@picked/client 0.0.12-next.14 → 0.0.12-next.2
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/shopify/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +745 -150
- package/dist/esm/plugins/create-experience/index.js +45 -45
- package/dist/esm/plugins/shopify/index.js +36 -68
- package/dist/esm/plugins/single-page-app/index.js +3 -3
- package/dist/esm/plugins/web-components/index.js +1 -1
- package/dist/esm/plugins/window-object/index.js +1 -1
- package/dist/esm/server/index.js +7 -7
- package/dist/experience-instance-BBz99AXU.js +766 -0
- package/dist/experience-instance-DDsqvl4c.cjs +1 -0
- package/dist/{supports-DBMT17KZ.js → supports-BjhuLJ8z.js} +10 -10
- 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/entities/feature/feature.d.ts +2 -5
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/picked.d.ts +4 -4
- package/dist/types/picked.d.ts.map +1 -1
- 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/dist/types/plugins/shopify/index.d.ts +0 -2
- package/dist/types/plugins/shopify/index.d.ts.map +1 -1
- package/dist/types/plugins/shopify/{predicates.d.ts → shopify.d.ts} +6 -20
- package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
- package/dist/types/plugins/shopify/{global-obj.d.ts → utils.d.ts} +1 -8
- package/dist/types/plugins/shopify/utils.d.ts.map +1 -0
- package/dist/types/utils/events.d.ts +4 -10
- package/dist/types/utils/events.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/experience-instance-B2l_MG7I.cjs +0 -1
- package/dist/experience-instance-CeuHLrdL.js +0 -781
- package/dist/types/plugins/shopify/global-obj.d.ts.map +0 -1
- package/dist/types/plugins/shopify/picked-config.d.ts +0 -96
- package/dist/types/plugins/shopify/picked-config.d.ts.map +0 -1
- package/dist/types/plugins/shopify/predicates.d.ts.map +0 -1
- package/dist/user-session-D-l-VMTb.cjs +0 -1
- package/dist/user-session-Ht0ayuo5.js +0 -632
|
@@ -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(), n = a.deserialize(s);
|
|
14
|
+
n.component = l.component, d.registerExperience(n), n.fields.forEach((f) => {
|
|
15
15
|
d.registerField(f);
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
}),
|
|
19
|
+
}), y = (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 n = c(
|
|
28
28
|
{ sourceNode: this, destinationNode: s.node, sourceNodeHandle: null },
|
|
29
29
|
d
|
|
30
30
|
);
|
|
31
|
-
d.edges.push(
|
|
31
|
+
d.edges.push(n);
|
|
32
32
|
},
|
|
33
33
|
onSuccess(s) {
|
|
34
34
|
if (!s.node) throw new Error("Cannot connect to node");
|
|
35
|
-
const
|
|
35
|
+
const n = c(
|
|
36
36
|
{ sourceNode: this, destinationNode: s.node, sourceNodeHandle: "true" },
|
|
37
37
|
d
|
|
38
38
|
);
|
|
39
|
-
d.edges.push(
|
|
39
|
+
d.edges.push(n);
|
|
40
40
|
},
|
|
41
41
|
onFail(s) {
|
|
42
42
|
if (!s.node) throw new Error("Cannot connect to node");
|
|
43
|
-
const
|
|
43
|
+
const n = c(
|
|
44
44
|
{ sourceNode: this, destinationNode: s.node, sourceNodeHandle: "false" },
|
|
45
45
|
d
|
|
46
46
|
);
|
|
47
|
-
d.edges.push(
|
|
47
|
+
d.edges.push(n);
|
|
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, n;
|
|
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) || (n = this.fields) == null || n.push(l), l;
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
66
|
+
}), m = (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
|
+
}, g = () => [0, 0], h = (i, d) => {
|
|
95
95
|
const l = {
|
|
96
96
|
id: p("node"),
|
|
97
|
-
position:
|
|
97
|
+
position: g(),
|
|
98
98
|
experience: d
|
|
99
99
|
};
|
|
100
100
|
if (i.type === "step") {
|
|
101
|
-
const
|
|
101
|
+
const n = {
|
|
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 n.connectedStep.node = n, n;
|
|
116
116
|
}
|
|
117
117
|
if (i.type === "conditional") {
|
|
118
|
-
const
|
|
118
|
+
const n = {
|
|
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 n.connectedConditional.node = n, n;
|
|
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 n = 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(n);
|
|
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 n = 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(n);
|
|
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
|
+
}, n = typeof this.defaultValue == "string" ? this.defaultValue : void 0, f = typeof this.defaultValue == "number" ? this.defaultValue : void 0, o = 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: n,
|
|
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: o,
|
|
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 = [], n = [], f = [];
|
|
362
362
|
return {
|
|
363
363
|
id: i.id,
|
|
364
364
|
component: i.component,
|
|
365
|
+
type: i.type,
|
|
365
366
|
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: n,
|
|
374
|
+
addStep(o, 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 o ? o : m(o, 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(o, 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 o ? o : y(o, 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(o, 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 o ? o : z(o, 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(o, 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: o },
|
|
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 o;
|
|
434
434
|
},
|
|
435
|
-
addField(
|
|
436
|
-
const t = "serialize" in
|
|
435
|
+
addField(o, e) {
|
|
436
|
+
const t = "serialize" in o ? o : N(o);
|
|
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,
|
|
442
443
|
component: this.component,
|
|
443
444
|
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((o) => a.deserialize(o.serialize())),
|
|
448
|
+
nodes: this.nodes.map((o) => a.deserialize(o.serialize())),
|
|
449
|
+
edges: this.edges.map((o) => a.deserialize(o.serialize())),
|
|
450
450
|
conditionals: this.conditionals.map(
|
|
451
|
-
(
|
|
451
|
+
(o) => a.deserialize(o.serialize())
|
|
452
452
|
),
|
|
453
|
-
fields: this.fields.map((
|
|
453
|
+
fields: this.fields.map((o) => a.deserialize(o.serialize()))
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
456
|
};
|
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
|
|
3
|
-
import "../../../experience-instance-CeuHLrdL.js";
|
|
4
|
-
import "effector";
|
|
5
|
-
function p() {
|
|
6
|
-
var e;
|
|
7
|
-
if (n())
|
|
8
|
-
return (e = window.pickedConfig) == null ? void 0 : e.product;
|
|
9
|
-
}
|
|
10
|
-
function s() {
|
|
11
|
-
var e;
|
|
12
|
-
if (n())
|
|
13
|
-
return (e = window.pickedConfig) == null ? void 0 : e.collection;
|
|
14
|
-
}
|
|
15
|
-
function m() {
|
|
16
|
-
var e, o;
|
|
17
|
-
if (n())
|
|
18
|
-
return (o = (e = window.pickedConfig) == null ? void 0 : e.storefront_api) == null ? void 0 : o.token;
|
|
19
|
-
}
|
|
20
|
-
const t = {
|
|
1
|
+
import { a as p } from "../../../supports-BjhuLJ8z.js";
|
|
2
|
+
const a = {
|
|
21
3
|
homepage: /^\/$/,
|
|
4
|
+
productPage: /(?:^|\/)products\/(?<productHandle>[^/]+)\/?$/,
|
|
5
|
+
collection: /^\/collections\/[^/]+\/?$/,
|
|
22
6
|
page: /(?:^|\/)pages\/[^/]+$/,
|
|
23
7
|
blog: /(?:^|\/)blogs\/(?<blogHandle>[^/]+)\/?$/,
|
|
24
8
|
article: /^\/blogs\/[^/]+\/(?<article>[^/]+)\/?$/,
|
|
@@ -28,74 +12,58 @@ const t = {
|
|
|
28
12
|
accountWildcard: /^\/account\/.+/,
|
|
29
13
|
accountLogin: /^\/account\/login(?:\/|$)/,
|
|
30
14
|
accountRegister: /^\/account\/register(?:\/|$)/
|
|
31
|
-
},
|
|
15
|
+
}, n = /^\/collections\/(?<collectionHandle>[^/]+)(?:\/|$)/, t = (e, o) => o ? !!e.exec(o.pathname) : !1, i = (e, o) => {
|
|
32
16
|
if (o) {
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
return
|
|
17
|
+
const c = e.exec(o.pathname);
|
|
18
|
+
if (c)
|
|
19
|
+
return c[1];
|
|
36
20
|
}
|
|
37
|
-
},
|
|
38
|
-
var o, i;
|
|
39
|
-
switch (e) {
|
|
40
|
-
case "product":
|
|
41
|
-
return ((o = p()) == null ? void 0 : o.handle) ?? !1;
|
|
42
|
-
case "collection":
|
|
43
|
-
return ((i = s()) == null ? void 0 : i.handle) ?? !1;
|
|
44
|
-
default:
|
|
45
|
-
return !1;
|
|
46
|
-
}
|
|
47
|
-
}, l = {
|
|
21
|
+
}, s = {
|
|
48
22
|
// Pages
|
|
49
|
-
"is-page": ({ location: e }) => a
|
|
50
|
-
"get-page-handle": ({ location: e }) =>
|
|
23
|
+
"is-page": ({ location: e }) => t(a.page, e),
|
|
24
|
+
"get-page-handle": ({ location: e }) => i(a.page, e),
|
|
51
25
|
// Products
|
|
52
|
-
"is-product-page": () =>
|
|
53
|
-
"get-product-handle": () =>
|
|
26
|
+
"is-product-page": ({ location: e }) => t(a.productPage, e),
|
|
27
|
+
"get-product-handle": ({ location: e }) => i(a.productPage, e),
|
|
54
28
|
// Collections
|
|
55
|
-
"is-collection-page": () =>
|
|
56
|
-
"get-collection-handle": () =>
|
|
29
|
+
"is-collection-page": ({ location: e }) => t(a.collection, e),
|
|
30
|
+
"get-collection-handle": ({ location: e }) => i(n, e),
|
|
57
31
|
// Blogs
|
|
58
|
-
"is-blog-page": ({ location: e }) => a
|
|
59
|
-
"get-blog-handle": ({ location: e }) =>
|
|
32
|
+
"is-blog-page": ({ location: e }) => t(a.blog, e),
|
|
33
|
+
"get-blog-handle": ({ location: e }) => i(a.blog, e),
|
|
60
34
|
// Blog Articles
|
|
61
|
-
"is-article-page": ({ location: e }) => a
|
|
62
|
-
"get-article-handle": ({ location: e }) =>
|
|
35
|
+
"is-article-page": ({ location: e }) => t(a.article, e),
|
|
36
|
+
"get-article-handle": ({ location: e }) => i(a.article, e),
|
|
63
37
|
// Apps
|
|
64
|
-
"is-app-proxy-page": ({ location: e }) => a
|
|
65
|
-
"get-app-proxy-handle": ({ location: e }) =>
|
|
38
|
+
"is-app-proxy-page": ({ location: e }) => t(a.appProxy, e),
|
|
39
|
+
"get-app-proxy-handle": ({ location: e }) => i(a.appProxy, e),
|
|
66
40
|
// Account
|
|
67
|
-
"is-account-page": ({ location: e }) => a
|
|
68
|
-
"is-login-page": ({ location: e }) => a
|
|
69
|
-
"is-register-page": ({ location: e }) => a
|
|
41
|
+
"is-account-page": ({ location: e }) => t(a.accountWildcard, e),
|
|
42
|
+
"is-login-page": ({ location: e }) => t(a.accountLogin, e),
|
|
43
|
+
"is-register-page": ({ location: e }) => t(a.accountRegister, e),
|
|
70
44
|
// Cart
|
|
71
|
-
"is-cart-page": ({ location: e }) => a
|
|
45
|
+
"is-cart-page": ({ location: e }) => t(a.cart, e),
|
|
72
46
|
// Checkout
|
|
73
|
-
"is-checkout-page": ({ location: e }) => a
|
|
47
|
+
"is-checkout-page": ({ location: e }) => t(a.checkout, e),
|
|
74
48
|
// Homepage
|
|
75
|
-
"is-homepage": ({ location: e }) => a
|
|
49
|
+
"is-homepage": ({ location: e }) => t(a.homepage, e)
|
|
76
50
|
};
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
function u(e) {
|
|
82
|
-
var o, i;
|
|
83
|
-
return typeof ((i = (o = g()) == null ? void 0 : o.analytics) == null ? void 0 : i.publish) == "function";
|
|
51
|
+
function r(e) {
|
|
52
|
+
var o, c;
|
|
53
|
+
return typeof ((c = (o = e.Shopify) == null ? void 0 : o.analytics) == null ? void 0 : c.publish) == "function";
|
|
84
54
|
}
|
|
85
|
-
const
|
|
55
|
+
const g = () => ({
|
|
86
56
|
name: "shopify",
|
|
87
57
|
setup: (e) => {
|
|
88
|
-
Object.entries(
|
|
89
|
-
e.registerPredicate(`shopify-${o}`,
|
|
90
|
-
}),
|
|
91
|
-
|
|
58
|
+
Object.entries(s).forEach(([o, c]) => {
|
|
59
|
+
e.registerPredicate(`shopify-${o}`, c);
|
|
60
|
+
}), p() && e.eventBus.watch((o) => {
|
|
61
|
+
r(window) && o.type === "session" && window.Shopify.analytics.publish("picked:session", {
|
|
92
62
|
id: o.id
|
|
93
63
|
});
|
|
94
64
|
});
|
|
95
65
|
}
|
|
96
66
|
});
|
|
97
67
|
export {
|
|
98
|
-
|
|
99
|
-
g as getShopify,
|
|
100
|
-
w as shopifyPlugin
|
|
68
|
+
g as shopifyPlugin
|
|
101
69
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as f, G as c,
|
|
1
|
+
import { a as f, G as c, f as m } from "../../../supports-BjhuLJ8z.js";
|
|
2
2
|
import { p as a } from "../../../object-JwZ58NOH.js";
|
|
3
3
|
const o = c;
|
|
4
4
|
let s;
|
|
5
|
-
const
|
|
5
|
+
const d = (r) => ({
|
|
6
6
|
name: "single-page-app",
|
|
7
7
|
setup: (n) => {
|
|
8
8
|
r.instrumentHistory && f() && h(() => {
|
|
@@ -33,5 +33,5 @@ function h(r) {
|
|
|
33
33
|
a(o.history, "pushState", n), a(o.history, "replaceState", n);
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
d as singlePageAppPlugin
|
|
37
37
|
};
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createEvent as i, createStore as
|
|
2
|
-
import {
|
|
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-BBz99AXU.js";
|
|
3
3
|
function R() {
|
|
4
4
|
let c, p;
|
|
5
5
|
return {
|
|
@@ -11,19 +11,19 @@ function R() {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
function w(c, p) {
|
|
14
|
-
const { promise: g, resolve: t } = R(), o = i(), s = i(), l = i(), m = i(), d = i(), I = c.experiences.listStore.map((e) => e.map((r) => F({ client: c, experience: r }))), x =
|
|
14
|
+
const { promise: g, resolve: t } = R(), o = i(), s = i(), l = i(), m = i(), d = i(), I = c.experiences.listStore.map((e) => e.map((r) => F({ client: c, experience: r }))), x = v({
|
|
15
15
|
currentExperienceIndex: 0,
|
|
16
16
|
renderedExperiences: [],
|
|
17
17
|
isComplete: !1
|
|
18
|
-
}), f =
|
|
18
|
+
}), f = C(
|
|
19
19
|
async ({
|
|
20
20
|
experience: e,
|
|
21
21
|
availableRenderers: r,
|
|
22
|
-
startRendererIndex:
|
|
22
|
+
startRendererIndex: h = 0
|
|
23
23
|
}) => {
|
|
24
24
|
if (!e)
|
|
25
25
|
return null;
|
|
26
|
-
for (let a =
|
|
26
|
+
for (let a = h; a < r.length; a++) {
|
|
27
27
|
const u = r[a], E = e.componentStore.getState();
|
|
28
28
|
if (E && (u != null && u.isValidComponent(E.component)))
|
|
29
29
|
return { rendered: await u.render(E.component, c, e), rendererIndex: a };
|
|
@@ -75,7 +75,7 @@ function w(c, p) {
|
|
|
75
75
|
filter: ({ experiences: e, state: r }) => r.currentExperienceIndex >= e.length,
|
|
76
76
|
target: m
|
|
77
77
|
});
|
|
78
|
-
const k =
|
|
78
|
+
const k = S({
|
|
79
79
|
source: x,
|
|
80
80
|
effect: (e) => {
|
|
81
81
|
e.isComplete && t(e.renderedExperiences);
|