@picked/svelte 0.0.1-dev.1775004084041 → 0.0.1-dev.1775015576394

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.
@@ -1 +1 @@
1
- import{STEP_CONTEXT_KEY as e}from"../context.js";import{getPicked as t}from"./client.js";import{getStepRouter as n}from"../router/context.js";import{getStepFields as r}from"@picked/client/form";import{attach as i,combine as a,createEffect as o,createStore as s,sample as c}from"effector";import{getContext as l,setContext as u}from"svelte";import{createForm as d}from"../form/create-form.svelte";function f(l){let f=t(),{activeStep:p}=n(),m=p.map(e=>e?.key===l),h=f.steps.listStore.map(e=>e.find(e=>e.key===l)??{id:l,key:l,name:``,fieldIds:[]}),g=s([]),_=i({source:a({step:h,fields:f.fields.listStore}),mapParams:(e,t)=>t,effect:o(async({step:e,fields:t})=>await r(f,t.filter(t=>e.fieldIds.includes(t.id)||e.fieldIds.includes(t.key))))});c({source:{isActiveStep:m},filter:({isActiveStep:e})=>e,target:_}),c({clock:f.responses.listStore,source:{isActiveStep:m},filter:({isActiveStep:e})=>e,target:_}),c({source:_.doneData,target:g});let v=g.map(e=>e.map(e=>e.key));return u(e,{step:h,isActive:m,isActiveStep:m,...d(l,h.map(e=>e.name),v)})}function p(){return l(e)}export{p as getStep,f as setStepContext};
1
+ import{STEP_CONTEXT_KEY as e}from"../context.js";import{getPicked as t}from"./client.js";import{getStepRouter as n}from"../router/context.js";import{getContext as r,setContext as i}from"svelte";import{createForm as a}from"../form/create-form.svelte";function o(r){let o=t(),{activeStep:s}=n(),c=s.map(e=>e?.key===r),l=o.steps.listStore.map(e=>e.find(e=>e.key===r)??{id:r,key:r,name:``,fieldIds:[]});return i(e,{step:l,isActive:c,isActiveStep:c,...a(r,l.map(e=>e.name),l.map(e=>e.fieldIds))})}function s(){return r(e)}export{s as getStep,o as setStepContext};
@@ -19,10 +19,6 @@
19
19
 
20
20
  <Card sectioned>
21
21
  <Stack direction="vertical" gap="medium" padding="medium">
22
- <div>
23
- <Text weight="semibold">Type</Text>
24
- <Text>{$config.type}</Text>
25
- </div>
26
22
 
27
23
  <div>
28
24
  <Text weight="semibold">Target selectors</Text>
@@ -247,8 +247,8 @@
247
247
  const edge = d.source.data._originalEdges.find(
248
248
  (e: ExperienceEdge) => e.destinationNodeId === targetId,
249
249
  )
250
- if (edge?.sourceNodeHandle === 'true') return '#10b981'
251
- if (edge?.sourceNodeHandle === 'false') return '#ef4444'
250
+ if (edge?.sourceHandle === 'true') return '#10b981'
251
+ if (edge?.sourceHandle === 'false') return '#ef4444'
252
252
  return '#94a3b8'
253
253
  })
254
254
  .attr('stroke-width', 2)
@@ -276,8 +276,8 @@
276
276
  const edge = d.source.data._originalEdges.find(
277
277
  (e: ExperienceEdge) => e.destinationNodeId === targetId,
278
278
  )
279
- if (edge?.sourceNodeHandle === 'true') return '#10b981'
280
- if (edge?.sourceNodeHandle === 'false') return '#ef4444'
279
+ if (edge?.sourceHandle === 'true') return '#10b981'
280
+ if (edge?.sourceHandle === 'false') return '#ef4444'
281
281
  return '#64748b'
282
282
  })
283
283
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- D3 callback types are untyped
@@ -288,8 +288,8 @@
288
288
  const edge = d.source.data._originalEdges.find(
289
289
  (e: ExperienceEdge) => e.destinationNodeId === targetId,
290
290
  )
291
- if (edge?.sourceNodeHandle === 'true') return 'Yes'
292
- if (edge?.sourceNodeHandle === 'false') return 'No'
291
+ if (edge?.sourceHandle === 'true') return 'Yes'
292
+ if (edge?.sourceHandle === 'false') return 'No'
293
293
  return ''
294
294
  })
295
295
 
@@ -5,26 +5,21 @@
5
5
  import { getStepRouter } from './context'
6
6
 
7
7
  interface Props {
8
- /** Preferred prop: the step key used for registration and lookup. */
9
- key?: string
10
- /** @deprecated Use `key` instead. Accepted for backwards compatibility. */
11
- id?: string
8
+ key: string
12
9
  component?: Component | Promise<Component> | Promise<{ default: Component }>
13
10
  children?: Snippet
14
11
  }
15
12
 
16
- const { key, id, component, children }: Props = $props()
13
+ const { key, component, children }: Props = $props()
17
14
 
18
- const resolvedKey = key ?? id ?? ''
19
15
 
20
16
  const step = {
21
- id: resolvedKey,
22
- key: resolvedKey,
17
+ key,
23
18
  }
24
19
 
25
20
  const { registerStep, unregisterStep } = getStepRouter()
26
21
 
27
- setStepContext(resolvedKey)
22
+ setStepContext(key)
28
23
 
29
24
  $effect(() => {
30
25
  registerStep(step)
@@ -1,6 +1,5 @@
1
1
  import { Store } from 'effector';
2
2
  export interface Step {
3
- id: string;
4
3
  key: string;
5
4
  }
6
5
  interface ContextOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/svelte",
3
- "version": "0.0.1-dev.1775004084041",
3
+ "version": "0.0.1-dev.1775015576394",
4
4
  "dependencies": {
5
5
  "d3": "^7.9.0"
6
6
  },
@@ -88,7 +88,7 @@
88
88
  },
89
89
  "module": "./dist/index.js",
90
90
  "peerDependencies": {
91
- "@picked/client": "0.0.1-dev.1775004084041",
91
+ "@picked/client": "0.0.1-dev.1775015576394",
92
92
  "effector": "^23.3.0",
93
93
  "svelte": "^5.46.4"
94
94
  },