@flowgram.ai/free-layout-core 0.5.5 → 0.5.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/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData } from '@flowgram.ai/core';
2
2
  export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, useRefresh, useService } from '@flowgram.ai/core';
3
3
  import { NodeFormProps } from '@flowgram.ai/node';
4
- import { FlowOperationBaseService, FlowNodeType, FlowOperationBaseServiceImpl, FlowNodeEntityOrId, FlowNodeEntity } from '@flowgram.ai/document';
4
+ import { FlowNodeType, FlowOperationBaseServiceImpl, FlowNodeEntityOrId, FlowNodeEntity } from '@flowgram.ai/document';
5
5
  import { W as WorkflowJSON, L as LineCenterPoint, a as WorkflowDocument, b as WorkflowNodeEntity, c as WorkflowHoverService, d as WorkflowLinesManager, e as WorkflowSelectService, f as WorkflowDocumentOptions, g as LineEventProps, N as NodesDragEvent, h as WorkflowNodeJSON, i as WorkflowPortEntity, j as WorkflowLineEntity, O as OnDragLineEnd, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-node-entity-DH5qlw7I.mjs';
6
6
  export { X as HoverPosition, F as LINE_HOVER_DISTANCE, x as LineColor, y as LineColors, w as LinePoint, v as LinePointLocation, u as LineType, C as NodesDragEndEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, P as POINT_RADIUS, K as PORT_SIZE, p as WORKFLOW_LINE_ENTITY, Y as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, _ as WorkflowDocumentOptionsDefault, Z as WorkflowDocumentProvider, V as WorkflowEntityHoverable, H as WorkflowLineEntityOpts, I as WorkflowLineInfo, G as WorkflowLinePortInfo, z as WorkflowLineRenderContributionFactory, J as WorkflowLineUIState, T as WorkflowNodeLines, U as WorkflowNodeLinesData, t as WorkflowNodeMeta, S as WorkflowNodePortsData, M as WorkflowPort, R as WorkflowPortEntityOpts, n as WorkflowPortType, Q as WorkflowPorts, A as WorkflowSubCanvas, q as domReactToBounds, o as getPortEntityId, E as onDragLineEndParams } from './workflow-node-entity-DH5qlw7I.mjs';
7
7
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
@@ -75,7 +75,7 @@ declare class WorkflowDragService {
75
75
  protected linesManager: WorkflowLinesManager;
76
76
  protected commandService: CommandService;
77
77
  protected selectService: WorkflowSelectService;
78
- protected operationService: FlowOperationBaseService;
78
+ protected operationService: WorkflowOperationBaseService;
79
79
  readonly options: WorkflowDocumentOptions;
80
80
  private _onDragLineEventEmitter;
81
81
  readonly onDragLineEventChange: _flowgram_ai_utils.Event<LineEventProps>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PlaygroundConfigEntity, CommandService, PlaygroundDragEvent, EntityData } from '@flowgram.ai/core';
2
2
  export { bindConfigEntity, useConfigEntity, useEntities, useEntityDataFromContext, useEntityFromContext, useListenEvents, usePlayground, usePlaygroundContainer, usePlaygroundContext, useRefresh, useService } from '@flowgram.ai/core';
3
3
  import { NodeFormProps } from '@flowgram.ai/node';
4
- import { FlowOperationBaseService, FlowNodeType, FlowOperationBaseServiceImpl, FlowNodeEntityOrId, FlowNodeEntity } from '@flowgram.ai/document';
4
+ import { FlowNodeType, FlowOperationBaseServiceImpl, FlowNodeEntityOrId, FlowNodeEntity } from '@flowgram.ai/document';
5
5
  import { W as WorkflowJSON, L as LineCenterPoint, a as WorkflowDocument, b as WorkflowNodeEntity, c as WorkflowHoverService, d as WorkflowLinesManager, e as WorkflowSelectService, f as WorkflowDocumentOptions, g as LineEventProps, N as NodesDragEvent, h as WorkflowNodeJSON, i as WorkflowPortEntity, j as WorkflowLineEntity, O as OnDragLineEnd, k as LineRenderType, l as WorkflowLineRenderContribution, m as LinePosition } from './workflow-node-entity-DWVtlA2a.js';
6
6
  export { X as HoverPosition, F as LINE_HOVER_DISTANCE, x as LineColor, y as LineColors, w as LinePoint, v as LinePointLocation, u as LineType, C as NodesDragEndEvent, B as NodesDragStartEvent, D as NodesDraggingEvent, P as POINT_RADIUS, K as PORT_SIZE, p as WORKFLOW_LINE_ENTITY, Y as WorkfloEntityHoverable, s as WorkflowContentChangeEvent, r as WorkflowContentChangeType, _ as WorkflowDocumentOptionsDefault, Z as WorkflowDocumentProvider, V as WorkflowEntityHoverable, H as WorkflowLineEntityOpts, I as WorkflowLineInfo, G as WorkflowLinePortInfo, z as WorkflowLineRenderContributionFactory, J as WorkflowLineUIState, T as WorkflowNodeLines, U as WorkflowNodeLinesData, t as WorkflowNodeMeta, S as WorkflowNodePortsData, M as WorkflowPort, R as WorkflowPortEntityOpts, n as WorkflowPortType, Q as WorkflowPorts, A as WorkflowSubCanvas, q as domReactToBounds, o as getPortEntityId, E as onDragLineEndParams } from './workflow-node-entity-DWVtlA2a.js';
7
7
  import * as _flowgram_ai_utils from '@flowgram.ai/utils';
@@ -75,7 +75,7 @@ declare class WorkflowDragService {
75
75
  protected linesManager: WorkflowLinesManager;
76
76
  protected commandService: CommandService;
77
77
  protected selectService: WorkflowSelectService;
78
- protected operationService: FlowOperationBaseService;
78
+ protected operationService: WorkflowOperationBaseService;
79
79
  readonly options: WorkflowDocumentOptions;
80
80
  private _onDragLineEventEmitter;
81
81
  readonly onDragLineEventChange: _flowgram_ai_utils.Event<LineEventProps>;
package/dist/index.js CHANGED
@@ -3156,20 +3156,16 @@ var WorkflowDragService = class {
3156
3156
  })
3157
3157
  );
3158
3158
  const containerTransform = container.getData(import_core15.TransformData);
3159
- containerTransform.update({
3160
- position: {
3161
- x: containerTransform.position.x + bounds.x,
3162
- y: containerTransform.position.y + bounds.y
3163
- }
3159
+ this.operationService.updateNodePosition(container, {
3160
+ x: containerTransform.position.x + bounds.x,
3161
+ y: containerTransform.position.y + bounds.y
3164
3162
  });
3165
3163
  this.document.layout.updateAffectedTransform(container);
3166
3164
  container.blocks.forEach((node) => {
3167
3165
  const transform = node.getData(import_core15.TransformData);
3168
- transform.update({
3169
- position: {
3170
- x: transform.position.x - bounds.x,
3171
- y: transform.position.y - bounds.y
3172
- }
3166
+ this.operationService.updateNodePosition(node, {
3167
+ x: transform.position.x - bounds.x,
3168
+ y: transform.position.y - bounds.y
3173
3169
  });
3174
3170
  this.document.layout.updateAffectedTransform(node);
3175
3171
  });
@@ -3490,7 +3486,7 @@ __decorateClass([
3490
3486
  (0, import_inversify6.inject)(WorkflowSelectService)
3491
3487
  ], WorkflowDragService.prototype, "selectService", 2);
3492
3488
  __decorateClass([
3493
- (0, import_inversify6.inject)(import_document9.FlowOperationBaseService)
3489
+ (0, import_inversify6.inject)(WorkflowOperationBaseService)
3494
3490
  ], WorkflowDragService.prototype, "operationService", 2);
3495
3491
  __decorateClass([
3496
3492
  (0, import_inversify6.inject)(WorkflowDocumentOptions)
@@ -3717,7 +3713,7 @@ function usePlaygroundReadonlyState(listenChange) {
3717
3713
  function checkTargetDraggable(el) {
3718
3714
  return el && el.tagName !== "INPUT" && el.tagName !== "TEXTAREA" && !el.closest(".flow-canvas-not-draggable");
3719
3715
  }
3720
- var isFirefox = navigator?.userAgent?.includes?.("Firefox");
3716
+ var isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes?.("Firefox");
3721
3717
  function useNodeRender(nodeFromProps) {
3722
3718
  const node = nodeFromProps || (0, import_react2.useContext)(import_core21.PlaygroundEntityContext);
3723
3719
  const renderData = node.getData(import_document13.FlowNodeRenderData);