@ckeditor/ckeditor5-widget 44.1.0 → 44.2.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/LICENSE.md +1 -1
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +5 -5
- package/dist/index.css.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/translations/af.d.ts +2 -2
- package/dist/translations/af.js +2 -2
- package/dist/translations/af.umd.js +2 -2
- package/dist/translations/ar.d.ts +2 -2
- package/dist/translations/ar.js +2 -2
- package/dist/translations/ar.umd.js +2 -2
- package/dist/translations/ast.d.ts +2 -2
- package/dist/translations/ast.js +2 -2
- package/dist/translations/ast.umd.js +2 -2
- package/dist/translations/az.d.ts +2 -2
- package/dist/translations/az.js +2 -2
- package/dist/translations/az.umd.js +2 -2
- package/dist/translations/bg.d.ts +2 -2
- package/dist/translations/bg.js +2 -2
- package/dist/translations/bg.umd.js +2 -2
- package/dist/translations/bn.d.ts +2 -2
- package/dist/translations/bn.js +2 -2
- package/dist/translations/bn.umd.js +2 -2
- package/dist/translations/bs.d.ts +2 -2
- package/dist/translations/bs.js +2 -2
- package/dist/translations/bs.umd.js +2 -2
- package/dist/translations/ca.d.ts +2 -2
- package/dist/translations/ca.js +2 -2
- package/dist/translations/ca.umd.js +2 -2
- package/dist/translations/cs.d.ts +2 -2
- package/dist/translations/cs.js +2 -2
- package/dist/translations/cs.umd.js +2 -2
- package/dist/translations/da.d.ts +2 -2
- package/dist/translations/da.js +2 -2
- package/dist/translations/da.umd.js +2 -2
- package/dist/translations/de-ch.d.ts +2 -2
- package/dist/translations/de-ch.js +2 -2
- package/dist/translations/de-ch.umd.js +2 -2
- package/dist/translations/de.d.ts +2 -2
- package/dist/translations/de.js +2 -2
- package/dist/translations/de.umd.js +2 -2
- package/dist/translations/el.d.ts +2 -2
- package/dist/translations/el.js +2 -2
- package/dist/translations/el.umd.js +2 -2
- package/dist/translations/en-au.d.ts +2 -2
- package/dist/translations/en-au.js +2 -2
- package/dist/translations/en-au.umd.js +2 -2
- package/dist/translations/en-gb.d.ts +2 -2
- package/dist/translations/en-gb.js +2 -2
- package/dist/translations/en-gb.umd.js +2 -2
- package/dist/translations/en.d.ts +2 -2
- package/dist/translations/en.js +2 -2
- package/dist/translations/en.umd.js +2 -2
- package/dist/translations/eo.d.ts +2 -2
- package/dist/translations/eo.js +2 -2
- package/dist/translations/eo.umd.js +2 -2
- package/dist/translations/es-co.d.ts +2 -2
- package/dist/translations/es-co.js +2 -2
- package/dist/translations/es-co.umd.js +2 -2
- package/dist/translations/es.d.ts +2 -2
- package/dist/translations/es.js +2 -2
- package/dist/translations/es.umd.js +2 -2
- package/dist/translations/et.d.ts +2 -2
- package/dist/translations/et.js +2 -2
- package/dist/translations/et.umd.js +2 -2
- package/dist/translations/eu.d.ts +2 -2
- package/dist/translations/eu.js +2 -2
- package/dist/translations/eu.umd.js +2 -2
- package/dist/translations/fa.d.ts +2 -2
- package/dist/translations/fa.js +2 -2
- package/dist/translations/fa.umd.js +2 -2
- package/dist/translations/fi.d.ts +2 -2
- package/dist/translations/fi.js +2 -2
- package/dist/translations/fi.umd.js +2 -2
- package/dist/translations/fr.d.ts +2 -2
- package/dist/translations/fr.js +2 -2
- package/dist/translations/fr.umd.js +2 -2
- package/dist/translations/gl.d.ts +2 -2
- package/dist/translations/gl.js +2 -2
- package/dist/translations/gl.umd.js +2 -2
- package/dist/translations/gu.d.ts +2 -2
- package/dist/translations/gu.js +2 -2
- package/dist/translations/gu.umd.js +2 -2
- package/dist/translations/he.d.ts +2 -2
- package/dist/translations/he.js +2 -2
- package/dist/translations/he.umd.js +2 -2
- package/dist/translations/hi.d.ts +2 -2
- package/dist/translations/hi.js +2 -2
- package/dist/translations/hi.umd.js +2 -2
- package/dist/translations/hr.d.ts +2 -2
- package/dist/translations/hr.js +2 -2
- package/dist/translations/hr.umd.js +2 -2
- package/dist/translations/hu.d.ts +2 -2
- package/dist/translations/hu.js +2 -2
- package/dist/translations/hu.umd.js +2 -2
- package/dist/translations/hy.d.ts +2 -2
- package/dist/translations/hy.js +2 -2
- package/dist/translations/hy.umd.js +2 -2
- package/dist/translations/id.d.ts +2 -2
- package/dist/translations/id.js +2 -2
- package/dist/translations/id.umd.js +2 -2
- package/dist/translations/it.d.ts +2 -2
- package/dist/translations/it.js +2 -2
- package/dist/translations/it.umd.js +2 -2
- package/dist/translations/ja.d.ts +2 -2
- package/dist/translations/ja.js +2 -2
- package/dist/translations/ja.umd.js +2 -2
- package/dist/translations/jv.d.ts +2 -2
- package/dist/translations/jv.js +2 -2
- package/dist/translations/jv.umd.js +2 -2
- package/dist/translations/kk.d.ts +2 -2
- package/dist/translations/kk.js +2 -2
- package/dist/translations/kk.umd.js +2 -2
- package/dist/translations/km.d.ts +2 -2
- package/dist/translations/km.js +2 -2
- package/dist/translations/km.umd.js +2 -2
- package/dist/translations/kn.d.ts +2 -2
- package/dist/translations/kn.js +2 -2
- package/dist/translations/kn.umd.js +2 -2
- package/dist/translations/ko.d.ts +2 -2
- package/dist/translations/ko.js +2 -2
- package/dist/translations/ko.umd.js +2 -2
- package/dist/translations/ku.d.ts +2 -2
- package/dist/translations/ku.js +2 -2
- package/dist/translations/ku.umd.js +2 -2
- package/dist/translations/lt.d.ts +2 -2
- package/dist/translations/lt.js +2 -2
- package/dist/translations/lt.umd.js +2 -2
- package/dist/translations/lv.d.ts +2 -2
- package/dist/translations/lv.js +2 -2
- package/dist/translations/lv.umd.js +2 -2
- package/dist/translations/ms.d.ts +2 -2
- package/dist/translations/ms.js +2 -2
- package/dist/translations/ms.umd.js +2 -2
- package/dist/translations/nb.d.ts +2 -2
- package/dist/translations/nb.js +2 -2
- package/dist/translations/nb.umd.js +2 -2
- package/dist/translations/ne.d.ts +2 -2
- package/dist/translations/ne.js +2 -2
- package/dist/translations/ne.umd.js +2 -2
- package/dist/translations/nl.d.ts +2 -2
- package/dist/translations/nl.js +2 -2
- package/dist/translations/nl.umd.js +2 -2
- package/dist/translations/no.d.ts +2 -2
- package/dist/translations/no.js +2 -2
- package/dist/translations/no.umd.js +2 -2
- package/dist/translations/oc.d.ts +2 -2
- package/dist/translations/oc.js +2 -2
- package/dist/translations/oc.umd.js +2 -2
- package/dist/translations/pl.d.ts +2 -2
- package/dist/translations/pl.js +2 -2
- package/dist/translations/pl.umd.js +2 -2
- package/dist/translations/pt-br.d.ts +2 -2
- package/dist/translations/pt-br.js +2 -2
- package/dist/translations/pt-br.umd.js +2 -2
- package/dist/translations/pt.d.ts +2 -2
- package/dist/translations/pt.js +2 -2
- package/dist/translations/pt.umd.js +2 -2
- package/dist/translations/ro.d.ts +2 -2
- package/dist/translations/ro.js +2 -2
- package/dist/translations/ro.umd.js +2 -2
- package/dist/translations/ru.d.ts +2 -2
- package/dist/translations/ru.js +2 -2
- package/dist/translations/ru.umd.js +2 -2
- package/dist/translations/si.d.ts +2 -2
- package/dist/translations/si.js +2 -2
- package/dist/translations/si.umd.js +2 -2
- package/dist/translations/sk.d.ts +2 -2
- package/dist/translations/sk.js +2 -2
- package/dist/translations/sk.umd.js +2 -2
- package/dist/translations/sl.d.ts +2 -2
- package/dist/translations/sl.js +2 -2
- package/dist/translations/sl.umd.js +2 -2
- package/dist/translations/sq.d.ts +2 -2
- package/dist/translations/sq.js +2 -2
- package/dist/translations/sq.umd.js +2 -2
- package/dist/translations/sr-latn.d.ts +2 -2
- package/dist/translations/sr-latn.js +2 -2
- package/dist/translations/sr-latn.umd.js +2 -2
- package/dist/translations/sr.d.ts +2 -2
- package/dist/translations/sr.js +2 -2
- package/dist/translations/sr.umd.js +2 -2
- package/dist/translations/sv.d.ts +2 -2
- package/dist/translations/sv.js +2 -2
- package/dist/translations/sv.umd.js +2 -2
- package/dist/translations/th.d.ts +2 -2
- package/dist/translations/th.js +2 -2
- package/dist/translations/th.umd.js +2 -2
- package/dist/translations/ti.d.ts +2 -2
- package/dist/translations/ti.js +2 -2
- package/dist/translations/ti.umd.js +2 -2
- package/dist/translations/tk.d.ts +2 -2
- package/dist/translations/tk.js +2 -2
- package/dist/translations/tk.umd.js +2 -2
- package/dist/translations/tr.d.ts +2 -2
- package/dist/translations/tr.js +2 -2
- package/dist/translations/tr.umd.js +2 -2
- package/dist/translations/tt.d.ts +2 -2
- package/dist/translations/tt.js +2 -2
- package/dist/translations/tt.umd.js +2 -2
- package/dist/translations/ug.d.ts +2 -2
- package/dist/translations/ug.js +2 -2
- package/dist/translations/ug.umd.js +2 -2
- package/dist/translations/uk.d.ts +2 -2
- package/dist/translations/uk.js +2 -2
- package/dist/translations/uk.umd.js +2 -2
- package/dist/translations/ur.d.ts +2 -2
- package/dist/translations/ur.js +2 -2
- package/dist/translations/ur.umd.js +2 -2
- package/dist/translations/uz.d.ts +2 -2
- package/dist/translations/uz.js +2 -2
- package/dist/translations/uz.umd.js +2 -2
- package/dist/translations/vi.d.ts +2 -2
- package/dist/translations/vi.js +2 -2
- package/dist/translations/vi.umd.js +2 -2
- package/dist/translations/zh-cn.d.ts +2 -2
- package/dist/translations/zh-cn.js +2 -2
- package/dist/translations/zh-cn.umd.js +2 -2
- package/dist/translations/zh.d.ts +2 -2
- package/dist/translations/zh.js +2 -2
- package/dist/translations/zh.umd.js +2 -2
- package/lang/translations/af.po +1 -1
- package/lang/translations/ar.po +1 -1
- package/lang/translations/ast.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/bs.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/eo.po +1 -1
- package/lang/translations/es-co.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/eu.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/gu.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/hy.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/jv.po +1 -1
- package/lang/translations/kk.po +1 -1
- package/lang/translations/km.po +1 -1
- package/lang/translations/kn.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/nb.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/oc.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/si.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sl.po +1 -1
- package/lang/translations/sq.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/ti.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/tt.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/uz.po +1 -1
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +29 -8
- package/src/augmentation.d.ts +1 -1
- package/src/augmentation.js +1 -1
- package/src/highlightstack.d.ts +1 -1
- package/src/highlightstack.js +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/utils.d.ts +1 -1
- package/src/utils.js +1 -1
- package/src/verticalnavigation.d.ts +1 -1
- package/src/verticalnavigation.js +1 -1
- package/src/widget.d.ts +1 -1
- package/src/widget.js +1 -1
- package/src/widgetresize/resizer.d.ts +1 -1
- package/src/widgetresize/resizer.js +1 -1
- package/src/widgetresize/resizerstate.d.ts +1 -1
- package/src/widgetresize/resizerstate.js +1 -1
- package/src/widgetresize/sizeview.d.ts +1 -1
- package/src/widgetresize/sizeview.js +1 -1
- package/src/widgetresize.d.ts +1 -1
- package/src/widgetresize.js +1 -1
- package/src/widgettoolbarrepository.d.ts +1 -1
- package/src/widgettoolbarrepository.js +1 -1
- package/src/widgettypearound/utils.d.ts +1 -1
- package/src/widgettypearound/utils.js +1 -1
- package/src/widgettypearound/widgettypearound.d.ts +1 -1
- package/src/widgettypearound/widgettypearound.js +1 -1
- package/theme/widget.css +1 -1
- package/theme/widgetresize.css +1 -1
- package/theme/widgettypearound.css +1 -1
- package/dist/augmentation.d.ts +0 -17
- package/dist/highlightstack.d.ts +0 -78
- package/dist/index.d.ts +0 -17
- package/dist/utils.d.ts +0 -219
- package/dist/verticalnavigation.d.ts +0 -19
- package/dist/widget.d.ts +0 -111
- package/dist/widgetresize/resizer.d.ts +0 -181
- package/dist/widgetresize/resizerstate.d.ts +0 -129
- package/dist/widgetresize/sizeview.d.ts +0 -59
- package/dist/widgetresize.d.ts +0 -133
- package/dist/widgettoolbarrepository.d.ts +0 -102
- package/dist/widgettypearound/utils.d.ts +0 -42
- package/dist/widgettypearound/widgettypearound.d.ts +0 -237
@@ -1,181 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
8
|
-
*/
|
9
|
-
import { Rect, type DecoratedMethodEvent } from '@ckeditor/ckeditor5-utils';
|
10
|
-
import ResizeState from './resizerstate.js';
|
11
|
-
import type { ResizerOptions } from '../widgetresize.js';
|
12
|
-
declare const Resizer_base: {
|
13
|
-
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
14
|
-
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
15
|
-
};
|
16
|
-
/**
|
17
|
-
* Represents a resizer for a single resizable object.
|
18
|
-
*/
|
19
|
-
export default class Resizer extends /* #__PURE__ */ Resizer_base {
|
20
|
-
/**
|
21
|
-
* Flag that indicates whether resizer can be used.
|
22
|
-
*
|
23
|
-
* @observable
|
24
|
-
*/
|
25
|
-
isEnabled: boolean;
|
26
|
-
/**
|
27
|
-
* Flag that indicates that resizer is currently focused.
|
28
|
-
*
|
29
|
-
* @observable
|
30
|
-
*/
|
31
|
-
isSelected: boolean;
|
32
|
-
/**
|
33
|
-
* Flag that indicates whether resizer is rendered (visible on the screen).
|
34
|
-
*
|
35
|
-
* @readonly
|
36
|
-
* @observable
|
37
|
-
*/
|
38
|
-
isVisible: boolean;
|
39
|
-
/**
|
40
|
-
* Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.
|
41
|
-
*
|
42
|
-
* Note that a new state is created for each resize transaction.
|
43
|
-
*/
|
44
|
-
private _state;
|
45
|
-
/**
|
46
|
-
* A view displaying the proposed new element size during the resizing.
|
47
|
-
*/
|
48
|
-
private _sizeView;
|
49
|
-
/**
|
50
|
-
* Options passed to the {@link #constructor}.
|
51
|
-
*/
|
52
|
-
private _options;
|
53
|
-
/**
|
54
|
-
* A wrapper that is controlled by the resizer. This is usually a widget element.
|
55
|
-
*/
|
56
|
-
private _viewResizerWrapper;
|
57
|
-
/**
|
58
|
-
* The width of the resized {@link module:widget/widgetresize~ResizerOptions#viewElement viewElement} before the resizing started.
|
59
|
-
*/
|
60
|
-
private _initialViewWidth;
|
61
|
-
/**
|
62
|
-
* @param options Resizer options.
|
63
|
-
*/
|
64
|
-
constructor(options: ResizerOptions);
|
65
|
-
/**
|
66
|
-
* Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.
|
67
|
-
*
|
68
|
-
* Note that a new state is created for each resize transaction.
|
69
|
-
*/
|
70
|
-
get state(): ResizeState;
|
71
|
-
/**
|
72
|
-
* Makes resizer visible in the UI.
|
73
|
-
*/
|
74
|
-
show(): void;
|
75
|
-
/**
|
76
|
-
* Hides resizer in the UI.
|
77
|
-
*/
|
78
|
-
hide(): void;
|
79
|
-
/**
|
80
|
-
* Attaches the resizer to the DOM.
|
81
|
-
*/
|
82
|
-
attach(): void;
|
83
|
-
/**
|
84
|
-
* Starts the resizing process.
|
85
|
-
*
|
86
|
-
* Creates a new {@link #state} for the current process.
|
87
|
-
*
|
88
|
-
* @fires begin
|
89
|
-
* @param domResizeHandle Clicked handle.
|
90
|
-
*/
|
91
|
-
begin(domResizeHandle: HTMLElement): void;
|
92
|
-
/**
|
93
|
-
* Updates the proposed size based on `domEventData`.
|
94
|
-
*
|
95
|
-
* @fires updateSize
|
96
|
-
*/
|
97
|
-
updateSize(domEventData: MouseEvent): void;
|
98
|
-
/**
|
99
|
-
* Applies the geometry proposed with the resizer.
|
100
|
-
*
|
101
|
-
* @fires commit
|
102
|
-
*/
|
103
|
-
commit(): void;
|
104
|
-
/**
|
105
|
-
* Cancels and rejects the proposed resize dimensions, hiding the UI.
|
106
|
-
*
|
107
|
-
* @fires cancel
|
108
|
-
*/
|
109
|
-
cancel(): void;
|
110
|
-
/**
|
111
|
-
* Destroys the resizer.
|
112
|
-
*/
|
113
|
-
destroy(): void;
|
114
|
-
/**
|
115
|
-
* Redraws the resizer.
|
116
|
-
*
|
117
|
-
* @param handleHostRect Handle host rectangle might be given to improve performance.
|
118
|
-
*/
|
119
|
-
redraw(handleHostRect?: Rect): void;
|
120
|
-
containsHandle(domElement: HTMLElement): boolean;
|
121
|
-
static isResizeHandle(domElement: HTMLElement): boolean;
|
122
|
-
/**
|
123
|
-
* Cleans up the context state.
|
124
|
-
*/
|
125
|
-
private _cleanup;
|
126
|
-
/**
|
127
|
-
* Calculates the proposed size as the resize handles are dragged.
|
128
|
-
*
|
129
|
-
* @param domEventData Event data that caused the size update request. It should be used to calculate the proposed size.
|
130
|
-
*/
|
131
|
-
private _proposeNewSize;
|
132
|
-
/**
|
133
|
-
* Obtains the resize host.
|
134
|
-
*
|
135
|
-
* Resize host is an object that receives dimensions which are the result of resizing.
|
136
|
-
*/
|
137
|
-
private _getResizeHost;
|
138
|
-
/**
|
139
|
-
* Obtains the handle host.
|
140
|
-
*
|
141
|
-
* Handle host is an object that the handles are aligned to.
|
142
|
-
*
|
143
|
-
* Handle host will not always be an entire widget itself. Take an image as an example. The image widget
|
144
|
-
* contains an image and a caption. Only the image should be surrounded with handles.
|
145
|
-
*/
|
146
|
-
private _getHandleHost;
|
147
|
-
/**
|
148
|
-
* DOM container of the entire resize UI.
|
149
|
-
*
|
150
|
-
* Note that this property will have a value only after the element bound with the resizer is rendered
|
151
|
-
* (otherwise `null`).
|
152
|
-
*/
|
153
|
-
private get _domResizerWrapper();
|
154
|
-
/**
|
155
|
-
* Renders the resize handles in the DOM.
|
156
|
-
*
|
157
|
-
* @param domElement The resizer wrapper.
|
158
|
-
*/
|
159
|
-
private _appendHandles;
|
160
|
-
/**
|
161
|
-
* Sets up the {@link #_sizeView} property and adds it to the passed `domElement`.
|
162
|
-
*/
|
163
|
-
private _appendSizeUI;
|
164
|
-
}
|
165
|
-
/**
|
166
|
-
* @eventName ~Resizer#begin
|
167
|
-
*/
|
168
|
-
export type ResizerBeginEvent = DecoratedMethodEvent<Resizer, 'begin'>;
|
169
|
-
/**
|
170
|
-
* @eventName ~Resizer#cancel
|
171
|
-
*/
|
172
|
-
export type ResizerCancelEvent = DecoratedMethodEvent<Resizer, 'cancel'>;
|
173
|
-
/**
|
174
|
-
* @eventName ~Resizer#commit
|
175
|
-
*/
|
176
|
-
export type ResizerCommitEvent = DecoratedMethodEvent<Resizer, 'commit'>;
|
177
|
-
/**
|
178
|
-
* @eventName ~Resizer#updateSize
|
179
|
-
*/
|
180
|
-
export type ResizerUpdateSizeEvent = DecoratedMethodEvent<Resizer, 'updateSize'>;
|
181
|
-
export {};
|
@@ -1,129 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
8
|
-
*/
|
9
|
-
import type { ResizerOptions } from '../widgetresize.js';
|
10
|
-
declare const ResizeState_base: {
|
11
|
-
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
12
|
-
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
13
|
-
};
|
14
|
-
/**
|
15
|
-
* Stores the internal state of a single resizable object.
|
16
|
-
*/
|
17
|
-
export default class ResizeState extends /* #__PURE__ */ ResizeState_base {
|
18
|
-
/**
|
19
|
-
* The position of the handle that initiated the resizing. E.g. `"top-left"`, `"bottom-right"` etc. or `null`
|
20
|
-
* if unknown.
|
21
|
-
*
|
22
|
-
* @readonly
|
23
|
-
* @observable
|
24
|
-
*/
|
25
|
-
activeHandlePosition: string | null;
|
26
|
-
/**
|
27
|
-
* The width (percents) proposed, but not committed yet, in the current resize process.
|
28
|
-
*
|
29
|
-
* @readonly
|
30
|
-
* @observable
|
31
|
-
*/
|
32
|
-
proposedWidthPercents: number | null;
|
33
|
-
/**
|
34
|
-
* The width (pixels) proposed, but not committed yet, in the current resize process.
|
35
|
-
*
|
36
|
-
* @readonly
|
37
|
-
* @observable
|
38
|
-
*/
|
39
|
-
proposedWidth: number | null;
|
40
|
-
/**
|
41
|
-
* The height (pixels) proposed, but not committed yet, in the current resize process.
|
42
|
-
*
|
43
|
-
* @readonly
|
44
|
-
* @observable
|
45
|
-
*/
|
46
|
-
proposedHeight: number | null;
|
47
|
-
/**
|
48
|
-
* @readonly
|
49
|
-
* @observable
|
50
|
-
*/
|
51
|
-
proposedHandleHostWidth: number | null;
|
52
|
-
/**
|
53
|
-
* @readonly
|
54
|
-
* @observable
|
55
|
-
*/
|
56
|
-
proposedHandleHostHeight: number | null;
|
57
|
-
/**
|
58
|
-
* The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor
|
59
|
-
* traveled, so how much the image should be enlarged.
|
60
|
-
* This information is only known after the DOM was rendered, so it will be updated later.
|
61
|
-
*
|
62
|
-
* @internal
|
63
|
-
*/
|
64
|
-
_referenceCoordinates: {
|
65
|
-
x: number;
|
66
|
-
y: number;
|
67
|
-
} | null;
|
68
|
-
/**
|
69
|
-
* Resizer options.
|
70
|
-
*/
|
71
|
-
private readonly _options;
|
72
|
-
/**
|
73
|
-
* The original width (pixels) of the resized object when the resize process was started.
|
74
|
-
*
|
75
|
-
* @readonly
|
76
|
-
*/
|
77
|
-
private _originalWidth?;
|
78
|
-
/**
|
79
|
-
* The original height (pixels) of the resized object when the resize process was started.
|
80
|
-
*
|
81
|
-
* @readonly
|
82
|
-
*/
|
83
|
-
private _originalHeight?;
|
84
|
-
/**
|
85
|
-
* The original width (percents) of the resized object when the resize process was started.
|
86
|
-
*
|
87
|
-
* @readonly
|
88
|
-
*/
|
89
|
-
private _originalWidthPercents?;
|
90
|
-
/**
|
91
|
-
* A width to height ratio of the resized image.
|
92
|
-
*
|
93
|
-
* @readonly
|
94
|
-
*/
|
95
|
-
private _aspectRatio?;
|
96
|
-
/**
|
97
|
-
* @param options Resizer options.
|
98
|
-
*/
|
99
|
-
constructor(options: ResizerOptions);
|
100
|
-
/**
|
101
|
-
* The original width (pixels) of the resized object when the resize process was started.
|
102
|
-
*/
|
103
|
-
get originalWidth(): number | undefined;
|
104
|
-
/**
|
105
|
-
* The original height (pixels) of the resized object when the resize process was started.
|
106
|
-
*/
|
107
|
-
get originalHeight(): number | undefined;
|
108
|
-
/**
|
109
|
-
* The original width (percents) of the resized object when the resize process was started.
|
110
|
-
*/
|
111
|
-
get originalWidthPercents(): number | undefined;
|
112
|
-
/**
|
113
|
-
* A width to height ratio of the resized image.
|
114
|
-
*/
|
115
|
-
get aspectRatio(): number | undefined;
|
116
|
-
/**
|
117
|
-
*
|
118
|
-
* @param domResizeHandle The handle used to calculate the reference point.
|
119
|
-
*/
|
120
|
-
begin(domResizeHandle: HTMLElement, domHandleHost: HTMLElement, domResizeHost: HTMLElement): void;
|
121
|
-
update(newSize: {
|
122
|
-
width: number;
|
123
|
-
height: number;
|
124
|
-
widthPercents: number;
|
125
|
-
handleHostWidth: number;
|
126
|
-
handleHostHeight: number;
|
127
|
-
}): void;
|
128
|
-
}
|
129
|
-
export {};
|
@@ -1,59 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module widget/widgetresize/sizeview
|
11
|
-
*/
|
12
|
-
import { View } from '@ckeditor/ckeditor5-ui';
|
13
|
-
import type { ResizerOptions } from '../widgetresize.js';
|
14
|
-
import type ResizeState from './resizerstate.js';
|
15
|
-
/**
|
16
|
-
* A view displaying the proposed new element size during the resizing.
|
17
|
-
*/
|
18
|
-
export default class SizeView extends View {
|
19
|
-
/**
|
20
|
-
* The visibility of the view defined based on the existence of the host proposed dimensions.
|
21
|
-
*
|
22
|
-
* @internal
|
23
|
-
* @observable
|
24
|
-
* @readonly
|
25
|
-
*/
|
26
|
-
_isVisible: boolean;
|
27
|
-
/**
|
28
|
-
* The text that will be displayed in the `SizeView` child.
|
29
|
-
* It can be formatted as the pixel values (e.g. 10x20) or the percentage value (e.g. 10%).
|
30
|
-
*
|
31
|
-
* @internal
|
32
|
-
* @observable
|
33
|
-
* @readonly
|
34
|
-
*/
|
35
|
-
_label: string;
|
36
|
-
/**
|
37
|
-
* The position of the view defined based on the host size and active handle position.
|
38
|
-
*
|
39
|
-
* @internal
|
40
|
-
* @observable
|
41
|
-
* @readonly
|
42
|
-
*/
|
43
|
-
_viewPosition: string;
|
44
|
-
constructor();
|
45
|
-
/**
|
46
|
-
* A method used for binding the `SizeView` instance properties to the `ResizeState` instance observable properties.
|
47
|
-
*
|
48
|
-
* @internal
|
49
|
-
* @param options An object defining the resizer options, used for setting the proper size label.
|
50
|
-
* @param resizeState The `ResizeState` class instance, used for keeping the `SizeView` state up to date.
|
51
|
-
*/
|
52
|
-
_bindToState(options: ResizerOptions, resizeState: ResizeState): void;
|
53
|
-
/**
|
54
|
-
* A method used for cleaning up. It removes the bindings and hides the view.
|
55
|
-
*
|
56
|
-
* @internal
|
57
|
-
*/
|
58
|
-
_dismiss(): void;
|
59
|
-
}
|
package/dist/widgetresize.d.ts
DELETED
@@ -1,133 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module widget/widgetresize
|
11
|
-
*/
|
12
|
-
import Resizer from './widgetresize/resizer.js';
|
13
|
-
import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
|
14
|
-
import { type Element, type ViewContainerElement } from '@ckeditor/ckeditor5-engine';
|
15
|
-
import '../theme/widgetresize.css';
|
16
|
-
/**
|
17
|
-
* The widget resize feature plugin.
|
18
|
-
*
|
19
|
-
* Use the {@link module:widget/widgetresize~WidgetResize#attachTo} method to create a resizer for the specified widget.
|
20
|
-
*/
|
21
|
-
export default class WidgetResize extends Plugin {
|
22
|
-
/**
|
23
|
-
* The currently selected resizer.
|
24
|
-
*
|
25
|
-
* @observable
|
26
|
-
*/
|
27
|
-
selectedResizer: Resizer | null;
|
28
|
-
/**
|
29
|
-
* References an active resizer.
|
30
|
-
*
|
31
|
-
* Active resizer means a resizer which handle is actively used by the end user.
|
32
|
-
*
|
33
|
-
* @internal
|
34
|
-
* @observable
|
35
|
-
*/
|
36
|
-
_activeResizer: Resizer | null;
|
37
|
-
/**
|
38
|
-
* A map of resizers created using this plugin instance.
|
39
|
-
*/
|
40
|
-
private _resizers;
|
41
|
-
private _observer;
|
42
|
-
private _redrawSelectedResizerThrottled;
|
43
|
-
/**
|
44
|
-
* @inheritDoc
|
45
|
-
*/
|
46
|
-
static get pluginName(): "WidgetResize";
|
47
|
-
/**
|
48
|
-
* @inheritDoc
|
49
|
-
*/
|
50
|
-
static get isOfficialPlugin(): true;
|
51
|
-
/**
|
52
|
-
* @inheritDoc
|
53
|
-
*/
|
54
|
-
init(): void;
|
55
|
-
/**
|
56
|
-
* Redraws the selected resizer if there is any selected resizer and if it is visible.
|
57
|
-
*/
|
58
|
-
redrawSelectedResizer(): void;
|
59
|
-
/**
|
60
|
-
* @inheritDoc
|
61
|
-
*/
|
62
|
-
destroy(): void;
|
63
|
-
/**
|
64
|
-
* Marks resizer as selected.
|
65
|
-
*/
|
66
|
-
select(resizer: Resizer): void;
|
67
|
-
/**
|
68
|
-
* Deselects currently set resizer.
|
69
|
-
*/
|
70
|
-
deselect(): void;
|
71
|
-
/**
|
72
|
-
* @param options Resizer options.
|
73
|
-
*/
|
74
|
-
attachTo(options: ResizerOptions): Resizer;
|
75
|
-
/**
|
76
|
-
* Returns a resizer created for a given view element (widget element).
|
77
|
-
*
|
78
|
-
* @param viewElement View element associated with the resizer.
|
79
|
-
*/
|
80
|
-
getResizerByViewElement(viewElement: ViewContainerElement): Resizer | undefined;
|
81
|
-
/**
|
82
|
-
* Returns a resizer that contains a given resize handle.
|
83
|
-
*/
|
84
|
-
private _getResizerByHandle;
|
85
|
-
/**
|
86
|
-
* @param domEventData Native DOM event.
|
87
|
-
*/
|
88
|
-
private _mouseDownListener;
|
89
|
-
/**
|
90
|
-
* @param domEventData Native DOM event.
|
91
|
-
*/
|
92
|
-
private _mouseMoveListener;
|
93
|
-
private _mouseUpListener;
|
94
|
-
}
|
95
|
-
/**
|
96
|
-
* Interface describing a resizer. It allows to specify the resizing host, custom logic for calculating aspect ratio, etc.
|
97
|
-
*/
|
98
|
-
export interface ResizerOptions {
|
99
|
-
/**
|
100
|
-
* Editor instance associated with the resizer.
|
101
|
-
*/
|
102
|
-
editor: Editor;
|
103
|
-
modelElement: Element;
|
104
|
-
/**
|
105
|
-
* A view of an element to be resized. Typically it's the main widget's view instance.
|
106
|
-
*/
|
107
|
-
viewElement: ViewContainerElement;
|
108
|
-
unit?: 'px' | '%';
|
109
|
-
/**
|
110
|
-
* A callback to be executed once the resizing process is done.
|
111
|
-
*
|
112
|
-
* It receives a `Number` (`newValue`) as a parameter.
|
113
|
-
*
|
114
|
-
* For example, {@link module:image/imageresize~ImageResize} uses it to execute the resize image command
|
115
|
-
* which puts the new value into the model.
|
116
|
-
*
|
117
|
-
* ```ts
|
118
|
-
* {
|
119
|
-
* editor,
|
120
|
-
* modelElement: data.item,
|
121
|
-
* viewElement: widget,
|
122
|
-
*
|
123
|
-
* onCommit( newValue ) {
|
124
|
-
* editor.execute( 'resizeImage', { width: newValue } );
|
125
|
-
* }
|
126
|
-
* };
|
127
|
-
* ```
|
128
|
-
*/
|
129
|
-
onCommit: (newValue: string) => void;
|
130
|
-
getResizeHost: (widgetWrapper: HTMLElement) => HTMLElement;
|
131
|
-
getHandleHost: (widgetWrapper: HTMLElement) => HTMLElement;
|
132
|
-
isCentered?: (resizer: Resizer) => boolean;
|
133
|
-
}
|
@@ -1,102 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module widget/widgettoolbarrepository
|
11
|
-
*/
|
12
|
-
import { Plugin, type ToolbarConfigItem } from '@ckeditor/ckeditor5-core';
|
13
|
-
import type { ViewDocumentSelection, ViewElement } from '@ckeditor/ckeditor5-engine';
|
14
|
-
import { ContextualBalloon } from '@ckeditor/ckeditor5-ui';
|
15
|
-
/**
|
16
|
-
* Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole
|
17
|
-
* toolbar rendering process and exposes a concise API.
|
18
|
-
*
|
19
|
-
* To add a toolbar for your widget use the {@link ~WidgetToolbarRepository#register `WidgetToolbarRepository#register()`} method.
|
20
|
-
*
|
21
|
-
* The following example comes from the {@link module:image/imagetoolbar~ImageToolbar} plugin:
|
22
|
-
*
|
23
|
-
* ```ts
|
24
|
-
* class ImageToolbar extends Plugin {
|
25
|
-
* static get requires() {
|
26
|
-
* return [ WidgetToolbarRepository ];
|
27
|
-
* }
|
28
|
-
*
|
29
|
-
* afterInit() {
|
30
|
-
* const editor = this.editor;
|
31
|
-
* const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
|
32
|
-
*
|
33
|
-
* widgetToolbarRepository.register( 'image', {
|
34
|
-
* items: editor.config.get( 'image.toolbar' ),
|
35
|
-
* getRelatedElement: getClosestSelectedImageWidget
|
36
|
-
* } );
|
37
|
-
* }
|
38
|
-
* }
|
39
|
-
* ```
|
40
|
-
*/
|
41
|
-
export default class WidgetToolbarRepository extends Plugin {
|
42
|
-
/**
|
43
|
-
* A map of toolbar definitions.
|
44
|
-
*/
|
45
|
-
private _toolbarDefinitions;
|
46
|
-
private _balloon;
|
47
|
-
/**
|
48
|
-
* @inheritDoc
|
49
|
-
*/
|
50
|
-
static get requires(): readonly [typeof ContextualBalloon];
|
51
|
-
/**
|
52
|
-
* @inheritDoc
|
53
|
-
*/
|
54
|
-
static get pluginName(): "WidgetToolbarRepository";
|
55
|
-
/**
|
56
|
-
* @inheritDoc
|
57
|
-
*/
|
58
|
-
static get isOfficialPlugin(): true;
|
59
|
-
/**
|
60
|
-
* @inheritDoc
|
61
|
-
*/
|
62
|
-
init(): void;
|
63
|
-
destroy(): void;
|
64
|
-
/**
|
65
|
-
* Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked
|
66
|
-
* `getRelatedElement` function. Toolbar items are gathered from `items` array.
|
67
|
-
* The balloon's CSS class is by default `ck-toolbar-container` and may be override with the `balloonClassName` option.
|
68
|
-
*
|
69
|
-
* Note: This method should be called in the {@link module:core/plugin~PluginInterface#afterInit `Plugin#afterInit()`}
|
70
|
-
* callback (or later) to make sure that the given toolbar items were already registered by other plugins.
|
71
|
-
*
|
72
|
-
* @param toolbarId An id for the toolbar. Used to
|
73
|
-
* @param options.ariaLabel Label used by assistive technologies to describe this toolbar element.
|
74
|
-
* @param options.items Array of toolbar items.
|
75
|
-
* @param options.getRelatedElement Callback which returns an element the toolbar should be attached to.
|
76
|
-
* @param options.balloonClassName CSS class for the widget balloon.
|
77
|
-
*/
|
78
|
-
register(toolbarId: string, { ariaLabel, items, getRelatedElement, balloonClassName }: {
|
79
|
-
ariaLabel?: string;
|
80
|
-
items: Array<ToolbarConfigItem>;
|
81
|
-
getRelatedElement: (selection: ViewDocumentSelection) => (ViewElement | null);
|
82
|
-
balloonClassName?: string;
|
83
|
-
}): void;
|
84
|
-
/**
|
85
|
-
* Iterates over stored toolbars and makes them visible or hidden.
|
86
|
-
*/
|
87
|
-
private _updateToolbarsVisibility;
|
88
|
-
/**
|
89
|
-
* Hides the given toolbar.
|
90
|
-
*/
|
91
|
-
private _hideToolbar;
|
92
|
-
/**
|
93
|
-
* Shows up the toolbar if the toolbar is not visible.
|
94
|
-
* Otherwise, repositions the toolbar's balloon when toolbar's view is the most top view in balloon stack.
|
95
|
-
*
|
96
|
-
* It might happen here that the toolbar's view is under another view. Then do nothing as the other toolbar view
|
97
|
-
* should be still visible after the {@link module:ui/editorui/editorui~EditorUI#event:update}.
|
98
|
-
*/
|
99
|
-
private _showToolbar;
|
100
|
-
private _isToolbarVisible;
|
101
|
-
private _isToolbarInBalloon;
|
102
|
-
}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
8
|
-
*/
|
9
|
-
import type { DocumentSelection, DomConverter, Element, Schema, Selection, ViewElement } from '@ckeditor/ckeditor5-engine';
|
10
|
-
/**
|
11
|
-
* The name of the type around model selection attribute responsible for
|
12
|
-
* displaying a fake caret next to a selected widget.
|
13
|
-
*/
|
14
|
-
export declare const TYPE_AROUND_SELECTION_ATTRIBUTE = "widget-type-around";
|
15
|
-
/**
|
16
|
-
* Checks if an element is a widget that qualifies to get the widget type around UI.
|
17
|
-
*/
|
18
|
-
export declare function isTypeAroundWidget(viewElement: ViewElement | undefined, modelElement: Element, schema: Schema): boolean;
|
19
|
-
/**
|
20
|
-
* For the passed HTML element, this helper finds the closest widget type around button ancestor.
|
21
|
-
*/
|
22
|
-
export declare function getClosestTypeAroundDomButton(domElement: HTMLElement): HTMLElement | null;
|
23
|
-
/**
|
24
|
-
* For the passed widget type around button element, this helper determines at which position
|
25
|
-
* the paragraph would be inserted into the content if, for instance, the button was
|
26
|
-
* clicked by the user.
|
27
|
-
*
|
28
|
-
* @returns The position of the button.
|
29
|
-
*/
|
30
|
-
export declare function getTypeAroundButtonPosition(domElement: HTMLElement): 'before' | 'after';
|
31
|
-
/**
|
32
|
-
* For the passed HTML element, this helper returns the closest view widget ancestor.
|
33
|
-
*/
|
34
|
-
export declare function getClosestWidgetViewElement(domElement: HTMLElement, domConverter: DomConverter): ViewElement;
|
35
|
-
/**
|
36
|
-
* For the passed selection instance, it returns the position of the fake caret displayed next to a widget.
|
37
|
-
*
|
38
|
-
* **Note**: If the fake caret is not currently displayed, `null` is returned.
|
39
|
-
*
|
40
|
-
* @returns The position of the fake caret or `null` when none is present.
|
41
|
-
*/
|
42
|
-
export declare function getTypeAroundFakeCaretPosition(selection: Selection | DocumentSelection): 'before' | 'after' | null;
|