@picked/svelte 0.0.34 → 0.0.35-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.
- package/dist/hooks/step.js +1 -1
- package/package.json +2 -2
package/dist/hooks/step.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getContext as
|
|
1
|
+
import{getContext as x,setContext as E}from"svelte";import{createStore as h,combine as l,attach as w,createEffect as A,sample as c}from"effector";import{getStepFields as C}from"@picked/client";import{STEP_CONTEXT_KEY as u}from"../context.js";import{getStepRouter as F}from"../router/context.js";import{getExperience as T,getPicked as k}from"./client.js";function N(){return x(u)}function O(i){const S=T(),o=k(),{activeStep:d}=F(),s=d.map(e=>(e==null?void 0:e.id)===i),p=S.treeStore.map(e=>{const t=e.steps.find(r=>r.id===i);if(!t)throw new Error(`Step with id "${i}" not found in the experience tree.`);return t}),f=h([]),m=l({fields:f,responses:o.responses.listStore},({fields:e,responses:t})=>e.map(r=>{var a;const g=(a=t.find(v=>v.fieldId===r.id))==null?void 0:a.value;return{...r,value:g}})),n=w({source:l({step:p,fields:o.fields.listStore}),effect:A(async({step:{fieldIds:e},fields:t})=>await C(o,t.filter(r=>e.includes(r.id))))});return c({source:{isActiveStep:s},filter:({isActiveStep:e})=>e,target:n}),c({clock:o.responses.listStore,source:{isActiveStep:s},filter:({isActiveStep:e})=>e,target:n}),c({source:n.doneData,target:f}),E(u,{step:p,fields:m,isActiveStep:s})}export{N as getStep,O as setStepContext};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/svelte",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35-next.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"d3": "^7.9.0"
|
|
6
6
|
},
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"module": "./dist/index.js",
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@picked/client": "0.0.
|
|
78
|
+
"@picked/client": "0.0.35-next.1",
|
|
79
79
|
"effector": "^23.3.0",
|
|
80
80
|
"svelte": "^5.34.3"
|
|
81
81
|
},
|