@juo/blocks 1.14.0 → 1.16.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.
- package/dist/{ExtensionRoot-CRJx0Dtr.js → ExtensionRoot-C3lVJEBl.js} +9 -2
- package/dist/{block-VhmfGB3N.js → block-dVP4Rqgz.js} +9 -0
- package/dist/block.d.ts.map +1 -1
- package/dist/block.devtools.test.d.ts +2 -0
- package/dist/block.devtools.test.d.ts.map +1 -0
- package/dist/{bridge-D838SWmN.js → bridge-xiKEzCGR.js} +30 -30
- package/dist/context.d.ts.map +1 -1
- package/dist/context.devtools.test.d.ts +2 -0
- package/dist/context.devtools.test.d.ts.map +1 -0
- package/dist/core.js +2390 -465
- package/dist/{css-runtime-DWytAzZ5.js → css-runtime-ClH0MEYr.js} +151 -113
- package/dist/devtools/env.d.ts +3 -0
- package/dist/devtools/env.d.ts.map +1 -0
- package/dist/devtools/hook.d.ts +40 -0
- package/dist/devtools/hook.d.ts.map +1 -0
- package/dist/devtools/index.d.ts +5 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/instrumentation.d.ts +47 -0
- package/dist/devtools/instrumentation.d.ts.map +1 -0
- package/dist/devtools/protocol.d.ts +77 -0
- package/dist/devtools/protocol.d.ts.map +1 -0
- package/dist/devtools.js +11 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/layout-command-emitter.d.ts +6 -0
- package/dist/editor/layout-command-emitter.d.ts.map +1 -1
- package/dist/editor/main.d.ts.map +1 -1
- package/dist/editor/messages.d.ts +6 -0
- package/dist/editor/messages.d.ts.map +1 -1
- package/dist/editor.js +74 -67
- package/dist/{gridstack-adapter-DreG3XnB.js → gridstack-adapter-CDWbSpbt.js} +15 -16
- package/dist/index-JSv6UH_o.js +169 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/insert.d.ts +14 -11
- package/dist/layout/insert.d.ts.map +1 -1
- package/dist/layout/override.d.ts +10 -0
- package/dist/layout/override.d.ts.map +1 -0
- package/dist/layout/override.test.d.ts +2 -0
- package/dist/layout/override.test.d.ts.map +1 -0
- package/dist/layout/project-css.d.ts.map +1 -1
- package/dist/layout/reconcile.d.ts +4 -3
- package/dist/layout/reconcile.d.ts.map +1 -1
- package/dist/{morph-Dj-xvrwt.js → morph-n4LMxOYo.js} +1 -1
- package/dist/preact/block.d.ts.map +1 -1
- package/dist/preact.js +16 -12
- package/dist/{project-gridstack-DYLMKSH1.js → project-gridstack-CM783oKI.js} +1 -1
- package/dist/react/block.d.ts.map +1 -1
- package/dist/react.js +15 -11
- package/dist/registry.devtools.test.d.ts +2 -0
- package/dist/registry.devtools.test.d.ts.map +1 -0
- package/dist/services/customer/adapter.d.ts +8 -0
- package/dist/services/customer/adapter.d.ts.map +1 -0
- package/dist/services/customer/customerService.d.ts +3 -2
- package/dist/services/customer/customerService.d.ts.map +1 -1
- package/dist/services/customer/index.d.ts +1 -0
- package/dist/services/customer/index.d.ts.map +1 -1
- package/dist/services/customer/types.d.ts +4 -1
- package/dist/services/customer/types.d.ts.map +1 -1
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/login/adapter.d.ts +33 -0
- package/dist/services/login/adapter.d.ts.map +1 -0
- package/dist/services/login/index.d.ts +3 -1
- package/dist/services/login/index.d.ts.map +1 -1
- package/dist/services/login/loginService.d.ts +6 -2
- package/dist/services/login/loginService.d.ts.map +1 -1
- package/dist/services/order/adapter.d.ts +9 -0
- package/dist/services/order/adapter.d.ts.map +1 -0
- package/dist/services/order/index.d.ts +5 -0
- package/dist/services/order/index.d.ts.map +1 -0
- package/dist/services/order/orderService.d.ts +7 -0
- package/dist/services/order/orderService.d.ts.map +1 -0
- package/dist/services/order/types.d.ts +21 -0
- package/dist/services/order/types.d.ts.map +1 -0
- package/dist/services/orders/adapter.d.ts +2 -0
- package/dist/services/orders/adapter.d.ts.map +1 -1
- package/dist/services/orders/index.d.ts +1 -1
- package/dist/services/orders/index.d.ts.map +1 -1
- package/dist/services/product/adapter.d.ts +27 -2
- package/dist/services/product/adapter.d.ts.map +1 -1
- package/dist/services/product/adapter.test.d.ts +2 -0
- package/dist/services/product/adapter.test.d.ts.map +1 -0
- package/dist/services/product/index.d.ts +1 -1
- package/dist/services/product/index.d.ts.map +1 -1
- package/dist/services/product/productService.d.ts.map +1 -1
- package/dist/services/product/types.d.ts +68 -0
- package/dist/services/product/types.d.ts.map +1 -1
- package/dist/services/schedules/adapter.d.ts +94 -0
- package/dist/services/schedules/adapter.d.ts.map +1 -0
- package/dist/services/schedules/adapter.test.d.ts +2 -0
- package/dist/services/schedules/adapter.test.d.ts.map +1 -0
- package/dist/services/schedules/apiSchedulesAdapter.test.d.ts +2 -0
- package/dist/services/schedules/apiSchedulesAdapter.test.d.ts.map +1 -0
- package/dist/services/schedules/index.d.ts +5 -0
- package/dist/services/schedules/index.d.ts.map +1 -0
- package/dist/services/schedules/schedulesService.d.ts +11 -0
- package/dist/services/schedules/schedulesService.d.ts.map +1 -0
- package/dist/services/schedules/schedulesService.test.d.ts +2 -0
- package/dist/services/schedules/schedulesService.test.d.ts.map +1 -0
- package/dist/services/schedules/types.d.ts +290 -0
- package/dist/services/schedules/types.d.ts.map +1 -0
- package/dist/services/settings/index.d.ts +3 -0
- package/dist/services/settings/index.d.ts.map +1 -0
- package/dist/services/settings/settingsService.d.ts +7 -0
- package/dist/services/settings/settingsService.d.ts.map +1 -0
- package/dist/services/settings/settingsService.test.d.ts +2 -0
- package/dist/services/settings/settingsService.test.d.ts.map +1 -0
- package/dist/services/settings/types.d.ts +35 -0
- package/dist/services/settings/types.d.ts.map +1 -0
- package/dist/services/shop/index.d.ts +3 -0
- package/dist/services/shop/index.d.ts.map +1 -0
- package/dist/services/shop/shopService.d.ts +12 -0
- package/dist/services/shop/shopService.d.ts.map +1 -0
- package/dist/services/shop/shopService.test.d.ts +2 -0
- package/dist/services/shop/shopService.test.d.ts.map +1 -0
- package/dist/services/shop/types.d.ts +7 -0
- package/dist/services/shop/types.d.ts.map +1 -0
- package/dist/services/subscription/adapter.d.ts +77 -2
- package/dist/services/subscription/adapter.d.ts.map +1 -1
- package/dist/services/subscription/adapter.test.d.ts +2 -0
- package/dist/services/subscription/adapter.test.d.ts.map +1 -0
- package/dist/services/subscription/index.d.ts +1 -1
- package/dist/services/subscription/index.d.ts.map +1 -1
- package/dist/services/subscription/subscriptionService.d.ts +1 -6
- package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
- package/dist/services/subscription/types.d.ts +220 -9
- package/dist/services/subscription/types.d.ts.map +1 -1
- package/dist/services/subscription/types.test.d.ts +2 -0
- package/dist/services/subscription/types.test.d.ts.map +1 -0
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/vue/block.d.ts.map +1 -1
- package/dist/vue/context.d.ts +1 -0
- package/dist/vue/context.d.ts.map +1 -1
- package/dist/vue.js +34 -6
- package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
- package/dist/web-components/editor/editor-layout-controller.d.ts.map +1 -1
- package/dist/web-components/editor/gridstack-adapter.d.ts.map +1 -1
- package/dist/web-components/layout-mode-adapter.d.ts +6 -0
- package/dist/web-components/layout-mode-adapter.d.ts.map +1 -1
- package/dist/web-components-editor.js +11 -6
- package/dist/web-components-runtime.js +2 -2
- package/package.json +5 -1
package/dist/layout/insert.d.ts
CHANGED
|
@@ -8,20 +8,23 @@ export type InsertPosition = "before" | "after";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const DEFAULT_NEW_BLOCK_HEIGHT = 4;
|
|
10
10
|
/**
|
|
11
|
-
* Insert a rect for `blockId` adjacent to `targetId` in
|
|
12
|
-
* `doc`, so a block added via the editor's add buttons lands directly
|
|
13
|
-
* above/below the block it was added relative to — not at the end of the grid
|
|
11
|
+
* Insert a rect for `blockId` adjacent to `targetId` in EVERY stored breakpoint
|
|
12
|
+
* of `doc`, so a block added via the editor's add buttons lands directly
|
|
13
|
+
* above/below the block it was added relative to — not at the end of the grid —
|
|
14
|
+
* in each viewport (desktop and an independent `layouts.mobile` alike).
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
* in the same lane the user added it from
|
|
17
|
-
* full-width
|
|
16
|
+
* Within each breakpoint the new block inherits that breakpoint's target column
|
|
17
|
+
* (`c`) and width (`w`), so it appears in the same lane the user added it from
|
|
18
|
+
* (full-width when the target is full-width; the single mobile lane on a cols:1
|
|
19
|
+
* breakpoint). Every block at or below the insertion row is shifted down by the
|
|
18
20
|
* new block's height so reading order is preserved regardless of GridStack's
|
|
19
|
-
* compaction.
|
|
21
|
+
* compaction. Because each breakpoint uses its own target rect, the desktop and
|
|
22
|
+
* mobile orders stay independent.
|
|
20
23
|
*
|
|
21
|
-
* Returns a NEW document; the input is never mutated.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* end-of-grid placement.
|
|
24
|
+
* Returns a NEW document; the input is never mutated. Breakpoints whose layout
|
|
25
|
+
* doesn't contain the target (not reconciled yet, or derived-on-demand) are
|
|
26
|
+
* skipped; if no breakpoint contains it the document is returned unchanged and
|
|
27
|
+
* `reconcileLayout` falls back to its default end-of-grid placement.
|
|
25
28
|
*/
|
|
26
29
|
export declare function insertRectRelative(doc: LayoutDocument, args: {
|
|
27
30
|
blockId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../src/layout/insert.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../src/layout/insert.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;CAC1B,GACA,cAAc,CAgChB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LayoutDocument } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Couple a non-base breakpoint back to desktop: drop its stored layout so it
|
|
4
|
+
* follows the base breakpoint again. All-or-nothing.
|
|
5
|
+
*
|
|
6
|
+
* No-op when the breakpoint is the base (never delete the authored layout) or
|
|
7
|
+
* when nothing is stored for it. Never mutates the input document.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resetBreakpoint(doc: LayoutDocument, breakpointId: string): LayoutDocument;
|
|
10
|
+
//# sourceMappingURL=override.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"override.d.ts","sourceRoot":"","sources":["../../src/layout/override.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,MAAM,GACnB,cAAc,CAQhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"override.test.d.ts","sourceRoot":"","sources":["../../src/layout/override.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-css.d.ts","sourceRoot":"","sources":["../../src/layout/project-css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-css.d.ts","sourceRoot":"","sources":["../../src/layout/project-css.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAwB,cAAc,EAAuB,MAAM,SAAS,CAAC;AAwOzF,wBAAgB,YAAY,CAC1B,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAC3C,MAAM,CAqBR"}
|
|
@@ -6,8 +6,9 @@ export declare function reconcileLayout(doc: LayoutDocument | null | undefined,
|
|
|
6
6
|
* `float:false` gravity (see `compactItems`). Used after mutations that can
|
|
7
7
|
* leave the settled CSS-grid view out of sync with the GridStack model — most
|
|
8
8
|
* notably deleting a block (which otherwise leaves a vertical gap) or stretching
|
|
9
|
-
* one to full width (which otherwise overlays its row-mates).
|
|
10
|
-
*
|
|
9
|
+
* one to full width (which otherwise overlays its row-mates). Runs on every
|
|
10
|
+
* stored breakpoint so an independent `layouts.mobile` compacts too; absent
|
|
11
|
+
* (derived) breakpoints are untouched.
|
|
11
12
|
*/
|
|
12
13
|
export declare function compactLayoutDocument(doc: LayoutDocument | null | undefined): LayoutDocument | null | undefined;
|
|
13
14
|
/**
|
|
@@ -16,7 +17,7 @@ export declare function compactLayoutDocument(doc: LayoutDocument | null | undef
|
|
|
16
17
|
* (e.g. deleting or adding a block) reconcile + compact the layout but do NOT go
|
|
17
18
|
* through the grid engine's command pipeline, so without this a fill block never
|
|
18
19
|
* reclaims the columns a deleted row-mate vacates. Kept document-level to mirror
|
|
19
|
-
* `compactLayoutDocument` and run right after it.
|
|
20
|
+
* `compactLayoutDocument` and run right after it, across every stored breakpoint.
|
|
20
21
|
*/
|
|
21
22
|
export declare function expandFillLayoutDocument(doc: LayoutDocument | null | undefined): LayoutDocument | null | undefined;
|
|
22
23
|
//# sourceMappingURL=reconcile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../src/layout/reconcile.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,cAAc,CAa9E;
|
|
1
|
+
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../src/layout/reconcile.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,cAAc,CAa9E;AAmCD,wBAAgB,eAAe,CAC7B,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACtC,QAAQ,EAAE,MAAM,EAAE,GACjB,cAAc,CA0ChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GACrC,cAAc,GAAG,IAAI,GAAG,SAAS,CAYnC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GACrC,cAAc,GAAG,IAAI,GAAG,SAAS,CAYnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { canvasMode, effect } from "@juo/blocks";
|
|
2
|
-
import {
|
|
2
|
+
import { g as getEditorBridge, c as createLayoutingModeChangedMessage, W as WRAPPER_SELECTOR } from "./bridge-xiKEzCGR.js";
|
|
3
3
|
import { LAYOUT_INTERACTION_START, LAYOUT_INTERACTION_END, LAYOUT_POP_CLASS } from "./layout-mode-adapter-BBd4JRQd.js";
|
|
4
4
|
function setCanvasMode(enabled) {
|
|
5
5
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/preact/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/preact/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0BjD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAC1C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAC1B,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAuCvC;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAC5C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAoEvC"}
|
package/dist/preact.js
CHANGED
|
@@ -3,10 +3,11 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { effect, injectContext, provideContext, createCeRenderer, attachEmptyTracking } from "@juo/blocks";
|
|
5
5
|
import { useState, useRef, useEffect, useContext as useContext$1, useMemo } from "preact/hooks";
|
|
6
|
-
import { g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-
|
|
7
|
-
import { t } from "./block-
|
|
6
|
+
import { g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-dVP4Rqgz.js";
|
|
7
|
+
import { t } from "./block-dVP4Rqgz.js";
|
|
8
8
|
import { createContext, h, render } from "preact";
|
|
9
|
-
import {
|
|
9
|
+
import { g as getInstrumentation } from "./index-JSv6UH_o.js";
|
|
10
|
+
import { a as createEditorBridge } from "./bridge-xiKEzCGR.js";
|
|
10
11
|
function toState(signal) {
|
|
11
12
|
const [value, setValue] = useState(() => getSignalValue(signal));
|
|
12
13
|
const disposeRef = useRef(null);
|
|
@@ -122,15 +123,18 @@ function createPreactRenderer(component) {
|
|
|
122
123
|
const wrapper = document.createElement("div");
|
|
123
124
|
wrapper.setAttribute("data-block-id", block.id);
|
|
124
125
|
wrapper.setAttribute("data-block-type", block.type);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
const renderTree = (props) => {
|
|
127
|
+
render(
|
|
128
|
+
h(ContextProvider, {
|
|
129
|
+
children: h(
|
|
130
|
+
component,
|
|
131
|
+
{ ...props, ...renderSlots(block.slots) }
|
|
132
|
+
)
|
|
133
|
+
}),
|
|
134
|
+
wrapper
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
renderTree(getInstrumentation().bindLiveProps(block, renderTree));
|
|
134
138
|
attachEmptyTracking(wrapper);
|
|
135
139
|
return wrapper;
|
|
136
140
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/react/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/react/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAwBjD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,GAAG,EACzC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAuCvC;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,GAAG,EAC3C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACjC,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAyEvC"}
|
package/dist/react.js
CHANGED
|
@@ -3,10 +3,11 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { effect, injectContext, provideContext, createCeRenderer, attachEmptyTracking } from "@juo/blocks";
|
|
5
5
|
import React, { useSyncExternalStore, createContext, useState, useContext as useContext$1, useMemo, useRef, useEffect } from "react";
|
|
6
|
-
import { g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-
|
|
7
|
-
import { t } from "./block-
|
|
6
|
+
import { g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-dVP4Rqgz.js";
|
|
7
|
+
import { t } from "./block-dVP4Rqgz.js";
|
|
8
8
|
import { createRoot } from "react-dom/client";
|
|
9
|
-
import {
|
|
9
|
+
import { g as getInstrumentation } from "./index-JSv6UH_o.js";
|
|
10
|
+
import { a as createEditorBridge } from "./bridge-xiKEzCGR.js";
|
|
10
11
|
function toState(signal) {
|
|
11
12
|
const subscribe = (callback) => {
|
|
12
13
|
const dispose = effect(() => {
|
|
@@ -105,14 +106,17 @@ function createReactRenderer(component) {
|
|
|
105
106
|
wrapper.setAttribute("data-block-id", block.id);
|
|
106
107
|
wrapper.setAttribute("data-block-type", block.type);
|
|
107
108
|
const root = createRoot(wrapper);
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
const renderTree = (props) => {
|
|
110
|
+
root.render(
|
|
111
|
+
React.createElement(ContextProvider, {
|
|
112
|
+
children: React.createElement(
|
|
113
|
+
component,
|
|
114
|
+
{ ...props, ...renderSlots(block.slots) }
|
|
115
|
+
)
|
|
116
|
+
})
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
renderTree(getInstrumentation().bindLiveProps(block, renderTree));
|
|
116
120
|
attachEmptyTracking(wrapper);
|
|
117
121
|
return wrapper;
|
|
118
122
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.devtools.test.d.ts","sourceRoot":"","sources":["../src/registry.devtools.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Customer } from './types';
|
|
2
|
+
import { ApiFetcher, Result } from '../../utils';
|
|
3
|
+
export interface CustomerAdapter {
|
|
4
|
+
getCurrent(): Promise<Result<Customer | null>>;
|
|
5
|
+
}
|
|
6
|
+
export declare function createMockCustomerAdapter(): CustomerAdapter;
|
|
7
|
+
export declare function createApiCustomerAdapter(fetcher: ApiFetcher): CustomerAdapter;
|
|
8
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/customer/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;CAChD;AAED,wBAAgB,yBAAyB,IAAI,eAAe,CAO3D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,eAAe,CAyB7E"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CustomerAdapter } from './adapter';
|
|
2
2
|
import { CustomerService } from './types';
|
|
3
3
|
type CreateCustomerServiceOptions = {
|
|
4
|
+
adapter: CustomerAdapter;
|
|
4
5
|
/**
|
|
5
6
|
* Absolute storefront URL for account / orders (Header `<a href>` + `target="_parent"`).
|
|
6
7
|
* Called once when the service is created; hosts that need reactivity (portal) update
|
|
@@ -8,7 +9,7 @@ type CreateCustomerServiceOptions = {
|
|
|
8
9
|
*/
|
|
9
10
|
getAccountOrdersUrl: () => string;
|
|
10
11
|
};
|
|
11
|
-
export declare function createCustomerService(options: CreateCustomerServiceOptions):
|
|
12
|
+
export declare function createCustomerService(options: CreateCustomerServiceOptions): CustomerService;
|
|
12
13
|
export declare const CustomerServiceContext: {
|
|
13
14
|
__context__: CustomerService;
|
|
14
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customerService.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"customerService.d.ts","sourceRoot":"","sources":["../../../src/services/customer/customerService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAClC,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACnC,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,eAAe,CAajB;AAED,eAAO,MAAM,sBAAsB;;CACkB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type CustomerService, type Customer } from './types';
|
|
2
2
|
export { createCustomerService, CustomerServiceContext, } from './customerService';
|
|
3
|
+
export { type CustomerAdapter, createMockCustomerAdapter, createApiCustomerAdapter, } from './adapter';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/customer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/customer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,WAAW,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Signal } from '@preact/signals-core';
|
|
2
|
+
import { Result } from '../../utils';
|
|
2
3
|
/** Signed-in customer identity for blocks such as Header (name / email display). */
|
|
3
4
|
export type Customer = {
|
|
4
5
|
id: string;
|
|
5
6
|
name: string;
|
|
6
|
-
email
|
|
7
|
+
email?: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
7
9
|
};
|
|
8
10
|
export type CustomerService = {
|
|
9
11
|
current: Signal<Customer | null>;
|
|
12
|
+
getCurrent(): Promise<Result<Customer | null>>;
|
|
10
13
|
accountOrdersUrl: Signal<string>;
|
|
11
14
|
};
|
|
12
15
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/customer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/customer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,oFAAoF;AACpF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACjC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/C,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC"}
|
package/dist/services/index.d.ts
CHANGED
|
@@ -3,5 +3,8 @@ export * from './login';
|
|
|
3
3
|
export * from './orders';
|
|
4
4
|
export * from './product';
|
|
5
5
|
export * from './router';
|
|
6
|
+
export * from './schedules';
|
|
7
|
+
export * from './settings';
|
|
8
|
+
export * from './shop';
|
|
6
9
|
export * from './subscription';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ApiFetcher, Result } from '../../utils';
|
|
2
|
+
export type AuthTokens = {
|
|
3
|
+
access_token: string;
|
|
4
|
+
refresh_token: string;
|
|
5
|
+
expires_in: number;
|
|
6
|
+
};
|
|
7
|
+
export interface LoginAdapter {
|
|
8
|
+
passwordlessStart(params: {
|
|
9
|
+
email: string;
|
|
10
|
+
lang: string;
|
|
11
|
+
}): Promise<Result<void>>;
|
|
12
|
+
authenticate(params: {
|
|
13
|
+
email: string;
|
|
14
|
+
code: string;
|
|
15
|
+
} | {
|
|
16
|
+
code: string;
|
|
17
|
+
} | {
|
|
18
|
+
refreshToken: string;
|
|
19
|
+
}): Promise<Result<AuthTokens>>;
|
|
20
|
+
getAuthorizeUrl(params: {
|
|
21
|
+
connection: "facebook" | "google-oauth2";
|
|
22
|
+
state: string;
|
|
23
|
+
shop: string;
|
|
24
|
+
}): string;
|
|
25
|
+
}
|
|
26
|
+
export declare function createMockLoginAdapter(opts?: {
|
|
27
|
+
appUrl?: string;
|
|
28
|
+
}): LoginAdapter;
|
|
29
|
+
export declare function createApiLoginAdapter(fetcher: ApiFetcher, opts: {
|
|
30
|
+
shopDomain: string;
|
|
31
|
+
appUrl: string;
|
|
32
|
+
}): LoginAdapter;
|
|
33
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/login/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGtD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,MAAM,EAAE;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1B,YAAY,CACV,MAAM,EACF;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAC/B;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAChB;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAC3B,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAE/B,eAAe,CAAC,MAAM,EAAE;QACtB,UAAU,EAAE,UAAU,GAAG,eAAe,CAAC;QACzC,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,MAAM,CAAC;CACZ;AAED,wBAAgB,sBAAsB,CACpC,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7B,YAAY,CAwBd;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3C,YAAY,CAoHd"}
|
|
@@ -13,11 +13,13 @@ type LoginService = {
|
|
|
13
13
|
};
|
|
14
14
|
isAuthenticated: Signal<boolean>;
|
|
15
15
|
getToken(): Promise<string | null>;
|
|
16
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
16
17
|
handleQueryParams(query: URLSearchParams): Promise<Result<void, ErrorDetails>>;
|
|
17
18
|
logout(): Promise<Result>;
|
|
18
19
|
};
|
|
19
20
|
export declare const LoginServiceContext: {
|
|
20
21
|
__context__: LoginService;
|
|
21
22
|
};
|
|
22
|
-
export { loginService, type LoginServiceDependencies, type ErrorFormatter, AuthenticationError, AuthenticationErrorReason, } from './loginService';
|
|
23
|
+
export { loginService, createLoginService, type LoginServiceDependencies, type ErrorFormatter, AuthenticationError, AuthenticationErrorReason, } from './loginService';
|
|
24
|
+
export { type LoginAdapter, type AuthTokens, createApiLoginAdapter, createMockLoginAdapter, } from './adapter';
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/login/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD,KAAK,YAAY,GAAG;IAClB,YAAY,EAAE;QACZ,KAAK,EAAE;YACL,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;YAC1D,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;SAC1E,CAAC;KACH,CAAC;IAEF,MAAM,EAAE;QACN,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;QAC5E,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;KAC3D,CAAC;IAEF,eAAe,EAAE,MAAM,CAAC,O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AAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEnC,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAElD,iBAAiB,CACf,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IAEvC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;CACe,CAAC;AAEhD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,WAAW,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Signal } from '@preact/signals-core';
|
|
2
|
+
import { LoginAdapter } from './adapter';
|
|
2
3
|
export declare enum AuthenticationErrorReason {
|
|
3
4
|
Expired = "expired",
|
|
4
5
|
IncorrectCode = "wrong-code",
|
|
@@ -28,14 +29,15 @@ export type ErrorFormatter = (error: unknown | AuthenticationError) => {
|
|
|
28
29
|
message: string;
|
|
29
30
|
};
|
|
30
31
|
export interface LoginServiceDependencies {
|
|
31
|
-
|
|
32
|
+
adapter: LoginAdapter;
|
|
32
33
|
formatError: ErrorFormatter;
|
|
33
34
|
router: RouterService;
|
|
34
35
|
shop: ShopService;
|
|
35
36
|
onLoginSuccess?: () => Promise<void>;
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
|
-
* @deprecated Use `createLoginService` instead
|
|
39
|
+
* @deprecated Use `createLoginService` instead.
|
|
40
|
+
* Constructs a real API adapter from `shop.rootUrl` for backward compatibility.
|
|
39
41
|
*/
|
|
40
42
|
export declare function loginService(deps: {
|
|
41
43
|
formatError: ErrorFormatter;
|
|
@@ -59,6 +61,7 @@ export declare function loginService(deps: {
|
|
|
59
61
|
};
|
|
60
62
|
isAuthenticated: Signal<boolean>;
|
|
61
63
|
getToken(): Promise<string | null>;
|
|
64
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
62
65
|
handleQueryParams(query: URLSearchParams): Promise<import('../../utils').Result<void, import('../../utils').ErrorDetails>>;
|
|
63
66
|
logout(): Promise<import('../../utils').Result>;
|
|
64
67
|
};
|
|
@@ -75,6 +78,7 @@ export declare function createLoginService(init: LoginServiceDependencies): {
|
|
|
75
78
|
};
|
|
76
79
|
isAuthenticated: Signal<boolean>;
|
|
77
80
|
getToken(): Promise<string | null>;
|
|
81
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
78
82
|
handleQueryParams(query: URLSearchParams): Promise<import('../../utils').Result<void, import('../../utils').ErrorDetails>>;
|
|
79
83
|
logout(): Promise<import('../../utils').Result>;
|
|
80
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loginService.d.ts","sourceRoot":"","sources":["../../../src/services/login/loginService.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"loginService.d.ts","sourceRoot":"","sources":["../../../src/services/login/loginService.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAKxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAI9C,oBAAY,yBAAyB;IACnC,OAAO,YAAY;IACnB,aAAa,eAAe;IAC5B,YAAY,mBAAmB;IAC/B,OAAO,aAAa;IACpB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,MAAM,EAAE,yBAAyB,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAG5B,MAAM,EA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'./types';
|
|
2
|
+
import { ApiFetcher, Result } from '../../utils';
|
|
3
|
+
export interface OrderAdapter {
|
|
4
|
+
getHistory(): Promise<Result<Order[]>>;
|
|
5
|
+
getById(id: string): Promise<Result<Order | null>>;
|
|
6
|
+
}
|
|
7
|
+
export declare function createMockOrderAdapter(): OrderAdapter;
|
|
8
|
+
export declare function createApiOrderAdapter(fetcher: ApiFetcher): OrderAdapter;
|
|
9
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/order/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;CACpD;AA+BD,wBAAgB,sBAAsB,IAAI,YAAY,CAiCrD;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY,CA2BvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/order/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACzE,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OrderAdapter } from './adapter';
|
|
2
|
+
import { OrderService } from './types';
|
|
3
|
+
export declare const OrderServiceContext: {
|
|
4
|
+
__context__: OrderService;
|
|
5
|
+
};
|
|
6
|
+
export declare function createOrderService(adapter: OrderAdapter): OrderService;
|
|
7
|
+
//# sourceMappingURL=orderService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderService.d.ts","sourceRoot":"","sources":["../../../src/services/order/orderService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,mBAAmB;;CAAgD,CAAC;AAEjF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAKtE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Result } from '../../utils';
|
|
2
|
+
export interface OrderItem {
|
|
3
|
+
id: string;
|
|
4
|
+
productId: string;
|
|
5
|
+
variantId: string;
|
|
6
|
+
quantity: number;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface Order {
|
|
10
|
+
id: string;
|
|
11
|
+
customerId: string;
|
|
12
|
+
items: OrderItem[];
|
|
13
|
+
deliveryDate: string | null;
|
|
14
|
+
status: "pending" | "confirmed" | "delivered" | "skipped";
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export type OrderService = {
|
|
18
|
+
getHistory(): Promise<Result<Order[]>>;
|
|
19
|
+
getById(id: string): Promise<Result<Order | null>>;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/order/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;CACpD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApiFetcher } from '../../utils';
|
|
1
2
|
import { OrdersAdapter } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* Returns a mock `OrdersAdapter` with sample orders including customAttributes.
|
|
@@ -5,4 +6,5 @@ import { OrdersAdapter } from './types';
|
|
|
5
6
|
* Used as a starting point by storybook helpers (`createMockOrdersService`) and theme preview.
|
|
6
7
|
*/
|
|
7
8
|
export declare function createMockOrdersAdapter(): OrdersAdapter;
|
|
9
|
+
export declare function createApiOrdersAdapter(fetcher: ApiFetcher): OrdersAdapter;
|
|
8
10
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/orders/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/orders/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAoB,aAAa,EAAmB,MAAM,SAAS,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,aAAa,CA6DvD;AAwDD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,CA2BzE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { GetOrdersParams, Order, OrderLine, OrdersAdapter, OrdersService, } from './types';
|
|
2
|
-
export { createMockOrdersAdapter } from './adapter';
|
|
2
|
+
export { createMockOrdersAdapter, createApiOrdersAdapter } from './adapter';
|
|
3
3
|
export { createOrdersService, OrdersServiceContext, } from './ordersService';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/orders/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,KAAK,EACL,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/orders/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,KAAK,EACL,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAE5E,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PaginatedList } from '../../utils';
|
|
2
|
-
import { Product, WithVariants } from './types';
|
|
1
|
+
import { ApiFetcher, PaginatedList } from '../../utils';
|
|
2
|
+
import { AvailableProduct, Box, Product, WithVariants } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Adapter interface for product operations.
|
|
5
5
|
* Implementations should handle API calls, error handling, and data transformation.
|
|
@@ -15,6 +15,31 @@ export interface ProductAdapter {
|
|
|
15
15
|
after: string;
|
|
16
16
|
};
|
|
17
17
|
}): Promise<PaginatedList<WithVariants<Product>>>;
|
|
18
|
+
getProductsByIds(params: {
|
|
19
|
+
ids: string[];
|
|
20
|
+
}): Promise<Product[]>;
|
|
21
|
+
getBoxVariants(params: {
|
|
22
|
+
ids: string[];
|
|
23
|
+
subscriptionId: string;
|
|
24
|
+
}): Promise<AvailableProduct[]>;
|
|
25
|
+
getAvailableProducts(params: {
|
|
26
|
+
subscriptionId: string;
|
|
27
|
+
lineId: string;
|
|
28
|
+
q?: string;
|
|
29
|
+
mode?: "same-product" | "other-products";
|
|
30
|
+
action: "swap" | "add";
|
|
31
|
+
pagination?: {
|
|
32
|
+
before: string;
|
|
33
|
+
} | {
|
|
34
|
+
after: string;
|
|
35
|
+
};
|
|
36
|
+
}): Promise<AvailableProduct[]>;
|
|
37
|
+
getBox(params: {
|
|
38
|
+
id: string;
|
|
39
|
+
}): Promise<Box | null>;
|
|
18
40
|
}
|
|
19
41
|
export declare function createMockProductAdapter(): ProductAdapter;
|
|
42
|
+
export declare function createApiProductAdapter(fetcher: ApiFetcher, opts?: {
|
|
43
|
+
currencyCode: string;
|
|
44
|
+
}): ProductAdapter;
|
|
20
45
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/product/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/product/adapter.ts"],"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AE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KACrD,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAEhC,MAAM,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;CACrD;AAED,wBAAgB,wBAAwB,IAAI,cAAc,CAmRzD;AAoED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EACnB,IAAI,GAAE;IAAE,YAAY,EAAE,MAAM,CAAA;CAA4B,GACvD,cAAc,CA4JhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.test.d.ts","sourceRoot":"","sources":["../../../src/services/product/adapter.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { ProductAdapter } from './adapter';
|
|
2
|
-
export { createMockProductAdapter } from './adapter';
|
|
2
|
+
export { createMockProductAdapter, createApiProductAdapter } from './adapter';
|
|
3
3
|
export { createProductService, ProductServiceContext } from './productService';
|
|
4
4
|
export * from './types';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/product/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/product/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productService.d.ts","sourceRoot":"","sources":["../../../src/services/product/productService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,qBAAqB;;CACiB,CAAC;AAGpD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,cAAc,GACtB,WAAW,CAAC,OAAO,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"productService.d.ts","sourceRoot":"","sources":["../../../src/services/product/productService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,qBAAqB;;CACiB,CAAC;AAGpD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,cAAc,GACtB,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAsB3C"}
|