@cniot/mdd-editor 0.3.5 → 0.3.6

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/build/index.es.js CHANGED
@@ -7213,6 +7213,22 @@ class HTML5BackendImpl {
7213
7213
  const HTML5Backend = function createBackend(manager, context, options) {
7214
7214
  return new HTML5BackendImpl(manager, context, options);
7215
7215
  };
7216
+ let sharedDragDropManager;
7217
+ function getSharedDragDropManager() {
7218
+ if (!sharedDragDropManager) {
7219
+ sharedDragDropManager = createDragDropManager(HTML5Backend);
7220
+ }
7221
+ return sharedDragDropManager;
7222
+ }
7223
+ function MddDndProvider({ children }) {
7224
+ const { dragDropManager } = React$1.useContext(DndContext);
7225
+ if (dragDropManager) {
7226
+ return children;
7227
+ }
7228
+ return /* @__PURE__ */ React$1.createElement(DndProvider, {
7229
+ manager: getSharedDragDropManager()
7230
+ }, children);
7231
+ }
7216
7232
  const FormLayoutDeepContext$1 = createContext(null);
7217
7233
  const FormLayoutShallowContext$1 = createContext(null);
7218
7234
  const useFormShallowLayout$1 = () => useContext(FormLayoutShallowContext$1);
@@ -26430,9 +26446,7 @@ function MddTableForm(props, ref) {
26430
26446
  className: styles$b.tableFormAction
26431
26447
  }, actionContent)), /* @__PURE__ */ React$1.createElement("div", {
26432
26448
  className: styles$b.tableFormContent
26433
- }, /* @__PURE__ */ React$1.createElement(DndProvider, {
26434
- backend: HTML5Backend
26435
- }, /* @__PURE__ */ React$1.createElement(Collapse, {
26449
+ }, /* @__PURE__ */ React$1.createElement(MddDndProvider, null, /* @__PURE__ */ React$1.createElement(Collapse, {
26436
26450
  accordion: true
26437
26451
  }, dataRef.current.map((item, idx) => {
26438
26452
  const compKey = item.name || item.dataIndex || `${title2}_${idx}`;
@@ -27791,9 +27805,7 @@ function MddTableSimpleArray(props) {
27791
27805
  align: "t"
27792
27806
  }, tip)), /* @__PURE__ */ React$1.createElement("div", {
27793
27807
  className: styles$9.tableArrayContent
27794
- }, /* @__PURE__ */ React$1.createElement(DndProvider, {
27795
- backend: HTML5Backend
27796
- }, /* @__PURE__ */ React$1.createElement(Collapse, {
27808
+ }, /* @__PURE__ */ React$1.createElement(MddDndProvider, null, /* @__PURE__ */ React$1.createElement(Collapse, {
27797
27809
  accordion: true
27798
27810
  }, (_a2 = data == null ? void 0 : data.map) == null ? void 0 : _a2.call(data, (item, idx) => {
27799
27811
  return /* @__PURE__ */ React$1.createElement(Panel$2, {
@@ -28383,9 +28395,7 @@ function MddTableArray(props) {
28383
28395
  className: styles$6.tableArrayTitle
28384
28396
  }, title2), /* @__PURE__ */ React$1.createElement("div", {
28385
28397
  className: styles$6.tableArrayContent
28386
- }, /* @__PURE__ */ React$1.createElement(DndProvider, {
28387
- backend: HTML5Backend
28388
- }, /* @__PURE__ */ React$1.createElement(Collapse, {
28398
+ }, /* @__PURE__ */ React$1.createElement(MddDndProvider, null, /* @__PURE__ */ React$1.createElement(Collapse, {
28389
28399
  accordion: true
28390
28400
  }, data.map((item, idx) => {
28391
28401
  var _a2;
@@ -31185,11 +31195,11 @@ function MDDEditor(props) {
31185
31195
  const Comp = CompAndSchema[0];
31186
31196
  return /* @__PURE__ */ React$1.createElement("div", {
31187
31197
  className: "mdd-editor-build-content"
31188
- }, /* @__PURE__ */ React$1.createElement(Comp, {
31198
+ }, /* @__PURE__ */ React$1.createElement(MddDndProvider, null, /* @__PURE__ */ React$1.createElement(Comp, {
31189
31199
  key: editorRefreshKey,
31190
31200
  schema,
31191
31201
  moduleMap
31192
- }), /* @__PURE__ */ React$1.createElement(Toolbar, {
31202
+ })), /* @__PURE__ */ React$1.createElement(Toolbar, {
31193
31203
  schema,
31194
31204
  scriptInfo: schemaAndScriptRef.current.scriptInfo,
31195
31205
  showScript,
@@ -31449,7 +31459,7 @@ function getDefaultIndexStyle() {
31449
31459
  `;
31450
31460
  }
31451
31461
  const name = "@cniot/mdd-editor";
31452
- const version = "0.3.5";
31462
+ const version = "0.3.6";
31453
31463
  const description = "\u6A21\u578B\u9A71\u52A8\u7F16\u8F91\u5668";
31454
31464
  const scripts = {
31455
31465
  build: "vite build"
@@ -31465,6 +31475,7 @@ const dependencies = {
31465
31475
  ahooks: "^3.2.0",
31466
31476
  classnames: "^2.3.1",
31467
31477
  "cn-address-select-pro": "^0.1.5",
31478
+ "dnd-core": "^16.0.1",
31468
31479
  hox: "^1.1.6",
31469
31480
  "immutability-helper": "^3.1.1",
31470
31481
  "js-cookie": "^3.0.5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cniot/mdd-editor",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "模型驱动编辑器",
5
5
  "scripts": {
6
6
  "build": "vite build"
@@ -16,6 +16,7 @@
16
16
  "ahooks": "^3.2.0",
17
17
  "classnames": "^2.3.1",
18
18
  "cn-address-select-pro": "^0.1.5",
19
+ "dnd-core": "^16.0.1",
19
20
  "hox": "^1.1.6",
20
21
  "immutability-helper": "^3.1.1",
21
22
  "js-cookie": "^3.0.5",