Sha256: aa7d56c95a9aecb75bd66cd3040605c3afa5720c8bb207a0c3486e88db7c5310

Contents?: true

Size: 1 KB

Versions: 9

Compression:

Stored size: 1 KB

Contents

import type { Application } from "@hotwired/stimulus";
import { ModalPresenter } from "./modal";
import { PopoverPresenter } from "./popover";
import RemoteNavigationController from "./controllers/remote-navigation";
import "./touch";

export { registerServiceWorker } from "./serviceworker";
export { currentLocale } from "./locale";

declare global {
  interface Window {
    ui?: {
      modal: ModalPresenter;
      popover: PopoverPresenter;
    };
  }
}

function createRemoteDestination(): void {
  if (document.getElementById("shimmer")) {
    return;
  }
  const root = document.createElement("div");
  root.id = "shimmer";
  document.body.append(root);
}

export async function start({
  application,
}: {
  application: Application;
}): Promise<void> {
  window.addEventListener("turbo:load", createRemoteDestination);
  createRemoteDestination();
  application.register("remote-navigation", RemoteNavigationController);
  window.ui = {
    modal: new ModalPresenter(),
    popover: new PopoverPresenter(),
  };
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shimmer-0.0.18 src/index.ts
shimmer-0.0.17 src/index.ts
shimmer-0.0.16 src/index.ts
shimmer-0.0.15 src/index.ts
shimmer-0.0.14 src/index.ts
shimmer-0.0.13 src/index.ts
shimmer-0.0.12 src/index.ts
shimmer-0.0.11 src/index.ts
shimmer-0.0.10 src/index.ts