@ckeditor/ckeditor5-link 39.0.2 → 40.0.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/build/link.js.map +1 -0
- package/build/translations/hy.js +1 -0
- package/build/translations/pt-br.js +1 -1
- package/lang/translations/hy.po +54 -0
- package/lang/translations/pt-br.po +2 -2
- package/package.json +3 -3
- package/src/augmentation.d.ts +30 -30
- package/src/augmentation.js +5 -5
- package/src/autolink.d.ts +60 -60
- package/src/autolink.js +216 -216
- package/src/index.d.ts +18 -18
- package/src/index.js +17 -17
- package/src/link.d.ts +27 -27
- package/src/link.js +31 -31
- package/src/linkcommand.d.ts +132 -132
- package/src/linkcommand.js +285 -285
- package/src/linkconfig.d.ts +251 -251
- package/src/linkconfig.js +5 -5
- package/src/linkediting.d.ts +106 -106
- package/src/linkediting.js +547 -547
- package/src/linkimage.d.ts +27 -27
- package/src/linkimage.js +31 -31
- package/src/linkimageediting.d.ts +39 -39
- package/src/linkimageediting.js +245 -245
- package/src/linkimageui.d.ts +40 -40
- package/src/linkimageui.js +96 -96
- package/src/linkui.d.ts +165 -165
- package/src/linkui.js +581 -581
- package/src/ui/linkactionsview.d.ts +101 -101
- package/src/ui/linkactionsview.js +156 -156
- package/src/ui/linkformview.d.ts +141 -141
- package/src/ui/linkformview.js +232 -232
- package/src/unlinkcommand.d.ts +31 -31
- package/src/unlinkcommand.js +66 -66
- package/src/utils/automaticdecorators.d.ts +45 -45
- package/src/utils/automaticdecorators.js +140 -140
- package/src/utils/manualdecorator.d.ts +72 -72
- package/src/utils/manualdecorator.js +47 -47
- package/src/utils.d.ts +80 -80
- package/src/utils.js +128 -128
package/src/ui/linkformview.d.ts
CHANGED
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, 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
|
-
* @module link/ui/linkformview
|
|
7
|
-
*/
|
|
8
|
-
import { ButtonView, LabeledFieldView, View, ViewCollection, type InputTextView } from 'ckeditor5/src/ui';
|
|
9
|
-
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
10
|
-
import type LinkCommand from '../linkcommand';
|
|
11
|
-
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
|
12
|
-
import '../../theme/linkform.css';
|
|
13
|
-
/**
|
|
14
|
-
* The link form view controller class.
|
|
15
|
-
*
|
|
16
|
-
* See {@link module:link/ui/linkformview~LinkFormView}.
|
|
17
|
-
*/
|
|
18
|
-
export default class LinkFormView extends View {
|
|
19
|
-
/**
|
|
20
|
-
* Tracks information about DOM focus in the form.
|
|
21
|
-
*/
|
|
22
|
-
readonly focusTracker: FocusTracker;
|
|
23
|
-
/**
|
|
24
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
25
|
-
*/
|
|
26
|
-
readonly keystrokes: KeystrokeHandler;
|
|
27
|
-
/**
|
|
28
|
-
* The URL input view.
|
|
29
|
-
*/
|
|
30
|
-
urlInputView: LabeledFieldView<InputTextView>;
|
|
31
|
-
/**
|
|
32
|
-
* The Save button view.
|
|
33
|
-
*/
|
|
34
|
-
saveButtonView: ButtonView;
|
|
35
|
-
/**
|
|
36
|
-
* The Cancel button view.
|
|
37
|
-
*/
|
|
38
|
-
cancelButtonView: ButtonView;
|
|
39
|
-
/**
|
|
40
|
-
* A collection of {@link module:ui/button/switchbuttonview~SwitchButtonView},
|
|
41
|
-
* which corresponds to {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators}
|
|
42
|
-
* configured in the editor.
|
|
43
|
-
*/
|
|
44
|
-
private readonly _manualDecoratorSwitches;
|
|
45
|
-
/**
|
|
46
|
-
* A collection of child views in the form.
|
|
47
|
-
*/
|
|
48
|
-
readonly children: ViewCollection;
|
|
49
|
-
/**
|
|
50
|
-
* A collection of views that can be focused in the form.
|
|
51
|
-
*/
|
|
52
|
-
private readonly _focusables;
|
|
53
|
-
/**
|
|
54
|
-
* Helps cycling over {@link #_focusables} in the form.
|
|
55
|
-
*/
|
|
56
|
-
private readonly _focusCycler;
|
|
57
|
-
/**
|
|
58
|
-
* Creates an instance of the {@link module:link/ui/linkformview~LinkFormView} class.
|
|
59
|
-
*
|
|
60
|
-
* Also see {@link #render}.
|
|
61
|
-
*
|
|
62
|
-
* @param locale The localization services instance.
|
|
63
|
-
* @param linkCommand Reference to {@link module:link/linkcommand~LinkCommand}.
|
|
64
|
-
*/
|
|
65
|
-
constructor(locale: Locale, linkCommand: LinkCommand);
|
|
66
|
-
/**
|
|
67
|
-
* Obtains the state of the {@link module:ui/button/switchbuttonview~SwitchButtonView switch buttons} representing
|
|
68
|
-
* {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators}
|
|
69
|
-
* in the {@link module:link/ui/linkformview~LinkFormView}.
|
|
70
|
-
*
|
|
71
|
-
* @returns Key-value pairs, where the key is the name of the decorator and the value is its state.
|
|
72
|
-
*/
|
|
73
|
-
getDecoratorSwitchesState(): Record<string, boolean>;
|
|
74
|
-
/**
|
|
75
|
-
* @inheritDoc
|
|
76
|
-
*/
|
|
77
|
-
render(): void;
|
|
78
|
-
/**
|
|
79
|
-
* @inheritDoc
|
|
80
|
-
*/
|
|
81
|
-
destroy(): void;
|
|
82
|
-
/**
|
|
83
|
-
* Focuses the fist {@link #_focusables} in the form.
|
|
84
|
-
*/
|
|
85
|
-
focus(): void;
|
|
86
|
-
/**
|
|
87
|
-
* Creates a labeled input view.
|
|
88
|
-
*
|
|
89
|
-
* @returns Labeled field view instance.
|
|
90
|
-
*/
|
|
91
|
-
private _createUrlInput;
|
|
92
|
-
/**
|
|
93
|
-
* Creates a button view.
|
|
94
|
-
*
|
|
95
|
-
* @param label The button label.
|
|
96
|
-
* @param icon The button icon.
|
|
97
|
-
* @param className The additional button CSS class name.
|
|
98
|
-
* @param eventName An event name that the `ButtonView#execute` event will be delegated to.
|
|
99
|
-
* @returns The button view instance.
|
|
100
|
-
*/
|
|
101
|
-
private _createButton;
|
|
102
|
-
/**
|
|
103
|
-
* Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView}
|
|
104
|
-
* made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}.
|
|
105
|
-
*
|
|
106
|
-
* @param linkCommand A reference to the link command.
|
|
107
|
-
* @returns ViewCollection of switch buttons.
|
|
108
|
-
*/
|
|
109
|
-
private _createManualDecoratorSwitches;
|
|
110
|
-
/**
|
|
111
|
-
* Populates the {@link #children} collection of the form.
|
|
112
|
-
*
|
|
113
|
-
* If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an
|
|
114
|
-
* additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding
|
|
115
|
-
* to these decorators.
|
|
116
|
-
*
|
|
117
|
-
* @param manualDecorators A reference to
|
|
118
|
-
* the collection of manual decorators stored in the link command.
|
|
119
|
-
* @returns The children of link form view.
|
|
120
|
-
*/
|
|
121
|
-
private _createFormChildren;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Fired when the form view is submitted (when one of the children triggered the submit event),
|
|
125
|
-
* for example with a click on {@link ~LinkFormView#saveButtonView}.
|
|
126
|
-
*
|
|
127
|
-
* @eventName ~LinkFormView#submit
|
|
128
|
-
*/
|
|
129
|
-
export type SubmitEvent = {
|
|
130
|
-
name: 'submit';
|
|
131
|
-
args: [];
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Fired when the form view is canceled, for example with a click on {@link ~LinkFormView#cancelButtonView}.
|
|
135
|
-
*
|
|
136
|
-
* @eventName ~LinkFormView#cancel
|
|
137
|
-
*/
|
|
138
|
-
export type CancelEvent = {
|
|
139
|
-
name: 'cancel';
|
|
140
|
-
args: [];
|
|
141
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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
|
+
* @module link/ui/linkformview
|
|
7
|
+
*/
|
|
8
|
+
import { ButtonView, LabeledFieldView, View, ViewCollection, type InputTextView } from 'ckeditor5/src/ui';
|
|
9
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
10
|
+
import type LinkCommand from '../linkcommand';
|
|
11
|
+
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
|
12
|
+
import '../../theme/linkform.css';
|
|
13
|
+
/**
|
|
14
|
+
* The link form view controller class.
|
|
15
|
+
*
|
|
16
|
+
* See {@link module:link/ui/linkformview~LinkFormView}.
|
|
17
|
+
*/
|
|
18
|
+
export default class LinkFormView extends View {
|
|
19
|
+
/**
|
|
20
|
+
* Tracks information about DOM focus in the form.
|
|
21
|
+
*/
|
|
22
|
+
readonly focusTracker: FocusTracker;
|
|
23
|
+
/**
|
|
24
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
25
|
+
*/
|
|
26
|
+
readonly keystrokes: KeystrokeHandler;
|
|
27
|
+
/**
|
|
28
|
+
* The URL input view.
|
|
29
|
+
*/
|
|
30
|
+
urlInputView: LabeledFieldView<InputTextView>;
|
|
31
|
+
/**
|
|
32
|
+
* The Save button view.
|
|
33
|
+
*/
|
|
34
|
+
saveButtonView: ButtonView;
|
|
35
|
+
/**
|
|
36
|
+
* The Cancel button view.
|
|
37
|
+
*/
|
|
38
|
+
cancelButtonView: ButtonView;
|
|
39
|
+
/**
|
|
40
|
+
* A collection of {@link module:ui/button/switchbuttonview~SwitchButtonView},
|
|
41
|
+
* which corresponds to {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators}
|
|
42
|
+
* configured in the editor.
|
|
43
|
+
*/
|
|
44
|
+
private readonly _manualDecoratorSwitches;
|
|
45
|
+
/**
|
|
46
|
+
* A collection of child views in the form.
|
|
47
|
+
*/
|
|
48
|
+
readonly children: ViewCollection;
|
|
49
|
+
/**
|
|
50
|
+
* A collection of views that can be focused in the form.
|
|
51
|
+
*/
|
|
52
|
+
private readonly _focusables;
|
|
53
|
+
/**
|
|
54
|
+
* Helps cycling over {@link #_focusables} in the form.
|
|
55
|
+
*/
|
|
56
|
+
private readonly _focusCycler;
|
|
57
|
+
/**
|
|
58
|
+
* Creates an instance of the {@link module:link/ui/linkformview~LinkFormView} class.
|
|
59
|
+
*
|
|
60
|
+
* Also see {@link #render}.
|
|
61
|
+
*
|
|
62
|
+
* @param locale The localization services instance.
|
|
63
|
+
* @param linkCommand Reference to {@link module:link/linkcommand~LinkCommand}.
|
|
64
|
+
*/
|
|
65
|
+
constructor(locale: Locale, linkCommand: LinkCommand);
|
|
66
|
+
/**
|
|
67
|
+
* Obtains the state of the {@link module:ui/button/switchbuttonview~SwitchButtonView switch buttons} representing
|
|
68
|
+
* {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators}
|
|
69
|
+
* in the {@link module:link/ui/linkformview~LinkFormView}.
|
|
70
|
+
*
|
|
71
|
+
* @returns Key-value pairs, where the key is the name of the decorator and the value is its state.
|
|
72
|
+
*/
|
|
73
|
+
getDecoratorSwitchesState(): Record<string, boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
render(): void;
|
|
78
|
+
/**
|
|
79
|
+
* @inheritDoc
|
|
80
|
+
*/
|
|
81
|
+
destroy(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Focuses the fist {@link #_focusables} in the form.
|
|
84
|
+
*/
|
|
85
|
+
focus(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Creates a labeled input view.
|
|
88
|
+
*
|
|
89
|
+
* @returns Labeled field view instance.
|
|
90
|
+
*/
|
|
91
|
+
private _createUrlInput;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a button view.
|
|
94
|
+
*
|
|
95
|
+
* @param label The button label.
|
|
96
|
+
* @param icon The button icon.
|
|
97
|
+
* @param className The additional button CSS class name.
|
|
98
|
+
* @param eventName An event name that the `ButtonView#execute` event will be delegated to.
|
|
99
|
+
* @returns The button view instance.
|
|
100
|
+
*/
|
|
101
|
+
private _createButton;
|
|
102
|
+
/**
|
|
103
|
+
* Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView}
|
|
104
|
+
* made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}.
|
|
105
|
+
*
|
|
106
|
+
* @param linkCommand A reference to the link command.
|
|
107
|
+
* @returns ViewCollection of switch buttons.
|
|
108
|
+
*/
|
|
109
|
+
private _createManualDecoratorSwitches;
|
|
110
|
+
/**
|
|
111
|
+
* Populates the {@link #children} collection of the form.
|
|
112
|
+
*
|
|
113
|
+
* If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an
|
|
114
|
+
* additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding
|
|
115
|
+
* to these decorators.
|
|
116
|
+
*
|
|
117
|
+
* @param manualDecorators A reference to
|
|
118
|
+
* the collection of manual decorators stored in the link command.
|
|
119
|
+
* @returns The children of link form view.
|
|
120
|
+
*/
|
|
121
|
+
private _createFormChildren;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Fired when the form view is submitted (when one of the children triggered the submit event),
|
|
125
|
+
* for example with a click on {@link ~LinkFormView#saveButtonView}.
|
|
126
|
+
*
|
|
127
|
+
* @eventName ~LinkFormView#submit
|
|
128
|
+
*/
|
|
129
|
+
export type SubmitEvent = {
|
|
130
|
+
name: 'submit';
|
|
131
|
+
args: [];
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Fired when the form view is canceled, for example with a click on {@link ~LinkFormView#cancelButtonView}.
|
|
135
|
+
*
|
|
136
|
+
* @eventName ~LinkFormView#cancel
|
|
137
|
+
*/
|
|
138
|
+
export type CancelEvent = {
|
|
139
|
+
name: 'cancel';
|
|
140
|
+
args: [];
|
|
141
|
+
};
|