@picked/client 0.0.62-next.11 → 0.0.62-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.
Files changed (105) hide show
  1. package/dist/api-C-Q9t21v.cjs +1 -0
  2. package/dist/{api-C6HQ65g9.js → api-Cfb-8mqu.js} +1 -1
  3. package/dist/cjs/form/index.js +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/create-experience/index.js +1 -1
  6. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  7. package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
  8. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  9. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  10. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  11. package/dist/cjs/plugins/web-components/index.js +1 -1
  12. package/dist/cjs/server/index.js +1 -1
  13. package/dist/docs/image-optimisation-service.md +6 -6
  14. package/dist/docs/sdk/content-security-policy.md +7 -8
  15. package/dist/docs/sdk/fields.md +2 -2
  16. package/dist/docs/workspaces.mdx +1 -1
  17. package/dist/esm/form/index.js +1 -1
  18. package/dist/esm/index.js +472 -1015
  19. package/dist/esm/plugins/create-experience/index.js +1 -1
  20. package/dist/esm/plugins/dynamic-experiences/index.js +60 -133
  21. package/dist/esm/plugins/experience-browser-storage/index.js +6 -9
  22. package/dist/esm/plugins/history-browser-storage/index.js +1 -1
  23. package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
  24. package/dist/esm/plugins/single-page-app/index.js +1 -1
  25. package/dist/esm/plugins/web-components/index.js +1 -1
  26. package/dist/esm/server/index.js +13 -23
  27. package/dist/experience-instance-DC2gKwA6.cjs +1 -0
  28. package/dist/experience-instance-DJaNc5Ob.js +486 -0
  29. package/dist/rules-logic-BTIxfrJJ.js +240 -0
  30. package/dist/rules-logic-DNLOv90w.cjs +1 -0
  31. package/dist/types/entities/action/action.d.ts +3 -6
  32. package/dist/types/entities/action/action.d.ts.map +1 -1
  33. package/dist/types/entities/component/component.d.ts +2 -39
  34. package/dist/types/entities/component/component.d.ts.map +1 -1
  35. package/dist/types/entities/experience/experience.d.ts +113 -69
  36. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  37. package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -17
  38. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  39. package/dist/types/entities/feature/feature.d.ts +2 -26
  40. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  41. package/dist/types/entities/field/field.d.ts.map +1 -1
  42. package/dist/types/entities/framework/framework.d.ts +3 -24
  43. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  44. package/dist/types/entities/plugin/plugin.d.ts +1 -32
  45. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  46. package/dist/types/entities/predicate/predicate.d.ts +3 -24
  47. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  48. package/dist/types/entities/step/step.d.ts +2 -17
  49. package/dist/types/entities/step/step.d.ts.map +1 -1
  50. package/dist/types/exports.d.ts +4 -8
  51. package/dist/types/exports.d.ts.map +1 -1
  52. package/dist/types/index.d.ts +1 -3
  53. package/dist/types/index.d.ts.map +1 -1
  54. package/dist/types/logic-engine.d.ts +1 -1
  55. package/dist/types/logic-engine.d.ts.map +1 -1
  56. package/dist/types/picked.d.ts +186 -141
  57. package/dist/types/picked.d.ts.map +1 -1
  58. package/dist/types/plugins/dynamic-experiences/index.d.ts +1 -2
  59. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
  60. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +1 -18
  61. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  62. package/dist/types/plugins/dynamic-experiences/types.d.ts +1 -63
  63. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  64. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  65. package/dist/types/plugins/web-components/plugin.d.ts.map +1 -1
  66. package/dist/types/server/index.d.ts +0 -7
  67. package/dist/types/server/index.d.ts.map +1 -1
  68. package/dist/types/utils/events.d.ts +1 -1
  69. package/dist/types/utils/events.d.ts.map +1 -1
  70. package/dist/types/utils/rules-logic.d.ts +9 -4
  71. package/dist/types/utils/rules-logic.d.ts.map +1 -1
  72. package/dist/types/utils/state-snaphot.d.ts +26 -0
  73. package/dist/types/utils/state-snaphot.d.ts.map +1 -0
  74. package/dist/types/utils/user-session.d.ts +12 -0
  75. package/dist/types/utils/user-session.d.ts.map +1 -0
  76. package/package.json +2 -12
  77. package/dist/api-v323-Asd.cjs +0 -1
  78. package/dist/cjs/plugins/dom-observer/index.js +0 -1
  79. package/dist/dom-C3C6Fmwz.cjs +0 -1
  80. package/dist/dom-DGePXPpM.js +0 -84
  81. package/dist/esm/plugins/dom-observer/index.js +0 -87
  82. package/dist/experience-instance-DImym3m_.js +0 -419
  83. package/dist/experience-instance-DygAdzbn.cjs +0 -1
  84. package/dist/rules-logic-D_CVBuv7.js +0 -13
  85. package/dist/rules-logic-H6P8xwHF.cjs +0 -1
  86. package/dist/types/entities/content/content.d.ts +0 -37
  87. package/dist/types/entities/content/content.d.ts.map +0 -1
  88. package/dist/types/entities/session/session.d.ts +0 -45
  89. package/dist/types/entities/session/session.d.ts.map +0 -1
  90. package/dist/types/lifecycle/lifecycle.d.ts +0 -47
  91. package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
  92. package/dist/types/lifecycle/rules-logic.d.ts +0 -24
  93. package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
  94. package/dist/types/lifecycle/state-snapshot.d.ts +0 -37
  95. package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
  96. package/dist/types/plugins/dom-observer/index.d.ts +0 -3
  97. package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
  98. package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
  99. package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
  100. /package/dist/{id-Cg7fVl1O.cjs → id-Bv44ilEo.cjs} +0 -0
  101. /package/dist/{id-n2yrHvNo.js → id-CRqy981z.js} +0 -0
  102. /package/dist/{object-DvUDOytC.js → object-C82v79xc.js} +0 -0
  103. /package/dist/{object-ThO1DEyl.cjs → object-CUJOjanb.cjs} +0 -0
  104. /package/dist/{storage-hOHCCXvP.js → storage-6Xk0uAxB.js} +0 -0
  105. /package/dist/{storage-BXSlLTRa.cjs → storage-B6lQtc4-.cjs} +0 -0
@@ -1,419 +0,0 @@
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
- }, te = (e, t, n) => b(e, t, n, !0, /* @__PURE__ */ new Set()), x = (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] = x(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
- }, S = (e, t, n) => x(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(), x = l(), E = l(), D = l(), O = l(), k = s.componentStore, A = T.store("transitioning"), j = r.history.entriesStore.map((e) => e.filter((e) => e.experienceId === s.id)), M = j.map((e) => e.filter((e) => h(e.node))), N = j.map((e) => e.at(-1)?.node || null), P = a(r.steps.listStore, N, (e, t) => e.find((e) => t && h(t) && e.id === t.stepId) || null), re = a(r.steps.listStore, M, (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
- }), F = a(s.treeStore, N, ({ nodes: e, edges: t }, n) => n ? ee(e, t, n) : []), I = a(s.treeStore, N, ({ nodes: e, edges: t }, n) => n ? S(e, t, n) : [-1, -1]), L = a(s.treeStore, N, ({ nodes: e, edges: t }, n) => n ? te(e, t, n) : [-1, -1]), R = T.store(!1), z = o(R, {
73
- open: () => !0,
74
- close: () => !1,
75
- toggle: (e) => !e,
76
- set: (e, t) => t
77
- }), B = c(async () => {
78
- r.history.back({ experienceId: s.id });
79
- }), V = 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: N,
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
- }), ie = c((e) => {
149
- g(e) && r.experiences.launch({ key: e.experienceKey });
150
- }), q = i({
151
- source: [N, s.treeStore],
152
- effect: async ([e, { nodes: t, edges: n }]) => w(e, t, n)
153
- }), J = i({
154
- source: [N, s.treeStore],
155
- effect: async ([e, { nodes: t, edges: n }]) => w(e, t, n)
156
- }), ae = 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(k, 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, oe = 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: k,
193
- componentAndFrameworkStore: X,
194
- stateStore: A,
195
- isOpenStore: R,
196
- open: z.open,
197
- close: z.close,
198
- toggleOpen: z.toggle,
199
- setOpen: z.set,
200
- treeStore: s.treeStore,
201
- currentNodeStore: N,
202
- currentStepStore: P,
203
- previousStepStore: re,
204
- nextReachableStepNodesStore: F,
205
- stepsToOriginStore: I,
206
- stepsToLeafStore: L,
207
- goToNextStep: b,
208
- goToPreviousStep: x,
209
- goToStepById: E,
210
- stepsHistoryStore: M,
211
- mountFx: oe
212
- });
213
- let Q = l(), $ = l();
214
- return u({
215
- clock: N,
216
- target: Q
217
- }), u({
218
- clock: Q,
219
- filter: (e) => e === null,
220
- target: U
221
- }), u({
222
- clock: Q,
223
- filter: (e) => e !== null,
224
- target: $
225
- }), d({
226
- source: $,
227
- match: (e) => m(e) ? "condition" : h(e) ? "step" : g(e) ? "launchExperience" : _(e) ? "origin" : v(e) ? "action" : "other",
228
- cases: {
229
- origin: W,
230
- condition: G,
231
- step: H,
232
- launchExperience: ie,
233
- action: K,
234
- __: l()
235
- }
236
- }), u({
237
- clock: [
238
- G.doneData,
239
- W.doneData,
240
- U.doneData,
241
- J.doneData,
242
- q.doneData,
243
- K.doneData
244
- ],
245
- filter: Boolean,
246
- target: ae
247
- }), u({
248
- clock: b,
249
- target: J
250
- }), u({
251
- clock: b,
252
- source: P,
253
- filter: Boolean,
254
- target: r.eventBus.prepend((e) => ({
255
- type: "step_submit",
256
- step: e,
257
- experience: Z
258
- }))
259
- }), u({
260
- clock: J.done,
261
- source: P,
262
- filter: Boolean,
263
- target: r.eventBus.prepend((e) => ({
264
- type: "step_submit_success",
265
- step: e,
266
- experience: Z
267
- }))
268
- }), u({
269
- clock: J.fail,
270
- source: P,
271
- filter: Boolean,
272
- target: r.eventBus.prepend((e) => ({
273
- type: "step_submit_error",
274
- step: e,
275
- experience: Z
276
- }))
277
- }), u({
278
- clock: x,
279
- target: B
280
- }), u({
281
- clock: E,
282
- target: V
283
- }), u({
284
- source: a([
285
- G.pending,
286
- W.pending,
287
- U.pending,
288
- J.pending
289
- ]),
290
- fn: (e) => e.some(Boolean) ? "transitioning" : "ready",
291
- target: A
292
- }), u({
293
- clock: H.doneData,
294
- source: P,
295
- filter: Boolean,
296
- target: r.eventBus.prepend((e) => ({
297
- type: "step_enter",
298
- step: e,
299
- experience: Z
300
- }))
301
- }), u({
302
- clock: O,
303
- target: Y
304
- }), u({
305
- source: Y.doneData,
306
- fn: Boolean,
307
- target: R
308
- }), u({
309
- source: N,
310
- clock: y,
311
- filter: (e) => e ? _(e) : !0,
312
- target: q
313
- }), u({
314
- source: R,
315
- filter: Boolean,
316
- target: y
317
- }), u({
318
- source: R,
319
- filter: Boolean,
320
- target: r.eventBus.prepend(() => ({
321
- type: "experience_open",
322
- experience: Z
323
- }))
324
- }), u({
325
- source: R,
326
- filter: (e) => !e,
327
- target: r.eventBus.prepend(() => ({
328
- type: "experience_close",
329
- experience: Z
330
- }))
331
- }), u({
332
- clock: D,
333
- target: [O]
334
- }), D(), Z;
335
- });
336
- function D(e) {
337
- return p(E, e);
338
- }
339
- var O = f(({ client: e }) => {
340
- let t = T.store({}), n = l(), i = l(), a = l(), s = o(t, {
341
- register(e, t) {
342
- let n = [...e[t.experienceId] ?? []];
343
- return n.push(t), {
344
- ...e,
345
- [t.experienceId]: n
346
- };
347
- },
348
- unregister(e, t) {
349
- let n = t.experienceId, r = e[n]?.filter((e) => e !== t);
350
- return {
351
- ...e,
352
- [n]: r ?? []
353
- };
354
- }
355
- }), d = c(({ experience: t, target: n, options: r }) => D({
356
- client: e,
357
- experience: t,
358
- target: n,
359
- options: r
360
- })), f = c((e) => {
361
- s.register(e);
362
- }), p = c((e) => {
363
- e.target && r(e.target, () => {
364
- a(e);
365
- });
366
- }), m = c((e) => {
367
- s.unregister(e);
368
- }), h = c(async (e) => {
369
- await e.mountFx();
370
- });
371
- u({
372
- clock: n,
373
- target: d
374
- }), u({
375
- clock: a,
376
- target: m
377
- }), u({
378
- clock: d.doneData,
379
- target: [
380
- f,
381
- p,
382
- i
383
- ]
384
- }), u({
385
- clock: d.doneData,
386
- target: e.eventBus.prepend((e) => ({
387
- type: "experience_initialize",
388
- experience: e
389
- }))
390
- }), u({
391
- clock: i,
392
- target: h
393
- });
394
- function g(e, t, r) {
395
- n({
396
- experience: e,
397
- target: t,
398
- options: r
399
- });
400
- }
401
- let _ = t.map((e) => Object.values(e).flat());
402
- function v(e) {
403
- return _.map((t) => t.filter((t) => t.experienceKey === e), { skipVoid: !1 });
404
- }
405
- function y(e) {
406
- return t.map((t) => t[e] || [], { skipVoid: !1 });
407
- }
408
- return {
409
- spawn: g,
410
- getByExperienceKey: v,
411
- getByExperienceId: y,
412
- listStore: _
413
- };
414
- });
415
- function k(e) {
416
- return p(O, e);
417
- }
418
- //#endregion
419
- export { h as i, k as n, m as r, D as t };
@@ -1 +0,0 @@
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 _(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 v=(0,n.createDomain)(`experience-instance`),y=(0,r.createFactory)(({client:r,experience:l,target:d,options:p})=>{let 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=v.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=D.map(e=>e.at(-1)?.node||null),A=(0,n.combine)(r.steps.listStore,k,(e,t)=>e.find(e=>t&&a(t)&&e.id===t.stepId)||null),j=(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}),M=(0,n.combine)(l.treeStore,k,({nodes:e,edges:t},n)=>n?u(e,t,n):[]),N=(0,n.combine)(l.treeStore,k,({nodes:e,edges:t},n)=>n?m(e,t,n):[-1,-1]),P=(0,n.combine)(l.treeStore,k,({nodes:e,edges:t},n)=>n?f(e,t,n):[-1,-1]),F=v.store(!1),I=(0,n.createApi)(F,{open:()=>!0,close:()=>!1,toggle:e=>!e,set:(e,t)=>t}),L=(0,n.createEffect)(async()=>{r.history.back({experienceId:l.id})}),R=(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})}}),z=(0,n.attach)({source:k,effect:e=>{}}),B=(0,n.attach)({source:l.treeStore,effect:async({nodes:e})=>h(e)}),V=(0,n.attach)({source:l.treeStore,effect:async({nodes:e,edges:t},n)=>{if(s(n))return g(n,e,t)}}),H=(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?_(!!await e.t(r,s),o.id,t,n):void 0}}),U=(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:X});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}}}),W=(0,n.createEffect)(e=>{o(e)&&r.experiences.launch({key:e.experienceKey})}),G=(0,n.attach)({source:[k,l.treeStore],effect:async([e,{nodes:t,edges:n}])=>g(e,t,n)}),K=(0,n.attach)({source:[k,l.treeStore],effect:async([e,{nodes:t,edges:n}])=>g(e,t,n)}),q=(0,n.createEffect)(e=>{r.history.push({experienceId:l.id,node:e})}),J=(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}),Y=(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}),X,Z=(0,n.attach)({source:Y,effect:e=>{if(!e)return;if(!d){`${l.id}`;return}let n=t.n(d);try{e.framework.render(n,e.component.component,r,X)}catch{}}});X=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:Y,stateStore:E,isOpenStore:F,open:I.open,close:I.close,toggleOpen:I.toggle,setOpen:I.set,treeStore:l.treeStore,currentNodeStore:k,currentStepStore:A,previousStepStore:j,nextReachableStepNodesStore:M,stepsToOriginStore:N,stepsToLeafStore:P,goToNextStep:b,goToPreviousStep:x,goToStepById:S,stepsHistoryStore:O,mountFx:Z});let Q=(0,n.createEvent)(),$=(0,n.createEvent)();return(0,n.sample)({clock:k,target:Q}),(0,n.sample)({clock:Q,filter:e=>e===null,target:B}),(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:V,condition:H,step:z,launchExperience:W,action:U,__:(0,n.createEvent)()}}),(0,n.sample)({clock:[H.doneData,V.doneData,B.doneData,K.doneData,G.doneData,U.doneData],filter:Boolean,target:q}),(0,n.sample)({clock:b,target:K}),(0,n.sample)({clock:b,source:A,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit`,step:e,experience:X}))}),(0,n.sample)({clock:K.done,source:A,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit_success`,step:e,experience:X}))}),(0,n.sample)({clock:K.fail,source:A,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_submit_error`,step:e,experience:X}))}),(0,n.sample)({clock:x,target:L}),(0,n.sample)({clock:S,target:R}),(0,n.sample)({source:(0,n.combine)([H.pending,V.pending,B.pending,K.pending]),fn:e=>e.some(Boolean)?`transitioning`:`ready`,target:E}),(0,n.sample)({clock:z.doneData,source:A,filter:Boolean,target:r.eventBus.prepend(e=>({type:`step_enter`,step:e,experience:X}))}),(0,n.sample)({clock:w,target:J}),(0,n.sample)({source:J.doneData,fn:Boolean,target:F}),(0,n.sample)({source:k,clock:y,filter:e=>e?s(e):!0,target:G}),(0,n.sample)({source:F,filter:Boolean,target:y}),(0,n.sample)({source:F,filter:Boolean,target:r.eventBus.prepend(()=>({type:`experience_open`,experience:X}))}),(0,n.sample)({source:F,filter:e=>!e,target:r.eventBus.prepend(()=>({type:`experience_close`,experience:X}))}),(0,n.sample)({clock:C,target:[w]}),C(),X});function b(e){return(0,r.invoke)(y,e)}var x=(0,r.createFactory)(({client:e})=>{let r=v.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})=>b({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 S(e){return(0,r.invoke)(x,e)}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}});
@@ -1,13 +0,0 @@
1
- import { t as e } from "./object-DvUDOytC.js";
2
- //#region src/utils/rules-logic.ts
3
- function t(t) {
4
- return !e(t);
5
- }
6
- async function n(e, t, n) {
7
- return await e.evaluateRuleLogicFx({
8
- rule: t,
9
- context: n
10
- });
11
- }
12
- //#endregion
13
- export { t as n, n as t };
@@ -1 +0,0 @@
1
- const e=require(`./object-ThO1DEyl.cjs`);function t(t){return!e.t(t)}async function n(e,t,n){return await e.evaluateRuleLogicFx({rule:t,context:n})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -1,37 +0,0 @@
1
- import { Store } from 'effector';
2
- export interface Content {
3
- id: string;
4
- data: Record<string, unknown>;
5
- }
6
- export type ContentsStore = ReturnType<typeof createContentIndex>;
7
- declare const createContentIndexFactory: () => {
8
- register: (content: Content) => void;
9
- getById: (id: Content["id"]) => Store<Content | null>;
10
- listStore: Store<Content[]>;
11
- indexStore: import('effector').StoreWritable<{
12
- [id: string]: Content;
13
- }>;
14
- };
15
- /**
16
- * Creates an Effector-based index for registering and retrieving content records.
17
- *
18
- * @returns {ContentsStore} A content index with register, getById, and listStore.
19
- * @example
20
- * ```typescript
21
- * const contents = createContentIndex()
22
- * ```
23
- */
24
- export declare function createContentIndex(): ReturnType<typeof createContentIndexFactory>;
25
- /**
26
- * Registers a content record with the given index via the helper function.
27
- *
28
- * @param {Content} content - The content record to register.
29
- * @param {ContentsStore} index - The content index to register the record with.
30
- * @example
31
- * ```typescript
32
- * setupContent(content, index)
33
- * ```
34
- */
35
- export declare function setupContent(content: Content, index: ContentsStore): void;
36
- export {};
37
- //# sourceMappingURL=content.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../src/entities/content/content.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAK9D,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEjE,QAAA,MAAM,yBAAyB;wBAuBF,OAAO,KAAG,IAAI;kBAmBpB,OAAO,CAAC,IAAI,CAAC,KAAG,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;;;;;CAU1D,CAAA;AAEF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAEjF;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAEzE"}
@@ -1,45 +0,0 @@
1
- import { EventCallable, Store } from 'effector';
2
- /** Plain shape of a persisted session — id, optional isUser flag, optional identifiers map. */
3
- export interface Session {
4
- id: string;
5
- isUser?: boolean;
6
- identifiers?: Record<string, string>;
7
- }
8
- /**
9
- * Session entity exposing the reactive `Session` store and mutator events. Field reads
10
- * derive from the store via `.map`, which is reference-equality memoised so per-field
11
- * subscribers only re-emit when their slice actually changes.
12
- *
13
- * @example
14
- * ```typescript
15
- * const session = createSession()
16
- * session.store.map((s) => s.id).watch((id) => console.log('Session id:', id))
17
- * session.setIsUser(true)
18
- * session.setIdentifier({ key: 'fp_id', value: 'abc' })
19
- * ```
20
- */
21
- export interface SessionEntity {
22
- /** Reactive store of the full session. Hydrated synchronously from localStorage when available; otherwise minted fresh in memory. */
23
- store: Store<Session>;
24
- /** Event — sets the isUser flag. */
25
- setIsUser: EventCallable<boolean>;
26
- /** Event — adds or replaces an identifier in the identifiers map. */
27
- setIdentifier: EventCallable<{
28
- key: string;
29
- value: string;
30
- }>;
31
- /** Event — removes an identifier from the identifiers map. */
32
- removeIdentifier: EventCallable<string>;
33
- }
34
- /**
35
- * Initialises a session entity. Always succeeds — persistence is gated internally on `supportsLocalStorage()`, so callers do not need to null-check the result.
36
- *
37
- * @returns {SessionEntity} A ready-to-use session entity.
38
- * @example
39
- * ```typescript
40
- * const session = initialiseSession()
41
- * console.log(session.store.getState().id)
42
- * ```
43
- */
44
- export declare function initialiseSession(): SessionEntity;
45
- //# sourceMappingURL=session.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/entities/session/session.ts"],"names":[],"mappings":"AAAA,kMAAkM;AAClM,OAAO,EAAkC,KAAK,aAAa,EAAU,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAKjG,+FAA+F;AAC/F,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,qIAAqI;IACrI,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IAErB,oCAAoC;IACpC,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IACjC,qEAAqE;IACrE,aAAa,EAAE,aAAa,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC5D,8DAA8D;IAC9D,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CACxC;AA+GD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,aAAa,CAEjD"}
@@ -1,47 +0,0 @@
1
- import { Effect, EventCallable, StoreWritable } from 'effector';
2
- import { Picked } from '../picked';
3
- import { LogicRule } from '../logic-engine';
4
- /** Discrete stages of the SDK lifecycle. */
5
- export type LifecycleStage = 'idle' | 'starting' | 'ready' | 'failed';
6
- /** A logic-engine gate rule, a literal boolean override, or `undefined` to indicate no gate is configured. */
7
- type GateConfig = LogicRule | boolean | undefined;
8
- /** Public effector units exposed by the lifecycle module. */
9
- interface Lifecycle {
10
- /** Public trigger — fires the start chain. `await allSettled(start, { scope })` resolves once the chain has fully settled. */
11
- start: EventCallable<void>;
12
- /** Reactive store of the readiness flag. */
13
- readyStore: StoreWritable<boolean>;
14
- /** Reactive store of the precondition-gate result (`undefined` until `start` is fired). */
15
- preconditionPassedStore: StoreWritable<boolean | undefined>;
16
- /** Reactive store of the condition-gate result (`undefined` until `start` is fired). */
17
- conditionPassedStore: StoreWritable<boolean | undefined>;
18
- /** Reactive store of the current lifecycle stage. */
19
- lifecycleStageStore: StoreWritable<LifecycleStage>;
20
- /** Event — registers a plugin onStart hook effect. */
21
- registerPluginStartHook: EventCallable<Effect<void, void, Error>>;
22
- /** Event — sets the precondition gate rule (called once during construction). */
23
- setPrecondition: EventCallable<GateConfig>;
24
- /** Event — sets the condition gate rule (called once during construction). */
25
- setCondition: EventCallable<GateConfig>;
26
- }
27
- /**
28
- * Creates the lifecycle module for a Picked client. Owns the start chain as an effector
29
- * event graph: `start` triggers a fan-out of effects (ping, plugin hooks, domInteractive)
30
- * whose `.done` events drive the next phases via `sample`.
31
- *
32
- * @param {object} params - Factory params.
33
- * @param {Picked} params.client - The Picked client instance.
34
- * @returns {Lifecycle} The lifecycle module exposing public events and read-only reactive stores.
35
- * @example
36
- * ```typescript
37
- * const lifecycle = createLifecycle({ client })
38
- * lifecycle.setPrecondition(myRule)
39
- * lifecycle.start()
40
- * await allSettled(lifecycle.start, { scope })
41
- * ```
42
- */
43
- export declare function createLifecycle(params: {
44
- client: Picked;
45
- }): Lifecycle;
46
- export {};
47
- //# sourceMappingURL=lifecycle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/lifecycle.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAOhD,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AAErE,8GAA8G;AAC9G,KAAK,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;AAEjD,6DAA6D;AAC7D,UAAU,SAAS;IACjB,8HAA8H;IAC9H,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IAE1B,4CAA4C;IAC5C,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAClC,2FAA2F;IAC3F,uBAAuB,EAAE,aAAa,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;IAC3D,wFAAwF;IACxF,oBAAoB,EAAE,aAAa,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;IACxD,qDAAqD;IACrD,mBAAmB,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAElD,sDAAsD;IACtD,uBAAuB,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;IAEjE,iFAAiF;IACjF,eAAe,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IAC1C,8EAA8E;IAC9E,YAAY,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;CACxC;AAqOD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAErE"}
@@ -1,24 +0,0 @@
1
- import { Effect } from 'effector';
2
- import { LogicObject, LogicRule } from '../logic-engine';
3
- import { Picked } from '../picked';
4
- /** Parameters for `evaluateRuleLogicFx` — the rule to evaluate and an optional context override. */
5
- export interface EvaluateRuleLogicParams {
6
- rule: LogicRule;
7
- context?: LogicObject;
8
- }
9
- /**
10
- * Creates an effector effect that evaluates a json-logic rule against the client's reactive state. The effect uses `attach({ source })` so all reads are scope-aware and reactive — no `.getState()` calls.
11
- *
12
- * @param {object} params - Factory params.
13
- * @param {Picked} params.client - The Picked client instance whose stores back the evaluation context.
14
- * @returns {Effect<EvaluateRuleLogicParams, unknown, Error>} An effect that evaluates a rule and resolves to the result.
15
- * @example
16
- * ```typescript
17
- * const evaluateRuleLogicFx = createEvaluateRuleLogicFx({ client })
18
- * const result = await evaluateRuleLogicFx({ rule: someRule, context: { extra: 'data' } })
19
- * ```
20
- */
21
- export declare function createEvaluateRuleLogicFx(params: {
22
- client: Picked;
23
- }): Effect<EvaluateRuleLogicParams, unknown, Error>;
24
- //# sourceMappingURL=rules-logic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rules-logic.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/rules-logic.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,KAAK,EAAgB,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,oGAAoG;AACpG,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB;AAuED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,MAAM,CAAC,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC,CAElD"}
@@ -1,37 +0,0 @@
1
- import { Store } from 'effector';
2
- import { Picked } from '../picked';
3
- import { Field, FieldValue } from '../entities/field/field';
4
- /** Immutable snapshot of the current client state, suitable for passing to user-supplied predicates, actions, and rule evaluators. */
5
- export interface StateSnapshot {
6
- client: Picked;
7
- location?: Window['location'];
8
- document?: Window['document'];
9
- sessionStorage?: Window['sessionStorage'];
10
- localStorage?: Window['localStorage'];
11
- responses: {
12
- fieldKey: string;
13
- value: FieldValue | undefined;
14
- }[];
15
- fields: Field[];
16
- }
17
- /**
18
- * Creates a reactive store that always reflects the current client state — responses, fields, browser globals, and the client reference.
19
- *
20
- * Consumers reading the snapshot inside an effect should use `attach({ source: stateSnapshotStore })` rather than `.getState()` so reads remain scope-aware and reactive.
21
- *
22
- * @param {object} params - Factory params.
23
- * @param {Picked} params.client - The Picked client instance to derive the snapshot from.
24
- * @returns {Store<StateSnapshot>} A derived store of the current state snapshot.
25
- * @example
26
- * ```typescript
27
- * const stateSnapshotStore = createStateSnapshotStore({ client })
28
- * const evaluateFx = attach({
29
- * source: stateSnapshotStore,
30
- * effect: (snapshot, rule) => evaluate(snapshot, rule),
31
- * })
32
- * ```
33
- */
34
- export declare function createStateSnapshotStore(params: {
35
- client: Picked;
36
- }): Store<StateSnapshot>;
37
- //# sourceMappingURL=state-snapshot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state-snapshot.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/state-snapshot.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAChI,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEhE,sIAAsI;AACtI,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IACrC,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,UAAU,GAAG,SAAS,CAAA;KAC9B,EAAE,CAAA;IACH,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB;AA4BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,aAAa,CAAC,CAEzF"}
@@ -1,3 +0,0 @@
1
- /** @file Public entrypoint for the dom-observer plugin. */
2
- export { domObserverPlugin } from './plugin';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dom-observer/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA"}