@picked/client 0.0.1-dev.1756875690387 → 0.0.1-dev.1762908210565
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -0
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -0
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -0
- package/dist/cjs/plugins/{responses-indexeddb-plugin → responses-indexeddb}/index.js +1 -1
- package/dist/cjs/plugins/shopify/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -0
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +555 -443
- package/dist/esm/plugins/create-experience/index.js +172 -103
- package/dist/esm/plugins/experience-browser-storage/index.js +39 -0
- package/dist/esm/plugins/{history-browserstorage-plugin → history-browser-storage}/index.js +2 -2
- package/dist/esm/plugins/responses-browser-storage/index.js +41 -0
- package/dist/esm/plugins/{responses-indexeddb-plugin → responses-indexeddb}/index.js +24 -21
- package/dist/esm/plugins/shopify/index.js +38 -28
- package/dist/esm/plugins/single-page-app/index.js +3 -3
- package/dist/esm/plugins/web-components/index.js +21 -0
- package/dist/esm/plugins/window-object/index.js +1 -1
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-CF6m7G83.cjs +1 -0
- package/dist/experience-instance-CKru5var.js +781 -0
- package/dist/storage-Cb_71y48.js +94 -0
- package/dist/storage-DuRlyFaY.cjs +1 -0
- package/dist/{supports-BvrzQAVk.js → supports-BjhuLJ8z.js} +27 -11
- package/dist/supports-YvpQZxbh.cjs +1 -0
- package/dist/types/client.d.ts +26 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/action/action.d.ts +15 -0
- package/dist/types/entities/action/action.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +19 -6
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +13 -10
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +5 -2
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +27 -19
- 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/predicate/predicate.d.ts +1 -1
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +8 -0
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/exports.d.ts +2 -0
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/picked.d.ts +28 -10
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +48 -13
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/index.d.ts.map +1 -0
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -0
- package/dist/types/plugins/history-browser-storage/index.d.ts.map +1 -0
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-browser-storage/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/plugin.d.ts.map +1 -1
- package/dist/types/plugins/shopify/utils.d.ts +21 -0
- package/dist/types/plugins/shopify/utils.d.ts.map +1 -0
- package/dist/types/plugins/web-components/index.d.ts +2 -0
- package/dist/types/plugins/web-components/index.d.ts.map +1 -0
- package/dist/types/plugins/web-components/plugin.d.ts +3 -0
- package/dist/types/plugins/web-components/plugin.d.ts.map +1 -0
- package/dist/types/utils/dom.d.ts +5 -5
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +29 -24
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/get-step-fields.d.ts +4 -0
- package/dist/types/utils/get-step-fields.d.ts.map +1 -0
- package/dist/types/utils/nodes.d.ts +2 -1
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts +3 -0
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/dist/types/utils/supports.d.ts +2 -0
- package/dist/types/utils/supports.d.ts.map +1 -1
- package/dist/types/utils/user-session.d.ts +5 -0
- package/dist/types/utils/user-session.d.ts.map +1 -0
- package/package.json +32 -26
- package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +0 -1
- package/dist/cjs/plugins/history-browserstorage-plugin/index.js +0 -1
- package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +0 -1
- package/dist/esm/plugins/experience-browserstorage-plugin/index.js +0 -38
- package/dist/esm/plugins/responses-browserstorage-plugin/index.js +0 -36
- package/dist/experience-instance-6ZKZS7dF.cjs +0 -1
- package/dist/experience-instance-BA0EXYg5.js +0 -712
- package/dist/storage-BPJwmlva.cjs +0 -1
- package/dist/storage-D87xFySf.js +0 -85
- package/dist/supports-C0y3-V5V.cjs +0 -1
- package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +0 -1
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +0 -1
- package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +0 -1
- package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +0 -1
- /package/dist/types/plugins/{experience-browserstorage-plugin → experience-browser-storage}/index.d.ts +0 -0
- /package/dist/types/plugins/{experience-browserstorage-plugin → experience-browser-storage}/plugin.d.ts +0 -0
- /package/dist/types/plugins/{history-browserstorage-plugin → history-browser-storage}/index.d.ts +0 -0
- /package/dist/types/plugins/{history-browserstorage-plugin → history-browser-storage}/plugin.d.ts +0 -0
- /package/dist/types/plugins/{responses-browserstorage-plugin → responses-browser-storage}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-browserstorage-plugin → responses-browser-storage}/plugin.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb-plugin → responses-indexeddb}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb-plugin → responses-indexeddb}/plugin.d.ts +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const f = (e) => btoa([...e].map((t) => String.fromCharCode(t.charCodeAt(0) ^ 7)).join("")).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
2
|
+
function m(e, t = "global", o) {
|
|
3
|
+
let r = "pckd";
|
|
4
|
+
if (t === "experience") {
|
|
5
|
+
if (!o)
|
|
6
|
+
throw new Error("Experience instance is required to scope storage to an experience");
|
|
7
|
+
r = `${r}:${o.experienceId}`;
|
|
8
|
+
}
|
|
9
|
+
return `${r}:${f(e)}`;
|
|
10
|
+
}
|
|
11
|
+
function l(e, t, o, r) {
|
|
12
|
+
const n = o === "local" ? localStorage : sessionStorage, s = typeof t != "string" ? JSON.stringify(t) : t;
|
|
13
|
+
if (n.setItem(e, s), typeof r == "number") {
|
|
14
|
+
const a = new Date(Date.now() + r).toISOString();
|
|
15
|
+
n.setItem(`${e}:expires-at`, a);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function c(e, t) {
|
|
19
|
+
const o = t === "local" ? localStorage : sessionStorage;
|
|
20
|
+
o.removeItem(e), o.removeItem(`${e}:expires-at`);
|
|
21
|
+
}
|
|
22
|
+
function u(e, t, o, r) {
|
|
23
|
+
const n = t === "local" ? localStorage : sessionStorage;
|
|
24
|
+
function s(i) {
|
|
25
|
+
i.storageArea === n && i.key === e && r(o(e));
|
|
26
|
+
}
|
|
27
|
+
return window.addEventListener("storage", s), function() {
|
|
28
|
+
window.removeEventListener("storage", s);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function g(e, t) {
|
|
32
|
+
const o = t === "local" ? localStorage : sessionStorage, r = o.getItem(e), n = o.getItem(`${e}:expires-at`), s = (a) => l(e, a, t), i = () => c(e, t);
|
|
33
|
+
if (n) {
|
|
34
|
+
const a = /* @__PURE__ */ new Date(), p = new Date(n);
|
|
35
|
+
if (a > p)
|
|
36
|
+
return c(e, t), {
|
|
37
|
+
isSet: () => !1,
|
|
38
|
+
text: () => null,
|
|
39
|
+
json: () => null,
|
|
40
|
+
boolean: () => null,
|
|
41
|
+
set: s,
|
|
42
|
+
remove: i
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
isSet() {
|
|
47
|
+
return r !== null;
|
|
48
|
+
},
|
|
49
|
+
text() {
|
|
50
|
+
return r;
|
|
51
|
+
},
|
|
52
|
+
json() {
|
|
53
|
+
return r ? JSON.parse(r) : null;
|
|
54
|
+
},
|
|
55
|
+
boolean() {
|
|
56
|
+
return r ? r === "true" : null;
|
|
57
|
+
},
|
|
58
|
+
set: s,
|
|
59
|
+
remove: i
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const S = {
|
|
63
|
+
get(e) {
|
|
64
|
+
return g(e, "session");
|
|
65
|
+
},
|
|
66
|
+
set(e, t, o) {
|
|
67
|
+
l(e, t, "session", o);
|
|
68
|
+
},
|
|
69
|
+
remove(e) {
|
|
70
|
+
c(e, "session");
|
|
71
|
+
},
|
|
72
|
+
subscribe(e, t) {
|
|
73
|
+
return u(e, "session", this.get, t);
|
|
74
|
+
}
|
|
75
|
+
}, x = {
|
|
76
|
+
get(e) {
|
|
77
|
+
return g(e, "local");
|
|
78
|
+
},
|
|
79
|
+
set(e, t, o) {
|
|
80
|
+
l(e, t, "local", o);
|
|
81
|
+
},
|
|
82
|
+
remove(e) {
|
|
83
|
+
c(e, "local");
|
|
84
|
+
},
|
|
85
|
+
subscribe(e, t) {
|
|
86
|
+
return u(e, "local", this.get, t);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
u as a,
|
|
91
|
+
m as c,
|
|
92
|
+
x as l,
|
|
93
|
+
S as s
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=e=>btoa([...e].map(t=>String.fromCharCode(t.charCodeAt(0)^7)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function m(e,t="global",o){let r="pckd";if(t==="experience"){if(!o)throw new Error("Experience instance is required to scope storage to an experience");r=`${r}:${o.experienceId}`}return`${r}:${f(e)}`}function l(e,t,o,r){const n=o==="local"?localStorage:sessionStorage,s=typeof t!="string"?JSON.stringify(t):t;if(n.setItem(e,s),typeof r=="number"){const c=new Date(Date.now()+r).toISOString();n.setItem(`${e}:expires-at`,c)}}function a(e,t){const o=t==="local"?localStorage:sessionStorage;o.removeItem(e),o.removeItem(`${e}:expires-at`)}function u(e,t,o,r){const n=t==="local"?localStorage:sessionStorage;function s(i){i.storageArea===n&&i.key===e&&r(o(e))}return window.addEventListener("storage",s),function(){window.removeEventListener("storage",s)}}function g(e,t){const o=t==="local"?localStorage:sessionStorage,r=o.getItem(e),n=o.getItem(`${e}:expires-at`),s=c=>l(e,c,t),i=()=>a(e,t);if(n){const c=new Date,S=new Date(n);if(c>S)return a(e,t),{isSet:()=>!1,text:()=>null,json:()=>null,boolean:()=>null,set:s,remove:i}}return{isSet(){return r!==null},text(){return r},json(){return r?JSON.parse(r):null},boolean(){return r?r==="true":null},set:s,remove:i}}const p={get(e){return g(e,"session")},set(e,t,o){l(e,t,"session",o)},remove(e){a(e,"session")},subscribe(e,t){return u(e,"session",this.get,t)}},b={get(e){return g(e,"local")},set(e,t,o){l(e,t,"local",o)},remove(e){a(e,"local")},subscribe(e,t){return u(e,"local",this.get,t)}};exports.createStorageKey=m;exports.localStore=b;exports.sessionStore=p;exports.subscribe=u;
|
|
@@ -50,30 +50,46 @@ function l() {
|
|
|
50
50
|
return !1;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function p() {
|
|
54
54
|
try {
|
|
55
55
|
return "document" in t;
|
|
56
56
|
} catch {
|
|
57
57
|
return !1;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function f() {
|
|
61
61
|
try {
|
|
62
62
|
return "IntersectionObserver" in t;
|
|
63
63
|
} catch {
|
|
64
64
|
return !1;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
+
function y() {
|
|
68
|
+
try {
|
|
69
|
+
return "customElements" in t && !!t.customElements;
|
|
70
|
+
} catch {
|
|
71
|
+
return !1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function h() {
|
|
75
|
+
try {
|
|
76
|
+
return "crypto" in t && "randomUUID" in t.crypto;
|
|
77
|
+
} catch {
|
|
78
|
+
return !1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
67
81
|
export {
|
|
68
82
|
t as G,
|
|
69
83
|
l as a,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
f as
|
|
84
|
+
a as b,
|
|
85
|
+
h as c,
|
|
86
|
+
r as d,
|
|
87
|
+
e,
|
|
88
|
+
s as f,
|
|
89
|
+
c as g,
|
|
90
|
+
u as h,
|
|
91
|
+
i,
|
|
92
|
+
f as j,
|
|
93
|
+
y as k,
|
|
94
|
+
p as s
|
|
79
95
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=Symbol("Picked"),t=globalThis,r=o=>{t[n]=o};function e(){try{return"location"in t&&!!t.location}catch{return!1}}function s(){try{return"history"in t&&!!t.history}catch{return!1}}function u(){try{return"localStorage"in t&&!!t.localStorage}catch{return!1}}function c(){try{return"sessionStorage"in t&&!!t.sessionStorage}catch{return!1}}function a(){try{return"document"in t&&"cookie"in t.document}catch{return!1}}function i(){try{return"document"in t&&"createElement"in t.document&&"attachShadow"in t.document.createElement("div")}catch{return!1}}function p(){try{return"window"in t}catch{return!1}}function l(){try{return"document"in t}catch{return!1}}function f(){try{return"IntersectionObserver"in t}catch{return!1}}function y(){try{return"customElements"in t&&!!t.customElements}catch{return!1}}function m(){try{return"crypto"in t&&"randomUUID"in t.crypto}catch{return!1}}exports.GLOBAL_OBJ=t;exports.bindClient=r;exports.supportsCookies=a;exports.supportsCryptoRandomUUID=m;exports.supportsDocument=l;exports.supportsHistory=s;exports.supportsIntersectionObserver=f;exports.supportsLocalStorage=u;exports.supportsLocation=e;exports.supportsSessionStorage=c;exports.supportsShadowRoot=i;exports.supportsWebComponents=y;exports.supportsWindow=p;
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Predicate } from './entities/predicate/predicate';
|
|
2
|
+
import { Action } from './entities/action/action';
|
|
2
3
|
import { Plugin } from './entities/plugin/plugin';
|
|
3
4
|
import { Feature } from './entities/feature/feature';
|
|
4
5
|
export interface CreateClientOptions {
|
|
@@ -31,6 +32,31 @@ export interface CreateClientOptions {
|
|
|
31
32
|
* ```
|
|
32
33
|
*/
|
|
33
34
|
predicates?: Record<string, Predicate>;
|
|
35
|
+
/**
|
|
36
|
+
* Register actions to be invoked in experience trees
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* actions: {
|
|
41
|
+
* logEvent({ event, data }) {
|
|
42
|
+
* // custom logic
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Register actions to be invoked in experience trees
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* actions: {
|
|
53
|
+
* logEvent({ event, data }) {
|
|
54
|
+
* // custom logic
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
actions?: Record<string, Action>;
|
|
34
60
|
/**
|
|
35
61
|
* Plugins to extend client functionality
|
|
36
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAEtC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,CAAA;IAEnE;;;;;;;;;;;;;;;OAeG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC,CAAA;CACrD"}
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAEtC;;;;;;;;;;;OAWG;IACH;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAEhC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,CAAA;IAEnE;;;;;;;;;;;;;;;OAeG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC,CAAA;CACrD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type Action = () => void;
|
|
2
|
+
export type ActionsStore = ReturnType<typeof createActionIndexFactory>;
|
|
3
|
+
export interface ActionIndexItem {
|
|
4
|
+
name: string;
|
|
5
|
+
action: Action;
|
|
6
|
+
}
|
|
7
|
+
declare const createActionIndexFactory: () => {
|
|
8
|
+
register: (name: string, action: Action) => void;
|
|
9
|
+
getByName: (name: string) => import('effector').Store<ActionIndexItem | undefined>;
|
|
10
|
+
listStore: import('effector').Store<ActionIndexItem[]>;
|
|
11
|
+
};
|
|
12
|
+
export declare function createActionIndex(): ReturnType<typeof createActionIndexFactory>;
|
|
13
|
+
export declare const setupAction: (name: string, action: Action, actions: ActionsStore) => void;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/entities/action/action.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,MAAM,GAAG,MAAM,IAAI,CAAA;AAC/B,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAItE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,wBAAwB;qBAiBJ,MAAM,UAAU,MAAM,KAAG,IAAI;sBAQ5B,MAAM;;CAS/B,CAAA;AAEF,wBAAgB,iBAAiB,IAAI,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAE/E;AAED,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,EAAE,SAAS,YAAY,KAAG,IAEjF,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdaptedComponent } from '../component/component';
|
|
2
2
|
import { Picked } from '../../picked';
|
|
3
|
-
import { LogicRule } from '../../logic-engine';
|
|
3
|
+
import { LogicRule, LogicValue } from '../../logic-engine';
|
|
4
4
|
import { Field } from '../field/field';
|
|
5
5
|
export type ExperiencesListStore = ReturnType<typeof createExperienceIndex>;
|
|
6
6
|
export type ExperienceStore = ReturnType<typeof createExperience>;
|
|
@@ -10,10 +10,10 @@ declare const createExperienceFactory: ({ client, experience }: {
|
|
|
10
10
|
}) => {
|
|
11
11
|
id: string;
|
|
12
12
|
configStore: import('effector').Store<{
|
|
13
|
-
type: string;
|
|
14
13
|
name: string;
|
|
15
14
|
decisionLogic: LogicRule | undefined;
|
|
16
15
|
targetSelectors: ExperienceTarget[];
|
|
16
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
17
17
|
}>;
|
|
18
18
|
treeStore: import('effector').Store<{
|
|
19
19
|
steps: ExperienceStep[];
|
|
@@ -26,6 +26,7 @@ declare const createExperienceFactory: ({ client, experience }: {
|
|
|
26
26
|
component: AdaptedComponent<string, unknown>;
|
|
27
27
|
frameworkStore: import('effector').Store<import('../..').Framework | undefined>;
|
|
28
28
|
} | undefined>;
|
|
29
|
+
actions: ExperienceAction[];
|
|
29
30
|
merge: import('effector').EventCallable<{
|
|
30
31
|
experience: Partial<Experience>;
|
|
31
32
|
strategy: "override";
|
|
@@ -39,10 +40,10 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
39
40
|
getById: (id: Experience["id"]) => import('effector').Store<{
|
|
40
41
|
id: string;
|
|
41
42
|
configStore: import('effector').Store<{
|
|
42
|
-
type: string;
|
|
43
43
|
name: string;
|
|
44
44
|
decisionLogic: LogicRule | undefined;
|
|
45
45
|
targetSelectors: ExperienceTarget[];
|
|
46
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
46
47
|
}>;
|
|
47
48
|
treeStore: import('effector').Store<{
|
|
48
49
|
steps: ExperienceStep[];
|
|
@@ -55,6 +56,7 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
55
56
|
component: AdaptedComponent<string, unknown>;
|
|
56
57
|
frameworkStore: import('effector').Store<import('../..').Framework | undefined>;
|
|
57
58
|
} | undefined>;
|
|
59
|
+
actions: ExperienceAction[];
|
|
58
60
|
merge: import('effector').EventCallable<{
|
|
59
61
|
experience: Partial<Experience>;
|
|
60
62
|
strategy: "override";
|
|
@@ -63,10 +65,10 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
63
65
|
listStore: import('effector').Store<{
|
|
64
66
|
id: string;
|
|
65
67
|
configStore: import('effector').Store<{
|
|
66
|
-
type: string;
|
|
67
68
|
name: string;
|
|
68
69
|
decisionLogic: LogicRule | undefined;
|
|
69
70
|
targetSelectors: ExperienceTarget[];
|
|
71
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
70
72
|
}>;
|
|
71
73
|
treeStore: import('effector').Store<{
|
|
72
74
|
steps: ExperienceStep[];
|
|
@@ -79,6 +81,7 @@ declare const createExperienceIndexFactory: ({ client }: {
|
|
|
79
81
|
component: AdaptedComponent<string, unknown>;
|
|
80
82
|
frameworkStore: import('effector').Store<import('../..').Framework | undefined>;
|
|
81
83
|
} | undefined>;
|
|
84
|
+
actions: ExperienceAction[];
|
|
82
85
|
merge: import('effector').EventCallable<{
|
|
83
86
|
experience: Partial<Experience>;
|
|
84
87
|
strategy: "override";
|
|
@@ -91,7 +94,16 @@ export interface ExperienceStep {
|
|
|
91
94
|
label: string;
|
|
92
95
|
fieldIds: string[];
|
|
93
96
|
}
|
|
94
|
-
export type ExperienceNode = StepNode | ConditionalNode | LaunchExperienceNode | OriginNode;
|
|
97
|
+
export type ExperienceNode = StepNode | ConditionalNode | LaunchExperienceNode | OriginNode | ActionNode;
|
|
98
|
+
export interface ExperienceAction {
|
|
99
|
+
id: string;
|
|
100
|
+
action: string;
|
|
101
|
+
}
|
|
102
|
+
export interface ActionNode extends BaseNode {
|
|
103
|
+
type: 'action';
|
|
104
|
+
action: string;
|
|
105
|
+
position: [number, number];
|
|
106
|
+
}
|
|
95
107
|
export interface BaseNode {
|
|
96
108
|
id: string;
|
|
97
109
|
type: string;
|
|
@@ -130,9 +142,10 @@ export interface ExperienceTarget {
|
|
|
130
142
|
export interface Experience {
|
|
131
143
|
id: string;
|
|
132
144
|
name: string;
|
|
133
|
-
type: string;
|
|
134
145
|
component?: AdaptedComponent;
|
|
135
146
|
conditionals: ExperienceConditional[];
|
|
147
|
+
initializeOpen?: LogicRule | LogicValue;
|
|
148
|
+
actions?: ExperienceAction[];
|
|
136
149
|
decide: LogicRule | undefined;
|
|
137
150
|
edges: ExperienceEdge[];
|
|
138
151
|
nodes: ExperienceNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAC3E,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAIjE,QAAA,MAAM,uBAAuB,2BACF;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;oBAIjB,OAAO,CAAC,UAAU,CAAC;kBAAY,UAAU;;CAmD5F,CAAA;AACD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,EACtF,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAE5C;AAED,QAAA,MAAM,4BAA4B,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;2BAclD,UAAU,KAAG,IAAI;kBAgB1B,UAAU,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;wBAxFa,OAA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A0B,GACrC,QAAQ,MAAM,EACd,YAAY,eAAe,KAC1B,OAAO,CAAC,OAAO,CAsBjB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Experience, ExperienceNode, ExperienceStore, ExperienceTarget } from '../experience/experience';
|
|
1
|
+
import { Experience, ExperienceNode, ExperienceStep, ExperienceStore, ExperienceTarget } from '../experience/experience';
|
|
2
2
|
import { Picked } from '../../picked';
|
|
3
3
|
export type ExperienceInstance = ReturnType<typeof createExperienceInstance>;
|
|
4
4
|
export type ExperienceInstanceIndex = ReturnType<typeof createExperienceInstanceIndex>;
|
|
@@ -11,12 +11,13 @@ declare const createExperienceInstanceFactory: ({ client, experience, target, }:
|
|
|
11
11
|
experience: ExperienceStore;
|
|
12
12
|
target?: HTMLElement;
|
|
13
13
|
}) => {
|
|
14
|
+
id: string;
|
|
14
15
|
experienceId: string;
|
|
15
16
|
configStore: import('effector').Store<{
|
|
16
|
-
type: string;
|
|
17
17
|
name: string;
|
|
18
18
|
decisionLogic: import('../../logic-engine').LogicRule | undefined;
|
|
19
19
|
targetSelectors: ExperienceTarget[];
|
|
20
|
+
initializeOpenLogic: import('../../logic-engine').LogicValue | import('../../logic-engine').LogicRule;
|
|
20
21
|
}>;
|
|
21
22
|
target: HTMLElement | undefined;
|
|
22
23
|
componentStore: import('effector').Store<{
|
|
@@ -31,13 +32,13 @@ declare const createExperienceInstanceFactory: ({ client, experience, target, }:
|
|
|
31
32
|
toggleOpen: import('effector').EventCallable<void>;
|
|
32
33
|
setOpen: import('effector').EventCallable<boolean>;
|
|
33
34
|
treeStore: import('effector').Store<{
|
|
34
|
-
steps:
|
|
35
|
+
steps: ExperienceStep[];
|
|
35
36
|
nodes: ExperienceNode[];
|
|
36
37
|
edges: import('../..').ExperienceEdge[];
|
|
37
38
|
conditionals: import('../..').ExperienceConditional[];
|
|
38
39
|
}>;
|
|
39
40
|
currentNodeStore: import('effector').Store<ExperienceNode | null>;
|
|
40
|
-
currentStepStore: import('effector').Store<
|
|
41
|
+
currentStepStore: import('effector').Store<ExperienceStep | null>;
|
|
41
42
|
nextReachableStepNodesStore: import('effector').Store<ExperienceNode[]>;
|
|
42
43
|
stepsToOriginStore: import('effector').Store<number[]>;
|
|
43
44
|
stepsToLeafStore: import('effector').Store<number[]>;
|
|
@@ -52,12 +53,13 @@ declare const createExperienceInstanceIndexFactory: ({ client }: {
|
|
|
52
53
|
}) => {
|
|
53
54
|
spawn: (experience: ExperienceStore, target: HTMLElement) => void;
|
|
54
55
|
getByExperienceId: (id: Experience["id"]) => import('effector').Store<{
|
|
56
|
+
id: string;
|
|
55
57
|
experienceId: string;
|
|
56
58
|
configStore: import('effector').Store<{
|
|
57
|
-
type: string;
|
|
58
59
|
name: string;
|
|
59
60
|
decisionLogic: import('../../logic-engine').LogicRule | undefined;
|
|
60
61
|
targetSelectors: ExperienceTarget[];
|
|
62
|
+
initializeOpenLogic: import('../../logic-engine').LogicValue | import('../../logic-engine').LogicRule;
|
|
61
63
|
}>;
|
|
62
64
|
target: HTMLElement | undefined;
|
|
63
65
|
componentStore: import('effector').Store<{
|
|
@@ -72,13 +74,13 @@ declare const createExperienceInstanceIndexFactory: ({ client }: {
|
|
|
72
74
|
toggleOpen: import('effector').EventCallable<void>;
|
|
73
75
|
setOpen: import('effector').EventCallable<boolean>;
|
|
74
76
|
treeStore: import('effector').Store<{
|
|
75
|
-
steps:
|
|
77
|
+
steps: ExperienceStep[];
|
|
76
78
|
nodes: ExperienceNode[];
|
|
77
79
|
edges: import('../..').ExperienceEdge[];
|
|
78
80
|
conditionals: import('../..').ExperienceConditional[];
|
|
79
81
|
}>;
|
|
80
82
|
currentNodeStore: import('effector').Store<ExperienceNode | null>;
|
|
81
|
-
currentStepStore: import('effector').Store<
|
|
83
|
+
currentStepStore: import('effector').Store<ExperienceStep | null>;
|
|
82
84
|
nextReachableStepNodesStore: import('effector').Store<ExperienceNode[]>;
|
|
83
85
|
stepsToOriginStore: import('effector').Store<number[]>;
|
|
84
86
|
stepsToLeafStore: import('effector').Store<number[]>;
|
|
@@ -88,12 +90,13 @@ declare const createExperienceInstanceIndexFactory: ({ client }: {
|
|
|
88
90
|
stepsHistoryStore: import('effector').Store<import('../..').HistoryEntry[]>;
|
|
89
91
|
}[]>;
|
|
90
92
|
listStore: import('effector').Store<{
|
|
93
|
+
id: string;
|
|
91
94
|
experienceId: string;
|
|
92
95
|
configStore: import('effector').Store<{
|
|
93
|
-
type: string;
|
|
94
96
|
name: string;
|
|
95
97
|
decisionLogic: import('../../logic-engine').LogicRule | undefined;
|
|
96
98
|
targetSelectors: ExperienceTarget[];
|
|
99
|
+
initializeOpenLogic: import('../../logic-engine').LogicValue | import('../../logic-engine').LogicRule;
|
|
97
100
|
}>;
|
|
98
101
|
target: HTMLElement | undefined;
|
|
99
102
|
componentStore: import('effector').Store<{
|
|
@@ -108,13 +111,13 @@ declare const createExperienceInstanceIndexFactory: ({ client }: {
|
|
|
108
111
|
toggleOpen: import('effector').EventCallable<void>;
|
|
109
112
|
setOpen: import('effector').EventCallable<boolean>;
|
|
110
113
|
treeStore: import('effector').Store<{
|
|
111
|
-
steps:
|
|
114
|
+
steps: ExperienceStep[];
|
|
112
115
|
nodes: ExperienceNode[];
|
|
113
116
|
edges: import('../..').ExperienceEdge[];
|
|
114
117
|
conditionals: import('../..').ExperienceConditional[];
|
|
115
118
|
}>;
|
|
116
119
|
currentNodeStore: import('effector').Store<ExperienceNode | null>;
|
|
117
|
-
currentStepStore: import('effector').Store<
|
|
120
|
+
currentStepStore: import('effector').Store<ExperienceStep | null>;
|
|
118
121
|
nextReachableStepNodesStore: import('effector').Store<ExperienceNode[]>;
|
|
119
122
|
stepsToOriginStore: import('effector').Store<number[]>;
|
|
120
123
|
stepsToLeafStore: import('effector').Store<number[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,UAAU,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAGjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"experience-instance.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience-instance/experience-instance.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAGjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAoB1C,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAC5E,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,oCAKhC;IACD,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,eAAe,CAAA;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6ZF,CAAA;AAED,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;wBAqI7D,eAAe,UAAU,WAAW;4BAQhC,UAAU,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS/C,CAAA;AAEF,wBAAgB,6BAA6B,CAC3C,CAAC,SAAS,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAAC,CAAC,CAAC,EACpE,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAEpE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Picked } from '../../picked';
|
|
1
2
|
export interface Feature {
|
|
2
3
|
key: string;
|
|
3
4
|
name: string;
|
|
@@ -37,12 +38,14 @@ export interface ResolvedFeatureBucket extends FeatureBaseBucket {
|
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
export type FeatureBucket = UnresolvedFeatureBucket | ResolvedFeatureBucket;
|
|
40
|
-
declare const createFeatureIndexFactory: (
|
|
41
|
+
declare const createFeatureIndexFactory: ({ client }: {
|
|
42
|
+
client: Picked;
|
|
43
|
+
}) => {
|
|
41
44
|
register: (id: string, feature: Feature) => void;
|
|
42
45
|
getByName: (name: string) => import('effector').Store<FeatureIndexItem | undefined>;
|
|
43
46
|
listStore: import('effector').Store<FeatureBucket[]>;
|
|
44
47
|
};
|
|
45
|
-
export declare function createFeatureIndex(): ReturnType<typeof createFeatureIndexFactory>;
|
|
48
|
+
export declare function createFeatureIndex<T extends Parameters<typeof createFeatureIndexFactory>[0]>(params: T): ReturnType<typeof createFeatureIndexFactory>;
|
|
46
49
|
export declare const setupFeature: (name: string, feature: Feature, features: FeaturesStore) => void;
|
|
47
50
|
export {};
|
|
48
51
|
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/entities/feature/feature.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/entities/feature/feature.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAI1C,MAAM,WAAW,OAAO;IACtB,GAAG,E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BAgBvD,MAAM,WAAW,OAAO,KAAG,IAAI;sBA6L5B,MAAM;;CAS/B,CAAA;AAEF,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,EAC1F,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAE9C;AAED,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,SAAS,OAAO,EAAE,UAAU,aAAa,SAEnF,CAAA"}
|
|
@@ -9,79 +9,87 @@ export interface FieldBase {
|
|
|
9
9
|
type: 'text' | 'number' | 'object' | 'boolean';
|
|
10
10
|
multiple: boolean;
|
|
11
11
|
required: boolean;
|
|
12
|
-
defaultValue
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
defaultValue?: FieldValue;
|
|
13
|
+
condition?: LogicRule;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
helpText?: string;
|
|
17
|
+
validation?: LogicRule;
|
|
18
|
+
policies?: {
|
|
18
19
|
doNotTrackValue?: boolean;
|
|
19
20
|
doNotStoreValue?: boolean;
|
|
20
21
|
};
|
|
21
|
-
options
|
|
22
|
+
options?: {
|
|
22
23
|
id: string;
|
|
23
24
|
label: string;
|
|
24
25
|
value: PrimitiveFieldValue;
|
|
26
|
+
condition?: LogicRule;
|
|
25
27
|
}[] | null;
|
|
26
28
|
}
|
|
27
29
|
export interface FieldTextSingular extends FieldBase {
|
|
28
30
|
type: 'text';
|
|
29
31
|
multiple: false;
|
|
30
|
-
defaultValue
|
|
31
|
-
options
|
|
32
|
+
defaultValue?: string;
|
|
33
|
+
options?: {
|
|
32
34
|
id: string;
|
|
33
35
|
label: string;
|
|
34
36
|
value: string;
|
|
37
|
+
condition?: LogicRule;
|
|
35
38
|
}[] | null;
|
|
36
39
|
}
|
|
37
40
|
export interface FieldTextMultiple extends FieldBase {
|
|
38
41
|
type: 'text';
|
|
39
42
|
multiple: true;
|
|
40
|
-
defaultValue
|
|
41
|
-
options
|
|
43
|
+
defaultValue?: string[];
|
|
44
|
+
options?: {
|
|
42
45
|
id: string;
|
|
43
46
|
label: string;
|
|
44
47
|
value: string;
|
|
48
|
+
condition?: LogicRule;
|
|
45
49
|
}[] | null;
|
|
46
50
|
}
|
|
47
51
|
export interface FieldNumberSingular extends FieldBase {
|
|
48
52
|
type: 'number';
|
|
49
53
|
multiple: false;
|
|
50
|
-
defaultValue
|
|
51
|
-
options
|
|
54
|
+
defaultValue?: number;
|
|
55
|
+
options?: {
|
|
52
56
|
id: string;
|
|
53
57
|
label: string;
|
|
54
58
|
value: number;
|
|
59
|
+
condition?: LogicRule;
|
|
55
60
|
}[] | null;
|
|
56
61
|
}
|
|
57
62
|
export interface FieldNumberMultiple extends FieldBase {
|
|
58
63
|
type: 'number';
|
|
59
64
|
multiple: true;
|
|
60
|
-
defaultValue
|
|
61
|
-
options
|
|
65
|
+
defaultValue?: number[];
|
|
66
|
+
options?: {
|
|
62
67
|
id: string;
|
|
63
68
|
label: string;
|
|
64
69
|
value: number;
|
|
70
|
+
condition?: LogicRule;
|
|
65
71
|
}[] | null;
|
|
66
72
|
}
|
|
67
73
|
export interface FieldBooleanSingular extends FieldBase {
|
|
68
74
|
type: 'boolean';
|
|
69
75
|
multiple: false;
|
|
70
|
-
defaultValue
|
|
71
|
-
options
|
|
76
|
+
defaultValue?: boolean;
|
|
77
|
+
options?: {
|
|
72
78
|
id: string;
|
|
73
79
|
label: string;
|
|
74
80
|
value: boolean;
|
|
81
|
+
condition?: LogicRule;
|
|
75
82
|
}[] | null;
|
|
76
83
|
}
|
|
77
84
|
export interface FieldBooleanMultiple extends FieldBase {
|
|
78
85
|
type: 'boolean';
|
|
79
86
|
multiple: true;
|
|
80
|
-
defaultValue
|
|
81
|
-
options
|
|
87
|
+
defaultValue?: boolean[];
|
|
88
|
+
options?: {
|
|
82
89
|
id: string;
|
|
83
90
|
label: string;
|
|
84
91
|
value: boolean;
|
|
92
|
+
condition?: LogicRule;
|
|
85
93
|
}[] | null;
|
|
86
94
|
}
|
|
87
95
|
export type Field = FieldTextSingular | FieldTextMultiple | FieldNumberSingular | FieldNumberMultiple | FieldBooleanSingular | FieldBooleanMultiple;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/entities/field/field.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAI7D,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAClE,MAAM,MAAM,UAAU,GAAG,mBAAmB,GAAG,mBAAmB,EAAE,CAAA;AAIpE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC9C,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/entities/field/field.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAI7D,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAClE,MAAM,MAAM,UAAU,GAAG,mBAAmB,GAAG,mBAAmB,EAAE,CAAA;AAIpE,MAAM,WAAW,SAAS;IACxB,EAAE,EAA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E,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,OAAO,CAAA;QACd,SAAS,CAAC,EAAE,SAAS,CAAA;KACtB,EAAE,GACH,IAAI,CAAA;CACT;AAED,MAAM,MAAM,KAAK,GACb,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,GAGnB,oBAAoB,GACpB,oBAAoB,CAAA;AAGxB,QAAA,MAAM,uBAAuB;sBAcF,KAAK,KAAG,IAAI;kBAQhB,SAAS,CAAC,IAAI,CAAC;;sBAIX,SAAS,CAAC,MAAM,CAAC;CAU1C,CAAA;AAEF,wBAAgB,gBAAgB,IAAI,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAE7E;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,EAAE,QAAQ,WAAW,KAAG,IAE9D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/entities/history/history.ts"],"names":[],"mappings":"AAEA,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;
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/entities/history/history.ts"],"names":[],"mappings":"AAEA,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;AA2FD,wBAAgB,aAAa;;sBA1EsB,MAAM;cAAQ,cAAc;;;sBACzB,MAAM;cAAQ,cAAc;;;uBAC9B,MAAM;;;iBACT,YAAY,EAAE;;;EAyE9D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateSnapshot } from '../../utils/state-snaphot';
|
|
2
2
|
import { Picked } from '../../picked';
|
|
3
|
-
export type Predicate = (snapshot: StateSnapshot) => boolean | Promise<boolean> | string | Promise<string> | undefined;
|
|
3
|
+
export type Predicate = (snapshot: StateSnapshot) => boolean | Promise<boolean> | string | Promise<string> | string[] | Promise<string[]> | undefined;
|
|
4
4
|
export type PredicatesStore = ReturnType<typeof createPredicateIndex>;
|
|
5
5
|
export interface PredicateIndexItem {
|
|
6
6
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../../../../src/entities/predicate/predicate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,MAAM,MAAM,SAAS,GAAG,CACtB,QAAQ,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../../../../src/entities/predicate/predicate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,MAAM,MAAM,SAAS,GAAG,CACtB,QAAQ,EAAE,aAAa,KAErB,OAAO,GACP,OAAO,CAAC,OAAO,CAAC,GAChB,MAAM,GACN,OAAO,CAAC,MAAM,CAAC,GACf,MAAM,EAAE,GACR,OAAO,CAAC,MAAM,EAAE,CAAC,GACjB,SAAS,CAAA;AAEb,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAErE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;CACrB;AAKD,QAAA,MAAM,2BAA2B,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;qBAoBvD,MAAM,aAAa,SAAS,KAAG,IAAI;sBAiBlC,MAAM;cAlCrB,MAAM;mBACD,SAAS;;;cADd,MAAM;mBACD,SAAS;;CA0CxB,CAAA;AAEF,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,EAC9F,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAEhD;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,WAAW,SAAS,EAAE,YAAY,eAAe,SAE7F,CAAA"}
|
|
@@ -2,6 +2,10 @@ import { Picked } from '../../picked';
|
|
|
2
2
|
import { Field, FieldValue } from '../field/field';
|
|
3
3
|
export type ResponsesStore = ReturnType<typeof createResponseIndex>;
|
|
4
4
|
export type Response = FieldValue;
|
|
5
|
+
export interface ResponseListItem {
|
|
6
|
+
fieldId: string;
|
|
7
|
+
value: Response | undefined;
|
|
8
|
+
}
|
|
5
9
|
declare const createResponseIndexFactory: ({ client }: {
|
|
6
10
|
client: Picked;
|
|
7
11
|
}) => {
|
|
@@ -11,6 +15,10 @@ declare const createResponseIndexFactory: ({ client }: {
|
|
|
11
15
|
commit: (responsesToCommit: CommitResponses) => Promise<{
|
|
12
16
|
errors: ValidationError[];
|
|
13
17
|
}>;
|
|
18
|
+
getResponsesToCommit: (responsesToCommit: CommitResponses) => Promise<{
|
|
19
|
+
responsesToCommit: CommitResponses;
|
|
20
|
+
validationErrors: ValidationError[];
|
|
21
|
+
}>;
|
|
14
22
|
listStore: import('effector').Store<{
|
|
15
23
|
fieldId: string;
|
|
16
24
|
value: FieldValue | undefined;
|