@ckeditor/ckeditor5-widget 0.0.0-nightly-20250613.0 → 0.0.0-nightly-20250614.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 +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/highlightstack.d.ts +7 -7
- package/src/highlightstack.js +1 -1
- package/src/index.d.ts +5 -2
- package/src/index.js +4 -1
- package/src/utils.d.ts +1 -1
- package/src/utils.js +3 -3
- package/src/verticalnavigation.d.ts +1 -1
- package/src/verticalnavigation.js +1 -1
- package/src/widget.js +2 -2
- package/src/widgetresize/resizer.d.ts +13 -13
- package/src/widgetresize/resizer.js +2 -2
- package/src/widgetresize/resizerstate.d.ts +2 -2
- package/src/widgetresize/sizeview.d.ts +2 -2
- package/src/widgetresize.d.ts +8 -8
- package/src/widgetresize.js +3 -3
package/dist/index.js
CHANGED
@@ -21,7 +21,7 @@ import { throttle } from 'es-toolkit/compat';
|
|
21
21
|
* {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
|
22
22
|
*
|
23
23
|
* This way, highlight will be applied with the same rules it is applied on texts.
|
24
|
-
*/ class
|
24
|
+
*/ class WidgetHighlightStack extends /* #__PURE__ */ EmitterMixin() {
|
25
25
|
_stack = [];
|
26
26
|
/**
|
27
27
|
* Adds highlight descriptor to the stack.
|
@@ -233,10 +233,10 @@ import { throttle } from 'es-toolkit/compat';
|
|
233
233
|
}
|
234
234
|
}
|
235
235
|
/**
|
236
|
-
* Sets highlight handling methods. Uses {@link module:widget/highlightstack~
|
236
|
+
* Sets highlight handling methods. Uses {@link module:widget/highlightstack~WidgetHighlightStack} to
|
237
237
|
* properly determine which highlight descriptor should be used at given time.
|
238
238
|
*/ function setHighlightHandling(element, writer, add = addHighlight, remove = removeHighlight) {
|
239
|
-
const stack = new
|
239
|
+
const stack = new WidgetHighlightStack();
|
240
240
|
stack.on('change:top', (evt, data)=>{
|
241
241
|
if (data.oldDescriptor) {
|
242
242
|
remove(element, data.oldDescriptor, data.writer);
|
@@ -1295,7 +1295,7 @@ function injectFakeCaret(wrapperDomElement) {
|
|
1295
1295
|
* Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.
|
1296
1296
|
*
|
1297
1297
|
* @param editing The editing controller.
|
1298
|
-
*/ function
|
1298
|
+
*/ function verticalWidgetNavigationHandler(editing) {
|
1299
1299
|
const model = editing.model;
|
1300
1300
|
return (evt, data)=>{
|
1301
1301
|
const arrowUpPressed = data.keyCode == keyCodes.arrowup;
|
@@ -1610,7 +1610,7 @@ function selectionWillShrink(selection, isForward) {
|
|
1610
1610
|
}, {
|
1611
1611
|
context: '$root'
|
1612
1612
|
});
|
1613
|
-
this.listenTo(viewDocument, 'arrowKey',
|
1613
|
+
this.listenTo(viewDocument, 'arrowKey', verticalWidgetNavigationHandler(this.editor.editing), {
|
1614
1614
|
context: '$text'
|
1615
1615
|
});
|
1616
1616
|
// Handle custom delete behaviour.
|
@@ -2533,7 +2533,7 @@ function isWidgetSelected(selection) {
|
|
2533
2533
|
|
2534
2534
|
/**
|
2535
2535
|
* Represents a resizer for a single resizable object.
|
2536
|
-
*/ class
|
2536
|
+
*/ class WidgetResizer extends /* #__PURE__ */ ObservableMixin() {
|
2537
2537
|
/**
|
2538
2538
|
* Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.
|
2539
2539
|
*
|
@@ -2549,7 +2549,7 @@ function isWidgetSelected(selection) {
|
|
2549
2549
|
* A wrapper that is controlled by the resizer. This is usually a widget element.
|
2550
2550
|
*/ _viewResizerWrapper = null;
|
2551
2551
|
/**
|
2552
|
-
* The width of the resized {@link module:widget/widgetresize~
|
2552
|
+
* The width of the resized {@link module:widget/widgetresize~WidgetResizerOptions#viewElement viewElement} before the resizing started.
|
2553
2553
|
*/ _initialViewWidth;
|
2554
2554
|
/**
|
2555
2555
|
* @param options Resizer options.
|
@@ -2984,7 +2984,7 @@ function existsInDom(element) {
|
|
2984
2984
|
/**
|
2985
2985
|
* @param options Resizer options.
|
2986
2986
|
*/ attachTo(options) {
|
2987
|
-
const resizer = new
|
2987
|
+
const resizer = new WidgetResizer(options);
|
2988
2988
|
const plugins = this.editor.plugins;
|
2989
2989
|
resizer.attach();
|
2990
2990
|
if (plugins.has('WidgetToolbarRepository')) {
|
@@ -3036,7 +3036,7 @@ function existsInDom(element) {
|
|
3036
3036
|
* @param domEventData Native DOM event.
|
3037
3037
|
*/ _mouseDownListener(event, domEventData) {
|
3038
3038
|
const resizeHandle = domEventData.domTarget;
|
3039
|
-
if (!
|
3039
|
+
if (!WidgetResizer.isResizeHandle(resizeHandle)) {
|
3040
3040
|
return;
|
3041
3041
|
}
|
3042
3042
|
this._activeResizer = this._getResizerByHandle(resizeHandle) || null;
|
@@ -3062,5 +3062,5 @@ function existsInDom(element) {
|
|
3062
3062
|
}
|
3063
3063
|
}
|
3064
3064
|
|
3065
|
-
export { WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, Widget, WidgetResize, WidgetToolbarRepository, WidgetTypeAround, TYPE_AROUND_SELECTION_ATTRIBUTE as _WIDGET_TYPE_AROUND_SELECTION_ATTRIBUTE, SizeView as _WidgetSizeView, getClosestTypeAroundDomButton as _getClosestWidgetTypeAroundDomButton, getClosestWidgetViewElement as _getClosestWidgetViewElement, getTypeAroundButtonPosition as _getWidgetTypeAroundButtonPosition, getTypeAroundFakeCaretPosition as _getWidgetTypeAroundFakeCaretPosition, calculateResizeHostAncestorWidth, calculateResizeHostPercentageWidth, findOptimalInsertionRange, getLabel, isWidget, setHighlightHandling, setLabel, toWidget, toWidgetEditable, viewToModelPositionOutsideModelElement };
|
3065
|
+
export { WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, Widget, WidgetHighlightStack, WidgetResize, WidgetResizer, WidgetToolbarRepository, WidgetTypeAround, TYPE_AROUND_SELECTION_ATTRIBUTE as _WIDGET_TYPE_AROUND_SELECTION_ATTRIBUTE, SizeView as _WidgetSizeView, getClosestTypeAroundDomButton as _getClosestWidgetTypeAroundDomButton, getClosestWidgetViewElement as _getClosestWidgetViewElement, getTypeAroundButtonPosition as _getWidgetTypeAroundButtonPosition, getTypeAroundFakeCaretPosition as _getWidgetTypeAroundFakeCaretPosition, calculateResizeHostAncestorWidth, calculateResizeHostPercentageWidth, findOptimalInsertionRange, getLabel, isTypeAroundWidget, isWidget, setHighlightHandling, setLabel, toWidget, toWidgetEditable, verticalWidgetNavigationHandler, viewToModelPositionOutsideModelElement };
|
3066
3066
|
//# sourceMappingURL=index.js.map
|