@worktile/theia 3.0.0-next.5 → 3.0.0-next.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.
@@ -1448,10 +1448,9 @@
1448
1448
  if (util.isObject(options[option])) {
1449
1449
  newOptions[option] = _.assign(options[option], override.options[option]);
1450
1450
  }
1451
- newOptions[option] = override.options[option];
1451
+ newOptions[option] = override.options[option] ? override.options[option] : options[option];
1452
1452
  }
1453
1453
  plugin.options = newOptions;
1454
- return plugin;
1455
1454
  };
1456
1455
 
1457
1456
  var combinePlugins = function (editor) {
@@ -1470,7 +1469,7 @@
1470
1469
  var newPlugins = _plugins.filter(function (p) { return plugin.overrideByKey[p.key]; });
1471
1470
  newPlugins.forEach(function (p) {
1472
1471
  if (editor.pluginsByKey[p.key]) {
1473
- p = mergeOptions(p, plugin.overrideByKey[p.key]);
1472
+ mergeOptions(p, plugin.overrideByKey[p.key]);
1474
1473
  editor.pluginsByKey[p.key] = _.defaultsDeep(p, plugin.overrideByKey[p.key]);
1475
1474
  }
1476
1475
  });
@@ -2526,19 +2525,19 @@
2526
2525
  someNode: someNode
2527
2526
  });
2528
2527
 
2529
- var insertElements = function (editor, element) {
2528
+ var insertElements = function (editor, elements) {
2530
2529
  var _a;
2531
2530
  if (slate.Range.isExpanded(editor.selection)) {
2532
2531
  slate.Editor.deleteFragment(editor);
2533
2532
  }
2534
- var type = element.type;
2533
+ var type = !util.isArray(elements) ? elements.type : elements[0].type; // 后期处理复制粘贴需要修改
2535
2534
  var allowParentTypes = ((_a = getPluginOptions(editor, type)) === null || _a === void 0 ? void 0 : _a.allowParentTypes) || [];
2536
2535
  var insertNodePath = getInsertElementsPath(editor, allowParentTypes);
2537
2536
  var _b = __read(anchorBlockEntry(editor), 2), anchorBlock = _b[0], anchorBlockPath = _b[1];
2538
2537
  var isEmpty = slate.Editor.isEmpty(editor, anchorBlock);
2539
2538
  if (insertNodePath) {
2540
2539
  slate.Editor.withoutNormalizing(editor, function () {
2541
- slate.Transforms.insertNodes(editor, element, { at: insertNodePath });
2540
+ slate.Transforms.insertNodes(editor, elements, { at: insertNodePath });
2542
2541
  slate.Transforms.select(editor, slate.Editor.start(editor, insertNodePath));
2543
2542
  if (isEmpty) {
2544
2543
  slate.Transforms.removeNodes(editor, { at: anchorBlockPath });
@@ -2547,7 +2546,7 @@
2547
2546
  return;
2548
2547
  }
2549
2548
  var nextPath = slate.Path.next([anchorBlockPath[0]]);
2550
- slate.Transforms.insertNodes(editor, element, { at: nextPath });
2549
+ slate.Transforms.insertNodes(editor, elements, { at: nextPath });
2551
2550
  if (isEmpty && anchorBlockPath.length === 1) {
2552
2551
  slate.Transforms.delete(editor, { at: anchorBlockPath });
2553
2552
  slate.Transforms.select(editor, slate.Editor.start(editor, anchorBlockPath));
@@ -3120,12 +3119,7 @@
3120
3119
  finally { if (e_1) throw e_1.error; }
3121
3120
  }
3122
3121
  if (imageNodes.length > 0) {
3123
- var at = editor.selection;
3124
- slate.Transforms.insertNodes(editor, imageNodes, { at: at });
3125
- if (isCollapsed(editor.selection) && isEmptyParagraph(editor)) {
3126
- slate.Transforms.removeNodes(editor, { at: at });
3127
- slate.Transforms.select(editor, at);
3128
- }
3122
+ insertElements(editor, imageNodes);
3129
3123
  }
3130
3124
  },
3131
3125
  verifyImage: function (editor, image) {