@picked/client 0.0.1-dev.1764632196476 → 0.0.1-dev.1764633009920
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/cjs/index.js +1 -1
- package/dist/cjs/plugins/create-experience/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/server/index.js +1 -1
- package/dist/esm/index.js +441 -460
- package/dist/esm/plugins/create-experience/index.js +121 -123
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +8 -8
- package/dist/esm/plugins/responses-browser-storage/index.js +6 -6
- package/dist/esm/plugins/responses-indexeddb/index.js +1 -1
- package/dist/esm/server/index.js +1 -1
- package/dist/{experience-instance-DjjpHk0t.cjs → experience-instance-BpQMqclI.cjs} +1 -1
- package/dist/{experience-instance-C4INDX6a.js → experience-instance-CMrX6QA2.js} +1 -1
- package/dist/types/client.d.ts +0 -31
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +1 -3
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/picked.d.ts +9 -12
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +1 -5
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +7 -10
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/user-session.d.ts +0 -2
- package/dist/types/utils/user-session.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
import { g as p } from "../../../id-BW-g3y32.js";
|
|
2
|
-
const
|
|
2
|
+
const a = {
|
|
3
3
|
serialize(i) {
|
|
4
4
|
return JSON.stringify(i);
|
|
5
5
|
},
|
|
6
6
|
deserialize(i) {
|
|
7
7
|
return JSON.parse(i);
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, x = (i) => ({
|
|
10
10
|
name: "create-experience",
|
|
11
|
-
setup: (
|
|
12
|
-
i.experiences.forEach((
|
|
13
|
-
const s =
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
setup: (d) => {
|
|
12
|
+
i.experiences.forEach((l) => {
|
|
13
|
+
const s = l.serialize(), o = a.deserialize(s);
|
|
14
|
+
o.component = l.component, d.registerExperience(o), o.fields.forEach((f) => {
|
|
15
|
+
d.registerField(f);
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
}),
|
|
19
|
+
}), m = (i, d) => ({
|
|
20
20
|
id: p("node"),
|
|
21
21
|
position: [0, 0],
|
|
22
|
-
experience:
|
|
22
|
+
experience: d,
|
|
23
23
|
type: "action",
|
|
24
24
|
action: i.action,
|
|
25
25
|
addNext(s) {
|
|
26
26
|
if (!s.node) throw new Error("Cannot connect to node");
|
|
27
|
-
const
|
|
27
|
+
const o = c(
|
|
28
28
|
{ sourceNode: this, destinationNode: s.node, sourceNodeHandle: null },
|
|
29
|
-
|
|
29
|
+
d
|
|
30
30
|
);
|
|
31
|
-
|
|
31
|
+
d.edges.push(o);
|
|
32
32
|
},
|
|
33
33
|
onSuccess(s) {
|
|
34
34
|
if (!s.node) throw new Error("Cannot connect to node");
|
|
35
|
-
const
|
|
35
|
+
const o = c(
|
|
36
36
|
{ sourceNode: this, destinationNode: s.node, sourceNodeHandle: "true" },
|
|
37
|
-
|
|
37
|
+
d
|
|
38
38
|
);
|
|
39
|
-
|
|
39
|
+
d.edges.push(o);
|
|
40
40
|
},
|
|
41
41
|
onFail(s) {
|
|
42
42
|
if (!s.node) throw new Error("Cannot connect to node");
|
|
43
|
-
const
|
|
43
|
+
const o = c(
|
|
44
44
|
{ sourceNode: this, destinationNode: s.node, sourceNodeHandle: "false" },
|
|
45
|
-
|
|
45
|
+
d
|
|
46
46
|
);
|
|
47
|
-
|
|
47
|
+
d.edges.push(o);
|
|
48
48
|
},
|
|
49
49
|
serialize() {
|
|
50
|
-
return
|
|
50
|
+
return a.serialize({
|
|
51
51
|
id: this.id,
|
|
52
52
|
type: this.type,
|
|
53
53
|
action: this.action,
|
|
54
54
|
position: this.position
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
}),
|
|
57
|
+
}), v = (i) => ({
|
|
58
58
|
id: i.id ?? p("step"),
|
|
59
59
|
label: i.label,
|
|
60
60
|
fields: i.fields ?? [],
|
|
61
|
-
addField(
|
|
62
|
-
var s,
|
|
63
|
-
const
|
|
64
|
-
return (s = this.fields) != null && s.includes(
|
|
61
|
+
addField(d) {
|
|
62
|
+
var s, o;
|
|
63
|
+
const l = "serialize" in d ? d : N(d);
|
|
64
|
+
return (s = this.fields) != null && s.includes(l) || (o = this.fields) == null || o.push(l), l;
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
67
|
-
const
|
|
66
|
+
}), g = (i, d) => {
|
|
67
|
+
const l = {
|
|
68
68
|
id: i.id ?? p("step"),
|
|
69
69
|
label: i.label,
|
|
70
|
-
experience:
|
|
70
|
+
experience: d,
|
|
71
71
|
fields: i.fields ?? [],
|
|
72
72
|
node: null,
|
|
73
73
|
nextStep(s) {
|
|
@@ -83,27 +83,27 @@ const r = {
|
|
|
83
83
|
return this.experience.addField(s, this);
|
|
84
84
|
},
|
|
85
85
|
serialize() {
|
|
86
|
-
return
|
|
86
|
+
return a.serialize({
|
|
87
87
|
id: this.id,
|
|
88
88
|
label: this.label,
|
|
89
89
|
fieldIds: this.fields.map((s) => s.id)
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
return h({ step:
|
|
94
|
-
},
|
|
95
|
-
const
|
|
93
|
+
return h({ step: l, type: "step" }, d), l;
|
|
94
|
+
}, y = () => [0, 0], h = (i, d) => {
|
|
95
|
+
const l = {
|
|
96
96
|
id: p("node"),
|
|
97
|
-
position:
|
|
98
|
-
experience:
|
|
97
|
+
position: y(),
|
|
98
|
+
experience: d
|
|
99
99
|
};
|
|
100
100
|
if (i.type === "step") {
|
|
101
|
-
const
|
|
102
|
-
...
|
|
101
|
+
const o = {
|
|
102
|
+
...l,
|
|
103
103
|
type: "step",
|
|
104
104
|
connectedStep: i.step,
|
|
105
105
|
serialize() {
|
|
106
|
-
return
|
|
106
|
+
return a.serialize({
|
|
107
107
|
id: this.id,
|
|
108
108
|
type: this.type,
|
|
109
109
|
stepId: this.connectedStep.id,
|
|
@@ -112,15 +112,15 @@ const r = {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
return
|
|
115
|
+
return o.connectedStep.node = o, o;
|
|
116
116
|
}
|
|
117
117
|
if (i.type === "conditional") {
|
|
118
|
-
const
|
|
119
|
-
...
|
|
118
|
+
const o = {
|
|
119
|
+
...l,
|
|
120
120
|
type: "conditional",
|
|
121
121
|
connectedConditional: i.conditional,
|
|
122
122
|
serialize() {
|
|
123
|
-
return
|
|
123
|
+
return a.serialize({
|
|
124
124
|
id: this.id,
|
|
125
125
|
type: this.type,
|
|
126
126
|
conditionalId: this.connectedConditional.id,
|
|
@@ -128,14 +128,14 @@ const r = {
|
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
return
|
|
131
|
+
return o.connectedConditional.node = o, o;
|
|
132
132
|
}
|
|
133
133
|
return i.type === "experience" ? {
|
|
134
|
-
...
|
|
134
|
+
...l,
|
|
135
135
|
type: "experience",
|
|
136
136
|
connectedExperience: i.experience,
|
|
137
137
|
serialize() {
|
|
138
|
-
return
|
|
138
|
+
return a.serialize({
|
|
139
139
|
id: this.id,
|
|
140
140
|
type: this.type,
|
|
141
141
|
experienceId: this.connectedExperience.id,
|
|
@@ -143,64 +143,64 @@ const r = {
|
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
} : {
|
|
146
|
-
...
|
|
146
|
+
...l,
|
|
147
147
|
type: "origin",
|
|
148
148
|
serialize() {
|
|
149
|
-
return
|
|
149
|
+
return a.serialize({
|
|
150
150
|
id: this.id,
|
|
151
151
|
type: this.type,
|
|
152
152
|
position: this.position
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
}, c = (i,
|
|
156
|
+
}, c = (i, d) => ({
|
|
157
157
|
id: p("edge"),
|
|
158
158
|
sourceNode: i.sourceNode,
|
|
159
159
|
sourceNodeHandle: i.sourceNodeHandle,
|
|
160
160
|
destinationNode: i.destinationNode,
|
|
161
|
-
experience:
|
|
161
|
+
experience: d,
|
|
162
162
|
serialize() {
|
|
163
|
-
return
|
|
163
|
+
return a.serialize({
|
|
164
164
|
id: this.id,
|
|
165
165
|
sourceNodeHandle: this.sourceNodeHandle ?? void 0,
|
|
166
166
|
sourceNodeId: this.sourceNode.id,
|
|
167
167
|
destinationNodeId: this.destinationNode.id
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
}),
|
|
171
|
-
const
|
|
170
|
+
}), z = (i, d) => {
|
|
171
|
+
const l = {
|
|
172
172
|
id: p("conditional"),
|
|
173
173
|
condition: i.condition,
|
|
174
174
|
node: null,
|
|
175
|
-
experience:
|
|
175
|
+
experience: d,
|
|
176
176
|
addTrue(s) {
|
|
177
177
|
if (!this.node || !s.node)
|
|
178
178
|
throw new Error("todo no node");
|
|
179
|
-
const
|
|
179
|
+
const o = c(
|
|
180
180
|
{ sourceNode: this.node, destinationNode: s.node, sourceNodeHandle: "true" },
|
|
181
181
|
this.experience
|
|
182
182
|
);
|
|
183
|
-
this.experience.edges.push(
|
|
183
|
+
this.experience.edges.push(o);
|
|
184
184
|
},
|
|
185
185
|
addFalse(s) {
|
|
186
186
|
if (!this.node || !s.node)
|
|
187
187
|
throw new Error("todo no node");
|
|
188
|
-
const
|
|
188
|
+
const o = c(
|
|
189
189
|
{ sourceNode: this.node, destinationNode: s.node, sourceNodeHandle: "false" },
|
|
190
190
|
this.experience
|
|
191
191
|
);
|
|
192
|
-
this.experience.edges.push(
|
|
192
|
+
this.experience.edges.push(o);
|
|
193
193
|
},
|
|
194
194
|
serialize() {
|
|
195
|
-
return
|
|
195
|
+
return a.serialize({
|
|
196
196
|
id: this.id,
|
|
197
197
|
condition: this.condition
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
return h({ conditional:
|
|
202
|
-
},
|
|
203
|
-
var
|
|
201
|
+
return h({ conditional: l, type: "conditional" }, d), l;
|
|
202
|
+
}, N = (i) => {
|
|
203
|
+
var l;
|
|
204
204
|
return {
|
|
205
205
|
id: i.id,
|
|
206
206
|
name: i.name,
|
|
@@ -214,7 +214,7 @@ const r = {
|
|
|
214
214
|
validation: i.validation ?? {},
|
|
215
215
|
condition: i.condition,
|
|
216
216
|
required: i.required,
|
|
217
|
-
options: ((
|
|
217
|
+
options: ((l = i.options) == null ? void 0 : l.map((s) => ({
|
|
218
218
|
...s
|
|
219
219
|
}))) ?? null,
|
|
220
220
|
policies: i.policies,
|
|
@@ -230,7 +230,7 @@ const r = {
|
|
|
230
230
|
validation: this.validation,
|
|
231
231
|
condition: this.condition,
|
|
232
232
|
policies: this.policies
|
|
233
|
-
},
|
|
233
|
+
}, o = typeof this.defaultValue == "string" ? this.defaultValue : void 0, f = typeof this.defaultValue == "number" ? this.defaultValue : void 0, n = typeof this.defaultValue == "boolean" ? this.defaultValue : void 0;
|
|
234
234
|
switch (this.type) {
|
|
235
235
|
case "text":
|
|
236
236
|
if (this.multiple) {
|
|
@@ -241,7 +241,7 @@ const r = {
|
|
|
241
241
|
typeof t == "string" && e.push(t);
|
|
242
242
|
e.length === 0 && (e = void 0);
|
|
243
243
|
}
|
|
244
|
-
return
|
|
244
|
+
return a.serialize({
|
|
245
245
|
...s,
|
|
246
246
|
type: "text",
|
|
247
247
|
multiple: !0,
|
|
@@ -254,11 +254,11 @@ const r = {
|
|
|
254
254
|
})) : null
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
return
|
|
257
|
+
return a.serialize({
|
|
258
258
|
...s,
|
|
259
259
|
type: "text",
|
|
260
260
|
multiple: !1,
|
|
261
|
-
defaultValue:
|
|
261
|
+
defaultValue: o,
|
|
262
262
|
options: this.options ? this.options.map((e) => ({
|
|
263
263
|
id: e.id,
|
|
264
264
|
label: e.label,
|
|
@@ -275,7 +275,7 @@ const r = {
|
|
|
275
275
|
typeof t == "number" && e.push(t);
|
|
276
276
|
e.length === 0 && (e = void 0);
|
|
277
277
|
}
|
|
278
|
-
return
|
|
278
|
+
return a.serialize({
|
|
279
279
|
...s,
|
|
280
280
|
type: "number",
|
|
281
281
|
multiple: !0,
|
|
@@ -288,7 +288,7 @@ const r = {
|
|
|
288
288
|
})) : null
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
return
|
|
291
|
+
return a.serialize({
|
|
292
292
|
...s,
|
|
293
293
|
type: "number",
|
|
294
294
|
multiple: !1,
|
|
@@ -309,7 +309,7 @@ const r = {
|
|
|
309
309
|
typeof t == "boolean" && e.push(t);
|
|
310
310
|
e.length === 0 && (e = void 0);
|
|
311
311
|
}
|
|
312
|
-
return
|
|
312
|
+
return a.serialize({
|
|
313
313
|
...s,
|
|
314
314
|
type: "boolean",
|
|
315
315
|
multiple: !0,
|
|
@@ -322,11 +322,11 @@ const r = {
|
|
|
322
322
|
})) : null
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
return
|
|
325
|
+
return a.serialize({
|
|
326
326
|
...s,
|
|
327
327
|
type: "boolean",
|
|
328
328
|
multiple: !1,
|
|
329
|
-
defaultValue:
|
|
329
|
+
defaultValue: n,
|
|
330
330
|
options: this.options ? this.options.map((e) => ({
|
|
331
331
|
id: e.id,
|
|
332
332
|
label: e.label,
|
|
@@ -357,113 +357,111 @@ const r = {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
|
-
},
|
|
361
|
-
const
|
|
360
|
+
}, E = (i) => {
|
|
361
|
+
const d = [], l = [], s = [], o = [], f = [];
|
|
362
362
|
return {
|
|
363
363
|
id: i.id,
|
|
364
364
|
component: i.component,
|
|
365
365
|
name: i.name,
|
|
366
366
|
initializeOpen: i.initializeOpen,
|
|
367
|
-
condition: N,
|
|
368
367
|
decide: i.decide,
|
|
369
368
|
targets: i.targets,
|
|
370
|
-
steps:
|
|
371
|
-
nodes:
|
|
369
|
+
steps: d,
|
|
370
|
+
nodes: l,
|
|
372
371
|
edges: s,
|
|
373
372
|
fields: f,
|
|
374
|
-
conditionals:
|
|
375
|
-
addStep(
|
|
376
|
-
let
|
|
377
|
-
this.nodes.length === 0 && (
|
|
378
|
-
const
|
|
379
|
-
if (
|
|
380
|
-
if (!
|
|
373
|
+
conditionals: o,
|
|
374
|
+
addStep(n, e) {
|
|
375
|
+
let t = e == null ? void 0 : e.node;
|
|
376
|
+
this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
|
|
377
|
+
const r = "serialize" in n ? n : g(n, this);
|
|
378
|
+
if (t) {
|
|
379
|
+
if (!r.node)
|
|
381
380
|
throw new Error("todo no node");
|
|
382
381
|
const u = c(
|
|
383
|
-
{ sourceNode:
|
|
382
|
+
{ sourceNode: t, destinationNode: r.node, sourceNodeHandle: null },
|
|
384
383
|
this
|
|
385
384
|
);
|
|
386
385
|
this.edges.push(u);
|
|
387
386
|
}
|
|
388
|
-
return
|
|
387
|
+
return r.fields.length > 0 && r.fields.forEach((u) => {
|
|
389
388
|
this.fields.includes(u) || this.fields.push(u);
|
|
390
|
-
}), this.steps.includes(
|
|
389
|
+
}), this.steps.includes(r) || (this.steps.push(r), r.node && this.nodes.push(r.node)), r;
|
|
391
390
|
},
|
|
392
|
-
addAction(
|
|
393
|
-
let
|
|
394
|
-
this.nodes.length === 0 && (
|
|
395
|
-
const
|
|
396
|
-
if (
|
|
391
|
+
addAction(n, e) {
|
|
392
|
+
let t = e == null ? void 0 : e.node;
|
|
393
|
+
this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
|
|
394
|
+
const r = "serialize" in n ? n : m(n, this);
|
|
395
|
+
if (t) {
|
|
397
396
|
const u = c(
|
|
398
|
-
{ sourceNode:
|
|
397
|
+
{ sourceNode: t, destinationNode: r, sourceNodeHandle: null },
|
|
399
398
|
this
|
|
400
399
|
);
|
|
401
400
|
this.edges.push(u);
|
|
402
401
|
}
|
|
403
|
-
return this.nodes.push(
|
|
402
|
+
return this.nodes.push(r), r;
|
|
404
403
|
},
|
|
405
|
-
addConditional(
|
|
406
|
-
let
|
|
407
|
-
this.nodes.length === 0 && (
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
410
|
-
if (!
|
|
404
|
+
addConditional(n, e) {
|
|
405
|
+
let t = e == null ? void 0 : e.node;
|
|
406
|
+
this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
|
|
407
|
+
const r = "serialize" in n ? n : z(n, this);
|
|
408
|
+
if (t) {
|
|
409
|
+
if (!r.node)
|
|
411
410
|
throw new Error("todo no node");
|
|
412
411
|
const u = c(
|
|
413
|
-
{ sourceNode:
|
|
412
|
+
{ sourceNode: t, destinationNode: r.node, sourceNodeHandle: null },
|
|
414
413
|
this
|
|
415
414
|
);
|
|
416
415
|
this.edges.push(u);
|
|
417
416
|
}
|
|
418
|
-
return this.conditionals.includes(
|
|
417
|
+
return this.conditionals.includes(r) || (this.conditionals.push(r), r.node && this.nodes.push(r.node)), r;
|
|
419
418
|
},
|
|
420
|
-
addExperience(
|
|
421
|
-
let
|
|
422
|
-
this.nodes.length === 0 && (
|
|
423
|
-
const
|
|
424
|
-
{ type: "experience", experience:
|
|
419
|
+
addExperience(n, e) {
|
|
420
|
+
let t = e == null ? void 0 : e.node;
|
|
421
|
+
this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
|
|
422
|
+
const r = h(
|
|
423
|
+
{ type: "experience", experience: n },
|
|
425
424
|
this
|
|
426
425
|
);
|
|
427
|
-
if (this.nodes.push(
|
|
426
|
+
if (this.nodes.push(r), t) {
|
|
428
427
|
const u = c(
|
|
429
|
-
{ sourceNode:
|
|
428
|
+
{ sourceNode: t, destinationNode: r, sourceNodeHandle: null },
|
|
430
429
|
this
|
|
431
430
|
);
|
|
432
431
|
this.edges.push(u);
|
|
433
432
|
}
|
|
434
|
-
return
|
|
433
|
+
return n;
|
|
435
434
|
},
|
|
436
|
-
addField(
|
|
437
|
-
const
|
|
438
|
-
return
|
|
435
|
+
addField(n, e) {
|
|
436
|
+
const t = "serialize" in n ? n : N(n);
|
|
437
|
+
return e && e.fields.push(t), this.fields.includes(t) || this.fields.push(t), t;
|
|
439
438
|
},
|
|
440
439
|
serialize() {
|
|
441
|
-
return
|
|
440
|
+
return a.serialize({
|
|
442
441
|
id: this.id,
|
|
443
442
|
component: this.component,
|
|
444
443
|
name: this.name,
|
|
445
444
|
initializeOpen: this.initializeOpen,
|
|
446
|
-
condition: this.condition ?? this.decide,
|
|
447
445
|
decide: this.decide,
|
|
448
446
|
targets: this.targets,
|
|
449
|
-
steps: this.steps.map((
|
|
450
|
-
nodes: this.nodes.map((
|
|
451
|
-
edges: this.edges.map((
|
|
447
|
+
steps: this.steps.map((n) => a.deserialize(n.serialize())),
|
|
448
|
+
nodes: this.nodes.map((n) => a.deserialize(n.serialize())),
|
|
449
|
+
edges: this.edges.map((n) => a.deserialize(n.serialize())),
|
|
452
450
|
conditionals: this.conditionals.map(
|
|
453
|
-
(
|
|
451
|
+
(n) => a.deserialize(n.serialize())
|
|
454
452
|
),
|
|
455
|
-
fields: this.fields.map((
|
|
453
|
+
fields: this.fields.map((n) => a.deserialize(n.serialize()))
|
|
456
454
|
});
|
|
457
455
|
}
|
|
458
456
|
};
|
|
459
457
|
};
|
|
460
458
|
export {
|
|
461
|
-
|
|
459
|
+
z as createConditional,
|
|
462
460
|
c as createEdge,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
461
|
+
E as createExperience,
|
|
462
|
+
x as createExperiencePlugin,
|
|
463
|
+
N as createField,
|
|
466
464
|
h as createNode,
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
v as createStep,
|
|
466
|
+
a as serialization
|
|
469
467
|
};
|
|
@@ -16,7 +16,7 @@ const y = ({
|
|
|
16
16
|
});
|
|
17
17
|
i({
|
|
18
18
|
source: n.eventBus,
|
|
19
|
-
filter: (e) => e.type === "
|
|
19
|
+
filter: (e) => e.type === "experience_initialized" && "experienceInstance" in e,
|
|
20
20
|
// @ts-ignore todo
|
|
21
21
|
fn: (e) => e.experienceInstance,
|
|
22
22
|
target: p
|
|
@@ -4,19 +4,19 @@ const a = l("history", "global"), f = ({
|
|
|
4
4
|
storage: i = "local"
|
|
5
5
|
} = {}) => ({
|
|
6
6
|
name: "history-browser-storage-plugin",
|
|
7
|
-
setup: (
|
|
8
|
-
const
|
|
9
|
-
const t =
|
|
10
|
-
t &&
|
|
7
|
+
setup: (e) => {
|
|
8
|
+
const o = i === "local" ? y : g, n = s(async () => {
|
|
9
|
+
const t = o.get(a).json();
|
|
10
|
+
t && e.history.restore({ entries: t });
|
|
11
11
|
}), c = s(async (t) => {
|
|
12
|
-
|
|
12
|
+
o.set(a, t);
|
|
13
13
|
});
|
|
14
14
|
r({
|
|
15
|
-
source:
|
|
16
|
-
filter: (t) => t.type === "
|
|
15
|
+
source: e.eventBus,
|
|
16
|
+
filter: (t) => t.type === "initialized",
|
|
17
17
|
target: n
|
|
18
18
|
}), r({
|
|
19
|
-
source:
|
|
19
|
+
source: e.history.entriesStore,
|
|
20
20
|
target: c
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -9,26 +9,26 @@ const p = b("responses", "global"), y = ({
|
|
|
9
9
|
const s = n.get(p).json();
|
|
10
10
|
if (!s)
|
|
11
11
|
return null;
|
|
12
|
-
Object.entries(s).forEach(([
|
|
13
|
-
e.responses.register(
|
|
12
|
+
Object.entries(s).forEach(([t, o]) => {
|
|
13
|
+
e.responses.register(t, o);
|
|
14
14
|
});
|
|
15
15
|
}), f = m({
|
|
16
16
|
source: {
|
|
17
17
|
responses: e.responses.getAllStore,
|
|
18
18
|
fields: e.fields.listStore
|
|
19
19
|
},
|
|
20
|
-
effect: ({ responses: s, fields:
|
|
20
|
+
effect: ({ responses: s, fields: t }) => {
|
|
21
21
|
const o = {};
|
|
22
22
|
Object.entries(s).forEach(([a, g]) => {
|
|
23
23
|
var c;
|
|
24
|
-
const
|
|
25
|
-
!((c =
|
|
24
|
+
const r = t.find((S) => S.id === a);
|
|
25
|
+
!((c = r == null ? void 0 : r.policies) != null && c.doNotStoreValue) && (o[a] = g);
|
|
26
26
|
}), n.set(p, o);
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
l({
|
|
30
30
|
source: e.eventBus,
|
|
31
|
-
filter: (s) => s.type === "
|
|
31
|
+
filter: (s) => s.type === "initialized",
|
|
32
32
|
target: u
|
|
33
33
|
}), l({
|
|
34
34
|
source: e.responses.getAllStore,
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEvent as i, createStore as v, createEffect as C, sample as n, attach as S } from "effector";
|
|
2
|
-
import { h as F } from "../../experience-instance-
|
|
2
|
+
import { h as F } from "../../experience-instance-CMrX6QA2.js";
|
|
3
3
|
function R() {
|
|
4
4
|
let c, p;
|
|
5
5
|
return {
|