@blueking/flow-canvas 0.0.10 → 0.0.12
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/README.md +2 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +26 -2
- package/dist/index.esm.js +1709 -1672
- package/dist/style.css +1 -1
- package/package.json +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -162,6 +162,12 @@ type CanvasUiEvent = {
|
|
|
162
162
|
} | {
|
|
163
163
|
type: 'node.dblclick';
|
|
164
164
|
nodeId: string;
|
|
165
|
+
} | {
|
|
166
|
+
type: 'node.mouseenter';
|
|
167
|
+
nodeId: string;
|
|
168
|
+
} | {
|
|
169
|
+
type: 'node.mouseleave';
|
|
170
|
+
nodeId: string;
|
|
165
171
|
} | {
|
|
166
172
|
type: 'node.contextmenu';
|
|
167
173
|
nodeId: string;
|
|
@@ -236,7 +242,16 @@ interface CanvasHistoryOptions {
|
|
|
236
242
|
}
|
|
237
243
|
|
|
238
244
|
interface OverlayManager {
|
|
245
|
+
/**
|
|
246
|
+
* 获取节点在 graph 容器内的 DOMRect(local-to-graph 坐标)。
|
|
247
|
+
* 适合用于同样渲染在 graph 容器内部的 overlay 定位。
|
|
248
|
+
*/
|
|
239
249
|
getNodeScreenRect(nodeId: string): DOMRect | null;
|
|
250
|
+
/**
|
|
251
|
+
* 获取节点在视口(viewport / client)中的 DOMRect。
|
|
252
|
+
* 适合用于 Teleport 到 body 的 position: fixed overlay 定位。
|
|
253
|
+
*/
|
|
254
|
+
getNodeViewportRect(nodeId: string): DOMRect | null;
|
|
240
255
|
}
|
|
241
256
|
|
|
242
257
|
declare function generateId(): string;
|
|
@@ -365,11 +380,12 @@ interface InsertNodeOptions {
|
|
|
365
380
|
label?: string;
|
|
366
381
|
direction?: InsertDirection;
|
|
367
382
|
}
|
|
383
|
+
type ZoomToFitOptions = Parameters<Graph['zoomToFit']>[0];
|
|
368
384
|
interface CanvasApi {
|
|
369
385
|
zoomIn(): void;
|
|
370
386
|
zoomOut(): void;
|
|
371
387
|
zoomTo(value: number): void;
|
|
372
|
-
zoomToFit(): void;
|
|
388
|
+
zoomToFit(options?: ZoomToFitOptions): void;
|
|
373
389
|
getZoom(): number;
|
|
374
390
|
centerContent(): void;
|
|
375
391
|
scrollToOrigin(): void;
|
|
@@ -427,6 +443,10 @@ interface QuickAddConfig {
|
|
|
427
443
|
getPort?: QuickAddPortResolver;
|
|
428
444
|
/** 点击 quick-add 插入节点时使用的方向;默认跟随绑定 port 的标准方向,不可推断时回退为 'right' */
|
|
429
445
|
insertDirection?: InsertDirection | QuickAddInsertDirectionResolver;
|
|
446
|
+
/** 弹出 quick-add 面板时,如右侧超出浏览器可视区,则自动左移画布,默认 true */
|
|
447
|
+
autoPanOnOpen?: boolean;
|
|
448
|
+
/** autoPanOnOpen 生效时,弹层与浏览器右边缘保留的安全间距,默认 16px */
|
|
449
|
+
autoPanPadding?: number;
|
|
430
450
|
}
|
|
431
451
|
interface EdgeDropConfig {
|
|
432
452
|
/** 全局开关,默认 false */
|
|
@@ -784,6 +804,8 @@ declare const _default$1: typeof __VLS_export$1;
|
|
|
784
804
|
type __VLS_Props = {
|
|
785
805
|
node: FlowNodeModel;
|
|
786
806
|
portPosition: ScreenPosition;
|
|
807
|
+
autoPanOnOpen?: boolean;
|
|
808
|
+
autoPanPadding?: number;
|
|
787
809
|
};
|
|
788
810
|
declare function closePopover(): void;
|
|
789
811
|
declare var __VLS_7: {};
|
|
@@ -798,12 +820,14 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
|
|
|
798
820
|
mouseleave: () => any;
|
|
799
821
|
open: (nodeId: string) => any;
|
|
800
822
|
"start-drag": (nodeId: string) => any;
|
|
823
|
+
"viewport-overflow-right": (overflowRight: number) => any;
|
|
801
824
|
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
802
825
|
onClose?: (() => any) | undefined;
|
|
803
826
|
onMouseenter?: (() => any) | undefined;
|
|
804
827
|
onMouseleave?: (() => any) | undefined;
|
|
805
828
|
onOpen?: ((nodeId: string) => any) | undefined;
|
|
806
829
|
"onStart-drag"?: ((nodeId: string) => any) | undefined;
|
|
830
|
+
"onViewport-overflow-right"?: ((overflowRight: number) => any) | undefined;
|
|
807
831
|
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
808
832
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
809
833
|
declare const _default: typeof __VLS_export;
|
|
@@ -915,4 +939,4 @@ declare function minimapPlugin(options?: MinimapPluginOptions): CanvasPlugin;
|
|
|
915
939
|
declare function clipboardPlugin(): CanvasPlugin;
|
|
916
940
|
|
|
917
941
|
export { CanvasConstraintError, _default$5 as CanvasLayout, _default$3 as CanvasNodePalette, _default$6 as CanvasRuntime, CanvasSchemaError, _default$4 as CanvasToolbar, _default$2 as DefaultNode, _default$1 as NodeActionsToolbar, _default as NodeQuickAddPopover, applyCanvasCommand, clipboardPlugin, connectionValidatorPlugin, createBuiltinEdgeTypes, createCanvasHistory, createDefaultSchema, createDefaultToolbarItems, createEmptyFlowModel, generateId, minimapPlugin, searchPlugin, selectionPlugin, snaplinePlugin, useCanvasEditor };
|
|
918
|
-
export type { BuiltinEdgeType, BuiltinToolbarType, CanvasApi, CanvasCallbackContext, CanvasCommand, CanvasEdgeDefinition, CanvasEditorContext, CanvasEditorOptions, CanvasHistory, CanvasHistoryOptions, CanvasMode, CanvasNodeDefinition, CanvasPlugin, CanvasPosition, CanvasSchema, CanvasSelection, CanvasToolbarItem, CanvasUiEvent, CommandEnvelope, CommandExecutionError, CommandExecutionResult, CommandPreview, CommandRejection, CommandSource, ConnectionValidateContext, ConnectionValidateResult, ConnectionValidator, ContextMenuItem, CoreToolbarType, DefaultNodeTypeConfig, DefaultSchemaOptions, DefaultSchemaResult, DefaultToolbarItemsOptions, DeleteSelectionOptions, EdgeDecoration, EdgeDropConfig, EdgeRenderState, EdgeStyle, EditorPluginContext, ExportOptions, FlowEdgeLabelModel, FlowEdgeModel, FlowModel, FlowModelChangeEvent, FlowNodeModel, FlowPortModel, GraphWithSelection, IdGenerator, InsertDirection, InsertNodeOptions, MinimapPluginOptions, NodeActionsConfig, NodeBehaviorConfig, NodeDecoration, NodePaletteItem, OverlayManager, PluginManagedToolbarType, QuickAddConfig, QuickAddInsertDirectionResolver, QuickAddPortResolver, RuntimePluginContext, ScreenPosition, SearchNodeMeta, SearchPluginOptions, SelectionPluginOptions, SnaplinePluginOptions };
|
|
942
|
+
export type { BuiltinEdgeType, BuiltinToolbarType, CanvasApi, CanvasCallbackContext, CanvasCommand, CanvasEdgeDefinition, CanvasEditorContext, CanvasEditorOptions, CanvasHistory, CanvasHistoryOptions, CanvasMode, CanvasNodeDefinition, CanvasPlugin, CanvasPosition, CanvasSchema, CanvasSelection, CanvasToolbarItem, CanvasUiEvent, CommandEnvelope, CommandExecutionError, CommandExecutionResult, CommandPreview, CommandRejection, CommandSource, ConnectionValidateContext, ConnectionValidateResult, ConnectionValidator, ContextMenuItem, CoreToolbarType, DefaultNodeTypeConfig, DefaultSchemaOptions, DefaultSchemaResult, DefaultToolbarItemsOptions, DeleteSelectionOptions, EdgeDecoration, EdgeDropConfig, EdgeRenderState, EdgeStyle, EditorPluginContext, ExportOptions, FlowEdgeLabelModel, FlowEdgeModel, FlowModel, FlowModelChangeEvent, FlowNodeModel, FlowPortModel, GraphWithSelection, IdGenerator, InsertDirection, InsertNodeOptions, MinimapPluginOptions, NodeActionsConfig, NodeBehaviorConfig, NodeDecoration, NodePaletteItem, OverlayManager, PluginManagedToolbarType, QuickAddConfig, QuickAddInsertDirectionResolver, QuickAddPortResolver, RuntimePluginContext, ScreenPosition, SearchNodeMeta, SearchPluginOptions, SelectionPluginOptions, SnaplinePluginOptions, ZoomToFitOptions };
|