@picked/client 0.0.1-dev.1773807602703 → 0.0.1-dev.1774224866171
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-WKe5XBeR.cjs +1 -0
- package/dist/api-ZK-H-MlI.js +37 -0
- package/dist/cjs/form/index.js +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- 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/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/form/index.js +428 -0
- package/dist/esm/index.js +1138 -1291
- package/dist/esm/plugins/create-experience/index.js +424 -509
- package/dist/esm/plugins/dynamic-experiences/index.js +120 -204
- package/dist/esm/plugins/experience-browser-storage/index.js +32 -37
- package/dist/esm/plugins/history-browser-storage/index.js +23 -25
- package/dist/esm/plugins/responses-browser-storage/index.js +36 -39
- package/dist/esm/plugins/responses-indexeddb/index.js +77 -80
- package/dist/esm/plugins/single-page-app/index.js +31 -35
- package/dist/esm/plugins/web-components/index.js +18 -20
- package/dist/esm/plugins/window-object/index.js +9 -9
- package/dist/esm/server/index.js +95 -89
- package/dist/experience-instance-DZiAwXph.js +481 -0
- package/dist/experience-instance-Ddk4Jktn.cjs +1 -0
- package/dist/id-Bv44ilEo.cjs +1 -0
- package/dist/id-CRqy981z.js +4 -0
- package/dist/logger-6z_gb4rA.js +4 -0
- package/dist/logger-fbvQC40v.cjs +1 -0
- package/dist/object-C82v79xc.js +25 -0
- package/dist/object-CUJOjanb.cjs +1 -0
- package/dist/rules-logic-B7vJrWyO.js +231 -0
- package/dist/rules-logic-CXr4wXcG.cjs +1 -0
- package/dist/storage-6Xk0uAxB.js +103 -0
- package/dist/storage-B6lQtc4-.cjs +1 -0
- package/dist/supports-0XIfd4-R.js +85 -0
- package/dist/supports-Dsjg-82e.cjs +1 -0
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +31 -48
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -2
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +12 -17
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +7 -9
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/form/build-responses.d.ts +14 -0
- package/dist/types/form/build-responses.d.ts.map +1 -0
- package/dist/types/form/create-field-evaluator.d.ts +19 -0
- package/dist/types/form/create-field-evaluator.d.ts.map +1 -0
- package/dist/types/form/create-field-validation.d.ts +44 -0
- package/dist/types/form/create-field-validation.d.ts.map +1 -0
- package/dist/types/form/create-form.d.ts +66 -0
- package/dist/types/form/create-form.d.ts.map +1 -0
- package/dist/types/form/create-submit-pipeline.d.ts +58 -0
- package/dist/types/form/create-submit-pipeline.d.ts.map +1 -0
- package/dist/types/form/get-step-fields.d.ts +5 -0
- package/dist/types/form/get-step-fields.d.ts.map +1 -0
- package/dist/types/form/index.d.ts +10 -0
- package/dist/types/form/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +2 -8
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +23 -42
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +37 -70
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +1 -1
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +5 -20
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -46
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +2 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -0
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +2 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +0 -3
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +2 -2
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +0 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +2 -1
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +3 -3
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +2 -7
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +0 -8
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/picked-config.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +18 -8
- package/dist/api-GlH9T8_1.js +0 -32
- package/dist/api-GvmToTw0.cjs +0 -1
- package/dist/experience-instance-CxiOyYPf.cjs +0 -1
- package/dist/experience-instance-DCknHRkX.js +0 -804
- package/dist/id-BKIWbSTy.cjs +0 -1
- package/dist/id-BW-g3y32.js +0 -6
- package/dist/logger-BsmHUUw1.cjs +0 -1
- package/dist/logger-C9a75KZn.js +0 -5
- package/dist/nodes-DQt4TfuO.js +0 -26
- package/dist/nodes-DsL8kMSX.cjs +0 -1
- package/dist/object-BbFTsGh3.cjs +0 -1
- package/dist/object-JwZ58NOH.js +0 -28
- package/dist/storage-Be5xWNPC.cjs +0 -1
- package/dist/storage-Co_LbKr_.js +0 -239
- package/dist/supports-8YT4QKI7.js +0 -95
- package/dist/supports-YvpQZxbh.cjs +0 -1
- package/dist/types/entities/condition/condition.d.ts +0 -17
- package/dist/types/entities/condition/condition.d.ts.map +0 -1
- package/dist/types/entities/project/project.d.ts +0 -9
- package/dist/types/entities/project/project.d.ts.map +0 -1
- package/dist/types/entities/step/step.d.ts +0 -20
- package/dist/types/entities/step/step.d.ts.map +0 -1
- package/dist/types/utils/key.d.ts +0 -12
- package/dist/types/utils/key.d.ts.map +0 -1
|
@@ -1,204 +1,120 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
let n;
|
|
122
|
-
try {
|
|
123
|
-
n = __PICKED_PROJECT_CONFIG__;
|
|
124
|
-
} catch {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (n === void 0)
|
|
128
|
-
return;
|
|
129
|
-
let e;
|
|
130
|
-
if (typeof n == "string")
|
|
131
|
-
try {
|
|
132
|
-
e = JSON.parse(n);
|
|
133
|
-
} catch {
|
|
134
|
-
a("warn", "Build-time project config is not valid JSON");
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
else
|
|
138
|
-
e = n;
|
|
139
|
-
if (g(e))
|
|
140
|
-
return e;
|
|
141
|
-
a("warn", "Build-time project config has invalid shape, falling back to runtime fetch");
|
|
142
|
-
}
|
|
143
|
-
function E(n) {
|
|
144
|
-
try {
|
|
145
|
-
const e = new URL(n).hostname;
|
|
146
|
-
return e === "localhost" || e === "127.0.0.1" || e === "::1";
|
|
147
|
-
} catch {
|
|
148
|
-
return !1;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function O(n) {
|
|
152
|
-
if (typeof n != "object" || n === null || !("cause" in n))
|
|
153
|
-
return !1;
|
|
154
|
-
const { cause: e } = n;
|
|
155
|
-
return typeof e != "object" || e === null || !("code" in e) ? !1 : e.code === "ECONNREFUSED";
|
|
156
|
-
}
|
|
157
|
-
async function p(n, e, t) {
|
|
158
|
-
const r = t?.previewToken ? `projects/${e}?preview_token=${encodeURIComponent(t.previewToken)}` : `projects/${e}`;
|
|
159
|
-
let o;
|
|
160
|
-
try {
|
|
161
|
-
o = await m(n, r, t?.headers);
|
|
162
|
-
} catch (s) {
|
|
163
|
-
return E(n) && O(s) || a("warn", "Failed to fetch project config", s), null;
|
|
164
|
-
}
|
|
165
|
-
if (!o.ok)
|
|
166
|
-
return a("warn", `Project config request failed with status ${o.status.toString()}`), null;
|
|
167
|
-
let i;
|
|
168
|
-
try {
|
|
169
|
-
i = await o.json();
|
|
170
|
-
} catch {
|
|
171
|
-
return a("warn", "Failed to parse project config response"), null;
|
|
172
|
-
}
|
|
173
|
-
return g(i) ? i : (a("warn", "Invalid project config response shape"), null);
|
|
174
|
-
}
|
|
175
|
-
function T(n) {
|
|
176
|
-
return {
|
|
177
|
-
name: "dynamic-experiences",
|
|
178
|
-
setup: (e) => {
|
|
179
|
-
const t = n?.apiUrl ?? e.apiUrl;
|
|
180
|
-
return {
|
|
181
|
-
onStart: async () => {
|
|
182
|
-
const r = k(e);
|
|
183
|
-
if (r) {
|
|
184
|
-
const s = await p(t, e.projectId, { previewToken: r });
|
|
185
|
-
s && (l(e, s, !0), c(e, s), f(e, s), u(e, s), d(e, s));
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
const o = n?.projectConfig ?? F();
|
|
189
|
-
if (o) {
|
|
190
|
-
l(e, o, !1), c(e, o), f(e, o), u(e, o), d(e, o);
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
const i = await p(t, e.projectId);
|
|
194
|
-
i && (l(e, i, !1), c(e, i), f(e, i), u(e, i), d(e, i));
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
export {
|
|
201
|
-
U as createClientHeaders,
|
|
202
|
-
T as dynamicExperiencesPlugin,
|
|
203
|
-
p as fetchProject
|
|
204
|
-
};
|
|
1
|
+
import "../../../logger-6z_gb4rA.js";
|
|
2
|
+
import { i as e, t } from "../../../api-ZK-H-MlI.js";
|
|
3
|
+
//#region src/plugins/dynamic-experiences/hash.ts
|
|
4
|
+
function n(e) {
|
|
5
|
+
let t = 2166136261;
|
|
6
|
+
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
7
|
+
return t >>> 0;
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
return n(e) % 100;
|
|
11
|
+
}
|
|
12
|
+
function i(e, t) {
|
|
13
|
+
return t <= 0 ? !1 : t >= 100 ? !0 : e < t;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/plugins/dynamic-experiences/plugin.ts
|
|
17
|
+
function a(e) {
|
|
18
|
+
return typeof e != "object" || !e || !("id" in e && "name" in e && "enabled" in e && "weight" in e && "version" in e) ? !1 : typeof e.id == "string" && typeof e.name == "string" && typeof e.enabled == "boolean" && typeof e.weight == "number" && typeof e.version == "number";
|
|
19
|
+
}
|
|
20
|
+
function o(e) {
|
|
21
|
+
return typeof e != "object" || !e || !("features" in e) || !Array.isArray(e.features) ? !1 : e.features.every(a);
|
|
22
|
+
}
|
|
23
|
+
function s(e) {
|
|
24
|
+
let t = e.searchParams["preview-token"];
|
|
25
|
+
if (t && t.length > 0) return t[0];
|
|
26
|
+
}
|
|
27
|
+
function c(e) {
|
|
28
|
+
let t = /* @__PURE__ */ new Set(), n = e.searchParams.feature;
|
|
29
|
+
if (!n) return t;
|
|
30
|
+
for (let e of n) {
|
|
31
|
+
let n = e.indexOf(":");
|
|
32
|
+
n > 0 && t.add(e.substring(0, n));
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
}
|
|
36
|
+
function l(e, t, n) {
|
|
37
|
+
let i = c(e), a = e.session?.id;
|
|
38
|
+
if (!a) throw Error("Session ID is required for feature registration");
|
|
39
|
+
let o = r(a);
|
|
40
|
+
for (let r of t.features) i.has(r.id) || u(e, r, n, o);
|
|
41
|
+
}
|
|
42
|
+
function u(e, t, n, r) {
|
|
43
|
+
e.registerFeature(t.id, {
|
|
44
|
+
key: `v${t.version}`,
|
|
45
|
+
name: t.name,
|
|
46
|
+
storage: n ? "session" : "local",
|
|
47
|
+
decide: () => t.enabled ? i(r, t.weight) : !1
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function d() {
|
|
51
|
+
let e;
|
|
52
|
+
try {
|
|
53
|
+
e = __PICKED_PROJECT_CONFIG__;
|
|
54
|
+
} catch {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (e === void 0) return;
|
|
58
|
+
let t;
|
|
59
|
+
if (typeof e == "string") try {
|
|
60
|
+
t = JSON.parse(e);
|
|
61
|
+
} catch {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
else t = e;
|
|
65
|
+
if (o(t)) return t;
|
|
66
|
+
}
|
|
67
|
+
function f(e) {
|
|
68
|
+
try {
|
|
69
|
+
let t = new URL(e).hostname;
|
|
70
|
+
return t === "localhost" || t === "127.0.0.1" || t === "::1";
|
|
71
|
+
} catch {
|
|
72
|
+
return !1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function p(e) {
|
|
76
|
+
if (typeof e != "object" || !e || !("cause" in e)) return !1;
|
|
77
|
+
let { cause: t } = e;
|
|
78
|
+
return typeof t != "object" || !t || !("code" in t) ? !1 : t.code === "ECONNREFUSED";
|
|
79
|
+
}
|
|
80
|
+
async function m(e, n, r) {
|
|
81
|
+
let i = r?.previewToken ? `projects/${n}?preview_token=${encodeURIComponent(r.previewToken)}` : `projects/${n}`, a;
|
|
82
|
+
try {
|
|
83
|
+
a = await t(e, i, r?.headers);
|
|
84
|
+
} catch (t) {
|
|
85
|
+
return f(e) && p(t), null;
|
|
86
|
+
}
|
|
87
|
+
if (!a.ok) return `${a.status.toString()}`, null;
|
|
88
|
+
let s;
|
|
89
|
+
try {
|
|
90
|
+
s = await a.json();
|
|
91
|
+
} catch {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return o(s) ? s : null;
|
|
95
|
+
}
|
|
96
|
+
function h(e) {
|
|
97
|
+
return {
|
|
98
|
+
name: "dynamic-experiences",
|
|
99
|
+
setup: (t) => {
|
|
100
|
+
let n = e?.apiUrl ?? t.apiUrl;
|
|
101
|
+
return { onStart: async () => {
|
|
102
|
+
let r = s(t);
|
|
103
|
+
if (r) {
|
|
104
|
+
let e = await m(n, t.projectId, { previewToken: r });
|
|
105
|
+
e && l(t, e, !0);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
let i = e?.projectConfig ?? d();
|
|
109
|
+
if (i) {
|
|
110
|
+
l(t, i, !1);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
let a = await m(n, t.projectId);
|
|
114
|
+
a && l(t, a, !1);
|
|
115
|
+
} };
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { e as createClientHeaders, h as dynamicExperiencesPlugin, m as fetchProject };
|
|
@@ -1,38 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
s.experienceInstances.listStore.watch((e) => {
|
|
32
|
-
e.forEach((t) => x(t));
|
|
33
|
-
});
|
|
34
|
-
}
|
|
1
|
+
import "../../../logger-6z_gb4rA.js";
|
|
2
|
+
import { n as e, r as t, t as n } from "../../../storage-6Xk0uAxB.js";
|
|
3
|
+
import { createEffect as r, sample as i } from "effector";
|
|
4
|
+
//#region src/plugins/experience-browser-storage/plugin.ts
|
|
5
|
+
var a = ({ storage: a = "local" } = {}) => ({
|
|
6
|
+
name: "experience-browser-storage-plugin",
|
|
7
|
+
setup: (o) => {
|
|
8
|
+
let s = a === "local" ? e : t, c = r(async (e) => {
|
|
9
|
+
if (!e) return;
|
|
10
|
+
let t = n("open-close", "experience", e), r = s.get(t).boolean();
|
|
11
|
+
e.setOpen(r ?? e.isOpenStore.getState());
|
|
12
|
+
});
|
|
13
|
+
i({
|
|
14
|
+
source: o.eventBus,
|
|
15
|
+
filter: (e) => e.type === "experience_initialize" && "experience" in e,
|
|
16
|
+
fn: (e) => e.experience,
|
|
17
|
+
target: c
|
|
18
|
+
});
|
|
19
|
+
let l = r(async (e) => {
|
|
20
|
+
let t = n("open-close", "experience", e), r = e.isOpenStore.getState();
|
|
21
|
+
s.set(t, r);
|
|
22
|
+
}), u = (e) => i({
|
|
23
|
+
source: e.isOpenStore,
|
|
24
|
+
fn: () => e,
|
|
25
|
+
target: l
|
|
26
|
+
});
|
|
27
|
+
o.experienceInstances.listStore.watch((e) => {
|
|
28
|
+
e.forEach((e) => u(e));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
35
31
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { a as experienceBrowserStoragePlugin };
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
1
|
+
import { n as e, r as t, t as n } from "../../../storage-6Xk0uAxB.js";
|
|
2
|
+
import { createEffect as r, sample as i } from "effector";
|
|
3
|
+
//#region src/plugins/history-browser-storage/plugin.ts
|
|
4
|
+
var a = n("history", "global"), o = ({ storage: n = "local" } = {}) => ({
|
|
5
|
+
name: "history-browser-storage-plugin",
|
|
6
|
+
setup: (o) => {
|
|
7
|
+
let s = n === "local" ? e : t, c = r(async () => {
|
|
8
|
+
let e = s.get(a).json();
|
|
9
|
+
e && o.history.restore({ entries: e });
|
|
10
|
+
}), l = r(async (e) => {
|
|
11
|
+
s.set(a, e);
|
|
12
|
+
});
|
|
13
|
+
i({
|
|
14
|
+
source: o.eventBus,
|
|
15
|
+
filter: (e) => e.type === "load",
|
|
16
|
+
target: c
|
|
17
|
+
}), i({
|
|
18
|
+
source: o.history.entriesStore,
|
|
19
|
+
target: l
|
|
20
|
+
});
|
|
21
|
+
}
|
|
23
22
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { o as historyBrowserStoragePlugin };
|
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
}
|
|
1
|
+
import { n as e, r as t, t as n } from "../../../storage-6Xk0uAxB.js";
|
|
2
|
+
import { attach as r, createEffect as i, sample as a } from "effector";
|
|
3
|
+
//#region src/plugins/responses-browser-storage/plugin.ts
|
|
4
|
+
var o = n("responses", "global"), s = (e, t) => {
|
|
5
|
+
let n = {};
|
|
6
|
+
return Object.entries(e).forEach(([e, r]) => {
|
|
7
|
+
t.find((t) => t.id === e)?.policies?.doNotStoreValue || (n[e] = r);
|
|
8
|
+
}), n;
|
|
9
|
+
}, c = ({ storage: n = "local" } = {}) => ({
|
|
10
|
+
name: "responses-browser-storage-plugin",
|
|
11
|
+
setup: (c) => {
|
|
12
|
+
let l = n === "local" ? e : t, u = i(async () => {
|
|
13
|
+
let e = l.get(o).json();
|
|
14
|
+
if (!e) return null;
|
|
15
|
+
c.responses.register(e);
|
|
16
|
+
}), d = r({
|
|
17
|
+
source: {
|
|
18
|
+
responses: c.responses.getAllStore,
|
|
19
|
+
fields: c.fields.listStore
|
|
20
|
+
},
|
|
21
|
+
effect: ({ responses: e, fields: t }) => {
|
|
22
|
+
let n = s(e, t);
|
|
23
|
+
l.set(o, n);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
a({
|
|
27
|
+
source: c.eventBus,
|
|
28
|
+
filter: (e) => e.type === "load",
|
|
29
|
+
target: u
|
|
30
|
+
}), a({
|
|
31
|
+
source: c.responses.getAllStore,
|
|
32
|
+
target: d
|
|
33
|
+
});
|
|
34
|
+
}
|
|
37
35
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { c as responsesBrowserStoragePlugin };
|