@picked/client 0.0.1-dev.1773804563218 → 0.0.1-dev.1773878362211
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-CQ1Lb-dB.js → api-4YC7Dkcf.js} +1 -1
- package/dist/{api-C90ugp6M.cjs → api-dQTozK5u.cjs} +1 -1
- package/dist/cjs/form/index.js +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/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/server/index.js +1 -1
- package/dist/esm/form/index.js +393 -0
- package/dist/esm/index.js +684 -770
- package/dist/esm/plugins/create-experience/index.js +284 -359
- package/dist/esm/plugins/dynamic-experiences/index.js +80 -146
- 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 +51 -46
- package/dist/esm/plugins/single-page-app/index.js +24 -24
- package/dist/esm/server/index.js +7 -7
- package/dist/experience-instance-Bd4kkjE6.js +559 -0
- package/dist/experience-instance-UAZPiG2b.cjs +1 -0
- package/dist/{object-JwZ58NOH.js → object-CJssU1Pm.js} +1 -1
- package/dist/object-mwaxtjLG.cjs +1 -0
- package/dist/rules-logic-CZfip-Wl.js +265 -0
- package/dist/rules-logic-Cgia6n5p.cjs +1 -0
- package/dist/storage-58NoTSsc.cjs +1 -0
- package/dist/{storage-Co_LbKr_.js → storage-B2d81EOI.js} +35 -30
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +31 -46
- 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 +12 -17
- 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.map +1 -1
- package/dist/types/entities/response/response.d.ts +7 -9
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/form/build-responses.d.ts +14 -0
- package/dist/types/form/build-responses.d.ts.map +1 -0
- package/dist/types/form/create-field-evaluator.d.ts +19 -0
- package/dist/types/form/create-field-evaluator.d.ts.map +1 -0
- package/dist/types/form/create-field-validation.d.ts +44 -0
- package/dist/types/form/create-field-validation.d.ts.map +1 -0
- package/dist/types/form/create-form.d.ts +56 -0
- package/dist/types/form/create-form.d.ts.map +1 -0
- package/dist/types/form/create-submit-pipeline.d.ts +58 -0
- package/dist/types/form/create-submit-pipeline.d.ts.map +1 -0
- package/dist/types/form/get-step-fields.d.ts +5 -0
- package/dist/types/form/get-step-fields.d.ts.map +1 -0
- package/dist/types/form/index.d.ts +10 -0
- package/dist/types/form/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +2 -8
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +23 -41
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +41 -70
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +1 -1
- 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 +5 -20
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -46
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +2 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +2 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +2 -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/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 +0 -3
- 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 +0 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +2 -1
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- 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 +2 -2
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +0 -8
- 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 +27 -3
- package/dist/experience-instance-8P1fJuPC.js +0 -819
- package/dist/experience-instance-Bi3-1tP5.cjs +0 -1
- package/dist/object-BbFTsGh3.cjs +0 -1
- package/dist/storage-Be5xWNPC.cjs +0 -1
- package/dist/types/entities/condition/condition.d.ts +0 -17
- package/dist/types/entities/condition/condition.d.ts.map +0 -1
- package/dist/types/entities/step/step.d.ts +0 -20
- package/dist/types/entities/step/step.d.ts.map +0 -1
- package/dist/types/utils/key.d.ts +0 -12
- package/dist/types/utils/key.d.ts.map +0 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { i as S } from "./object-CJssU1Pm.js";
|
|
2
|
+
function b(t) {
|
|
3
|
+
return typeof t == "number" && !isNaN(t);
|
|
4
|
+
}
|
|
5
|
+
function w(t) {
|
|
6
|
+
return typeof t == "string";
|
|
7
|
+
}
|
|
8
|
+
function l(t) {
|
|
9
|
+
return Array.isArray(t);
|
|
10
|
+
}
|
|
11
|
+
function g(t) {
|
|
12
|
+
return t instanceof Promise;
|
|
13
|
+
}
|
|
14
|
+
function y(t) {
|
|
15
|
+
return typeof t == "object" && t !== null && !Array.isArray(t) && Object.keys(t).length === 1;
|
|
16
|
+
}
|
|
17
|
+
function a(t) {
|
|
18
|
+
if (b(t)) return t;
|
|
19
|
+
const r = parseFloat(`${t}`);
|
|
20
|
+
return isNaN(r) ? 0 : r;
|
|
21
|
+
}
|
|
22
|
+
function h(t) {
|
|
23
|
+
return `${t}`;
|
|
24
|
+
}
|
|
25
|
+
const d = {
|
|
26
|
+
// eslint-disable-next-line eqeqeq
|
|
27
|
+
"==": (t, r) => t == r,
|
|
28
|
+
"===": (t, r) => t === r,
|
|
29
|
+
// eslint-disable-next-line eqeqeq
|
|
30
|
+
"!=": (t, r) => t != r,
|
|
31
|
+
"!==": (t, r) => t !== r,
|
|
32
|
+
">": (t, r) => a(t) > a(r),
|
|
33
|
+
">=": (t, r) => a(t) >= a(r),
|
|
34
|
+
"<": (t, r, s) => {
|
|
35
|
+
const n = a(t), u = a(r);
|
|
36
|
+
if (s === void 0) return n < u;
|
|
37
|
+
const o = a(s);
|
|
38
|
+
return n < u && u < o;
|
|
39
|
+
},
|
|
40
|
+
"<=": (t, r, s) => {
|
|
41
|
+
const n = a(t), u = a(r);
|
|
42
|
+
if (s === void 0) return n <= u;
|
|
43
|
+
const o = a(s);
|
|
44
|
+
return n <= u && u <= o;
|
|
45
|
+
},
|
|
46
|
+
"!!": async (t) => await m(t),
|
|
47
|
+
"!": async (t) => !await m(t),
|
|
48
|
+
"%": (t, r) => a(t) % a(r),
|
|
49
|
+
// eslint-disable-next-line sonarjs/function-return-type
|
|
50
|
+
log: (t) => (console.log(t), t),
|
|
51
|
+
in: (t, r) => r ? w(r) ? r.indexOf(h(t)) !== -1 : l(r) ? r.includes(t) : !1 : !1,
|
|
52
|
+
cat: (...t) => t.map(h).join(""),
|
|
53
|
+
/* eslint-disable sonarjs/deprecation */
|
|
54
|
+
substr: (t, r, s) => {
|
|
55
|
+
const n = h(t), u = a(r);
|
|
56
|
+
if (s === void 0) return n.substr(u);
|
|
57
|
+
const o = a(s);
|
|
58
|
+
if (o < 0) {
|
|
59
|
+
const e = n.substr(u);
|
|
60
|
+
return e.substr(0, e.length + o);
|
|
61
|
+
}
|
|
62
|
+
return n.substr(u, o);
|
|
63
|
+
},
|
|
64
|
+
/* eslint-enable sonarjs/deprecation */
|
|
65
|
+
"+": (...t) => t.reduce((r, s) => a(r) + a(s), 0),
|
|
66
|
+
"*": (...t) => t.reduce((r, s) => a(r) * a(s), 1),
|
|
67
|
+
"-": (t, r) => {
|
|
68
|
+
const s = a(t);
|
|
69
|
+
return r === void 0 ? -s : s - a(r);
|
|
70
|
+
},
|
|
71
|
+
"/": (t, r) => a(t) / a(r),
|
|
72
|
+
min: (...t) => Math.min(...t.map(a)),
|
|
73
|
+
max: (...t) => Math.max(...t.map(a)),
|
|
74
|
+
merge: (...t) => t.reduce((r, s) => l(s) ? r.concat(s) : r.concat([s]), []),
|
|
75
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- JSONLogic var operator requires complex path traversal logic
|
|
76
|
+
var(t, r) {
|
|
77
|
+
const s = arguments.length > 1 ? r : null;
|
|
78
|
+
if (t === "" || t === "." || t === null || t === void 0)
|
|
79
|
+
return this;
|
|
80
|
+
if (typeof t == "number" && Array.isArray(this))
|
|
81
|
+
return t >= 0 && t < this.length ? this[t] : s;
|
|
82
|
+
const n = h(t);
|
|
83
|
+
if (n === "" || n === ".")
|
|
84
|
+
return this;
|
|
85
|
+
const u = n.split(".");
|
|
86
|
+
let o = this;
|
|
87
|
+
for (const e of u) {
|
|
88
|
+
if (o == null)
|
|
89
|
+
return s;
|
|
90
|
+
if (Array.isArray(o)) {
|
|
91
|
+
const c = parseInt(e, 10);
|
|
92
|
+
isNaN(c) ? o = o[e] : o = o[c];
|
|
93
|
+
} else
|
|
94
|
+
o = o[e];
|
|
95
|
+
}
|
|
96
|
+
return o !== void 0 ? o : s;
|
|
97
|
+
},
|
|
98
|
+
async missing(...t) {
|
|
99
|
+
const r = l(t[0]) ? t[0] : t, s = [];
|
|
100
|
+
for (const n of r) {
|
|
101
|
+
const u = await i({ var: n }, this);
|
|
102
|
+
(u === null || u === "") && s.push(`${n}`);
|
|
103
|
+
}
|
|
104
|
+
return s;
|
|
105
|
+
},
|
|
106
|
+
async missing_some(t, r) {
|
|
107
|
+
const s = await i({ missing: r }, this);
|
|
108
|
+
if (!l(s) || !l(r)) return [];
|
|
109
|
+
const n = s.filter(w);
|
|
110
|
+
return r.filter(w).length - n.length >= a(t) ? [] : n;
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Invoke operator - executes a function with optional arguments
|
|
114
|
+
*
|
|
115
|
+
* Object format (no arguments):
|
|
116
|
+
* { "invoke": { "var": "functionName" } }
|
|
117
|
+
*
|
|
118
|
+
* Array format (with arguments):
|
|
119
|
+
* { "invoke": [{ "var": "functionName" }, arg1, arg2, ...] }
|
|
120
|
+
*
|
|
121
|
+
* Arguments are evaluated as JSONLogic expressions before being passed to the function.
|
|
122
|
+
*/
|
|
123
|
+
// eslint-disable-next-line sonarjs/function-return-type
|
|
124
|
+
invoke(...t) {
|
|
125
|
+
const [r, ...s] = t;
|
|
126
|
+
return typeof r != "function" ? null : Reflect.apply(r, null, s);
|
|
127
|
+
},
|
|
128
|
+
regexp_matches(t, r) {
|
|
129
|
+
let s = t, n = "";
|
|
130
|
+
if (l(t)) {
|
|
131
|
+
const [o, e] = t;
|
|
132
|
+
s = o, n = e;
|
|
133
|
+
}
|
|
134
|
+
return !w(s) || !w(n) ? !1 : new RegExp(s, n).test(h(r));
|
|
135
|
+
},
|
|
136
|
+
throw(t) {
|
|
137
|
+
throw new Error(h(t));
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
async function i(t, r) {
|
|
141
|
+
if (!t) return t;
|
|
142
|
+
if (g(t))
|
|
143
|
+
return i(await t, r);
|
|
144
|
+
if (l(t))
|
|
145
|
+
return Promise.all(t.map((e) => i(e, r)));
|
|
146
|
+
if (!y(t)) return t;
|
|
147
|
+
const s = k(t);
|
|
148
|
+
let n = s ? t[s] ?? [] : [];
|
|
149
|
+
switch (l(n) || (n = [n]), s) {
|
|
150
|
+
case "if":
|
|
151
|
+
case "?:":
|
|
152
|
+
for (let e = 0; e < n.length - 1; e += 2)
|
|
153
|
+
if (await m(await i(n[e], r)))
|
|
154
|
+
return i(n[e + 1], r);
|
|
155
|
+
return n.length % 2 === 1 ? i(n[n.length - 1], r) : null;
|
|
156
|
+
case "and": {
|
|
157
|
+
let e = null;
|
|
158
|
+
for (const c of n)
|
|
159
|
+
if (e = await i(c, r), !await m(e))
|
|
160
|
+
return e;
|
|
161
|
+
return e;
|
|
162
|
+
}
|
|
163
|
+
case "or": {
|
|
164
|
+
let e = null;
|
|
165
|
+
for (const c of n)
|
|
166
|
+
if (e = await i(c, r), await m(e)) return e;
|
|
167
|
+
return e;
|
|
168
|
+
}
|
|
169
|
+
case "map": {
|
|
170
|
+
const e = await i(n[0], r);
|
|
171
|
+
return l(e) ? await Promise.all(e.map((c) => i(n[1], c))) : [];
|
|
172
|
+
}
|
|
173
|
+
case "filter": {
|
|
174
|
+
const e = await i(n[0], r);
|
|
175
|
+
return l(e) ? (await Promise.all(
|
|
176
|
+
e.map(async (f) => {
|
|
177
|
+
const p = await m(await i(n[1], f));
|
|
178
|
+
return { item: f, shouldInclude: p };
|
|
179
|
+
})
|
|
180
|
+
)).filter(({ shouldInclude: f }) => f).map(({ item: f }) => f) : [];
|
|
181
|
+
}
|
|
182
|
+
case "reduce": {
|
|
183
|
+
const e = await i(n[0], r);
|
|
184
|
+
if (!l(e))
|
|
185
|
+
return n.length > 2 ? await i(n[2], r) : null;
|
|
186
|
+
const c = n[1];
|
|
187
|
+
let p = n.length > 2 ? await i(n[2], r) : null;
|
|
188
|
+
for (const A of e)
|
|
189
|
+
p = await i(c, { current: A, accumulator: p });
|
|
190
|
+
return p;
|
|
191
|
+
}
|
|
192
|
+
case "all": {
|
|
193
|
+
const e = await i(n[0], r);
|
|
194
|
+
if (!l(e) || e.length === 0) return !1;
|
|
195
|
+
for (const c of e)
|
|
196
|
+
if (!await m(await i(n[1], c))) return !1;
|
|
197
|
+
return !0;
|
|
198
|
+
}
|
|
199
|
+
case "some": {
|
|
200
|
+
const e = await i(n[0], r);
|
|
201
|
+
if (!l(e)) return !1;
|
|
202
|
+
for (const c of e)
|
|
203
|
+
if (await m(await i(n[1], c))) return !0;
|
|
204
|
+
return !1;
|
|
205
|
+
}
|
|
206
|
+
case "none": {
|
|
207
|
+
const e = await i(n[0], r);
|
|
208
|
+
if (!l(e)) return !0;
|
|
209
|
+
for (const c of e)
|
|
210
|
+
if (await m(await i(n[1], c))) return !1;
|
|
211
|
+
return !0;
|
|
212
|
+
}
|
|
213
|
+
case "catch":
|
|
214
|
+
try {
|
|
215
|
+
return await i(n[0], r);
|
|
216
|
+
} catch (e) {
|
|
217
|
+
return y(e) ? await i(e, r) : n[1] ? await i(n[1], e) : e instanceof Error ? e.message : e;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const u = await Promise.all(n.map((e) => i(e, r))), o = s ? d[s] : void 0;
|
|
221
|
+
if (!o) throw new Error(`Unrecognized operation ${s}`);
|
|
222
|
+
return o.apply(r, u);
|
|
223
|
+
}
|
|
224
|
+
async function m(t) {
|
|
225
|
+
return g(t) ? m(await t) : !(Array.isArray(t) && t.length === 0) && !!t;
|
|
226
|
+
}
|
|
227
|
+
function k(t) {
|
|
228
|
+
return Object.keys(t)[0];
|
|
229
|
+
}
|
|
230
|
+
function x(t) {
|
|
231
|
+
return !S(t);
|
|
232
|
+
}
|
|
233
|
+
async function N(t, r, s) {
|
|
234
|
+
const n = t.getStateSnapshot(), u = t.predicates.listStore.getState().reduce((c, f) => ({
|
|
235
|
+
...c,
|
|
236
|
+
[f.name]: (...p) => f.predicate({ ...n, args: p })
|
|
237
|
+
}), {}), o = t.features.listStore.getState().reduce((c, f) => ({
|
|
238
|
+
...c,
|
|
239
|
+
[f.id]: async () => {
|
|
240
|
+
const { bucket: p } = await f.getBucket();
|
|
241
|
+
return p;
|
|
242
|
+
}
|
|
243
|
+
}), {}), e = {
|
|
244
|
+
...s,
|
|
245
|
+
responses: t.responses.getAllStore.getState(),
|
|
246
|
+
location: typeof n.location == "object" ? {
|
|
247
|
+
hash: n.location.hash,
|
|
248
|
+
host: n.location.host,
|
|
249
|
+
hostname: n.location.hostname,
|
|
250
|
+
href: n.location.href,
|
|
251
|
+
origin: n.location.origin,
|
|
252
|
+
pathname: n.location.pathname,
|
|
253
|
+
port: n.location.port,
|
|
254
|
+
protocol: n.location.protocol,
|
|
255
|
+
search: n.location.search
|
|
256
|
+
} : void 0,
|
|
257
|
+
predicates: u,
|
|
258
|
+
features: o
|
|
259
|
+
};
|
|
260
|
+
return await i(r, e);
|
|
261
|
+
}
|
|
262
|
+
export {
|
|
263
|
+
N as e,
|
|
264
|
+
x as i
|
|
265
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const S=require("./object-mwaxtjLG.cjs");function b(t){return typeof t=="number"&&!isNaN(t)}function w(t){return typeof t=="string"}function l(t){return Array.isArray(t)}function y(t){return t instanceof Promise}function g(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.keys(t).length===1}function a(t){if(b(t))return t;const r=parseFloat(`${t}`);return isNaN(r)?0:r}function p(t){return`${t}`}const v={"==":(t,r)=>t==r,"===":(t,r)=>t===r,"!=":(t,r)=>t!=r,"!==":(t,r)=>t!==r,">":(t,r)=>a(t)>a(r),">=":(t,r)=>a(t)>=a(r),"<":(t,r,s)=>{const n=a(t),u=a(r);if(s===void 0)return n<u;const o=a(s);return n<u&&u<o},"<=":(t,r,s)=>{const n=a(t),u=a(r);if(s===void 0)return n<=u;const o=a(s);return n<=u&&u<=o},"!!":async t=>await m(t),"!":async t=>!await m(t),"%":(t,r)=>a(t)%a(r),log:t=>(console.log(t),t),in:(t,r)=>r?w(r)?r.indexOf(p(t))!==-1:l(r)?r.includes(t):!1:!1,cat:(...t)=>t.map(p).join(""),substr:(t,r,s)=>{const n=p(t),u=a(r);if(s===void 0)return n.substr(u);const o=a(s);if(o<0){const e=n.substr(u);return e.substr(0,e.length+o)}return n.substr(u,o)},"+":(...t)=>t.reduce((r,s)=>a(r)+a(s),0),"*":(...t)=>t.reduce((r,s)=>a(r)*a(s),1),"-":(t,r)=>{const s=a(t);return r===void 0?-s:s-a(r)},"/":(t,r)=>a(t)/a(r),min:(...t)=>Math.min(...t.map(a)),max:(...t)=>Math.max(...t.map(a)),merge:(...t)=>t.reduce((r,s)=>l(s)?r.concat(s):r.concat([s]),[]),var(t,r){const s=arguments.length>1?r:null;if(t===""||t==="."||t===null||t===void 0)return this;if(typeof t=="number"&&Array.isArray(this))return t>=0&&t<this.length?this[t]:s;const n=p(t);if(n===""||n===".")return this;const u=n.split(".");let o=this;for(const e of u){if(o==null)return s;if(Array.isArray(o)){const c=parseInt(e,10);isNaN(c)?o=o[e]:o=o[c]}else o=o[e]}return o!==void 0?o:s},async missing(...t){const r=l(t[0])?t[0]:t,s=[];for(const n of r){const u=await i({var:n},this);(u===null||u==="")&&s.push(`${n}`)}return s},async missing_some(t,r){const s=await i({missing:r},this);if(!l(s)||!l(r))return[];const n=s.filter(w);return r.filter(w).length-n.length>=a(t)?[]:n},invoke(...t){const[r,...s]=t;return typeof r!="function"?null:Reflect.apply(r,null,s)},regexp_matches(t,r){let s=t,n="";if(l(t)){const[o,e]=t;s=o,n=e}return!w(s)||!w(n)?!1:new RegExp(s,n).test(p(r))},throw(t){throw new Error(p(t))}};async function i(t,r){if(!t)return t;if(y(t))return i(await t,r);if(l(t))return Promise.all(t.map(e=>i(e,r)));if(!g(t))return t;const s=d(t);let n=s?t[s]??[]:[];switch(l(n)||(n=[n]),s){case"if":case"?:":for(let e=0;e<n.length-1;e+=2)if(await m(await i(n[e],r)))return i(n[e+1],r);return n.length%2===1?i(n[n.length-1],r):null;case"and":{let e=null;for(const c of n)if(e=await i(c,r),!await m(e))return e;return e}case"or":{let e=null;for(const c of n)if(e=await i(c,r),await m(e))return e;return e}case"map":{const e=await i(n[0],r);return l(e)?await Promise.all(e.map(c=>i(n[1],c))):[]}case"filter":{const e=await i(n[0],r);return l(e)?(await Promise.all(e.map(async f=>{const h=await m(await i(n[1],f));return{item:f,shouldInclude:h}}))).filter(({shouldInclude:f})=>f).map(({item:f})=>f):[]}case"reduce":{const e=await i(n[0],r);if(!l(e))return n.length>2?await i(n[2],r):null;const c=n[1];let h=n.length>2?await i(n[2],r):null;for(const A of e)h=await i(c,{current:A,accumulator:h});return h}case"all":{const e=await i(n[0],r);if(!l(e)||e.length===0)return!1;for(const c of e)if(!await m(await i(n[1],c)))return!1;return!0}case"some":{const e=await i(n[0],r);if(!l(e))return!1;for(const c of e)if(await m(await i(n[1],c)))return!0;return!1}case"none":{const e=await i(n[0],r);if(!l(e))return!0;for(const c of e)if(await m(await i(n[1],c)))return!1;return!0}case"catch":try{return await i(n[0],r)}catch(e){return g(e)?await i(e,r):n[1]?await i(n[1],e):e instanceof Error?e.message:e}}const u=await Promise.all(n.map(e=>i(e,r))),o=s?v[s]:void 0;if(!o)throw new Error(`Unrecognized operation ${s}`);return o.apply(r,u)}async function m(t){return y(t)?m(await t):!(Array.isArray(t)&&t.length===0)&&!!t}function d(t){return Object.keys(t)[0]}function k(t){return!S.isEmpty(t)}async function N(t,r,s){const n=t.getStateSnapshot(),u=t.predicates.listStore.getState().reduce((c,f)=>({...c,[f.name]:(...h)=>f.predicate({...n,args:h})}),{}),o=t.features.listStore.getState().reduce((c,f)=>({...c,[f.id]:async()=>{const{bucket:h}=await f.getBucket();return h}}),{}),e={...s,responses:t.responses.getAllStore.getState(),location:typeof n.location=="object"?{hash:n.location.hash,host:n.location.host,hostname:n.location.hostname,href:n.location.href,origin:n.location.origin,pathname:n.location.pathname,port:n.location.port,protocol:n.location.protocol,search:n.location.search}:void 0,predicates:u,features:o};return await i(r,e)}exports.evaluateRuleLogic=N;exports.isRulesLogic=k;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const p=e=>btoa([...e].map(t=>String.fromCharCode(t.charCodeAt(0)^7)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function w(e,t="global",o){let r="pckd";if(t==="experience"){if(!o)throw new Error("Experience instance is required to scope storage to an experience");r=`${r}:${o.experienceId}`}return{_:`${r}:${p(e)}`,scope:t}}const u=new Map;function m(e,t){const o=u.get(e._);o&&o.forEach(r=>r(e,t))}function S(e,t,o,r){const i=o==="local"?localStorage:sessionStorage,c=typeof t!="string"?JSON.stringify(t):t;if(i.setItem(e._,c),typeof r=="number"){const l=new Date(Date.now()+r).toISOString();i.setItem(`${e._}:expires-at`,l)}m(e,o)}function b(e,t){const o=t==="local"?localStorage:sessionStorage;o.removeItem(e._),o.removeItem(`${e._}:expires-at`),m(e,t)}function f(e,t,o,r){const i=t==="local"?localStorage:sessionStorage;function c(n){n.storageArea===i&&n.key===e._&&r(o(e))}function a(n,s){s===t&&r(o(n))}window.addEventListener("storage",c),u.has(e._)||u.set(e._,new Set);const l=u.get(e._);return l&&l.add(a),function(){window.removeEventListener("storage",c);const s=u.get(e._);s&&(s.delete(a),s.size===0&&u.delete(e._))}}function g(e,t){const o=t==="local"?localStorage:sessionStorage,r=o.getItem(e._),i=o.getItem(`${e._}:expires-at`),c=(n,s)=>S(e,n,t,s),a=()=>b(e,t),l=n=>f(e,t,s=>g(s,t),n);if(i){const n=new Date,s=new Date(i);if(n>s)return b(e,t),{isSet:()=>!1,text:()=>null,json:()=>null,boolean:()=>null,set:c,remove:a,subscribe:l}}return{isSet(){return r!==null},text(){return r},json(){return r?JSON.parse(r):null},boolean(){return r?r==="true":null},set:c,remove:a,subscribe:l}}const d={get(e){return g(e,"session")},set(e,t,o){S(e,t,"session",o)},remove(e){b(e,"session")},subscribe(e,t){return f(e,"session",this.get,t)}},_={get(e){return g(e,"local")},set(e,t,o){S(e,t,"local",o)},remove(e){b(e,"local")},subscribe(e,t){return f(e,"local",this.get,t)}};exports.createStorageKey=w;exports.localStore=_;exports.sessionStore=d;exports.subscribe=f;
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
const m = (e) =>
|
|
1
|
+
const m = (e) => (
|
|
2
|
+
// eslint-disable-next-line no-bitwise -- XOR cipher for cookie consent banner detection avoidance
|
|
3
|
+
btoa([...e].map((t) => String.fromCharCode(t.charCodeAt(0) ^ 7)).join("")).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "")
|
|
4
|
+
);
|
|
2
5
|
function w(e, t = "global", o) {
|
|
3
|
-
let
|
|
6
|
+
let n = "pckd";
|
|
4
7
|
if (t === "experience") {
|
|
5
8
|
if (!o)
|
|
6
9
|
throw new Error("Experience instance is required to scope storage to an experience");
|
|
7
|
-
|
|
10
|
+
n = `${n}:${o.experienceId}`;
|
|
8
11
|
}
|
|
9
|
-
return { _: `${
|
|
12
|
+
return { _: `${n}:${m(e)}`, scope: t };
|
|
10
13
|
}
|
|
11
|
-
const
|
|
14
|
+
const u = /* @__PURE__ */ new Map();
|
|
12
15
|
function p(e, t) {
|
|
13
|
-
const o =
|
|
14
|
-
o && o.forEach((
|
|
16
|
+
const o = u.get(e._);
|
|
17
|
+
o && o.forEach((n) => n(e, t));
|
|
15
18
|
}
|
|
16
|
-
function b(e, t, o,
|
|
19
|
+
function b(e, t, o, n) {
|
|
17
20
|
const i = o === "local" ? localStorage : sessionStorage, c = typeof t != "string" ? JSON.stringify(t) : t;
|
|
18
|
-
if (i.setItem(e._, c), typeof
|
|
19
|
-
const
|
|
20
|
-
i.setItem(`${e._}:expires-at`,
|
|
21
|
+
if (i.setItem(e._, c), typeof n == "number") {
|
|
22
|
+
const a = new Date(Date.now() + n).toISOString();
|
|
23
|
+
i.setItem(`${e._}:expires-at`, a);
|
|
21
24
|
}
|
|
22
25
|
p(e, o);
|
|
23
26
|
}
|
|
@@ -25,51 +28,53 @@ function f(e, t) {
|
|
|
25
28
|
const o = t === "local" ? localStorage : sessionStorage;
|
|
26
29
|
o.removeItem(e._), o.removeItem(`${e._}:expires-at`), p(e, t);
|
|
27
30
|
}
|
|
28
|
-
function S(e, t, o,
|
|
31
|
+
function S(e, t, o, n) {
|
|
29
32
|
const i = t === "local" ? localStorage : sessionStorage;
|
|
30
|
-
function c(
|
|
31
|
-
|
|
33
|
+
function c(r) {
|
|
34
|
+
r.storageArea === i && r.key === e._ && n(o(e));
|
|
32
35
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
36
|
+
function l(r, s) {
|
|
37
|
+
s === t && n(o(r));
|
|
35
38
|
}
|
|
36
|
-
|
|
39
|
+
window.addEventListener("storage", c), u.has(e._) || u.set(e._, /* @__PURE__ */ new Set());
|
|
40
|
+
const a = u.get(e._);
|
|
41
|
+
return a && a.add(l), function() {
|
|
37
42
|
window.removeEventListener("storage", c);
|
|
38
|
-
const
|
|
39
|
-
|
|
43
|
+
const s = u.get(e._);
|
|
44
|
+
s && (s.delete(l), s.size === 0 && u.delete(e._));
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
47
|
function g(e, t) {
|
|
43
|
-
const o = t === "local" ? localStorage : sessionStorage,
|
|
48
|
+
const o = t === "local" ? localStorage : sessionStorage, n = o.getItem(e._), i = o.getItem(`${e._}:expires-at`), c = (r, s) => b(e, r, t, s), l = () => f(e, t), a = (r) => S(e, t, (s) => g(s, t), r);
|
|
44
49
|
if (i) {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
50
|
+
const r = /* @__PURE__ */ new Date(), s = new Date(i);
|
|
51
|
+
if (r > s)
|
|
47
52
|
return f(e, t), {
|
|
48
53
|
isSet: () => !1,
|
|
49
54
|
text: () => null,
|
|
50
55
|
json: () => null,
|
|
51
56
|
boolean: () => null,
|
|
52
57
|
set: c,
|
|
53
|
-
remove:
|
|
54
|
-
subscribe:
|
|
58
|
+
remove: l,
|
|
59
|
+
subscribe: a
|
|
55
60
|
};
|
|
56
61
|
}
|
|
57
62
|
return {
|
|
58
63
|
isSet() {
|
|
59
|
-
return
|
|
64
|
+
return n !== null;
|
|
60
65
|
},
|
|
61
66
|
text() {
|
|
62
|
-
return
|
|
67
|
+
return n;
|
|
63
68
|
},
|
|
64
69
|
json() {
|
|
65
|
-
return
|
|
70
|
+
return n ? JSON.parse(n) : null;
|
|
66
71
|
},
|
|
67
72
|
boolean() {
|
|
68
|
-
return
|
|
73
|
+
return n ? n === "true" : null;
|
|
69
74
|
},
|
|
70
75
|
set: c,
|
|
71
|
-
remove:
|
|
72
|
-
subscribe:
|
|
76
|
+
remove: l,
|
|
77
|
+
subscribe: a
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
80
|
const d = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/entities/action/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAG9D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,CAAA;AACnD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAItE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,wBAAwB;qBAiBJ,MAAM,UAAU,MAAM,KAAG,IAAI;sBAQ5B,MAAM;;
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/entities/action/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAG9D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,CAAA;AACnD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAItE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,wBAAwB;qBAiBJ,MAAM,UAAU,MAAM,KAAG,IAAI;sBAQ5B,MAAM;;oCAKjB,MAAM,KACjB,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAgBtD,CAAA;AAEF,wBAAgB,iBAAiB,IAAI,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAE/E;AAED,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,EAAE,SAAS,YAAY,KAAG,IAEjF,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AdaptedComponent } from '../component/component';
|
|
2
2
|
import { Picked } from '../../picked';
|
|
3
3
|
import { LogicRule, LogicValue } from '../../logic-engine';
|
|
4
|
+
import { Field } from '../field/field';
|
|
4
5
|
export type ExperiencesListStore = ReturnType<typeof createExperienceIndex>;
|
|
5
6
|
export type ExperienceStore = ReturnType<typeof createExperience>;
|
|
6
7
|
declare const createExperienceFactory: ({ client, experience }: {
|
|
@@ -8,8 +9,6 @@ declare const createExperienceFactory: ({ client, experience }: {
|
|
|
8
9
|
experience: Experience;
|
|
9
10
|
}) => {
|
|
10
11
|
id: string;
|
|
11
|
-
key: string | undefined;
|
|
12
|
-
name: string;
|
|
13
12
|
configStore: import('effector').Store<{
|
|
14
13
|
name: string;
|
|
15
14
|
decisionLogic: LogicValue | LogicRule;
|
|
@@ -17,11 +16,12 @@ declare const createExperienceFactory: ({ client, experience }: {
|
|
|
17
16
|
initializeOpenLogic: LogicValue | LogicRule;
|
|
18
17
|
}>;
|
|
19
18
|
treeStore: import('effector').Store<{
|
|
20
|
-
steps:
|
|
19
|
+
steps: ExperienceStep[];
|
|
21
20
|
nodes: ExperienceNode[];
|
|
22
21
|
edges: ExperienceEdge[];
|
|
23
|
-
|
|
22
|
+
conditionals: ExperienceConditional[];
|
|
24
23
|
}>;
|
|
24
|
+
fieldsStore: import('effector').Store<Field[]>;
|
|
25
25
|
componentStore: import('effector').Store<{
|
|
26
26
|
name: string;
|
|
27
27
|
component: AdaptedComponent<string, unknown>;
|
|
@@ -35,7 +35,6 @@ declare const createExperienceFactory: ({ client, experience }: {
|
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* Creates an Effector store for a single experience.
|
|
38
|
-
*
|
|
39
38
|
* @param params - The client instance and experience data.
|
|
40
39
|
* @returns An experience store with config, tree, fields, and component sub-stores.
|
|
41
40
|
* @example
|
|
@@ -58,11 +57,9 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
58
57
|
}) => {
|
|
59
58
|
/** Registers an experience in the index. If an experience with the same ID already exists, it is merged. */
|
|
60
59
|
register: (experience: Experience) => void;
|
|
61
|
-
/** Returns a derived store for an experience by its ID
|
|
62
|
-
get: (
|
|
60
|
+
/** Returns a derived store for an experience by its ID. The store value is `undefined` when no match exists. */
|
|
61
|
+
get: (id: Experience["id"]) => import('effector').Store<{
|
|
63
62
|
id: string;
|
|
64
|
-
key: string | undefined;
|
|
65
|
-
name: string;
|
|
66
63
|
configStore: import('effector').Store<{
|
|
67
64
|
name: string;
|
|
68
65
|
decisionLogic: LogicValue | LogicRule;
|
|
@@ -70,11 +67,12 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
70
67
|
initializeOpenLogic: LogicValue | LogicRule;
|
|
71
68
|
}>;
|
|
72
69
|
treeStore: import('effector').Store<{
|
|
73
|
-
steps:
|
|
70
|
+
steps: ExperienceStep[];
|
|
74
71
|
nodes: ExperienceNode[];
|
|
75
72
|
edges: ExperienceEdge[];
|
|
76
|
-
|
|
73
|
+
conditionals: ExperienceConditional[];
|
|
77
74
|
}>;
|
|
75
|
+
fieldsStore: import('effector').Store<Field[]>;
|
|
78
76
|
componentStore: import('effector').Store<{
|
|
79
77
|
name: string;
|
|
80
78
|
component: AdaptedComponent<string, unknown>;
|
|
@@ -87,10 +85,8 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
87
85
|
}>;
|
|
88
86
|
} | undefined>;
|
|
89
87
|
/** @deprecated Use `experiences.get(id)` instead. */
|
|
90
|
-
getById: (
|
|
88
|
+
getById: (id: Experience["id"]) => import('effector').Store<{
|
|
91
89
|
id: string;
|
|
92
|
-
key: string | undefined;
|
|
93
|
-
name: string;
|
|
94
90
|
configStore: import('effector').Store<{
|
|
95
91
|
name: string;
|
|
96
92
|
decisionLogic: LogicValue | LogicRule;
|
|
@@ -98,11 +94,12 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
98
94
|
initializeOpenLogic: LogicValue | LogicRule;
|
|
99
95
|
}>;
|
|
100
96
|
treeStore: import('effector').Store<{
|
|
101
|
-
steps:
|
|
97
|
+
steps: ExperienceStep[];
|
|
102
98
|
nodes: ExperienceNode[];
|
|
103
99
|
edges: ExperienceEdge[];
|
|
104
|
-
|
|
100
|
+
conditionals: ExperienceConditional[];
|
|
105
101
|
}>;
|
|
102
|
+
fieldsStore: import('effector').Store<Field[]>;
|
|
106
103
|
componentStore: import('effector').Store<{
|
|
107
104
|
name: string;
|
|
108
105
|
component: AdaptedComponent<string, unknown>;
|
|
@@ -114,7 +111,7 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
114
111
|
strategy: "override";
|
|
115
112
|
}>;
|
|
116
113
|
} | undefined>;
|
|
117
|
-
/** Effector effect that launches an experience by ID
|
|
114
|
+
/** Effector effect that launches an experience by ID, creating instances for each DOM target. */
|
|
118
115
|
launch: import('effector').Effect<{
|
|
119
116
|
id: string;
|
|
120
117
|
options?: LaunchExperienceOptions;
|
|
@@ -127,8 +124,6 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
127
124
|
/** Derived store containing all registered experiences as an array. */
|
|
128
125
|
listStore: import('effector').Store<{
|
|
129
126
|
id: string;
|
|
130
|
-
key: string | undefined;
|
|
131
|
-
name: string;
|
|
132
127
|
configStore: import('effector').Store<{
|
|
133
128
|
name: string;
|
|
134
129
|
decisionLogic: LogicValue | LogicRule;
|
|
@@ -136,11 +131,12 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
136
131
|
initializeOpenLogic: LogicValue | LogicRule;
|
|
137
132
|
}>;
|
|
138
133
|
treeStore: import('effector').Store<{
|
|
139
|
-
steps:
|
|
134
|
+
steps: ExperienceStep[];
|
|
140
135
|
nodes: ExperienceNode[];
|
|
141
136
|
edges: ExperienceEdge[];
|
|
142
|
-
|
|
137
|
+
conditionals: ExperienceConditional[];
|
|
143
138
|
}>;
|
|
139
|
+
fieldsStore: import('effector').Store<Field[]>;
|
|
144
140
|
componentStore: import('effector').Store<{
|
|
145
141
|
name: string;
|
|
146
142
|
component: AdaptedComponent<string, unknown>;
|
|
@@ -155,7 +151,6 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
155
151
|
};
|
|
156
152
|
/**
|
|
157
153
|
* Creates an Effector-based index for registering and retrieving experiences.
|
|
158
|
-
*
|
|
159
154
|
* @param params - The client instance.
|
|
160
155
|
* @returns An experience index with register, get, launch, and open methods.
|
|
161
156
|
* @example
|
|
@@ -164,7 +159,12 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
164
159
|
* ```
|
|
165
160
|
*/
|
|
166
161
|
export declare function createExperienceIndex<T extends Parameters<typeof createExperienceIndexFactory>[0]>(params: T): ReturnType<typeof createExperienceIndexFactory>;
|
|
167
|
-
export
|
|
162
|
+
export interface ExperienceStep {
|
|
163
|
+
id: string;
|
|
164
|
+
label: string;
|
|
165
|
+
fieldIds: string[];
|
|
166
|
+
}
|
|
167
|
+
export type ExperienceNode = StepNode | ConditionalNode | LaunchExperienceNode | OriginNode | ActionNode;
|
|
168
168
|
export interface ExperienceAction {
|
|
169
169
|
id: string;
|
|
170
170
|
action: string;
|
|
@@ -179,19 +179,13 @@ export interface BaseNode {
|
|
|
179
179
|
}
|
|
180
180
|
export interface StepNode extends BaseNode {
|
|
181
181
|
type: 'step';
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
/** @deprecated Use `name` instead. Populated for backwards compatibility. */
|
|
185
|
-
label?: string;
|
|
182
|
+
stepId: string;
|
|
183
|
+
label: string;
|
|
186
184
|
}
|
|
187
|
-
export interface
|
|
185
|
+
export interface ConditionalNode extends BaseNode {
|
|
188
186
|
type: 'conditional';
|
|
189
|
-
|
|
190
|
-
/** @deprecated Use `conditionId` instead. */
|
|
191
|
-
conditionalId?: string;
|
|
187
|
+
conditionalId: string;
|
|
192
188
|
}
|
|
193
|
-
/** @deprecated Use {@link ConditionNode} instead. */
|
|
194
|
-
export type ConditionalNode = ConditionNode;
|
|
195
189
|
export interface LaunchExperienceNode extends BaseNode {
|
|
196
190
|
type: 'experience';
|
|
197
191
|
experienceId: string;
|
|
@@ -205,48 +199,39 @@ export interface ExperienceEdge {
|
|
|
205
199
|
destinationNodeId: string;
|
|
206
200
|
sourceNodeHandle?: string;
|
|
207
201
|
}
|
|
208
|
-
export interface
|
|
202
|
+
export interface ExperienceConditional {
|
|
209
203
|
id: string;
|
|
210
204
|
label?: string;
|
|
211
205
|
condition: LogicRule;
|
|
212
206
|
}
|
|
213
|
-
/** @deprecated Use {@link ExperienceCondition} instead. */
|
|
214
|
-
export type ExperienceConditional = ExperienceCondition;
|
|
215
207
|
export interface ExperienceTarget {
|
|
216
208
|
selector: string;
|
|
217
209
|
placement: 'replace' | 'append' | 'prepend' | 'before' | 'after';
|
|
218
210
|
}
|
|
219
211
|
export interface Experience {
|
|
220
212
|
id: string;
|
|
221
|
-
key?: string;
|
|
222
213
|
name: string;
|
|
223
214
|
componentName?: string;
|
|
224
215
|
component?: AdaptedComponent;
|
|
225
|
-
|
|
226
|
-
conditions?: ExperienceCondition[];
|
|
227
|
-
/** @deprecated Use `conditions` instead. */
|
|
228
|
-
conditionals?: ExperienceCondition[];
|
|
216
|
+
conditionals: ExperienceConditional[];
|
|
229
217
|
initializeOpen?: LogicRule | LogicValue;
|
|
230
218
|
actions?: ExperienceAction[];
|
|
231
|
-
/** Decision logic that controls whether this experience is initialised. */
|
|
232
219
|
condition?: LogicRule | LogicValue;
|
|
233
220
|
edges: ExperienceEdge[];
|
|
234
221
|
nodes: ExperienceNode[];
|
|
235
|
-
|
|
236
|
-
steps:
|
|
222
|
+
fields: Field[];
|
|
223
|
+
steps: ExperienceStep[];
|
|
237
224
|
targets: ExperienceTarget[];
|
|
238
225
|
}
|
|
239
226
|
export declare const setupExperience: (experience: Experience, experienceStore: ExperiencesListStore) => void;
|
|
240
227
|
/**
|
|
241
228
|
* Initializes an experience for each target that exists in the DOM.
|
|
242
|
-
*
|
|
243
229
|
* @param client - The Picked client instance.
|
|
244
230
|
* @param experience - The experience store to initialise.
|
|
245
231
|
*/
|
|
246
232
|
export declare const initialiseExperience: (client: Picked, experience: ExperienceStore, options?: LaunchExperienceOptions) => void;
|
|
247
233
|
/**
|
|
248
234
|
* Conditionally initializes experiences.
|
|
249
|
-
*
|
|
250
235
|
* @param client - The Picked client instance.
|
|
251
236
|
*/
|
|
252
237
|
export declare const initialiseExperiences: (client: Picked) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EventCallable, Store } from 'effector';
|
|
2
|
-
import { Experience, ExperienceNode, ExperienceStore, ExperienceTarget, LaunchExperienceOptions } from '../experience/experience';
|
|
3
|
-
import { ExperienceStep } from '../step/step';
|
|
2
|
+
import { Experience, ExperienceNode, ExperienceStep, ExperienceStore, ExperienceTarget, LaunchExperienceOptions } from '../experience/experience';
|
|
4
3
|
import { Picked } from '../../picked';
|
|
5
4
|
import { HistoryEntry } from '../history/history';
|
|
6
5
|
export interface ExperienceInstance {
|
|
@@ -16,6 +15,7 @@ export interface ExperienceInstance {
|
|
|
16
15
|
toggleOpen: EventCallable<void>;
|
|
17
16
|
setOpen: EventCallable<boolean>;
|
|
18
17
|
treeStore: ExperienceStore['treeStore'];
|
|
18
|
+
fieldsStore: ExperienceStore['fieldsStore'];
|
|
19
19
|
currentNodeStore: Store<ExperienceNode | null>;
|
|
20
20
|
currentStepStore: Store<ExperienceStep | null>;
|
|
21
21
|
previousStepStore: Store<ExperienceStep | null>;
|