@juo/blocks 1.15.0 → 2.0.0-alpha.1

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/dist/{ExtensionRoot-C3lVJEBl.js → ExtensionRoot-DRpD5EcC.js} +24 -6
  2. package/dist/block-BjJztStr.js +993 -0
  3. package/dist/{block-VhmfGB3N.js → block-DnhzyZ1H.js} +38 -3
  4. package/dist/block.d.ts +56 -0
  5. package/dist/block.d.ts.map +1 -1
  6. package/dist/{bridge-xiKEzCGR.js → bridge-Mz0CqG6E.js} +39 -30
  7. package/dist/core.js +2429 -399
  8. package/dist/css-runtime-B7tZrBIp.js +749 -0
  9. package/dist/devtools/hook.d.ts +0 -5
  10. package/dist/devtools/hook.d.ts.map +1 -1
  11. package/dist/devtools/index.d.ts +0 -1
  12. package/dist/devtools/index.d.ts.map +1 -1
  13. package/dist/devtools/protocol.d.ts +15 -1
  14. package/dist/devtools/protocol.d.ts.map +1 -1
  15. package/dist/devtools.js +42 -9
  16. package/dist/editor/bridge.d.ts +7 -0
  17. package/dist/editor/bridge.d.ts.map +1 -1
  18. package/dist/editor/components.d.ts.map +1 -1
  19. package/dist/editor/main.d.ts +2 -1
  20. package/dist/editor/main.d.ts.map +1 -1
  21. package/dist/editor/messages.d.ts +13 -2
  22. package/dist/editor/messages.d.ts.map +1 -1
  23. package/dist/editor/overlays.d.ts +14 -0
  24. package/dist/editor/overlays.d.ts.map +1 -0
  25. package/dist/editor/overlays.test.d.ts +2 -0
  26. package/dist/editor/overlays.test.d.ts.map +1 -0
  27. package/dist/editor.js +52 -33
  28. package/dist/{gridstack-adapter-CDWbSpbt.js → gridstack-adapter-BGKGC-eO.js} +2 -2
  29. package/dist/main.d.ts +3 -1
  30. package/dist/main.d.ts.map +1 -1
  31. package/dist/{morph-n4LMxOYo.js → morph-CT5hc5Qp.js} +1 -1
  32. package/dist/overlay-wrapper.d.ts +69 -0
  33. package/dist/overlay-wrapper.d.ts.map +1 -0
  34. package/dist/overlay-wrapper.test.d.ts +2 -0
  35. package/dist/overlay-wrapper.test.d.ts.map +1 -0
  36. package/dist/overlays/OverlayService.d.ts +34 -0
  37. package/dist/overlays/OverlayService.d.ts.map +1 -0
  38. package/dist/overlays/OverlayService.test.d.ts +2 -0
  39. package/dist/overlays/OverlayService.test.d.ts.map +1 -0
  40. package/dist/preact/block.d.ts.map +1 -1
  41. package/dist/preact/context.d.ts.map +1 -1
  42. package/dist/preact/context.test.d.ts +2 -0
  43. package/dist/preact/context.test.d.ts.map +1 -0
  44. package/dist/preact/signals.d.ts +19 -0
  45. package/dist/preact/signals.d.ts.map +1 -1
  46. package/dist/preact/useContextSubscription.test.d.ts +2 -0
  47. package/dist/preact/useContextSubscription.test.d.ts.map +1 -0
  48. package/dist/preact.js +33 -7
  49. package/dist/{project-gridstack-CM783oKI.js → project-gridstack-PxN_DIfP.js} +1 -1
  50. package/dist/react/block.d.ts.map +1 -1
  51. package/dist/react/context.d.ts.map +1 -1
  52. package/dist/react/context.test.d.ts +2 -0
  53. package/dist/react/context.test.d.ts.map +1 -0
  54. package/dist/react/signals.d.ts +19 -0
  55. package/dist/react/signals.d.ts.map +1 -1
  56. package/dist/react/useContextSubscription.test.d.ts +2 -0
  57. package/dist/react/useContextSubscription.test.d.ts.map +1 -0
  58. package/dist/react.js +40 -8
  59. package/dist/services/customer/adapter.d.ts +8 -0
  60. package/dist/services/customer/adapter.d.ts.map +1 -0
  61. package/dist/services/customer/customerService.d.ts +3 -2
  62. package/dist/services/customer/customerService.d.ts.map +1 -1
  63. package/dist/services/customer/index.d.ts +1 -0
  64. package/dist/services/customer/index.d.ts.map +1 -1
  65. package/dist/services/customer/types.d.ts +4 -1
  66. package/dist/services/customer/types.d.ts.map +1 -1
  67. package/dist/services/index.d.ts +4 -1
  68. package/dist/services/index.d.ts.map +1 -1
  69. package/dist/services/login/adapter.d.ts +33 -0
  70. package/dist/services/login/adapter.d.ts.map +1 -0
  71. package/dist/services/login/index.d.ts +3 -1
  72. package/dist/services/login/index.d.ts.map +1 -1
  73. package/dist/services/login/loginService.d.ts +6 -2
  74. package/dist/services/login/loginService.d.ts.map +1 -1
  75. package/dist/services/order/adapter.d.ts +10 -0
  76. package/dist/services/order/adapter.d.ts.map +1 -0
  77. package/dist/services/order/index.d.ts +4 -0
  78. package/dist/services/order/index.d.ts.map +1 -0
  79. package/dist/services/order/orderService.d.ts +6 -0
  80. package/dist/services/order/orderService.d.ts.map +1 -0
  81. package/dist/services/order/orderService.test.d.ts +2 -0
  82. package/dist/services/order/orderService.test.d.ts.map +1 -0
  83. package/dist/services/{orders → order}/types.d.ts +3 -3
  84. package/dist/services/order/types.d.ts.map +1 -0
  85. package/dist/services/product/adapter.d.ts +27 -2
  86. package/dist/services/product/adapter.d.ts.map +1 -1
  87. package/dist/services/product/adapter.test.d.ts +2 -0
  88. package/dist/services/product/adapter.test.d.ts.map +1 -0
  89. package/dist/services/product/index.d.ts +1 -1
  90. package/dist/services/product/index.d.ts.map +1 -1
  91. package/dist/services/product/productService.d.ts.map +1 -1
  92. package/dist/services/product/types.d.ts +68 -0
  93. package/dist/services/product/types.d.ts.map +1 -1
  94. package/dist/services/schedules/adapter.d.ts +94 -0
  95. package/dist/services/schedules/adapter.d.ts.map +1 -0
  96. package/dist/services/schedules/adapter.test.d.ts +2 -0
  97. package/dist/services/schedules/adapter.test.d.ts.map +1 -0
  98. package/dist/services/schedules/apiSchedulesAdapter.test.d.ts +2 -0
  99. package/dist/services/schedules/apiSchedulesAdapter.test.d.ts.map +1 -0
  100. package/dist/services/schedules/index.d.ts +5 -0
  101. package/dist/services/schedules/index.d.ts.map +1 -0
  102. package/dist/services/schedules/schedulesService.d.ts +11 -0
  103. package/dist/services/schedules/schedulesService.d.ts.map +1 -0
  104. package/dist/services/schedules/schedulesService.test.d.ts +2 -0
  105. package/dist/services/schedules/schedulesService.test.d.ts.map +1 -0
  106. package/dist/services/schedules/types.d.ts +290 -0
  107. package/dist/services/schedules/types.d.ts.map +1 -0
  108. package/dist/services/settings/index.d.ts +3 -0
  109. package/dist/services/settings/index.d.ts.map +1 -0
  110. package/dist/services/settings/settingsService.d.ts +7 -0
  111. package/dist/services/settings/settingsService.d.ts.map +1 -0
  112. package/dist/services/settings/settingsService.test.d.ts +2 -0
  113. package/dist/services/settings/settingsService.test.d.ts.map +1 -0
  114. package/dist/services/settings/types.d.ts +35 -0
  115. package/dist/services/settings/types.d.ts.map +1 -0
  116. package/dist/services/shop/index.d.ts +3 -0
  117. package/dist/services/shop/index.d.ts.map +1 -0
  118. package/dist/services/shop/shopService.d.ts +12 -0
  119. package/dist/services/shop/shopService.d.ts.map +1 -0
  120. package/dist/services/shop/shopService.test.d.ts +2 -0
  121. package/dist/services/shop/shopService.test.d.ts.map +1 -0
  122. package/dist/services/shop/types.d.ts +7 -0
  123. package/dist/services/shop/types.d.ts.map +1 -0
  124. package/dist/services/subscription/adapter.d.ts +77 -2
  125. package/dist/services/subscription/adapter.d.ts.map +1 -1
  126. package/dist/services/subscription/adapter.test.d.ts +2 -0
  127. package/dist/services/subscription/adapter.test.d.ts.map +1 -0
  128. package/dist/services/subscription/index.d.ts +1 -1
  129. package/dist/services/subscription/index.d.ts.map +1 -1
  130. package/dist/services/subscription/subscriptionService.d.ts +1 -6
  131. package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
  132. package/dist/services/subscription/types.d.ts +220 -9
  133. package/dist/services/subscription/types.d.ts.map +1 -1
  134. package/dist/services/subscription/types.test.d.ts +2 -0
  135. package/dist/services/subscription/types.test.d.ts.map +1 -0
  136. package/dist/shared/context.d.ts +10 -3
  137. package/dist/shared/context.d.ts.map +1 -1
  138. package/dist/shared/touchSignals.d.ts +17 -0
  139. package/dist/shared/touchSignals.d.ts.map +1 -0
  140. package/dist/shared/touchSignals.test.d.ts +2 -0
  141. package/dist/shared/touchSignals.test.d.ts.map +1 -0
  142. package/dist/theme-state.d.ts +2 -1
  143. package/dist/theme-state.d.ts.map +1 -1
  144. package/dist/theme-state.params.test.d.ts +2 -0
  145. package/dist/theme-state.params.test.d.ts.map +1 -0
  146. package/dist/theme-state.translations.test.d.ts +2 -0
  147. package/dist/theme-state.translations.test.d.ts.map +1 -0
  148. package/dist/utils/index.d.ts +6 -0
  149. package/dist/utils/index.d.ts.map +1 -1
  150. package/dist/vue/block.d.ts.map +1 -1
  151. package/dist/vue/context.d.ts +1 -0
  152. package/dist/vue/context.d.ts.map +1 -1
  153. package/dist/vue.js +28 -15
  154. package/dist/web-components/ExtensionRoot.d.ts +1 -0
  155. package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
  156. package/dist/web-components-editor.js +6 -5
  157. package/dist/web-components-runtime.js +3 -2
  158. package/package.json +1 -1
  159. package/dist/css-runtime-ClH0MEYr.js +0 -1570
  160. package/dist/devtools/instrumentation.d.ts +0 -47
  161. package/dist/devtools/instrumentation.d.ts.map +0 -1
  162. package/dist/index-JSv6UH_o.js +0 -169
  163. package/dist/services/orders/adapter.d.ts +0 -8
  164. package/dist/services/orders/adapter.d.ts.map +0 -1
  165. package/dist/services/orders/index.d.ts +0 -4
  166. package/dist/services/orders/index.d.ts.map +0 -1
  167. package/dist/services/orders/ordersService.d.ts +0 -6
  168. package/dist/services/orders/ordersService.d.ts.map +0 -1
  169. package/dist/services/orders/ordersService.test.d.ts +0 -2
  170. package/dist/services/orders/ordersService.test.d.ts.map +0 -1
  171. package/dist/services/orders/types.d.ts.map +0 -1
@@ -0,0 +1,34 @@
1
+ import { ReadonlySignal } from '@preact/signals-core';
2
+ import { BlockDefinition } from '../block';
3
+ import { ThemeState } from '../theme-state';
4
+ import { OverlayLayout } from '../overlay-wrapper';
5
+ import { OverlayRegistryEntry } from '../editor/overlays';
6
+ export type { OverlayRegistryEntry };
7
+ export interface OverlayState {
8
+ name: string;
9
+ layout: OverlayLayout;
10
+ canAbort: boolean;
11
+ }
12
+ export interface OverlayService {
13
+ /** Editor registry: the flat, global overlay list for the editor dropdown. */
14
+ getEditableOverlays(): Record<string, OverlayRegistryEntry>;
15
+ /** Open an overlay surface (full `overlay:<id>` name), optionally parameterized. */
16
+ open(name: string, params?: Record<string, unknown>): void;
17
+ /** Close the current overlay surface. */
18
+ close(): void;
19
+ /** The overlay currently showing, or null (incl. when a workflow overlay is up). */
20
+ current: ReadonlySignal<OverlayState | null>;
21
+ }
22
+ export declare const OverlayServiceContext: {
23
+ __context__: OverlayService;
24
+ };
25
+ /**
26
+ * Owns non-workflow overlay state over the shared `themeState.overlay` surface.
27
+ * Symmetric to `WorkflowService`; never invoked on the workflow path. `current`
28
+ * filters to `overlay:` roots so workflow roots (which share the surface) read
29
+ * as null.
30
+ */
31
+ export declare function createOverlayService(themeState: ThemeState, options?: {
32
+ getBlocks?: () => BlockDefinition[];
33
+ }): OverlayService;
34
+ //# sourceMappingURL=OverlayService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverlayService.d.ts","sourceRoot":"","sources":["../../src/overlays/OverlayService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAIrC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC5D,oFAAoF;IACpF,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3D,yCAAyC;IACzC,KAAK,IAAI,IAAI,CAAC;IACd,oFAAoF;IACpF,OAAO,EAAE,cAAc,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;CAC9C;AAED,eAAO,MAAM,qBAAqB;;CACiB,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,eAAe,EAAE,CAAA;CAAO,GACpD,cAAc,CAiChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=OverlayService.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverlayService.test.d.ts","sourceRoot":"","sources":["../../src/overlays/OverlayService.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/preact/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0BjD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAC1C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAC1B,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAuCvC;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAC5C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAoEvC"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src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B,UAAU,IAAI,MAAM,GAAG,IAAI,CAU1C;AAED,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/preact/context.ts"],"names":[],"mappings":"AASA,OAAO,EAAK,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EACL,WAAW,EAGX,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI3D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,iBAAiB,CAAA;CAAE;;;GAiB5E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EACxD,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GACnB,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,cAAc,EACjD,OAAO,EAAE,CAAC,GACT,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAUtB;AAED,wBAAgB,UAAU,IAAI,MAAM,GAAG,IAAI,CAU1C;AAED,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=context.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.test.d.ts","sourceRoot":"","sources":["../../src/preact/context.test.ts"],"names":[],"mappings":""}
@@ -20,4 +20,23 @@ export declare function toState<T extends object>(signal: Signal<T> | (() => T))
20
20
  * @returns The current value of the signal
21
21
  */
22
22
  export declare function useSignal<T>(signal: Signal<T> | (() => T)): T;
23
+ /**
24
+ * Subscribes the component to every signal reachable from `target` (see
25
+ * `touchSignals`) and rerenders it on any change. This is the single,
26
+ * coarse-grained subscription behind `useContext` — it keeps method
27
+ * reads like `settings.get(...)` reactive without any hooks inside the
28
+ * wrapContext proxy. Only signals reachable from the context object are
29
+ * covered — objects returned by service methods (e.g. a SubscriptionList)
30
+ * carry their own signals and are not subscribed.
31
+ *
32
+ * The effect body runs once synchronously when wired inside useEffect. On
33
+ * the first wiring it bumps the version unconditionally — so a signal
34
+ * change that lands between mount render and subscription is never lost
35
+ * (at the cost of one extra post-mount render). Rewires caused by a
36
+ * `target` identity change are silent: the outgoing effect stays live until
37
+ * the synchronous swap, so an unstable target degrades to subscription
38
+ * churn instead of an infinite rerender loop. (A signal reachable only
39
+ * from the new target changing before the swap is not caught.)
40
+ */
41
+ export declare function useContextSubscription(target: unknown): void;
23
42
  //# sourceMappingURL=signals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/preact/signals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAU,MAAM,EAAE,MAAM,aAAa,CAAC;AAI7C;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EACtC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAkCzB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CA8B7D"}
1
+ {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/preact/signals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAU,MAAM,EAAE,MAAM,aAAa,CAAC;AAK7C;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EACtC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAkCzB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CA8B7D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAiB5D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=useContextSubscription.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContextSubscription.test.d.ts","sourceRoot":"","sources":["../../src/preact/useContextSubscription.test.ts"],"names":[],"mappings":""}
package/dist/preact.js CHANGED
@@ -3,11 +3,12 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { effect, injectContext, provideContext, createCeRenderer, attachEmptyTracking } from "@juo/blocks";
5
5
  import { useState, useRef, useEffect, useContext as useContext$1, useMemo } from "preact/hooks";
6
- import { g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-VhmfGB3N.js";
7
- import { t } from "./block-VhmfGB3N.js";
6
+ import { g as getSignalValue, t as touchSignals, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-DnhzyZ1H.js";
7
+ import { a } from "./block-DnhzyZ1H.js";
8
8
  import { createContext, h, render } from "preact";
9
- import { g as getInstrumentation } from "./index-JSv6UH_o.js";
10
- import { a as createEditorBridge } from "./bridge-xiKEzCGR.js";
9
+ import { getHook } from "./devtools.js";
10
+ import { _ as __recordDevtoolsPropSetter, a as applyDevtoolsPropOverride } from "./block-BjJztStr.js";
11
+ import { a as createEditorBridge } from "./bridge-Mz0CqG6E.js";
11
12
  function toState(signal) {
12
13
  const [value, setValue] = useState(() => getSignalValue(signal));
13
14
  const disposeRef = useRef(null);
@@ -55,6 +56,23 @@ function useSignal(signal) {
55
56
  }, [signal]);
56
57
  return value;
57
58
  }
59
+ function useContextSubscription(target) {
60
+ const [, setVersion] = useState(0);
61
+ const everWiredRef = useRef(false);
62
+ useEffect(() => {
63
+ const isRewire = everWiredRef.current;
64
+ everWiredRef.current = true;
65
+ let initialRun = true;
66
+ return effect(() => {
67
+ touchSignals(target);
68
+ if (initialRun) {
69
+ initialRun = false;
70
+ if (isRewire) return;
71
+ }
72
+ setVersion((v) => v + 1);
73
+ });
74
+ }, [target]);
75
+ }
58
76
  const ContextProviderContext = createContext(null);
59
77
  function ContextProvider({ children }) {
60
78
  const [rootElement, setRootElement] = useState(null);
@@ -84,7 +102,9 @@ function useContext(context) {
84
102
  if (root == null) {
85
103
  throw new Error("ContextProvider not available");
86
104
  }
87
- return wrapContext(injectContext(root, context), toState);
105
+ const ctx = injectContext(root, context);
106
+ useContextSubscription(ctx);
107
+ return wrapContext(ctx);
88
108
  }
89
109
  function useBlockId() {
90
110
  const root = useContext$1(ContextProviderContext);
@@ -134,7 +154,12 @@ function createPreactRenderer(component) {
134
154
  wrapper
135
155
  );
136
156
  };
137
- renderTree(getInstrumentation().bindLiveProps(block, renderTree));
157
+ if (getHook()) {
158
+ __recordDevtoolsPropSetter(block.id, () => {
159
+ renderTree(applyDevtoolsPropOverride(block.id, block.props));
160
+ });
161
+ }
162
+ renderTree(applyDevtoolsPropOverride(block.id, block.props));
138
163
  attachEmptyTracking(wrapper);
139
164
  return wrapper;
140
165
  };
@@ -226,11 +251,12 @@ export {
226
251
  ContextProvider,
227
252
  createPreactCeRenderer,
228
253
  createPreactRenderer,
229
- t as toSignal,
254
+ a as toSignal,
230
255
  toState,
231
256
  useBlockId,
232
257
  useBridge,
233
258
  useContext,
259
+ useContextSubscription,
234
260
  useProvideContext,
235
261
  useSignal
236
262
  };
@@ -1,4 +1,4 @@
1
- import { r as resolveLayout } from "./css-runtime-ClH0MEYr.js";
1
+ import { r as resolveLayout } from "./css-runtime-B7tZrBIp.js";
2
2
  const MIN_BLOCK_ROWS = 2;
3
3
  const MIN_BLOCK_PX = 200;
4
4
  function resolveActiveBreakpoint(doc, containerWidthPx) {
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/react/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAwBjD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,GAAG,EACzC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAuCvC;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,GAAG,EAC3C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACjC,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAyEvC"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/react/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA4BjD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,GAAG,EACzC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAkDvC;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,GAAG,EAC3C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACjC,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAyEvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/react/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EAGX,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI3D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2EAsBpE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EACxD,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GACnB,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,cAAc,EACjD,OAAO,EAAE,CAAC,GACT,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAOtB;AAED,wBAAgB,UAAU,IAAI,MAAM,GAAG,IAAI,CAU1C;AAED,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/react/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,WAAW,EAGX,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI3D;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2EAsBpE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EACxD,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GACnB,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,cAAc,EACjD,OAAO,EAAE,CAAC,GACT,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAUtB;AAED,wBAAgB,UAAU,IAAI,MAAM,GAAG,IAAI,CAU1C;AAED,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=context.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.test.d.ts","sourceRoot":"","sources":["../../src/react/context.test.ts"],"names":[],"mappings":""}
@@ -20,4 +20,23 @@ export declare function toState<T extends object>(signal: Signal<T> | (() => T))
20
20
  * @returns The current value of the signal
21
21
  */
22
22
  export declare function useSignal<T>(signal: Signal<T> | (() => T)): T;
23
+ /**
24
+ * Subscribes the component to every signal reachable from `target` (see
25
+ * `touchSignals`) and rerenders it on any change. This is the single,
26
+ * coarse-grained subscription behind `useContext` — it keeps method
27
+ * reads like `settings.get(...)` reactive without any hooks inside the
28
+ * wrapContext proxy. Only signals reachable from the context object are
29
+ * covered — objects returned by service methods (e.g. a SubscriptionList)
30
+ * carry their own signals and are not subscribed.
31
+ *
32
+ * The effect body runs once synchronously when the store subscription is
33
+ * wired. On the first wiring it bumps the version unconditionally — so a
34
+ * signal change that lands between mount render and subscription is never
35
+ * lost (at the cost of one extra post-mount render). Rewires caused by a
36
+ * `target` identity change are silent: the outgoing effect stays live until
37
+ * the synchronous swap, so an unstable target degrades to subscription
38
+ * churn instead of an infinite rerender loop. (A signal reachable only
39
+ * from the new target changing before the swap is not caught.)
40
+ */
41
+ export declare function useContextSubscription(target: unknown): void;
23
42
  //# sourceMappingURL=signals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/react/signals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAU,MAAM,EAAE,MAAM,aAAa,CAAC;AAI7C;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EACtC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAkBzB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAY7D"}
1
+ {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/react/signals.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAU,MAAM,EAAE,MAAM,aAAa,CAAC;AAK7C;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EACtC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAkBzB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAY7D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAyB5D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=useContextSubscription.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContextSubscription.test.d.ts","sourceRoot":"","sources":["../../src/react/useContextSubscription.test.ts"],"names":[],"mappings":""}
package/dist/react.js CHANGED
@@ -2,12 +2,13 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { effect, injectContext, provideContext, createCeRenderer, attachEmptyTracking } from "@juo/blocks";
5
- import React, { useSyncExternalStore, createContext, useState, useContext as useContext$1, useMemo, useRef, useEffect } from "react";
6
- import { g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-VhmfGB3N.js";
7
- import { t } from "./block-VhmfGB3N.js";
5
+ import React, { useSyncExternalStore, useRef, useCallback, createContext, useState, useContext as useContext$1, useMemo, useEffect } from "react";
6
+ import { t as touchSignals, g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-DnhzyZ1H.js";
7
+ import { a } from "./block-DnhzyZ1H.js";
8
8
  import { createRoot } from "react-dom/client";
9
- import { g as getInstrumentation } from "./index-JSv6UH_o.js";
10
- import { a as createEditorBridge } from "./bridge-xiKEzCGR.js";
9
+ import { getHook } from "./devtools.js";
10
+ import { _ as __recordDevtoolsPropSetter, a as applyDevtoolsPropOverride } from "./block-BjJztStr.js";
11
+ import { a as createEditorBridge } from "./bridge-Mz0CqG6E.js";
11
12
  function toState(signal) {
12
13
  const subscribe = (callback) => {
13
14
  const dispose = effect(() => {
@@ -34,6 +35,29 @@ function useSignal(signal) {
34
35
  const getSnapshot = () => getSignalValue(signal);
35
36
  return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
36
37
  }
38
+ function useContextSubscription(target) {
39
+ const versionRef = useRef(0);
40
+ const everWiredRef = useRef(false);
41
+ const subscribe = useCallback(
42
+ (notify) => {
43
+ const isRewire = everWiredRef.current;
44
+ everWiredRef.current = true;
45
+ let initialRun = true;
46
+ return effect(() => {
47
+ touchSignals(target);
48
+ if (initialRun) {
49
+ initialRun = false;
50
+ if (isRewire) return;
51
+ }
52
+ versionRef.current++;
53
+ notify();
54
+ });
55
+ },
56
+ [target]
57
+ );
58
+ const getVersion = () => versionRef.current;
59
+ useSyncExternalStore(subscribe, getVersion, getVersion);
60
+ }
37
61
  const ContextProviderContext = createContext(null);
38
62
  function ContextProvider({ children }) {
39
63
  const [rootElement, setRootElement] = useState(null);
@@ -68,7 +92,9 @@ function useContext(context) {
68
92
  if (root == null) {
69
93
  throw new Error("ContextProvider not available");
70
94
  }
71
- return wrapContext(injectContext(root, context), toState);
95
+ const ctx = injectContext(root, context);
96
+ useContextSubscription(ctx);
97
+ return wrapContext(ctx);
72
98
  }
73
99
  function useBlockId() {
74
100
  const root = useContext$1(ContextProviderContext);
@@ -116,7 +142,12 @@ function createReactRenderer(component) {
116
142
  })
117
143
  );
118
144
  };
119
- renderTree(getInstrumentation().bindLiveProps(block, renderTree));
145
+ if (getHook()) {
146
+ __recordDevtoolsPropSetter(block.id, () => {
147
+ renderTree(applyDevtoolsPropOverride(block.id, block.props));
148
+ });
149
+ }
150
+ renderTree(applyDevtoolsPropOverride(block.id, block.props));
120
151
  attachEmptyTracking(wrapper);
121
152
  return wrapper;
122
153
  };
@@ -201,11 +232,12 @@ export {
201
232
  ContextProvider,
202
233
  createReactCeRenderer,
203
234
  createReactRenderer,
204
- t as toSignal,
235
+ a as toSignal,
205
236
  toState,
206
237
  useBlockId,
207
238
  useBridge,
208
239
  useContext,
240
+ useContextSubscription,
209
241
  useProvideContext,
210
242
  useSignal
211
243
  };
@@ -0,0 +1,8 @@
1
+ import { Customer } from './types';
2
+ import { ApiFetcher, Result } from '../../utils';
3
+ export interface CustomerAdapter {
4
+ getCurrent(): Promise<Result<Customer | null>>;
5
+ }
6
+ export declare function createMockCustomerAdapter(): CustomerAdapter;
7
+ export declare function createApiCustomerAdapter(fetcher: ApiFetcher): CustomerAdapter;
8
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/customer/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;CAChD;AAED,wBAAgB,yBAAyB,IAAI,eAAe,CAO3D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,eAAe,CAyB7E"}
@@ -1,6 +1,7 @@
1
- import { ContextType } from '../../context';
1
+ import { CustomerAdapter } from './adapter';
2
2
  import { CustomerService } from './types';
3
3
  type CreateCustomerServiceOptions = {
4
+ adapter: CustomerAdapter;
4
5
  /**
5
6
  * Absolute storefront URL for account / orders (Header `<a href>` + `target="_parent"`).
6
7
  * Called once when the service is created; hosts that need reactivity (portal) update
@@ -8,7 +9,7 @@ type CreateCustomerServiceOptions = {
8
9
  */
9
10
  getAccountOrdersUrl: () => string;
10
11
  };
11
- export declare function createCustomerService(options: CreateCustomerServiceOptions): ContextType<typeof CustomerServiceContext>;
12
+ export declare function createCustomerService(options: CreateCustomerServiceOptions): CustomerService;
12
13
  export declare const CustomerServiceContext: {
13
14
  __context__: CustomerService;
14
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"customerService.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAClC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAU5C;AAED,eAAO,MAAM,sBAAsB;;CACkB,CAAC"}
1
+ {"version":3,"file":"customerService.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,eAAe,CAajB;AAED,eAAO,MAAM,sBAAsB;;CACkB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { type CustomerService, type Customer } from './types';
2
2
  export { createCustomerService, CustomerServiceContext, } from './customerService';
3
+ export { type CustomerAdapter, createMockCustomerAdapter, createApiCustomerAdapter, } from './adapter';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/customer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/customer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,WAAW,CAAC"}
@@ -1,12 +1,15 @@
1
1
  import { Signal } from '@preact/signals-core';
2
+ import { Result } from '../../utils';
2
3
  /** Signed-in customer identity for blocks such as Header (name / email display). */
3
4
  export type Customer = {
4
5
  id: string;
5
6
  name: string;
6
- email: string;
7
+ email?: string;
8
+ metadata?: Record<string, unknown>;
7
9
  };
8
10
  export type CustomerService = {
9
11
  current: Signal<Customer | null>;
12
+ getCurrent(): Promise<Result<Customer | null>>;
10
13
  accountOrdersUrl: Signal<string>;
11
14
  };
12
15
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/customer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,oFAAoF;AACpF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/customer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,oFAAoF;AACpF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACjC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/C,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC"}
@@ -1,7 +1,10 @@
1
1
  export * from './customer';
2
2
  export * from './login';
3
- export * from './orders';
3
+ export * from './order';
4
4
  export * from './product';
5
5
  export * from './router';
6
+ export * from './schedules';
7
+ export * from './settings';
8
+ export * from './shop';
6
9
  export * from './subscription';
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { ApiFetcher, Result } from '../../utils';
2
+ export type AuthTokens = {
3
+ access_token: string;
4
+ refresh_token: string;
5
+ expires_in: number;
6
+ };
7
+ export interface LoginAdapter {
8
+ passwordlessStart(params: {
9
+ email: string;
10
+ lang: string;
11
+ }): Promise<Result<void>>;
12
+ authenticate(params: {
13
+ email: string;
14
+ code: string;
15
+ } | {
16
+ code: string;
17
+ } | {
18
+ refreshToken: string;
19
+ }): Promise<Result<AuthTokens>>;
20
+ getAuthorizeUrl(params: {
21
+ connection: "facebook" | "google-oauth2";
22
+ state: string;
23
+ shop: string;
24
+ }): string;
25
+ }
26
+ export declare function createMockLoginAdapter(opts?: {
27
+ appUrl?: string;
28
+ }): LoginAdapter;
29
+ export declare function createApiLoginAdapter(fetcher: ApiFetcher, opts: {
30
+ shopDomain: string;
31
+ appUrl: string;
32
+ }): LoginAdapter;
33
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/login/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGtD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,MAAM,EAAE;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1B,YAAY,CACV,MAAM,EACF;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAC/B;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAChB;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAC3B,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAE/B,eAAe,CAAC,MAAM,EAAE;QACtB,UAAU,EAAE,UAAU,GAAG,eAAe,CAAC;QACzC,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,MAAM,CAAC;CACZ;AAED,wBAAgB,sBAAsB,CACpC,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7B,YAAY,CAwBd;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3C,YAAY,CAoHd"}
@@ -13,11 +13,13 @@ type LoginService = {
13
13
  };
14
14
  isAuthenticated: Signal<boolean>;
15
15
  getToken(): Promise<string | null>;
16
+ getAuthHeaders(): Promise<Record<string, string>>;
16
17
  handleQueryParams(query: URLSearchParams): Promise<Result<void, ErrorDetails>>;
17
18
  logout(): Promise<Result>;
18
19
  };
19
20
  export declare const LoginServiceContext: {
20
21
  __context__: LoginService;
21
22
  };
22
- export { loginService, type LoginServiceDependencies, type ErrorFormatter, AuthenticationError, AuthenticationErrorReason, } from './loginService';
23
+ export { loginService, createLoginService, type LoginServiceDependencies, type ErrorFormatter, AuthenticationError, AuthenticationErrorReason, } from './loginService';
24
+ export { type LoginAdapter, type AuthTokens, createApiLoginAdapter, createMockLoginAdapter, } from './adapter';
23
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/login/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD,KAAK,YAAY,GAAG;IAClB,YAAY,EAAE;QACZ,KAAK,E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GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;YAC1D,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;SAC1E,CAAC;KACH,CAAC;IAEF,MAAM,EAAE;QACN,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;QAC5E,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;KAC3D,CAAC;IAEF,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAEjC,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEnC,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAElD,iBAAiB,CACf,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IAEvC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;CACe,CAAC;AAEhD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,WAAW,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Signal } from '@preact/signals-core';
2
+ import { LoginAdapter } from './adapter';
2
3
  export declare enum AuthenticationErrorReason {
3
4
  Expired = "expired",
4
5
  IncorrectCode = "wrong-code",
@@ -28,14 +29,15 @@ export type ErrorFormatter = (error: unknown | AuthenticationError) => {
28
29
  message: string;
29
30
  };
30
31
  export interface LoginServiceDependencies {
31
- apiUrl: string;
32
+ adapter: LoginAdapter;
32
33
  formatError: ErrorFormatter;
33
34
  router: RouterService;
34
35
  shop: ShopService;
35
36
  onLoginSuccess?: () => Promise<void>;
36
37
  }
37
38
  /**
38
- * @deprecated Use `createLoginService` instead
39
+ * @deprecated Use `createLoginService` instead.
40
+ * Constructs a real API adapter from `shop.rootUrl` for backward compatibility.
39
41
  */
40
42
  export declare function loginService(deps: {
41
43
  formatError: ErrorFormatter;
@@ -59,6 +61,7 @@ export declare function loginService(deps: {
59
61
  };
60
62
  isAuthenticated: Signal<boolean>;
61
63
  getToken(): Promise<string | null>;
64
+ getAuthHeaders(): Promise<Record<string, string>>;
62
65
  handleQueryParams(query: URLSearchParams): Promise<import('../../utils').Result<void, import('../../utils').ErrorDetails>>;
63
66
  logout(): Promise<import('../../utils').Result>;
64
67
  };
@@ -75,6 +78,7 @@ export declare function createLoginService(init: LoginServiceDependencies): {
75
78
  };
76
79
  isAuthenticated: Signal<boolean>;
77
80
  getToken(): Promise<string | null>;
81
+ getAuthHeaders(): Promise<Record<string, string>>;
78
82
  handleQueryParams(query: URLSearchParams): Promise<import('../../utils').Result<void, import('../../utils').ErrorDetails>>;
79
83
  logout(): Promise<import('../../utils').Result>;
80
84
  };
@@ -1 +1 @@
1
- {"version":3,"file":"loginService.d.ts","sourceRoot":"","sources":["../../../src/services/login/loginService.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAMxE,oBAAY,yBAAyB;IACnC,OAAO,YAAY;IACnB,aAAa,eAAe;IAC5B,YAAY,mBAAmB;IAC/B,OAAO,aAAa;IACpB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,MAAM,EAAE,yBAAyB,CAAC;I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AE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,WAAW,EAAE,cAAc,CAAC;IAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;;;;;;;;;;;;;;;;EAmBA;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,wBAAwB;;;;;;;;;;;;;;;;EA+MhE"}
@@ -0,0 +1,10 @@
1
+ import { ApiFetcher } from '../../utils';
2
+ import { OrderAdapter } from './types';
3
+ /**
4
+ * Returns a mock `OrderAdapter` with sample orders including customAttributes.
5
+ * Hosts can override the methods to seed real fixtures.
6
+ * Used as a starting point by storybook helpers (`createMockOrderService`) and theme preview.
7
+ */
8
+ export declare function createMockOrderAdapter(): OrderAdapter;
9
+ export declare function createApiOrderAdapter(fetcher: ApiFetcher): OrderAdapter;
10
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/order/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAoB,YAAY,EAAmB,MAAM,SAAS,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,YAAY,CA6DrD;AAwDD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY,CA2BvE"}
@@ -0,0 +1,4 @@
1
+ export type { GetOrdersParams, Order, OrderLine, OrderAdapter, OrderService, } from './types';
2
+ export { createMockOrderAdapter, createApiOrderAdapter } from './adapter';
3
+ export { createOrderService, OrderServiceContext, } from './orderService';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/order/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,KAAK,EACL,SAAS,EACT,YAAY,EACZ,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { OrderAdapter, OrderService } from './types';
2
+ export declare function createOrderService(adapter: OrderAdapter): OrderService;
3
+ export declare const OrderServiceContext: {
4
+ __context__: OrderService;
5
+ };
6
+ //# sourceMappingURL=orderService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderService.d.ts","sourceRoot":"","sources":["../../../src/services/order/orderService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAWtE;AAED,eAAO,MAAM,mBAAmB;;CACe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=orderService.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderService.test.d.ts","sourceRoot":"","sources":["../../../src/services/order/orderService.test.ts"],"names":[],"mappings":""}
@@ -50,11 +50,11 @@ export interface GetOrdersParams {
50
50
  */
51
51
  sort?: "placedAt";
52
52
  }
53
- /** Adapter consumed by `createOrdersService`. Hosts (customer portal, theme, storybook) implement this. */
54
- export interface OrdersAdapter {
53
+ /** Adapter consumed by `createOrderService`. Hosts (customer portal, theme, storybook) implement this. */
54
+ export interface OrderAdapter {
55
55
  getOrders(params?: GetOrdersParams): Promise<PaginatedList<Order>>;
56
56
  }
57
- export interface OrdersService {
57
+ export interface OrderService {
58
58
  getOrders(params?: GetOrdersParams): Promise<Result<PaginatedList<Order>>>;
59
59
  }
60
60
  //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/order/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,KAAK,GAAG,IAAI,CAAC;IAC3B,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,KAAK;IACpB,4GAA4G;IAC5G,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,oIAAoI;IACpI,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,4IAA4I;IAC5I,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,M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