@worktile/theia 13.0.22 → 13.0.23

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.
@@ -897,12 +897,11 @@ const mergeElementOptions = (elementOptions) => {
897
897
  const combinationData = [...DefaultElementOptions, ...elementOptions];
898
898
  const dataInfo = {};
899
899
  combinationData.forEach(item => {
900
- const { type, inValidChildrenTypes, isIndivisible, isSecondaryContainer } = item;
900
+ const { type, inValidChildrenTypes, isSecondaryContainer } = item;
901
901
  if (!dataInfo[type]) {
902
902
  dataInfo[type] = {
903
903
  type,
904
904
  inValidChildrenTypes,
905
- isIndivisible,
906
905
  isSecondaryContainer
907
906
  };
908
907
  }
@@ -2278,36 +2277,6 @@ const unWrap = (editor, kind) => {
2278
2277
  });
2279
2278
  };
2280
2279
 
2281
- const splitNode = (editor, indivisibleTypes) => {
2282
- const { selection } = editor;
2283
- const indivisibleType = indivisibleTypes && indivisibleTypes.find(item => getAboveByType(editor, item, { mode: 'highest' }));
2284
- let splitPath;
2285
- if (!indivisibleType) {
2286
- Transforms.splitNodes(editor, {
2287
- always: true,
2288
- mode: 'highest'
2289
- });
2290
- splitPath = [selection.anchor.path[0]];
2291
- }
2292
- else {
2293
- Transforms.splitNodes(editor, {
2294
- always: true,
2295
- mode: 'highest',
2296
- match: (data) => {
2297
- if (data.type && !indivisibleTypes.includes(data.type)) {
2298
- const [node] = getNodesByType(editor, data.type, { at: selection });
2299
- const parentNode = Editor.parent(editor, node[1]);
2300
- if (indivisibleTypes.includes(parentNode[0].type)) {
2301
- splitPath = node[1];
2302
- return true;
2303
- }
2304
- }
2305
- }
2306
- });
2307
- }
2308
- return splitPath;
2309
- };
2310
-
2311
2280
  const deleteElement = (editor, element) => {
2312
2281
  const at = findPath(editor, element);
2313
2282
  Transforms.insertNodes(editor, createEmptyParagraph(), { at });
@@ -2376,7 +2345,6 @@ var index = /*#__PURE__*/Object.freeze({
2376
2345
  applyDeepToNodes: applyDeepToNodes,
2377
2346
  mergeDeepToNodes: mergeDeepToNodes,
2378
2347
  unWrap: unWrap,
2379
- splitNode: splitNode,
2380
2348
  deleteElement: deleteElement,
2381
2349
  setEndSelection: setEndSelection,
2382
2350
  closeConversionHint: closeConversionHint,
@@ -2555,7 +2523,6 @@ const withAutoInsertData = (editor) => {
2555
2523
  const extraInfo = mergeElementOptions(editor.extraElementOptions);
2556
2524
  allElementOptions = Object.values(extraInfo);
2557
2525
  }
2558
- const indivisibleTypes = allElementOptions.filter(item => item.isIndivisible).map(item => item.type);
2559
2526
  const fragment = extractFragment(data);
2560
2527
  if (fragment) {
2561
2528
  if (isAcrossBlocks(editor, fragment) || Editor.isVoid(editor, fragment[0])) {
@@ -2567,20 +2534,20 @@ const withAutoInsertData = (editor) => {
2567
2534
  // is exist invalid element type in fragment
2568
2535
  const invalidIndex = fragment.findIndex(item => tryVerifyNode.inValidChildrenTypes.includes(item.type));
2569
2536
  if (invalidIndex > -1) {
2570
- const validFragmentData = fragment.slice(0, invalidIndex);
2571
2537
  const invalidFragmentData = fragment.slice(invalidIndex, fragment.length);
2572
- Editor.withoutNormalizing(editor, () => {
2573
- if (validFragmentData.length > 0) {
2574
- validFragmentData.forEach(item => {
2575
- Transforms.insertNodes(editor, item);
2576
- });
2577
- }
2578
- // split node
2579
- const path = splitNode(editor, indivisibleTypes);
2580
- Transforms.insertNodes(editor, invalidFragmentData, {
2581
- at: Path.next(path)
2538
+ const allowParentTypes = getPluginOptions(editor, invalidFragmentData[0].type)?.allowParentTypes || [];
2539
+ const insertNodePath = getInsertElementsPath(editor, allowParentTypes);
2540
+ if (insertNodePath) {
2541
+ Editor.withoutNormalizing(editor, () => {
2542
+ Transforms.insertNodes(editor, fragment, { at: insertNodePath });
2543
+ Transforms.select(editor, Editor.start(editor, insertNodePath));
2582
2544
  });
2583
- });
2545
+ return;
2546
+ }
2547
+ const [anchorBlock, anchorBlockPath] = anchorBlockEntry(editor);
2548
+ const nextPath = Path.next([anchorBlockPath[0]]);
2549
+ Transforms.insertNodes(editor, fragment, { at: nextPath });
2550
+ Transforms.select(editor, Editor.start(editor, nextPath));
2584
2551
  return;
2585
2552
  }
2586
2553
  }
@@ -8660,10 +8627,10 @@ class TheTableToolbarComponent {
8660
8627
  }
8661
8628
  }
8662
8629
  TheTableToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: TheTableToolbarComponent, deps: [{ token: i0.NgZone }, { token: TheColorSelectService }, { token: i1$1.ThyPopover }, { token: i1$1.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
8663
- TheTableToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect", tableElement: "tableElement" }, ngImport: i0, template: "<thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a\n *ngIf=\"!item.invisibility\"\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"item.actionHandle()\"\n ></a>\n </ng-container>\n <thy-divider *ngIf=\"!isActiveSelect && isShowSplitLine\" class=\"mx-2 align-self-center\" [thyVertical]=\"true\"> </thy-divider>\n <a href=\"javascript:;\" thyAction thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <a href=\"javascript:;\" *ngIf=\"tableOptions?.showFullscreen\" thyAction thyTooltip=\"\u5168\u5C4F\" (mousedown)=\"setFullscreen($event)\">\n <thy-icon thyIconName=\"expand-arrows\"></thy-icon>\n </a>\n\n <ng-container *ngIf=\"tableStore.isSelectedTable\">\n <thy-divider class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a href=\"javascript:;\" class=\"link-with-down\" thyAction (mousedown)=\"openTableOptionMenu($event)\">\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon thyIconName=\"caret-down\"></thy-icon>\n </a>\n </ng-container>\n\n <thy-divider *ngIf=\"deleteIcon\" class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n [thyActionIcon]=\"deleteIcon\"\n [thyTooltip]=\"iconName\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-actions>\n", components: [{ type: i3$1.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { type: i3$1.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { type: i4$2.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { type: i2.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$3.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
8630
+ TheTableToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect", tableElement: "tableElement" }, ngImport: i0, template: "<thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a\n *ngIf=\"!item.invisibility\"\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"item.actionHandle()\"\n ></a>\n </ng-container>\n <thy-divider *ngIf=\"!isActiveSelect && isShowSplitLine\" class=\"mx-2 align-self-center\" [thyVertical]=\"true\"> </thy-divider>\n <a href=\"javascript:;\" thyAction thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <a href=\"javascript:;\" *ngIf=\"tableOptions?.showFullscreen\" thyAction thyTooltip=\"\u5168\u5C4F\" (mousedown)=\"setFullscreen($event)\">\n <thy-icon thyIconName=\"expand-arrows\"></thy-icon>\n </a>\n\n <ng-container *ngIf=\"tableStore.isSelectedTable\">\n <thy-divider class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a href=\"javascript:;\" class=\"link-with-down\" thyAction (mousedown)=\"openTableOptionMenu($event)\">\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon thyIconName=\"caret-down\"></thy-icon>\n </a>\n </ng-container>\n\n <ng-container *ngIf=\"tableOptions?.showFullscreen ? deleteIcon : deleteIcon && !tableStore.isSelectedTable\">\n <thy-divider class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n [thyActionIcon]=\"deleteIcon\"\n [thyTooltip]=\"iconName\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n </ng-container>\n</thy-actions>\n", components: [{ type: i3$1.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { type: i3$1.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { type: i4$2.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { type: i2.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$3.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
8664
8631
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: TheTableToolbarComponent, decorators: [{
8665
8632
  type: Component,
8666
- args: [{ selector: 'the-table-toolbar', template: "<thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a\n *ngIf=\"!item.invisibility\"\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"item.actionHandle()\"\n ></a>\n </ng-container>\n <thy-divider *ngIf=\"!isActiveSelect && isShowSplitLine\" class=\"mx-2 align-self-center\" [thyVertical]=\"true\"> </thy-divider>\n <a href=\"javascript:;\" thyAction thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <a href=\"javascript:;\" *ngIf=\"tableOptions?.showFullscreen\" thyAction thyTooltip=\"\u5168\u5C4F\" (mousedown)=\"setFullscreen($event)\">\n <thy-icon thyIconName=\"expand-arrows\"></thy-icon>\n </a>\n\n <ng-container *ngIf=\"tableStore.isSelectedTable\">\n <thy-divider class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a href=\"javascript:;\" class=\"link-with-down\" thyAction (mousedown)=\"openTableOptionMenu($event)\">\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon thyIconName=\"caret-down\"></thy-icon>\n </a>\n </ng-container>\n\n <thy-divider *ngIf=\"deleteIcon\" class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n [thyActionIcon]=\"deleteIcon\"\n [thyTooltip]=\"iconName\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-actions>\n" }]
8633
+ args: [{ selector: 'the-table-toolbar', template: "<thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a\n *ngIf=\"!item.invisibility\"\n href=\"javascript:;\"\n thyAction\n [thyActionIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n (mousedown)=\"item.actionHandle()\"\n ></a>\n </ng-container>\n <thy-divider *ngIf=\"!isActiveSelect && isShowSplitLine\" class=\"mx-2 align-self-center\" [thyVertical]=\"true\"> </thy-divider>\n <a href=\"javascript:;\" thyAction thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <a href=\"javascript:;\" *ngIf=\"tableOptions?.showFullscreen\" thyAction thyTooltip=\"\u5168\u5C4F\" (mousedown)=\"setFullscreen($event)\">\n <thy-icon thyIconName=\"expand-arrows\"></thy-icon>\n </a>\n\n <ng-container *ngIf=\"tableStore.isSelectedTable\">\n <thy-divider class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a href=\"javascript:;\" class=\"link-with-down\" thyAction (mousedown)=\"openTableOptionMenu($event)\">\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon thyIconName=\"caret-down\"></thy-icon>\n </a>\n </ng-container>\n\n <ng-container *ngIf=\"tableOptions?.showFullscreen ? deleteIcon : deleteIcon && !tableStore.isSelectedTable\">\n <thy-divider class=\"mx-2 align-self-center\" [thyVertical]=\"true\"></thy-divider>\n <a\n href=\"javascript:;\"\n thyAction\n thyType=\"danger\"\n [thyActionIcon]=\"deleteIcon\"\n [thyTooltip]=\"iconName\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n </ng-container>\n</thy-actions>\n" }]
8667
8634
  }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: TheColorSelectService }, { type: i1$1.ThyPopover }, { type: i1$1.ThyPopoverRef }]; }, propDecorators: { tableStore: [{
8668
8635
  type: Input
8669
8636
  }], isActiveSelect: [{
@@ -11269,9 +11236,6 @@ const createTablePlugin = createPluginFactory({
11269
11236
  showFullscreen: true,
11270
11237
  setFullscreen: (editor, event, element) => {
11271
11238
  event.preventDefault();
11272
- },
11273
- exitFullscreen: (editor, event, element) => {
11274
- event.preventDefault();
11275
11239
  }
11276
11240
  }
11277
11241
  });