@picked/client 0.0.82 → 0.0.83-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/.tsbuildinfo +1 -1
- package/dist/{api-B_ewYO43.js → api-DqBJhsaz.js} +1 -1
- package/dist/{api-D8G-8HVZ.cjs → api-lXnAqLoj.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +417 -416
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/server/index.js +13 -13
- package/dist/{experience-instance-DGk11d8a.js → experience-instance-BibCf-8y.js} +299 -154
- package/dist/experience-instance-CMfjyLaI.cjs +1 -0
- package/dist/{plugin-DPZ8aMJt.cjs → plugin-K7326WFb.cjs} +1 -1
- package/dist/{plugin-WesBxGtC.js → plugin-WtyPGoxi.js} +2 -2
- package/dist/{provider-BR2HOdya.js → provider-Bv6_St9B.js} +1 -1
- package/dist/{provider-DFoze53Z.cjs → provider-DB9w0dEw.cjs} +1 -1
- package/dist/types/entities/experience/experience.d.ts +8 -0
- 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/utils/node-tree/min-max-steps-to-leaf.d.ts +16 -6
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +18 -7
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +30 -6
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/node-tree/node-adjacency.d.ts +50 -0
- package/dist/types/utils/node-tree/node-adjacency.d.ts.map +1 -0
- package/dist/types/utils/node-tree/node-tree-index.d.ts +57 -0
- package/dist/types/utils/node-tree/node-tree-index.d.ts.map +1 -0
- package/dist/{version-BZ7EkVfb.js → version-DSu8zrH_.js} +1 -1
- package/dist/{version-F-XKx24-.cjs → version-SYU8CWbk.cjs} +1 -1
- package/package.json +3 -3
- package/dist/experience-instance-Dej3P1sE.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "../../../plugin-
|
|
2
|
-
import { n as t, t as n } from "../../../api-
|
|
1
|
+
import { t as e } from "../../../plugin-WtyPGoxi.js";
|
|
2
|
+
import { n as t, t as n } from "../../../api-DqBJhsaz.js";
|
|
3
3
|
import { n as r } from "../../../registry-CXZv0uLg.js";
|
|
4
4
|
import { createClientHeaders as i, fetchSchema as a } from "@picked/delivery-api-client";
|
|
5
5
|
export { i as createClientHeaders, e as dynamicExperiencesPlugin, n as fetchExperienceContent, t as fetchProject, a as fetchSchema, r as registerPickedBundle };
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e, c as t,
|
|
2
|
-
import { n as s } from "../../plugin-
|
|
1
|
+
import { a as e, c as t, d as n, i as r, o as i, s as a, t as o } from "../../experience-instance-BibCf-8y.js";
|
|
2
|
+
import { n as s } from "../../plugin-WtyPGoxi.js";
|
|
3
3
|
import { attach as c, createEffect as l, createEvent as u, createStore as d, sample as f } from "effector";
|
|
4
4
|
//#region src/server/serialize.ts
|
|
5
5
|
var p = 1e4;
|
|
@@ -7,22 +7,22 @@ function m(e) {
|
|
|
7
7
|
if (e?.location !== void 0) return { location: e.location };
|
|
8
8
|
}
|
|
9
9
|
function h(e, t) {
|
|
10
|
-
return e.nodes.filter(
|
|
10
|
+
return e.nodes.filter(n).some((e) => t.get(e.stepId) === !0);
|
|
11
11
|
}
|
|
12
12
|
async function g(e, n = {}) {
|
|
13
|
-
let
|
|
13
|
+
let r = n.previewToken === void 0 ? void 0 : { previewToken: n.previewToken }, a = await e.getProjectConfig(r), o = e.session.store.getState().id;
|
|
14
14
|
e.conditionResults.reset(), s(e, a, {
|
|
15
15
|
isPreview: !1,
|
|
16
16
|
sessionId: o
|
|
17
17
|
});
|
|
18
18
|
let c = m(n.attributes), l = n.timeoutMs ?? p, u = new Map(a.steps.map((e) => [e.id, e.layoutContentId !== void 0 && e.layoutContentId !== null])), d = Object.fromEntries(a.conditions.map((e) => [e.key, e])), f = a.experiences.filter((e) => !t(e.condition, d)), g = (await Promise.all(f.map(async (t) => ({
|
|
19
19
|
experience: t,
|
|
20
|
-
active: await
|
|
20
|
+
active: await i(e, { condition: t.condition }, { context: c })
|
|
21
21
|
})))).filter((e) => e.active).map((e) => e.experience), _ = await Promise.all(g.filter((e) => h(e, u)).map((t) => e.getExperienceContent({
|
|
22
22
|
id: t.id,
|
|
23
23
|
key: t.key
|
|
24
24
|
}, {
|
|
25
|
-
...
|
|
25
|
+
...r,
|
|
26
26
|
signal: AbortSignal.timeout(l)
|
|
27
27
|
}))), v = /* @__PURE__ */ new Map();
|
|
28
28
|
for (let e of _) if (e) for (let t of [...e.references ?? [], ...e.content]) v.set(t.id, t);
|
|
@@ -46,7 +46,7 @@ function _() {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
function v(e, t) {
|
|
49
|
-
let { promise: n, resolve: r } = _(), i = u(),
|
|
49
|
+
let { promise: n, resolve: r } = _(), i = u(), a = u(), s = u(), p = u(), m = u(), h = e.experiences.listStore.map((t) => t.map((t) => o({
|
|
50
50
|
client: e,
|
|
51
51
|
experience: t
|
|
52
52
|
}))), g = d({
|
|
@@ -86,9 +86,9 @@ function v(e, t) {
|
|
|
86
86
|
isComplete: !0
|
|
87
87
|
})).reset(i), f({
|
|
88
88
|
clock: i,
|
|
89
|
-
target:
|
|
89
|
+
target: a
|
|
90
90
|
}), f({
|
|
91
|
-
clock:
|
|
91
|
+
clock: a,
|
|
92
92
|
source: {
|
|
93
93
|
experiences: h,
|
|
94
94
|
state: g
|
|
@@ -107,17 +107,17 @@ function v(e, t) {
|
|
|
107
107
|
target: s
|
|
108
108
|
}), f({
|
|
109
109
|
clock: s,
|
|
110
|
-
target:
|
|
110
|
+
target: a
|
|
111
111
|
}), f({
|
|
112
112
|
clock: y.doneData,
|
|
113
113
|
filter: (e) => e === null,
|
|
114
114
|
target: m
|
|
115
115
|
}), f({
|
|
116
116
|
clock: m,
|
|
117
|
-
target:
|
|
117
|
+
target: a
|
|
118
118
|
}), f({
|
|
119
119
|
clock: [
|
|
120
|
-
|
|
120
|
+
a,
|
|
121
121
|
m,
|
|
122
122
|
s
|
|
123
123
|
],
|
|
@@ -140,4 +140,4 @@ function v(e, t) {
|
|
|
140
140
|
}), i(), n;
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
143
|
-
export {
|
|
143
|
+
export { o as createExperienceInstance, r as evaluateConditionMemo, e as hashRule, i as isExperienceActive, s as registerProjectConfig, v as render, a as ruleReferencesAction, t as ruleReferencesActionDeep, g as serialize };
|