@juo/blocks 1.13.0-alpha.2 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/dist/ExtensionRoot-CRJx0Dtr.js +378 -0
  2. package/dist/block.d.ts +0 -50
  3. package/dist/block.d.ts.map +1 -1
  4. package/dist/{bridge-r7Yk8fjY.js → bridge-D838SWmN.js} +147 -42
  5. package/dist/context.d.ts.map +1 -1
  6. package/dist/core.js +1120 -2157
  7. package/dist/css-runtime-DWytAzZ5.js +1532 -0
  8. package/dist/editor/bridge.d.ts +8 -7
  9. package/dist/editor/bridge.d.ts.map +1 -1
  10. package/dist/editor/canvas-mode-signal.d.ts +22 -0
  11. package/dist/editor/canvas-mode-signal.d.ts.map +1 -0
  12. package/dist/editor/canvas-mode.d.ts +15 -0
  13. package/dist/editor/canvas-mode.d.ts.map +1 -0
  14. package/dist/editor/canvas-mode.test.d.ts +2 -0
  15. package/dist/editor/canvas-mode.test.d.ts.map +1 -0
  16. package/dist/editor/components.d.ts +113 -0
  17. package/dist/editor/components.d.ts.map +1 -1
  18. package/dist/editor/components.test.d.ts.map +1 -1
  19. package/dist/editor/handler.d.ts.map +1 -1
  20. package/dist/editor/handler.test.d.ts +2 -0
  21. package/dist/editor/handler.test.d.ts.map +1 -0
  22. package/dist/editor/layout-command-emitter.d.ts +31 -0
  23. package/dist/editor/layout-command-emitter.d.ts.map +1 -0
  24. package/dist/editor/layout-command-emitter.test.d.ts +2 -0
  25. package/dist/editor/layout-command-emitter.test.d.ts.map +1 -0
  26. package/dist/editor/layout-system-signal.d.ts +21 -0
  27. package/dist/editor/layout-system-signal.d.ts.map +1 -0
  28. package/dist/editor/main.d.ts +2 -2
  29. package/dist/editor/main.d.ts.map +1 -1
  30. package/dist/editor/messages.d.ts +90 -14
  31. package/dist/editor/messages.d.ts.map +1 -1
  32. package/dist/editor/surface-context.d.ts +7 -0
  33. package/dist/editor/surface-context.d.ts.map +1 -0
  34. package/dist/editor/surface-context.test.d.ts +2 -0
  35. package/dist/editor/surface-context.test.d.ts.map +1 -0
  36. package/dist/editor/wrapper-shared.d.ts +31 -0
  37. package/dist/editor/wrapper-shared.d.ts.map +1 -0
  38. package/dist/editor.js +887 -88
  39. package/dist/flows/WorkflowService.d.ts +2 -0
  40. package/dist/flows/WorkflowService.d.ts.map +1 -1
  41. package/dist/gridstack-adapter-DreG3XnB.js +5490 -0
  42. package/dist/layout/css-runtime.d.ts +41 -0
  43. package/dist/layout/css-runtime.d.ts.map +1 -0
  44. package/dist/layout/css-runtime.test.d.ts +2 -0
  45. package/dist/layout/css-runtime.test.d.ts.map +1 -0
  46. package/dist/layout/derive.d.ts +4 -0
  47. package/dist/layout/derive.d.ts.map +1 -0
  48. package/dist/layout/derive.test.d.ts +2 -0
  49. package/dist/layout/derive.test.d.ts.map +1 -0
  50. package/dist/layout/dividers.d.ts +34 -0
  51. package/dist/layout/dividers.d.ts.map +1 -0
  52. package/dist/layout/dividers.test.d.ts +2 -0
  53. package/dist/layout/dividers.test.d.ts.map +1 -0
  54. package/dist/layout/engine.d.ts +3 -0
  55. package/dist/layout/engine.d.ts.map +1 -0
  56. package/dist/layout/engine.test.d.ts +2 -0
  57. package/dist/layout/engine.test.d.ts.map +1 -0
  58. package/dist/layout/grid-utils.d.ts +57 -0
  59. package/dist/layout/grid-utils.d.ts.map +1 -0
  60. package/dist/layout/grid-utils.test.d.ts +2 -0
  61. package/dist/layout/grid-utils.test.d.ts.map +1 -0
  62. package/dist/layout/index.d.ts +12 -0
  63. package/dist/layout/index.d.ts.map +1 -0
  64. package/dist/layout/index.test.d.ts +2 -0
  65. package/dist/layout/index.test.d.ts.map +1 -0
  66. package/dist/layout/insert.d.ts +31 -0
  67. package/dist/layout/insert.d.ts.map +1 -0
  68. package/dist/layout/insert.test.d.ts +2 -0
  69. package/dist/layout/insert.test.d.ts.map +1 -0
  70. package/dist/layout/project-css.d.ts +6 -0
  71. package/dist/layout/project-css.d.ts.map +1 -0
  72. package/dist/layout/project-css.test.d.ts +2 -0
  73. package/dist/layout/project-css.test.d.ts.map +1 -0
  74. package/dist/layout/project-gridstack.d.ts +50 -0
  75. package/dist/layout/project-gridstack.d.ts.map +1 -0
  76. package/dist/layout/project-gridstack.test.d.ts +2 -0
  77. package/dist/layout/project-gridstack.test.d.ts.map +1 -0
  78. package/dist/layout/reconcile.d.ts +22 -0
  79. package/dist/layout/reconcile.d.ts.map +1 -0
  80. package/dist/layout/reconcile.test.d.ts +2 -0
  81. package/dist/layout/reconcile.test.d.ts.map +1 -0
  82. package/dist/layout/types.d.ts +118 -0
  83. package/dist/layout/types.d.ts.map +1 -0
  84. package/dist/layout-mode-adapter-BBd4JRQd.js +21 -0
  85. package/dist/main.d.ts +8 -4
  86. package/dist/main.d.ts.map +1 -1
  87. package/dist/morph-Dj-xvrwt.js +182 -0
  88. package/dist/preact.js +1 -1
  89. package/dist/project-gridstack-DYLMKSH1.js +52 -0
  90. package/dist/react.js +1 -1
  91. package/dist/services/customer/customerService.d.ts +2 -3
  92. package/dist/services/customer/customerService.d.ts.map +1 -1
  93. package/dist/services/customer/index.d.ts +0 -1
  94. package/dist/services/customer/index.d.ts.map +1 -1
  95. package/dist/services/customer/types.d.ts +1 -4
  96. package/dist/services/customer/types.d.ts.map +1 -1
  97. package/dist/services/index.d.ts +0 -3
  98. package/dist/services/index.d.ts.map +1 -1
  99. package/dist/services/login/index.d.ts +1 -3
  100. package/dist/services/login/index.d.ts.map +1 -1
  101. package/dist/services/login/loginService.d.ts +2 -6
  102. package/dist/services/login/loginService.d.ts.map +1 -1
  103. package/dist/services/orders/adapter.d.ts +0 -2
  104. package/dist/services/orders/adapter.d.ts.map +1 -1
  105. package/dist/services/orders/index.d.ts +1 -1
  106. package/dist/services/orders/index.d.ts.map +1 -1
  107. package/dist/services/product/adapter.d.ts +2 -27
  108. package/dist/services/product/adapter.d.ts.map +1 -1
  109. package/dist/services/product/index.d.ts +1 -1
  110. package/dist/services/product/index.d.ts.map +1 -1
  111. package/dist/services/product/productService.d.ts.map +1 -1
  112. package/dist/services/product/types.d.ts +0 -68
  113. package/dist/services/product/types.d.ts.map +1 -1
  114. package/dist/services/subscription/adapter.d.ts +2 -77
  115. package/dist/services/subscription/adapter.d.ts.map +1 -1
  116. package/dist/services/subscription/index.d.ts +1 -1
  117. package/dist/services/subscription/index.d.ts.map +1 -1
  118. package/dist/services/subscription/subscriptionService.d.ts +6 -1
  119. package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
  120. package/dist/services/subscription/types.d.ts +9 -220
  121. package/dist/services/subscription/types.d.ts.map +1 -1
  122. package/dist/theme-state.d.ts +17 -2
  123. package/dist/theme-state.d.ts.map +1 -1
  124. package/dist/theme-state.layout.test.d.ts +2 -0
  125. package/dist/theme-state.layout.test.d.ts.map +1 -0
  126. package/dist/theme-state.test.d.ts +2 -0
  127. package/dist/theme-state.test.d.ts.map +1 -0
  128. package/dist/utils/index.d.ts +0 -6
  129. package/dist/utils/index.d.ts.map +1 -1
  130. package/dist/vue/block.d.ts.map +1 -1
  131. package/dist/vue.js +4 -25
  132. package/dist/web-components/ExtensionRoot.d.ts +50 -3
  133. package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
  134. package/dist/web-components/editor/ExtensionRoot.d.ts +11 -0
  135. package/dist/web-components/editor/ExtensionRoot.d.ts.map +1 -0
  136. package/dist/web-components/editor/ExtensionRoot.test.d.ts +2 -0
  137. package/dist/web-components/editor/ExtensionRoot.test.d.ts.map +1 -0
  138. package/dist/web-components/editor/InlineText.d.ts +1 -0
  139. package/dist/web-components/editor/InlineText.d.ts.map +1 -1
  140. package/dist/web-components/editor/editor-layout-controller.d.ts +28 -0
  141. package/dist/web-components/editor/editor-layout-controller.d.ts.map +1 -0
  142. package/dist/web-components/editor/gridstack-adapter.d.ts +3 -0
  143. package/dist/web-components/editor/gridstack-adapter.d.ts.map +1 -0
  144. package/dist/web-components/editor/gridstack-adapter.test.d.ts +2 -0
  145. package/dist/web-components/editor/gridstack-adapter.test.d.ts.map +1 -0
  146. package/dist/web-components/editor/morph.d.ts +32 -0
  147. package/dist/web-components/editor/morph.d.ts.map +1 -0
  148. package/dist/web-components/editor/morph.test.d.ts +2 -0
  149. package/dist/web-components/editor/morph.test.d.ts.map +1 -0
  150. package/dist/web-components/layout/layout-controller.d.ts +55 -0
  151. package/dist/web-components/layout/layout-controller.d.ts.map +1 -0
  152. package/dist/web-components/layout/view-layout-controller.d.ts +17 -0
  153. package/dist/web-components/layout/view-layout-controller.d.ts.map +1 -0
  154. package/dist/web-components/layout/view-layout-controller.test.d.ts +2 -0
  155. package/dist/web-components/layout/view-layout-controller.test.d.ts.map +1 -0
  156. package/dist/web-components/layout-grid.d.ts +47 -0
  157. package/dist/web-components/layout-grid.d.ts.map +1 -0
  158. package/dist/web-components/layout-grid.test.d.ts +2 -0
  159. package/dist/web-components/layout-grid.test.d.ts.map +1 -0
  160. package/dist/web-components/layout-mode-adapter.d.ts +51 -0
  161. package/dist/web-components/layout-mode-adapter.d.ts.map +1 -0
  162. package/dist/web-components/layout-mode-adapter.test.d.ts +2 -0
  163. package/dist/web-components/layout-mode-adapter.test.d.ts.map +1 -0
  164. package/dist/web-components-editor.js +125 -18
  165. package/dist/web-components-runtime.js +4 -4
  166. package/package.json +3 -2
  167. package/dist/ExtensionRoot-peABLAZZ.js +0 -231
  168. package/dist/block-B6s9jL7l.js +0 -966
  169. package/dist/block.devtools.test.d.ts +0 -2
  170. package/dist/block.devtools.test.d.ts.map +0 -1
  171. package/dist/context.devtools.test.d.ts +0 -2
  172. package/dist/context.devtools.test.d.ts.map +0 -1
  173. package/dist/devtools/env.d.ts +0 -3
  174. package/dist/devtools/env.d.ts.map +0 -1
  175. package/dist/devtools/hook.d.ts +0 -35
  176. package/dist/devtools/hook.d.ts.map +0 -1
  177. package/dist/devtools/index.d.ts +0 -4
  178. package/dist/devtools/index.d.ts.map +0 -1
  179. package/dist/devtools/protocol.d.ts +0 -91
  180. package/dist/devtools/protocol.d.ts.map +0 -1
  181. package/dist/devtools.js +0 -44
  182. package/dist/editor/overlays.d.ts +0 -14
  183. package/dist/editor/overlays.d.ts.map +0 -1
  184. package/dist/editor/overlays.test.d.ts +0 -2
  185. package/dist/editor/overlays.test.d.ts.map +0 -1
  186. package/dist/juo-workflow-DY4rd256.js +0 -868
  187. package/dist/overlay-wrapper.d.ts +0 -69
  188. package/dist/overlay-wrapper.d.ts.map +0 -1
  189. package/dist/overlay-wrapper.test.d.ts +0 -2
  190. package/dist/overlay-wrapper.test.d.ts.map +0 -1
  191. package/dist/overlays/OverlayService.d.ts +0 -34
  192. package/dist/overlays/OverlayService.d.ts.map +0 -1
  193. package/dist/overlays/OverlayService.test.d.ts +0 -2
  194. package/dist/overlays/OverlayService.test.d.ts.map +0 -1
  195. package/dist/registry.devtools.test.d.ts +0 -2
  196. package/dist/registry.devtools.test.d.ts.map +0 -1
  197. package/dist/services/customer/adapter.d.ts +0 -8
  198. package/dist/services/customer/adapter.d.ts.map +0 -1
  199. package/dist/services/login/adapter.d.ts +0 -32
  200. package/dist/services/login/adapter.d.ts.map +0 -1
  201. package/dist/services/order/adapter.d.ts +0 -9
  202. package/dist/services/order/adapter.d.ts.map +0 -1
  203. package/dist/services/order/index.d.ts +0 -5
  204. package/dist/services/order/index.d.ts.map +0 -1
  205. package/dist/services/order/orderService.d.ts +0 -7
  206. package/dist/services/order/orderService.d.ts.map +0 -1
  207. package/dist/services/order/types.d.ts +0 -21
  208. package/dist/services/order/types.d.ts.map +0 -1
  209. package/dist/services/product/adapter.test.d.ts +0 -2
  210. package/dist/services/product/adapter.test.d.ts.map +0 -1
  211. package/dist/services/schedules/adapter.d.ts +0 -71
  212. package/dist/services/schedules/adapter.d.ts.map +0 -1
  213. package/dist/services/schedules/adapter.test.d.ts +0 -2
  214. package/dist/services/schedules/adapter.test.d.ts.map +0 -1
  215. package/dist/services/schedules/index.d.ts +0 -5
  216. package/dist/services/schedules/index.d.ts.map +0 -1
  217. package/dist/services/schedules/schedulesService.d.ts +0 -11
  218. package/dist/services/schedules/schedulesService.d.ts.map +0 -1
  219. package/dist/services/schedules/schedulesService.test.d.ts +0 -2
  220. package/dist/services/schedules/schedulesService.test.d.ts.map +0 -1
  221. package/dist/services/schedules/types.d.ts +0 -226
  222. package/dist/services/schedules/types.d.ts.map +0 -1
  223. package/dist/services/settings/index.d.ts +0 -3
  224. package/dist/services/settings/index.d.ts.map +0 -1
  225. package/dist/services/settings/settingsService.d.ts +0 -7
  226. package/dist/services/settings/settingsService.d.ts.map +0 -1
  227. package/dist/services/settings/settingsService.test.d.ts +0 -2
  228. package/dist/services/settings/settingsService.test.d.ts.map +0 -1
  229. package/dist/services/settings/types.d.ts +0 -35
  230. package/dist/services/settings/types.d.ts.map +0 -1
  231. package/dist/services/shop/index.d.ts +0 -3
  232. package/dist/services/shop/index.d.ts.map +0 -1
  233. package/dist/services/shop/shopService.d.ts +0 -12
  234. package/dist/services/shop/shopService.d.ts.map +0 -1
  235. package/dist/services/shop/shopService.test.d.ts +0 -2
  236. package/dist/services/shop/shopService.test.d.ts.map +0 -1
  237. package/dist/services/shop/types.d.ts +0 -7
  238. package/dist/services/shop/types.d.ts.map +0 -1
  239. package/dist/services/subscription/adapter.test.d.ts +0 -2
  240. package/dist/services/subscription/adapter.test.d.ts.map +0 -1
  241. package/dist/services/subscription/types.test.d.ts +0 -2
  242. package/dist/services/subscription/types.test.d.ts.map +0 -1
  243. package/dist/theme-state.params.test.d.ts +0 -2
  244. package/dist/theme-state.params.test.d.ts.map +0 -1
  245. package/dist/theme-state.translations.test.d.ts +0 -2
  246. package/dist/theme-state.translations.test.d.ts.map +0 -1
@@ -1,26 +1,13 @@
1
- import { ApiFetcher, PaginatedList, Result } from '../../utils';
2
- import { Subscription, SellingPlan, SellingPlanInterval, SearchOptions, PostableSubscriptionItem, UpdateSubscriptionItem, UpdateBoxItem, LastOrder, RenewNowResult, UpsellProduct } from './types';
1
+ import { Subscription, SellingPlan, SearchOptions, PostableSubscriptionItem } from './types';
3
2
  import { ApplyDiscountError, DiscountRejectionReason, RemoveDiscountError } from './discountErrors';
4
- import { ProductAdapter } from '../product/adapter';
3
+ import { Result, PaginatedList } from '../../utils';
5
4
  /**
6
5
  * Adapter interface for subscription.
7
6
  * Implementations should handle API calls, error handling, and data transformation.
8
7
  */
9
8
  export interface SubscriptionAdapter {
10
9
  search(options?: SearchOptions): Promise<Result<PaginatedList<Subscription>>>;
11
- /**
12
- * Returns the full list of the customer's subscriptions for cross-subscription
13
- * views (the "other subscriptions" list and the product strip), ordered with
14
- * active/paused first. Unlike `search` (a single v1 page sorted createdAt:asc),
15
- * this is sourced from the richer legacy list endpoint so active subscriptions
16
- * are never paginated out behind older canceled ones. Optional: when an adapter
17
- * does not implement it, the service falls back to `search`.
18
- */
19
- listAll?(): Promise<Result<Subscription[]>>;
20
10
  getById(id: string): Promise<Result<Subscription | null>>;
21
- getLastOrder(params: {
22
- subscriptionId: string;
23
- }): Promise<Result<LastOrder | null>>;
24
11
  addItem(params: {
25
12
  subscriptionId: string;
26
13
  item: PostableSubscriptionItem;
@@ -29,31 +16,6 @@ export interface SubscriptionAdapter {
29
16
  subscriptionId: string;
30
17
  itemId: string;
31
18
  }): Promise<Result>;
32
- updateItem(params: {
33
- subscriptionId: string;
34
- lineId: string;
35
- update: UpdateSubscriptionItem;
36
- }): Promise<Result>;
37
- skipLineItem(params: {
38
- subscriptionId: string;
39
- lineId: string;
40
- nextBillingDate: string;
41
- }): Promise<Result>;
42
- updateBoxItems(params: {
43
- subscriptionId: string;
44
- parentId: string;
45
- items: UpdateBoxItem[];
46
- shippingMethodHandle?: string;
47
- }): Promise<Result>;
48
- updateItemAttributes(params: {
49
- subscriptionId: string;
50
- lineId: string;
51
- customAttributes: Record<string, string>;
52
- }): Promise<Result>;
53
- updateAttributes(params: {
54
- subscriptionId: string;
55
- customAttributes: Record<string, string>;
56
- }): Promise<Result>;
57
19
  addDiscount(params: {
58
20
  subscriptionId: string;
59
21
  code: string;
@@ -66,16 +28,6 @@ export interface SubscriptionAdapter {
66
28
  subscriptionId: string;
67
29
  newDate: string;
68
30
  }): Promise<Result<Subscription>>;
69
- /**
70
- * Replace the customer-visible custom attributes on a subscription. `customAttributes`
71
- * is the complete desired set of customer-editable keys — keys omitted are removed.
72
- * Internal (`_`-prefixed) / reserved keys are always preserved server-side and must
73
- * not be sent (the API rejects them with 400).
74
- */
75
- updateCustomAttributes(params: {
76
- subscriptionId: string;
77
- customAttributes: Record<string, string>;
78
- }): Promise<Result<Subscription>>;
79
31
  resume(params: {
80
32
  subscriptionId: string;
81
33
  }): Promise<Result<Subscription>>;
@@ -89,28 +41,10 @@ export interface SubscriptionAdapter {
89
41
  subscriptionId: string;
90
42
  reason?: string;
91
43
  }): Promise<Result<Subscription>>;
92
- renewNow(params: {
93
- subscriptionId: string;
94
- renewalId?: string;
95
- retry?: boolean;
96
- }): Promise<Result<RenewNowResult>>;
97
- changeFrequency(params: {
98
- subscriptionId: string;
99
- plan: string | SellingPlanInterval;
100
- }): Promise<Result<Subscription>>;
101
44
  getAvailablePlans(params: {
102
45
  subscriptionId: string;
103
46
  }): Promise<Result<SellingPlan[]>>;
104
47
  getDefaultSubscriptionId(): Promise<Result<string | null>>;
105
- getUpsellProducts?(params: {
106
- subscriptionId: string;
107
- }): Promise<Result<UpsellProduct[]>>;
108
- addUpsellProduct?(params: {
109
- subscriptionId: string;
110
- variantId: string;
111
- quantity: number;
112
- oneTime?: boolean;
113
- }): Promise<Result>;
114
48
  }
115
49
  export interface MockSubscriptionAdapterOptions {
116
50
  addDiscountBehavior?: {
@@ -128,15 +62,6 @@ export interface MockSubscriptionAdapterOptions {
128
62
  kind: "error";
129
63
  error: "NETWORK" | "UNKNOWN" | "SUBSCRIPTION_NOT_FOUND" | "DISCOUNT_NOT_FOUND";
130
64
  };
131
- /**
132
- * Optional product source used by `addItem` to resolve a real title/price for
133
- * an added line. Without it, added lines fall back to a placeholder title and
134
- * a 0.00 price (the two mock stores are otherwise independent). Pass the same
135
- * `createMockProductAdapter()` instance that backs the ProductService so the
136
- * added line matches what the product picker showed.
137
- */
138
- productAdapter?: Pick<ProductAdapter, "getByVariantId" | "getById">;
139
65
  }
140
66
  export declare function createMockSubscriptionAdapter(options?: MockSubscriptionAdapterOptions): SubscriptionAdapter;
141
- export declare function createApiSubscriptionAdapter(fetcher: ApiFetcher): SubscriptionAdapter;
142
67
  //# sourceMappingURL=adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAE9E;;;;;;;OAOG;IACH,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAE5C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC;IAE1D,YAAY,CAAC,MAAM,EAAE;QACnB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC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A;KAAE,GACnB;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,MAAM,EAAE,uBAAuB,CAAA;KAAE,GACrD;QACE,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,wBAAwB,CAAC;KACzD,CAAC;IACN,sBAAsB,CAAC,EACnB;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,GACnB;QACE,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EACD,SAAS,GACT,SAAS,GACT,wBAAwB,GACxB,oBAAoB,CAAC;KAC1B,CAAC;CACP;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,8BAAmC,GAC3C,mBAAmB,CAiTrB"}
@@ -1,5 +1,5 @@
1
1
  export type { SubscriptionAdapter, MockSubscriptionAdapterOptions } from './adapter';
2
- export { createMockSubscriptionAdapter, createApiSubscriptionAdapter } from './adapter';
2
+ export { createMockSubscriptionAdapter } from './adapter';
3
3
  export { createSubscriptionService, SubscriptionServiceContext } from './subscriptionService';
4
4
  export * from './types';
5
5
  export * from './discountErrors';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAExF,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE9F,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE9F,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
@@ -1,7 +1,12 @@
1
+ import { ContextType } from '../../context';
1
2
  import { SubscriptionAdapter } from './adapter';
2
3
  import { SubscriptionService } from './types';
3
4
  export declare const SubscriptionServiceContext: {
4
5
  __context__: SubscriptionService;
5
6
  };
6
- export declare function createSubscriptionService(adapter: SubscriptionAdapter): SubscriptionService;
7
+ /**
8
+ * Creates a subscription service that uses the provided adapter for data operations.
9
+ * The adapter pattern decouples the service from specific SDK implementations.
10
+ */
11
+ export declare function createSubscriptionService(adapter: SubscriptionAdapter): ContextType<typeof SubscriptionServiceContext>;
7
12
  //# sourceMappingURL=subscriptionService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptionService.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAMV,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,0BAA0B;;CACsB,CAAC;AA2B9D,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,GAC3B,mBAAmB,CAsLrB"}
1
+ {"version":3,"file":"subscriptionService.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAGV,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,0BAA0B;;CACsB,CAAC;AAqC9D;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,GAC3B,WAAW,CAAC,OAAO,0BAA0B,CAAC,CAmGhD"}
@@ -8,27 +8,6 @@ export interface SubscriptionItem {
8
8
  quantity: number;
9
9
  price: PriceWithCurrency;
10
10
  nextDeliveryDate?: Date | null;
11
- /** Optional fields populated when host carries the richer SDK shape (e.g. RenewalSummary). */
12
- isUpsell?: boolean;
13
- isVirtual?: boolean;
14
- nextBillingDate?: string | null;
15
- lineDiscountedPrice?: PriceWithCurrency;
16
- currentPrice?: PriceWithCurrency;
17
- variantAvailableForSale?: boolean;
18
- billingPolicy?: SellingPlanInterval | null;
19
- deliveryPolicy?: SellingPlanInterval | null;
20
- /** Human-readable product/line title (legacy line.title). */
21
- title?: string;
22
- variantTitle?: string;
23
- recurringCycleLimit?: number | null;
24
- /** Box grouping: parent subscription LINE id (primary) and parent PRODUCT id (fallback). */
25
- parentLineId?: string;
26
- parentProductId?: string;
27
- parentProductHandle?: string;
28
- variantImage?: {
29
- url: string;
30
- altText?: string;
31
- };
32
11
  customAttributes?: Array<{
33
12
  key: string;
34
13
  value: string;
@@ -38,16 +17,6 @@ export interface PostableSubscriptionItem {
38
17
  variantId: string;
39
18
  quantity: number;
40
19
  }
41
- export interface UpdateSubscriptionItem {
42
- variantId?: string;
43
- quantity?: number;
44
- billingPolicy?: SellingPlanInterval;
45
- shippingMethodHandle?: string;
46
- }
47
- export interface UpdateBoxItem {
48
- variantId: string;
49
- quantity: number;
50
- }
51
20
  export interface SubscriptionDiscount {
52
21
  id: string;
53
22
  type: "percentage" | "fixed_amount";
@@ -55,15 +24,6 @@ export interface SubscriptionDiscount {
55
24
  code?: string;
56
25
  description?: string;
57
26
  }
58
- export interface ShippingMethodOption {
59
- handle: string;
60
- title: string;
61
- price?: PriceWithCurrency;
62
- }
63
- export interface DeliveryMethodConflict {
64
- code: "DELIVERY_METHOD_CONFLICT";
65
- availableShippingMethods: ShippingMethodOption[];
66
- }
67
27
  export interface Subscription {
68
28
  id: string;
69
29
  items: SubscriptionItem[];
@@ -83,115 +43,12 @@ export interface SellingPlanInterval {
83
43
  intervalCount: number;
84
44
  interval: string;
85
45
  }
86
- export interface SubscriptionBillingPolicy extends SellingPlanInterval {
87
- minCycles?: number;
88
- }
89
- export interface SubscriptionDeliveryAnchor {
90
- day: number;
91
- month?: number;
92
- type: "MONTHDAY" | "WEEKDAY" | "YEARDAY";
93
- }
94
- export interface SubscriptionDeliveryPolicy extends SellingPlanInterval {
95
- anchors?: SubscriptionDeliveryAnchor[];
96
- }
97
- export interface SubscriptionPaymentInstrument {
98
- type: string;
99
- brand?: string;
100
- maskedNumber?: string;
101
- }
102
- export interface SubscriptionPaymentMethod {
103
- id: string;
104
- instrument?: SubscriptionPaymentInstrument | null;
105
- active?: boolean;
106
- isRecurring?: boolean;
107
- }
108
- export interface SubscriptionDeliveryAddress {
109
- firstName?: string;
110
- lastName?: string;
111
- address1?: string;
112
- address2?: string;
113
- zip?: string;
114
- city?: string;
115
- countryCode?: string;
116
- province?: string;
117
- }
118
- export interface SubscriptionDeliveryOption {
119
- title?: string;
120
- presentmentTitle?: string;
121
- description?: string;
122
- }
123
- /**
124
- * Delivery method for a subscription. Populated by the real adapter from the
125
- * legacy list endpoint (v1 does not return it). Used by ContractSelect to show
126
- * the delivery address and method.
127
- */
128
- export interface SubscriptionDeliveryMethod {
129
- address?: SubscriptionDeliveryAddress | null;
130
- shippingOption?: SubscriptionDeliveryOption | null;
131
- pickupOption?: SubscriptionDeliveryOption | null;
132
- localDeliveryOption?: SubscriptionDeliveryOption | null;
133
- }
134
- export interface SubscriptionBillingAttempt {
135
- date: string;
136
- attempt?: number;
137
- ready?: boolean;
138
- }
139
- export interface SubscriptionRenewal {
140
- id: string;
141
- /** True while the renewal is actively being processed — used to disable renew-now. */
142
- isInActiveProcessState?: boolean;
143
- }
144
- export interface SubscriptionPausePeriod {
145
- start: string;
146
- end: string;
147
- }
148
- export interface Subscription {
149
- id: string;
150
- customerId: string;
151
- items: SubscriptionItem[];
152
- discounts: SubscriptionDiscount[];
153
- status: "active" | "paused" | "canceled" | "expired" | "failed";
154
- nextDeliveryDate: Date | null;
155
- frequency: string;
156
- createdAt: string;
157
- updatedAt: string;
158
- /** Optional fields populated by hosts that carry the richer SDK shape. */
159
- billingPolicy?: SubscriptionBillingPolicy;
160
- deliveryPolicy?: SubscriptionDeliveryPolicy;
161
- nextBillingDate?: string | null;
162
- nextBillingAttempt?: SubscriptionBillingAttempt | null;
163
- lastBillingAttempt?: SubscriptionBillingAttempt | null;
164
- nextFulfillment?: string | null;
165
- estimatedOrderDate?: string | null;
166
- customerPaymentMethod?: SubscriptionPaymentMethod | null;
167
- requiredBillingCyclesLeft?: number;
168
- renewal?: SubscriptionRenewal | null;
169
- pausePeriod?: SubscriptionPausePeriod | null;
170
- lastPaymentStatus?: "succeeded" | "failed" | "pending" | string;
171
- /** False when the subscription contains a membership product (from the legacy endpoint). Undefined = unknown → treat as editable. */
172
- isEditable?: boolean;
173
- /**
174
- * Human-readable sequential reference number (e.g. "1042"). Populated by the real adapter
175
- * from the customer v1 API `serial` field. Used by ContractSelect for the subscription
176
- * reference display.
177
- */
178
- serial?: string;
179
- /**
180
- * Delivery address + shipping/pickup option. Populated by the real adapter from
181
- * the legacy list endpoint (v1 does not return it). Used by ContractSelect.
182
- */
183
- deliveryMethod?: SubscriptionDeliveryMethod | null;
184
- }
185
46
  export interface SellingPlan {
186
47
  id: string;
187
48
  name: string;
188
49
  billingPolicy: SellingPlanInterval;
189
50
  deliveryPolicy: SellingPlanInterval;
190
51
  }
191
- export interface LastOrder {
192
- id: string;
193
- createdAt: string;
194
- }
195
52
  export interface SubscriptionFilter {
196
53
  id?: string;
197
54
  serial?: string;
@@ -210,33 +67,15 @@ export interface SearchOptions {
210
67
  after: string;
211
68
  };
212
69
  }
213
- export type RenewNowResult = {
214
- nextActionUrl?: string;
215
- result?: "success" | "pending" | "failure";
216
- };
217
- export interface UpsellProduct {
218
- id: string;
219
- variantId: string;
220
- title: string;
221
- imageUrl?: string;
222
- price: PriceWithCurrency;
223
- description?: string;
224
- /**
225
- * True when the upsell rule is recurring (added to every renewal).
226
- * False when it is a one-time add (renewalLimit=1 on the order).
227
- * Populated by the real adapter from the `variants[].recurring` field in the
228
- * `/customer/subscriptions/{id}/upsell-products` response (PreparedProductSchema).
229
- */
230
- recurring?: boolean;
231
- }
232
70
  export type SubscriptionService = {
233
- current: Signal<Subscription | null>;
234
- hasPendingBilling: Signal<boolean>;
71
+ search(options?: SearchOptions): Promise<Result<PaginatedList<Subscription>>>;
72
+ getById(id: string): Promise<Result<Subscription | null>>;
73
+ getCurrentSubscriptionId(): string | null;
235
74
  /**
236
- * Last order placed for the host's current subscription (or `null` when none / not loaded).
237
- * Hydrated alongside `current` by the host.
75
+ * Subscription the host treats as in focus (e.g. detail page), or `null`. Preact `Signal`;
76
+ * the service factory creates it; hosts sync route or other context by assigning `current.value`.
238
77
  */
239
- lastOrder: Signal<LastOrder | null>;
78
+ current: Signal<Subscription | null>;
240
79
  /**
241
80
  * Monotonically-increasing counter that bumps after every successful
242
81
  * `addDiscount`/`removeDiscount`. Consumers (e.g. the customer portal page)
@@ -244,73 +83,23 @@ export type SubscriptionService = {
244
83
  * subscription's discounts.
245
84
  */
246
85
  discountsChangedAt: ReadonlySignal<number>;
247
- search(options?: SearchOptions): Promise<Result<PaginatedList<Subscription>>>;
248
- /**
249
- * Full cross-subscription list (active/paused first) for the "other subscriptions"
250
- * list and product strip. Sourced from the legacy list endpoint by the real adapter
251
- * so active subscriptions are never paginated out. Falls back to `search` when the
252
- * adapter does not implement `listAll` (e.g. the editor mock).
253
- */
254
- listAll(): Promise<Result<Subscription[]>>;
255
- getById(id: string): Promise<Result<Subscription | null>>;
256
- getCurrentSubscriptionId(): string | null;
257
- getAvailablePlans(subscriptionId: string): Promise<Result<SellingPlan[]>>;
258
- getDefaultSubscriptionId(): Promise<Result<string | null>>;
259
- getUpsellProducts(params: {
260
- subscriptionId: string;
261
- }): Promise<Result<UpsellProduct[]>>;
262
86
  /**
263
87
  * Monotonically-increasing counter that bumps after every successful
264
- * `addItem`/`removeItem`/`updateItem`. Consumers (e.g. the customer portal page) can watch
88
+ * `addItem`/`removeItem`. Consumers (e.g. the customer portal page) can watch
265
89
  * this signal to re-fetch any non-blocks state that depends on the
266
90
  * subscription's line items.
267
91
  */
268
92
  itemsChangedAt: ReadonlySignal<number>;
269
93
  addItem(subscriptionId: string, item: PostableSubscriptionItem): Promise<Result>;
270
94
  removeItem(subscriptionId: string, itemId: string): Promise<Result>;
271
- updateItem(subscriptionId: string, lineId: string, update: UpdateSubscriptionItem): Promise<Result>;
272
- updateItemAttributes(subscriptionId: string, lineId: string, customAttributes: Record<string, string>): Promise<Result>;
273
- updateAttributes(subscriptionId: string, customAttributes: Record<string, string>): Promise<Result>;
274
- skipLineItem(subscriptionId: string, lineId: string, nextBillingDate: string): Promise<Result>;
275
- updateBoxItems(subscriptionId: string, params: {
276
- parentId: string;
277
- items: UpdateBoxItem[];
278
- shippingMethodHandle?: string;
279
- }): Promise<Result>;
280
95
  addDiscount(code: string, subscriptionId?: string): Promise<Result<void, ApplyDiscountError>>;
281
96
  removeDiscount(discountId: string, subscriptionId?: string): Promise<Result<void, RemoveDiscountError>>;
282
- addUpsellProduct(params: {
283
- subscriptionId: string;
284
- variantId: string;
285
- quantity: number;
286
- oneTime?: boolean;
287
- }): Promise<Result>;
288
97
  reschedule(subscriptionId: string, newDate: string): Promise<Result<Subscription>>;
289
- /**
290
- * Replace the subscription's customer-visible custom attributes. `customAttributes`
291
- * is the complete desired set — omitted keys are removed. Internal (`_`-prefixed) /
292
- * reserved keys are preserved server-side and must not be included.
293
- */
294
- updateCustomAttributes(subscriptionId: string, customAttributes: Record<string, string>): Promise<Result<Subscription>>;
295
98
  resume(subscriptionId: string): Promise<Result<Subscription>>;
296
99
  pause(subscriptionId: string): Promise<Result<Subscription>>;
297
100
  reactivate(subscriptionId: string): Promise<Result<Subscription>>;
298
101
  cancel(subscriptionId: string, reason?: string): Promise<Result<Subscription>>;
299
- /**
300
- * Renew now. Adapter shape is split by stage:
301
- * - `retry: true` → POST /customer/subscriptions/{contractId}/retry
302
- * - `renewalId` present, no retry → POST /customer/renewals/{renewalId}/renew
303
- * - default → POST /customer/subscriptions/{contractId}/order-now
304
- * Caller decides whether to chain stages based on `nextActionUrl` presence.
305
- */
306
- renewNow(params: {
307
- subscriptionId: string;
308
- renewalId?: string;
309
- retry?: boolean;
310
- }): Promise<Result<RenewNowResult>>;
311
- /** Change subscription frequency: a selling plan id, or a custom delivery interval. */
312
- changeFrequency(subscriptionId: string, plan: string | SellingPlanInterval): Promise<Result<Subscription>>;
313
- /** Re-fetch `current` and `lastOrder` from the most recent in-focus subscription. */
314
- reload(): Promise<void>;
102
+ getAvailablePlans(subscriptionId: string): Promise<Result<SellingPlan[]>>;
103
+ getDefaultSubscriptionId(): Promise<Result<string | null>>;
315
104
  };
316
105
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,iBAAiB,CAAC;IACzB,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC/B,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC,YAAY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als-core';
2
2
  import { Block, BlockInstance } from './block';
3
3
  import { RouterService } from './services/router';
4
+ import { LayoutDocument, LayoutEngineId } from './layout';
4
5
  export type ThemeSurface = "page" | "overlay";
5
6
  export type GlobalStyleColors = {
6
7
  accent: string;
@@ -14,6 +15,17 @@ export type GlobalStyleColors = {
14
15
  background: string;
15
16
  };
16
17
  export type ThemeType = "neutral" | "warm" | "cold";
18
+ /**
19
+ * Which layout engine renders this theme. Absent is treated as "legacy" so
20
+ * existing themes need no migration. "grid-v1" opts the theme into the
21
+ * grid-based layout system (grid rendering + arrange mode + the layout block
22
+ * wrapper); "legacy" is the classic stacked/flex editing experience.
23
+ *
24
+ * Built by extending the real engine ids ({@link LayoutEngineId}) with the
25
+ * `"legacy"` sentinel (= layout system off). Adding a new engine format only
26
+ * requires touching `LayoutEngineId` in `layout/types.ts`.
27
+ */
28
+ export type LayoutEngine = LayoutEngineId | "legacy";
17
29
  export type GlobalStyles = {
18
30
  volume: "compact" | "comfort" | "spacious";
19
31
  style: "bare" | "ghost" | "tinted" | "solid" | "layered";
@@ -23,10 +35,13 @@ export type GlobalStyles = {
23
35
  theme: "preset" | "custom";
24
36
  themeType: ThemeType;
25
37
  colors: GlobalStyleColors;
38
+ /** Opt-in layout engine version. Omitted/undefined => legacy. */
39
+ layoutEngine?: LayoutEngine;
26
40
  };
27
41
  export declare const DEFAULT_GLOBAL_STYLES: GlobalStyles;
28
42
  export type ThemeSurfaceState = {
29
43
  blocks: Signal<BlockInstance[]>;
44
+ layout: Signal<LayoutDocument | null>;
30
45
  };
31
46
  export type TranslationMode = "override" | "default";
32
47
  export type TranslationScope = {
@@ -63,8 +78,7 @@ export type ThemeState = {
63
78
  locales: ThemeLocaleState;
64
79
  globalStyles: ReadonlySignal<GlobalStyles>;
65
80
  setGlobalStyles: (styles: GlobalStyles) => void;
66
- setInstanceTranslationOverride: (blockId: string, key: string, value: string) => void;
67
- resolve: (surface: ThemeSurface, path: string, params?: Record<string, unknown>) => Promise<{
81
+ resolve: (surface: ThemeSurface, path: string) => Promise<{
68
82
  blocks: Block[];
69
83
  }>;
70
84
  };
@@ -78,6 +92,7 @@ export declare function indexOverrides(overrides: TranslationOverride[]): {
78
92
  export declare function createThemeState(deps: {
79
93
  resolve: (surface: ThemeSurface, path: string) => Promise<{
80
94
  blocks: Block[];
95
+ layout?: LayoutDocument | null;
81
96
  } | null>;
82
97
  translations?: {
83
98
  resolveTranslations: (locale: string) => Promise<TranslationOverride[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"theme-state.d.ts","sourceRoot":"","sources":["../src/theme-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EAIL,KAAK,KAAK,EAEV,KAAK,aAAa,EAGnB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAC3C,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACzD,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,OA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EAAE,MAAM,CAAC,CAAC,CAAC;CAChD,CAmBA;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,OAAO,EAAE,CACP,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,MAAM,KACT,OAAO,CAAC;QAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IACzE,YAAY,CAAC,EAAE;QACb,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;KACzE,CAAC;IACF,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;CAC9E,GAAG,UAAU,CAwLb"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=theme-state.layout.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-state.layout.test.d.ts","sourceRoot":"","sources":["../src/theme-state.layout.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=theme-state.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-state.test.d.ts","sourceRoot":"","sources":["../src/theme-state.test.ts"],"names":[],"mappings":""}
@@ -29,11 +29,5 @@ export type PriceWithCurrency = {
29
29
  amount: string;
30
30
  currencyCode: string;
31
31
  };
32
- /**
33
- * Thin fetch wrapper provided by themes.
34
- * Handles auth headers, base URL, and shop domain injection.
35
- * Path should start with `/` (e.g. `/customer/v1/subscriptions`).
36
- */
37
- export type ApiFetcher = (path: string, init?: RequestInit) => Promise<Response>;
38
32
  export * from './editor';
39
33
  //# sourceMappingURL=index.d.ts.map
@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AC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,OAAO,IAAI;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,IAAI,IAAI;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAEpE,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,cAAc,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/vue/block.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EAGR,SAAS,EAUV,MAAM,KAAK,CAAC;AAOb,OAAO,EAEL,aAAa,EAEb,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,kBAAkB,EAAE,CAAC;AA2B9B,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,GAAG,CAAA;CAAE,WA0CZ,aAAa,iBAwF7B;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,EACpB,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,yCAoCrD"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/vue/block.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EAGR,SAAS,EAUV,MAAM,KAAK,CAAC;AACb,OAAO,EAEL,aAAa,EAEb,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,kBAAkB,EAAE,CAAC;AA2B9B,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,GAAG,CAAA;CAAE,WAuCZ,aAAa,iBA6D7B;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,EACpB,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,yCAoCrD"}