@picked/svelte 0.0.1-dev.1778468342672 → 0.0.1-dev.1778730134956

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,13 +1,25 @@
1
1
  import { Picked, ExperienceInstance } from '@picked/client';
2
2
  /**
3
- * Retrieves the Picked Client for the Experience Instance
3
+ * Retrieves the Picked Client for the Experience Instance.
4
4
  *
5
- * @returns The Picked client instance that provides access to experiences, steps, and other Picked functionality
5
+ * @returns The Picked client instance that provides access to experiences, steps, and other Picked functionality.
6
+ * @example
7
+ * const client = getPicked()
6
8
  */
7
9
  export declare function getPicked(): Picked;
8
10
  /**
9
- * Retrieves the Experience Store for the current Experience Instance
11
+ * Retrieves the Experience Store for the current Experience Instance.
10
12
  *
11
- * @returns The Experience store instance that provides access to experience configuration and state
13
+ * The returned instance exposes `restart` and `isResumableStore` for SDK-native
14
+ * resume/restart flows: call `instance.restart()` to atomically clear this
15
+ * experience's history and owned responses, and subscribe to
16
+ * `instance.isResumableStore` (via the `$` prefix) to render a
17
+ * "continue / start over" prompt when the user has in-progress state.
18
+ *
19
+ * @returns The Experience store instance that provides access to experience configuration and state.
20
+ * @example
21
+ * const experience = getExperience()
22
+ * const canResume = experience.isResumableStore
23
+ * // in markup: {#if $canResume}…{/if}
12
24
  */
13
25
  export declare function getExperience(): ExperienceInstance;
@@ -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{createStore as r}from"effector";import{getContext as i,setContext as a}from"svelte";import{createForm as o}from"../form/create-form.svelte";var s=r(null,{skipVoid:!1});function c(r){let i=t(),{activeStep:c}=n(),l=c.map(e=>e?.key===r),u=i.steps.listStore.map(e=>e.find(e=>e.key===r)??{id:r,key:r,name:``,fieldKeys:[]}),d=o(r,u.map(e=>e.name),u.map(e=>e.fieldKeys));return a(e,{step:u,layoutContentStore:u.getState().layoutContentStore??s,isActive:l,isActiveStep:l,...d})}function l(){return i(e)}function u(){let{layoutContentStore:e}=l();return e.map(e=>e?.data??null,{skipVoid:!1})}export{l as getStep,u as getStepContent,c 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{combine as r}from"effector";import{getContext as i,setContext as a}from"svelte";import{createForm as o}from"../form/create-form.svelte";function s(i){let s=t(),{activeStep:c}=n(),l=c.map(e=>e?.key===i),u=s.steps.listStore.map(e=>e.find(e=>e.key===i)??{id:i,key:i,name:``,fieldKeys:[]}),d=o(i,u.map(e=>e.name),u.map(e=>e.fieldKeys));return a(e,{step:u,layoutContentStore:r(u,s.contents.indexStore,(e,t)=>e.layoutContentId?t[e.layoutContentId]??null:null,{skipVoid:!1}),isActive:l,isActiveStep:l,...d})}function c(){return i(e)}function l(){let{layoutContentStore:e}=c();return e.map(e=>e?.data??null,{skipVoid:!1})}export{c as getStep,l as getStepContent,s as setStepContext};
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  /** @file Editable table row for a single field response in the devtools responses screen. */
3
- import type { ResponseListItem, PrimitiveFieldValue, Field } from '@picked/client'
3
+ import type { ResponseListItem, PrimitiveFieldValue, Field, FieldValue } from '@picked/client'
4
4
  import { getPicked } from '../../../../hooks'
5
5
  import { Button, Text, CodeBlock, Banner, Stack } from '../../ui'
6
6
 
@@ -197,7 +197,7 @@
197
197
  * ```
198
198
  */
199
199
  function handleClear() {
200
- client.responses.clear(field.id)
200
+ client.responses.clear(field.key)
201
201
  }
202
202
  </script>
203
203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/svelte",
3
- "version": "0.0.1-dev.1778468342672",
3
+ "version": "0.0.1-dev.1778730134956",
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.1778468342672",
91
+ "@picked/client": "0.0.1-dev.1778730134956",
92
92
  "effector": "^23.3.0",
93
93
  "svelte": "^5.46.4"
94
94
  },