@ckeditor/ckeditor5-fullscreen 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/augmentation.d.ts +19 -19
- package/dist/fullscreen.d.ts +22 -22
- package/dist/fullscreencommand.d.ts +50 -50
- package/dist/fullscreenconfig.d.ts +65 -65
- package/dist/fullscreenediting.d.ts +24 -24
- package/dist/fullscreenui.d.ts +30 -30
- package/dist/handlers/abstracteditorhandler.d.ts +284 -285
- package/dist/handlers/classiceditorhandler.d.ts +19 -19
- package/dist/handlers/decouplededitorhandler.d.ts +21 -21
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +14 -14
- package/dist/index.js +972 -1073
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -2,193 +2,213 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import { Command, Plugin } from
|
|
6
|
-
import {
|
|
7
|
-
import { BodyCollection, ButtonView, DialogViewPosition,
|
|
8
|
-
import {
|
|
5
|
+
import { Command, Plugin } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import { Rect, ResizeObserver, createElement, env, global } from "@ckeditor/ckeditor5-utils";
|
|
7
|
+
import { BodyCollection, ButtonView, DialogViewPosition, MenuBarMenuListItemButtonView, MenuBarView } from "@ckeditor/ckeditor5-ui";
|
|
8
|
+
import { IconDocumentOutlineToggle, IconFullscreenEnter, IconFullscreenLeave, IconPreviousArrow } from "@ckeditor/ckeditor5-icons";
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
12
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @module fullscreen/handlers/abstracteditorhandler
|
|
16
|
+
*/
|
|
10
17
|
const DIALOG_OFFSET = 28;
|
|
11
18
|
/**
|
|
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
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
19
|
+
* The abstract editor type handler.
|
|
20
|
+
*
|
|
21
|
+
* This class defines some actions and behaviors that are applied when fullscreen mode is toggled, and which are common
|
|
22
|
+
* regardless of the editor type. Then, specific classes like `ClassicEditorHandler` or `DecoupledEditorHandler`
|
|
23
|
+
* extend this class with actions specific for these editor types.
|
|
24
|
+
*
|
|
25
|
+
* Extend this class to provide fullscreen mode handling for unsupported editor types,
|
|
26
|
+
* or if you wish to heavily customize the default behavior.
|
|
27
|
+
*
|
|
28
|
+
* The only method that is necessary to provide when extending this class is {@link #defaultOnEnter}. However, make sure to
|
|
29
|
+
* familiarize yourself with the below full list of actions taken by `FullscreenAbstractEditorHandler` to understand
|
|
30
|
+
* what is covered by default, and what should be provided by you.
|
|
31
|
+
*
|
|
32
|
+
* When entering the fullscreen mode, the {@link #enable} method is called. It creates the properly styled container
|
|
33
|
+
* and handles the editor features that need it, in the following order:
|
|
34
|
+
*
|
|
35
|
+
* 1. Saves the scroll positions of all ancestors of the editable element to restore them after leaving the fullscreen mode.
|
|
36
|
+
* 2. Executes the {@link #defaultOnEnter} method to move the proper editor UI elements to the fullscreen mode.
|
|
37
|
+
* **If you extend the abstract handler, you should override this method** to move the elements that are specific to your editor type, like:
|
|
38
|
+
* editable, toolbar, menu bar.
|
|
39
|
+
* Use {@link #moveToFullscreen} method for this purpose to ensure they are automatically cleaned up after leaving the fullscreen mode.
|
|
40
|
+
* 3. Adds proper classes to the `<body>` and `<html>` elements to block page scrolling, adjust `z-index` etc.
|
|
41
|
+
*
|
|
42
|
+
* Steps 4-12 are only executed if the corresponding features are used.
|
|
43
|
+
*
|
|
44
|
+
* 4. If presence list is used, moves it to the fullscreen mode container.
|
|
45
|
+
* 5. If document outline is used, moves it to the fullscreen mode.
|
|
46
|
+
* 6. If pagination is used, adjusts it's configuration for the changed view.
|
|
47
|
+
* 7. If annotations are used, moves them to the fullscreen mode.
|
|
48
|
+
* 8. If revision history is used, overrides the callbacks to show the revision viewer in the fullscreen mode.
|
|
49
|
+
* 9. If AI Tabs is used, moves it to the fullscreen mode.
|
|
50
|
+
* 10. If source editing and document outline are both used, registers a callback hiding the document outline header in source editing mode.
|
|
51
|
+
* 11. Changes the position of some dialogs to utilize the empty space on the right side of the editable element.
|
|
52
|
+
* 12. If custom container is used, hides all other elements in it to ensure they don't create an empty unscrollable space.
|
|
53
|
+
*
|
|
54
|
+
* Then finally:
|
|
55
|
+
*
|
|
56
|
+
* 13. Adjusts the visibility of the left and right sidebars based on the available space.
|
|
57
|
+
* 14. Sets up a resize observer to adjust the visibility of the left and right sidebars dynamically.
|
|
58
|
+
* 15. Executes the configured {@link module:fullscreen/fullscreenconfig~FullscreenConfig#onEnterCallback
|
|
59
|
+
* `config.fullscreen.onEnterCallback`} function.
|
|
60
|
+
* By default, it returns the fullscreen mode container element so it can be further customized.
|
|
61
|
+
*
|
|
62
|
+
* When leaving the fullscreen mode, the {@link #disable} method is called. It does the following:
|
|
63
|
+
*
|
|
64
|
+
* 1. Execute the configured {@link module:fullscreen/fullscreenconfig~FullscreenConfig#onLeaveCallback
|
|
65
|
+
* `config.fullscreen.onLeaveCallback`} function.
|
|
66
|
+
* 2. Remove the classes added to the `<body>` and `<html>` elements.
|
|
67
|
+
* 3. If document outline is used, restore its default container.
|
|
68
|
+
* 4. If annotations are used, restore their original state (UI, filters etc).
|
|
69
|
+
* 5. If revision history is used, restore the original callbacks.
|
|
70
|
+
* 7. If AI Tabs is used, restore it to the original state.
|
|
71
|
+
* 8. If source editing and document outline are both used, restore the document outline header.
|
|
72
|
+
* 9. Restore all moved elements to their original place.
|
|
73
|
+
* 10. Destroy the fullscreen mode container.
|
|
74
|
+
* 11. If the editor has a toolbar, switch its behavior to the one configured in the
|
|
75
|
+
* {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} property.
|
|
76
|
+
* 12. Restore the scroll positions of all ancestors of the editable element.
|
|
77
|
+
* 13. If pagination is used, restore its default configuration.
|
|
78
|
+
* 14. Restore default dialogs positions.
|
|
79
|
+
*
|
|
80
|
+
* This class is exported to allow for custom extensions.
|
|
81
|
+
*/
|
|
82
|
+
var FullscreenAbstractEditorHandler = class {
|
|
83
|
+
/**
|
|
84
|
+
* Maps placeholder names to placeholder elements and moved elements.
|
|
85
|
+
*/
|
|
86
|
+
_placeholderMap;
|
|
87
|
+
/**
|
|
88
|
+
* The wrapper element that holds the fullscreen mode layout.
|
|
89
|
+
*/
|
|
90
|
+
_wrapper = null;
|
|
91
|
+
/**
|
|
92
|
+
* The document object in which the editor is located.
|
|
93
|
+
*/
|
|
94
|
+
_document;
|
|
95
|
+
/**
|
|
96
|
+
* Data of the annotations UIs that were active before entering the fullscreen mode.
|
|
97
|
+
*/
|
|
98
|
+
_annotationsUIsData = null;
|
|
99
|
+
/**
|
|
100
|
+
* The pagination body collection that is used in the fullscreen mode.
|
|
101
|
+
* If we don't move pagination lines to the fullscreen container, they won't be visible.
|
|
102
|
+
*/
|
|
103
|
+
_paginationBodyCollection = null;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the left sidebar collapse button is created.
|
|
106
|
+
*/
|
|
107
|
+
_hasLeftCollapseButton = false;
|
|
108
|
+
/**
|
|
109
|
+
* The button that toggles the visibility of the left sidebar.
|
|
110
|
+
*/
|
|
111
|
+
_collapseLeftSidebarButton = null;
|
|
112
|
+
/**
|
|
113
|
+
* The resize observer that is used to adjust the visibility of the left and right sidebars dynamically.
|
|
114
|
+
*/
|
|
115
|
+
_resizeObserver = null;
|
|
116
|
+
/**
|
|
117
|
+
* The width of the expanded left and right sidebars in the fullscreen mode. Necessary for logic checking if they should be visible.
|
|
118
|
+
*/
|
|
119
|
+
_sidebarsWidths = {
|
|
120
|
+
left: 0,
|
|
121
|
+
right: 0
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Whether the left sidebar should be kept hidden even if there is enough space for it. It's set to `true` when user
|
|
125
|
+
* collapses the left sidebar with a button. Behavior is reset when exiting the fullscreen mode.
|
|
126
|
+
*/
|
|
127
|
+
_keepLeftSidebarHidden = false;
|
|
128
|
+
/**
|
|
129
|
+
* Temporary flag used to ignore the first automatic layout adjustment logic when user collapses the left sidebar with a button.
|
|
130
|
+
* It is then immediately set back to `false`.
|
|
131
|
+
*/
|
|
132
|
+
_forceShowLeftSidebar = false;
|
|
133
|
+
/**
|
|
134
|
+
* A callback that hides the document outline header when the source editing mode is enabled.
|
|
135
|
+
* Document outline element itself is hidden by source editing plugin.
|
|
136
|
+
*/
|
|
137
|
+
/* v8 ignore start -- @preserve */
|
|
138
|
+
_sourceEditingCallback = (_evt, _name, value) => {
|
|
139
|
+
this.getWrapper().querySelector(".ck-fullscreen__document-outline-header").style.display = value ? "none" : "";
|
|
140
|
+
};
|
|
141
|
+
/* v8 ignore stop -- @preserve */
|
|
142
|
+
/**
|
|
143
|
+
* A map of elements that were hidden when entering the fullscreen mode.
|
|
144
|
+
* It is used to restore their previous visibility when leaving the fullscreen mode and avoid showing elements
|
|
145
|
+
* that were hidden before entering the fullscreen mode.
|
|
146
|
+
*/
|
|
147
|
+
_hiddenElements = /* @__PURE__ */ new Map();
|
|
148
|
+
/**
|
|
149
|
+
* A map matching the ancestors of the editable element with their scroll positions before entering fullscreen mode.
|
|
150
|
+
*/
|
|
151
|
+
_savedAncestorsScrollPositions = /* @__PURE__ */ new Map();
|
|
152
|
+
/**
|
|
153
|
+
* A callback that shows the revision viewer, stored to restore the original one after exiting the fullscreen mode.
|
|
154
|
+
*/
|
|
155
|
+
_showRevisionViewerCallback = null;
|
|
156
|
+
/**
|
|
157
|
+
* A callback that closes the revision viewer, stored to restore the original one after exiting the fullscreen mode.
|
|
158
|
+
*/
|
|
159
|
+
_closeRevisionViewerCallback = null;
|
|
160
|
+
/**
|
|
161
|
+
* A map of AI Tabs data that were set before entering the fullscreen mode.
|
|
162
|
+
*/
|
|
163
|
+
_aiTabsData = null;
|
|
164
|
+
/**
|
|
165
|
+
* @inheritDoc
|
|
166
|
+
*/
|
|
167
|
+
constructor(editor) {
|
|
168
|
+
this._placeholderMap = /* @__PURE__ */ new Map();
|
|
169
|
+
if (editor.plugins.has("RevisionHistory")) {
|
|
170
|
+
this._showRevisionViewerCallback = editor.config.get("revisionHistory").showRevisionViewerCallback;
|
|
171
|
+
this._closeRevisionViewerCallback = editor.config.get("revisionHistory").closeRevisionViewerCallback;
|
|
172
|
+
}
|
|
173
|
+
this._editor = editor;
|
|
174
|
+
this._document = this._editor.sourceElement ? this._editor.sourceElement.ownerDocument : global.document;
|
|
175
|
+
this._editor.config.define("fullscreen.container", this._document.body);
|
|
176
|
+
editor.on("destroy", () => {
|
|
177
|
+
if (this._wrapper) this.destroy();
|
|
178
|
+
if (this._resizeObserver) this._resizeObserver.destroy();
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Moves the given element to the fullscreen mode container, leaving a placeholder in its place.
|
|
183
|
+
*/
|
|
184
|
+
moveToFullscreen(elementToMove, placeholderName) {
|
|
185
|
+
const placeholderElement = createElement(this._document, "div");
|
|
186
|
+
placeholderElement.setAttribute("data-ck-fullscreen-placeholder", placeholderName);
|
|
187
|
+
elementToMove.replaceWith(placeholderElement);
|
|
188
|
+
this.getWrapper().querySelector(`[data-ck-fullscreen="${placeholderName}"]`).append(elementToMove);
|
|
189
|
+
this._placeholderMap.set(placeholderName, {
|
|
190
|
+
placeholderElement,
|
|
191
|
+
movedElement: elementToMove
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Returns a single moved element to its original place.
|
|
196
|
+
*/
|
|
197
|
+
restoreMovedElementLocation(placeholderName) {
|
|
198
|
+
if (!this._placeholderMap.has(placeholderName)) return;
|
|
199
|
+
const { placeholderElement, movedElement } = this._placeholderMap.get(placeholderName);
|
|
200
|
+
placeholderElement.replaceWith(movedElement);
|
|
201
|
+
placeholderElement.remove();
|
|
202
|
+
this._placeholderMap.delete(placeholderName);
|
|
203
|
+
if (this._placeholderMap.size === 0) this._destroyContainer();
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Returns the fullscreen mode container element.
|
|
207
|
+
*/
|
|
208
|
+
getWrapper() {
|
|
209
|
+
if (!this._wrapper) {
|
|
210
|
+
this._wrapper = createElement(this._document, "div", { class: "ck ck-fullscreen__main-wrapper" });
|
|
211
|
+
this._wrapper.innerHTML = `
|
|
192
212
|
<div class="ck ck-fullscreen__top-wrapper ck-reset_all">
|
|
193
213
|
<div class="ck ck-fullscreen__menu-bar" data-ck-fullscreen="menu-bar"></div>
|
|
194
214
|
<div class="ck ck-fullscreen__toolbar" data-ck-fullscreen="toolbar"></div>
|
|
@@ -205,917 +225,796 @@ const DIALOG_OFFSET = 28;
|
|
|
205
225
|
<div class="ck ck-fullscreen__body-wrapper" data-ck-fullscreen="body-wrapper"></div>
|
|
206
226
|
</div>
|
|
207
227
|
`;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
this._savedAncestorsScrollPositions.clear();
|
|
340
|
-
// Pagination has to be restored after leaving fullscreen mode to ensure proper rendering.
|
|
341
|
-
// Code coverage is provided in the commercial package repository as integration unit tests.
|
|
342
|
-
/* istanbul ignore next -- @preserve */ if (this._editor.plugins.has('Pagination') && this._editor.plugins.get('Pagination').isEnabled) {
|
|
343
|
-
const paginationRenderer = this._editor.plugins.get('PaginationRenderer');
|
|
344
|
-
paginationRenderer.setupScrollableAncestor();
|
|
345
|
-
paginationRenderer.linesRepository.setViewCollection(this._editor.ui.view.body);
|
|
346
|
-
this._paginationBodyCollection.detachFromDom();
|
|
347
|
-
this._paginationBodyCollection?.destroy();
|
|
348
|
-
}
|
|
349
|
-
// Also dialog position needs to be recalculated after leaving fullscreen mode.
|
|
350
|
-
if (this._editor.plugins.has('Dialog')) {
|
|
351
|
-
this._unregisterFullscreenDialogPositionAdjustments();
|
|
352
|
-
}
|
|
353
|
-
// Reset the behavior of the left sidebar.
|
|
354
|
-
this._keepLeftSidebarHidden = false;
|
|
355
|
-
this._resizeObserver?.destroy();
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* @inheritDoc
|
|
359
|
-
*/ destroy() {
|
|
360
|
-
for (const { placeholderElement, movedElement } of this._placeholderMap.values()){
|
|
361
|
-
placeholderElement.remove();
|
|
362
|
-
movedElement.remove();
|
|
363
|
-
}
|
|
364
|
-
this._destroyContainer();
|
|
365
|
-
this._document.body.classList.remove('ck-fullscreen');
|
|
366
|
-
this._document.body.parentElement.classList.remove('ck-fullscreen');
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* A function that moves the editor UI elements to the fullscreen mode. It should be set by the particular editor type handler.
|
|
370
|
-
*
|
|
371
|
-
* Returns the fullscreen mode container element so it can be further customized via
|
|
372
|
-
* `fullscreen.onEnterCallback` configuration property.
|
|
373
|
-
*/ defaultOnEnter() {
|
|
374
|
-
return this.getWrapper();
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Destroys the fullscreen mode container.
|
|
378
|
-
*/ _destroyContainer() {
|
|
379
|
-
if (!this._wrapper) {
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
this._wrapper.remove();
|
|
383
|
-
this._wrapper = null;
|
|
384
|
-
// Restore visibility of all other elements in the container.
|
|
385
|
-
for (const [element, displayValue] of this._hiddenElements){
|
|
386
|
-
element.style.display = displayValue;
|
|
387
|
-
}
|
|
388
|
-
this._hiddenElements.clear();
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Checks if the PresenceListUI plugin is available and moves its elements to fullscreen mode.
|
|
392
|
-
*/ // Code coverage is provided in the commercial package repository as integration unit tests.
|
|
393
|
-
/* istanbul ignore next -- @preserve */ _generatePresenceListContainer() {
|
|
394
|
-
const t = this._editor.t;
|
|
395
|
-
const presenceListElement = createElement(document, 'div', {
|
|
396
|
-
class: 'ck ck-fullscreen__left-sidebar-item'
|
|
397
|
-
});
|
|
398
|
-
presenceListElement.innerHTML = `
|
|
228
|
+
this._editor.config.get("fullscreen.container").appendChild(this._wrapper);
|
|
229
|
+
}
|
|
230
|
+
return this._wrapper;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Enables the fullscreen mode. It executes the editor-specific enable handler and then the configured callback.
|
|
234
|
+
*/
|
|
235
|
+
enable() {
|
|
236
|
+
this._saveAncestorsScrollPositions(this._editor.ui.getEditableElement());
|
|
237
|
+
this.defaultOnEnter();
|
|
238
|
+
if (this._editor.config.get("fullscreen.container") === this._document.body) {
|
|
239
|
+
this._document.body.classList.add("ck-fullscreen");
|
|
240
|
+
this._document.body.parentElement.classList.add("ck-fullscreen");
|
|
241
|
+
}
|
|
242
|
+
/* v8 ignore if -- @preserve */
|
|
243
|
+
if (this._editor.plugins.has("PresenceListUI")) this._generatePresenceListContainer();
|
|
244
|
+
/* v8 ignore if -- @preserve */
|
|
245
|
+
if (this._editor.plugins.has("DocumentOutlineUI")) this._generateDocumentOutlineContainer();
|
|
246
|
+
if (this._hasLeftCollapseButton) this._generateCollapseButton();
|
|
247
|
+
/* v8 ignore next -- @preserve */
|
|
248
|
+
if (this._editor.plugins.has("Pagination") && this._editor.plugins.get("Pagination").isEnabled) {
|
|
249
|
+
const paginationRenderer = this._editor.plugins.get("PaginationRenderer");
|
|
250
|
+
paginationRenderer.setupScrollableAncestor();
|
|
251
|
+
this._paginationBodyCollection = new BodyCollection(this._editor.locale);
|
|
252
|
+
this._paginationBodyCollection.attachToDom();
|
|
253
|
+
paginationRenderer.linesRepository.setViewCollection(this._paginationBodyCollection);
|
|
254
|
+
this._editor.once("destroy", () => {
|
|
255
|
+
this._paginationBodyCollection.detachFromDom();
|
|
256
|
+
});
|
|
257
|
+
this.moveToFullscreen(this._paginationBodyCollection.bodyCollectionContainer, "body-wrapper");
|
|
258
|
+
}
|
|
259
|
+
/* v8 ignore if -- @preserve */
|
|
260
|
+
if (this._editor.plugins.has("AnnotationsUIs")) this._overrideAnnotationsUIs();
|
|
261
|
+
if (this._editor.plugins.has("RevisionHistory")) {
|
|
262
|
+
/* v8 ignore if -- @preserve */
|
|
263
|
+
if (this._editor.plugins.get("RevisionHistory").isRevisionViewerOpen) this._editor.config.get("revisionHistory.closeRevisionViewerCallback")();
|
|
264
|
+
this._overrideRevisionHistoryCallbacks();
|
|
265
|
+
}
|
|
266
|
+
/* v8 ignore if -- @preserve */
|
|
267
|
+
if (this._editor.plugins.has("AITabs")) this._handleAITabsTransfer();
|
|
268
|
+
if (this._editor.plugins.has("SourceEditing") && this._editor.plugins.has("DocumentOutlineUI")) this._editor.plugins.get("SourceEditing").on("change:isSourceEditingMode", this._sourceEditingCallback);
|
|
269
|
+
if (this._editor.plugins.has("Dialog")) this._registerFullscreenDialogPositionAdjustments();
|
|
270
|
+
for (const element of this._editor.config.get("fullscreen.container").children) if (element !== this._wrapper && !element.classList.contains("ck-body-wrapper") && !element.classList.contains("ckbox-wrapper") && element.style.display !== "none") {
|
|
271
|
+
this._hiddenElements.set(element, element.style.display);
|
|
272
|
+
element.style.display = "none";
|
|
273
|
+
}
|
|
274
|
+
this._sidebarsWidths = {
|
|
275
|
+
left: this._wrapper.querySelector(".ck-fullscreen__left-sidebar").scrollWidth,
|
|
276
|
+
right: this._wrapper.querySelector(".ck-fullscreen__right-sidebar").scrollWidth
|
|
277
|
+
};
|
|
278
|
+
this._adjustVisibleElements();
|
|
279
|
+
this._setupResizeObserver();
|
|
280
|
+
if (this._editor.config.get("fullscreen.onEnterCallback")) this._editor.config.get("fullscreen.onEnterCallback")(this.getWrapper());
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Disables the fullscreen mode by restoring all moved elements and destroying the fullscreen container.
|
|
284
|
+
*/
|
|
285
|
+
disable() {
|
|
286
|
+
if (this._editor.config.get("fullscreen.onLeaveCallback")) this._editor.config.get("fullscreen.onLeaveCallback")(this.getWrapper());
|
|
287
|
+
this._document.body.classList.remove("ck-fullscreen");
|
|
288
|
+
this._document.body.parentElement.classList.remove("ck-fullscreen");
|
|
289
|
+
/* v8 ignore if -- @preserve */
|
|
290
|
+
if (this._editor.plugins.has("DocumentOutlineUI")) this._restoreDocumentOutlineDefaultContainer();
|
|
291
|
+
/* v8 ignore if -- @preserve */
|
|
292
|
+
if (this._annotationsUIsData) this._restoreAnnotationsUIs();
|
|
293
|
+
if (this._editor.plugins.has("RevisionHistory")) this._restoreRevisionHistoryCallbacks();
|
|
294
|
+
/* v8 ignore if -- @preserve */
|
|
295
|
+
if (this._editor.plugins.has("AITabs")) this._restoreAITabs();
|
|
296
|
+
if (this._editor.plugins.has("SourceEditing") && this._editor.plugins.has("DocumentOutlineUI")) this._editor.plugins.get("SourceEditing").off("change:isSourceEditingMode", this._sourceEditingCallback);
|
|
297
|
+
for (const placeholderName of this._placeholderMap.keys()) this.restoreMovedElementLocation(placeholderName);
|
|
298
|
+
this._destroyContainer();
|
|
299
|
+
if (this._editor.ui.view.toolbar) this._editor.ui.view.toolbar.switchBehavior(this._editor.config.get("toolbar.shouldNotGroupWhenFull") === true ? "static" : "dynamic");
|
|
300
|
+
for (const [ancestor, value] of this._savedAncestorsScrollPositions) ancestor.scrollTo({
|
|
301
|
+
left: value.scrollLeft,
|
|
302
|
+
top: value.scrollTop,
|
|
303
|
+
behavior: "instant"
|
|
304
|
+
});
|
|
305
|
+
this._savedAncestorsScrollPositions.clear();
|
|
306
|
+
/* v8 ignore next -- @preserve */
|
|
307
|
+
if (this._editor.plugins.has("Pagination") && this._editor.plugins.get("Pagination").isEnabled) {
|
|
308
|
+
const paginationRenderer = this._editor.plugins.get("PaginationRenderer");
|
|
309
|
+
paginationRenderer.setupScrollableAncestor();
|
|
310
|
+
paginationRenderer.linesRepository.setViewCollection(this._editor.ui.view.body);
|
|
311
|
+
this._paginationBodyCollection.detachFromDom();
|
|
312
|
+
this._paginationBodyCollection?.destroy();
|
|
313
|
+
}
|
|
314
|
+
if (this._editor.plugins.has("Dialog")) this._unregisterFullscreenDialogPositionAdjustments();
|
|
315
|
+
this._keepLeftSidebarHidden = false;
|
|
316
|
+
this._resizeObserver?.destroy();
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* @inheritDoc
|
|
320
|
+
*/
|
|
321
|
+
destroy() {
|
|
322
|
+
for (const { placeholderElement, movedElement } of this._placeholderMap.values()) {
|
|
323
|
+
placeholderElement.remove();
|
|
324
|
+
movedElement.remove();
|
|
325
|
+
}
|
|
326
|
+
this._destroyContainer();
|
|
327
|
+
this._document.body.classList.remove("ck-fullscreen");
|
|
328
|
+
this._document.body.parentElement.classList.remove("ck-fullscreen");
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* A function that moves the editor UI elements to the fullscreen mode. It should be set by the particular editor type handler.
|
|
332
|
+
*
|
|
333
|
+
* Returns the fullscreen mode container element so it can be further customized via
|
|
334
|
+
* `fullscreen.onEnterCallback` configuration property.
|
|
335
|
+
*/
|
|
336
|
+
defaultOnEnter() {
|
|
337
|
+
return this.getWrapper();
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Destroys the fullscreen mode container.
|
|
341
|
+
*/
|
|
342
|
+
_destroyContainer() {
|
|
343
|
+
if (!this._wrapper) return;
|
|
344
|
+
this._wrapper.remove();
|
|
345
|
+
this._wrapper = null;
|
|
346
|
+
for (const [element, displayValue] of this._hiddenElements) element.style.display = displayValue;
|
|
347
|
+
this._hiddenElements.clear();
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Checks if the PresenceListUI plugin is available and moves its elements to fullscreen mode.
|
|
351
|
+
*/
|
|
352
|
+
/* v8 ignore next -- @preserve */
|
|
353
|
+
_generatePresenceListContainer() {
|
|
354
|
+
const t = this._editor.t;
|
|
355
|
+
const presenceListElement = createElement(document, "div", { class: "ck ck-fullscreen__left-sidebar-item" });
|
|
356
|
+
presenceListElement.innerHTML = `
|
|
399
357
|
<div class="ck ck-fullscreen__left-sidebar-header"></div>
|
|
400
358
|
<div class="ck ck-fullscreen__presence-list" data-ck-fullscreen="presence-list"></div>
|
|
401
359
|
`;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
class: 'ck-fullscreen__left-sidebar-item ck-fullscreen__left-sidebar-item--no-margin'
|
|
421
|
-
});
|
|
422
|
-
documentOutlineHeaderElement.innerHTML = `
|
|
360
|
+
presenceListElement.firstElementChild.innerText = t("Connected users");
|
|
361
|
+
if (!document.querySelector("[data-ck-fullscreen=\"left-sidebar-sticky\"]")) document.querySelector("[data-ck-fullscreen=\"left-sidebar\"]").appendChild(createElement(document, "div", {
|
|
362
|
+
class: "ck ck-fullscreen__left-sidebar-sticky",
|
|
363
|
+
"data-ck-fullscreen": "left-sidebar-sticky"
|
|
364
|
+
}));
|
|
365
|
+
document.querySelector("[data-ck-fullscreen=\"left-sidebar-sticky\"]").appendChild(presenceListElement);
|
|
366
|
+
const presenceListUI = this._editor.plugins.get("PresenceListUI");
|
|
367
|
+
this.moveToFullscreen(presenceListUI.view.element, "presence-list");
|
|
368
|
+
this._hasLeftCollapseButton = true;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Checks if the DocumentOutlineUI plugin is available and moves its elements to fullscreen mode.
|
|
372
|
+
*/
|
|
373
|
+
/* v8 ignore next -- @preserve */
|
|
374
|
+
_generateDocumentOutlineContainer() {
|
|
375
|
+
const t = this._editor.t;
|
|
376
|
+
const documentOutlineHeaderElement = createElement(document, "div", { class: "ck-fullscreen__left-sidebar-item ck-fullscreen__left-sidebar-item--no-margin" });
|
|
377
|
+
documentOutlineHeaderElement.innerHTML = `
|
|
423
378
|
<div class="ck ck-fullscreen__left-sidebar-header ck-fullscreen__document-outline-header"></div>
|
|
424
379
|
`;
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
});
|
|
429
|
-
documentOutlineBodyWrapper.innerHTML = `
|
|
380
|
+
documentOutlineHeaderElement.firstElementChild.innerText = t("Document outline");
|
|
381
|
+
const documentOutlineBodyWrapper = createElement(document, "div", { class: "ck ck-fullscreen__left-sidebar-item ck-fullscreen__document-outline-wrapper" });
|
|
382
|
+
documentOutlineBodyWrapper.innerHTML = `
|
|
430
383
|
<div class="ck ck-fullscreen__document-outline" data-ck-fullscreen="document-outline"></div>
|
|
431
384
|
`;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
annotationsUIs.deactivateAll();
|
|
749
|
-
const annotationsFilters = new Map();
|
|
750
|
-
for (const [uiName, data] of [
|
|
751
|
-
...this._annotationsUIsData
|
|
752
|
-
]){
|
|
753
|
-
// Default filter is `() => true`. Only store filters that are different.
|
|
754
|
-
if (data.filter !== annotationsUIs.defaultFilter) {
|
|
755
|
-
annotationsFilters.set(uiName, data.filter);
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
// First, check if someone has a filter defined for requested UI. If so, retrieve and apply it in fullscreen.
|
|
759
|
-
if (annotationsFilters.has(uiName)) {
|
|
760
|
-
annotationsUIs.activate(uiName, annotationsFilters.get(uiName));
|
|
761
|
-
} else if (annotationsFilters.size) {
|
|
762
|
-
annotationsUIs.activate(uiName, (annotation)=>[
|
|
763
|
-
...annotationsFilters.values()
|
|
764
|
-
].some((filter)=>filter(annotation)));
|
|
765
|
-
} else {
|
|
766
|
-
annotationsUIs.switchTo(uiName);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* Sets up a resize observer to adjust the visibility of the left and right sidebars dynamically.
|
|
771
|
-
*/ _setupResizeObserver() {
|
|
772
|
-
const wrapper = this._wrapper.querySelector('.ck-fullscreen__editable-wrapper');
|
|
773
|
-
if (this._resizeObserver) {
|
|
774
|
-
this._resizeObserver.destroy();
|
|
775
|
-
}
|
|
776
|
-
this._resizeObserver = new ResizeObserver(wrapper, ()=>{
|
|
777
|
-
this._adjustVisibleElements();
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* Hides the left sidebar. Works only if there is anything to hide.
|
|
782
|
-
*/ // Code coverage is provided in the commercial package repository as integration unit tests.
|
|
783
|
-
/* istanbul ignore next -- @preserve */ _hideLeftSidebar() {
|
|
784
|
-
const t = this._editor.t;
|
|
785
|
-
if (this._collapseLeftSidebarButton) {
|
|
786
|
-
const leftSidebar = this._wrapper.querySelector('.ck-fullscreen__left-sidebar');
|
|
787
|
-
leftSidebar.classList.add('ck-fullscreen__left-sidebar--collapsed');
|
|
788
|
-
this._collapseLeftSidebarButton.icon = IconDocumentOutlineToggle;
|
|
789
|
-
this._collapseLeftSidebarButton.tooltip = t('Show left sidebar');
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* Shows the left sidebar. Works only if there is anything to show.
|
|
794
|
-
*/ // Code coverage is provided in the commercial package repository as integration unit tests.
|
|
795
|
-
/* istanbul ignore next -- @preserve */ _showLeftSidebar() {
|
|
796
|
-
const t = this._editor.t;
|
|
797
|
-
if (this._collapseLeftSidebarButton) {
|
|
798
|
-
const leftSidebar = this._wrapper.querySelector('.ck-fullscreen__left-sidebar');
|
|
799
|
-
leftSidebar.classList.remove('ck-fullscreen__left-sidebar--collapsed');
|
|
800
|
-
this._collapseLeftSidebarButton.icon = IconPreviousArrow;
|
|
801
|
-
this._collapseLeftSidebarButton.tooltip = t('Hide left sidebar');
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
/**
|
|
805
|
-
* Hides the right sidebar. Works only if there is anything to hide.
|
|
806
|
-
*/ _hideRightSidebar() {
|
|
807
|
-
if (this._wrapper.querySelector('.ck-fullscreen__right-sidebar').firstChild) {
|
|
808
|
-
this._switchAnnotationsUI('narrowSidebar');
|
|
809
|
-
this._wrapper.querySelector('.ck-fullscreen__right-sidebar').classList.add('ck-fullscreen__right-sidebar--collapsed');
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
/**
|
|
813
|
-
* Shows the right sidebar. Works only if there is anything to show.
|
|
814
|
-
*/ _showRightSidebar() {
|
|
815
|
-
if (this._wrapper.querySelector('.ck-fullscreen__right-sidebar').firstChild) {
|
|
816
|
-
this._switchAnnotationsUI('wideSidebar');
|
|
817
|
-
this._wrapper.querySelector('.ck-fullscreen__right-sidebar').classList.remove('ck-fullscreen__right-sidebar--collapsed');
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
/**
|
|
821
|
-
* Handler for AI tabs `transitionend`; must be the same reference in `addEventListener` / `removeEventListener`.
|
|
822
|
-
*/ _aiTabsTransitionEndCallback = (evt)=>{
|
|
823
|
-
this._handleAISidebarTransitions(evt);
|
|
824
|
-
};
|
|
825
|
-
}
|
|
385
|
+
if (!document.querySelector("[data-ck-fullscreen=\"left-sidebar-sticky\"]")) document.querySelector("[data-ck-fullscreen=\"left-sidebar\"]").appendChild(createElement(document, "div", {
|
|
386
|
+
class: "ck ck-fullscreen__left-sidebar-sticky",
|
|
387
|
+
"data-ck-fullscreen": "left-sidebar-sticky"
|
|
388
|
+
}));
|
|
389
|
+
document.querySelector("[data-ck-fullscreen=\"left-sidebar\"]").appendChild(documentOutlineBodyWrapper);
|
|
390
|
+
document.querySelector("[data-ck-fullscreen=\"left-sidebar-sticky\"]").appendChild(documentOutlineHeaderElement);
|
|
391
|
+
const documentOutlineUI = this._editor.plugins.get("DocumentOutlineUI");
|
|
392
|
+
documentOutlineUI.view.documentOutlineContainer = document.querySelector("[data-ck-fullscreen=\"left-sidebar\"]");
|
|
393
|
+
this.moveToFullscreen(documentOutlineUI.view.element, "document-outline");
|
|
394
|
+
this._hasLeftCollapseButton = true;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Restores the default value of documentOutlineContainer, which is modified in fullscreen mode.
|
|
398
|
+
*/
|
|
399
|
+
/* v8 ignore next -- @preserve */
|
|
400
|
+
_restoreDocumentOutlineDefaultContainer() {
|
|
401
|
+
const documentOutlineUI = this._editor.plugins.get("DocumentOutlineUI");
|
|
402
|
+
documentOutlineUI.view.documentOutlineContainer = documentOutlineUI.view.element;
|
|
403
|
+
}
|
|
404
|
+
/* v8 ignore next -- @preserve */
|
|
405
|
+
_generateCollapseButton() {
|
|
406
|
+
const button = new ButtonView(this._editor.locale);
|
|
407
|
+
const leftSidebarContainer = document.querySelector(".ck-fullscreen__left-sidebar");
|
|
408
|
+
const t = this._editor.t;
|
|
409
|
+
button.set({
|
|
410
|
+
label: t("Toggle sidebar"),
|
|
411
|
+
class: "ck-fullscreen__left-sidebar-toggle-button",
|
|
412
|
+
tooltip: t("Hide left sidebar"),
|
|
413
|
+
tooltipPosition: "se",
|
|
414
|
+
icon: IconPreviousArrow
|
|
415
|
+
});
|
|
416
|
+
button.on("execute", () => {
|
|
417
|
+
if (leftSidebarContainer.classList.contains("ck-fullscreen__left-sidebar--collapsed")) {
|
|
418
|
+
this._forceShowLeftSidebar = true;
|
|
419
|
+
this._keepLeftSidebarHidden = false;
|
|
420
|
+
this._showLeftSidebar();
|
|
421
|
+
} else {
|
|
422
|
+
this._keepLeftSidebarHidden = true;
|
|
423
|
+
this._hideLeftSidebar();
|
|
424
|
+
}
|
|
425
|
+
this._editor.editing.view.focus();
|
|
426
|
+
});
|
|
427
|
+
button.render();
|
|
428
|
+
this._collapseLeftSidebarButton = button;
|
|
429
|
+
leftSidebarContainer.prepend(button.element);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Stores the current state of the annotations UIs to restore it when leaving fullscreen mode and switches the UI to the wide sidebar.
|
|
433
|
+
*/
|
|
434
|
+
/* v8 ignore next -- @preserve */
|
|
435
|
+
_overrideAnnotationsUIs() {
|
|
436
|
+
const annotationsUIs = this._editor.plugins.get("AnnotationsUIs");
|
|
437
|
+
this._annotationsUIsData = new Map(annotationsUIs.uisData);
|
|
438
|
+
annotationsUIs.deactivateAll();
|
|
439
|
+
const sidebarPlugin = this._editor.plugins.get("Sidebar");
|
|
440
|
+
if (!sidebarPlugin.container) {
|
|
441
|
+
sidebarPlugin.setContainer(this.getWrapper().querySelector("[data-ck-fullscreen=\"right-sidebar\"]"));
|
|
442
|
+
this._switchAnnotationsUI("wideSidebar");
|
|
443
|
+
this.moveToFullscreen(sidebarPlugin.container.firstElementChild, "right-sidebar");
|
|
444
|
+
} else {
|
|
445
|
+
this._switchAnnotationsUI("wideSidebar");
|
|
446
|
+
this.moveToFullscreen(sidebarPlugin.container.firstElementChild, "right-sidebar");
|
|
447
|
+
sidebarPlugin.setContainer(this.getWrapper().querySelector("[data-ck-fullscreen=\"right-sidebar\"]"));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Restores the saved state of the annotations UIs.
|
|
452
|
+
*/
|
|
453
|
+
/* v8 ignore next -- @preserve */
|
|
454
|
+
_restoreAnnotationsUIs() {
|
|
455
|
+
const sidebarPlugin = this._editor.plugins.get("Sidebar");
|
|
456
|
+
const sidebarContainer = sidebarPlugin.context.config.get("sidebar.container");
|
|
457
|
+
if (sidebarContainer) sidebarPlugin.setContainer(sidebarContainer);
|
|
458
|
+
const annotationsUIs = this._editor.plugins.get("AnnotationsUIs");
|
|
459
|
+
annotationsUIs.deactivateAll();
|
|
460
|
+
for (const [uiName, data] of [...this._annotationsUIsData]) annotationsUIs.activate(uiName, data.filter);
|
|
461
|
+
this._annotationsUIsData = null;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Modifies the revision history viewer callbacks to display the viewer in the fullscreen mode.
|
|
465
|
+
*/
|
|
466
|
+
_overrideRevisionHistoryCallbacks() {
|
|
467
|
+
/* v8 ignore next -- @preserve */
|
|
468
|
+
this._editor.config.set("revisionHistory.showRevisionViewerCallback", async () => {
|
|
469
|
+
const revisionViewerEditor = await this._showRevisionViewerCallback();
|
|
470
|
+
if (this._editor.plugins.has("DocumentOutlineUI")) this.getWrapper().querySelector(".ck-fullscreen__document-outline-header").style.display = "none";
|
|
471
|
+
this.restoreMovedElementLocation("editable");
|
|
472
|
+
this.restoreMovedElementLocation("toolbar");
|
|
473
|
+
this.restoreMovedElementLocation("right-sidebar");
|
|
474
|
+
if (this._annotationsUIsData) this._restoreAnnotationsUIs();
|
|
475
|
+
if (this._editor.ui.view.menuBarView) this._editor.ui.view.menuBarView.disable();
|
|
476
|
+
this.moveToFullscreen(revisionViewerEditor.ui.getEditableElement(), "editable");
|
|
477
|
+
this.moveToFullscreen(revisionViewerEditor.ui.view.toolbar.element, "toolbar");
|
|
478
|
+
this.moveToFullscreen(this._editor.config.get("revisionHistory.viewerSidebarContainer"), "right-sidebar");
|
|
479
|
+
return revisionViewerEditor;
|
|
480
|
+
});
|
|
481
|
+
/* v8 ignore next -- @preserve */
|
|
482
|
+
this._editor.config.set("revisionHistory.closeRevisionViewerCallback", async () => {
|
|
483
|
+
this.restoreMovedElementLocation("toolbar");
|
|
484
|
+
this.restoreMovedElementLocation("editable");
|
|
485
|
+
this.restoreMovedElementLocation("right-sidebar");
|
|
486
|
+
if (this._editor.plugins.has("DocumentOutlineUI")) this.getWrapper().querySelector(".ck-fullscreen__document-outline-header").style.display = "";
|
|
487
|
+
this.moveToFullscreen(this._editor.ui.getEditableElement(), "editable");
|
|
488
|
+
this.moveToFullscreen(this._editor.ui.view.toolbar.element, "toolbar");
|
|
489
|
+
await this._closeRevisionViewerCallback();
|
|
490
|
+
if (this._editor.plugins.has("AnnotationsUIs")) this._overrideAnnotationsUIs();
|
|
491
|
+
if (this._editor.ui.view.menuBarView) this._editor.ui.view.menuBarView.enable();
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Resets the revision history viewer callbacks to their original values.
|
|
496
|
+
*/
|
|
497
|
+
_restoreRevisionHistoryCallbacks() {
|
|
498
|
+
/* v8 ignore next -- @preserve */
|
|
499
|
+
this._editor.config.set("revisionHistory.showRevisionViewerCallback", async () => {
|
|
500
|
+
return this._showRevisionViewerCallback();
|
|
501
|
+
});
|
|
502
|
+
/* v8 ignore next -- @preserve */
|
|
503
|
+
this._editor.config.set("revisionHistory.closeRevisionViewerCallback", async () => {
|
|
504
|
+
return this._closeRevisionViewerCallback();
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Adds an event listener when the dialog opens to adjust its position in fullscreen mode,
|
|
509
|
+
* utilizing the empty space on the right side of the editable element.
|
|
510
|
+
*/
|
|
511
|
+
_registerFullscreenDialogPositionAdjustments() {
|
|
512
|
+
const dialog = this._editor.plugins.get("Dialog");
|
|
513
|
+
this._setNewDialogPosition();
|
|
514
|
+
dialog.on("change:isOpen", this.updateDialogPositionCallback, { priority: "highest" });
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Removes an event listener that adjusts the dialog's position in fullscreen mode.
|
|
518
|
+
*/
|
|
519
|
+
_unregisterFullscreenDialogPositionAdjustments() {
|
|
520
|
+
const dialog = this._editor.plugins.get("Dialog");
|
|
521
|
+
const dialogView = dialog.view;
|
|
522
|
+
if (dialogView && dialogView.position === null) dialogView.position = DialogViewPosition.EDITOR_TOP_SIDE;
|
|
523
|
+
if (dialogView) dialogView.updatePosition();
|
|
524
|
+
dialog.off("change:isOpen", this.updateDialogPositionCallback);
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Stores a bound reference to the _updateDialogPosition method, allowing it to be attached and detached from change event.
|
|
528
|
+
*/
|
|
529
|
+
updateDialogPositionCallback = this._updateDialogPosition.bind(this);
|
|
530
|
+
/**
|
|
531
|
+
* If dialog is open, adjust its positioning.
|
|
532
|
+
*/
|
|
533
|
+
_updateDialogPosition(_evt, _name, isOpen) {
|
|
534
|
+
if (isOpen) this._setNewDialogPosition();
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Adjusts the dialog position to utilize the empty space on the right side of the editable.
|
|
538
|
+
* The new dialog position should be on the right side of the fullscreen view with a 30px margin.
|
|
539
|
+
* Only dialogs with the position set to "editor-top-side" should have their position changed.
|
|
540
|
+
*/
|
|
541
|
+
_setNewDialogPosition() {
|
|
542
|
+
const dialogView = this._editor.plugins.get("Dialog").view;
|
|
543
|
+
if (!dialogView || dialogView.position !== DialogViewPosition.EDITOR_TOP_SIDE) return;
|
|
544
|
+
const keepRightEdgeContainerVisible = new Rect(this._wrapper.querySelector(".ck-fullscreen__right-edge")).getVisible();
|
|
545
|
+
const relativeContainerRect = new Rect(keepRightEdgeContainerVisible ? this._wrapper.querySelector(".ck-fullscreen__right-edge") : this._wrapper).getVisible();
|
|
546
|
+
const editorContainerRect = new Rect(document.querySelector(".ck-fullscreen__editable")).getVisible();
|
|
547
|
+
const dialogRect = new Rect(dialogView.element.querySelector(".ck-dialog")).getVisible();
|
|
548
|
+
const scrollOffset = new Rect(document.querySelector(".ck-fullscreen__editable-wrapper")).excludeScrollbarsAndBorders().getVisible().width - new Rect(document.querySelector(".ck-fullscreen__editable-wrapper")).getVisible().width;
|
|
549
|
+
if (relativeContainerRect && editorContainerRect && dialogRect) {
|
|
550
|
+
dialogView.position = null;
|
|
551
|
+
const leftOffset = keepRightEdgeContainerVisible ? relativeContainerRect.left - dialogRect.width - DIALOG_OFFSET : relativeContainerRect.left + relativeContainerRect.width - dialogRect.width - DIALOG_OFFSET + scrollOffset;
|
|
552
|
+
dialogView.moveTo(leftOffset, editorContainerRect.top);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Saves the scroll positions of all ancestors of the given element.
|
|
557
|
+
*/
|
|
558
|
+
_saveAncestorsScrollPositions(domElement) {
|
|
559
|
+
let element = domElement.parentElement;
|
|
560
|
+
if (!element) return;
|
|
561
|
+
while (element) {
|
|
562
|
+
const overflowY = element.style.overflowY || global.window.getComputedStyle(element).overflowY;
|
|
563
|
+
const overflowX = element.style.overflowX || global.window.getComputedStyle(element).overflowX;
|
|
564
|
+
if (overflowY === "auto" || overflowY === "scroll" || overflowX === "auto" || overflowX === "scroll") this._savedAncestorsScrollPositions.set(element, {
|
|
565
|
+
scrollLeft: element.scrollLeft,
|
|
566
|
+
scrollTop: element.scrollTop
|
|
567
|
+
});
|
|
568
|
+
else if (element.tagName === "HTML") this._savedAncestorsScrollPositions.set(element, {
|
|
569
|
+
scrollLeft: element.scrollLeft,
|
|
570
|
+
scrollTop: element.scrollTop
|
|
571
|
+
});
|
|
572
|
+
element = element.parentElement;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Stores the current state of the AI Tabs and moves it to the fullscreen mode.
|
|
577
|
+
*/
|
|
578
|
+
/* v8 ignore next -- @preserve */
|
|
579
|
+
_handleAITabsTransfer() {
|
|
580
|
+
const aiTabs = this._editor.plugins.get("AITabs");
|
|
581
|
+
this._aiTabsData = {
|
|
582
|
+
side: aiTabs.side,
|
|
583
|
+
type: aiTabs.type
|
|
584
|
+
};
|
|
585
|
+
this.moveToFullscreen(aiTabs.view.element, "right-edge");
|
|
586
|
+
aiTabs.side = "right";
|
|
587
|
+
aiTabs.type = "sidebar";
|
|
588
|
+
aiTabs.view.element.addEventListener("transitionend", this._aiTabsTransitionEndCallback);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Checks the transition event to see if it's changing the width of the AI tabs and if so, adjusts the visible fullscreen mode elements.
|
|
592
|
+
*/
|
|
593
|
+
_handleAISidebarTransitions(evt) {
|
|
594
|
+
const aiTabs = this._editor.plugins.get("AITabs");
|
|
595
|
+
if (evt.target === aiTabs.view.element && evt.propertyName.includes("width")) this._adjustVisibleElements();
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Restores the state of the AI Tabs to the original values.
|
|
599
|
+
*/
|
|
600
|
+
/* v8 ignore next -- @preserve */
|
|
601
|
+
_restoreAITabs() {
|
|
602
|
+
const aiTabs = this._editor.plugins.get("AITabs");
|
|
603
|
+
aiTabs.side = this._aiTabsData?.side;
|
|
604
|
+
aiTabs.type = this._aiTabsData?.type;
|
|
605
|
+
this._aiTabsData = null;
|
|
606
|
+
aiTabs.view.element.removeEventListener("transitionend", this._aiTabsTransitionEndCallback);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Adjusts the visibility of the left and right sidebars based on the available space.
|
|
610
|
+
*/
|
|
611
|
+
_adjustVisibleElements() {
|
|
612
|
+
const editableWrapper = this._wrapper.querySelector(".ck-fullscreen__editable-wrapper");
|
|
613
|
+
if (this._forceShowLeftSidebar) {
|
|
614
|
+
this._forceShowLeftSidebar = false;
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
if (editableWrapper.scrollWidth > editableWrapper.clientWidth) {
|
|
618
|
+
this._hideLeftSidebar();
|
|
619
|
+
if (editableWrapper.scrollWidth > editableWrapper.clientWidth) this._hideRightSidebar();
|
|
620
|
+
} else {
|
|
621
|
+
let actualWidth = [...editableWrapper.children].reduce((acc, child) => acc + child.scrollWidth, 0);
|
|
622
|
+
if (actualWidth + this._sidebarsWidths.right < editableWrapper.clientWidth) {
|
|
623
|
+
this._showRightSidebar();
|
|
624
|
+
actualWidth = [...editableWrapper.children].reduce((acc, child) => acc + child.scrollWidth, 0);
|
|
625
|
+
}
|
|
626
|
+
if (actualWidth + this._sidebarsWidths.left < editableWrapper.clientWidth && !this._keepLeftSidebarHidden) this._showLeftSidebar();
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Switches the annotations UI to the requested one.
|
|
631
|
+
*/
|
|
632
|
+
/* v8 ignore next -- @preserve */
|
|
633
|
+
_switchAnnotationsUI(uiName) {
|
|
634
|
+
const annotationsUIs = this._editor.plugins.get("AnnotationsUIs");
|
|
635
|
+
annotationsUIs.deactivateAll();
|
|
636
|
+
const annotationsFilters = /* @__PURE__ */ new Map();
|
|
637
|
+
for (const [uiName, data] of [...this._annotationsUIsData]) if (data.filter !== annotationsUIs.defaultFilter) annotationsFilters.set(uiName, data.filter);
|
|
638
|
+
if (annotationsFilters.has(uiName)) annotationsUIs.activate(uiName, annotationsFilters.get(uiName));
|
|
639
|
+
else if (annotationsFilters.size) annotationsUIs.activate(uiName, (annotation) => [...annotationsFilters.values()].some((filter) => filter(annotation)));
|
|
640
|
+
else annotationsUIs.switchTo(uiName);
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Sets up a resize observer to adjust the visibility of the left and right sidebars dynamically.
|
|
644
|
+
*/
|
|
645
|
+
_setupResizeObserver() {
|
|
646
|
+
const wrapper = this._wrapper.querySelector(".ck-fullscreen__editable-wrapper");
|
|
647
|
+
if (this._resizeObserver) this._resizeObserver.destroy();
|
|
648
|
+
this._resizeObserver = new ResizeObserver(wrapper, () => {
|
|
649
|
+
this._adjustVisibleElements();
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Hides the left sidebar. Works only if there is anything to hide.
|
|
654
|
+
*/
|
|
655
|
+
/* v8 ignore next -- @preserve */
|
|
656
|
+
_hideLeftSidebar() {
|
|
657
|
+
const t = this._editor.t;
|
|
658
|
+
if (this._collapseLeftSidebarButton) {
|
|
659
|
+
this._wrapper.querySelector(".ck-fullscreen__left-sidebar").classList.add("ck-fullscreen__left-sidebar--collapsed");
|
|
660
|
+
this._collapseLeftSidebarButton.icon = IconDocumentOutlineToggle;
|
|
661
|
+
this._collapseLeftSidebarButton.tooltip = t("Show left sidebar");
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Shows the left sidebar. Works only if there is anything to show.
|
|
666
|
+
*/
|
|
667
|
+
/* v8 ignore next -- @preserve */
|
|
668
|
+
_showLeftSidebar() {
|
|
669
|
+
const t = this._editor.t;
|
|
670
|
+
if (this._collapseLeftSidebarButton) {
|
|
671
|
+
this._wrapper.querySelector(".ck-fullscreen__left-sidebar").classList.remove("ck-fullscreen__left-sidebar--collapsed");
|
|
672
|
+
this._collapseLeftSidebarButton.icon = IconPreviousArrow;
|
|
673
|
+
this._collapseLeftSidebarButton.tooltip = t("Hide left sidebar");
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Hides the right sidebar. Works only if there is anything to hide.
|
|
678
|
+
*/
|
|
679
|
+
_hideRightSidebar() {
|
|
680
|
+
if (this._wrapper.querySelector(".ck-fullscreen__right-sidebar").firstChild) {
|
|
681
|
+
this._switchAnnotationsUI("narrowSidebar");
|
|
682
|
+
this._wrapper.querySelector(".ck-fullscreen__right-sidebar").classList.add("ck-fullscreen__right-sidebar--collapsed");
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Shows the right sidebar. Works only if there is anything to show.
|
|
687
|
+
*/
|
|
688
|
+
_showRightSidebar() {
|
|
689
|
+
if (this._wrapper.querySelector(".ck-fullscreen__right-sidebar").firstChild) {
|
|
690
|
+
this._switchAnnotationsUI("wideSidebar");
|
|
691
|
+
this._wrapper.querySelector(".ck-fullscreen__right-sidebar").classList.remove("ck-fullscreen__right-sidebar--collapsed");
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Handler for AI tabs `transitionend`; must be the same reference in `addEventListener` / `removeEventListener`.
|
|
696
|
+
*/
|
|
697
|
+
_aiTabsTransitionEndCallback = (evt) => {
|
|
698
|
+
this._handleAISidebarTransitions(evt);
|
|
699
|
+
};
|
|
700
|
+
};
|
|
826
701
|
|
|
827
702
|
/**
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}
|
|
703
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
704
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
705
|
+
*/
|
|
706
|
+
/**
|
|
707
|
+
* @module fullscreen/handlers/classiceditorhandler
|
|
708
|
+
*/
|
|
709
|
+
/**
|
|
710
|
+
* The classic editor fullscreen mode handler.
|
|
711
|
+
*/
|
|
712
|
+
var FullscreenClassicEditorHandler = class extends FullscreenAbstractEditorHandler {
|
|
713
|
+
/**
|
|
714
|
+
* An editor instance.
|
|
715
|
+
*/
|
|
716
|
+
_editor;
|
|
717
|
+
/**
|
|
718
|
+
* @inheritDoc
|
|
719
|
+
*/
|
|
720
|
+
constructor(editor) {
|
|
721
|
+
super(editor);
|
|
722
|
+
this._editor = editor;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* A function that moves the editor UI elements to the fullscreen mode.
|
|
726
|
+
*/
|
|
727
|
+
defaultOnEnter() {
|
|
728
|
+
const editorUI = this._editor.ui;
|
|
729
|
+
const editorUIView = editorUI.view;
|
|
730
|
+
/* v8 ignore next -- @preserve */
|
|
731
|
+
if (this._editor.plugins.has("Pagination") && this._editor.plugins.get("Pagination").isEnabled) this.moveToFullscreen(editorUI.getEditableElement().parentElement.querySelector(".ck-pagination-view"), "pagination-view");
|
|
732
|
+
this.moveToFullscreen(editorUI.getEditableElement(), "editable");
|
|
733
|
+
this.moveToFullscreen(editorUIView.toolbar.element, "toolbar");
|
|
734
|
+
editorUIView.toolbar.switchBehavior(this._editor.config.get("fullscreen.toolbar.shouldNotGroupWhenFull") === true ? "static" : "dynamic");
|
|
735
|
+
this.getWrapper().setAttribute("dir", editorUIView.element.getAttribute("dir"));
|
|
736
|
+
this.getWrapper().classList.add("ck-rounded-corners");
|
|
737
|
+
if (this._editor.config.get("fullscreen.menuBar.isVisible")) {
|
|
738
|
+
if (!editorUIView.menuBarView) {
|
|
739
|
+
editorUIView.menuBarView = new MenuBarView(this._editor.locale);
|
|
740
|
+
editorUIView.menuBarView.render();
|
|
741
|
+
editorUI.initMenuBar(editorUIView.menuBarView);
|
|
742
|
+
}
|
|
743
|
+
this.moveToFullscreen(editorUIView.menuBarView.element, "menu-bar");
|
|
744
|
+
}
|
|
745
|
+
return this.getWrapper();
|
|
746
|
+
}
|
|
747
|
+
};
|
|
873
748
|
|
|
874
749
|
/**
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
750
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
751
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
752
|
+
*/
|
|
753
|
+
/**
|
|
754
|
+
* The decoupled editor fullscreen mode handler.
|
|
755
|
+
*/
|
|
756
|
+
var FullscreenDecoupledEditorHandler = class extends FullscreenAbstractEditorHandler {
|
|
757
|
+
/**
|
|
758
|
+
* An editor instance.
|
|
759
|
+
*/
|
|
760
|
+
_editor;
|
|
761
|
+
/**
|
|
762
|
+
* @inheritDoc
|
|
763
|
+
*/
|
|
764
|
+
constructor(editor) {
|
|
765
|
+
super(editor);
|
|
766
|
+
this._editor = editor;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* A function that moves the editor UI elements to the fullscreen mode.
|
|
770
|
+
*/
|
|
771
|
+
defaultOnEnter() {
|
|
772
|
+
/* v8 ignore next -- @preserve */
|
|
773
|
+
if (this._editor.plugins.has("Pagination") && this._editor.plugins.get("Pagination").isEnabled) this.moveToFullscreen(this._editor.ui.getEditableElement().parentElement.querySelector(".ck-pagination-view"), "pagination-view");
|
|
774
|
+
this.moveToFullscreen(this._editor.ui.getEditableElement(), "editable");
|
|
775
|
+
this.moveToFullscreen(this._editor.ui.view.toolbar.element, "toolbar");
|
|
776
|
+
this._editor.ui.view.toolbar.switchBehavior(this._editor.config.get("fullscreen.toolbar.shouldNotGroupWhenFull") === true ? "static" : "dynamic");
|
|
777
|
+
if (this._editor.config.get("fullscreen.menuBar.isVisible")) this.moveToFullscreen(this._editor.ui.view.menuBarView.element, "menu-bar");
|
|
778
|
+
return this.getWrapper();
|
|
779
|
+
}
|
|
780
|
+
};
|
|
902
781
|
|
|
903
782
|
/**
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
783
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
784
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
785
|
+
*/
|
|
786
|
+
/**
|
|
787
|
+
* @module fullscreen/fullscreencommand
|
|
788
|
+
*/
|
|
789
|
+
/**
|
|
790
|
+
* A command toggling the fullscreen mode.
|
|
791
|
+
*/
|
|
792
|
+
var FullscreenCommand = class extends Command {
|
|
793
|
+
/**
|
|
794
|
+
* Specialized class handling the fullscreen mode toggling for a specific editor type.
|
|
795
|
+
*
|
|
796
|
+
* If you want to add support for a new editor type (for now, only Classic and Decoupled editors are handled),
|
|
797
|
+
* create a custom handler that extends `FullscreenAbstractEditorHandler` and replace `fullscreenHandler` with it after
|
|
798
|
+
* editor initialization:
|
|
799
|
+
*
|
|
800
|
+
* ```ts
|
|
801
|
+
* // See the details of how to implement a custom handler in the `FullscreenAbstractEditorHandler` class API docs.
|
|
802
|
+
* class CustomEditorHandler extends FullscreenAbstractEditorHandler {}
|
|
803
|
+
*
|
|
804
|
+
* CustomEditorClass.create()
|
|
805
|
+
* .then( ( editor ) => {
|
|
806
|
+
* editor.commands.get( 'toggleFullscreen' ).fullscreenHandler = new CustomEditorHandler( editor );
|
|
807
|
+
* } );
|
|
808
|
+
* ```
|
|
809
|
+
*/
|
|
810
|
+
fullscreenHandler;
|
|
811
|
+
/**
|
|
812
|
+
* @inheritDoc
|
|
813
|
+
*/
|
|
814
|
+
constructor(editor) {
|
|
815
|
+
super(editor);
|
|
816
|
+
this.affectsData = false;
|
|
817
|
+
this.isEnabled = true;
|
|
818
|
+
this.value = false;
|
|
819
|
+
if (isClassicEditor(editor)) this.fullscreenHandler = new FullscreenClassicEditorHandler(editor);
|
|
820
|
+
else if (isDecoupledEditor(editor)) this.fullscreenHandler = new FullscreenDecoupledEditorHandler(editor);
|
|
821
|
+
else this.fullscreenHandler = new FullscreenAbstractEditorHandler(editor);
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Toggles the fullscreen mode.
|
|
825
|
+
*/
|
|
826
|
+
execute() {
|
|
827
|
+
if (this.value) this._disableFullscreenMode();
|
|
828
|
+
else this._enableFullscreenMode();
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Enables the fullscreen mode.
|
|
832
|
+
*/
|
|
833
|
+
_enableFullscreenMode() {
|
|
834
|
+
this.fullscreenHandler.enable();
|
|
835
|
+
this.value = true;
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Disables the fullscreen mode.
|
|
839
|
+
*/
|
|
840
|
+
_disableFullscreenMode() {
|
|
841
|
+
this.fullscreenHandler.disable();
|
|
842
|
+
this.value = false;
|
|
843
|
+
}
|
|
844
|
+
};
|
|
963
845
|
/**
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
846
|
+
* Classic editor typeguard.
|
|
847
|
+
*/
|
|
848
|
+
function isClassicEditor(editor) {
|
|
849
|
+
return editor.constructor.editorName === "ClassicEditor";
|
|
967
850
|
}
|
|
968
851
|
/**
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
852
|
+
* Decoupled editor typeguard.
|
|
853
|
+
*/
|
|
854
|
+
function isDecoupledEditor(editor) {
|
|
855
|
+
return editor.constructor.editorName === "DecoupledEditor";
|
|
972
856
|
}
|
|
973
857
|
|
|
974
858
|
/**
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
}
|
|
859
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
860
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
861
|
+
*/
|
|
862
|
+
/**
|
|
863
|
+
* @module fullscreen/fullscreenediting
|
|
864
|
+
*/
|
|
865
|
+
/**
|
|
866
|
+
* A plugin that registers the fullscreen mode command.
|
|
867
|
+
*/
|
|
868
|
+
var FullscreenEditing = class extends Plugin {
|
|
869
|
+
/**
|
|
870
|
+
* @inheritDoc
|
|
871
|
+
*/
|
|
872
|
+
static get pluginName() {
|
|
873
|
+
return "FullscreenEditing";
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* @inheritDoc
|
|
877
|
+
*/
|
|
878
|
+
static get isOfficialPlugin() {
|
|
879
|
+
return true;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* @inheritDoc
|
|
883
|
+
*/
|
|
884
|
+
constructor(editor) {
|
|
885
|
+
super(editor);
|
|
886
|
+
editor.config.define("fullscreen.menuBar.isVisible", true);
|
|
887
|
+
editor.config.define("fullscreen.toolbar.shouldNotGroupWhenFull", editor.config.get("toolbar.shouldNotGroupWhenFull") === true);
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* @inheritDoc
|
|
891
|
+
*/
|
|
892
|
+
init() {
|
|
893
|
+
this.editor.commands.add("toggleFullscreen", new FullscreenCommand(this.editor));
|
|
894
|
+
const t = this.editor.locale.t;
|
|
895
|
+
this.editor.keystrokes.set("Ctrl+Shift+F", (evt, cancel) => {
|
|
896
|
+
this.editor.execute("toggleFullscreen");
|
|
897
|
+
if (!env.isBlink) {
|
|
898
|
+
this.editor.editing.view.document.isFocused = false;
|
|
899
|
+
this.editor.ui.view.toolbar.focusTracker.focusedElement = null;
|
|
900
|
+
}
|
|
901
|
+
this.editor.editing.view.scrollToTheSelection();
|
|
902
|
+
this.editor.editing.view.focus();
|
|
903
|
+
cancel();
|
|
904
|
+
});
|
|
905
|
+
this.editor.accessibility.addKeystrokeInfos({
|
|
906
|
+
keystrokes: [{
|
|
907
|
+
label: t("Toggle fullscreen mode"),
|
|
908
|
+
keystroke: "CTRL+SHIFT+F"
|
|
909
|
+
}],
|
|
910
|
+
categoryId: "navigation"
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
};
|
|
1028
914
|
|
|
1029
|
-
const COMMAND_NAME = 'toggleFullscreen';
|
|
1030
915
|
/**
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
}
|
|
916
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
917
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
918
|
+
*/
|
|
919
|
+
/**
|
|
920
|
+
* @module fullscreen/fullscreenui
|
|
921
|
+
*/
|
|
922
|
+
const COMMAND_NAME = "toggleFullscreen";
|
|
923
|
+
/**
|
|
924
|
+
* A plugin registering the fullscreen mode buttons.
|
|
925
|
+
*/
|
|
926
|
+
var FullscreenUI = class extends Plugin {
|
|
927
|
+
/**
|
|
928
|
+
* @inheritDoc
|
|
929
|
+
*/
|
|
930
|
+
static get requires() {
|
|
931
|
+
return [FullscreenEditing];
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* @inheritDoc
|
|
935
|
+
*/
|
|
936
|
+
static get pluginName() {
|
|
937
|
+
return "FullscreenUI";
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* @inheritDoc
|
|
941
|
+
*/
|
|
942
|
+
static get isOfficialPlugin() {
|
|
943
|
+
return true;
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* @inheritDoc
|
|
947
|
+
*/
|
|
948
|
+
init() {
|
|
949
|
+
const editor = this.editor;
|
|
950
|
+
editor.ui.componentFactory.add("fullscreen", () => this._createButton(ButtonView));
|
|
951
|
+
editor.ui.componentFactory.add("menuBar:fullscreen", () => this._createButton(MenuBarMenuListItemButtonView));
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Creates a button that toggles the fullscreen mode.
|
|
955
|
+
*/
|
|
956
|
+
_createButton(ButtonClass) {
|
|
957
|
+
const editor = this.editor;
|
|
958
|
+
const t = editor.t;
|
|
959
|
+
const command = editor.commands.get(COMMAND_NAME);
|
|
960
|
+
const view = new ButtonClass(editor.locale);
|
|
961
|
+
view.set({ isToggleable: true });
|
|
962
|
+
view.bind("isEnabled").to(command, "isEnabled");
|
|
963
|
+
view.bind("isOn").to(command, "value");
|
|
964
|
+
if (view instanceof MenuBarMenuListItemButtonView) view.set({
|
|
965
|
+
role: "menuitemcheckbox",
|
|
966
|
+
label: t("Fullscreen mode")
|
|
967
|
+
});
|
|
968
|
+
else {
|
|
969
|
+
view.bind("icon").to(command, "value", (value) => value ? IconFullscreenLeave : IconFullscreenEnter);
|
|
970
|
+
view.bind("label").to(command, "value", (value) => value ? t("Leave fullscreen mode") : t("Enter fullscreen mode"));
|
|
971
|
+
view.set({ tooltip: true });
|
|
972
|
+
}
|
|
973
|
+
this.listenTo(view, "execute", () => {
|
|
974
|
+
editor.execute(COMMAND_NAME);
|
|
975
|
+
if (!env.isBlink) this.editor.ui.view.toolbar.focusTracker.focusedElement = null;
|
|
976
|
+
editor.editing.view.scrollToTheSelection();
|
|
977
|
+
editor.editing.view.focus();
|
|
978
|
+
});
|
|
979
|
+
return view;
|
|
980
|
+
}
|
|
981
|
+
};
|
|
1096
982
|
|
|
1097
983
|
/**
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
984
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
985
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
986
|
+
*/
|
|
987
|
+
/**
|
|
988
|
+
* @module fullscreen/fullscreen
|
|
989
|
+
*/
|
|
990
|
+
/**
|
|
991
|
+
* The fullscreen mode feature.
|
|
992
|
+
*/
|
|
993
|
+
var Fullscreen = class extends Plugin {
|
|
994
|
+
/**
|
|
995
|
+
* @inheritDoc
|
|
996
|
+
*/
|
|
997
|
+
static get requires() {
|
|
998
|
+
return [FullscreenEditing, FullscreenUI];
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* @inheritDoc
|
|
1002
|
+
*/
|
|
1003
|
+
static get pluginName() {
|
|
1004
|
+
return "Fullscreen";
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* @inheritDoc
|
|
1008
|
+
*/
|
|
1009
|
+
static get isOfficialPlugin() {
|
|
1010
|
+
return true;
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
1016
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
1017
|
+
*/
|
|
1119
1018
|
|
|
1120
1019
|
export { Fullscreen, FullscreenAbstractEditorHandler, FullscreenClassicEditorHandler, FullscreenCommand, FullscreenDecoupledEditorHandler, FullscreenEditing, FullscreenUI };
|
|
1121
|
-
//# sourceMappingURL=index.js.map
|
|
1020
|
+
//# sourceMappingURL=index.js.map
|