@flowgram.ai/free-lines-plugin 0.1.0-alpha.12 → 0.1.0-alpha.14

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode, FC } from 'react';
2
- import { WorkflowPortEntity, WorkflowLineEntity, LineRenderType, WorkflowLineRenderContributionFactory, WorkflowHoverService, WorkflowSelectService, WorkflowDocument, WorkflowLineRenderContribution, LineType } from '@flowgram.ai/free-layout-core';
2
+ import { WorkflowPortEntity, WorkflowLineEntity, LineRenderType, WorkflowLineRenderContributionFactory, WorkflowHoverService, WorkflowSelectService, WorkflowDocument, LineCenterPoint, WorkflowLineRenderContribution, LineType, LinePoint } from '@flowgram.ai/free-layout-core';
3
3
  import * as _flowgram_ai_core from '@flowgram.ai/core';
4
4
  import { Layer, TransformData } from '@flowgram.ai/core';
5
5
  import { FlowRendererRegistry } from '@flowgram.ai/renderer';
@@ -125,30 +125,6 @@ interface ArrowRendererProps {
125
125
  */
126
126
  type ArrowRendererComponent = React.ComponentType<ArrowRendererProps>;
127
127
 
128
- /**
129
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
130
- * SPDX-License-Identifier: MIT
131
- */
132
-
133
- declare enum BezierControlType {
134
- RIGHT_TOP = 0,
135
- RIGHT_BOTTOM = 1,
136
- LEFT_TOP = 2,
137
- LEFT_BOTTOM = 3
138
- }
139
- /**
140
- * 获取贝塞尔曲线横向的控制节点
141
- * @param fromPos
142
- * @param toPos
143
- */
144
- declare function getBezierHorizontalControlPoints(fromPos: IPoint, toPos: IPoint): IPoint[];
145
- /**
146
- * 获取贝塞尔曲线垂直方向的控制节点
147
- * @param fromPos 起始点
148
- * @param toPos 终点
149
- */
150
- declare function getBezierVerticalControlPoints(fromPos: IPoint, toPos: IPoint): IPoint[];
151
-
152
128
  /**
153
129
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
154
130
  * SPDX-License-Identifier: MIT
@@ -161,6 +137,7 @@ interface BezierData {
161
137
  controls: IPoint[];
162
138
  bezier: Bezier;
163
139
  path: string;
140
+ center: LineCenterPoint;
164
141
  }
165
142
  declare class WorkflowBezierLineContribution implements WorkflowLineRenderContribution {
166
143
  static type: LineType;
@@ -170,9 +147,10 @@ declare class WorkflowBezierLineContribution implements WorkflowLineRenderContri
170
147
  get path(): string;
171
148
  calcDistance(pos: IPoint): number;
172
149
  get bounds(): Rectangle;
150
+ get center(): LineCenterPoint | undefined;
173
151
  update(params: {
174
- fromPos: IPoint;
175
- toPos: IPoint;
152
+ fromPos: LinePoint;
153
+ toPos: LinePoint;
176
154
  }): void;
177
155
  private calcBezier;
178
156
  private getPath;
@@ -187,6 +165,7 @@ interface FoldData {
187
165
  points: IPoint[];
188
166
  path: string;
189
167
  bbox: Rectangle;
168
+ center: LineCenterPoint;
190
169
  }
191
170
  declare class WorkflowFoldLineContribution implements WorkflowLineRenderContribution {
192
171
  static type: LineType;
@@ -196,9 +175,10 @@ declare class WorkflowFoldLineContribution implements WorkflowLineRenderContribu
196
175
  get path(): string;
197
176
  calcDistance(pos: IPoint): number;
198
177
  get bounds(): Rectangle;
178
+ get center(): LineCenterPoint | undefined;
199
179
  update(params: {
200
- fromPos: IPoint;
201
- toPos: IPoint;
180
+ fromPos: LinePoint;
181
+ toPos: LinePoint;
202
182
  }): void;
203
183
  }
204
184
 
@@ -211,73 +191,21 @@ interface StraightData {
211
191
  points: IPoint[];
212
192
  path: string;
213
193
  bbox: Rectangle;
194
+ center: LineCenterPoint;
214
195
  }
215
196
  declare class WorkflowStraightLineContribution implements WorkflowLineRenderContribution {
216
- static type: string;
217
- entity: WorkflowLineEntity;
218
- constructor(entity: WorkflowLineEntity);
219
- private data?;
220
- get path(): string;
221
- calcDistance(pos: IPoint): number;
222
- get bounds(): Rectangle;
223
- update(params: {
224
- fromPos: IPoint;
225
- toPos: IPoint;
226
- }): void;
227
- }
228
-
229
- /**
230
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
231
- * SPDX-License-Identifier: MIT
232
- */
233
-
234
- interface ArcData {
235
- fromPos: IPoint;
236
- toPos: IPoint;
237
- path: string;
238
- bbox: Rectangle;
239
- }
240
- declare class WorkflowArkLineContribution implements WorkflowLineRenderContribution {
241
- static type: string;
242
- entity: WorkflowLineEntity;
243
- constructor(entity: WorkflowLineEntity);
244
- private data?;
245
- get path(): string;
246
- calcDistance(pos: IPoint): number;
247
- get bounds(): Rectangle;
248
- update(params: {
249
- fromPos: IPoint;
250
- toPos: IPoint;
251
- }): void;
252
- private calculateArcBBox;
253
- private getArcPath;
254
- }
255
-
256
- /**
257
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
258
- * SPDX-License-Identifier: MIT
259
- */
260
-
261
- interface ManhattanData {
262
- points: IPoint[];
263
- path: string;
264
- bbox: Rectangle;
265
- }
266
- declare class WorkflowManhattanLineContribution implements WorkflowLineRenderContribution {
267
- static type: string;
197
+ static type: LineType;
268
198
  entity: WorkflowLineEntity;
269
199
  constructor(entity: WorkflowLineEntity);
270
200
  private data?;
271
201
  get path(): string;
272
202
  calcDistance(pos: IPoint): number;
273
- private getDistanceToLineSegment;
274
203
  get bounds(): Rectangle;
204
+ get center(): LineCenterPoint | undefined;
275
205
  update(params: {
276
- fromPos: IPoint;
277
- toPos: IPoint;
206
+ fromPos: LinePoint;
207
+ toPos: LinePoint;
278
208
  }): void;
279
- private getManhattanPoints;
280
- private getPathFromPoints;
281
209
  }
282
210
 
283
- export { type ArcData, type ArrowRendererComponent, type ArrowRendererProps, BezierControlType, type BezierData, type FoldData, type FreeLinesPluginOptions, LINE_OFFSET, LINE_PADDING, type LineRenderProps, WorkflowLinesLayer as LinesLayer, type LinesLayerOptions, type ManhattanData, type StraightData, WorkflowArkLineContribution, WorkflowBezierLineContribution, WorkflowFoldLineContribution, WorkflowLinesLayer, WorkflowManhattanLineContribution, WorkflowPortRender, type WorkflowPortRenderProps, WorkflowStraightLineContribution, createFreeLinesPlugin, getBezierHorizontalControlPoints, getBezierVerticalControlPoints };
211
+ export { type ArrowRendererComponent, type ArrowRendererProps, type BezierData, type FoldData, type FreeLinesPluginOptions, LINE_OFFSET, LINE_PADDING, type LineRenderProps, WorkflowLinesLayer as LinesLayer, type LinesLayerOptions, type StraightData, WorkflowBezierLineContribution, WorkflowFoldLineContribution, WorkflowLinesLayer, WorkflowPortRender, type WorkflowPortRenderProps, WorkflowStraightLineContribution, createFreeLinesPlugin };