@dragcraft/designer 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 +502 -0
- package/dist/index.mjs +2228 -0
- package/dist/structure.css +613 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-PRESENT hackycy <https://github.com/hackycy>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import { AddNodePayload, BehaviorPredicate, Command, Command as Command$1, CommandExecutionResult, CommandHandler, CommandType, ContainerDefinition, ContainerVariantMigrationContext, ContainerVariantMigrationResult, CreatableBehaviorPredicate, CreatableBehaviorResult, CreatableDecision, CreationBlockReason, CreationBlockReason as CreationBlockReason$1, DeepReadonly as DeepReadonly$1, DesignerEngine, DesignerEngine as DesignerEngine$1, DesignerSchema, DesignerSchema as DesignerSchema$1, DragTarget, EngineOptions, EngineOptions as EngineOptions$1, EngineStore, EngineStore as EngineStore$1, EventName, HistoryEntry, HistoryState, InstanceBehaviorContext, MoveNodePayload, NodeDestination, PlacementDecision, RemoveNodePayload, SchemaNode, SchemaNode as SchemaNode$1, SetGlobalConfigPayload, TypeBehaviorContext, UpdatePropsPayload, WidgetActionConfig, WidgetMeta, WidgetMeta as WidgetMeta$1, createEngine, resolveBehavior, resolveCreatable } from "@dragcraft/core";
|
|
2
|
+
import { ActionConfirmRequest, ActionDecision, ActionInterceptor, ActionInterceptor as ActionInterceptor$1, ActionInvocation, ActionKey, ActionRisk, ComponentMap, ComponentMap as ComponentMap$1, ConfirmActionInterceptorOptions, ContainerDropRejection, ContainerDropTarget, ContainerRegionOutlet, DeepReadonly, DefaultEmptyState, DefaultNodeHandle, DefaultNodeMask, DefaultNodeToolbar, EmptyStateProps, NodeActionContext, NodeActionDefinition, NodeActionDefinition as NodeActionDefinition$1, NodeActionRegistry, NodeActionRegistry as NodeActionRegistry$1, NodeHandleProps, NodeInteractionGeometry, NodeInteractionGeometryMode, NodeInteractionPresentation, NodeInteractionRect, NodeMaskProps, NodeToolbarOrientation, NodeToolbarPlacement, NodeToolbarProps, NodeWrapperProps, RendererEventHooks, RendererEventHooks as RendererEventHooks$1, RendererExtensions, RendererExtensions as RendererExtensions$1, RendererOptions, RendererWidgetActionExtra, RendererWidgetMeta, RendererWidgetMeta as RendererWidgetMeta$1, ResolveContainerDropIndexContext, ResolvedNodeAction, RootRenderer, UseNodeInteractionGeometryOptions, UseNodeInteractionGeometryReturn, WidgetActionConfig as RendererWidgetActionConfig, WidgetFallbackProps, createConfirmActionInterceptor, createDefaultActions, createNodeActionRegistry, useContainerRuntime, useNodeActions, useNodeDrag, useNodeInteractionGeometry, useWidgetNode } from "@dragcraft/renderer";
|
|
3
|
+
import { Component, ComputedRef, InjectionKey, PropType, Ref, VNodeChild } from "vue";
|
|
4
|
+
import { FlatMessages, I18N_KEY, I18nInstance, I18nInstance as I18nInstance$1, LocaleMessages, LocaleMessages as LocaleMessages$1, MessageTree, MessageTree as MessageTree$1, createI18n, useI18n } from "@dragcraft/i18n";
|
|
5
|
+
import { FieldBindingScope, FieldBindingTarget, FieldChangePayload, FieldComponentMap, FieldComponentMap as FieldComponentMap$1, FieldSchema, FormGenerator, FormSchema, FormSchema as FormSchema$1, SectionSchema, ValidationRule } from "@dragcraft/form-generator";
|
|
6
|
+
//#region src/bindings/field-binding.d.ts
|
|
7
|
+
type FieldBinding = string | FieldBindingTarget | undefined;
|
|
8
|
+
interface ResolvedFieldBinding {
|
|
9
|
+
scope: FieldBindingScope;
|
|
10
|
+
path: string;
|
|
11
|
+
}
|
|
12
|
+
declare function resolveFieldBinding(binding: FieldBinding, fallback: ResolvedFieldBinding): ResolvedFieldBinding;
|
|
13
|
+
declare function readBindingValue(binding: ResolvedFieldBinding, schema: DeepReadonly$1<DesignerSchema$1>, node: DeepReadonly$1<SchemaNode$1> | null): unknown;
|
|
14
|
+
declare function createBindingCommand(binding: ResolvedFieldBinding, value: unknown, nodeId?: string): Command$1 | null;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/DcCanvas.d.ts
|
|
17
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/composables/useCanvasPan.d.ts
|
|
22
|
+
type CanvasInteractionMode = 'pointer' | 'hand';
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/DcCanvasControls.d.ts
|
|
25
|
+
declare const _default$1: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
26
|
+
interactionMode: {
|
|
27
|
+
type: PropType<CanvasInteractionMode>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
modeChange: (_mode: CanvasInteractionMode) => true;
|
|
34
|
+
resetView: () => true;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
interactionMode: {
|
|
37
|
+
type: PropType<CanvasInteractionMode>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
}>> & Readonly<{
|
|
41
|
+
onModeChange?: ((_mode: CanvasInteractionMode) => any) | undefined;
|
|
42
|
+
onResetView?: (() => any) | undefined;
|
|
43
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/types.d.ts
|
|
46
|
+
type DesignerWorkspaceMode = 'wide' | 'compact';
|
|
47
|
+
interface DesignerWorkspaceOptions {
|
|
48
|
+
compactBreakpoint?: number;
|
|
49
|
+
defaultLeftOpen?: boolean;
|
|
50
|
+
defaultRightOpen?: boolean;
|
|
51
|
+
keyboardShortcuts?: boolean;
|
|
52
|
+
leftPanelWidth?: number;
|
|
53
|
+
rightPanelWidth?: number;
|
|
54
|
+
railWidth?: number;
|
|
55
|
+
drawerWidth?: number;
|
|
56
|
+
}
|
|
57
|
+
interface DesignerWorkspaceController {
|
|
58
|
+
readonly compactBreakpoint: number;
|
|
59
|
+
readonly keyboardShortcuts: boolean;
|
|
60
|
+
readonly leftPanelWidth: number;
|
|
61
|
+
readonly rightPanelWidth: number;
|
|
62
|
+
readonly railWidth: number;
|
|
63
|
+
readonly drawerWidth: number;
|
|
64
|
+
mode: Ref<DesignerWorkspaceMode>;
|
|
65
|
+
leftOpen: Ref<boolean>;
|
|
66
|
+
rightOpen: Ref<boolean>;
|
|
67
|
+
activeLeftPanel: Ref<LeftPanelTabKey>;
|
|
68
|
+
activeRightPanel: Ref<PropertyTabKey>;
|
|
69
|
+
setMode: (mode: DesignerWorkspaceMode) => void;
|
|
70
|
+
openLeft: (panel?: LeftPanelTabKey) => void;
|
|
71
|
+
closeLeft: () => void;
|
|
72
|
+
toggleLeft: (panel?: LeftPanelTabKey) => void;
|
|
73
|
+
openRight: (panel?: PropertyTabKey) => void;
|
|
74
|
+
closeRight: () => void;
|
|
75
|
+
toggleRight: (panel?: PropertyTabKey) => void;
|
|
76
|
+
closeDrawers: () => void;
|
|
77
|
+
}
|
|
78
|
+
interface DesignerEngineOptions extends EngineOptions$1 {
|
|
79
|
+
initialSchema?: DesignerSchema$1;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Widget group configuration with display title.
|
|
83
|
+
* Used by DcMaterialPanel to organize widgets into named groups.
|
|
84
|
+
*/
|
|
85
|
+
interface WidgetGroupConfig {
|
|
86
|
+
/** Group identifier (matches WidgetMeta.group) */
|
|
87
|
+
name: string;
|
|
88
|
+
/** Display title shown in the material panel */
|
|
89
|
+
title: string;
|
|
90
|
+
/** i18n message key for title; overrides `title` when i18n is active */
|
|
91
|
+
titleKey?: string;
|
|
92
|
+
}
|
|
93
|
+
type MaterialItemIcon = string | Component;
|
|
94
|
+
/**
|
|
95
|
+
* Designer-owned display metadata for a widget in the material panel.
|
|
96
|
+
* Core registration remains UI-agnostic; this protocol only affects designer UI.
|
|
97
|
+
*/
|
|
98
|
+
interface MaterialDisplayMeta {
|
|
99
|
+
/** Material panel title override. Falls back to WidgetMeta.title/titleKey. */
|
|
100
|
+
title?: string;
|
|
101
|
+
/** i18n message key for material panel title. */
|
|
102
|
+
titleKey?: string;
|
|
103
|
+
/** Icon or Vue component shown in the material panel. Falls back to WidgetMeta.icon. */
|
|
104
|
+
icon?: MaterialItemIcon;
|
|
105
|
+
/** Short supporting copy for richer material cards. */
|
|
106
|
+
description?: string;
|
|
107
|
+
/** i18n message key for description. */
|
|
108
|
+
descriptionKey?: string;
|
|
109
|
+
/** Image URL for visual material cards. */
|
|
110
|
+
thumbnail?: string;
|
|
111
|
+
/** Compact labels shown by custom material item renderers. */
|
|
112
|
+
tags?: string[];
|
|
113
|
+
/** Additional search terms for the material panel. */
|
|
114
|
+
keywords?: string[];
|
|
115
|
+
/** App-specific display data for custom material item renderers. */
|
|
116
|
+
metadata?: Record<string, unknown>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Widget metadata accepted by designer. Extends renderer metadata with
|
|
120
|
+
* material-panel display information without coupling core to Vue UI.
|
|
121
|
+
*/
|
|
122
|
+
interface DesignerWidgetMeta extends RendererWidgetMeta$1 {
|
|
123
|
+
material?: MaterialDisplayMeta;
|
|
124
|
+
}
|
|
125
|
+
interface ResolvedMaterialItem {
|
|
126
|
+
title: string;
|
|
127
|
+
icon?: MaterialItemIcon;
|
|
128
|
+
description?: string;
|
|
129
|
+
thumbnail?: string;
|
|
130
|
+
tags: string[];
|
|
131
|
+
keywords: string[];
|
|
132
|
+
}
|
|
133
|
+
interface MaterialItemRenderProps {
|
|
134
|
+
meta: DesignerWidgetMeta;
|
|
135
|
+
material: ResolvedMaterialItem;
|
|
136
|
+
draggable: boolean;
|
|
137
|
+
disabled: boolean;
|
|
138
|
+
dragging: boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Options accepted by createDesigner.
|
|
142
|
+
*
|
|
143
|
+
* Users must explicitly provide widget metas, component maps, and field maps.
|
|
144
|
+
*/
|
|
145
|
+
interface DesignerOptions {
|
|
146
|
+
/** Core engine options (initialSchema, maxHistorySize) */
|
|
147
|
+
engineOptions?: DesignerEngineOptions;
|
|
148
|
+
/** Widget metas to register with the engine */
|
|
149
|
+
widgetMetas?: DesignerWidgetMeta[];
|
|
150
|
+
/** Widget type → Vue component map for canvas rendering */
|
|
151
|
+
componentMap?: ComponentMap$1;
|
|
152
|
+
/** Widget group configurations for material panel. If not provided, groups are derived from registered widgets. */
|
|
153
|
+
widgetGroups?: WidgetGroupConfig[];
|
|
154
|
+
/** Field type → Vue component map for form-generator */
|
|
155
|
+
fieldComponentMap?: FieldComponentMap$1;
|
|
156
|
+
/** Global config form schema for the right panel Global tab */
|
|
157
|
+
globalConfigSchema?: FormSchema$1;
|
|
158
|
+
/** Extension point overrides */
|
|
159
|
+
extensions?: DesignerExtensions;
|
|
160
|
+
/** Renderer event hooks for selection, drag, and hover */
|
|
161
|
+
eventHooks?: RendererEventHooks$1;
|
|
162
|
+
/** Interceptors for node actions such as delete, move, duplicate, and custom actions */
|
|
163
|
+
actionInterceptors?: ActionInterceptor$1[];
|
|
164
|
+
/** Custom node action definitions to add or override default actions */
|
|
165
|
+
customActions?: NodeActionDefinition$1[];
|
|
166
|
+
/** Current locale (default: 'zh-CN') */
|
|
167
|
+
locale?: string;
|
|
168
|
+
/** Additional/override messages merged on top of designer and renderer defaults */
|
|
169
|
+
messages?: LocaleMessages$1;
|
|
170
|
+
/** Workbench layout and keyboard behavior. */
|
|
171
|
+
workspace?: DesignerWorkspaceOptions;
|
|
172
|
+
}
|
|
173
|
+
interface DesignerRailSlotAPI {
|
|
174
|
+
engine: DesignerEngine$1;
|
|
175
|
+
workspace: DesignerWorkspaceController;
|
|
176
|
+
t: I18nInstance$1['t'];
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* All available designer extension points.
|
|
180
|
+
*/
|
|
181
|
+
interface DesignerExtensions {
|
|
182
|
+
/** Completely replace the left material panel */
|
|
183
|
+
materialPanelRenderer?: Component;
|
|
184
|
+
/** Completely replace the right property panel */
|
|
185
|
+
propertyPanelRenderer?: Component;
|
|
186
|
+
/** Custom content renderer for a single material item. Designer owns the outer shell and drag behavior. */
|
|
187
|
+
materialItemRenderer?: (props: MaterialItemRenderProps) => VNodeChild;
|
|
188
|
+
/** Renderer extensions (dropIndicator) forwarded to @dragcraft/renderer */
|
|
189
|
+
rendererExtensions?: RendererExtensions$1;
|
|
190
|
+
/** Optional controls appended to the left sidebar rail. */
|
|
191
|
+
leftRailRenderer?: (api: DesignerRailSlotAPI) => VNodeChild;
|
|
192
|
+
/** Optional controls appended to the right sidebar rail. */
|
|
193
|
+
rightRailRenderer?: (api: DesignerRailSlotAPI) => VNodeChild;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* The object returned by createDesigner().
|
|
197
|
+
* Holds the core engine and resolved configuration.
|
|
198
|
+
*/
|
|
199
|
+
interface DesignerInstance {
|
|
200
|
+
/** The underlying core engine */
|
|
201
|
+
engine: DesignerEngine$1;
|
|
202
|
+
/** Merged component map (default + extra) */
|
|
203
|
+
componentMap: ComponentMap$1;
|
|
204
|
+
/** Widget group configurations for material panel */
|
|
205
|
+
widgetGroups: WidgetGroupConfig[] | undefined;
|
|
206
|
+
/** Resolved designer extensions */
|
|
207
|
+
extensions: DesignerExtensions;
|
|
208
|
+
/** Override field component map for form-generator */
|
|
209
|
+
fieldComponentMap: FieldComponentMap$1 | undefined;
|
|
210
|
+
/** Global config form schema, if provided */
|
|
211
|
+
globalConfigSchema: FormSchema$1 | null;
|
|
212
|
+
/** Renderer event hooks */
|
|
213
|
+
eventHooks: RendererEventHooks$1;
|
|
214
|
+
/** Node action interceptors */
|
|
215
|
+
actionInterceptors: ActionInterceptor$1[];
|
|
216
|
+
/** Node action registry */
|
|
217
|
+
actionRegistry: NodeActionRegistry$1;
|
|
218
|
+
/** i18n instance for locale management */
|
|
219
|
+
i18n: I18nInstance$1;
|
|
220
|
+
workspace: DesignerWorkspaceController;
|
|
221
|
+
/** Dispose all resources */
|
|
222
|
+
dispose: () => void;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Internal context provided to all designer descendants via provide/inject.
|
|
226
|
+
*/
|
|
227
|
+
interface DesignerContext {
|
|
228
|
+
engine: DesignerEngine$1;
|
|
229
|
+
componentMap: ComponentMap$1;
|
|
230
|
+
widgetGroups: WidgetGroupConfig[] | undefined;
|
|
231
|
+
extensions: DesignerExtensions;
|
|
232
|
+
fieldComponentMap: FieldComponentMap$1 | undefined;
|
|
233
|
+
globalConfigSchema: FormSchema$1 | null;
|
|
234
|
+
eventHooks: RendererEventHooks$1;
|
|
235
|
+
actionInterceptors: ActionInterceptor$1[];
|
|
236
|
+
actionRegistry: NodeActionRegistry$1;
|
|
237
|
+
workspace: DesignerWorkspaceController;
|
|
238
|
+
activeDestination: Ref<NodeDestination | null>;
|
|
239
|
+
containerDropDecision: Ref<PlacementDecision | null>;
|
|
240
|
+
dragOverNodeId: Ref<string | null>;
|
|
241
|
+
dragOverIndex: Ref<number | null>;
|
|
242
|
+
handleMaterialDragStart: (e: DragEvent, meta: RendererWidgetMeta$1) => void;
|
|
243
|
+
handleDragEnd: (e: DragEvent) => void;
|
|
244
|
+
handleCanvasDragOver: (e: DragEvent) => void;
|
|
245
|
+
handleCanvasDragLeave: (e: DragEvent) => void;
|
|
246
|
+
handleCanvasDrop: (e: DragEvent) => CommandExecutionResult;
|
|
247
|
+
handleContainerDragOver: (payload: ContainerDropTarget | ContainerDropRejection) => void;
|
|
248
|
+
handleContainerDragLeave: (e: DragEvent) => void;
|
|
249
|
+
handleContainerDrop: (e: DragEvent) => CommandExecutionResult;
|
|
250
|
+
/** Whether the current drag-over is forbidden */
|
|
251
|
+
isForbidden: Ref<boolean>;
|
|
252
|
+
/** User-facing reason for the current forbidden drag-over state */
|
|
253
|
+
forbiddenReason: Ref<(CreationBlockReason$1 & {
|
|
254
|
+
details?: Record<string, unknown>;
|
|
255
|
+
}) | null>;
|
|
256
|
+
searchQuery: Ref<string>;
|
|
257
|
+
activeTab: Ref<PropertyTabKey>;
|
|
258
|
+
leftPanelActiveTab: Ref<LeftPanelTabKey>;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Injection key for the designer context.
|
|
262
|
+
*/
|
|
263
|
+
declare const DESIGNER_CONTEXT_KEY: InjectionKey<DesignerContext>;
|
|
264
|
+
type PropertyTabKey = 'global' | 'widget';
|
|
265
|
+
type LeftPanelTabKey = 'materials' | 'structure';
|
|
266
|
+
/**
|
|
267
|
+
* Return type of useDesigner composable.
|
|
268
|
+
*/
|
|
269
|
+
interface UseDesignerReturn {
|
|
270
|
+
/** Reactive schema (from engine.store.schema ShallowRef) */
|
|
271
|
+
schema: EngineStore$1['schema'];
|
|
272
|
+
/** Currently selected node ID (reactive) */
|
|
273
|
+
selectedNodeId: EngineStore$1['selectedNodeId'];
|
|
274
|
+
/** Currently hovered node ID (reactive) */
|
|
275
|
+
hoveredNodeId: EngineStore$1['hoveredNodeId'];
|
|
276
|
+
/** Execute a command through the engine */
|
|
277
|
+
execute: DesignerEngine$1['execute'];
|
|
278
|
+
/** Undo last change */
|
|
279
|
+
undo: () => void;
|
|
280
|
+
/** Redo last undone change */
|
|
281
|
+
redo: () => void;
|
|
282
|
+
/** Whether undo is available */
|
|
283
|
+
canUndo: () => boolean;
|
|
284
|
+
/** Whether redo is available */
|
|
285
|
+
canRedo: () => boolean;
|
|
286
|
+
/** Import a full schema (replaces current) */
|
|
287
|
+
importSchema: (schema: DesignerSchema$1) => void;
|
|
288
|
+
/** Export current schema (deep clone) */
|
|
289
|
+
exportSchema: () => DesignerSchema$1;
|
|
290
|
+
/** Subscribe to engine events */
|
|
291
|
+
on: DesignerEngine$1['eventHub']['on'];
|
|
292
|
+
/** Unsubscribe from engine events */
|
|
293
|
+
off: DesignerEngine$1['eventHub']['off'];
|
|
294
|
+
}
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region src/components/DcDesigner.d.ts
|
|
297
|
+
declare const _default$2: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
298
|
+
instance: {
|
|
299
|
+
type: PropType<DesignerInstance>;
|
|
300
|
+
required: true;
|
|
301
|
+
};
|
|
302
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
303
|
+
[key: string]: any;
|
|
304
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
305
|
+
instance: {
|
|
306
|
+
type: PropType<DesignerInstance>;
|
|
307
|
+
required: true;
|
|
308
|
+
};
|
|
309
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region src/components/DcLeftSidebar.d.ts
|
|
312
|
+
declare const _default$3: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
313
|
+
[key: string]: any;
|
|
314
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/components/DcMaterialGroup.d.ts
|
|
317
|
+
declare const _default$4: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
318
|
+
title: {
|
|
319
|
+
type: PropType<string>;
|
|
320
|
+
required: true;
|
|
321
|
+
};
|
|
322
|
+
widgets: {
|
|
323
|
+
type: PropType<DesignerWidgetMeta[]>;
|
|
324
|
+
required: true;
|
|
325
|
+
};
|
|
326
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
327
|
+
[key: string]: any;
|
|
328
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
329
|
+
title: {
|
|
330
|
+
type: PropType<string>;
|
|
331
|
+
required: true;
|
|
332
|
+
};
|
|
333
|
+
widgets: {
|
|
334
|
+
type: PropType<DesignerWidgetMeta[]>;
|
|
335
|
+
required: true;
|
|
336
|
+
};
|
|
337
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/components/DcMaterialItem.d.ts
|
|
340
|
+
declare const _default$5: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
341
|
+
meta: {
|
|
342
|
+
type: PropType<DesignerWidgetMeta>;
|
|
343
|
+
required: true;
|
|
344
|
+
};
|
|
345
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
346
|
+
[key: string]: any;
|
|
347
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
348
|
+
meta: {
|
|
349
|
+
type: PropType<DesignerWidgetMeta>;
|
|
350
|
+
required: true;
|
|
351
|
+
};
|
|
352
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
353
|
+
//#endregion
|
|
354
|
+
//#region src/components/DcMaterialPanel.d.ts
|
|
355
|
+
declare const _default$6: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
356
|
+
[key: string]: any;
|
|
357
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/components/DcPropertyPanel.d.ts
|
|
360
|
+
declare const _default$7: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
361
|
+
[key: string]: any;
|
|
362
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/components/DcRightSidebar.d.ts
|
|
365
|
+
declare const _default$8: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
366
|
+
[key: string]: any;
|
|
367
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/components/DcStructurePanel.d.ts
|
|
370
|
+
declare const _default$9: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
371
|
+
[key: string]: any;
|
|
372
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/composables/useDesigner.d.ts
|
|
375
|
+
/**
|
|
376
|
+
* Composable that provides reactive access to designer state and operations.
|
|
377
|
+
* Thin wrapper around the engine's reactive store and API.
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```ts
|
|
381
|
+
* const designer = createDesigner()
|
|
382
|
+
* const { schema, selectedNodeId, undo, redo } = useDesigner(designer)
|
|
383
|
+
* ```
|
|
384
|
+
*/
|
|
385
|
+
declare function useDesigner(instance: DesignerInstance): UseDesignerReturn;
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/composables/useDragDrop.d.ts
|
|
388
|
+
interface UseDragDropReturn {
|
|
389
|
+
/** Unified root/container destination selected during drag-over. */
|
|
390
|
+
dragOverDestination: Ref<NodeDestination | null>;
|
|
391
|
+
/** Alias used by renderer container outlets. */
|
|
392
|
+
activeDestination: Ref<NodeDestination | null>;
|
|
393
|
+
/** Advisory placement decision for the active container destination. */
|
|
394
|
+
containerDropDecision: Ref<PlacementDecision | null>;
|
|
395
|
+
/** Compatibility projection for renderer extensions. */
|
|
396
|
+
dragOverNodeId: Ref<string | null>;
|
|
397
|
+
/** Compatibility projection for renderer extensions. */
|
|
398
|
+
dragOverIndex: Ref<number | null>;
|
|
399
|
+
/** Cached locked indices (recomputed only when schema changes) */
|
|
400
|
+
lockedIndices: ComputedRef<ReadonlySet<number>>;
|
|
401
|
+
/** Valid drop indices for the current drag operation */
|
|
402
|
+
validDropIndices: ComputedRef<ReadonlySet<number> | null>;
|
|
403
|
+
/** Start dragging a new widget from the material panel */
|
|
404
|
+
handleMaterialDragStart: (e: DragEvent, meta: RendererWidgetMeta$1) => void;
|
|
405
|
+
/** Handle dragover on the canvas (event delegation) */
|
|
406
|
+
handleCanvasDragOver: (e: DragEvent) => void;
|
|
407
|
+
/** Handle dragleave on the canvas (event delegation) */
|
|
408
|
+
handleCanvasDragLeave: (e: DragEvent) => void;
|
|
409
|
+
/** Handle drop on the canvas (event delegation) */
|
|
410
|
+
handleCanvasDrop: (e: DragEvent) => CommandExecutionResult;
|
|
411
|
+
/** Handle a material-resolved container destination or adapter rejection. */
|
|
412
|
+
handleContainerDragOver: (payload: ContainerDropTarget | ContainerDropRejection) => void;
|
|
413
|
+
/** Clear container feedback after leaving the active region. */
|
|
414
|
+
handleContainerDragLeave: (e: DragEvent) => void;
|
|
415
|
+
/** Commit the active container destination. */
|
|
416
|
+
handleContainerDrop: (e: DragEvent) => CommandExecutionResult;
|
|
417
|
+
/** Commit the current drag target to the current destination. */
|
|
418
|
+
commitDrop: () => CommandExecutionResult;
|
|
419
|
+
/** Handle drag end (cleanup) */
|
|
420
|
+
handleDragEnd: (e: DragEvent) => void;
|
|
421
|
+
/** Whether the current drag-over is forbidden */
|
|
422
|
+
isForbidden: Ref<boolean>;
|
|
423
|
+
/** User-facing reason for the current forbidden drag-over state */
|
|
424
|
+
forbiddenReason: Ref<DropRejectionReason | null>;
|
|
425
|
+
}
|
|
426
|
+
type DropRejectionReason = CreationBlockReason$1 & {
|
|
427
|
+
details?: Record<string, unknown>;
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* Coordinates HTML5 Drag and Drop between the material panel (drag source)
|
|
431
|
+
* and the canvas (drop target), bridging to core commands.
|
|
432
|
+
*
|
|
433
|
+
* Manages all drag-drop state including visual drop index computation
|
|
434
|
+
* and sortable constraint validation.
|
|
435
|
+
*/
|
|
436
|
+
declare function useDragDrop(engine: DesignerEngine$1): UseDragDropReturn;
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/composables/usePropertyBinding.d.ts
|
|
439
|
+
interface UsePropertyBindingOptions {
|
|
440
|
+
globalConfigSchema?: FormSchema$1 | null;
|
|
441
|
+
t?: (key: string, fallback?: string) => string;
|
|
442
|
+
}
|
|
443
|
+
interface UsePropertyBindingReturn {
|
|
444
|
+
/** The selected node, reactively derived */
|
|
445
|
+
selectedNode: ComputedRef<DeepReadonly$1<SchemaNode$1> | null>;
|
|
446
|
+
/** The form schema for the selected node's widget type */
|
|
447
|
+
selectedFormSchema: ComputedRef<FormSchema$1 | null>;
|
|
448
|
+
/** The selected widget meta */
|
|
449
|
+
selectedWidgetMeta: ComputedRef<WidgetMeta$1 | undefined>;
|
|
450
|
+
/** The current property values for the selected node */
|
|
451
|
+
selectedNodeProps: ComputedRef<Record<string, unknown>>;
|
|
452
|
+
/** The current values for the global config form */
|
|
453
|
+
globalConfigValues: ComputedRef<Record<string, unknown>>;
|
|
454
|
+
/** Handle property change from the form generator */
|
|
455
|
+
handlePropertyChange: (key: string, value: unknown) => CommandExecutionResult | null;
|
|
456
|
+
/** Handle global config change */
|
|
457
|
+
handleGlobalConfigChange: (key: string, value: unknown) => CommandExecutionResult | null;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Bridges the currently selected node's props and formSchema
|
|
461
|
+
* to the form-generator, and dispatches property updates as commands.
|
|
462
|
+
*/
|
|
463
|
+
declare function usePropertyBinding(engine: DesignerEngine$1, options?: UsePropertyBindingOptions): UsePropertyBindingReturn;
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/context.d.ts
|
|
466
|
+
/**
|
|
467
|
+
* Injects the DesignerContext from the nearest ancestor DcDesigner.
|
|
468
|
+
* Throws if called outside the designer component tree.
|
|
469
|
+
*/
|
|
470
|
+
declare function useDesignerContext(): DesignerContext;
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/factory.d.ts
|
|
473
|
+
/**
|
|
474
|
+
* Creates a designer instance by initializing the core engine,
|
|
475
|
+
* registering widgets, and resolving configuration.
|
|
476
|
+
*
|
|
477
|
+
* Users must explicitly provide widget metas, component maps, and field maps.
|
|
478
|
+
*
|
|
479
|
+
* @example
|
|
480
|
+
* ```ts
|
|
481
|
+
* const designer = createDesigner({
|
|
482
|
+
* widgetMetas: myWidgetMetas,
|
|
483
|
+
* componentMap: myComponentMap,
|
|
484
|
+
* fieldComponentMap: myFieldComponentMap,
|
|
485
|
+
* globalConfigSchema: myGlobalSchema,
|
|
486
|
+
* })
|
|
487
|
+
* ```
|
|
488
|
+
*/
|
|
489
|
+
declare function createDesigner(options?: DesignerOptions): DesignerInstance;
|
|
490
|
+
//#endregion
|
|
491
|
+
//#region src/material.d.ts
|
|
492
|
+
type Translate = (key: string, fallback?: string) => string;
|
|
493
|
+
declare function resolveMaterialItem(meta: DesignerWidgetMeta, t: Translate): ResolvedMaterialItem;
|
|
494
|
+
declare function materialItemMatchesQuery(meta: DesignerWidgetMeta, material: ResolvedMaterialItem, query: string): boolean;
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/messages.d.ts
|
|
497
|
+
declare const designerMessages: Record<string, MessageTree$1>;
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region src/workspace.d.ts
|
|
500
|
+
declare function createDesignerWorkspace(options?: DesignerWorkspaceOptions): DesignerWorkspaceController;
|
|
501
|
+
//#endregion
|
|
502
|
+
export { type ActionConfirmRequest, type ActionDecision, type ActionInterceptor, type ActionInvocation, ActionKey, type ActionRisk, type AddNodePayload, type BehaviorPredicate, type Command, type CommandHandler, CommandType, type ComponentMap, type ConfirmActionInterceptorOptions, type ContainerDefinition, ContainerRegionOutlet, type ContainerVariantMigrationContext, type ContainerVariantMigrationResult, type CreatableBehaviorPredicate, type CreatableBehaviorResult, type CreatableDecision, type CreationBlockReason, DESIGNER_CONTEXT_KEY, _default as DcCanvas, _default$1 as DcCanvasControls, _default$2 as DcDesigner, _default$3 as DcLeftSidebar, _default$4 as DcMaterialGroup, _default$5 as DcMaterialItem, _default$6 as DcMaterialPanel, _default$7 as DcPropertyPanel, _default$8 as DcRightSidebar, _default$9 as DcStructurePanel, type DeepReadonly, DefaultEmptyState, DefaultNodeHandle, DefaultNodeMask, DefaultNodeToolbar, type DesignerContext, type DesignerEngine, type DesignerEngineOptions, type DesignerExtensions, type DesignerInstance, type DesignerOptions, type DesignerRailSlotAPI, type DesignerSchema, type DesignerWidgetMeta, type DesignerWorkspaceController, type DesignerWorkspaceMode, type DesignerWorkspaceOptions, type DragTarget, type EmptyStateProps, type EngineOptions, type EngineStore, EventName, type FieldBinding, type FieldChangePayload, type FieldComponentMap, type FieldSchema, type FlatMessages, FormGenerator, type FormSchema, type HistoryEntry, type HistoryState, I18N_KEY, type I18nInstance, type InstanceBehaviorContext, type LeftPanelTabKey, type LocaleMessages, type MaterialDisplayMeta, type MaterialItemIcon, type MaterialItemRenderProps, type MessageTree, type MoveNodePayload, type NodeActionContext, type NodeActionDefinition, type NodeActionRegistry, type NodeHandleProps, type NodeInteractionGeometry, type NodeInteractionGeometryMode, type NodeInteractionPresentation, type NodeInteractionRect, type NodeMaskProps, type NodeToolbarOrientation, type NodeToolbarPlacement, type NodeToolbarProps, type NodeWrapperProps, type PropertyTabKey, type RemoveNodePayload, type RendererEventHooks, type RendererExtensions, type RendererOptions, type RendererWidgetActionConfig, type RendererWidgetActionExtra, type RendererWidgetMeta, type ResolveContainerDropIndexContext, type ResolvedFieldBinding, type ResolvedMaterialItem, type ResolvedNodeAction, RootRenderer, type SchemaNode, type SectionSchema, type SetGlobalConfigPayload, type TypeBehaviorContext, type UpdatePropsPayload, type UseDesignerReturn, type UseDragDropReturn, type UseNodeInteractionGeometryOptions, type UseNodeInteractionGeometryReturn, type UsePropertyBindingReturn, type ValidationRule, type WidgetActionConfig, type WidgetFallbackProps, type WidgetGroupConfig, type WidgetMeta, createBindingCommand, createConfirmActionInterceptor, createDefaultActions, createDesigner, createDesignerWorkspace, createEngine, createI18n, createNodeActionRegistry, designerMessages, materialItemMatchesQuery, readBindingValue, resolveBehavior, resolveCreatable, resolveFieldBinding, resolveMaterialItem, useContainerRuntime, useDesigner, useDesignerContext, useDragDrop, useI18n, useNodeActions, useNodeDrag, useNodeInteractionGeometry, usePropertyBinding, useWidgetNode };
|