@picked/client 0.0.1-dev.1764626732123 → 0.0.1-dev.1764632196476
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 -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/server/index.js +1 -1
- package/dist/esm/index.js +792 -144
- package/dist/esm/plugins/create-experience/index.js +123 -121
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +8 -8
- package/dist/esm/plugins/responses-browser-storage/index.js +23 -24
- package/dist/esm/plugins/responses-indexeddb/index.js +1 -1
- package/dist/esm/plugins/single-page-app/index.js +3 -3
- package/dist/esm/plugins/web-components/index.js +1 -1
- package/dist/esm/plugins/window-object/index.js +1 -1
- package/dist/esm/server/index.js +7 -7
- package/dist/{experience-instance-C2AnM2J_.js → experience-instance-C4INDX6a.js} +8 -8
- package/dist/{experience-instance-BpQMqclI.cjs → experience-instance-DjjpHk0t.cjs} +1 -1
- package/dist/{supports-DBMT17KZ.js → supports-BjhuLJ8z.js} +10 -10
- package/dist/types/client.d.ts +31 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/action/action.d.ts +2 -4
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +3 -1
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +3 -5
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +7 -0
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +5 -4
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +1 -4
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/picked.d.ts +20 -20
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +6 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +13 -7
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/user-session.d.ts +2 -0
- package/dist/types/utils/user-session.d.ts.map +1 -1
- package/package.json +1 -7
- package/dist/cjs/plugins/shopify/index.js +0 -1
- package/dist/esm/plugins/shopify/index.js +0 -123
- package/dist/types/plugins/shopify/global-obj.d.ts +0 -49
- package/dist/types/plugins/shopify/global-obj.d.ts.map +0 -1
- package/dist/types/plugins/shopify/index.d.ts +0 -6
- package/dist/types/plugins/shopify/index.d.ts.map +0 -1
- package/dist/types/plugins/shopify/picked-config.d.ts +0 -103
- package/dist/types/plugins/shopify/picked-config.d.ts.map +0 -1
- package/dist/types/plugins/shopify/plugin.d.ts +0 -3
- package/dist/types/plugins/shopify/plugin.d.ts.map +0 -1
- package/dist/types/plugins/shopify/predicates.d.ts +0 -42
- package/dist/types/plugins/shopify/predicates.d.ts.map +0 -1
- package/dist/user-session-BTaOgTo_.cjs +0 -1
- package/dist/user-session-YEUZkOjt.js +0 -718
package/dist/esm/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createEvent as i, createStore as
|
|
2
|
-
import {
|
|
1
|
+
import { createEvent as i, createStore as v, createEffect as C, sample as n, attach as S } from "effector";
|
|
2
|
+
import { h as F } from "../../experience-instance-C4INDX6a.js";
|
|
3
3
|
function R() {
|
|
4
4
|
let c, p;
|
|
5
5
|
return {
|
|
@@ -11,19 +11,19 @@ function R() {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
function w(c, p) {
|
|
14
|
-
const { promise: g, resolve: t } = R(), o = i(), s = i(), l = i(), m = i(), d = i(), I = c.experiences.listStore.map((e) => e.map((r) => F({ client: c, experience: r }))), x =
|
|
14
|
+
const { promise: g, resolve: t } = R(), o = i(), s = i(), l = i(), m = i(), d = i(), I = c.experiences.listStore.map((e) => e.map((r) => F({ client: c, experience: r }))), x = v({
|
|
15
15
|
currentExperienceIndex: 0,
|
|
16
16
|
renderedExperiences: [],
|
|
17
17
|
isComplete: !1
|
|
18
|
-
}), f =
|
|
18
|
+
}), f = C(
|
|
19
19
|
async ({
|
|
20
20
|
experience: e,
|
|
21
21
|
availableRenderers: r,
|
|
22
|
-
startRendererIndex:
|
|
22
|
+
startRendererIndex: h = 0
|
|
23
23
|
}) => {
|
|
24
24
|
if (!e)
|
|
25
25
|
return null;
|
|
26
|
-
for (let a =
|
|
26
|
+
for (let a = h; a < r.length; a++) {
|
|
27
27
|
const u = r[a], E = e.componentStore.getState();
|
|
28
28
|
if (E && (u != null && u.isValidComponent(E.component)))
|
|
29
29
|
return { rendered: await u.render(E.component, c, e), rendererIndex: a };
|
|
@@ -75,7 +75,7 @@ function w(c, p) {
|
|
|
75
75
|
filter: ({ experiences: e, state: r }) => r.currentExperienceIndex >= e.length,
|
|
76
76
|
target: m
|
|
77
77
|
});
|
|
78
|
-
const k =
|
|
78
|
+
const k = S({
|
|
79
79
|
source: x,
|
|
80
80
|
effect: (e) => {
|
|
81
81
|
e.isComplete && t(e.renderedExperiences);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createDomain as ht, createEvent as O, combine as C, createApi as ot, createEffect as M, attach as _, split as yt, sample as m } from "effector";
|
|
2
2
|
import { createFactory as it, invoke as st } from "@withease/factories";
|
|
3
|
-
import {
|
|
3
|
+
import { i as wt, s as at, a as Nt } from "./supports-BjhuLJ8z.js";
|
|
4
4
|
import { l as I } from "./logger-C9a75KZn.js";
|
|
5
5
|
import { i as It } from "./object-JwZ58NOH.js";
|
|
6
6
|
function xt(t) {
|
|
@@ -745,7 +745,7 @@ const Gt = it(({ client: t }) => {
|
|
|
745
745
|
}), m({
|
|
746
746
|
clock: o.doneData,
|
|
747
747
|
target: t.eventBus.prepend((u) => ({
|
|
748
|
-
type: "
|
|
748
|
+
type: "experience_initialize",
|
|
749
749
|
experienceInstance: u
|
|
750
750
|
}))
|
|
751
751
|
}), m({
|
|
@@ -769,14 +769,14 @@ function Zt(t) {
|
|
|
769
769
|
return st(Gt, t);
|
|
770
770
|
}
|
|
771
771
|
export {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
772
|
+
j as a,
|
|
773
|
+
Zt as b,
|
|
774
|
+
Qt as c,
|
|
775
775
|
zt as d,
|
|
776
776
|
et as e,
|
|
777
|
-
|
|
777
|
+
Ft as f,
|
|
778
778
|
Jt as g,
|
|
779
|
-
|
|
780
|
-
|
|
779
|
+
Wt as h,
|
|
780
|
+
At as i,
|
|
781
781
|
Yt as t
|
|
782
782
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("effector"),q=require("@withease/factories"),H=require("./supports-YvpQZxbh.cjs"),N=require("./logger-BsmHUUw1.cjs"),ge=require("./object-BbFTsGh3.cjs");function me(e){return typeof e=="number"&&!isNaN(e)}function R(e){return typeof e=="string"}function E(e){return Array.isArray(e)}function ne(e){return e instanceof Promise}function Z(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1}function m(e){if(me(e))return e;const t=parseFloat(`${e}`);return isNaN(t)?0:t}function T(e){return`${e}`}const he={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>m(e)>m(t),">=":(e,t)=>m(e)>=m(t),"<":(e,t,r)=>{const n=m(e),a=m(t);if(r===void 0)return n<a;const c=m(r);return n<a&&a<c},"<=":(e,t,r)=>{const n=m(e),a=m(t);if(r===void 0)return n<=a;const c=m(r);return n<=a&&a<=c},"!!":async e=>await O(e),"!":async e=>!await O(e),"%":(e,t)=>m(e)%m(t),log:e=>(console.log(e),e),in:(e,t)=>t?R(t)?t.indexOf(T(e))!==-1:E(t)?t.includes(e):!1:!1,cat:(...e)=>e.map(T).join(""),substr:(e,t,r)=>{const n=T(e),a=m(t);if(r===void 0)return n.substr(a);const c=m(r);if(c<0){const o=n.substr(a);return o.substr(0,o.length+c)}return n.substr(a,c)},"+":(...e)=>e.reduce((t,r)=>m(t)+m(r),0),"*":(...e)=>e.reduce((t,r)=>m(t)*m(r),1),"-":(e,t)=>{const r=m(e);return t===void 0?-r:r-m(t)},"/":(e,t)=>m(e)/m(t),min:(...e)=>Math.min(...e.map(m)),max:(...e)=>Math.max(...e.map(m)),merge:(...e)=>e.reduce((t,r)=>E(r)?t.concat(r):t.concat([r]),[]),var(e,t){const r=arguments.length>1?t:null;if(e===""||e==="."||e===null||e===void 0)return this;if(typeof e=="number"&&Array.isArray(this))return e>=0&&e<this.length?this[e]:r;const n=T(e);if(n===""||n===".")return this;const a=n.split(".");let c=this;for(const o of a){if(c==null)return r;if(Array.isArray(c)){const u=parseInt(o,10);isNaN(u)?c=c[o]:c=c[u]}else c=c[o]}return c!==void 0?c:r},async missing(...e){const t=E(e[0])?e[0]:e,r=[];for(const n of t){const a=await g({var:n},this);(a===null||a==="")&&r.push(`${n}`)}return r},async missing_some(e,t){const r=await g({missing:t},this);if(!E(r)||!E(t))return[];const n=r.filter(R);return t.filter(R).length-n.length>=m(e)?[]:n},invoke(e){return typeof e!="function"?null:e()},regexp_matches(e,t){let r=e,n="";if(E(e)){const[c,o]=e;r=c,n=o}return!R(r)||!R(n)?!1:new RegExp(r,n).test(T(t))},throw(e){throw new Error(T(e))}};async function g(e,t){if(!e)return e;if(ne(e))return g(await e,t);if(E(e))return Promise.all(e.map(o=>g(o,t)));if(!Z(e))return e;const r=Se(e);let n=r?e[r]??[]:[];switch(E(n)||(n=[n]),r){case"if":case"?:":for(let o=0;o<n.length-1;o+=2)if(await O(await g(n[o],t)))return g(n[o+1],t);return n.length%2===1?g(n[n.length-1],t):null;case"and":{let o=null;for(const u of n)if(o=await g(u,t),!await O(o))return o;return o}case"or":{let o=null;for(const u of n)if(o=await g(u,t),await O(o))return o;return o}case"map":{const o=await g(n[0],t);return E(o)?await Promise.all(o.map(u=>g(n[1],u))):[]}case"filter":{const o=await g(n[0],t);return E(o)?(await Promise.all(o.map(async p=>{const y=await O(await g(n[1],p));return{item:p,shouldInclude:y}}))).filter(({shouldInclude:p})=>p).map(({item:p})=>p):[]}case"reduce":{const o=await g(n[0],t);if(!E(o))return n.length>2?await g(n[2],t):null;const u=n[1];let y=n.length>2?await g(n[2],t):null;for(const k of o)y=await g(u,{current:k,accumulator:y});return y}case"all":{const o=await g(n[0],t);if(!E(o)||o.length===0)return!1;for(const u of o)if(!await O(await g(n[1],u)))return!1;return!0}case"some":{const o=await g(n[0],t);if(!E(o))return!1;for(const u of o)if(await O(await g(n[1],u)))return!0;return!1}case"none":{const o=await g(n[0],t);if(!E(o))return!0;for(const u of o)if(await O(await g(n[1],u)))return!1;return!0}case"catch":try{return await g(n[0],t)}catch(o){return Z(o)?await g(o,t):n[1]?await g(n[1],o):o instanceof Error?o.message:o}}const a=await Promise.all(n.map(o=>g(o,t))),c=r?he[r]:void 0;if(!c)throw new Error(`Unrecognized operation ${r}`);return c.apply(t,a)}async function O(e){return ne(e)?O(await e):!(Array.isArray(e)&&e.length===0)&&!!e}function Se(e){return Object.keys(e)[0]}function re(e){return!ge.isEmpty(e)}async function V(e,t,r){const n=e.getStateSnapshot(),a=e.predicates.listStore.getState().reduce((u,p)=>({...u,[p.name]:()=>p.predicate(n)}),{}),c=e.features.listStore.getState().reduce((u,p)=>({...u,[p.id]:async()=>{const{bucket:y}=await p.getBucket();return y}}),{}),o={...r,responses:e.responses.getAllStore.getState(),location:typeof n.location=="object"?{hash:n.location.hash,host:n.location.host,hostname:n.location.hostname,href:n.location.href,origin:n.location.origin,pathname:n.location.pathname,port:n.location.port,protocol:n.location.protocol,search:n.location.search}:void 0,predicates:a,features:c};return await g(t,o)}function ye(e){return!H.supportsWindow()||!H.supportsDocument()?[]:Array.from(window.document.querySelectorAll(e)).filter(t=>t instanceof HTMLElement)}const we="open";function Ee(e){if(!H.supportsShadowRoot())throw new Error("Shadow DOM is not supported in this environment");return e.attachShadow({mode:we})}function Ne(){return new Promise((e,t)=>{if(!H.supportsDocument()){t();return}document.readyState!=="loading"?e():document.addEventListener("readystatechange",()=>e(),{once:!0})})}function Ie(e,t){const r=new MutationObserver(n=>{document.contains(e)||(r.disconnect(),t())});r.observe(document.body,{childList:!0,subtree:!0})}const C="picked-root",j="picked-target",xe="picked-root";function ke(e,t){return[...e,{selector:`${xe}[experience-id="${t}"]`,placement:"replace"}].flatMap(n=>{const a=ye(n.selector).filter(c=>!Ae(c,t)&&!oe(c,t));return{...n,elements:a}})}function ve(e,t){return e.flatMap(r=>r.elements.map(n=>Be(n,r.placement,t)))}function be(e,t){e.classList.add(j),e.classList.add(`${j}-${t}`)}function Ae(e,t){return t?e.classList.contains(`${j}-${t}`):e.classList.contains(`${j}`)}function oe(e,t){return t?e.classList.contains(`${C}-${t}`):e.classList.contains(C)}function Oe(e){const t=document.createElement("div");return t.style.display="block",t.classList.add(C),t.classList.add(`${C}-${e}`),t}function Be(e,t,r){let n;const a=Oe(r);if(e instanceof Document)n=e.body.appendChild(a);else{switch(t){case"replace":e.replaceWith(a);break;case"before":e.before(a);break;case"after":e.after(a);break;case"prepend":e.prepend(a);break;default:e.append(a);break}n=a}return n}function Fe(e){return e.type==="conditional"}function M(e){return e.type==="step"}function _e(e){return e.type==="experience"}function ee(e){return e.type==="origin"}function te(e){return e.type==="action"}const se=(e,t,r,n,a=new Set)=>a.has(r.id)?[]:(a.add(r.id),M(r)&&!n?[r]:t.filter(o=>o.sourceNodeId===r.id).flatMap(o=>{const u=e.find(p=>p.id===o.destinationNodeId);return u?se(e,t,u,!1,a):[]})),$e=(e,t,r)=>se(e,t,r,!0,new Set),ie=(e,t,r,n,a=new Set)=>{if(a.has(r.id))return[-1,-1];a.add(r.id);const c=t.filter(p=>p.sourceNodeId===r.id);if(c.length===0)return[0,0];let o=1/0,u=-1/0;for(const p of c){const y=e.find(L=>L.id===p.destinationNodeId);if(!y)continue;const[k,B]=ie(e,t,y,!1,new Set(a));k!==-1&&(o=Math.min(o,k+1),u=Math.max(u,B+1))}return o===1/0?[-1,-1]:[o,u]},Te=(e,t,r)=>ie(e,t,r,!0,new Set),ae=(e,t,r,n=new Set)=>{if(n.has(r.id))return[-1,-1];if(n.add(r.id),r.type==="origin")return[0,0];const a=t.filter(u=>u.destinationNodeId===r.id);if(a.length===0)return[-1,-1];let c=1/0,o=-1/0;for(const u of a){const p=e.find(B=>B.id===u.sourceNodeId);if(!p)continue;const[y,k]=ae(e,t,p,new Set(n));y!==-1&&(c=Math.min(c,y+1),o=Math.max(o,k+1))}return c===1/0?[-1,-1]:[c,o]},Me=(e,t,r)=>ae(e,t,r,new Set),ce=e=>e.find(r=>r.type==="origin")||null,U=(e,t,r)=>{if(!e)return ce(t);const n=r.find(c=>c.sourceNodeId===e.id);if(!n)return null;const a=t.find(c=>c.id===n.destinationNodeId);return a||null};async function Le(e,t,r,n){const a=e?"true":"false",c=n.find(o=>o.sourceNodeHandle===a&&o.sourceNodeId===t);return r.find(o=>o.id===(c==null?void 0:c.destinationNodeId))}const X=i.createDomain("experience-instance"),De=q.createFactory(({client:e,experience:t,target:r})=>{const n=i.createEvent(),a=i.createEvent(),c=i.createEvent(),o=i.createEvent(),u=i.createEvent(),p=i.createEvent(),y=t.componentStore,k=X.store("transitioning"),B=e.history.entriesStore.map(s=>s.filter(l=>l.experienceId===t.id)),L=B.map(s=>s.filter(l=>M(l.node))),I=B.map(s=>{var l;return((l=s[s.length-1])==null?void 0:l.node)||null}),f=i.combine(t.treeStore,I,({steps:s},l)=>s.find(d=>l&&M(l)&&d.id===l.stepId)||null),h=i.combine(t.treeStore,I,({nodes:s,edges:l},d)=>d?$e(s,l,d):[]),A=i.combine(t.treeStore,I,({nodes:s,edges:l},d)=>d?Me(s,l,d):[-1,-1]),_=i.combine(t.treeStore,I,({nodes:s,edges:l},d)=>d?Te(s,l,d):[-1,-1]),v=X.store(!1),F=i.createApi(v,{open:()=>!0,close:()=>!1,toggle:s=>!s,set:(s,l)=>l}),fe=i.createEffect(async()=>{e.history.back({experienceId:t.id})}),le=i.attach({source:t.treeStore,effect:async(s,l)=>{const d=s.nodes.find(w=>M(w)&&w.stepId===l);d&&e.history.push({experienceId:t.id,node:d})}}),z=i.attach({source:I,effect:s=>{}}),W=i.attach({source:t.treeStore,effect:async({nodes:s})=>ce(s)}),G=i.attach({source:t.treeStore,effect:async({nodes:s,edges:l},d)=>U(d,s,l)}),K=i.attach({source:t.treeStore,effect:async({nodes:s,edges:l,conditionals:d},w)=>{if(!w)return;const $=d.find(b=>b.id===w.conditionalId);if(!$)return;const x=w.id,S=await V(e,$.condition);return Le(!!S,x,s,l)}}),J=i.attach({source:t.treeStore,effect:async({nodes:s,edges:l},d)=>{if(!d||!te(d))return;const w=d.action;if(!w){N.logger("warn",`Action node ${d.id} has no action name`);return}const $=e.actions.getByName(w).getState();if(!$){N.logger("warn",`Action '${w}' not registered on client`);const x=l.find(S=>S.sourceNodeId===d.id&&S.sourceNodeHandle==="false");return x?s.find(S=>S.id===x.destinationNodeId):null}if(typeof $.action!="function"){N.logger("warn",`Action '${w}' is not a function`);const x=l.find(S=>S.sourceNodeId===d.id&&S.sourceNodeHandle==="false");return x?s.find(S=>S.id===x.destinationNodeId):null}try{N.logger("info",`Executing action: ${w}`),await $.action();const x=l.find(b=>b.sourceNodeId===d.id&&b.sourceNodeHandle==="true");if(!x)return N.logger("warn",`No 'true' edge found for action node ${d.id}`),null;const S=s.find(b=>b.id===x.destinationNodeId);return N.logger("info",`Action '${w}' succeeded, moving to node ${S==null?void 0:S.id}`),S||null}catch(x){N.logger("warn",`Action '${w}' failed:`,x);const S=l.find(P=>P.sourceNodeId===d.id&&P.sourceNodeHandle==="false");if(!S)return N.logger("warn",`No 'false' edge found for action node ${d.id}`),null;const b=s.find(P=>P.id===S.destinationNodeId);return N.logger("info",`Action '${w}' failed, moving to node ${b==null?void 0:b.id}`),b||null}}}),de=i.createEffect(s=>{if(s)return e.launchExperienceById(s.experienceId)}),Q=i.attach({source:[I,t.treeStore],effect:async([s,{nodes:l,edges:d}])=>U(s,l,d)}),D=i.attach({source:[I,t.treeStore],effect:async([s,{nodes:l,edges:d}])=>U(s,l,d)}),pe=i.createEffect(s=>{e.history.push({experienceId:t.id,node:s})}),Y=i.attach({source:t.configStore,effect:async({initializeOpenLogic:s})=>re(s)?!!await V(e,s):s??!1});return i.split({source:I,match:s=>s?Fe(s)?"condition":M(s)?"step":_e(s)?"launchExperience":ee(s)?"origin":te(s)?"action":"other":"none",cases:{none:W,origin:G,condition:K,step:z,launchExperience:de,action:J,__:i.createEvent()}}),i.sample({clock:[K.doneData,G.doneData,W.doneData,D.doneData,Q.doneData,J.doneData],filter:Boolean,target:pe}),i.sample({clock:a,target:D}),i.sample({clock:a,source:f,filter:Boolean,target:e.eventBus.prepend(s=>({type:"step_submit",step:s,experience:t}))}),i.sample({clock:D.done,source:f,filter:Boolean,target:e.eventBus.prepend(s=>({type:"step_submit_success",step:s,experience:t}))}),i.sample({clock:D.fail,source:f,filter:Boolean,target:e.eventBus.prepend(s=>({type:"step_submit_error",step:s,experience:t}))}),i.sample({clock:c,target:fe}),i.sample({clock:o,target:le}),i.sample({source:i.combine([K.pending,G.pending,W.pending,D.pending]),fn:s=>s.some(Boolean)?"transitioning":"ready",target:k}),i.sample({clock:z.doneData,source:f,filter:Boolean,target:e.eventBus.prepend(s=>({type:"step_enter",step:s,experience:t}))}),i.sample({clock:p,target:Y}),i.sample({source:Y.doneData,fn:Boolean,target:v}),i.sample({source:I,clock:n,filter:s=>s?ee(s):!0,target:Q}),i.sample({source:v,filter:Boolean,target:n}),i.sample({source:v,filter:Boolean,target:e.eventBus.prepend(()=>({type:"experience_open",experience:t}))}),i.sample({source:v,filter:s=>!s,target:e.eventBus.prepend(()=>({type:"experience_close",experience:t}))}),i.sample({clock:u,target:[p]}),u(),{id:Math.random().toString(36).substring(7),experienceId:t.id,configStore:t.configStore,target:r,componentStore:y,stateStore:k,isOpenStore:v,open:F.open,close:F.close,toggleOpen:F.toggle,setOpen:F.set,treeStore:t.treeStore,currentNodeStore:I,currentStepStore:f,nextReachableStepNodesStore:h,stepsToOriginStore:A,stepsToLeafStore:_,goToNextStep:a,goToPreviousStep:c,goToStepById:o,stepsHistoryStore:L}});function ue(e){return q.invoke(De,e)}const Re=q.createFactory(({client:e})=>{const t=X.store({}),r=i.createEvent(),n=i.createEvent(),a=i.createEvent(),c=i.createApi(t,{register(f,h){const A=[...f[h.experienceId]??[]];return A.push(h),{...f,[h.experienceId]:A}},unregister(f,h){var v;const A=h.experienceId,_=(v=f[A])==null?void 0:v.filter(F=>F!==h);return{...f,[A]:_??[]}}}),o=i.createEffect(({experience:f,target:h})=>ue({client:e,experience:f,target:h})),u=i.createEffect(f=>{c.register(f)}),p=i.createEffect(f=>{f.target&&Ie(f.target,()=>{a(f)})}),y=i.createEffect(f=>{c.unregister(f)}),k=i.createEffect(f=>{const h=f.componentStore.getState();if(!h){N.logger("warn","No app component registered. Skipping init.");return}const A=h.frameworkStore.getState();if(!A){N.logger("error",`No framework registered for component '${h.name}'. Skipping rendering.`);return}const _=f.target;if(!_){N.logger("error",`No target element registered for experience '${f.experienceId}'. Skipping rendering.`);return}const v=Ee(_);try{A.render(v,h.component,e,f)}catch(F){N.logger("error",F)}});i.sample({clock:r,target:o}),i.sample({clock:a,target:y}),i.sample({clock:o.doneData,target:[u,p,n]}),i.sample({clock:o.doneData,target:e.eventBus.prepend(f=>({type:"experience_initialized",experienceInstance:f}))}),i.sample({clock:n,target:k});function B(f,h){r({experience:f,target:h})}const L=t.map(f=>Object.values(f).flat());function I(f){return t.map(h=>h[f]||[],{skipVoid:!1})}return{spawn:B,getByExperienceId:I,listStore:L}});function Pe(e){return q.invoke(Re,e)}exports.createAppHosts=ve;exports.createExperienceInstance=ue;exports.createExperienceInstanceIndex=Pe;exports.domInteractive=Ne;exports.evaluateRuleLogic=V;exports.getTargetElements=ke;exports.isPickedRoot=oe;exports.isRulesLogic=re;exports.isStepNode=M;exports.tagTargetElement=be;
|
|
1
|
+
"use strict";const i=require("effector"),q=require("@withease/factories"),H=require("./supports-YvpQZxbh.cjs"),N=require("./logger-BsmHUUw1.cjs"),ge=require("./object-BbFTsGh3.cjs");function me(e){return typeof e=="number"&&!isNaN(e)}function R(e){return typeof e=="string"}function E(e){return Array.isArray(e)}function ne(e){return e instanceof Promise}function Z(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1}function m(e){if(me(e))return e;const t=parseFloat(`${e}`);return isNaN(t)?0:t}function T(e){return`${e}`}const he={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>m(e)>m(t),">=":(e,t)=>m(e)>=m(t),"<":(e,t,r)=>{const n=m(e),a=m(t);if(r===void 0)return n<a;const c=m(r);return n<a&&a<c},"<=":(e,t,r)=>{const n=m(e),a=m(t);if(r===void 0)return n<=a;const c=m(r);return n<=a&&a<=c},"!!":async e=>await O(e),"!":async e=>!await O(e),"%":(e,t)=>m(e)%m(t),log:e=>(console.log(e),e),in:(e,t)=>t?R(t)?t.indexOf(T(e))!==-1:E(t)?t.includes(e):!1:!1,cat:(...e)=>e.map(T).join(""),substr:(e,t,r)=>{const n=T(e),a=m(t);if(r===void 0)return n.substr(a);const c=m(r);if(c<0){const o=n.substr(a);return o.substr(0,o.length+c)}return n.substr(a,c)},"+":(...e)=>e.reduce((t,r)=>m(t)+m(r),0),"*":(...e)=>e.reduce((t,r)=>m(t)*m(r),1),"-":(e,t)=>{const r=m(e);return t===void 0?-r:r-m(t)},"/":(e,t)=>m(e)/m(t),min:(...e)=>Math.min(...e.map(m)),max:(...e)=>Math.max(...e.map(m)),merge:(...e)=>e.reduce((t,r)=>E(r)?t.concat(r):t.concat([r]),[]),var(e,t){const r=arguments.length>1?t:null;if(e===""||e==="."||e===null||e===void 0)return this;if(typeof e=="number"&&Array.isArray(this))return e>=0&&e<this.length?this[e]:r;const n=T(e);if(n===""||n===".")return this;const a=n.split(".");let c=this;for(const o of a){if(c==null)return r;if(Array.isArray(c)){const u=parseInt(o,10);isNaN(u)?c=c[o]:c=c[u]}else c=c[o]}return c!==void 0?c:r},async missing(...e){const t=E(e[0])?e[0]:e,r=[];for(const n of t){const a=await g({var:n},this);(a===null||a==="")&&r.push(`${n}`)}return r},async missing_some(e,t){const r=await g({missing:t},this);if(!E(r)||!E(t))return[];const n=r.filter(R);return t.filter(R).length-n.length>=m(e)?[]:n},invoke(e){return typeof e!="function"?null:e()},regexp_matches(e,t){let r=e,n="";if(E(e)){const[c,o]=e;r=c,n=o}return!R(r)||!R(n)?!1:new RegExp(r,n).test(T(t))},throw(e){throw new Error(T(e))}};async function g(e,t){if(!e)return e;if(ne(e))return g(await e,t);if(E(e))return Promise.all(e.map(o=>g(o,t)));if(!Z(e))return e;const r=Se(e);let n=r?e[r]??[]:[];switch(E(n)||(n=[n]),r){case"if":case"?:":for(let o=0;o<n.length-1;o+=2)if(await O(await g(n[o],t)))return g(n[o+1],t);return n.length%2===1?g(n[n.length-1],t):null;case"and":{let o=null;for(const u of n)if(o=await g(u,t),!await O(o))return o;return o}case"or":{let o=null;for(const u of n)if(o=await g(u,t),await O(o))return o;return o}case"map":{const o=await g(n[0],t);return E(o)?await Promise.all(o.map(u=>g(n[1],u))):[]}case"filter":{const o=await g(n[0],t);return E(o)?(await Promise.all(o.map(async p=>{const y=await O(await g(n[1],p));return{item:p,shouldInclude:y}}))).filter(({shouldInclude:p})=>p).map(({item:p})=>p):[]}case"reduce":{const o=await g(n[0],t);if(!E(o))return n.length>2?await g(n[2],t):null;const u=n[1];let y=n.length>2?await g(n[2],t):null;for(const k of o)y=await g(u,{current:k,accumulator:y});return y}case"all":{const o=await g(n[0],t);if(!E(o)||o.length===0)return!1;for(const u of o)if(!await O(await g(n[1],u)))return!1;return!0}case"some":{const o=await g(n[0],t);if(!E(o))return!1;for(const u of o)if(await O(await g(n[1],u)))return!0;return!1}case"none":{const o=await g(n[0],t);if(!E(o))return!0;for(const u of o)if(await O(await g(n[1],u)))return!1;return!0}case"catch":try{return await g(n[0],t)}catch(o){return Z(o)?await g(o,t):n[1]?await g(n[1],o):o instanceof Error?o.message:o}}const a=await Promise.all(n.map(o=>g(o,t))),c=r?he[r]:void 0;if(!c)throw new Error(`Unrecognized operation ${r}`);return c.apply(t,a)}async function O(e){return ne(e)?O(await e):!(Array.isArray(e)&&e.length===0)&&!!e}function Se(e){return Object.keys(e)[0]}function re(e){return!ge.isEmpty(e)}async function V(e,t,r){const n=e.getStateSnapshot(),a=e.predicates.listStore.getState().reduce((u,p)=>({...u,[p.name]:()=>p.predicate(n)}),{}),c=e.features.listStore.getState().reduce((u,p)=>({...u,[p.id]:async()=>{const{bucket:y}=await p.getBucket();return y}}),{}),o={...r,responses:e.responses.getAllStore.getState(),location:typeof n.location=="object"?{hash:n.location.hash,host:n.location.host,hostname:n.location.hostname,href:n.location.href,origin:n.location.origin,pathname:n.location.pathname,port:n.location.port,protocol:n.location.protocol,search:n.location.search}:void 0,predicates:a,features:c};return await g(t,o)}function ye(e){return!H.supportsWindow()||!H.supportsDocument()?[]:Array.from(window.document.querySelectorAll(e)).filter(t=>t instanceof HTMLElement)}const we="open";function Ee(e){if(!H.supportsShadowRoot())throw new Error("Shadow DOM is not supported in this environment");return e.attachShadow({mode:we})}function Ne(){return new Promise((e,t)=>{if(!H.supportsDocument()){t();return}document.readyState!=="loading"?e():document.addEventListener("readystatechange",()=>e(),{once:!0})})}function Ie(e,t){const r=new MutationObserver(n=>{document.contains(e)||(r.disconnect(),t())});r.observe(document.body,{childList:!0,subtree:!0})}const C="picked-root",j="picked-target",xe="picked-root";function ke(e,t){return[...e,{selector:`${xe}[experience-id="${t}"]`,placement:"replace"}].flatMap(n=>{const a=ye(n.selector).filter(c=>!Ae(c,t)&&!oe(c,t));return{...n,elements:a}})}function ve(e,t){return e.flatMap(r=>r.elements.map(n=>Be(n,r.placement,t)))}function be(e,t){e.classList.add(j),e.classList.add(`${j}-${t}`)}function Ae(e,t){return t?e.classList.contains(`${j}-${t}`):e.classList.contains(`${j}`)}function oe(e,t){return t?e.classList.contains(`${C}-${t}`):e.classList.contains(C)}function Oe(e){const t=document.createElement("div");return t.style.display="block",t.classList.add(C),t.classList.add(`${C}-${e}`),t}function Be(e,t,r){let n;const a=Oe(r);if(e instanceof Document)n=e.body.appendChild(a);else{switch(t){case"replace":e.replaceWith(a);break;case"before":e.before(a);break;case"after":e.after(a);break;case"prepend":e.prepend(a);break;default:e.append(a);break}n=a}return n}function Fe(e){return e.type==="conditional"}function M(e){return e.type==="step"}function _e(e){return e.type==="experience"}function ee(e){return e.type==="origin"}function te(e){return e.type==="action"}const se=(e,t,r,n,a=new Set)=>a.has(r.id)?[]:(a.add(r.id),M(r)&&!n?[r]:t.filter(o=>o.sourceNodeId===r.id).flatMap(o=>{const u=e.find(p=>p.id===o.destinationNodeId);return u?se(e,t,u,!1,a):[]})),$e=(e,t,r)=>se(e,t,r,!0,new Set),ie=(e,t,r,n,a=new Set)=>{if(a.has(r.id))return[-1,-1];a.add(r.id);const c=t.filter(p=>p.sourceNodeId===r.id);if(c.length===0)return[0,0];let o=1/0,u=-1/0;for(const p of c){const y=e.find(L=>L.id===p.destinationNodeId);if(!y)continue;const[k,B]=ie(e,t,y,!1,new Set(a));k!==-1&&(o=Math.min(o,k+1),u=Math.max(u,B+1))}return o===1/0?[-1,-1]:[o,u]},Te=(e,t,r)=>ie(e,t,r,!0,new Set),ae=(e,t,r,n=new Set)=>{if(n.has(r.id))return[-1,-1];if(n.add(r.id),r.type==="origin")return[0,0];const a=t.filter(u=>u.destinationNodeId===r.id);if(a.length===0)return[-1,-1];let c=1/0,o=-1/0;for(const u of a){const p=e.find(B=>B.id===u.sourceNodeId);if(!p)continue;const[y,k]=ae(e,t,p,new Set(n));y!==-1&&(c=Math.min(c,y+1),o=Math.max(o,k+1))}return c===1/0?[-1,-1]:[c,o]},Me=(e,t,r)=>ae(e,t,r,new Set),ce=e=>e.find(r=>r.type==="origin")||null,U=(e,t,r)=>{if(!e)return ce(t);const n=r.find(c=>c.sourceNodeId===e.id);if(!n)return null;const a=t.find(c=>c.id===n.destinationNodeId);return a||null};async function Le(e,t,r,n){const a=e?"true":"false",c=n.find(o=>o.sourceNodeHandle===a&&o.sourceNodeId===t);return r.find(o=>o.id===(c==null?void 0:c.destinationNodeId))}const X=i.createDomain("experience-instance"),De=q.createFactory(({client:e,experience:t,target:r})=>{const n=i.createEvent(),a=i.createEvent(),c=i.createEvent(),o=i.createEvent(),u=i.createEvent(),p=i.createEvent(),y=t.componentStore,k=X.store("transitioning"),B=e.history.entriesStore.map(s=>s.filter(l=>l.experienceId===t.id)),L=B.map(s=>s.filter(l=>M(l.node))),I=B.map(s=>{var l;return((l=s[s.length-1])==null?void 0:l.node)||null}),f=i.combine(t.treeStore,I,({steps:s},l)=>s.find(d=>l&&M(l)&&d.id===l.stepId)||null),h=i.combine(t.treeStore,I,({nodes:s,edges:l},d)=>d?$e(s,l,d):[]),A=i.combine(t.treeStore,I,({nodes:s,edges:l},d)=>d?Me(s,l,d):[-1,-1]),_=i.combine(t.treeStore,I,({nodes:s,edges:l},d)=>d?Te(s,l,d):[-1,-1]),v=X.store(!1),F=i.createApi(v,{open:()=>!0,close:()=>!1,toggle:s=>!s,set:(s,l)=>l}),fe=i.createEffect(async()=>{e.history.back({experienceId:t.id})}),le=i.attach({source:t.treeStore,effect:async(s,l)=>{const d=s.nodes.find(w=>M(w)&&w.stepId===l);d&&e.history.push({experienceId:t.id,node:d})}}),z=i.attach({source:I,effect:s=>{}}),W=i.attach({source:t.treeStore,effect:async({nodes:s})=>ce(s)}),G=i.attach({source:t.treeStore,effect:async({nodes:s,edges:l},d)=>U(d,s,l)}),K=i.attach({source:t.treeStore,effect:async({nodes:s,edges:l,conditionals:d},w)=>{if(!w)return;const $=d.find(b=>b.id===w.conditionalId);if(!$)return;const x=w.id,S=await V(e,$.condition);return Le(!!S,x,s,l)}}),J=i.attach({source:t.treeStore,effect:async({nodes:s,edges:l},d)=>{if(!d||!te(d))return;const w=d.action;if(!w){N.logger("warn",`Action node ${d.id} has no action name`);return}const $=e.actions.getByName(w).getState();if(!$){N.logger("warn",`Action '${w}' not registered on client`);const x=l.find(S=>S.sourceNodeId===d.id&&S.sourceNodeHandle==="false");return x?s.find(S=>S.id===x.destinationNodeId):null}if(typeof $.action!="function"){N.logger("warn",`Action '${w}' is not a function`);const x=l.find(S=>S.sourceNodeId===d.id&&S.sourceNodeHandle==="false");return x?s.find(S=>S.id===x.destinationNodeId):null}try{N.logger("info",`Executing action: ${w}`),await $.action();const x=l.find(b=>b.sourceNodeId===d.id&&b.sourceNodeHandle==="true");if(!x)return N.logger("warn",`No 'true' edge found for action node ${d.id}`),null;const S=s.find(b=>b.id===x.destinationNodeId);return N.logger("info",`Action '${w}' succeeded, moving to node ${S==null?void 0:S.id}`),S||null}catch(x){N.logger("warn",`Action '${w}' failed:`,x);const S=l.find(P=>P.sourceNodeId===d.id&&P.sourceNodeHandle==="false");if(!S)return N.logger("warn",`No 'false' edge found for action node ${d.id}`),null;const b=s.find(P=>P.id===S.destinationNodeId);return N.logger("info",`Action '${w}' failed, moving to node ${b==null?void 0:b.id}`),b||null}}}),de=i.createEffect(s=>{if(s)return e.launchExperienceById(s.experienceId)}),Q=i.attach({source:[I,t.treeStore],effect:async([s,{nodes:l,edges:d}])=>U(s,l,d)}),D=i.attach({source:[I,t.treeStore],effect:async([s,{nodes:l,edges:d}])=>U(s,l,d)}),pe=i.createEffect(s=>{e.history.push({experienceId:t.id,node:s})}),Y=i.attach({source:t.configStore,effect:async({initializeOpenLogic:s})=>re(s)?!!await V(e,s):s??!1});return i.split({source:I,match:s=>s?Fe(s)?"condition":M(s)?"step":_e(s)?"launchExperience":ee(s)?"origin":te(s)?"action":"other":"none",cases:{none:W,origin:G,condition:K,step:z,launchExperience:de,action:J,__:i.createEvent()}}),i.sample({clock:[K.doneData,G.doneData,W.doneData,D.doneData,Q.doneData,J.doneData],filter:Boolean,target:pe}),i.sample({clock:a,target:D}),i.sample({clock:a,source:f,filter:Boolean,target:e.eventBus.prepend(s=>({type:"step_submit",step:s,experience:t}))}),i.sample({clock:D.done,source:f,filter:Boolean,target:e.eventBus.prepend(s=>({type:"step_submit_success",step:s,experience:t}))}),i.sample({clock:D.fail,source:f,filter:Boolean,target:e.eventBus.prepend(s=>({type:"step_submit_error",step:s,experience:t}))}),i.sample({clock:c,target:fe}),i.sample({clock:o,target:le}),i.sample({source:i.combine([K.pending,G.pending,W.pending,D.pending]),fn:s=>s.some(Boolean)?"transitioning":"ready",target:k}),i.sample({clock:z.doneData,source:f,filter:Boolean,target:e.eventBus.prepend(s=>({type:"step_enter",step:s,experience:t}))}),i.sample({clock:p,target:Y}),i.sample({source:Y.doneData,fn:Boolean,target:v}),i.sample({source:I,clock:n,filter:s=>s?ee(s):!0,target:Q}),i.sample({source:v,filter:Boolean,target:n}),i.sample({source:v,filter:Boolean,target:e.eventBus.prepend(()=>({type:"experience_open",experience:t}))}),i.sample({source:v,filter:s=>!s,target:e.eventBus.prepend(()=>({type:"experience_close",experience:t}))}),i.sample({clock:u,target:[p]}),u(),{id:Math.random().toString(36).substring(7),experienceId:t.id,configStore:t.configStore,target:r,componentStore:y,stateStore:k,isOpenStore:v,open:F.open,close:F.close,toggleOpen:F.toggle,setOpen:F.set,treeStore:t.treeStore,currentNodeStore:I,currentStepStore:f,nextReachableStepNodesStore:h,stepsToOriginStore:A,stepsToLeafStore:_,goToNextStep:a,goToPreviousStep:c,goToStepById:o,stepsHistoryStore:L}});function ue(e){return q.invoke(De,e)}const Re=q.createFactory(({client:e})=>{const t=X.store({}),r=i.createEvent(),n=i.createEvent(),a=i.createEvent(),c=i.createApi(t,{register(f,h){const A=[...f[h.experienceId]??[]];return A.push(h),{...f,[h.experienceId]:A}},unregister(f,h){var v;const A=h.experienceId,_=(v=f[A])==null?void 0:v.filter(F=>F!==h);return{...f,[A]:_??[]}}}),o=i.createEffect(({experience:f,target:h})=>ue({client:e,experience:f,target:h})),u=i.createEffect(f=>{c.register(f)}),p=i.createEffect(f=>{f.target&&Ie(f.target,()=>{a(f)})}),y=i.createEffect(f=>{c.unregister(f)}),k=i.createEffect(f=>{const h=f.componentStore.getState();if(!h){N.logger("warn","No app component registered. Skipping init.");return}const A=h.frameworkStore.getState();if(!A){N.logger("error",`No framework registered for component '${h.name}'. Skipping rendering.`);return}const _=f.target;if(!_){N.logger("error",`No target element registered for experience '${f.experienceId}'. Skipping rendering.`);return}const v=Ee(_);try{A.render(v,h.component,e,f)}catch(F){N.logger("error",F)}});i.sample({clock:r,target:o}),i.sample({clock:a,target:y}),i.sample({clock:o.doneData,target:[u,p,n]}),i.sample({clock:o.doneData,target:e.eventBus.prepend(f=>({type:"experience_initialize",experienceInstance:f}))}),i.sample({clock:n,target:k});function B(f,h){r({experience:f,target:h})}const L=t.map(f=>Object.values(f).flat());function I(f){return t.map(h=>h[f]||[],{skipVoid:!1})}return{spawn:B,getByExperienceId:I,listStore:L}});function Pe(e){return q.invoke(Re,e)}exports.createAppHosts=ve;exports.createExperienceInstance=ue;exports.createExperienceInstanceIndex=Pe;exports.domInteractive=Ne;exports.evaluateRuleLogic=V;exports.getTargetElements=ke;exports.isPickedRoot=oe;exports.isRulesLogic=re;exports.isStepNode=M;exports.tagTargetElement=be;
|
|
@@ -81,15 +81,15 @@ function h() {
|
|
|
81
81
|
export {
|
|
82
82
|
t as G,
|
|
83
83
|
l as a,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
94
|
p as s
|
|
95
95
|
};
|
package/dist/types/client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Predicate } from './entities/predicate/predicate';
|
|
|
2
2
|
import { Action } from './entities/action/action';
|
|
3
3
|
import { Plugin } from './entities/plugin/plugin';
|
|
4
4
|
import { Feature } from './entities/feature/feature';
|
|
5
|
+
import { LogicRule } from './logic-engine';
|
|
5
6
|
export interface CreateClientOptions {
|
|
6
7
|
/**
|
|
7
8
|
* Your organizations unique identifier
|
|
@@ -87,5 +88,35 @@ export interface CreateClientOptions {
|
|
|
87
88
|
````
|
|
88
89
|
*/
|
|
89
90
|
features?: Record<string, Feature | (() => Feature)>;
|
|
91
|
+
/**
|
|
92
|
+
* Evaluate a condition or boolean expression before initializing the client
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* precondition: {
|
|
97
|
+
invoke: {
|
|
98
|
+
var: 'predicates.shopify-is-product-page',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
```
|
|
102
|
+
*
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
precondition?: LogicRule;
|
|
106
|
+
/**
|
|
107
|
+
* Evaluate a condition or boolean expression to determine the user state at initialization
|
|
108
|
+
*
|
|
109
|
+
* * @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* condition: {
|
|
112
|
+
invoke: {
|
|
113
|
+
var: 'features.convincely-enabled',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
```
|
|
117
|
+
*
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
condition?: LogicRule;
|
|
90
121
|
}
|
|
91
122
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -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,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
|
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;AACzD,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,gBAAgB,CAAA;AAE3D,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;IAEpD;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,SAAS,CAAA;IAExB;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Store } from 'effector';
|
|
2
1
|
export type Action = () => void;
|
|
3
2
|
export type ActionsStore = ReturnType<typeof createActionIndexFactory>;
|
|
4
3
|
export interface ActionIndexItem {
|
|
@@ -7,9 +6,8 @@ export interface ActionIndexItem {
|
|
|
7
6
|
}
|
|
8
7
|
declare const createActionIndexFactory: () => {
|
|
9
8
|
register: (name: string, action: Action) => void;
|
|
10
|
-
getByName: (name: string) => Store<ActionIndexItem | undefined>;
|
|
11
|
-
listStore: Store<ActionIndexItem[]>;
|
|
12
|
-
getEvokableAction: (actionName: string) => Store<(() => void) | undefined>;
|
|
9
|
+
getByName: (name: string) => import('effector').Store<ActionIndexItem | undefined>;
|
|
10
|
+
listStore: import('effector').Store<ActionIndexItem[]>;
|
|
13
11
|
};
|
|
14
12
|
export declare function createActionIndex(): ReturnType<typeof createActionIndexFactory>;
|
|
15
13
|
export declare const setupAction: (name: string, action: Action, actions: ActionsStore) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/entities/action/action.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -146,7 +146,9 @@ export interface Experience {
|
|
|
146
146
|
conditionals: ExperienceConditional[];
|
|
147
147
|
initializeOpen?: LogicRule | LogicValue;
|
|
148
148
|
actions?: ExperienceAction[];
|
|
149
|
-
|
|
149
|
+
condition?: LogicRule;
|
|
150
|
+
/** @deprecated Use `condition` instead. This property will be removed in a future version. */
|
|
151
|
+
decide?: LogicRule;
|
|
150
152
|
edges: ExperienceEdge[];
|
|
151
153
|
nodes: ExperienceNode[];
|
|
152
154
|
fields: Field[];
|
|
@@ -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,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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rB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;CACjE;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,YAAY,EAAE,qBAAqB,EAAE,CAAA;IACrC,cAAc,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACvC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC5B;AAED,eAAO,MAAM,eAAe,GAC1B,YAAY,UAAU,EACtB,iBAAiB,oBAAoB,KACpC,IAEF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,EAAE,YAAY,eAAe,SAa/E,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,MAAM,kBASzD,CAAA;AAsBD,eAAO,MAAM,0BAA0B,GACrC,QAAQ,MAAM,EACd,YAAY,eAAe,KAC1B,OAAO,CAAC,OAAO,CAsBjB,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Store } from 'effector';
|
|
2
1
|
import { Picked } from '../../picked';
|
|
3
2
|
export interface Feature {
|
|
4
3
|
key: string;
|
|
@@ -6,7 +5,7 @@ export interface Feature {
|
|
|
6
5
|
decide: () => boolean | Promise<boolean> | string | Promise<string>;
|
|
7
6
|
storage?: 'local' | 'session';
|
|
8
7
|
}
|
|
9
|
-
export type FeaturesStore = ReturnType<typeof
|
|
8
|
+
export type FeaturesStore = ReturnType<typeof createFeatureIndex>;
|
|
10
9
|
export interface FeatureIndexItem {
|
|
11
10
|
id: string;
|
|
12
11
|
feature: Feature & {
|
|
@@ -43,9 +42,8 @@ declare const createFeatureIndexFactory: ({ client }: {
|
|
|
43
42
|
client: Picked;
|
|
44
43
|
}) => {
|
|
45
44
|
register: (id: string, feature: Feature) => void;
|
|
46
|
-
|
|
47
|
-
listStore: Store<FeatureBucket[]>;
|
|
48
|
-
getEvokableFeature: (featureName: string) => Store<() => Promise<boolean | string | undefined>>;
|
|
45
|
+
getByName: (name: string) => import('effector').Store<FeatureIndexItem | undefined>;
|
|
46
|
+
listStore: import('effector').Store<FeatureBucket[]>;
|
|
49
47
|
};
|
|
50
48
|
export declare function createFeatureIndex<T extends Parameters<typeof createFeatureIndexFactory>[0]>(params: T): ReturnType<typeof createFeatureIndexFactory>;
|
|
51
49
|
export declare const setupFeature: (name: string, feature: Feature, features: FeaturesStore) => void;
|
|
@@ -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,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACnE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,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I,MAAM,MAAM,EAAE,SAAS,OAAO,EAAE,UAAU,aAAa,SAEnF,CAAA"}
|
|
@@ -22,6 +22,7 @@ export interface FieldBase {
|
|
|
22
22
|
options?: {
|
|
23
23
|
id: string;
|
|
24
24
|
label: string;
|
|
25
|
+
description?: string;
|
|
25
26
|
value: PrimitiveFieldValue;
|
|
26
27
|
condition?: LogicRule;
|
|
27
28
|
}[] | null;
|
|
@@ -33,6 +34,7 @@ export interface FieldTextSingular extends FieldBase {
|
|
|
33
34
|
options?: {
|
|
34
35
|
id: string;
|
|
35
36
|
label: string;
|
|
37
|
+
description?: string;
|
|
36
38
|
value: string;
|
|
37
39
|
condition?: LogicRule;
|
|
38
40
|
}[] | null;
|
|
@@ -44,6 +46,7 @@ export interface FieldTextMultiple extends FieldBase {
|
|
|
44
46
|
options?: {
|
|
45
47
|
id: string;
|
|
46
48
|
label: string;
|
|
49
|
+
description?: string;
|
|
47
50
|
value: string;
|
|
48
51
|
condition?: LogicRule;
|
|
49
52
|
}[] | null;
|
|
@@ -55,6 +58,7 @@ export interface FieldNumberSingular extends FieldBase {
|
|
|
55
58
|
options?: {
|
|
56
59
|
id: string;
|
|
57
60
|
label: string;
|
|
61
|
+
description?: string;
|
|
58
62
|
value: number;
|
|
59
63
|
condition?: LogicRule;
|
|
60
64
|
}[] | null;
|
|
@@ -66,6 +70,7 @@ export interface FieldNumberMultiple extends FieldBase {
|
|
|
66
70
|
options?: {
|
|
67
71
|
id: string;
|
|
68
72
|
label: string;
|
|
73
|
+
description?: string;
|
|
69
74
|
value: number;
|
|
70
75
|
condition?: LogicRule;
|
|
71
76
|
}[] | null;
|
|
@@ -77,6 +82,7 @@ export interface FieldBooleanSingular extends FieldBase {
|
|
|
77
82
|
options?: {
|
|
78
83
|
id: string;
|
|
79
84
|
label: string;
|
|
85
|
+
description?: string;
|
|
80
86
|
value: boolean;
|
|
81
87
|
condition?: LogicRule;
|
|
82
88
|
}[] | null;
|
|
@@ -88,6 +94,7 @@ export interface FieldBooleanMultiple extends FieldBase {
|
|
|
88
94
|
options?: {
|
|
89
95
|
id: string;
|
|
90
96
|
label: string;
|
|
97
|
+
description?: string;
|
|
91
98
|
value: boolean;
|
|
92
99
|
condition?: LogicRule;
|
|
93
100
|
}[] | null;
|
|
@@ -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,CAAC,EAAE,UAAU,CAAA;IACzB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE;QACT,eAAe,CAAC,EAAE,OAAO,CAAA;QACzB,eAAe,CAAC,EAAE,OAAO,CAAA;KAC1B,CAAA;IACD,OAAO,CAAC,EACJ;QACE,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,mBAAmB,CAAA;QAC1B,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,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,EAAE,KAAK,CAAA;IACf,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EACJ;QACE,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,KAAK,EAAE,OAAO,CAAA;QACd,SAAS,CAAC,EAAE,SAAS,CAAA;KACtB,EAAE,GACH,IAAI,CAAA;CACT;AAED,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,EAAE,IAAI,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,EAAE,CAAA;IACxB,OAAO,CAAC,EACJ;QACE,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,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,4 +1,3 @@
|
|
|
1
|
-
import { Store } from 'effector';
|
|
2
1
|
import { StateSnapshot } from '../../utils/state-snaphot';
|
|
3
2
|
import { Picked } from '../../picked';
|
|
4
3
|
export type Predicate = (snapshot: StateSnapshot) => boolean | Promise<boolean> | string | Promise<string> | string[] | Promise<string[]> | undefined;
|
|
@@ -11,12 +10,14 @@ declare const createPredicateIndexFactory: ({ client }: {
|
|
|
11
10
|
client: Picked;
|
|
12
11
|
}) => {
|
|
13
12
|
register: (name: string, predicate: Predicate) => void;
|
|
14
|
-
getByName: (name: string) => Store<
|
|
15
|
-
|
|
13
|
+
getByName: (name: string) => import('effector').Store<{
|
|
14
|
+
name: string;
|
|
15
|
+
predicate: Predicate;
|
|
16
|
+
} | undefined>;
|
|
17
|
+
listStore: import('effector').Store<{
|
|
16
18
|
name: string;
|
|
17
19
|
predicate: Predicate;
|
|
18
20
|
}[]>;
|
|
19
|
-
getEvokablePredicate: (predicateName: string) => Store<() => ReturnType<Predicate>>;
|
|
20
21
|
};
|
|
21
22
|
export declare function createPredicateIndex<T extends Parameters<typeof createPredicateIndexFactory>[0]>(params: T): ReturnType<typeof createPredicateIndexFactory>;
|
|
22
23
|
export declare const setupPredicate: (name: string, predicate: Predicate, predicates: PredicatesStore) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../../../../src/entities/predicate/predicate.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -9,10 +9,7 @@ export interface ResponseListItem {
|
|
|
9
9
|
declare const createResponseIndexFactory: ({ client }: {
|
|
10
10
|
client: Picked;
|
|
11
11
|
}) => {
|
|
12
|
-
register:
|
|
13
|
-
(fieldId: Field["id"], response: Response): void;
|
|
14
|
-
(payload: Record<Field["id"], Response>, response?: never): void;
|
|
15
|
-
};
|
|
12
|
+
register: (fieldId: Field["id"], response: Response) => void;
|
|
16
13
|
clearAll: import('effector').EventCallable<void>;
|
|
17
14
|
clear: import('effector').EventCallable<string>;
|
|
18
15
|
commit: (responsesToCommit: CommitResponses) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/entities/response/response.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAuB,MAAM,gBAAgB,CAAA;AAkB5E,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,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AAED,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAA;AAE7D,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IAGpB,WAAW,EAAE,MAAM,CAAA;IAGnB,aAAa,EAAE,MAAM,CAAA;IAGrB,KAAK,EAAE,UAAU,CAAA;CAClB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from './exports';
|
|
2
2
|
export type * from './client';
|
|
3
|
-
export type * from './entities/action/action';
|
|
4
3
|
export type * from './entities/component/component';
|
|
5
4
|
export type * from './entities/experience-instance/experience-instance';
|
|
6
5
|
export type * from './entities/experience/experience';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,oDAAoD,CAAA;AACvE,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,8BAA8B,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/types/picked.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Feature } from './entities/feature/feature';
|
|
|
9
9
|
import { Field } from './entities/field/field';
|
|
10
10
|
import { Action } from './entities/action/action';
|
|
11
11
|
import { Session } from './utils/user-session';
|
|
12
|
+
import { LogicRule, LogicValue } from './logic-engine';
|
|
12
13
|
export declare class Picked {
|
|
13
14
|
static readonly logger: (level: "log" | "warn" | "info" | "error", ...args: Parameters<Console["log"]>) => void;
|
|
14
15
|
private readonly options;
|
|
@@ -19,7 +20,9 @@ export declare class Picked {
|
|
|
19
20
|
readonly organizationId: string;
|
|
20
21
|
readonly projectId: string;
|
|
21
22
|
readonly apiUrl: string;
|
|
22
|
-
|
|
23
|
+
session?: Session | null;
|
|
24
|
+
readonly precondition?: LogicRule;
|
|
25
|
+
readonly condition?: LogicRule;
|
|
23
26
|
readonly searchParams: import('./utils/search-params').PickedSearchParams;
|
|
24
27
|
readonly history: {
|
|
25
28
|
push: import('effector').EventCallable<{
|
|
@@ -57,9 +60,9 @@ export declare class Picked {
|
|
|
57
60
|
experienceId: string;
|
|
58
61
|
configStore: import('effector').Store<{
|
|
59
62
|
name: string;
|
|
60
|
-
decisionLogic:
|
|
63
|
+
decisionLogic: LogicRule | undefined;
|
|
61
64
|
targetSelectors: import('.').ExperienceTarget[];
|
|
62
|
-
initializeOpenLogic:
|
|
65
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
63
66
|
}>;
|
|
64
67
|
target: HTMLElement | undefined;
|
|
65
68
|
componentStore: import('effector').Store<{
|
|
@@ -94,9 +97,9 @@ export declare class Picked {
|
|
|
94
97
|
experienceId: string;
|
|
95
98
|
configStore: import('effector').Store<{
|
|
96
99
|
name: string;
|
|
97
|
-
decisionLogic:
|
|
100
|
+
decisionLogic: LogicRule | undefined;
|
|
98
101
|
targetSelectors: import('.').ExperienceTarget[];
|
|
99
|
-
initializeOpenLogic:
|
|
102
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
100
103
|
}>;
|
|
101
104
|
target: HTMLElement | undefined;
|
|
102
105
|
componentStore: import('effector').Store<{
|
|
@@ -133,9 +136,9 @@ export declare class Picked {
|
|
|
133
136
|
id: string;
|
|
134
137
|
configStore: import('effector').Store<{
|
|
135
138
|
name: string;
|
|
136
|
-
decisionLogic:
|
|
139
|
+
decisionLogic: LogicRule | undefined;
|
|
137
140
|
targetSelectors: import('.').ExperienceTarget[];
|
|
138
|
-
initializeOpenLogic:
|
|
141
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
139
142
|
}>;
|
|
140
143
|
treeStore: import('effector').Store<{
|
|
141
144
|
steps: import('.').ExperienceStep[];
|
|
@@ -158,9 +161,9 @@ export declare class Picked {
|
|
|
158
161
|
id: string;
|
|
159
162
|
configStore: import('effector').Store<{
|
|
160
163
|
name: string;
|
|
161
|
-
decisionLogic:
|
|
164
|
+
decisionLogic: LogicRule | undefined;
|
|
162
165
|
targetSelectors: import('.').ExperienceTarget[];
|
|
163
|
-
initializeOpenLogic:
|
|
166
|
+
initializeOpenLogic: LogicValue | LogicRule;
|
|
164
167
|
}>;
|
|
165
168
|
treeStore: import('effector').Store<{
|
|
166
169
|
steps: import('.').ExperienceStep[];
|
|
@@ -187,24 +190,22 @@ export declare class Picked {
|
|
|
187
190
|
};
|
|
188
191
|
readonly predicates: {
|
|
189
192
|
register: (name: string, predicate: Predicate) => void;
|
|
190
|
-
getByName: (name: string) => import('effector').Store<
|
|
193
|
+
getByName: (name: string) => import('effector').Store<{
|
|
194
|
+
name: string;
|
|
195
|
+
predicate: Predicate;
|
|
196
|
+
} | undefined>;
|
|
191
197
|
listStore: import('effector').Store<{
|
|
192
198
|
name: string;
|
|
193
199
|
predicate: Predicate;
|
|
194
200
|
}[]>;
|
|
195
|
-
getEvokablePredicate: (predicateName: string) => import('effector').Store<() => ReturnType<Predicate>>;
|
|
196
201
|
};
|
|
197
202
|
readonly features: {
|
|
198
203
|
register: (id: string, feature: Feature) => void;
|
|
199
|
-
|
|
204
|
+
getByName: (name: string) => import('effector').Store<import('.').FeatureIndexItem | undefined>;
|
|
200
205
|
listStore: import('effector').Store<import('.').FeatureBucket[]>;
|
|
201
|
-
getEvokableFeature: (featureName: string) => import('effector').Store<() => Promise<boolean | string | undefined>>;
|
|
202
206
|
};
|
|
203
207
|
readonly responses: {
|
|
204
|
-
register:
|
|
205
|
-
(fieldId: Field["id"], response: import('.').Response): void;
|
|
206
|
-
(payload: Record<Field["id"], import('.').Response>, response?: never): void;
|
|
207
|
-
};
|
|
208
|
+
register: (fieldId: Field["id"], response: import('.').Response) => void;
|
|
208
209
|
clearAll: import('effector').EventCallable<void>;
|
|
209
210
|
clear: import('effector').EventCallable<string>;
|
|
210
211
|
commit: (responsesToCommit: import('.').CommitResponses) => Promise<{
|
|
@@ -232,9 +233,8 @@ export declare class Picked {
|
|
|
232
233
|
};
|
|
233
234
|
readonly actions: {
|
|
234
235
|
register: (name: string, action: Action) => void;
|
|
235
|
-
getByName: (name: string) => import('effector').Store<import('
|
|
236
|
-
listStore: import('effector').Store<import('
|
|
237
|
-
getEvokableAction: (actionName: string) => import('effector').Store<(() => void) | undefined>;
|
|
236
|
+
getByName: (name: string) => import('effector').Store<import('./entities/action/action').ActionIndexItem | undefined>;
|
|
237
|
+
listStore: import('effector').Store<import('./entities/action/action').ActionIndexItem[]>;
|
|
238
238
|
};
|
|
239
239
|
constructor(options: CreateClientOptions);
|
|
240
240
|
start(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,UAAU,EAIhB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAC3F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,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AAE,SAAS;IAItC,iBAAiB,CAAC,IAAI,EAAE,MAAM,mBAAmB,EAAE,SAAS,EAAE,gBAAgB;IAI9E,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIpC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAI9C,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS;IAIpD,aAAa,CAAC,KAAK,EAAE,KAAK;IAI1B,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAI3C,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAQhD,gBAAgB,IAAI,aAAa;IAI3B,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB/D,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAGzF"}
|
|
@@ -127,6 +127,7 @@ export type SerializableField = {
|
|
|
127
127
|
options: {
|
|
128
128
|
id: string;
|
|
129
129
|
label: string;
|
|
130
|
+
description?: string;
|
|
130
131
|
value: string | number | boolean | object;
|
|
131
132
|
condition?: LogicRule;
|
|
132
133
|
}[] | null;
|
|
@@ -137,6 +138,8 @@ export interface SerializableExperience {
|
|
|
137
138
|
id: string;
|
|
138
139
|
component?: AdaptedComponent;
|
|
139
140
|
name: string;
|
|
141
|
+
condition?: LogicRule;
|
|
142
|
+
/** @deprecated Use `condition` instead. This property will be removed in a future version. */
|
|
140
143
|
decide?: LogicRule;
|
|
141
144
|
initializeOpen?: LogicRule | LogicValue;
|
|
142
145
|
targets: ExperienceTarget[];
|
|
@@ -163,7 +166,9 @@ export interface SerializableExperience {
|
|
|
163
166
|
export interface CreateExperienceOptions {
|
|
164
167
|
id: string;
|
|
165
168
|
name: string;
|
|
166
|
-
|
|
169
|
+
condition?: LogicRule;
|
|
170
|
+
/** @deprecated Use `condition` instead. This property will be removed in a future version. */
|
|
171
|
+
decide?: LogicRule;
|
|
167
172
|
initializeOpen?: LogicRule | LogicValue;
|
|
168
173
|
targets: ExperienceTarget[];
|
|
169
174
|
component?: AdaptedComponent;
|