@ckeditor/ckeditor5-ckbox 0.0.0-nightly-20240522.0 → 0.0.0-nightly-20240523.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/README.md +6 -0
- package/build/ckbox.js +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/types/ckboximageedit/ckboximageeditcommand.d.ts +8 -0
- package/package.json +2 -2
- package/src/ckboximageedit/ckboximageeditcommand.d.ts +8 -0
- package/src/ckboximageedit/ckboximageeditcommand.js +11 -1
@@ -36,6 +36,14 @@ export default class CKBoxImageEditCommand extends Command {
|
|
36
36
|
* A wrapper function to prepare mount options. Ensures that at most one preparation is in-flight.
|
37
37
|
*/
|
38
38
|
private _prepareOptions;
|
39
|
+
/**
|
40
|
+
* CKBox's onClose function runs before the final cleanup, potentially causing
|
41
|
+
* page layout changes after it finishes. To address this, we use a setTimeout hack
|
42
|
+
* to ensure that floating elements on the page maintain their correct position.
|
43
|
+
*
|
44
|
+
* See: https://github.com/ckeditor/ckeditor5/issues/16153.
|
45
|
+
*/
|
46
|
+
private _updateUiDelayed;
|
39
47
|
/**
|
40
48
|
* @inheritDoc
|
41
49
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-ckbox",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20240523.0",
|
4
4
|
"description": "CKBox integration for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"type": "module",
|
14
14
|
"main": "src/index.js",
|
15
15
|
"dependencies": {
|
16
|
-
"ckeditor5": "0.0.0-nightly-
|
16
|
+
"ckeditor5": "0.0.0-nightly-20240523.0",
|
17
17
|
"blurhash": "2.0.5",
|
18
18
|
"lodash-es": "4.17.21"
|
19
19
|
},
|
@@ -32,6 +32,14 @@ export default class CKBoxImageEditCommand extends Command {
|
|
32
32
|
* A wrapper function to prepare mount options. Ensures that at most one preparation is in-flight.
|
33
33
|
*/
|
34
34
|
private _prepareOptions;
|
35
|
+
/**
|
36
|
+
* CKBox's onClose function runs before the final cleanup, potentially causing
|
37
|
+
* page layout changes after it finishes. To address this, we use a setTimeout hack
|
38
|
+
* to ensure that floating elements on the page maintain their correct position.
|
39
|
+
*
|
40
|
+
* See: https://github.com/ckeditor/ckeditor5/issues/16153.
|
41
|
+
*/
|
42
|
+
private _updateUiDelayed;
|
35
43
|
/**
|
36
44
|
* @inheritDoc
|
37
45
|
*/
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @module ckbox/ckboximageedit/ckboximageeditcommand
|
8
8
|
*/
|
9
9
|
import { Command, PendingActions } from 'ckeditor5/src/core.js';
|
10
|
-
import { CKEditorError, abortableDebounce, createElement, retry } from 'ckeditor5/src/utils.js';
|
10
|
+
import { CKEditorError, abortableDebounce, createElement, retry, delay } from 'ckeditor5/src/utils.js';
|
11
11
|
import { Notification } from 'ckeditor5/src/ui.js';
|
12
12
|
import { isEqual } from 'lodash-es';
|
13
13
|
import { sendHttpRequest } from '../utils.js';
|
@@ -33,6 +33,14 @@ export default class CKBoxImageEditCommand extends Command {
|
|
33
33
|
* The states of image processing in progress.
|
34
34
|
*/
|
35
35
|
this._processInProgress = new Set();
|
36
|
+
/**
|
37
|
+
* CKBox's onClose function runs before the final cleanup, potentially causing
|
38
|
+
* page layout changes after it finishes. To address this, we use a setTimeout hack
|
39
|
+
* to ensure that floating elements on the page maintain their correct position.
|
40
|
+
*
|
41
|
+
* See: https://github.com/ckeditor/ckeditor5/issues/16153.
|
42
|
+
*/
|
43
|
+
this._updateUiDelayed = delay(() => this.editor.ui.update(), 0);
|
36
44
|
this.value = false;
|
37
45
|
this._canEdit = createEditabilityChecker(editor.config.get('ckbox.allowExternalImagesEditing'));
|
38
46
|
this._prepareOptions = abortableDebounce((signal, state) => this._prepareOptionsAbortable(signal, state));
|
@@ -83,6 +91,7 @@ export default class CKBoxImageEditCommand extends Command {
|
|
83
91
|
destroy() {
|
84
92
|
this._handleImageEditorClose();
|
85
93
|
this._prepareOptions.abort();
|
94
|
+
this._updateUiDelayed.cancel();
|
86
95
|
for (const state of this._processInProgress.values()) {
|
87
96
|
state.controller.abort();
|
88
97
|
}
|
@@ -170,6 +179,7 @@ export default class CKBoxImageEditCommand extends Command {
|
|
170
179
|
this._wrapper.remove();
|
171
180
|
this._wrapper = null;
|
172
181
|
this.editor.editing.view.focus();
|
182
|
+
this._updateUiDelayed();
|
173
183
|
this.refresh();
|
174
184
|
}
|
175
185
|
/**
|