Sha256: 983568b7846b9d3d068e3a1acb42fc3b13155b710520876688570f4e6da61396

Contents?: true

Size: 1.71 KB

Versions: 2

Compression:

Stored size: 1.71 KB

Contents

import { install } from "@github/hotkey";
import Alpine from "alpinejs";
import Fern from "@ryangjchandler/fern";
import AlpineTooltip from "@ryangjchandler/alpine-tooltip";
import AlpineClipboard from "@ryangjchandler/alpine-clipboard";
import Screen from "./utils/screen";
import split from "./utils/split";
import page from "./page";
import workbench from "./workbench";
import preview from "./workbench/preview";
import inspector from "./workbench/inspector";
import param from "./workbench/param";
import nav from "./nav";
import navNode from "./nav/node";
import navLeaf from "./nav/leaf";
import sizeObserver from "./utils/size_observer";
import reloader from "./utils/reloader";
import clipboard from "./utils/clipboard";

window.Alpine = Alpine;

// Plugins

Alpine.plugin(Fern);
Alpine.plugin(AlpineTooltip);
Alpine.plugin(AlpineClipboard);
Alpine.plugin(Screen);

// Stores

Alpine.store("page", {
  reflowing: false,
  doc: window.document,
});

Alpine.persistedStore("nav", {
  width: 280,
  filter: "",
  open: {},
});

Alpine.persistedStore("inspector", {
  height: 200,
  active: "source",
});

Alpine.persistedStore("preview", {
  width: "100%",
});

// Components & utils

Alpine.data("page", page);
Alpine.data("nav", nav);
Alpine.data("navNode", navNode);
Alpine.data("navLeaf", navLeaf);
Alpine.data("workbench", workbench);
Alpine.data("preview", preview);
Alpine.data("inspector", inspector);
Alpine.data("param", param);
Alpine.data("clipboard", clipboard);
Alpine.data("sizeObserver", sizeObserver);
Alpine.data("split", split);

// Init

for (const el of document.querySelectorAll("[data-hotkey]")) {
  install(el);
}

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

window.Alpine = Alpine;
Alpine.start();

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lookbook-0.4.6 app/assets/lookbook/js/app.js
lookbook-0.4.5 app/assets/lookbook/js/app.js