@next-core/editor-bricks-helper 0.44.1 → 0.46.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.46.0](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.45.1...@next-core/editor-bricks-helper@0.46.0) (2022-08-10)
7
+
8
+
9
+ ### Features
10
+
11
+ * update workbenchTree Drag move ([2a01659](https://github.com/easyops-cn/next-core/commit/2a016591ff4d3ba170fd75bea92bebb24a0f6b8d))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.45.1](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.45.0...@next-core/editor-bricks-helper@0.45.1) (2022-08-09)
18
+
19
+ **Note:** Version bump only for package @next-core/editor-bricks-helper
20
+
21
+
22
+
23
+
24
+
25
+ # [0.45.0](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.44.1...@next-core/editor-bricks-helper@0.45.0) (2022-08-09)
26
+
27
+
28
+ ### Features
29
+
30
+ * support drag snippet not update builder data ([3b73fe4](https://github.com/easyops-cn/next-core/commit/3b73fe4b39851667a749a8bb353f561adb131ebb))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [0.44.1](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.44.0...@next-core/editor-bricks-helper@0.44.1) (2022-08-08)
7
37
 
8
38
  **Note:** Version bump only for package @next-core/editor-bricks-helper
@@ -1233,6 +1233,7 @@
1233
1233
  }
1234
1234
 
1235
1235
  workbenchNodeAdd(detail) {
1236
+ var isNeedUpdateSnippet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1236
1237
  var {
1237
1238
  nodes,
1238
1239
  edges,
@@ -1285,7 +1286,7 @@
1285
1286
 
1286
1287
  if (nodeData.bricks) {
1287
1288
  // snippet
1288
- this.snippetApply({
1289
+ var snippetData = {
1289
1290
  parentUid,
1290
1291
  nodeDetails: nodeData.bricks.map(brickConf => getSnippetNodeDetail({
1291
1292
  parent: parentInstanceId,
@@ -1297,8 +1298,13 @@
1297
1298
  })),
1298
1299
  nodeIds,
1299
1300
  nodeUids
1300
- });
1301
- return;
1301
+ };
1302
+
1303
+ if (isNeedUpdateSnippet) {
1304
+ this.snippetApply(snippetData);
1305
+ } else {
1306
+ return snippetData;
1307
+ }
1302
1308
  }
1303
1309
 
1304
1310
  this.runAddNodeAction({
@@ -1334,6 +1340,8 @@
1334
1340
  dragStatus
1335
1341
  } = detail;
1336
1342
  var nodeData = nodes.find(item => item.$$uid === dragNodeUid);
1343
+ var originParentUid = edges.find(edge => edge.child === nodeData.$$uid).parent;
1344
+ var originParentNode = nodes.find(node => node.$$uid === originParentUid);
1337
1345
  var {
1338
1346
  parentUid,
1339
1347
  parnetNodeData,
@@ -1367,15 +1375,18 @@
1367
1375
  });
1368
1376
  this.triggerDataChange();
1369
1377
  this.eventTarget.dispatchEvent(new CustomEvent(BuilderInternalEventType.WORKBENCH_TREE_NODE_MOVE, {
1370
- detail: {
1378
+ detail: _objectSpread__default["default"](_objectSpread__default["default"]({
1371
1379
  nodeUid: dragNodeUid,
1372
1380
  nodeInstanceId: nodeData.instanceId,
1373
- nodeIds,
1381
+ nodeIds
1382
+ }, originParentNode.instanceId !== parnetNodeData.instanceId ? {
1374
1383
  nodeData: {
1375
1384
  parent: parnetNodeData.instanceId,
1376
1385
  mountPoint: mountPoint
1377
1386
  }
1378
- }
1387
+ } : {}), {}, {
1388
+ objectId: nodeData["_object_id"]
1389
+ })
1379
1390
  }));
1380
1391
  }
1381
1392
  /**