@picked/client 0.0.1-dev.1774231221701 → 0.0.1-dev.1774244905386
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-oudcFuUX.js → api-ENA5t36y.js} +1 -1
- package/dist/{api-BEXzPJHZ.cjs → api-dkMxUUe0.cjs} +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/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/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/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +503 -426
- package/dist/esm/plugins/create-experience/index.js +329 -294
- package/dist/esm/plugins/dynamic-experiences/index.js +53 -30
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-indexeddb/index.js +9 -5
- package/dist/esm/plugins/single-page-app/index.js +4 -4
- package/dist/esm/plugins/web-components/index.js +1 -1
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-BODAwa-_.js +713 -0
- package/dist/experience-instance-DImQh64e.cjs +1 -0
- package/dist/object-BReQiaSS.cjs +1 -0
- package/dist/{object-C82v79xc.js → object-Clj5zVr1.js} +1 -2
- package/dist/storage-BFjb8azI.cjs +1 -0
- package/dist/{storage-6Xk0uAxB.js → storage-DyxpJ0pg.js} +1 -3
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/condition/condition.d.ts +17 -0
- package/dist/types/entities/condition/condition.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +36 -59
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -2
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +17 -12
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts +9 -0
- package/dist/types/entities/project/project.d.ts.map +1 -0
- package/dist/types/entities/response/response.d.ts +10 -7
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +38 -0
- package/dist/types/entities/step/step.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +8 -2
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +61 -52
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +61 -29
- 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 +47 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -2
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +0 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -2
- 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/plugins/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +3 -0
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +2 -2
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +1 -0
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +1 -2
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/key.d.ts +12 -0
- package/dist/types/utils/key.d.ts.map +1 -0
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +3 -3
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +25 -2
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +8 -0
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/picked-config.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +1 -11
- package/dist/cjs/form/index.js +0 -1
- package/dist/esm/form/index.js +0 -428
- package/dist/experience-instance-DZiAwXph.js +0 -481
- package/dist/experience-instance-Ddk4Jktn.cjs +0 -1
- package/dist/object-CUJOjanb.cjs +0 -1
- package/dist/rules-logic-B7vJrWyO.js +0 -231
- package/dist/rules-logic-CXr4wXcG.cjs +0 -1
- package/dist/storage-B6lQtc4-.cjs +0 -1
- package/dist/types/form/build-responses.d.ts +0 -14
- package/dist/types/form/build-responses.d.ts.map +0 -1
- package/dist/types/form/create-field-evaluator.d.ts +0 -19
- package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
- package/dist/types/form/create-field-validation.d.ts +0 -44
- package/dist/types/form/create-field-validation.d.ts.map +0 -1
- package/dist/types/form/create-form.d.ts +0 -66
- package/dist/types/form/create-form.d.ts.map +0 -1
- package/dist/types/form/create-submit-pipeline.d.ts +0 -58
- package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
- package/dist/types/form/get-step-fields.d.ts +0 -5
- package/dist/types/form/get-step-fields.d.ts.map +0 -1
- package/dist/types/form/index.d.ts +0 -10
- package/dist/types/form/index.d.ts.map +0 -1
- package/dist/types/plugins/create-experience/serialization.d.ts +0 -6
- package/dist/types/plugins/create-experience/serialization.d.ts.map +0 -1
- /package/dist/{id-CRqy981z.js → id-BniPxOdF.js} +0 -0
- /package/dist/{id-Bv44ilEo.cjs → id-CIbS4P60.cjs} +0 -0
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ExperienceStep } from '../../entities/step/step';
|
|
2
|
+
import { Field } from '../../entities/field/field';
|
|
3
|
+
import { ExperienceEdge, ExperienceNode, ExperienceAction, 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,50 @@ 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
|
+
/** Optional name of a pre-registered component to associate with this experience. */
|
|
26
|
+
componentName?: string;
|
|
27
|
+
/** IDs of features that gate this experience. */
|
|
28
|
+
featureIds?: string[];
|
|
29
|
+
nodes: ProjectConfigNode[];
|
|
30
|
+
edges: ExperienceEdge[];
|
|
31
|
+
actions?: ExperienceAction[];
|
|
32
|
+
/** Decision logic that controls whether this experience is initialised. */
|
|
33
|
+
condition?: LogicRule | LogicValue;
|
|
34
|
+
/** Logic that controls the initial open state of the experience. */
|
|
35
|
+
initializeOpen?: LogicRule | LogicValue;
|
|
36
|
+
/** DOM targets this experience mounts into. */
|
|
37
|
+
targets?: ExperienceTarget[];
|
|
38
|
+
}
|
|
8
39
|
export interface ProjectConfig {
|
|
40
|
+
id: string;
|
|
41
|
+
key: string;
|
|
42
|
+
name: string;
|
|
43
|
+
status: string;
|
|
44
|
+
versionId: string | null;
|
|
45
|
+
workspaceId: string;
|
|
9
46
|
features: ProjectConfigFeature[];
|
|
47
|
+
/** Experience definitions with steps and conditions referenced by ID. */
|
|
48
|
+
experiences?: ProjectConfigExperience[];
|
|
49
|
+
/** Global step definitions shared across experiences. */
|
|
50
|
+
steps?: ExperienceStep[];
|
|
51
|
+
/** Global field definitions shared across steps. */
|
|
52
|
+
fields?: Field[];
|
|
53
|
+
/** Global condition definitions referenced by experience flow nodes. */
|
|
54
|
+
conditions?: Condition[];
|
|
55
|
+
/** Action definitions (properties to be documented in future scope). */
|
|
56
|
+
actions?: unknown[];
|
|
10
57
|
}
|
|
11
58
|
export interface DynamicExperiencesPluginOptions {
|
|
12
59
|
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,E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A;IAC5B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAClC,oEAAoE;IACpE,cAAc,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACvC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,oBAAoB,EAAE,CAAA;IAChC,yEAAyE;IACzE,WAAW,CAAC,EAAE,uBAAuB,EAAE,CAAA;IACvC,yDAAyD;IACzD,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;IACxB,oDAAoD;IACpD,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,wEAAwE;IACxE,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;CACpB;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,6 @@
|
|
|
1
1
|
import { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
-
interface ExperienceBrowserStoragePlugin {
|
|
2
|
+
export interface ExperienceBrowserStoragePlugin {
|
|
3
3
|
storage?: 'local' | 'session';
|
|
4
4
|
}
|
|
5
5
|
export declare const experienceBrowserStoragePlugin: ({ storage, }?: ExperienceBrowserStoragePlugin) => Plugin;
|
|
6
|
-
export {};
|
|
7
6
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,8BAA8B,GAAI,eAE5C,8BAAmC,KAAG,MA6CxC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,2BAA2B,GAAI,eAEzC,2BAAgC,KAAG,MA4BrC,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
-
interface ResponsesBrowserStoragePlugin {
|
|
2
|
+
export interface ResponsesBrowserStoragePlugin {
|
|
3
3
|
storage?: 'local' | 'session';
|
|
4
4
|
}
|
|
5
5
|
export declare const responsesBrowserStoragePlugin: ({ storage, }?: ResponsesBrowserStoragePlugin) => Plugin;
|
|
6
|
-
export {};
|
|
7
6
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAkBD,eAAO,MAAM,6BAA6B,GAAI,eAE3C,6BAAkC,KAAG,MAsCvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,eAAO,MAAM,wBAAwB,QAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,eAAO,MAAM,wBAAwB,QAAO,MA2E3C,CAAA"}
|
|
@@ -26,7 +26,7 @@ interface SinglePageAppPluginOptions {
|
|
|
26
26
|
* })
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
export declare const singlePageAppPlugin: (
|
|
29
|
+
export declare const singlePageAppPlugin: (options: SinglePageAppPluginOptions) => Plugin;
|
|
30
30
|
export declare function instrumentHistory(callback: () => void): void;
|
|
31
31
|
export {};
|
|
32
32
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/single-page-app/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,0BAA0B;IAClC;;;;OAIG;IACH,iBAAiB,EAAE,IAAI,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,GAAI,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/single-page-app/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,0BAA0B;IAClC;;;;OAIG;IACH,iBAAiB,EAAE,IAAI,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,0BAA0B,KAAG,MAazE,CAAA;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAwC5D"}
|
|
@@ -14,6 +14,9 @@ export declare function createAppHosts(targets: (ExperienceTarget & {
|
|
|
14
14
|
elements: HTMLElement[];
|
|
15
15
|
})[], experienceId: string): HTMLElement[];
|
|
16
16
|
export declare function tagTargetElement(element: HTMLElement, experienceId: string): void;
|
|
17
|
+
export declare function isTaggedTarget(element: HTMLElement, experienceId?: string): boolean;
|
|
17
18
|
export declare function isPickedRoot(element: HTMLElement, experienceId?: string): boolean;
|
|
19
|
+
export declare function createPickedRoot(experienceId: string): HTMLDivElement;
|
|
20
|
+
export declare function createHostElement(target: HTMLElement | Document, placement: Placement, experienceId: string): HTMLElement;
|
|
18
21
|
export {};
|
|
19
22
|
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAGzE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CAQ7D;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,CAMhE;AAED,wBAAgB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAa9C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,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,iBAOrB;AAGD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAG1E;
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAGzE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CAQ7D;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,CAMhE;AAED,wBAAgB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAa9C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,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,iBAOrB;AAGD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAG1E;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,MAAM,WAMzE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,MAAM,WAMvE;AAED,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,kBAMpD;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,GAAG,QAAQ,EAC9B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,MAAM,eA+BrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createEvent, Store } 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":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,UAAU,CAAA;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,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,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,UAAU,EAAE,KAAK,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;IAC/B,cAAc,EAAE;QAAE,OAAO,EAAE,eAAe,CAAA;KAAE,CAAA;IAC5C,qBAAqB,EAAE;QAAE,UAAU,EAAE,kBAAkB,CAAA;KAAE,CAAA;IACzD,eAAe,EAAE;QAAE,UAAU,EAAE,kBAAkB,CAAA;KAAE,CAAA;IACnD,gBAAgB,EAAE;QAAE,UAAU,EAAE,kBAAkB,C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B,IAAI,EAAE,OAAO,CAAA;KACd,CAAA;CACF;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,UAAU,CAAA;AAE9C,MAAM,MAAM,eAAe,GAAG;KAC3B,CAAC,IAAI,eAAe,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,KAAK,GACxF,MAAM,GACN,UAAU,CAAC,CAAC,CAAC,CAAC;CACnB,CAAC,eAAe,CAAC,CAAA;AAElB,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,IAAI,CAAA;IACR,OAAO,EAAE,eAAe,CAAA;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAA;AAgB1D,eAAO,MAAM,kBAAkB,GAC7B,UAAU,UAAU,CAAC,OAAO,WAAW,CAAC,eAAe,CAAC,CAAC,KACxD,iBAoBF,CAAA"}
|
|
@@ -6,5 +6,6 @@ interface InternalGlobal {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const GLOBAL_OBJ: typeof globalThis & InternalGlobal;
|
|
8
8
|
export declare const bindClient: (client: Picked) => void;
|
|
9
|
+
export declare const getBoundClient: () => Picked;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=global-obj.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-obj.d.ts","sourceRoot":"","sources":["../../../src/utils/global-obj.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,QAAA,MAAM,YAAY,eAAmB,CAAA;AAErC,UAAU,cAAc;IACtB,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAGD,eAAO,MAAM,UAAU,EAAiB,OAAO,UAAU,GAAG,cAAc,CAAA;AAE1E,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,SAExC,CAAA"}
|
|
1
|
+
{"version":3,"file":"global-obj.d.ts","sourceRoot":"","sources":["../../../src/utils/global-obj.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,QAAA,MAAM,YAAY,eAAmB,CAAA;AAErC,UAAU,cAAc;IACtB,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAGD,eAAO,MAAM,UAAU,EAAiB,OAAO,UAAU,GAAG,cAAc,CAAA;AAE1E,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,SAExC,CAAA;AAED,eAAO,MAAM,cAAc,QAAO,MAMjC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface IndexedDBConfig {
|
|
1
|
+
export interface IndexedDBConfig {
|
|
2
2
|
storeName: string;
|
|
3
3
|
version?: number;
|
|
4
4
|
keyPath?: string | null;
|
|
@@ -8,5 +8,4 @@ export declare function getAllItems<T>(db: IDBDatabase, storeName: string): Prom
|
|
|
8
8
|
export declare function setItem<T>(db: IDBDatabase, storeName: string, value: T): Promise<void>;
|
|
9
9
|
export declare function clearItem(db: IDBDatabase, storeName: string, key: string): Promise<void>;
|
|
10
10
|
export declare function clearAllItems(db: IDBDatabase, storeName: string): Promise<void>;
|
|
11
|
-
export {};
|
|
12
11
|
//# sourceMappingURL=indexed-db.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexed-db.d.ts","sourceRoot":"","sources":["../../../src/utils/indexed-db.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"indexed-db.d.ts","sourceRoot":"","sources":["../../../src/utils/indexed-db.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAID,wBAAsB,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAgB1E;AAED,wBAAsB,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAQrF;AAED,wBAAsB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ5F;AAED,wBAAsB,SAAS,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9F;AAED,wBAAsB,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQrF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @file Utility for converting human-readable names to kebab-case keys. */
|
|
2
|
+
/**
|
|
3
|
+
* Converts a human-readable name to a kebab-case key.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} name - The display name to convert (e.g. 'Email Address').
|
|
6
|
+
* @returns {string} Kebab-case key (e.g. 'email-address').
|
|
7
|
+
* @example
|
|
8
|
+
* nameToKey('Email Address') // 'email-address'
|
|
9
|
+
* nameToKey('Lead Capture') // 'lead-capture'
|
|
10
|
+
*/
|
|
11
|
+
export declare function nameToKey(name: string): string;
|
|
12
|
+
//# sourceMappingURL=key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../src/utils/key.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EACxC,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAClC,IAKF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"min-max-steps-to-leaf.d.ts","sourceRoot":"","sources":["../../../../src/utils/node-tree/min-max-steps-to-leaf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"min-max-steps-to-leaf.d.ts","sourceRoot":"","sources":["../../../../src/utils/node-tree/min-max-steps-to-leaf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AA6D1F;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,cAAc,EAAE,EACvB,OAAO,cAAc,EAAE,EACvB,aAAa,cAAc,KAC1B,CAAC,MAAM,EAAE,MAAM,CAEjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"min-max-steps-to-origin.d.ts","sourceRoot":"","sources":["../../../../src/utils/node-tree/min-max-steps-to-origin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"min-max-steps-to-origin.d.ts","sourceRoot":"","sources":["../../../../src/utils/node-tree/min-max-steps-to-origin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AA8D1F;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAClC,OAAO,cAAc,EAAE,EACvB,OAAO,cAAc,EAAE,EACvB,aAAa,cAAc,KAC1B,CAAC,MAAM,EAAE,MAAM,CAEjB,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ExperienceEdge, ExperienceNode } from '../../entities/experience/experience';
|
|
2
2
|
/**
|
|
3
3
|
* Given the current Node as the starting point, recursively traverses every branch
|
|
4
|
-
* of the tree until encountering nodes with
|
|
5
|
-
* Does not progress past a node with a
|
|
4
|
+
* of the tree until encountering nodes with stepKey properties.
|
|
5
|
+
* Does not progress past a node with a stepKey.
|
|
6
6
|
*
|
|
7
7
|
* @param nodes - Array of all nodes in the tree
|
|
8
8
|
* @param edges - Array of all edges connecting the nodes
|
|
9
9
|
* @param currentNode - The starting node for traversal
|
|
10
|
-
* @returns Array of nodes with
|
|
10
|
+
* @returns Array of nodes with stepKey properties that are descendants of the current node
|
|
11
11
|
*/
|
|
12
12
|
export declare const nextReachableStepNodes: (nodes: ExperienceNode[], edges: ExperienceEdge[], currentNode: ExperienceNode) => ExperienceNode[];
|
|
13
13
|
//# sourceMappingURL=next-reachable-step-nodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-reachable-step-nodes.d.ts","sourceRoot":"","sources":["../../../../src/utils/node-tree/next-reachable-step-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"next-reachable-step-nodes.d.ts","sourceRoot":"","sources":["../../../../src/utils/node-tree/next-reachable-step-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAwC1F;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,cAAc,EAAE,EACvB,OAAO,cAAc,EAAE,EACvB,aAAa,cAAc,KAC1B,cAAc,EAEhB,CAAA"}
|
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function isConditionNode(node: ExperienceNode): node is
|
|
1
|
+
import { ConditionNode, ExperienceNode, LaunchExperienceNode, OriginNode, StepNode, ActionNode } from '../entities/experience/experience';
|
|
2
|
+
export declare function isConditionNode(node: ExperienceNode): node is ConditionNode;
|
|
3
3
|
export declare function isStepNode(node: ExperienceNode): node is StepNode;
|
|
4
4
|
export declare function isLaunchExperienceNode(node: ExperienceNode): node is LaunchExperienceNode;
|
|
5
5
|
export declare function isOriginNode(node: ExperienceNode): node is OriginNode;
|
|
6
6
|
export declare function isActionNode(node: ExperienceNode): node is ActionNode;
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the step key from a StepNode, falling back to the deprecated `stepId`
|
|
9
|
+
* for backwards compatibility with production projects that have not migrated yet.
|
|
10
|
+
*
|
|
11
|
+
* @param node - The step node to resolve the key from.
|
|
12
|
+
* @returns The step key string.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* resolveStepKey({ id: 'n1', type: 'step', stepKey: 'welcome' }) // 'welcome'
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveStepKey(node: StepNode): string;
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the condition ID from a ConditionNode.
|
|
21
|
+
*
|
|
22
|
+
* @param node - The condition node to resolve the ID from.
|
|
23
|
+
* @returns The condition ID string.
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* resolveConditionId({ id: 'n1', type: 'condition', conditionId: 'cond-1' }) // 'cond-1'
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveConditionId(node: ConditionNode): string;
|
|
7
30
|
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/utils/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/utils/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,UAAU,EACX,MAAM,mCAAmC,CAAA;AAE1C,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,aAAa,CAE3E;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,QAAQ,CAEjE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,oBAAoB,CAEzF;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,UAAU,CAErE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,UAAU,CAErE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAGrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAE9D"}
|
|
@@ -34,6 +34,14 @@ export declare function addNonEnumerableProperty(obj: object, name: string, valu
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function wrapFunction<F extends Function>(wrapped: F, original: F): void;
|
|
36
36
|
export declare function isWrappedFunction(fn: unknown): fn is WrappedFunction;
|
|
37
|
+
/**
|
|
38
|
+
* Gets a property from an object using a dot-separated path.
|
|
39
|
+
*
|
|
40
|
+
* @param obj the object to get the property from
|
|
41
|
+
* @param path the path to the property
|
|
42
|
+
* @param defaultValue the default value to return if the property is not found
|
|
43
|
+
*/
|
|
44
|
+
export declare function get<T = any, D = any>(obj: Record<string, any> | undefined, path: string, defaultValue?: D): T | D;
|
|
37
45
|
/**
|
|
38
46
|
* Checks if an object is empty (has no own enumerable properties).
|
|
39
47
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/utils/object.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,GAAG;IAC/D,iBAAiB,EAAE,CAAC,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/utils/object.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,GAAG;IAC/D,iBAAiB,EAAE,CAAC,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,CAAC,SAAS,MAAM,CAAC,EAC7E,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,CAAC,EACP,kBAAkB,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAC5C,IAAI,CAiBN;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAOxF;AAED;;;;;;GAMG;AAEH,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,CAI9E;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,eAAe,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAClC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EACpC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,CAAC,GACf,CAAC,GAAG,CAAC,CAMP;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQpE"}
|
|
@@ -4,7 +4,7 @@ declare global {
|
|
|
4
4
|
pickedConfig?: Partial<CreateClientOptions>;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
export declare function getPickedConfig<ExtendedPickedConfig extends Record<string,
|
|
7
|
+
export declare function getPickedConfig<ExtendedPickedConfig extends Record<string, any> | undefined>(): Readonly<Partial<CreateClientOptions> & ExtendedPickedConfig> | undefined;
|
|
8
8
|
export declare function getCreateClientIds(options: CreateClientOptions): {
|
|
9
9
|
organizationId: string;
|
|
10
10
|
projectId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked-config.d.ts","sourceRoot":"","sources":["../../../src/utils/picked-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAGpD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;KAC5C;CACF;AAED,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"picked-config.d.ts","sourceRoot":"","sources":["../../../src/utils/picked-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAGpD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;KAC5C;CACF;AAED,wBAAgB,eAAe,CAAC,oBAAoB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,+EAS3F;AAoCD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG;IAChE,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;CAClB,CAuBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-params.d.ts","sourceRoot":"","sources":["../../../src/utils/search-params.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;CACpC;AAED,wBAAgB,eAAe,IAAI,kBAAkB,
|
|
1
|
+
{"version":3,"file":"search-params.d.ts","sourceRoot":"","sources":["../../../src/utils/search-params.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;CACpC;AAED,wBAAgB,eAAe,IAAI,kBAAkB,CAgCpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/utils/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAE7F;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC;;;;;;;;;;;OAWG;IACH,KAAK,EAAE,MAAM,OAAO,CAAA;IAEpB;;;;;;;;;OASG;I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B,UAAU;IAIhC;;;;;;;;;;;;;;;OAeG;aACM,UAAU,SAAS,OAAO,cAAc,MAAM;IAIvD;;;;;;;;;;OAUG;gBACS,UAAU;IAItB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;cACO,CAAC,iBAAiB,UAAU,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI;CAGlF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/client",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1774244905386",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@withease/factories": "^1.0.5"
|
|
6
6
|
},
|
|
@@ -88,12 +88,6 @@
|
|
|
88
88
|
"import": "./dist/esm/plugins/dynamic-experiences/index.js",
|
|
89
89
|
"require": "./dist/cjs/plugins/dynamic-experiences/index.js",
|
|
90
90
|
"default": "./dist/esm/plugins/dynamic-experiences/index.js"
|
|
91
|
-
},
|
|
92
|
-
"./form": {
|
|
93
|
-
"types": "./dist/types/form/index.d.ts",
|
|
94
|
-
"import": "./dist/esm/form/index.js",
|
|
95
|
-
"require": "./dist/cjs/form/index.js",
|
|
96
|
-
"default": "./dist/esm/form/index.js"
|
|
97
91
|
}
|
|
98
92
|
},
|
|
99
93
|
"files": [
|
|
@@ -171,10 +165,6 @@
|
|
|
171
165
|
{
|
|
172
166
|
"path": "dist/esm/plugins/web-components/index.js",
|
|
173
167
|
"limit": "10 kB"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"path": "dist/esm/form/index.js",
|
|
177
|
-
"limit": "5 kB"
|
|
178
168
|
}
|
|
179
169
|
],
|
|
180
170
|
"type": "module",
|
package/dist/cjs/form/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../rules-logic-CXr4wXcG.cjs`);let t=require(`effector`);function n(e,t,n){let r=e[t];if(r===void 0){e[t]=n;return}if(Array.isArray(r)&&Array.isArray(n)&&n.length>0){typeof r[0]==`string`?e[t]=[...r,...n].map(String):typeof r[0]==`number`?e[t]=[...r,...n].map(Number):typeof r[0]==`boolean`?e[t]=[...r,...n].map(e=>!!e):e[t]=n;return}e[t]=n}function r(e,t){let r=Array.from(t.entries()),i={};return e.forEach(e=>{let t=r.filter(([t])=>t===e.id);t.length===0&&(t=[[e.id,``]]),t.forEach(([,t])=>{if(t===``){n(i,e.id,null);return}switch(e.type){case`text`:case`object`:n(i,e.id,e.multiple?[String(t)]:String(t));break;case`number`:n(i,e.id,e.multiple?[Number(t)]:Number(t));break;case`boolean`:n(i,e.id,e.multiple?[t===`true`]:t===`true`);break}})}),i}function i(e){return Array.isArray(e.options)&&e.options.some(e=>`condition`in e)}function a(e){return e.some(e=>e.condition||i(e))}async function o(t,n,r){return n.length===0||!a(n)?n:(await Promise.all(n.map(async n=>{if(!(!n.condition||await e.t(t,n.condition,r)))return null;if(!Array.isArray(n.options)||!i(n))return n;let a=(await Promise.all(n.options.map(async n=>n.condition?await e.t(t,n.condition,r)?n:null:n))).filter(e=>e!==null);return a.length===n.options.length?n:a.length===0?null:{...n,options:a}}))).filter(e=>e!==null)}function s(e,n,r){let i=(0,t.createStore)([]),a=(0,t.attach)({source:{allFields:e.fields.listStore,fieldIds:n,staged:r,committed:e.responses.getAllStore},effect:(0,t.createEffect)(async({allFields:t,fieldIds:n,staged:r,committed:i})=>await o(e,t.filter(e=>n.includes(e.id)),{responses:{...i,...r}}))});return(0,t.sample)({clock:a.doneData,target:i}),a(),(0,t.sample)({clock:[e.responses.listStore,n,e.fields.listStore,r],target:a}),{fieldsStore:i}}function c(e){return e===null||e===``||Array.isArray(e)&&e.length===0}function l(n,r,i){let a=(0,t.createEvent)(),o=(0,t.createEvent)(),s=(0,t.createStore)({});(0,t.sample)({clock:o,source:s,fn:(e,{fieldId:t})=>({...e,[t]:!0}),target:s});let l=(0,t.createStore)({}),u=l.map(e=>Object.values(e).filter(e=>e!==void 0)),d=(0,t.attach)({source:{fields:r,staged:i,committed:n.responses.getAllStore},effect:async({fields:t,staged:r,committed:i},{fieldId:a,value:o,checkRequired:s})=>{let l=t.find(e=>e.id===a);if(!l)return{fieldId:a,error:null};if(l.validation&&Object.keys(l.validation).length>0){let t={...i,...r},s=await e.t(n,l.validation,{responses:t,$input:o});if(typeof s==`string`)return{fieldId:a,error:{fieldId:a,userMessage:s,systemMessage:s,value:o}};if(s===!1)return{fieldId:a,error:{fieldId:a,userMessage:`This field is invalid`,systemMessage:`Field validation rule returned false.`,value:o}}}return s&&l.required&&c(o)?{fieldId:a,error:{fieldId:a,userMessage:`This field is required`,systemMessage:`Field is required.`,value:o}}:{fieldId:a,error:null}}});return(0,t.sample)({clock:a,source:s,filter:(e,{fieldId:t})=>e[t]===!0,fn:(e,{fieldId:t,value:n})=>({fieldId:t,value:n,checkRequired:!1}),target:d}),(0,t.sample)({clock:o,fn:({fieldId:e,value:t})=>({fieldId:e,value:t,checkRequired:!0}),target:d}),i.on(a,(e,{fieldId:t,value:n})=>({...e,[t]:n})),i.on(o,(e,{fieldId:t,value:n})=>({...e,[t]:n})),l.on(d.doneData,(e,{fieldId:t,error:n})=>{if(n===null){let n={...e};return delete n[t],n}return{...e,[t]:n}}),{fieldChangeEvent:a,fieldBlurEvent:o,touchedStore:s,fieldErrorsStore:l,formErrorsStore:u,stagedValuesStore:i}}function u(e){let n=[];return{executeFx:(0,t.createEffect)(async(...t)=>await e(n,...t)),register:e=>(n.push(e),()=>{n=n.filter(t=>t!==e)})}}function d({client:e,experienceInstance:n,formId:i,title:a,stepStore:o,fieldsStore:s,goToNextStep:c}){let l=(0,t.createEvent)(),d=(0,t.createEvent)(),f=(0,t.createEvent)(),p=(0,t.createEvent)(),m=(0,t.createEvent)(),h=(0,t.createStore)(!1),g=(0,t.createStore)(!1);g.on(p,()=>!0).on(l,()=>!1);let _=l.map(()=>void 0),v=u(async(e,t)=>{await Promise.all(e.map(e=>Promise.resolve(e(t))))}),y=u(async(e,t)=>{await Promise.all(e.map(e=>Promise.resolve(e(t))))}),b=u(async(e,t)=>{let n=t;for(let t of e){let e=await Promise.resolve(t(n));e!==void 0&&(n=e)}return n}),x=(0,t.createEffect)(async t=>({data:t,errors:(await e.responses.commit(t)).errors})),S=(0,t.attach)({source:{step:o,title:a},mapParams:(e,t)=>({step:t.step,title:t.title,data:e.data}),effect:(0,t.createEffect)(async({step:t,title:r,data:a})=>(e.eventBus({type:`form_submit_success`,form:{id:i,title:r},experience:n,step:t??void 0}),a))}),C=(0,t.attach)({source:{step:o,title:a},mapParams:(e,t)=>({step:t.step,title:t.title,errors:e.errors}),effect:(0,t.createEffect)(async({step:t,title:r,errors:a})=>(e.eventBus({type:`form_submit_error`,form:{id:i,title:r},exception:{reason:a},experience:n,step:t??void 0}),a.forEach(r=>{e.eventBus({type:`field_validation_error`,exception:{reason:[r]},experience:n,step:t??void 0})}),a))});return(0,t.sample)({clock:l,fn:()=>!0,target:h}),(0,t.sample)({clock:l,source:{step:o,title:a},fn:({step:e,title:t})=>({formId:i,title:t,step:e}),target:(0,t.createEffect)(({formId:t,title:r,step:i})=>{e.eventBus({type:`form_submit`,form:{id:t,title:r},experience:n,step:i??void 0})})}),(0,t.sample)({clock:l,source:{stepFields:s},fn:({stepFields:e},t)=>(t.preventDefault(),r(e,new FormData(t.currentTarget))),target:b.executeFx}),(0,t.sample)({clock:b.executeFx.doneData,target:x}),(0,t.split)({source:x.doneData,match:{hasErrors:({errors:e})=>e.length>0},cases:{hasErrors:C,__:S}}),(0,t.sample)({clock:S.doneData,target:d}),(0,t.sample)({clock:d,fn:e=>({data:e,stopNavigation:p}),target:v.executeFx}),(0,t.sample)({clock:v.executeFx.done,target:m}),(0,t.sample)({clock:m,source:g,filter:e=>!e,target:c}),(0,t.sample)({clock:C.doneData,target:f}),(0,t.sample)({clock:f,target:y.executeFx}),(0,t.sample)({clock:[m,y.executeFx.done],fn:()=>!1,target:h}),{submitEvent:l,isFormSubmitting:h,onSubmit:b.register,onSuccess:v.register,onError:y.register,submitStarted:_,validationErrorsReceived:f}}function f(e){let t=e.currentTarget;if(t instanceof HTMLInputElement)return t.type===`checkbox`?t.checked:t.value;if(t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement)return t.value}function p(e,n,r,i){let{client:a,experienceInstance:o}=e,{currentStepStore:c,goToNextStep:u}=o,p=(0,t.createStore)({}),{fieldsStore:m}=s(a,i,p),{fieldChangeEvent:h,fieldBlurEvent:g,touchedStore:_,fieldErrorsStore:v,formErrorsStore:y}=l(a,m,p),b=(0,t.combine)({fields:m,responses:a.responses.listStore,staged:p,fieldErrors:v,touched:_},({fields:e,responses:t,staged:n,fieldErrors:r,touched:i})=>e.map(e=>{let a=t=>{let n=f(t);n!==void 0&&h({fieldId:e.id,value:n})},o=t=>{let n=f(t);n!==void 0&&g({fieldId:e.id,value:n})};return{...e,value:n[e.id]??t.find(t=>t.fieldId===e.id)?.value,error:r[e.id],touched:i[e.id]??!1,onChange:a,onBlur:o,props:{name:e.id,id:e.id,oninput:a,onblur:o}}})),{submitEvent:x,isFormSubmitting:S,onSubmit:C,onSuccess:w,onError:T,submitStarted:E,validationErrorsReceived:D}=d({client:a,experienceInstance:o,formId:n,title:r,stepStore:c,fieldsStore:m,goToNextStep:u});return(0,t.sample)({clock:E,fn:()=>({}),target:_}),(0,t.sample)({clock:E,fn:()=>({}),target:v}),(0,t.sample)({clock:D,fn:e=>Object.fromEntries(e.map(e=>[e.fieldId,e])),target:v}),{form:{props:{onsubmit:x},errors:y,submitting:S,onSubmit:C,onSuccess:w,onError:T},fields:b}}exports.buildResponsesFromFormData=r,exports.createFieldEvaluator=s,exports.createFieldValidation=l,exports.createForm=p,exports.createSubmitPipeline=d,exports.getEventValue=f,exports.getStepFields=o;
|