@ckeditor/ckeditor5-table 0.0.0-nightly-next-20251209.0 → 0.0.0-nightly-20251210.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/build/table.js +2 -2
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/ast.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/be.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/en-gb.js +1 -1
- package/build/translations/eo.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/eu.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/gu.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/hy.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/kk.js +1 -1
- package/build/translations/km.js +1 -1
- package/build/translations/kn.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/ku.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nb.js +1 -1
- package/build/translations/ne.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/oc.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/si.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sl.js +1 -1
- package/build/translations/sq.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/ti.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/uz.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/ckeditor5-metadata.json +1 -10
- package/dist/index-content.css +30 -30
- package/dist/index-editor.css +194 -120
- package/dist/index.css +265 -167
- package/dist/index.css.map +1 -1
- package/dist/index.js +2219 -148
- package/dist/index.js.map +1 -1
- package/lang/contexts.json +4 -0
- package/package.json +9 -9
- package/src/augmentation.d.ts +7 -0
- package/src/converters/downcast.js +12 -3
- package/src/index.d.ts +4 -0
- package/src/index.js +5 -0
- package/src/tablecellproperties/tablecellpropertiesuiexperimental.d.ts +128 -0
- package/src/tablecellproperties/tablecellpropertiesuiexperimental.js +386 -0
- package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +0 -8
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +10 -30
- package/src/tablecellproperties/ui/tablecellpropertiesviewexperimental.d.ts +237 -0
- package/src/tablecellproperties/ui/tablecellpropertiesviewexperimental.js +633 -0
- package/src/tableconfig.d.ts +4 -4
- package/src/tableproperties/tablepropertiesediting.js +147 -14
- package/src/tableproperties/tablepropertiesuiexperimental.d.ts +136 -0
- package/src/tableproperties/tablepropertiesuiexperimental.js +375 -0
- package/src/tableproperties/ui/tablepropertiesview.d.ts +0 -8
- package/src/tableproperties/ui/tablepropertiesview.js +37 -59
- package/src/tableproperties/ui/tablepropertiesviewexperimental.d.ts +216 -0
- package/src/tableproperties/ui/tablepropertiesviewexperimental.js +544 -0
- package/src/utils/ui/table-propertiesexperimental.d.ts +215 -0
- package/src/utils/ui/table-propertiesexperimental.js +391 -0
- package/theme/formrow-experimental.css +15 -0
- package/theme/formrow.css +0 -2
- package/theme/tableform-experimental.css +73 -0
- package/theme/tableform.css +5 -1
- package/theme/tableproperties-experimental.css +78 -0
- package/theme/tableproperties.css +0 -60
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormRowView, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui.js';
|
|
9
9
|
import { KeystrokeHandler, FocusTracker } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import { IconAlignBottom, IconAlignCenter, IconAlignJustify, IconAlignLeft, IconAlignMiddle, IconAlignRight, IconAlignTop,
|
|
10
|
+
import { IconAlignBottom, IconAlignCenter, IconAlignJustify, IconAlignLeft, IconAlignMiddle, IconAlignRight, IconAlignTop, IconCancel, IconCheck } from 'ckeditor5/src/icons.js';
|
|
11
11
|
import { fillToolbar, getBorderStyleDefinitions, getBorderStyleLabels, getLabeledColorInputCreator } from '../../utils/ui/table-properties.js';
|
|
12
12
|
// eslint-disable-next-line ckeditor5-rules/ckeditor-imports
|
|
13
13
|
import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
|
|
@@ -79,10 +79,6 @@ export class TableCellPropertiesView extends View {
|
|
|
79
79
|
* The "Cancel" button view.
|
|
80
80
|
*/
|
|
81
81
|
cancelButtonView;
|
|
82
|
-
/**
|
|
83
|
-
* The "Back" button view.
|
|
84
|
-
*/
|
|
85
|
-
backButtonView;
|
|
86
82
|
/**
|
|
87
83
|
* A collection of views that can be focused in the form.
|
|
88
84
|
*/
|
|
@@ -136,7 +132,6 @@ export class TableCellPropertiesView extends View {
|
|
|
136
132
|
const { saveButtonView, cancelButtonView } = this._createActionButtons();
|
|
137
133
|
this.saveButtonView = saveButtonView;
|
|
138
134
|
this.cancelButtonView = cancelButtonView;
|
|
139
|
-
this.backButtonView = this._createBackButton();
|
|
140
135
|
this._focusables = new ViewCollection();
|
|
141
136
|
this._focusCycler = new FocusCycler({
|
|
142
137
|
focusables: this._focusables,
|
|
@@ -150,11 +145,9 @@ export class TableCellPropertiesView extends View {
|
|
|
150
145
|
}
|
|
151
146
|
});
|
|
152
147
|
// Form header.
|
|
153
|
-
|
|
148
|
+
this.children.add(new FormHeaderView(locale, {
|
|
154
149
|
label: this.t('Cell properties')
|
|
155
|
-
});
|
|
156
|
-
header.children.add(this.backButtonView, 0);
|
|
157
|
-
this.children.add(header);
|
|
150
|
+
}));
|
|
158
151
|
// Border row.
|
|
159
152
|
this.children.add(new FormRowView(locale, {
|
|
160
153
|
labelView: borderRowLabel,
|
|
@@ -211,8 +204,8 @@ export class TableCellPropertiesView extends View {
|
|
|
211
204
|
// Action row.
|
|
212
205
|
this.children.add(new FormRowView(locale, {
|
|
213
206
|
children: [
|
|
214
|
-
this.
|
|
215
|
-
this.
|
|
207
|
+
this.saveButtonView,
|
|
208
|
+
this.cancelButtonView
|
|
216
209
|
],
|
|
217
210
|
class: 'ck-table-form__action-row'
|
|
218
211
|
}));
|
|
@@ -255,9 +248,8 @@ export class TableCellPropertiesView extends View {
|
|
|
255
248
|
this.paddingInput,
|
|
256
249
|
this.horizontalAlignmentToolbar,
|
|
257
250
|
this.verticalAlignmentToolbar,
|
|
258
|
-
this.cancelButtonView,
|
|
259
251
|
this.saveButtonView,
|
|
260
|
-
this.
|
|
252
|
+
this.cancelButtonView
|
|
261
253
|
].forEach(view => {
|
|
262
254
|
// Register the view as focusable.
|
|
263
255
|
this._focusables.add(view);
|
|
@@ -566,7 +558,8 @@ export class TableCellPropertiesView extends View {
|
|
|
566
558
|
];
|
|
567
559
|
saveButtonView.set({
|
|
568
560
|
label: t('Save'),
|
|
569
|
-
|
|
561
|
+
icon: IconCheck,
|
|
562
|
+
class: 'ck-button-save',
|
|
570
563
|
type: 'submit',
|
|
571
564
|
withText: true
|
|
572
565
|
});
|
|
@@ -575,6 +568,8 @@ export class TableCellPropertiesView extends View {
|
|
|
575
568
|
});
|
|
576
569
|
cancelButtonView.set({
|
|
577
570
|
label: t('Cancel'),
|
|
571
|
+
icon: IconCancel,
|
|
572
|
+
class: 'ck-button-cancel',
|
|
578
573
|
withText: true
|
|
579
574
|
});
|
|
580
575
|
cancelButtonView.delegate('execute').to(this, 'cancel');
|
|
@@ -582,21 +577,6 @@ export class TableCellPropertiesView extends View {
|
|
|
582
577
|
saveButtonView, cancelButtonView
|
|
583
578
|
};
|
|
584
579
|
}
|
|
585
|
-
/**
|
|
586
|
-
* Creates a back button view that cancels the form.
|
|
587
|
-
*/
|
|
588
|
-
_createBackButton() {
|
|
589
|
-
const t = this.locale.t;
|
|
590
|
-
const backButton = new ButtonView(this.locale);
|
|
591
|
-
backButton.set({
|
|
592
|
-
class: 'ck-button-back',
|
|
593
|
-
label: t('Back'),
|
|
594
|
-
icon: IconPreviousArrow,
|
|
595
|
-
tooltip: true
|
|
596
|
-
});
|
|
597
|
-
backButton.delegate('execute').to(this, 'cancel');
|
|
598
|
-
return backButton;
|
|
599
|
-
}
|
|
600
580
|
/**
|
|
601
581
|
* Provides localized labels for {@link #horizontalAlignmentToolbar} buttons.
|
|
602
582
|
*/
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/tablecellproperties/ui/tablecellpropertiesviewexperimental
|
|
7
|
+
*/
|
|
8
|
+
import { ButtonView, FocusCycler, LabeledFieldView, ToolbarView, View, ViewCollection, type FocusableView, type NormalizedColorOption, type ColorPickerConfig } from 'ckeditor5/src/ui.js';
|
|
9
|
+
import { KeystrokeHandler, FocusTracker, type Locale } from 'ckeditor5/src/utils.js';
|
|
10
|
+
import { type ColorInputView } from '../../ui/colorinputview.js';
|
|
11
|
+
import type { TableCellPropertiesOptions } from '../../tableconfig.js';
|
|
12
|
+
import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
|
|
13
|
+
import '../../../theme/formrow.css';
|
|
14
|
+
import '../../../theme/tableform.css';
|
|
15
|
+
import '../../../theme/tablecellproperties.css';
|
|
16
|
+
export interface TableCellPropertiesViewOptionsExperimental {
|
|
17
|
+
borderColors: Array<NormalizedColorOption>;
|
|
18
|
+
backgroundColors: Array<NormalizedColorOption>;
|
|
19
|
+
defaultTableCellProperties: TableCellPropertiesOptions;
|
|
20
|
+
colorPickerConfig: false | ColorPickerConfig;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The class representing a table cell properties form, allowing users to customize
|
|
24
|
+
* certain style aspects of a table cell, for instance, border, padding, text alignment, etc..
|
|
25
|
+
*/
|
|
26
|
+
export declare class TableCellPropertiesViewExperimental extends View {
|
|
27
|
+
/**
|
|
28
|
+
* The value of the cell border style.
|
|
29
|
+
*
|
|
30
|
+
* @observable
|
|
31
|
+
* @default ''
|
|
32
|
+
*/
|
|
33
|
+
borderStyle: string;
|
|
34
|
+
/**
|
|
35
|
+
* The value of the cell border width style.
|
|
36
|
+
*
|
|
37
|
+
* @observable
|
|
38
|
+
* @default ''
|
|
39
|
+
*/
|
|
40
|
+
borderWidth: string;
|
|
41
|
+
/**
|
|
42
|
+
* The value of the cell border color style.
|
|
43
|
+
*
|
|
44
|
+
* @observable
|
|
45
|
+
* @default ''
|
|
46
|
+
*/
|
|
47
|
+
borderColor: string;
|
|
48
|
+
/**
|
|
49
|
+
* The value of the cell padding style.
|
|
50
|
+
*
|
|
51
|
+
* @observable
|
|
52
|
+
* @default ''
|
|
53
|
+
*/
|
|
54
|
+
padding: string;
|
|
55
|
+
/**
|
|
56
|
+
* The value of the cell background color style.
|
|
57
|
+
*
|
|
58
|
+
* @observable
|
|
59
|
+
* @default ''
|
|
60
|
+
*/
|
|
61
|
+
backgroundColor: string;
|
|
62
|
+
/**
|
|
63
|
+
* The value of the table cell width style.
|
|
64
|
+
*
|
|
65
|
+
* @observable
|
|
66
|
+
* @default ''
|
|
67
|
+
*/
|
|
68
|
+
width: string;
|
|
69
|
+
/**
|
|
70
|
+
* The value of the table cell height style.
|
|
71
|
+
*
|
|
72
|
+
* @observable
|
|
73
|
+
* @default ''
|
|
74
|
+
*/
|
|
75
|
+
height: string;
|
|
76
|
+
/**
|
|
77
|
+
* The value of the horizontal text alignment style.
|
|
78
|
+
*
|
|
79
|
+
* @observable
|
|
80
|
+
* @default ''
|
|
81
|
+
*/
|
|
82
|
+
horizontalAlignment: string;
|
|
83
|
+
/**
|
|
84
|
+
* The value of the vertical text alignment style.
|
|
85
|
+
*
|
|
86
|
+
* @observable
|
|
87
|
+
* @default ''
|
|
88
|
+
*/
|
|
89
|
+
verticalAlignment: string;
|
|
90
|
+
/**
|
|
91
|
+
* Options passed to the view. See {@link #constructor} to learn more.
|
|
92
|
+
*/
|
|
93
|
+
readonly options: TableCellPropertiesViewOptionsExperimental;
|
|
94
|
+
/**
|
|
95
|
+
* Tracks information about the DOM focus in the form.
|
|
96
|
+
*/
|
|
97
|
+
readonly focusTracker: FocusTracker;
|
|
98
|
+
/**
|
|
99
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
100
|
+
*/
|
|
101
|
+
readonly keystrokes: KeystrokeHandler;
|
|
102
|
+
/**
|
|
103
|
+
* A collection of child views in the form.
|
|
104
|
+
*/
|
|
105
|
+
readonly children: ViewCollection;
|
|
106
|
+
/**
|
|
107
|
+
* A dropdown that allows selecting the style of the table cell border.
|
|
108
|
+
*/
|
|
109
|
+
readonly borderStyleDropdown: LabeledFieldView<FocusableView>;
|
|
110
|
+
/**
|
|
111
|
+
* An input that allows specifying the width of the table cell border.
|
|
112
|
+
*/
|
|
113
|
+
readonly borderWidthInput: LabeledFieldView<FocusableView>;
|
|
114
|
+
/**
|
|
115
|
+
* An input that allows specifying the color of the table cell border.
|
|
116
|
+
*/
|
|
117
|
+
readonly borderColorInput: LabeledFieldView<ColorInputView>;
|
|
118
|
+
/**
|
|
119
|
+
* An input that allows specifying the table cell background color.
|
|
120
|
+
*/
|
|
121
|
+
readonly backgroundInput: LabeledFieldView<ColorInputView>;
|
|
122
|
+
/**
|
|
123
|
+
* An input that allows specifying the table cell padding.
|
|
124
|
+
*/
|
|
125
|
+
readonly paddingInput: LabeledFieldView;
|
|
126
|
+
/**
|
|
127
|
+
* An input that allows specifying the table cell width.
|
|
128
|
+
*/
|
|
129
|
+
readonly widthInput: LabeledFieldView<FocusableView>;
|
|
130
|
+
/**
|
|
131
|
+
* An input that allows specifying the table cell height.
|
|
132
|
+
*/
|
|
133
|
+
readonly heightInput: LabeledFieldView<FocusableView>;
|
|
134
|
+
/**
|
|
135
|
+
* A toolbar with buttons that allow changing the horizontal text alignment in a table cell.
|
|
136
|
+
*/
|
|
137
|
+
readonly horizontalAlignmentToolbar: ToolbarView;
|
|
138
|
+
/**
|
|
139
|
+
* A toolbar with buttons that allow changing the vertical text alignment in a table cell.
|
|
140
|
+
*/
|
|
141
|
+
readonly verticalAlignmentToolbar: ToolbarView;
|
|
142
|
+
/**
|
|
143
|
+
* The "Save" button view.
|
|
144
|
+
*/
|
|
145
|
+
saveButtonView: ButtonView;
|
|
146
|
+
/**
|
|
147
|
+
* The "Cancel" button view.
|
|
148
|
+
*/
|
|
149
|
+
cancelButtonView: ButtonView;
|
|
150
|
+
/**
|
|
151
|
+
* The "Back" button view.
|
|
152
|
+
*/
|
|
153
|
+
backButtonView: ButtonView;
|
|
154
|
+
/**
|
|
155
|
+
* A collection of views that can be focused in the form.
|
|
156
|
+
*/
|
|
157
|
+
protected readonly _focusables: ViewCollection<FocusableView>;
|
|
158
|
+
/**
|
|
159
|
+
* Helps cycling over {@link #_focusables} in the form.
|
|
160
|
+
*/
|
|
161
|
+
protected readonly _focusCycler: FocusCycler;
|
|
162
|
+
/**
|
|
163
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
164
|
+
* @param options Additional configuration of the view.
|
|
165
|
+
* @param options.borderColors A configuration of the border color palette used by the
|
|
166
|
+
* {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView#borderColorInput}.
|
|
167
|
+
* @param options.backgroundColors A configuration of the background color palette used by the
|
|
168
|
+
* {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView#backgroundInput}.
|
|
169
|
+
* @param options.defaultTableCellProperties The default table cell properties.
|
|
170
|
+
*/
|
|
171
|
+
constructor(locale: Locale, options: TableCellPropertiesViewOptionsExperimental);
|
|
172
|
+
/**
|
|
173
|
+
* @inheritDoc
|
|
174
|
+
*/
|
|
175
|
+
render(): void;
|
|
176
|
+
/**
|
|
177
|
+
* @inheritDoc
|
|
178
|
+
*/
|
|
179
|
+
destroy(): void;
|
|
180
|
+
/**
|
|
181
|
+
* Focuses the fist focusable field in the form.
|
|
182
|
+
*/
|
|
183
|
+
focus(): void;
|
|
184
|
+
/**
|
|
185
|
+
* Creates the following form fields:
|
|
186
|
+
*
|
|
187
|
+
* * {@link #borderStyleDropdown},
|
|
188
|
+
* * {@link #borderWidthInput},
|
|
189
|
+
* * {@link #borderColorInput}.
|
|
190
|
+
*/
|
|
191
|
+
private _createBorderFields;
|
|
192
|
+
/**
|
|
193
|
+
* Creates the following form fields:
|
|
194
|
+
*
|
|
195
|
+
* * {@link #backgroundInput}.
|
|
196
|
+
*/
|
|
197
|
+
private _createBackgroundFields;
|
|
198
|
+
/**
|
|
199
|
+
* Creates the following form fields:
|
|
200
|
+
*
|
|
201
|
+
* * {@link #widthInput}.
|
|
202
|
+
* * {@link #heightInput}.
|
|
203
|
+
*/
|
|
204
|
+
private _createDimensionFields;
|
|
205
|
+
/**
|
|
206
|
+
* Creates the following form fields:
|
|
207
|
+
*
|
|
208
|
+
* * {@link #paddingInput}.
|
|
209
|
+
*/
|
|
210
|
+
private _createPaddingField;
|
|
211
|
+
/**
|
|
212
|
+
* Creates the following form fields:
|
|
213
|
+
*
|
|
214
|
+
* * {@link #horizontalAlignmentToolbar},
|
|
215
|
+
* * {@link #verticalAlignmentToolbar}.
|
|
216
|
+
*/
|
|
217
|
+
private _createAlignmentFields;
|
|
218
|
+
/**
|
|
219
|
+
* Creates the following form controls:
|
|
220
|
+
*
|
|
221
|
+
* * {@link #saveButtonView},
|
|
222
|
+
* * {@link #cancelButtonView}.
|
|
223
|
+
*/
|
|
224
|
+
private _createActionButtons;
|
|
225
|
+
/**
|
|
226
|
+
* Creates a back button view that cancels the form.
|
|
227
|
+
*/
|
|
228
|
+
private _createBackButton;
|
|
229
|
+
/**
|
|
230
|
+
* Provides localized labels for {@link #horizontalAlignmentToolbar} buttons.
|
|
231
|
+
*/
|
|
232
|
+
private get _horizontalAlignmentLabels();
|
|
233
|
+
/**
|
|
234
|
+
* Provides localized labels for {@link #verticalAlignmentToolbar} buttons.
|
|
235
|
+
*/
|
|
236
|
+
private get _verticalAlignmentLabels();
|
|
237
|
+
}
|