@flowgram.ai/free-layout-core 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +25 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/typings/index.d.mts +1 -1
- package/dist/typings/index.d.ts +1 -1
- package/dist/typings/workflow-drag.d.mts +1 -1
- package/dist/typings/workflow-drag.d.ts +1 -1
- package/dist/typings/workflow-json.d.mts +1 -1
- package/dist/typings/workflow-json.d.ts +1 -1
- package/dist/typings/workflow-line.d.mts +1 -1
- package/dist/typings/workflow-line.d.ts +1 -1
- package/dist/typings/workflow-node.d.mts +1 -1
- package/dist/typings/workflow-node.d.ts +1 -1
- package/dist/typings/workflow-registry.d.mts +1 -1
- package/dist/typings/workflow-registry.d.ts +1 -1
- package/dist/{workflow-line-entity-BGD6_sdy.d.mts → workflow-line-entity-B34FWw9W.d.mts} +9 -2
- package/dist/{workflow-line-entity-OFVYg40b.d.ts → workflow-line-entity-B4Mfa03B.d.ts} +9 -2
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData
|
|
|
2
2
|
export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, usePlaygroundLatest, useRefresh, useService } from '@flowgram.ai/core';
|
|
3
3
|
import { NodeFormProps } from '@flowgram.ai/node';
|
|
4
4
|
import { FlowOperationBaseService, FlowNodeType, FlowOperationBaseServiceImpl, FlowNodeEntityOrId, FlowNodeEntity } from '@flowgram.ai/document';
|
|
5
|
-
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowPorts, i as WorkflowPortType, j as WorkflowPort, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-line-entity-
|
|
6
|
-
export { C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY,
|
|
5
|
+
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowPorts, i as WorkflowPortType, j as WorkflowPort, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-line-entity-B34FWw9W.mjs';
|
|
6
|
+
export { J as HoverPosition, C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, K as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, Q as WorkflowDocumentOptionsDefault, M as WorkflowDocumentProvider, I as WorkflowEntityHoverable, q as WorkflowJSON, E as WorkflowLineEntityOpts, F as WorkflowLineInfo, D as WorkflowLinePortInfo, x as WorkflowLineRenderContributionFactory, t as WorkflowNodeMeta, H as WorkflowPortEntityOpts, p as domReactToBounds, n as getPortEntityId, B as onDragLineEndParams } from './workflow-line-entity-B34FWw9W.mjs';
|
|
7
7
|
import { W as WorkflowNodeEntity } from './workflow-sub-canvas-DOVla1mw.mjs';
|
|
8
8
|
export { a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.mjs';
|
|
9
9
|
import * as _flowgram_ai_utils from '@flowgram.ai/utils';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData
|
|
|
2
2
|
export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, usePlaygroundLatest, useRefresh, useService } from '@flowgram.ai/core';
|
|
3
3
|
import { NodeFormProps } from '@flowgram.ai/node';
|
|
4
4
|
import { FlowOperationBaseService, FlowNodeType, FlowOperationBaseServiceImpl, FlowNodeEntityOrId, FlowNodeEntity } from '@flowgram.ai/document';
|
|
5
|
-
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowPorts, i as WorkflowPortType, j as WorkflowPort, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-line-entity-
|
|
6
|
-
export { C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY,
|
|
5
|
+
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowDocumentOptions, L as LineEventProps, N as NodesDragEvent, e as WorkflowNodeJSON, f as WorkflowPortEntity, g as WorkflowLineEntity, O as OnDragLineEnd, h as WorkflowPorts, i as WorkflowPortType, j as WorkflowPort, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-line-entity-B4Mfa03B.js';
|
|
6
|
+
export { J as HoverPosition, C as LINE_HOVER_DISTANCE, v as LineColor, w as LineColors, u as LineType, z as NodesDragEndEvent, y as NodesDragStartEvent, A as NodesDraggingEvent, P as POINT_RADIUS, G as PORT_SIZE, o as WORKFLOW_LINE_ENTITY, K as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, Q as WorkflowDocumentOptionsDefault, M as WorkflowDocumentProvider, I as WorkflowEntityHoverable, q as WorkflowJSON, E as WorkflowLineEntityOpts, F as WorkflowLineInfo, D as WorkflowLinePortInfo, x as WorkflowLineRenderContributionFactory, t as WorkflowNodeMeta, H as WorkflowPortEntityOpts, p as domReactToBounds, n as getPortEntityId, B as onDragLineEndParams } from './workflow-line-entity-B4Mfa03B.js';
|
|
7
7
|
import { W as WorkflowNodeEntity } from './workflow-sub-canvas-DOVla1mw.js';
|
|
8
8
|
export { a as WorkflowSubCanvas } from './workflow-sub-canvas-DOVla1mw.js';
|
|
9
9
|
import * as _flowgram_ai_utils from '@flowgram.ai/utils';
|
package/dist/index.js
CHANGED
|
@@ -1094,7 +1094,9 @@ var import_core10 = require("@flowgram.ai/core");
|
|
|
1094
1094
|
var WorkflowHoverService = class {
|
|
1095
1095
|
constructor() {
|
|
1096
1096
|
this.onHoveredChangeEmitter = new import_utils11.Emitter();
|
|
1097
|
+
this.onUpdateHoverPositionEmitter = new import_utils11.Emitter();
|
|
1097
1098
|
this.onHoveredChange = this.onHoveredChangeEmitter.event;
|
|
1099
|
+
this.onUpdateHoverPosition = this.onUpdateHoverPositionEmitter.event;
|
|
1098
1100
|
// 当前鼠标 hover 位置
|
|
1099
1101
|
this.hoveredPos = { x: 0, y: 0 };
|
|
1100
1102
|
/**
|
|
@@ -1114,6 +1116,13 @@ var WorkflowHoverService = class {
|
|
|
1114
1116
|
this.onHoveredChangeEmitter.fire(hoveredKey);
|
|
1115
1117
|
}
|
|
1116
1118
|
}
|
|
1119
|
+
updateHoverPosition(position, target) {
|
|
1120
|
+
this.hoveredPos = position;
|
|
1121
|
+
this.onUpdateHoverPositionEmitter.fire({
|
|
1122
|
+
position,
|
|
1123
|
+
target
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1117
1126
|
/**
|
|
1118
1127
|
* 清空 hover 内容
|
|
1119
1128
|
*/
|
|
@@ -2444,7 +2453,8 @@ var WorkflowDragService = class {
|
|
|
2444
2453
|
});
|
|
2445
2454
|
}
|
|
2446
2455
|
});
|
|
2447
|
-
|
|
2456
|
+
const { clientX, clientY } = import_core15.MouseTouchEvent.getEventCoord(triggerEvent);
|
|
2457
|
+
return dragger.start(clientX, clientY, this.playgroundConfig)?.then(() => dragSuccess);
|
|
2448
2458
|
}
|
|
2449
2459
|
/**
|
|
2450
2460
|
* 通过拖入卡片添加
|
|
@@ -2854,7 +2864,8 @@ var WorkflowDragService = class {
|
|
|
2854
2864
|
}
|
|
2855
2865
|
}
|
|
2856
2866
|
});
|
|
2857
|
-
|
|
2867
|
+
const { clientX, clientY } = import_core15.MouseTouchEvent.getEventCoord(event);
|
|
2868
|
+
await dragger.start(clientX, clientY, config);
|
|
2858
2869
|
return deferred.promise;
|
|
2859
2870
|
}
|
|
2860
2871
|
/**
|
|
@@ -3096,12 +3107,14 @@ function useNodeRender(nodeFromProps) {
|
|
|
3096
3107
|
}, []);
|
|
3097
3108
|
const startDrag = (0, import_react2.useCallback)(
|
|
3098
3109
|
(e) => {
|
|
3099
|
-
|
|
3110
|
+
import_core21.MouseTouchEvent.preventDefault(e);
|
|
3100
3111
|
if (!selectionService.isSelected(node.id)) {
|
|
3101
3112
|
selectNode(e);
|
|
3102
3113
|
}
|
|
3103
|
-
if (!
|
|
3104
|
-
|
|
3114
|
+
if (!import_core21.MouseTouchEvent.isTouchEvent(e)) {
|
|
3115
|
+
if (!checkTargetDraggable(e.target) || !checkTargetDraggable(document.activeElement)) {
|
|
3116
|
+
return;
|
|
3117
|
+
}
|
|
3105
3118
|
}
|
|
3106
3119
|
isDragging.current = true;
|
|
3107
3120
|
dragService.startDragSelectedNodes(e)?.finally(
|