@picked/client 0.0.1-dev.1778468342672 → 0.0.1-dev.1778561735098
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/{api-BFD1TEJW.js → api-Bzb9pR2r.js} +1 -1
- package/dist/{api-D_w_sQ8k.cjs → api-XV6bcv_D.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +445 -449
- package/dist/esm/plugins/dynamic-experiences/index.js +38 -109
- package/dist/esm/plugins/history-browser-storage/index.js +52 -13
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-B16NqD7y.cjs +1 -0
- package/dist/{experience-instance-BrLWgVAN.js → experience-instance-CZC0uPuv.js} +215 -203
- package/dist/types/entities/experience/experience.d.ts +2 -22
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +28 -16
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +2 -17
- package/dist/types/entities/step/step.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lifecycle/state-snapshot.d.ts.map +1 -1
- package/dist/types/picked.d.ts +8 -53
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +1 -2
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +1 -18
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +1 -63
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +16 -0
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +27 -0
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/experience-instance-Ct3ogC7n.cjs +0 -1
- package/dist/types/entities/content/content.d.ts +0 -37
- package/dist/types/entities/content/content.d.ts.map +0 -1
|
@@ -45,34 +45,14 @@ export interface ExperienceStore {
|
|
|
45
45
|
* should be initialised.
|
|
46
46
|
*/
|
|
47
47
|
shouldInitialiseFx: Effect<void, boolean, Error>;
|
|
48
|
-
/**
|
|
49
|
-
* Public event — requests initialisation, gated by `shouldInitialiseFx`. When the
|
|
50
|
-
* gate passes, the sample graph fires `prepareExperienceContentFx` and `initialiseFx`
|
|
51
|
-
* in parallel so content loading does not delay initialisation.
|
|
52
|
-
*/
|
|
53
|
-
initialiseRequested: EventCallable<LaunchExperienceOptions | undefined>;
|
|
54
|
-
/**
|
|
55
|
-
* Public event — requests initialisation directly, bypassing the `shouldInitialiseFx`
|
|
56
|
-
* gate. Fires `prepareExperienceContentFx` and `initialiseFx` in parallel.
|
|
57
|
-
*/
|
|
58
|
-
initialiseDirectly: EventCallable<LaunchExperienceOptions | undefined>;
|
|
59
|
-
/**
|
|
60
|
-
* Prepares per-experience CMS content by calling `client.contentLoader` and
|
|
61
|
-
* registering returned blobs into `client.contents`. Driven by the sample graph
|
|
62
|
-
* on `initialiseRequested`/`initialiseDirectly`; can also be called directly for
|
|
63
|
-
* speculative prefetch (e.g. Visibility-driven warm-up). Failure-tolerant:
|
|
64
|
-
* always resolves `true` even when the loader rejects, so initialisation is
|
|
65
|
-
* never blocked by content failures.
|
|
66
|
-
*/
|
|
67
|
-
prepareExperienceContentFx: Effect<void, boolean, Error>;
|
|
68
48
|
}
|
|
69
49
|
/**
|
|
70
50
|
* Creates an Effector store for a single experience.
|
|
71
51
|
*
|
|
72
52
|
* @template T - Factory parameter type.
|
|
73
53
|
* @param {T} params - The client instance and experience data.
|
|
74
|
-
* @param {Picked} params.client - The Picked client
|
|
75
|
-
* @param {Experience} params.experience - The experience definition to wrap in stores
|
|
54
|
+
* @param {Picked} params.client - The Picked client this experience belongs to.
|
|
55
|
+
* @param {Experience} params.experience - The experience definition to wrap in stores.
|
|
76
56
|
* @returns {ReturnType<typeof createExperienceFactory>} An experience store with config, tree, fields, and component sub-stores.
|
|
77
57
|
* @example
|
|
78
58
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,aAAa,EAElB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,aAAa,EAElB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CA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,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,cAAc,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACvC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAClC,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CAExE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,aAAa,EAGlB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EACV,UAAU,
|
|
1
|
+
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,aAAa,EAGlB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EACV,UAAU,EAEV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,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C,EACpE,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAEpE"}
|
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
import { ExperienceNode } from '../experience/experience';
|
|
2
|
-
|
|
2
|
+
/** Identifies one navigation slice: the `ExperienceInstance` and the `Experience` it belongs to. */
|
|
3
|
+
export interface InstanceScope {
|
|
4
|
+
instanceId: string;
|
|
5
|
+
experienceId: string;
|
|
6
|
+
}
|
|
7
|
+
/** Payload carried by `push`/`replace` — an `InstanceScope` plus the node to record. */
|
|
8
|
+
export interface InstanceNodeIntent extends InstanceScope {
|
|
9
|
+
node: ExperienceNode;
|
|
10
|
+
}
|
|
11
|
+
export interface HistoryEntry extends InstanceScope {
|
|
3
12
|
id: string;
|
|
4
13
|
node: ExperienceNode;
|
|
5
14
|
at: number;
|
|
6
|
-
experienceId: string;
|
|
7
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a fresh history instance: an Effector-backed list of navigation
|
|
18
|
+
* entries plus the events that drive it. Live entries are filtered per
|
|
19
|
+
* instance via `instanceId`; the derived `snapshotStore` groups by
|
|
20
|
+
* `experienceId` and is used by the storage plugin to resume across respawn.
|
|
21
|
+
*
|
|
22
|
+
* @returns {ReturnType<typeof invoke<typeof createHistoryFactory>>} The events and stores.
|
|
23
|
+
* @example
|
|
24
|
+
* const history = createHistory()
|
|
25
|
+
*/
|
|
8
26
|
export declare function createHistory(): {
|
|
9
|
-
push: import('effector').EventCallable<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
experienceId: string;
|
|
15
|
-
node: ExperienceNode;
|
|
16
|
-
}>;
|
|
17
|
-
back: import('effector').EventCallable<{
|
|
18
|
-
experienceId?: string;
|
|
19
|
-
}>;
|
|
20
|
-
restore: import('effector').EventCallable<{
|
|
21
|
-
entries: HistoryEntry[];
|
|
27
|
+
push: import('effector').EventCallable<InstanceNodeIntent>;
|
|
28
|
+
replace: import('effector').EventCallable<InstanceNodeIntent>;
|
|
29
|
+
back: import('effector').EventCallable<Pick<InstanceScope, "instanceId">>;
|
|
30
|
+
restoreSnapshots: import('effector').EventCallable<{
|
|
31
|
+
snapshots: Record<string, HistoryEntry[]>;
|
|
22
32
|
}>;
|
|
23
|
-
|
|
33
|
+
seedInstanceFromSnapshot: import('effector').EventCallable<InstanceScope>;
|
|
34
|
+
entriesStore: import('effector').StoreWritable<HistoryEntry[]>;
|
|
35
|
+
snapshotStore: import('effector').Store<Record<string, HistoryEntry[]>>;
|
|
24
36
|
};
|
|
25
37
|
//# sourceMappingURL=history.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/entities/history/history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/entities/history/history.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAM9D,oGAAoG;AACpG,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,wFAAwF;AACxF,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,IAAI,EAAE,cAAc,CAAA;CACrB;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,EAAE,EAAE,MAAM,CAAA;CACX;AAsKD;;;;;;;;;GASG;AACH,wBAAgB,aAAa;;;;;mBA7Hd,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC;;;;;EA+H5C"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Store } from 'effector';
|
|
2
|
-
import { Content } from '../content/content';
|
|
3
2
|
export type StepsStore = ReturnType<typeof createStepIndex>;
|
|
4
3
|
export interface ExperienceStep {
|
|
5
4
|
id: string;
|
|
@@ -7,19 +6,6 @@ export interface ExperienceStep {
|
|
|
7
6
|
name: string;
|
|
8
7
|
fieldKeys: string[];
|
|
9
8
|
layoutName?: string | null;
|
|
10
|
-
/**
|
|
11
|
-
* Optional reference to a CMS Content record that supplies the step's layout data.
|
|
12
|
-
* The actual content is registered separately via `client.registerContent` and
|
|
13
|
-
* resolved at render time through `layoutContentStore` against the global content registry.
|
|
14
|
-
*/
|
|
15
|
-
layoutContentId?: string | null;
|
|
16
|
-
/**
|
|
17
|
-
* Reactive store of the content record this step references. Composed at registration
|
|
18
|
-
* time against `client.contents.getById(layoutContentId)`. `null` when the step has no
|
|
19
|
-
* `layoutContentId`. Reads stay reactive — content registered after the step
|
|
20
|
-
* (or updated mid-session) flows through automatically.
|
|
21
|
-
*/
|
|
22
|
-
layoutContentStore?: Store<Content | null> | null;
|
|
23
9
|
}
|
|
24
10
|
declare const createStepIndexFactory: () => {
|
|
25
11
|
register: (step: ExperienceStep) => void;
|
|
@@ -33,7 +19,6 @@ declare const createStepIndexFactory: () => {
|
|
|
33
19
|
/**
|
|
34
20
|
* Creates an Effector-based index for registering and retrieving steps.
|
|
35
21
|
*
|
|
36
|
-
* @returns {ReturnType<typeof createStepIndexFactory>} A step index with register, getById, getByKey, listStore, and indexStore.
|
|
37
22
|
* @example
|
|
38
23
|
* ```typescript
|
|
39
24
|
* const steps = createStepIndex()
|
|
@@ -43,8 +28,8 @@ export declare function createStepIndex(): ReturnType<typeof createStepIndexFact
|
|
|
43
28
|
/**
|
|
44
29
|
* Registers a step with the given index via the helper function.
|
|
45
30
|
*
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
31
|
+
* @param step - The step definition to register.
|
|
32
|
+
* @param index - The step index to register the step with.
|
|
48
33
|
* @example
|
|
49
34
|
* ```typescript
|
|
50
35
|
* setupStep(step, index)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/entities/step/step.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/entities/step/step.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAG9D,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAI3D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAGD,QAAA,MAAM,sBAAsB;qBAuBF,cAAc,KAAG,IAAI;kBAkBxB,cAAc,CAAC,IAAI,CAAC,KAAG,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;oBAcjD,cAAc,CAAC,KAAK,CAAC,KAAG,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;;;;;CAa3E,CAAA;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAE3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,CAE/F"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/** @file Top-level public entry point — re-exports the client class, public utilities, and entity types. */
|
|
2
1
|
export * from './exports';
|
|
3
2
|
export type * from './client';
|
|
4
3
|
export type * from './entities/action/action';
|
|
5
4
|
export type * from './entities/condition/condition';
|
|
6
|
-
export type * from './entities/content/content';
|
|
7
5
|
export type * from './entities/component/component';
|
|
8
6
|
export type * from './entities/component/lazyComponent';
|
|
9
7
|
export type * from './entities/experience-instance/experience-instance';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,oCAAoC,CAAA;AACvD,mBAAmB,oDAAoD,CAAA;AACvE,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,8BAA8B,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-snapshot.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/state-snapshot.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAChI,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEhE,sIAAsI;AACtI,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAA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.d.ts
CHANGED
|
@@ -12,42 +12,12 @@ import { Feature } from './entities/feature/feature';
|
|
|
12
12
|
import { EventBusPayload, EventHistoryStore } from './utils/events';
|
|
13
13
|
import { Field } from './entities/field/field';
|
|
14
14
|
import { ExperienceStep } from './entities/step/step';
|
|
15
|
-
import { Content } from './entities/content/content';
|
|
16
|
-
import { ContentLoader } from './plugins/dynamic-experiences/types';
|
|
17
15
|
import { Action } from './entities/action/action';
|
|
18
16
|
import { Condition } from './entities/condition/condition';
|
|
19
17
|
import { SessionEntity } from './entities/session/session';
|
|
20
|
-
/**
|
|
21
|
-
* Provenance metadata describing where the Picked client's project config and
|
|
22
|
-
* content came from. Set by `dynamicExperiencesPlugin` when the Vite plugin's
|
|
23
|
-
* virtual data module is available; remains `null` otherwise.
|
|
24
|
-
*/
|
|
25
|
-
export interface PickedDataSource {
|
|
26
|
-
/** `'build'` when build-mode prefetch JSON was used, `'dev'` when the dev-mode runtime fetch was used. */
|
|
27
|
-
mode: 'dev' | 'build';
|
|
28
|
-
/** ISO 8601 timestamp from the manifest. `null` in dev mode where no manifest is written. */
|
|
29
|
-
fetchedAt: string | null;
|
|
30
|
-
/** The `versionId` recorded by the source, when known. */
|
|
31
|
-
projectVersionId: string | null;
|
|
32
|
-
/** The `workspaceId` recorded by the source, when known. */
|
|
33
|
-
workspaceId: string | null;
|
|
34
|
-
}
|
|
35
18
|
export declare class Picked {
|
|
36
19
|
static readonly logger: (level: "log" | "warn" | "info" | "error", ...args: Parameters<Console["log"]>) => void;
|
|
37
20
|
private readonly options;
|
|
38
|
-
/**
|
|
39
|
-
* Provenance metadata for the data backing this client. Populated by
|
|
40
|
-
* `dynamicExperiencesPlugin` when the Vite plugin's virtual data module is
|
|
41
|
-
* resolvable; remains `null` when the SDK is using the runtime API path.
|
|
42
|
-
*/
|
|
43
|
-
dataSource: PickedDataSource | null;
|
|
44
|
-
/**
|
|
45
|
-
* Content fetcher selected by `dynamicExperiencesPlugin`'s resolution chain. Called
|
|
46
|
-
* by each experience's `prepareExperienceContentFx` (fired in parallel with
|
|
47
|
-
* `initialiseFx` by the per-experience sample graph). `undefined` when no plugin
|
|
48
|
-
* has registered one yet.
|
|
49
|
-
*/
|
|
50
|
-
contentLoader?: ContentLoader;
|
|
51
21
|
private readonly plugins;
|
|
52
22
|
readonly eventBus: EventCallable<EventBusPayload>;
|
|
53
23
|
readonly events: EventHistoryStore;
|
|
@@ -58,21 +28,15 @@ export declare class Picked {
|
|
|
58
28
|
readonly session: SessionEntity;
|
|
59
29
|
readonly searchParams: import('.').PickedSearchParams;
|
|
60
30
|
readonly history: {
|
|
61
|
-
push: EventCallable<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
experienceId: string;
|
|
67
|
-
node: import('.').ExperienceNode;
|
|
31
|
+
push: EventCallable<import('.').InstanceNodeIntent>;
|
|
32
|
+
replace: EventCallable<import('.').InstanceNodeIntent>;
|
|
33
|
+
back: EventCallable<Pick<import('.').InstanceScope, "instanceId">>;
|
|
34
|
+
restoreSnapshots: EventCallable<{
|
|
35
|
+
snapshots: Record<string, import('.').HistoryEntry[]>;
|
|
68
36
|
}>;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
restore: EventCallable<{
|
|
73
|
-
entries: import('.').HistoryEntry[];
|
|
74
|
-
}>;
|
|
75
|
-
entriesStore: Store<import('.').HistoryEntry[]>;
|
|
37
|
+
seedInstanceFromSnapshot: EventCallable<import('.').InstanceScope>;
|
|
38
|
+
entriesStore: StoreWritable<import('.').HistoryEntry[]>;
|
|
39
|
+
snapshotStore: Store<Record<string, import('.').HistoryEntry[]>>;
|
|
76
40
|
};
|
|
77
41
|
readonly components: {
|
|
78
42
|
register: EventCallable<{
|
|
@@ -198,14 +162,6 @@ export declare class Picked {
|
|
|
198
162
|
[id: string]: ExperienceStep;
|
|
199
163
|
}>;
|
|
200
164
|
};
|
|
201
|
-
readonly contents: {
|
|
202
|
-
register: (content: Content) => void;
|
|
203
|
-
getById: (id: Content["id"]) => Store<Content | null>;
|
|
204
|
-
listStore: Store<Content[]>;
|
|
205
|
-
indexStore: StoreWritable<{
|
|
206
|
-
[id: string]: Content;
|
|
207
|
-
}>;
|
|
208
|
-
};
|
|
209
165
|
readonly actions: {
|
|
210
166
|
register: EventCallable<{
|
|
211
167
|
key: string;
|
|
@@ -251,7 +207,6 @@ export declare class Picked {
|
|
|
251
207
|
registerCondition: (condition: Condition) => void;
|
|
252
208
|
registerField: (field: Field) => void;
|
|
253
209
|
registerStep: (step: ExperienceStep) => void;
|
|
254
|
-
registerContent: (content: Content) => void;
|
|
255
210
|
registerAction: (key: string, action: Action) => void;
|
|
256
211
|
registerExperience: (experience: Experience) => void;
|
|
257
212
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,aAAa,EACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC7B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAC3F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAA;AACzF,OAAO,EAA6B,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjG,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM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S,KAAG,IAAI,CAE/C;IAED,aAAa,GAAI,OAAO,KAAK,KAAG,IAAI,CAEnC;IAED,YAAY,GAAI,MAAM,cAAc,KAAG,IAAI,CAE1C;IAED,cAAc,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,KAAG,IAAI,CAEnD;IAED,kBAAkB,GAAI,YAAY,UAAU,KAAG,IAAI,CAMlD;IAED;;;;;;;;;OASG;IAEH,oBAAoB,GAClB,cAAc,MAAM,EACpB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IACD;;;;;;;;;OASG;IAEH,qBAAqB,GACnB,eAAe,MAAM,EACrB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;;;;;;;OAQG;IAEH,kBAAkB,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;IAED;;;;;;;;OAQG;IAEH,mBAAmB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;IAED,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,eAAe;IAWvB,eAAe,GAAI,YAAY,MAAM,KAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1F;CACF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { dynamicExperiencesPlugin, fetchExperienceContent, fetchProject } from './plugin';
|
|
1
|
+
export { dynamicExperiencesPlugin, fetchProject } from './plugin';
|
|
3
2
|
export { createClientHeaders } from '../../utils/client-headers';
|
|
4
3
|
export type * from './types';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,mBAAmB,SAAS,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
-
import { DynamicExperiencesPluginOptions,
|
|
2
|
+
import { DynamicExperiencesPluginOptions, FetchProjectOptions, ProjectConfig } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Fetches the project configuration from the Picked REST API.
|
|
5
5
|
*
|
|
@@ -16,23 +16,6 @@ import { DynamicExperiencesPluginOptions, ExperienceContentResponse, FetchProjec
|
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
18
|
export declare function fetchProject(apiUrl: string, projectId: string, options?: FetchProjectOptions): Promise<ProjectConfig | null>;
|
|
19
|
-
/**
|
|
20
|
-
* Fetches per-experience content from the Picked API.
|
|
21
|
-
*
|
|
22
|
-
* Returns `null` on network failure, non-OK responses, or invalid JSON shape — preserving
|
|
23
|
-
* the failure-tolerant policy: experiences still render, layouts handle null defensively.
|
|
24
|
-
*
|
|
25
|
-
* @param {string} apiUrl - Base URL for the Picked API.
|
|
26
|
-
* @param {string} projectId - Project ID to fetch content for.
|
|
27
|
-
* @param {string} experienceId - Experience ID whose content to fetch.
|
|
28
|
-
* @param {FetchProjectOptions} [options] - Optional headers and preview token.
|
|
29
|
-
* @returns {Promise<ExperienceContentResponse | null>} Validated content response, or `null` on any failure.
|
|
30
|
-
* @example
|
|
31
|
-
* ```typescript
|
|
32
|
-
* const content = await fetchExperienceContent('https://api.picked.app', 'proj_1', 'exp_1')
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export declare function fetchExperienceContent(apiUrl: string, projectId: string, experienceId: string, options?: FetchProjectOptions): Promise<ExperienceContentResponse | null>;
|
|
36
19
|
/**
|
|
37
20
|
* Plugin that fetches project configuration from the Picked REST API and registers
|
|
38
21
|
* features, steps, fields, and experiences with the client.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EACV,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,EAGd,MAAM,SAAS,CAAA;AA2VhB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAmC/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,MAAM,CAmD1F"}
|
|
@@ -9,14 +9,8 @@ import { LogicRule, LogicValue } from '../../logic-engine';
|
|
|
9
9
|
* keys against `ProjectConfig.fields` at registration time.
|
|
10
10
|
*
|
|
11
11
|
* `fieldIds` is optional: layout-only steps (driven purely by `layoutName`) omit it.
|
|
12
|
-
*
|
|
13
|
-
* `layoutContentId` is the wire-format reference to a CMS Content record. The actual
|
|
14
|
-
* content blob is delivered by `dynamicExperiencesPlugin`'s content resolution chain
|
|
15
|
-
* (virtual data module, preview-token API fetch, or direct API fetch) and registered
|
|
16
|
-
* via `client.registerContent`. Steps' derived `layoutContentStore` resolves reactively
|
|
17
|
-
* against the registry at render time.
|
|
18
12
|
*/
|
|
19
|
-
export type ApiExperienceStep = Omit<ExperienceStep, 'fieldKeys'
|
|
13
|
+
export type ApiExperienceStep = Omit<ExperienceStep, 'fieldKeys'> & {
|
|
20
14
|
fieldIds?: string[];
|
|
21
15
|
};
|
|
22
16
|
export interface ProjectConfigFeature {
|
|
@@ -72,65 +66,9 @@ export interface ProjectConfig {
|
|
|
72
66
|
export interface DynamicExperiencesPluginOptions {
|
|
73
67
|
apiUrl?: string;
|
|
74
68
|
projectConfig?: ProjectConfig;
|
|
75
|
-
/**
|
|
76
|
-
* Customer-supplied content fetcher. When provided, supersedes both the virtual
|
|
77
|
-
* data module and the runtime API for per-experience content resolution.
|
|
78
|
-
* Customers using this override are responsible for project ↔ content version
|
|
79
|
-
* consistency. Receives the resolved experience and the current preview token
|
|
80
|
-
* (when present) so the customer can decide preview semantics themselves.
|
|
81
|
-
*/
|
|
82
|
-
getContent?: (experience: {
|
|
83
|
-
id: string;
|
|
84
|
-
key: string;
|
|
85
|
-
}, options?: {
|
|
86
|
-
previewToken?: string;
|
|
87
|
-
}) => Promise<ExperienceContentResponse | null>;
|
|
88
69
|
}
|
|
89
70
|
export interface FetchProjectOptions {
|
|
90
71
|
previewToken?: string;
|
|
91
72
|
headers?: Record<string, string>;
|
|
92
73
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Wire-format content blob as returned by the Picked API content endpoint.
|
|
95
|
-
*/
|
|
96
|
-
export interface ContentBlob {
|
|
97
|
-
id: string;
|
|
98
|
-
data: Record<string, unknown>;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Wire-format response shape for `GET /api/v1/projects/:projectId/experiences/:experienceId/content`.
|
|
102
|
-
* The response is agnostic of step structure — step ↔ content mapping is encoded in the
|
|
103
|
-
* project blob via `Step.layoutContentId`.
|
|
104
|
-
*/
|
|
105
|
-
export interface ExperienceContentResponse {
|
|
106
|
-
experienceId: string;
|
|
107
|
-
versionId: string;
|
|
108
|
-
content: ContentBlob[];
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Function that resolves an experience's content blobs. Set on the Picked client by
|
|
112
|
-
* `dynamicExperiencesPlugin` (selecting from virtual module, getContent override, or API)
|
|
113
|
-
* and called by each experience's `prepareExperienceContentFx`, which is fired by the
|
|
114
|
-
* per-experience sample graph in parallel with `initialiseFx`.
|
|
115
|
-
*/
|
|
116
|
-
export type ContentLoader = (experience: {
|
|
117
|
-
id: string;
|
|
118
|
-
key: string;
|
|
119
|
-
}, options?: {
|
|
120
|
-
previewToken?: string;
|
|
121
|
-
}) => Promise<ExperienceContentResponse | null>;
|
|
122
|
-
/**
|
|
123
|
-
* Optional-fields surface of the virtual data module exposed by `@picked/vite-plugin-picked`.
|
|
124
|
-
* The shape is identical between dev (`vite serve`) and build (`vite build`) modes.
|
|
125
|
-
*/
|
|
126
|
-
export interface VirtualPickedData {
|
|
127
|
-
projectConfig: ProjectConfig;
|
|
128
|
-
experienceContent: ContentLoader;
|
|
129
|
-
manifestMetadata: {
|
|
130
|
-
mode: 'dev' | 'build';
|
|
131
|
-
fetchedAt: string | null;
|
|
132
|
-
projectVersionId: string | null;
|
|
133
|
-
workspaceId: string | null;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
74
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EACjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AACnE,OAAO,KAAK,EAAE,S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BAAgB,EAAE,CAAA;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,oBAAoB,EAAE,CAAA;IAChC,yEAAyE;IACzE,WAAW,EAAE,uBAAuB,EAAE,CAAA;IACtC,yDAAyD;IACzD,KAAK,EAAE,iBAAiB,EAAE,CAAA;IAC1B,oDAAoD;IACpD,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,wEAAwE;IACxE,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC1D;AAED,MAAM,WAAW,+BAA+B;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC"}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
+
export declare const STORAGE_KEY: import('../..').StorageKey;
|
|
2
3
|
/** @public */
|
|
3
4
|
export interface HistoryBrowserStoragePlugin {
|
|
4
5
|
storage?: 'local' | 'session';
|
|
5
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Picked plugin that persists per-experience history snapshots into
|
|
9
|
+
* `localStorage` (default) or `sessionStorage` and restores them on plugin
|
|
10
|
+
* setup and again on the client `load` event (restore is idempotent — the
|
|
11
|
+
* history entity only fills experiences that have no live entries yet).
|
|
12
|
+
*
|
|
13
|
+
* Reads the v1 flat-array shape transparently and migrates it in place; the
|
|
14
|
+
* next debounced save overwrites the v1 bytes with the v2 record shape.
|
|
15
|
+
*
|
|
16
|
+
* @param {HistoryBrowserStoragePlugin} [options] - Plugin options.
|
|
17
|
+
* @param {'local' | 'session'} [options.storage] - Backing store.
|
|
18
|
+
* @returns {Plugin} A Picked client plugin.
|
|
19
|
+
* @example
|
|
20
|
+
* client.use(historyBrowserStoragePlugin({ storage: 'session' }))
|
|
21
|
+
*/
|
|
6
22
|
export declare const historyBrowserStoragePlugin: ({ storage, }?: HistoryBrowserStoragePlugin) => Plugin;
|
|
7
23
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,eAAO,MAAM,WAAW,4BAAwC,CAAA;AA2DhE,cAAc;AACd,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,2BAA2B,GAAI,eAEzC,2BAAgC,KAAG,MA2ErC,CAAA"}
|
|
@@ -13,6 +13,33 @@ export declare function getTargetElements(targets: {
|
|
|
13
13
|
export declare function createAppHosts(targets: (ExperienceTarget & {
|
|
14
14
|
elements: HTMLElement[];
|
|
15
15
|
})[], experienceId: string, experienceKey: string): HTMLElement[];
|
|
16
|
+
/**
|
|
17
|
+
* Finds an existing picked-root host that has already claimed the given selector. Returns
|
|
18
|
+
* the claiming experience id, or `undefined` if no host is found.
|
|
19
|
+
*
|
|
20
|
+
* Used by the per-experience initialise effect to detect target conflicts. The lookup
|
|
21
|
+
* intentionally does not filter by placement: only `placement: 'replace'` removes the
|
|
22
|
+
* original target elements, so any prior claim that caused a later experience to find
|
|
23
|
+
* zero matches must itself have been `replace`. Selector alone is sufficient.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} selector - The original target selector to look up.
|
|
26
|
+
* @returns {string | undefined} The claiming experience id, or `undefined`.
|
|
27
|
+
* @example
|
|
28
|
+
* const claimer = findClaimingExperienceId('.host-slot')
|
|
29
|
+
*/
|
|
30
|
+
export declare function findClaimingExperienceId(selector: string): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Finds an existing picked-root host nested inside `element` that was claimed by a different
|
|
33
|
+
* experience. Used to detect destructive `placement: 'replace'` collisions where the
|
|
34
|
+
* replacing experience would otherwise silently remove another experience's host.
|
|
35
|
+
*
|
|
36
|
+
* @param {HTMLElement} element - The element that is about to be replaced.
|
|
37
|
+
* @param {string} ownExperienceId - The current experience id; matching hosts are ignored.
|
|
38
|
+
* @returns {string | undefined} The id of a nested experience's host, if any.
|
|
39
|
+
* @example
|
|
40
|
+
* findDescendantClaim(parentEl, 'B')
|
|
41
|
+
*/
|
|
42
|
+
export declare function findDescendantClaim(element: HTMLElement, ownExperienceId: string): string | undefined;
|
|
16
43
|
export declare function tagTargetElement(element: HTMLElement, experienceId: string): void;
|
|
17
44
|
export declare function isPickedRoot(element: HTMLElement, experienceId?: string): boolean;
|
|
18
45
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAGzE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CAQ7D;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EA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E,MAAM,IAAI,QAS1E;AAED,KAAK,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAA;AAOtE,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,EAAE,EACrD,YAAY,EAAE,MAAM,GACnB,CAAC,gBAAgB,GAAG;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,EAAE,CAqBpD;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,CAAC,gBAAgB,GAAG;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,EAAE,EAC3D,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,iBAOtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAU7E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,EACpB,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,SAAS,CASpB;AAGD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAG1E;AAUD,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,MAAM,WAMvE"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./rules-logic-H6P8xwHF.cjs`);require(`./logger-fbvQC40v.cjs`);const t=require(`./supports-Dsjg-82e.cjs`);let n=require(`effector`),r=require(`@withease/factories`);function i(e){return!t.d()||!t.r()?[]:Array.from(window.document.querySelectorAll(e)).filter(e=>e instanceof HTMLElement)}var a=`open`;function o(e){if(!t.l())throw Error(`Shadow DOM is not supported in this environment`);return e.attachShadow({mode:a})}function s(){return new Promise((e,n)=>{if(!t.r()){n();return}document.readyState===`loading`?document.addEventListener(`readystatechange`,()=>e(),{once:!0}):e()})}function c(e,t){let n=new MutationObserver(r=>{document.contains(e)||(n.disconnect(),t())});n.observe(document.body,{childList:!0,subtree:!0})}var l=`picked-root`,u=`picked-target`,d=`picked-root`;function f(e,t){return[...e,{selector:`${d}[experience-id="${t}"]`,placement:`replace`}].flatMap(e=>{let n=i(e.selector).filter(e=>!h(e,t)&&!g(e,t));return{...e,elements:n}})}function p(e,t,n){return e.flatMap(e=>e.elements.map(r=>v(r,e.placement,t,n)))}function m(e,t){e.classList.add(u),e.classList.add(`${u}-${t}`)}function h(e,t){return t?e.classList.contains(`${u}-${t}`):e.classList.contains(`${u}`)}function g(e,t){return t?e.classList.contains(`${l}-${t}`):e.classList.contains(l)}function _(e,t){let n=document.createElement(`div`);return n.style.display=`block`,n.classList.add(l),n.classList.add(`${l}-${e}`),n.classList.add(`${l}-${t}`),n}function v(e,t,n,r){let i,a=_(n,r);if(e instanceof Document)i=e.body.appendChild(a);else{switch(t){case`replace`:e.replaceWith(a);break;case`before`:e.before(a);break;case`after`:e.after(a);break;case`prepend`:e.prepend(a);break;case`append`:e.append(a);break}i=a}return i}function y(e){return e.type===`condition`}function b(e){return e.type===`step`}function x(e){return e.type===`experience`}function S(e){return e.type===`origin`}function C(e){return e.type===`action`}var w=(e,t,n,r,i=new Set)=>i.has(n.id)?[]:(i.add(n.id),b(n)&&!r?[n]:t.filter(e=>e.sourceNodeId===n.id).flatMap(n=>{let r=e.find(e=>e.id===n.destinationNodeId);return r?w(e,t,r,!1,i):[]})),T=(e,t,n)=>w(e,t,n,!0,new Set),E=(e,t,n,r,i=new Set)=>{if(i.has(n.id))return[-1,-1];i.add(n.id);let a=t.filter(e=>e.sourceNodeId===n.id);if(a.length===0)return[0,0];let o=1/0,s=-1/0;for(let n of a){let r=e.find(e=>e.id===n.destinationNodeId);if(!r)continue;let[a,c]=E(e,t,r,!1,new Set(i));a!==-1&&(o=Math.min(o,a+1),s=Math.max(s,c+1))}return o===1/0?[-1,-1]:[o,s]},D=(e,t,n)=>E(e,t,n,!0,new Set),O=(e,t,n,r=new Set)=>{if(r.has(n.id))return[-1,-1];if(r.add(n.id),n.type===`origin`)return[0,0];let i=t.filter(e=>e.destinationNodeId===n.id);if(i.length===0)return[-1,-1];let a=1/0,o=-1/0;for(let n of i){let i=e.find(e=>e.id===n.sourceNodeId);if(!i)continue;let[s,c]=O(e,t,i,new Set(r));s!==-1&&(a=Math.min(a,s+1),o=Math.max(o,c+1))}return a===1/0?[-1,-1]:[a,o]},k=(e,t,n)=>O(e,t,n,new Set),A=e=>e.find(e=>e.type===`origin`)||null,j=(e,t,n)=>{if(!e)return A(t);let r=n.find(t=>t.sourceNodeId===e.id);return r&&t.find(e=>e.id===r.destinationNodeId)||null};async function M(e,t,n,r){let i=e?`true`:`false`,a=r.find(e=>e.sourceHandle===i&&e.sourceNodeId===t);return n.find(e=>e.id===a?.destinationNodeId)}var N=(0,n.createDomain)(`experience-instance`),P=(0,r.createFactory)(({client:t,experience:r,target:i,options:a})=>{let s=(0,n.createEvent)(),c=(0,n.createEvent)(),l=(0,n.createEvent)(),u=(0,n.createEvent)(),d=(0,n.createEvent)(),f=(0,n.createEvent)(),p=r.componentStore,m=N.store(`transitioning`),h=t.history.entriesStore.map(e=>e.filter(e=>e.experienceId===r.id)),g=h.map(e=>e.filter(e=>b(e.node))),_=h.map(e=>e.at(-1)?.node||null),v=(0,n.combine)(t.steps.listStore,_,(e,t)=>e.find(e=>t&&b(t)&&e.id===t.stepId)||null),w=(0,n.combine)(t.steps.listStore,g,(e,t)=>{let n=t.at(-2);if(!n||!b(n.node))return null;let r=n.node;return e.find(e=>e.id===r.stepId)||null}),E=(0,n.combine)(r.treeStore,_,({nodes:e,edges:t},n)=>n?T(e,t,n):[]),O=(0,n.combine)(r.treeStore,_,({nodes:e,edges:t},n)=>n?k(e,t,n):[-1,-1]),P=(0,n.combine)(r.treeStore,_,({nodes:e,edges:t},n)=>n?D(e,t,n):[-1,-1]),F=N.store(!1),I=(0,n.createApi)(F,{open:()=>!0,close:()=>!1,toggle:e=>!e,set:(e,t)=>t}),L=(0,n.createEffect)(async()=>{t.history.back({experienceId:r.id})}),R=(0,n.attach)({source:r.treeStore,effect:async(e,n)=>{let i=e.nodes.find(e=>b(e)&&e.stepId===n);i&&t.history.push({experienceId:r.id,node:i})}}),z=(0,n.attach)({source:_,effect:e=>{}}),B=(0,n.attach)({source:r.treeStore,effect:async({nodes:e})=>A(e)}),V=(0,n.attach)({source:r.treeStore,effect:async({nodes:e,edges:t},n)=>{if(S(n))return j(n,e,t)}}),H=(0,n.attach)({source:r.treeStore,effect:async({nodes:n,edges:r,conditions:i},a)=>{if(!y(a))return;let o=i.find(e=>e.id===a.conditionId)?.logic;return o?M(!!await e.t(t,o),a.id,n,r):void 0}}),U=(0,n.attach)({source:{tree:r.treeStore,actions:t.actions.listStore,snapshot:t.stateSnapshotStore},effect:async({tree:e,actions:t,snapshot:n},r)=>{let{nodes:i,edges:a}=e;if(!C(r))return;let o=r.actionKey;if(!o){`${r.id}`;return}let s=t.find(e=>e.key===o)?.action;if(!s){`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return e?i.find(t=>t.id===e.destinationNodeId):null}if(typeof s!=`function`){`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return e?i.find(t=>t.id===e.destinationNodeId):null}try{`${o}`,await s({...n,args:[]},{experience:X});let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`true`);if(!e)return`${r.id}`,null;let t=i.find(t=>t.id===e.destinationNodeId);return`${o}${t?.id}`,t||null}catch{`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);if(!e)return`${r.id}`,null;let t=i.find(t=>t.id===e.destinationNodeId);return`${o}${t?.id}`,t||null}}}),W=(0,n.createEffect)(e=>{x(e)&&t.experiences.launch({key:e.experienceKey})}),G=(0,n.attach)({source:[_,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),K=(0,n.attach)({source:[_,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),q=(0,n.createEffect)(e=>{t.history.push({experienceId:r.id,node:e})}),J=(0,n.attach)({source:r.configStore,effect:async({initializeOpenLogic:n})=>a?.initialiseOpen===void 0?e.n(n)?!!await e.t(t,n):n??!1:a.initialiseOpen}),Y=(0,n.combine)(p,t.frameworks.listStore,(e,t)=>{if(!e)return null;let n=t.find(t=>t.name===e.component.frameworkName);return n?{component:e,framework:n}:null},{skipVoid:!1}),X,Z=(0,n.attach)({source:Y,effect:e=>{if(!e)return;if(!i){`${r.id}`;return}let n=o(i);try{e.framework.render(n,e.component.component,t,X)}catch{}}});X=Object.freeze({id:Math.random().toString(36).substring(7),experienceKey:r.key,experienceId:r.id,experienceName:r.name,configStore:r.configStore,target:i,componentStore:p,componentAndFrameworkStore:Y,stateStore:m,isOpenStore:F,open:I.open,close:I.close,toggleOpen:I.toggle,setOpen:I.set,treeStore:r.treeStore,currentNodeStore:_,currentStepStore:v,previousStepStore:w,nextReachableStepNodesStore:E,stepsToOriginStore:O,stepsToLeafStore:P,goToNextStep:c,goToPreviousStep:l,goToStepById:u,stepsHistoryStore:g,mountFx:Z});let Q=(0,n.createEvent)(),$=(0,n.createEvent)();return(0,n.sample)({clock:_,target:Q}),(0,n.sample)({clock:Q,filter:e=>e===null,target:B}),(0,n.sample)({clock:Q,filter:e=>e!==null,target:$}),(0,n.split)({source:$,match:e=>y(e)?`condition`:b(e)?`step`:x(e)?`launchExperience`:S(e)?`origin`:C(e)?`action`:`other`,cases:{origin:V,condition:H,step:z,launchExperience:W,action:U,__:(0,n.createEvent)()}}),(0,n.sample)({clock:[H.doneData,V.doneData,B.doneData,K.doneData,G.doneData,U.doneData],filter:Boolean,target:q}),(0,n.sample)({clock:c,target:K}),(0,n.sample)({clock:c,source:v,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit`,step:e,experience:X}))}),(0,n.sample)({clock:K.done,source:v,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_success`,step:e,experience:X}))}),(0,n.sample)({clock:K.fail,source:v,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_error`,step:e,experience:X}))}),(0,n.sample)({clock:l,target:L}),(0,n.sample)({clock:u,target:R}),(0,n.sample)({source:(0,n.combine)([H.pending,V.pending,B.pending,K.pending]),fn:e=>e.some(Boolean)?`transitioning`:`ready`,target:m}),(0,n.sample)({clock:z.doneData,source:v,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_enter`,step:e,experience:X}))}),(0,n.sample)({clock:f,target:J}),(0,n.sample)({source:J.doneData,fn:Boolean,target:F}),(0,n.sample)({source:_,clock:s,filter:e=>e?S(e):!0,target:G}),(0,n.sample)({source:F,filter:Boolean,target:s}),(0,n.sample)({source:F,filter:Boolean,target:t.eventBus.prepend(()=>({type:`experience_open`,experience:X}))}),(0,n.sample)({source:F,filter:e=>!e,target:t.eventBus.prepend(()=>({type:`experience_close`,experience:X}))}),(0,n.sample)({clock:d,target:[f]}),d(),X});function F(e){return(0,r.invoke)(P,e)}var I=(0,r.createFactory)(({client:e})=>{let t=N.store({}),r=(0,n.createEvent)(),i=(0,n.createEvent)(),a=(0,n.createEvent)(),o=(0,n.createApi)(t,{register(e,t){let n=[...e[t.experienceId]??[]];return n.push(t),{...e,[t.experienceId]:n}},unregister(e,t){let n=t.experienceId,r=e[n]?.filter(e=>e!==t);return{...e,[n]:r??[]}}}),s=(0,n.createEffect)(({experience:t,target:n,options:r})=>F({client:e,experience:t,target:n,options:r})),l=(0,n.createEffect)(e=>{o.register(e)}),u=(0,n.createEffect)(e=>{e.target&&c(e.target,()=>{a(e)})}),d=(0,n.createEffect)(e=>{o.unregister(e)}),f=(0,n.createEffect)(async e=>{await e.mountFx()});(0,n.sample)({clock:r,target:s}),(0,n.sample)({clock:a,target:d}),(0,n.sample)({clock:s.doneData,target:[l,u,i]}),(0,n.sample)({clock:s.doneData,target:e.eventBus.prepend(e=>({type:`experience_initialize`,experience:e}))}),(0,n.sample)({clock:i,target:f});function p(e,t,n){r({experience:e,target:t,options:n})}let m=t.map(e=>Object.values(e).flat());function h(e){return m.map(t=>t.filter(t=>t.experienceKey===e),{skipVoid:!1})}function g(e){return t.map(t=>t[e]||[],{skipVoid:!1})}return{spawn:p,getByExperienceKey:h,getByExperienceId:g,listStore:m}});function L(e){return(0,r.invoke)(I,e)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return F}});
|