mates-devtools 0.1.0-beta.5 → 0.1.0-beta.7

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 (161) hide show
  1. package/dist/mates-devtools.es.js +953 -835
  2. package/dist/mates-devtools.umd.js +190 -179
  3. package/dist/types/Mates-DevTools/src/MatesDevTools.d.ts.map +1 -1
  4. package/dist/types/Mates-DevTools/src/MatesDevToolsComponent.d.ts.map +1 -1
  5. package/dist/types/Mates-DevTools/src/components/Header.d.ts +3 -2
  6. package/dist/types/Mates-DevTools/src/components/Header.d.ts.map +1 -1
  7. package/dist/types/Mates-DevTools/src/components/UserLogsViewer.d.ts +6 -0
  8. package/dist/types/Mates-DevTools/src/components/UserLogsViewer.d.ts.map +1 -0
  9. package/dist/types/Mates-DevTools/src/userLogStore.d.ts +26 -0
  10. package/dist/types/Mates-DevTools/src/userLogStore.d.ts.map +1 -0
  11. package/dist/types/lib/Directives/animationClasses.d.ts +1 -1
  12. package/dist/types/lib/Directives/customEvent.d.ts +74 -0
  13. package/dist/types/lib/Directives/customEvent.d.ts.map +1 -0
  14. package/dist/types/lib/Directives/disappear.d.ts +23 -0
  15. package/dist/types/lib/Directives/disappear.d.ts.map +1 -0
  16. package/dist/types/lib/Directives/eleHook.d.ts.map +1 -1
  17. package/dist/types/lib/Directives/htmlHook.d.ts.map +1 -1
  18. package/dist/types/lib/Directives/index.d.ts +5 -3
  19. package/dist/types/lib/Directives/index.d.ts.map +1 -1
  20. package/dist/types/lib/Directives/onDirective.d.ts.map +1 -1
  21. package/dist/types/lib/Directives/onParentDirective.d.ts +1 -1
  22. package/dist/types/lib/Directives/timerDirective.d.ts +6 -6
  23. package/dist/types/lib/Directives/timerDirective.d.ts.map +1 -1
  24. package/dist/types/lib/Directives/virtualHelpers.d.ts +8 -6
  25. package/dist/types/lib/Directives/virtualHelpers.d.ts.map +1 -1
  26. package/dist/types/lib/Fetch/Fetch.d.ts +59 -13
  27. package/dist/types/lib/Fetch/Fetch.d.ts.map +1 -1
  28. package/dist/types/lib/MatesUtils/FetchUtils.d.ts +23 -0
  29. package/dist/types/lib/MatesUtils/FetchUtils.d.ts.map +1 -0
  30. package/dist/types/lib/MatesUtils/MatesUtils.d.ts +47 -0
  31. package/dist/types/lib/MatesUtils/MatesUtils.d.ts.map +1 -0
  32. package/dist/types/lib/MatesUtils/RouterUtils.d.ts +39 -0
  33. package/dist/types/lib/MatesUtils/RouterUtils.d.ts.map +1 -0
  34. package/dist/types/lib/MatesUtils/StorageUtils.d.ts +16 -0
  35. package/dist/types/lib/MatesUtils/StorageUtils.d.ts.map +1 -0
  36. package/dist/types/lib/MatesUtils/ThemeUtils.d.ts +18 -0
  37. package/dist/types/lib/MatesUtils/ThemeUtils.d.ts.map +1 -0
  38. package/dist/types/lib/MatesUtils/index.d.ts +6 -0
  39. package/dist/types/lib/MatesUtils/index.d.ts.map +1 -0
  40. package/dist/types/lib/Mutables/Extended Atoms/changeFlagAtom.d.ts +56 -0
  41. package/dist/types/lib/Mutables/Extended Atoms/changeFlagAtom.d.ts.map +1 -0
  42. package/dist/types/lib/Mutables/Extended Atoms/index.d.ts +1 -0
  43. package/dist/types/lib/Mutables/Extended Atoms/index.d.ts.map +1 -1
  44. package/dist/types/lib/Mutables/Extended Atoms/themeAtom.d.ts +3 -15
  45. package/dist/types/lib/Mutables/Extended Atoms/themeAtom.d.ts.map +1 -1
  46. package/dist/types/lib/Mutables/atom/atom.d.ts.map +1 -1
  47. package/dist/types/lib/Mutables/atom/delayAtom.d.ts +40 -0
  48. package/dist/types/lib/Mutables/atom/delayAtom.d.ts.map +1 -0
  49. package/dist/types/lib/Mutables/atom/index.d.ts +2 -1
  50. package/dist/types/lib/Mutables/atom/index.d.ts.map +1 -1
  51. package/dist/types/lib/Mutables/atom/storageAtom.d.ts +9 -31
  52. package/dist/types/lib/Mutables/atom/storageAtom.d.ts.map +1 -1
  53. package/dist/types/lib/Mutables/atom/titleAtom.d.ts +3 -9
  54. package/dist/types/lib/Mutables/atom/titleAtom.d.ts.map +1 -1
  55. package/dist/types/lib/Mutables/form/formAtom.d.ts +7 -5
  56. package/dist/types/lib/Mutables/form/formAtom.d.ts.map +1 -1
  57. package/dist/types/lib/Mutables/scope/scope.d.ts +32 -1
  58. package/dist/types/lib/Mutables/scope/scope.d.ts.map +1 -1
  59. package/dist/types/lib/Mutables/useStore/hostContext.d.ts.map +1 -1
  60. package/dist/types/lib/Mutables/useStore/subscription.d.ts +1 -1
  61. package/dist/types/lib/Mutables/useStore/subscription.d.ts.map +1 -1
  62. package/dist/types/lib/Router/Router.d.ts +2 -2
  63. package/dist/types/lib/Router/Router.d.ts.map +1 -1
  64. package/dist/types/lib/Router/animatedRouter.d.ts.map +1 -1
  65. package/dist/types/lib/Router/hashAtom.d.ts +7 -3
  66. package/dist/types/lib/Router/hashAtom.d.ts.map +1 -1
  67. package/dist/types/lib/Router/historyStateAtom.d.ts +8 -0
  68. package/dist/types/lib/Router/historyStateAtom.d.ts.map +1 -0
  69. package/dist/types/lib/Router/historyUtils.d.ts +14 -0
  70. package/dist/types/lib/Router/historyUtils.d.ts.map +1 -0
  71. package/dist/types/lib/Router/index.d.ts +2 -6
  72. package/dist/types/lib/Router/index.d.ts.map +1 -1
  73. package/dist/types/lib/Router/isPathMatching.d.ts +5 -1
  74. package/dist/types/lib/Router/isPathMatching.d.ts.map +1 -1
  75. package/dist/types/lib/Router/location.d.ts +4 -63
  76. package/dist/types/lib/Router/location.d.ts.map +1 -1
  77. package/dist/types/lib/Router/navigateTo.d.ts +8 -27
  78. package/dist/types/lib/Router/navigateTo.d.ts.map +1 -1
  79. package/dist/types/lib/Router/navigationLock.d.ts +5 -46
  80. package/dist/types/lib/Router/navigationLock.d.ts.map +1 -1
  81. package/dist/types/lib/Router/navigationRequest.d.ts +26 -0
  82. package/dist/types/lib/Router/navigationRequest.d.ts.map +1 -0
  83. package/dist/types/lib/Router/pathAtom.d.ts +16 -36
  84. package/dist/types/lib/Router/pathAtom.d.ts.map +1 -1
  85. package/dist/types/lib/Router/qsAtom.d.ts +7 -3
  86. package/dist/types/lib/Router/qsAtom.d.ts.map +1 -1
  87. package/dist/types/lib/Template/hmr.d.ts +6 -0
  88. package/dist/types/lib/Template/hmr.d.ts.map +1 -0
  89. package/dist/types/lib/Template/x-x.d.ts +1 -0
  90. package/dist/types/lib/Template/x-x.d.ts.map +1 -1
  91. package/dist/types/lib/Template/x-x.types.d.ts +0 -22
  92. package/dist/types/lib/Template/x-x.types.d.ts.map +1 -1
  93. package/dist/types/lib/Template/x.d.ts +19 -2
  94. package/dist/types/lib/Template/x.d.ts.map +1 -1
  95. package/dist/types/lib/TrackState/componentStatus.d.ts +0 -5
  96. package/dist/types/lib/TrackState/componentStatus.d.ts.map +1 -1
  97. package/dist/types/lib/TrackState/readTracking.d.ts.map +1 -1
  98. package/dist/types/lib/Utils/cookie.d.ts +2 -0
  99. package/dist/types/lib/Utils/cookie.d.ts.map +1 -0
  100. package/dist/types/lib/Utils/countdown.d.ts +48 -0
  101. package/dist/types/lib/Utils/countdown.d.ts.map +1 -0
  102. package/dist/types/lib/Utils/index.d.ts +3 -0
  103. package/dist/types/lib/Utils/index.d.ts.map +1 -1
  104. package/dist/types/lib/Utils/logEvent.d.ts +24 -0
  105. package/dist/types/lib/Utils/logEvent.d.ts.map +1 -0
  106. package/dist/types/lib/Utils/logger.d.ts +24 -13
  107. package/dist/types/lib/Utils/logger.d.ts.map +1 -1
  108. package/dist/types/lib/Utils/onceIdle.d.ts +28 -0
  109. package/dist/types/lib/Utils/onceIdle.d.ts.map +1 -0
  110. package/dist/types/lib/Utils/svgIcon.d.ts +2 -4
  111. package/dist/types/lib/Utils/svgIcon.d.ts.map +1 -1
  112. package/dist/types/lib/actions/asyncAction.d.ts.map +1 -1
  113. package/dist/types/lib/css-in-js/index.d.ts +1 -1
  114. package/dist/types/lib/css-in-js/index.d.ts.map +1 -1
  115. package/dist/types/lib/css-in-js/stylesheet.d.ts +15 -0
  116. package/dist/types/lib/css-in-js/stylesheet.d.ts.map +1 -1
  117. package/dist/types/lib/css-in-js/theme.d.ts +0 -8
  118. package/dist/types/lib/css-in-js/theme.d.ts.map +1 -1
  119. package/dist/types/lib/index.d.ts +25 -18
  120. package/dist/types/lib/index.d.ts.map +1 -1
  121. package/dist/types/lib/indexdb/index.d.ts +3 -0
  122. package/dist/types/lib/indexdb/index.d.ts.map +1 -0
  123. package/dist/types/lib/indexdb/indexdb.d.ts +86 -0
  124. package/dist/types/lib/indexdb/indexdb.d.ts.map +1 -0
  125. package/dist/types/lib/indexdb/types.d.ts +249 -0
  126. package/dist/types/lib/indexdb/types.d.ts.map +1 -0
  127. package/dist/types/lib/minidb/index.d.ts +3 -0
  128. package/dist/types/lib/minidb/index.d.ts.map +1 -0
  129. package/dist/types/lib/minidb/minidb.d.ts +105 -0
  130. package/dist/types/lib/minidb/minidb.d.ts.map +1 -0
  131. package/dist/types/lib/on/hooks.d.ts.map +1 -1
  132. package/dist/types/lib/portals/floating-container.d.ts +129 -0
  133. package/dist/types/lib/portals/floating-container.d.ts.map +1 -0
  134. package/dist/types/lib/portals/index.d.ts +5 -3
  135. package/dist/types/lib/portals/index.d.ts.map +1 -1
  136. package/dist/types/lib/portals/popup.d.ts +75 -11
  137. package/dist/types/lib/portals/popup.d.ts.map +1 -1
  138. package/dist/types/lib/portals/popupPlacement.d.ts +52 -0
  139. package/dist/types/lib/portals/popupPlacement.d.ts.map +1 -0
  140. package/dist/types/lib/portals/portal.d.ts +40 -16
  141. package/dist/types/lib/portals/portal.d.ts.map +1 -1
  142. package/dist/types/lib/socket/ws.d.ts +2 -2
  143. package/dist/types/lib/ssr/index.d.ts +1 -0
  144. package/dist/types/lib/ssr/index.d.ts.map +1 -1
  145. package/dist/types/lib/ssr/ssrFlag.d.ts +56 -21
  146. package/dist/types/lib/ssr/ssrFlag.d.ts.map +1 -1
  147. package/dist/types/lib/ssr/useCtx.d.ts +63 -0
  148. package/dist/types/lib/ssr/useCtx.d.ts.map +1 -0
  149. package/dist/types/lib/virtualizer/Virtualizer.d.ts +3 -2
  150. package/dist/types/lib/virtualizer/Virtualizer.d.ts.map +1 -1
  151. package/dist/types/lib/virtualizer/layouts/shared/BaseLayout.d.ts +8 -0
  152. package/dist/types/lib/virtualizer/layouts/shared/BaseLayout.d.ts.map +1 -1
  153. package/dist/types/lib/virtualizer/mates-adapter.d.ts +36 -88
  154. package/dist/types/lib/virtualizer/mates-adapter.d.ts.map +1 -1
  155. package/package.json +1 -1
  156. package/dist/types/lib/Router/pathResolver.d.ts +0 -9
  157. package/dist/types/lib/Router/pathResolver.d.ts.map +0 -1
  158. package/dist/types/lib/portals/tip.d.ts +0 -38
  159. package/dist/types/lib/portals/tip.d.ts.map +0 -1
  160. package/dist/types/lib/virtualizer/layouts/grid.d.ts +0 -25
  161. package/dist/types/lib/virtualizer/layouts/grid.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouterUtils.d.ts","sourceRoot":"","sources":["../../../../../lib/MatesUtils/RouterUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAgBrC,qBAAa,WAAW;IACtB,gBAAgB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,EAAE,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAC1D,gBAAgB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACtC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;;IAexC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAS7D,cAAc,IAAI,IAAI;IAItB,gBAAgB,IAAI,IAAI;IAIxB,IAAI,QAAQ;;;;MAEX;IAED,mBAAmB,CACjB,EAAE,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC5D,IAAI;CAqCR"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * StorageUtils — Scope class for localStorage/sessionStorage reactive atoms.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const { lsAtom } = getParentScope(StorageUtils);
7
+ * lsAtom.set({ theme: "dark" });
8
+ * ```
9
+ */
10
+ import type { StorageAtomType } from "../Mutables/atom/storageAtom";
11
+ export declare class StorageUtils {
12
+ lsAtom: StorageAtomType;
13
+ ssAtom: StorageAtomType;
14
+ constructor();
15
+ }
16
+ //# sourceMappingURL=StorageUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageUtils.d.ts","sourceRoot":"","sources":["../../../../../lib/MatesUtils/StorageUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE,qBAAa,YAAY;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;;CAMzB"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ThemeUtils — Scope class for theme and title reactive atoms.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const { themeAtom, titleAtom } = getParentScope(ThemeUtils);
7
+ * themeAtom.setToDark();
8
+ * titleAtom.set("My App");
9
+ * ```
10
+ */
11
+ import type { AtomType } from "../Mutables/atom/atom";
12
+ import type { ThemeAtomType } from "../Mutables/Extended Atoms/themeAtom";
13
+ export declare class ThemeUtils {
14
+ themeAtom: ThemeAtomType;
15
+ titleAtom: AtomType<string>;
16
+ constructor();
17
+ }
18
+ //# sourceMappingURL=ThemeUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeUtils.d.ts","sourceRoot":"","sources":["../../../../../lib/MatesUtils/ThemeUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAI1E,qBAAa,UAAU;IACrB,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;;CAM7B"}
@@ -0,0 +1,6 @@
1
+ export { FetchUtils } from "./FetchUtils";
2
+ export { MatesUtils } from "./MatesUtils";
3
+ export { RouterUtils } from "./RouterUtils";
4
+ export { StorageUtils } from "./StorageUtils";
5
+ export { ThemeUtils } from "./ThemeUtils";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/MatesUtils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { AtomConfig, AtomType } from "../atom/atom";
2
+ export type ChangeFlagAtomType = AtomType<number> & {
3
+ /**
4
+ * Trigger a reactivity update.
5
+ *
6
+ * - Called with no argument: sets the value to `Math.random()`, guaranteeing
7
+ * a new value every call and forcing all subscribers / effects / views to
8
+ * re-run.
9
+ * - Called with a number: sets the value to that number. Useful when you
10
+ * want a meaningful version counter or a specific sentinel value.
11
+ *
12
+ * @example
13
+ * flag.change(); // random — always triggers
14
+ * flag.change(n + 1); // explicit increment
15
+ */
16
+ change(value?: number): void;
17
+ /** Discriminator tag — always `"changeFlagAtom"`. */
18
+ readonly name: "changeFlagAtom";
19
+ };
20
+ /**
21
+ * changeFlagAtom — a reactive number atom whose sole purpose is to force
22
+ * re-renders, effect re-runs, and subscription callbacks.
23
+ *
24
+ * The stored number is intentionally meaningless by default — only the fact
25
+ * that it changed matters. Call `change()` to trigger, or pass a value if
26
+ * you want a meaningful version counter.
27
+ *
28
+ * Pairs well with `disappear` to bring back a disappeared element:
29
+ *
30
+ * @example
31
+ * const flag = changeFlagAtom();
32
+ *
33
+ * // Re-render the element (and restart the disappear timer) each time flag changes
34
+ * return () => html`
35
+ * ${flag()} // read flag so the template re-runs when it changes
36
+ * <div ${disappear(3000)}>I vanish in 3 s</div>
37
+ * <button @click=${() => flag.change()}>Show again</button>
38
+ * `;
39
+ *
40
+ * @example
41
+ * // Explicit version counter
42
+ * const version = changeFlagAtom(0);
43
+ * version.change(version() + 1);
44
+ *
45
+ * @example
46
+ * // Pair with effect
47
+ * const refresh = changeFlagAtom();
48
+ * effect(() => {
49
+ * refresh(); // subscribe
50
+ * fetchData();
51
+ * });
52
+ * // later:
53
+ * refresh.change(); // re-triggers the effect
54
+ */
55
+ export declare function changeFlagAtom(initial?: number, config?: AtomConfig): ChangeFlagAtomType;
56
+ //# sourceMappingURL=changeFlagAtom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changeFlagAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/Extended Atoms/changeFlagAtom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKzD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG;IAClD;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,cAAc,CAC5B,OAAO,GAAE,MAAU,EACnB,MAAM,CAAC,EAAE,UAAU,GAClB,kBAAkB,CAYpB"}
@@ -1,4 +1,5 @@
1
1
  export * from "./cacheAtom";
2
+ export * from "./changeFlagAtom";
2
3
  export * from "./paginationAtom";
3
4
  export * from "./themeAtom";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/Extended Atoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/Extended Atoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
@@ -34,26 +34,14 @@ export type ThemeAtomType = AtomType<ThemeValue> & {
34
34
  readonly name: "themeAtom";
35
35
  };
36
36
  /**
37
- * The singleton reactive theme atom.
38
- *
39
- * Use directly — it is the atom, not a factory.
37
+ * Creates a reactive theme atom.
40
38
  *
41
39
  * - Reads the initial theme from `localStorage["mates-theme"]`.
42
40
  * - Falls back to the OS color-scheme preference when no value is stored.
43
41
  * - Keeps `<html data-theme="…">` in sync automatically via an internal effect.
44
42
  * - Persists changes to localStorage (removes key for "auto").
45
43
  * - Re-applies the resolved theme when the OS preference changes while in
46
- * "auto" mode, re-notifying all subscribers so derived UIs update.
47
- *
48
- * @example
49
- * import { themeAtom } from "mates";
50
- *
51
- * themeAtom.setToDark();
52
- * themeAtom.toggle(); // → "light"
53
- * themeAtom.setToAuto(); // follows OS
54
- * themeAtom.resolved; // "light" | "dark" — never "auto"
55
- * themeAtom(); // read current value: "light" | "dark" | "auto"
56
- * themeAtom.val; // same
44
+ * "auto" mode.
57
45
  */
58
- export declare const themeAtom: ThemeAtomType;
46
+ export declare const createThemeAtom: () => ThemeAtomType;
59
47
  //# sourceMappingURL=themeAtom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"themeAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/Extended Atoms/themeAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAQ,MAAM,cAAc,CAAC;AAUnD,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG;IACjD,mEAAmE;IACnE,UAAU,IAAI,IAAI,CAAC;IACnB,kEAAkE;IAClE,SAAS,IAAI,IAAI,CAAC;IAClB,uEAAuE;IACvE,SAAS,IAAI,IAAI,CAAC;IAClB;;;;OAIG;IACH,MAAM,IAAI,IAAI,CAAC;IACf,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B,CAAC;AA6JF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,SAAS,EAAE,aAAgC,CAAC"}
1
+ {"version":3,"file":"themeAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/Extended Atoms/themeAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAQ,MAAM,cAAc,CAAC;AAUnD,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,OAAO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AM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,CA8BtE;AAaD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mGAAmG;IACnG,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG;IAC3C,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IACf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,OAAO,EAAE,CAAC,EACV,OAAO,GAAE,gBAAqB,GAC7B,aAAa,CAAC,CAAC,CAAC,CAwFlB;AA4BD,OAAO,EAAE,UAAU,IAAI,EAAE,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { type AtomConfig, type AtomType } from "./atom";
2
+ /**
3
+ * delayAtom — a reactive atom whose `set()` and `update()` calls are applied
4
+ * after a fixed `delay` in milliseconds.
5
+ *
6
+ * Unlike `debouncedAtom`, **every call fires** — there is no cancellation of
7
+ * previous pending writes. Each call schedules its own independent timeout.
8
+ * This makes it useful for "apply this value after N ms" patterns rather than
9
+ * "apply only the last value after N ms of silence".
10
+ *
11
+ * Accepts either a plain initial value or a source {@link AtomType}. When a
12
+ * source atom is provided the delay atom mirrors the source's value, applying
13
+ * the delay to every propagated change.
14
+ *
15
+ * All pending timeouts are cancelled automatically when the atom is disposed
16
+ * via `registerCleanup`.
17
+ *
18
+ * @param initialAtomOrState - A plain initial value, or a source atom to mirror.
19
+ * @param delay - How long to wait (ms) before each `set` / `update` is applied.
20
+ * @param config - Optional atom configuration forwarded to the underlying atom.
21
+ *
22
+ * @example
23
+ * // Every set fires independently after 1 second:
24
+ * const status = delayAtom("idle", 1000);
25
+ * status.set("loading"); // applied after 1 s
26
+ * status.set("done"); // also applied after 1 s (both fire, in order)
27
+ *
28
+ * @example
29
+ * // Mirror a source with delay:
30
+ * const immediate = atom(0);
31
+ * const delayed = delayAtom(immediate, 500);
32
+ * immediate.set(42); // delayed reflects 42 after 500 ms
33
+ *
34
+ * @example
35
+ * // Useful with disappear — update state after the animation finishes:
36
+ * const visible = delayAtom(true, 300);
37
+ * visible.set(false); // hides the element 300 ms later (after CSS transition)
38
+ */
39
+ export declare function delayAtom<T>(initialAtomOrState: T | AtomType<T>, delay: number, config?: AtomConfig): AtomType<T>;
40
+ //# sourceMappingURL=delayAtom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delayAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/delayAtom.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAQ,MAAM,QAAQ,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,kBAAkB,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACnC,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,UAAU,GAClB,QAAQ,CAAC,CAAC,CAAC,CA8Db"}
@@ -1,7 +1,8 @@
1
1
  export * from "./atom";
2
+ export * from "./atom";
2
3
  export * from "./createTimedAtom";
3
4
  export * from "./debouncedAtom";
4
- export * from "./atom";
5
+ export * from "./delayAtom";
5
6
  export * from "./mapAtom";
6
7
  export * from "./setAtom";
7
8
  export * from "./storageAtom";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
@@ -2,43 +2,21 @@ import { type AtomType } from "./atom";
2
2
  export type StorageValue = Record<string, unknown>;
3
3
  export type StorageAtomType = AtomType<StorageValue | null>;
4
4
  /**
5
- * A reactive atom backed by `localStorage["mates"]`.
5
+ * Creates a reactive atom backed by `localStorage["mates"]`.
6
6
  *
7
- * A single shared instance import and use directly, no factory call needed.
8
- *
9
- * - Hydrates from `localStorage` on module load.
7
+ * - Hydrates from `localStorage` on creation.
10
8
  * - Every `set()` / `update()` persists the new value to `localStorage["mates"]`.
11
9
  * - Changes made in another tab are synced automatically via the `storage` event.
12
- * - Only manages the single `"mates"` key — it does not expose or interact with
13
- * any other localStorage entries.
14
- *
15
- * @example
16
- * import { lsAtom } from "./storageAtom";
17
- *
18
- * lsAtom.set({ theme: "dark", lang: "en" });
19
- * lsAtom.update(d => { d.lang = "fr"; });
20
- * lsAtom(); // { theme: "dark", lang: "fr" }
21
- * lsAtom.get(); // same
22
- * lsAtom.val; // same
10
+ * - Only manages the single `"mates"` key.
23
11
  */
24
- export declare const lsAtom: StorageAtomType;
12
+ export declare function createLsAtom(): StorageAtomType;
25
13
  /**
26
- * A reactive atom backed by `sessionStorage["mates"]`.
14
+ * Creates a reactive atom backed by `sessionStorage["mates"]`.
27
15
  *
28
- * A single shared instance import and use directly, no factory call needed.
29
- *
30
- * - Hydrates from `sessionStorage` on module load.
31
- * - Every `set()` / `update()` persists the new value to `sessionStorage["mates"]`.
16
+ * - Hydrates from `sessionStorage` on creation.
17
+ * - Every `set()` / `update()` persists to `sessionStorage["mates"]`.
32
18
  * - `sessionStorage` is tab-scoped so no cross-tab sync occurs.
33
- * - Only manages the single `"mates"` key — it does not expose or interact with
34
- * any other sessionStorage entries.
35
- *
36
- * @example
37
- * import { ssAtom } from "./storageAtom";
38
- *
39
- * ssAtom.set({ cart: [], user: null });
40
- * ssAtom.update(d => { d.cart = [item]; });
41
- * ssAtom(); // { cart: [item], user: null }
19
+ * - Only manages the single `"mates"` key.
42
20
  */
43
- export declare const ssAtom: StorageAtomType;
21
+ export declare function createSsAtom(): StorageAtomType;
44
22
  //# sourceMappingURL=storageAtom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storageAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/storageAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAQ,MAAM,QAAQ,CAAC;AAI7C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;AAwI5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,MAAM,EAAE,eAMpB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,EAAE,eAMpB,CAAC"}
1
+ {"version":3,"file":"storageAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/storageAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAQ,MAAM,QAAQ,CAAC;AAI7C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;AA8G5D;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,eAAe,CAQ9C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,eAAe,CAQ9C"}
@@ -1,5 +1,6 @@
1
+ import { type AtomType } from "./atom";
1
2
  /**
2
- * A singleton reactive atom that mirrors `document.title`.
3
+ * Creates a reactive atom that mirrors `document.title`.
3
4
  *
4
5
  * Setting this atom automatically updates the browser tab title via an
5
6
  * internal effect. Reading it inside a memo, effect, or component will
@@ -8,13 +9,6 @@
8
9
  * On SSR (environments where `document` is not defined) the initial value
9
10
  * is `""` and writes to the atom are tracked reactively but do not touch
10
11
  * any DOM.
11
- *
12
- * @example
13
- * ```ts
14
- * titleAtom.set("My App - Dashboard"); // document.title === "My App - Dashboard"
15
- * titleAtom.get(); // "My App - Dashboard"
16
- * // Reading titleAtom() in a component will re-render whenever the title changes
17
- * ```
18
12
  */
19
- export declare const titleAtom: import("./atom").AtomType<string>;
13
+ export declare function createTitleAtom(): AtomType<string>;
20
14
  //# sourceMappingURL=titleAtom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"titleAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/titleAtom.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS,mCAAqB,CAAC"}
1
+ {"version":3,"file":"titleAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/atom/titleAtom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAQ,MAAM,QAAQ,CAAC;AAE7C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,IAAI,QAAQ,CAAC,MAAM,CAAC,CAWlD"}
@@ -1,7 +1,8 @@
1
- import { type AtomConfig, type AtomType } from "../atom/atom";
1
+ import { type AtomConfig, type SuperAtomType } from "../atom/atom";
2
2
  import type { ValidatorFn } from "./validators";
3
3
  /**
4
- * Widen literal types so that `formAtom("")` infers `FormAtom<string>`
4
+ * Widen literal types so that `form
5
+ "")` infers `FormAtom<string>`
5
6
  * instead of `FormAtom<"">`, and `formAtom(0)` infers `FormAtom<number>`
6
7
  * instead of `FormAtom<0>`.
7
8
  */
@@ -13,7 +14,7 @@ type Widen<T> = T extends string ? string : T extends number ? number : T extend
13
14
  * __subscribe, __version__, lock/unlock, toJSON, …) with form-specific
14
15
  * members: errors, isValid, validate(), and the numeric helpers.
15
16
  */
16
- export type FormAtom<T> = AtomType<T> & {
17
+ export type FormAtom<T> = SuperAtomType<T> & {
17
18
  validate(): string[];
18
19
  readonly errors: string[];
19
20
  readonly isValid: boolean;
@@ -26,9 +27,10 @@ export type FormAtom<T> = AtomType<T> & {
26
27
  /**
27
28
  * Create a reactive form field atom.
28
29
  *
29
- * Inherits the full `AtomType<T>` interface — callable as a function,
30
+ * Inherits the full `SuperAtomType<T>` interface — callable as a function,
30
31
  * `.get()`, `.set()`, `.update()`, `.val`, `.__subscribe()`,
31
- * `.__version__`, `.lock()` / `.unlock()`, `.toJSON()` — plus:
32
+ * `.__version__`, `.__id__`, `.toJSON()`, `.lock()`, `.unlock()`,
33
+ * `.reset()`, `.freeze()` — plus:
32
34
  *
33
35
  * - `errors` — `string[]` reactive via an internal atom; `[]` on mount.
34
36
  * - `isValid` — `boolean` derived from errors.
@@ -1 +1 @@
1
- {"version":3,"file":"formAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/form/formAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAQ,MAAM,cAAc,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;GAIG;AACH,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC5B,MAAM,GACN,CAAC,SAAS,MAAM,GACd,MAAM,GACN,CAAC,SAAS,OAAO,GACf,OAAO,GACP,CAAC,CAAC;AAIV;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG;IACtC,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC;IAC9B,OAAO,IAAI,MAAM,CAAC;IAClB,aAAa,IAAI,MAAM,CAAC;IACxB,aAAa,IAAI,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B,CAAC;AA2FF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,EACxB,SAAS,CAAC,EACV,aAAY,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAO,EACxC,SAAS,UAAU,KAClB,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAC+C,CAAC"}
1
+ {"version":3,"file":"formAtom.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/form/formAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,aAAa,EAEnB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;GAKG;AACH,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC5B,MAAM,GACN,CAAC,SAAS,MAAM,GACd,MAAM,GACN,CAAC,SAAS,OAAO,GACf,OAAO,GACP,CAAC,CAAC;AAIV;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG;IAC3C,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC;IAC9B,OAAO,IAAI,MAAM,CAAC;IAClB,aAAa,IAAI,MAAM,CAAC;IACxB,aAAa,IAAI,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B,CAAC;AAiGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,EACxB,SAAS,CAAC,EACV,aAAY,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAO,EACxC,SAAS,UAAU,KAClB,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAC+C,CAAC"}
@@ -1,3 +1,8 @@
1
+ import { MatesUtils } from "../../MatesUtils";
2
+ import { RouterUtils } from "../../MatesUtils/RouterUtils";
3
+ import { FetchUtils } from "../../MatesUtils/FetchUtils";
4
+ import { StorageUtils } from "../../MatesUtils/StorageUtils";
5
+ import { ThemeUtils } from "../../MatesUtils/ThemeUtils";
1
6
  type TScope<T> = T & {
2
7
  reset: () => void;
3
8
  __isScope___: boolean;
@@ -56,5 +61,31 @@ export declare const scope: <T extends object>(ScopeClass: new () => T) => TScop
56
61
  * counter.incr(); // mutates the parent's atom
57
62
  */
58
63
  export declare const getParentScope: <T extends object>(ScopeClass: new () => T) => TScope<T>;
59
- export {};
64
+ /**
65
+ * Register scope classes that WithScope should instantiate on every
66
+ * component tree mount. Libraries call this at module level.
67
+ *
68
+ * Safe to call multiple times — duplicates are ignored (Set semantics).
69
+ *
70
+ * @example
71
+ * import { registerGlobalScopes } from "mates";
72
+ * registerGlobalScopes([SnackbarScope, NotificationScope]);
73
+ */
74
+ export declare function registerGlobalScopes(classes: Array<new () => object>): void;
75
+ /**
76
+ * Returns a snapshot of all registered global scope classes.
77
+ * Used internally by WithScope.
78
+ */
79
+ export declare function getGlobalScopeClasses(): Array<new () => object>;
80
+ export declare const useUtils: () => TScope<MatesUtils>;
81
+ /** Alias for `scope()` — creates a scope instance. */
82
+ export { scope as useScope };
83
+ /** Shorthand for `getParentScope(RouterUtils)`. */
84
+ export declare const useRouter: () => TScope<RouterUtils>;
85
+ /** Shorthand for `getParentScope(FetchUtils)`. */
86
+ export declare const useFetch: () => TScope<FetchUtils>;
87
+ /** Shorthand for `getParentScope(StorageUtils)`. */
88
+ export declare const useStorage: () => TScope<StorageUtils>;
89
+ /** Shorthand for `getParentScope(ThemeUtils)`. */
90
+ export declare const useTheme: () => TScope<ThemeUtils>;
60
91
  //# sourceMappingURL=scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/scope/scope.ts"],"names":[],"mappings":"AAKA,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,SAAS,MAAM,EAAE,YAAY,UAAU,CAAC,KAAG,MAAM,CAAC,CAAC,CAiEzE,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,M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mC,CAAC;AAEzD,oDAAoD;AACpD,eAAO,MAAM,UAAU,4BAAqC,CAAC;AAE7D,kDAAkD;AAClD,eAAO,MAAM,QAAQ,0BAAmC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hostContext.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/useStore/hostContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,OAS5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CASvE"}
1
+ {"version":3,"file":"hostContext.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/useStore/hostContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAM5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,OAS5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CASvE"}
@@ -46,5 +46,5 @@ export type SetterReturnType<T extends Function> = T & {
46
46
  set: SetterReturnType<T>;
47
47
  [key: string]: any;
48
48
  };
49
- export declare const on: (callback: () => (() => void) | undefined, deps: any[]) => () => void;
49
+ export declare const on: (callback: () => void | (() => void) | Promise<void>, deps: any[]) => () => void;
50
50
  //# sourceMappingURL=subscription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../../../lib/Mutables/useStore/subscription.ts"],"names":[],"mappings":"AAMA,wBAAgB,UAAU,CACxB,KAAK,E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AAQ,CAAC;IAC/C,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,QAAQ,CAAC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAG5D;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,QAAQ,IAAI,CAAC,GAAG;IACrD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,QAAQ,CAAC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,EAAE,GACb,UAAU,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,EACnD,MAAM,GAAG,EAAE,eA0CZ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { nothing } from "lit-html";
2
- import type { ComponentType, View } from "../Template/x-x.types";
2
+ import type { ComponentType } from "../Template/x-x.types";
3
3
  /**
4
4
  * Renders `view` if the current URL path matches `path`; otherwise returns `null`.
5
5
  *
@@ -15,7 +15,7 @@ import type { ComponentType, View } from "../Template/x-x.types";
15
15
  * ${route("/about", { view: () => html`<about-page></about-page>` })}
16
16
  */
17
17
  export declare const route: (path: string, { view: viewFn }: {
18
- view: View;
18
+ view: ComponentType;
19
19
  }) => typeof nothing | import("lit-html").TemplateResult<1> | null;
20
20
  type RouteConfig = {
21
21
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/Router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAa,aAAa,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAI5E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,EAAE,kBAAkB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,iEAGnE,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,MAAM,GACjB,aAAa,WAAW,EAAE,EAC1B,WAAW,aAAa,kEAuBzB,CAAC"}
1
+ {"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/Router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAa,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EACZ,kBAAkB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,iEAK1C,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,MAAM,GACjB,aAAa,WAAW,EAAE,EAC1B,WAAW,aAAa,kEAezB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"animatedRouter.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/animatedRouter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM/D,OAAO,KAAK,EAAE,aAAa,EAAS,MAAM,uBAAuB,CAAC;AAIlE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MA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gB,cAAc,CAC5B,MAAM,EAAE,mBAAmB,EAAE,EAC7B,OAAO,GAAE,qBAA0B,wCAGpC"}
@@ -1,12 +1,16 @@
1
+ import { type AtomType } from "../Mutables/atom/atom";
1
2
  /**
2
- * Singleton atom holding the current URL hash fragment as a parsed object.
3
+ * Creates a reactive atom holding the current URL hash fragment as a parsed object.
3
4
  *
4
- * Hydrated from `window.location.hash` at module load time. All reads are
5
+ * Hydrated from `window.location.hash` at creation time. All reads are
5
6
  * reactive — any effect or component that calls `hashAtom()` will re-run
6
7
  * whenever the hash state changes.
7
8
  *
8
9
  * Setting the atom via `hashAtom.set(obj)` automatically serialises the new
9
10
  * value back to the URL hash using `history.replaceState`.
11
+ *
12
+ * @param navigationLocked - A reactive atom; when `true`, URL writes and
13
+ * hashchange→atom updates are suppressed.
10
14
  */
11
- export declare const hashAtom: import("..").AtomType<Record<string, any>>;
15
+ export declare function createHashAtom(navigationLocked: AtomType<boolean>): AtomType<Record<string, any>>;
12
16
  //# sourceMappingURL=hashAtom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashAtom.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/hashAtom.ts"],"names":[],"mappings":"AA+FA;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,4CAAqC,CAAC"}
1
+ {"version":3,"file":"hashAtom.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/hashAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAQ,MAAM,uBAAuB,CAAC;AAgD5D;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,gBAAgB,EAAE,QAAQ,CAAC,OAAO,CAAC,GAClC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAuB/B"}
@@ -0,0 +1,8 @@
1
+ import { type AtomType } from "../Mutables/atom/atom";
2
+ /**
3
+ * Creates a reactive atom that always reflects `window.history.state`.
4
+ *
5
+ * Hydrated from `window.history.state` at creation time.
6
+ */
7
+ export declare function createHistoryStateAtom(): AtomType<unknown>;
8
+ //# sourceMappingURL=historyStateAtom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historyStateAtom.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/historyStateAtom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,QAAQ,CAAC,OAAO,CAAC,CAI1D"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Replace dynamic route params in the current URL using a **pattern** that
3
+ * describes which segments are params.
4
+ *
5
+ * Uses `replaceState` — no new history entry is created.
6
+ *
7
+ * Reads `pathAtom` and calls `navigateTo()` from the nearest `MatesUtils` scope.
8
+ *
9
+ * @param pattern Route pattern with `:param` segments (e.g. `"/users/:id"`).
10
+ * @param params Param names → new values. Only provided keys are replaced;
11
+ * all other segments are left unchanged.
12
+ */
13
+ export declare function replaceParams(pattern: string, params: Record<string, string | number | boolean>): void;
14
+ //# sourceMappingURL=historyUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historyUtils.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/historyUtils.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAChD,IAAI,CA2CN"}
@@ -1,11 +1,7 @@
1
1
  export { type AnimatedRouteConfig, type AnimatedRouterOptions, animatedRouter, } from "./animatedRouter";
2
2
  export { buildPath } from "./buildPath";
3
- export { hashAtom } from "./hashAtom";
3
+ export { replaceParams } from "./historyUtils";
4
4
  export { isPathMatching } from "./isPathMatching";
5
- export { location } from "./location";
6
- export { navigateTo } from "./navigateTo";
7
- export { lockNavigation, navigationLocked, unlockNavigation, } from "./navigationLock";
8
- export { pathAtom } from "./pathAtom";
9
- export { qsAtom } from "./qsAtom";
5
+ export type { NavigationRequestDetail } from "./navigationRequest";
10
6
  export { Router, route } from "./Router";
11
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
@@ -1,12 +1,16 @@
1
+ import type { SuperAtomType } from "../Mutables/atom/atom";
1
2
  /**
2
3
  * Checks whether the current pathname matches a route pattern.
3
4
  *
4
5
  * Supports dynamic params in the pattern using `:param` segments.
5
6
  *
7
+ * Reads `pathAtom` from the nearest `MatesUtils` scope, or uses the
8
+ * optional `pathAtom` parameter when provided (useful for testing).
9
+ *
6
10
  * @example
7
11
  * // current path: /users/42
8
12
  * isPathMatching("/users/:id") // true
9
13
  * isPathMatching("/users") // false
10
14
  */
11
- export declare const isPathMatching: (path: string) => boolean;
15
+ export declare const isPathMatching: (path: string, pathAtom?: SuperAtomType<string>) => boolean;
12
16
  //# sourceMappingURL=isPathMatching.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isPathMatching.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/isPathMatching.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OAuB7C,CAAC"}
1
+ {"version":3,"file":"isPathMatching.d.ts","sourceRoot":"","sources":["../../../../../lib/Router/isPathMatching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM,MAAM,EACZ,WAAW,aAAa,CAAC,MAAM,CAAC,KAC/B,OAwBF,CAAC"}