@omerdlw/base-framework 1.0.0 → 1.0.2

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 (171) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +121 -52
  3. package/dist/atoms/index.d.ts +0 -1
  4. package/dist/atoms/index.d.ts.map +1 -1
  5. package/dist/atoms/index.js +1 -64
  6. package/dist/atoms/index.js.map +1 -1
  7. package/dist/error/index.js +22 -25
  8. package/dist/error/index.js.map +1 -1
  9. package/dist/hooks/index.d.ts +2 -9
  10. package/dist/hooks/index.d.ts.map +1 -1
  11. package/dist/hooks/index.js +97 -540
  12. package/dist/hooks/index.js.map +1 -1
  13. package/dist/hooks/types.d.ts +3 -45
  14. package/dist/hooks/types.d.ts.map +1 -1
  15. package/dist/hooks/use-controllable-state.d.ts +1 -1
  16. package/dist/hooks/use-controllable-state.d.ts.map +1 -1
  17. package/dist/hooks/use-global-event.d.ts +0 -2
  18. package/dist/hooks/use-global-event.d.ts.map +1 -1
  19. package/dist/hooks/use-hotkey.d.ts +1 -1
  20. package/dist/hooks/use-hotkey.d.ts.map +1 -1
  21. package/dist/index.js +11283 -11772
  22. package/dist/index.js.map +1 -1
  23. package/dist/kernel/adapters.d.ts.map +1 -1
  24. package/dist/kernel/index.d.ts +1 -0
  25. package/dist/kernel/index.d.ts.map +1 -1
  26. package/dist/kernel/index.js +10 -81
  27. package/dist/kernel/index.js.map +1 -1
  28. package/dist/kernel/installed.d.ts.map +1 -1
  29. package/dist/kernel/page-controller.d.ts.map +1 -1
  30. package/dist/kernel/provider.d.ts.map +1 -1
  31. package/dist/modules/ambient/constants.d.ts +1 -1
  32. package/dist/modules/ambient/constants.d.ts.map +1 -1
  33. package/dist/modules/ambient/index.js +180 -326
  34. package/dist/modules/ambient/index.js.map +1 -1
  35. package/dist/modules/ambient/module.d.ts.map +1 -1
  36. package/dist/modules/background/constants.d.ts +4 -2
  37. package/dist/modules/background/constants.d.ts.map +1 -1
  38. package/dist/modules/background/context.d.ts +3 -0
  39. package/dist/modules/background/context.d.ts.map +1 -1
  40. package/dist/modules/background/hooks.d.ts +1 -1
  41. package/dist/modules/background/index.d.ts +2 -2
  42. package/dist/modules/background/index.d.ts.map +1 -1
  43. package/dist/modules/background/index.js +1172 -1270
  44. package/dist/modules/background/index.js.map +1 -1
  45. package/dist/modules/background/overlay.d.ts +1 -1
  46. package/dist/modules/background/overlay.d.ts.map +1 -1
  47. package/dist/modules/background/types.d.ts +1 -1
  48. package/dist/modules/background/types.d.ts.map +1 -1
  49. package/dist/modules/context-menu/constants.d.ts +1 -1
  50. package/dist/modules/context-menu/constants.d.ts.map +1 -1
  51. package/dist/modules/context-menu/context.d.ts.map +1 -1
  52. package/dist/modules/context-menu/hooks.d.ts.map +1 -1
  53. package/dist/modules/context-menu/index.js +133 -238
  54. package/dist/modules/context-menu/index.js.map +1 -1
  55. package/dist/modules/controls/constants.d.ts +1 -1
  56. package/dist/modules/controls/constants.d.ts.map +1 -1
  57. package/dist/modules/controls/hooks.d.ts +1 -1
  58. package/dist/modules/controls/index.js +28 -162
  59. package/dist/modules/controls/index.js.map +1 -1
  60. package/dist/modules/controls/types.d.ts +1 -1
  61. package/dist/modules/controls/types.d.ts.map +1 -1
  62. package/dist/modules/dock/cards.d.ts +2 -2
  63. package/dist/modules/dock/constants.d.ts +1 -1
  64. package/dist/modules/dock/constants.d.ts.map +1 -1
  65. package/dist/modules/dock/context.d.ts +10 -6
  66. package/dist/modules/dock/context.d.ts.map +1 -1
  67. package/dist/modules/dock/hooks.d.ts +5 -5
  68. package/dist/modules/dock/hooks.d.ts.map +1 -1
  69. package/dist/modules/dock/index.d.ts +1 -1
  70. package/dist/modules/dock/index.d.ts.map +1 -1
  71. package/dist/modules/dock/index.js +2060 -2080
  72. package/dist/modules/dock/index.js.map +1 -1
  73. package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
  74. package/dist/modules/dock/types.d.ts +1 -1
  75. package/dist/modules/dock/types.d.ts.map +1 -1
  76. package/dist/modules/index.js +10789 -11027
  77. package/dist/modules/index.js.map +1 -1
  78. package/dist/modules/loading/constants.d.ts +4 -2
  79. package/dist/modules/loading/constants.d.ts.map +1 -1
  80. package/dist/modules/loading/context.d.ts +3 -0
  81. package/dist/modules/loading/context.d.ts.map +1 -1
  82. package/dist/modules/loading/hooks.d.ts +1 -1
  83. package/dist/modules/loading/hooks.d.ts.map +1 -1
  84. package/dist/modules/loading/index.d.ts +2 -2
  85. package/dist/modules/loading/index.d.ts.map +1 -1
  86. package/dist/modules/loading/index.js +118 -222
  87. package/dist/modules/loading/index.js.map +1 -1
  88. package/dist/modules/loading/types.d.ts +1 -1
  89. package/dist/modules/loading/types.d.ts.map +1 -1
  90. package/dist/modules/media/constants.d.ts +2 -1
  91. package/dist/modules/media/constants.d.ts.map +1 -1
  92. package/dist/modules/media/context.d.ts +3 -0
  93. package/dist/modules/media/context.d.ts.map +1 -1
  94. package/dist/modules/media/index.d.ts +2 -2
  95. package/dist/modules/media/index.d.ts.map +1 -1
  96. package/dist/modules/media/index.js +61 -218
  97. package/dist/modules/media/index.js.map +1 -1
  98. package/dist/modules/modal/constants.d.ts +1 -1
  99. package/dist/modules/modal/constants.d.ts.map +1 -1
  100. package/dist/modules/modal/context.d.ts.map +1 -1
  101. package/dist/modules/modal/hooks.d.ts +2 -2
  102. package/dist/modules/modal/index.js +20 -366
  103. package/dist/modules/modal/index.js.map +1 -1
  104. package/dist/modules/notification/constants.d.ts +4 -2
  105. package/dist/modules/notification/constants.d.ts.map +1 -1
  106. package/dist/modules/notification/context.d.ts +4 -0
  107. package/dist/modules/notification/context.d.ts.map +1 -1
  108. package/dist/modules/notification/hooks.d.ts +1 -1
  109. package/dist/modules/notification/index.d.ts +2 -3
  110. package/dist/modules/notification/index.d.ts.map +1 -1
  111. package/dist/modules/notification/index.js +70 -154
  112. package/dist/modules/notification/index.js.map +1 -1
  113. package/dist/modules/notification/module.d.ts.map +1 -1
  114. package/dist/provider.js +255 -257
  115. package/dist/provider.js.map +1 -1
  116. package/dist/theme.d.ts +1 -0
  117. package/dist/theme.d.ts.map +1 -1
  118. package/dist/theme.js +2 -2
  119. package/dist/theme.js.map +1 -1
  120. package/dist/utils/index.d.ts +5 -6
  121. package/dist/utils/index.d.ts.map +1 -1
  122. package/dist/utils/index.js +1 -57
  123. package/dist/utils/index.js.map +1 -1
  124. package/dist/utils/number.d.ts +0 -1
  125. package/dist/utils/number.d.ts.map +1 -1
  126. package/dist/utils/object.d.ts +0 -2
  127. package/dist/utils/object.d.ts.map +1 -1
  128. package/dist/utils/string.d.ts +0 -3
  129. package/dist/utils/string.d.ts.map +1 -1
  130. package/dist/utils/timing.d.ts +0 -1
  131. package/dist/utils/timing.d.ts.map +1 -1
  132. package/docs/README.md +124 -0
  133. package/docs/architecture-and-rules.md +129 -0
  134. package/docs/core-engine.md +196 -0
  135. package/docs/custom-modules.md +267 -0
  136. package/docs/getting-started.md +199 -0
  137. package/docs/modules/README.md +176 -0
  138. package/docs/modules/ambient.md +150 -0
  139. package/docs/modules/background.md +195 -0
  140. package/docs/modules/context-menu.md +248 -0
  141. package/docs/modules/controls.md +159 -0
  142. package/docs/modules/dock.md +734 -0
  143. package/docs/modules/error-boundary.md +160 -0
  144. package/docs/modules/kernel.md +266 -0
  145. package/docs/modules/loading.md +157 -0
  146. package/docs/modules/media.md +196 -0
  147. package/docs/modules/modal.md +229 -0
  148. package/docs/modules/notification.md +161 -0
  149. package/docs/modules/result.md +135 -0
  150. package/docs/testing.md +160 -0
  151. package/docs/theming.md +185 -0
  152. package/package.json +50 -2
  153. package/templates/AGENTS.md +165 -0
  154. package/dist/hooks/use-async-action.d.ts +0 -3
  155. package/dist/hooks/use-async-action.d.ts.map +0 -1
  156. package/dist/hooks/use-debounce.d.ts +0 -2
  157. package/dist/hooks/use-debounce.d.ts.map +0 -1
  158. package/dist/hooks/use-intersection-observer.d.ts +0 -4
  159. package/dist/hooks/use-intersection-observer.d.ts.map +0 -1
  160. package/dist/hooks/use-media-query.d.ts +0 -2
  161. package/dist/hooks/use-media-query.d.ts.map +0 -1
  162. package/dist/hooks/use-mounted.d.ts +0 -2
  163. package/dist/hooks/use-mounted.d.ts.map +0 -1
  164. package/dist/hooks/use-server-action.d.ts +0 -4
  165. package/dist/hooks/use-server-action.d.ts.map +0 -1
  166. package/dist/hooks/use-storage-state.d.ts +0 -5
  167. package/dist/hooks/use-storage-state.d.ts.map +0 -1
  168. package/dist/modules/theme.d.ts +0 -3
  169. package/dist/modules/theme.d.ts.map +0 -1
  170. package/dist/utils/json.d.ts +0 -3
  171. package/dist/utils/json.d.ts.map +0 -1
@@ -1,10 +1,9 @@
1
1
  "use client";
2
2
  import { Icon as Icon$1 } from '@iconify-icon/react';
3
3
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
- import '@radix-ui/react-tooltip';
5
- import { useState, useRef, useCallback, useMemo, use, useSyncExternalStore, createContext, useLayoutEffect, useEffect, createElement, useInsertionEffect, useId, useContext, isValidElement, cloneElement, Children } from 'react';
6
4
  import { clsx } from 'clsx';
7
5
  import { twMerge } from 'tailwind-merge';
6
+ import { useState, useRef, useCallback, useMemo, use, useSyncExternalStore, createContext, useLayoutEffect, useEffect, createElement, useInsertionEffect, useId, useContext, isValidElement, cloneElement, Children } from 'react';
8
7
  import { usePathname } from 'next/navigation';
9
8
  import { motion, AnimatePresence } from 'motion/react';
10
9
  import { createPortal } from 'react-dom';
@@ -47,17 +46,6 @@ var init_icon = __esm({
47
46
  Icon.displayName = "Icon";
48
47
  }
49
48
  });
50
- var init_spinner = __esm({
51
- "src/atoms/spinner.tsx"() {
52
- "use client";
53
- init_icon();
54
- }
55
- });
56
- var init_tooltip = __esm({
57
- "src/atoms/tooltip.tsx"() {
58
- "use client";
59
- }
60
- });
61
49
  function Button({
62
50
  ref,
63
51
  children,
@@ -86,21 +74,13 @@ var init_button = __esm({
86
74
  Button.displayName = "Button";
87
75
  }
88
76
  });
89
- var init_use_fullscreen_state = __esm({
90
- "src/hooks/use-fullscreen-state.ts"() {
91
- "use client";
92
- }
93
- });
94
77
 
95
78
  // src/atoms/index.ts
96
79
  var init_atoms = __esm({
97
80
  "src/atoms/index.ts"() {
98
81
  "use client";
99
82
  init_icon();
100
- init_spinner();
101
- init_tooltip();
102
83
  init_button();
103
- init_use_fullscreen_state();
104
84
  }
105
85
  });
106
86
 
@@ -255,19 +235,12 @@ function acquireGlobalScrollLock() {
255
235
  var isBrowser, globalScrollLockCount, globalScrollLockStyles;
256
236
  var init_dom = __esm({
257
237
  "src/utils/dom.ts"() {
258
- init_string();
259
238
  isBrowser = typeof window !== "undefined";
260
239
  globalScrollLockCount = 0;
261
240
  globalScrollLockStyles = null;
262
241
  }
263
242
  });
264
243
 
265
- // src/utils/number.ts
266
- var init_number = __esm({
267
- "src/utils/number.ts"() {
268
- }
269
- });
270
-
271
244
  // src/utils/object.ts
272
245
  function isObject(value) {
273
246
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
@@ -282,18 +255,6 @@ var init_object = __esm({
282
255
  }
283
256
  });
284
257
 
285
- // src/utils/timing.ts
286
- var init_timing = __esm({
287
- "src/utils/timing.ts"() {
288
- }
289
- });
290
-
291
- // src/utils/json.ts
292
- var init_json = __esm({
293
- "src/utils/json.ts"() {
294
- }
295
- });
296
-
297
258
  // src/utils/report.ts
298
259
  function report(scope, error, level = "error") {
299
260
  if (sink) {
@@ -314,10 +275,6 @@ var init_report = __esm({
314
275
  sink = null;
315
276
  }
316
277
  });
317
- var init_user_message = __esm({
318
- "src/utils/user-message.ts"() {
319
- }
320
- });
321
278
 
322
279
  // src/utils/store.ts
323
280
  function freezeStoreSnapshot(state) {
@@ -387,11 +344,6 @@ var init_store = __esm({
387
344
  init_report();
388
345
  }
389
346
  });
390
- var init_scheduler = __esm({
391
- "src/utils/scheduler.ts"() {
392
- init_report();
393
- }
394
- });
395
347
 
396
348
  // src/utils/index.ts
397
349
  var init_utils = __esm({
@@ -399,14 +351,9 @@ var init_utils = __esm({
399
351
  init_cn();
400
352
  init_dom();
401
353
  init_string();
402
- init_number();
403
354
  init_object();
404
- init_timing();
405
- init_json();
406
355
  init_report();
407
- init_user_message();
408
356
  init_store();
409
- init_scheduler();
410
357
  }
411
358
  });
412
359
 
@@ -472,6 +419,18 @@ var init_constants = __esm({
472
419
  REGISTRY_SCOPE_KINDS.APP;
473
420
  }
474
421
  });
422
+ function getOrCreateGlobalContext(name, defaultValue) {
423
+ const sym = /* @__PURE__ */ Symbol.for(`@omerdlw/base-framework/context/${name}`);
424
+ const store = globalThis;
425
+ if (!store[sym]) {
426
+ store[sym] = createContext(defaultValue);
427
+ }
428
+ return store[sym];
429
+ }
430
+ var init_context_registry = __esm({
431
+ "src/kernel/context-registry.ts"() {
432
+ }
433
+ });
475
434
 
476
435
  // src/kernel/utils.ts
477
436
  function parseFiniteNumber(value) {
@@ -483,7 +442,6 @@ function getValidString(value, fallback = null) {
483
442
  }
484
443
  var init_utils2 = __esm({
485
444
  "src/kernel/utils.ts"() {
486
- init_constants();
487
445
  init_utils();
488
446
  }
489
447
  });
@@ -583,15 +541,6 @@ var init_schema = __esm({
583
541
  init_utils2();
584
542
  }
585
543
  });
586
-
587
- // src/kernel/operations.ts
588
- var init_operations = __esm({
589
- "src/kernel/operations.ts"() {
590
- init_constants();
591
- init_utils2();
592
- init_schema();
593
- }
594
- });
595
544
  function useRequiredContext(context, hookName, providerName) {
596
545
  const value = use(context);
597
546
  if (value === null) {
@@ -642,11 +591,6 @@ var init_use_store = __esm({
642
591
  "use client";
643
592
  }
644
593
  });
645
- var init_use_click_outside = __esm({
646
- "src/hooks/use-click-outside.ts"() {
647
- "use client";
648
- }
649
- });
650
594
  var useIsomorphicLayoutEffect;
651
595
  var init_use_isomorphic_layout_effect = __esm({
652
596
  "src/hooks/use-isomorphic-layout-effect.ts"() {
@@ -655,157 +599,6 @@ var init_use_isomorphic_layout_effect = __esm({
655
599
  useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
656
600
  }
657
601
  });
658
- var init_use_debounce = __esm({
659
- "src/hooks/use-debounce.ts"() {
660
- "use client";
661
- }
662
- });
663
- var init_use_mounted = __esm({
664
- "src/hooks/use-mounted.ts"() {
665
- "use client";
666
- }
667
- });
668
- var init_use_media_query = __esm({
669
- "src/hooks/use-media-query.ts"() {
670
- "use client";
671
- init_utils();
672
- }
673
- });
674
- var init_use_controllable_state = __esm({
675
- "src/hooks/use-controllable-state.ts"() {
676
- "use client";
677
- init_use_isomorphic_layout_effect();
678
- }
679
- });
680
- var init_use_hotkey = __esm({
681
- "src/hooks/use-hotkey.ts"() {
682
- "use client";
683
- init_utils();
684
- init_use_isomorphic_layout_effect();
685
- }
686
- });
687
-
688
- // src/events.ts
689
- var EventEmitter, GLOBAL_EVENTS_KEY, _global;
690
- var init_events = __esm({
691
- "src/events.ts"() {
692
- init_report();
693
- EventEmitter = class {
694
- events = /* @__PURE__ */ new Map();
695
- debounceTimers = /* @__PURE__ */ new Map();
696
- subscribe(event, callback) {
697
- if (typeof event !== "string" || !event || typeof callback !== "function") {
698
- return () => {
699
- };
700
- }
701
- const listeners = this.events.get(event) || /* @__PURE__ */ new Set();
702
- listeners.add(callback);
703
- this.events.set(event, listeners);
704
- return () => {
705
- listeners.delete(callback);
706
- if (listeners.size === 0) this.events.delete(event);
707
- };
708
- }
709
- emit(event, payload) {
710
- const listeners = this.events.get(event);
711
- if (!listeners || listeners.size === 0) return;
712
- const snapshot = Array.from(listeners);
713
- for (const callback of snapshot) {
714
- try {
715
- callback(payload);
716
- } catch (error) {
717
- report(`Event listener (${String(event)})`, error);
718
- }
719
- }
720
- }
721
- emitDebounced(event, payload, waitMs = 100) {
722
- const existing = this.debounceTimers.get(event);
723
- if (existing) clearTimeout(existing);
724
- const timer = setTimeout(() => {
725
- this.debounceTimers.delete(event);
726
- this.emit(event, payload);
727
- }, waitMs);
728
- this.debounceTimers.set(event, timer);
729
- }
730
- cancelDebounced(event) {
731
- if (event) {
732
- const timer = this.debounceTimers.get(event);
733
- if (timer) {
734
- clearTimeout(timer);
735
- this.debounceTimers.delete(event);
736
- }
737
- } else {
738
- for (const timer of this.debounceTimers.values()) {
739
- clearTimeout(timer);
740
- }
741
- this.debounceTimers.clear();
742
- }
743
- }
744
- unsubscribeAll(event) {
745
- this.cancelDebounced(event);
746
- if (event) this.events.delete(event);
747
- else this.events.clear();
748
- }
749
- hasListeners(event) {
750
- return Boolean(this.events.get(event)?.size);
751
- }
752
- getListenerCount(event) {
753
- return this.events.get(event)?.size || 0;
754
- }
755
- getAllEvents() {
756
- return [...this.events.keys()];
757
- }
758
- };
759
- GLOBAL_EVENTS_KEY = /* @__PURE__ */ Symbol.for("__base_framework_global_events__");
760
- _global = globalThis;
761
- _global[GLOBAL_EVENTS_KEY] ?? (_global[GLOBAL_EVENTS_KEY] = new EventEmitter());
762
- }
763
- });
764
- var init_use_global_event = __esm({
765
- "src/hooks/use-global-event.ts"() {
766
- "use client";
767
- init_events();
768
- init_use_isomorphic_layout_effect();
769
- }
770
- });
771
-
772
- // src/result.ts
773
- var init_result = __esm({
774
- "src/result.ts"() {
775
- init_user_message();
776
- init_report();
777
- }
778
- });
779
- var init_use_async_action = __esm({
780
- "src/hooks/use-async-action.ts"() {
781
- "use client";
782
- init_events();
783
- init_result();
784
- init_utils();
785
- }
786
- });
787
- var init_use_server_action = __esm({
788
- "src/hooks/use-server-action.ts"() {
789
- "use client";
790
- init_events();
791
- init_result();
792
- init_utils();
793
- }
794
- });
795
- var init_use_storage_state = __esm({
796
- "src/hooks/use-storage-state.ts"() {
797
- "use client";
798
- init_utils();
799
- init_use_isomorphic_layout_effect();
800
- }
801
- });
802
- var init_use_intersection_observer = __esm({
803
- "src/hooks/use-intersection-observer.ts"() {
804
- "use client";
805
- init_utils();
806
- init_use_isomorphic_layout_effect();
807
- }
808
- });
809
602
 
810
603
  // src/hooks/index.ts
811
604
  var init_hooks = __esm({
@@ -813,64 +606,7 @@ var init_hooks = __esm({
813
606
  "use client";
814
607
  init_use_required_context();
815
608
  init_use_store();
816
- init_use_click_outside();
817
609
  init_use_isomorphic_layout_effect();
818
- init_use_debounce();
819
- init_use_mounted();
820
- init_use_media_query();
821
- init_use_controllable_state();
822
- init_use_hotkey();
823
- init_use_global_event();
824
- init_use_async_action();
825
- init_use_server_action();
826
- init_use_storage_state();
827
- init_use_intersection_observer();
828
- init_use_fullscreen_state();
829
- }
830
- });
831
-
832
- // src/kernel/runtime.ts
833
- var init_runtime = __esm({
834
- "src/kernel/runtime.ts"() {
835
- "use client";
836
- }
837
- });
838
- function createNoopHandle(status = "rejected", reason = "unknown") {
839
- const handle = Object.assign(() => false, {
840
- active: false,
841
- dispose: () => false,
842
- instanceId: null,
843
- key: "",
844
- priority: 0,
845
- reason,
846
- source: "",
847
- status,
848
- type: "",
849
- update: () => handle,
850
- updatedAt: 0,
851
- validation: "warn"
852
- });
853
- return handle;
854
- }
855
- var init_store2 = __esm({
856
- "src/kernel/store.ts"() {
857
- init_operations();
858
- init_schema();
859
- init_runtime();
860
- init_utils();
861
- createNoopHandle();
862
- }
863
- });
864
- function getOrCreateGlobalContext(name, defaultValue) {
865
- const sym = /* @__PURE__ */ Symbol.for(`@omerdlw/base-framework/context/${name}`);
866
- const store = globalThis;
867
- if (!store[sym]) {
868
- store[sym] = createContext(defaultValue);
869
- }
870
- return store[sym];
871
- }
872
- var init_context_registry = __esm({
873
- "src/kernel/context-registry.ts"() {
874
610
  }
875
611
  });
876
612
  function useRegistryActions() {
@@ -904,7 +640,6 @@ var init_provider = __esm({
904
640
  "src/kernel/provider.tsx"() {
905
641
  "use client";
906
642
  init_hooks();
907
- init_store2();
908
643
  init_context_registry();
909
644
  RegistryContext = getOrCreateGlobalContext(
910
645
  "RegistryContext",
@@ -1370,63 +1105,6 @@ var init_hooks2 = __esm({
1370
1105
  MAX_STABILIZATION_DEPTH = 64;
1371
1106
  }
1372
1107
  });
1373
- function createPageControllerStore() {
1374
- const listeners = /* @__PURE__ */ new Set();
1375
- let stack = [];
1376
- const notify = () => {
1377
- listeners.forEach((listener) => {
1378
- try {
1379
- listener();
1380
- } catch (error) {
1381
- report("Page controller listener", error);
1382
- }
1383
- });
1384
- };
1385
- return {
1386
- getSnapshot() {
1387
- const top = stack[stack.length - 1];
1388
- return top?.controllerRef?.current || null;
1389
- },
1390
- notify,
1391
- register(id, controllerRef) {
1392
- stack = stack.filter((item) => item.id !== id);
1393
- stack.push({ controllerRef, id });
1394
- notify();
1395
- },
1396
- subscribe(listener) {
1397
- listeners.add(listener);
1398
- return () => {
1399
- listeners.delete(listener);
1400
- };
1401
- },
1402
- unregister(id) {
1403
- stack = stack.filter((item) => item.id !== id);
1404
- notify();
1405
- }
1406
- };
1407
- }
1408
- var fallbackStandaloneStore;
1409
- var init_page_controller = __esm({
1410
- "src/kernel/page-controller.tsx"() {
1411
- "use client";
1412
- init_hooks();
1413
- init_hooks2();
1414
- init_installed();
1415
- init_schema();
1416
- init_utils2();
1417
- init_utils();
1418
- init_context_registry();
1419
- fallbackStandaloneStore = createPageControllerStore();
1420
- getOrCreateGlobalContext(
1421
- "PageControllerContext",
1422
- null
1423
- );
1424
- getOrCreateGlobalContext(
1425
- "PageControllerStoreContext",
1426
- fallbackStandaloneStore
1427
- );
1428
- }
1429
- });
1430
1108
  function defineModule(coreModule) {
1431
1109
  return Object.freeze({ ...coreModule });
1432
1110
  }
@@ -1440,17 +1118,13 @@ function ModuleBoundary({
1440
1118
  var init_module = __esm({
1441
1119
  "src/kernel/module.tsx"() {
1442
1120
  "use client";
1443
- init_hooks();
1444
1121
  init_utils();
1445
1122
  init_installed();
1446
- init_page_controller();
1447
- init_provider();
1448
- init_utils();
1449
1123
  createStore(void 0);
1450
1124
  }
1451
1125
  });
1452
1126
 
1453
- // src/kernel/adapters.tsx
1127
+ // src/kernel/adapters.ts
1454
1128
  function useModuleRegistration(id, value, options) {
1455
1129
  const coreModule = useInstalledModules().find(
1456
1130
  (candidate) => candidate.id === id
@@ -1459,35 +1133,23 @@ function useModuleRegistration(id, value, options) {
1459
1133
  useRegistry(config, pickRegistryMetadata(options));
1460
1134
  }
1461
1135
  var init_adapters = __esm({
1462
- "src/kernel/adapters.tsx"() {
1136
+ "src/kernel/adapters.ts"() {
1463
1137
  "use client";
1464
1138
  init_schema();
1465
1139
  init_hooks2();
1466
1140
  init_installed();
1467
1141
  }
1468
1142
  });
1469
- var init_compose = __esm({
1470
- "src/kernel/compose.ts"() {
1471
- }
1472
- });
1473
1143
 
1474
1144
  // src/kernel/index.ts
1475
1145
  var init_kernel = __esm({
1476
1146
  "src/kernel/index.ts"() {
1477
1147
  "use client";
1478
1148
  init_types();
1479
- init_constants();
1480
- init_utils2();
1481
- init_operations();
1149
+ init_context_registry();
1482
1150
  init_provider();
1483
- init_store2();
1484
- init_installed();
1485
1151
  init_module();
1486
- init_handlers();
1487
- init_hooks2();
1488
1152
  init_adapters();
1489
- init_page_controller();
1490
- init_compose();
1491
1153
  }
1492
1154
  });
1493
1155
  function defineThemeSpec(id) {
@@ -1497,7 +1159,7 @@ function useTheme(spec) {
1497
1159
  const config = useContext(ThemeContext).get(spec.id);
1498
1160
  if (!config) {
1499
1161
  throw new Error(
1500
- `Theme "${spec.id}" is missing. Add its theme file to src/config/ and list it in src/config/index.ts.`
1162
+ `Theme "${spec.id}" is missing. Ensure its theme configuration is provided to <ThemeProvider themes={[...]}> (e.g. in src/config/ or your theme setup).`
1501
1163
  );
1502
1164
  }
1503
1165
  return {
@@ -1509,24 +1171,17 @@ var EMPTY, ThemeContext;
1509
1171
  var init_theme = __esm({
1510
1172
  "src/theme.tsx"() {
1511
1173
  "use client";
1512
- init_context_registry();
1174
+ init_kernel();
1513
1175
  EMPTY = /* @__PURE__ */ new Map();
1514
1176
  ThemeContext = getOrCreateGlobalContext("ThemeContext", EMPTY);
1515
1177
  }
1516
1178
  });
1517
1179
 
1518
- // src/modules/theme.ts
1519
- var init_theme2 = __esm({
1520
- "src/modules/theme.ts"() {
1521
- init_theme();
1522
- }
1523
- });
1524
-
1525
1180
  // src/modules/modal/constants.ts
1526
1181
  var MODAL_POSITIONS, MODAL_CHROME, MODAL_BREAKPOINTS, SMOOTH_SCROLL_LOCK_EVENT, FOCUSABLE_SELECTOR, HEIGHT_CONSTRAINT_PATTERN, modalTheme;
1527
1182
  var init_constants2 = __esm({
1528
1183
  "src/modules/modal/constants.ts"() {
1529
- init_theme2();
1184
+ init_theme();
1530
1185
  MODAL_POSITIONS = Object.freeze({
1531
1186
  BOTTOM: "bottom",
1532
1187
  CENTER: "center",
@@ -2126,7 +1781,6 @@ var init_context = __esm({
2126
1781
  init_state();
2127
1782
  init_utils3();
2128
1783
  init_utils();
2129
- init_context_registry();
2130
1784
  ModalContext = getOrCreateGlobalContext(
2131
1785
  "ModalContext",
2132
1786
  null
@@ -2266,7 +1920,7 @@ var init_hooks3 = __esm({
2266
1920
  "use client";
2267
1921
  init_tokens2();
2268
1922
  init_utils();
2269
- init_theme2();
1923
+ init_theme();
2270
1924
  init_constants2();
2271
1925
  init_utils3();
2272
1926
  init_context();