@picked/svelte 0.0.1-dev.1774995194828 → 0.0.1-dev.1775010167310
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/field.js +1 -1
- package/dist/hooks/step.d.ts +2 -2
- package/dist/hooks/step.js +1 -1
- package/dist/plugins/devtools/components/ExperienceInstanceListItem.svelte +1 -1
- package/dist/plugins/devtools/screens/events/EventListItem.svelte +13 -7
- package/dist/plugins/devtools/screens/experiences/ExperienceTreeScreen.svelte +6 -6
- package/dist/plugins/devtools/screens/history/HistoryEntryListItem.svelte +1 -1
- package/dist/utils/ErrorBoundary.svelte +1 -1
- package/package.json +2 -2
package/dist/hooks/field.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getPicked as e}from"./client.js";function t(t){let n=e();return{field:n.fields.
|
|
1
|
+
import{getPicked as e}from"./client.js";function t(t){let n=e();return{field:n.fields.getByKey(t),value:n.responses.getByFieldKey(t)}}export{t as getField};
|
package/dist/hooks/step.d.ts
CHANGED
|
@@ -12,10 +12,10 @@ export interface StepContext extends FormInstance {
|
|
|
12
12
|
/**
|
|
13
13
|
* Creates and sets step context in the Svelte context tree.
|
|
14
14
|
*
|
|
15
|
-
* @param
|
|
15
|
+
* @param stepKey - The step key.
|
|
16
16
|
* @example setStepContext('step-1')
|
|
17
17
|
*/
|
|
18
|
-
export declare function setStepContext(
|
|
18
|
+
export declare function setStepContext(stepKey: string): StepContext;
|
|
19
19
|
/**
|
|
20
20
|
* Retrieves the step context from the Svelte context tree.
|
|
21
21
|
*
|
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:``,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};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export let experienceInstance: ExperienceInstance
|
|
8
8
|
|
|
9
9
|
const client = getPicked()
|
|
10
|
-
const experienceStore = client.experiences.
|
|
10
|
+
const experienceStore = client.experiences.getById(experienceInstance.experienceId)
|
|
11
11
|
|
|
12
12
|
const currentNode = experienceInstance.currentNodeStore
|
|
13
13
|
const currentStep = experienceInstance.currentStepStore
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
'experience' in event.payload && event.payload.experience
|
|
15
15
|
? event.payload.experience.experienceId
|
|
16
16
|
: undefined
|
|
17
|
-
const eventExperienceStore = client.experiences.
|
|
17
|
+
const eventExperienceStore = client.experiences.getById(eventExpId ?? '')
|
|
18
18
|
$: eventExpName = eventExpId
|
|
19
19
|
? ($eventExperienceStore?.name ?? eventExpId)
|
|
20
20
|
: '-'
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
/**
|
|
23
23
|
* Formats a Date as a 24-hour time string with milliseconds.
|
|
24
24
|
*
|
|
25
|
-
* @param date - The date to format.
|
|
25
|
+
* @param {Date} date - The date to format.
|
|
26
|
+
* @returns {string} The formatted time string.
|
|
26
27
|
* @example
|
|
27
28
|
* ```typescript
|
|
28
29
|
* formatTime(new Date()) // '14:30:05.123'
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
/**
|
|
47
48
|
* Extracts experience-related fields from an event payload's experience object.
|
|
48
49
|
*
|
|
49
|
-
* @param exp - The experience object from the event payload.
|
|
50
|
+
* @param {unknown} exp - The experience object from the event payload.
|
|
51
|
+
* @returns {PayloadField[]} Extracted experience fields.
|
|
50
52
|
* @example
|
|
51
53
|
* ```typescript
|
|
52
54
|
* getExperienceFields({ id: 'abc', experienceId: 'quiz' })
|
|
@@ -65,7 +67,8 @@
|
|
|
65
67
|
/**
|
|
66
68
|
* Extracts step-related fields from an event payload's step object.
|
|
67
69
|
*
|
|
68
|
-
* @param step - The step object from the event payload.
|
|
70
|
+
* @param {unknown} step - The step object from the event payload.
|
|
71
|
+
* @returns {PayloadField[]} Extracted step fields.
|
|
69
72
|
* @example
|
|
70
73
|
* ```typescript
|
|
71
74
|
* getStepFields({ id: 's1', name: 'Welcome' })
|
|
@@ -103,7 +106,8 @@
|
|
|
103
106
|
/**
|
|
104
107
|
* Extracts scalar (non-nested) fields from an event bus payload.
|
|
105
108
|
*
|
|
106
|
-
* @param payload - The event bus payload to extract scalar fields from.
|
|
109
|
+
* @param {EventBusPayload} payload - The event bus payload to extract scalar fields from.
|
|
110
|
+
* @returns {PayloadField[]} Extracted scalar fields.
|
|
107
111
|
* @example
|
|
108
112
|
* ```typescript
|
|
109
113
|
* getScalarFields({ type: 'step', value: 42 })
|
|
@@ -127,7 +131,8 @@
|
|
|
127
131
|
/**
|
|
128
132
|
* Builds a flat list of display fields from an event bus payload.
|
|
129
133
|
*
|
|
130
|
-
* @param payload - The event bus payload to extract fields from.
|
|
134
|
+
* @param {EventBusPayload} payload - The event bus payload to extract fields from.
|
|
135
|
+
* @returns {PayloadField[]} All extracted fields.
|
|
131
136
|
* @example
|
|
132
137
|
* ```typescript
|
|
133
138
|
* getPayloadFields({ type: 'session', id: 'sess-1' })
|
|
@@ -156,7 +161,8 @@
|
|
|
156
161
|
/**
|
|
157
162
|
* Formats a field value for display as a string.
|
|
158
163
|
*
|
|
159
|
-
* @param value - The value to format.
|
|
164
|
+
* @param {unknown} value - The value to format.
|
|
165
|
+
* @returns {string} The formatted string representation.
|
|
160
166
|
* @example
|
|
161
167
|
* ```typescript
|
|
162
168
|
* formatValue(42) // '42'
|
|
@@ -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?.
|
|
251
|
-
if (edge?.
|
|
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?.
|
|
280
|
-
if (edge?.
|
|
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?.
|
|
292
|
-
if (edge?.
|
|
291
|
+
if (edge?.sourceHandle === 'true') return 'Yes'
|
|
292
|
+
if (edge?.sourceHandle === 'false') return 'No'
|
|
293
293
|
return ''
|
|
294
294
|
})
|
|
295
295
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export let historyEntry: HistoryEntry
|
|
7
7
|
|
|
8
8
|
const client = getPicked()
|
|
9
|
-
const experienceStore = client.experiences.
|
|
9
|
+
const experienceStore = client.experiences.getById(historyEntry.experienceId)
|
|
10
10
|
$: experienceName = $experienceStore?.name ?? historyEntry.experienceId
|
|
11
11
|
</script>
|
|
12
12
|
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const { component: InnerComponent, componentProps }: Props = $props()
|
|
11
|
+
const client = getPicked()
|
|
11
12
|
|
|
12
13
|
function handleError(error: unknown) {
|
|
13
|
-
const client = getPicked()
|
|
14
14
|
|
|
15
15
|
// We still log to console for visibility during development
|
|
16
16
|
// eslint-disable-next-line no-console
|
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.1775010167310",
|
|
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.1775010167310",
|
|
92
92
|
"effector": "^23.3.0",
|
|
93
93
|
"svelte": "^5.46.4"
|
|
94
94
|
},
|