@flowgram.ai/free-layout-core 0.1.6 → 0.1.7
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/{chunk-KAL7YCC2.js → chunk-PT4ZVDZZ.js} +1 -1
- package/dist/esm/chunk-PT4ZVDZZ.js.map +1 -0
- package/dist/esm/index.js +346 -549
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/typings/index.js +1 -1
- package/dist/esm/typings/workflow-line.js +1 -1
- package/dist/index.d.mts +54 -42
- package/dist/index.d.ts +54 -42
- package/dist/index.js +460 -665
- package/dist/index.js.map +1 -1
- package/dist/typings/index.d.mts +1 -3
- package/dist/typings/index.d.ts +1 -3
- package/dist/typings/index.js.map +1 -1
- package/dist/typings/workflow-json.d.mts +1 -3
- package/dist/typings/workflow-json.d.ts +1 -3
- package/dist/typings/workflow-line.d.mts +7 -27
- package/dist/typings/workflow-line.d.ts +7 -27
- package/dist/typings/workflow-line.js.map +1 -1
- package/dist/typings/workflow-node.d.mts +1 -3
- package/dist/typings/workflow-node.d.ts +1 -3
- package/dist/typings/workflow-registry.d.mts +1 -3
- package/dist/typings/workflow-registry.d.ts +1 -3
- package/dist/{workflow-line-entity-CG_8mknJ.d.ts → workflow-line-entity-BcXJ4GjA.d.ts} +57 -49
- package/dist/{workflow-line-entity-1qT4aXVU.d.mts → workflow-line-entity-DZGrnBuq.d.mts} +57 -49
- package/package.json +9 -10
- package/dist/esm/chunk-KAL7YCC2.js.map +0 -1
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, FlowNodeEntity } from '@flowgram.ai/document';
|
|
5
|
-
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowNodeJSON, e as WorkflowPortEntity, f as WorkflowLineEntity, g as WorkflowPorts, h as WorkflowPortType, i as WorkflowPort } from './workflow-line-entity-
|
|
6
|
-
export {
|
|
5
|
+
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowNodeJSON, e as WorkflowPortEntity, f as WorkflowLineEntity, g as WorkflowPorts, h as WorkflowPortType, i as WorkflowPort, L as LineRenderType, j as WorkflowLineRenderContribution, k as LinePosition } from './workflow-line-entity-DZGrnBuq.mjs';
|
|
6
|
+
export { w as LINE_HOVER_DISTANCE, t as LineColor, u as LineColors, s as LineType, P as POINT_RADIUS, A as PORT_SIZE, m as WORKFLOW_LINE_ENTITY, C as WorkfloEntityHoverable, q as WorkflowContentChangeEvent, p as WorkflowContentChangeType, E as WorkflowDocumentOptions, F as WorkflowDocumentOptionsDefault, D as WorkflowDocumentProvider, o as WorkflowJSON, y as WorkflowLineEntityOpts, z as WorkflowLineInfo, x as WorkflowLinePortInfo, v as WorkflowLineRenderContributionFactory, r as WorkflowNodeMeta, B as WorkflowPortEntityOpts, n as domReactToBounds, l as getPortEntityId } from './workflow-line-entity-DZGrnBuq.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';
|
|
@@ -14,8 +14,6 @@ import React$1 from 'react';
|
|
|
14
14
|
import { ContainerModule } from 'inversify';
|
|
15
15
|
export { WorkflowEdgeJSON } from './typings/workflow-edge.mjs';
|
|
16
16
|
export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './typings/workflow-registry.mjs';
|
|
17
|
-
export { LineColor, LineColors, LinePosition, LineType } from './typings/workflow-line.mjs';
|
|
18
|
-
import 'bezier-js';
|
|
19
17
|
import '@flowgram.ai/form-core';
|
|
20
18
|
|
|
21
19
|
declare enum WorkflowCommands {
|
|
@@ -278,43 +276,6 @@ declare function useWorkflowDocument(): WorkflowDocument;
|
|
|
278
276
|
*/
|
|
279
277
|
declare function usePlaygroundReadonlyState(listenChange?: boolean): boolean;
|
|
280
278
|
|
|
281
|
-
declare namespace FoldLine {
|
|
282
|
-
function getPoints({ source, target }: {
|
|
283
|
-
source: IPoint;
|
|
284
|
-
target: IPoint;
|
|
285
|
-
}): IPoint[];
|
|
286
|
-
/**
|
|
287
|
-
* 实现 reactFlow 原本的折叠线交互
|
|
288
|
-
*/
|
|
289
|
-
function getSmoothStepPath(points: IPoint[]): string;
|
|
290
|
-
function getBounds(points: IPoint[]): Rectangle;
|
|
291
|
-
/**
|
|
292
|
-
* 折叠线和点的距离
|
|
293
|
-
* @param linePosition
|
|
294
|
-
* @param pos
|
|
295
|
-
*/
|
|
296
|
-
function getFoldLineToPointDistance(points: IPoint[], pos: IPoint): number;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
declare enum BezierControlType {
|
|
300
|
-
RIGHT_TOP = 0,
|
|
301
|
-
RIGHT_BOTTOM = 1,
|
|
302
|
-
LEFT_TOP = 2,
|
|
303
|
-
LEFT_BOTTOM = 3
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* 获取贝塞尔曲线横向的控制节点
|
|
307
|
-
* @param fromPos
|
|
308
|
-
* @param toPos
|
|
309
|
-
*/
|
|
310
|
-
declare function getBezierHorizontalControlPoints(fromPos: IPoint, toPos: IPoint): IPoint[];
|
|
311
|
-
/**
|
|
312
|
-
* 获取贝塞尔曲线垂直方向的控制节点
|
|
313
|
-
* @param fromPos 起始点
|
|
314
|
-
* @param toPos 终点
|
|
315
|
-
*/
|
|
316
|
-
declare function getBezierVerticalControlPoints(fromPos: IPoint, toPos: IPoint): IPoint[];
|
|
317
|
-
|
|
318
279
|
declare function nanoid(n?: number): string;
|
|
319
280
|
|
|
320
281
|
declare const fitView: (doc: WorkflowDocument, playgroundConfig: PlaygroundConfigEntity, easing?: boolean) => Promise<void>;
|
|
@@ -458,6 +419,57 @@ declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
|
|
|
458
419
|
removeLine(line: WorkflowLineEntity): void;
|
|
459
420
|
}
|
|
460
421
|
|
|
422
|
+
interface WorkflowLineRenderDataSchema {
|
|
423
|
+
version: string;
|
|
424
|
+
contributions: Map<LineRenderType, WorkflowLineRenderContribution>;
|
|
425
|
+
position: LinePosition;
|
|
426
|
+
}
|
|
427
|
+
declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSchema> {
|
|
428
|
+
static type: string;
|
|
429
|
+
entity: WorkflowLineEntity;
|
|
430
|
+
constructor(entity: WorkflowLineEntity);
|
|
431
|
+
getDefaultData(): WorkflowLineRenderDataSchema;
|
|
432
|
+
get renderVersion(): string;
|
|
433
|
+
get position(): LinePosition;
|
|
434
|
+
get path(): string;
|
|
435
|
+
calcDistance(pos: IPoint): number;
|
|
436
|
+
get bounds(): Rectangle;
|
|
437
|
+
/**
|
|
438
|
+
* 更新数据
|
|
439
|
+
* WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
|
|
440
|
+
*/
|
|
441
|
+
update(): void;
|
|
442
|
+
private get lineType();
|
|
443
|
+
/**
|
|
444
|
+
* 更新版本
|
|
445
|
+
* WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
|
|
446
|
+
*/
|
|
447
|
+
private updatePosition;
|
|
448
|
+
private get currentLine();
|
|
449
|
+
private syncContributions;
|
|
450
|
+
private registerContribution;
|
|
451
|
+
}
|
|
452
|
+
|
|
461
453
|
declare const WorkflowDocumentContainerModule: ContainerModule;
|
|
462
454
|
|
|
463
|
-
|
|
455
|
+
interface StraightData {
|
|
456
|
+
points: IPoint[];
|
|
457
|
+
path: string;
|
|
458
|
+
bbox: Rectangle;
|
|
459
|
+
}
|
|
460
|
+
declare class WorkflowSimpleLineContribution implements WorkflowLineRenderContribution {
|
|
461
|
+
static type: string;
|
|
462
|
+
entity: WorkflowLineEntity;
|
|
463
|
+
constructor(entity: WorkflowLineEntity);
|
|
464
|
+
private data?;
|
|
465
|
+
get path(): string;
|
|
466
|
+
calcDistance(pos: IPoint): number;
|
|
467
|
+
get bounds(): Rectangle;
|
|
468
|
+
update(params: {
|
|
469
|
+
fromPos: IPoint;
|
|
470
|
+
toPos: IPoint;
|
|
471
|
+
}): void;
|
|
472
|
+
private projectPointOnLine;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export { EditorCursorState, InteractiveType, LinePosition, LineRenderType, type NodeRenderReturnType, type NodesDragEndEvent, type NodesDragEvent, type PositionMap, type StraightData, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDragService, WorkflowHoverService, WorkflowLineEntity, WorkflowLineRenderContribution, WorkflowLineRenderData, type WorkflowLineRenderDataSchema, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, type WorkflowNodeLines, WorkflowNodeLinesData, WorkflowNodePortsData, WorkflowPort, WorkflowPortEntity, WorkflowPortType, WorkflowPorts, WorkflowResetLayoutService, WorkflowSelectService, WorkflowSimpleLineContribution, fitView, getAntiOverlapPosition, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
|
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, FlowNodeEntity } from '@flowgram.ai/document';
|
|
5
|
-
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowNodeJSON, e as WorkflowPortEntity, f as WorkflowLineEntity, g as WorkflowPorts, h as WorkflowPortType, i as WorkflowPort } from './workflow-line-entity-
|
|
6
|
-
export {
|
|
5
|
+
import { W as WorkflowHoverService, a as WorkflowDocument, b as WorkflowLinesManager, c as WorkflowSelectService, d as WorkflowNodeJSON, e as WorkflowPortEntity, f as WorkflowLineEntity, g as WorkflowPorts, h as WorkflowPortType, i as WorkflowPort, L as LineRenderType, j as WorkflowLineRenderContribution, k as LinePosition } from './workflow-line-entity-BcXJ4GjA.js';
|
|
6
|
+
export { w as LINE_HOVER_DISTANCE, t as LineColor, u as LineColors, s as LineType, P as POINT_RADIUS, A as PORT_SIZE, m as WORKFLOW_LINE_ENTITY, C as WorkfloEntityHoverable, q as WorkflowContentChangeEvent, p as WorkflowContentChangeType, E as WorkflowDocumentOptions, F as WorkflowDocumentOptionsDefault, D as WorkflowDocumentProvider, o as WorkflowJSON, y as WorkflowLineEntityOpts, z as WorkflowLineInfo, x as WorkflowLinePortInfo, v as WorkflowLineRenderContributionFactory, r as WorkflowNodeMeta, B as WorkflowPortEntityOpts, n as domReactToBounds, l as getPortEntityId } from './workflow-line-entity-BcXJ4GjA.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';
|
|
@@ -14,8 +14,6 @@ import React$1 from 'react';
|
|
|
14
14
|
import { ContainerModule } from 'inversify';
|
|
15
15
|
export { WorkflowEdgeJSON } from './typings/workflow-edge.js';
|
|
16
16
|
export { WorkflowNodeFormMeta, WorkflowNodeRegistry, WorkflowNodeRenderProps } from './typings/workflow-registry.js';
|
|
17
|
-
export { LineColor, LineColors, LinePosition, LineType } from './typings/workflow-line.js';
|
|
18
|
-
import 'bezier-js';
|
|
19
17
|
import '@flowgram.ai/form-core';
|
|
20
18
|
|
|
21
19
|
declare enum WorkflowCommands {
|
|
@@ -278,43 +276,6 @@ declare function useWorkflowDocument(): WorkflowDocument;
|
|
|
278
276
|
*/
|
|
279
277
|
declare function usePlaygroundReadonlyState(listenChange?: boolean): boolean;
|
|
280
278
|
|
|
281
|
-
declare namespace FoldLine {
|
|
282
|
-
function getPoints({ source, target }: {
|
|
283
|
-
source: IPoint;
|
|
284
|
-
target: IPoint;
|
|
285
|
-
}): IPoint[];
|
|
286
|
-
/**
|
|
287
|
-
* 实现 reactFlow 原本的折叠线交互
|
|
288
|
-
*/
|
|
289
|
-
function getSmoothStepPath(points: IPoint[]): string;
|
|
290
|
-
function getBounds(points: IPoint[]): Rectangle;
|
|
291
|
-
/**
|
|
292
|
-
* 折叠线和点的距离
|
|
293
|
-
* @param linePosition
|
|
294
|
-
* @param pos
|
|
295
|
-
*/
|
|
296
|
-
function getFoldLineToPointDistance(points: IPoint[], pos: IPoint): number;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
declare enum BezierControlType {
|
|
300
|
-
RIGHT_TOP = 0,
|
|
301
|
-
RIGHT_BOTTOM = 1,
|
|
302
|
-
LEFT_TOP = 2,
|
|
303
|
-
LEFT_BOTTOM = 3
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* 获取贝塞尔曲线横向的控制节点
|
|
307
|
-
* @param fromPos
|
|
308
|
-
* @param toPos
|
|
309
|
-
*/
|
|
310
|
-
declare function getBezierHorizontalControlPoints(fromPos: IPoint, toPos: IPoint): IPoint[];
|
|
311
|
-
/**
|
|
312
|
-
* 获取贝塞尔曲线垂直方向的控制节点
|
|
313
|
-
* @param fromPos 起始点
|
|
314
|
-
* @param toPos 终点
|
|
315
|
-
*/
|
|
316
|
-
declare function getBezierVerticalControlPoints(fromPos: IPoint, toPos: IPoint): IPoint[];
|
|
317
|
-
|
|
318
279
|
declare function nanoid(n?: number): string;
|
|
319
280
|
|
|
320
281
|
declare const fitView: (doc: WorkflowDocument, playgroundConfig: PlaygroundConfigEntity, easing?: boolean) => Promise<void>;
|
|
@@ -458,6 +419,57 @@ declare class WorkflowNodeLinesData extends EntityData<WorkflowNodeLines> {
|
|
|
458
419
|
removeLine(line: WorkflowLineEntity): void;
|
|
459
420
|
}
|
|
460
421
|
|
|
422
|
+
interface WorkflowLineRenderDataSchema {
|
|
423
|
+
version: string;
|
|
424
|
+
contributions: Map<LineRenderType, WorkflowLineRenderContribution>;
|
|
425
|
+
position: LinePosition;
|
|
426
|
+
}
|
|
427
|
+
declare class WorkflowLineRenderData extends EntityData<WorkflowLineRenderDataSchema> {
|
|
428
|
+
static type: string;
|
|
429
|
+
entity: WorkflowLineEntity;
|
|
430
|
+
constructor(entity: WorkflowLineEntity);
|
|
431
|
+
getDefaultData(): WorkflowLineRenderDataSchema;
|
|
432
|
+
get renderVersion(): string;
|
|
433
|
+
get position(): LinePosition;
|
|
434
|
+
get path(): string;
|
|
435
|
+
calcDistance(pos: IPoint): number;
|
|
436
|
+
get bounds(): Rectangle;
|
|
437
|
+
/**
|
|
438
|
+
* 更新数据
|
|
439
|
+
* WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
|
|
440
|
+
*/
|
|
441
|
+
update(): void;
|
|
442
|
+
private get lineType();
|
|
443
|
+
/**
|
|
444
|
+
* 更新版本
|
|
445
|
+
* WARNING: 这个方法,必须在 requestAnimationFrame / useLayoutEffect 中调用,否则会引起浏览器强制重排
|
|
446
|
+
*/
|
|
447
|
+
private updatePosition;
|
|
448
|
+
private get currentLine();
|
|
449
|
+
private syncContributions;
|
|
450
|
+
private registerContribution;
|
|
451
|
+
}
|
|
452
|
+
|
|
461
453
|
declare const WorkflowDocumentContainerModule: ContainerModule;
|
|
462
454
|
|
|
463
|
-
|
|
455
|
+
interface StraightData {
|
|
456
|
+
points: IPoint[];
|
|
457
|
+
path: string;
|
|
458
|
+
bbox: Rectangle;
|
|
459
|
+
}
|
|
460
|
+
declare class WorkflowSimpleLineContribution implements WorkflowLineRenderContribution {
|
|
461
|
+
static type: string;
|
|
462
|
+
entity: WorkflowLineEntity;
|
|
463
|
+
constructor(entity: WorkflowLineEntity);
|
|
464
|
+
private data?;
|
|
465
|
+
get path(): string;
|
|
466
|
+
calcDistance(pos: IPoint): number;
|
|
467
|
+
get bounds(): Rectangle;
|
|
468
|
+
update(params: {
|
|
469
|
+
fromPos: IPoint;
|
|
470
|
+
toPos: IPoint;
|
|
471
|
+
}): void;
|
|
472
|
+
private projectPointOnLine;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export { EditorCursorState, InteractiveType, LinePosition, LineRenderType, type NodeRenderReturnType, type NodesDragEndEvent, type NodesDragEvent, type PositionMap, type StraightData, WorkflowCommands, WorkflowDocument, WorkflowDocumentContainerModule, WorkflowDragService, WorkflowHoverService, WorkflowLineEntity, WorkflowLineRenderContribution, WorkflowLineRenderData, type WorkflowLineRenderDataSchema, WorkflowLinesManager, WorkflowNodeEntity, WorkflowNodeJSON, type WorkflowNodeLines, WorkflowNodeLinesData, WorkflowNodePortsData, WorkflowPort, WorkflowPortEntity, WorkflowPortType, WorkflowPorts, WorkflowResetLayoutService, WorkflowSelectService, WorkflowSimpleLineContribution, fitView, getAntiOverlapPosition, nanoid, useCurrentDomNode, useCurrentEntity, useNodeRender, usePlaygroundReadonlyState, useWorkflowDocument };
|