@picked/client 0.0.7 → 0.0.8-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/plugins/create-experience/index.js +1 -1
  3. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  4. package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
  5. package/dist/cjs/server/index.js +1 -1
  6. package/dist/esm/index.js +323 -291
  7. package/dist/esm/plugins/create-experience/index.js +75 -67
  8. package/dist/esm/plugins/responses-browser-storage/index.js +16 -15
  9. package/dist/esm/plugins/responses-indexeddb/index.js +24 -21
  10. package/dist/esm/server/index.js +1 -1
  11. package/dist/{experience-instance-DYZovD6a.js → experience-instance-C1Ky25uw.js} +17 -16
  12. package/dist/{experience-instance-DwO_yZK0.cjs → experience-instance-DNI5sbjx.cjs} +1 -1
  13. package/dist/types/entities/experience-instance/experience-instance.d.ts +3 -0
  14. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  15. package/dist/types/entities/field/field.d.ts +27 -19
  16. package/dist/types/entities/field/field.d.ts.map +1 -1
  17. package/dist/types/entities/predicate/predicate.d.ts +1 -1
  18. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  19. package/dist/types/entities/response/response.d.ts +8 -0
  20. package/dist/types/entities/response/response.d.ts.map +1 -1
  21. package/dist/types/exports.d.ts +2 -0
  22. package/dist/types/exports.d.ts.map +1 -1
  23. package/dist/types/picked.d.ts +12 -6
  24. package/dist/types/picked.d.ts.map +1 -1
  25. package/dist/types/plugins/create-experience/create-experience.d.ts +17 -6
  26. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  27. package/dist/types/utils/get-step-fields.d.ts +4 -0
  28. package/dist/types/utils/get-step-fields.d.ts.map +1 -0
  29. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";const a=require("effector"),D=require("@withease/factories"),B=require("./supports-B6KShYPU.cjs"),M=require("./logger-BsmHUUw1.cjs"),ce=require("./object-BbFTsGh3.cjs");function ae(e){return typeof e=="number"&&!isNaN(e)}function F(e){return typeof e=="string"}function w(e){return Array.isArray(e)}function z(e){return e instanceof Promise}function V(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1}function g(e){if(ae(e))return e;const t=parseFloat(`${e}`);return isNaN(t)?0:t}function A(e){return`${e}`}const ue={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>g(e)>g(t),">=":(e,t)=>g(e)>=g(t),"<":(e,t,r)=>{const n=g(e),i=g(t);if(r===void 0)return n<i;const c=g(r);return n<i&&i<c},"<=":(e,t,r)=>{const n=g(e),i=g(t);if(r===void 0)return n<=i;const c=g(r);return n<=i&&i<=c},"!!":async e=>await k(e),"!":async e=>!await k(e),"%":(e,t)=>g(e)%g(t),log:e=>(console.log(e),e),in:(e,t)=>t?F(t)?t.indexOf(A(e))!==-1:w(t)?t.includes(e):!1:!1,cat:(...e)=>e.map(A).join(""),substr:(e,t,r)=>{const n=A(e),i=g(t);if(r===void 0)return n.substr(i);const c=g(r);if(c<0){const o=n.substr(i);return o.substr(0,o.length+c)}return n.substr(i,c)},"+":(...e)=>e.reduce((t,r)=>g(t)+g(r),0),"*":(...e)=>e.reduce((t,r)=>g(t)*g(r),1),"-":(e,t)=>{const r=g(e);return t===void 0?-r:r-g(t)},"/":(e,t)=>g(e)/g(t),min:(...e)=>Math.min(...e.map(g)),max:(...e)=>Math.max(...e.map(g)),merge:(...e)=>e.reduce((t,r)=>w(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=A(e);if(n===""||n===".")return this;const i=n.split(".");let c=this;for(const o of i){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=w(e[0])?e[0]:e,r=[];for(const n of t){const i=await d({var:n},this);(i===null||i==="")&&r.push(`${n}`)}return r},async missing_some(e,t){const r=await d({missing:t},this);if(!w(r)||!w(t))return[];const n=r.filter(F);return t.filter(F).length-n.length>=g(e)?[]:n},invoke(e){return typeof e!="function"?null:e()},regexp_matches(e,t){let r=e,n="";if(w(e)){const[c,o]=e;r=c,n=o}return!F(r)||!F(n)?!1:new RegExp(r,n).test(A(t))},throw(e){throw new Error(A(e))}};async function d(e,t){if(!e)return e;if(z(e))return d(await e,t);if(w(e))return Promise.all(e.map(o=>d(o,t)));if(!V(e))return e;const r=fe(e);let n=r?e[r]??[]:[];switch(w(n)||(n=[n]),r){case"if":case"?:":for(let o=0;o<n.length-1;o+=2)if(await k(await d(n[o],t)))return d(n[o+1],t);return n.length%2===1?d(n[n.length-1],t):null;case"and":{let o=null;for(const u of n)if(o=await d(u,t),!await k(o))return o;return o}case"or":{let o=null;for(const u of n)if(o=await d(u,t),await k(o))return o;return o}case"map":{const o=await d(n[0],t);return w(o)?await Promise.all(o.map(u=>d(n[1],u))):[]}case"filter":{const o=await d(n[0],t);return w(o)?(await Promise.all(o.map(async f=>{const S=await k(await d(n[1],f));return{item:f,shouldInclude:S}}))).filter(({shouldInclude:f})=>f).map(({item:f})=>f):[]}case"reduce":{const o=await d(n[0],t);if(!w(o))return n.length>2?await d(n[2],t):null;const u=n[1];let S=n.length>2?await d(n[2],t):null;for(const x of o)S=await d(u,{current:x,accumulator:S});return S}case"all":{const o=await d(n[0],t);if(!w(o)||o.length===0)return!1;for(const u of o)if(!await k(await d(n[1],u)))return!1;return!0}case"some":{const o=await d(n[0],t);if(!w(o))return!1;for(const u of o)if(await k(await d(n[1],u)))return!0;return!1}case"none":{const o=await d(n[0],t);if(!w(o))return!0;for(const u of o)if(await k(await d(n[1],u)))return!1;return!0}case"catch":try{return await d(n[0],t)}catch(o){return V(o)?await d(o,t):n[1]?await d(n[1],o):o instanceof Error?o.message:o}}const i=await Promise.all(n.map(o=>d(o,t))),c=r?ue[r]:void 0;if(!c)throw new Error(`Unrecognized operation ${r}`);return c.apply(t,i)}async function k(e){return z(e)?k(await e):!(Array.isArray(e)&&e.length===0)&&!!e}function fe(e){return Object.keys(e)[0]}function pe(e){return!ce.isEmpty(e)}async function X(e,t,r){const n=e.getStateSnapshot(),i=e.predicates.listStore.getState().reduce((u,f)=>({...u,[f.name]:()=>f.predicate(n)}),{}),c=e.features.listStore.getState().reduce((u,f)=>({...u,[f.id]:async()=>{const{bucket:S}=await f.getBucket();return S}}),{}),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:i,features:c};return await d(t,o)}function le(e){return!B.supportsWindow()||!B.supportsDocument()?[]:Array.from(window.document.querySelectorAll(e)).filter(t=>t instanceof HTMLElement)}function de(e){if(!B.supportsShadowRoot())throw new Error("Shadow DOM is not supported in this environment");return e.attachShadow({mode:"closed"})}function ge(){return new Promise((e,t)=>{if(!B.supportsDocument()){t();return}document.readyState!=="loading"?e():document.addEventListener("readystatechange",()=>e(),{once:!0})})}function me(e,t){const r=new MutationObserver(n=>{document.contains(e)||(r.disconnect(),t())});r.observe(document.body,{childList:!0,subtree:!0})}const O="picked-root",R="picked-target",he="picked-root";function Se(e,t){return[...e,{selector:`${he}[experience-id="${t}"]`,placement:"replace"}].flatMap(n=>{const i=le(n.selector).filter(c=>!Ee(c,t)&&!J(c,t));return{...n,elements:i}})}function ye(e,t){return e.flatMap(r=>r.elements.map(n=>Ie(n,r.placement,t)))}function we(e,t){e.classList.add(R),e.classList.add(`${R}-${t}`)}function Ee(e,t){return t?e.classList.contains(`${R}-${t}`):e.classList.contains(`${R}`)}function J(e,t){return t?e.classList.contains(`${O}-${t}`):e.classList.contains(O)}function xe(e){const t=document.createElement("div");return t.style.display="block",t.classList.add(O),t.classList.add(`${O}-${e}`),t}function Ie(e,t,r){let n;const i=xe(r);if(e instanceof Document)n=e.body.appendChild(i);else{switch(t){case"replace":e.replaceWith(i);break;case"before":e.before(i);break;case"after":e.after(i);break;case"prepend":e.prepend(i);break;default:e.append(i);break}n=i}return n}function ke(e){return e.type==="conditional"}function _(e){return e.type==="step"}function Ne(e){return e.type==="experience"}function W(e){return e.type==="origin"}const Q=(e,t,r,n,i=new Set)=>i.has(r.id)?[]:(i.add(r.id),_(r)&&!n?[r]:t.filter(o=>o.sourceNodeId===r.id).flatMap(o=>{const u=e.find(f=>f.id===o.destinationNodeId);return u?Q(e,t,u,!1,i):[]})),ve=(e,t,r)=>Q(e,t,r,!0,new Set),Y=(e,t,r,n,i=new Set)=>{if(i.has(r.id))return[-1,-1];i.add(r.id);const c=t.filter(f=>f.sourceNodeId===r.id);if(c.length===0)return[0,0];let o=1/0,u=-1/0;for(const f of c){const S=e.find(I=>I.id===f.destinationNodeId);if(!S)continue;const[x,y]=Y(e,t,S,!1,new Set(i));x!==-1&&(o=Math.min(o,x+1),u=Math.max(u,y+1))}return o===1/0?[-1,-1]:[o,u]},be=(e,t,r)=>Y(e,t,r,!0,new Set),Z=(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 i=t.filter(u=>u.destinationNodeId===r.id);if(i.length===0)return[-1,-1];let c=1/0,o=-1/0;for(const u of i){const f=e.find(y=>y.id===u.sourceNodeId);if(!f)continue;const[S,x]=Z(e,t,f,new Set(n));S!==-1&&(c=Math.min(c,S+1),o=Math.max(o,x+1))}return c===1/0?[-1,-1]:[c,o]},Ae=(e,t,r)=>Z(e,t,r,new Set),ee=e=>e.find(r=>r.type==="origin")||null,j=(e,t,r)=>{if(!e)return ee(t);const n=r.find(c=>c.sourceNodeId===e.id);if(!n)return null;const i=t.find(c=>c.id===n.destinationNodeId);return i||null};async function _e(e,t,r,n){const i=e?"true":"false",c=n.find(o=>o.sourceNodeHandle===i&&o.sourceNodeId===t);return r.find(o=>o.id===(c==null?void 0:c.destinationNodeId))}const q=a.createDomain("experience-instance"),Le=D.createFactory(({client:e,experience:t,target:r})=>{const n=a.createEvent(),i=a.createEvent(),c=a.createEvent(),o=a.createEvent(),u=t.componentStore,f=q.store("transitioning"),S=e.history.entriesStore.map(s=>s.filter(l=>l.experienceId===t.id)),x=S.map(s=>s.filter(l=>_(l.node))),y=S.map(s=>{var l;return((l=s[s.length-1])==null?void 0:l.node)||null}),I=a.combine(t.treeStore,y,({steps:s},l)=>s.find(m=>l&&_(l)&&m.id===l.stepId)||null),P=a.combine(t.treeStore,y,({nodes:s,edges:l},m)=>m?ve(s,l,m):[]),p=a.combine(t.treeStore,y,({nodes:s,edges:l},m)=>m?Ae(s,l,m):[-1,-1]),h=a.combine(t.treeStore,y,({nodes:s,edges:l},m)=>m?be(s,l,m):[-1,-1]),E=q.store(!0),N=a.createApi(E,{open:()=>!0,close:()=>!1,toggle:s=>!s,set:(s,l)=>l});a.sample({source:E,filter:Boolean,target:e.eventBus.prepend(()=>({type:"experience_open",experience:t}))}),a.sample({source:E,filter:s=>!s,target:e.eventBus.prepend(()=>({type:"experience_close",experience:t}))});const v=a.createEffect(async()=>{e.history.back({experienceId:t.id})}),L=a.attach({source:t.treeStore,effect:async(s,l)=>{const m=s.nodes.find(b=>_(b)&&b.stepId===l);m&&e.history.push({experienceId:t.id,node:m})}}),G=a.attach({source:y,effect:s=>{}}),$=a.attach({source:t.treeStore,effect:async({nodes:s})=>ee(s)}),C=a.attach({source:t.treeStore,effect:async({nodes:s,edges:l},m)=>j(m,s,l)}),H=a.attach({source:t.treeStore,effect:async({nodes:s,edges:l,conditionals:m},b)=>{if(!b)return;const U=m.find(ie=>ie.id===b.conditionalId);if(!U)return;const oe=b.id,se=await X(e,U.condition);return _e(!!se,oe,s,l)}}),ne=a.createEffect(s=>{if(s)return e.launchExperienceById(s.experienceId)}),K=a.attach({source:[y,t.treeStore],effect:async([s,{nodes:l,edges:m}])=>j(s,l,m)}),T=a.attach({source:[y,t.treeStore],effect:async([s,{nodes:l,edges:m}])=>j(s,l,m)}),re=a.createEffect(s=>{e.history.push({experienceId:t.id,node:s})});return a.split({source:y,match:s=>s?ke(s)?"condition":_(s)?"step":Ne(s)?"launchExperience":W(s)?"origin":"other":"none",cases:{none:$,origin:C,condition:H,step:G,launchExperience:ne,__:a.createEvent()}}),a.sample({clock:[H.doneData,C.doneData,$.doneData,T.doneData,K.doneData],filter:Boolean,target:re}),a.sample({clock:i,target:T}),a.sample({clock:i,source:I,target:e.eventBus.prepend(s=>({type:"step_submit",step:s??void 0,experience:t}))}),a.sample({clock:T.done,source:I,target:e.eventBus.prepend(s=>({type:"step_submit_success",step:s??void 0,experience:t}))}),a.sample({clock:T.fail,source:I,target:e.eventBus.prepend(s=>({type:"step_submit_error",step:s??void 0,experience:t}))}),a.sample({clock:c,target:v}),a.sample({clock:c,source:I,target:e.eventBus.prepend(s=>({type:"step_submit",step:s??void 0,experience:t}))}),a.sample({clock:o,target:L}),a.sample({source:a.combine([H.pending,C.pending,$.pending,T.pending]),fn:s=>s.some(Boolean)?"transitioning":"ready",target:f}),a.sample({clock:G.doneData,source:I,target:e.eventBus.prepend(s=>({type:"step_enter",step:s??void 0,experience:t}))}),a.sample({source:y,clock:n,filter:s=>s?W(s):!0,target:K}),n(),{experienceId:t.id,configStore:t.configStore,target:r,componentStore:u,stateStore:f,isOpenStore:E,open:N.open,close:N.close,toggleOpen:N.toggle,setOpen:N.set,treeStore:t.treeStore,currentNodeStore:y,currentStepStore:I,nextReachableStepNodesStore:P,stepsToOriginStore:p,stepsToLeafStore:h,goToNextStep:i,goToPreviousStep:c,goToStepById:o,stepsHistoryStore:x}});function te(e){return D.invoke(Le,e)}const Te=D.createFactory(({client:e})=>{const t=q.store({}),r=a.createEvent(),n=a.createEvent(),i=a.createEvent(),c=a.createApi(t,{register(p,h){const E=[...p[h.experienceId]??[]];return E.push(h),{...p,[h.experienceId]:E}},unregister(p,h){var v;const E=h.experienceId,N=(v=p[E])==null?void 0:v.filter(L=>L!==h);return{...p,[E]:N??[]}}}),o=a.createEffect(({experience:p,target:h})=>te({client:e,experience:p,target:h})),u=a.createEffect(p=>{c.register(p)}),f=a.createEffect(p=>{p.target&&me(p.target,()=>{i(p)})}),S=a.createEffect(p=>{c.unregister(p)}),x=a.createEffect(p=>{const h=p.componentStore.getState();if(!h){M.logger("warn","No app component registered. Skipping init.");return}const E=h.frameworkStore.getState();if(!E){M.logger("error",`No framework registered for component '${h.name}'. Skipping rendering.`);return}const N=p.target;if(!N){M.logger("error",`No target element registered for experience '${p.experienceId}'. Skipping rendering.`);return}const v=de(N);try{E.render(v,h.component,e,p)}catch(L){M.logger("error",L)}});a.sample({clock:r,target:o}),a.sample({clock:i,target:S}),a.sample({clock:o.doneData,target:[u,f,n]}),a.sample({clock:o.doneData,target:e.eventBus.prepend(p=>({type:"experience_initialized",experienceInstance:p}))}),a.sample({clock:n,target:x});function y(p,h){r({experience:p,target:h})}const I=t.map(p=>Object.values(p).flat());function P(p){return t.map(h=>h[p]||[],{skipVoid:!1})}return{spawn:y,getByExperienceId:P,listStore:I}});function Fe(e){return D.invoke(Te,e)}exports.createAppHosts=ye;exports.createExperienceInstance=te;exports.createExperienceInstanceIndex=Fe;exports.domInteractive=ge;exports.evaluateRuleLogic=X;exports.getTargetElements=Se;exports.isPickedRoot=J;exports.isRulesLogic=pe;exports.isStepNode=_;exports.tagTargetElement=we;
1
+ "use strict";const a=require("effector"),D=require("@withease/factories"),B=require("./supports-B6KShYPU.cjs"),F=require("./logger-BsmHUUw1.cjs"),ce=require("./object-BbFTsGh3.cjs");function ae(e){return typeof e=="number"&&!isNaN(e)}function M(e){return typeof e=="string"}function w(e){return Array.isArray(e)}function z(e){return e instanceof Promise}function V(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1}function g(e){if(ae(e))return e;const t=parseFloat(`${e}`);return isNaN(t)?0:t}function A(e){return`${e}`}const ue={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>g(e)>g(t),">=":(e,t)=>g(e)>=g(t),"<":(e,t,r)=>{const n=g(e),i=g(t);if(r===void 0)return n<i;const c=g(r);return n<i&&i<c},"<=":(e,t,r)=>{const n=g(e),i=g(t);if(r===void 0)return n<=i;const c=g(r);return n<=i&&i<=c},"!!":async e=>await k(e),"!":async e=>!await k(e),"%":(e,t)=>g(e)%g(t),log:e=>(console.log(e),e),in:(e,t)=>t?M(t)?t.indexOf(A(e))!==-1:w(t)?t.includes(e):!1:!1,cat:(...e)=>e.map(A).join(""),substr:(e,t,r)=>{const n=A(e),i=g(t);if(r===void 0)return n.substr(i);const c=g(r);if(c<0){const o=n.substr(i);return o.substr(0,o.length+c)}return n.substr(i,c)},"+":(...e)=>e.reduce((t,r)=>g(t)+g(r),0),"*":(...e)=>e.reduce((t,r)=>g(t)*g(r),1),"-":(e,t)=>{const r=g(e);return t===void 0?-r:r-g(t)},"/":(e,t)=>g(e)/g(t),min:(...e)=>Math.min(...e.map(g)),max:(...e)=>Math.max(...e.map(g)),merge:(...e)=>e.reduce((t,r)=>w(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=A(e);if(n===""||n===".")return this;const i=n.split(".");let c=this;for(const o of i){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=w(e[0])?e[0]:e,r=[];for(const n of t){const i=await d({var:n},this);(i===null||i==="")&&r.push(`${n}`)}return r},async missing_some(e,t){const r=await d({missing:t},this);if(!w(r)||!w(t))return[];const n=r.filter(M);return t.filter(M).length-n.length>=g(e)?[]:n},invoke(e){return typeof e!="function"?null:e()},regexp_matches(e,t){let r=e,n="";if(w(e)){const[c,o]=e;r=c,n=o}return!M(r)||!M(n)?!1:new RegExp(r,n).test(A(t))},throw(e){throw new Error(A(e))}};async function d(e,t){if(!e)return e;if(z(e))return d(await e,t);if(w(e))return Promise.all(e.map(o=>d(o,t)));if(!V(e))return e;const r=fe(e);let n=r?e[r]??[]:[];switch(w(n)||(n=[n]),r){case"if":case"?:":for(let o=0;o<n.length-1;o+=2)if(await k(await d(n[o],t)))return d(n[o+1],t);return n.length%2===1?d(n[n.length-1],t):null;case"and":{let o=null;for(const u of n)if(o=await d(u,t),!await k(o))return o;return o}case"or":{let o=null;for(const u of n)if(o=await d(u,t),await k(o))return o;return o}case"map":{const o=await d(n[0],t);return w(o)?await Promise.all(o.map(u=>d(n[1],u))):[]}case"filter":{const o=await d(n[0],t);return w(o)?(await Promise.all(o.map(async f=>{const S=await k(await d(n[1],f));return{item:f,shouldInclude:S}}))).filter(({shouldInclude:f})=>f).map(({item:f})=>f):[]}case"reduce":{const o=await d(n[0],t);if(!w(o))return n.length>2?await d(n[2],t):null;const u=n[1];let S=n.length>2?await d(n[2],t):null;for(const x of o)S=await d(u,{current:x,accumulator:S});return S}case"all":{const o=await d(n[0],t);if(!w(o)||o.length===0)return!1;for(const u of o)if(!await k(await d(n[1],u)))return!1;return!0}case"some":{const o=await d(n[0],t);if(!w(o))return!1;for(const u of o)if(await k(await d(n[1],u)))return!0;return!1}case"none":{const o=await d(n[0],t);if(!w(o))return!0;for(const u of o)if(await k(await d(n[1],u)))return!1;return!0}case"catch":try{return await d(n[0],t)}catch(o){return V(o)?await d(o,t):n[1]?await d(n[1],o):o instanceof Error?o.message:o}}const i=await Promise.all(n.map(o=>d(o,t))),c=r?ue[r]:void 0;if(!c)throw new Error(`Unrecognized operation ${r}`);return c.apply(t,i)}async function k(e){return z(e)?k(await e):!(Array.isArray(e)&&e.length===0)&&!!e}function fe(e){return Object.keys(e)[0]}function pe(e){return!ce.isEmpty(e)}async function X(e,t,r){const n=e.getStateSnapshot(),i=e.predicates.listStore.getState().reduce((u,f)=>({...u,[f.name]:()=>f.predicate(n)}),{}),c=e.features.listStore.getState().reduce((u,f)=>({...u,[f.id]:async()=>{const{bucket:S}=await f.getBucket();return S}}),{}),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:i,features:c};return await d(t,o)}function le(e){return!B.supportsWindow()||!B.supportsDocument()?[]:Array.from(window.document.querySelectorAll(e)).filter(t=>t instanceof HTMLElement)}function de(e){if(!B.supportsShadowRoot())throw new Error("Shadow DOM is not supported in this environment");return e.attachShadow({mode:"closed"})}function ge(){return new Promise((e,t)=>{if(!B.supportsDocument()){t();return}document.readyState!=="loading"?e():document.addEventListener("readystatechange",()=>e(),{once:!0})})}function me(e,t){const r=new MutationObserver(n=>{document.contains(e)||(r.disconnect(),t())});r.observe(document.body,{childList:!0,subtree:!0})}const O="picked-root",R="picked-target",he="picked-root";function Se(e,t){return[...e,{selector:`${he}[experience-id="${t}"]`,placement:"replace"}].flatMap(n=>{const i=le(n.selector).filter(c=>!Ee(c,t)&&!J(c,t));return{...n,elements:i}})}function ye(e,t){return e.flatMap(r=>r.elements.map(n=>Ie(n,r.placement,t)))}function we(e,t){e.classList.add(R),e.classList.add(`${R}-${t}`)}function Ee(e,t){return t?e.classList.contains(`${R}-${t}`):e.classList.contains(`${R}`)}function J(e,t){return t?e.classList.contains(`${O}-${t}`):e.classList.contains(O)}function xe(e){const t=document.createElement("div");return t.style.display="block",t.classList.add(O),t.classList.add(`${O}-${e}`),t}function Ie(e,t,r){let n;const i=xe(r);if(e instanceof Document)n=e.body.appendChild(i);else{switch(t){case"replace":e.replaceWith(i);break;case"before":e.before(i);break;case"after":e.after(i);break;case"prepend":e.prepend(i);break;default:e.append(i);break}n=i}return n}function ke(e){return e.type==="conditional"}function _(e){return e.type==="step"}function Ne(e){return e.type==="experience"}function W(e){return e.type==="origin"}const Q=(e,t,r,n,i=new Set)=>i.has(r.id)?[]:(i.add(r.id),_(r)&&!n?[r]:t.filter(o=>o.sourceNodeId===r.id).flatMap(o=>{const u=e.find(f=>f.id===o.destinationNodeId);return u?Q(e,t,u,!1,i):[]})),ve=(e,t,r)=>Q(e,t,r,!0,new Set),Y=(e,t,r,n,i=new Set)=>{if(i.has(r.id))return[-1,-1];i.add(r.id);const c=t.filter(f=>f.sourceNodeId===r.id);if(c.length===0)return[0,0];let o=1/0,u=-1/0;for(const f of c){const S=e.find(I=>I.id===f.destinationNodeId);if(!S)continue;const[x,y]=Y(e,t,S,!1,new Set(i));x!==-1&&(o=Math.min(o,x+1),u=Math.max(u,y+1))}return o===1/0?[-1,-1]:[o,u]},be=(e,t,r)=>Y(e,t,r,!0,new Set),Z=(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 i=t.filter(u=>u.destinationNodeId===r.id);if(i.length===0)return[-1,-1];let c=1/0,o=-1/0;for(const u of i){const f=e.find(y=>y.id===u.sourceNodeId);if(!f)continue;const[S,x]=Z(e,t,f,new Set(n));S!==-1&&(c=Math.min(c,S+1),o=Math.max(o,x+1))}return c===1/0?[-1,-1]:[c,o]},Ae=(e,t,r)=>Z(e,t,r,new Set),ee=e=>e.find(r=>r.type==="origin")||null,j=(e,t,r)=>{if(!e)return ee(t);const n=r.find(c=>c.sourceNodeId===e.id);if(!n)return null;const i=t.find(c=>c.id===n.destinationNodeId);return i||null};async function _e(e,t,r,n){const i=e?"true":"false",c=n.find(o=>o.sourceNodeHandle===i&&o.sourceNodeId===t);return r.find(o=>o.id===(c==null?void 0:c.destinationNodeId))}const q=a.createDomain("experience-instance"),Le=D.createFactory(({client:e,experience:t,target:r})=>{const n=a.createEvent(),i=a.createEvent(),c=a.createEvent(),o=a.createEvent(),u=t.componentStore,f=q.store("transitioning"),S=e.history.entriesStore.map(s=>s.filter(l=>l.experienceId===t.id)),x=S.map(s=>s.filter(l=>_(l.node))),y=S.map(s=>{var l;return((l=s[s.length-1])==null?void 0:l.node)||null}),I=a.combine(t.treeStore,y,({steps:s},l)=>s.find(m=>l&&_(l)&&m.id===l.stepId)||null),P=a.combine(t.treeStore,y,({nodes:s,edges:l},m)=>m?ve(s,l,m):[]),p=a.combine(t.treeStore,y,({nodes:s,edges:l},m)=>m?Ae(s,l,m):[-1,-1]),h=a.combine(t.treeStore,y,({nodes:s,edges:l},m)=>m?be(s,l,m):[-1,-1]),E=q.store(!0),N=a.createApi(E,{open:()=>!0,close:()=>!1,toggle:s=>!s,set:(s,l)=>l});a.sample({source:E,filter:Boolean,target:e.eventBus.prepend(()=>({type:"experience_open",experience:t}))}),a.sample({source:E,filter:s=>!s,target:e.eventBus.prepend(()=>({type:"experience_close",experience:t}))});const v=a.createEffect(async()=>{e.history.back({experienceId:t.id})}),L=a.attach({source:t.treeStore,effect:async(s,l)=>{const m=s.nodes.find(b=>_(b)&&b.stepId===l);m&&e.history.push({experienceId:t.id,node:m})}}),G=a.attach({source:y,effect:s=>{}}),$=a.attach({source:t.treeStore,effect:async({nodes:s})=>ee(s)}),C=a.attach({source:t.treeStore,effect:async({nodes:s,edges:l},m)=>j(m,s,l)}),H=a.attach({source:t.treeStore,effect:async({nodes:s,edges:l,conditionals:m},b)=>{if(!b)return;const U=m.find(ie=>ie.id===b.conditionalId);if(!U)return;const oe=b.id,se=await X(e,U.condition);return _e(!!se,oe,s,l)}}),ne=a.createEffect(s=>{if(s)return e.launchExperienceById(s.experienceId)}),K=a.attach({source:[y,t.treeStore],effect:async([s,{nodes:l,edges:m}])=>j(s,l,m)}),T=a.attach({source:[y,t.treeStore],effect:async([s,{nodes:l,edges:m}])=>j(s,l,m)}),re=a.createEffect(s=>{e.history.push({experienceId:t.id,node:s})});return a.split({source:y,match:s=>s?ke(s)?"condition":_(s)?"step":Ne(s)?"launchExperience":W(s)?"origin":"other":"none",cases:{none:$,origin:C,condition:H,step:G,launchExperience:ne,__:a.createEvent()}}),a.sample({clock:[H.doneData,C.doneData,$.doneData,T.doneData,K.doneData],filter:Boolean,target:re}),a.sample({clock:i,target:T}),a.sample({clock:i,source:I,target:e.eventBus.prepend(s=>({type:"step_submit",step:s??void 0,experience:t}))}),a.sample({clock:T.done,source:I,target:e.eventBus.prepend(s=>({type:"step_submit_success",step:s??void 0,experience:t}))}),a.sample({clock:T.fail,source:I,target:e.eventBus.prepend(s=>({type:"step_submit_error",step:s??void 0,experience:t}))}),a.sample({clock:c,target:v}),a.sample({clock:c,source:I,target:e.eventBus.prepend(s=>({type:"step_submit",step:s??void 0,experience:t}))}),a.sample({clock:o,target:L}),a.sample({source:a.combine([H.pending,C.pending,$.pending,T.pending]),fn:s=>s.some(Boolean)?"transitioning":"ready",target:f}),a.sample({clock:G.doneData,source:I,target:e.eventBus.prepend(s=>({type:"step_enter",step:s??void 0,experience:t}))}),a.sample({source:y,clock:n,filter:s=>s?W(s):!0,target:K}),n(),{id:Math.random().toString(36).substring(7),experienceId:t.id,configStore:t.configStore,target:r,componentStore:u,stateStore:f,isOpenStore:E,open:N.open,close:N.close,toggleOpen:N.toggle,setOpen:N.set,treeStore:t.treeStore,currentNodeStore:y,currentStepStore:I,nextReachableStepNodesStore:P,stepsToOriginStore:p,stepsToLeafStore:h,goToNextStep:i,goToPreviousStep:c,goToStepById:o,stepsHistoryStore:x}});function te(e){return D.invoke(Le,e)}const Te=D.createFactory(({client:e})=>{const t=q.store({}),r=a.createEvent(),n=a.createEvent(),i=a.createEvent(),c=a.createApi(t,{register(p,h){const E=[...p[h.experienceId]??[]];return E.push(h),{...p,[h.experienceId]:E}},unregister(p,h){var v;const E=h.experienceId,N=(v=p[E])==null?void 0:v.filter(L=>L!==h);return{...p,[E]:N??[]}}}),o=a.createEffect(({experience:p,target:h})=>te({client:e,experience:p,target:h})),u=a.createEffect(p=>{c.register(p)}),f=a.createEffect(p=>{p.target&&me(p.target,()=>{i(p)})}),S=a.createEffect(p=>{c.unregister(p)}),x=a.createEffect(p=>{const h=p.componentStore.getState();if(!h){F.logger("warn","No app component registered. Skipping init.");return}const E=h.frameworkStore.getState();if(!E){F.logger("error",`No framework registered for component '${h.name}'. Skipping rendering.`);return}const N=p.target;if(!N){F.logger("error",`No target element registered for experience '${p.experienceId}'. Skipping rendering.`);return}const v=de(N);try{E.render(v,h.component,e,p)}catch(L){F.logger("error",L)}});a.sample({clock:r,target:o}),a.sample({clock:i,target:S}),a.sample({clock:o.doneData,target:[u,f,n]}),a.sample({clock:o.doneData,target:e.eventBus.prepend(p=>({type:"experience_initialized",experienceInstance:p}))}),a.sample({clock:n,target:x});function y(p,h){r({experience:p,target:h})}const I=t.map(p=>Object.values(p).flat());function P(p){return t.map(h=>h[p]||[],{skipVoid:!1})}return{spawn:y,getByExperienceId:P,listStore:I}});function Me(e){return D.invoke(Te,e)}exports.createAppHosts=ye;exports.createExperienceInstance=te;exports.createExperienceInstanceIndex=Me;exports.domInteractive=ge;exports.evaluateRuleLogic=X;exports.getTargetElements=Se;exports.isPickedRoot=J;exports.isRulesLogic=pe;exports.isStepNode=_;exports.tagTargetElement=we;
@@ -11,6 +11,7 @@ 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
17
  type: string;
@@ -52,6 +53,7 @@ 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
59
  type: string;
@@ -88,6 +90,7 @@ 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
96
  type: string;
@@ -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;AAmB1C,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkTF,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;wBAoI7D,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
+ {"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;AAmB1C,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoTF,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"}
@@ -9,79 +9,87 @@ export interface FieldBase {
9
9
  type: 'text' | 'number' | 'object' | 'boolean';
10
10
  multiple: boolean;
11
11
  required: boolean;
12
- defaultValue: FieldValue;
13
- placeholder: string | null;
14
- description: string | null;
15
- helpText: string | null;
16
- validation: LogicRule;
17
- policies: {
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: string | null;
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: string[] | null;
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: number | null;
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: number[] | null;
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: boolean | null;
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: boolean[] | null;
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,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BD,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,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,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,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,KACpB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;AAEtE,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"}
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;
@@ -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;AAI5E,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAInE,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAA;AAEjC,QAAA,MAAM,0BAA0B,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;wBAwBnD,KAAK,CAAC,IAAI,CAAC,YAAY,QAAQ,KAAG,IAAI;;;gCAK5C,eAAe,KACjC,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC;;;;;;;;4BAyIV,KAAK,CAAC,IAAI,CAAC;gCAmBP,KAAK,CAAC,MAAM,CAAC;CAuChD,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAC5F,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAE/C;AAED,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"}
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/entities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 export { isPickedRoot } from './utils/dom';
4
4
  export * from './utils/supports';
5
5
  export * from './utils/storage';
6
6
  export type * from './utils/storage';
7
+ export { evaluateRuleLogic } from './utils/rules-logic';
8
+ export { getStepFields } from './utils/get-step-fields';
7
9
  /**
8
10
  * Create a new Picked client instance and bind it to the window
9
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,mBAAmB,iBAAiB,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,mBAAmB,WAIxD,CAAA"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,mBAAmB,iBAAiB,CAAA;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,mBAAmB,WAIxD,CAAA"}
@@ -50,6 +50,7 @@ export declare class Picked {
50
50
  readonly experienceInstances: {
51
51
  spawn: (experience: import('.').ExperienceStore, target: HTMLElement) => void;
52
52
  getByExperienceId: (id: Experience["id"]) => import('effector').Store<{
53
+ id: string;
53
54
  experienceId: string;
54
55
  configStore: import('effector').Store<{
55
56
  type: string;
@@ -86,6 +87,7 @@ export declare class Picked {
86
87
  stepsHistoryStore: import('effector').Store<import('.').HistoryEntry[]>;
87
88
  }[]>;
88
89
  listStore: import('effector').Store<{
90
+ id: string;
89
91
  experienceId: string;
90
92
  configStore: import('effector').Store<{
91
93
  type: string;
@@ -194,12 +196,6 @@ export declare class Picked {
194
196
  getByName: (name: string) => import('effector').Store<import('.').FeatureIndexItem | undefined>;
195
197
  listStore: import('effector').Store<import('.').FeatureBucket[]>;
196
198
  };
197
- readonly fields: {
198
- register: (field: Field) => void;
199
- getById: (id: import('.').FieldBase["id"]) => import('effector').Store<Field | null>;
200
- listStore: import('effector').Store<Field[]>;
201
- getByName: (name: import('.').FieldBase["name"]) => import('effector').Store<Field | null>;
202
- };
203
199
  readonly responses: {
204
200
  register: (fieldId: Field["id"], response: import('.').Response) => void;
205
201
  clearAll: import('effector').EventCallable<void>;
@@ -207,6 +203,10 @@ export declare class Picked {
207
203
  commit: (responsesToCommit: import('.').CommitResponses) => Promise<{
208
204
  errors: import('.').ValidationError[];
209
205
  }>;
206
+ getResponsesToCommit: (responsesToCommit: import('.').CommitResponses) => Promise<{
207
+ responsesToCommit: import('.').CommitResponses;
208
+ validationErrors: import('.').ValidationError[];
209
+ }>;
210
210
  listStore: import('effector').Store<{
211
211
  fieldId: string;
212
212
  value: import('.').FieldValue | undefined;
@@ -217,6 +217,12 @@ export declare class Picked {
217
217
  getByFieldId: (fieldId: Field["id"]) => import('effector').Store<import('.').FieldValue>;
218
218
  getByFieldName: (fieldName: Field["name"]) => import('effector').Store<import('.').FieldValue>;
219
219
  };
220
+ readonly fields: {
221
+ register: (field: Field) => void;
222
+ getById: (id: import('.').FieldBase["id"]) => import('effector').Store<Field | null>;
223
+ listStore: import('effector').Store<Field[]>;
224
+ getByName: (name: import('.').FieldBase["name"]) => import('effector').Store<Field | null>;
225
+ };
220
226
  constructor(options: CreateClientOptions);
221
227
  start(): void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QAAQ,CAAC,UAAU;;;;MAAyC;IAC5D,QAAQ,CAAC,UAAU;;;;;;;;;;MAAyC;IAC5D,QAAQ,CAAC,QAAQ;;;;MAAuB;IACxC,QAAQ,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;MAAwC;IAC1D,QAAQ,CAAC,MAAM;;;;;MAAqB;gBAExB,OAAO,EAAE,mBAAmB;IAkBxC,KAAK,IAAI,IAAI;IA8Bb,iBAAiB,CAAC,SAAS,EAAE,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,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,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAGzF"}
@@ -80,8 +80,17 @@ export interface SerializableConditional extends Nodeable {
80
80
  export interface CreateConditionalOptions {
81
81
  condition: LogicRule;
82
82
  }
83
- export type CreateFieldOptions = Omit<Field, 'options'> & {
84
- options: NonNullable<FieldTextSingular['options']>[number][] | NonNullable<FieldTextMultiple['options']>[number][] | NonNullable<FieldNumberSingular['options']>[number][] | NonNullable<FieldNumberMultiple['options']>[number][] | NonNullable<FieldBooleanSingular['options']>[number][] | NonNullable<FieldBooleanMultiple['options']>[number][] | null;
83
+ export type CreateFieldOptions = Omit<Field, 'options' | 'placeholder' | 'description' | 'helpText' | 'validation' | 'policies' | 'defaultValue'> & {
84
+ defaultValue?: string | number | boolean | object | null | string[] | number[] | boolean[] | object[];
85
+ placeholder?: string;
86
+ description?: string;
87
+ helpText?: string;
88
+ validation?: LogicRule;
89
+ policies?: {
90
+ doNotTrackValue?: boolean;
91
+ doNotStoreValue?: boolean;
92
+ };
93
+ options?: NonNullable<FieldTextSingular['options']>[number][] | NonNullable<FieldTextMultiple['options']>[number][] | NonNullable<FieldNumberSingular['options']>[number][] | NonNullable<FieldNumberMultiple['options']>[number][] | NonNullable<FieldBooleanSingular['options']>[number][] | NonNullable<FieldBooleanMultiple['options']>[number][];
85
94
  };
86
95
  export type SerializableField = {
87
96
  id: string;
@@ -91,11 +100,12 @@ export type SerializableField = {
91
100
  multiple: boolean;
92
101
  required: boolean;
93
102
  defaultValue: string | number | boolean | object | null | string[] | number[] | boolean[] | object[];
94
- placeholder: string | null;
95
- description: string | null;
96
- helpText: string | null;
103
+ placeholder?: string;
104
+ description?: string;
105
+ helpText?: string;
97
106
  validation: LogicRule;
98
- policies: {
107
+ condition?: LogicRule;
108
+ policies?: {
99
109
  doNotTrackValue?: boolean;
100
110
  doNotStoreValue?: boolean;
101
111
  };
@@ -103,6 +113,7 @@ export type SerializableField = {
103
113
  id: string;
104
114
  label: string;
105
115
  value: string | number | boolean | object;
116
+ condition?: LogicRule;
106
117
  }[] | null;
107
118
  } & {
108
119
  serialize: () => Serialized<Field>;
@@ -1 +1 @@
1
- {"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAGjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAo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F,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,oBAAoB,wBAAwB,EAC5C,YAAY,sBAAsB,KACjC,uBA0CF,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,cAAc,kBAAkB,KAAG,iBAyM9D,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,YAAY,uBAAuB,KAAG,sBA6JtE,CAAA"}
1
+ {"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAGjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EACV,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEhE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,iBAAiB,EAAE,CAAA;IAC3B,UAAU,EAAE,sBAAsB,CAAA;IAClC,QAAQ,EAAE,CAAC,WAAW,EAAE,iBAAiB,GAAG,gBAAgB,KAAK,gBAAgB,CAAA;IACjF,eAAe,EAAE,CACf,kBAAkB,EAAE,wBAAwB,GAAG,uBAAuB,KACnE,uBAAuB,CAAA;IAC5B,iBAAiB,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,sBAAsB,CAAA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BA6JtE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { Field } from '../entities/field/field';
2
+ import { Picked } from '../picked';
3
+ export declare function getStepFields(client: Picked, fields: Field[]): Promise<Field[]>;
4
+ //# sourceMappingURL=get-step-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-step-fields.d.ts","sourceRoot":"","sources":["../../../src/utils/get-step-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAWvC,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAoDrF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/client",
3
- "version": "0.0.7",
3
+ "version": "0.0.8-next.1",
4
4
  "dependencies": {
5
5
  "@withease/factories": "^1.0.5"
6
6
  },