@juo/blocks 1.16.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.
- package/dist/{ExtensionRoot-C3lVJEBl.js → ExtensionRoot-DRpD5EcC.js} +24 -6
- package/dist/block-BjJztStr.js +993 -0
- package/dist/{block-dVP4Rqgz.js → block-DnhzyZ1H.js} +29 -3
- package/dist/block.d.ts +56 -0
- package/dist/block.d.ts.map +1 -1
- package/dist/{bridge-xiKEzCGR.js → bridge-Mz0CqG6E.js} +39 -30
- package/dist/core.js +336 -222
- package/dist/css-runtime-B7tZrBIp.js +749 -0
- package/dist/devtools/hook.d.ts +0 -5
- package/dist/devtools/hook.d.ts.map +1 -1
- package/dist/devtools/index.d.ts +0 -1
- package/dist/devtools/index.d.ts.map +1 -1
- package/dist/devtools/protocol.d.ts +15 -1
- package/dist/devtools/protocol.d.ts.map +1 -1
- package/dist/devtools.js +42 -9
- package/dist/editor/bridge.d.ts +7 -0
- package/dist/editor/bridge.d.ts.map +1 -1
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/main.d.ts +2 -1
- package/dist/editor/main.d.ts.map +1 -1
- package/dist/editor/messages.d.ts +13 -2
- package/dist/editor/messages.d.ts.map +1 -1
- package/dist/editor/overlays.d.ts +14 -0
- package/dist/editor/overlays.d.ts.map +1 -0
- package/dist/editor/overlays.test.d.ts +2 -0
- package/dist/editor/overlays.test.d.ts.map +1 -0
- package/dist/editor.js +52 -33
- package/dist/{gridstack-adapter-CDWbSpbt.js → gridstack-adapter-BGKGC-eO.js} +2 -2
- package/dist/main.d.ts +3 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/{morph-n4LMxOYo.js → morph-CT5hc5Qp.js} +1 -1
- package/dist/overlay-wrapper.d.ts +69 -0
- package/dist/overlay-wrapper.d.ts.map +1 -0
- package/dist/overlay-wrapper.test.d.ts +2 -0
- package/dist/overlay-wrapper.test.d.ts.map +1 -0
- package/dist/overlays/OverlayService.d.ts +34 -0
- package/dist/overlays/OverlayService.d.ts.map +1 -0
- package/dist/overlays/OverlayService.test.d.ts +2 -0
- package/dist/overlays/OverlayService.test.d.ts.map +1 -0
- package/dist/preact/block.d.ts.map +1 -1
- package/dist/preact/context.d.ts.map +1 -1
- package/dist/preact/context.test.d.ts +2 -0
- package/dist/preact/context.test.d.ts.map +1 -0
- package/dist/preact/signals.d.ts +19 -0
- package/dist/preact/signals.d.ts.map +1 -1
- package/dist/preact/useContextSubscription.test.d.ts +2 -0
- package/dist/preact/useContextSubscription.test.d.ts.map +1 -0
- package/dist/preact.js +33 -7
- package/dist/{project-gridstack-CM783oKI.js → project-gridstack-PxN_DIfP.js} +1 -1
- package/dist/react/block.d.ts.map +1 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.test.d.ts +2 -0
- package/dist/react/context.test.d.ts.map +1 -0
- package/dist/react/signals.d.ts +19 -0
- package/dist/react/signals.d.ts.map +1 -1
- package/dist/react/useContextSubscription.test.d.ts +2 -0
- package/dist/react/useContextSubscription.test.d.ts.map +1 -0
- package/dist/react.js +40 -8
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/order/adapter.d.ts +7 -6
- package/dist/services/order/adapter.d.ts.map +1 -1
- package/dist/services/order/index.d.ts +2 -3
- package/dist/services/order/index.d.ts.map +1 -1
- package/dist/services/order/orderService.d.ts +2 -3
- package/dist/services/order/orderService.d.ts.map +1 -1
- package/dist/services/order/orderService.test.d.ts +2 -0
- package/dist/services/order/orderService.test.d.ts.map +1 -0
- package/dist/services/order/types.d.ts +53 -14
- package/dist/services/order/types.d.ts.map +1 -1
- package/dist/shared/context.d.ts +10 -3
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/shared/touchSignals.d.ts +17 -0
- package/dist/shared/touchSignals.d.ts.map +1 -0
- package/dist/shared/touchSignals.test.d.ts +2 -0
- package/dist/shared/touchSignals.test.d.ts.map +1 -0
- package/dist/theme-state.d.ts +2 -1
- package/dist/theme-state.d.ts.map +1 -1
- package/dist/theme-state.params.test.d.ts +2 -0
- package/dist/theme-state.params.test.d.ts.map +1 -0
- package/dist/theme-state.translations.test.d.ts +2 -0
- package/dist/theme-state.translations.test.d.ts.map +1 -0
- package/dist/vue/block.d.ts.map +1 -1
- package/dist/vue.js +16 -13
- package/dist/web-components/ExtensionRoot.d.ts +1 -0
- package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
- package/dist/web-components-editor.js +6 -5
- package/dist/web-components-runtime.js +3 -2
- package/package.json +1 -1
- package/dist/css-runtime-ClH0MEYr.js +0 -1570
- package/dist/devtools/instrumentation.d.ts +0 -47
- package/dist/devtools/instrumentation.d.ts.map +0 -1
- package/dist/index-JSv6UH_o.js +0 -169
- package/dist/services/orders/adapter.d.ts +0 -10
- package/dist/services/orders/adapter.d.ts.map +0 -1
- package/dist/services/orders/index.d.ts +0 -4
- package/dist/services/orders/index.d.ts.map +0 -1
- package/dist/services/orders/ordersService.d.ts +0 -6
- package/dist/services/orders/ordersService.d.ts.map +0 -1
- package/dist/services/orders/ordersService.test.d.ts +0 -2
- package/dist/services/orders/ordersService.test.d.ts.map +0 -1
- package/dist/services/orders/types.d.ts +0 -60
- package/dist/services/orders/types.d.ts.map +0 -1
package/dist/core.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
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
|
-
import {
|
|
5
|
-
import { B,
|
|
4
|
+
import { e as createContext, f as d, m as w, n as defineBlock, h as createBlockInstance, j as getDefinedBlocks, p as registerBlock, E, u, s as subscribeContext } from "./block-BjJztStr.js";
|
|
5
|
+
import { B, q, t, S, v, _, x, c, y, g, z, A, D, F, G, i, H, b, I, o, J, k, K, l, L, w as w2 } from "./block-BjJztStr.js";
|
|
6
|
+
import { G as GRID_V1_ENGINE_ID, d as clampRect, e as applyFillExpansion, f as compactItems, g as findFreeRect, D as DEFAULT_GRID } from "./css-runtime-B7tZrBIp.js";
|
|
7
|
+
import { h, i as i2, L as L2, P, a, T, b as b2, j, k as k2, l as l2, m, n, o as o2, p, q as q2, s, t as t2, u as u2, v as v2, c as c2, w as w3, r } from "./css-runtime-B7tZrBIp.js";
|
|
6
8
|
import { reportBlockWarning, reportBlockError } from "./observability.js";
|
|
7
|
-
import { a as createEditorBridge,
|
|
8
|
-
import { p } from "./project-gridstack-
|
|
9
|
+
import { a as createEditorBridge, E as createSelectBlockMessage } from "./bridge-Mz0CqG6E.js";
|
|
10
|
+
import { p as p2 } from "./project-gridstack-PxN_DIfP.js";
|
|
9
11
|
import { clearLayoutModeAdapter, getLayoutModeAdapter, registerLayoutModeAdapter } from "./layout-mode-adapter-BBd4JRQd.js";
|
|
10
12
|
function createState() {
|
|
11
13
|
const discountCode = d(null);
|
|
@@ -75,6 +77,111 @@ function createState() {
|
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
79
|
const StateContext = createContext("state");
|
|
80
|
+
const OVERLAY_WRAPPER_SCHEMA = {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
props: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {
|
|
86
|
+
layout: {
|
|
87
|
+
type: "string",
|
|
88
|
+
enum: ["modal", "sidebar"]
|
|
89
|
+
},
|
|
90
|
+
canAbort: {
|
|
91
|
+
type: "boolean"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
required: ["layout"],
|
|
95
|
+
additionalProperties: false
|
|
96
|
+
},
|
|
97
|
+
slots: {
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: {
|
|
100
|
+
content: {}
|
|
101
|
+
},
|
|
102
|
+
additionalProperties: false
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
required: ["props", "slots"],
|
|
106
|
+
additionalProperties: false
|
|
107
|
+
};
|
|
108
|
+
function defineOverlayWrapper(opts) {
|
|
109
|
+
const layout = opts.layout ?? "sidebar";
|
|
110
|
+
const canAbort = opts.canAbort ?? true;
|
|
111
|
+
return defineBlock(opts.name, {
|
|
112
|
+
displayName: opts.title,
|
|
113
|
+
group: "internal",
|
|
114
|
+
schema: OVERLAY_WRAPPER_SCHEMA,
|
|
115
|
+
initialValue: () => ({
|
|
116
|
+
props: { layout, canAbort },
|
|
117
|
+
slots: {
|
|
118
|
+
content: [createBlockInstance(opts.content)]
|
|
119
|
+
}
|
|
120
|
+
}),
|
|
121
|
+
renderer: () => null
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const OVERLAY_PREFIX$1 = "overlay:";
|
|
125
|
+
function callInitialValue(block) {
|
|
126
|
+
if (typeof block.initialValue !== "function") return block.initialValue;
|
|
127
|
+
try {
|
|
128
|
+
return block.initialValue();
|
|
129
|
+
} catch (error) {
|
|
130
|
+
console.warn(
|
|
131
|
+
`[overlays] initialValue() threw for "${block.name}"; its content block will not be hidden from the palette.`,
|
|
132
|
+
error
|
|
133
|
+
);
|
|
134
|
+
return void 0;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function buildOverlayRegistry(blocks) {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
const registry = {};
|
|
140
|
+
for (const block of blocks) {
|
|
141
|
+
if (!block.name.startsWith(OVERLAY_PREFIX$1)) continue;
|
|
142
|
+
const id = block.name.slice(OVERLAY_PREFIX$1.length);
|
|
143
|
+
const initial = callInitialValue(block);
|
|
144
|
+
const first = (_b = (_a = initial == null ? void 0 : initial.slots) == null ? void 0 : _a.content) == null ? void 0 : _b[0];
|
|
145
|
+
const contentBlock = typeof (first == null ? void 0 : first.type) === "string" ? first.type : "";
|
|
146
|
+
registry[id] = {
|
|
147
|
+
block: block.name,
|
|
148
|
+
title: block.displayName ?? id,
|
|
149
|
+
contentBlock
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
return registry;
|
|
153
|
+
}
|
|
154
|
+
const OVERLAY_PREFIX = "overlay:";
|
|
155
|
+
const OverlayServiceContext = createContext("services/overlay");
|
|
156
|
+
function createOverlayService(themeState, options = {}) {
|
|
157
|
+
const getBlocks = options.getBlocks ?? getDefinedBlocks;
|
|
158
|
+
const current = w(() => {
|
|
159
|
+
const root = themeState.overlay.blocks.value[0];
|
|
160
|
+
const type = root == null ? void 0 : root.type;
|
|
161
|
+
if (typeof type !== "string" || !type.startsWith(OVERLAY_PREFIX)) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const props = root.props ?? {};
|
|
165
|
+
return {
|
|
166
|
+
name: type,
|
|
167
|
+
// Defaults mirror defineOverlayWrapper's seeding in overlay-wrapper.ts — keep in sync.
|
|
168
|
+
layout: props.layout ?? "sidebar",
|
|
169
|
+
canAbort: Boolean(props.canAbort ?? true)
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
getEditableOverlays() {
|
|
174
|
+
return buildOverlayRegistry(getBlocks());
|
|
175
|
+
},
|
|
176
|
+
open(name, params) {
|
|
177
|
+
void themeState.resolve("overlay", name, params);
|
|
178
|
+
},
|
|
179
|
+
close() {
|
|
180
|
+
themeState.overlay.blocks.value = [];
|
|
181
|
+
},
|
|
182
|
+
current
|
|
183
|
+
};
|
|
184
|
+
}
|
|
78
185
|
function isLocalhostOrigin(origin) {
|
|
79
186
|
try {
|
|
80
187
|
const url = new URL(origin);
|
|
@@ -190,8 +297,8 @@ function createApiCustomerAdapter(fetcher) {
|
|
|
190
297
|
_tag: "Success",
|
|
191
298
|
data: { id: data.id, name, email: data.email }
|
|
192
299
|
};
|
|
193
|
-
} catch (
|
|
194
|
-
return { _tag: "Failure", error:
|
|
300
|
+
} catch (e) {
|
|
301
|
+
return { _tag: "Failure", error: e };
|
|
195
302
|
}
|
|
196
303
|
}
|
|
197
304
|
};
|
|
@@ -209,7 +316,7 @@ const PARAMS = {
|
|
|
209
316
|
function uuid() {
|
|
210
317
|
return ("10000000-1000-4000-8000" + -1e11).replace(
|
|
211
318
|
/[018]/g,
|
|
212
|
-
(
|
|
319
|
+
(c3) => (c3 ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c3 / 4).toString(16)
|
|
213
320
|
);
|
|
214
321
|
}
|
|
215
322
|
function createMockLoginAdapter(opts = {}) {
|
|
@@ -280,8 +387,8 @@ function createApiLoginAdapter(fetcher, opts) {
|
|
|
280
387
|
lang
|
|
281
388
|
);
|
|
282
389
|
return { _tag: "Success", data: void 0 };
|
|
283
|
-
} catch (
|
|
284
|
-
return { _tag: "Failure", error:
|
|
390
|
+
} catch (e) {
|
|
391
|
+
return { _tag: "Failure", error: e };
|
|
285
392
|
}
|
|
286
393
|
},
|
|
287
394
|
async authenticate(params) {
|
|
@@ -315,8 +422,8 @@ function createApiLoginAdapter(fetcher, opts) {
|
|
|
315
422
|
throw new Error(`Unexpected response: ${res.statusText}`);
|
|
316
423
|
}
|
|
317
424
|
return { _tag: "Success", data: await res.json() };
|
|
318
|
-
} catch (
|
|
319
|
-
return { _tag: "Failure", error:
|
|
425
|
+
} catch (e) {
|
|
426
|
+
return { _tag: "Failure", error: e };
|
|
320
427
|
}
|
|
321
428
|
},
|
|
322
429
|
getAuthorizeUrl({ connection, state, shop }) {
|
|
@@ -575,7 +682,7 @@ function createLoginService(init) {
|
|
|
575
682
|
return service;
|
|
576
683
|
}
|
|
577
684
|
const LoginServiceContext = createContext("services/login");
|
|
578
|
-
function
|
|
685
|
+
function createMockOrderAdapter() {
|
|
579
686
|
const mockOrders = [
|
|
580
687
|
{
|
|
581
688
|
id: "10001",
|
|
@@ -659,7 +766,7 @@ function mapOrder(order) {
|
|
|
659
766
|
customAttributes: order.customAttributes
|
|
660
767
|
};
|
|
661
768
|
}
|
|
662
|
-
function
|
|
769
|
+
function createApiOrderAdapter(fetcher) {
|
|
663
770
|
return {
|
|
664
771
|
async getOrders(params) {
|
|
665
772
|
const query = new URLSearchParams();
|
|
@@ -685,7 +792,7 @@ function createApiOrdersAdapter(fetcher) {
|
|
|
685
792
|
}
|
|
686
793
|
};
|
|
687
794
|
}
|
|
688
|
-
function
|
|
795
|
+
function createOrderService(adapter) {
|
|
689
796
|
return {
|
|
690
797
|
async getOrders(params) {
|
|
691
798
|
try {
|
|
@@ -697,7 +804,7 @@ function createOrdersService(adapter) {
|
|
|
697
804
|
}
|
|
698
805
|
};
|
|
699
806
|
}
|
|
700
|
-
const
|
|
807
|
+
const OrderServiceContext = createContext("services/order");
|
|
701
808
|
function createMockProductAdapter() {
|
|
702
809
|
const products = [
|
|
703
810
|
{
|
|
@@ -888,9 +995,9 @@ function createMockProductAdapter() {
|
|
|
888
995
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
889
996
|
return products.filter((product) => ids.includes(product.id)).map(toAvailableProduct);
|
|
890
997
|
},
|
|
891
|
-
async getAvailableProducts({ q }) {
|
|
998
|
+
async getAvailableProducts({ q: q3 }) {
|
|
892
999
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
893
|
-
const queryLower =
|
|
1000
|
+
const queryLower = q3 == null ? void 0 : q3.toLowerCase();
|
|
894
1001
|
return products.filter(
|
|
895
1002
|
(product) => !queryLower || product.title.toLowerCase().includes(queryLower) || product.variants.some(
|
|
896
1003
|
(variant) => variant.title.toLowerCase().includes(queryLower)
|
|
@@ -964,7 +1071,7 @@ function mapProduct(product, currencyCode) {
|
|
|
964
1071
|
featuredImage: product.image == null ? null : { url: product.image.url, altText: product.image.altText ?? void 0 },
|
|
965
1072
|
hasOnlyDefaultVariant: product.variants.length <= 1,
|
|
966
1073
|
variants: {
|
|
967
|
-
items: product.variants.map((
|
|
1074
|
+
items: product.variants.map((v3) => mapVariant(v3, currencyCode)),
|
|
968
1075
|
pageInfo: {
|
|
969
1076
|
hasNextPage: false,
|
|
970
1077
|
hasPrevPage: false,
|
|
@@ -1019,7 +1126,7 @@ function createApiProductAdapter(fetcher, opts = { currencyCode: "USD" }) {
|
|
|
1019
1126
|
}
|
|
1020
1127
|
const body = await fetchProducts(params);
|
|
1021
1128
|
return {
|
|
1022
|
-
items: body.data.map((
|
|
1129
|
+
items: body.data.map((p3) => mapProduct(p3, currencyCode)),
|
|
1023
1130
|
pageInfo: {
|
|
1024
1131
|
hasNextPage: body.hasNextPage,
|
|
1025
1132
|
hasPrevPage: body.hasPrevPage,
|
|
@@ -1045,10 +1152,10 @@ function createApiProductAdapter(fetcher, opts = { currencyCode: "USD" }) {
|
|
|
1045
1152
|
const res = await fetcher(`/customer/products/by-ids?${params.toString()}`);
|
|
1046
1153
|
if (!res.ok) return [];
|
|
1047
1154
|
const data = await res.json();
|
|
1048
|
-
return (data ?? []).map((
|
|
1049
|
-
id:
|
|
1050
|
-
title:
|
|
1051
|
-
featuredImage:
|
|
1155
|
+
return (data ?? []).map((p3) => ({
|
|
1156
|
+
id: p3.id,
|
|
1157
|
+
title: p3.title ?? "",
|
|
1158
|
+
featuredImage: p3.featuredImage ? { url: p3.featuredImage.url, altText: p3.featuredImage.altText } : null,
|
|
1052
1159
|
hasOnlyDefaultVariant: true,
|
|
1053
1160
|
collections: []
|
|
1054
1161
|
}));
|
|
@@ -1060,30 +1167,30 @@ function createApiProductAdapter(fetcher, opts = { currencyCode: "USD" }) {
|
|
|
1060
1167
|
const res = await fetcher(`/customer/products/variants?${params.toString()}`);
|
|
1061
1168
|
if (!res.ok) return [];
|
|
1062
1169
|
const data = await res.json();
|
|
1063
|
-
return (data ?? []).map((
|
|
1170
|
+
return (data ?? []).map((p3) => {
|
|
1064
1171
|
var _a;
|
|
1065
1172
|
return {
|
|
1066
|
-
id:
|
|
1067
|
-
title:
|
|
1068
|
-
description:
|
|
1069
|
-
featuredImage:
|
|
1070
|
-
hasOnlyDefaultVariant:
|
|
1071
|
-
variants: (
|
|
1072
|
-
id:
|
|
1073
|
-
availableForSale:
|
|
1074
|
-
title:
|
|
1075
|
-
currentPrice:
|
|
1076
|
-
basePrice:
|
|
1077
|
-
image:
|
|
1078
|
-
recurring:
|
|
1173
|
+
id: p3.id,
|
|
1174
|
+
title: p3.title,
|
|
1175
|
+
description: p3.description ?? "",
|
|
1176
|
+
featuredImage: p3.featuredImage,
|
|
1177
|
+
hasOnlyDefaultVariant: p3.hasOnlyDefaultVariant ?? (((_a = p3.variants) == null ? void 0 : _a.length) ?? 0) <= 1,
|
|
1178
|
+
variants: (p3.variants ?? []).map((v3) => ({
|
|
1179
|
+
id: v3.id,
|
|
1180
|
+
availableForSale: v3.availableForSale,
|
|
1181
|
+
title: v3.title,
|
|
1182
|
+
currentPrice: v3.currentPrice,
|
|
1183
|
+
basePrice: v3.basePrice,
|
|
1184
|
+
image: v3.image,
|
|
1185
|
+
recurring: v3.recurring
|
|
1079
1186
|
}))
|
|
1080
1187
|
};
|
|
1081
1188
|
});
|
|
1082
1189
|
},
|
|
1083
|
-
async getAvailableProducts({ subscriptionId, lineId, q, mode, action, pagination }) {
|
|
1190
|
+
async getAvailableProducts({ subscriptionId, lineId, q: q3, mode, action, pagination }) {
|
|
1084
1191
|
const params = new URLSearchParams();
|
|
1085
1192
|
params.set("action", action);
|
|
1086
|
-
if (
|
|
1193
|
+
if (q3) params.set("q", q3);
|
|
1087
1194
|
if (mode) params.set("mode", mode);
|
|
1088
1195
|
if (pagination && "after" in pagination) params.set("after", pagination.after);
|
|
1089
1196
|
if (pagination && "before" in pagination) params.set("before", pagination.before);
|
|
@@ -1092,22 +1199,22 @@ function createApiProductAdapter(fetcher, opts = { currencyCode: "USD" }) {
|
|
|
1092
1199
|
);
|
|
1093
1200
|
if (!res.ok) return [];
|
|
1094
1201
|
const data = await res.json();
|
|
1095
|
-
return (data ?? []).map((
|
|
1202
|
+
return (data ?? []).map((p3) => {
|
|
1096
1203
|
var _a;
|
|
1097
1204
|
return {
|
|
1098
|
-
id:
|
|
1099
|
-
title:
|
|
1100
|
-
description:
|
|
1101
|
-
featuredImage:
|
|
1102
|
-
hasOnlyDefaultVariant:
|
|
1103
|
-
variants: (
|
|
1104
|
-
id:
|
|
1105
|
-
availableForSale:
|
|
1106
|
-
title:
|
|
1107
|
-
currentPrice:
|
|
1108
|
-
basePrice:
|
|
1109
|
-
image:
|
|
1110
|
-
recurring:
|
|
1205
|
+
id: p3.id,
|
|
1206
|
+
title: p3.title,
|
|
1207
|
+
description: p3.description ?? "",
|
|
1208
|
+
featuredImage: p3.featuredImage,
|
|
1209
|
+
hasOnlyDefaultVariant: p3.hasOnlyDefaultVariant ?? (((_a = p3.variants) == null ? void 0 : _a.length) ?? 0) <= 1,
|
|
1210
|
+
variants: (p3.variants ?? []).map((v3) => ({
|
|
1211
|
+
id: v3.id,
|
|
1212
|
+
availableForSale: v3.availableForSale,
|
|
1213
|
+
title: v3.title,
|
|
1214
|
+
currentPrice: v3.currentPrice,
|
|
1215
|
+
basePrice: v3.basePrice,
|
|
1216
|
+
image: v3.image,
|
|
1217
|
+
recurring: v3.recurring
|
|
1111
1218
|
}))
|
|
1112
1219
|
};
|
|
1113
1220
|
});
|
|
@@ -1152,7 +1259,7 @@ function routeNameTableFromPages(pages) {
|
|
|
1152
1259
|
function createRouterService(options) {
|
|
1153
1260
|
const { pages, pushImplementation } = options;
|
|
1154
1261
|
const routeNameToPagePath = routeNameTableFromPages(pages);
|
|
1155
|
-
const pathSet = new Set(pages.map((
|
|
1262
|
+
const pathSet = new Set(pages.map((p3) => p3.path));
|
|
1156
1263
|
const navigationSubscribers = [];
|
|
1157
1264
|
function notifySubscribers(logicalPath) {
|
|
1158
1265
|
for (const cb of navigationSubscribers) cb({ path: logicalPath });
|
|
@@ -1420,7 +1527,7 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1420
1527
|
data: subscription ? {
|
|
1421
1528
|
...subscription,
|
|
1422
1529
|
items: subscription.items.map((item) => ({ ...item })),
|
|
1423
|
-
discounts: subscription.discounts.map((
|
|
1530
|
+
discounts: subscription.discounts.map((d2) => ({ ...d2 }))
|
|
1424
1531
|
} : null
|
|
1425
1532
|
};
|
|
1426
1533
|
},
|
|
@@ -1468,7 +1575,7 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1468
1575
|
}
|
|
1469
1576
|
const currencyCode = ((_a = subscription.items[0]) == null ? void 0 : _a.price.currencyCode) ?? "USD";
|
|
1470
1577
|
const product = await ((_b = options.productAdapter) == null ? void 0 : _b.getByVariantId(item.variantId)) ?? await ((_c = options.productAdapter) == null ? void 0 : _c.getById(item.variantId)) ?? null;
|
|
1471
|
-
const variant = (product == null ? void 0 : product.variants.items.find((
|
|
1578
|
+
const variant = (product == null ? void 0 : product.variants.items.find((v3) => v3.id === item.variantId)) ?? (product == null ? void 0 : product.variants.items[0]);
|
|
1472
1579
|
const linePrice = ((_e = (_d = variant == null ? void 0 : variant.purchaseOptions) == null ? void 0 : _d[0]) == null ? void 0 : _e.price) ?? (variant == null ? void 0 : variant.price);
|
|
1473
1580
|
subscription.items.push({
|
|
1474
1581
|
id: `item_${Date.now()}_${subscription.items.length}`,
|
|
@@ -1493,7 +1600,7 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1493
1600
|
if (!subscription) {
|
|
1494
1601
|
return { _tag: "Failure", error: "Subscription not found" };
|
|
1495
1602
|
}
|
|
1496
|
-
subscription.items = subscription.items.filter((
|
|
1603
|
+
subscription.items = subscription.items.filter((i3) => i3.id !== itemId);
|
|
1497
1604
|
subscription.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1498
1605
|
return { _tag: "Success", data: void 0 };
|
|
1499
1606
|
},
|
|
@@ -1503,7 +1610,7 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1503
1610
|
if (!subscription) {
|
|
1504
1611
|
return { _tag: "Failure", error: "Subscription not found" };
|
|
1505
1612
|
}
|
|
1506
|
-
const item = subscription.items.find((
|
|
1613
|
+
const item = subscription.items.find((i3) => i3.id === lineId);
|
|
1507
1614
|
if (!item) {
|
|
1508
1615
|
return { _tag: "Failure", error: "Line item not found" };
|
|
1509
1616
|
}
|
|
@@ -1519,7 +1626,7 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1519
1626
|
if (!subscription) {
|
|
1520
1627
|
return { _tag: "Failure", error: "Subscription not found" };
|
|
1521
1628
|
}
|
|
1522
|
-
const item = subscription.items.find((
|
|
1629
|
+
const item = subscription.items.find((i3) => i3.id === lineId);
|
|
1523
1630
|
if (!item) {
|
|
1524
1631
|
return { _tag: "Failure", error: "Line item not found" };
|
|
1525
1632
|
}
|
|
@@ -1709,7 +1816,7 @@ function createMockSubscriptionAdapter(options = {}) {
|
|
|
1709
1816
|
data: {
|
|
1710
1817
|
...subscription,
|
|
1711
1818
|
items: subscription.items.map((item) => ({ ...item })),
|
|
1712
|
-
discounts: subscription.discounts.map((
|
|
1819
|
+
discounts: subscription.discounts.map((d2) => ({ ...d2 }))
|
|
1713
1820
|
}
|
|
1714
1821
|
};
|
|
1715
1822
|
},
|
|
@@ -1781,14 +1888,14 @@ function mapSubscription(raw) {
|
|
|
1781
1888
|
),
|
|
1782
1889
|
discounts: (raw.discounts ?? []).map(
|
|
1783
1890
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1784
|
-
(
|
|
1891
|
+
(d2) => {
|
|
1785
1892
|
var _a2, _b2, _c;
|
|
1786
1893
|
return {
|
|
1787
|
-
id:
|
|
1788
|
-
type: ((_a2 =
|
|
1789
|
-
value: ((_b2 =
|
|
1790
|
-
code:
|
|
1791
|
-
description:
|
|
1894
|
+
id: d2.id,
|
|
1895
|
+
type: ((_a2 = d2.value) == null ? void 0 : _a2.type) === "fixed-amount" || d2.type === "fixed_amount" ? "fixed_amount" : "percentage",
|
|
1896
|
+
value: ((_b2 = d2.value) == null ? void 0 : _b2.amount) ?? ((_c = d2.value) == null ? void 0 : _c.percentage) ?? d2.value ?? 0,
|
|
1897
|
+
code: d2.title ?? d2.code ?? "",
|
|
1898
|
+
description: d2.description ?? ""
|
|
1792
1899
|
};
|
|
1793
1900
|
}
|
|
1794
1901
|
),
|
|
@@ -1822,8 +1929,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1822
1929
|
try {
|
|
1823
1930
|
const params = new URLSearchParams();
|
|
1824
1931
|
if ((_a = options == null ? void 0 : options.filters) == null ? void 0 : _a.length) {
|
|
1825
|
-
const groups = options.filters.filter((f) => Object.keys(f).length > 0).map((f) => Object.entries(f).filter(([,
|
|
1826
|
-
(entries) => "(" + entries.map(([
|
|
1932
|
+
const groups = options.filters.filter((f) => Object.keys(f).length > 0).map((f) => Object.entries(f).filter(([, v3]) => Boolean(v3))).filter((entries) => entries.length > 0).map(
|
|
1933
|
+
(entries) => "(" + entries.map(([k3, v3]) => `${k3}:'${v3}'`).join(" AND ") + ")"
|
|
1827
1934
|
);
|
|
1828
1935
|
if (groups.length) params.set("query", groups.join(" OR "));
|
|
1829
1936
|
}
|
|
@@ -1853,8 +1960,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1853
1960
|
}
|
|
1854
1961
|
}
|
|
1855
1962
|
};
|
|
1856
|
-
} catch (
|
|
1857
|
-
return { _tag: "Failure", error:
|
|
1963
|
+
} catch (e) {
|
|
1964
|
+
return { _tag: "Failure", error: e };
|
|
1858
1965
|
}
|
|
1859
1966
|
},
|
|
1860
1967
|
async getById(id) {
|
|
@@ -1866,8 +1973,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1866
1973
|
const body = await res.json();
|
|
1867
1974
|
const raw = body.data[0];
|
|
1868
1975
|
return { _tag: "Success", data: raw ? mapSubscription(raw) : null };
|
|
1869
|
-
} catch (
|
|
1870
|
-
return { _tag: "Failure", error:
|
|
1976
|
+
} catch (e) {
|
|
1977
|
+
return { _tag: "Failure", error: e };
|
|
1871
1978
|
}
|
|
1872
1979
|
},
|
|
1873
1980
|
async addItem({ subscriptionId, item }) {
|
|
@@ -1882,8 +1989,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1882
1989
|
);
|
|
1883
1990
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
1884
1991
|
return { _tag: "Success", data: void 0 };
|
|
1885
|
-
} catch (
|
|
1886
|
-
return { _tag: "Failure", error:
|
|
1992
|
+
} catch (e) {
|
|
1993
|
+
return { _tag: "Failure", error: e };
|
|
1887
1994
|
}
|
|
1888
1995
|
},
|
|
1889
1996
|
async removeItem({ subscriptionId, itemId }) {
|
|
@@ -1894,8 +2001,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1894
2001
|
);
|
|
1895
2002
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
1896
2003
|
return { _tag: "Success", data: void 0 };
|
|
1897
|
-
} catch (
|
|
1898
|
-
return { _tag: "Failure", error:
|
|
2004
|
+
} catch (e) {
|
|
2005
|
+
return { _tag: "Failure", error: e };
|
|
1899
2006
|
}
|
|
1900
2007
|
},
|
|
1901
2008
|
async updateItem({ subscriptionId, lineId, update }) {
|
|
@@ -1916,8 +2023,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1916
2023
|
);
|
|
1917
2024
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
1918
2025
|
return { _tag: "Success", data: void 0 };
|
|
1919
|
-
} catch (
|
|
1920
|
-
return { _tag: "Failure", error:
|
|
2026
|
+
} catch (e) {
|
|
2027
|
+
return { _tag: "Failure", error: e };
|
|
1921
2028
|
}
|
|
1922
2029
|
},
|
|
1923
2030
|
async updateItemAttributes({ subscriptionId, lineId, customAttributes }) {
|
|
@@ -1932,8 +2039,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1932
2039
|
);
|
|
1933
2040
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
1934
2041
|
return { _tag: "Success", data: void 0 };
|
|
1935
|
-
} catch (
|
|
1936
|
-
return { _tag: "Failure", error:
|
|
2042
|
+
} catch (e) {
|
|
2043
|
+
return { _tag: "Failure", error: e };
|
|
1937
2044
|
}
|
|
1938
2045
|
},
|
|
1939
2046
|
async updateAttributes({ subscriptionId, customAttributes }) {
|
|
@@ -1948,8 +2055,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1948
2055
|
);
|
|
1949
2056
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
1950
2057
|
return { _tag: "Success", data: void 0 };
|
|
1951
|
-
} catch (
|
|
1952
|
-
return { _tag: "Failure", error:
|
|
2058
|
+
} catch (e) {
|
|
2059
|
+
return { _tag: "Failure", error: e };
|
|
1953
2060
|
}
|
|
1954
2061
|
},
|
|
1955
2062
|
async skipLineItem({ subscriptionId, lineId, nextBillingDate }) {
|
|
@@ -1964,8 +2071,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1964
2071
|
);
|
|
1965
2072
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
1966
2073
|
return { _tag: "Success", data: void 0 };
|
|
1967
|
-
} catch (
|
|
1968
|
-
return { _tag: "Failure", error:
|
|
2074
|
+
} catch (e) {
|
|
2075
|
+
return { _tag: "Failure", error: e };
|
|
1969
2076
|
}
|
|
1970
2077
|
},
|
|
1971
2078
|
async updateBoxItems({ subscriptionId, parentId, items, shippingMethodHandle }) {
|
|
@@ -1980,8 +2087,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
1980
2087
|
);
|
|
1981
2088
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
1982
2089
|
return { _tag: "Success", data: void 0 };
|
|
1983
|
-
} catch (
|
|
1984
|
-
return { _tag: "Failure", error:
|
|
2090
|
+
} catch (e) {
|
|
2091
|
+
return { _tag: "Failure", error: e };
|
|
1985
2092
|
}
|
|
1986
2093
|
},
|
|
1987
2094
|
async addDiscount({ subscriptionId, code }) {
|
|
@@ -2007,10 +2114,10 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2007
2114
|
return { _tag: "Failure", error: { kind: "UNKNOWN", message: `HTTP ${res.status}` } };
|
|
2008
2115
|
}
|
|
2009
2116
|
return { _tag: "Success", data: void 0 };
|
|
2010
|
-
} catch (
|
|
2117
|
+
} catch (e) {
|
|
2011
2118
|
return {
|
|
2012
2119
|
_tag: "Failure",
|
|
2013
|
-
error: { kind: "NETWORK", message:
|
|
2120
|
+
error: { kind: "NETWORK", message: e instanceof Error ? e.message : void 0 }
|
|
2014
2121
|
};
|
|
2015
2122
|
}
|
|
2016
2123
|
},
|
|
@@ -2032,10 +2139,10 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2032
2139
|
return { _tag: "Failure", error: { kind: "UNKNOWN", message: `HTTP ${res.status}` } };
|
|
2033
2140
|
}
|
|
2034
2141
|
return { _tag: "Success", data: void 0 };
|
|
2035
|
-
} catch (
|
|
2142
|
+
} catch (e) {
|
|
2036
2143
|
return {
|
|
2037
2144
|
_tag: "Failure",
|
|
2038
|
-
error: { kind: "NETWORK", message:
|
|
2145
|
+
error: { kind: "NETWORK", message: e instanceof Error ? e.message : void 0 }
|
|
2039
2146
|
};
|
|
2040
2147
|
}
|
|
2041
2148
|
},
|
|
@@ -2053,8 +2160,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2053
2160
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2054
2161
|
const data = await res.json();
|
|
2055
2162
|
return { _tag: "Success", data: mapSubscription(data) };
|
|
2056
|
-
} catch (
|
|
2057
|
-
return { _tag: "Failure", error:
|
|
2163
|
+
} catch (e) {
|
|
2164
|
+
return { _tag: "Failure", error: e };
|
|
2058
2165
|
}
|
|
2059
2166
|
},
|
|
2060
2167
|
// PATCH /customer/v1/subscriptions/{id} with the full customer-visible set.
|
|
@@ -2071,8 +2178,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2071
2178
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2072
2179
|
const data = await res.json();
|
|
2073
2180
|
return { _tag: "Success", data: mapSubscription(data) };
|
|
2074
|
-
} catch (
|
|
2075
|
-
return { _tag: "Failure", error:
|
|
2181
|
+
} catch (e) {
|
|
2182
|
+
return { _tag: "Failure", error: e };
|
|
2076
2183
|
}
|
|
2077
2184
|
},
|
|
2078
2185
|
async resume({ subscriptionId }) {
|
|
@@ -2084,8 +2191,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2084
2191
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2085
2192
|
const data = await res.json();
|
|
2086
2193
|
return { _tag: "Success", data: mapSubscription(data) };
|
|
2087
|
-
} catch (
|
|
2088
|
-
return { _tag: "Failure", error:
|
|
2194
|
+
} catch (e) {
|
|
2195
|
+
return { _tag: "Failure", error: e };
|
|
2089
2196
|
}
|
|
2090
2197
|
},
|
|
2091
2198
|
async pause({ subscriptionId }) {
|
|
@@ -2097,8 +2204,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2097
2204
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2098
2205
|
const data = await res.json();
|
|
2099
2206
|
return { _tag: "Success", data: mapSubscription(data) };
|
|
2100
|
-
} catch (
|
|
2101
|
-
return { _tag: "Failure", error:
|
|
2207
|
+
} catch (e) {
|
|
2208
|
+
return { _tag: "Failure", error: e };
|
|
2102
2209
|
}
|
|
2103
2210
|
},
|
|
2104
2211
|
async reactivate({ subscriptionId }) {
|
|
@@ -2110,8 +2217,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2110
2217
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2111
2218
|
const data = await res.json();
|
|
2112
2219
|
return { _tag: "Success", data: mapSubscription(data) };
|
|
2113
|
-
} catch (
|
|
2114
|
-
return { _tag: "Failure", error:
|
|
2220
|
+
} catch (e) {
|
|
2221
|
+
return { _tag: "Failure", error: e };
|
|
2115
2222
|
}
|
|
2116
2223
|
},
|
|
2117
2224
|
async cancel({ subscriptionId, reason }) {
|
|
@@ -2127,8 +2234,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2127
2234
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2128
2235
|
const data = await res.json();
|
|
2129
2236
|
return { _tag: "Success", data: mapSubscription(data) };
|
|
2130
|
-
} catch (
|
|
2131
|
-
return { _tag: "Failure", error:
|
|
2237
|
+
} catch (e) {
|
|
2238
|
+
return { _tag: "Failure", error: e };
|
|
2132
2239
|
}
|
|
2133
2240
|
},
|
|
2134
2241
|
// Legacy endpoint — no /customer/v1/subscriptions/{id}/plans exists yet.
|
|
@@ -2140,8 +2247,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2140
2247
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2141
2248
|
const data = await res.json();
|
|
2142
2249
|
return { _tag: "Success", data };
|
|
2143
|
-
} catch (
|
|
2144
|
-
return { _tag: "Failure", error:
|
|
2250
|
+
} catch (e) {
|
|
2251
|
+
return { _tag: "Failure", error: e };
|
|
2145
2252
|
}
|
|
2146
2253
|
},
|
|
2147
2254
|
// Legacy endpoint — no /customer/v1 equivalent exists yet.
|
|
@@ -2153,8 +2260,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2153
2260
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2154
2261
|
const data = await res.json();
|
|
2155
2262
|
return { _tag: "Success", data: (data == null ? void 0 : data.id) ?? null };
|
|
2156
|
-
} catch (
|
|
2157
|
-
return { _tag: "Failure", error:
|
|
2263
|
+
} catch (e) {
|
|
2264
|
+
return { _tag: "Failure", error: e };
|
|
2158
2265
|
}
|
|
2159
2266
|
},
|
|
2160
2267
|
// Legacy endpoint — no /customer/v1/subscriptions/{id}/upsells exists yet.
|
|
@@ -2165,24 +2272,24 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2165
2272
|
);
|
|
2166
2273
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2167
2274
|
const data = await res.json();
|
|
2168
|
-
const products = data.map((
|
|
2275
|
+
const products = data.map((p3) => {
|
|
2169
2276
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
2170
2277
|
return {
|
|
2171
|
-
id:
|
|
2172
|
-
variantId: ((_b = (_a =
|
|
2173
|
-
title:
|
|
2174
|
-
imageUrl: ((_c =
|
|
2278
|
+
id: p3.id,
|
|
2279
|
+
variantId: ((_b = (_a = p3.variants) == null ? void 0 : _a[0]) == null ? void 0 : _b.id) ?? "",
|
|
2280
|
+
title: p3.title ?? "",
|
|
2281
|
+
imageUrl: ((_c = p3.featuredImage) == null ? void 0 : _c.url) ?? void 0,
|
|
2175
2282
|
price: {
|
|
2176
|
-
amount: String(((_f = (_e = (_d =
|
|
2177
|
-
currencyCode: ((_i = (_h = (_g =
|
|
2283
|
+
amount: String(((_f = (_e = (_d = p3.variants) == null ? void 0 : _d[0]) == null ? void 0 : _e.currentPrice) == null ? void 0 : _f.amount) ?? 0),
|
|
2284
|
+
currencyCode: ((_i = (_h = (_g = p3.variants) == null ? void 0 : _g[0]) == null ? void 0 : _h.currentPrice) == null ? void 0 : _i.currencyCode) ?? ""
|
|
2178
2285
|
},
|
|
2179
2286
|
// recurring comes from the upsell rule on variants[0]; present in PreparedProductSchema
|
|
2180
|
-
recurring: (_k = (_j =
|
|
2287
|
+
recurring: (_k = (_j = p3.variants) == null ? void 0 : _j[0]) == null ? void 0 : _k.recurring
|
|
2181
2288
|
};
|
|
2182
2289
|
});
|
|
2183
2290
|
return { _tag: "Success", data: products };
|
|
2184
|
-
} catch (
|
|
2185
|
-
return { _tag: "Failure", error:
|
|
2291
|
+
} catch (e) {
|
|
2292
|
+
return { _tag: "Failure", error: e };
|
|
2186
2293
|
}
|
|
2187
2294
|
},
|
|
2188
2295
|
// Legacy endpoint — no /customer/v1/subscriptions/{id}/upsells POST exists yet.
|
|
@@ -2202,8 +2309,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2202
2309
|
);
|
|
2203
2310
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2204
2311
|
return { _tag: "Success", data: void 0 };
|
|
2205
|
-
} catch (
|
|
2206
|
-
return { _tag: "Failure", error:
|
|
2312
|
+
} catch (e) {
|
|
2313
|
+
return { _tag: "Failure", error: e };
|
|
2207
2314
|
}
|
|
2208
2315
|
},
|
|
2209
2316
|
// Legacy endpoint — no /customer/v1 equivalent exists yet.
|
|
@@ -2219,8 +2326,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2219
2326
|
_tag: "Success",
|
|
2220
2327
|
data: { id: data.id, createdAt: data.createdAt }
|
|
2221
2328
|
};
|
|
2222
|
-
} catch (
|
|
2223
|
-
return { _tag: "Failure", error:
|
|
2329
|
+
} catch (e) {
|
|
2330
|
+
return { _tag: "Failure", error: e };
|
|
2224
2331
|
}
|
|
2225
2332
|
},
|
|
2226
2333
|
// Legacy endpoints, split by stage (see SubscriptionService.renewNow docs):
|
|
@@ -2240,8 +2347,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2240
2347
|
result: (body == null ? void 0 : body.result) ?? "success"
|
|
2241
2348
|
}
|
|
2242
2349
|
};
|
|
2243
|
-
} catch (
|
|
2244
|
-
return { _tag: "Failure", error:
|
|
2350
|
+
} catch (e) {
|
|
2351
|
+
return { _tag: "Failure", error: e };
|
|
2245
2352
|
}
|
|
2246
2353
|
},
|
|
2247
2354
|
// Legacy endpoint — POST /plan returns 204; re-fetch to return the updated subscription.
|
|
@@ -2263,8 +2370,8 @@ function createApiSubscriptionAdapter(fetcher) {
|
|
|
2263
2370
|
_tag: "Failure",
|
|
2264
2371
|
error: "Subscription not found after frequency change"
|
|
2265
2372
|
};
|
|
2266
|
-
} catch (
|
|
2267
|
-
return { _tag: "Failure", error:
|
|
2373
|
+
} catch (e) {
|
|
2374
|
+
return { _tag: "Failure", error: e };
|
|
2268
2375
|
}
|
|
2269
2376
|
}
|
|
2270
2377
|
};
|
|
@@ -2325,13 +2432,13 @@ function mapScheduleOrder(order) {
|
|
|
2325
2432
|
};
|
|
2326
2433
|
}),
|
|
2327
2434
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2328
|
-
discounts: (order.discounts ?? []).map((
|
|
2435
|
+
discounts: (order.discounts ?? []).map((d2) => {
|
|
2329
2436
|
var _a, _b, _c;
|
|
2330
2437
|
return {
|
|
2331
|
-
id:
|
|
2332
|
-
title:
|
|
2333
|
-
type: ((_a =
|
|
2334
|
-
value: ((_b =
|
|
2438
|
+
id: d2.id,
|
|
2439
|
+
title: d2.title ?? void 0,
|
|
2440
|
+
type: ((_a = d2.value) == null ? void 0 : _a.type) === "fixed-amount" ? "fixed_amount" : "percentage",
|
|
2441
|
+
value: ((_b = d2.value) == null ? void 0 : _b.amount) ?? ((_c = d2.value) == null ? void 0 : _c.percentage) ?? 0
|
|
2335
2442
|
};
|
|
2336
2443
|
})
|
|
2337
2444
|
};
|
|
@@ -2370,26 +2477,26 @@ function buildSkipItemMatcher(params) {
|
|
|
2370
2477
|
const DELIVERY_PRICE = 5;
|
|
2371
2478
|
const DELIVERY_OFFSET_DAYS = 2;
|
|
2372
2479
|
function toPrice(amount) {
|
|
2373
|
-
const
|
|
2374
|
-
return Number.isFinite(
|
|
2480
|
+
const n2 = Number.parseFloat(amount ?? "0");
|
|
2481
|
+
return Number.isFinite(n2) ? n2 : 0;
|
|
2375
2482
|
}
|
|
2376
2483
|
function addInterval(date, interval, units) {
|
|
2377
|
-
const
|
|
2484
|
+
const d2 = new Date(date);
|
|
2378
2485
|
switch (interval) {
|
|
2379
2486
|
case "DAY":
|
|
2380
|
-
|
|
2487
|
+
d2.setDate(d2.getDate() + units);
|
|
2381
2488
|
break;
|
|
2382
2489
|
case "WEEK":
|
|
2383
|
-
|
|
2490
|
+
d2.setDate(d2.getDate() + units * 7);
|
|
2384
2491
|
break;
|
|
2385
2492
|
case "YEAR":
|
|
2386
|
-
|
|
2493
|
+
d2.setFullYear(d2.getFullYear() + units);
|
|
2387
2494
|
break;
|
|
2388
2495
|
default:
|
|
2389
|
-
|
|
2496
|
+
d2.setMonth(d2.getMonth() + units);
|
|
2390
2497
|
break;
|
|
2391
2498
|
}
|
|
2392
|
-
return
|
|
2499
|
+
return d2;
|
|
2393
2500
|
}
|
|
2394
2501
|
function mapItem(sub, item, cycle) {
|
|
2395
2502
|
var _a, _b;
|
|
@@ -2447,11 +2554,11 @@ function projectUpcomingOrders(sub, count) {
|
|
|
2447
2554
|
deliveryDate: deliveryDate.toISOString(),
|
|
2448
2555
|
status: "scheduled",
|
|
2449
2556
|
items,
|
|
2450
|
-
discounts: sub.discounts.map((
|
|
2451
|
-
id:
|
|
2452
|
-
title:
|
|
2453
|
-
type:
|
|
2454
|
-
value:
|
|
2557
|
+
discounts: sub.discounts.map((d2) => ({
|
|
2558
|
+
id: d2.id,
|
|
2559
|
+
title: d2.code,
|
|
2560
|
+
type: d2.type,
|
|
2561
|
+
value: d2.value
|
|
2455
2562
|
}))
|
|
2456
2563
|
});
|
|
2457
2564
|
}
|
|
@@ -2479,7 +2586,7 @@ function applyAdjustments(orders, stored) {
|
|
|
2479
2586
|
);
|
|
2480
2587
|
const subtotal = items.reduce((sum, it) => sum + it.totalPrice, 0);
|
|
2481
2588
|
next = { ...next, items, subtotal };
|
|
2482
|
-
if (items.length > 0 && items.every((
|
|
2589
|
+
if (items.length > 0 && items.every((i3) => i3.skipped)) {
|
|
2483
2590
|
next = { ...next, skipped: true, status: "skipped", deliveryPrice: 0 };
|
|
2484
2591
|
}
|
|
2485
2592
|
}
|
|
@@ -2514,11 +2621,11 @@ function createMockSchedulesAdapter(subscriptions = createMockSubscriptionAdapte
|
|
|
2514
2621
|
const iso = toIsoOrNull(opts.date);
|
|
2515
2622
|
const target = iso == null ? void 0 : iso.split("T")[0];
|
|
2516
2623
|
const match = target ? orders.find(
|
|
2517
|
-
(
|
|
2624
|
+
(o3) => o3.deliveryDate.split("T")[0] === target || o3.date.split("T")[0] === target
|
|
2518
2625
|
) : void 0;
|
|
2519
2626
|
return match ? match.cycleIndex : null;
|
|
2520
2627
|
}
|
|
2521
|
-
const firstScheduled = orders.find((
|
|
2628
|
+
const firstScheduled = orders.find((o3) => o3.status === "scheduled");
|
|
2522
2629
|
return (firstScheduled == null ? void 0 : firstScheduled.cycleIndex) ?? null;
|
|
2523
2630
|
}
|
|
2524
2631
|
async function recordAdjustment(subscriptionId, opts, buildAction, matcherOverride) {
|
|
@@ -2551,25 +2658,25 @@ function createMockSchedulesAdapter(subscriptions = createMockSubscriptionAdapte
|
|
|
2551
2658
|
const subs = await subscriptionsToProject(subscriptionId);
|
|
2552
2659
|
const skipCount = new Set(
|
|
2553
2660
|
stored.filter(
|
|
2554
|
-
(
|
|
2555
|
-
).map((
|
|
2661
|
+
(s2) => s2.adjustment.action.type === "SKIP_ORDER" || s2.adjustment.action.type === "SKIP_ITEM"
|
|
2662
|
+
).map((s2) => `${s2.subscriptionId}:${s2.cycle}`)
|
|
2556
2663
|
).size;
|
|
2557
2664
|
const depth = excludeSkipped ? count + skipCount : count;
|
|
2558
2665
|
const orders = subs.flatMap(
|
|
2559
2666
|
(sub) => applyAdjustments(projectUpcomingOrders(sub, depth), stored)
|
|
2560
|
-
).filter((
|
|
2561
|
-
(
|
|
2667
|
+
).filter((o3) => excludeSkipped ? !o3.skipped : true).map(
|
|
2668
|
+
(o3) => (
|
|
2562
2669
|
// Mirror backend removeSkippedItems: the billable view also strips
|
|
2563
2670
|
// skipped lines from surviving (partially-skipped) orders. No
|
|
2564
2671
|
// recompute needed — skipped lines already carry totalPrice 0 (R4).
|
|
2565
|
-
excludeSkipped &&
|
|
2672
|
+
excludeSkipped && o3.items.some((i3) => i3.skipped) ? { ...o3, items: o3.items.filter((i3) => !i3.skipped) } : o3
|
|
2566
2673
|
)
|
|
2567
|
-
).sort((
|
|
2674
|
+
).sort((a2, b3) => a2.date.localeCompare(b3.date));
|
|
2568
2675
|
return { _tag: "Success", data: orders.slice(0, count) };
|
|
2569
2676
|
},
|
|
2570
2677
|
async getAdjustments() {
|
|
2571
2678
|
await new Promise((r2) => setTimeout(r2, 200));
|
|
2572
|
-
return { _tag: "Success", data: stored.map((
|
|
2679
|
+
return { _tag: "Success", data: stored.map((s2) => s2.adjustment) };
|
|
2573
2680
|
},
|
|
2574
2681
|
async skipOrder({ subscriptionId, cycle, date }) {
|
|
2575
2682
|
await new Promise((r2) => setTimeout(r2, 300));
|
|
@@ -2642,7 +2749,7 @@ function createMockSchedulesAdapter(subscriptions = createMockSubscriptionAdapte
|
|
|
2642
2749
|
},
|
|
2643
2750
|
async removeAdjustment({ adjustmentId }) {
|
|
2644
2751
|
await new Promise((r2) => setTimeout(r2, 200));
|
|
2645
|
-
stored = stored.filter((
|
|
2752
|
+
stored = stored.filter((s2) => s2.adjustment.id !== adjustmentId);
|
|
2646
2753
|
return { _tag: "Success", data: void 0 };
|
|
2647
2754
|
}
|
|
2648
2755
|
};
|
|
@@ -2657,8 +2764,8 @@ function createApiSchedulesAdapter(fetcher) {
|
|
|
2657
2764
|
});
|
|
2658
2765
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2659
2766
|
return { _tag: "Success", data: void 0 };
|
|
2660
|
-
} catch (
|
|
2661
|
-
return { _tag: "Failure", error:
|
|
2767
|
+
} catch (e) {
|
|
2768
|
+
return { _tag: "Failure", error: e };
|
|
2662
2769
|
}
|
|
2663
2770
|
}
|
|
2664
2771
|
return {
|
|
@@ -2671,8 +2778,8 @@ function createApiSchedulesAdapter(fetcher) {
|
|
|
2671
2778
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2672
2779
|
const data = await res.json();
|
|
2673
2780
|
return { _tag: "Success", data: (data.orders ?? []).map(mapScheduleOrder) };
|
|
2674
|
-
} catch (
|
|
2675
|
-
return { _tag: "Failure", error:
|
|
2781
|
+
} catch (e) {
|
|
2782
|
+
return { _tag: "Failure", error: e };
|
|
2676
2783
|
}
|
|
2677
2784
|
},
|
|
2678
2785
|
async getAdjustments() {
|
|
@@ -2688,10 +2795,10 @@ function createApiSchedulesAdapter(fetcher) {
|
|
|
2688
2795
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2689
2796
|
const body = await res.json();
|
|
2690
2797
|
all.push(
|
|
2691
|
-
...body.data.map((
|
|
2692
|
-
id:
|
|
2693
|
-
matcher:
|
|
2694
|
-
action:
|
|
2798
|
+
...body.data.map((a2) => ({
|
|
2799
|
+
id: a2.id,
|
|
2800
|
+
matcher: a2.matcher,
|
|
2801
|
+
action: a2.action
|
|
2695
2802
|
}))
|
|
2696
2803
|
);
|
|
2697
2804
|
if (!body.hasNextPage) return { _tag: "Success", data: all };
|
|
@@ -2707,8 +2814,8 @@ function createApiSchedulesAdapter(fetcher) {
|
|
|
2707
2814
|
_tag: "Failure",
|
|
2708
2815
|
error: "Adjustments pagination exceeded 50 pages"
|
|
2709
2816
|
};
|
|
2710
|
-
} catch (
|
|
2711
|
-
return { _tag: "Failure", error:
|
|
2817
|
+
} catch (e) {
|
|
2818
|
+
return { _tag: "Failure", error: e };
|
|
2712
2819
|
}
|
|
2713
2820
|
},
|
|
2714
2821
|
async skipOrder({ cycle, date }) {
|
|
@@ -2784,16 +2891,16 @@ function createApiSchedulesAdapter(fetcher) {
|
|
|
2784
2891
|
);
|
|
2785
2892
|
if (!res.ok) return { _tag: "Failure", error: `HTTP ${res.status}` };
|
|
2786
2893
|
return { _tag: "Success", data: void 0 };
|
|
2787
|
-
} catch (
|
|
2788
|
-
return { _tag: "Failure", error:
|
|
2894
|
+
} catch (e) {
|
|
2895
|
+
return { _tag: "Failure", error: e };
|
|
2789
2896
|
}
|
|
2790
2897
|
}
|
|
2791
2898
|
};
|
|
2792
2899
|
}
|
|
2793
2900
|
const SchedulesServiceContext = createContext("services/schedules");
|
|
2794
|
-
function isSameCalendarDay(
|
|
2795
|
-
const da = new Date(
|
|
2796
|
-
const db = new Date(
|
|
2901
|
+
function isSameCalendarDay(a2, b3) {
|
|
2902
|
+
const da = new Date(a2);
|
|
2903
|
+
const db = new Date(b3);
|
|
2797
2904
|
if (Number.isNaN(da.getTime()) || Number.isNaN(db.getTime())) return false;
|
|
2798
2905
|
return da.toISOString().slice(0, 10) === db.toISOString().slice(0, 10);
|
|
2799
2906
|
}
|
|
@@ -2873,26 +2980,26 @@ function createSchedulesService(adapter, opts) {
|
|
|
2873
2980
|
const adjustments = await adapter.getAdjustments();
|
|
2874
2981
|
if (adjustments._tag === "Failure") return adjustments;
|
|
2875
2982
|
const covering = adjustments.data.filter(
|
|
2876
|
-
(
|
|
2983
|
+
(a2) => a2.action.type === "SKIP_ITEM" && a2.action.input.lineIds.includes(lineId) && matcherAffects(a2.matcher, { cycle, date })
|
|
2877
2984
|
);
|
|
2878
2985
|
if (covering.length === 0) {
|
|
2879
2986
|
return { _tag: "Failure", error: "No skip found for this item" };
|
|
2880
2987
|
}
|
|
2881
|
-
if (covering.some((
|
|
2988
|
+
if (covering.some((a2) => a2.action.input.lineIds.length > 1)) {
|
|
2882
2989
|
return {
|
|
2883
2990
|
_tag: "Failure",
|
|
2884
2991
|
error: "This item was skipped together with other items and can't be unskipped individually"
|
|
2885
2992
|
};
|
|
2886
2993
|
}
|
|
2887
|
-
if (covering.some((
|
|
2994
|
+
if (covering.some((a2) => !matcherExactlyTargets(a2.matcher, { cycle, date }))) {
|
|
2888
2995
|
return {
|
|
2889
2996
|
_tag: "Failure",
|
|
2890
2997
|
error: "This skip also affects another order and can't be removed from here"
|
|
2891
2998
|
};
|
|
2892
2999
|
}
|
|
2893
3000
|
let deleted = 0;
|
|
2894
|
-
for (const
|
|
2895
|
-
const result = await adapter.removeAdjustment({ adjustmentId:
|
|
3001
|
+
for (const a2 of covering) {
|
|
3002
|
+
const result = await adapter.removeAdjustment({ adjustmentId: a2.id });
|
|
2896
3003
|
if (result._tag === "Failure") {
|
|
2897
3004
|
if (deleted > 0) await notifyChanged(subscriptionId);
|
|
2898
3005
|
return result;
|
|
@@ -3127,7 +3234,7 @@ function createSubscriptionService(adapter) {
|
|
|
3127
3234
|
function getDefaultBlockForAction(actionType, actionConfig, blockId) {
|
|
3128
3235
|
const blockName = `action:${actionType}`;
|
|
3129
3236
|
const definedBlocks = getDefinedBlocks();
|
|
3130
|
-
const exists = definedBlocks.some((
|
|
3237
|
+
const exists = definedBlocks.some((b3) => b3.name === blockName);
|
|
3131
3238
|
if (!exists) {
|
|
3132
3239
|
throw new Error(
|
|
3133
3240
|
`No default block registered for action type "${actionType}". Expected a block named "${blockName}" to be registered in blocks-extensions.`
|
|
@@ -3137,7 +3244,7 @@ function getDefaultBlockForAction(actionType, actionConfig, blockId) {
|
|
|
3137
3244
|
}
|
|
3138
3245
|
function hasDefaultBlockForAction(actionType) {
|
|
3139
3246
|
const blockName = `action:${actionType}`;
|
|
3140
|
-
return getDefinedBlocks().some((
|
|
3247
|
+
return getDefinedBlocks().some((b3) => b3.name === blockName);
|
|
3141
3248
|
}
|
|
3142
3249
|
const WorkflowServiceContext = createContext("services/workflow");
|
|
3143
3250
|
const RUN_SCOPED_RESET = {
|
|
@@ -3275,7 +3382,7 @@ function createWorkflowService(deps) {
|
|
|
3275
3382
|
outcome: null
|
|
3276
3383
|
});
|
|
3277
3384
|
if (editor.isEditorMode) {
|
|
3278
|
-
const displayStepId = isInitialResponse && previewStepId && ((_e = data.interactiveSteps) == null ? void 0 : _e.some((
|
|
3385
|
+
const displayStepId = isInitialResponse && previewStepId && ((_e = data.interactiveSteps) == null ? void 0 : _e.some((s2) => s2.stepId === previewStepId)) ? previewStepId : currentStepId;
|
|
3279
3386
|
const overlayBlocks = deps.themeState.overlay.blocks.value;
|
|
3280
3387
|
const rootBlock = overlayBlocks[0];
|
|
3281
3388
|
const stepSlot = displayStepId ? (_f = rootBlock == null ? void 0 : rootBlock.slots) == null ? void 0 : _f[displayStepId] : null;
|
|
@@ -3370,7 +3477,7 @@ function createWorkflowService(deps) {
|
|
|
3370
3477
|
const presets = {};
|
|
3371
3478
|
const baseLabelFor = (step) => {
|
|
3372
3479
|
var _a;
|
|
3373
|
-
return ((_a = getDefinedBlocks().find((
|
|
3480
|
+
return ((_a = getDefinedBlocks().find((b3) => b3.name === `action:${step.actionType}`)) == null ? void 0 : _a.displayName) ?? step.stepId;
|
|
3374
3481
|
};
|
|
3375
3482
|
const totalCounts = /* @__PURE__ */ new Map();
|
|
3376
3483
|
for (const step of allSteps) {
|
|
@@ -3965,9 +4072,9 @@ const gridV1Engine = {
|
|
|
3965
4072
|
case "resize": {
|
|
3966
4073
|
const current = layout.items[cmd.blockId];
|
|
3967
4074
|
if (current) {
|
|
3968
|
-
const
|
|
3969
|
-
const
|
|
3970
|
-
layout.items[cmd.blockId] = { ...current, w:
|
|
4075
|
+
const w4 = Math.max(1, Math.min(cmd.size.w, ctx2.cols - current.c));
|
|
4076
|
+
const h2 = Math.max(1, cmd.size.h);
|
|
4077
|
+
layout.items[cmd.blockId] = { ...current, w: w4, h: h2 };
|
|
3971
4078
|
}
|
|
3972
4079
|
break;
|
|
3973
4080
|
}
|
|
@@ -4034,7 +4141,7 @@ function insertRectRelative(doc, args) {
|
|
|
4034
4141
|
if (!layout) continue;
|
|
4035
4142
|
const target = layout.items[args.targetId];
|
|
4036
4143
|
if (!target) continue;
|
|
4037
|
-
const cols = ((_a = doc.breakpoints.find((
|
|
4144
|
+
const cols = ((_a = doc.breakpoints.find((b3) => b3.id === breakpointId)) == null ? void 0 : _a.cols) ?? ((_b = layout.grid) == null ? void 0 : _b.cols) ?? DEFAULT_GRID.cols;
|
|
4038
4145
|
const insertRow = args.position === "before" ? target.r : target.r + target.h;
|
|
4039
4146
|
for (const [id, rect] of Object.entries(layout.items)) {
|
|
4040
4147
|
if (id === args.blockId) continue;
|
|
@@ -4085,18 +4192,19 @@ export {
|
|
|
4085
4192
|
AuthenticationError,
|
|
4086
4193
|
AuthenticationErrorReason,
|
|
4087
4194
|
B as BlockWrapperEvent,
|
|
4088
|
-
|
|
4089
|
-
|
|
4195
|
+
q as ContextProvideEvent,
|
|
4196
|
+
t as ContextRequestEvent,
|
|
4090
4197
|
CustomerServiceContext,
|
|
4091
|
-
|
|
4092
|
-
|
|
4198
|
+
h as DEFAULT_BREAKPOINTS,
|
|
4199
|
+
i2 as DEFAULT_GLOBAL_STYLES,
|
|
4093
4200
|
DEFAULT_GRID,
|
|
4094
4201
|
DEFAULT_NEW_BLOCK_HEIGHT,
|
|
4095
4202
|
DISCOUNT_REJECTION_REASONS,
|
|
4096
4203
|
GRID_V1_ENGINE_ID,
|
|
4097
|
-
|
|
4204
|
+
L2 as LAYOUT_SCOPE_ATTR,
|
|
4098
4205
|
LoginServiceContext,
|
|
4099
|
-
|
|
4206
|
+
OrderServiceContext,
|
|
4207
|
+
OverlayServiceContext,
|
|
4100
4208
|
P as PAGE_ROOT_SLOT,
|
|
4101
4209
|
ProductServiceContext,
|
|
4102
4210
|
RouterServiceContext,
|
|
@@ -4107,99 +4215,105 @@ export {
|
|
|
4107
4215
|
u as Signal,
|
|
4108
4216
|
StateContext,
|
|
4109
4217
|
SubscriptionServiceContext,
|
|
4110
|
-
|
|
4218
|
+
a as ThemeStateContext,
|
|
4111
4219
|
T as TranslationContext,
|
|
4112
4220
|
WorkflowServiceContext,
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4221
|
+
v as __recordDevtoolsInstance,
|
|
4222
|
+
_ as __recordDevtoolsPropSetter,
|
|
4223
|
+
x as attachEmptyTracking,
|
|
4224
|
+
c as backfillInstanceDefaults,
|
|
4225
|
+
b2 as buildGridLayout,
|
|
4226
|
+
j as buildLayoutCss,
|
|
4117
4227
|
canvasMode,
|
|
4118
4228
|
clampRect,
|
|
4119
|
-
|
|
4229
|
+
k2 as classifyRowDividers,
|
|
4120
4230
|
clearAllSurfaceContexts,
|
|
4121
4231
|
clearLayoutModeAdapter,
|
|
4122
4232
|
compactItems,
|
|
4123
|
-
|
|
4233
|
+
l2 as compactLayoutDocument,
|
|
4124
4234
|
w as computed,
|
|
4125
4235
|
createApiCustomerAdapter,
|
|
4126
4236
|
createApiLoginAdapter,
|
|
4127
|
-
|
|
4237
|
+
createApiOrderAdapter,
|
|
4128
4238
|
createApiProductAdapter,
|
|
4129
4239
|
createApiSchedulesAdapter,
|
|
4130
4240
|
createApiSubscriptionAdapter,
|
|
4131
4241
|
createBlockInstance,
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4242
|
+
y as createBlockInstanceFromJSON,
|
|
4243
|
+
g as createBlockInstanceFromObject,
|
|
4244
|
+
z as createCeRenderer,
|
|
4135
4245
|
createContext,
|
|
4136
4246
|
createCustomerService,
|
|
4137
|
-
|
|
4247
|
+
m as createDefaultLayoutDocument,
|
|
4138
4248
|
createLoginService,
|
|
4139
4249
|
createMockCustomerAdapter,
|
|
4140
4250
|
createMockLoginAdapter,
|
|
4141
|
-
|
|
4251
|
+
createMockOrderAdapter,
|
|
4142
4252
|
createMockProductAdapter,
|
|
4143
4253
|
createMockRouterService,
|
|
4144
4254
|
createMockSchedulesAdapter,
|
|
4145
4255
|
createMockSubscriptionAdapter,
|
|
4146
4256
|
createMockWorkflowApiAdapter,
|
|
4147
|
-
|
|
4257
|
+
createOrderService,
|
|
4258
|
+
createOverlayService,
|
|
4148
4259
|
createProductService,
|
|
4149
4260
|
createRouterService,
|
|
4150
4261
|
createSchedulesService,
|
|
4151
|
-
|
|
4262
|
+
A as createSelectedBlock,
|
|
4152
4263
|
createSettingsService,
|
|
4153
4264
|
createShopService,
|
|
4154
4265
|
createState,
|
|
4155
4266
|
createSubscriptionService,
|
|
4156
|
-
|
|
4157
|
-
|
|
4267
|
+
n as createThemeState,
|
|
4268
|
+
o2 as createTranslationService,
|
|
4158
4269
|
createWorkflowApiAdapter,
|
|
4159
4270
|
createWorkflowService,
|
|
4160
4271
|
defineBlock,
|
|
4161
|
-
|
|
4162
|
-
|
|
4272
|
+
D as defineBlockRuntime,
|
|
4273
|
+
defineOverlayWrapper,
|
|
4274
|
+
p as deriveLayout,
|
|
4163
4275
|
E as effect,
|
|
4164
4276
|
emitLayoutCommand,
|
|
4165
4277
|
emitLayoutSetRects,
|
|
4166
|
-
|
|
4278
|
+
q2 as expandFillLayoutDocument,
|
|
4167
4279
|
findFreeRect,
|
|
4168
4280
|
getActiveSurfaceContext,
|
|
4169
4281
|
getDefaultBlockForAction,
|
|
4170
4282
|
getDefinedBlocks,
|
|
4283
|
+
F as getDevtoolsBlockState,
|
|
4171
4284
|
getLayoutModeAdapter,
|
|
4172
4285
|
gridV1Engine,
|
|
4173
4286
|
hasDefaultBlockForAction,
|
|
4174
|
-
|
|
4175
|
-
|
|
4287
|
+
G as hasRenderedContent,
|
|
4288
|
+
s as indexOverrides,
|
|
4176
4289
|
i as injectContext,
|
|
4177
4290
|
insertRectRelative,
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4291
|
+
H as isEditorPreview,
|
|
4292
|
+
b as isStubDefinition,
|
|
4293
|
+
t2 as layoutScopeSelector,
|
|
4294
|
+
I as layoutSystemEnabled,
|
|
4182
4295
|
loadBlockRegistry,
|
|
4183
4296
|
loginService,
|
|
4184
4297
|
o as onRegisterBlock,
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4298
|
+
u2 as projectToCss,
|
|
4299
|
+
p2 as projectToGridStack,
|
|
4300
|
+
J as provideContext,
|
|
4301
|
+
v2 as readingOrder,
|
|
4302
|
+
c2 as reconcileLayout,
|
|
4303
|
+
w3 as rectsOverlap,
|
|
4191
4304
|
registerBlock,
|
|
4192
4305
|
registerLayoutModeAdapter,
|
|
4193
4306
|
resetBreakpoint,
|
|
4194
4307
|
r as resolveLayout,
|
|
4195
|
-
|
|
4308
|
+
k as serializeBlocks,
|
|
4196
4309
|
setActiveSurfaceContext,
|
|
4310
|
+
K as setDevtoolsBlockProp,
|
|
4197
4311
|
setLayoutCommandDispatcher,
|
|
4198
4312
|
setLayoutCommandEmitter,
|
|
4199
|
-
|
|
4313
|
+
l as setLayoutSystemEnabled,
|
|
4200
4314
|
d as signal,
|
|
4201
4315
|
subscribeContext,
|
|
4202
|
-
|
|
4316
|
+
L as untracked,
|
|
4203
4317
|
waitForDevBlocksUrl,
|
|
4204
4318
|
w2 as withWrapper
|
|
4205
4319
|
};
|