@ckeditor/ckeditor5-widget 0.0.0-nightly-20250616.0 → 0.0.0-nightly-20250617.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/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
  import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
6
- import { MouseObserver, TreeWalker } from '@ckeditor/ckeditor5-engine/dist/index.js';
6
+ import { MouseObserver, ModelTreeWalker } from '@ckeditor/ckeditor5-engine/dist/index.js';
7
7
  import { Delete } from '@ckeditor/ckeditor5-typing/dist/index.js';
8
8
  import { EmitterMixin, Rect, CKEditorError, toArray, isForwardArrowKeyCode, env, keyCodes, getLocalizedArrowKeyCodeDirection, getRangeFromMouseEvent, logWarning, ObservableMixin, compareArrays, global, DomEmitterMixin } from '@ckeditor/ckeditor5-utils/dist/index.js';
9
9
  import { IconDragHandle, IconReturnArrow } from '@ckeditor/ckeditor5-icons/dist/index.js';
@@ -18,7 +18,7 @@ import { throttle } from 'es-toolkit/compat';
18
18
  *
19
19
  * * highlight with highest priority should be applied,
20
20
  * * if two highlights have same priority - sort by CSS class provided in
21
- * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
21
+ * {@link module:engine/conversion/downcasthelpers~DowncastHighlightDescriptor}.
22
22
  *
23
23
  * This way, highlight will be applied with the same rules it is applied on texts.
24
24
  */ class WidgetHighlightStack extends /* #__PURE__ */ EmitterMixin() {
@@ -115,7 +115,7 @@ import { throttle } from 'es-toolkit/compat';
115
115
  return classesToString(a.classes) > classesToString(b.classes);
116
116
  }
117
117
  /**
118
- * Converts CSS classes passed with {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} to
118
+ * Converts CSS classes passed with {@link module:engine/conversion/downcasthelpers~DowncastHighlightDescriptor} to
119
119
  * sorted string.
120
120
  */ function classesToString(classes) {
121
121
  return Array.isArray(classes) ? classes.sort().join(',') : classes;
@@ -128,7 +128,7 @@ import { throttle } from 'es-toolkit/compat';
128
128
  * CSS class added to currently selected widget element.
129
129
  */ const WIDGET_SELECTED_CLASS_NAME = 'ck-widget_selected';
130
130
  /**
131
- * Returns `true` if given {@link module:engine/view/node~Node} is an {@link module:engine/view/element~Element} and a widget.
131
+ * Returns `true` if given {@link module:engine/view/node~ViewNode} is an {@link module:engine/view/element~ViewElement} and a widget.
132
132
  */ function isWidget(node) {
133
133
  if (!node.is('element')) {
134
134
  return false;
@@ -136,11 +136,11 @@ import { throttle } from 'es-toolkit/compat';
136
136
  return !!node.getCustomProperty('widget');
137
137
  }
138
138
  /**
139
- * Converts the given {@link module:engine/view/element~Element} to a widget in the following way:
139
+ * Converts the given {@link module:engine/view/element~ViewElement} to a widget in the following way:
140
140
  *
141
141
  * * sets the `contenteditable` attribute to `"false"`,
142
142
  * * adds the `ck-widget` CSS class,
143
- * * adds a custom {@link module:engine/view/element~Element#getFillerOffset `getFillerOffset()`} method returning `null`,
143
+ * * adds a custom {@link module:engine/view/element~ViewElement#getFillerOffset `getFillerOffset()`} method returning `null`,
144
144
  * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},
145
145
  * * implements the {@link ~setHighlightHandling view highlight on widgets}.
146
146
  *
@@ -183,7 +183,7 @@ import { throttle } from 'es-toolkit/compat';
183
183
  */ function toWidget(element, writer, options = {}) {
184
184
  if (!element.is('containerElement')) {
185
185
  /**
186
- * The element passed to `toWidget()` must be a {@link module:engine/view/containerelement~ContainerElement}
186
+ * The element passed to `toWidget()` must be a {@link module:engine/view/containerelement~ViewContainerElement}
187
187
  * instance.
188
188
  *
189
189
  * @error widget-to-widget-wrong-element-type
@@ -271,9 +271,10 @@ import { throttle } from 'es-toolkit/compat';
271
271
  }, '');
272
272
  }
273
273
  /**
274
- * Adds functionality to the provided {@link module:engine/view/editableelement~EditableElement} to act as a widget's editable:
274
+ * Adds functionality to the provided {@link module:engine/view/editableelement~ViewEditableElement} to act as a widget's editable:
275
275
  *
276
- * * sets the `contenteditable` attribute to `true` when {@link module:engine/view/editableelement~EditableElement#isReadOnly} is `false`,
276
+ * * sets the `contenteditable` attribute to `true` when
277
+ * {@link module:engine/view/editableelement~ViewEditableElement#isReadOnly} is `false`,
277
278
  * otherwise sets it to `false`,
278
279
  * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
279
280
  * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
@@ -693,7 +694,7 @@ const PLUGIN_DISABLED_EDITING_ROOT_CLASS = 'ck-widget__type-around_disabled';
693
694
  * Creates a listener in the editing conversion pipeline that injects the widget type around
694
695
  * UI into every single widget instance created in the editor.
695
696
  *
696
- * The UI is delivered as a {@link module:engine/view/uielement~UIElement}
697
+ * The UI is delivered as a {@link module:engine/view/uielement~ViewUIElement}
697
698
  * wrapper which renders DOM buttons that users can use to insert paragraphs.
698
699
  */ _enableTypeAroundUIInjection() {
699
700
  const editor = this.editor;
@@ -1485,7 +1486,7 @@ function selectionWillShrink(selection, isForward) {
1485
1486
  *
1486
1487
  * * The model to view selection converter for the editing pipeline (it handles widget custom selection rendering).
1487
1488
  * If a converted selection wraps around a widget element, that selection is marked as
1488
- * {@link module:engine/view/selection~Selection#isFake fake}. Additionally, the `ck-widget_selected` CSS class
1489
+ * {@link module:engine/view/selection~ViewSelection#isFake fake}. Additionally, the `ck-widget_selected` CSS class
1489
1490
  * is added to indicate that widget has been selected.
1490
1491
  * * The mouse and keyboard events handling on and around widget elements.
1491
1492
  */ class Widget extends Plugin {
@@ -1707,7 +1708,7 @@ function selectionWillShrink(selection, isForward) {
1707
1708
  });
1708
1709
  }
1709
1710
  /**
1710
- * Handles {@link module:engine/view/document~Document#event:mousedown mousedown} events on widget elements.
1711
+ * Handles {@link module:engine/view/document~ViewDocument#event:mousedown mousedown} events on widget elements.
1711
1712
  */ _onMousedown(eventInfo, domEventData) {
1712
1713
  const editor = this.editor;
1713
1714
  const view = editor.editing.view;
@@ -1776,7 +1777,7 @@ function selectionWillShrink(selection, isForward) {
1776
1777
  return true;
1777
1778
  }
1778
1779
  /**
1779
- * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and changes
1780
+ * Handles {@link module:engine/view/document~ViewDocument#event:keydown keydown} events and changes
1780
1781
  * the model selection when:
1781
1782
  *
1782
1783
  * * arrow key is pressed when the widget is selected,
@@ -1838,7 +1839,7 @@ function selectionWillShrink(selection, isForward) {
1838
1839
  }
1839
1840
  }
1840
1841
  /**
1841
- * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and prevents
1842
+ * Handles {@link module:engine/view/document~ViewDocument#event:keydown keydown} events and prevents
1842
1843
  * the default browser behavior to make sure the fake selection is not being moved from a fake selection
1843
1844
  * container.
1844
1845
  *
@@ -1885,7 +1886,7 @@ function selectionWillShrink(selection, isForward) {
1885
1886
  }
1886
1887
  }
1887
1888
  /**
1888
- * Sets {@link module:engine/model/selection~Selection document's selection} over given element.
1889
+ * Sets {@link module:engine/model/selection~ModelSelection document's selection} over given element.
1889
1890
  *
1890
1891
  * @internal
1891
1892
  */ _setSelectionOverElement(element) {
@@ -1894,9 +1895,9 @@ function selectionWillShrink(selection, isForward) {
1894
1895
  });
1895
1896
  }
1896
1897
  /**
1897
- * Checks if {@link module:engine/model/element~Element element} placed next to the current
1898
- * {@link module:engine/model/selection~Selection model selection} exists and is marked in
1899
- * {@link module:engine/model/schema~Schema schema} as `object`.
1898
+ * Checks if {@link module:engine/model/element~ModelElement element} placed next to the current
1899
+ * {@link module:engine/model/selection~ModelSelection model selection} exists and is marked in
1900
+ * {@link module:engine/model/schema~ModelSchema schema} as `object`.
1900
1901
  *
1901
1902
  * @internal
1902
1903
  * @param forward Direction of checking.
@@ -2059,7 +2060,7 @@ function selectionWillShrink(selection, isForward) {
2059
2060
  /**
2060
2061
  * Returns next text block where could put selection.
2061
2062
  */ function findNextTextBlock(position, schema) {
2062
- const treeWalker = new TreeWalker({
2063
+ const treeWalker = new ModelTreeWalker({
2063
2064
  startPosition: position
2064
2065
  });
2065
2066
  for (const { item } of treeWalker){