Sha256: 288028382a7c93629df58224a02d53030ec167254ba00c320027873665ddfd1b

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

import Alpine from "alpinejs";
import Fern from "@ryangjchandler/fern";
import Tooltip from "@ryangjchandler/alpine-tooltip";
import Clipboard from "@ryangjchandler/alpine-clipboard";
import split from "./split";
import preview from "./preview";
import observeSize from "./size_observer";
import reloader from "./reloader";

// Plugins

Alpine.plugin(Fern);
Alpine.plugin(Tooltip);
Alpine.plugin(Clipboard);

// Data

Alpine.data("preview", preview);
Alpine.data("sizeObserver", observeSize);
Alpine.data("split", split);

// Stores

Alpine.store("app", { reflowing: false });
Alpine.persistedStore("nav", {
  width: 280,
  filter: "",
  open: {},
  scrollTop: 0,
  shouldDisplay(previewName) {
    const cleanFilter = this.filter.replace(/\s/g, "");
    return (
      cleanFilter === "" || previewName.includes(cleanFilter.toLowerCase())
    );
  },
});
Alpine.persistedStore("preview", {});
Alpine.persistedStore("inspector", {
  height: 200,
  active: "source",
});

// Init

window.Alpine = Alpine;
if (window.SOCKET_PATH) {
  reloader(window.SOCKET_PATH).start();
}
Alpine.start();

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lookbook-0.2.4 app/assets/lookbook/js/app.js
lookbook-0.2.3 app/assets/lookbook/js/app.js
lookbook-0.2.2 app/assets/lookbook/js/app.js