@juo/blocks 1.13.0-alpha.2 → 1.13.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-peABLAZZ.js → ExtensionRoot-2xTGTu3K.js} +3 -15
- package/dist/block.d.ts +0 -50
- package/dist/block.d.ts.map +1 -1
- package/dist/{bridge-r7Yk8fjY.js → bridge-w5KQ-czl.js} +25 -34
- package/dist/context.d.ts.map +1 -1
- package/dist/core.js +344 -2121
- package/dist/editor/bridge.d.ts +0 -7
- package/dist/editor/bridge.d.ts.map +1 -1
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/main.d.ts +1 -2
- package/dist/editor/main.d.ts.map +1 -1
- package/dist/editor/messages.d.ts +2 -13
- package/dist/editor/messages.d.ts.map +1 -1
- package/dist/editor.js +45 -64
- package/dist/flows/WorkflowService.d.ts +2 -0
- package/dist/flows/WorkflowService.d.ts.map +1 -1
- package/dist/{juo-workflow-DY4rd256.js → juo-workflow-BlG9CcAG.js} +887 -78
- package/dist/main.d.ts +1 -3
- package/dist/main.d.ts.map +1 -1
- package/dist/preact.js +1 -1
- package/dist/react.js +1 -1
- package/dist/services/customer/customerService.d.ts +2 -3
- package/dist/services/customer/customerService.d.ts.map +1 -1
- package/dist/services/customer/index.d.ts +0 -1
- package/dist/services/customer/index.d.ts.map +1 -1
- package/dist/services/customer/types.d.ts +1 -4
- package/dist/services/customer/types.d.ts.map +1 -1
- package/dist/services/index.d.ts +0 -3
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/login/index.d.ts +1 -3
- package/dist/services/login/index.d.ts.map +1 -1
- package/dist/services/login/loginService.d.ts +2 -6
- package/dist/services/login/loginService.d.ts.map +1 -1
- package/dist/services/orders/adapter.d.ts +0 -2
- 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 +2 -27
- package/dist/services/product/adapter.d.ts.map +1 -1
- 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 +0 -68
- package/dist/services/product/types.d.ts.map +1 -1
- package/dist/services/subscription/adapter.d.ts +2 -77
- package/dist/services/subscription/adapter.d.ts.map +1 -1
- 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 +6 -1
- package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
- package/dist/services/subscription/types.d.ts +9 -220
- package/dist/services/subscription/types.d.ts.map +1 -1
- package/dist/theme-state.d.ts +1 -2
- package/dist/theme-state.d.ts.map +1 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/vue/block.d.ts.map +1 -1
- package/dist/vue.js +4 -25
- package/dist/web-components/ExtensionRoot.d.ts +0 -1
- package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
- package/dist/web-components-editor.js +3 -4
- package/dist/web-components-runtime.js +2 -3
- package/package.json +1 -1
- package/dist/block-B6s9jL7l.js +0 -966
- package/dist/block.devtools.test.d.ts +0 -2
- package/dist/block.devtools.test.d.ts.map +0 -1
- package/dist/context.devtools.test.d.ts +0 -2
- package/dist/context.devtools.test.d.ts.map +0 -1
- package/dist/devtools/env.d.ts +0 -3
- package/dist/devtools/env.d.ts.map +0 -1
- package/dist/devtools/hook.d.ts +0 -35
- package/dist/devtools/hook.d.ts.map +0 -1
- package/dist/devtools/index.d.ts +0 -4
- package/dist/devtools/index.d.ts.map +0 -1
- package/dist/devtools/protocol.d.ts +0 -91
- package/dist/devtools/protocol.d.ts.map +0 -1
- package/dist/devtools.js +0 -44
- package/dist/editor/messages.test.d.ts +0 -2
- package/dist/editor/messages.test.d.ts.map +0 -1
- package/dist/editor/overlays.d.ts +0 -14
- package/dist/editor/overlays.d.ts.map +0 -1
- package/dist/editor/overlays.test.d.ts +0 -2
- package/dist/editor/overlays.test.d.ts.map +0 -1
- package/dist/overlay-wrapper.d.ts +0 -69
- package/dist/overlay-wrapper.d.ts.map +0 -1
- package/dist/overlay-wrapper.test.d.ts +0 -2
- package/dist/overlay-wrapper.test.d.ts.map +0 -1
- package/dist/overlays/OverlayService.d.ts +0 -34
- package/dist/overlays/OverlayService.d.ts.map +0 -1
- package/dist/overlays/OverlayService.test.d.ts +0 -2
- package/dist/overlays/OverlayService.test.d.ts.map +0 -1
- package/dist/registry.devtools.test.d.ts +0 -2
- package/dist/registry.devtools.test.d.ts.map +0 -1
- package/dist/services/customer/adapter.d.ts +0 -8
- package/dist/services/customer/adapter.d.ts.map +0 -1
- package/dist/services/login/adapter.d.ts +0 -32
- package/dist/services/login/adapter.d.ts.map +0 -1
- package/dist/services/order/adapter.d.ts +0 -9
- package/dist/services/order/adapter.d.ts.map +0 -1
- package/dist/services/order/index.d.ts +0 -5
- package/dist/services/order/index.d.ts.map +0 -1
- package/dist/services/order/orderService.d.ts +0 -7
- package/dist/services/order/orderService.d.ts.map +0 -1
- package/dist/services/order/types.d.ts +0 -21
- package/dist/services/order/types.d.ts.map +0 -1
- package/dist/services/product/adapter.test.d.ts +0 -2
- package/dist/services/product/adapter.test.d.ts.map +0 -1
- package/dist/services/schedules/adapter.d.ts +0 -71
- package/dist/services/schedules/adapter.d.ts.map +0 -1
- package/dist/services/schedules/adapter.test.d.ts +0 -2
- package/dist/services/schedules/adapter.test.d.ts.map +0 -1
- package/dist/services/schedules/index.d.ts +0 -5
- package/dist/services/schedules/index.d.ts.map +0 -1
- package/dist/services/schedules/schedulesService.d.ts +0 -11
- package/dist/services/schedules/schedulesService.d.ts.map +0 -1
- package/dist/services/schedules/schedulesService.test.d.ts +0 -2
- package/dist/services/schedules/schedulesService.test.d.ts.map +0 -1
- package/dist/services/schedules/types.d.ts +0 -226
- package/dist/services/schedules/types.d.ts.map +0 -1
- package/dist/services/settings/index.d.ts +0 -3
- package/dist/services/settings/index.d.ts.map +0 -1
- package/dist/services/settings/settingsService.d.ts +0 -7
- package/dist/services/settings/settingsService.d.ts.map +0 -1
- package/dist/services/settings/settingsService.test.d.ts +0 -2
- package/dist/services/settings/settingsService.test.d.ts.map +0 -1
- package/dist/services/settings/types.d.ts +0 -35
- package/dist/services/settings/types.d.ts.map +0 -1
- package/dist/services/shop/index.d.ts +0 -3
- package/dist/services/shop/index.d.ts.map +0 -1
- package/dist/services/shop/shopService.d.ts +0 -12
- package/dist/services/shop/shopService.d.ts.map +0 -1
- package/dist/services/shop/shopService.test.d.ts +0 -2
- package/dist/services/shop/shopService.test.d.ts.map +0 -1
- package/dist/services/shop/types.d.ts +0 -7
- package/dist/services/shop/types.d.ts.map +0 -1
- package/dist/services/subscription/adapter.test.d.ts +0 -2
- package/dist/services/subscription/adapter.test.d.ts.map +0 -1
- package/dist/services/subscription/types.test.d.ts +0 -2
- package/dist/services/subscription/types.test.d.ts.map +0 -1
- package/dist/theme-state.params.test.d.ts +0 -2
- package/dist/theme-state.params.test.d.ts.map +0 -1
- package/dist/theme-state.translations.test.d.ts +0 -2
- package/dist/theme-state.translations.test.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block.devtools.test.d.ts","sourceRoot":"","sources":["../src/block.devtools.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.devtools.test.d.ts","sourceRoot":"","sources":["../src/context.devtools.test.ts"],"names":[],"mappings":""}
|
package/dist/devtools/env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/devtools/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,EAMJ,OAAO,UAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,SAAgC,CAAC"}
|
package/dist/devtools/hook.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { DevtoolsEvent, DevtoolsEventKind, PropsSchema } from './protocol';
|
|
2
|
-
/**
|
|
3
|
-
* The page-side resolver surface the framework (`blocks/core`) publishes on the
|
|
4
|
-
* hook so a backend running in a *separate bundle* (e.g. an injected extension
|
|
5
|
-
* script) can read/write live block state without importing `@juo/blocks`.
|
|
6
|
-
* Tree + picker are NOT here — the backend derives them from the DOM.
|
|
7
|
-
*/
|
|
8
|
-
export interface DevtoolsResolverSurface {
|
|
9
|
-
getBlockState(id: string): {
|
|
10
|
-
props: Record<string, unknown>;
|
|
11
|
-
propsSchema: PropsSchema;
|
|
12
|
-
} | null;
|
|
13
|
-
setBlockProp(id: string, key: string, value: unknown): {
|
|
14
|
-
props: Record<string, unknown>;
|
|
15
|
-
} | null;
|
|
16
|
-
/** Registry name → editor display label (displayName ?? name). */
|
|
17
|
-
getBlockCatalog(): Record<string, string>;
|
|
18
|
-
}
|
|
19
|
-
export interface JuoBlocksDevtoolsHook {
|
|
20
|
-
readonly version: number;
|
|
21
|
-
emit(kind: DevtoolsEventKind, payload: Record<string, unknown>): void;
|
|
22
|
-
on(cb: (e: DevtoolsEvent) => void): () => void;
|
|
23
|
-
off(cb: (e: DevtoolsEvent) => void): void;
|
|
24
|
-
/** Attached by `blocks/core` on first lifecycle emit; undefined until then. */
|
|
25
|
-
resolvers?: DevtoolsResolverSurface;
|
|
26
|
-
}
|
|
27
|
-
declare global {
|
|
28
|
-
var __JUO_BLOCKS_DEVTOOLS_HOOK__: JuoBlocksDevtoolsHook | undefined;
|
|
29
|
-
}
|
|
30
|
-
export declare function createHook(): JuoBlocksDevtoolsHook;
|
|
31
|
-
/** Installs (idempotently) and returns the global hook. */
|
|
32
|
-
export declare function installHook(): JuoBlocksDevtoolsHook;
|
|
33
|
-
/** Returns the global hook if a shell has installed one, else undefined. */
|
|
34
|
-
export declare function getHook(): JuoBlocksDevtoolsHook | undefined;
|
|
35
|
-
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -1 +0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D;AAED,4EAA4E;AAC5E,wBAAgB,OAAO,IAAI,qBAAqB,GAAG,SAAS,CAE3D"}
|
package/dist/devtools/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/devtools/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
export declare const PROTOCOL_VERSION: 1;
|
|
2
|
-
export type BlockNode = {
|
|
3
|
-
id: string;
|
|
4
|
-
type: string;
|
|
5
|
-
slot: string | null;
|
|
6
|
-
parentId: string | null;
|
|
7
|
-
propKeys: string[];
|
|
8
|
-
};
|
|
9
|
-
/** A node in the DOM-derived, nested block tree. */
|
|
10
|
-
export type BlockTreeNode = {
|
|
11
|
-
id: string;
|
|
12
|
-
type: string;
|
|
13
|
-
slot: string | null;
|
|
14
|
-
children: BlockTreeNode[];
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* The `props` sub-schema of a block definition (a JSON Schema object), as used
|
|
18
|
-
* by the visual editor to pick controls. Carried to the panel so it can render
|
|
19
|
-
* controls that reflect each prop's real type (dropdowns for enums, color
|
|
20
|
-
* pickers, steppers, …) instead of guessing from the runtime value. JSON-safe.
|
|
21
|
-
*/
|
|
22
|
-
export type PropsSchema = {
|
|
23
|
-
type?: string;
|
|
24
|
-
properties?: Record<string, Record<string, unknown>>;
|
|
25
|
-
required?: string[];
|
|
26
|
-
[key: string]: unknown;
|
|
27
|
-
} | null;
|
|
28
|
-
export type TranslationSource = "instanceOverride" | "blockDefault" | "themeOverride" | "themeDefault" | "fallback";
|
|
29
|
-
export type BlockTranslation = {
|
|
30
|
-
key: string;
|
|
31
|
-
value: string;
|
|
32
|
-
source: TranslationSource;
|
|
33
|
-
missing: boolean;
|
|
34
|
-
rendered: boolean;
|
|
35
|
-
};
|
|
36
|
-
export type TranslationsState = {
|
|
37
|
-
locale: string;
|
|
38
|
-
entries: BlockTranslation[];
|
|
39
|
-
};
|
|
40
|
-
export type DevtoolsEventKind = "block:registered" | "block:mounted" | "block:updated" | "block:unmounted" | "signal:changed" | "context:provide" | "context:request" | "block:picked";
|
|
41
|
-
export interface DevtoolsEvent {
|
|
42
|
-
v: typeof PROTOCOL_VERSION;
|
|
43
|
-
kind: DevtoolsEventKind;
|
|
44
|
-
ts: number;
|
|
45
|
-
payload: Record<string, unknown>;
|
|
46
|
-
}
|
|
47
|
-
/** Pull-on-demand RPC the engine (server) exposes to the client. */
|
|
48
|
-
export interface DevtoolsServerFns {
|
|
49
|
-
getSnapshot(): Promise<{
|
|
50
|
-
nodes: BlockNode[];
|
|
51
|
-
registered: string[];
|
|
52
|
-
/** Registry name → editor display label. */
|
|
53
|
-
blockLabels: Record<string, string>;
|
|
54
|
-
}>;
|
|
55
|
-
getBlockState(id: string): Promise<{
|
|
56
|
-
props: Record<string, unknown>;
|
|
57
|
-
propsSchema: PropsSchema;
|
|
58
|
-
} | null>;
|
|
59
|
-
/**
|
|
60
|
-
* Writes a single prop on a live block and returns its updated state.
|
|
61
|
-
* Works for custom-element blocks (the property set is reactive); the edit
|
|
62
|
-
* is a live tweak and may be overwritten if upstream data re-renders.
|
|
63
|
-
*/
|
|
64
|
-
setBlockProp(id: string, key: string, value: unknown): Promise<{
|
|
65
|
-
props: Record<string, unknown>;
|
|
66
|
-
} | null>;
|
|
67
|
-
/** Returns the live, nested block tree derived from the page DOM. */
|
|
68
|
-
getTree(): Promise<BlockTreeNode[]>;
|
|
69
|
-
highlight(id: string | null): Promise<void>;
|
|
70
|
-
/** Persistent outline for the currently selected block in the tree. */
|
|
71
|
-
highlightSelected(id: string | null): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Scrolls the block's element into view in the page and briefly flashes the
|
|
74
|
-
* highlight box over it (auto-hiding after a short delay). Purely a viewport
|
|
75
|
-
* affordance — it does not change selection.
|
|
76
|
-
*/
|
|
77
|
-
scrollToBlock(id: string): Promise<void>;
|
|
78
|
-
/** Begins the page-side element picker; resolves immediately. The pick
|
|
79
|
-
* arrives later as a pushed `block:picked` event. */
|
|
80
|
-
startPicker(): Promise<void>;
|
|
81
|
-
/** Cancels the page-side element picker if active. */
|
|
82
|
-
stopPicker(): Promise<void>;
|
|
83
|
-
getBlockTranslations(id: string): Promise<TranslationsState | null>;
|
|
84
|
-
setBlockTranslationOverride(id: string, key: string, value: string): Promise<TranslationsState | null>;
|
|
85
|
-
}
|
|
86
|
-
/** Functions the client exposes to the server (push notifications). */
|
|
87
|
-
export interface DevtoolsClientFns {
|
|
88
|
-
onEvent(e: DevtoolsEvent): void;
|
|
89
|
-
}
|
|
90
|
-
export declare function isDevtoolsEvent(x: unknown): x is DevtoolsEvent;
|
|
91
|
-
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/devtools/protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAE3C,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC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!== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : {};
|
|
2
|
-
const isBrowser = typeof window !== "undefined";
|
|
3
|
-
const PROTOCOL_VERSION = 1;
|
|
4
|
-
function isDevtoolsEvent(x) {
|
|
5
|
-
return typeof x === "object" && x !== null && x.v === PROTOCOL_VERSION && typeof x.kind === "string" && typeof x.ts === "number";
|
|
6
|
-
}
|
|
7
|
-
const HOOK_KEY = "__JUO_BLOCKS_DEVTOOLS_HOOK__";
|
|
8
|
-
function createHook() {
|
|
9
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
10
|
-
return {
|
|
11
|
-
version: PROTOCOL_VERSION,
|
|
12
|
-
emit(kind, payload) {
|
|
13
|
-
const event = {
|
|
14
|
-
v: PROTOCOL_VERSION,
|
|
15
|
-
kind,
|
|
16
|
-
ts: Date.now(),
|
|
17
|
-
payload
|
|
18
|
-
};
|
|
19
|
-
listeners.forEach((cb) => cb(event));
|
|
20
|
-
},
|
|
21
|
-
on(cb) {
|
|
22
|
-
listeners.add(cb);
|
|
23
|
-
return () => listeners.delete(cb);
|
|
24
|
-
},
|
|
25
|
-
off(cb) {
|
|
26
|
-
listeners.delete(cb);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function installHook() {
|
|
31
|
-
return target[HOOK_KEY] ?? (target[HOOK_KEY] = createHook());
|
|
32
|
-
}
|
|
33
|
-
function getHook() {
|
|
34
|
-
return target[HOOK_KEY];
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
PROTOCOL_VERSION,
|
|
38
|
-
createHook,
|
|
39
|
-
getHook,
|
|
40
|
-
installHook,
|
|
41
|
-
isBrowser,
|
|
42
|
-
isDevtoolsEvent,
|
|
43
|
-
target
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.test.d.ts","sourceRoot":"","sources":["../../src/editor/messages.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BlockDefinition } from '../block';
|
|
2
|
-
export interface OverlayRegistryEntry {
|
|
3
|
-
block: string;
|
|
4
|
-
title: string;
|
|
5
|
-
contentBlock: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Turns the registered block list into the overlay registry sent to the host
|
|
9
|
-
* editor. Only `overlay:*` wrapper blocks are included. `contentBlock` is the
|
|
10
|
-
* type of the single instance the wrapper seeds into its `content` slot — used
|
|
11
|
-
* by the host to hide that block from the Composition palette.
|
|
12
|
-
*/
|
|
13
|
-
export declare function buildOverlayRegistry(blocks: BlockDefinition[]): Record<string, OverlayRegistryEntry>;
|
|
14
|
-
//# sourceMappingURL=overlays.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlays.d.ts","sourceRoot":"","sources":["../../src/editor/overlays.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAoBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,EAAE,GACxB,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAetC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlays.test.d.ts","sourceRoot":"","sources":["../../src/editor/overlays.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { BlockDefinition } from './block';
|
|
2
|
-
/**
|
|
3
|
-
* Layout chrome for an overlay surface. The host (`OverlayHost.vue`) reads this
|
|
4
|
-
* value off the wrapper block's `props.layout` and picks `UiSidebarShell` or
|
|
5
|
-
* `UiModalShell` accordingly — same data-driven pattern `WorkflowOverlay.vue`
|
|
6
|
-
* uses for workflow flow root blocks.
|
|
7
|
-
*/
|
|
8
|
-
export type OverlayLayout = "modal" | "sidebar";
|
|
9
|
-
/**
|
|
10
|
-
* Defines a wrapper block for an overlay surface.
|
|
11
|
-
*
|
|
12
|
-
* The overlay surface is rendered by `<juo-extension-root surface="overlay"
|
|
13
|
-
* name="content">`, which reads `blocks[0].slots.content`. That means the
|
|
14
|
-
* surface root must be a *parent* block with a populated `content` slot —
|
|
15
|
-
* resolving an overlay leaf block directly leaves the surface root with
|
|
16
|
-
* empty slots and `juo-extension-root` renders nothing.
|
|
17
|
-
*
|
|
18
|
-
* `defineOverlayWrapper` produces such a parent: a no-render block whose
|
|
19
|
-
* `initialValue` puts a single instance of the `content` block into its
|
|
20
|
-
* `content` slot, mirroring the page-surface pattern (`MainPage.slots.*`).
|
|
21
|
-
*
|
|
22
|
-
* The `layout` opt is forwarded onto the wrapper's `props.layout` and is
|
|
23
|
-
* read by `OverlayHost.vue` to pick the chrome (sidebar vs modal) — same
|
|
24
|
-
* convention `WorkflowOverlay.vue` uses for flow root blocks. Defaults to
|
|
25
|
-
* `"sidebar"` to preserve behavior for callers that omit it.
|
|
26
|
-
*
|
|
27
|
-
* The `canAbort` opt is forwarded onto the wrapper's `props.canAbort` and is
|
|
28
|
-
* read by `OverlayHost.vue` to (a) drive `<UiModalContent :show-close>` so the
|
|
29
|
-
* corner X is present in modal chrome, and (b) gate `handleClose` so backdrop
|
|
30
|
-
* click, Esc, and the chrome X uniformly respect non-dismissable overlays.
|
|
31
|
-
* Defaults to `true`. Same gate `WorkflowOverlay.handleClose` uses.
|
|
32
|
-
*
|
|
33
|
-
* Usage:
|
|
34
|
-
*
|
|
35
|
-
* ```ts
|
|
36
|
-
* const MyFeatureBlock = defineBlock("my_feature", { ...leaf renderer... });
|
|
37
|
-
* const MyFeatureOverlayBlock = defineOverlayWrapper({
|
|
38
|
-
* name: "my_feature_overlay",
|
|
39
|
-
* content: "my_feature",
|
|
40
|
-
* layout: "modal",
|
|
41
|
-
* });
|
|
42
|
-
* registerBlock(MyFeatureBlock);
|
|
43
|
-
* registerBlock(MyFeatureOverlayBlock);
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* Then callers open the overlay via:
|
|
47
|
-
*
|
|
48
|
-
* ```ts
|
|
49
|
-
* themeState.$.resolve("overlay", "my_feature_overlay");
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* The wrapper's `renderer` is a no-op because `<juo-extension-root>` only
|
|
53
|
-
* reads its slot — the wrapper itself is never rendered as a block.
|
|
54
|
-
*
|
|
55
|
-
* Open-time params: callers may pass JSON-safe params as the 3rd arg to
|
|
56
|
-
* `themeState.resolve("overlay", name, params)`. They are merged onto the
|
|
57
|
-
* wrapper's `content` block instance props (see `theme-state.ts` `resolve`),
|
|
58
|
-
* so the content leaf can read per-open data (e.g. the generic Confirmation
|
|
59
|
-
* block's `action`/`title`/`message`). Never pass callbacks — props cross the
|
|
60
|
-
* render boundary and must stay JSON-safe.
|
|
61
|
-
*/
|
|
62
|
-
export declare function defineOverlayWrapper(opts: {
|
|
63
|
-
name: string;
|
|
64
|
-
content: string;
|
|
65
|
-
layout?: OverlayLayout;
|
|
66
|
-
canAbort?: boolean;
|
|
67
|
-
title?: string;
|
|
68
|
-
}): BlockDefinition;
|
|
69
|
-
//# sourceMappingURL=overlay-wrapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-wrapper.d.ts","sourceRoot":"","sources":["../src/overlay-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAyChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,eAAe,CAelB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-wrapper.test.d.ts","sourceRoot":"","sources":["../src/overlay-wrapper.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ReadonlySignal } from '@preact/signals-core';
|
|
2
|
-
import { BlockDefinition } from '../block';
|
|
3
|
-
import { ThemeState } from '../theme-state';
|
|
4
|
-
import { OverlayLayout } from '../overlay-wrapper';
|
|
5
|
-
import { OverlayRegistryEntry } from '../editor/overlays';
|
|
6
|
-
export type { OverlayRegistryEntry };
|
|
7
|
-
export interface OverlayState {
|
|
8
|
-
name: string;
|
|
9
|
-
layout: OverlayLayout;
|
|
10
|
-
canAbort: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface OverlayService {
|
|
13
|
-
/** Editor registry: the flat, global overlay list for the editor dropdown. */
|
|
14
|
-
getEditableOverlays(): Record<string, OverlayRegistryEntry>;
|
|
15
|
-
/** Open an overlay surface (full `overlay:<id>` name), optionally parameterized. */
|
|
16
|
-
open(name: string, params?: Record<string, unknown>): void;
|
|
17
|
-
/** Close the current overlay surface. */
|
|
18
|
-
close(): void;
|
|
19
|
-
/** The overlay currently showing, or null (incl. when a workflow overlay is up). */
|
|
20
|
-
current: ReadonlySignal<OverlayState | null>;
|
|
21
|
-
}
|
|
22
|
-
export declare const OverlayServiceContext: {
|
|
23
|
-
__context__: OverlayService;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Owns non-workflow overlay state over the shared `themeState.overlay` surface.
|
|
27
|
-
* Symmetric to `WorkflowService`; never invoked on the workflow path. `current`
|
|
28
|
-
* filters to `overlay:` roots so workflow roots (which share the surface) read
|
|
29
|
-
* as null.
|
|
30
|
-
*/
|
|
31
|
-
export declare function createOverlayService(themeState: ThemeState, options?: {
|
|
32
|
-
getBlocks?: () => BlockDefinition[];
|
|
33
|
-
}): OverlayService;
|
|
34
|
-
//# sourceMappingURL=OverlayService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayService.d.ts","sourceRoot":"","sources":["../../src/overlays/OverlayService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAIrC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC5D,oFAAoF;IACpF,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3D,yCAAyC;IACzC,KAAK,IAAI,IAAI,CAAC;IACd,oFAAoF;IACpF,OAAO,EAAE,cAAc,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;CAC9C;AAED,eAAO,MAAM,qBAAqB;;CACiB,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,eAAe,EAAE,CAAA;CAAO,GACpD,cAAc,CAiChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayService.test.d.ts","sourceRoot":"","sources":["../../src/overlays/OverlayService.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.devtools.test.d.ts","sourceRoot":"","sources":["../src/registry.devtools.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,32 +0,0 @@
|
|
|
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
|
-
appUrl: string;
|
|
25
|
-
}): string;
|
|
26
|
-
}
|
|
27
|
-
export declare function createMockLoginAdapter(): LoginAdapter;
|
|
28
|
-
export declare function createApiLoginAdapter(fetcher: ApiFetcher, opts: {
|
|
29
|
-
shopDomain: string;
|
|
30
|
-
appUrl: string;
|
|
31
|
-
}): LoginAdapter;
|
|
32
|
-
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,MAAM,CAAC;CACZ;AAED,wBAAgB,sBAAsB,IAAI,YAAY,CAuBrD;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3C,YAAY,CAoHd"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Order } from './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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.test.d.ts","sourceRoot":"","sources":["../../../src/services/product/adapter.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ApiFetcher, Result } from '../../utils';
|
|
2
|
-
import { SubscriptionAdapter } from '../subscription/adapter';
|
|
3
|
-
import { Subscription } from '../subscription/types';
|
|
4
|
-
import { ScheduleAdjustment, ScheduleOrder, ScheduleShippingAddressInput, ScheduleUpdateProductsLine } from './types';
|
|
5
|
-
export interface SchedulesAdapter {
|
|
6
|
-
getUpcomingOrders(params: {
|
|
7
|
-
count: number;
|
|
8
|
-
subscriptionId?: string;
|
|
9
|
-
}): Promise<Result<ScheduleOrder[]>>;
|
|
10
|
-
getAdjustments(): Promise<Result<ScheduleAdjustment[]>>;
|
|
11
|
-
skipOrder(params: {
|
|
12
|
-
subscriptionId: string;
|
|
13
|
-
cycle?: number;
|
|
14
|
-
date?: string;
|
|
15
|
-
}): Promise<Result>;
|
|
16
|
-
changeDateAdjustment(params: {
|
|
17
|
-
subscriptionId: string;
|
|
18
|
-
newDate: string;
|
|
19
|
-
cycle: number;
|
|
20
|
-
currentDate?: string;
|
|
21
|
-
}): Promise<Result>;
|
|
22
|
-
updateShippingAdjustment(params: {
|
|
23
|
-
subscriptionId: string;
|
|
24
|
-
address: ScheduleShippingAddressInput;
|
|
25
|
-
cycle?: number;
|
|
26
|
-
date?: string;
|
|
27
|
-
}): Promise<Result>;
|
|
28
|
-
updatePaymentMethodAdjustment(params: {
|
|
29
|
-
subscriptionId: string;
|
|
30
|
-
paymentMethodId: string;
|
|
31
|
-
cycle?: number;
|
|
32
|
-
date?: string;
|
|
33
|
-
}): Promise<Result>;
|
|
34
|
-
updateProductsAdjustment(params: {
|
|
35
|
-
subscriptionId: string;
|
|
36
|
-
lines: ScheduleUpdateProductsLine[];
|
|
37
|
-
cycle?: number;
|
|
38
|
-
date?: string;
|
|
39
|
-
}): Promise<Result>;
|
|
40
|
-
applyDiscountAdjustment(params: {
|
|
41
|
-
subscriptionId: string;
|
|
42
|
-
discountCode: string;
|
|
43
|
-
cycle: number;
|
|
44
|
-
}): Promise<Result>;
|
|
45
|
-
removeAdjustment(params: {
|
|
46
|
-
adjustmentId: string;
|
|
47
|
-
}): Promise<Result>;
|
|
48
|
-
}
|
|
49
|
-
/** Subscription state the schedules mock projects orders from. */
|
|
50
|
-
type SubscriptionSource = Pick<SubscriptionAdapter, "getById" | "search">;
|
|
51
|
-
/**
|
|
52
|
-
* Project the next `count` upcoming orders for a subscription by stepping its
|
|
53
|
-
* `nextBillingDate` forward one billing interval at a time. Only active
|
|
54
|
-
* subscriptions have upcoming orders; everything else projects to nothing.
|
|
55
|
-
*/
|
|
56
|
-
export declare function projectUpcomingOrders(sub: Subscription, count: number): ScheduleOrder[];
|
|
57
|
-
/**
|
|
58
|
-
* Mock schedules adapter that PROJECTS upcoming orders from a subscription
|
|
59
|
-
* source rather than holding its own static fixtures. Pass the same
|
|
60
|
-
* subscription adapter instance the SubscriptionService uses so item
|
|
61
|
-
* add/remove/update mutations flow through to the projected schedule. When no
|
|
62
|
-
* source is given it owns a fresh mock subscription adapter (used by unit tests).
|
|
63
|
-
*
|
|
64
|
-
* Skip / date-change actions are stored as an adjustments overlay applied on
|
|
65
|
-
* top of the projection — mirroring the real API (`getAdjustments` + a derived
|
|
66
|
-
* order list) rather than mutating a baked order array.
|
|
67
|
-
*/
|
|
68
|
-
export declare function createMockSchedulesAdapter(subscriptions?: SubscriptionSource): SchedulesAdapter;
|
|
69
|
-
export declare function createApiSchedulesAdapter(fetcher: ApiFetcher): SchedulesAdapter;
|
|
70
|
-
export {};
|
|
71
|
-
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/schedules/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU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ACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,wBAAwB,CAAC,MAAM,EAAE;QAC/B,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,0BAA0B,EAAE,CAAC;QACpC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,uBAAuB,CAAC,MAAM,EAAE;QAC9B,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,gBAAgB,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrE;AAoCD,kEAAkE;AAClE,KAAK,kBAAkB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;AA2D1E;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,MAAM,GACZ,aAAa,EAAE,CA4CjB;AA4CD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,GAAE,kBAAoD,GAClE,gBAAgB,CA0KlB;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,gBAAgB,CAyI/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.test.d.ts","sourceRoot":"","sources":["../../../src/services/schedules/adapter.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { SchedulesAdapter, } from './adapter';
|
|
2
|
-
export { createMockSchedulesAdapter, createApiSchedulesAdapter, } from './adapter';
|
|
3
|
-
export { createSchedulesService, SchedulesServiceContext, } from './schedulesService';
|
|
4
|
-
export * from './types';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/schedules/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Signal } from '@preact/signals-core';
|
|
2
|
-
import { ContextType } from '../../context';
|
|
3
|
-
import { SchedulesAdapter } from './adapter';
|
|
4
|
-
import { SchedulesService } from './types';
|
|
5
|
-
export declare const SchedulesServiceContext: {
|
|
6
|
-
__context__: SchedulesService;
|
|
7
|
-
};
|
|
8
|
-
export declare function createSchedulesService(adapter: SchedulesAdapter, opts?: {
|
|
9
|
-
hasPendingBilling?: Signal<boolean>;
|
|
10
|
-
}): ContextType<typeof SchedulesServiceContext>;
|
|
11
|
-
//# sourceMappingURL=schedulesService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schedulesService.d.ts","sourceRoot":"","sources":["../../../src/services/schedules/schedulesService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAiB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,uBAAuB;;CACmB,CAAC;AAExD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,EACzB,IAAI,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;CAAE,GAC7C,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAmH7C"}
|