@ckeditor/ckeditor5-widget 0.0.0-nightly-20250323.0 → 0.0.0-nightly-20250325.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.

Potentially problematic release.


This version of @ckeditor/ckeditor5-widget might be problematic. Click here for more details.

package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-widget",
3
- "version": "0.0.0-nightly-20250323.0",
3
+ "version": "0.0.0-nightly-20250325.0",
4
4
  "description": "Widget API for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,13 +12,13 @@
12
12
  "type": "module",
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-core": "0.0.0-nightly-20250323.0",
16
- "@ckeditor/ckeditor5-engine": "0.0.0-nightly-20250323.0",
17
- "@ckeditor/ckeditor5-enter": "0.0.0-nightly-20250323.0",
18
- "@ckeditor/ckeditor5-icons": "0.0.0-nightly-20250323.0",
19
- "@ckeditor/ckeditor5-ui": "0.0.0-nightly-20250323.0",
20
- "@ckeditor/ckeditor5-utils": "0.0.0-nightly-20250323.0",
21
- "@ckeditor/ckeditor5-typing": "0.0.0-nightly-20250323.0",
15
+ "@ckeditor/ckeditor5-core": "0.0.0-nightly-20250325.0",
16
+ "@ckeditor/ckeditor5-engine": "0.0.0-nightly-20250325.0",
17
+ "@ckeditor/ckeditor5-enter": "0.0.0-nightly-20250325.0",
18
+ "@ckeditor/ckeditor5-icons": "0.0.0-nightly-20250325.0",
19
+ "@ckeditor/ckeditor5-ui": "0.0.0-nightly-20250325.0",
20
+ "@ckeditor/ckeditor5-utils": "0.0.0-nightly-20250325.0",
21
+ "@ckeditor/ckeditor5-typing": "0.0.0-nightly-20250325.0",
22
22
  "es-toolkit": "1.32.0"
23
23
  },
24
24
  "author": "CKSource (http://cksource.com/)",
package/src/utils.d.ts CHANGED
@@ -89,6 +89,7 @@ export declare function getLabel(element: ViewElement): string;
89
89
  * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
90
90
  * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
91
91
  * * implements the {@link ~setHighlightHandling view highlight on widget's editable}.
92
+ * * sets the `role` attribute to `textbox` for accessibility purposes.
92
93
  *
93
94
  * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
94
95
  * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
@@ -121,10 +122,12 @@ export declare function getLabel(element: ViewElement): string;
121
122
  *
122
123
  * @param options Additional options.
123
124
  * @param options.label Editable's label used by assistive technologies (e.g. screen readers).
125
+ * @param options.withAriaRole Whether to add the role="textbox" attribute on the editable. Defaults to `true`.
124
126
  * @returns Returns the same element that was provided in the `editable` parameter
125
127
  */
126
128
  export declare function toWidgetEditable(editable: ViewEditableElement, writer: DowncastWriter, options?: {
127
129
  label?: string;
130
+ withAriaRole?: boolean;
128
131
  }): ViewEditableElement;
129
132
  /**
130
133
  * Returns a model range which is optimal (in terms of UX) for inserting a widget block.
package/src/utils.js CHANGED
@@ -176,6 +176,7 @@ export function getLabel(element) {
176
176
  * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
177
177
  * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
178
178
  * * implements the {@link ~setHighlightHandling view highlight on widget's editable}.
179
+ * * sets the `role` attribute to `textbox` for accessibility purposes.
179
180
  *
180
181
  * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
181
182
  * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
@@ -208,11 +209,15 @@ export function getLabel(element) {
208
209
  *
209
210
  * @param options Additional options.
210
211
  * @param options.label Editable's label used by assistive technologies (e.g. screen readers).
212
+ * @param options.withAriaRole Whether to add the role="textbox" attribute on the editable. Defaults to `true`.
211
213
  * @returns Returns the same element that was provided in the `editable` parameter
212
214
  */
213
215
  export function toWidgetEditable(editable, writer, options = {}) {
214
216
  writer.addClass(['ck-editor__editable', 'ck-editor__nested-editable'], editable);
215
- writer.setAttribute('role', 'textbox', editable);
217
+ // Set role="textbox" only if explicitly requested (defaults to true for backward compatibility).
218
+ if (options.withAriaRole !== false) {
219
+ writer.setAttribute('role', 'textbox', editable);
220
+ }
216
221
  writer.setAttribute('tabindex', '-1', editable);
217
222
  if (options.label) {
218
223
  writer.setAttribute('aria-label', options.label, editable);