@picked/client 0.0.51-next.1 → 0.0.51-next.10
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-CHy9HcU7.cjs +1 -0
- package/dist/{api-Brluf3C1.js → api-mlYS-lDj.js} +1 -1
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/form/index.js +82 -76
- package/dist/esm/index.js +436 -355
- package/dist/esm/plugins/create-experience/index.js +181 -154
- package/dist/esm/plugins/dynamic-experiences/index.js +52 -30
- package/dist/esm/plugins/responses-browser-storage/index.js +6 -8
- package/dist/esm/plugins/responses-indexeddb/index.js +8 -4
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-DOcd8XI1.cjs +1 -0
- package/dist/{experience-instance-CIbQp9D7.js → experience-instance-NHU1moID.js} +37 -32
- package/dist/{rules-logic-BIkBWZmf.js → rules-logic-CnVktz2l.js} +9 -2
- package/dist/{rules-logic-DDxCiq4P.cjs → rules-logic-nMHNVLn7.cjs} +1 -1
- package/dist/types/client.d.ts +47 -43
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/action/action.d.ts +37 -5
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/condition/condition.d.ts +20 -0
- package/dist/types/entities/condition/condition.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +63 -47
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +22 -2
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +13 -2
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/response/response-validation.d.ts +74 -0
- package/dist/types/entities/response/response-validation.d.ts.map +1 -0
- package/dist/types/entities/response/response.d.ts +24 -20
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +42 -0
- package/dist/types/entities/step/step.d.ts.map +1 -0
- package/dist/types/form/build-responses.d.ts +12 -9
- package/dist/types/form/build-responses.d.ts.map +1 -1
- package/dist/types/form/create-field-evaluator.d.ts +11 -3
- package/dist/types/form/create-field-evaluator.d.ts.map +1 -1
- package/dist/types/form/create-field-validation.d.ts +4 -4
- package/dist/types/form/create-field-validation.d.ts.map +1 -1
- package/dist/types/form/create-form.d.ts +1 -0
- package/dist/types/form/create-form.d.ts.map +1 -1
- package/dist/types/form/create-submit-pipeline.d.ts +19 -7
- package/dist/types/form/create-submit-pipeline.d.ts.map +1 -1
- package/dist/types/form/get-step-fields.d.ts +13 -0
- package/dist/types/form/get-step-fields.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/picked.d.ts +98 -31
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +31 -11
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +2 -2
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +21 -4
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +45 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +1 -1
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +13 -0
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +11 -1
- package/dist/types/utils/state-snaphot.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/api-A3gUhQJc.cjs +0 -1
- package/dist/experience-instance-Dri5yAp1.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,KAAK,EACV,UAAU,EAEV,UAAU,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAGjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EACV,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACV,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEhE,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,MAA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6 +1,6 @@
|
|
|
1
|
+
/** @file Public API for the create-experience plugin. */
|
|
1
2
|
export { createExperiencePlugin } from './plugin';
|
|
2
3
|
export type * from './plugin';
|
|
3
4
|
export type * from './create-experience';
|
|
4
|
-
export { createCondition,
|
|
5
|
-
export { serialization } from './serialization';
|
|
5
|
+
export { createCondition, createEdge, createExperience, createNode, createField, createStep, } from './create-experience';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjD,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,qBAAqB,CAAA;AACxC,OAAO,EACL,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjD,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,qBAAqB,CAAA;AACxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,qBAAqB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/plugin.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAE1D,OAAO,KAAK,EAAwB,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAGvF,UAAU,6BAA6B;IACrC,WAAW,EAAE,sBAAsB,EAAE,CAAA;CACtC;AAED,eAAO,MAAM,sBAAsB,GAAI,SAAS,6BAA6B,KAAG,MA0B/E,CAAA"}
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import { Plugin } from '../../entities/plugin/plugin';
|
|
2
2
|
import { DynamicExperiencesPluginOptions, FetchProjectOptions, ProjectConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Fetches the project configuration from the Picked REST API.
|
|
5
|
+
*
|
|
6
|
+
* Returns `null` on network failure, non-OK responses, or invalid JSON shape.
|
|
7
|
+
* Connection-refused errors from local URLs are suppressed silently.
|
|
8
|
+
*
|
|
9
|
+
* @param apiUrl - Base URL for the Picked API.
|
|
10
|
+
* @param projectId - Project ID to fetch config for.
|
|
11
|
+
* @param options - Optional headers and preview token.
|
|
12
|
+
* @returns Validated project config, or `null` on any failure.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const config = await fetchProject('https://api.picked.app', 'proj_123')
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
3
18
|
export declare function fetchProject(apiUrl: string, projectId: string, options?: FetchProjectOptions): Promise<ProjectConfig | null>;
|
|
4
19
|
/**
|
|
5
|
-
* Plugin that fetches
|
|
6
|
-
* and
|
|
20
|
+
* Plugin that fetches project configuration from the Picked REST API and registers
|
|
21
|
+
* features, steps, fields, and experiences with the client.
|
|
7
22
|
*
|
|
8
|
-
* Features are fetched during the `onStart` hook, before experience
|
|
9
|
-
*
|
|
23
|
+
* Features are fetched during the `onStart` hook, before experience initialisation.
|
|
24
|
+
* Search param feature overrides take precedence over API-provided values.
|
|
10
25
|
*
|
|
26
|
+
* @param options - Optional plugin configuration.
|
|
27
|
+
* @returns A configured Picked plugin.
|
|
11
28
|
* @example
|
|
12
29
|
* ```typescript
|
|
13
30
|
* import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EACV,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EACV,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,EAGd,MAAM,SAAS,CAAA;AAmUhB;;;;;;;;;;;;;;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,CAgD1F"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ExperienceStep } from '../../entities/step/step';
|
|
2
|
+
import { Field } from '../../entities/field/field';
|
|
3
|
+
import { ExperienceEdge, ExperienceNode, ExperienceTarget } from '../../entities/experience/experience';
|
|
4
|
+
import { Condition } from '../../entities/condition/condition';
|
|
5
|
+
import { LogicRule, LogicValue } from '../../logic-engine';
|
|
1
6
|
export interface ProjectConfigFeature {
|
|
2
7
|
id: string;
|
|
3
8
|
name: string;
|
|
@@ -5,8 +10,48 @@ export interface ProjectConfigFeature {
|
|
|
5
10
|
weight: number;
|
|
6
11
|
version: number;
|
|
7
12
|
}
|
|
13
|
+
export type ProjectConfigNode = ExperienceNode;
|
|
14
|
+
/**
|
|
15
|
+
* An experience payload as returned by the API.
|
|
16
|
+
* Steps are referenced by ID only; the full step definitions live in the
|
|
17
|
+
* top-level `steps` array of ProjectConfig.
|
|
18
|
+
* Conditions are referenced by nodes via `conditionId`; the full condition
|
|
19
|
+
* definitions live in the top-level `conditions` array of ProjectConfig.
|
|
20
|
+
*/
|
|
21
|
+
export interface ProjectConfigExperience {
|
|
22
|
+
id: string;
|
|
23
|
+
key: string;
|
|
24
|
+
name: string;
|
|
25
|
+
componentName: string;
|
|
26
|
+
nodes: ProjectConfigNode[];
|
|
27
|
+
edges: ExperienceEdge[];
|
|
28
|
+
/** Decision logic that controls whether this experience is initialised. */
|
|
29
|
+
condition: LogicRule | LogicValue;
|
|
30
|
+
/** Logic that controls the initial open state of the experience. */
|
|
31
|
+
initializeOpen: LogicRule | LogicValue;
|
|
32
|
+
/** DOM targets this experience mounts into. */
|
|
33
|
+
targets: ExperienceTarget[];
|
|
34
|
+
}
|
|
8
35
|
export interface ProjectConfig {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
status: string;
|
|
39
|
+
versionId: string;
|
|
40
|
+
workspaceId: string;
|
|
9
41
|
features: ProjectConfigFeature[];
|
|
42
|
+
/** Experience definitions with steps and conditions referenced by ID. */
|
|
43
|
+
experiences: ProjectConfigExperience[];
|
|
44
|
+
/** Global step definitions shared across experiences. */
|
|
45
|
+
steps: ExperienceStep[];
|
|
46
|
+
/** Global field definitions shared across steps. */
|
|
47
|
+
fields: Field[];
|
|
48
|
+
/** Global condition definitions referenced by experience flow nodes. */
|
|
49
|
+
conditions: Condition[];
|
|
50
|
+
actions: Array<{
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
key: string;
|
|
54
|
+
}>;
|
|
10
55
|
}
|
|
11
56
|
export interface DynamicExperiencesPluginOptions {
|
|
12
57
|
apiUrl?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,oBAAoB,EAAE,CAAA;
|
|
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,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/D,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAA;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,iBAAiB,EAAE,CAAA;IAC1B,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,2EAA2E;IAC3E,SAAS,EAAE,SAAS,GAAG,UAAU,CAAA;IACjC,oEAAoE;IACpE,cAAc,EAAE,SAAS,GAAG,UAAU,CAAA;IACtC,+CAA+C;IAC/C,OAAO,EAAE,gBAAgB,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,cAAc,EAAE,CAAA;IACvB,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,UAAU,6BAA6B;IACrC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAiCD,eAAO,MAAM,6BAA6B,GAAI,eAE3C,6BAAkC,KAAG,MAqCvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,eAAO,MAAM,wBAAwB,QAAO,MAqE3C,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Store, createEvent } from 'effector';
|
|
2
2
|
import { ValidationError } from '../entities/response/response';
|
|
3
|
-
import { ExperienceStep } from '../entities/
|
|
3
|
+
import { ExperienceStep } from '../entities/step/step';
|
|
4
4
|
import { ExperienceInstance } from '../entities/experience-instance/experience-instance';
|
|
5
5
|
import { ResolvedFeature } from '../entities/feature/feature';
|
|
6
6
|
import { Session } from './user-session';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM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16 @@
|
|
|
1
1
|
import { ExperienceEdge, ExperienceNode } from '../../entities/experience/experience';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the next node in the experience graph based on a condition result.
|
|
4
|
+
*
|
|
5
|
+
* @param conditionResult - Whether the condition evaluated to true or false.
|
|
6
|
+
* @param conditionNodeId - The ID of the condition node in the graph.
|
|
7
|
+
* @param nodes - All nodes in the experience graph.
|
|
8
|
+
* @param edges - All edges in the experience graph.
|
|
9
|
+
* @returns The next node to navigate to, or undefined if no matching edge exists.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const nextNode = await getNextNodeFromCondition(true, 'cond-1', nodes, edges)
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
2
15
|
export declare function getNextNodeFromCondition(conditionResult: boolean, conditionNodeId: string, nodes: ExperienceNode[], edges: ExperienceEdge[]): Promise<ExperienceNode | undefined>;
|
|
3
16
|
//# sourceMappingURL=get-next-node-from-condition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-next-node-from-condition.d.ts","sourceRoot":"","sources":["../../../../src/utils/node-tree/get-next-node-from-condition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAE1F,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,cAAc,EAAE,EACvB,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"get-next-node-from-condition.d.ts","sourceRoot":"","sources":["../../../../src/utils/node-tree/get-next-node-from-condition.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAE1F;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,cAAc,EAAE,EACvB,KAAK,EAAE,cAAc,EAAE,uCAOxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-logic.d.ts","sourceRoot":"","sources":["../../../src/utils/rules-logic.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAgB,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGvC;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE/D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"rules-logic.d.ts","sourceRoot":"","sources":["../../../src/utils/rules-logic.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAgB,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGvC;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE/D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,WAAW,gKAmDtB"}
|
|
@@ -7,10 +7,20 @@ export interface StateSnapshot {
|
|
|
7
7
|
sessionStorage?: Window['sessionStorage'];
|
|
8
8
|
localStorage?: Window['localStorage'];
|
|
9
9
|
responses: {
|
|
10
|
-
|
|
10
|
+
fieldKey: string;
|
|
11
11
|
value: FieldValue | undefined;
|
|
12
12
|
}[];
|
|
13
13
|
fields: Field[];
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates an immutable snapshot of the current client state for condition evaluation.
|
|
17
|
+
*
|
|
18
|
+
* @param {Picked} client - The Picked client instance to snapshot.
|
|
19
|
+
* @returns {StateSnapshot} A frozen snapshot of the current client state.
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const snapshot = createStateSnapshot(client)
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
15
25
|
export declare function createStateSnapshot(client: Picked): StateSnapshot;
|
|
16
26
|
//# sourceMappingURL=state-snaphot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-snaphot.d.ts","sourceRoot":"","sources":["../../../src/utils/state-snaphot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEhE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IACrC,SAAS,EAAE;QACT,
|
|
1
|
+
{"version":3,"file":"state-snaphot.d.ts","sourceRoot":"","sources":["../../../src/utils/state-snaphot.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEhE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IACrC,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,UAAU,GAAG,SAAS,CAAA;KAC9B,EAAE,CAAA;IACH,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAYjE"}
|
package/package.json
CHANGED
package/dist/api-A3gUhQJc.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`Picked-Client`,t=`Picked-Version`;function n(n,r){return{[e]:n,[t]:r}}var r=()=>`0.0.51-next.1`,i=`v1`;function a(e,t){return new URL(`/api/${i}/${t}`,e).toString()}function o(e){return{...n(`sdk`,r()),...e}}async function s(e,t,n){let r=a(e,t);return fetch(r,{headers:o(n)})}async function c(e,t,n,r){let i=a(e,t);return fetch(i,{method:`POST`,headers:{"Content-Type":`application/json`,...o(r)},body:JSON.stringify(n)})}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./rules-logic-DDxCiq4P.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){return e.flatMap(e=>e.elements.map(n=>v(n,e.placement,t)))}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){let t=document.createElement(`div`);return t.style.display=`block`,t.classList.add(l),t.classList.add(`${l}-${e}`),t}function v(e,t,n){let r,i=_(n);if(e instanceof Document)r=e.body.appendChild(i);else{switch(t){case`replace`:e.replaceWith(i);break;case`before`:e.before(i);break;case`after`:e.after(i);break;case`prepend`:e.prepend(i);break;case`append`:e.append(i);break}r=i}return r}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.sourceNodeHandle===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 o=(0,n.createEvent)(),s=(0,n.createEvent)(),c=(0,n.createEvent)(),l=(0,n.createEvent)(),u=(0,n.createEvent)(),d=(0,n.createEvent)(),f=r.componentStore,p=N.store(`transitioning`),m=t.history.entriesStore.map(e=>e.filter(e=>e.experienceId===r.id)),h=m.map(e=>e.filter(e=>b(e.node))),g=m.map(e=>e.at(-1)?.node||null),_=(0,n.combine)(r.treeStore,g,({steps:e},t)=>e.find(e=>t&&b(t)&&e.id===t.stepId)||null),v=(0,n.combine)(r.treeStore,h,({steps: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}),w=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?T(e,t,n):[]),E=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?k(e,t,n):[-1,-1]),O=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?D(e,t,n):[-1,-1]),P=N.store(!1),F=(0,n.createApi)(P,{open:()=>!0,close:()=>!1,toggle:e=>!e,set:(e,t)=>t}),I=(0,n.createEffect)(async()=>{t.history.back({experienceId:r.id})}),L=(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})}}),R=(0,n.attach)({source:g,effect:e=>{}}),z=(0,n.attach)({source:r.treeStore,effect:async({nodes:e})=>A(e)}),B=(0,n.attach)({source:r.treeStore,effect:async({nodes:e,edges:t},n)=>{if(S(n))return j(n,e,t)}}),V=(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);if(!o)return;let s=a.id;return M(!!await e.t(t,o.condition),s,n,r)}}),H=(0,n.attach)({source:r.treeStore,effect:async({nodes:e,edges:n},r)=>{if(!C(r))return;let i=r.action;if(!i){`${r.id}`;return}let a=t.actions.getByName(i).getState();if(!a){`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceNodeHandle===`false`);return t?e.find(e=>e.id===t.destinationNodeId):null}if(typeof a.action!=`function`){`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceNodeHandle===`false`);return t?e.find(e=>e.id===t.destinationNodeId):null}try{`${i}`,await a.action(i);let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceNodeHandle===`true`);if(!t)return`${r.id}`,null;let o=e.find(e=>e.id===t.destinationNodeId);return`${i}${o?.id}`,o||null}catch{`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceNodeHandle===`false`);if(!t)return`${r.id}`,null;let a=e.find(e=>e.id===t.destinationNodeId);return`${i}${a?.id}`,a||null}}}),U=(0,n.createEffect)(e=>{x(e)&&t.experiences.launch({id:e.experienceId})}),W=(0,n.attach)({source:[g,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),G=(0,n.attach)({source:[g,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),K=(0,n.createEffect)(e=>{t.history.push({experienceId:r.id,node:e})}),q=(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}),J=Object.freeze({id:Math.random().toString(36).substring(7),experienceId:r.id,configStore:r.configStore,target:i,componentStore:f,stateStore:p,isOpenStore:P,open:F.open,close:F.close,toggleOpen:F.toggle,setOpen:F.set,treeStore:r.treeStore,fieldsStore:r.fieldsStore,currentNodeStore:g,currentStepStore:_,previousStepStore:v,nextReachableStepNodesStore:w,stepsToOriginStore:E,stepsToLeafStore:O,goToNextStep:s,goToPreviousStep:c,goToStepById:l,stepsHistoryStore:h}),Y=(0,n.createEvent)(),X=(0,n.createEvent)();return(0,n.sample)({source:g,target:Y}),(0,n.sample)({clock:Y,filter:e=>e===null,target:z}),(0,n.sample)({clock:Y,filter:e=>e!==null,target:X}),(0,n.split)({source:X,match:e=>y(e)?`condition`:b(e)?`step`:x(e)?`launchExperience`:S(e)?`origin`:C(e)?`action`:`other`,cases:{origin:B,condition:V,step:R,launchExperience:U,action:H,__:(0,n.createEvent)()}}),(0,n.sample)({clock:[V.doneData,B.doneData,z.doneData,G.doneData,W.doneData,H.doneData],filter:Boolean,target:K}),(0,n.sample)({clock:s,target:G}),(0,n.sample)({clock:s,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit`,step:e,experience:J}))}),(0,n.sample)({clock:G.done,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_success`,step:e,experience:J}))}),(0,n.sample)({clock:G.fail,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_error`,step:e,experience:J}))}),(0,n.sample)({clock:c,target:I}),(0,n.sample)({clock:l,target:L}),(0,n.sample)({source:(0,n.combine)([V.pending,B.pending,z.pending,G.pending]),fn:e=>e.some(Boolean)?`transitioning`:`ready`,target:p}),(0,n.sample)({clock:R.doneData,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_enter`,step:e,experience:J}))}),(0,n.sample)({clock:d,target:q}),(0,n.sample)({source:q.doneData,fn:Boolean,target:P}),(0,n.sample)({source:g,clock:o,filter:e=>e?S(e):!0,target:W}),(0,n.sample)({source:P,filter:Boolean,target:o}),(0,n.sample)({source:P,filter:Boolean,target:t.eventBus.prepend(()=>({type:`experience_open`,experience:J}))}),(0,n.sample)({source:P,filter:e=>!e,target:t.eventBus.prepend(()=>({type:`experience_close`,experience:J}))}),(0,n.sample)({clock:u,target:[d]}),u(),J});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)(),s=(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??[]}}}),l=(0,n.createEffect)(({experience:t,target:n,options:r})=>F({client:e,experience:t,target:n,options:r})),u=(0,n.createEffect)(e=>{s.register(e)}),d=(0,n.createEffect)(e=>{e.target&&c(e.target,()=>{a(e)})}),f=(0,n.createEffect)(e=>{s.unregister(e)}),p=(0,n.createEffect)(t=>{let n=t.componentStore.getState();if(!n)return;let r=n.frameworkStore.getState();if(!r){`${n.name}`;return}let i=t.target;if(!i){`${t.experienceId}`;return}let a=o(i);try{r.render(a,n.component,e,t)}catch{}});(0,n.sample)({clock:r,target:l}),(0,n.sample)({clock:a,target:f}),(0,n.sample)({clock:l.doneData,target:[u,d,i]}),(0,n.sample)({clock:l.doneData,target:e.eventBus.prepend(e=>({type:`experience_initialize`,experience:e}))}),(0,n.sample)({clock:i,target:p});function m(e,t,n){r({experience:e,target:t,options:n})}let h=t.map(e=>Object.values(e).flat());function g(e){return t.map(t=>t[e]||[],{skipVoid:!1})}return{spawn:m,getByExperienceId:g,listStore:h}});function L(e){return(0,r.invoke)(I,e)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return F}});
|