@picked/client 0.0.1-dev.1778468342672 → 0.0.1-dev.1778730134956
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-BFD1TEJW.js → api-B-CbCRqb.js} +1 -1
- package/dist/{api-D_w_sQ8k.cjs → api-CPRRXVw6.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dom-observer/index.js +1 -0
- package/dist/cjs/plugins/dynamic-experiences/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/server/index.js +1 -1
- package/dist/docs/workspaces.mdx +1 -1
- package/dist/dom-C3C6Fmwz.cjs +1 -0
- package/dist/dom-DGePXPpM.js +84 -0
- package/dist/esm/index.js +330 -314
- package/dist/esm/plugins/create-experience/index.js +1 -1
- package/dist/esm/plugins/dom-observer/index.js +87 -0
- package/dist/esm/plugins/dynamic-experiences/index.js +1 -1
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-BOhvCj_F.js +430 -0
- package/dist/experience-instance-D8yKenBU.cjs +1 -0
- package/dist/types/entities/experience-instance/experience-instance.d.ts +12 -0
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +3 -0
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +1 -0
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/picked.d.ts +4 -0
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dom-observer/index.d.ts +3 -0
- package/dist/types/plugins/dom-observer/index.d.ts.map +1 -0
- package/dist/types/plugins/dom-observer/plugin.d.ts +50 -0
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +1 -0
- package/package.json +11 -1
- package/dist/experience-instance-BrLWgVAN.js +0 -501
- package/dist/experience-instance-Ct3ogC7n.cjs +0 -1
- /package/dist/{id-Bv44ilEo.cjs → id-Cg7fVl1O.cjs} +0 -0
- /package/dist/{id-CRqy981z.js → id-n2yrHvNo.js} +0 -0
- /package/dist/{storage-B6lQtc4-.cjs → storage-BXSlLTRa.cjs} +0 -0
- /package/dist/{storage-6Xk0uAxB.js → storage-hOHCCXvP.js} +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import "../../../logger-6z_gb4rA.js";
|
|
2
|
+
import { d as e, r as t } from "../../../supports-0XIfd4-R.js";
|
|
3
|
+
import { r as n } from "../../../dom-DGePXPpM.js";
|
|
4
|
+
import { createEffect as r, createEvent as i, createStore as a, sample as o } from "effector";
|
|
5
|
+
//#region src/plugins/dom-observer/plugin.ts
|
|
6
|
+
var s = /* @__PURE__ */ new WeakSet(), c = () => ({
|
|
7
|
+
name: "dom-observer",
|
|
8
|
+
setup: (e) => {
|
|
9
|
+
l() && (s.has(e) || (s.add(e), u(e)));
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
function l() {
|
|
13
|
+
return !(!e() || !t() || typeof MutationObserver != "function" || typeof requestAnimationFrame != "function");
|
|
14
|
+
}
|
|
15
|
+
function u(e) {
|
|
16
|
+
n().then(() => {
|
|
17
|
+
document.body && d(e);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function d(e) {
|
|
21
|
+
let t = i(), n = a(/* @__PURE__ */ new Map()).on(t, (e, { id: t, selectors: n }) => {
|
|
22
|
+
let r = new Map(e);
|
|
23
|
+
return n.length > 0 ? r.set(t, n) : r.delete(t), r;
|
|
24
|
+
}), s = /* @__PURE__ */ new Map();
|
|
25
|
+
e.experiences.listStore.watch((e) => {
|
|
26
|
+
for (let n of e) {
|
|
27
|
+
if (s.has(n.id)) continue;
|
|
28
|
+
let e = n.configStore.watch((e) => {
|
|
29
|
+
t({
|
|
30
|
+
id: n.id,
|
|
31
|
+
selectors: f(e.targetSelectors)
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
s.set(n.id, e);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
let c = r(async (e) => {
|
|
38
|
+
await Promise.all(e.map(async (e) => {
|
|
39
|
+
await e.shouldInitialiseFx() && await e.initialiseFx(void 0);
|
|
40
|
+
}));
|
|
41
|
+
});
|
|
42
|
+
c.fail.watch(({ error: e }) => {});
|
|
43
|
+
let l = i();
|
|
44
|
+
o({
|
|
45
|
+
clock: l,
|
|
46
|
+
source: {
|
|
47
|
+
selectorsById: n,
|
|
48
|
+
experiences: e.experiences.listStore
|
|
49
|
+
},
|
|
50
|
+
fn: ({ selectorsById: e, experiences: t }, n) => t.filter((t) => {
|
|
51
|
+
let r = e.get(t.id);
|
|
52
|
+
return r ? r.some((e) => p(n, e)) : !1;
|
|
53
|
+
}),
|
|
54
|
+
target: c
|
|
55
|
+
});
|
|
56
|
+
let u = [], d, m = () => {
|
|
57
|
+
d = void 0;
|
|
58
|
+
let e = u;
|
|
59
|
+
u = [], l(e);
|
|
60
|
+
};
|
|
61
|
+
new MutationObserver((e) => {
|
|
62
|
+
let t = !1;
|
|
63
|
+
for (let n of e) if (n.type === "childList") for (let e of n.addedNodes) e instanceof Element && (u.push(e), t = !0);
|
|
64
|
+
t && (d ??= requestAnimationFrame(m));
|
|
65
|
+
}).observe(document.body, {
|
|
66
|
+
childList: !0,
|
|
67
|
+
subtree: !0
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function f(e) {
|
|
71
|
+
let t = [];
|
|
72
|
+
for (let n of e) {
|
|
73
|
+
let e = n.selector.trim();
|
|
74
|
+
e.length > 0 && t.push(e);
|
|
75
|
+
}
|
|
76
|
+
return t;
|
|
77
|
+
}
|
|
78
|
+
function p(e, t) {
|
|
79
|
+
for (let n of e) try {
|
|
80
|
+
if (n.matches(t) || n.querySelector(t) !== null) return !0;
|
|
81
|
+
} catch {
|
|
82
|
+
return !1;
|
|
83
|
+
}
|
|
84
|
+
return !1;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { c as domObserverPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../../logger-6z_gb4rA.js";
|
|
2
2
|
import { d as e } from "../../../supports-0XIfd4-R.js";
|
|
3
|
-
import { n as t, r as n, t as r } from "../../../storage-
|
|
3
|
+
import { n as t, r as n, t as r } from "../../../storage-hOHCCXvP.js";
|
|
4
4
|
import { createEffect as i, sample as a } from "effector";
|
|
5
5
|
//#region src/plugins/experience-browser-storage/plugin.ts
|
|
6
6
|
var o = ({ storage: o = "local" } = {}) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as e } from "../../../supports-0XIfd4-R.js";
|
|
2
|
-
import { n as t, r as n, t as r } from "../../../storage-
|
|
2
|
+
import { n as t, r as n, t as r } from "../../../storage-hOHCCXvP.js";
|
|
3
3
|
import { createEffect as i, sample as a } from "effector";
|
|
4
4
|
//#region src/plugins/history-browser-storage/plugin.ts
|
|
5
5
|
var o = r("history", "global"), s = ({ storage: r = "local" } = {}) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as e } from "../../../supports-0XIfd4-R.js";
|
|
2
|
-
import { n as t, r as n, t as r } from "../../../storage-
|
|
2
|
+
import { n as t, r as n, t as r } from "../../../storage-hOHCCXvP.js";
|
|
3
3
|
import { attach as i, createEffect as a, sample as o } from "effector";
|
|
4
4
|
//#region src/plugins/responses-browser-storage/plugin.ts
|
|
5
5
|
var s = r("responses", "global");
|
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-BOhvCj_F.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() {
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { n as e, t } from "./rules-logic-D_CVBuv7.js";
|
|
2
|
+
import "./logger-6z_gb4rA.js";
|
|
3
|
+
import { n, o as r } from "./dom-DGePXPpM.js";
|
|
4
|
+
import { attach as i, combine as a, createApi as o, createDomain as s, createEffect as c, createEvent as l, sample as u, split as d } from "effector";
|
|
5
|
+
import { createFactory as f, invoke as p } from "@withease/factories";
|
|
6
|
+
//#region src/utils/nodes.ts
|
|
7
|
+
function m(e) {
|
|
8
|
+
return e.type === "condition";
|
|
9
|
+
}
|
|
10
|
+
function h(e) {
|
|
11
|
+
return e.type === "step";
|
|
12
|
+
}
|
|
13
|
+
function g(e) {
|
|
14
|
+
return e.type === "experience";
|
|
15
|
+
}
|
|
16
|
+
function _(e) {
|
|
17
|
+
return e.type === "origin";
|
|
18
|
+
}
|
|
19
|
+
function v(e) {
|
|
20
|
+
return e.type === "action";
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/utils/node-tree/next-reachable-step-nodes.ts
|
|
24
|
+
var y = (e, t, n, r, i = /* @__PURE__ */ new Set()) => i.has(n.id) ? [] : (i.add(n.id), h(n) && !r ? [n] : t.filter((e) => e.sourceNodeId === n.id).flatMap((n) => {
|
|
25
|
+
let r = e.find((e) => e.id === n.destinationNodeId);
|
|
26
|
+
return r ? y(e, t, r, !1, i) : [];
|
|
27
|
+
})), ee = (e, t, n) => y(e, t, n, !0, /* @__PURE__ */ new Set()), b = (e, t, n, r, i = /* @__PURE__ */ new Set()) => {
|
|
28
|
+
if (i.has(n.id)) return [-1, -1];
|
|
29
|
+
i.add(n.id);
|
|
30
|
+
let a = t.filter((e) => e.sourceNodeId === n.id);
|
|
31
|
+
if (a.length === 0) return [0, 0];
|
|
32
|
+
let o = Infinity, s = -Infinity;
|
|
33
|
+
for (let n of a) {
|
|
34
|
+
let r = e.find((e) => e.id === n.destinationNodeId);
|
|
35
|
+
if (!r) continue;
|
|
36
|
+
let [a, c] = b(e, t, r, !1, new Set(i));
|
|
37
|
+
a !== -1 && (o = Math.min(o, a + 1), s = Math.max(s, c + 1));
|
|
38
|
+
}
|
|
39
|
+
return o === Infinity ? [-1, -1] : [o, s];
|
|
40
|
+
}, x = (e, t, n) => b(e, t, n, !0, /* @__PURE__ */ new Set()), S = (e, t, n, r = /* @__PURE__ */ new Set()) => {
|
|
41
|
+
if (r.has(n.id)) return [-1, -1];
|
|
42
|
+
if (r.add(n.id), n.type === "origin") return [0, 0];
|
|
43
|
+
let i = t.filter((e) => e.destinationNodeId === n.id);
|
|
44
|
+
if (i.length === 0) return [-1, -1];
|
|
45
|
+
let a = Infinity, o = -Infinity;
|
|
46
|
+
for (let n of i) {
|
|
47
|
+
let i = e.find((e) => e.id === n.sourceNodeId);
|
|
48
|
+
if (!i) continue;
|
|
49
|
+
let [s, c] = S(e, t, i, new Set(r));
|
|
50
|
+
s !== -1 && (a = Math.min(a, s + 1), o = Math.max(o, c + 1));
|
|
51
|
+
}
|
|
52
|
+
return a === Infinity ? [-1, -1] : [a, o];
|
|
53
|
+
}, te = (e, t, n) => S(e, t, n, /* @__PURE__ */ new Set()), C = (e) => e.find((e) => e.type === "origin") || null, w = (e, t, n) => {
|
|
54
|
+
if (!e) return C(t);
|
|
55
|
+
let r = n.find((t) => t.sourceNodeId === e.id);
|
|
56
|
+
return r && t.find((e) => e.id === r.destinationNodeId) || null;
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/utils/node-tree/get-next-node-from-condition.ts
|
|
60
|
+
async function ne(e, t, n, r) {
|
|
61
|
+
let i = e ? "true" : "false", a = r.find((e) => e.sourceHandle === i && e.sourceNodeId === t);
|
|
62
|
+
return n.find((e) => e.id === a?.destinationNodeId);
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/entities/experience-instance/experience-instance.ts
|
|
66
|
+
var T = s("experience-instance"), E = f(({ client: r, experience: s, target: f, options: p }) => {
|
|
67
|
+
let y = l(), b = l(), S = l(), E = l(), D = l(), O = l(), k = l(), A = s.componentStore, j = T.store("transitioning"), M = r.history.entriesStore.map((e) => e.filter((e) => e.experienceId === s.id)), N = M.map((e) => e.filter((e) => h(e.node))), re = N.map((e) => e.length >= 2), P = M.map((e) => e.at(-1)?.node || null), F = a(r.steps.listStore, P, (e, t) => e.find((e) => t && h(t) && e.id === t.stepId) || null), I = a(r.steps.listStore, N, (e, t) => {
|
|
68
|
+
let n = t.at(-2);
|
|
69
|
+
if (!n || !h(n.node)) return null;
|
|
70
|
+
let r = n.node;
|
|
71
|
+
return e.find((e) => e.id === r.stepId) || null;
|
|
72
|
+
}), L = a(s.treeStore, P, ({ nodes: e, edges: t }, n) => n ? ee(e, t, n) : []), R = a(s.treeStore, P, ({ nodes: e, edges: t }, n) => n ? te(e, t, n) : [-1, -1]), z = a(s.treeStore, P, ({ nodes: e, edges: t }, n) => n ? x(e, t, n) : [-1, -1]), B = T.store(!1), V = o(B, {
|
|
73
|
+
open: () => !0,
|
|
74
|
+
close: () => !1,
|
|
75
|
+
toggle: (e) => !e,
|
|
76
|
+
set: (e, t) => t
|
|
77
|
+
}), ie = c(async () => {
|
|
78
|
+
r.history.back({ experienceId: s.id });
|
|
79
|
+
}), ae = i({
|
|
80
|
+
source: s.treeStore,
|
|
81
|
+
effect: async (e, t) => {
|
|
82
|
+
let n = e.nodes.find((e) => h(e) && e.stepId === t);
|
|
83
|
+
n && r.history.push({
|
|
84
|
+
experienceId: s.id,
|
|
85
|
+
node: n
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}), H = i({
|
|
89
|
+
source: P,
|
|
90
|
+
effect: (e) => {}
|
|
91
|
+
}), U = i({
|
|
92
|
+
source: s.treeStore,
|
|
93
|
+
effect: async ({ nodes: e }) => C(e)
|
|
94
|
+
}), W = i({
|
|
95
|
+
source: s.treeStore,
|
|
96
|
+
effect: async ({ nodes: e, edges: t }, n) => {
|
|
97
|
+
if (_(n)) return w(n, e, t);
|
|
98
|
+
}
|
|
99
|
+
}), G = i({
|
|
100
|
+
source: s.treeStore,
|
|
101
|
+
effect: async ({ nodes: e, edges: n, conditions: i }, a) => {
|
|
102
|
+
if (!m(a)) return;
|
|
103
|
+
let o = i.find((e) => e.id === a.conditionId)?.logic;
|
|
104
|
+
return o ? ne(!!await t(r, o), a.id, e, n) : void 0;
|
|
105
|
+
}
|
|
106
|
+
}), K = i({
|
|
107
|
+
source: {
|
|
108
|
+
tree: s.treeStore,
|
|
109
|
+
actions: r.actions.listStore,
|
|
110
|
+
snapshot: r.stateSnapshotStore
|
|
111
|
+
},
|
|
112
|
+
effect: async ({ tree: e, actions: t, snapshot: n }, r) => {
|
|
113
|
+
let { nodes: i, edges: a } = e;
|
|
114
|
+
if (!v(r)) return;
|
|
115
|
+
let o = r.actionKey;
|
|
116
|
+
if (!o) {
|
|
117
|
+
`${r.id}`;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
let s = t.find((e) => e.key === o)?.action;
|
|
121
|
+
if (!s) {
|
|
122
|
+
`${o}`;
|
|
123
|
+
let e = a.find((e) => e.sourceNodeId === r.id && e.sourceHandle === "false");
|
|
124
|
+
return e ? i.find((t) => t.id === e.destinationNodeId) : null;
|
|
125
|
+
}
|
|
126
|
+
if (typeof s != "function") {
|
|
127
|
+
`${o}`;
|
|
128
|
+
let e = a.find((e) => e.sourceNodeId === r.id && e.sourceHandle === "false");
|
|
129
|
+
return e ? i.find((t) => t.id === e.destinationNodeId) : null;
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
`${o}`, await s({
|
|
133
|
+
...n,
|
|
134
|
+
args: []
|
|
135
|
+
}, { experience: Z });
|
|
136
|
+
let e = a.find((e) => e.sourceNodeId === r.id && e.sourceHandle === "true");
|
|
137
|
+
if (!e) return `${r.id}`, null;
|
|
138
|
+
let t = i.find((t) => t.id === e.destinationNodeId);
|
|
139
|
+
return `${o}${t?.id}`, t || null;
|
|
140
|
+
} catch {
|
|
141
|
+
`${o}`;
|
|
142
|
+
let e = a.find((e) => e.sourceNodeId === r.id && e.sourceHandle === "false");
|
|
143
|
+
if (!e) return `${r.id}`, null;
|
|
144
|
+
let t = i.find((t) => t.id === e.destinationNodeId);
|
|
145
|
+
return `${o}${t?.id}`, t || null;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}), oe = c((e) => {
|
|
149
|
+
g(e) && r.experiences.launch({ key: e.experienceKey });
|
|
150
|
+
}), q = i({
|
|
151
|
+
source: [P, s.treeStore],
|
|
152
|
+
effect: async ([e, { nodes: t, edges: n }]) => w(e, t, n)
|
|
153
|
+
}), J = i({
|
|
154
|
+
source: [P, s.treeStore],
|
|
155
|
+
effect: async ([e, { nodes: t, edges: n }]) => w(e, t, n)
|
|
156
|
+
}), se = c((e) => {
|
|
157
|
+
r.history.push({
|
|
158
|
+
experienceId: s.id,
|
|
159
|
+
node: e
|
|
160
|
+
});
|
|
161
|
+
}), Y = i({
|
|
162
|
+
source: s.configStore,
|
|
163
|
+
effect: async ({ initializeOpenLogic: n }) => p?.initialiseOpen === void 0 ? e(n) ? !!await t(r, n) : n ?? !1 : p.initialiseOpen
|
|
164
|
+
}), X = a(A, r.frameworks.listStore, (e, t) => {
|
|
165
|
+
if (!e) return null;
|
|
166
|
+
let n = t.find((t) => t.name === e.component.frameworkName);
|
|
167
|
+
return n ? {
|
|
168
|
+
component: e,
|
|
169
|
+
framework: n
|
|
170
|
+
} : null;
|
|
171
|
+
}, { skipVoid: !1 }), Z, ce = i({
|
|
172
|
+
source: X,
|
|
173
|
+
effect: (e) => {
|
|
174
|
+
if (!e) return;
|
|
175
|
+
if (!f) {
|
|
176
|
+
`${s.id}`;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
let t = n(f);
|
|
180
|
+
try {
|
|
181
|
+
e.framework.render(t, e.component.component, r, Z);
|
|
182
|
+
} catch {}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
Z = Object.freeze({
|
|
186
|
+
id: Math.random().toString(36).substring(7),
|
|
187
|
+
experienceKey: s.key,
|
|
188
|
+
experienceId: s.id,
|
|
189
|
+
experienceName: s.name,
|
|
190
|
+
configStore: s.configStore,
|
|
191
|
+
target: f,
|
|
192
|
+
componentStore: A,
|
|
193
|
+
componentAndFrameworkStore: X,
|
|
194
|
+
stateStore: j,
|
|
195
|
+
isOpenStore: B,
|
|
196
|
+
open: V.open,
|
|
197
|
+
close: V.close,
|
|
198
|
+
toggleOpen: V.toggle,
|
|
199
|
+
setOpen: V.set,
|
|
200
|
+
treeStore: s.treeStore,
|
|
201
|
+
currentNodeStore: P,
|
|
202
|
+
currentStepStore: F,
|
|
203
|
+
previousStepStore: I,
|
|
204
|
+
nextReachableStepNodesStore: L,
|
|
205
|
+
stepsToOriginStore: R,
|
|
206
|
+
stepsToLeafStore: z,
|
|
207
|
+
goToNextStep: b,
|
|
208
|
+
goToPreviousStep: S,
|
|
209
|
+
goToStepById: E,
|
|
210
|
+
stepsHistoryStore: N,
|
|
211
|
+
isResumableStore: re,
|
|
212
|
+
restart: D,
|
|
213
|
+
mountFx: ce
|
|
214
|
+
});
|
|
215
|
+
let Q = l(), $ = l();
|
|
216
|
+
return u({
|
|
217
|
+
clock: P,
|
|
218
|
+
target: Q
|
|
219
|
+
}), u({
|
|
220
|
+
clock: Q,
|
|
221
|
+
filter: (e) => e === null,
|
|
222
|
+
target: U
|
|
223
|
+
}), u({
|
|
224
|
+
clock: Q,
|
|
225
|
+
filter: (e) => e !== null,
|
|
226
|
+
target: $
|
|
227
|
+
}), d({
|
|
228
|
+
source: $,
|
|
229
|
+
match: (e) => m(e) ? "condition" : h(e) ? "step" : g(e) ? "launchExperience" : _(e) ? "origin" : v(e) ? "action" : "other",
|
|
230
|
+
cases: {
|
|
231
|
+
origin: W,
|
|
232
|
+
condition: G,
|
|
233
|
+
step: H,
|
|
234
|
+
launchExperience: oe,
|
|
235
|
+
action: K,
|
|
236
|
+
__: l()
|
|
237
|
+
}
|
|
238
|
+
}), u({
|
|
239
|
+
clock: [
|
|
240
|
+
G.doneData,
|
|
241
|
+
W.doneData,
|
|
242
|
+
U.doneData,
|
|
243
|
+
J.doneData,
|
|
244
|
+
q.doneData,
|
|
245
|
+
K.doneData
|
|
246
|
+
],
|
|
247
|
+
filter: Boolean,
|
|
248
|
+
target: se
|
|
249
|
+
}), u({
|
|
250
|
+
clock: b,
|
|
251
|
+
target: J
|
|
252
|
+
}), u({
|
|
253
|
+
clock: b,
|
|
254
|
+
source: F,
|
|
255
|
+
filter: Boolean,
|
|
256
|
+
target: r.eventBus.prepend((e) => ({
|
|
257
|
+
type: "step_submit",
|
|
258
|
+
step: e,
|
|
259
|
+
experience: Z
|
|
260
|
+
}))
|
|
261
|
+
}), u({
|
|
262
|
+
clock: J.done,
|
|
263
|
+
source: F,
|
|
264
|
+
filter: Boolean,
|
|
265
|
+
target: r.eventBus.prepend((e) => ({
|
|
266
|
+
type: "step_submit_success",
|
|
267
|
+
step: e,
|
|
268
|
+
experience: Z
|
|
269
|
+
}))
|
|
270
|
+
}), u({
|
|
271
|
+
clock: J.fail,
|
|
272
|
+
source: F,
|
|
273
|
+
filter: Boolean,
|
|
274
|
+
target: r.eventBus.prepend((e) => ({
|
|
275
|
+
type: "step_submit_error",
|
|
276
|
+
step: e,
|
|
277
|
+
experience: Z
|
|
278
|
+
}))
|
|
279
|
+
}), u({
|
|
280
|
+
clock: S,
|
|
281
|
+
target: ie
|
|
282
|
+
}), u({
|
|
283
|
+
clock: E,
|
|
284
|
+
target: ae
|
|
285
|
+
}), u({
|
|
286
|
+
clock: D,
|
|
287
|
+
fn: () => ({ experienceId: s.id }),
|
|
288
|
+
target: r.history.resetExperience
|
|
289
|
+
}), u({
|
|
290
|
+
clock: D,
|
|
291
|
+
target: c(() => {
|
|
292
|
+
r.responses.clearByExperience(s.id);
|
|
293
|
+
})
|
|
294
|
+
}), u({
|
|
295
|
+
source: a([
|
|
296
|
+
G.pending,
|
|
297
|
+
W.pending,
|
|
298
|
+
U.pending,
|
|
299
|
+
J.pending
|
|
300
|
+
]),
|
|
301
|
+
fn: (e) => e.some(Boolean) ? "transitioning" : "ready",
|
|
302
|
+
target: j
|
|
303
|
+
}), u({
|
|
304
|
+
clock: H.doneData,
|
|
305
|
+
source: F,
|
|
306
|
+
filter: Boolean,
|
|
307
|
+
target: r.eventBus.prepend((e) => ({
|
|
308
|
+
type: "step_enter",
|
|
309
|
+
step: e,
|
|
310
|
+
experience: Z
|
|
311
|
+
}))
|
|
312
|
+
}), u({
|
|
313
|
+
clock: k,
|
|
314
|
+
target: Y
|
|
315
|
+
}), u({
|
|
316
|
+
source: Y.doneData,
|
|
317
|
+
fn: Boolean,
|
|
318
|
+
target: B
|
|
319
|
+
}), u({
|
|
320
|
+
source: P,
|
|
321
|
+
clock: y,
|
|
322
|
+
filter: (e) => e ? _(e) : !0,
|
|
323
|
+
target: q
|
|
324
|
+
}), u({
|
|
325
|
+
source: B,
|
|
326
|
+
filter: Boolean,
|
|
327
|
+
target: y
|
|
328
|
+
}), u({
|
|
329
|
+
source: B,
|
|
330
|
+
filter: Boolean,
|
|
331
|
+
target: r.eventBus.prepend(() => ({
|
|
332
|
+
type: "experience_open",
|
|
333
|
+
experience: Z
|
|
334
|
+
}))
|
|
335
|
+
}), u({
|
|
336
|
+
source: B,
|
|
337
|
+
filter: (e) => !e,
|
|
338
|
+
target: r.eventBus.prepend(() => ({
|
|
339
|
+
type: "experience_close",
|
|
340
|
+
experience: Z
|
|
341
|
+
}))
|
|
342
|
+
}), u({
|
|
343
|
+
clock: O,
|
|
344
|
+
target: [k]
|
|
345
|
+
}), O(), Z;
|
|
346
|
+
});
|
|
347
|
+
function D(e) {
|
|
348
|
+
return p(E, e);
|
|
349
|
+
}
|
|
350
|
+
var O = f(({ client: e }) => {
|
|
351
|
+
let t = T.store({}), n = l(), i = l(), a = l(), s = o(t, {
|
|
352
|
+
register(e, t) {
|
|
353
|
+
let n = [...e[t.experienceId] ?? []];
|
|
354
|
+
return n.push(t), {
|
|
355
|
+
...e,
|
|
356
|
+
[t.experienceId]: n
|
|
357
|
+
};
|
|
358
|
+
},
|
|
359
|
+
unregister(e, t) {
|
|
360
|
+
let n = t.experienceId, r = e[n]?.filter((e) => e !== t);
|
|
361
|
+
return {
|
|
362
|
+
...e,
|
|
363
|
+
[n]: r ?? []
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
}), d = c(({ experience: t, target: n, options: r }) => D({
|
|
367
|
+
client: e,
|
|
368
|
+
experience: t,
|
|
369
|
+
target: n,
|
|
370
|
+
options: r
|
|
371
|
+
})), f = c((e) => {
|
|
372
|
+
s.register(e);
|
|
373
|
+
}), p = c((e) => {
|
|
374
|
+
e.target && r(e.target, () => {
|
|
375
|
+
a(e);
|
|
376
|
+
});
|
|
377
|
+
}), m = c((e) => {
|
|
378
|
+
s.unregister(e);
|
|
379
|
+
}), h = c(async (e) => {
|
|
380
|
+
await e.mountFx();
|
|
381
|
+
});
|
|
382
|
+
u({
|
|
383
|
+
clock: n,
|
|
384
|
+
target: d
|
|
385
|
+
}), u({
|
|
386
|
+
clock: a,
|
|
387
|
+
target: m
|
|
388
|
+
}), u({
|
|
389
|
+
clock: d.doneData,
|
|
390
|
+
target: [
|
|
391
|
+
f,
|
|
392
|
+
p,
|
|
393
|
+
i
|
|
394
|
+
]
|
|
395
|
+
}), u({
|
|
396
|
+
clock: d.doneData,
|
|
397
|
+
target: e.eventBus.prepend((e) => ({
|
|
398
|
+
type: "experience_initialize",
|
|
399
|
+
experience: e
|
|
400
|
+
}))
|
|
401
|
+
}), u({
|
|
402
|
+
clock: i,
|
|
403
|
+
target: h
|
|
404
|
+
});
|
|
405
|
+
function g(e, t, r) {
|
|
406
|
+
n({
|
|
407
|
+
experience: e,
|
|
408
|
+
target: t,
|
|
409
|
+
options: r
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
let _ = t.map((e) => Object.values(e).flat());
|
|
413
|
+
function v(e) {
|
|
414
|
+
return _.map((t) => t.filter((t) => t.experienceKey === e), { skipVoid: !1 });
|
|
415
|
+
}
|
|
416
|
+
function y(e) {
|
|
417
|
+
return t.map((t) => t[e] || [], { skipVoid: !1 });
|
|
418
|
+
}
|
|
419
|
+
return {
|
|
420
|
+
spawn: g,
|
|
421
|
+
getByExperienceKey: v,
|
|
422
|
+
getByExperienceId: y,
|
|
423
|
+
listStore: _
|
|
424
|
+
};
|
|
425
|
+
});
|
|
426
|
+
function k(e) {
|
|
427
|
+
return p(O, e);
|
|
428
|
+
}
|
|
429
|
+
//#endregion
|
|
430
|
+
export { h as i, k as n, m as r, D as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./rules-logic-H6P8xwHF.cjs`);require(`./logger-fbvQC40v.cjs`);const t=require(`./dom-C3C6Fmwz.cjs`);let n=require(`effector`),r=require(`@withease/factories`);function i(e){return e.type===`condition`}function a(e){return e.type===`step`}function o(e){return e.type===`experience`}function s(e){return e.type===`origin`}function c(e){return e.type===`action`}var l=(e,t,n,r,i=new Set)=>i.has(n.id)?[]:(i.add(n.id),a(n)&&!r?[n]:t.filter(e=>e.sourceNodeId===n.id).flatMap(n=>{let r=e.find(e=>e.id===n.destinationNodeId);return r?l(e,t,r,!1,i):[]})),u=(e,t,n)=>l(e,t,n,!0,new Set),d=(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]=d(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]},f=(e,t,n)=>d(e,t,n,!0,new Set),p=(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]=p(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]},m=(e,t,n)=>p(e,t,n,new Set),h=e=>e.find(e=>e.type===`origin`)||null,g=(e,t,n)=>{if(!e)return h(t);let r=n.find(t=>t.sourceNodeId===e.id);return r&&t.find(e=>e.id===r.destinationNodeId)||null};async function ee(e,t,n,r){let i=e?`true`:`false`,a=r.find(e=>e.sourceHandle===i&&e.sourceNodeId===t);return n.find(e=>e.id===a?.destinationNodeId)}var _=(0,n.createDomain)(`experience-instance`),v=(0,r.createFactory)(({client:r,experience:l,target:d,options:p})=>{let v=(0,n.createEvent)(),y=(0,n.createEvent)(),b=(0,n.createEvent)(),x=(0,n.createEvent)(),S=(0,n.createEvent)(),C=(0,n.createEvent)(),w=(0,n.createEvent)(),T=l.componentStore,E=_.store(`transitioning`),D=r.history.entriesStore.map(e=>e.filter(e=>e.experienceId===l.id)),O=D.map(e=>e.filter(e=>a(e.node))),k=O.map(e=>e.length>=2),A=D.map(e=>e.at(-1)?.node||null),j=(0,n.combine)(r.steps.listStore,A,(e,t)=>e.find(e=>t&&a(t)&&e.id===t.stepId)||null),M=(0,n.combine)(r.steps.listStore,O,(e,t)=>{let n=t.at(-2);if(!n||!a(n.node))return null;let r=n.node;return e.find(e=>e.id===r.stepId)||null}),N=(0,n.combine)(l.treeStore,A,({nodes:e,edges:t},n)=>n?u(e,t,n):[]),P=(0,n.combine)(l.treeStore,A,({nodes:e,edges:t},n)=>n?m(e,t,n):[-1,-1]),F=(0,n.combine)(l.treeStore,A,({nodes:e,edges:t},n)=>n?f(e,t,n):[-1,-1]),I=_.store(!1),L=(0,n.createApi)(I,{open:()=>!0,close:()=>!1,toggle:e=>!e,set:(e,t)=>t}),R=(0,n.createEffect)(async()=>{r.history.back({experienceId:l.id})}),z=(0,n.attach)({source:l.treeStore,effect:async(e,t)=>{let n=e.nodes.find(e=>a(e)&&e.stepId===t);n&&r.history.push({experienceId:l.id,node:n})}}),B=(0,n.attach)({source:A,effect:e=>{}}),V=(0,n.attach)({source:l.treeStore,effect:async({nodes:e})=>h(e)}),H=(0,n.attach)({source:l.treeStore,effect:async({nodes:e,edges:t},n)=>{if(s(n))return g(n,e,t)}}),U=(0,n.attach)({source:l.treeStore,effect:async({nodes:t,edges:n,conditions:a},o)=>{if(!i(o))return;let s=a.find(e=>e.id===o.conditionId)?.logic;return s?ee(!!await e.t(r,s),o.id,t,n):void 0}}),W=(0,n.attach)({source:{tree:l.treeStore,actions:r.actions.listStore,snapshot:r.stateSnapshotStore},effect:async({tree:e,actions:t,snapshot:n},r)=>{let{nodes:i,edges:a}=e;if(!c(r))return;let o=r.actionKey;if(!o){`${r.id}`;return}let s=t.find(e=>e.key===o)?.action;if(!s){`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return e?i.find(t=>t.id===e.destinationNodeId):null}if(typeof s!=`function`){`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return e?i.find(t=>t.id===e.destinationNodeId):null}try{`${o}`,await s({...n,args:[]},{experience:Z});let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`true`);if(!e)return`${r.id}`,null;let t=i.find(t=>t.id===e.destinationNodeId);return`${o}${t?.id}`,t||null}catch{`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);if(!e)return`${r.id}`,null;let t=i.find(t=>t.id===e.destinationNodeId);return`${o}${t?.id}`,t||null}}}),G=(0,n.createEffect)(e=>{o(e)&&r.experiences.launch({key:e.experienceKey})}),K=(0,n.attach)({source:[A,l.treeStore],effect:async([e,{nodes:t,edges:n}])=>g(e,t,n)}),q=(0,n.attach)({source:[A,l.treeStore],effect:async([e,{nodes:t,edges:n}])=>g(e,t,n)}),J=(0,n.createEffect)(e=>{r.history.push({experienceId:l.id,node:e})}),Y=(0,n.attach)({source:l.configStore,effect:async({initializeOpenLogic:t})=>p?.initialiseOpen===void 0?e.n(t)?!!await e.t(r,t):t??!1:p.initialiseOpen}),X=(0,n.combine)(T,r.frameworks.listStore,(e,t)=>{if(!e)return null;let n=t.find(t=>t.name===e.component.frameworkName);return n?{component:e,framework:n}:null},{skipVoid:!1}),Z,te=(0,n.attach)({source:X,effect:e=>{if(!e)return;if(!d){`${l.id}`;return}let n=t.n(d);try{e.framework.render(n,e.component.component,r,Z)}catch{}}});Z=Object.freeze({id:Math.random().toString(36).substring(7),experienceKey:l.key,experienceId:l.id,experienceName:l.name,configStore:l.configStore,target:d,componentStore:T,componentAndFrameworkStore:X,stateStore:E,isOpenStore:I,open:L.open,close:L.close,toggleOpen:L.toggle,setOpen:L.set,treeStore:l.treeStore,currentNodeStore:A,currentStepStore:j,previousStepStore:M,nextReachableStepNodesStore:N,stepsToOriginStore:P,stepsToLeafStore:F,goToNextStep:y,goToPreviousStep:b,goToStepById:x,stepsHistoryStore:O,isResumableStore:k,restart:S,mountFx:te});let Q=(0,n.createEvent)(),$=(0,n.createEvent)();return(0,n.sample)({clock:A,target:Q}),(0,n.sample)({clock:Q,filter:e=>e===null,target:V}),(0,n.sample)({clock:Q,filter:e=>e!==null,target:$}),(0,n.split)({source:$,match:e=>i(e)?`condition`:a(e)?`step`:o(e)?`launchExperience`:s(e)?`origin`:c(e)?`action`:`other`,cases:{origin:H,condition:U,step:B,launchExperience:G,action:W,__:(0,n.createEvent)()}}),(0,n.sample)({clock:[U.doneData,H.doneData,V.doneData,q.doneData,K.doneData,W.doneData],filter:Boolean,target:J}),(0,n.sample)({clock:y,target:q}),(0,n.sample)({clock:y,source:j,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit`,step:e,experience:Z}))}),(0,n.sample)({clock:q.done,source:j,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit_success`,step:e,experience:Z}))}),(0,n.sample)({clock:q.fail,source:j,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit_error`,step:e,experience:Z}))}),(0,n.sample)({clock:b,target:R}),(0,n.sample)({clock:x,target:z}),(0,n.sample)({clock:S,fn:()=>({experienceId:l.id}),target:r.history.resetExperience}),(0,n.sample)({clock:S,target:(0,n.createEffect)(()=>{r.responses.clearByExperience(l.id)})}),(0,n.sample)({source:(0,n.combine)([U.pending,H.pending,V.pending,q.pending]),fn:e=>e.some(Boolean)?`transitioning`:`ready`,target:E}),(0,n.sample)({clock:B.doneData,source:j,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_enter`,step:e,experience:Z}))}),(0,n.sample)({clock:w,target:Y}),(0,n.sample)({source:Y.doneData,fn:Boolean,target:I}),(0,n.sample)({source:A,clock:v,filter:e=>e?s(e):!0,target:K}),(0,n.sample)({source:I,filter:Boolean,target:v}),(0,n.sample)({source:I,filter:Boolean,target:r.eventBus.prepend(()=>({type:`experience_open`,experience:Z}))}),(0,n.sample)({source:I,filter:e=>!e,target:r.eventBus.prepend(()=>({type:`experience_close`,experience:Z}))}),(0,n.sample)({clock:C,target:[w]}),C(),Z});function y(e){return(0,r.invoke)(v,e)}var b=(0,r.createFactory)(({client:e})=>{let r=_.store({}),i=(0,n.createEvent)(),a=(0,n.createEvent)(),o=(0,n.createEvent)(),s=(0,n.createApi)(r,{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??[]}}}),c=(0,n.createEffect)(({experience:t,target:n,options:r})=>y({client:e,experience:t,target:n,options:r})),l=(0,n.createEffect)(e=>{s.register(e)}),u=(0,n.createEffect)(e=>{e.target&&t.o(e.target,()=>{o(e)})}),d=(0,n.createEffect)(e=>{s.unregister(e)}),f=(0,n.createEffect)(async e=>{await e.mountFx()});(0,n.sample)({clock:i,target:c}),(0,n.sample)({clock:o,target:d}),(0,n.sample)({clock:c.doneData,target:[l,u,a]}),(0,n.sample)({clock:c.doneData,target:e.eventBus.prepend(e=>({type:`experience_initialize`,experience:e}))}),(0,n.sample)({clock:a,target:f});function p(e,t,n){i({experience:e,target:t,options:n})}let m=r.map(e=>Object.values(e).flat());function h(e){return m.map(t=>t.filter(t=>t.experienceKey===e),{skipVoid:!1})}function g(e){return r.map(t=>t[e]||[],{skipVoid:!1})}return{spawn:p,getByExperienceKey:h,getByExperienceId:g,listStore:m}});function x(e){return(0,r.invoke)(b,e)}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}});
|
|
@@ -38,6 +38,18 @@ export interface ExperienceInstance {
|
|
|
38
38
|
goToPreviousStep: EventCallable<void>;
|
|
39
39
|
goToStepById: EventCallable<string>;
|
|
40
40
|
stepsHistoryStore: Store<HistoryEntry[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Reactive flag indicating whether the user has in-progress state for this experience.
|
|
43
|
+
* Derived from `stepsHistoryStore`: `true` once history holds at least two step
|
|
44
|
+
* entries (entry step + one progression), `false` at origin or with a single entry.
|
|
45
|
+
*/
|
|
46
|
+
isResumableStore: Store<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Atomically clears this experience's history entries and the responses owned by its
|
|
49
|
+
* step nodes. The walk then re-fires from origin because `currentNodeStore` re-derives
|
|
50
|
+
* to `null`. Sibling experiences are untouched.
|
|
51
|
+
*/
|
|
52
|
+
restart: EventCallable<void>;
|
|
41
53
|
/**
|
|
42
54
|
* Per-instance mount effect. Attached over `componentAndFrameworkStore` so the render call always receives the current resolved component+framework pair.
|
|
43
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources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AAE,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,CAAA;IAC9C,gBAAgB,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,iBAAiB,EAAE,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC/C,2BAA2B,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAA;IACpD,kBAAkB,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;IACnC,gBAAgB,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;IACjC,YAAY,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IACjC,gBAAgB,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IACrC,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACnC,iBAAiB,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAA;IACxC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;CACnC;AAED,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACtF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAA;CACzC;AAED,QAAA,MAAM,+BAA+B,6CAMhC;IACD,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,eAAe,CAAA;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,OAAO,CAAC,EAAE,uBAAuB,CAAA;CAClC,
|
|
1
|
+
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.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BAAuB,CAAA;CAClC,uBA6hBF,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,CAAC,SAAS,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAC,CAAC,CAAC,EAC/D,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAE/D;AAED,QAAA,MAAM,oCAAoC,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;wBA4H1E,eAAe,UACnB,WAAW,YACT,uBAAuB;8BAmBF,UAAU,CAAC,KAAK,CAAC;4BAiBnB,UAAU,CAAC,IAAI,CAAC;;CAU/C,CAAA;AAEF;;;;;;;;;GASG;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"}
|
|
@@ -20,6 +20,9 @@ export declare function createHistory(): {
|
|
|
20
20
|
restore: import('effector').EventCallable<{
|
|
21
21
|
entries: HistoryEntry[];
|
|
22
22
|
}>;
|
|
23
|
+
resetExperience: import('effector').EventCallable<{
|
|
24
|
+
experienceId: string;
|
|
25
|
+
}>;
|
|
23
26
|
entriesStore: import('effector').Store<HistoryEntry[]>;
|
|
24
27
|
};
|
|
25
28
|
//# sourceMappingURL=history.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/entities/history/history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/entities/history/history.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAM9D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;CACrB;AAgGD,wBAAgB,aAAa;;sBA/EsB,MAAM;cAAQ,cAAc;;;sBACzB,MAAM;cAAQ,cAAc;;;uBAC9B,MAAM;;;iBACT,YAAY,EAAE;;;sBACD,MAAM;;;EA6EnE"}
|
|
@@ -18,6 +18,7 @@ declare const createResponseIndexFactory: ({ client }: {
|
|
|
18
18
|
};
|
|
19
19
|
clearAll: import('effector').EventCallable<void>;
|
|
20
20
|
clear: import('effector').EventCallable<string>;
|
|
21
|
+
clearByExperience: (experienceId: string) => void;
|
|
21
22
|
commit: (responsesToCommit: CommitResponses) => Promise<{
|
|
22
23
|
errors: ValidationError[];
|
|
23
24
|
}>;
|
|
@@ -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,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,QAAQ,CAAA;CAChB;AAED,QAAA,MAAM,0BAA0B,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;mBA6BlD,KAAK,CAAC,KAAK,CAAC,YAAY,QAAQ,GAAG,IAAI;kBACxC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE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AAC,MAAM,CAAC,KAAG,KAAK,CAAC,UAAU,CAAC;CAwDpE,CAAA;AAEF;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAC5F,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAE/C;AAED,mCAAmC;AACnC,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA"}
|
package/dist/types/picked.d.ts
CHANGED
|
@@ -72,6 +72,9 @@ export declare class Picked {
|
|
|
72
72
|
restore: EventCallable<{
|
|
73
73
|
entries: import('.').HistoryEntry[];
|
|
74
74
|
}>;
|
|
75
|
+
resetExperience: EventCallable<{
|
|
76
|
+
experienceId: string;
|
|
77
|
+
}>;
|
|
75
78
|
entriesStore: Store<import('.').HistoryEntry[]>;
|
|
76
79
|
};
|
|
77
80
|
readonly components: {
|
|
@@ -171,6 +174,7 @@ export declare class Picked {
|
|
|
171
174
|
};
|
|
172
175
|
clearAll: EventCallable<void>;
|
|
173
176
|
clear: EventCallable<string>;
|
|
177
|
+
clearByExperience: (experienceId: string) => void;
|
|
174
178
|
commit: (responsesToCommit: import('.').CommitResponses) => Promise<{
|
|
175
179
|
errors: import('.').ValidationError[];
|
|
176
180
|
}>;
|