@ckeditor/ckeditor5-table 0.0.0-nightly-20250214.0 → 0.0.0-nightly-next-20250215.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.
Files changed (33) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/table.js +1 -1
  3. package/ckeditor5-metadata.json +6 -6
  4. package/dist/index.js +25 -34
  5. package/dist/index.js.map +1 -1
  6. package/package.json +10 -9
  7. package/src/commands/insertcolumncommand.js +4 -0
  8. package/src/commands/insertrowcommand.js +4 -0
  9. package/src/commands/mergecellcommand.js +8 -0
  10. package/src/commands/splitcellcommand.js +4 -0
  11. package/src/tablecaption/tablecaptionediting.js +7 -0
  12. package/src/tablecaption/tablecaptionui.js +3 -2
  13. package/src/tablecellproperties/commands/tablecellpropertycommand.js +8 -0
  14. package/src/tablecellproperties/tablecellpropertiesui.js +25 -3
  15. package/src/tablecellproperties/ui/tablecellpropertiesview.js +78 -10
  16. package/src/tablecolumnresize/tablecolumnresizeediting.js +18 -1
  17. package/src/tableediting.js +4 -0
  18. package/src/tablemouse/mouseeventsobserver.js +3 -6
  19. package/src/tableproperties/commands/tablepropertycommand.js +8 -0
  20. package/src/tableproperties/tablepropertiesui.d.ts +1 -1
  21. package/src/tableproperties/tablepropertiesui.js +25 -7
  22. package/src/tableproperties/ui/tablepropertiesview.js +66 -6
  23. package/src/tableui.js +7 -9
  24. package/src/tablewalker.js +99 -4
  25. package/src/ui/colorinputview.js +34 -0
  26. package/src/ui/formrowview.js +4 -0
  27. package/src/ui/inserttableview.js +12 -0
  28. package/src/utils/table-properties.js +1 -1
  29. package/theme/icons/table-cell-properties.svg +0 -1
  30. package/theme/icons/table-column.svg +0 -1
  31. package/theme/icons/table-merge-cell.svg +0 -1
  32. package/theme/icons/table-properties.svg +0 -1
  33. package/theme/icons/table-row.svg +0 -1
@@ -10,12 +10,12 @@
10
10
  {
11
11
  "type": "SplitButton",
12
12
  "name": "insertTable",
13
- "iconPath": "@ckeditor/ckeditor5-core/theme/icons/table.svg"
13
+ "iconPath": "@ckeditor/ckeditor5-icons/theme/icons/table.svg"
14
14
  },
15
15
  {
16
16
  "type": "Button",
17
17
  "name": "tableColumn",
18
- "iconPath": "theme/icons/table-column.svg",
18
+ "iconPath": "@ckeditor/ckeditor5-icons/theme/icons/table-column.svg",
19
19
  "toolbars": [
20
20
  "table.contentToolbar"
21
21
  ]
@@ -23,7 +23,7 @@
23
23
  {
24
24
  "type": "Button",
25
25
  "name": "tableRow",
26
- "iconPath": "theme/icons/table-row.svg",
26
+ "iconPath": "@ckeditor/ckeditor5-icons/theme/icons/table-row.svg",
27
27
  "toolbars": [
28
28
  "table.contentToolbar"
29
29
  ]
@@ -31,7 +31,7 @@
31
31
  {
32
32
  "type": "Button",
33
33
  "name": "mergeTableCells",
34
- "iconPath": "theme/icons/table-merge-cell.svg",
34
+ "iconPath": "@ckeditor/ckeditor5-icons/theme/icons/table-merge-cell.svg",
35
35
  "toolbars": [
36
36
  "table.contentToolbar"
37
37
  ]
@@ -76,7 +76,7 @@
76
76
  {
77
77
  "type": "Button",
78
78
  "name": "tableCellProperties",
79
- "iconPath": "theme/icons/table-cell-properties.svg",
79
+ "iconPath": "@ckeditor/ckeditor5-icons/theme/icons/table-cell-properties.svg",
80
80
  "toolbars": [
81
81
  "table.contentToolbar"
82
82
  ]
@@ -115,7 +115,7 @@
115
115
  {
116
116
  "type": "Button",
117
117
  "name": "tableProperties",
118
- "iconPath": "theme/icons/table-properties.svg",
118
+ "iconPath": "@ckeditor/ckeditor5-icons/theme/icons/table-properties.svg",
119
119
  "toolbars": [
120
120
  "table.contentToolbar"
121
121
  ]
package/dist/index.js CHANGED
@@ -2,13 +2,14 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import { Command, Plugin, icons } from '@ckeditor/ckeditor5-core/dist/index.js';
5
+ import { Command, Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
6
6
  import { toWidgetEditable, toWidget, Widget, isWidget, WidgetToolbarRepository } from '@ckeditor/ckeditor5-widget/dist/index.js';
7
7
  import { first, global, CKEditorError, KeystrokeHandler, FocusTracker, Collection, getLocalizedArrowKeyCodeDirection, Rect, DomEmitterMixin } from '@ckeditor/ckeditor5-utils/dist/index.js';
8
+ import { IconTable, IconTableColumn, IconTableRow, IconTableMergeCell, IconCheck, IconCancel, IconAlignBottom, IconAlignMiddle, IconAlignTop, IconAlignJustify, IconAlignRight, IconAlignCenter, IconAlignLeft, IconTableCellProperties, IconObjectInlineRight, IconObjectCenter, IconObjectInlineLeft, IconTableProperties, IconCaption } from '@ckeditor/ckeditor5-icons/dist/index.js';
8
9
  import { View, addKeyboardHandlingForGrid, ButtonView, createDropdown, MenuBarMenuView, SwitchButtonView, SplitButtonView, addListToDropdown, ViewModel, ViewCollection, FocusCycler, InputTextView, ColorSelectorView, FormHeaderView, submitHandler, LabelView, LabeledFieldView, createLabeledDropdown, createLabeledInputText, ToolbarView, BalloonPanelView, ContextualBalloon, normalizeColorOptions, getLocalizedColorOptions, clickOutsideHandler } from '@ckeditor/ckeditor5-ui/dist/index.js';
9
10
  import { ClipboardMarkersUtils, ClipboardPipeline } from '@ckeditor/ckeditor5-clipboard/dist/index.js';
10
11
  import { DomEventObserver, isColor, isLength, isPercentage, addBorderRules, addPaddingRules, addBackgroundRules, enablePlaceholder, Element } from '@ckeditor/ckeditor5-engine/dist/index.js';
11
- import { isObject, debounce, isEqual, throttle } from 'lodash-es';
12
+ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
12
13
 
13
14
  /**
14
15
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
@@ -4750,12 +4751,6 @@ function getMaxOffset(tableCell, start, currentMaxOffset, which) {
4750
4751
  }
4751
4752
  }
4752
4753
 
4753
- var tableColumnIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M18 7v1H2V7h16zm0 5v1H2v-1h16z\" opacity=\".6\"/><path d=\"M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z\"/></svg>";
4754
-
4755
- var tableRowIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M7 2h1v16H7V2zm5 0h1v16h-1V2z\" opacity=\".6\"/><path d=\"M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z\"/></svg>";
4756
-
4757
- var tableMergeCellIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z\" opacity=\".6\"/><path d=\"M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z\"/></svg>";
4758
-
4759
4754
  /**
4760
4755
  * The table UI plugin. It introduces:
4761
4756
  *
@@ -4790,7 +4785,7 @@ var tableMergeCellIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2
4790
4785
  dropdownView.bind('isEnabled').to(command);
4791
4786
  // Decorate dropdown's button.
4792
4787
  dropdownView.buttonView.set({
4793
- icon: icons.table,
4788
+ icon: IconTable,
4794
4789
  label: t('Insert table'),
4795
4790
  tooltip: true
4796
4791
  });
@@ -4832,7 +4827,7 @@ var tableMergeCellIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2
4832
4827
  });
4833
4828
  menuView.buttonView.set({
4834
4829
  label: t('Table'),
4835
- icon: icons.table
4830
+ icon: IconTable
4836
4831
  });
4837
4832
  menuView.panelView.children.add(insertTableView);
4838
4833
  menuView.bind('isEnabled').to(command);
@@ -4880,7 +4875,7 @@ var tableMergeCellIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2
4880
4875
  }
4881
4876
  }
4882
4877
  ];
4883
- return this._prepareDropdown(t('Column'), tableColumnIcon, options, locale);
4878
+ return this._prepareDropdown(t('Column'), IconTableColumn, options, locale);
4884
4879
  });
4885
4880
  editor.ui.componentFactory.add('tableRow', (locale)=>{
4886
4881
  const options = [
@@ -4924,7 +4919,7 @@ var tableMergeCellIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2
4924
4919
  }
4925
4920
  }
4926
4921
  ];
4927
- return this._prepareDropdown(t('Row'), tableRowIcon, options, locale);
4922
+ return this._prepareDropdown(t('Row'), IconTableRow, options, locale);
4928
4923
  });
4929
4924
  editor.ui.componentFactory.add('mergeTableCells', (locale)=>{
4930
4925
  const options = [
@@ -4974,7 +4969,7 @@ var tableMergeCellIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2
4974
4969
  }
4975
4970
  }
4976
4971
  ];
4977
- return this._prepareMergeSplitButtonDropdown(t('Merge cells'), tableMergeCellIcon, options, locale);
4972
+ return this._prepareMergeSplitButtonDropdown(t('Merge cells'), IconTableMergeCell, options, locale);
4978
4973
  });
4979
4974
  }
4980
4975
  /**
@@ -7705,13 +7700,13 @@ function colorConfigToColorGridDefinitions(colorConfig) {
7705
7700
  const t = this.t;
7706
7701
  const alignmentLabel = new LabelView(locale);
7707
7702
  const ALIGNMENT_ICONS = {
7708
- left: icons.alignLeft,
7709
- center: icons.alignCenter,
7710
- right: icons.alignRight,
7711
- justify: icons.alignJustify,
7712
- top: icons.alignTop,
7713
- middle: icons.alignMiddle,
7714
- bottom: icons.alignBottom
7703
+ left: IconAlignLeft,
7704
+ center: IconAlignCenter,
7705
+ right: IconAlignRight,
7706
+ justify: IconAlignJustify,
7707
+ top: IconAlignTop,
7708
+ middle: IconAlignMiddle,
7709
+ bottom: IconAlignBottom
7715
7710
  };
7716
7711
  alignmentLabel.text = t('Table cell text alignment');
7717
7712
  // -- Horizontal ---------------------------------------------------
@@ -7780,7 +7775,7 @@ function colorConfigToColorGridDefinitions(colorConfig) {
7780
7775
  ];
7781
7776
  saveButtonView.set({
7782
7777
  label: t('Save'),
7783
- icon: icons.check,
7778
+ icon: IconCheck,
7784
7779
  class: 'ck-button-save',
7785
7780
  type: 'submit',
7786
7781
  withText: true
@@ -7790,7 +7785,7 @@ function colorConfigToColorGridDefinitions(colorConfig) {
7790
7785
  });
7791
7786
  cancelButtonView.set({
7792
7787
  label: t('Cancel'),
7793
- icon: icons.cancel,
7788
+ icon: IconCancel,
7794
7789
  class: 'ck-button-cancel',
7795
7790
  withText: true
7796
7791
  });
@@ -7934,8 +7929,6 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (()=>[
7934
7929
  return Rect.getBoundingRect(rects);
7935
7930
  }
7936
7931
 
7937
- var tableCellProperties = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z\" opacity=\".6\"/><path d=\"m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z\"/></svg>";
7938
-
7939
7932
  /**
7940
7933
  * Returns a string if all four values of box sides are equal.
7941
7934
  *
@@ -8122,7 +8115,7 @@ const propertyToCommandMap$1 = {
8122
8115
  const view = new ButtonView(locale);
8123
8116
  view.set({
8124
8117
  label: t('Cell properties'),
8125
- icon: tableCellProperties,
8118
+ icon: IconTableCellProperties,
8126
8119
  tooltip: true
8127
8120
  });
8128
8121
  this.listenTo(view, 'execute', ()=>this._showView());
@@ -10044,9 +10037,9 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
10044
10037
  fillToolbar({
10045
10038
  view: this,
10046
10039
  icons: {
10047
- left: icons.objectLeft,
10048
- center: icons.objectCenter,
10049
- right: icons.objectRight
10040
+ left: IconObjectInlineLeft,
10041
+ center: IconObjectCenter,
10042
+ right: IconObjectInlineRight
10050
10043
  },
10051
10044
  toolbar: alignmentToolbar,
10052
10045
  labels: this._alignmentLabels,
@@ -10077,7 +10070,7 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
10077
10070
  ];
10078
10071
  saveButtonView.set({
10079
10072
  label: t('Save'),
10080
- icon: icons.check,
10073
+ icon: IconCheck,
10081
10074
  class: 'ck-button-save',
10082
10075
  type: 'submit',
10083
10076
  withText: true
@@ -10087,7 +10080,7 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
10087
10080
  });
10088
10081
  cancelButtonView.set({
10089
10082
  label: t('Cancel'),
10090
- icon: icons.cancel,
10083
+ icon: IconCancel,
10091
10084
  class: 'ck-button-cancel',
10092
10085
  withText: true
10093
10086
  });
@@ -10125,8 +10118,6 @@ function isBorderStyleSet(value) {
10125
10118
  return value !== 'none';
10126
10119
  }
10127
10120
 
10128
- var tableProperties = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z\" opacity=\".6\"/><path d=\"m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z\"/></svg>";
10129
-
10130
10121
  const ERROR_TEXT_TIMEOUT = 500;
10131
10122
  // Map of view properties and related commands.
10132
10123
  const propertyToCommandMap = {
@@ -10200,7 +10191,7 @@ const propertyToCommandMap = {
10200
10191
  const view = new ButtonView(locale);
10201
10192
  view.set({
10202
10193
  label: t('Table properties'),
10203
- icon: tableProperties,
10194
+ icon: IconTableProperties,
10204
10195
  tooltip: true
10205
10196
  });
10206
10197
  this.listenTo(view, 'execute', ()=>this._showView());
@@ -10799,7 +10790,7 @@ const propertyToCommandMap = {
10799
10790
  const command = editor.commands.get('toggleTableCaption');
10800
10791
  const view = new ButtonView(locale);
10801
10792
  view.set({
10802
- icon: icons.caption,
10793
+ icon: IconCaption,
10803
10794
  tooltip: true,
10804
10795
  isToggleable: true
10805
10796
  });