@ckeditor/ckeditor5-ui 48.2.0-alpha.7 → 48.3.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.
- package/dist/arialiveannouncer.d.ts +90 -90
- package/dist/augmentation.d.ts +86 -86
- package/dist/autocomplete/autocompleteview.d.ts +70 -70
- package/dist/badge/badge.d.ts +119 -121
- package/dist/bindings/addkeyboardhandlingforgrid.d.ts +22 -22
- package/dist/bindings/clickoutsidehandler.d.ts +25 -25
- package/dist/bindings/csstransitiondisablermixin.d.ts +47 -36
- package/dist/bindings/draggableviewmixin.d.ts +45 -37
- package/dist/bindings/preventdefault.d.ts +30 -30
- package/dist/bindings/submithandler.d.ts +49 -49
- package/dist/button/button.d.ts +167 -167
- package/dist/button/buttonlabel.d.ts +28 -28
- package/dist/button/buttonlabelview.d.ts +26 -26
- package/dist/button/buttonview.d.ts +192 -192
- package/dist/button/filedialogbuttonview.d.ts +107 -99
- package/dist/button/listitembuttonview.d.ts +73 -73
- package/dist/button/switchbuttonview.d.ts +40 -40
- package/dist/collapsible/collapsibleview.d.ts +63 -63
- package/dist/colorgrid/colorgridview.d.ts +117 -117
- package/dist/colorgrid/colortileview.d.ts +21 -21
- package/dist/colorgrid/utils.d.ts +35 -35
- package/dist/colorpicker/colorpickerview.d.ts +155 -157
- package/dist/colorpicker/utils.d.ts +37 -37
- package/dist/colorselector/colorgridsfragmentview.d.ts +191 -191
- package/dist/colorselector/colorpickerfragmentview.d.ts +129 -129
- package/dist/colorselector/colorselectorview.d.ts +227 -229
- package/dist/colorselector/documentcolorcollection.d.ts +52 -59
- package/dist/componentfactory.d.ts +76 -76
- package/dist/dialog/dialog.d.ts +311 -288
- package/dist/dialog/dialogactionsview.d.ts +62 -62
- package/dist/dialog/dialogcontentview.d.ts +22 -22
- package/dist/dialog/dialogview.d.ts +255 -251
- package/dist/dropdown/button/dropdownbutton.d.ts +17 -17
- package/dist/dropdown/button/dropdownbuttonview.d.ts +41 -41
- package/dist/dropdown/button/splitbuttonview.d.ts +155 -155
- package/dist/dropdown/dropdownpanelfocusable.d.ts +16 -16
- package/dist/dropdown/dropdownpanelview.d.ts +56 -56
- package/dist/dropdown/dropdownview.d.ts +326 -326
- package/dist/dropdown/menu/dropdownmenubehaviors.d.ts +43 -43
- package/dist/dropdown/menu/dropdownmenubuttonview.d.ts +29 -29
- package/dist/dropdown/menu/dropdownmenulistitembuttonview.d.ts +12 -12
- package/dist/dropdown/menu/dropdownmenulistitemview.d.ts +17 -17
- package/dist/dropdown/menu/dropdownmenulistview.d.ts +19 -19
- package/dist/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +28 -28
- package/dist/dropdown/menu/dropdownmenunestedmenuview.d.ts +126 -126
- package/dist/dropdown/menu/dropdownmenurootlistview.d.ts +132 -132
- package/dist/dropdown/menu/utils.d.ts +112 -112
- package/dist/dropdown/utils.d.ts +272 -272
- package/dist/editableui/editableuiview.d.ts +78 -78
- package/dist/editableui/inline/inlineeditableuiview.d.ts +38 -38
- package/dist/editorui/accessibilityhelp/accessibilityhelp.d.ts +50 -50
- package/dist/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +30 -30
- package/dist/editorui/bodycollection.d.ts +86 -86
- package/dist/editorui/boxed/boxededitoruiview.d.ts +35 -35
- package/dist/editorui/editorui.d.ts +348 -351
- package/dist/editorui/editoruiview.d.ts +53 -53
- package/dist/editorui/evaluationbadge.d.ts +28 -28
- package/dist/editorui/poweredby.d.ts +25 -25
- package/dist/focuscycler.d.ts +265 -270
- package/dist/formheader/formheaderview.d.ts +53 -53
- package/dist/formrow/formrowview.d.ts +52 -52
- package/dist/highlightedtext/buttonlabelwithhighlightview.d.ts +25 -25
- package/dist/highlightedtext/highlightedtextview.d.ts +33 -33
- package/dist/highlightedtext/labelwithhighlightview.d.ts +21 -21
- package/dist/icon/iconview.d.ts +83 -83
- package/dist/iframe/iframeview.d.ts +42 -42
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +136 -136
- package/dist/index.js +16467 -17751
- package/dist/index.js.map +1 -1
- package/dist/input/inputbase.d.ts +114 -114
- package/dist/input/inputview.d.ts +28 -28
- package/dist/inputnumber/inputnumberview.d.ts +44 -44
- package/dist/inputtext/inputtextview.d.ts +13 -13
- package/dist/label/labelview.d.ts +31 -31
- package/dist/labeledfield/labeledfieldview.d.ts +180 -180
- package/dist/labeledfield/utils.d.ts +112 -112
- package/dist/labeledinput/labeledinputview.d.ts +120 -120
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/list/listitemgroupview.d.ts +54 -54
- package/dist/list/listitemview.d.ts +31 -31
- package/dist/list/listseparatorview.d.ts +13 -13
- package/dist/list/listview.d.ts +119 -119
- package/dist/menubar/menubarmenubuttonview.d.ts +28 -28
- package/dist/menubar/menubarmenulistitembuttonview.d.ts +16 -16
- package/dist/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +18 -18
- package/dist/menubar/menubarmenulistitemview.d.ts +20 -20
- package/dist/menubar/menubarmenulistview.d.ts +24 -24
- package/dist/menubar/menubarmenupanelview.d.ts +47 -47
- package/dist/menubar/menubarmenuview.d.ts +113 -113
- package/dist/menubar/menubarview.d.ts +145 -145
- package/dist/menubar/utils.d.ts +455 -455
- package/dist/model.d.ts +19 -18
- package/dist/notification/notification.d.ts +200 -200
- package/dist/panel/balloon/balloonpanelview.d.ts +692 -692
- package/dist/panel/balloon/contextualballoon.d.ts +298 -298
- package/dist/panel/sticky/stickypanelview.d.ts +151 -151
- package/dist/search/filteredview.d.ts +23 -23
- package/dist/search/filtergroupanditemnames.d.ts +11 -11
- package/dist/search/searchinfoview.d.ts +39 -39
- package/dist/search/searchresultsview.d.ts +49 -49
- package/dist/search/text/searchtextqueryview.d.ts +63 -63
- package/dist/search/text/searchtextview.d.ts +203 -203
- package/dist/spinner/spinnerview.d.ts +20 -20
- package/dist/template.d.ts +897 -902
- package/dist/textarea/textareaview.d.ts +96 -96
- package/dist/toolbar/balloon/balloontoolbar.d.ts +122 -122
- package/dist/toolbar/block/blockbuttonview.d.ts +30 -30
- package/dist/toolbar/block/blocktoolbar.d.ts +166 -166
- package/dist/toolbar/normalizetoolbarconfig.d.ts +35 -35
- package/dist/toolbar/toolbarlinebreakview.d.ts +13 -13
- package/dist/toolbar/toolbarseparatorview.d.ts +13 -13
- package/dist/toolbar/toolbarview.d.ts +271 -271
- package/dist/tooltipmanager.d.ts +190 -193
- package/dist/view.d.ts +385 -388
- package/dist/viewcollection.d.ts +134 -134
- package/package.json +6 -6
package/dist/badge/badge.d.ts
CHANGED
|
@@ -1,129 +1,127 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import type { Editor } from
|
|
9
|
-
import { type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
prototype: import("@ckeditor/ckeditor5-utils").DomEmitter;
|
|
13
|
-
};
|
|
6
|
+
* @module ui/badge/badge
|
|
7
|
+
*/
|
|
8
|
+
import type { Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { type DomEmitterMixinConstructor } from "@ckeditor/ckeditor5-utils";
|
|
10
|
+
import { type View } from "../view.js";
|
|
11
|
+
declare const BadgeBase: DomEmitterMixinConstructor;
|
|
14
12
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export declare abstract class Badge extends
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
13
|
+
* A helper that enables the badge feature in the editor and renders a custom view next to the bottom of the editable element
|
|
14
|
+
* (editor root, source editing area, etc.) when the editor is focused.
|
|
15
|
+
*
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class Badge extends BadgeBase {
|
|
19
|
+
/**
|
|
20
|
+
* Editor instance the helper was created for.
|
|
21
|
+
*/
|
|
22
|
+
protected readonly editor: Editor;
|
|
23
|
+
/**
|
|
24
|
+
* A reference to the balloon panel hosting and positioning the badge content.
|
|
25
|
+
*/
|
|
26
|
+
private _balloonView;
|
|
27
|
+
/**
|
|
28
|
+
* A throttled version of the {@link #_showBalloon} method meant for frequent use to avoid performance loss.
|
|
29
|
+
*/
|
|
30
|
+
private _showBalloonThrottled;
|
|
31
|
+
/**
|
|
32
|
+
* A reference to the last editable element (root, source editing area, etc.) focused by the user.
|
|
33
|
+
* Since the focus can move to other focusable elements in the UI, this reference allows positioning the balloon over the
|
|
34
|
+
* right element whether the user is typing or using the UI.
|
|
35
|
+
*/
|
|
36
|
+
private _lastFocusedEditableElement;
|
|
37
|
+
/**
|
|
38
|
+
* An additional CSS class added to the `BalloonView`.
|
|
39
|
+
*/
|
|
40
|
+
private readonly _balloonClass;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a badge for a given editor. The feature is initialized on Editor#ready
|
|
43
|
+
* event.
|
|
44
|
+
*/
|
|
45
|
+
protected constructor(editor: Editor, options?: {
|
|
46
|
+
balloonClass?: string;
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Destroys the badge along with its view.
|
|
50
|
+
*/
|
|
51
|
+
destroy(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Enables badge label once the editor (ui) is ready.
|
|
54
|
+
*/
|
|
55
|
+
protected _handleEditorReady(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Returns normalized configuration for the badge.
|
|
58
|
+
*/
|
|
59
|
+
protected _getNormalizedConfig(): BadgeConfig;
|
|
60
|
+
/**
|
|
61
|
+
* Creates the badge content.
|
|
62
|
+
*/
|
|
63
|
+
protected abstract _createBadgeContent(): View<HTMLElement>;
|
|
64
|
+
/**
|
|
65
|
+
* Enables the badge feature.
|
|
66
|
+
*/
|
|
67
|
+
protected abstract _isEnabled(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Attempts to display the balloon with the badge view.
|
|
70
|
+
*/
|
|
71
|
+
private _showBalloon;
|
|
72
|
+
/**
|
|
73
|
+
* Hides the badge balloon if already visible.
|
|
74
|
+
*/
|
|
75
|
+
private _hideBalloon;
|
|
76
|
+
/**
|
|
77
|
+
* Creates an instance of the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon panel}
|
|
78
|
+
* with the badge view inside ready for positioning.
|
|
79
|
+
*/
|
|
80
|
+
private _createBalloonView;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the options for attaching the balloon to the focused editable element.
|
|
83
|
+
*/
|
|
84
|
+
private _getBalloonAttachOptions;
|
|
85
|
+
/**
|
|
86
|
+
* Updates the {@link #_lastFocusedEditableElement} based on the state of the global focus tracker.
|
|
87
|
+
*/
|
|
88
|
+
private _updateLastFocusedEditableElement;
|
|
91
89
|
}
|
|
92
90
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
* The badge configuration options.
|
|
92
|
+
**/
|
|
95
93
|
export interface BadgeConfig {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
94
|
+
/**
|
|
95
|
+
* The position of the badge.
|
|
96
|
+
*
|
|
97
|
+
* * When `'inside'`, the badge will be displayed within the boundaries of the editing area.
|
|
98
|
+
* * When `'border'`, the basge will be displayed over the bottom border of the editing area.
|
|
99
|
+
*
|
|
100
|
+
* @default 'border'
|
|
101
|
+
*/
|
|
102
|
+
position: "inside" | "border";
|
|
103
|
+
/**
|
|
104
|
+
* Allows choosing the side of the editing area where the badge will be displayed.
|
|
105
|
+
*
|
|
106
|
+
* **Note:** If {@link module:core/editor/editorconfig~EditorConfig#language `config.language`} is set to an RTL (right-to-left)
|
|
107
|
+
* language, the side switches to `'left'` by default.
|
|
108
|
+
*
|
|
109
|
+
* @default 'right'
|
|
110
|
+
*/
|
|
111
|
+
side: "left" | "right";
|
|
112
|
+
/**
|
|
113
|
+
* The vertical distance the badge can be moved away from its default position.
|
|
114
|
+
*
|
|
115
|
+
* **Note:** If `position` is `'border'`, the offset is measured from the (vertical) center of the badge.
|
|
116
|
+
*
|
|
117
|
+
* @default 5
|
|
118
|
+
*/
|
|
119
|
+
verticalOffset: number;
|
|
120
|
+
/**
|
|
121
|
+
* The horizontal distance between the side of the editing root and the nearest side of the badge.
|
|
122
|
+
*
|
|
123
|
+
* @default 5
|
|
124
|
+
*/
|
|
125
|
+
horizontalOffset: number;
|
|
128
126
|
}
|
|
129
127
|
export {};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import type { FocusTracker, KeystrokeHandler } from
|
|
9
|
-
import { type ViewCollection } from
|
|
6
|
+
* @module ui/bindings/addkeyboardhandlingforgrid
|
|
7
|
+
*/
|
|
8
|
+
import type { FocusTracker, KeystrokeHandler } from "@ckeditor/ckeditor5-utils";
|
|
9
|
+
import { type ViewCollection } from "../viewcollection.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
* A helper that adds a keyboard navigation support (arrow up/down/left/right) for grids.
|
|
12
|
+
*
|
|
13
|
+
* @param options Configuration options.
|
|
14
|
+
* @param options.keystrokeHandler Keystroke handler to register navigation with arrow keys.
|
|
15
|
+
* @param options.focusTracker A focus tracker for grid elements.
|
|
16
|
+
* @param options.gridItems A collection of grid items.
|
|
17
|
+
* @param options.numberOfColumns Number of columns in the grid. Can be specified as a function that returns
|
|
18
|
+
* the number (e.g. for responsive grids).
|
|
19
|
+
* @param options.uiLanguageDirection String of ui language direction.
|
|
20
|
+
*/
|
|
21
21
|
export declare function addKeyboardHandlingForGrid({ keystrokeHandler, focusTracker, gridItems, numberOfColumns, uiLanguageDirection }: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
keystrokeHandler: KeystrokeHandler;
|
|
23
|
+
focusTracker: FocusTracker;
|
|
24
|
+
gridItems: ViewCollection;
|
|
25
|
+
numberOfColumns: number | (() => number);
|
|
26
|
+
uiLanguageDirection?: string;
|
|
27
27
|
}): void;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import type { CallbackOptions, DomEmitter } from
|
|
6
|
+
* @module ui/bindings/clickoutsidehandler
|
|
7
|
+
*/
|
|
8
|
+
import type { CallbackOptions, DomEmitter } from "@ckeditor/ckeditor5-utils";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
* Handles clicking **outside** of a specified set of elements, then fires an action.
|
|
11
|
+
*
|
|
12
|
+
* **Note**: Actually, the action is executed upon `mousedown`, not `click`. It prevents
|
|
13
|
+
* certain issues when the user keeps holding the mouse button and the UI cannot react
|
|
14
|
+
* properly.
|
|
15
|
+
*
|
|
16
|
+
* @param options Configuration options.
|
|
17
|
+
* @param options.emitter The emitter to which this behavior should be added.
|
|
18
|
+
* @param options.activator Function returning a `Boolean`, to determine whether the handler is active.
|
|
19
|
+
* @param options.contextElements Array of HTML elements or a callback returning an array of HTML elements
|
|
20
|
+
* that determine the scope of the handler. Clicking any of them or their descendants will **not** fire the callback.
|
|
21
|
+
* @param options.callback An action executed by the handler.
|
|
22
|
+
* @param options.listenerOptions Additional options for the listener (like priority).
|
|
23
|
+
*/
|
|
24
24
|
export declare function clickOutsideHandler({ emitter, activator, callback, contextElements, listenerOptions }: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
emitter: DomEmitter;
|
|
26
|
+
activator: () => boolean;
|
|
27
|
+
contextElements: Array<Element> | (() => Array<Element>);
|
|
28
|
+
callback: () => void;
|
|
29
|
+
listenerOptions?: CallbackOptions;
|
|
30
30
|
}): void;
|
|
@@ -1,41 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import type { Constructor, Mixed } from
|
|
9
|
-
import { type View } from
|
|
6
|
+
* @module ui/bindings/csstransitiondisablermixin
|
|
7
|
+
*/
|
|
8
|
+
import type { Constructor, Mixed } from "@ckeditor/ckeditor5-utils";
|
|
9
|
+
import { type View } from "../view.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
* Constructor returned by {@link ~CssTransitionDisablerMixin}. Use it to name a mixin base class before extending it.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* const MyCssTransitionDisablerBase: CssTransitionDisablerMixinConstructor<typeof BaseClass> =
|
|
15
|
+
* CssTransitionDisablerMixin( BaseClass );
|
|
16
|
+
*
|
|
17
|
+
* class MyCssTransitionDisabler extends MyCssTransitionDisablerBase {}
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export type CssTransitionDisablerMixinConstructor<Base extends Constructor<View>> = Mixed<Base, ViewWithCssTransitionDisabler>;
|
|
21
|
+
/**
|
|
22
|
+
* A mixin that brings the possibility to temporarily disable CSS transitions using
|
|
23
|
+
* {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen
|
|
24
|
+
* when the view is first displayed but they should work normal in other cases.
|
|
25
|
+
*
|
|
26
|
+
* The methods to control the CSS transitions are:
|
|
27
|
+
* * `disableCssTransitions()` – Adds the `.ck-transitions-disabled` class to the
|
|
28
|
+
* {@link module:ui/view~View#element view element}.
|
|
29
|
+
* * `enableCssTransitions()` – Removes the `.ck-transitions-disabled` class from the
|
|
30
|
+
* {@link module:ui/view~View#element view element}.
|
|
31
|
+
*
|
|
32
|
+
* The usage comes down to:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* const MyViewWithCssTransitionDisabler = CssTransitionDisablerMixin( MyView );
|
|
36
|
+
* const view = new MyViewWithCssTransitionDisabler();
|
|
37
|
+
*
|
|
38
|
+
* // ...
|
|
39
|
+
*
|
|
40
|
+
* view.disableCssTransitions();
|
|
41
|
+
* view.show();
|
|
42
|
+
* view.enableCssTransitions();
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @param view View instance that should get this functionality.
|
|
46
|
+
*/
|
|
47
|
+
export declare function CssTransitionDisablerMixin<Base extends Constructor<View>>(view: Base): CssTransitionDisablerMixinConstructor<Base>;
|
|
37
48
|
export declare class ViewWithCssTransitionDisabler extends View {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
disableCssTransitions(): void;
|
|
50
|
+
enableCssTransitions(): void;
|
|
51
|
+
protected initializeCssTransitionDisablerMixin(): void;
|
|
41
52
|
}
|
|
@@ -1,46 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { type View } from
|
|
9
|
-
import { type Constructor, type Mixed } from
|
|
6
|
+
* @module ui/bindings/draggableviewmixin
|
|
7
|
+
*/
|
|
8
|
+
import { type View } from "../view.js";
|
|
9
|
+
import { type Constructor, type Mixed } from "@ckeditor/ckeditor5-utils";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* Creating a class extending it attaches a set of mouse and touch listeners allowing to observe dragging of the view element:
|
|
21
|
-
* * `mousedown` and `touchstart` on the view element - starting the dragging.
|
|
22
|
-
* * `mousemove` and `touchmove` on the document - updating the view coordinates.
|
|
23
|
-
* * `mouseup` and `touchend` on the document - stopping the dragging.
|
|
24
|
-
*
|
|
25
|
-
* The mixin itself does not provide a visual feedback (that is, the dragged element does not change its position) -
|
|
26
|
-
* it is up to the developer to implement it.
|
|
27
|
-
*/
|
|
28
|
-
export declare function DraggableViewMixin<Base extends Constructor<View>>(view: Base): Mixed<Base, DraggableView>;
|
|
11
|
+
* Constructor returned by {@link ~DraggableViewMixin}. Use it to name a mixin base class before extending it.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* const MyDraggableViewBase: DraggableViewMixinConstructor<typeof BaseClass> = DraggableViewMixin( BaseClass );
|
|
15
|
+
*
|
|
16
|
+
* class MyDraggableView extends MyDraggableViewBase {}
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export type DraggableViewMixinConstructor<Base extends Constructor<View>> = Mixed<Base, DraggableView>;
|
|
29
20
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
* A mixin that brings the possibility to observe dragging of the view element.
|
|
22
|
+
* The view has to implement the {@link ~DraggableView} interface to use it:
|
|
23
|
+
*
|
|
24
|
+
* ```js
|
|
25
|
+
* export class MyDraggableView extends DraggableViewMixin( View ) implements DraggableView {
|
|
26
|
+
* // ...
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Creating a class extending it attaches a set of mouse and touch listeners allowing to observe dragging of the view element:
|
|
31
|
+
* * `mousedown` and `touchstart` on the view element - starting the dragging.
|
|
32
|
+
* * `mousemove` and `touchmove` on the document - updating the view coordinates.
|
|
33
|
+
* * `mouseup` and `touchend` on the document - stopping the dragging.
|
|
34
|
+
*
|
|
35
|
+
* The mixin itself does not provide a visual feedback (that is, the dragged element does not change its position) -
|
|
36
|
+
* it is up to the developer to implement it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function DraggableViewMixin<Base extends Constructor<View>>(view: Base): DraggableViewMixinConstructor<Base>;
|
|
39
|
+
/**
|
|
40
|
+
* An interface that should be implemented by views that want to be draggable.
|
|
41
|
+
*/
|
|
32
42
|
export interface DraggableView extends View {
|
|
33
|
-
|
|
43
|
+
get dragHandleElement(): HTMLElement | null;
|
|
34
44
|
}
|
|
35
45
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
* An event data object for the {@link ~DraggableView} `drag` event. Fired when the view is dragged.
|
|
47
|
+
*/
|
|
38
48
|
export type DraggableViewDragEvent = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
];
|
|
49
|
+
name: "drag";
|
|
50
|
+
args: [{
|
|
51
|
+
deltaX: number;
|
|
52
|
+
deltaY: number;
|
|
53
|
+
}];
|
|
46
54
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import type { ListenerBinding } from
|
|
9
|
-
import { type View } from
|
|
6
|
+
* @module ui/bindings/preventdefault
|
|
7
|
+
*/
|
|
8
|
+
import type { ListenerBinding } from "../template.js";
|
|
9
|
+
import { type View } from "../view.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
* A helper which executes a native `Event.preventDefault()` if the target of an event equals the
|
|
12
|
+
* {@link module:ui/view~View#element element of the view}. It shortens the definition of a
|
|
13
|
+
* {@link module:ui/view~View#template template}.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* // In a class extending View.
|
|
17
|
+
* import { preventDefault } from '@ckeditor/ckeditor5-ui/src/bindings/preventdefault';
|
|
18
|
+
*
|
|
19
|
+
* // ...
|
|
20
|
+
*
|
|
21
|
+
* this.setTemplate( {
|
|
22
|
+
* tag: 'div',
|
|
23
|
+
*
|
|
24
|
+
* on: {
|
|
25
|
+
* // Prevent the default mousedown action on this view.
|
|
26
|
+
* mousedown: preventDefault( this )
|
|
27
|
+
* }
|
|
28
|
+
* } );
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @param view View instance that defines the template.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
34
|
export declare function preventDefault(view: View): ListenerBinding;
|