@ckeditor/ckeditor5-table 35.3.2 → 36.0.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/LICENSE.md +1 -1
- package/build/table.js +2 -2
- package/package.json +26 -26
- package/src/commands/insertcolumncommand.js +1 -1
- package/src/commands/insertrowcommand.js +1 -1
- package/src/commands/inserttablecommand.js +1 -1
- package/src/commands/mergecellcommand.js +1 -1
- package/src/commands/mergecellscommand.js +1 -1
- package/src/commands/removecolumncommand.js +1 -1
- package/src/commands/removerowcommand.js +1 -1
- package/src/commands/selectcolumncommand.js +1 -1
- package/src/commands/selectrowcommand.js +1 -1
- package/src/commands/setheadercolumncommand.js +1 -1
- package/src/commands/setheaderrowcommand.js +1 -1
- package/src/commands/splitcellcommand.js +1 -1
- package/src/converters/downcast.js +8 -5
- package/src/converters/table-caption-post-fixer.js +1 -1
- package/src/converters/table-cell-paragraph-post-fixer.js +1 -1
- package/src/converters/table-cell-refresh-handler.js +1 -1
- package/src/converters/table-headings-refresh-handler.js +1 -1
- package/src/converters/table-layout-post-fixer.js +1 -1
- package/src/converters/tableproperties.js +7 -2
- package/src/converters/upcasttable.js +21 -6
- package/src/index.js +1 -1
- package/src/plaintableoutput.js +1 -1
- package/src/table.js +1 -1
- package/src/tablecaption/tablecaptionediting.js +1 -1
- package/src/tablecaption/tablecaptionui.js +1 -1
- package/src/tablecaption/toggletablecaptioncommand.js +1 -1
- package/src/tablecaption/utils.js +1 -1
- package/src/tablecaption.js +1 -1
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellborderstylecommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellheightcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellpaddingcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +1 -1
- package/src/tablecellproperties/tablecellpropertiesediting.js +1 -1
- package/src/tablecellproperties/tablecellpropertiesui.js +53 -32
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +1 -1
- package/src/tablecellproperties.js +1 -1
- package/src/tablecellwidth/commands/tablecellwidthcommand.js +1 -1
- package/src/tablecellwidth/tablecellwidthediting.js +1 -1
- package/src/tableclipboard.js +1 -1
- package/src/tablecolumnresize/constants.js +1 -1
- package/src/tablecolumnresize/converters.js +5 -3
- package/src/tablecolumnresize/tablecolumnresizeediting.js +13 -15
- package/src/tablecolumnresize/tablecolumnwidthscommand.js +1 -1
- package/src/tablecolumnresize/tablewidthresizecommand.js +9 -4
- package/src/tablecolumnresize/utils.js +1 -25
- package/src/tablecolumnresize.js +1 -1
- package/src/tableediting.js +1 -40
- package/src/tablekeyboard.js +1 -1
- package/src/tablemouse/mouseeventsobserver.js +1 -1
- package/src/tablemouse.js +1 -1
- package/src/tableproperties/commands/tablealignmentcommand.js +1 -1
- package/src/tableproperties/commands/tablebackgroundcolorcommand.js +1 -1
- package/src/tableproperties/commands/tablebordercolorcommand.js +1 -1
- package/src/tableproperties/commands/tableborderstylecommand.js +1 -1
- package/src/tableproperties/commands/tableborderwidthcommand.js +1 -1
- package/src/tableproperties/commands/tableheightcommand.js +1 -1
- package/src/tableproperties/commands/tablepropertycommand.js +1 -1
- package/src/tableproperties/commands/tablewidthcommand.js +1 -1
- package/src/tableproperties/tablepropertiesediting.js +8 -2
- package/src/tableproperties/tablepropertiesui.js +32 -17
- package/src/tableproperties/ui/tablepropertiesview.js +1 -1
- package/src/tableproperties.js +1 -1
- package/src/tableselection.js +1 -1
- package/src/tabletoolbar.js +1 -1
- package/src/tableui.js +2 -2
- package/src/tableutils.js +1 -1
- package/src/tablewalker.js +2 -2
- package/src/ui/colorinputview.js +1 -1
- package/src/ui/formrowview.js +1 -1
- package/src/ui/inserttableview.js +3 -2
- package/src/utils/common.js +1 -1
- package/src/utils/structure.js +1 -1
- package/src/utils/table-properties.js +1 -1
- package/src/utils/ui/contextualballoon.js +1 -1
- package/src/utils/ui/table-properties.js +1 -1
- package/src/utils/ui/widget.js +1 -1
- package/theme/colorinput.css +1 -1
- package/theme/form.css +1 -1
- package/theme/formrow.css +1 -1
- package/theme/inserttable.css +1 -1
- package/theme/table.css +1 -1
- package/theme/tablecaption.css +1 -1
- package/theme/tablecellproperties.css +1 -1
- package/theme/tablecolumnresize.css +1 -1
- package/theme/tableediting.css +1 -1
- package/theme/tableform.css +1 -1
- package/theme/tableproperties.css +1 -1
- package/theme/tableselection.css +1 -1
- package/build/table.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -105,7 +105,7 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
105
105
|
*
|
|
106
106
|
* @member {module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}
|
|
107
107
|
*/
|
|
108
|
-
this.view =
|
|
108
|
+
this.view = null;
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
111
|
* The batch used to undo all changes made by the form (which are live, as the user types)
|
|
@@ -116,6 +116,15 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
116
116
|
*/
|
|
117
117
|
this._undoStepBatch = null;
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Flag used to indicate whether view is ready to execute update commands
|
|
121
|
+
* (it finished loading initial data).
|
|
122
|
+
*
|
|
123
|
+
* @private
|
|
124
|
+
* @member {Boolean}
|
|
125
|
+
*/
|
|
126
|
+
this._isReady = false;
|
|
127
|
+
|
|
119
128
|
editor.ui.componentFactory.add( 'tableProperties', locale => {
|
|
120
129
|
const view = new ButtonView( locale );
|
|
121
130
|
|
|
@@ -146,7 +155,9 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
146
155
|
|
|
147
156
|
// Destroy created UI components as they are not automatically destroyed.
|
|
148
157
|
// See https://github.com/ckeditor/ckeditor5/issues/1341.
|
|
149
|
-
this.view
|
|
158
|
+
if ( this.view ) {
|
|
159
|
+
this.view.destroy();
|
|
160
|
+
}
|
|
150
161
|
}
|
|
151
162
|
|
|
152
163
|
/**
|
|
@@ -290,6 +301,8 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
290
301
|
|
|
291
302
|
this.view.set( property, value );
|
|
292
303
|
} );
|
|
304
|
+
|
|
305
|
+
this._isReady = true;
|
|
293
306
|
}
|
|
294
307
|
|
|
295
308
|
/**
|
|
@@ -304,6 +317,10 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
304
317
|
_showView() {
|
|
305
318
|
const editor = this.editor;
|
|
306
319
|
|
|
320
|
+
if ( !this.view ) {
|
|
321
|
+
this.view = this._createPropertiesView();
|
|
322
|
+
}
|
|
323
|
+
|
|
307
324
|
this.listenTo( editor.ui, 'update', () => {
|
|
308
325
|
this._updateView();
|
|
309
326
|
} );
|
|
@@ -333,6 +350,8 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
333
350
|
|
|
334
351
|
this.stopListening( editor.ui, 'update' );
|
|
335
352
|
|
|
353
|
+
this._isReady = false;
|
|
354
|
+
|
|
336
355
|
// Blur any input element before removing it from DOM to prevent issues in some browsers.
|
|
337
356
|
// See https://github.com/ckeditor/ckeditor5/issues/1501.
|
|
338
357
|
this.view.saveButtonView.focus();
|
|
@@ -367,7 +386,7 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
367
386
|
* @type {Boolean}
|
|
368
387
|
*/
|
|
369
388
|
get _isViewVisible() {
|
|
370
|
-
return this._balloon.visibleView === this.view;
|
|
389
|
+
return !!this.view && this._balloon.visibleView === this.view;
|
|
371
390
|
}
|
|
372
391
|
|
|
373
392
|
/**
|
|
@@ -377,7 +396,7 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
377
396
|
* @type {Boolean}
|
|
378
397
|
*/
|
|
379
398
|
get _isViewInBalloon() {
|
|
380
|
-
return this._balloon.hasView( this.view );
|
|
399
|
+
return !!this.view && this._balloon.hasView( this.view );
|
|
381
400
|
}
|
|
382
401
|
|
|
383
402
|
/**
|
|
@@ -388,14 +407,12 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
388
407
|
*
|
|
389
408
|
* @private
|
|
390
409
|
* @param {String} commandName The command that will be executed.
|
|
391
|
-
* @param {String} defaultValue The default value of the command.
|
|
392
410
|
* @returns {Function}
|
|
393
411
|
*/
|
|
394
|
-
_getPropertyChangeCallback( commandName
|
|
395
|
-
return ( evt, propertyName, newValue
|
|
396
|
-
//
|
|
397
|
-
|
|
398
|
-
if ( !oldValue && defaultValue === newValue ) {
|
|
412
|
+
_getPropertyChangeCallback( commandName ) {
|
|
413
|
+
return ( evt, propertyName, newValue ) => {
|
|
414
|
+
// Do not execute the command on initial call (opening the table properties view).
|
|
415
|
+
if ( !this._isReady ) {
|
|
399
416
|
return;
|
|
400
417
|
}
|
|
401
418
|
|
|
@@ -417,21 +434,19 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
417
434
|
* @param {module:ui/view~View} options.viewField
|
|
418
435
|
* @param {Function} options.validator
|
|
419
436
|
* @param {String} options.errorText
|
|
420
|
-
* @param {String} options.defaultValue
|
|
421
437
|
* @returns {Function}
|
|
422
438
|
*/
|
|
423
439
|
_getValidatedPropertyChangeCallback( options ) {
|
|
424
|
-
const { commandName, viewField, validator, errorText
|
|
440
|
+
const { commandName, viewField, validator, errorText } = options;
|
|
425
441
|
const setErrorTextDebounced = debounce( () => {
|
|
426
442
|
viewField.errorText = errorText;
|
|
427
443
|
}, ERROR_TEXT_TIMEOUT );
|
|
428
444
|
|
|
429
|
-
return ( evt, propertyName, newValue
|
|
445
|
+
return ( evt, propertyName, newValue ) => {
|
|
430
446
|
setErrorTextDebounced.cancel();
|
|
431
447
|
|
|
432
|
-
//
|
|
433
|
-
|
|
434
|
-
if ( !oldValue && defaultValue === newValue ) {
|
|
448
|
+
// Do not execute the command on initial call (opening the table properties view).
|
|
449
|
+
if ( !this._isReady ) {
|
|
435
450
|
return;
|
|
436
451
|
}
|
|
437
452
|
|
package/src/tableproperties.js
CHANGED
package/src/tableselection.js
CHANGED
package/src/tabletoolbar.js
CHANGED
package/src/tableui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -327,7 +327,7 @@ export default class TableUI extends Plugin {
|
|
|
327
327
|
addListOption( option, editor, commands, itemDefinitions );
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
addListToDropdown( dropdownView, itemDefinitions
|
|
330
|
+
addListToDropdown( dropdownView, itemDefinitions );
|
|
331
331
|
|
|
332
332
|
return commands;
|
|
333
333
|
}
|
package/src/tableutils.js
CHANGED
package/src/tablewalker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module table/tablewalker
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
// @if CK_DEBUG //
|
|
10
|
+
// @if CK_DEBUG // const { CKEditorError } = require( 'ckeditor5/src/utils' );
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The table iterator class. It allows to iterate over table cells. For each cell the iterator yields
|
package/src/ui/colorinputview.js
CHANGED
package/src/ui/formrowview.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -158,7 +158,8 @@ export default class InsertTableView extends View {
|
|
|
158
158
|
keystrokeHandler: this.keystrokes,
|
|
159
159
|
focusTracker: this.focusTracker,
|
|
160
160
|
gridItems: this.items,
|
|
161
|
-
numberOfColumns: 10
|
|
161
|
+
numberOfColumns: 10,
|
|
162
|
+
uiLanguageDirection: this.locale && this.locale.uiLanguageDirection
|
|
162
163
|
} );
|
|
163
164
|
|
|
164
165
|
for ( const item of this.items ) {
|
package/src/utils/common.js
CHANGED
package/src/utils/structure.js
CHANGED
package/src/utils/ui/widget.js
CHANGED
package/theme/colorinput.css
CHANGED
package/theme/form.css
CHANGED
package/theme/formrow.css
CHANGED
package/theme/inserttable.css
CHANGED
package/theme/table.css
CHANGED
package/theme/tablecaption.css
CHANGED
package/theme/tableediting.css
CHANGED
package/theme/tableform.css
CHANGED
package/theme/tableselection.css
CHANGED