@picked/svelte 0.0.1-dev.1778468342672 → 0.0.1-dev.1778561735098
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/index.d.ts +1 -2
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/step.d.ts +2 -25
- package/dist/hooks/step.js +1 -1
- package/dist/plugins/devtools/screens/history/HistoryEntriesTable.svelte +3 -2
- package/dist/plugins/devtools/screens/history/HistoryEntryListItem.svelte +2 -2
- package/package.json +2 -2
- package/dist/hooks/content.d.ts +0 -18
- package/dist/hooks/content.js +0 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ export { getPicked, getExperience } from './client';
|
|
|
3
3
|
export { getPredicate, getPredicateResult } from './predicate';
|
|
4
4
|
export { getFeature, getFeatureResult } from './feature';
|
|
5
5
|
export { getAction, getActionResult } from './action';
|
|
6
|
-
export { getStep, setStepContext
|
|
7
|
-
export { getContent } from './content';
|
|
6
|
+
export { getStep, setStepContext } from './step';
|
|
8
7
|
export { useUnit, getContextScope, setContextScope } from './stores';
|
|
9
8
|
export { createSessionStorageStore, createLocalStorageStore } from './storage.js';
|
|
10
9
|
export { getTrackRecommendationPresentEvent } from './events';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getExperience as e,getPicked as t}from"./client.js";import{getPredicate as n,getPredicateResult as r}from"./predicate.js";import{getFeature as i,getFeatureResult as a}from"./feature.js";import{getAction as o,getActionResult as s}from"./action.js";import{getStep as c,
|
|
1
|
+
import{getExperience as e,getPicked as t}from"./client.js";import{getPredicate as n,getPredicateResult as r}from"./predicate.js";import{getFeature as i,getFeatureResult as a}from"./feature.js";import{getAction as o,getActionResult as s}from"./action.js";import{getStep as c,setStepContext as l}from"./step.js";import{getContextScope as u,setContextScope as d,useUnit as f}from"./stores.js";import{createLocalStorageStore as p,createSessionStorageStore as m}from"./storage.js";import{getTrackRecommendationPresentEvent as h}from"./events.js";import{createQuery as g,queryCache as _,queryPresets as v}from"./create-query/index.js";export{p as createLocalStorageStore,g as createQuery,m as createSessionStorageStore,o as getAction,s as getActionResult,u as getContextScope,e as getExperience,i as getFeature,a as getFeatureResult,t as getPicked,n as getPredicate,r as getPredicateResult,c as getStep,h as getTrackRecommendationPresentEvent,_ as queryCache,v as queryPresets,d as setContextScope,l as setStepContext,f as useUnit};
|
package/dist/hooks/step.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { Store } from 'effector';
|
|
2
|
-
import {
|
|
2
|
+
import { ExperienceStep } from '@picked/client';
|
|
3
3
|
import { FormInstance, FormField } from '../form/create-form.svelte';
|
|
4
4
|
export interface StepContext extends FormInstance {
|
|
5
5
|
step: Store<ExperienceStep>;
|
|
6
6
|
/** Directly accessible fields with current response values — usable without a form. */
|
|
7
7
|
fields: Store<FormField[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Reactive store of the current step's CMS layout content. Resolves the step's
|
|
10
|
-
* `layoutContentId` against `client.contents` and stays reactive.
|
|
11
|
-
*/
|
|
12
|
-
layoutContentStore: Store<Content | null>;
|
|
13
8
|
isActive: Store<boolean>;
|
|
14
9
|
/** @deprecated Use `isActive` instead. */
|
|
15
10
|
isActiveStep: Store<boolean>;
|
|
@@ -17,31 +12,13 @@ export interface StepContext extends FormInstance {
|
|
|
17
12
|
/**
|
|
18
13
|
* Creates and sets step context in the Svelte context tree.
|
|
19
14
|
*
|
|
20
|
-
* @param
|
|
21
|
-
* @returns {StepContext} The created step context.
|
|
15
|
+
* @param stepKey - The step key.
|
|
22
16
|
* @example setStepContext('step-1')
|
|
23
17
|
*/
|
|
24
18
|
export declare function setStepContext(stepKey: string): StepContext;
|
|
25
19
|
/**
|
|
26
20
|
* Retrieves the step context from the Svelte context tree.
|
|
27
21
|
*
|
|
28
|
-
* @returns {StepContext} The current step context.
|
|
29
22
|
* @example getStep()
|
|
30
23
|
*/
|
|
31
24
|
export declare function getStep(): StepContext;
|
|
32
|
-
/**
|
|
33
|
-
* Returns a Svelte/Effector store that yields the current step's resolved CMS content
|
|
34
|
-
* data, or `null` when no content is registered for the step's `layoutContentId`.
|
|
35
|
-
* Subscribers automatically receive updates when content is registered or replaced.
|
|
36
|
-
*
|
|
37
|
-
* @returns {Store<Record<string, unknown> | null>} A store of the Content record's `data`.
|
|
38
|
-
* @example
|
|
39
|
-
* ```svelte
|
|
40
|
-
* <script>
|
|
41
|
-
* import { getStepContent } from '@picked/svelte'
|
|
42
|
-
* const content = getStepContent()
|
|
43
|
-
* </script>
|
|
44
|
-
* <h1>{$content?.headline ?? ''}</h1>
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export declare function getStepContent(): Store<Record<string, unknown> | null>;
|
package/dist/hooks/step.js
CHANGED
|
@@ -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{
|
|
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:``,fieldKeys:[]});return i(e,{step:l,isActive:c,isActiveStep:c,...a(r,l.map(e=>e.name),l.map(e=>e.fieldKeys))})}function s(){return r(e)}export{s as getStep,o as setStepContext};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
<script lang="ts"
|
|
1
|
+
<script lang="ts">/** @file Devtools table that lists history entries for the current Picked client. */
|
|
2
2
|
import type { HistoryEntry } from '@picked/client'
|
|
3
|
-
import HistoryEntryListItem from './HistoryEntryListItem.svelte'
|
|
4
3
|
import { Card, DataTable, EmptyState, Stack } from '../../ui'
|
|
4
|
+
import HistoryEntryListItem from './HistoryEntryListItem.svelte'
|
|
5
5
|
|
|
6
6
|
export let historyEntries: HistoryEntry[]
|
|
7
7
|
|
|
8
8
|
const columns = [
|
|
9
9
|
{ key: 'id', header: 'ID' },
|
|
10
|
+
{ key: 'instanceId', header: 'Instance ID' },
|
|
10
11
|
{ key: 'experienceId', header: 'Experience ID' },
|
|
11
12
|
{ key: 'nodeId', header: 'Node ID' },
|
|
12
13
|
{ key: 'nodeType', header: 'Node Type' },
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
/** @file List item row displaying a navigation history entry in the devtools history screen. */
|
|
1
|
+
<script lang="ts">/** @file List item row displaying a navigation history entry in the devtools history screen. */
|
|
3
2
|
import type { HistoryEntry } from '@picked/client'
|
|
4
3
|
import { getPicked } from '../../../../hooks'
|
|
5
4
|
|
|
@@ -12,6 +11,7 @@
|
|
|
12
11
|
|
|
13
12
|
<tr>
|
|
14
13
|
<td>{historyEntry.id}</td>
|
|
14
|
+
<td>{historyEntry.instanceId}</td>
|
|
15
15
|
<td>{experienceName}</td>
|
|
16
16
|
<td>{historyEntry.node.id}</td>
|
|
17
17
|
<td>{historyEntry.node.type}</td>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/svelte",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1778561735098",
|
|
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.
|
|
91
|
+
"@picked/client": "0.0.1-dev.1778561735098",
|
|
92
92
|
"effector": "^23.3.0",
|
|
93
93
|
"svelte": "^5.46.4"
|
|
94
94
|
},
|
package/dist/hooks/content.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Store } from 'effector';
|
|
2
|
-
import { Content } from '@picked/client';
|
|
3
|
-
/**
|
|
4
|
-
* Returns the registry store for a content id, mirroring `getField(key)`. Resolves
|
|
5
|
-
* the Picked client via `getPicked()` and returns `client.contents.getById(id)`.
|
|
6
|
-
*
|
|
7
|
-
* @param {string} id - The content record id to look up.
|
|
8
|
-
* @returns {Store<Content | null>} The registry store; `null` until content is registered.
|
|
9
|
-
* @example
|
|
10
|
-
* ```svelte
|
|
11
|
-
* <script>
|
|
12
|
-
* import { getContent } from '@picked/svelte'
|
|
13
|
-
* const banner = getContent('lc_banner')
|
|
14
|
-
* </script>
|
|
15
|
-
* <h1>{$banner?.data?.headline ?? ''}</h1>
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function getContent(id: string): Store<Content | null>;
|
package/dist/hooks/content.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getPicked as e}from"./client.js";function t(t){return e().contents.getById(t)}export{t as getContent};
|