@versa-stack/v-craft 1.1.0-alpha.2 → 1.1.0-alpha.3
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/types/components/CraftNodeStatic.vue.d.ts +2 -0
- package/dist/types/components/composable/useCraftFrame.d.ts +15 -0
- package/dist/types/components/composable/useCraftNodeEvents.d.ts +12 -1
- package/dist/types/components/composable/useCraftNodeWrapper.d.ts +15 -0
- package/dist/types/store/editor.d.ts +19 -0
- package/dist/v-craft.es.js +997 -927
- package/dist/v-craft.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,8 @@ type __VLS_Props = {
|
|
|
5
5
|
nodeMap: Map<string, CraftNode>;
|
|
6
6
|
nodeDataMap?: Record<string, CraftNodeDatasource>;
|
|
7
7
|
eventsContext?: Record<string, any>;
|
|
8
|
+
nodeRuntimeProps?: Record<string, Record<string, any>>;
|
|
9
|
+
pageState?: Record<string, any>;
|
|
8
10
|
context?: CraftNodePropsContext;
|
|
9
11
|
};
|
|
10
12
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, any, any>;
|
|
@@ -57,6 +57,8 @@ export declare const useCraftFrame: <T extends FormKitSchemaDefinition = FormKit
|
|
|
57
57
|
eventsContext: Record<string, any>;
|
|
58
58
|
nodeDataMap: Record<string, import('../..').CraftNodeDatasource | null>;
|
|
59
59
|
draggingDisabled: boolean;
|
|
60
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
61
|
+
pageState: Record<string, any>;
|
|
60
62
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => boolean;
|
|
61
63
|
selectedNode: (state: {
|
|
62
64
|
nodeMap: Map<string, {
|
|
@@ -113,6 +115,8 @@ export declare const useCraftFrame: <T extends FormKitSchemaDefinition = FormKit
|
|
|
113
115
|
eventsContext: Record<string, any>;
|
|
114
116
|
nodeDataMap: Record<string, import('../..').CraftNodeDatasource | null>;
|
|
115
117
|
draggingDisabled: boolean;
|
|
118
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
119
|
+
pageState: Record<string, any>;
|
|
116
120
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => import('../..').CraftNode | null;
|
|
117
121
|
selectedRef: (state: {
|
|
118
122
|
nodeMap: Map<string, {
|
|
@@ -169,6 +173,8 @@ export declare const useCraftFrame: <T extends FormKitSchemaDefinition = FormKit
|
|
|
169
173
|
eventsContext: Record<string, any>;
|
|
170
174
|
nodeDataMap: Record<string, import('../..').CraftNodeDatasource | null>;
|
|
171
175
|
draggingDisabled: boolean;
|
|
176
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
177
|
+
pageState: Record<string, any>;
|
|
172
178
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => HTMLElement | null;
|
|
173
179
|
getRef: (state: {
|
|
174
180
|
nodeMap: Map<string, {
|
|
@@ -225,6 +231,8 @@ export declare const useCraftFrame: <T extends FormKitSchemaDefinition = FormKit
|
|
|
225
231
|
eventsContext: Record<string, any>;
|
|
226
232
|
nodeDataMap: Record<string, import('../..').CraftNodeDatasource | null>;
|
|
227
233
|
draggingDisabled: boolean;
|
|
234
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
235
|
+
pageState: Record<string, any>;
|
|
228
236
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => (uuid: string) => HTMLElement;
|
|
229
237
|
allNodes: (state: {
|
|
230
238
|
nodeMap: Map<string, {
|
|
@@ -281,6 +289,8 @@ export declare const useCraftFrame: <T extends FormKitSchemaDefinition = FormKit
|
|
|
281
289
|
eventsContext: Record<string, any>;
|
|
282
290
|
nodeDataMap: Record<string, import('../..').CraftNodeDatasource | null>;
|
|
283
291
|
draggingDisabled: boolean;
|
|
292
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
293
|
+
pageState: Record<string, any>;
|
|
284
294
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => import('../..').CraftNode[];
|
|
285
295
|
getDraggedNode: (state: {
|
|
286
296
|
nodeMap: Map<string, {
|
|
@@ -337,6 +347,8 @@ export declare const useCraftFrame: <T extends FormKitSchemaDefinition = FormKit
|
|
|
337
347
|
eventsContext: Record<string, any>;
|
|
338
348
|
nodeDataMap: Record<string, import('../..').CraftNodeDatasource | null>;
|
|
339
349
|
draggingDisabled: boolean;
|
|
350
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
351
|
+
pageState: Record<string, any>;
|
|
340
352
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => {
|
|
341
353
|
slots: Record<string, import('../..').CraftNode[]>;
|
|
342
354
|
slotsPropsPropsMap?: Record<string, Record<string, string>> | undefined;
|
|
@@ -409,6 +421,8 @@ export declare const useCraftFrame: <T extends FormKitSchemaDefinition = FormKit
|
|
|
409
421
|
eventsContext: Record<string, any>;
|
|
410
422
|
nodeDataMap: Record<string, import('../..').CraftNodeDatasource | null>;
|
|
411
423
|
draggingDisabled: boolean;
|
|
424
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
425
|
+
pageState: Record<string, any>;
|
|
412
426
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => import('../..').CraftNode[];
|
|
413
427
|
}, {
|
|
414
428
|
clear(): void;
|
|
@@ -435,6 +449,7 @@ export declare const useCraftFrame: <T extends FormKitSchemaDefinition = FormKit
|
|
|
435
449
|
insertNodeBefore(node: import('../..').CraftNode, targetNode: import('../..').CraftNode, slotName?: string): void;
|
|
436
450
|
insertNodeAfter(node: import('../..').CraftNode, targetNode: import('../..').CraftNode, slotName?: string): void;
|
|
437
451
|
setEventsContext(context: Record<string, any>): void;
|
|
452
|
+
setNodeRuntimeProps(uuid: string, patch: Record<string, any>): void;
|
|
438
453
|
}>;
|
|
439
454
|
mountNodes: () => void;
|
|
440
455
|
};
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { CraftNode } from '../../lib/craftNode';
|
|
3
|
-
|
|
3
|
+
/** Extra lookups/channels merged into `ctx` for compiled event code. */
|
|
4
|
+
export interface CraftNodeEventsRuntime {
|
|
5
|
+
getNodes?: () => Record<string, CraftNode> | null;
|
|
6
|
+
getNode?: (uuid: string) => CraftNode | null;
|
|
7
|
+
/** Live runtime values captured from value-bearing nodes (e.g. what a user typed), keyed by uuid. */
|
|
8
|
+
nodeValues?: Record<string, Record<string, any>>;
|
|
9
|
+
/** Patch another node's rendered props at runtime, by uuid. */
|
|
10
|
+
setNodeProps?: (uuid: string, patch: Record<string, any>) => void;
|
|
11
|
+
/** Page-scoped bag shared across event handlers, e.g. a pending flag. */
|
|
12
|
+
state?: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export declare const useCraftNodeEvents: (craftNode: Ref<CraftNode>, ctx: Record<string, any>, runtime?: CraftNodeEventsRuntime) => {
|
|
4
15
|
eventHandlers: import('vue').ComputedRef<any>;
|
|
5
16
|
};
|
|
@@ -57,6 +57,8 @@ export declare const useCraftNodeWrapper: (craftNode: Ref<CraftNode>) => {
|
|
|
57
57
|
eventsContext: Record<string, any>;
|
|
58
58
|
nodeDataMap: Record<string, import('../../lib/craftNode').CraftNodeDatasource | null>;
|
|
59
59
|
draggingDisabled: boolean;
|
|
60
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
61
|
+
pageState: Record<string, any>;
|
|
60
62
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => boolean;
|
|
61
63
|
selectedNode: (state: {
|
|
62
64
|
nodeMap: Map<string, {
|
|
@@ -113,6 +115,8 @@ export declare const useCraftNodeWrapper: (craftNode: Ref<CraftNode>) => {
|
|
|
113
115
|
eventsContext: Record<string, any>;
|
|
114
116
|
nodeDataMap: Record<string, import('../../lib/craftNode').CraftNodeDatasource | null>;
|
|
115
117
|
draggingDisabled: boolean;
|
|
118
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
119
|
+
pageState: Record<string, any>;
|
|
116
120
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => CraftNode | null;
|
|
117
121
|
selectedRef: (state: {
|
|
118
122
|
nodeMap: Map<string, {
|
|
@@ -169,6 +173,8 @@ export declare const useCraftNodeWrapper: (craftNode: Ref<CraftNode>) => {
|
|
|
169
173
|
eventsContext: Record<string, any>;
|
|
170
174
|
nodeDataMap: Record<string, import('../../lib/craftNode').CraftNodeDatasource | null>;
|
|
171
175
|
draggingDisabled: boolean;
|
|
176
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
177
|
+
pageState: Record<string, any>;
|
|
172
178
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => HTMLElement | null;
|
|
173
179
|
getRef: (state: {
|
|
174
180
|
nodeMap: Map<string, {
|
|
@@ -225,6 +231,8 @@ export declare const useCraftNodeWrapper: (craftNode: Ref<CraftNode>) => {
|
|
|
225
231
|
eventsContext: Record<string, any>;
|
|
226
232
|
nodeDataMap: Record<string, import('../../lib/craftNode').CraftNodeDatasource | null>;
|
|
227
233
|
draggingDisabled: boolean;
|
|
234
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
235
|
+
pageState: Record<string, any>;
|
|
228
236
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => (uuid: string) => HTMLElement;
|
|
229
237
|
allNodes: (state: {
|
|
230
238
|
nodeMap: Map<string, {
|
|
@@ -281,6 +289,8 @@ export declare const useCraftNodeWrapper: (craftNode: Ref<CraftNode>) => {
|
|
|
281
289
|
eventsContext: Record<string, any>;
|
|
282
290
|
nodeDataMap: Record<string, import('../../lib/craftNode').CraftNodeDatasource | null>;
|
|
283
291
|
draggingDisabled: boolean;
|
|
292
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
293
|
+
pageState: Record<string, any>;
|
|
284
294
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => CraftNode[];
|
|
285
295
|
getDraggedNode: (state: {
|
|
286
296
|
nodeMap: Map<string, {
|
|
@@ -337,6 +347,8 @@ export declare const useCraftNodeWrapper: (craftNode: Ref<CraftNode>) => {
|
|
|
337
347
|
eventsContext: Record<string, any>;
|
|
338
348
|
nodeDataMap: Record<string, import('../../lib/craftNode').CraftNodeDatasource | null>;
|
|
339
349
|
draggingDisabled: boolean;
|
|
350
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
351
|
+
pageState: Record<string, any>;
|
|
340
352
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => {
|
|
341
353
|
slots: Record<string, CraftNode[]>;
|
|
342
354
|
slotsPropsPropsMap?: Record<string, Record<string, string>> | undefined;
|
|
@@ -409,6 +421,8 @@ export declare const useCraftNodeWrapper: (craftNode: Ref<CraftNode>) => {
|
|
|
409
421
|
eventsContext: Record<string, any>;
|
|
410
422
|
nodeDataMap: Record<string, import('../../lib/craftNode').CraftNodeDatasource | null>;
|
|
411
423
|
draggingDisabled: boolean;
|
|
424
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
425
|
+
pageState: Record<string, any>;
|
|
412
426
|
} & import('pinia').PiniaCustomStateProperties<import('../../store/editor').EditorState>) => CraftNode[];
|
|
413
427
|
}, {
|
|
414
428
|
clear(): void;
|
|
@@ -435,6 +449,7 @@ export declare const useCraftNodeWrapper: (craftNode: Ref<CraftNode>) => {
|
|
|
435
449
|
insertNodeBefore(node: CraftNode, targetNode: CraftNode, slotName?: string): void;
|
|
436
450
|
insertNodeAfter(node: CraftNode, targetNode: CraftNode, slotName?: string): void;
|
|
437
451
|
setEventsContext(context: Record<string, any>): void;
|
|
452
|
+
setNodeRuntimeProps(uuid: string, patch: Record<string, any>): void;
|
|
438
453
|
}> | null;
|
|
439
454
|
craftNode: Ref<CraftNode, CraftNode>;
|
|
440
455
|
enabled: import('vue').ComputedRef<any>;
|
|
@@ -13,6 +13,10 @@ export interface EditorState {
|
|
|
13
13
|
eventsContext: Record<string, any>;
|
|
14
14
|
nodeDataMap: Record<string, CraftNodeDatasource | null>;
|
|
15
15
|
draggingDisabled: boolean;
|
|
16
|
+
/** Live runtime props written by event handlers or captured from value-bearing nodes, by uuid. */
|
|
17
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
18
|
+
/** Page-scoped bag shared across event handlers, e.g. a pending flag. */
|
|
19
|
+
pageState: Record<string, any>;
|
|
16
20
|
}
|
|
17
21
|
export declare const useEditor: import('pinia').StoreDefinition<"editor", EditorState, {
|
|
18
22
|
hasNodes: (state: {
|
|
@@ -70,6 +74,8 @@ export declare const useEditor: import('pinia').StoreDefinition<"editor", Editor
|
|
|
70
74
|
eventsContext: Record<string, any>;
|
|
71
75
|
nodeDataMap: Record<string, CraftNodeDatasource | null>;
|
|
72
76
|
draggingDisabled: boolean;
|
|
77
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
78
|
+
pageState: Record<string, any>;
|
|
73
79
|
} & import('pinia').PiniaCustomStateProperties<EditorState>) => boolean;
|
|
74
80
|
selectedNode: (state: {
|
|
75
81
|
nodeMap: Map<string, {
|
|
@@ -126,6 +132,8 @@ export declare const useEditor: import('pinia').StoreDefinition<"editor", Editor
|
|
|
126
132
|
eventsContext: Record<string, any>;
|
|
127
133
|
nodeDataMap: Record<string, CraftNodeDatasource | null>;
|
|
128
134
|
draggingDisabled: boolean;
|
|
135
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
136
|
+
pageState: Record<string, any>;
|
|
129
137
|
} & import('pinia').PiniaCustomStateProperties<EditorState>) => CraftNode | null;
|
|
130
138
|
selectedRef: (state: {
|
|
131
139
|
nodeMap: Map<string, {
|
|
@@ -182,6 +190,8 @@ export declare const useEditor: import('pinia').StoreDefinition<"editor", Editor
|
|
|
182
190
|
eventsContext: Record<string, any>;
|
|
183
191
|
nodeDataMap: Record<string, CraftNodeDatasource | null>;
|
|
184
192
|
draggingDisabled: boolean;
|
|
193
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
194
|
+
pageState: Record<string, any>;
|
|
185
195
|
} & import('pinia').PiniaCustomStateProperties<EditorState>) => HTMLElement | null;
|
|
186
196
|
getRef: (state: {
|
|
187
197
|
nodeMap: Map<string, {
|
|
@@ -238,6 +248,8 @@ export declare const useEditor: import('pinia').StoreDefinition<"editor", Editor
|
|
|
238
248
|
eventsContext: Record<string, any>;
|
|
239
249
|
nodeDataMap: Record<string, CraftNodeDatasource | null>;
|
|
240
250
|
draggingDisabled: boolean;
|
|
251
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
252
|
+
pageState: Record<string, any>;
|
|
241
253
|
} & import('pinia').PiniaCustomStateProperties<EditorState>) => (uuid: string) => HTMLElement;
|
|
242
254
|
allNodes: (state: {
|
|
243
255
|
nodeMap: Map<string, {
|
|
@@ -294,6 +306,8 @@ export declare const useEditor: import('pinia').StoreDefinition<"editor", Editor
|
|
|
294
306
|
eventsContext: Record<string, any>;
|
|
295
307
|
nodeDataMap: Record<string, CraftNodeDatasource | null>;
|
|
296
308
|
draggingDisabled: boolean;
|
|
309
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
310
|
+
pageState: Record<string, any>;
|
|
297
311
|
} & import('pinia').PiniaCustomStateProperties<EditorState>) => CraftNode[];
|
|
298
312
|
getDraggedNode: (state: {
|
|
299
313
|
nodeMap: Map<string, {
|
|
@@ -350,6 +364,8 @@ export declare const useEditor: import('pinia').StoreDefinition<"editor", Editor
|
|
|
350
364
|
eventsContext: Record<string, any>;
|
|
351
365
|
nodeDataMap: Record<string, CraftNodeDatasource | null>;
|
|
352
366
|
draggingDisabled: boolean;
|
|
367
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
368
|
+
pageState: Record<string, any>;
|
|
353
369
|
} & import('pinia').PiniaCustomStateProperties<EditorState>) => {
|
|
354
370
|
slots: Record<string, CraftNode[]>;
|
|
355
371
|
slotsPropsPropsMap?: Record<string, Record<string, string>> | undefined;
|
|
@@ -422,6 +438,8 @@ export declare const useEditor: import('pinia').StoreDefinition<"editor", Editor
|
|
|
422
438
|
eventsContext: Record<string, any>;
|
|
423
439
|
nodeDataMap: Record<string, CraftNodeDatasource | null>;
|
|
424
440
|
draggingDisabled: boolean;
|
|
441
|
+
nodeRuntimeProps: Record<string, Record<string, any>>;
|
|
442
|
+
pageState: Record<string, any>;
|
|
425
443
|
} & import('pinia').PiniaCustomStateProperties<EditorState>) => CraftNode[];
|
|
426
444
|
}, {
|
|
427
445
|
clear(): void;
|
|
@@ -448,4 +466,5 @@ export declare const useEditor: import('pinia').StoreDefinition<"editor", Editor
|
|
|
448
466
|
insertNodeBefore(node: CraftNode, targetNode: CraftNode, slotName?: string): void;
|
|
449
467
|
insertNodeAfter(node: CraftNode, targetNode: CraftNode, slotName?: string): void;
|
|
450
468
|
setEventsContext(context: Record<string, any>): void;
|
|
469
|
+
setNodeRuntimeProps(uuid: string, patch: Record<string, any>): void;
|
|
451
470
|
}>;
|