@picked/client 0.0.12-next.5 → 0.0.12-next.6
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/server/index.js +1 -1
- package/dist/esm/index.js +191 -191
- package/dist/esm/plugins/create-experience/index.js +45 -45
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-Bs9t-zff.js +777 -0
- package/dist/experience-instance-COUhADSj.cjs +1 -0
- package/dist/types/entities/experience/experience.d.ts +5 -5
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +3 -3
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/picked.d.ts +4 -4
- package/dist/types/plugins/create-experience/create-experience.d.ts +3 -3
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/experience-instance-BBz99AXU.js +0 -766
- package/dist/experience-instance-DDsqvl4c.cjs +0 -1
|
@@ -10,13 +10,13 @@ const a = {
|
|
|
10
10
|
name: "create-experience",
|
|
11
11
|
setup: (d) => {
|
|
12
12
|
i.experiences.forEach((l) => {
|
|
13
|
-
const s = l.serialize(),
|
|
14
|
-
|
|
13
|
+
const s = l.serialize(), o = a.deserialize(s);
|
|
14
|
+
o.component = l.component, d.registerExperience(o), o.fields.forEach((f) => {
|
|
15
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
22
|
experience: d,
|
|
@@ -24,27 +24,27 @@ const a = {
|
|
|
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
|
-
d.edges.push(
|
|
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
|
-
d.edges.push(
|
|
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
|
-
d.edges.push(
|
|
47
|
+
d.edges.push(o);
|
|
48
48
|
},
|
|
49
49
|
serialize() {
|
|
50
50
|
return a.serialize({
|
|
@@ -59,11 +59,11 @@ const a = {
|
|
|
59
59
|
label: i.label,
|
|
60
60
|
fields: i.fields ?? [],
|
|
61
61
|
addField(d) {
|
|
62
|
-
var s,
|
|
62
|
+
var s, o;
|
|
63
63
|
const l = "serialize" in d ? d : N(d);
|
|
64
|
-
return (s = this.fields) != null && s.includes(l) || (
|
|
64
|
+
return (s = this.fields) != null && s.includes(l) || (o = this.fields) == null || o.push(l), l;
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
66
|
+
}), g = (i, d) => {
|
|
67
67
|
const l = {
|
|
68
68
|
id: i.id ?? p("step"),
|
|
69
69
|
label: i.label,
|
|
@@ -91,14 +91,14 @@ const a = {
|
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
return h({ step: l, type: "step" }, d), l;
|
|
94
|
-
},
|
|
94
|
+
}, y = () => [0, 0], h = (i, d) => {
|
|
95
95
|
const l = {
|
|
96
96
|
id: p("node"),
|
|
97
|
-
position:
|
|
97
|
+
position: y(),
|
|
98
98
|
experience: d
|
|
99
99
|
};
|
|
100
100
|
if (i.type === "step") {
|
|
101
|
-
const
|
|
101
|
+
const o = {
|
|
102
102
|
...l,
|
|
103
103
|
type: "step",
|
|
104
104
|
connectedStep: i.step,
|
|
@@ -112,10 +112,10 @@ const a = {
|
|
|
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
|
|
118
|
+
const o = {
|
|
119
119
|
...l,
|
|
120
120
|
type: "conditional",
|
|
121
121
|
connectedConditional: i.conditional,
|
|
@@ -128,7 +128,7 @@ const a = {
|
|
|
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,
|
|
@@ -176,20 +176,20 @@ const a = {
|
|
|
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
195
|
return a.serialize({
|
|
@@ -230,7 +230,7 @@ const a = {
|
|
|
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) {
|
|
@@ -258,7 +258,7 @@ const a = {
|
|
|
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,
|
|
@@ -326,7 +326,7 @@ const a = {
|
|
|
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,
|
|
@@ -358,23 +358,23 @@ const a = {
|
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
360
|
}, E = (i) => {
|
|
361
|
-
const d = [], l = [], s = [],
|
|
361
|
+
const d = [], l = [], s = [], o = [], f = [];
|
|
362
362
|
return {
|
|
363
363
|
id: i.id,
|
|
364
364
|
component: i.component,
|
|
365
|
-
type: i.type,
|
|
366
365
|
name: i.name,
|
|
366
|
+
initializeOpen: i.initializeOpen,
|
|
367
367
|
decide: i.decide,
|
|
368
368
|
targets: i.targets,
|
|
369
369
|
steps: d,
|
|
370
370
|
nodes: l,
|
|
371
371
|
edges: s,
|
|
372
372
|
fields: f,
|
|
373
|
-
conditionals:
|
|
374
|
-
addStep(
|
|
373
|
+
conditionals: o,
|
|
374
|
+
addStep(n, e) {
|
|
375
375
|
let t = e == null ? void 0 : e.node;
|
|
376
376
|
this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
|
|
377
|
-
const r = "serialize" in
|
|
377
|
+
const r = "serialize" in n ? n : g(n, this);
|
|
378
378
|
if (t) {
|
|
379
379
|
if (!r.node)
|
|
380
380
|
throw new Error("todo no node");
|
|
@@ -388,10 +388,10 @@ const a = {
|
|
|
388
388
|
this.fields.includes(u) || this.fields.push(u);
|
|
389
389
|
}), this.steps.includes(r) || (this.steps.push(r), r.node && this.nodes.push(r.node)), r;
|
|
390
390
|
},
|
|
391
|
-
addAction(
|
|
391
|
+
addAction(n, e) {
|
|
392
392
|
let t = e == null ? void 0 : e.node;
|
|
393
393
|
this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
|
|
394
|
-
const r = "serialize" in
|
|
394
|
+
const r = "serialize" in n ? n : m(n, this);
|
|
395
395
|
if (t) {
|
|
396
396
|
const u = c(
|
|
397
397
|
{ sourceNode: t, destinationNode: r, sourceNodeHandle: null },
|
|
@@ -401,10 +401,10 @@ const a = {
|
|
|
401
401
|
}
|
|
402
402
|
return this.nodes.push(r), r;
|
|
403
403
|
},
|
|
404
|
-
addConditional(
|
|
404
|
+
addConditional(n, e) {
|
|
405
405
|
let t = e == null ? void 0 : e.node;
|
|
406
406
|
this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
|
|
407
|
-
const r = "serialize" in
|
|
407
|
+
const r = "serialize" in n ? n : z(n, this);
|
|
408
408
|
if (t) {
|
|
409
409
|
if (!r.node)
|
|
410
410
|
throw new Error("todo no node");
|
|
@@ -416,11 +416,11 @@ const a = {
|
|
|
416
416
|
}
|
|
417
417
|
return this.conditionals.includes(r) || (this.conditionals.push(r), r.node && this.nodes.push(r.node)), r;
|
|
418
418
|
},
|
|
419
|
-
addExperience(
|
|
419
|
+
addExperience(n, e) {
|
|
420
420
|
let t = e == null ? void 0 : e.node;
|
|
421
421
|
this.nodes.length === 0 && (t = h({ type: "origin" }, this), this.nodes.push(t));
|
|
422
422
|
const r = h(
|
|
423
|
-
{ type: "experience", experience:
|
|
423
|
+
{ type: "experience", experience: n },
|
|
424
424
|
this
|
|
425
425
|
);
|
|
426
426
|
if (this.nodes.push(r), t) {
|
|
@@ -430,27 +430,27 @@ const a = {
|
|
|
430
430
|
);
|
|
431
431
|
this.edges.push(u);
|
|
432
432
|
}
|
|
433
|
-
return
|
|
433
|
+
return n;
|
|
434
434
|
},
|
|
435
|
-
addField(
|
|
436
|
-
const t = "serialize" in
|
|
435
|
+
addField(n, e) {
|
|
436
|
+
const t = "serialize" in n ? n : N(n);
|
|
437
437
|
return e && e.fields.push(t), this.fields.includes(t) || this.fields.push(t), t;
|
|
438
438
|
},
|
|
439
439
|
serialize() {
|
|
440
440
|
return a.serialize({
|
|
441
441
|
id: this.id,
|
|
442
|
-
type: this.type,
|
|
443
442
|
component: this.component,
|
|
444
443
|
name: this.name,
|
|
444
|
+
initializeOpen: this.initializeOpen,
|
|
445
445
|
decide: this.decide,
|
|
446
446
|
targets: this.targets,
|
|
447
|
-
steps: this.steps.map((
|
|
448
|
-
nodes: this.nodes.map((
|
|
449
|
-
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())),
|
|
450
450
|
conditionals: this.conditionals.map(
|
|
451
|
-
(
|
|
451
|
+
(n) => a.deserialize(n.serialize())
|
|
452
452
|
),
|
|
453
|
-
fields: this.fields.map((
|
|
453
|
+
fields: this.fields.map((n) => a.deserialize(n.serialize()))
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
456
|
};
|
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-Bs9t-zff.js";
|
|
3
3
|
function R() {
|
|
4
4
|
let c, p;
|
|
5
5
|
return {
|