@dragcraft/renderer 0.0.1
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/LICENSE +21 -0
- package/dist/index.d.mts +1419 -0
- package/dist/index.mjs +2590 -0
- package/dist/structure.css +383 -0
- package/package.json +54 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1419 @@
|
|
|
1
|
+
import { Command, CommandExecutionResult, ContainerRegionDefinition, ContainerRegionId, ContainerVariantId, CoreWidgetMeta, CreationBlockReason, DeepReadonly as DeepReadonly$1, DesignerEngine, DesignerSchema, LayoutPlan, NodeDestination, NodeOwner, NodeStyle, PlacementDecision, ResolvedNodeLayout, SchemaIndexResult, SchemaNode, StyleValueMap } from "@dragcraft/core";
|
|
2
|
+
import { Component, ComputedRef, InjectionKey, PropType, Ref, VNode } from "vue";
|
|
3
|
+
import { MessageTree } from "@dragcraft/i18n";
|
|
4
|
+
//#region src/event-hooks.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* A value that is either T or a Promise resolving to T.
|
|
7
|
+
* Used to allow event hooks to be either synchronous or asynchronous.
|
|
8
|
+
*/
|
|
9
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
10
|
+
interface PendingGuard {
|
|
11
|
+
value: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Payload for selection hooks.
|
|
15
|
+
*/
|
|
16
|
+
interface SelectHookPayload {
|
|
17
|
+
nodeId: string;
|
|
18
|
+
event?: MouseEvent;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Payload for drag hooks.
|
|
22
|
+
*/
|
|
23
|
+
interface DragHookPayload {
|
|
24
|
+
nodeId: string;
|
|
25
|
+
event?: DragEvent;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Payload for hover hooks.
|
|
29
|
+
*/
|
|
30
|
+
interface HoverHookPayload {
|
|
31
|
+
nodeId: string | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Interceptable event hooks for non-action renderer events.
|
|
35
|
+
*
|
|
36
|
+
* "onBefore*" hooks are called BEFORE the action. Returning `false`
|
|
37
|
+
* cancels the event (e.g., prevents selection).
|
|
38
|
+
* Returning `undefined` or `true` allows the action to proceed.
|
|
39
|
+
* Hooks may return a Promise for async operations (e.g., confirmation dialogs, API validation).
|
|
40
|
+
*
|
|
41
|
+
* "onAfter*" hooks are called AFTER the action completed.
|
|
42
|
+
* They are informational and cannot cancel. May return a Promise (fire-and-forget).
|
|
43
|
+
*
|
|
44
|
+
* Exceptions:
|
|
45
|
+
* - `onBeforeDrag` stays synchronous — browser DragEvent requires synchronous `preventDefault()`.
|
|
46
|
+
* - `onHoverChange` stays synchronous — high-frequency informational event.
|
|
47
|
+
*/
|
|
48
|
+
interface RendererEventHooks {
|
|
49
|
+
onBeforeSelect?: (payload: SelectHookPayload) => MaybePromise<boolean | void>;
|
|
50
|
+
onAfterSelect?: (payload: SelectHookPayload) => MaybePromise<void>;
|
|
51
|
+
onBeforeDrag?: (payload: DragHookPayload) => boolean | void;
|
|
52
|
+
onAfterDrag?: (payload: DragHookPayload) => MaybePromise<void>;
|
|
53
|
+
onHoverChange?: (payload: HoverHookPayload) => void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Returns empty event hooks (no-op). Used as the default.
|
|
57
|
+
*/
|
|
58
|
+
declare function createDefaultEventHooks(): RendererEventHooks;
|
|
59
|
+
/**
|
|
60
|
+
* Resolves a before-hook result that may be sync or async.
|
|
61
|
+
* Returns `true` if the action should proceed, `false` if cancelled.
|
|
62
|
+
*
|
|
63
|
+
* Error handling: if the hook throws or the promise rejects,
|
|
64
|
+
* the action is CANCELLED (returns false) and the error is logged.
|
|
65
|
+
* Rationale: a gating hook that crashes should fail closed, not open.
|
|
66
|
+
*/
|
|
67
|
+
declare function resolveBeforeHook(result: Promise<boolean | void>): Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* Fires an after-hook (fire-and-forget).
|
|
70
|
+
* If the hook returns a promise, any rejection is caught and logged.
|
|
71
|
+
* Errors never propagate to the caller.
|
|
72
|
+
*/
|
|
73
|
+
declare function fireAfterHook<P>(hook: ((payload: P) => MaybePromise<void>) | undefined, payload: P): void;
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/action-runtime.d.ts
|
|
76
|
+
type ActionRisk = 'normal' | 'destructive';
|
|
77
|
+
interface ActionDecision {
|
|
78
|
+
allowed: boolean;
|
|
79
|
+
reason?: string;
|
|
80
|
+
}
|
|
81
|
+
interface ActionInvocation {
|
|
82
|
+
key: string;
|
|
83
|
+
label: string;
|
|
84
|
+
ctx: NodeActionContext;
|
|
85
|
+
event: MouseEvent;
|
|
86
|
+
risk: ActionRisk;
|
|
87
|
+
command?: Command;
|
|
88
|
+
metadata?: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
interface ActionInterceptor {
|
|
91
|
+
beforeAction?: (invocation: ActionInvocation) => MaybePromise<boolean | ActionDecision | void>;
|
|
92
|
+
afterAction?: (invocation: ActionInvocation) => MaybePromise<void>;
|
|
93
|
+
onActionError?: (invocation: ActionInvocation, error: unknown) => void;
|
|
94
|
+
}
|
|
95
|
+
interface ActionConfirmRequest {
|
|
96
|
+
invocation: ActionInvocation;
|
|
97
|
+
title?: string;
|
|
98
|
+
message?: string;
|
|
99
|
+
}
|
|
100
|
+
interface ConfirmActionInterceptorOptions {
|
|
101
|
+
confirm: (request: ActionConfirmRequest) => MaybePromise<boolean>;
|
|
102
|
+
shouldConfirm?: (invocation: ActionInvocation) => boolean;
|
|
103
|
+
title?: string | ((invocation: ActionInvocation) => string);
|
|
104
|
+
message?: string | ((invocation: ActionInvocation) => string);
|
|
105
|
+
}
|
|
106
|
+
declare function runActionPipeline(invocation: ActionInvocation, execute: () => MaybePromise<void>, interceptors?: ActionInterceptor[], pendingGuard?: PendingGuard): void | Promise<void>;
|
|
107
|
+
declare function createConfirmActionInterceptor(options: ConfirmActionInterceptorOptions): ActionInterceptor;
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/selection-presentation.d.ts
|
|
110
|
+
type NodeSelectionPlane = 'root' | 'content' | 'viewport';
|
|
111
|
+
type NodeSelectionProjectionKind = 'root-segment' | 'material-bounds';
|
|
112
|
+
interface NodeSelectionRect {
|
|
113
|
+
top: number;
|
|
114
|
+
left: number;
|
|
115
|
+
width: number;
|
|
116
|
+
height: number;
|
|
117
|
+
}
|
|
118
|
+
interface NodeSelectionProjection {
|
|
119
|
+
kind: NodeSelectionProjectionKind;
|
|
120
|
+
plane: NodeSelectionPlane;
|
|
121
|
+
/** Material border box relative to the registered plane. */
|
|
122
|
+
materialBounds: NodeSelectionRect;
|
|
123
|
+
/** Renderer-owned semantic selection range relative to the registered plane. */
|
|
124
|
+
bounds: NodeSelectionRect;
|
|
125
|
+
}
|
|
126
|
+
interface NodeSelectionPresentationHost {
|
|
127
|
+
registerPlane: (plane: NodeSelectionPlane, element: HTMLElement | null) => void;
|
|
128
|
+
}
|
|
129
|
+
interface NodeSelectionPresentation extends NodeSelectionPresentationHost {
|
|
130
|
+
registerFallback: (element: HTMLElement | null) => void;
|
|
131
|
+
getPlane: (plane: NodeSelectionPlane) => ComputedRef<HTMLElement | null>;
|
|
132
|
+
}
|
|
133
|
+
declare const NODE_SELECTION_PRESENTATION_KEY: InjectionKey<NodeSelectionPresentation>;
|
|
134
|
+
declare const NODE_SELECTION_PLANE_KEY: InjectionKey<Readonly<Ref<NodeSelectionPlane>>>;
|
|
135
|
+
declare function createNodeSelectionPresentation(): NodeSelectionPresentation;
|
|
136
|
+
declare function useNodeSelectionPresentation(): NodeSelectionPresentation;
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/node-interaction.d.ts
|
|
139
|
+
type NodeInteractionGeometryMode = 'root-band' | 'node-box';
|
|
140
|
+
type NodeToolbarPlacement = 'left-start' | 'top-end';
|
|
141
|
+
type NodeToolbarOrientation = 'vertical' | 'horizontal';
|
|
142
|
+
interface NodeInteractionPresentation {
|
|
143
|
+
geometryMode: NodeInteractionGeometryMode;
|
|
144
|
+
selectionKind: NodeSelectionProjectionKind;
|
|
145
|
+
toolbarPlacement: NodeToolbarPlacement;
|
|
146
|
+
toolbarOrientation: NodeToolbarOrientation;
|
|
147
|
+
}
|
|
148
|
+
declare function resolveNodeInteractionPresentation(owner: NodeOwner): NodeInteractionPresentation;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/types.d.ts
|
|
151
|
+
type DeepReadonly<T> = T extends ((...args: infer Args) => infer Result) ? (...args: Args) => Result : T extends readonly unknown[] ? { readonly [Key in keyof T]: DeepReadonly<T[Key]>; } : T extends object ? { readonly [Key in keyof T]: DeepReadonly<T[Key]>; } : T;
|
|
152
|
+
/**
|
|
153
|
+
* Maps a node's `type` string to a Vue component.
|
|
154
|
+
*
|
|
155
|
+
* Example: { button: ButtonWidget, text: TextWidget }
|
|
156
|
+
*/
|
|
157
|
+
type ComponentMap = Record<string, Component>;
|
|
158
|
+
interface WidgetRendererProps {
|
|
159
|
+
node: SchemaNode;
|
|
160
|
+
owner?: NodeOwner;
|
|
161
|
+
/** Internal coordinate plane inherited by nested container nodes. */
|
|
162
|
+
selectionPlane?: NodeSelectionPlane;
|
|
163
|
+
}
|
|
164
|
+
interface ContainerRegionOutletProps {
|
|
165
|
+
regionId: ContainerRegionId;
|
|
166
|
+
as?: string | Component;
|
|
167
|
+
}
|
|
168
|
+
interface ResolveContainerDropIndexContext {
|
|
169
|
+
event: DragEvent;
|
|
170
|
+
regionElement: HTMLElement;
|
|
171
|
+
itemElements: readonly HTMLElement[];
|
|
172
|
+
nodes: DeepReadonly<SchemaNode[]>;
|
|
173
|
+
}
|
|
174
|
+
type ResolveContainerDropIndex = (ctx: ResolveContainerDropIndexContext) => number | null;
|
|
175
|
+
interface ContainerRegionOutletDropProps extends ContainerRegionOutletProps {
|
|
176
|
+
resolveDropIndex?: ResolveContainerDropIndex;
|
|
177
|
+
}
|
|
178
|
+
interface ContainerDropTarget {
|
|
179
|
+
event: DragEvent;
|
|
180
|
+
destination: Extract<NodeDestination, {
|
|
181
|
+
kind: 'container';
|
|
182
|
+
}>;
|
|
183
|
+
}
|
|
184
|
+
interface ContainerDropRejection {
|
|
185
|
+
event: DragEvent;
|
|
186
|
+
containerId: string;
|
|
187
|
+
regionId: string;
|
|
188
|
+
allowed: false;
|
|
189
|
+
code: 'CONTAINER_DROP_ADAPTER_MISSING' | 'CONTAINER_DROP_ADAPTER_FAILED' | 'CONTAINER_DROP_ADAPTER_INVALID' | 'CONTAINER_DROP_NO_TARGET';
|
|
190
|
+
message?: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Props received by a custom nodeWrapper component.
|
|
194
|
+
* Must render a default slot containing the widget content.
|
|
195
|
+
*/
|
|
196
|
+
interface NodeWrapperProps {
|
|
197
|
+
/** The schema node ID being wrapped */
|
|
198
|
+
nodeId: string;
|
|
199
|
+
/** The widget type string */
|
|
200
|
+
nodeType: string;
|
|
201
|
+
/** Structural owner that determines the default interaction presentation. */
|
|
202
|
+
owner: NodeOwner;
|
|
203
|
+
/** Reactive interaction state */
|
|
204
|
+
state: NodeInteractionState;
|
|
205
|
+
/** The resolved widget meta, if available */
|
|
206
|
+
meta: RendererWidgetMeta | undefined;
|
|
207
|
+
}
|
|
208
|
+
interface RendererWidgetActionExtra {
|
|
209
|
+
key: string;
|
|
210
|
+
label: string;
|
|
211
|
+
icon?: string | Component;
|
|
212
|
+
type: 'button' | 'drag-handle';
|
|
213
|
+
order: number;
|
|
214
|
+
risk?: ActionRisk;
|
|
215
|
+
metadata?: Record<string, unknown>;
|
|
216
|
+
visible?: (ctx: NodeActionContext) => boolean;
|
|
217
|
+
available?: (ctx: NodeActionContext) => boolean;
|
|
218
|
+
disabled?: (ctx: NodeActionContext) => boolean;
|
|
219
|
+
command?: (ctx: NodeActionContext, event: MouseEvent) => Command | null | undefined;
|
|
220
|
+
handler?: (ctx: NodeActionContext, event: MouseEvent) => MaybePromise<void>;
|
|
221
|
+
className?: string;
|
|
222
|
+
}
|
|
223
|
+
interface WidgetActionConfig {
|
|
224
|
+
only?: string[];
|
|
225
|
+
exclude?: string[];
|
|
226
|
+
extra?: RendererWidgetActionExtra[];
|
|
227
|
+
}
|
|
228
|
+
interface RendererContainerAdapter {
|
|
229
|
+
resolveDropIndex?: ResolveContainerDropIndex;
|
|
230
|
+
}
|
|
231
|
+
interface RendererWidgetMeta extends CoreWidgetMeta {
|
|
232
|
+
actions?: WidgetActionConfig;
|
|
233
|
+
wrapper?: Component;
|
|
234
|
+
containerAdapter?: RendererContainerAdapter;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Viewport-relative position coordinates for floating toolbar.
|
|
238
|
+
* When provided, the toolbar uses position: fixed to escape overflow clipping.
|
|
239
|
+
*/
|
|
240
|
+
interface ToolbarPositionData {
|
|
241
|
+
/** CSS x coordinate in pixels (viewport-relative). */
|
|
242
|
+
x: number;
|
|
243
|
+
/** CSS y coordinate in pixels (viewport-relative). */
|
|
244
|
+
y: number;
|
|
245
|
+
/** Resolved placement after collision handling. */
|
|
246
|
+
placement: 'left-start' | 'top-end' | 'bottom-end';
|
|
247
|
+
/** Action layout direction for the resolved owner presentation. */
|
|
248
|
+
orientation: NodeToolbarOrientation;
|
|
249
|
+
/** Positioning strategy used by the interaction layer. */
|
|
250
|
+
strategy: 'fixed';
|
|
251
|
+
/** Whether the toolbar should be visible (widget is at least partially in viewport) */
|
|
252
|
+
visible: boolean;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Props received by a custom nodeToolbar component.
|
|
256
|
+
*/
|
|
257
|
+
interface NodeToolbarProps {
|
|
258
|
+
/** The schema node ID */
|
|
259
|
+
nodeId: string;
|
|
260
|
+
/** The widget type string */
|
|
261
|
+
nodeType: string;
|
|
262
|
+
/** Structural owner that determines the default interaction presentation. */
|
|
263
|
+
owner: NodeOwner;
|
|
264
|
+
/** Pre-resolved actions for this node */
|
|
265
|
+
actions: ResolvedNodeAction[];
|
|
266
|
+
/** Reactive interaction state */
|
|
267
|
+
state: NodeInteractionState;
|
|
268
|
+
/** Drag start handler for drag-handle type actions */
|
|
269
|
+
onDragStart: (e: DragEvent) => void;
|
|
270
|
+
/** Drag end handler for drag-handle type actions */
|
|
271
|
+
onDragEnd: (e: DragEvent) => void;
|
|
272
|
+
/**
|
|
273
|
+
* Viewport-relative position for fixed positioning.
|
|
274
|
+
* When provided, the toolbar escapes overflow clipping by using position: fixed.
|
|
275
|
+
* If not provided, falls back to position: absolute behavior.
|
|
276
|
+
*/
|
|
277
|
+
toolbarPosition?: ToolbarPositionData;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Props received by a custom nodeMask component.
|
|
281
|
+
*/
|
|
282
|
+
interface NodeMaskProps {
|
|
283
|
+
/** The schema node ID */
|
|
284
|
+
nodeId: string;
|
|
285
|
+
/** The widget type string */
|
|
286
|
+
nodeType: string;
|
|
287
|
+
/** Structural owner that determines the default interaction presentation. */
|
|
288
|
+
owner: NodeOwner;
|
|
289
|
+
/** Select handler to call on click */
|
|
290
|
+
onSelect: (e: MouseEvent) => void;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Props received by a custom nodeHandle component.
|
|
294
|
+
*/
|
|
295
|
+
interface NodeHandleProps {
|
|
296
|
+
/** The schema node ID */
|
|
297
|
+
nodeId: string;
|
|
298
|
+
/** The widget type string */
|
|
299
|
+
nodeType: string;
|
|
300
|
+
/** Structural owner that determines the default interaction presentation. */
|
|
301
|
+
owner: NodeOwner;
|
|
302
|
+
/** Select handler to call on click */
|
|
303
|
+
onSelect: (e: MouseEvent) => void;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Props received by a custom nodeSelection component.
|
|
307
|
+
* Renderer and the shell own geometry, plane routing, and clipping; the
|
|
308
|
+
* component only owns the visual presentation.
|
|
309
|
+
*/
|
|
310
|
+
interface NodeSelectionProps {
|
|
311
|
+
/** The schema node ID */
|
|
312
|
+
nodeId: string;
|
|
313
|
+
/** The widget type string */
|
|
314
|
+
nodeType: string;
|
|
315
|
+
/** Structural owner that determines the projection kind. */
|
|
316
|
+
owner: NodeOwner;
|
|
317
|
+
/** Renderer-owned material and semantic selection bounds in a coordinate plane. */
|
|
318
|
+
projection: NodeSelectionProjection;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Props received by a custom emptyState component.
|
|
322
|
+
*/
|
|
323
|
+
interface EmptyStateProps {
|
|
324
|
+
/** Whether a drag operation is currently over the canvas */
|
|
325
|
+
isDragOver: boolean;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Props received by a custom forbiddenOverlay component.
|
|
329
|
+
*/
|
|
330
|
+
interface ForbiddenOverlayProps {
|
|
331
|
+
/** The widget type that was blocked */
|
|
332
|
+
widgetType: string;
|
|
333
|
+
/** User-facing reason for the blocked creation attempt */
|
|
334
|
+
reason: CreationBlockReason | null;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Props received by a custom widgetFallback component.
|
|
338
|
+
*/
|
|
339
|
+
interface WidgetFallbackProps {
|
|
340
|
+
/** The schema node ID */
|
|
341
|
+
nodeId: string;
|
|
342
|
+
/** The unresolved widget type string */
|
|
343
|
+
nodeType: string;
|
|
344
|
+
}
|
|
345
|
+
interface RendererExtensions {
|
|
346
|
+
/**
|
|
347
|
+
* Replaces the default root canvas wrapper.
|
|
348
|
+
* E.g., a phone frame, tablet frame, or custom viewport shell.
|
|
349
|
+
* Receives ContainerShellProps and region slot functions.
|
|
350
|
+
*/
|
|
351
|
+
containerShell?: Component;
|
|
352
|
+
/**
|
|
353
|
+
* Replaces the default drop indicator shown inside containers
|
|
354
|
+
* during drag-over state.
|
|
355
|
+
*/
|
|
356
|
+
dropIndicator?: Component;
|
|
357
|
+
/**
|
|
358
|
+
* Wraps each rendered widget node. Receives NodeWrapperProps.
|
|
359
|
+
* Must render a default slot containing the widget content.
|
|
360
|
+
* Use this to add custom chrome, annotations, badges, etc.
|
|
361
|
+
*/
|
|
362
|
+
nodeWrapper?: Component;
|
|
363
|
+
/**
|
|
364
|
+
* Replaces the default per-node floating toolbar.
|
|
365
|
+
* Receives NodeToolbarProps with pre-resolved actions.
|
|
366
|
+
*/
|
|
367
|
+
nodeToolbar?: Component;
|
|
368
|
+
/**
|
|
369
|
+
* Replaces the default mask overlay for mask=true widgets.
|
|
370
|
+
* Receives NodeMaskProps.
|
|
371
|
+
*/
|
|
372
|
+
nodeMask?: Component;
|
|
373
|
+
/**
|
|
374
|
+
* Replaces the default selection handle for mask=false widgets.
|
|
375
|
+
* Receives NodeHandleProps.
|
|
376
|
+
*/
|
|
377
|
+
nodeHandle?: Component;
|
|
378
|
+
/**
|
|
379
|
+
* Replaces the visual presentation of the Renderer-owned selected projection.
|
|
380
|
+
* Geometry, plane routing, and clipping remain owned by Renderer and the shell.
|
|
381
|
+
*/
|
|
382
|
+
nodeSelection?: Component;
|
|
383
|
+
/**
|
|
384
|
+
* Replaces the default "drag components here" empty state.
|
|
385
|
+
* Receives EmptyStateProps.
|
|
386
|
+
*/
|
|
387
|
+
emptyState?: Component;
|
|
388
|
+
/**
|
|
389
|
+
* Replaces the default fallback for unknown widget types.
|
|
390
|
+
* Receives WidgetFallbackProps.
|
|
391
|
+
*/
|
|
392
|
+
widgetFallback?: Component;
|
|
393
|
+
/**
|
|
394
|
+
* Replaces the default forbidden overlay shown when a widget type
|
|
395
|
+
* cannot be dropped.
|
|
396
|
+
* Receives ForbiddenOverlayProps.
|
|
397
|
+
*/
|
|
398
|
+
forbiddenOverlay?: Component;
|
|
399
|
+
}
|
|
400
|
+
interface ContainerDropRendererOptions {
|
|
401
|
+
activeDestination?: Ref<NodeDestination | null>;
|
|
402
|
+
containerDropDecision?: Ref<PlacementDecision | null>;
|
|
403
|
+
onContainerDragOver?: (target: ContainerDropTarget | ContainerDropRejection) => void;
|
|
404
|
+
onContainerDragLeave?: (event: DragEvent) => void;
|
|
405
|
+
onContainerDrop?: (event: DragEvent) => void;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Options accepted by RootRenderer as props.
|
|
409
|
+
*
|
|
410
|
+
* **Immutability constraint:** These options are captured once when RootRenderer
|
|
411
|
+
* mounts and provided to all descendants via provide/inject. Changing them after
|
|
412
|
+
* the initial render has no effect on the running renderer. If you need to swap
|
|
413
|
+
* extensions or hooks, remount RootRenderer with a different `key`.
|
|
414
|
+
*/
|
|
415
|
+
interface RendererOptions extends ContainerDropRendererOptions {
|
|
416
|
+
/** The core engine instance (read-only consumption) */
|
|
417
|
+
engine: DesignerEngine;
|
|
418
|
+
/** Maps node.type -> Vue component for rendering */
|
|
419
|
+
componentMap: ComponentMap;
|
|
420
|
+
/** Optional extension point overrides */
|
|
421
|
+
extensions?: RendererExtensions;
|
|
422
|
+
/** Interceptable event hooks for renderer events */
|
|
423
|
+
eventHooks?: RendererEventHooks;
|
|
424
|
+
/** Interceptors for node actions such as delete, move, duplicate, and custom actions */
|
|
425
|
+
actionInterceptors?: ActionInterceptor[];
|
|
426
|
+
/** Node action registry. If not provided, default actions are used. */
|
|
427
|
+
actionRegistry?: NodeActionRegistry;
|
|
428
|
+
/**
|
|
429
|
+
* Optional reactive ref tracking whether root is being dragged over.
|
|
430
|
+
* Managed externally by the designer package.
|
|
431
|
+
* If not provided, drag-over visual state is disabled.
|
|
432
|
+
*/
|
|
433
|
+
dragOverNodeId?: Ref<string | null>;
|
|
434
|
+
/**
|
|
435
|
+
* Optional reactive ref tracking the visual insertion index during drag-over.
|
|
436
|
+
* Determines where the drop indicator is rendered within the widget list.
|
|
437
|
+
* Managed externally by the designer package.
|
|
438
|
+
*/
|
|
439
|
+
dragOverIndex?: Ref<number | null>;
|
|
440
|
+
/** Optional canvas viewport used as the collision boundary for floating controls. */
|
|
441
|
+
interactionBoundary?: Ref<HTMLElement | null>;
|
|
442
|
+
/**
|
|
443
|
+
* Optional reactive ref indicating the current drag-over is forbidden.
|
|
444
|
+
* When true and dragOverNodeId is 'root', the forbidden overlay is shown
|
|
445
|
+
* instead of the drop indicator.
|
|
446
|
+
* Managed externally by the designer package.
|
|
447
|
+
*/
|
|
448
|
+
isForbidden?: Ref<boolean>;
|
|
449
|
+
/** Optional reason explaining the current forbidden drag-over state. */
|
|
450
|
+
forbiddenReason?: Ref<CreationBlockReason | null>;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Internal context provided to all renderer descendants via provide/inject.
|
|
454
|
+
*/
|
|
455
|
+
interface RendererContext extends ContainerDropRendererOptions {
|
|
456
|
+
engine: DesignerEngine;
|
|
457
|
+
/** One safe schema snapshot shared by the renderer tree for each schema revision. */
|
|
458
|
+
schema: ComputedRef<DeepReadonly<DesignerSchema>>;
|
|
459
|
+
/** Root layout projection cached for the current schema revision. */
|
|
460
|
+
layoutPlan: ComputedRef<LayoutPlan>;
|
|
461
|
+
/** Ownership index cached for the current schema revision. */
|
|
462
|
+
schemaIndex: ComputedRef<SchemaIndexResult>;
|
|
463
|
+
/** Resolves action geometry and lock constraints from revision-scoped caches. */
|
|
464
|
+
resolveNodeActionPosition?: (node: SchemaNode, owner: NodeOwner) => {
|
|
465
|
+
owner: NodeOwner;
|
|
466
|
+
index: number;
|
|
467
|
+
siblingCount: number;
|
|
468
|
+
sortScope: string | false;
|
|
469
|
+
lockedIndices: Set<number>;
|
|
470
|
+
};
|
|
471
|
+
componentMap: ComponentMap;
|
|
472
|
+
extensions: RendererExtensions;
|
|
473
|
+
eventHooks: RendererEventHooks;
|
|
474
|
+
actionInterceptors: ActionInterceptor[];
|
|
475
|
+
actionRegistry: NodeActionRegistry;
|
|
476
|
+
dragOverNodeId: Ref<string | null>;
|
|
477
|
+
activeDestination: Ref<NodeDestination | null>;
|
|
478
|
+
containerDropDecision: Ref<PlacementDecision | null>;
|
|
479
|
+
/** Optional canvas viewport used as the collision boundary for floating controls. */
|
|
480
|
+
interactionBoundary?: Ref<HTMLElement | null>;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Injection key for the renderer context.
|
|
484
|
+
*/
|
|
485
|
+
declare const RENDERER_CONTEXT_KEY: InjectionKey<RendererContext>;
|
|
486
|
+
/**
|
|
487
|
+
* Reactive interaction state computed for a single node.
|
|
488
|
+
* Returned by the useNodeState composable.
|
|
489
|
+
*/
|
|
490
|
+
interface NodeInteractionState {
|
|
491
|
+
isSelected: ComputedRef<boolean>;
|
|
492
|
+
isHovered: ComputedRef<boolean>;
|
|
493
|
+
isDragOver: ComputedRef<boolean>;
|
|
494
|
+
/** CSS class map for binding: { 'dc-node--selected': true, ... } */
|
|
495
|
+
interactionClasses: ComputedRef<Record<string, boolean>>;
|
|
496
|
+
}
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/action-registry.d.ts
|
|
499
|
+
/**
|
|
500
|
+
* Context provided to action predicates and handlers.
|
|
501
|
+
*/
|
|
502
|
+
interface NodeActionContext {
|
|
503
|
+
/** The schema node this action applies to */
|
|
504
|
+
node: DeepReadonly$1<SchemaNode>;
|
|
505
|
+
/** Structural owner whose child array defines sibling ordering. */
|
|
506
|
+
owner: NodeOwner;
|
|
507
|
+
/** The node's index among siblings */
|
|
508
|
+
index: number;
|
|
509
|
+
/** Total sibling count */
|
|
510
|
+
siblingCount: number;
|
|
511
|
+
/** Sort scope this action context belongs to, or false when unsorted */
|
|
512
|
+
sortScope: string | false;
|
|
513
|
+
/** The widget meta, if registered */
|
|
514
|
+
meta: RendererWidgetMeta | undefined;
|
|
515
|
+
/** The engine instance for executing commands */
|
|
516
|
+
engine: DesignerEngine;
|
|
517
|
+
/** Safe schema snapshot shared by all action predicates for this resolution. */
|
|
518
|
+
schema: DeepReadonly$1<DesignerSchema>;
|
|
519
|
+
/** Precomputed lock set for the owning sort scope or container region. */
|
|
520
|
+
lockedIndices?: Set<number>;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Definition of a single node action.
|
|
524
|
+
*/
|
|
525
|
+
interface NodeActionDefinition {
|
|
526
|
+
/** Unique action key (e.g., 'drag', 'move-up', 'move-down', 'delete') */
|
|
527
|
+
key: string;
|
|
528
|
+
/** Display label for the action */
|
|
529
|
+
label: string;
|
|
530
|
+
/** Icon content: a string character, or a Vue component */
|
|
531
|
+
icon?: string | Component;
|
|
532
|
+
/** 'button' renders as button, 'drag-handle' renders as draggable element */
|
|
533
|
+
type: 'button' | 'drag-handle';
|
|
534
|
+
/** Sort order. Built-in actions use 100, 200, 300, 400. */
|
|
535
|
+
order: number;
|
|
536
|
+
/** Risk level used by action interceptors. */
|
|
537
|
+
risk?: ActionRisk;
|
|
538
|
+
/** Optional metadata passed through action interceptors. */
|
|
539
|
+
metadata?: Record<string, unknown>;
|
|
540
|
+
/**
|
|
541
|
+
* Whether this action is visible.
|
|
542
|
+
* Return false to hide the action for this node.
|
|
543
|
+
*/
|
|
544
|
+
visible?: (ctx: NodeActionContext) => boolean;
|
|
545
|
+
/**
|
|
546
|
+
* Whether this action is available (usable) for this node.
|
|
547
|
+
* Return false to render the action in disabled state.
|
|
548
|
+
* Distinct from `visible` — an action can be visible but unavailable.
|
|
549
|
+
*/
|
|
550
|
+
available?: (ctx: NodeActionContext) => boolean;
|
|
551
|
+
/**
|
|
552
|
+
* Whether this action is disabled.
|
|
553
|
+
* Return true to render the button in disabled state.
|
|
554
|
+
*/
|
|
555
|
+
disabled?: (ctx: NodeActionContext) => boolean;
|
|
556
|
+
/**
|
|
557
|
+
* Command invoked when the action is triggered.
|
|
558
|
+
* Prefer this for schema writes so the action remains declarative.
|
|
559
|
+
*/
|
|
560
|
+
command?: (ctx: NodeActionContext, event: MouseEvent) => Command | null | undefined;
|
|
561
|
+
/**
|
|
562
|
+
* Handler invoked when the action is triggered.
|
|
563
|
+
* Use this for side effects or actions that do not map to a core command.
|
|
564
|
+
*/
|
|
565
|
+
handler?: (ctx: NodeActionContext, event: MouseEvent) => MaybePromise<void>;
|
|
566
|
+
/**
|
|
567
|
+
* CSS class name(s) to add to the action element.
|
|
568
|
+
*/
|
|
569
|
+
className?: string;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* A resolved action with computed visible/disabled state for a specific node.
|
|
573
|
+
*/
|
|
574
|
+
interface ResolvedNodeAction {
|
|
575
|
+
key: string;
|
|
576
|
+
label: string;
|
|
577
|
+
icon?: string | Component;
|
|
578
|
+
type: 'button' | 'drag-handle';
|
|
579
|
+
order: number;
|
|
580
|
+
risk: ActionRisk;
|
|
581
|
+
metadata?: Record<string, unknown>;
|
|
582
|
+
visible: boolean;
|
|
583
|
+
disabled: boolean;
|
|
584
|
+
handler: (event: MouseEvent) => void | Promise<void>;
|
|
585
|
+
className?: string;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Registry for managing node actions.
|
|
589
|
+
*/
|
|
590
|
+
interface NodeActionRegistry {
|
|
591
|
+
/** Get all registered global action definitions */
|
|
592
|
+
getActions: () => NodeActionDefinition[];
|
|
593
|
+
/** Register a new action definition */
|
|
594
|
+
register: (action: NodeActionDefinition) => void;
|
|
595
|
+
/** Unregister an action by key */
|
|
596
|
+
unregister: (key: string) => void;
|
|
597
|
+
/**
|
|
598
|
+
* Resolve actions for a specific node, applying visibility/disabled predicates
|
|
599
|
+
* and per-widget overrides from WidgetMeta.
|
|
600
|
+
*/
|
|
601
|
+
resolve: (ctx: NodeActionContext, actionInterceptors?: ActionInterceptor[], keys?: readonly string[]) => ResolvedNodeAction[];
|
|
602
|
+
}
|
|
603
|
+
declare const ActionKey: {
|
|
604
|
+
readonly DRAG: "drag";
|
|
605
|
+
readonly MOVE_UP: "move-up";
|
|
606
|
+
readonly MOVE_DOWN: "move-down";
|
|
607
|
+
readonly DUPLICATE: "duplicate";
|
|
608
|
+
readonly DELETE: "delete";
|
|
609
|
+
};
|
|
610
|
+
declare function createDefaultActions(t?: (key: string, fallback?: string) => string): NodeActionDefinition[];
|
|
611
|
+
declare function createNodeActionRegistry(initialActions?: NodeActionDefinition[]): NodeActionRegistry;
|
|
612
|
+
//#endregion
|
|
613
|
+
//#region src/components/ContainerRegionOutlet.d.ts
|
|
614
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
615
|
+
regionId: {
|
|
616
|
+
type: StringConstructor;
|
|
617
|
+
required: true;
|
|
618
|
+
};
|
|
619
|
+
as: {
|
|
620
|
+
type: PropType<string | Component>;
|
|
621
|
+
default: string;
|
|
622
|
+
};
|
|
623
|
+
resolveDropIndex: {
|
|
624
|
+
type: PropType<ResolveContainerDropIndex>;
|
|
625
|
+
default: undefined;
|
|
626
|
+
};
|
|
627
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
628
|
+
[key: string]: any;
|
|
629
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
630
|
+
regionId: {
|
|
631
|
+
type: StringConstructor;
|
|
632
|
+
required: true;
|
|
633
|
+
};
|
|
634
|
+
as: {
|
|
635
|
+
type: PropType<string | Component>;
|
|
636
|
+
default: string;
|
|
637
|
+
};
|
|
638
|
+
resolveDropIndex: {
|
|
639
|
+
type: PropType<ResolveContainerDropIndex>;
|
|
640
|
+
default: undefined;
|
|
641
|
+
};
|
|
642
|
+
}>> & Readonly<{}>, {
|
|
643
|
+
as: string | Component;
|
|
644
|
+
resolveDropIndex: ResolveContainerDropIndex;
|
|
645
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region src/components/DefaultContainerFallback.d.ts
|
|
648
|
+
declare const _default$1: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
649
|
+
node: {
|
|
650
|
+
type: PropType<SchemaNode>;
|
|
651
|
+
required: true;
|
|
652
|
+
};
|
|
653
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
654
|
+
[key: string]: any;
|
|
655
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
656
|
+
node: {
|
|
657
|
+
type: PropType<SchemaNode>;
|
|
658
|
+
required: true;
|
|
659
|
+
};
|
|
660
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/components/DefaultContainerShell.d.ts
|
|
663
|
+
declare const DefaultContainerShell: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
664
|
+
isEmpty: {
|
|
665
|
+
type: BooleanConstructor;
|
|
666
|
+
default: boolean;
|
|
667
|
+
};
|
|
668
|
+
regionVNodes: {
|
|
669
|
+
type: PropType<Record<string, VNode[]>>;
|
|
670
|
+
default: () => {};
|
|
671
|
+
};
|
|
672
|
+
chromeVNodes: {
|
|
673
|
+
type: PropType<VNode[]>;
|
|
674
|
+
default: () => never[];
|
|
675
|
+
};
|
|
676
|
+
layerVNodes: {
|
|
677
|
+
type: PropType<Record<string, VNode[]>>;
|
|
678
|
+
default: () => {};
|
|
679
|
+
};
|
|
680
|
+
forbiddenOverlayVNode: {
|
|
681
|
+
type: PropType<VNode | null>;
|
|
682
|
+
default: null;
|
|
683
|
+
};
|
|
684
|
+
layoutPlan: {
|
|
685
|
+
type: PropType<LayoutPlan>;
|
|
686
|
+
default: undefined;
|
|
687
|
+
};
|
|
688
|
+
surfaceStyle: {
|
|
689
|
+
type: PropType<StyleValueMap>;
|
|
690
|
+
default: undefined;
|
|
691
|
+
};
|
|
692
|
+
selectionPresentation: {
|
|
693
|
+
type: PropType<NodeSelectionPresentationHost>;
|
|
694
|
+
default: undefined;
|
|
695
|
+
};
|
|
696
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
697
|
+
[key: string]: any;
|
|
698
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
699
|
+
isEmpty: {
|
|
700
|
+
type: BooleanConstructor;
|
|
701
|
+
default: boolean;
|
|
702
|
+
};
|
|
703
|
+
regionVNodes: {
|
|
704
|
+
type: PropType<Record<string, VNode[]>>;
|
|
705
|
+
default: () => {};
|
|
706
|
+
};
|
|
707
|
+
chromeVNodes: {
|
|
708
|
+
type: PropType<VNode[]>;
|
|
709
|
+
default: () => never[];
|
|
710
|
+
};
|
|
711
|
+
layerVNodes: {
|
|
712
|
+
type: PropType<Record<string, VNode[]>>;
|
|
713
|
+
default: () => {};
|
|
714
|
+
};
|
|
715
|
+
forbiddenOverlayVNode: {
|
|
716
|
+
type: PropType<VNode | null>;
|
|
717
|
+
default: null;
|
|
718
|
+
};
|
|
719
|
+
layoutPlan: {
|
|
720
|
+
type: PropType<LayoutPlan>;
|
|
721
|
+
default: undefined;
|
|
722
|
+
};
|
|
723
|
+
surfaceStyle: {
|
|
724
|
+
type: PropType<StyleValueMap>;
|
|
725
|
+
default: undefined;
|
|
726
|
+
};
|
|
727
|
+
selectionPresentation: {
|
|
728
|
+
type: PropType<NodeSelectionPresentationHost>;
|
|
729
|
+
default: undefined;
|
|
730
|
+
};
|
|
731
|
+
}>> & Readonly<{}>, {
|
|
732
|
+
isEmpty: boolean;
|
|
733
|
+
regionVNodes: Record<string, VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
734
|
+
[key: string]: any;
|
|
735
|
+
}>[]>;
|
|
736
|
+
chromeVNodes: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
737
|
+
[key: string]: any;
|
|
738
|
+
}>[];
|
|
739
|
+
layerVNodes: Record<string, VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
740
|
+
[key: string]: any;
|
|
741
|
+
}>[]>;
|
|
742
|
+
forbiddenOverlayVNode: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
743
|
+
[key: string]: any;
|
|
744
|
+
}> | null;
|
|
745
|
+
layoutPlan: LayoutPlan;
|
|
746
|
+
surfaceStyle: StyleValueMap;
|
|
747
|
+
selectionPresentation: NodeSelectionPresentationHost;
|
|
748
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/components/DefaultDropIndicator.d.ts
|
|
751
|
+
/**
|
|
752
|
+
* Sort-scope drop indicator shown during drag-over.
|
|
753
|
+
* Renders a dashed-border rectangle placeholder indicating where
|
|
754
|
+
* the widget will be placed. Styled via CSS class `dc-drop-indicator`.
|
|
755
|
+
*/
|
|
756
|
+
declare const _default$2: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
757
|
+
[key: string]: any;
|
|
758
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
759
|
+
//#endregion
|
|
760
|
+
//#region src/components/DefaultEmptyState.d.ts
|
|
761
|
+
/**
|
|
762
|
+
* Default empty canvas state component.
|
|
763
|
+
* Displayed when the canvas has no widgets and no drag operation is active.
|
|
764
|
+
*/
|
|
765
|
+
declare const _default$3: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
766
|
+
isDragOver: {
|
|
767
|
+
type: PropType<boolean>;
|
|
768
|
+
default: boolean;
|
|
769
|
+
};
|
|
770
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
771
|
+
[key: string]: any;
|
|
772
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
773
|
+
isDragOver: {
|
|
774
|
+
type: PropType<boolean>;
|
|
775
|
+
default: boolean;
|
|
776
|
+
};
|
|
777
|
+
}>> & Readonly<{}>, {
|
|
778
|
+
isDragOver: boolean;
|
|
779
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
780
|
+
//#endregion
|
|
781
|
+
//#region src/components/DefaultForbiddenOverlay.d.ts
|
|
782
|
+
/**
|
|
783
|
+
* Default forbidden overlay shown when a widget type cannot be dropped.
|
|
784
|
+
* Renders a red dashed drop zone with the blocked reason in the center.
|
|
785
|
+
*/
|
|
786
|
+
declare const _default$4: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
787
|
+
widgetType: {
|
|
788
|
+
type: PropType<string>;
|
|
789
|
+
required: true;
|
|
790
|
+
};
|
|
791
|
+
reason: {
|
|
792
|
+
type: PropType<CreationBlockReason | null>;
|
|
793
|
+
default: null;
|
|
794
|
+
};
|
|
795
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
796
|
+
[key: string]: any;
|
|
797
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
798
|
+
widgetType: {
|
|
799
|
+
type: PropType<string>;
|
|
800
|
+
required: true;
|
|
801
|
+
};
|
|
802
|
+
reason: {
|
|
803
|
+
type: PropType<CreationBlockReason | null>;
|
|
804
|
+
default: null;
|
|
805
|
+
};
|
|
806
|
+
}>> & Readonly<{}>, {
|
|
807
|
+
reason: CreationBlockReason | null;
|
|
808
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
809
|
+
//#endregion
|
|
810
|
+
//#region src/components/DefaultNodeHandle.d.ts
|
|
811
|
+
/**
|
|
812
|
+
* Default semantic selection handle for unmasked widgets and resolved containers.
|
|
813
|
+
*/
|
|
814
|
+
declare const _default$5: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
815
|
+
nodeId: {
|
|
816
|
+
type: StringConstructor;
|
|
817
|
+
required: true;
|
|
818
|
+
};
|
|
819
|
+
nodeType: {
|
|
820
|
+
type: StringConstructor;
|
|
821
|
+
required: true;
|
|
822
|
+
};
|
|
823
|
+
owner: {
|
|
824
|
+
type: PropType<NodeOwner>;
|
|
825
|
+
required: true;
|
|
826
|
+
};
|
|
827
|
+
onSelect: {
|
|
828
|
+
type: PropType<(e: MouseEvent) => void>;
|
|
829
|
+
required: true;
|
|
830
|
+
};
|
|
831
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
832
|
+
[key: string]: any;
|
|
833
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
834
|
+
nodeId: {
|
|
835
|
+
type: StringConstructor;
|
|
836
|
+
required: true;
|
|
837
|
+
};
|
|
838
|
+
nodeType: {
|
|
839
|
+
type: StringConstructor;
|
|
840
|
+
required: true;
|
|
841
|
+
};
|
|
842
|
+
owner: {
|
|
843
|
+
type: PropType<NodeOwner>;
|
|
844
|
+
required: true;
|
|
845
|
+
};
|
|
846
|
+
onSelect: {
|
|
847
|
+
type: PropType<(e: MouseEvent) => void>;
|
|
848
|
+
required: true;
|
|
849
|
+
};
|
|
850
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
851
|
+
//#endregion
|
|
852
|
+
//#region src/components/DefaultNodeMask.d.ts
|
|
853
|
+
/**
|
|
854
|
+
* Default mask overlay component for widgets with mask=true.
|
|
855
|
+
* Renders a transparent overlay that blocks widget interaction
|
|
856
|
+
* and captures clicks for selection.
|
|
857
|
+
*/
|
|
858
|
+
declare const _default$6: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
859
|
+
nodeId: {
|
|
860
|
+
type: StringConstructor;
|
|
861
|
+
required: true;
|
|
862
|
+
};
|
|
863
|
+
nodeType: {
|
|
864
|
+
type: StringConstructor;
|
|
865
|
+
required: true;
|
|
866
|
+
};
|
|
867
|
+
owner: {
|
|
868
|
+
type: PropType<NodeOwner>;
|
|
869
|
+
required: true;
|
|
870
|
+
};
|
|
871
|
+
onSelect: {
|
|
872
|
+
type: PropType<(e: MouseEvent) => void>;
|
|
873
|
+
required: true;
|
|
874
|
+
};
|
|
875
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
876
|
+
[key: string]: any;
|
|
877
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
878
|
+
nodeId: {
|
|
879
|
+
type: StringConstructor;
|
|
880
|
+
required: true;
|
|
881
|
+
};
|
|
882
|
+
nodeType: {
|
|
883
|
+
type: StringConstructor;
|
|
884
|
+
required: true;
|
|
885
|
+
};
|
|
886
|
+
owner: {
|
|
887
|
+
type: PropType<NodeOwner>;
|
|
888
|
+
required: true;
|
|
889
|
+
};
|
|
890
|
+
onSelect: {
|
|
891
|
+
type: PropType<(e: MouseEvent) => void>;
|
|
892
|
+
required: true;
|
|
893
|
+
};
|
|
894
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
895
|
+
//#endregion
|
|
896
|
+
//#region src/components/DefaultNodeSelection.d.ts
|
|
897
|
+
declare const _default$7: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
898
|
+
nodeId: {
|
|
899
|
+
type: StringConstructor;
|
|
900
|
+
required: true;
|
|
901
|
+
};
|
|
902
|
+
nodeType: {
|
|
903
|
+
type: StringConstructor;
|
|
904
|
+
required: true;
|
|
905
|
+
};
|
|
906
|
+
owner: {
|
|
907
|
+
type: PropType<NodeOwner>;
|
|
908
|
+
required: true;
|
|
909
|
+
};
|
|
910
|
+
projection: {
|
|
911
|
+
type: PropType<NodeSelectionProjection>;
|
|
912
|
+
required: true;
|
|
913
|
+
};
|
|
914
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
915
|
+
[key: string]: any;
|
|
916
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
917
|
+
nodeId: {
|
|
918
|
+
type: StringConstructor;
|
|
919
|
+
required: true;
|
|
920
|
+
};
|
|
921
|
+
nodeType: {
|
|
922
|
+
type: StringConstructor;
|
|
923
|
+
required: true;
|
|
924
|
+
};
|
|
925
|
+
owner: {
|
|
926
|
+
type: PropType<NodeOwner>;
|
|
927
|
+
required: true;
|
|
928
|
+
};
|
|
929
|
+
projection: {
|
|
930
|
+
type: PropType<NodeSelectionProjection>;
|
|
931
|
+
required: true;
|
|
932
|
+
};
|
|
933
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/components/DefaultNodeToolbar.d.ts
|
|
936
|
+
/**
|
|
937
|
+
* Default per-node floating toolbar component.
|
|
938
|
+
* Renders actions based on the resolved action list from the action registry.
|
|
939
|
+
* Supports both 'button' and 'drag-handle' action types.
|
|
940
|
+
*
|
|
941
|
+
* Positioning is owned by WidgetRenderer's measurable floating wrapper. The
|
|
942
|
+
* resolved placement controls whether actions use a vertical or horizontal row.
|
|
943
|
+
*/
|
|
944
|
+
declare const _default$8: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
945
|
+
nodeId: {
|
|
946
|
+
type: StringConstructor;
|
|
947
|
+
required: true;
|
|
948
|
+
};
|
|
949
|
+
nodeType: {
|
|
950
|
+
type: StringConstructor;
|
|
951
|
+
required: true;
|
|
952
|
+
};
|
|
953
|
+
owner: {
|
|
954
|
+
type: PropType<NodeOwner>;
|
|
955
|
+
required: true;
|
|
956
|
+
};
|
|
957
|
+
actions: {
|
|
958
|
+
type: PropType<ResolvedNodeAction[]>;
|
|
959
|
+
required: true;
|
|
960
|
+
};
|
|
961
|
+
state: {
|
|
962
|
+
type: PropType<NodeInteractionState>;
|
|
963
|
+
required: true;
|
|
964
|
+
};
|
|
965
|
+
toolbarPosition: {
|
|
966
|
+
type: PropType<ToolbarPositionData>;
|
|
967
|
+
default: undefined;
|
|
968
|
+
};
|
|
969
|
+
onDragStart: {
|
|
970
|
+
type: PropType<(e: DragEvent) => void>;
|
|
971
|
+
required: true;
|
|
972
|
+
};
|
|
973
|
+
onDragEnd: {
|
|
974
|
+
type: PropType<(e: DragEvent) => void>;
|
|
975
|
+
required: true;
|
|
976
|
+
};
|
|
977
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
978
|
+
[key: string]: any;
|
|
979
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
980
|
+
nodeId: {
|
|
981
|
+
type: StringConstructor;
|
|
982
|
+
required: true;
|
|
983
|
+
};
|
|
984
|
+
nodeType: {
|
|
985
|
+
type: StringConstructor;
|
|
986
|
+
required: true;
|
|
987
|
+
};
|
|
988
|
+
owner: {
|
|
989
|
+
type: PropType<NodeOwner>;
|
|
990
|
+
required: true;
|
|
991
|
+
};
|
|
992
|
+
actions: {
|
|
993
|
+
type: PropType<ResolvedNodeAction[]>;
|
|
994
|
+
required: true;
|
|
995
|
+
};
|
|
996
|
+
state: {
|
|
997
|
+
type: PropType<NodeInteractionState>;
|
|
998
|
+
required: true;
|
|
999
|
+
};
|
|
1000
|
+
toolbarPosition: {
|
|
1001
|
+
type: PropType<ToolbarPositionData>;
|
|
1002
|
+
default: undefined;
|
|
1003
|
+
};
|
|
1004
|
+
onDragStart: {
|
|
1005
|
+
type: PropType<(e: DragEvent) => void>;
|
|
1006
|
+
required: true;
|
|
1007
|
+
};
|
|
1008
|
+
onDragEnd: {
|
|
1009
|
+
type: PropType<(e: DragEvent) => void>;
|
|
1010
|
+
required: true;
|
|
1011
|
+
};
|
|
1012
|
+
}>> & Readonly<{}>, {
|
|
1013
|
+
toolbarPosition: ToolbarPositionData;
|
|
1014
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1015
|
+
//#endregion
|
|
1016
|
+
//#region src/components/DefaultWidgetFallback.d.ts
|
|
1017
|
+
declare const _default$9: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
1018
|
+
nodeId: {
|
|
1019
|
+
type: PropType<string>;
|
|
1020
|
+
required: true;
|
|
1021
|
+
};
|
|
1022
|
+
nodeType: {
|
|
1023
|
+
type: PropType<string>;
|
|
1024
|
+
default: string;
|
|
1025
|
+
};
|
|
1026
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1027
|
+
[key: string]: any;
|
|
1028
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1029
|
+
nodeId: {
|
|
1030
|
+
type: PropType<string>;
|
|
1031
|
+
required: true;
|
|
1032
|
+
};
|
|
1033
|
+
nodeType: {
|
|
1034
|
+
type: PropType<string>;
|
|
1035
|
+
default: string;
|
|
1036
|
+
};
|
|
1037
|
+
}>> & Readonly<{}>, {
|
|
1038
|
+
nodeType: string;
|
|
1039
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1040
|
+
//#endregion
|
|
1041
|
+
//#region src/components/RootRenderer.d.ts
|
|
1042
|
+
declare const _default$10: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
1043
|
+
engine: {
|
|
1044
|
+
type: PropType<DesignerEngine>;
|
|
1045
|
+
required: true;
|
|
1046
|
+
};
|
|
1047
|
+
componentMap: {
|
|
1048
|
+
type: PropType<ComponentMap>;
|
|
1049
|
+
required: true;
|
|
1050
|
+
};
|
|
1051
|
+
extensions: {
|
|
1052
|
+
type: PropType<RendererExtensions>;
|
|
1053
|
+
default: () => {};
|
|
1054
|
+
};
|
|
1055
|
+
eventHooks: {
|
|
1056
|
+
type: PropType<RendererEventHooks>;
|
|
1057
|
+
default: undefined;
|
|
1058
|
+
};
|
|
1059
|
+
actionInterceptors: {
|
|
1060
|
+
type: PropType<ActionInterceptor[]>;
|
|
1061
|
+
default: undefined;
|
|
1062
|
+
};
|
|
1063
|
+
actionRegistry: {
|
|
1064
|
+
type: PropType<NodeActionRegistry>;
|
|
1065
|
+
default: undefined;
|
|
1066
|
+
};
|
|
1067
|
+
dragOverNodeId: {
|
|
1068
|
+
type: PropType<Ref<string | null>>;
|
|
1069
|
+
default: undefined;
|
|
1070
|
+
};
|
|
1071
|
+
dragOverIndex: {
|
|
1072
|
+
type: PropType<Ref<number | null>>;
|
|
1073
|
+
default: undefined;
|
|
1074
|
+
};
|
|
1075
|
+
activeDestination: {
|
|
1076
|
+
type: PropType<Ref<NodeDestination | null>>;
|
|
1077
|
+
default: undefined;
|
|
1078
|
+
};
|
|
1079
|
+
containerDropDecision: {
|
|
1080
|
+
type: PropType<Ref<PlacementDecision | null>>;
|
|
1081
|
+
default: undefined;
|
|
1082
|
+
};
|
|
1083
|
+
onContainerDragOver: {
|
|
1084
|
+
type: PropType<(target: ContainerDropTarget | ContainerDropRejection) => void>;
|
|
1085
|
+
default: undefined;
|
|
1086
|
+
};
|
|
1087
|
+
onContainerDragLeave: {
|
|
1088
|
+
type: PropType<(event: DragEvent) => void>;
|
|
1089
|
+
default: undefined;
|
|
1090
|
+
};
|
|
1091
|
+
onContainerDrop: {
|
|
1092
|
+
type: PropType<(event: DragEvent) => void>;
|
|
1093
|
+
default: undefined;
|
|
1094
|
+
};
|
|
1095
|
+
interactionBoundary: {
|
|
1096
|
+
type: PropType<Ref<HTMLElement | null>>;
|
|
1097
|
+
default: undefined;
|
|
1098
|
+
};
|
|
1099
|
+
isForbidden: {
|
|
1100
|
+
type: PropType<Ref<boolean>>;
|
|
1101
|
+
default: undefined;
|
|
1102
|
+
};
|
|
1103
|
+
forbiddenReason: {
|
|
1104
|
+
type: PropType<Ref<CreationBlockReason | null>>;
|
|
1105
|
+
default: undefined;
|
|
1106
|
+
};
|
|
1107
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1108
|
+
[key: string]: any;
|
|
1109
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1110
|
+
engine: {
|
|
1111
|
+
type: PropType<DesignerEngine>;
|
|
1112
|
+
required: true;
|
|
1113
|
+
};
|
|
1114
|
+
componentMap: {
|
|
1115
|
+
type: PropType<ComponentMap>;
|
|
1116
|
+
required: true;
|
|
1117
|
+
};
|
|
1118
|
+
extensions: {
|
|
1119
|
+
type: PropType<RendererExtensions>;
|
|
1120
|
+
default: () => {};
|
|
1121
|
+
};
|
|
1122
|
+
eventHooks: {
|
|
1123
|
+
type: PropType<RendererEventHooks>;
|
|
1124
|
+
default: undefined;
|
|
1125
|
+
};
|
|
1126
|
+
actionInterceptors: {
|
|
1127
|
+
type: PropType<ActionInterceptor[]>;
|
|
1128
|
+
default: undefined;
|
|
1129
|
+
};
|
|
1130
|
+
actionRegistry: {
|
|
1131
|
+
type: PropType<NodeActionRegistry>;
|
|
1132
|
+
default: undefined;
|
|
1133
|
+
};
|
|
1134
|
+
dragOverNodeId: {
|
|
1135
|
+
type: PropType<Ref<string | null>>;
|
|
1136
|
+
default: undefined;
|
|
1137
|
+
};
|
|
1138
|
+
dragOverIndex: {
|
|
1139
|
+
type: PropType<Ref<number | null>>;
|
|
1140
|
+
default: undefined;
|
|
1141
|
+
};
|
|
1142
|
+
activeDestination: {
|
|
1143
|
+
type: PropType<Ref<NodeDestination | null>>;
|
|
1144
|
+
default: undefined;
|
|
1145
|
+
};
|
|
1146
|
+
containerDropDecision: {
|
|
1147
|
+
type: PropType<Ref<PlacementDecision | null>>;
|
|
1148
|
+
default: undefined;
|
|
1149
|
+
};
|
|
1150
|
+
onContainerDragOver: {
|
|
1151
|
+
type: PropType<(target: ContainerDropTarget | ContainerDropRejection) => void>;
|
|
1152
|
+
default: undefined;
|
|
1153
|
+
};
|
|
1154
|
+
onContainerDragLeave: {
|
|
1155
|
+
type: PropType<(event: DragEvent) => void>;
|
|
1156
|
+
default: undefined;
|
|
1157
|
+
};
|
|
1158
|
+
onContainerDrop: {
|
|
1159
|
+
type: PropType<(event: DragEvent) => void>;
|
|
1160
|
+
default: undefined;
|
|
1161
|
+
};
|
|
1162
|
+
interactionBoundary: {
|
|
1163
|
+
type: PropType<Ref<HTMLElement | null>>;
|
|
1164
|
+
default: undefined;
|
|
1165
|
+
};
|
|
1166
|
+
isForbidden: {
|
|
1167
|
+
type: PropType<Ref<boolean>>;
|
|
1168
|
+
default: undefined;
|
|
1169
|
+
};
|
|
1170
|
+
forbiddenReason: {
|
|
1171
|
+
type: PropType<Ref<CreationBlockReason | null>>;
|
|
1172
|
+
default: undefined;
|
|
1173
|
+
};
|
|
1174
|
+
}>> & Readonly<{}>, {
|
|
1175
|
+
extensions: RendererExtensions;
|
|
1176
|
+
eventHooks: RendererEventHooks;
|
|
1177
|
+
actionInterceptors: ActionInterceptor[];
|
|
1178
|
+
actionRegistry: NodeActionRegistry;
|
|
1179
|
+
dragOverNodeId: Ref<string | null, string | null>;
|
|
1180
|
+
dragOverIndex: Ref<number | null, number | null>;
|
|
1181
|
+
activeDestination: Ref<NodeDestination | null, NodeDestination | null>;
|
|
1182
|
+
containerDropDecision: Ref<PlacementDecision | null, PlacementDecision | null>;
|
|
1183
|
+
onContainerDragOver: (target: ContainerDropTarget | ContainerDropRejection) => void;
|
|
1184
|
+
onContainerDragLeave: (event: DragEvent) => void;
|
|
1185
|
+
onContainerDrop: (event: DragEvent) => void;
|
|
1186
|
+
interactionBoundary: Ref<HTMLElement | null, HTMLElement | null>;
|
|
1187
|
+
isForbidden: Ref<boolean, boolean>;
|
|
1188
|
+
forbiddenReason: Ref<CreationBlockReason | null, CreationBlockReason | null>;
|
|
1189
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1190
|
+
//#endregion
|
|
1191
|
+
//#region src/components/WidgetRenderer.d.ts
|
|
1192
|
+
/**
|
|
1193
|
+
* WidgetRenderer — thin orchestration layer.
|
|
1194
|
+
*
|
|
1195
|
+
* Delegates all logic to composables (useWidgetNode, useNodeActions, useNodeDrag)
|
|
1196
|
+
* and renders via configurable extension components (nodeMask, nodeHandle,
|
|
1197
|
+
* nodeToolbar, widgetFallback, nodeWrapper).
|
|
1198
|
+
*/
|
|
1199
|
+
declare const _default$11: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
1200
|
+
node: {
|
|
1201
|
+
type: PropType<SchemaNode>;
|
|
1202
|
+
required: true;
|
|
1203
|
+
};
|
|
1204
|
+
owner: {
|
|
1205
|
+
type: PropType<NodeOwner>;
|
|
1206
|
+
default: () => {
|
|
1207
|
+
kind: string;
|
|
1208
|
+
};
|
|
1209
|
+
};
|
|
1210
|
+
selectionPlane: {
|
|
1211
|
+
type: PropType<NodeSelectionPlane>;
|
|
1212
|
+
default: undefined;
|
|
1213
|
+
};
|
|
1214
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1215
|
+
[key: string]: any;
|
|
1216
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1217
|
+
node: {
|
|
1218
|
+
type: PropType<SchemaNode>;
|
|
1219
|
+
required: true;
|
|
1220
|
+
};
|
|
1221
|
+
owner: {
|
|
1222
|
+
type: PropType<NodeOwner>;
|
|
1223
|
+
default: () => {
|
|
1224
|
+
kind: string;
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
selectionPlane: {
|
|
1228
|
+
type: PropType<NodeSelectionPlane>;
|
|
1229
|
+
default: undefined;
|
|
1230
|
+
};
|
|
1231
|
+
}>> & Readonly<{}>, {
|
|
1232
|
+
owner: NodeOwner;
|
|
1233
|
+
selectionPlane: NodeSelectionPlane;
|
|
1234
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1235
|
+
//#endregion
|
|
1236
|
+
//#region src/composables/useNodeActions.d.ts
|
|
1237
|
+
interface UseNodeActionsReturn {
|
|
1238
|
+
/** Resolved actions for the current node with visibility/disabled computed */
|
|
1239
|
+
actions: ComputedRef<ResolvedNodeAction[]>;
|
|
1240
|
+
/** The action context for the current node */
|
|
1241
|
+
actionContext: ComputedRef<NodeActionContext>;
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Composable that resolves the action system for a specific node.
|
|
1245
|
+
* Provides the list of visible, resolved actions with their handlers.
|
|
1246
|
+
*
|
|
1247
|
+
* @param getNode - Getter for the current schema node
|
|
1248
|
+
* @param ctx - The renderer context
|
|
1249
|
+
*/
|
|
1250
|
+
declare function useNodeActions(getNode: () => SchemaNode, ctx: RendererContext, getOwner?: () => NodeOwner): UseNodeActionsReturn;
|
|
1251
|
+
//#endregion
|
|
1252
|
+
//#region src/composables/useNodeDrag.d.ts
|
|
1253
|
+
interface UseNodeDragReturn {
|
|
1254
|
+
/** Start a drag operation from the drag handle */
|
|
1255
|
+
handleDragStart: (e: DragEvent) => void;
|
|
1256
|
+
/** End a drag operation */
|
|
1257
|
+
handleDragEnd: (e: DragEvent) => void;
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Composable that encapsulates drag handle behavior for a widget node.
|
|
1261
|
+
* Integrates with event hooks for interceptable drag operations.
|
|
1262
|
+
*
|
|
1263
|
+
* @param getNode - Getter for the current schema node
|
|
1264
|
+
* @param ctx - The renderer context (from useRendererContext)
|
|
1265
|
+
*/
|
|
1266
|
+
declare function useNodeDrag(getNode: () => SchemaNode, ctx: RendererContext): UseNodeDragReturn;
|
|
1267
|
+
//#endregion
|
|
1268
|
+
//#region src/composables/useNodeInteractionGeometry.d.ts
|
|
1269
|
+
interface NodeInteractionRect {
|
|
1270
|
+
top: number;
|
|
1271
|
+
right: number;
|
|
1272
|
+
bottom: number;
|
|
1273
|
+
left: number;
|
|
1274
|
+
width: number;
|
|
1275
|
+
height: number;
|
|
1276
|
+
}
|
|
1277
|
+
interface NodeInteractionGeometry {
|
|
1278
|
+
visibleRect: NodeInteractionRect;
|
|
1279
|
+
paintRect: NodeInteractionRect;
|
|
1280
|
+
visible: boolean;
|
|
1281
|
+
}
|
|
1282
|
+
interface UseNodeInteractionGeometryOptions {
|
|
1283
|
+
mode: NodeInteractionGeometryMode;
|
|
1284
|
+
boundarySelector?: string;
|
|
1285
|
+
paintInset?: number;
|
|
1286
|
+
selfTargetSelector?: string;
|
|
1287
|
+
}
|
|
1288
|
+
interface UseNodeInteractionGeometryReturn {
|
|
1289
|
+
geometry: Ref<NodeInteractionGeometry>;
|
|
1290
|
+
update: () => void;
|
|
1291
|
+
}
|
|
1292
|
+
declare function useNodeInteractionGeometry(elRef: Ref<HTMLElement | null>, isActive: Ref<boolean>, options: UseNodeInteractionGeometryOptions): UseNodeInteractionGeometryReturn;
|
|
1293
|
+
//#endregion
|
|
1294
|
+
//#region src/composables/useNodeSelectionProjection.d.ts
|
|
1295
|
+
interface UseNodeSelectionProjectionOptions {
|
|
1296
|
+
kind: NodeSelectionProjectionKind;
|
|
1297
|
+
plane: Ref<NodeSelectionPlane>;
|
|
1298
|
+
selfTargetSelector?: string;
|
|
1299
|
+
}
|
|
1300
|
+
interface UseNodeSelectionProjectionReturn {
|
|
1301
|
+
projection: Ref<NodeSelectionProjection | null>;
|
|
1302
|
+
target: Readonly<Ref<HTMLElement | null>>;
|
|
1303
|
+
update: () => void;
|
|
1304
|
+
}
|
|
1305
|
+
declare function useNodeSelectionProjection(elRef: Ref<HTMLElement | null>, isSelected: Ref<boolean>, options: UseNodeSelectionProjectionOptions): UseNodeSelectionProjectionReturn;
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#region src/composables/useNodeState.d.ts
|
|
1308
|
+
/**
|
|
1309
|
+
* Computes reactive interaction state for a single schema node.
|
|
1310
|
+
*
|
|
1311
|
+
* @param getNodeId - Getter function returning the node ID (for reactivity safety)
|
|
1312
|
+
* @param ctx - The renderer context (from useRendererContext)
|
|
1313
|
+
*/
|
|
1314
|
+
declare function useNodeState(getNodeId: () => string, ctx: RendererContext): NodeInteractionState;
|
|
1315
|
+
//#endregion
|
|
1316
|
+
//#region src/composables/useToolbarPosition.d.ts
|
|
1317
|
+
interface UseToolbarPositionOptions {
|
|
1318
|
+
gap?: number;
|
|
1319
|
+
interactionBoundary?: Ref<HTMLElement | null>;
|
|
1320
|
+
targetSelector?: string;
|
|
1321
|
+
selfTargetSelector?: string;
|
|
1322
|
+
boundarySelector?: string;
|
|
1323
|
+
padding?: number;
|
|
1324
|
+
interactionGeometry?: Ref<NodeInteractionGeometry>;
|
|
1325
|
+
interactionGeometryUpdate?: () => void;
|
|
1326
|
+
placement?: NodeToolbarPlacement;
|
|
1327
|
+
orientation?: NodeToolbarOrientation;
|
|
1328
|
+
}
|
|
1329
|
+
interface UseToolbarPositionReturn {
|
|
1330
|
+
position: Ref<ToolbarPositionData>;
|
|
1331
|
+
update: () => Promise<void>;
|
|
1332
|
+
}
|
|
1333
|
+
declare function useToolbarPosition(referenceRef: Ref<HTMLElement | null>, floatingRef: Ref<HTMLElement | null>, isActive: Ref<boolean>, options?: UseToolbarPositionOptions): UseToolbarPositionReturn;
|
|
1334
|
+
//#endregion
|
|
1335
|
+
//#region src/composables/useWidgetNode.d.ts
|
|
1336
|
+
interface UseWidgetNodeReturn {
|
|
1337
|
+
/** Reactive interaction state (selected, hovered, drag-over) */
|
|
1338
|
+
state: NodeInteractionState;
|
|
1339
|
+
/** The resolved Vue component for this widget type, or undefined */
|
|
1340
|
+
resolvedComponent: ComputedRef<Component | undefined>;
|
|
1341
|
+
/** The widget meta from the registry */
|
|
1342
|
+
meta: ComputedRef<RendererWidgetMeta | undefined>;
|
|
1343
|
+
/** Whether to use mask (from meta.mask, default true) */
|
|
1344
|
+
useMask: ComputedRef<boolean>;
|
|
1345
|
+
/** Whether this node is selectable (from meta.selectable, default true) */
|
|
1346
|
+
selectable: ComputedRef<boolean>;
|
|
1347
|
+
/** Whether this node is draggable (from meta.draggable, default true) */
|
|
1348
|
+
draggable: ComputedRef<boolean>;
|
|
1349
|
+
/** Whether this node is sortable / position-locked (from meta.sortable, default true) */
|
|
1350
|
+
sortable: ComputedRef<boolean>;
|
|
1351
|
+
/** Whether this node belongs to a sortable scope */
|
|
1352
|
+
inSortScope: ComputedRef<boolean>;
|
|
1353
|
+
/** Whether this node is the active drag source */
|
|
1354
|
+
isDragging: ComputedRef<boolean>;
|
|
1355
|
+
/** Whether this node is visible (from layout.visible, default true) */
|
|
1356
|
+
visible: ComputedRef<boolean>;
|
|
1357
|
+
/** Resolved open layout metadata */
|
|
1358
|
+
layout: ComputedRef<ResolvedNodeLayout>;
|
|
1359
|
+
/** CSS classes for the node wrapper */
|
|
1360
|
+
wrapperClasses: ComputedRef<Array<string | Record<string, boolean>>>;
|
|
1361
|
+
/** Handle select event */
|
|
1362
|
+
handleSelect: (e: MouseEvent) => void;
|
|
1363
|
+
/** Handle mouse enter */
|
|
1364
|
+
handleMouseEnter: () => void;
|
|
1365
|
+
/** Handle mouse leave */
|
|
1366
|
+
handleMouseLeave: () => void;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Composable that extracts all widget node state and event handling logic.
|
|
1370
|
+
* This is the primary composable for building custom node renderers.
|
|
1371
|
+
*
|
|
1372
|
+
* @param getNode - Getter for the current schema node
|
|
1373
|
+
* @param ctx - The renderer context (from useRendererContext)
|
|
1374
|
+
*/
|
|
1375
|
+
declare function useWidgetNode(getNode: () => SchemaNode, ctx: RendererContext): UseWidgetNodeReturn;
|
|
1376
|
+
//#endregion
|
|
1377
|
+
//#region src/container-runtime.d.ts
|
|
1378
|
+
interface ContainerRuntime {
|
|
1379
|
+
nodeId: ComputedRef<string>;
|
|
1380
|
+
variant: ComputedRef<ContainerVariantId>;
|
|
1381
|
+
regionDefinitions: ComputedRef<DeepReadonly<ContainerRegionDefinition[]>>;
|
|
1382
|
+
getRegionNodes: (regionId: ContainerRegionId) => DeepReadonly<SchemaNode[]>;
|
|
1383
|
+
requestVariantChange: (variant: ContainerVariantId) => CommandExecutionResult;
|
|
1384
|
+
}
|
|
1385
|
+
declare const CONTAINER_RUNTIME_CONTEXT_KEY: InjectionKey<ContainerRuntime>;
|
|
1386
|
+
declare function createContainerRuntime(getNode: () => SchemaNode, ctx: RendererContext): ContainerRuntime;
|
|
1387
|
+
declare function useContainerRuntime(): ContainerRuntime;
|
|
1388
|
+
//#endregion
|
|
1389
|
+
//#region src/context.d.ts
|
|
1390
|
+
/**
|
|
1391
|
+
* Creates a RendererContext from options.
|
|
1392
|
+
* Called internally by RootRenderer.
|
|
1393
|
+
*/
|
|
1394
|
+
declare function createRendererContext(options: RendererOptions): RendererContext;
|
|
1395
|
+
/**
|
|
1396
|
+
* Injects the RendererContext from the nearest ancestor RootRenderer.
|
|
1397
|
+
* Throws if called outside the renderer component tree.
|
|
1398
|
+
*/
|
|
1399
|
+
declare function useRendererContext(): RendererContext;
|
|
1400
|
+
//#endregion
|
|
1401
|
+
//#region src/drag-image.d.ts
|
|
1402
|
+
declare function hideNativeDragImage(dataTransfer: DataTransfer | null): void;
|
|
1403
|
+
//#endregion
|
|
1404
|
+
//#region src/messages.d.ts
|
|
1405
|
+
declare const rendererMessages: Record<string, MessageTree>;
|
|
1406
|
+
//#endregion
|
|
1407
|
+
//#region src/widget-runtime.d.ts
|
|
1408
|
+
interface WidgetRuntimeContext {
|
|
1409
|
+
nodeId: Readonly<Ref<string>>;
|
|
1410
|
+
nodeType: Readonly<Ref<string>>;
|
|
1411
|
+
updateProps: (patch: Record<string, unknown>) => void;
|
|
1412
|
+
updateStyle: (patch: NodeStyle) => void;
|
|
1413
|
+
updateContainerStyle: (patch: StyleValueMap) => void;
|
|
1414
|
+
updateContentStyle: (patch: StyleValueMap) => void;
|
|
1415
|
+
}
|
|
1416
|
+
declare const WIDGET_RUNTIME_CONTEXT_KEY: InjectionKey<WidgetRuntimeContext>;
|
|
1417
|
+
declare function useWidgetRuntime(): WidgetRuntimeContext;
|
|
1418
|
+
//#endregion
|
|
1419
|
+
export { type ActionConfirmRequest, type ActionDecision, type ActionInterceptor, type ActionInvocation, ActionKey, type ActionRisk, CONTAINER_RUNTIME_CONTEXT_KEY, type ComponentMap, type ConfirmActionInterceptorOptions, type ContainerDropRejection, type ContainerDropRendererOptions, type ContainerDropTarget, _default as ContainerRegionOutlet, type ContainerRegionOutletDropProps, type ContainerRegionOutletProps, type ContainerRuntime, type DeepReadonly, _default$1 as DefaultContainerFallback, DefaultContainerShell, _default$2 as DefaultDropIndicator, _default$3 as DefaultEmptyState, _default$4 as DefaultForbiddenOverlay, _default$5 as DefaultNodeHandle, _default$6 as DefaultNodeMask, _default$7 as DefaultNodeSelection, _default$8 as DefaultNodeToolbar, _default$9 as DefaultWidgetFallback, type DragHookPayload, type EmptyStateProps, type ForbiddenOverlayProps, type HoverHookPayload, type MaybePromise, NODE_SELECTION_PLANE_KEY, NODE_SELECTION_PRESENTATION_KEY, type NodeActionContext, type NodeActionDefinition, type NodeActionRegistry, type NodeHandleProps, type NodeInteractionGeometry, type NodeInteractionGeometryMode, type NodeInteractionPresentation, type NodeInteractionRect, type NodeInteractionState, type NodeMaskProps, type NodeSelectionPlane, type NodeSelectionPresentation, type NodeSelectionPresentationHost, type NodeSelectionProjection, type NodeSelectionProjectionKind, type NodeSelectionProps, type NodeSelectionRect, type NodeToolbarOrientation, type NodeToolbarPlacement, type NodeToolbarProps, type NodeWrapperProps, RENDERER_CONTEXT_KEY, type RendererContainerAdapter, type RendererContext, type RendererEventHooks, type RendererExtensions, type RendererOptions, type RendererWidgetActionExtra, type RendererWidgetMeta, type ResolveContainerDropIndex, type ResolveContainerDropIndexContext, type ResolvedNodeAction, _default$10 as RootRenderer, type SelectHookPayload, type ToolbarPositionData, type UseNodeActionsReturn, type UseNodeDragReturn, type UseNodeInteractionGeometryOptions, type UseNodeInteractionGeometryReturn, type UseNodeSelectionProjectionOptions, type UseNodeSelectionProjectionReturn, type UseToolbarPositionReturn, type UseWidgetNodeReturn, WIDGET_RUNTIME_CONTEXT_KEY, type WidgetActionConfig, type WidgetFallbackProps, _default$11 as WidgetRenderer, type WidgetRendererProps, type WidgetRuntimeContext, createConfirmActionInterceptor, createContainerRuntime, createDefaultActions, createDefaultEventHooks, createNodeActionRegistry, createNodeSelectionPresentation, createRendererContext, fireAfterHook, hideNativeDragImage, rendererMessages, resolveBeforeHook, resolveNodeInteractionPresentation, runActionPipeline, useContainerRuntime, useNodeActions, useNodeDrag, useNodeInteractionGeometry, useNodeSelectionPresentation, useNodeSelectionProjection, useNodeState, useRendererContext, useToolbarPosition, useWidgetNode, useWidgetRuntime };
|