@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/dist/index.esm.js CHANGED
@@ -1231,6 +1231,7 @@ class BuilderDataManager {
1231
1231
  }
1232
1232
 
1233
1233
  workbenchNodeAdd(detail) {
1234
+ var isNeedUpdateSnippet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1234
1235
  var {
1235
1236
  nodes,
1236
1237
  edges,
@@ -1283,7 +1284,7 @@ class BuilderDataManager {
1283
1284
 
1284
1285
  if (nodeData.bricks) {
1285
1286
  // snippet
1286
- this.snippetApply({
1287
+ var snippetData = {
1287
1288
  parentUid,
1288
1289
  nodeDetails: nodeData.bricks.map(brickConf => getSnippetNodeDetail({
1289
1290
  parent: parentInstanceId,
@@ -1295,8 +1296,13 @@ class BuilderDataManager {
1295
1296
  })),
1296
1297
  nodeIds,
1297
1298
  nodeUids
1298
- });
1299
- return;
1299
+ };
1300
+
1301
+ if (isNeedUpdateSnippet) {
1302
+ this.snippetApply(snippetData);
1303
+ } else {
1304
+ return snippetData;
1305
+ }
1300
1306
  }
1301
1307
 
1302
1308
  this.runAddNodeAction({
@@ -1332,6 +1338,8 @@ class BuilderDataManager {
1332
1338
  dragStatus
1333
1339
  } = detail;
1334
1340
  var nodeData = nodes.find(item => item.$$uid === dragNodeUid);
1341
+ var originParentUid = edges.find(edge => edge.child === nodeData.$$uid).parent;
1342
+ var originParentNode = nodes.find(node => node.$$uid === originParentUid);
1335
1343
  var {
1336
1344
  parentUid,
1337
1345
  parnetNodeData,
@@ -1365,15 +1373,18 @@ class BuilderDataManager {
1365
1373
  });
1366
1374
  this.triggerDataChange();
1367
1375
  this.eventTarget.dispatchEvent(new CustomEvent(BuilderInternalEventType.WORKBENCH_TREE_NODE_MOVE, {
1368
- detail: {
1376
+ detail: _objectSpread(_objectSpread({
1369
1377
  nodeUid: dragNodeUid,
1370
1378
  nodeInstanceId: nodeData.instanceId,
1371
- nodeIds,
1379
+ nodeIds
1380
+ }, originParentNode.instanceId !== parnetNodeData.instanceId ? {
1372
1381
  nodeData: {
1373
1382
  parent: parnetNodeData.instanceId,
1374
1383
  mountPoint: mountPoint
1375
1384
  }
1376
- }
1385
+ } : {}), {}, {
1386
+ objectId: nodeData["_object_id"]
1387
+ })
1377
1388
  }));
1378
1389
  }
1379
1390
  /**