@nocobase/flow-engine 2.1.0-alpha.38 → 2.1.0-alpha.39

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.
@@ -39,4 +39,15 @@ export declare const Droppable: FC<{
39
39
  model: FlowModel<any>;
40
40
  children: React.ReactNode;
41
41
  }>;
42
- export declare const DndProvider: FC<DndContextProps & PersistOptions>;
42
+ export interface DndProviderProps extends DndContextProps, PersistOptions {
43
+ /**
44
+ * Whether to render the built-in `DragOverlay` (the "Dragging" pill that
45
+ * follows the cursor). Defaults to `true` for backwards compatibility with
46
+ * existing flow-engine drag interactions. Set to `false` when the
47
+ * surrounding UI already gives clear visual feedback (e.g. a drag-sort
48
+ * table that highlights the drop position) and the floating pill would be
49
+ * redundant.
50
+ */
51
+ showDragOverlay?: boolean;
52
+ }
53
+ export declare const DndProvider: FC<DndProviderProps>;
@@ -274,6 +274,7 @@ const Droppable = /* @__PURE__ */ __name(({ model, children }) => {
274
274
  }, "Droppable");
275
275
  const DndProvider = /* @__PURE__ */ __name(({
276
276
  persist = true,
277
+ showDragOverlay = true,
277
278
  children,
278
279
  onDragStart,
279
280
  onDragEnd,
@@ -337,7 +338,7 @@ const DndProvider = /* @__PURE__ */ __name(({
337
338
  ...restProps
338
339
  },
339
340
  children,
340
- typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
341
+ showDragOverlay && typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
341
342
  /* @__PURE__ */ import_react.default.createElement(
342
343
  import_core.DragOverlay,
343
344
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/flow-engine",
3
- "version": "2.1.0-alpha.38",
3
+ "version": "2.1.0-alpha.39",
4
4
  "private": false,
5
5
  "description": "A standalone flow engine for NocoBase, managing workflows, models, and actions.",
6
6
  "main": "lib/index.js",
@@ -8,8 +8,8 @@
8
8
  "dependencies": {
9
9
  "@formily/antd-v5": "1.x",
10
10
  "@formily/reactive": "2.x",
11
- "@nocobase/sdk": "2.1.0-alpha.38",
12
- "@nocobase/shared": "2.1.0-alpha.38",
11
+ "@nocobase/sdk": "2.1.0-alpha.39",
12
+ "@nocobase/shared": "2.1.0-alpha.39",
13
13
  "ahooks": "^3.7.2",
14
14
  "axios": "^1.7.0",
15
15
  "dayjs": "^1.11.9",
@@ -37,5 +37,5 @@
37
37
  ],
38
38
  "author": "NocoBase Team",
39
39
  "license": "Apache-2.0",
40
- "gitHead": "cc99815fc9ae0612d6db0db5ebbc87a774fff8ed"
40
+ "gitHead": "d06ed6b97030866c00e7ce40c9e1bcc773ebf12c"
41
41
  }
@@ -283,9 +283,22 @@ export const Droppable: FC<{ model: FlowModel<any>; children: React.ReactNode }>
283
283
  );
284
284
  };
285
285
 
286
+ export interface DndProviderProps extends DndContextProps, PersistOptions {
287
+ /**
288
+ * Whether to render the built-in `DragOverlay` (the "Dragging" pill that
289
+ * follows the cursor). Defaults to `true` for backwards compatibility with
290
+ * existing flow-engine drag interactions. Set to `false` when the
291
+ * surrounding UI already gives clear visual feedback (e.g. a drag-sort
292
+ * table that highlights the drop position) and the floating pill would be
293
+ * redundant.
294
+ */
295
+ showDragOverlay?: boolean;
296
+ }
297
+
286
298
  // 提供一个封装了 DragOverlay 的 DndProvider 组件,继承 DndContext 的所有 props
287
- export const DndProvider: FC<DndContextProps & PersistOptions> = ({
299
+ export const DndProvider: FC<DndProviderProps> = ({
288
300
  persist = true,
301
+ showDragOverlay = true,
289
302
  children,
290
303
  onDragStart,
291
304
  onDragEnd,
@@ -355,7 +368,7 @@ export const DndProvider: FC<DndContextProps & PersistOptions> = ({
355
368
  {...restProps}
356
369
  >
357
370
  {children}
358
- {typeof document !== 'undefined'
371
+ {showDragOverlay && typeof document !== 'undefined'
359
372
  ? createPortal(
360
373
  <DragOverlay
361
374
  dropAnimation={null}