@ckeditor/ckeditor5-table 39.0.2 → 40.1.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 +3 -3
- package/build/table.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/hy.js +1 -0
- package/lang/translations/fi.po +3 -3
- package/lang/translations/hy.po +262 -0
- package/package.json +2 -2
- package/src/tablecaption/toggletablecaptioncommand.js +2 -1
- package/src/tablecaption/utils.d.ts +0 -4
- package/src/tablecaption/utils.js +1 -11
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +11 -2
- package/src/tableproperties/commands/tablepropertycommand.js +3 -2
- package/src/tableproperties/tablepropertiesui.js +2 -2
- package/src/tableproperties/ui/tablepropertiesview.js +11 -2
- package/src/ui/colorinputview.d.ts +8 -8
- package/src/ui/colorinputview.js +14 -8
- package/src/utils/common.d.ts +5 -1
- package/src/utils/common.js +11 -0
- package/src/utils/ui/contextualballoon.js +13 -9
- package/src/utils/ui/widget.d.ts +4 -0
- package/src/utils/ui/widget.js +10 -0
package/build/translations/fi.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(
|
|
1
|
+
!function(e){const t=e.fi=e.fi||{};t.dictionary=Object.assign(t.dictionary||{},{"Align cell text to the bottom":"Siirrä solun teksti alaosaan","Align cell text to the center":"Siirrä solun teksti keskelle","Align cell text to the left":"Siirrä solun teksti vasemmalle","Align cell text to the middle":"Siirrä solun teksti keskiosaan","Align cell text to the right":"Siirrä solun teksti oikealle","Align cell text to the top":"Siirrä solun teksti yläosaan","Align table to the left":"Siirrä taulukko vasemmalle","Align table to the right":"Siirrä taulukko oikealle",Alignment:"Suunta",Background:"Tausta",Border:"Reunus","Cell properties":"Solun ominaisuudet","Center table":"Keskitä taulukko",Color:"Väri","Color picker":"Värin valitsin",Column:"Sarake",Dashed:"Katkoviiva","Delete column":"Poista sarake","Delete row":"Poista rivi",Dimensions:"Mittasuhteet",Dotted:"Pisteviiva",Double:"Kaksinkertainen","Enter table caption":"Syötä taulukon kuvaus",Groove:"Uurrettu","Header column":"Otsikkosarake","Header row":"Otsikkorivi",Height:"Korkeus","Horizontal text alignment toolbar":"Vaakasuoran tekstin suunnan työkalupalkki","Insert column left":"Lisää sarake vasemmalle","Insert column right":"Lisää sarake oikealle","Insert row above":"Lisää rivi ylle","Insert row below":"Lisää rivi alle","Insert table":"Lisää taulukko",Inset:"Upote","Justify cell text":"Tasaa solun teksti","Merge cell down":"Yhdistä solu alas","Merge cell left":"Yhdistä solu vasemmalle","Merge cell right":"Yhdistä solu oikealle","Merge cell up":"Yhdistä solu ylös","Merge cells":"Yhdistä tai jaa soluja",None:"Ei mitään",Outset:"Ulkonema",Padding:"Täyte",Ridge:"Harjanne",Row:"Rivi","Select column":"Valitse sarake","Select row":"Valitse rivi",Solid:"Kiinteä","Split cell horizontally":"Jaa solu vaakasuunnassa","Split cell vertically":"Jaa solu pystysuunnassa",Style:"Tyyli","Table alignment toolbar":"Taulukon suunnan työkalupalkki","Table cell text alignment":"Taulukkosolun tekstin suunta","Table properties":"Taulukon ominaisuudet","Table toolbar":"Taulukon työkalupalkki",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'Väri ei kelpaa. Ota sen sijaan käyttöön "#FF0000", "rgb(255,0,0)" tai "red".','The value is invalid. Try "10px" or "2em" or simply "2".':'Arvo ei kelpaa. Ota käyttöön "10px", "2em" tai pelkästään "2".',"Toggle caption off":"Poista taulukon kuvaus","Toggle caption on":"Lisää taulukon kuvaus","Vertical text alignment toolbar":"Pystysuoran tekstin suunnan työkalupalkki",Width:"Leveys"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e){const t=e.hy=e.hy||{};t.dictionary=Object.assign(t.dictionary||{},{"Align cell text to the bottom":"","Align cell text to the center":"","Align cell text to the left":"","Align cell text to the middle":"","Align cell text to the right":"","Align cell text to the top":"","Align table to the left":"","Align table to the right":"",Alignment:"",Background:"",Border:"","Cell properties":"","Center table":"",Color:"","Color picker":"",Column:"Սյունակ",Dashed:"","Delete column":"","Delete row":"",Dimensions:"",Dotted:"",Double:"","Enter table caption":"",Groove:"","Header column":"","Header row":"",Height:"","Horizontal text alignment toolbar":"","Insert column left":"","Insert column right":"","Insert row above":"","Insert row below":"","Insert table":"",Inset:"","Justify cell text":"","Merge cell down":"","Merge cell left":"","Merge cell right":"","Merge cell up":"","Merge cells":"",None:"",Outset:"",Padding:"",Ridge:"",Row:"","Select column":"","Select row":"",Solid:"","Split cell horizontally":"","Split cell vertically":"",Style:"","Table alignment toolbar":"","Table cell text alignment":"","Table properties":"","Table toolbar":"",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':"",'The value is invalid. Try "10px" or "2em" or simply "2".':"","Toggle caption off":"","Toggle caption on":"","Vertical text alignment toolbar":"",Width:""})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/lang/translations/fi.po
CHANGED
|
@@ -251,12 +251,12 @@ msgstr "Värin valitsin"
|
|
|
251
251
|
|
|
252
252
|
msgctxt "The button label for the table toolbar hiding caption attached to the table."
|
|
253
253
|
msgid "Toggle caption off"
|
|
254
|
-
msgstr "
|
|
254
|
+
msgstr "Poista taulukon kuvaus"
|
|
255
255
|
|
|
256
256
|
msgctxt "The button label for the table toolbar showing caption attached to the table."
|
|
257
257
|
msgid "Toggle caption on"
|
|
258
|
-
msgstr "
|
|
258
|
+
msgstr "Lisää taulukon kuvaus"
|
|
259
259
|
|
|
260
260
|
msgctxt "The placeholder text for the table caption displayed when the caption is empty."
|
|
261
261
|
msgid "Enter table caption"
|
|
262
|
-
msgstr "
|
|
262
|
+
msgstr "Syötä taulukon kuvaus"
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# !!! IMPORTANT !!!
|
|
4
|
+
#
|
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
|
7
|
+
#
|
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
|
9
|
+
#
|
|
10
|
+
# To learn more, check out the official contributor's guide:
|
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
|
12
|
+
#
|
|
13
|
+
msgid ""
|
|
14
|
+
msgstr ""
|
|
15
|
+
"Language-Team: Armenian (https://app.transifex.com/ckeditor/teams/11143/hy/)\n"
|
|
16
|
+
"Language: hy\n"
|
|
17
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
18
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
19
|
+
|
|
20
|
+
msgctxt "Label for the insert table toolbar button."
|
|
21
|
+
msgid "Insert table"
|
|
22
|
+
msgstr ""
|
|
23
|
+
|
|
24
|
+
msgctxt "Label for the set/unset table header column button."
|
|
25
|
+
msgid "Header column"
|
|
26
|
+
msgstr ""
|
|
27
|
+
|
|
28
|
+
msgctxt "Label for the insert table column to the left of the current one button."
|
|
29
|
+
msgid "Insert column left"
|
|
30
|
+
msgstr ""
|
|
31
|
+
|
|
32
|
+
msgctxt "Label for the insert table column to the right of the current one button."
|
|
33
|
+
msgid "Insert column right"
|
|
34
|
+
msgstr ""
|
|
35
|
+
|
|
36
|
+
msgctxt "Label for the delete table column button."
|
|
37
|
+
msgid "Delete column"
|
|
38
|
+
msgstr ""
|
|
39
|
+
|
|
40
|
+
msgctxt "Label for the select the entire table column button."
|
|
41
|
+
msgid "Select column"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
44
|
+
msgctxt "Label for the table column dropdown button."
|
|
45
|
+
msgid "Column"
|
|
46
|
+
msgstr "Սյունակ"
|
|
47
|
+
|
|
48
|
+
msgctxt "Label for the set/unset table header row button."
|
|
49
|
+
msgid "Header row"
|
|
50
|
+
msgstr ""
|
|
51
|
+
|
|
52
|
+
msgctxt "Label for the insert row below button."
|
|
53
|
+
msgid "Insert row below"
|
|
54
|
+
msgstr ""
|
|
55
|
+
|
|
56
|
+
msgctxt "Label for the insert row above button."
|
|
57
|
+
msgid "Insert row above"
|
|
58
|
+
msgstr ""
|
|
59
|
+
|
|
60
|
+
msgctxt "Label for the delete table row button."
|
|
61
|
+
msgid "Delete row"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
64
|
+
msgctxt "Label for the select the entire table row button."
|
|
65
|
+
msgid "Select row"
|
|
66
|
+
msgstr ""
|
|
67
|
+
|
|
68
|
+
msgctxt "Label for the table row dropdown button."
|
|
69
|
+
msgid "Row"
|
|
70
|
+
msgstr ""
|
|
71
|
+
|
|
72
|
+
msgctxt "Label for the merge table cell up button."
|
|
73
|
+
msgid "Merge cell up"
|
|
74
|
+
msgstr ""
|
|
75
|
+
|
|
76
|
+
msgctxt "Label for the merge table cell right button."
|
|
77
|
+
msgid "Merge cell right"
|
|
78
|
+
msgstr ""
|
|
79
|
+
|
|
80
|
+
msgctxt "Label for the merge table cell down button."
|
|
81
|
+
msgid "Merge cell down"
|
|
82
|
+
msgstr ""
|
|
83
|
+
|
|
84
|
+
msgctxt "Label for the merge table cell left button."
|
|
85
|
+
msgid "Merge cell left"
|
|
86
|
+
msgstr ""
|
|
87
|
+
|
|
88
|
+
msgctxt "Label for the split table cell vertically button."
|
|
89
|
+
msgid "Split cell vertically"
|
|
90
|
+
msgstr ""
|
|
91
|
+
|
|
92
|
+
msgctxt "Label for the split table cell horizontally button."
|
|
93
|
+
msgid "Split cell horizontally"
|
|
94
|
+
msgstr ""
|
|
95
|
+
|
|
96
|
+
msgctxt "Label for the merge table cells button."
|
|
97
|
+
msgid "Merge cells"
|
|
98
|
+
msgstr ""
|
|
99
|
+
|
|
100
|
+
msgctxt "The label used by assistive technologies describing a table toolbar attached to a table widget."
|
|
101
|
+
msgid "Table toolbar"
|
|
102
|
+
msgstr ""
|
|
103
|
+
|
|
104
|
+
msgctxt "The label describing the form allowing to specify the properties of a selected table."
|
|
105
|
+
msgid "Table properties"
|
|
106
|
+
msgstr ""
|
|
107
|
+
|
|
108
|
+
msgctxt "The label describing the form allowing to specify the properties of a selected table cell."
|
|
109
|
+
msgid "Cell properties"
|
|
110
|
+
msgstr ""
|
|
111
|
+
|
|
112
|
+
msgctxt "The label describing a group of border–related form fields (border style, color, etc.)."
|
|
113
|
+
msgid "Border"
|
|
114
|
+
msgstr ""
|
|
115
|
+
|
|
116
|
+
msgctxt "The label for the dropdown that allows configuring the border style of a table or a table cell."
|
|
117
|
+
msgid "Style"
|
|
118
|
+
msgstr ""
|
|
119
|
+
|
|
120
|
+
msgctxt "The label for the input that allows configuring the width of a table or a table cell or the width of a border."
|
|
121
|
+
msgid "Width"
|
|
122
|
+
msgstr ""
|
|
123
|
+
|
|
124
|
+
msgctxt "The label for the input that allows configuring the height of a table or a table cell."
|
|
125
|
+
msgid "Height"
|
|
126
|
+
msgstr ""
|
|
127
|
+
|
|
128
|
+
msgctxt "The label for the input that allows configuring the border color of a table or a table cell."
|
|
129
|
+
msgid "Color"
|
|
130
|
+
msgstr ""
|
|
131
|
+
|
|
132
|
+
msgctxt "The label for the input that allows configuring the background color of a table or a table cell."
|
|
133
|
+
msgid "Background"
|
|
134
|
+
msgstr ""
|
|
135
|
+
|
|
136
|
+
msgctxt "The label for the input that allows configuring the padding of a table cell."
|
|
137
|
+
msgid "Padding"
|
|
138
|
+
msgstr ""
|
|
139
|
+
|
|
140
|
+
msgctxt "The label describing a group of form fields that allows setting dimensions of a table or a table cell."
|
|
141
|
+
msgid "Dimensions"
|
|
142
|
+
msgstr ""
|
|
143
|
+
|
|
144
|
+
msgctxt "The label for the group of toolbars that allows configuring the text alignment in a table cell."
|
|
145
|
+
msgid "Table cell text alignment"
|
|
146
|
+
msgstr ""
|
|
147
|
+
|
|
148
|
+
msgctxt "The label for the toolbar that allows configuring the alignment of a table."
|
|
149
|
+
msgid "Alignment"
|
|
150
|
+
msgstr ""
|
|
151
|
+
|
|
152
|
+
msgctxt "The label used by assistive technologies describing a toolbar that allows configuring the horizontal text alignment in a table cell."
|
|
153
|
+
msgid "Horizontal text alignment toolbar"
|
|
154
|
+
msgstr ""
|
|
155
|
+
|
|
156
|
+
msgctxt "The label used by assistive technologies describing a toolbar that allows configuring the vertical text alignment in a table cell."
|
|
157
|
+
msgid "Vertical text alignment toolbar"
|
|
158
|
+
msgstr ""
|
|
159
|
+
|
|
160
|
+
msgctxt "The label used by assistive technologies describing a toolbar that allows configuring the alignment of a table."
|
|
161
|
+
msgid "Table alignment toolbar"
|
|
162
|
+
msgstr ""
|
|
163
|
+
|
|
164
|
+
msgctxt "The label for the border style dropdown when no style is applied to a table or a table cell."
|
|
165
|
+
msgid "None"
|
|
166
|
+
msgstr ""
|
|
167
|
+
|
|
168
|
+
msgctxt "The label for the border style dropdown when the solid border is applied to a table or a table cell."
|
|
169
|
+
msgid "Solid"
|
|
170
|
+
msgstr ""
|
|
171
|
+
|
|
172
|
+
msgctxt "The label for the border style dropdown when the dotted border is applied to a table or a table cell."
|
|
173
|
+
msgid "Dotted"
|
|
174
|
+
msgstr ""
|
|
175
|
+
|
|
176
|
+
msgctxt "The label for the border style dropdown when the dashed border is applied to a table or a table cell."
|
|
177
|
+
msgid "Dashed"
|
|
178
|
+
msgstr ""
|
|
179
|
+
|
|
180
|
+
msgctxt "The label for the border style dropdown when the double border is applied to a table or a table cell."
|
|
181
|
+
msgid "Double"
|
|
182
|
+
msgstr ""
|
|
183
|
+
|
|
184
|
+
msgctxt "The label for the border style dropdown when the groove border is applied to a table or a table cell."
|
|
185
|
+
msgid "Groove"
|
|
186
|
+
msgstr ""
|
|
187
|
+
|
|
188
|
+
msgctxt "The label for the border style dropdown when the ridge border is applied to a table or a table cell."
|
|
189
|
+
msgid "Ridge"
|
|
190
|
+
msgstr ""
|
|
191
|
+
|
|
192
|
+
msgctxt "The label for the border style dropdown when the inset border is applied to a table or a table cell."
|
|
193
|
+
msgid "Inset"
|
|
194
|
+
msgstr ""
|
|
195
|
+
|
|
196
|
+
msgctxt "The label for the border style dropdown when the outset border is applied to a table or a table cell."
|
|
197
|
+
msgid "Outset"
|
|
198
|
+
msgstr ""
|
|
199
|
+
|
|
200
|
+
msgctxt "The label used by assistive technologies describing a button that aligns the table cell text to the left."
|
|
201
|
+
msgid "Align cell text to the left"
|
|
202
|
+
msgstr ""
|
|
203
|
+
|
|
204
|
+
msgctxt "The label used by assistive technologies describing a button that aligns the table cell text to the center."
|
|
205
|
+
msgid "Align cell text to the center"
|
|
206
|
+
msgstr ""
|
|
207
|
+
|
|
208
|
+
msgctxt "The label used by assistive technologies describing a button that aligns the table cell text to the right."
|
|
209
|
+
msgid "Align cell text to the right"
|
|
210
|
+
msgstr ""
|
|
211
|
+
|
|
212
|
+
msgctxt "The label used by assistive technologies describing a button that justifies the table cell text."
|
|
213
|
+
msgid "Justify cell text"
|
|
214
|
+
msgstr ""
|
|
215
|
+
|
|
216
|
+
msgctxt "The label used by assistive technologies describing a button that aligns the table cell text to the top."
|
|
217
|
+
msgid "Align cell text to the top"
|
|
218
|
+
msgstr ""
|
|
219
|
+
|
|
220
|
+
msgctxt "The label used by assistive technologies describing a button that aligns the table cell text to the middle."
|
|
221
|
+
msgid "Align cell text to the middle"
|
|
222
|
+
msgstr ""
|
|
223
|
+
|
|
224
|
+
msgctxt "The label used by assistive technologies describing a button that aligns the table cell text to the bottom."
|
|
225
|
+
msgid "Align cell text to the bottom"
|
|
226
|
+
msgstr ""
|
|
227
|
+
|
|
228
|
+
msgctxt "The label used by assistive technologies describing a button that aligns the table to the left."
|
|
229
|
+
msgid "Align table to the left"
|
|
230
|
+
msgstr ""
|
|
231
|
+
|
|
232
|
+
msgctxt "The label used by assistive technologies describing a button that centers the table."
|
|
233
|
+
msgid "Center table"
|
|
234
|
+
msgstr ""
|
|
235
|
+
|
|
236
|
+
msgctxt "The label used by assistive technologies describing a button that aligns the table to the right."
|
|
237
|
+
msgid "Align table to the right"
|
|
238
|
+
msgstr ""
|
|
239
|
+
|
|
240
|
+
msgctxt "The localized error string that can be displayed next to color (background, border) fields that have an invalid value"
|
|
241
|
+
msgid "The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\"."
|
|
242
|
+
msgstr ""
|
|
243
|
+
|
|
244
|
+
msgctxt "The localized error string that can be displayed next to length (padding, border width) fields that have an invalid value."
|
|
245
|
+
msgid "The value is invalid. Try \"10px\" or \"2em\" or simply \"2\"."
|
|
246
|
+
msgstr ""
|
|
247
|
+
|
|
248
|
+
msgctxt "The label used by assistive technologies describing a button that opens a color picker, where user can choose a configured color for a certain properties (eg.: background color, color, border-color etc.)."
|
|
249
|
+
msgid "Color picker"
|
|
250
|
+
msgstr ""
|
|
251
|
+
|
|
252
|
+
msgctxt "The button label for the table toolbar hiding caption attached to the table."
|
|
253
|
+
msgid "Toggle caption off"
|
|
254
|
+
msgstr ""
|
|
255
|
+
|
|
256
|
+
msgctxt "The button label for the table toolbar showing caption attached to the table."
|
|
257
|
+
msgid "Toggle caption on"
|
|
258
|
+
msgstr ""
|
|
259
|
+
|
|
260
|
+
msgctxt "The placeholder text for the table caption displayed when the caption is empty."
|
|
261
|
+
msgid "Enter table caption"
|
|
262
|
+
msgstr ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "40.1.0",
|
|
4
4
|
"description": "Table feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "
|
|
15
|
+
"ckeditor5": "40.1.0",
|
|
16
16
|
"lodash-es": "4.17.21"
|
|
17
17
|
},
|
|
18
18
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @module table/tablecaption/toggletablecaptioncommand
|
|
7
7
|
*/
|
|
8
8
|
import { Command } from 'ckeditor5/src/core';
|
|
9
|
-
import { getCaptionFromTableModelElement
|
|
9
|
+
import { getCaptionFromTableModelElement } from './utils';
|
|
10
|
+
import { getSelectionAffectedTable } from '../utils/common';
|
|
10
11
|
/**
|
|
11
12
|
* The toggle table caption command.
|
|
12
13
|
*
|
|
@@ -36,7 +36,3 @@ export declare function getCaptionFromModelSelection(selection: DocumentSelectio
|
|
|
36
36
|
export declare function matchTableCaptionViewElement(element: ViewElement): {
|
|
37
37
|
name: true;
|
|
38
38
|
} | null;
|
|
39
|
-
/**
|
|
40
|
-
* Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.
|
|
41
|
-
*/
|
|
42
|
-
export declare function getSelectionAffectedTable(selection: DocumentSelection): Element;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
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
|
+
import { getSelectionAffectedTable } from '../utils/common';
|
|
5
6
|
/**
|
|
6
7
|
* Checks if the provided model element is a `table`.
|
|
7
8
|
*
|
|
@@ -54,14 +55,3 @@ export function matchTableCaptionViewElement(element) {
|
|
|
54
55
|
}
|
|
55
56
|
return null;
|
|
56
57
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.
|
|
59
|
-
*/
|
|
60
|
-
export function getSelectionAffectedTable(selection) {
|
|
61
|
-
const selectedElement = selection.getSelectedElement();
|
|
62
|
-
// Is the command triggered from the `tableToolbar`?
|
|
63
|
-
if (selectedElement && selectedElement.is('element', 'table')) {
|
|
64
|
-
return selectedElement;
|
|
65
|
-
}
|
|
66
|
-
return selection.getFirstPosition().findAncestor('table');
|
|
67
|
-
}
|
|
@@ -174,13 +174,22 @@ export default class TableCellPropertiesView extends View {
|
|
|
174
174
|
submitHandler({
|
|
175
175
|
view: this
|
|
176
176
|
});
|
|
177
|
+
// Maintain continuous focus cycling over views that have focusable children and focus cyclers themselves.
|
|
178
|
+
[this.borderColorInput, this.backgroundInput].forEach(view => {
|
|
179
|
+
view.fieldView.focusCycler.on('forwardCycle', evt => {
|
|
180
|
+
this._focusCycler.focusNext();
|
|
181
|
+
evt.stop();
|
|
182
|
+
});
|
|
183
|
+
view.fieldView.focusCycler.on('backwardCycle', evt => {
|
|
184
|
+
this._focusCycler.focusPrevious();
|
|
185
|
+
evt.stop();
|
|
186
|
+
});
|
|
187
|
+
});
|
|
177
188
|
[
|
|
178
189
|
this.borderStyleDropdown,
|
|
179
190
|
this.borderColorInput,
|
|
180
|
-
this.borderColorInput.fieldView.dropdownView.buttonView,
|
|
181
191
|
this.borderWidthInput,
|
|
182
192
|
this.backgroundInput,
|
|
183
|
-
this.backgroundInput.fieldView.dropdownView.buttonView,
|
|
184
193
|
this.widthInput,
|
|
185
194
|
this.heightInput,
|
|
186
195
|
this.paddingInput,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
import { Command } from 'ckeditor5/src/core';
|
|
6
|
+
import { getSelectionAffectedTable } from '../../utils/common';
|
|
6
7
|
/**
|
|
7
8
|
* The table cell attribute command.
|
|
8
9
|
*
|
|
@@ -27,7 +28,7 @@ export default class TablePropertyCommand extends Command {
|
|
|
27
28
|
refresh() {
|
|
28
29
|
const editor = this.editor;
|
|
29
30
|
const selection = editor.model.document.selection;
|
|
30
|
-
const table = selection
|
|
31
|
+
const table = getSelectionAffectedTable(selection);
|
|
31
32
|
this.isEnabled = !!table;
|
|
32
33
|
this.value = this._getValue(table);
|
|
33
34
|
}
|
|
@@ -44,7 +45,7 @@ export default class TablePropertyCommand extends Command {
|
|
|
44
45
|
const model = this.editor.model;
|
|
45
46
|
const selection = model.document.selection;
|
|
46
47
|
const { value, batch } = options;
|
|
47
|
-
const table = selection
|
|
48
|
+
const table = getSelectionAffectedTable(selection);
|
|
48
49
|
const valueToSet = this._getValueToSet(value);
|
|
49
50
|
model.enqueueChange(batch, writer => {
|
|
50
51
|
if (valueToSet) {
|
|
@@ -11,7 +11,7 @@ import { debounce } from 'lodash-es';
|
|
|
11
11
|
import TablePropertiesView from './ui/tablepropertiesview';
|
|
12
12
|
import tableProperties from './../../theme/icons/table-properties.svg';
|
|
13
13
|
import { colorFieldValidator, getLocalizedColorErrorText, getLocalizedLengthErrorText, lengthFieldValidator, lineWidthFieldValidator, defaultColors } from '../utils/ui/table-properties';
|
|
14
|
-
import {
|
|
14
|
+
import { getSelectionAffectedTableWidget } from '../utils/ui/widget';
|
|
15
15
|
import { getBalloonTablePositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon';
|
|
16
16
|
import { getNormalizedDefaultProperties } from '../utils/table-properties';
|
|
17
17
|
const ERROR_TEXT_TIMEOUT = 500;
|
|
@@ -251,7 +251,7 @@ export default class TablePropertiesUI extends Plugin {
|
|
|
251
251
|
_updateView() {
|
|
252
252
|
const editor = this.editor;
|
|
253
253
|
const viewDocument = editor.editing.view.document;
|
|
254
|
-
if (!
|
|
254
|
+
if (!getSelectionAffectedTableWidget(viewDocument.selection)) {
|
|
255
255
|
this._hideView();
|
|
256
256
|
}
|
|
257
257
|
else if (this._isViewVisible) {
|
|
@@ -152,13 +152,22 @@ export default class TablePropertiesView extends View {
|
|
|
152
152
|
submitHandler({
|
|
153
153
|
view: this
|
|
154
154
|
});
|
|
155
|
+
// Maintain continuous focus cycling over views that have focusable children and focus cyclers themselves.
|
|
156
|
+
[this.borderColorInput, this.backgroundInput].forEach(view => {
|
|
157
|
+
view.fieldView.focusCycler.on('forwardCycle', evt => {
|
|
158
|
+
this._focusCycler.focusNext();
|
|
159
|
+
evt.stop();
|
|
160
|
+
});
|
|
161
|
+
view.fieldView.focusCycler.on('backwardCycle', evt => {
|
|
162
|
+
this._focusCycler.focusPrevious();
|
|
163
|
+
evt.stop();
|
|
164
|
+
});
|
|
165
|
+
});
|
|
155
166
|
[
|
|
156
167
|
this.borderStyleDropdown,
|
|
157
168
|
this.borderColorInput,
|
|
158
|
-
this.borderColorInput.fieldView.dropdownView.buttonView,
|
|
159
169
|
this.borderWidthInput,
|
|
160
170
|
this.backgroundInput,
|
|
161
|
-
this.backgroundInput.fieldView.dropdownView.buttonView,
|
|
162
171
|
this.widthInput,
|
|
163
172
|
this.heightInput,
|
|
164
173
|
this.alignmentToolbar,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module table/ui/colorinputview
|
|
7
7
|
*/
|
|
8
|
-
import { View, InputTextView, FocusCycler, ViewCollection, type ColorDefinition, type DropdownView, type ColorPickerConfig } from 'ckeditor5/src/ui';
|
|
8
|
+
import { View, InputTextView, FocusCycler, ViewCollection, type ColorDefinition, type DropdownView, type ColorPickerConfig, type FocusableView } from 'ckeditor5/src/ui';
|
|
9
9
|
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
10
10
|
import '../../theme/colorinput.css';
|
|
11
11
|
export type ColorInputViewOptions = {
|
|
@@ -20,7 +20,7 @@ export type ColorInputViewOptions = {
|
|
|
20
20
|
*
|
|
21
21
|
* @internal
|
|
22
22
|
*/
|
|
23
|
-
export default class ColorInputView extends View {
|
|
23
|
+
export default class ColorInputView extends View implements FocusableView {
|
|
24
24
|
/**
|
|
25
25
|
* The value of the input.
|
|
26
26
|
*
|
|
@@ -62,6 +62,10 @@ export default class ColorInputView extends View {
|
|
|
62
62
|
* Tracks information about the DOM focus in the view.
|
|
63
63
|
*/
|
|
64
64
|
readonly focusTracker: FocusTracker;
|
|
65
|
+
/**
|
|
66
|
+
* Helps cycling over focusable children in the input view.
|
|
67
|
+
*/
|
|
68
|
+
readonly focusCycler: FocusCycler;
|
|
65
69
|
/**
|
|
66
70
|
* A collection of views that can be focused in the view.
|
|
67
71
|
*/
|
|
@@ -84,10 +88,6 @@ export default class ColorInputView extends View {
|
|
|
84
88
|
* So, we should interrupt the user by replacing the input's value.
|
|
85
89
|
*/
|
|
86
90
|
protected _stillTyping: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Helps cycling over focusable items in the view.
|
|
89
|
-
*/
|
|
90
|
-
protected readonly _focusCycler: FocusCycler;
|
|
91
91
|
/**
|
|
92
92
|
* Creates an instance of the color input view.
|
|
93
93
|
*
|
|
@@ -104,9 +104,9 @@ export default class ColorInputView extends View {
|
|
|
104
104
|
*/
|
|
105
105
|
render(): void;
|
|
106
106
|
/**
|
|
107
|
-
* Focuses the
|
|
107
|
+
* Focuses the view.
|
|
108
108
|
*/
|
|
109
|
-
focus(): void;
|
|
109
|
+
focus(direction: 1 | -1): void;
|
|
110
110
|
/**
|
|
111
111
|
* @inheritDoc
|
|
112
112
|
*/
|
package/src/ui/colorinputview.js
CHANGED
|
@@ -38,7 +38,7 @@ export default class ColorInputView extends View {
|
|
|
38
38
|
this.inputView = this._createInputTextView();
|
|
39
39
|
this.keystrokes = new KeystrokeHandler();
|
|
40
40
|
this._stillTyping = false;
|
|
41
|
-
this.
|
|
41
|
+
this.focusCycler = new FocusCycler({
|
|
42
42
|
focusables: this._focusables,
|
|
43
43
|
focusTracker: this.focusTracker,
|
|
44
44
|
keystrokeHandler: this.keystrokes,
|
|
@@ -69,14 +69,22 @@ export default class ColorInputView extends View {
|
|
|
69
69
|
*/
|
|
70
70
|
render() {
|
|
71
71
|
super.render();
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
[this.inputView, this.dropdownView.buttonView].forEach(view => {
|
|
73
|
+
this.focusTracker.add(view.element);
|
|
74
|
+
this._focusables.add(view);
|
|
75
|
+
});
|
|
76
|
+
this.keystrokes.listenTo(this.element);
|
|
74
77
|
}
|
|
75
78
|
/**
|
|
76
|
-
* Focuses the
|
|
79
|
+
* Focuses the view.
|
|
77
80
|
*/
|
|
78
|
-
focus() {
|
|
79
|
-
|
|
81
|
+
focus(direction) {
|
|
82
|
+
if (direction === -1) {
|
|
83
|
+
this.focusCycler.focusLast();
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.focusCycler.focusFirst();
|
|
87
|
+
}
|
|
80
88
|
}
|
|
81
89
|
/**
|
|
82
90
|
* @inheritDoc
|
|
@@ -129,8 +137,6 @@ export default class ColorInputView extends View {
|
|
|
129
137
|
dropdown.panelPosition = locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';
|
|
130
138
|
dropdown.panelView.children.add(colorSelector);
|
|
131
139
|
dropdown.bind('isEnabled').to(this, 'isReadOnly', value => !value);
|
|
132
|
-
this._focusables.add(colorSelector);
|
|
133
|
-
this.focusTracker.add(colorSelector.element);
|
|
134
140
|
dropdown.on('change:isOpen', (evt, name, isVisible) => {
|
|
135
141
|
if (isVisible) {
|
|
136
142
|
colorSelector.updateSelectedColors();
|
package/src/utils/common.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module table/utils/common
|
|
7
7
|
*/
|
|
8
|
-
import type { Conversion, Element, Item, Position, Schema, Writer } from 'ckeditor5/src/engine';
|
|
8
|
+
import type { Conversion, Element, Item, Position, Schema, Writer, DocumentSelection } from 'ckeditor5/src/engine';
|
|
9
9
|
import type TableUtils from '../tableutils';
|
|
10
10
|
/**
|
|
11
11
|
* A common method to update the numeric value. If a value is the default one, it will be unset.
|
|
@@ -40,3 +40,7 @@ export declare function enableProperty(schema: Schema, conversion: Conversion, o
|
|
|
40
40
|
defaultValue: string;
|
|
41
41
|
reduceBoxSides?: boolean;
|
|
42
42
|
}): void;
|
|
43
|
+
/**
|
|
44
|
+
* Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getSelectionAffectedTable(selection: DocumentSelection): Element;
|
package/src/utils/common.js
CHANGED
|
@@ -55,3 +55,14 @@ export function enableProperty(schema, conversion, options) {
|
|
|
55
55
|
upcastStyleToAttribute(conversion, { viewElement: /^(td|th)$/, ...options });
|
|
56
56
|
downcastAttributeToStyle(conversion, { modelElement: 'tableCell', ...options });
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.
|
|
60
|
+
*/
|
|
61
|
+
export function getSelectionAffectedTable(selection) {
|
|
62
|
+
const selectedElement = selection.getSelectedElement();
|
|
63
|
+
// Is the command triggered from the `tableToolbar`?
|
|
64
|
+
if (selectedElement && selectedElement.is('element', 'table')) {
|
|
65
|
+
return selectedElement;
|
|
66
|
+
}
|
|
67
|
+
return selection.getFirstPosition().findAncestor('table');
|
|
68
|
+
}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Rect } from 'ckeditor5/src/utils';
|
|
9
9
|
import { BalloonPanelView } from 'ckeditor5/src/ui';
|
|
10
|
-
import { getTableWidgetAncestor } from './widget';
|
|
10
|
+
import { getSelectionAffectedTableWidget, getTableWidgetAncestor } from './widget';
|
|
11
|
+
import { getSelectionAffectedTable } from '../common';
|
|
11
12
|
const DEFAULT_BALLOON_POSITIONS = BalloonPanelView.defaultPositions;
|
|
12
13
|
const BALLOON_POSITIONS = [
|
|
13
14
|
DEFAULT_BALLOON_POSITIONS.northArrowSouth,
|
|
@@ -28,14 +29,17 @@ const BALLOON_POSITIONS = [
|
|
|
28
29
|
*/
|
|
29
30
|
export function repositionContextualBalloon(editor, target) {
|
|
30
31
|
const balloon = editor.plugins.get('ContextualBalloon');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const selection = editor.editing.view.document.selection;
|
|
33
|
+
let position;
|
|
34
|
+
if (target === 'cell') {
|
|
35
|
+
if (getTableWidgetAncestor(selection)) {
|
|
34
36
|
position = getBalloonCellPositionData(editor);
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
}
|
|
39
|
+
else if (getSelectionAffectedTableWidget(selection)) {
|
|
40
|
+
position = getBalloonTablePositionData(editor);
|
|
41
|
+
}
|
|
42
|
+
if (position) {
|
|
39
43
|
balloon.updatePosition(position);
|
|
40
44
|
}
|
|
41
45
|
}
|
|
@@ -47,8 +51,8 @@ export function repositionContextualBalloon(editor, target) {
|
|
|
47
51
|
* @param editor The editor instance.
|
|
48
52
|
*/
|
|
49
53
|
export function getBalloonTablePositionData(editor) {
|
|
50
|
-
const
|
|
51
|
-
const modelTable =
|
|
54
|
+
const selection = editor.model.document.selection;
|
|
55
|
+
const modelTable = getSelectionAffectedTable(selection);
|
|
52
56
|
const viewTable = editor.editing.mapper.toViewElement(modelTable);
|
|
53
57
|
return {
|
|
54
58
|
target: editor.editing.view.domConverter.mapViewToDom(viewTable),
|
package/src/utils/ui/widget.d.ts
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* @module table/utils/ui/widget
|
|
7
7
|
*/
|
|
8
8
|
import type { ViewDocumentSelection, ViewElement } from 'ckeditor5/src/engine';
|
|
9
|
+
/**
|
|
10
|
+
* Depending on the position of the selection either return the selected table or the table higher in the hierarchy.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSelectionAffectedTableWidget(selection: ViewDocumentSelection): ViewElement | null;
|
|
9
13
|
/**
|
|
10
14
|
* Returns a table widget editing view element if one is selected.
|
|
11
15
|
*/
|