@picked/client 0.0.48-next.1 → 0.0.49-next.1
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-DlWmrA8P.js +32 -0
- package/dist/api-sPUT21Vf.cjs +1 -0
- 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/esm/index.js +422 -415
- package/dist/esm/plugins/create-experience/index.js +54 -60
- package/dist/esm/plugins/dynamic-experiences/index.js +63 -41
- package/dist/types/client.d.ts +13 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +24 -9
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/picked.d.ts +4 -2
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +0 -3
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +1 -0
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +2 -2
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +4 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/utils/api.d.ts +1 -1
- package/dist/types/utils/api.d.ts.map +1 -1
- package/dist/types/utils/client-headers.d.ts +2 -0
- package/dist/types/utils/client-headers.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/api-CbXfbi_s.js +0 -19
- package/dist/api-DzSCgBQ2.cjs +0 -1
|
@@ -6,67 +6,65 @@ const r = {
|
|
|
6
6
|
deserialize(e) {
|
|
7
7
|
return JSON.parse(e);
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, v = (e) => ({
|
|
10
10
|
name: "create-experience",
|
|
11
|
-
setup: (
|
|
11
|
+
setup: (d) => {
|
|
12
12
|
e.experiences.forEach((s) => {
|
|
13
|
-
const n = s.serialize(),
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const n = s.serialize(), o = r.deserialize(n);
|
|
14
|
+
o.component = s.component, d.registerExperience(o), o.fields.forEach((N) => {
|
|
15
|
+
d.registerField(N);
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
}), y = (e,
|
|
19
|
+
}), y = (e, d) => ({
|
|
20
20
|
id: f("node"),
|
|
21
|
-
|
|
22
|
-
experience: o,
|
|
21
|
+
experience: d,
|
|
23
22
|
type: "action",
|
|
24
23
|
action: e.action,
|
|
25
24
|
addNext(n) {
|
|
26
25
|
if (!n.node) throw new Error("Cannot connect to node");
|
|
27
|
-
const
|
|
26
|
+
const o = h(
|
|
28
27
|
{ sourceNode: this, destinationNode: n.node, sourceNodeHandle: null },
|
|
29
|
-
|
|
28
|
+
d
|
|
30
29
|
);
|
|
31
|
-
|
|
30
|
+
d.edges.push(o);
|
|
32
31
|
},
|
|
33
32
|
onSuccess(n) {
|
|
34
33
|
if (!n.node) throw new Error("Cannot connect to node");
|
|
35
|
-
const
|
|
34
|
+
const o = h(
|
|
36
35
|
{ sourceNode: this, destinationNode: n.node, sourceNodeHandle: "true" },
|
|
37
|
-
|
|
36
|
+
d
|
|
38
37
|
);
|
|
39
|
-
|
|
38
|
+
d.edges.push(o);
|
|
40
39
|
},
|
|
41
40
|
onFail(n) {
|
|
42
41
|
if (!n.node) throw new Error("Cannot connect to node");
|
|
43
|
-
const
|
|
42
|
+
const o = h(
|
|
44
43
|
{ sourceNode: this, destinationNode: n.node, sourceNodeHandle: "false" },
|
|
45
|
-
|
|
44
|
+
d
|
|
46
45
|
);
|
|
47
|
-
|
|
46
|
+
d.edges.push(o);
|
|
48
47
|
},
|
|
49
48
|
serialize() {
|
|
50
49
|
return r.serialize({
|
|
51
50
|
id: this.id,
|
|
52
51
|
type: this.type,
|
|
53
|
-
action: this.action
|
|
54
|
-
position: this.position
|
|
52
|
+
action: this.action
|
|
55
53
|
});
|
|
56
54
|
}
|
|
57
|
-
}),
|
|
55
|
+
}), x = (e) => ({
|
|
58
56
|
id: e.id ?? f("step"),
|
|
59
57
|
label: e.label,
|
|
60
58
|
fields: e.fields ?? [],
|
|
61
|
-
addField(
|
|
62
|
-
const s = "serialize" in
|
|
63
|
-
return this.fields
|
|
59
|
+
addField(d) {
|
|
60
|
+
const s = "serialize" in d ? d : m(d);
|
|
61
|
+
return this.fields.includes(s) || this.fields.push(s), s;
|
|
64
62
|
}
|
|
65
|
-
}), z = (e,
|
|
63
|
+
}), z = (e, d) => {
|
|
66
64
|
const s = {
|
|
67
65
|
id: e.id ?? f("step"),
|
|
68
66
|
label: e.label,
|
|
69
|
-
experience:
|
|
67
|
+
experience: d,
|
|
70
68
|
fields: e.fields ?? [],
|
|
71
69
|
node: null,
|
|
72
70
|
nextStep(n) {
|
|
@@ -89,15 +87,14 @@ const r = {
|
|
|
89
87
|
});
|
|
90
88
|
}
|
|
91
89
|
};
|
|
92
|
-
return p({ step: s, type: "step" },
|
|
93
|
-
},
|
|
90
|
+
return p({ step: s, type: "step" }, d), s;
|
|
91
|
+
}, p = (e, d) => {
|
|
94
92
|
const s = {
|
|
95
93
|
id: f("node"),
|
|
96
|
-
|
|
97
|
-
experience: o
|
|
94
|
+
experience: d
|
|
98
95
|
};
|
|
99
96
|
if (e.type === "step") {
|
|
100
|
-
const
|
|
97
|
+
const o = {
|
|
101
98
|
...s,
|
|
102
99
|
type: "step",
|
|
103
100
|
connectedStep: e.step,
|
|
@@ -106,15 +103,14 @@ const r = {
|
|
|
106
103
|
id: this.id,
|
|
107
104
|
type: this.type,
|
|
108
105
|
stepId: this.connectedStep.id,
|
|
109
|
-
position: this.position,
|
|
110
106
|
label: this.connectedStep.label
|
|
111
107
|
});
|
|
112
108
|
}
|
|
113
109
|
};
|
|
114
|
-
return
|
|
110
|
+
return o.connectedStep.node = o, o;
|
|
115
111
|
}
|
|
116
112
|
if (e.type === "conditional") {
|
|
117
|
-
const
|
|
113
|
+
const o = {
|
|
118
114
|
...s,
|
|
119
115
|
type: "conditional",
|
|
120
116
|
connectedConditional: e.conditional,
|
|
@@ -122,12 +118,11 @@ const r = {
|
|
|
122
118
|
return r.serialize({
|
|
123
119
|
id: this.id,
|
|
124
120
|
type: this.type,
|
|
125
|
-
conditionalId: this.connectedConditional.id
|
|
126
|
-
position: this.position
|
|
121
|
+
conditionalId: this.connectedConditional.id
|
|
127
122
|
});
|
|
128
123
|
}
|
|
129
124
|
};
|
|
130
|
-
return
|
|
125
|
+
return o.connectedConditional.node = o, o;
|
|
131
126
|
}
|
|
132
127
|
return e.type === "experience" ? {
|
|
133
128
|
...s,
|
|
@@ -137,8 +132,7 @@ const r = {
|
|
|
137
132
|
return r.serialize({
|
|
138
133
|
id: this.id,
|
|
139
134
|
type: this.type,
|
|
140
|
-
experienceId: this.connectedExperience.id
|
|
141
|
-
position: this.position
|
|
135
|
+
experienceId: this.connectedExperience.id
|
|
142
136
|
});
|
|
143
137
|
}
|
|
144
138
|
} : {
|
|
@@ -147,17 +141,16 @@ const r = {
|
|
|
147
141
|
serialize() {
|
|
148
142
|
return r.serialize({
|
|
149
143
|
id: this.id,
|
|
150
|
-
type: this.type
|
|
151
|
-
position: this.position
|
|
144
|
+
type: this.type
|
|
152
145
|
});
|
|
153
146
|
}
|
|
154
147
|
};
|
|
155
|
-
}, h = (e,
|
|
148
|
+
}, h = (e, d) => ({
|
|
156
149
|
id: f("edge"),
|
|
157
150
|
sourceNode: e.sourceNode,
|
|
158
151
|
sourceNodeHandle: e.sourceNodeHandle,
|
|
159
152
|
destinationNode: e.destinationNode,
|
|
160
|
-
experience:
|
|
153
|
+
experience: d,
|
|
161
154
|
serialize() {
|
|
162
155
|
return r.serialize({
|
|
163
156
|
id: this.id,
|
|
@@ -166,30 +159,30 @@ const r = {
|
|
|
166
159
|
destinationNodeId: this.destinationNode.id
|
|
167
160
|
});
|
|
168
161
|
}
|
|
169
|
-
}),
|
|
162
|
+
}), g = (e, d) => {
|
|
170
163
|
const s = {
|
|
171
164
|
id: f("conditional"),
|
|
172
165
|
label: e.label,
|
|
173
166
|
condition: e.condition,
|
|
174
167
|
node: null,
|
|
175
|
-
experience:
|
|
168
|
+
experience: d,
|
|
176
169
|
addTrue(n) {
|
|
177
170
|
if (!this.node || !n.node)
|
|
178
171
|
throw new Error("todo no node");
|
|
179
|
-
const
|
|
172
|
+
const o = h(
|
|
180
173
|
{ sourceNode: this.node, destinationNode: n.node, sourceNodeHandle: "true" },
|
|
181
174
|
this.experience
|
|
182
175
|
);
|
|
183
|
-
this.experience.edges.push(
|
|
176
|
+
this.experience.edges.push(o);
|
|
184
177
|
},
|
|
185
178
|
addFalse(n) {
|
|
186
179
|
if (!this.node || !n.node)
|
|
187
180
|
throw new Error("todo no node");
|
|
188
|
-
const
|
|
181
|
+
const o = h(
|
|
189
182
|
{ sourceNode: this.node, destinationNode: n.node, sourceNodeHandle: "false" },
|
|
190
183
|
this.experience
|
|
191
184
|
);
|
|
192
|
-
this.experience.edges.push(
|
|
185
|
+
this.experience.edges.push(o);
|
|
193
186
|
},
|
|
194
187
|
serialize() {
|
|
195
188
|
return r.serialize({
|
|
@@ -199,7 +192,7 @@ const r = {
|
|
|
199
192
|
});
|
|
200
193
|
}
|
|
201
194
|
};
|
|
202
|
-
return p({ conditional: s, type: "conditional" },
|
|
195
|
+
return p({ conditional: s, type: "conditional" }, d), s;
|
|
203
196
|
}, m = (e) => ({
|
|
204
197
|
id: e.id,
|
|
205
198
|
name: e.name,
|
|
@@ -218,6 +211,7 @@ const r = {
|
|
|
218
211
|
...s
|
|
219
212
|
})) ?? null,
|
|
220
213
|
policies: e.policies,
|
|
214
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- this function handles all field types and subtypes; splitting it would increase indirection without improving clarity. Addressed in PR #1372
|
|
221
215
|
serialize() {
|
|
222
216
|
const s = {
|
|
223
217
|
id: this.id,
|
|
@@ -230,7 +224,7 @@ const r = {
|
|
|
230
224
|
validation: this.validation,
|
|
231
225
|
condition: this.condition,
|
|
232
226
|
policies: this.policies
|
|
233
|
-
}, n = typeof this.defaultValue == "string" ? this.defaultValue : void 0,
|
|
227
|
+
}, n = typeof this.defaultValue == "string" ? this.defaultValue : void 0, o = typeof this.defaultValue == "number" ? this.defaultValue : void 0, N = typeof this.defaultValue == "boolean" ? this.defaultValue : void 0;
|
|
234
228
|
switch (this.type) {
|
|
235
229
|
case "text":
|
|
236
230
|
if (this.multiple) {
|
|
@@ -292,7 +286,7 @@ const r = {
|
|
|
292
286
|
...s,
|
|
293
287
|
type: "number",
|
|
294
288
|
multiple: !1,
|
|
295
|
-
defaultValue:
|
|
289
|
+
defaultValue: o,
|
|
296
290
|
options: this.options ? this.options.map((t) => ({
|
|
297
291
|
id: t.id,
|
|
298
292
|
label: t.label,
|
|
@@ -364,8 +358,8 @@ const r = {
|
|
|
364
358
|
throw new Error("Unsupported field type");
|
|
365
359
|
}
|
|
366
360
|
}
|
|
367
|
-
}),
|
|
368
|
-
const
|
|
361
|
+
}), V = (e) => {
|
|
362
|
+
const d = [], s = [], n = [], o = [], N = [], t = e.condition ?? e.decide;
|
|
369
363
|
return {
|
|
370
364
|
id: e.id,
|
|
371
365
|
component: e.component,
|
|
@@ -374,11 +368,11 @@ const r = {
|
|
|
374
368
|
condition: t,
|
|
375
369
|
decide: e.decide,
|
|
376
370
|
targets: e.targets,
|
|
377
|
-
steps:
|
|
371
|
+
steps: d,
|
|
378
372
|
nodes: s,
|
|
379
373
|
edges: n,
|
|
380
374
|
fields: N,
|
|
381
|
-
conditionals:
|
|
375
|
+
conditionals: o,
|
|
382
376
|
addStep(i, u) {
|
|
383
377
|
let l = u?.node;
|
|
384
378
|
this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
|
|
@@ -412,7 +406,7 @@ const r = {
|
|
|
412
406
|
addConditional(i, u) {
|
|
413
407
|
let l = u?.node;
|
|
414
408
|
this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
|
|
415
|
-
const a = "serialize" in i ? i :
|
|
409
|
+
const a = "serialize" in i ? i : g(i, this);
|
|
416
410
|
if (l) {
|
|
417
411
|
if (!a.node)
|
|
418
412
|
throw new Error("todo no node");
|
|
@@ -465,12 +459,12 @@ const r = {
|
|
|
465
459
|
};
|
|
466
460
|
};
|
|
467
461
|
export {
|
|
468
|
-
|
|
462
|
+
g as createConditional,
|
|
469
463
|
h as createEdge,
|
|
470
|
-
|
|
471
|
-
|
|
464
|
+
V as createExperience,
|
|
465
|
+
v as createExperiencePlugin,
|
|
472
466
|
m as createField,
|
|
473
467
|
p as createNode,
|
|
474
|
-
|
|
468
|
+
x as createStep,
|
|
475
469
|
r as serialization
|
|
476
470
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as l } from "../../../api-DlWmrA8P.js";
|
|
2
|
+
import { c as S } from "../../../api-DlWmrA8P.js";
|
|
2
3
|
import { l as a } from "../../../logger-C9a75KZn.js";
|
|
3
4
|
function d(e) {
|
|
4
5
|
let r = 2166136261;
|
|
@@ -12,104 +13,125 @@ function p(e) {
|
|
|
12
13
|
function g(e, r) {
|
|
13
14
|
return r <= 0 ? !1 : r >= 100 ? !0 : e < r;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function h(e) {
|
|
16
17
|
return typeof e != "object" || e === null || !("id" in e && "name" in e && "enabled" in e && "weight" in e && "version" in e) ? !1 : typeof e.id == "string" && typeof e.name == "string" && typeof e.enabled == "boolean" && typeof e.weight == "number" && typeof e.version == "number";
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
return typeof e != "object" || e === null || !("features" in e) || !Array.isArray(e.features) ? !1 : e.features.every(
|
|
19
|
+
function f(e) {
|
|
20
|
+
return typeof e != "object" || e === null || !("features" in e) || !Array.isArray(e.features) ? !1 : e.features.every(h);
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function m(e) {
|
|
22
23
|
const r = e.searchParams["preview-token"];
|
|
23
24
|
if (r && r.length > 0)
|
|
24
25
|
return r[0];
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function w(e) {
|
|
27
28
|
const r = /* @__PURE__ */ new Set(), n = e.searchParams.feature;
|
|
28
29
|
if (!n)
|
|
29
30
|
return r;
|
|
30
|
-
for (const
|
|
31
|
-
const t =
|
|
32
|
-
t > 0 && r.add(
|
|
31
|
+
for (const o of n) {
|
|
32
|
+
const t = o.indexOf(":");
|
|
33
|
+
t > 0 && r.add(o.substring(0, t));
|
|
33
34
|
}
|
|
34
35
|
return r;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
37
|
+
function c(e, r, n) {
|
|
38
|
+
const o = w(e), t = e.session?.id;
|
|
38
39
|
if (!t)
|
|
39
40
|
throw new Error("Session ID is required for feature registration");
|
|
40
|
-
const
|
|
41
|
+
const i = p(t);
|
|
41
42
|
for (const s of r.features)
|
|
42
|
-
|
|
43
|
+
o.has(s.id) || y(e, s, n, i);
|
|
43
44
|
}
|
|
44
|
-
function y(e, r, n,
|
|
45
|
+
function y(e, r, n, o) {
|
|
45
46
|
e.registerFeature(r.id, {
|
|
46
47
|
key: `v${r.version}`,
|
|
47
48
|
name: r.name,
|
|
48
49
|
storage: n ? "session" : "local",
|
|
49
|
-
decide: () => r.enabled ? g(
|
|
50
|
+
decide: () => r.enabled ? g(o, r.weight) : !1
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
if (typeof __PICKED_PROJECT_CONFIG__ > "u")
|
|
54
|
-
return;
|
|
53
|
+
function v() {
|
|
55
54
|
let e;
|
|
56
|
-
|
|
55
|
+
try {
|
|
56
|
+
e = __PICKED_PROJECT_CONFIG__;
|
|
57
|
+
} catch {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (e === void 0)
|
|
61
|
+
return;
|
|
62
|
+
let r;
|
|
63
|
+
if (typeof e == "string")
|
|
57
64
|
try {
|
|
58
|
-
|
|
65
|
+
r = JSON.parse(e);
|
|
59
66
|
} catch {
|
|
60
67
|
a("warn", "Build-time project config is not valid JSON");
|
|
61
68
|
return;
|
|
62
69
|
}
|
|
63
70
|
else
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
return
|
|
71
|
+
r = e;
|
|
72
|
+
if (f(r))
|
|
73
|
+
return r;
|
|
67
74
|
a("warn", "Build-time project config has invalid shape, falling back to runtime fetch");
|
|
68
75
|
}
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
function j(e) {
|
|
77
|
+
try {
|
|
78
|
+
const r = new URL(e).hostname;
|
|
79
|
+
return r === "localhost" || r === "127.0.0.1" || r === "::1";
|
|
80
|
+
} catch {
|
|
81
|
+
return !1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function b(e) {
|
|
85
|
+
if (typeof e != "object" || e === null || !("cause" in e))
|
|
86
|
+
return !1;
|
|
87
|
+
const { cause: r } = e;
|
|
88
|
+
return typeof r != "object" || r === null || !("code" in r) ? !1 : r.code === "ECONNREFUSED";
|
|
89
|
+
}
|
|
90
|
+
async function u(e, r, n) {
|
|
91
|
+
const o = n?.previewToken ? `projects/${r}?preview_token=${encodeURIComponent(n.previewToken)}` : `projects/${r}`;
|
|
71
92
|
let t;
|
|
72
93
|
try {
|
|
73
|
-
t = await l(e,
|
|
94
|
+
t = await l(e, o, n?.headers);
|
|
74
95
|
} catch (s) {
|
|
75
|
-
return a("warn", "Failed to fetch project config", s), null;
|
|
96
|
+
return j(e) && b(s) || a("warn", "Failed to fetch project config", s), null;
|
|
76
97
|
}
|
|
77
98
|
if (!t.ok)
|
|
78
99
|
return a("warn", `Project config request failed with status ${t.status.toString()}`), null;
|
|
79
|
-
let
|
|
100
|
+
let i;
|
|
80
101
|
try {
|
|
81
|
-
|
|
102
|
+
i = await t.json();
|
|
82
103
|
} catch {
|
|
83
104
|
return a("warn", "Failed to parse project config response"), null;
|
|
84
105
|
}
|
|
85
|
-
return
|
|
106
|
+
return f(i) ? i : (a("warn", "Invalid project config response shape"), null);
|
|
86
107
|
}
|
|
87
|
-
function
|
|
108
|
+
function k(e) {
|
|
88
109
|
return {
|
|
89
110
|
name: "dynamic-experiences",
|
|
90
111
|
setup: (r) => {
|
|
91
112
|
const n = e?.apiUrl ?? r.apiUrl;
|
|
92
113
|
return {
|
|
93
114
|
onStart: async () => {
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
const s = await
|
|
97
|
-
s &&
|
|
115
|
+
const o = m(r);
|
|
116
|
+
if (o) {
|
|
117
|
+
const s = await u(n, r.projectId, { previewToken: o });
|
|
118
|
+
s && c(r, s, !0);
|
|
98
119
|
return;
|
|
99
120
|
}
|
|
100
|
-
const t = e?.projectConfig ??
|
|
121
|
+
const t = e?.projectConfig ?? v();
|
|
101
122
|
if (t) {
|
|
102
|
-
|
|
123
|
+
c(r, t, !1);
|
|
103
124
|
return;
|
|
104
125
|
}
|
|
105
|
-
const
|
|
106
|
-
|
|
126
|
+
const i = await u(n, r.projectId);
|
|
127
|
+
i && c(r, i, !1);
|
|
107
128
|
}
|
|
108
129
|
};
|
|
109
130
|
}
|
|
110
131
|
};
|
|
111
132
|
}
|
|
112
133
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
134
|
+
S as createClientHeaders,
|
|
135
|
+
k as dynamicExperiencesPlugin,
|
|
136
|
+
u as fetchProject
|
|
115
137
|
};
|
package/dist/types/client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Predicate } from './entities/predicate/predicate';
|
|
|
2
2
|
import { Action } from './entities/action/action';
|
|
3
3
|
import { Plugin } from './entities/plugin/plugin';
|
|
4
4
|
import { Feature } from './entities/feature/feature';
|
|
5
|
+
import { AdaptedComponent } from './entities/component/component';
|
|
5
6
|
import { LogicRule } from './logic-engine';
|
|
6
7
|
export interface CreateClientOptions {
|
|
7
8
|
/**
|
|
@@ -88,6 +89,18 @@ export interface CreateClientOptions {
|
|
|
88
89
|
````
|
|
89
90
|
*/
|
|
90
91
|
features?: Record<string, Feature | (() => Feature)>;
|
|
92
|
+
/**
|
|
93
|
+
* Register components for use in dynamic experiences
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* components: {
|
|
98
|
+
* HeroBanner: adaptedHeroBannerComponent,
|
|
99
|
+
* ProductCard: adaptedProductCardComponent,
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
components?: Record<string, AdaptedComponent>;
|
|
91
104
|
/**
|
|
92
105
|
* Evaluate a condition or boolean expression before initializing the client
|
|
93
106
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,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oB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAEtC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAEhC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,CAAA;IAEnE;;;;;;;;;;;;;;;OAeG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC,CAAA;IAEpD;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAE7C;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,SAAS,CAAA;IAExB;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB"}
|
|
@@ -33,6 +33,15 @@ declare const createExperienceFactory: ({ client, experience }: {
|
|
|
33
33
|
strategy: "override";
|
|
34
34
|
}>;
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Creates an Effector store for a single experience.
|
|
38
|
+
* @param params - The client instance and experience data.
|
|
39
|
+
* @returns An experience store with config, tree, fields, and component sub-stores.
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const store = createExperience({ client, experience })
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
36
45
|
export declare function createExperience<T extends Parameters<typeof createExperienceFactory>[0]>(params: T): ReturnType<typeof createExperienceFactory>;
|
|
37
46
|
/** Options for launching an experience. */
|
|
38
47
|
export interface LaunchExperienceOptions {
|
|
@@ -140,6 +149,15 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
140
149
|
}>;
|
|
141
150
|
}[]>;
|
|
142
151
|
};
|
|
152
|
+
/**
|
|
153
|
+
* Creates an Effector-based index for registering and retrieving experiences.
|
|
154
|
+
* @param params - The client instance.
|
|
155
|
+
* @returns An experience index with register, get, launch, and open methods.
|
|
156
|
+
* @example
|
|
157
|
+
* ```typescript
|
|
158
|
+
* const index = createExperienceIndex({ client })
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
143
161
|
export declare function createExperienceIndex<T extends Parameters<typeof createExperienceIndexFactory>[0]>(params: T): ReturnType<typeof createExperienceIndexFactory>;
|
|
144
162
|
export interface ExperienceStep {
|
|
145
163
|
id: string;
|
|
@@ -154,12 +172,10 @@ export interface ExperienceAction {
|
|
|
154
172
|
export interface ActionNode extends BaseNode {
|
|
155
173
|
type: 'action';
|
|
156
174
|
action: string;
|
|
157
|
-
position: [number, number];
|
|
158
175
|
}
|
|
159
176
|
export interface BaseNode {
|
|
160
177
|
id: string;
|
|
161
178
|
type: string;
|
|
162
|
-
position: [number, number];
|
|
163
179
|
}
|
|
164
180
|
export interface StepNode extends BaseNode {
|
|
165
181
|
type: 'step';
|
|
@@ -195,6 +211,7 @@ export interface ExperienceTarget {
|
|
|
195
211
|
export interface Experience {
|
|
196
212
|
id: string;
|
|
197
213
|
name: string;
|
|
214
|
+
componentName?: string;
|
|
198
215
|
component?: AdaptedComponent;
|
|
199
216
|
conditionals: ExperienceConditional[];
|
|
200
217
|
initializeOpen?: LogicRule | LogicValue;
|
|
@@ -210,16 +227,14 @@ export interface Experience {
|
|
|
210
227
|
}
|
|
211
228
|
export declare const setupExperience: (experience: Experience, experienceStore: ExperiencesListStore) => void;
|
|
212
229
|
/**
|
|
213
|
-
* Initializes an experience for each target that exists in the DOM
|
|
214
|
-
*
|
|
215
|
-
* @param
|
|
216
|
-
* @param experience
|
|
230
|
+
* Initializes an experience for each target that exists in the DOM.
|
|
231
|
+
* @param client - The Picked client instance.
|
|
232
|
+
* @param experience - The experience store to initialise.
|
|
217
233
|
*/
|
|
218
234
|
export declare const initialiseExperience: (client: Picked, experience: ExperienceStore, options?: LaunchExperienceOptions) => void;
|
|
219
235
|
/**
|
|
220
|
-
* Conditionally initializes experiences
|
|
221
|
-
*
|
|
222
|
-
* @param client
|
|
236
|
+
* Conditionally initializes experiences.
|
|
237
|
+
* @param client - The Picked client instance.
|
|
223
238
|
*/
|
|
224
239
|
export declare const initialiseExperiences: (client: Picked) => Promise<void>;
|
|
225
240
|
export declare const shouldInitialiseExperience: (client: Picked, experience: ExperienceStore) => Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAC3E,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAIjE,QAAA,MAAM,uBAAuB,2BACF;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;oBAIjB,OAAO,CAAC,UAAU,CAAC;kBAAY,UAAU;;CAuD5F,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,C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IACV,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,YAAY,EAAE,qBAAqB,EAAE,CAAA;IACrC,cAAc,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACvC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAClC,8FAA8F;IAC9F,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC5B;AAED,eAAO,MAAM,eAAe,GAC1B,YAAY,UAAU,EACtB,iBAAiB,oBAAoB,KACpC,IAEF,CAAA;AAED;;;;GAIG;AAEH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,MAAM,EACd,YAAY,eAAe,EAC3B,UAAU,uBAAuB,SAkBlC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,MAAM,kBASzD,CAAA;AAsBD,eAAO,MAAM,0BAA0B,GACrC,QAAQ,MAAM,EACd,YAAY,eAAe,KAC1B,OAAO,CAAC,OAAO,CAiCjB,CAAA"}
|
package/dist/types/picked.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Experience, LaunchExperienceOptions } from './entities/experience/experience';
|
|
2
2
|
import { Plugin, PluginConfigIndex } from './entities/plugin/plugin';
|
|
3
3
|
import { CreateClientOptions } from './client';
|
|
4
|
-
import {
|
|
4
|
+
import { AdaptedComponent } from './entities/component/component';
|
|
5
5
|
import { Framework } from './entities/framework/framework';
|
|
6
6
|
import { StateSnapshot } from './utils/state-snaphot';
|
|
7
7
|
import { Predicate } from './entities/predicate/predicate';
|
|
@@ -28,6 +28,7 @@ export declare class Picked {
|
|
|
28
28
|
readonly session?: SessionStore | null;
|
|
29
29
|
readonly precondition?: LogicRule | boolean;
|
|
30
30
|
readonly condition?: LogicRule | boolean;
|
|
31
|
+
preconditionPassed?: boolean;
|
|
31
32
|
readonly searchParams: import('./utils/search-params').PickedSearchParams;
|
|
32
33
|
readonly history: {
|
|
33
34
|
push: import('effector').EventCallable<{
|
|
@@ -216,7 +217,7 @@ export declare class Picked {
|
|
|
216
217
|
constructor(options: CreateClientOptions);
|
|
217
218
|
start: () => void;
|
|
218
219
|
registerFramework: (framework: Framework) => void;
|
|
219
|
-
registerComponent: (name:
|
|
220
|
+
registerComponent: (name: string, component: AdaptedComponent) => void;
|
|
220
221
|
registerPlugin: (plugin: Plugin) => void;
|
|
221
222
|
registerFeature: (name: string, feature: Feature) => void;
|
|
222
223
|
registerPredicate: (name: string, predicate: Predicate) => void;
|
|
@@ -234,6 +235,7 @@ export declare class Picked {
|
|
|
234
235
|
private setupFeatures;
|
|
235
236
|
private setupPredicates;
|
|
236
237
|
private setupActions;
|
|
238
|
+
private setupComponents;
|
|
237
239
|
getPluginConfig: (pluginName: string) => PluginConfigIndex[string] | Record<string, unknown>;
|
|
238
240
|
/**
|
|
239
241
|
* Interpolates a template string using values from the client's response store and/or a provided context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,uBAAuB,EAE7B,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,
|
|
1
|
+
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"m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I,CAEvD;IAED,iBAAiB,GAAI,MAAM,MAAM,EAAE,WAAW,SAAS,KAAG,IAAI,CAE7D;IAED,aAAa,GAAI,OAAO,KAAK,KAAG,IAAI,CAEnC;IAED,cAAc,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,IAAI,CAEpD;IAED,kBAAkB,GAAI,YAAY,UAAU,KAAG,IAAI,CAMlD;IAED,gBAAgB,QAAO,aAAa,CAEnC;IAED,iFAAiF;IACjF,oBAAoB,GAClB,cAAc,MAAM,EACpB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED,+EAA+E;IAC/E,kBAAkB,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;YAEa,mBAAmB;YAMnB,YAAY;IAc1B,OAAO,CAAC,YAAY;IA6BpB,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;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,YAAY,GAAI,UAAU,MAAM,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,CAY3E;CACF"}
|
|
@@ -38,7 +38,6 @@ export declare const createAction: (actionOptions: CreateActionOptions, experien
|
|
|
38
38
|
export interface SerializableBaseNode {
|
|
39
39
|
id: string;
|
|
40
40
|
experience: SerializableExperience;
|
|
41
|
-
position: [number, number];
|
|
42
41
|
serialize: () => Serialized<ExperienceNode>;
|
|
43
42
|
}
|
|
44
43
|
export interface SerializableStepNode extends SerializableBaseNode {
|
|
@@ -191,11 +190,9 @@ export declare const createEdge: (edgeOptions: CreateEdgeOptions, experience: Se
|
|
|
191
190
|
export declare const createConditional: (conditionalOptions: CreateConditionalOptions, experience: SerializableExperience) => SerializableConditional;
|
|
192
191
|
/**
|
|
193
192
|
* Creates a field with optional generic type parameter for object field type safety.
|
|
194
|
-
*
|
|
195
193
|
* @template T - The type of the object field value (only applicable for type: 'object')
|
|
196
194
|
* @param fieldOptions - The field configuration options
|
|
197
195
|
* @returns A serializable field with type information
|
|
198
|
-
*
|
|
199
196
|
* @example
|
|
200
197
|
* ```typescript
|
|
201
198
|
* // Without type parameter (default JsonValue)
|