@ckeditor/ckeditor5-font 38.2.0-alpha.0 → 38.2.0-alpha.1
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/font.js +2 -2
- package/build/translations/ar.js +1 -1
- package/build/translations/az.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/es.js +1 -1
- package/build/translations/et.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/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/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/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/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/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/tk.js +1 -1
- package/build/translations/tr.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/lang/contexts.json +1 -2
- package/package.json +2 -3
- package/src/augmentation.d.ts +1 -1
- package/src/font.d.ts +5 -5
- package/src/font.js +5 -5
- package/src/fontbackgroundcolor/fontbackgroundcolorcommand.d.ts +2 -2
- package/src/fontbackgroundcolor/fontbackgroundcolorcommand.js +2 -2
- package/src/fontbackgroundcolor/fontbackgroundcolorediting.d.ts +1 -1
- package/src/fontbackgroundcolor/fontbackgroundcolorediting.js +4 -4
- package/src/fontbackgroundcolor/fontbackgroundcolorui.d.ts +2 -2
- package/src/fontbackgroundcolor/fontbackgroundcolorui.js +2 -2
- package/src/fontbackgroundcolor.d.ts +3 -3
- package/src/fontbackgroundcolor.js +3 -3
- package/src/fontcolor/fontcolorcommand.d.ts +2 -2
- package/src/fontcolor/fontcolorcommand.js +2 -2
- package/src/fontcolor/fontcolorediting.d.ts +1 -1
- package/src/fontcolor/fontcolorediting.js +3 -3
- package/src/fontcolor/fontcolorui.d.ts +2 -2
- package/src/fontcolor/fontcolorui.js +2 -2
- package/src/fontcolor.d.ts +3 -3
- package/src/fontcolor.js +3 -3
- package/src/fontcommand.d.ts +2 -2
- package/src/fontcommand.js +1 -1
- package/src/fontconfig.d.ts +2 -2
- package/src/fontfamily/fontfamilycommand.d.ts +2 -2
- package/src/fontfamily/fontfamilycommand.js +2 -2
- package/src/fontfamily/fontfamilyediting.d.ts +1 -1
- package/src/fontfamily/fontfamilyediting.js +4 -4
- package/src/fontfamily/fontfamilyui.d.ts +1 -1
- package/src/fontfamily/fontfamilyui.js +5 -5
- package/src/fontfamily/utils.d.ts +1 -1
- package/src/fontfamily.d.ts +3 -3
- package/src/fontfamily.js +3 -3
- package/src/fontsize/fontsizecommand.d.ts +2 -2
- package/src/fontsize/fontsizecommand.js +2 -2
- package/src/fontsize/fontsizeediting.d.ts +1 -1
- package/src/fontsize/fontsizeediting.js +6 -6
- package/src/fontsize/fontsizeui.d.ts +1 -1
- package/src/fontsize/fontsizeui.js +5 -5
- package/src/fontsize/utils.d.ts +1 -1
- package/src/fontsize/utils.js +1 -1
- package/src/fontsize.d.ts +4 -4
- package/src/fontsize.js +4 -4
- package/src/index.d.ts +20 -20
- package/src/index.js +14 -14
- package/src/ui/colorui.d.ts +8 -7
- package/src/ui/colorui.js +21 -19
- package/src/utils.d.ts +16 -15
- package/src/utils.js +13 -14
- package/src/documentcolorcollection.d.ts +0 -70
- package/src/documentcolorcollection.js +0 -42
- package/src/ui/colortableview.d.ts +0 -459
- package/src/ui/colortableview.js +0 -645
- package/theme/fontcolor.css +0 -75
|
@@ -1,459 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import { ButtonView, ColorGridView, FocusCycler, View, ViewCollection, ColorPickerView, type ColorDefinition, type ColorPickerConfig } from 'ckeditor5/src/ui';
|
|
6
|
-
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
7
|
-
import type { Model } from 'ckeditor5/src/engine';
|
|
8
|
-
import DocumentColorCollection from '../documentcolorcollection';
|
|
9
|
-
import '../../theme/fontcolor.css';
|
|
10
|
-
/**
|
|
11
|
-
* A class which represents a view with the following sub–components:
|
|
12
|
-
*
|
|
13
|
-
* * A {@link module:font/ui/colortableview~ColorTableView#colorGridsPageView color grids component},
|
|
14
|
-
* * A {@link module:font/ui/colortableview~ColorTableView#colorPickerPageView color picker component}.
|
|
15
|
-
*/
|
|
16
|
-
export default class ColorTableView extends View {
|
|
17
|
-
/**
|
|
18
|
-
* Tracks information about the DOM focus in the list.
|
|
19
|
-
*/
|
|
20
|
-
readonly focusTracker: FocusTracker;
|
|
21
|
-
/**
|
|
22
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
23
|
-
*/
|
|
24
|
-
readonly keystrokes: KeystrokeHandler;
|
|
25
|
-
/**
|
|
26
|
-
* A collection of components.
|
|
27
|
-
*/
|
|
28
|
-
readonly items: ViewCollection;
|
|
29
|
-
/**
|
|
30
|
-
* The "Color grids" component.
|
|
31
|
-
*/
|
|
32
|
-
colorGridsPageView: ColorGridsPageView;
|
|
33
|
-
/**
|
|
34
|
-
* The "Color picker" component.
|
|
35
|
-
*/
|
|
36
|
-
colorPickerPageView: ColorPickerPageView;
|
|
37
|
-
/**
|
|
38
|
-
* Keeps the value of the command associated with the component for the current selection.
|
|
39
|
-
*/
|
|
40
|
-
selectedColor?: string;
|
|
41
|
-
/**
|
|
42
|
-
* State of the "Color grids" component visibility.
|
|
43
|
-
*
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
46
|
-
_isColorGridsPageVisible: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* State of the "Color picker" component visibility.
|
|
49
|
-
*
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
_isColorPickerPageVisible: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Helps cycling over focusable {@link #items} in the list.
|
|
55
|
-
*
|
|
56
|
-
* @readonly
|
|
57
|
-
*/
|
|
58
|
-
protected _focusCycler: FocusCycler;
|
|
59
|
-
/**
|
|
60
|
-
* A collection of views that can be focused in the view.
|
|
61
|
-
*
|
|
62
|
-
* @readonly
|
|
63
|
-
*/
|
|
64
|
-
protected _focusables: ViewCollection;
|
|
65
|
-
/**
|
|
66
|
-
* The configuration of color picker feature.
|
|
67
|
-
*/
|
|
68
|
-
private _colorPickerConfig;
|
|
69
|
-
/**
|
|
70
|
-
* Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
|
|
71
|
-
*
|
|
72
|
-
* @param locale The localization services instance.
|
|
73
|
-
* @param colors An array with definitions of colors to be displayed in the table.
|
|
74
|
-
* @param columns The number of columns in the color grid.
|
|
75
|
-
* @param removeButtonLabel The label of the button responsible for removing the color.
|
|
76
|
-
* @param colorPickerLabel The label of the button responsible for color picker appearing.
|
|
77
|
-
* @param documentColorsLabel The label for the section with the document colors.
|
|
78
|
-
* @param documentColorsCount The number of colors in the document colors section inside the color dropdown.
|
|
79
|
-
* @param colorPickerConfig The configuration of color picker feature.
|
|
80
|
-
*/
|
|
81
|
-
constructor(locale: Locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, colorPickerConfig }: {
|
|
82
|
-
colors: Array<ColorDefinition>;
|
|
83
|
-
columns: number;
|
|
84
|
-
removeButtonLabel: string;
|
|
85
|
-
colorPickerLabel: string;
|
|
86
|
-
documentColorsLabel?: string;
|
|
87
|
-
documentColorsCount?: number;
|
|
88
|
-
colorPickerConfig: ColorPickerConfig | false;
|
|
89
|
-
});
|
|
90
|
-
/**
|
|
91
|
-
* @inheritDoc
|
|
92
|
-
*/
|
|
93
|
-
render(): void;
|
|
94
|
-
/**
|
|
95
|
-
* @inheritDoc
|
|
96
|
-
*/
|
|
97
|
-
destroy(): void;
|
|
98
|
-
/**
|
|
99
|
-
* Appends static and document color grid views.
|
|
100
|
-
*/
|
|
101
|
-
appendGrids(): void;
|
|
102
|
-
/**
|
|
103
|
-
* Renders UI in dropdown. Which sub-components are rendered
|
|
104
|
-
* depends on the component configuration.
|
|
105
|
-
*/
|
|
106
|
-
appendUI(): void;
|
|
107
|
-
/**
|
|
108
|
-
* Show "Color picker" and hide "Color grids".
|
|
109
|
-
*/
|
|
110
|
-
showColorPicker(): void;
|
|
111
|
-
/**
|
|
112
|
-
* Show "Color grids" and hide "Color picker".
|
|
113
|
-
*/
|
|
114
|
-
showColorGrids(): void;
|
|
115
|
-
/**
|
|
116
|
-
* Focuses the first focusable element in {@link #items}.
|
|
117
|
-
*/
|
|
118
|
-
focus(): void;
|
|
119
|
-
/**
|
|
120
|
-
* Focuses the last focusable element in {@link #items}.
|
|
121
|
-
*/
|
|
122
|
-
focusLast(): void;
|
|
123
|
-
/**
|
|
124
|
-
* Scans through the editor model and searches for text node attributes with the given attribute name.
|
|
125
|
-
* Found entries are set as document colors.
|
|
126
|
-
*
|
|
127
|
-
* All the previously stored document colors will be lost in the process.
|
|
128
|
-
*
|
|
129
|
-
* @param model The model used as a source to obtain the document colors.
|
|
130
|
-
* @param attributeName Determines the name of the related model's attribute for a given dropdown.
|
|
131
|
-
*/
|
|
132
|
-
updateDocumentColors(model: Model, attributeName: string): void;
|
|
133
|
-
/**
|
|
134
|
-
* Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgridview~ColorGridView}s
|
|
135
|
-
* available in the {@link module:font/ui/colortableview~ColorTableView}. It guarantees that the selection will occur only in one
|
|
136
|
-
* of them.
|
|
137
|
-
*/
|
|
138
|
-
updateSelectedColors(): void;
|
|
139
|
-
/**
|
|
140
|
-
* Appends the color picker view.
|
|
141
|
-
*/
|
|
142
|
-
private _appendColorPicker;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* A class which represents a view with the following sub–components:
|
|
146
|
-
*
|
|
147
|
-
* * A remove color button,
|
|
148
|
-
* * A static {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors defined in the configuration,
|
|
149
|
-
* * A dynamic {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors used in the document.
|
|
150
|
-
* * If color picker is configured, the "Color Picker" button is visible too.
|
|
151
|
-
*/
|
|
152
|
-
declare class ColorGridsPageView extends View {
|
|
153
|
-
/**
|
|
154
|
-
* A collection of the children of the table.
|
|
155
|
-
*/
|
|
156
|
-
readonly items: ViewCollection;
|
|
157
|
-
/**
|
|
158
|
-
* An array with objects representing colors to be displayed in the grid.
|
|
159
|
-
*/
|
|
160
|
-
colorDefinitions: Array<ColorDefinition>;
|
|
161
|
-
/**
|
|
162
|
-
* Tracks information about the DOM focus in the list.
|
|
163
|
-
*/
|
|
164
|
-
readonly focusTracker: FocusTracker;
|
|
165
|
-
/**
|
|
166
|
-
* The number of columns in the color grid.
|
|
167
|
-
*/
|
|
168
|
-
columns: number;
|
|
169
|
-
/**
|
|
170
|
-
* A collection of definitions that store the document colors.
|
|
171
|
-
*
|
|
172
|
-
* @readonly
|
|
173
|
-
*/
|
|
174
|
-
documentColors: DocumentColorCollection;
|
|
175
|
-
/**
|
|
176
|
-
* The maximum number of colors in the document colors section.
|
|
177
|
-
* If it equals 0, the document colors section is not added.
|
|
178
|
-
*
|
|
179
|
-
* @readonly
|
|
180
|
-
*/
|
|
181
|
-
documentColorsCount?: number;
|
|
182
|
-
/**
|
|
183
|
-
* Keeps the value of the command associated with the table for the current selection.
|
|
184
|
-
*/
|
|
185
|
-
selectedColor: string;
|
|
186
|
-
/**
|
|
187
|
-
* Preserves the reference to {@link module:ui/colorgrid/colorgridview~ColorGridView} used to create
|
|
188
|
-
* the default (static) color set.
|
|
189
|
-
*
|
|
190
|
-
* The property is loaded once the the parent dropdown is opened the first time.
|
|
191
|
-
*
|
|
192
|
-
* @readonly
|
|
193
|
-
*/
|
|
194
|
-
staticColorsGrid: ColorGridView | undefined;
|
|
195
|
-
/**
|
|
196
|
-
* Preserves the reference to {@link module:ui/colorgrid/colorgridview~ColorGridView} used to create
|
|
197
|
-
* the document colors. It remains undefined if the document colors feature is disabled.
|
|
198
|
-
*
|
|
199
|
-
* The property is loaded once the the parent dropdown is opened the first time.
|
|
200
|
-
*
|
|
201
|
-
* @readonly
|
|
202
|
-
*/
|
|
203
|
-
documentColorsGrid: ColorGridView | undefined;
|
|
204
|
-
/**
|
|
205
|
-
* The "Color picker" button view.
|
|
206
|
-
*/
|
|
207
|
-
colorPickerButtonView?: ButtonView;
|
|
208
|
-
/**
|
|
209
|
-
* The "Remove color" button view.
|
|
210
|
-
*/
|
|
211
|
-
removeColorButtonView: ButtonView;
|
|
212
|
-
/**
|
|
213
|
-
* The property which is responsible for is component visible or not.
|
|
214
|
-
*/
|
|
215
|
-
isVisible: boolean;
|
|
216
|
-
/**
|
|
217
|
-
* A collection of views that can be focused in the view.
|
|
218
|
-
*
|
|
219
|
-
* @readonly
|
|
220
|
-
*/
|
|
221
|
-
protected _focusables: ViewCollection;
|
|
222
|
-
/**
|
|
223
|
-
* Document color section's label.
|
|
224
|
-
*
|
|
225
|
-
* @readonly
|
|
226
|
-
*/
|
|
227
|
-
private _documentColorsLabel?;
|
|
228
|
-
/**
|
|
229
|
-
* The label of the button responsible for removing color attributes.
|
|
230
|
-
*/
|
|
231
|
-
private _removeButtonLabel;
|
|
232
|
-
/**
|
|
233
|
-
* The label of the button responsible for switching to the color picker component.
|
|
234
|
-
*/
|
|
235
|
-
_colorPickerLabel: string;
|
|
236
|
-
/**
|
|
237
|
-
* Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
|
|
238
|
-
*
|
|
239
|
-
* @param locale The localization services instance.
|
|
240
|
-
* @param colors An array with definitions of colors to be displayed in the table.
|
|
241
|
-
* @param columns The number of columns in the color grid.
|
|
242
|
-
* @param removeButtonLabel The label of the button responsible for removing the color.
|
|
243
|
-
* @param colorPickerLabel The label of the button responsible for color picker appearing.
|
|
244
|
-
* @param documentColorsLabel The label for the section with the document colors.
|
|
245
|
-
* @param documentColorsCount The number of colors in the document colors section inside the color dropdown.
|
|
246
|
-
* @param focusTracker Tracks information about the DOM focus in the list.
|
|
247
|
-
* @param focusables A collection of views that can be focused in the view.
|
|
248
|
-
*/
|
|
249
|
-
constructor(locale: Locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, focusTracker, focusables }: {
|
|
250
|
-
colors: Array<ColorDefinition>;
|
|
251
|
-
columns: number;
|
|
252
|
-
removeButtonLabel: string;
|
|
253
|
-
colorPickerLabel: string;
|
|
254
|
-
documentColorsLabel?: string;
|
|
255
|
-
documentColorsCount?: number;
|
|
256
|
-
focusTracker: FocusTracker;
|
|
257
|
-
focusables: ViewCollection;
|
|
258
|
-
});
|
|
259
|
-
/**
|
|
260
|
-
* Scans through the editor model and searches for text node attributes with the given attribute name.
|
|
261
|
-
* Found entries are set as document colors.
|
|
262
|
-
*
|
|
263
|
-
* All the previously stored document colors will be lost in the process.
|
|
264
|
-
*
|
|
265
|
-
* @param model The model used as a source to obtain the document colors.
|
|
266
|
-
* @param attributeName Determines the name of the related model's attribute for a given dropdown.
|
|
267
|
-
*/
|
|
268
|
-
updateDocumentColors(model: Model, attributeName: string): void;
|
|
269
|
-
/**
|
|
270
|
-
* Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgridview~ColorGridView}s
|
|
271
|
-
* available in the {@link module:font/ui/colortableview~ColorTableView}. It guarantees that the selection will occur only in one
|
|
272
|
-
* of them.
|
|
273
|
-
*/
|
|
274
|
-
updateSelectedColors(): void;
|
|
275
|
-
/**
|
|
276
|
-
* @inheritDoc
|
|
277
|
-
*/
|
|
278
|
-
render(): void;
|
|
279
|
-
/**
|
|
280
|
-
* Focuses the component.
|
|
281
|
-
*/
|
|
282
|
-
focus(): void;
|
|
283
|
-
/**
|
|
284
|
-
* @inheritDoc
|
|
285
|
-
*/
|
|
286
|
-
destroy(): void;
|
|
287
|
-
/**
|
|
288
|
-
* Handles displaying the color picker button (if it was previously created) and making it focusable.
|
|
289
|
-
*/
|
|
290
|
-
addColorPickerButton(): void;
|
|
291
|
-
/**
|
|
292
|
-
* Adds color table elements to focus tracker.
|
|
293
|
-
*/
|
|
294
|
-
private _addColorTablesElementsToFocusTracker;
|
|
295
|
-
/**
|
|
296
|
-
* Creates the button responsible for displaying the color picker component.
|
|
297
|
-
*/
|
|
298
|
-
private _createColorPickerButton;
|
|
299
|
-
/**
|
|
300
|
-
* Adds the remove color button as a child of the current view.
|
|
301
|
-
*/
|
|
302
|
-
private _createRemoveColorButton;
|
|
303
|
-
/**
|
|
304
|
-
* Creates a static color table grid based on the editor configuration.
|
|
305
|
-
*/
|
|
306
|
-
private _createStaticColorsGrid;
|
|
307
|
-
/**
|
|
308
|
-
* Creates the document colors section view and binds it to {@link #documentColors}.
|
|
309
|
-
*/
|
|
310
|
-
private _createDocumentColorsGrid;
|
|
311
|
-
/**
|
|
312
|
-
* Adds a given color to the document colors list. If possible, the method will attempt to use
|
|
313
|
-
* data from the {@link #colorDefinitions} (label, color options).
|
|
314
|
-
*
|
|
315
|
-
* @param color A string that stores the value of the recently applied color.
|
|
316
|
-
*/
|
|
317
|
-
private _addColorToDocumentColors;
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* A class which represents a color picker component view with the following sub–components:
|
|
321
|
-
*
|
|
322
|
-
* * Color picker saturation and hue sliders,
|
|
323
|
-
* * Input accepting colors in HEX format,
|
|
324
|
-
* * "Save" and "Cancel" action buttons.
|
|
325
|
-
*/
|
|
326
|
-
declare class ColorPickerPageView extends View {
|
|
327
|
-
/**
|
|
328
|
-
* A collection of component's children.
|
|
329
|
-
*/
|
|
330
|
-
readonly items: ViewCollection;
|
|
331
|
-
/**
|
|
332
|
-
* A view with saturation and hue sliders and color input.
|
|
333
|
-
*/
|
|
334
|
-
colorPickerView?: ColorPickerView;
|
|
335
|
-
/**
|
|
336
|
-
* The "Save" button view.
|
|
337
|
-
*/
|
|
338
|
-
saveButtonView: ButtonView;
|
|
339
|
-
/**
|
|
340
|
-
* The "Cancel" button view.
|
|
341
|
-
*/
|
|
342
|
-
cancelButtonView: ButtonView;
|
|
343
|
-
/**
|
|
344
|
-
* The action bar where are "Save" button and "Cancel" button.
|
|
345
|
-
*/
|
|
346
|
-
actionBarView: View;
|
|
347
|
-
/**
|
|
348
|
-
* Tracks information about the DOM focus in the list.
|
|
349
|
-
*/
|
|
350
|
-
readonly focusTracker: FocusTracker;
|
|
351
|
-
/**
|
|
352
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
353
|
-
*/
|
|
354
|
-
readonly keystrokes: KeystrokeHandler;
|
|
355
|
-
/**
|
|
356
|
-
* Indicates whether the component is visible or not.
|
|
357
|
-
*/
|
|
358
|
-
isVisible: boolean;
|
|
359
|
-
/**
|
|
360
|
-
* Keeps the value of the command associated with the component for the current selection.
|
|
361
|
-
*/
|
|
362
|
-
selectedColor?: string;
|
|
363
|
-
/**
|
|
364
|
-
* A collection of views that can be focused in the view.
|
|
365
|
-
*
|
|
366
|
-
* @readonly
|
|
367
|
-
*/
|
|
368
|
-
protected _focusables: ViewCollection;
|
|
369
|
-
/**
|
|
370
|
-
* Color picker's config.
|
|
371
|
-
*
|
|
372
|
-
* @readonly
|
|
373
|
-
*/
|
|
374
|
-
private _pickerConfig;
|
|
375
|
-
/**
|
|
376
|
-
* @param locale The localization services instance.
|
|
377
|
-
* @param focusTracker Tracks information about the DOM focus in the list.
|
|
378
|
-
* @param focusables A collection of views that can be focused in the view..
|
|
379
|
-
* @param keystrokes An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
380
|
-
* @param colorPickerConfig The configuration of color picker feature.
|
|
381
|
-
*/
|
|
382
|
-
constructor(locale: Locale, { focusTracker, focusables, keystrokes, colorPickerConfig }: {
|
|
383
|
-
focusTracker: FocusTracker;
|
|
384
|
-
focusables: ViewCollection;
|
|
385
|
-
keystrokes: KeystrokeHandler;
|
|
386
|
-
colorPickerConfig: ColorPickerConfig | false;
|
|
387
|
-
});
|
|
388
|
-
/**
|
|
389
|
-
* @inheritDoc
|
|
390
|
-
*/
|
|
391
|
-
render(): void;
|
|
392
|
-
/**
|
|
393
|
-
* @inheritDoc
|
|
394
|
-
*/
|
|
395
|
-
destroy(): void;
|
|
396
|
-
/**
|
|
397
|
-
* Focuses the color picker.
|
|
398
|
-
*/
|
|
399
|
-
focus(): void;
|
|
400
|
-
/**
|
|
401
|
-
* When color picker is focused and "enter" is pressed it executes command.
|
|
402
|
-
*/
|
|
403
|
-
private _executeOnEnterPress;
|
|
404
|
-
/**
|
|
405
|
-
* Removes default behavior of arrow keys in dropdown.
|
|
406
|
-
*/
|
|
407
|
-
private _stopPropagationOnArrowsKeys;
|
|
408
|
-
/**
|
|
409
|
-
* Adds color picker elements to focus tracker.
|
|
410
|
-
*/
|
|
411
|
-
private _addColorPickersElementsToFocusTracker;
|
|
412
|
-
/**
|
|
413
|
-
* Creates bar containing "Save" and "Cancel" buttons.
|
|
414
|
-
*/
|
|
415
|
-
private _createActionBarView;
|
|
416
|
-
/**
|
|
417
|
-
* Creates "Save" and "Cancel" buttons.
|
|
418
|
-
*/
|
|
419
|
-
private _createActionButtons;
|
|
420
|
-
/**
|
|
421
|
-
* Fires the `execute` event if color in color picker changed.
|
|
422
|
-
*
|
|
423
|
-
* @fires execute
|
|
424
|
-
*/
|
|
425
|
-
private _executeUponColorChange;
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Fired whenever the color was changed.
|
|
429
|
-
*
|
|
430
|
-
* @eventName ~ColorTableView#execute
|
|
431
|
-
*/
|
|
432
|
-
export type ColorTableExecuteEvent = {
|
|
433
|
-
name: 'execute';
|
|
434
|
-
args: [
|
|
435
|
-
{
|
|
436
|
-
value: string;
|
|
437
|
-
source: 'staticColorsGrid' | 'documentColorsGrid' | 'removeColorButton' | 'colorPicker' | 'saveButton';
|
|
438
|
-
}
|
|
439
|
-
];
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* Fired whenever color changes should be canceled.
|
|
443
|
-
*
|
|
444
|
-
* @eventName ~ColorTableView#cancel
|
|
445
|
-
*/
|
|
446
|
-
export type ColorTableCancelEvent = {
|
|
447
|
-
name: 'cancel';
|
|
448
|
-
args: [];
|
|
449
|
-
};
|
|
450
|
-
/**
|
|
451
|
-
* Fired whenever color picker will be shown.
|
|
452
|
-
*
|
|
453
|
-
* @eventName ~ColorTableView#showColorPicker
|
|
454
|
-
*/
|
|
455
|
-
export type ColorTableShowColorPickerEvent = {
|
|
456
|
-
name: 'showColorPicker';
|
|
457
|
-
args: [];
|
|
458
|
-
};
|
|
459
|
-
export {};
|