@molecule/app-bonds-default 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +478 -2
  3. package/dist/auth.d.ts +156 -0
  4. package/dist/auth.d.ts.map +1 -0
  5. package/dist/auth.js +258 -0
  6. package/dist/index.d.ts +116 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +115 -0
  9. package/dist/optional/charts-chartjs.d.ts +15 -0
  10. package/dist/optional/charts-chartjs.d.ts.map +1 -0
  11. package/dist/optional/charts-chartjs.js +20 -0
  12. package/dist/optional/client-search-minisearch.d.ts +12 -0
  13. package/dist/optional/client-search-minisearch.d.ts.map +1 -0
  14. package/dist/optional/client-search-minisearch.js +17 -0
  15. package/dist/optional/code-editor-monaco.d.ts +12 -0
  16. package/dist/optional/code-editor-monaco.d.ts.map +1 -0
  17. package/dist/optional/code-editor-monaco.js +17 -0
  18. package/dist/optional/command-palette-cmdk.d.ts +12 -0
  19. package/dist/optional/command-palette-cmdk.d.ts.map +1 -0
  20. package/dist/optional/command-palette-cmdk.js +17 -0
  21. package/dist/optional/drag-drop-dndkit.d.ts +12 -0
  22. package/dist/optional/drag-drop-dndkit.d.ts.map +1 -0
  23. package/dist/optional/drag-drop-dndkit.js +17 -0
  24. package/dist/optional/keyboard-shortcuts-hotkeys.d.ts +12 -0
  25. package/dist/optional/keyboard-shortcuts-hotkeys.d.ts.map +1 -0
  26. package/dist/optional/keyboard-shortcuts-hotkeys.js +17 -0
  27. package/dist/optional/maps-leaflet.d.ts +19 -0
  28. package/dist/optional/maps-leaflet.d.ts.map +1 -0
  29. package/dist/optional/maps-leaflet.js +24 -0
  30. package/dist/optional/realtime-socketio.d.ts +24 -0
  31. package/dist/optional/realtime-socketio.d.ts.map +1 -0
  32. package/dist/optional/realtime-socketio.js +29 -0
  33. package/dist/optional/video-hls.d.ts +12 -0
  34. package/dist/optional/video-hls.d.ts.map +1 -0
  35. package/dist/optional/video-hls.js +17 -0
  36. package/dist/optional/virtual-scroll-tanstack.d.ts +12 -0
  37. package/dist/optional/virtual-scroll-tanstack.d.ts.map +1 -0
  38. package/dist/optional/virtual-scroll-tanstack.js +17 -0
  39. package/dist/setup.d.ts +65 -0
  40. package/dist/setup.d.ts.map +1 -0
  41. package/dist/setup.js +113 -0
  42. package/package.json +178 -4
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-charts` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /**
11
+ * Wires `@molecule/app-charts-chartjs` (Chart.js) to `@molecule/app-charts` — real
12
+ * line/bar/pie/etc. charts instead of the core's placeholder panel.
13
+ */
14
+ export declare function setupAppChartsChartjs(): Promise<void>;
15
+ //# sourceMappingURL=charts-chartjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charts-chartjs.d.ts","sourceRoot":"","sources":["../../src/optional/charts-chartjs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM3D"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-charts` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /**
11
+ * Wires `@molecule/app-charts-chartjs` (Chart.js) to `@molecule/app-charts` — real
12
+ * line/bar/pie/etc. charts instead of the core's placeholder panel.
13
+ */
14
+ export async function setupAppChartsChartjs() {
15
+ const [{ setProvider: setCharts }, { provider }] = await Promise.all([
16
+ import('@molecule/app-charts'),
17
+ import('@molecule/app-charts-chartjs'),
18
+ ]);
19
+ setCharts(provider);
20
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-client-search` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-client-search-minisearch` to `@molecule/app-client-search`. */
11
+ export declare function setupAppClientSearchMinisearch(): Promise<void>;
12
+ //# sourceMappingURL=client-search-minisearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-search-minisearch.d.ts","sourceRoot":"","sources":["../../src/optional/client-search-minisearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uFAAuF;AACvF,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMpE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-client-search` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-client-search-minisearch` to `@molecule/app-client-search`. */
11
+ export async function setupAppClientSearchMinisearch() {
12
+ const [{ setProvider: setSearch }, { provider }] = await Promise.all([
13
+ import('@molecule/app-client-search'),
14
+ import('@molecule/app-client-search-minisearch'),
15
+ ]);
16
+ setSearch(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-code-editor` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-code-editor-monaco` to `@molecule/app-code-editor`. */
11
+ export declare function setupAppCodeEditorMonaco(): Promise<void>;
12
+ //# sourceMappingURL=code-editor-monaco.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-editor-monaco.d.ts","sourceRoot":"","sources":["../../src/optional/code-editor-monaco.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+EAA+E;AAC/E,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM9D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-code-editor` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-code-editor-monaco` to `@molecule/app-code-editor`. */
11
+ export async function setupAppCodeEditorMonaco() {
12
+ const [{ setProvider: setEditor }, { provider }] = await Promise.all([
13
+ import('@molecule/app-code-editor'),
14
+ import('@molecule/app-code-editor-monaco'),
15
+ ]);
16
+ setEditor(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-command-palette` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-command-palette-cmdk` to `@molecule/app-command-palette`. */
11
+ export declare function setupAppCommandPaletteCmdk(): Promise<void>;
12
+ //# sourceMappingURL=command-palette-cmdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-palette-cmdk.d.ts","sourceRoot":"","sources":["../../src/optional/command-palette-cmdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qFAAqF;AACrF,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMhE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-command-palette` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-command-palette-cmdk` to `@molecule/app-command-palette`. */
11
+ export async function setupAppCommandPaletteCmdk() {
12
+ const [{ setProvider: setPalette }, { provider }] = await Promise.all([
13
+ import('@molecule/app-command-palette'),
14
+ import('@molecule/app-command-palette-cmdk'),
15
+ ]);
16
+ setPalette(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-drag-drop` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-drag-drop-dndkit` to `@molecule/app-drag-drop`. */
11
+ export declare function setupAppDragDropDndkit(): Promise<void>;
12
+ //# sourceMappingURL=drag-drop-dndkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drag-drop-dndkit.d.ts","sourceRoot":"","sources":["../../src/optional/drag-drop-dndkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2EAA2E;AAC3E,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM5D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-drag-drop` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-drag-drop-dndkit` to `@molecule/app-drag-drop`. */
11
+ export async function setupAppDragDropDndkit() {
12
+ const [{ setProvider: setDnd }, { provider }] = await Promise.all([
13
+ import('@molecule/app-drag-drop'),
14
+ import('@molecule/app-drag-drop-dndkit'),
15
+ ]);
16
+ setDnd(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-keyboard-shortcuts` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-keyboard-shortcuts-hotkeys` to `@molecule/app-keyboard-shortcuts`. */
11
+ export declare function setupAppKeyboardShortcutsHotkeys(): Promise<void>;
12
+ //# sourceMappingURL=keyboard-shortcuts-hotkeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard-shortcuts-hotkeys.d.ts","sourceRoot":"","sources":["../../src/optional/keyboard-shortcuts-hotkeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8FAA8F;AAC9F,wBAAsB,gCAAgC,IAAI,OAAO,CAAC,IAAI,CAAC,CAMtE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-keyboard-shortcuts` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-keyboard-shortcuts-hotkeys` to `@molecule/app-keyboard-shortcuts`. */
11
+ export async function setupAppKeyboardShortcutsHotkeys() {
12
+ const [{ setProvider: setKbd }, { provider }] = await Promise.all([
13
+ import('@molecule/app-keyboard-shortcuts'),
14
+ import('@molecule/app-keyboard-shortcuts-hotkeys'),
15
+ ]);
16
+ setKbd(provider);
17
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-maps` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale. `@molecule/app-maps` is the import that first exposed the problem:
7
+ * it is the alphabetically-first unresolvable provider, so it is the one Rolldown
8
+ * named while the other 14 were equally broken.
9
+ *
10
+ * @module
11
+ */
12
+ /**
13
+ * Wires `@molecule/app-maps-leaflet` (Leaflet + OpenStreetMap, no API key) to
14
+ * `@molecule/app-maps` — a real slippy map instead of the core's grey placeholder.
15
+ * REQUIRES `import 'leaflet/dist/leaflet.css'` once in the app entry (the scaffolded
16
+ * `bonds/app-maps-leaflet.ts` does this); without it tiles + markers mis-position.
17
+ */
18
+ export declare function setupAppMapsLeaflet(): Promise<void>;
19
+ //# sourceMappingURL=maps-leaflet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maps-leaflet.d.ts","sourceRoot":"","sources":["../../src/optional/maps-leaflet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAMzD"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-maps` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale. `@molecule/app-maps` is the import that first exposed the problem:
7
+ * it is the alphabetically-first unresolvable provider, so it is the one Rolldown
8
+ * named while the other 14 were equally broken.
9
+ *
10
+ * @module
11
+ */
12
+ /**
13
+ * Wires `@molecule/app-maps-leaflet` (Leaflet + OpenStreetMap, no API key) to
14
+ * `@molecule/app-maps` — a real slippy map instead of the core's grey placeholder.
15
+ * REQUIRES `import 'leaflet/dist/leaflet.css'` once in the app entry (the scaffolded
16
+ * `bonds/app-maps-leaflet.ts` does this); without it tiles + markers mis-position.
17
+ */
18
+ export async function setupAppMapsLeaflet() {
19
+ const [{ setProvider: setMaps }, { provider }] = await Promise.all([
20
+ import('@molecule/app-maps'),
21
+ import('@molecule/app-maps-leaflet'),
22
+ ]);
23
+ setMaps(provider);
24
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-realtime` bond.
3
+ *
4
+ * Lives in its own module, reachable only via the
5
+ * `@molecule/app-bonds-default/optional/realtime-socketio.js` subpath, because
6
+ * a bundler must RESOLVE every `import()` in a module it pulls into the graph —
7
+ * before tree-shaking can drop anything. While these wirings sat in `setup.ts`
8
+ * (re-exported from the barrel), importing `bootstrapApp` dragged all 18 optional
9
+ * providers into the graph, and any app that had not installed all of them failed
10
+ * to build:
11
+ *
12
+ * ```
13
+ * [vite]: Rolldown failed to resolve import "@molecule/app-maps"
14
+ * from ".../app-bonds-default/dist/setup.js"
15
+ * ```
16
+ *
17
+ * One module per provider pair means an app pays for exactly the providers it
18
+ * imports — which is what made them optional in the first place.
19
+ *
20
+ * @module
21
+ */
22
+ /** Wires `@molecule/app-realtime-socketio` to `@molecule/app-realtime`. */
23
+ export declare function setupAppRealtimeSocketio(): Promise<void>;
24
+ //# sourceMappingURL=realtime-socketio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime-socketio.d.ts","sourceRoot":"","sources":["../../src/optional/realtime-socketio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,2EAA2E;AAC3E,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM9D"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-realtime` bond.
3
+ *
4
+ * Lives in its own module, reachable only via the
5
+ * `@molecule/app-bonds-default/optional/realtime-socketio.js` subpath, because
6
+ * a bundler must RESOLVE every `import()` in a module it pulls into the graph —
7
+ * before tree-shaking can drop anything. While these wirings sat in `setup.ts`
8
+ * (re-exported from the barrel), importing `bootstrapApp` dragged all 18 optional
9
+ * providers into the graph, and any app that had not installed all of them failed
10
+ * to build:
11
+ *
12
+ * ```
13
+ * [vite]: Rolldown failed to resolve import "@molecule/app-maps"
14
+ * from ".../app-bonds-default/dist/setup.js"
15
+ * ```
16
+ *
17
+ * One module per provider pair means an app pays for exactly the providers it
18
+ * imports — which is what made them optional in the first place.
19
+ *
20
+ * @module
21
+ */
22
+ /** Wires `@molecule/app-realtime-socketio` to `@molecule/app-realtime`. */
23
+ export async function setupAppRealtimeSocketio() {
24
+ const [{ setProvider: setRealtime }, { provider }] = await Promise.all([
25
+ import('@molecule/app-realtime'),
26
+ import('@molecule/app-realtime-socketio'),
27
+ ]);
28
+ setRealtime(provider);
29
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-video` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-video-hls` (hls.js — HLS streaming everywhere) to `@molecule/app-video`. */
11
+ export declare function setupAppVideoHls(): Promise<void>;
12
+ //# sourceMappingURL=video-hls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-hls.d.ts","sourceRoot":"","sources":["../../src/optional/video-hls.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oGAAoG;AACpG,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAMtD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-video` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-video-hls` (hls.js — HLS streaming everywhere) to `@molecule/app-video`. */
11
+ export async function setupAppVideoHls() {
12
+ const [{ setProvider: setVideo }, { provider }] = await Promise.all([
13
+ import('@molecule/app-video'),
14
+ import('@molecule/app-video-hls'),
15
+ ]);
16
+ setVideo(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-virtual-scroll` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-virtual-scroll-tanstack` to `@molecule/app-virtual-scroll`. */
11
+ export declare function setupAppVirtualScrollTanstack(): Promise<void>;
12
+ //# sourceMappingURL=virtual-scroll-tanstack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-scroll-tanstack.d.ts","sourceRoot":"","sources":["../../src/optional/virtual-scroll-tanstack.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uFAAuF;AACvF,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMnE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-virtual-scroll` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-virtual-scroll-tanstack` to `@molecule/app-virtual-scroll`. */
11
+ export async function setupAppVirtualScrollTanstack() {
12
+ const [{ setProvider: setScroll }, { provider }] = await Promise.all([
13
+ import('@molecule/app-virtual-scroll'),
14
+ import('@molecule/app-virtual-scroll-tanstack'),
15
+ ]);
16
+ setScroll(provider);
17
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Framework-neutral default app-side bond wirings (state + Tailwind ClassMap +
3
+ * localStorage + Arimo font + Molecule icons + CSS-variables theme + web
4
+ * clipboard).
5
+ *
6
+ * Centralizes the byte-identical `app/src/bonds/<name>.ts` setup functions that
7
+ * every flagship app shipped. Per-app bond files become 1-line re-exports —
8
+ * `bonds/index.ts` import sites unchanged.
9
+ *
10
+ * Each framework package (`@molecule/app-bonds-default-react`, `-vue`,
11
+ * `-solid`, `-svelte`, `-angular`) re-exports every setup here and adds its own
12
+ * `setupAppRouting<Router>()` plus a `setupAllDefaultBonds()` that wires these
13
+ * in one call. Only routing is framework-specific; everything in this module
14
+ * runs under any renderer.
15
+ *
16
+ * `setupAppStylingTailwind` registers `tailwind-merge` as the class merger
17
+ * for `cn()`; Tailwind itself is configured via env vars and the Vite plugin.
18
+ * Apps wire it in `setupProviders()` alongside the others.
19
+ *
20
+ * @module
21
+ */
22
+ import { createCSSVariablesThemeProvider } from '@molecule/app-theme-css-variables';
23
+ /** Returns (and lazily constructs) the shared default CSS-variables theme provider. */
24
+ export declare function getDefaultThemeProvider(): ReturnType<typeof createCSSVariablesThemeProvider>;
25
+ /**
26
+ * Wires `@molecule/app-clipboard-web` to `@molecule/app-clipboard`: the browser's
27
+ * Clipboard API, falling back to a selection-and-copy where that API is missing
28
+ * or refuses (a plain-HTTP page, an iframe without the clipboard-write
29
+ * permission, a document that lost focus).
30
+ *
31
+ * WITHOUT this, `writeText()` throws "No provider set" and
32
+ * `copyTextWithFallback()` only tries the legacy copy command, so a copy button
33
+ * built on them works in fewer places than a raw `navigator.clipboard` call.
34
+ */
35
+ export declare function setupAppClipboardWeb(): void;
36
+ /** Wires `@molecule/app-fonts-arimo` to `@molecule/app-fonts`. */
37
+ export declare function setupAppFontsArimo(): void;
38
+ /** Wires `@molecule/app-icons-molecule` to `@molecule/app-icons`. */
39
+ export declare function setupAppIconsMolecule(): void;
40
+ /**
41
+ * Wires the framework-agnostic `simpleProvider` from `@molecule/app-state` as
42
+ * the active state provider.
43
+ *
44
+ * WITHOUT this, `createStore()` throws
45
+ * `@molecule/app-state: No provider set. Call setProvider() first` — nothing
46
+ * else in a scaffolded app wires the `state` bond, so the documented
47
+ * `createStore()` + `useStore()` pattern failed at the first render and every
48
+ * page came up blank while `tsc` passed.
49
+ */
50
+ export declare function setupAppStateSimple(): void;
51
+ /** Wires `@molecule/app-storage-localstorage` to `@molecule/app-storage`. */
52
+ export declare function setupAppStorageLocalstorage(): void;
53
+ /**
54
+ * Wires `@molecule/app-styling-tailwind`: registers `tailwind-merge` as the
55
+ * class merger for `@molecule/app-styling`'s `cn()`, so conflicting Tailwind
56
+ * utilities resolve (last wins). Tailwind itself is configured via env vars +
57
+ * the Vite plugin; this is the one runtime hook the framework-agnostic styling
58
+ * core needs so it carries no Tailwind dependency of its own.
59
+ */
60
+ export declare function setupAppStylingTailwind(): void;
61
+ /** Wires the default light + dark CSS-variables theme provider to `@molecule/app-theme`. */
62
+ export declare function setupAppThemeCssVariables(): void;
63
+ /** Wires `@molecule/app-ui-tailwind` `classMap` to `@molecule/app-ui`. */
64
+ export declare function setupAppUiTailwind(): void;
65
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAgBH,OAAO,EACL,+BAA+B,EAGhC,MAAM,mCAAmC,CAAA;AAe1C,uFAAuF;AACvF,wBAAgB,uBAAuB,IAAI,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAS5F;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED,6EAA6E;AAC7E,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,4FAA4F;AAC5F,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
package/dist/setup.js ADDED
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Framework-neutral default app-side bond wirings (state + Tailwind ClassMap +
3
+ * localStorage + Arimo font + Molecule icons + CSS-variables theme + web
4
+ * clipboard).
5
+ *
6
+ * Centralizes the byte-identical `app/src/bonds/<name>.ts` setup functions that
7
+ * every flagship app shipped. Per-app bond files become 1-line re-exports —
8
+ * `bonds/index.ts` import sites unchanged.
9
+ *
10
+ * Each framework package (`@molecule/app-bonds-default-react`, `-vue`,
11
+ * `-solid`, `-svelte`, `-angular`) re-exports every setup here and adds its own
12
+ * `setupAppRouting<Router>()` plus a `setupAllDefaultBonds()` that wires these
13
+ * in one call. Only routing is framework-specific; everything in this module
14
+ * runs under any renderer.
15
+ *
16
+ * `setupAppStylingTailwind` registers `tailwind-merge` as the class merger
17
+ * for `cn()`; Tailwind itself is configured via env vars and the Vite plugin.
18
+ * Apps wire it in `setupProviders()` alongside the others.
19
+ *
20
+ * @module
21
+ */
22
+ import { setProvider as setClipboard } from '@molecule/app-clipboard';
23
+ import { provider as webClipboardProvider } from '@molecule/app-clipboard-web';
24
+ import { setFont } from '@molecule/app-fonts';
25
+ import { font as arimoFont } from '@molecule/app-fonts-arimo';
26
+ import { setIconSet } from '@molecule/app-icons';
27
+ import { iconSet as moleculeIconSet } from '@molecule/app-icons-molecule';
28
+ import { setProvider as setState, simpleProvider as defaultStateProvider, } from '@molecule/app-state';
29
+ import { setProvider as setStorage } from '@molecule/app-storage';
30
+ import { provider as localStorageProvider } from '@molecule/app-storage-localstorage';
31
+ import { registerTailwindClassMerger } from '@molecule/app-styling-tailwind';
32
+ import { setProvider as setTheme } from '@molecule/app-theme';
33
+ import { createCSSVariablesThemeProvider, darkTheme, lightTheme, } from '@molecule/app-theme-css-variables';
34
+ import { setClassMap } from '@molecule/app-ui';
35
+ import { classMap } from '@molecule/app-ui-tailwind';
36
+ /**
37
+ * Pre-wired default CSS-variables theme provider with light + dark
38
+ * themes from `@molecule/app-theme-css-variables`. Apps that need
39
+ * custom themes should build their own provider and skip this.
40
+ *
41
+ * Lazily constructed on first access — `createCSSVariablesThemeProvider`
42
+ * touches `globalThis.localStorage.getItem` during construction, which
43
+ * throws in non-DOM environments (SSR, unit-test runners with
44
+ * incomplete localStorage shims).
45
+ */
46
+ let _defaultThemeProvider = null;
47
+ /** Returns (and lazily constructs) the shared default CSS-variables theme provider. */
48
+ export function getDefaultThemeProvider() {
49
+ if (!_defaultThemeProvider) {
50
+ _defaultThemeProvider = createCSSVariablesThemeProvider({
51
+ themes: [lightTheme, darkTheme],
52
+ defaultTheme: 'light',
53
+ persistKey: 'molecule-theme',
54
+ });
55
+ }
56
+ return _defaultThemeProvider;
57
+ }
58
+ /**
59
+ * Wires `@molecule/app-clipboard-web` to `@molecule/app-clipboard`: the browser's
60
+ * Clipboard API, falling back to a selection-and-copy where that API is missing
61
+ * or refuses (a plain-HTTP page, an iframe without the clipboard-write
62
+ * permission, a document that lost focus).
63
+ *
64
+ * WITHOUT this, `writeText()` throws "No provider set" and
65
+ * `copyTextWithFallback()` only tries the legacy copy command, so a copy button
66
+ * built on them works in fewer places than a raw `navigator.clipboard` call.
67
+ */
68
+ export function setupAppClipboardWeb() {
69
+ setClipboard(webClipboardProvider);
70
+ }
71
+ /** Wires `@molecule/app-fonts-arimo` to `@molecule/app-fonts`. */
72
+ export function setupAppFontsArimo() {
73
+ setFont(arimoFont);
74
+ }
75
+ /** Wires `@molecule/app-icons-molecule` to `@molecule/app-icons`. */
76
+ export function setupAppIconsMolecule() {
77
+ setIconSet(moleculeIconSet);
78
+ }
79
+ /**
80
+ * Wires the framework-agnostic `simpleProvider` from `@molecule/app-state` as
81
+ * the active state provider.
82
+ *
83
+ * WITHOUT this, `createStore()` throws
84
+ * `@molecule/app-state: No provider set. Call setProvider() first` — nothing
85
+ * else in a scaffolded app wires the `state` bond, so the documented
86
+ * `createStore()` + `useStore()` pattern failed at the first render and every
87
+ * page came up blank while `tsc` passed.
88
+ */
89
+ export function setupAppStateSimple() {
90
+ setState(defaultStateProvider);
91
+ }
92
+ /** Wires `@molecule/app-storage-localstorage` to `@molecule/app-storage`. */
93
+ export function setupAppStorageLocalstorage() {
94
+ setStorage(localStorageProvider);
95
+ }
96
+ /**
97
+ * Wires `@molecule/app-styling-tailwind`: registers `tailwind-merge` as the
98
+ * class merger for `@molecule/app-styling`'s `cn()`, so conflicting Tailwind
99
+ * utilities resolve (last wins). Tailwind itself is configured via env vars +
100
+ * the Vite plugin; this is the one runtime hook the framework-agnostic styling
101
+ * core needs so it carries no Tailwind dependency of its own.
102
+ */
103
+ export function setupAppStylingTailwind() {
104
+ registerTailwindClassMerger();
105
+ }
106
+ /** Wires the default light + dark CSS-variables theme provider to `@molecule/app-theme`. */
107
+ export function setupAppThemeCssVariables() {
108
+ setTheme(getDefaultThemeProvider());
109
+ }
110
+ /** Wires `@molecule/app-ui-tailwind` `classMap` to `@molecule/app-ui`. */
111
+ export function setupAppUiTailwind() {
112
+ setClassMap(classMap);
113
+ }