@ckeditor/ckeditor5-widget 48.8.1-alpha.3 → 49.0.0-alpha.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 (169) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/augmentation.d.ts +11 -11
  3. package/dist/highlightstack.d.ts +65 -64
  4. package/dist/index-content.css +3 -0
  5. package/dist/index-content.css.map +1 -0
  6. package/dist/index-editor.css +433 -426
  7. package/dist/index-editor.css.map +1 -0
  8. package/dist/index.css +331 -328
  9. package/dist/index.css.map +1 -1
  10. package/dist/index.d.ts +19 -17
  11. package/dist/index.js +2647 -3053
  12. package/dist/index.js.map +1 -1
  13. package/dist/translations/af.js +1 -1
  14. package/dist/translations/af.umd.js +5 -3
  15. package/dist/translations/ar.js +1 -1
  16. package/dist/translations/ar.umd.js +5 -3
  17. package/dist/translations/ast.js +1 -1
  18. package/dist/translations/ast.umd.js +5 -3
  19. package/dist/translations/az.js +1 -1
  20. package/dist/translations/az.umd.js +5 -3
  21. package/dist/translations/be.js +1 -1
  22. package/dist/translations/be.umd.js +5 -3
  23. package/dist/translations/bg.js +1 -1
  24. package/dist/translations/bg.umd.js +5 -3
  25. package/dist/translations/bn.js +1 -1
  26. package/dist/translations/bn.umd.js +5 -3
  27. package/dist/translations/bs.js +1 -1
  28. package/dist/translations/bs.umd.js +5 -3
  29. package/dist/translations/ca.js +1 -1
  30. package/dist/translations/ca.umd.js +5 -3
  31. package/dist/translations/cs.js +1 -1
  32. package/dist/translations/cs.umd.js +5 -3
  33. package/dist/translations/da.js +1 -1
  34. package/dist/translations/da.umd.js +5 -3
  35. package/dist/translations/de-ch.js +1 -1
  36. package/dist/translations/de-ch.umd.js +5 -3
  37. package/dist/translations/de.js +1 -1
  38. package/dist/translations/de.umd.js +5 -3
  39. package/dist/translations/el.js +1 -1
  40. package/dist/translations/el.umd.js +5 -3
  41. package/dist/translations/en-au.js +1 -1
  42. package/dist/translations/en-au.umd.js +5 -3
  43. package/dist/translations/en-gb.js +1 -1
  44. package/dist/translations/en-gb.umd.js +5 -3
  45. package/dist/translations/en.js +1 -1
  46. package/dist/translations/en.umd.js +5 -3
  47. package/dist/translations/eo.js +1 -1
  48. package/dist/translations/eo.umd.js +5 -3
  49. package/dist/translations/es-co.js +1 -1
  50. package/dist/translations/es-co.umd.js +5 -3
  51. package/dist/translations/es.js +1 -1
  52. package/dist/translations/es.umd.js +5 -3
  53. package/dist/translations/et.js +1 -1
  54. package/dist/translations/et.umd.js +5 -3
  55. package/dist/translations/eu.js +1 -1
  56. package/dist/translations/eu.umd.js +5 -3
  57. package/dist/translations/fa.js +1 -1
  58. package/dist/translations/fa.umd.js +5 -3
  59. package/dist/translations/fi.js +1 -1
  60. package/dist/translations/fi.umd.js +5 -3
  61. package/dist/translations/fr.js +1 -1
  62. package/dist/translations/fr.umd.js +5 -3
  63. package/dist/translations/gl.js +1 -1
  64. package/dist/translations/gl.umd.js +5 -3
  65. package/dist/translations/gu.js +1 -1
  66. package/dist/translations/gu.umd.js +5 -3
  67. package/dist/translations/he.js +1 -1
  68. package/dist/translations/he.umd.js +5 -3
  69. package/dist/translations/hi.js +1 -1
  70. package/dist/translations/hi.umd.js +5 -3
  71. package/dist/translations/hr.js +1 -1
  72. package/dist/translations/hr.umd.js +5 -3
  73. package/dist/translations/hu.js +1 -1
  74. package/dist/translations/hu.umd.js +5 -3
  75. package/dist/translations/hy.js +1 -1
  76. package/dist/translations/hy.umd.js +5 -3
  77. package/dist/translations/id.js +1 -1
  78. package/dist/translations/id.umd.js +5 -3
  79. package/dist/translations/it.js +1 -1
  80. package/dist/translations/it.umd.js +5 -3
  81. package/dist/translations/ja.js +1 -1
  82. package/dist/translations/ja.umd.js +5 -3
  83. package/dist/translations/jv.js +1 -1
  84. package/dist/translations/jv.umd.js +5 -3
  85. package/dist/translations/kk.js +1 -1
  86. package/dist/translations/kk.umd.js +5 -3
  87. package/dist/translations/km.js +1 -1
  88. package/dist/translations/km.umd.js +5 -3
  89. package/dist/translations/kn.js +1 -1
  90. package/dist/translations/kn.umd.js +5 -3
  91. package/dist/translations/ko.js +1 -1
  92. package/dist/translations/ko.umd.js +5 -3
  93. package/dist/translations/ku.js +1 -1
  94. package/dist/translations/ku.umd.js +5 -3
  95. package/dist/translations/lt.js +1 -1
  96. package/dist/translations/lt.umd.js +5 -3
  97. package/dist/translations/lv.js +1 -1
  98. package/dist/translations/lv.umd.js +5 -3
  99. package/dist/translations/ms.js +1 -1
  100. package/dist/translations/ms.umd.js +5 -3
  101. package/dist/translations/nb.js +1 -1
  102. package/dist/translations/nb.umd.js +5 -3
  103. package/dist/translations/ne.js +1 -1
  104. package/dist/translations/ne.umd.js +5 -3
  105. package/dist/translations/nl.js +1 -1
  106. package/dist/translations/nl.umd.js +5 -3
  107. package/dist/translations/no.js +1 -1
  108. package/dist/translations/no.umd.js +5 -3
  109. package/dist/translations/oc.js +1 -1
  110. package/dist/translations/oc.umd.js +5 -3
  111. package/dist/translations/pl.js +1 -1
  112. package/dist/translations/pl.umd.js +5 -3
  113. package/dist/translations/pt-br.js +1 -1
  114. package/dist/translations/pt-br.umd.js +5 -3
  115. package/dist/translations/pt.js +1 -1
  116. package/dist/translations/pt.umd.js +5 -3
  117. package/dist/translations/ro.js +1 -1
  118. package/dist/translations/ro.umd.js +5 -3
  119. package/dist/translations/ru.js +1 -1
  120. package/dist/translations/ru.umd.js +5 -3
  121. package/dist/translations/si.js +1 -1
  122. package/dist/translations/si.umd.js +5 -3
  123. package/dist/translations/sk.js +1 -1
  124. package/dist/translations/sk.umd.js +5 -3
  125. package/dist/translations/sl.js +1 -1
  126. package/dist/translations/sl.umd.js +5 -3
  127. package/dist/translations/sq.js +1 -1
  128. package/dist/translations/sq.umd.js +5 -3
  129. package/dist/translations/sr-latn.js +1 -1
  130. package/dist/translations/sr-latn.umd.js +5 -3
  131. package/dist/translations/sr.js +1 -1
  132. package/dist/translations/sr.umd.js +5 -3
  133. package/dist/translations/sv.js +1 -1
  134. package/dist/translations/sv.umd.js +5 -3
  135. package/dist/translations/th.js +1 -1
  136. package/dist/translations/th.umd.js +5 -3
  137. package/dist/translations/ti.js +1 -1
  138. package/dist/translations/ti.umd.js +5 -3
  139. package/dist/translations/tk.js +1 -1
  140. package/dist/translations/tk.umd.js +5 -3
  141. package/dist/translations/tr.js +1 -1
  142. package/dist/translations/tr.umd.js +5 -3
  143. package/dist/translations/tt.js +1 -1
  144. package/dist/translations/tt.umd.js +5 -3
  145. package/dist/translations/ug.js +1 -1
  146. package/dist/translations/ug.umd.js +5 -3
  147. package/dist/translations/uk.js +1 -1
  148. package/dist/translations/uk.umd.js +5 -3
  149. package/dist/translations/ur.js +1 -1
  150. package/dist/translations/ur.umd.js +5 -3
  151. package/dist/translations/uz.js +1 -1
  152. package/dist/translations/uz.umd.js +5 -3
  153. package/dist/translations/vi.js +1 -1
  154. package/dist/translations/vi.umd.js +5 -3
  155. package/dist/translations/zh-cn.js +1 -1
  156. package/dist/translations/zh-cn.umd.js +5 -3
  157. package/dist/translations/zh.js +1 -1
  158. package/dist/translations/zh.umd.js +5 -3
  159. package/dist/utils.d.ts +192 -189
  160. package/dist/verticalnavigation.d.ts +11 -11
  161. package/dist/widget.d.ts +112 -113
  162. package/dist/widgetresize/resizer.d.ts +166 -169
  163. package/dist/widgetresize/resizerstate.d.ts +122 -121
  164. package/dist/widgetresize/sizeview.d.ts +52 -52
  165. package/dist/widgetresize.d.ts +120 -121
  166. package/dist/widgettoolbarrepository.d.ts +96 -96
  167. package/dist/widgettypearound/utils.d.ts +70 -37
  168. package/dist/widgettypearound/widgettypearound.d.ts +225 -226
  169. package/package.json +9 -9
@@ -4,8 +4,10 @@
4
4
  */
5
5
 
6
6
  ( e => {
7
- const { [ 'zh-cn' ]: { dictionary, getPluralForm } } = {"zh-cn":{"dictionary":{"Widget toolbar":"小部件工具栏","Insert paragraph before block":"在前面插入段落","Insert paragraph after block":"在后面插入段落","Press Enter to type after or press Shift + Enter to type before the widget":"按下“Enter”键,在小组件后输入;按下“Shift+Enter”键,在小组件前输入","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"当小组件被选中时(例如:图片、表格等)可以使用的按键","Insert a new paragraph directly after a widget":"直接在小组件之后插入新段落","Insert a new paragraph directly before a widget":"直接在小组件之前插入新段落","Move the caret to allow typing directly before a widget":"移动插入符,以允许在小组件之前直接输入文字","Move the caret to allow typing directly after a widget":"移动插入符,以允许在小组件之后直接输入文字","Move focus from an editable area back to the parent widget":"将焦点从可编辑区域移回父窗口小组件"},getPluralForm(n){return 0;}}};
7
+ const { [ 'zh-cn' ]: translations } = {"zh-cn":{"dictionary":{"Widget toolbar":"小部件工具栏","Insert paragraph before block":"在前面插入段落","Insert paragraph after block":"在后面插入段落","Press Enter to type after or press Shift + Enter to type before the widget":"按下“Enter”键,在小组件后输入;按下“Shift+Enter”键,在小组件前输入","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"当小组件被选中时(例如:图片、表格等)可以使用的按键","Insert a new paragraph directly after a widget":"直接在小组件之后插入新段落","Insert a new paragraph directly before a widget":"直接在小组件之前插入新段落","Move the caret to allow typing directly before a widget":"移动插入符,以允许在小组件之前直接输入文字","Move the caret to allow typing directly after a widget":"移动插入符,以允许在小组件之后直接输入文字","Move focus from an editable area back to the parent widget":"将焦点从可编辑区域移回父窗口小组件"}}};
8
8
  e[ 'zh-cn' ] ||= { dictionary: {}, getPluralForm: null };
9
- e[ 'zh-cn' ].dictionary = Object.assign( e[ 'zh-cn' ].dictionary, dictionary );
10
- e[ 'zh-cn' ].getPluralForm = getPluralForm;
9
+ e[ 'zh-cn' ].dictionary = Object.assign( e[ 'zh-cn' ].dictionary, translations.dictionary );
10
+ if ( translations.getPluralForm ) {
11
+ e[ 'zh-cn' ].getPluralForm = translations.getPluralForm;
12
+ }
11
13
  } )( window.CKEDITOR_TRANSLATIONS ||= {} );
@@ -2,4 +2,4 @@
2
2
  * @license Copyright (c) 2003-2026, 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
- export default {"zh":{"dictionary":{"Widget toolbar":"小工具","Insert paragraph before block":"在這個區塊前面插入一個段落","Insert paragraph after block":"在這個區塊後面插入一個段落","Press Enter to type after or press Shift + Enter to type before the widget":"按下 Enter 在小工具後輸入,或按下 Shift + Enter 在小工具前輸入","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"小工具選取時可使用的按鍵(例如:圖片、表格等)","Insert a new paragraph directly after a widget":"在小工具後直接插入新段落","Insert a new paragraph directly before a widget":"在小工具前直接插入新段落","Move the caret to allow typing directly before a widget":"移動插入符號,以便在小工具前直接輸入","Move the caret to allow typing directly after a widget":"移動插入符號,以便在小工具後直接輸入","Move focus from an editable area back to the parent widget":"將焦點從可編輯區域移回上層小工具"},getPluralForm(n){return 0;}}}
5
+ export default {"zh":{"dictionary":{"Widget toolbar":"小工具","Insert paragraph before block":"在這個區塊前面插入一個段落","Insert paragraph after block":"在這個區塊後面插入一個段落","Press Enter to type after or press Shift + Enter to type before the widget":"按下 Enter 在小工具後輸入,或按下 Shift + Enter 在小工具前輸入","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"小工具選取時可使用的按鍵(例如:圖片、表格等)","Insert a new paragraph directly after a widget":"在小工具後直接插入新段落","Insert a new paragraph directly before a widget":"在小工具前直接插入新段落","Move the caret to allow typing directly before a widget":"移動插入符號,以便在小工具前直接輸入","Move the caret to allow typing directly after a widget":"移動插入符號,以便在小工具後直接輸入","Move focus from an editable area back to the parent widget":"將焦點從可編輯區域移回上層小工具"}}}
@@ -4,8 +4,10 @@
4
4
  */
5
5
 
6
6
  ( e => {
7
- const { [ 'zh' ]: { dictionary, getPluralForm } } = {"zh":{"dictionary":{"Widget toolbar":"小工具","Insert paragraph before block":"在這個區塊前面插入一個段落","Insert paragraph after block":"在這個區塊後面插入一個段落","Press Enter to type after or press Shift + Enter to type before the widget":"按下 Enter 在小工具後輸入,或按下 Shift + Enter 在小工具前輸入","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"小工具選取時可使用的按鍵(例如:圖片、表格等)","Insert a new paragraph directly after a widget":"在小工具後直接插入新段落","Insert a new paragraph directly before a widget":"在小工具前直接插入新段落","Move the caret to allow typing directly before a widget":"移動插入符號,以便在小工具前直接輸入","Move the caret to allow typing directly after a widget":"移動插入符號,以便在小工具後直接輸入","Move focus from an editable area back to the parent widget":"將焦點從可編輯區域移回上層小工具"},getPluralForm(n){return 0;}}};
7
+ const { [ 'zh' ]: translations } = {"zh":{"dictionary":{"Widget toolbar":"小工具","Insert paragraph before block":"在這個區塊前面插入一個段落","Insert paragraph after block":"在這個區塊後面插入一個段落","Press Enter to type after or press Shift + Enter to type before the widget":"按下 Enter 在小工具後輸入,或按下 Shift + Enter 在小工具前輸入","Keystrokes that can be used when a widget is selected (for example: image, table, etc.)":"小工具選取時可使用的按鍵(例如:圖片、表格等)","Insert a new paragraph directly after a widget":"在小工具後直接插入新段落","Insert a new paragraph directly before a widget":"在小工具前直接插入新段落","Move the caret to allow typing directly before a widget":"移動插入符號,以便在小工具前直接輸入","Move the caret to allow typing directly after a widget":"移動插入符號,以便在小工具後直接輸入","Move focus from an editable area back to the parent widget":"將焦點從可編輯區域移回上層小工具"}}};
8
8
  e[ 'zh' ] ||= { dictionary: {}, getPluralForm: null };
9
- e[ 'zh' ].dictionary = Object.assign( e[ 'zh' ].dictionary, dictionary );
10
- e[ 'zh' ].getPluralForm = getPluralForm;
9
+ e[ 'zh' ].dictionary = Object.assign( e[ 'zh' ].dictionary, translations.dictionary );
10
+ if ( translations.getPluralForm ) {
11
+ e[ 'zh' ].getPluralForm = translations.getPluralForm;
12
+ }
11
13
  } )( window.CKEDITOR_TRANSLATIONS ||= {} );
package/dist/utils.d.ts CHANGED
@@ -1,216 +1,219 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, 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
- import { Rect, type GetCallback } from '@ckeditor/ckeditor5-utils';
6
- import { type DowncastHighlightDescriptor, type MapperViewToModelPositionEvent, type ModelDocumentSelection, type ViewDowncastWriter, type Model, type ModelRange, type ModelSelection, type ViewEditableElement, type ViewElement, type ViewTypeCheckable } from '@ckeditor/ckeditor5-engine';
2
+ * @license Copyright (c) 2003-2026, 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
+ import { Rect, type GetCallback } from "@ckeditor/ckeditor5-utils";
6
+ import { type DowncastHighlightDescriptor, type MapperViewToModelPositionEvent, type ModelDocumentSelection, type ViewDowncastWriter, type Model, type ModelRange, type ModelSelection, type ViewEditableElement, type ViewElement, type ViewTypeCheckable } from "@ckeditor/ckeditor5-engine";
7
7
  /**
8
- * CSS class added to each widget element.
9
- */
8
+ * CSS class added to each widget element.
9
+ */
10
10
  export declare const WIDGET_CLASS_NAME = "ck-widget";
11
11
  /**
12
- * CSS class added to currently selected widget element.
13
- */
12
+ * CSS class added to currently selected widget element.
13
+ */
14
14
  export declare const WIDGET_SELECTED_CLASS_NAME = "ck-widget_selected";
15
15
  /**
16
- * Returns `true` if given {@link module:engine/view/node~ViewNode} is an {@link module:engine/view/element~ViewElement} and a widget.
17
- */
16
+ * Returns `true` if given {@link module:engine/view/node~ViewNode} is an {@link module:engine/view/element~ViewElement} and a widget.
17
+ */
18
18
  export declare function isWidget(node: ViewTypeCheckable): boolean;
19
19
  /**
20
- * Converts the given {@link module:engine/view/element~ViewElement} to a widget in the following way:
21
- *
22
- * * sets the `contenteditable` attribute to `"false"`,
23
- * * adds the `ck-widget` CSS class,
24
- * * adds a custom {@link module:engine/view/element~ViewElement#getFillerOffset `getFillerOffset()`} method returning `null`,
25
- * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},
26
- * * implements the {@link ~setHighlightHandling view highlight on widgets}.
27
- *
28
- * This function needs to be used in conjunction with
29
- * {@link module:engine/conversion/downcasthelpers~DowncastHelpers downcast conversion helpers}
30
- * like {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
31
- * Moreover, typically you will want to use `toWidget()` only for `editingDowncast`, while keeping the `dataDowncast` clean.
32
- *
33
- * For example, in order to convert a `<widget>` model element to `<div class="widget">` in the view, you can define
34
- * such converters:
35
- *
36
- * ```ts
37
- * editor.conversion.for( 'editingDowncast' )
38
- * .elementToElement( {
39
- * model: 'widget',
40
- * view: ( modelItem, { writer } ) => {
41
- * const div = writer.createContainerElement( 'div', { class: 'widget' } );
42
- *
43
- * return toWidget( div, writer, { label: 'some widget' } );
44
- * }
45
- * } );
46
- *
47
- * editor.conversion.for( 'dataDowncast' )
48
- * .elementToElement( {
49
- * model: 'widget',
50
- * view: ( modelItem, { writer } ) => {
51
- * return writer.createContainerElement( 'div', { class: 'widget' } );
52
- * }
53
- * } );
54
- * ```
55
- *
56
- * See the full source code of the widget (with a nested editable) schema definition and converters in
57
- * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
58
- *
59
- * @param options Additional options.
60
- * @param options.label Element's label provided to the {@link ~setLabel} function. It can be passed as
61
- * a plain string or a function returning a string. It represents the widget for assistive technologies (like screen readers).
62
- * @param options.hasSelectionHandle If `true`, the widget will have a selection handle added.
63
- * @returns Returns the same element.
64
- */
20
+ * Converts the given {@link module:engine/view/element~ViewElement} to a widget in the following way:
21
+ *
22
+ * * sets the `contenteditable` attribute to `"false"`,
23
+ * * adds the `ck-widget` CSS class,
24
+ * * adds a custom {@link module:engine/view/element~ViewElement#getFillerOffset `getFillerOffset()`} method returning `null`,
25
+ * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},
26
+ * * implements the {@link ~setHighlightHandling view highlight on widgets}.
27
+ *
28
+ * This function needs to be used in conjunction with
29
+ * {@link module:engine/conversion/downcasthelpers~DowncastHelpers downcast conversion helpers}
30
+ * like {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
31
+ * Moreover, typically you will want to use `toWidget()` only for `editingDowncast`, while keeping the `dataDowncast` clean.
32
+ *
33
+ * For example, in order to convert a `<widget>` model element to `<div class="widget">` in the view, you can define
34
+ * such converters:
35
+ *
36
+ * ```ts
37
+ * editor.conversion.for( 'editingDowncast' )
38
+ * .elementToElement( {
39
+ * model: 'widget',
40
+ * view: ( modelItem, { writer } ) => {
41
+ * const div = writer.createContainerElement( 'div', { class: 'widget' } );
42
+ *
43
+ * return toWidget( div, writer, { label: 'some widget' } );
44
+ * }
45
+ * } );
46
+ *
47
+ * editor.conversion.for( 'dataDowncast' )
48
+ * .elementToElement( {
49
+ * model: 'widget',
50
+ * view: ( modelItem, { writer } ) => {
51
+ * return writer.createContainerElement( 'div', { class: 'widget' } );
52
+ * }
53
+ * } );
54
+ * ```
55
+ *
56
+ * See the full source code of the widget (with a nested editable) schema definition and converters in
57
+ * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
58
+ *
59
+ * @param options Additional options.
60
+ * @param options.label Element's label provided to the {@link ~setLabel} function. It can be passed as
61
+ * a plain string or a function returning a string. It represents the widget for assistive technologies (like screen readers).
62
+ * @param options.hasSelectionHandle If `true`, the widget will have a selection handle added.
63
+ * @returns Returns the same element.
64
+ */
65
65
  export declare function toWidget(element: ViewElement, writer: ViewDowncastWriter, options?: {
66
- label?: string | (() => string);
67
- hasSelectionHandle?: boolean;
66
+ label?: string | (() => string);
67
+ hasSelectionHandle?: boolean;
68
68
  }): ViewElement;
69
69
  /**
70
- * Sets highlight handling methods. Uses {@link module:widget/highlightstack~WidgetHighlightStack} to
71
- * properly determine which highlight descriptor should be used at given time.
72
- */
70
+ * Sets highlight handling methods. Uses {@link module:widget/highlightstack~WidgetHighlightStack} to
71
+ * properly determine which highlight descriptor should be used at given time.
72
+ */
73
73
  export declare function setHighlightHandling(element: ViewElement, writer: ViewDowncastWriter, add?: (element: ViewElement, descriptor: DowncastHighlightDescriptor, writer: ViewDowncastWriter) => void, remove?: (element: ViewElement, descriptor: DowncastHighlightDescriptor, writer: ViewDowncastWriter) => void): void;
74
74
  /**
75
- * Sets label for given element.
76
- * It can be passed as a plain string or a function returning a string. Function will be called each time label is retrieved by
77
- * {@link ~getLabel `getLabel()`}.
78
- */
75
+ * Sets label for given element.
76
+ * It can be passed as a plain string or a function returning a string. Function will be called each time label is retrieved by
77
+ * {@link ~getLabel `getLabel()`}.
78
+ */
79
79
  export declare function setLabel(element: ViewElement, labelOrCreator: string | (() => string)): void;
80
80
  /**
81
- * Returns the label of the provided element.
82
- */
81
+ * Returns the label of the provided element.
82
+ */
83
83
  export declare function getLabel(element: ViewElement): string;
84
84
  /**
85
- * Adds functionality to the provided {@link module:engine/view/editableelement~ViewEditableElement} to act as a widget's editable:
86
- *
87
- * * sets the `contenteditable` attribute to `true` when
88
- * {@link module:engine/view/editableelement~ViewEditableElement#isReadOnly} is `false`,
89
- * otherwise sets it to `false`,
90
- * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
91
- * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
92
- * * implements the {@link ~setHighlightHandling view highlight on widget's editable}.
93
- * * sets the `role` attribute to `textbox` for accessibility purposes.
94
- *
95
- * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
96
- * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
97
- *
98
- * For example, in order to convert a `<nested>` model element to `<div class="nested">` in the view, you can define
99
- * such converters:
100
- *
101
- * ```ts
102
- * editor.conversion.for( 'editingDowncast' )
103
- * .elementToElement( {
104
- * model: 'nested',
105
- * view: ( modelItem, { writer } ) => {
106
- * const div = writer.createEditableElement( 'div', { class: 'nested' } );
107
- *
108
- * return toWidgetEditable( nested, writer, { label: 'label for editable' } );
109
- * }
110
- * } );
111
- *
112
- * editor.conversion.for( 'dataDowncast' )
113
- * .elementToElement( {
114
- * model: 'nested',
115
- * view: ( modelItem, { writer } ) => {
116
- * return writer.createContainerElement( 'div', { class: 'nested' } );
117
- * }
118
- * } );
119
- * ```
120
- *
121
- * See the full source code of the widget (with nested editable) schema definition and converters in
122
- * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
123
- *
124
- * @param options Additional options.
125
- * @param options.label Editable's label used by assistive technologies (e.g. screen readers).
126
- * @param options.withAriaRole Whether to add the role="textbox" attribute on the editable. Defaults to `true`.
127
- * @returns Returns the same element that was provided in the `editable` parameter
128
- */
85
+ * Adds functionality to the provided {@link module:engine/view/editableelement~ViewEditableElement} to act as a widget's editable:
86
+ *
87
+ * * sets the `contenteditable` attribute to `true` when
88
+ * {@link module:engine/view/editableelement~ViewEditableElement#isReadOnly} is `false`,
89
+ * otherwise sets it to `false`,
90
+ * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
91
+ * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
92
+ * * implements the {@link ~setHighlightHandling view highlight on widget's editable}.
93
+ * * sets the `role` attribute to `textbox` for accessibility purposes.
94
+ *
95
+ * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
96
+ * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
97
+ *
98
+ * For example, in order to convert a `<nested>` model element to `<div class="nested">` in the view, you can define
99
+ * such converters:
100
+ *
101
+ * ```ts
102
+ * editor.conversion.for( 'editingDowncast' )
103
+ * .elementToElement( {
104
+ * model: 'nested',
105
+ * view: ( modelItem, { writer } ) => {
106
+ * const div = writer.createEditableElement( 'div', { class: 'nested' } );
107
+ *
108
+ * return toWidgetEditable( nested, writer, { label: 'label for editable' } );
109
+ * }
110
+ * } );
111
+ *
112
+ * editor.conversion.for( 'dataDowncast' )
113
+ * .elementToElement( {
114
+ * model: 'nested',
115
+ * view: ( modelItem, { writer } ) => {
116
+ * return writer.createContainerElement( 'div', { class: 'nested' } );
117
+ * }
118
+ * } );
119
+ * ```
120
+ *
121
+ * See the full source code of the widget (with nested editable) schema definition and converters in
122
+ * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
123
+ *
124
+ * @param options Additional options.
125
+ * @param options.label Editable's label used by assistive technologies (e.g. screen readers).
126
+ * @param options.withAriaRole Whether to add the role="textbox" attribute on the editable. Defaults to `true`.
127
+ * @returns Returns the same element that was provided in the `editable` parameter
128
+ */
129
129
  export declare function toWidgetEditable(editable: ViewEditableElement, writer: ViewDowncastWriter, options?: {
130
- label?: string;
131
- withAriaRole?: boolean;
130
+ label?: string;
131
+ withAriaRole?: boolean;
132
132
  }): ViewEditableElement;
133
133
  /**
134
- * Returns a model range which is optimal (in terms of UX) for inserting a widget block.
135
- *
136
- * For instance, if a selection is in the middle of a paragraph, the collapsed range before this paragraph
137
- * will be returned so that it is not split. If the selection is at the end of a paragraph,
138
- * the collapsed range after this paragraph will be returned.
139
- *
140
- * Note: If the selection is placed in an empty block, the range in that block will be returned. If that range
141
- * is then passed to {@link module:engine/model/model~Model#insertContent}, the block will be fully replaced
142
- * by the inserted widget block.
143
- *
144
- * @param selection The selection based on which the insertion position should be calculated.
145
- * @param model Model instance.
146
- * @returns The optimal range.
147
- */
134
+ * Returns a model range which is optimal (in terms of UX) for inserting a widget block.
135
+ *
136
+ * For instance, if a selection is in the middle of a paragraph, the collapsed range before this paragraph
137
+ * will be returned so that it is not split. If the selection is at the end of a paragraph,
138
+ * the collapsed range after this paragraph will be returned.
139
+ *
140
+ * Note: If the selection is placed in an empty block, the range in that block will be returned. If that range
141
+ * is then passed to {@link module:engine/model/model~Model#insertContent}, the block will be fully replaced
142
+ * by the inserted widget block.
143
+ *
144
+ * @param selection The selection based on which the insertion position should be calculated.
145
+ * @param model Model instance.
146
+ * @returns The optimal range.
147
+ */
148
148
  export declare function findOptimalInsertionRange(selection: ModelSelection | ModelDocumentSelection, model: Model): ModelRange;
149
149
  /**
150
- * A util to be used in order to map view positions to correct model positions when implementing a widget
151
- * which renders non-empty view element for an empty model element.
152
- *
153
- * For example:
154
- *
155
- * ```
156
- * // Model:
157
- * <placeholder type="name"></placeholder>
158
- *
159
- * // View:
160
- * <span class="placeholder">name</span>
161
- * ```
162
- *
163
- * In such case, view positions inside `<span>` cannot be correctly mapped to the model (because the model element is empty).
164
- * To handle mapping positions inside `<span class="placeholder">` to the model use this util as follows:
165
- *
166
- * ```ts
167
- * editor.editing.mapper.on(
168
- * 'viewToModelPosition',
169
- * viewToModelPositionOutsideModelElement( model, viewElement => viewElement.hasClass( 'placeholder' ) )
170
- * );
171
- * ```
172
- *
173
- * The callback will try to map the view offset of selection to an expected model position.
174
- *
175
- * 1. When the position is at the end (or in the middle) of the inline widget:
176
- *
177
- * ```
178
- * // View:
179
- * <p>foo <span class="placeholder">name|</span> bar</p>
180
- *
181
- * // Model:
182
- * <paragraph>foo <placeholder type="name"></placeholder>| bar</paragraph>
183
- * ```
184
- *
185
- * 2. When the position is at the beginning of the inline widget:
186
- *
187
- * ```
188
- * // View:
189
- * <p>foo <span class="placeholder">|name</span> bar</p>
190
- *
191
- * // Model:
192
- * <paragraph>foo |<placeholder type="name"></placeholder> bar</paragraph>
193
- * ```
194
- *
195
- * @param model Model instance on which the callback operates.
196
- * @param viewElementMatcher Function that is passed a view element and should return `true` if the custom mapping
197
- * should be applied to the given view element.
198
- */
150
+ * A util to be used in order to map view positions to correct model positions when implementing a widget
151
+ * which renders non-empty view element for an empty model element.
152
+ *
153
+ * For example:
154
+ *
155
+ * ```
156
+ * // Model:
157
+ * <placeholder type="name"></placeholder>
158
+ *
159
+ * // View:
160
+ * <span class="placeholder">name</span>
161
+ * ```
162
+ *
163
+ * In such case, view positions inside `<span>` cannot be correctly mapped to the model (because the model element is empty).
164
+ * To handle mapping positions inside `<span class="placeholder">` to the model use this util as follows:
165
+ *
166
+ * ```ts
167
+ * editor.editing.mapper.on(
168
+ * 'viewToModelPosition',
169
+ * viewToModelPositionOutsideModelElement( model, viewElement => viewElement.hasClass( 'placeholder' ) )
170
+ * );
171
+ * ```
172
+ *
173
+ * The callback will try to map the view offset of selection to an expected model position.
174
+ *
175
+ * 1. When the position is at the end (or in the middle) of the inline widget:
176
+ *
177
+ * ```
178
+ * // View:
179
+ * <p>foo <span class="placeholder">name|</span> bar</p>
180
+ *
181
+ * // Model:
182
+ * <paragraph>foo <placeholder type="name"></placeholder>| bar</paragraph>
183
+ * ```
184
+ *
185
+ * 2. When the position is at the beginning of the inline widget:
186
+ *
187
+ * ```
188
+ * // View:
189
+ * <p>foo <span class="placeholder">|name</span> bar</p>
190
+ *
191
+ * // Model:
192
+ * <paragraph>foo |<placeholder type="name"></placeholder> bar</paragraph>
193
+ * ```
194
+ *
195
+ * @param model Model instance on which the callback operates.
196
+ * @param viewElementMatcher Function that is passed a view element and should return `true` if the custom mapping
197
+ * should be applied to the given view element.
198
+ */
199
199
  export declare function viewToModelPositionOutsideModelElement(model: Model, viewElementMatcher: (element: ViewElement) => boolean): GetCallback<MapperViewToModelPositionEvent>;
200
200
  /**
201
- * Starting from a DOM resize host element (an element that receives dimensions as a result of resizing),
202
- * this helper returns the width of the found ancestor element.
203
- *
204
- * * It searches up to 5 levels of ancestors only.
205
- *
206
- * @param domResizeHost Resize host DOM element that receives dimensions as a result of resizing.
207
- * @returns Width of ancestor element in pixels or 0 if no ancestor with a computed width has been found.
208
- */
201
+ * Starting from a DOM resize host element (an element that receives dimensions as a result of resizing),
202
+ * this helper returns the width of the found ancestor element.
203
+ *
204
+ * * It searches up to 5 levels of ancestors only.
205
+ *
206
+ * The search crosses shadow DOM boundaries, so for a resize host inside a shadow root it continues
207
+ * through the host into the surrounding (light) DOM instead of stopping at the boundary.
208
+ *
209
+ * @param domResizeHost Resize host DOM element that receives dimensions as a result of resizing.
210
+ * @returns Width of ancestor element in pixels or 0 if no ancestor with a computed width has been found.
211
+ */
209
212
  export declare function calculateResizeHostAncestorWidth(domResizeHost: HTMLElement): number;
210
213
  /**
211
- * Calculates a relative width of a `domResizeHost` compared to its ancestor in percents.
212
- *
213
- * @param domResizeHost Resize host DOM element.
214
- * @returns Percentage value between 0 and 100.
215
- */
214
+ * Calculates a relative width of a `domResizeHost` compared to its ancestor in percents.
215
+ *
216
+ * @param domResizeHost Resize host DOM element.
217
+ * @returns Percentage value between 0 and 100.
218
+ */
216
219
  export declare function calculateResizeHostPercentageWidth(domResizeHost: HTMLElement, resizeHostRect?: Rect): number;
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, 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
5
  /**
6
- * @module widget/verticalnavigation
7
- */
8
- import { type GetCallback } from '@ckeditor/ckeditor5-utils';
9
- import type { EditingController, ViewDocumentArrowKeyEvent } from '@ckeditor/ckeditor5-engine';
6
+ * @module widget/verticalnavigation
7
+ */
8
+ import { type GetCallback } from "@ckeditor/ckeditor5-utils";
9
+ import type { EditingController, ViewDocumentArrowKeyEvent } from "@ckeditor/ckeditor5-engine";
10
10
  /**
11
- * Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.
12
- *
13
- * @param editing The editing controller.
14
- */
11
+ * Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.
12
+ *
13
+ * @param editing The editing controller.
14
+ */
15
15
  export declare function verticalWidgetNavigationHandler(editing: EditingController): GetCallback<ViewDocumentArrowKeyEvent>;