@picked/client 0.0.1-dev.1774928205822 → 0.0.1-dev.1774950356669
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-BU10Fnoi.js → api-BHJlUOFk.js} +1 -1
- package/dist/{api-CnVCFux0.cjs → api-QaRyNOq-.cjs} +1 -1
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/form/index.js +27 -27
- package/dist/esm/index.js +189 -203
- package/dist/esm/plugins/create-experience/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +15 -44
- package/dist/esm/plugins/responses-indexeddb/index.js +9 -5
- package/dist/esm/server/index.js +1 -1
- package/dist/{experience-instance-CwwrKUI8.js → experience-instance-Bl0OlS-y.js} +37 -43
- package/dist/experience-instance-eacAapPl.cjs +1 -0
- package/dist/types/entities/condition/condition.d.ts +1 -2
- package/dist/types/entities/condition/condition.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +3 -3
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/response/response-validation.d.ts +0 -2
- package/dist/types/entities/response/response-validation.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +2 -5
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +4 -2
- package/dist/types/entities/step/step.d.ts.map +1 -1
- package/dist/types/form/create-field-validation.d.ts +4 -4
- package/dist/types/form/create-field-validation.d.ts.map +1 -1
- package/dist/types/picked.d.ts +7 -8
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +52 -0
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +0 -22
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +12 -2
- package/dist/types/utils/state-snaphot.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/experience-instance-DdFUcVRd.cjs +0 -1
|
@@ -3,62 +3,33 @@ import { attach as r, createEffect as i, sample as a } from "effector";
|
|
|
3
3
|
//#region src/plugins/responses-browser-storage/plugin.ts
|
|
4
4
|
var o = n("responses", "global");
|
|
5
5
|
function s(e, t) {
|
|
6
|
-
return e.
|
|
6
|
+
return Object.fromEntries(Object.entries(e).flatMap(([e, n]) => t.find((t) => t.key === e)?.policies?.doNotStoreValue ? [] : [[e, n]]));
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
return Object.fromEntries(Object.entries(e).flatMap(([e, n]) => {
|
|
10
|
-
let r = s(t, e);
|
|
11
|
-
return r?.policies?.doNotStoreValue ? [] : [[r?.key ?? e, n]];
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
var l = ({ storage: n = "local" } = {}) => ({
|
|
8
|
+
var c = ({ storage: n = "local" } = {}) => ({
|
|
15
9
|
name: "responses-browser-storage-plugin",
|
|
16
|
-
setup: (
|
|
17
|
-
let
|
|
18
|
-
let e =
|
|
10
|
+
setup: (c) => {
|
|
11
|
+
let l = n === "local" ? e : t, u = i(async () => {
|
|
12
|
+
let e = l.get(o).json();
|
|
19
13
|
if (!e) return null;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}), f = r({
|
|
23
|
-
source: {
|
|
24
|
-
responses: l.responses.getAllStore,
|
|
25
|
-
fields: l.fields.listStore
|
|
26
|
-
},
|
|
27
|
-
effect: ({ responses: e, fields: t }) => {
|
|
28
|
-
u.set(o, c(e, t));
|
|
29
|
-
}
|
|
30
|
-
}), p = r({
|
|
14
|
+
c.responses.register(e);
|
|
15
|
+
}), d = r({
|
|
31
16
|
source: {
|
|
32
|
-
responses:
|
|
33
|
-
fields:
|
|
17
|
+
responses: c.responses.getAllStore,
|
|
18
|
+
fields: c.fields.listStore
|
|
34
19
|
},
|
|
35
20
|
effect: ({ responses: e, fields: t }) => {
|
|
36
|
-
|
|
37
|
-
for (let [i, a] of Object.entries(e)) {
|
|
38
|
-
let e = s(t, i);
|
|
39
|
-
e && e.key !== i && (n[e.key] = a, r = !0);
|
|
40
|
-
}
|
|
41
|
-
if (r) {
|
|
42
|
-
for (let e of Object.keys(n)) {
|
|
43
|
-
let n = t.find((t) => t.key === e);
|
|
44
|
-
n && n.id !== n.key && l.responses.clear(n.id);
|
|
45
|
-
}
|
|
46
|
-
l.responses.register(n);
|
|
47
|
-
}
|
|
21
|
+
l.set(o, s(e, t));
|
|
48
22
|
}
|
|
49
23
|
});
|
|
50
24
|
a({
|
|
51
|
-
source:
|
|
25
|
+
source: c.eventBus,
|
|
52
26
|
filter: (e) => e.type === "load",
|
|
53
|
-
target:
|
|
27
|
+
target: u
|
|
54
28
|
}), a({
|
|
55
|
-
source:
|
|
56
|
-
target:
|
|
57
|
-
}), a({
|
|
58
|
-
source: l.responses.getAllStore,
|
|
59
|
-
target: f
|
|
29
|
+
source: c.responses.getAllStore,
|
|
30
|
+
target: d
|
|
60
31
|
});
|
|
61
32
|
}
|
|
62
33
|
});
|
|
63
34
|
//#endregion
|
|
64
|
-
export {
|
|
35
|
+
export { c as responsesBrowserStoragePlugin };
|
|
@@ -7,7 +7,7 @@ async function r(e) {
|
|
|
7
7
|
let o = indexedDB.open(n, r);
|
|
8
8
|
o.onupgradeneeded = () => {
|
|
9
9
|
let e = o.result;
|
|
10
|
-
e.objectStoreNames.contains(t)
|
|
10
|
+
e.objectStoreNames.contains(t) && e.deleteObjectStore(t), e.createObjectStore(t, i ? { keyPath: i } : void 0);
|
|
11
11
|
}, o.onsuccess = () => e(o.result), o.onerror = () => a(Error(o.error?.message));
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -39,12 +39,13 @@ async function s(e, t) {
|
|
|
39
39
|
//#region src/plugins/responses-indexeddb/plugin.ts
|
|
40
40
|
var c = "responses", l = {
|
|
41
41
|
storeName: c,
|
|
42
|
-
keyPath: "
|
|
42
|
+
keyPath: "fieldKey",
|
|
43
|
+
version: 2
|
|
43
44
|
}, u = () => ({
|
|
44
45
|
name: "responses-indexdb-plugin",
|
|
45
46
|
setup: (n) => {
|
|
46
47
|
let u = e(async () => {
|
|
47
|
-
let e = (await i(await r(l), c)).reduce((e, {
|
|
48
|
+
let e = (await i(await r(l), c)).reduce((e, { fieldKey: t, value: n }) => (e[t] = n, e), {});
|
|
48
49
|
await n.responses.commit(e);
|
|
49
50
|
}), d = e(async (e) => {
|
|
50
51
|
await Promise.allSettled(e.map(async (e) => {
|
|
@@ -66,8 +67,11 @@ var c = "responses", l = {
|
|
|
66
67
|
fields: n.fields.listStore
|
|
67
68
|
},
|
|
68
69
|
fn: ({ responses: e, fields: t }) => {
|
|
69
|
-
let n = new Set(t.filter((e) => !e.policies?.doNotStoreValue).map((e) => e.
|
|
70
|
-
return e.filter((e) => n.has(e.
|
|
70
|
+
let n = new Set(t.filter((e) => !e.policies?.doNotStoreValue).map((e) => e.key));
|
|
71
|
+
return e.filter((e) => n.has(e.fieldKey)).map((e) => ({
|
|
72
|
+
fieldKey: e.fieldKey,
|
|
73
|
+
value: e.value
|
|
74
|
+
}));
|
|
71
75
|
},
|
|
72
76
|
target: d
|
|
73
77
|
}), t({
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../experience-instance-
|
|
1
|
+
import { t as e } from "../../experience-instance-Bl0OlS-y.js";
|
|
2
2
|
import { attach as t, createEffect as n, createEvent as r, createStore as i, sample as a } from "effector";
|
|
3
3
|
//#region src/server/index.ts
|
|
4
4
|
function o() {
|
|
@@ -101,18 +101,12 @@ function N(e) {
|
|
|
101
101
|
function P(e) {
|
|
102
102
|
return e.type === "action";
|
|
103
103
|
}
|
|
104
|
-
function F(e) {
|
|
105
|
-
return e.conditionId;
|
|
106
|
-
}
|
|
107
|
-
function I(e) {
|
|
108
|
-
return e.stepId;
|
|
109
|
-
}
|
|
110
104
|
//#endregion
|
|
111
105
|
//#region src/utils/node-tree/next-reachable-step-nodes.ts
|
|
112
|
-
var
|
|
106
|
+
var F = (e, t, n, r, i = /* @__PURE__ */ new Set()) => i.has(n.id) ? [] : (i.add(n.id), j(n) && !r ? [n] : t.filter((e) => e.sourceNodeId === n.id).flatMap((n) => {
|
|
113
107
|
let r = e.find((e) => e.id === n.destinationNodeId);
|
|
114
|
-
return r ?
|
|
115
|
-
})),
|
|
108
|
+
return r ? F(e, t, r, !1, i) : [];
|
|
109
|
+
})), I = (e, t, n) => F(e, t, n, !0, /* @__PURE__ */ new Set()), L = (e, t, n, r, i = /* @__PURE__ */ new Set()) => {
|
|
116
110
|
if (i.has(n.id)) return [-1, -1];
|
|
117
111
|
i.add(n.id);
|
|
118
112
|
let a = t.filter((e) => e.sourceNodeId === n.id);
|
|
@@ -121,11 +115,11 @@ var L = (e, t, n, r, i = /* @__PURE__ */ new Set()) => i.has(n.id) ? [] : (i.add
|
|
|
121
115
|
for (let n of a) {
|
|
122
116
|
let r = e.find((e) => e.id === n.destinationNodeId);
|
|
123
117
|
if (!r) continue;
|
|
124
|
-
let [a, c] =
|
|
118
|
+
let [a, c] = L(e, t, r, !1, new Set(i));
|
|
125
119
|
a !== -1 && (o = Math.min(o, a + 1), s = Math.max(s, c + 1));
|
|
126
120
|
}
|
|
127
121
|
return o === Infinity ? [-1, -1] : [o, s];
|
|
128
|
-
}, ee = (e, t, n) =>
|
|
122
|
+
}, ee = (e, t, n) => L(e, t, n, !0, /* @__PURE__ */ new Set()), R = (e, t, n, r = /* @__PURE__ */ new Set()) => {
|
|
129
123
|
if (r.has(n.id)) return [-1, -1];
|
|
130
124
|
if (r.add(n.id), n.type === "origin") return [0, 0];
|
|
131
125
|
let i = t.filter((e) => e.destinationNodeId === n.id);
|
|
@@ -134,62 +128,62 @@ var L = (e, t, n, r, i = /* @__PURE__ */ new Set()) => i.has(n.id) ? [] : (i.add
|
|
|
134
128
|
for (let n of i) {
|
|
135
129
|
let i = e.find((e) => e.id === n.sourceNodeId);
|
|
136
130
|
if (!i) continue;
|
|
137
|
-
let [s, c] =
|
|
131
|
+
let [s, c] = R(e, t, i, new Set(r));
|
|
138
132
|
s !== -1 && (a = Math.min(a, s + 1), o = Math.max(o, c + 1));
|
|
139
133
|
}
|
|
140
134
|
return a === Infinity ? [-1, -1] : [a, o];
|
|
141
|
-
}, te = (e, t, n) =>
|
|
142
|
-
if (!e) return
|
|
135
|
+
}, te = (e, t, n) => R(e, t, n, /* @__PURE__ */ new Set()), z = (e) => e.find((e) => e.type === "origin") || null, B = (e, t, n) => {
|
|
136
|
+
if (!e) return z(t);
|
|
143
137
|
let r = n.find((t) => t.sourceNodeId === e.id);
|
|
144
138
|
return r && t.find((e) => e.id === r.destinationNodeId) || null;
|
|
145
139
|
};
|
|
146
140
|
//#endregion
|
|
147
141
|
//#region src/utils/node-tree/get-next-node-from-condition.ts
|
|
148
|
-
async function
|
|
142
|
+
async function V(e, t, n, r) {
|
|
149
143
|
let i = e ? "true" : "false", a = r.find((e) => e.sourceNodeHandle === i && e.sourceNodeId === t);
|
|
150
144
|
return n.find((e) => e.id === a?.destinationNodeId);
|
|
151
145
|
}
|
|
152
146
|
//#endregion
|
|
153
147
|
//#region src/entities/experience-instance/experience-instance.ts
|
|
154
|
-
var
|
|
155
|
-
let p = u(), m = u(), h = u(), g = u(), _ = u(), v = u(), y = r.componentStore, b =
|
|
148
|
+
var H = c("experience-instance"), U = p(({ client: n, experience: r, target: i, options: c }) => {
|
|
149
|
+
let p = u(), m = u(), h = u(), g = u(), _ = u(), v = u(), y = r.componentStore, b = H.store("transitioning"), x = n.history.entriesStore.map((e) => e.filter((e) => e.experienceId === r.id)), S = x.map((e) => e.filter((e) => j(e.node))), C = x.map((e) => e.at(-1)?.node || null), w = o(n.steps.listStore, C, (e, t) => e.find((e) => t && j(t) && e.id === t.stepId) || null), T = o(n.steps.listStore, S, (e, t) => {
|
|
156
150
|
let n = t.at(-2);
|
|
157
151
|
if (!n || !j(n.node)) return null;
|
|
158
152
|
let r = n.node;
|
|
159
|
-
return e.find((e) => e.id === r.stepId
|
|
160
|
-
}), E = o(r.treeStore, C, ({ nodes: e, edges: t }, n) => n ?
|
|
153
|
+
return e.find((e) => e.id === r.stepId) || null;
|
|
154
|
+
}), E = o(r.treeStore, C, ({ nodes: e, edges: t }, n) => n ? I(e, t, n) : []), D = o(r.treeStore, C, ({ nodes: e, edges: t }, n) => n ? te(e, t, n) : [-1, -1]), O = o(r.treeStore, C, ({ nodes: e, edges: t }, n) => n ? ee(e, t, n) : [-1, -1]), k = H.store(!1), F = s(k, {
|
|
161
155
|
open: () => !0,
|
|
162
156
|
close: () => !1,
|
|
163
157
|
toggle: (e) => !e,
|
|
164
158
|
set: (e, t) => t
|
|
165
159
|
}), L = l(async () => {
|
|
166
160
|
n.history.back({ experienceId: r.id });
|
|
167
|
-
}),
|
|
161
|
+
}), R = a({
|
|
168
162
|
source: r.treeStore,
|
|
169
163
|
effect: async (e, t) => {
|
|
170
|
-
let i = e.nodes.find((e) => j(e) &&
|
|
164
|
+
let i = e.nodes.find((e) => j(e) && e.stepId === t);
|
|
171
165
|
i && n.history.push({
|
|
172
166
|
experienceId: r.id,
|
|
173
167
|
node: i
|
|
174
168
|
});
|
|
175
169
|
}
|
|
176
|
-
}),
|
|
170
|
+
}), U = a({
|
|
177
171
|
source: C,
|
|
178
172
|
effect: (e) => {}
|
|
179
173
|
}), W = a({
|
|
180
174
|
source: r.treeStore,
|
|
181
|
-
effect: async ({ nodes: e }) =>
|
|
175
|
+
effect: async ({ nodes: e }) => z(e)
|
|
182
176
|
}), G = a({
|
|
183
177
|
source: r.treeStore,
|
|
184
178
|
effect: async ({ nodes: e, edges: t }, n) => {
|
|
185
|
-
if (N(n)) return
|
|
179
|
+
if (N(n)) return B(n, e, t);
|
|
186
180
|
}
|
|
187
181
|
}), K = a({
|
|
188
182
|
source: r.treeStore,
|
|
189
183
|
effect: async ({ nodes: e, edges: r, conditions: i }, a) => {
|
|
190
184
|
if (!A(a)) return;
|
|
191
|
-
let o =
|
|
192
|
-
return
|
|
185
|
+
let o = i.find((e) => e.id === a.conditionId)?.logic;
|
|
186
|
+
return o ? V(!!await t(n, o), a.id, e, r) : void 0;
|
|
193
187
|
}
|
|
194
188
|
}), q = a({
|
|
195
189
|
source: r.treeStore,
|
|
@@ -225,15 +219,15 @@ var U = c("experience-instance"), W = p(({ client: n, experience: r, target: i,
|
|
|
225
219
|
return `${i}${a?.id}`, a || null;
|
|
226
220
|
}
|
|
227
221
|
}
|
|
228
|
-
}),
|
|
222
|
+
}), ne = l((e) => {
|
|
229
223
|
M(e) && n.experiences.launch({ id: e.experienceId });
|
|
230
224
|
}), J = a({
|
|
231
225
|
source: [C, r.treeStore],
|
|
232
|
-
effect: async ([e, { nodes: t, edges: n }]) =>
|
|
226
|
+
effect: async ([e, { nodes: t, edges: n }]) => B(e, t, n)
|
|
233
227
|
}), Y = a({
|
|
234
228
|
source: [C, r.treeStore],
|
|
235
|
-
effect: async ([e, { nodes: t, edges: n }]) =>
|
|
236
|
-
}),
|
|
229
|
+
effect: async ([e, { nodes: t, edges: n }]) => B(e, t, n)
|
|
230
|
+
}), re = l((e) => {
|
|
237
231
|
n.history.push({
|
|
238
232
|
experienceId: r.id,
|
|
239
233
|
node: e
|
|
@@ -283,8 +277,8 @@ var U = c("experience-instance"), W = p(({ client: n, experience: r, target: i,
|
|
|
283
277
|
cases: {
|
|
284
278
|
origin: G,
|
|
285
279
|
condition: K,
|
|
286
|
-
step:
|
|
287
|
-
launchExperience:
|
|
280
|
+
step: U,
|
|
281
|
+
launchExperience: ne,
|
|
288
282
|
action: q,
|
|
289
283
|
__: u()
|
|
290
284
|
}
|
|
@@ -298,7 +292,7 @@ var U = c("experience-instance"), W = p(({ client: n, experience: r, target: i,
|
|
|
298
292
|
q.doneData
|
|
299
293
|
],
|
|
300
294
|
filter: Boolean,
|
|
301
|
-
target:
|
|
295
|
+
target: re
|
|
302
296
|
}), d({
|
|
303
297
|
clock: m,
|
|
304
298
|
target: Y
|
|
@@ -334,7 +328,7 @@ var U = c("experience-instance"), W = p(({ client: n, experience: r, target: i,
|
|
|
334
328
|
target: L
|
|
335
329
|
}), d({
|
|
336
330
|
clock: g,
|
|
337
|
-
target:
|
|
331
|
+
target: R
|
|
338
332
|
}), d({
|
|
339
333
|
source: o([
|
|
340
334
|
K.pending,
|
|
@@ -345,7 +339,7 @@ var U = c("experience-instance"), W = p(({ client: n, experience: r, target: i,
|
|
|
345
339
|
fn: (e) => e.some(Boolean) ? "transitioning" : "ready",
|
|
346
340
|
target: b
|
|
347
341
|
}), d({
|
|
348
|
-
clock:
|
|
342
|
+
clock: U.doneData,
|
|
349
343
|
source: w,
|
|
350
344
|
filter: Boolean,
|
|
351
345
|
target: n.eventBus.prepend((e) => ({
|
|
@@ -388,11 +382,11 @@ var U = c("experience-instance"), W = p(({ client: n, experience: r, target: i,
|
|
|
388
382
|
target: [v]
|
|
389
383
|
}), _(), Z;
|
|
390
384
|
});
|
|
391
|
-
function
|
|
392
|
-
return m(
|
|
385
|
+
function W(e) {
|
|
386
|
+
return m(U, e);
|
|
393
387
|
}
|
|
394
|
-
var
|
|
395
|
-
let t =
|
|
388
|
+
var G = p(({ client: e }) => {
|
|
389
|
+
let t = H.store({}), n = u(), r = u(), i = u(), a = s(t, {
|
|
396
390
|
register(e, t) {
|
|
397
391
|
let n = [...e[t.experienceId] ?? []];
|
|
398
392
|
return n.push(t), {
|
|
@@ -407,7 +401,7 @@ var K = p(({ client: e }) => {
|
|
|
407
401
|
[n]: r ?? []
|
|
408
402
|
};
|
|
409
403
|
}
|
|
410
|
-
}), o = l(({ experience: t, target: n, options: r }) =>
|
|
404
|
+
}), o = l(({ experience: t, target: n, options: r }) => W({
|
|
411
405
|
client: e,
|
|
412
406
|
experience: t,
|
|
413
407
|
target: n,
|
|
@@ -478,8 +472,8 @@ var K = p(({ client: e }) => {
|
|
|
478
472
|
listStore: g
|
|
479
473
|
};
|
|
480
474
|
});
|
|
481
|
-
function
|
|
482
|
-
return m(
|
|
475
|
+
function K(e) {
|
|
476
|
+
return m(G, e);
|
|
483
477
|
}
|
|
484
478
|
//#endregion
|
|
485
|
-
export {
|
|
479
|
+
export { w as a, D as c, j as i, T as l, K as n, v as o, A as r, C as s, W as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./rules-logic-DDxCiq4P.cjs`);require(`./logger-fbvQC40v.cjs`);const t=require(`./supports-Dsjg-82e.cjs`);let n=require(`effector`),r=require(`@withease/factories`);function i(e){return!t.d()||!t.r()?[]:Array.from(window.document.querySelectorAll(e)).filter(e=>e instanceof HTMLElement)}var a=`open`;function o(e){if(!t.l())throw Error(`Shadow DOM is not supported in this environment`);return e.attachShadow({mode:a})}function s(){return new Promise((e,n)=>{if(!t.r()){n();return}document.readyState===`loading`?document.addEventListener(`readystatechange`,()=>e(),{once:!0}):e()})}function c(e,t){let n=new MutationObserver(r=>{document.contains(e)||(n.disconnect(),t())});n.observe(document.body,{childList:!0,subtree:!0})}var l=`picked-root`,u=`picked-target`,d=`picked-root`;function f(e,t){return[...e,{selector:`${d}[experience-id="${t}"]`,placement:`replace`}].flatMap(e=>{let n=i(e.selector).filter(e=>!h(e,t)&&!g(e,t));return{...e,elements:n}})}function p(e,t){return e.flatMap(e=>e.elements.map(n=>v(n,e.placement,t)))}function m(e,t){e.classList.add(u),e.classList.add(`${u}-${t}`)}function h(e,t){return t?e.classList.contains(`${u}-${t}`):e.classList.contains(`${u}`)}function g(e,t){return t?e.classList.contains(`${l}-${t}`):e.classList.contains(l)}function _(e){let t=document.createElement(`div`);return t.style.display=`block`,t.classList.add(l),t.classList.add(`${l}-${e}`),t}function v(e,t,n){let r,i=_(n);if(e instanceof Document)r=e.body.appendChild(i);else{switch(t){case`replace`:e.replaceWith(i);break;case`before`:e.before(i);break;case`after`:e.after(i);break;case`prepend`:e.prepend(i);break;case`append`:e.append(i);break}r=i}return r}function y(e){return e.type===`condition`}function b(e){return e.type===`step`}function x(e){return e.type===`experience`}function S(e){return e.type===`origin`}function C(e){return e.type===`action`}var w=(e,t,n,r,i=new Set)=>i.has(n.id)?[]:(i.add(n.id),b(n)&&!r?[n]:t.filter(e=>e.sourceNodeId===n.id).flatMap(n=>{let r=e.find(e=>e.id===n.destinationNodeId);return r?w(e,t,r,!1,i):[]})),T=(e,t,n)=>w(e,t,n,!0,new Set),E=(e,t,n,r,i=new Set)=>{if(i.has(n.id))return[-1,-1];i.add(n.id);let a=t.filter(e=>e.sourceNodeId===n.id);if(a.length===0)return[0,0];let o=1/0,s=-1/0;for(let n of a){let r=e.find(e=>e.id===n.destinationNodeId);if(!r)continue;let[a,c]=E(e,t,r,!1,new Set(i));a!==-1&&(o=Math.min(o,a+1),s=Math.max(s,c+1))}return o===1/0?[-1,-1]:[o,s]},D=(e,t,n)=>E(e,t,n,!0,new Set),O=(e,t,n,r=new Set)=>{if(r.has(n.id))return[-1,-1];if(r.add(n.id),n.type===`origin`)return[0,0];let i=t.filter(e=>e.destinationNodeId===n.id);if(i.length===0)return[-1,-1];let a=1/0,o=-1/0;for(let n of i){let i=e.find(e=>e.id===n.sourceNodeId);if(!i)continue;let[s,c]=O(e,t,i,new Set(r));s!==-1&&(a=Math.min(a,s+1),o=Math.max(o,c+1))}return a===1/0?[-1,-1]:[a,o]},k=(e,t,n)=>O(e,t,n,new Set),A=e=>e.find(e=>e.type===`origin`)||null,j=(e,t,n)=>{if(!e)return A(t);let r=n.find(t=>t.sourceNodeId===e.id);return r&&t.find(e=>e.id===r.destinationNodeId)||null};async function M(e,t,n,r){let i=e?`true`:`false`,a=r.find(e=>e.sourceNodeHandle===i&&e.sourceNodeId===t);return n.find(e=>e.id===a?.destinationNodeId)}var N=(0,n.createDomain)(`experience-instance`),P=(0,r.createFactory)(({client:t,experience:r,target:i,options:a})=>{let o=(0,n.createEvent)(),s=(0,n.createEvent)(),c=(0,n.createEvent)(),l=(0,n.createEvent)(),u=(0,n.createEvent)(),d=(0,n.createEvent)(),f=r.componentStore,p=N.store(`transitioning`),m=t.history.entriesStore.map(e=>e.filter(e=>e.experienceId===r.id)),h=m.map(e=>e.filter(e=>b(e.node))),g=m.map(e=>e.at(-1)?.node||null),_=(0,n.combine)(t.steps.listStore,g,(e,t)=>e.find(e=>t&&b(t)&&e.id===t.stepId)||null),v=(0,n.combine)(t.steps.listStore,h,(e,t)=>{let n=t.at(-2);if(!n||!b(n.node))return null;let r=n.node;return e.find(e=>e.id===r.stepId)||null}),w=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?T(e,t,n):[]),E=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?k(e,t,n):[-1,-1]),O=(0,n.combine)(r.treeStore,g,({nodes:e,edges:t},n)=>n?D(e,t,n):[-1,-1]),P=N.store(!1),F=(0,n.createApi)(P,{open:()=>!0,close:()=>!1,toggle:e=>!e,set:(e,t)=>t}),I=(0,n.createEffect)(async()=>{t.history.back({experienceId:r.id})}),L=(0,n.attach)({source:r.treeStore,effect:async(e,n)=>{let i=e.nodes.find(e=>b(e)&&e.stepId===n);i&&t.history.push({experienceId:r.id,node:i})}}),R=(0,n.attach)({source:g,effect:e=>{}}),z=(0,n.attach)({source:r.treeStore,effect:async({nodes:e})=>A(e)}),B=(0,n.attach)({source:r.treeStore,effect:async({nodes:e,edges:t},n)=>{if(S(n))return j(n,e,t)}}),V=(0,n.attach)({source:r.treeStore,effect:async({nodes:n,edges:r,conditions:i},a)=>{if(!y(a))return;let o=i.find(e=>e.id===a.conditionId)?.logic;return o?M(!!await e.t(t,o),a.id,n,r):void 0}}),H=(0,n.attach)({source:r.treeStore,effect:async({nodes:e,edges:n},r)=>{if(!C(r))return;let i=r.action;if(!i){`${r.id}`;return}let a=t.actions.getByName(i).getState();if(!a){`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceNodeHandle===`false`);return t?e.find(e=>e.id===t.destinationNodeId):null}if(typeof a.action!=`function`){`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceNodeHandle===`false`);return t?e.find(e=>e.id===t.destinationNodeId):null}try{`${i}`,await a.action(i);let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceNodeHandle===`true`);if(!t)return`${r.id}`,null;let o=e.find(e=>e.id===t.destinationNodeId);return`${i}${o?.id}`,o||null}catch{`${i}`;let t=n.find(e=>e.sourceNodeId===r.id&&e.sourceNodeHandle===`false`);if(!t)return`${r.id}`,null;let a=e.find(e=>e.id===t.destinationNodeId);return`${i}${a?.id}`,a||null}}}),U=(0,n.createEffect)(e=>{x(e)&&t.experiences.launch({id:e.experienceId})}),W=(0,n.attach)({source:[g,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),G=(0,n.attach)({source:[g,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),K=(0,n.createEffect)(e=>{t.history.push({experienceId:r.id,node:e})}),q=(0,n.attach)({source:r.configStore,effect:async({initializeOpenLogic:n})=>a?.initialiseOpen===void 0?e.n(n)?!!await e.t(t,n):n??!1:a.initialiseOpen}),J=Object.freeze({id:Math.random().toString(36).substring(7),experienceKey:r.key,experienceId:r.id,configStore:r.configStore,target:i,componentStore:f,stateStore:p,isOpenStore:P,open:F.open,close:F.close,toggleOpen:F.toggle,setOpen:F.set,treeStore:r.treeStore,currentNodeStore:g,currentStepStore:_,previousStepStore:v,nextReachableStepNodesStore:w,stepsToOriginStore:E,stepsToLeafStore:O,goToNextStep:s,goToPreviousStep:c,goToStepById:l,stepsHistoryStore:h}),Y=(0,n.createEvent)(),X=(0,n.createEvent)();return(0,n.sample)({source:g,target:Y}),(0,n.sample)({clock:Y,filter:e=>e===null,target:z}),(0,n.sample)({clock:Y,filter:e=>e!==null,target:X}),(0,n.split)({source:X,match:e=>y(e)?`condition`:b(e)?`step`:x(e)?`launchExperience`:S(e)?`origin`:C(e)?`action`:`other`,cases:{origin:B,condition:V,step:R,launchExperience:U,action:H,__:(0,n.createEvent)()}}),(0,n.sample)({clock:[V.doneData,B.doneData,z.doneData,G.doneData,W.doneData,H.doneData],filter:Boolean,target:K}),(0,n.sample)({clock:s,target:G}),(0,n.sample)({clock:s,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit`,step:e,experience:J}))}),(0,n.sample)({clock:G.done,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_success`,step:e,experience:J}))}),(0,n.sample)({clock:G.fail,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_error`,step:e,experience:J}))}),(0,n.sample)({clock:c,target:I}),(0,n.sample)({clock:l,target:L}),(0,n.sample)({source:(0,n.combine)([V.pending,B.pending,z.pending,G.pending]),fn:e=>e.some(Boolean)?`transitioning`:`ready`,target:p}),(0,n.sample)({clock:R.doneData,source:_,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_enter`,step:e,experience:J}))}),(0,n.sample)({clock:d,target:q}),(0,n.sample)({source:q.doneData,fn:Boolean,target:P}),(0,n.sample)({source:g,clock:o,filter:e=>e?S(e):!0,target:W}),(0,n.sample)({source:P,filter:Boolean,target:o}),(0,n.sample)({source:P,filter:Boolean,target:t.eventBus.prepend(()=>({type:`experience_open`,experience:J}))}),(0,n.sample)({source:P,filter:e=>!e,target:t.eventBus.prepend(()=>({type:`experience_close`,experience:J}))}),(0,n.sample)({clock:u,target:[d]}),u(),J});function F(e){return(0,r.invoke)(P,e)}var I=(0,r.createFactory)(({client:e})=>{let t=N.store({}),r=(0,n.createEvent)(),i=(0,n.createEvent)(),a=(0,n.createEvent)(),s=(0,n.createApi)(t,{register(e,t){let n=[...e[t.experienceId]??[]];return n.push(t),{...e,[t.experienceId]:n}},unregister(e,t){let n=t.experienceId,r=e[n]?.filter(e=>e!==t);return{...e,[n]:r??[]}}}),l=(0,n.createEffect)(({experience:t,target:n,options:r})=>F({client:e,experience:t,target:n,options:r})),u=(0,n.createEffect)(e=>{s.register(e)}),d=(0,n.createEffect)(e=>{e.target&&c(e.target,()=>{a(e)})}),f=(0,n.createEffect)(e=>{s.unregister(e)}),p=(0,n.createEffect)(t=>{let n=t.componentStore.getState();if(!n)return;let r=n.frameworkStore.getState();if(!r){`${n.name}`;return}let i=t.target;if(!i){`${t.experienceId}`;return}let a=o(i);try{r.render(a,n.component,e,t)}catch{}});(0,n.sample)({clock:r,target:l}),(0,n.sample)({clock:a,target:f}),(0,n.sample)({clock:l.doneData,target:[u,d,i]}),(0,n.sample)({clock:l.doneData,target:e.eventBus.prepend(e=>({type:`experience_initialize`,experience:e}))}),(0,n.sample)({clock:i,target:p});function m(e,t,n){r({experience:e,target:t,options:n})}let h=t.map(e=>Object.values(e).flat());function g(e){return t.map(t=>t[e]||[],{skipVoid:!1})}return{spawn:m,getByExperienceId:g,listStore:h}});function L(e){return(0,r.invoke)(I,e)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return F}});
|
|
@@ -8,8 +8,7 @@ export interface Condition {
|
|
|
8
8
|
}
|
|
9
9
|
declare const createConditionIndexFactory: () => {
|
|
10
10
|
register: (condition: Condition) => void;
|
|
11
|
-
|
|
12
|
-
getByKey: (key: Condition["key"]) => import('effector').Store<Condition | null>;
|
|
11
|
+
get: (key: Condition["key"]) => import('effector').Store<Condition | null>;
|
|
13
12
|
listStore: import('effector').Store<Condition[]>;
|
|
14
13
|
};
|
|
15
14
|
export declare function createConditionIndex(): ReturnType<typeof createConditionIndexFactory>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../../src/entities/condition/condition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAIrE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,CAAA;CACjB;AAGD,QAAA,MAAM,2BAA2B;0BAcF,SAAS,KAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../../src/entities/condition/condition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAIrE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,CAAA;CACjB;AAGD,QAAA,MAAM,2BAA2B;0BAcF,SAAS,KAAG,IAAI;eAQ3B,SAAS,CAAC,KAAK,CAAC;;CAWlC,CAAA;AAEF,wBAAgB,oBAAoB,IAAI,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAErF"}
|
|
@@ -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,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAI/D,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;;
|
|
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,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAI/D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,qBAAqB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AC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;CACjE;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,cAAc,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACvC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAClC,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC5B;AAED;;;;;GAKG;AAEH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,MAAM,EACd,YAAY,eAAe,EAC3B,UAAU,uBAAuB,SAkBlC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,MAAM,kBASzD,CAAA;AAmBD,eAAO,MAAM,0BAA0B,GACrC,QAAQ,MAAM,EACd,YAAY,eAAe,KAC1B,OAAO,CAAC,OAAO,CAiCjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAOL,KAAK,aAAa,EAGlB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAOL,KAAK,aAAa,EAGlB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,aAAa,EAAE,UAAU,CAAC,KAAK,CAAC,CAAA;IAChC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAC9B,WAAW,EAAE,eAAe,CAAC,aAAa,CAAC,CAAA;IAC3C,MAAM,EAAE,WAAW,GAAG,SAAS,CAAA;IAC/B,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;IACjD,UAAU,EAAE,KAAK,CAAC,eAAe,GAAG,OAAO,CAAC,CAAA;IAC5C,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IAC3B,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IACzB,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IAC1B,UAAU,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IAC/B,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAC/B,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAA;IACvC,gBAAgB,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CA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;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,CAAC,SAAS,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAAC,CAAC,CAAC,EACpE,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAEpE"}
|
|
@@ -83,9 +83,9 @@ export interface FieldBooleanMultiple extends FieldBase<boolean> {
|
|
|
83
83
|
export type Field = FieldTextSingular | FieldTextMultiple | FieldNumberSingular | FieldNumberMultiple | FieldObjectSingular | FieldObjectMultiple | FieldBooleanSingular | FieldBooleanMultiple;
|
|
84
84
|
declare const createFieldIndexFactory: () => {
|
|
85
85
|
register: (field: Field) => void;
|
|
86
|
-
update: (
|
|
87
|
-
getById: (
|
|
88
|
-
|
|
86
|
+
update: (key: FieldBase["key"], updates: Partial<Field>) => void;
|
|
87
|
+
getById: (key: FieldBase["key"]) => Store<Field | null>;
|
|
88
|
+
get: (key: FieldBase["key"]) => Store<Field | null>;
|
|
89
89
|
listStore: Store<Field[]>;
|
|
90
90
|
getByName: (name: FieldBase["name"]) => Store<Field | null>;
|
|
91
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/entities/field/field.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAI7D,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAElE,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAExD,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,gBAAgB;IAC/C,EAAE,EAAE,MAAM,CAAA;IACV,KA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AC,MAAM,CAAC,KAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;CAiBhE,CAAA;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAE7E"}
|
|
@@ -2,8 +2,6 @@ import { Field, FieldValue } from '../field/field';
|
|
|
2
2
|
import { LogicObject, LogicRule } from '../../logic-engine';
|
|
3
3
|
export interface ValidationError {
|
|
4
4
|
fieldKey: Field['key'];
|
|
5
|
-
/** @deprecated Use `fieldKey` instead. */
|
|
6
|
-
fieldId?: Field['id'];
|
|
7
5
|
userMessage: string;
|
|
8
6
|
systemMessage: string;
|
|
9
7
|
value: FieldValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-validation.d.ts","sourceRoot":"","sources":["../../../../src/entities/response/response-validation.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAuB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAGhE,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IACtB,
|
|
1
|
+
{"version":3,"file":"response-validation.d.ts","sourceRoot":"","sources":["../../../../src/entities/response/response-validation.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAuB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAGhE,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,UAAU,CAAA;CAClB;AAED,qEAAqE;AACrE,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAmFlF;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,IAAI,CAE/E;AAED;;;;;;;;;;GAUG;AAEH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CASzE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,IAAI,CAgE3F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,IAAI,CAsCvF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,aAAa,EAC3B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,EACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GACrC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAsCjC"}
|
|
@@ -6,10 +6,8 @@ export type { ValidationError } from './response-validation';
|
|
|
6
6
|
export type ResponsesStore = ReturnType<typeof createResponseIndex>;
|
|
7
7
|
export type Response = FieldValue;
|
|
8
8
|
export interface ResponseListItem {
|
|
9
|
-
/** @deprecated Use `fieldKey` instead. */
|
|
10
|
-
fieldId: string;
|
|
11
9
|
fieldKey: string;
|
|
12
|
-
value: Response
|
|
10
|
+
value: Response;
|
|
13
11
|
}
|
|
14
12
|
declare const createResponseIndexFactory: ({ client }: {
|
|
15
13
|
client: Picked;
|
|
@@ -28,14 +26,13 @@ declare const createResponseIndexFactory: ({ client }: {
|
|
|
28
26
|
validationErrors: ValidationError[];
|
|
29
27
|
}>;
|
|
30
28
|
listStore: Store<{
|
|
31
|
-
fieldId: string;
|
|
32
29
|
fieldKey: string;
|
|
33
30
|
value: FieldValue;
|
|
34
31
|
}[]>;
|
|
35
32
|
getAllStore: Store<{
|
|
36
33
|
[fieldKey: string]: FieldValue;
|
|
37
34
|
}>;
|
|
38
|
-
getByFieldId: (
|
|
35
|
+
getByFieldId: (id: Field["id"]) => Store<FieldValue>;
|
|
39
36
|
getByFieldKey: (key: Field["key"]) => Store<FieldValue>;
|
|
40
37
|
getByFieldName: (fieldName: Field["name"]) => Store<FieldValue>;
|
|
41
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/entities/response/response.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,EAAiE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAEpG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGvD,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAA;AAE9B,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAInE,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAA;AAGjC,MAAM,WAAW,gBAAgB;IAC/B,
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/entities/response/response.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,EAAiE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAEpG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGvD,OA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
|
1
2
|
export type StepsStore = ReturnType<typeof createStepIndex>;
|
|
2
3
|
export interface ExperienceStep {
|
|
3
4
|
id: string;
|
|
@@ -9,8 +10,9 @@ export interface ExperienceStep {
|
|
|
9
10
|
}
|
|
10
11
|
declare const createStepIndexFactory: () => {
|
|
11
12
|
register: (step: ExperienceStep) => void;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
get: (key: ExperienceStep["key"]) => Store<ExperienceStep | null>;
|
|
14
|
+
getById: (key: ExperienceStep["key"]) => Store<ExperienceStep | null>;
|
|
15
|
+
listStore: Store<ExperienceStep[]>;
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* Creates an Effector-based index for registering and retrieving steps.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/entities/step/step.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/entities/step/step.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAG9D,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAI3D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAGD,QAAA,MAAM,sBAAsB;qBAuBF,cAAc,KAAG,IAAI;eAkB3B,cAAc,CAAC,KAAK,CAAC,KAAG,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;mBAApD,cAAc,CAAC,KAAK,CAAC,KAAG,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;;CAYtE,CAAA;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAE3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,CAE/F"}
|
|
@@ -5,17 +5,17 @@ import { Picked } from '../picked';
|
|
|
5
5
|
export interface FieldValidation {
|
|
6
6
|
/** Dispatch on keyboard input — updates staged values and runs validation if the field has been touched. */
|
|
7
7
|
fieldInputEvent: EventCallable<{
|
|
8
|
-
|
|
8
|
+
fieldKey: string;
|
|
9
9
|
value: FieldValue;
|
|
10
10
|
}>;
|
|
11
11
|
/** Dispatch when a field value is committed (onchange) — updates staged values and runs validation if the field has been touched. */
|
|
12
12
|
fieldChangeEvent: EventCallable<{
|
|
13
|
-
|
|
13
|
+
fieldKey: string;
|
|
14
14
|
value: FieldValue;
|
|
15
15
|
}>;
|
|
16
16
|
/** Dispatch when a field loses focus — always runs full validation including required check. */
|
|
17
17
|
fieldBlurEvent: EventCallable<{
|
|
18
|
-
|
|
18
|
+
fieldKey: string;
|
|
19
19
|
value: FieldValue;
|
|
20
20
|
}>;
|
|
21
21
|
/** Which fields have been interacted with — used by formFieldsStore to show/hide errors. */
|
|
@@ -52,7 +52,7 @@ export interface FieldValidation {
|
|
|
52
52
|
* @example
|
|
53
53
|
* ```ts
|
|
54
54
|
* const validation = createFieldValidation(client, fieldsStore, stagedValuesStore)
|
|
55
|
-
* validation.fieldInputEvent({
|
|
55
|
+
* validation.fieldInputEvent({ fieldKey: 'email', value: 'hi' })
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
export declare function createFieldValidation(client: Picked, fieldsStore: Store<Field[]>, stagedValuesStore: StoreWritable<Record<string, FieldValue>>): FieldValidation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-field-validation.d.ts","sourceRoot":"","sources":["../../../src/form/create-field-validation.ts"],"names":[],"mappings":"AAAA,4GAA4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C,CAAA;IAC7D;;;;OAIG;IACH,gBAAgB,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;IACzE,kFAAkF;IAClF,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE,CAAC,CAAA;IACzC;;;;OAIG;IACH,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;CAC7D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,EAC3B,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAC3D,eAAe,CA2KjB"}
|
package/dist/types/picked.d.ts
CHANGED
|
@@ -182,15 +182,14 @@ export declare class Picked {
|
|
|
182
182
|
};
|
|
183
183
|
readonly conditions: {
|
|
184
184
|
register: (condition: Condition) => void;
|
|
185
|
-
|
|
186
|
-
getByKey: (key: Condition["key"]) => import('effector').Store<Condition | null>;
|
|
185
|
+
get: (key: Condition["key"]) => import('effector').Store<Condition | null>;
|
|
187
186
|
listStore: import('effector').Store<Condition[]>;
|
|
188
187
|
};
|
|
189
188
|
readonly fields: {
|
|
190
189
|
register: (field: Field) => void;
|
|
191
|
-
update: (
|
|
192
|
-
getById: (
|
|
193
|
-
|
|
190
|
+
update: (key: import('.').FieldBase["key"], updates: Partial<Field>) => void;
|
|
191
|
+
getById: (key: import('.').FieldBase["key"]) => import('effector').Store<Field | null>;
|
|
192
|
+
get: (key: import('.').FieldBase["key"]) => import('effector').Store<Field | null>;
|
|
194
193
|
listStore: import('effector').Store<Field[]>;
|
|
195
194
|
getByName: (name: import('.').FieldBase["name"]) => import('effector').Store<Field | null>;
|
|
196
195
|
};
|
|
@@ -209,20 +208,20 @@ export declare class Picked {
|
|
|
209
208
|
validationErrors: import('.').ValidationError[];
|
|
210
209
|
}>;
|
|
211
210
|
listStore: import('effector').Store<{
|
|
212
|
-
fieldId: string;
|
|
213
211
|
fieldKey: string;
|
|
214
212
|
value: import('.').FieldValue;
|
|
215
213
|
}[]>;
|
|
216
214
|
getAllStore: import('effector').Store<{
|
|
217
215
|
[fieldKey: string]: import('.').FieldValue;
|
|
218
216
|
}>;
|
|
219
|
-
getByFieldId: (
|
|
217
|
+
getByFieldId: (id: Field["id"]) => import('effector').Store<import('.').FieldValue>;
|
|
220
218
|
getByFieldKey: (key: Field["key"]) => import('effector').Store<import('.').FieldValue>;
|
|
221
219
|
getByFieldName: (fieldName: Field["name"]) => import('effector').Store<import('.').FieldValue>;
|
|
222
220
|
};
|
|
223
221
|
readonly steps: {
|
|
224
222
|
register: (step: ExperienceStep) => void;
|
|
225
|
-
|
|
223
|
+
get: (key: ExperienceStep["key"]) => import('effector').Store<ExperienceStep | null>;
|
|
224
|
+
getById: (key: ExperienceStep["key"]) => import('effector').Store<ExperienceStep | null>;
|
|
226
225
|
listStore: import('effector').Store<ExperienceStep[]>;
|
|
227
226
|
};
|
|
228
227
|
readonly actions: {
|