@ckeditor/ckeditor5-ckbox 0.0.0-nightly-20241216.0 → 0.0.0-nightly-20241217.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.
@@ -1,65 +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 ckbox/ckboxediting
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import CKBoxUploadAdapter from './ckboxuploadadapter.js';
14
- import CKBoxUtils from './ckboxutils.js';
15
- /**
16
- * The CKBox editing feature. It introduces the {@link module:ckbox/ckboxcommand~CKBoxCommand CKBox command} and
17
- * {@link module:ckbox/ckboxuploadadapter~CKBoxUploadAdapter CKBox upload adapter}.
18
- */
19
- export default class CKBoxEditing extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "CKBoxEditing";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get isOfficialPlugin(): true;
28
- /**
29
- * @inheritDoc
30
- */
31
- static get requires(): readonly ["LinkEditing", "PictureEditing", typeof CKBoxUploadAdapter, typeof CKBoxUtils];
32
- /**
33
- * @inheritDoc
34
- */
35
- init(): void;
36
- /**
37
- * @inheritDoc
38
- */
39
- afterInit(): void;
40
- /**
41
- * Returns true only when the integrator intentionally wants to use the plugin, i.e. when the `config.ckbox` exists or
42
- * the CKBox JavaScript library is loaded.
43
- */
44
- private _shouldBeInitialised;
45
- /**
46
- * Blocks `uploadImage` and `ckboxImageEdit` commands.
47
- */
48
- private _blockImageCommands;
49
- /**
50
- * Checks if at least one image plugin is loaded.
51
- */
52
- private _checkImagePlugins;
53
- /**
54
- * Extends the schema to allow the `ckboxImageId` and `ckboxLinkId` attributes for links and images.
55
- */
56
- private _initSchema;
57
- /**
58
- * Configures the upcast and downcast conversions for the `ckboxImageId` and `ckboxLinkId` attributes.
59
- */
60
- private _initConversion;
61
- /**
62
- * Registers post-fixers that add or remove the `ckboxLinkId` and `ckboxImageId` attributes.
63
- */
64
- private _initFixers;
65
- }
@@ -1,109 +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 ckbox/ckboximageedit/ckboximageeditcommand
11
- */
12
- import { Command, type Editor } from 'ckeditor5/src/core.js';
13
- /**
14
- * The CKBox edit image command.
15
- *
16
- * Opens the CKBox dialog for editing the image.
17
- */
18
- export default class CKBoxImageEditCommand extends Command {
19
- /**
20
- * Flag indicating whether the command is active, i.e. dialog is open.
21
- */
22
- value: boolean;
23
- /**
24
- * The DOM element that acts as a mounting point for the CKBox Edit Image dialog.
25
- */
26
- private _wrapper;
27
- /**
28
- * The states of image processing in progress.
29
- */
30
- private _processInProgress;
31
- /**
32
- * Determines if the element can be edited.
33
- */
34
- private _canEdit;
35
- /**
36
- * A wrapper function to prepare mount options. Ensures that at most one preparation is in-flight.
37
- */
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;
47
- /**
48
- * @inheritDoc
49
- */
50
- constructor(editor: Editor);
51
- /**
52
- * @inheritDoc
53
- */
54
- refresh(): void;
55
- /**
56
- * Opens the CKBox Image Editor dialog for editing the image.
57
- */
58
- execute(): void;
59
- /**
60
- * @inheritDoc
61
- */
62
- destroy(): void;
63
- /**
64
- * Indicates if the CKBox Image Editor dialog is already opened.
65
- */
66
- private _getValue;
67
- /**
68
- * Creates the options object for the CKBox Image Editor dialog.
69
- */
70
- private _prepareOptionsAbortable;
71
- /**
72
- * Initializes event lister for an event of removing an image.
73
- */
74
- private _prepareListeners;
75
- /**
76
- * Gets processing states of images that have been deleted in the mean time.
77
- */
78
- private _getProcessingStatesOfDeletedImages;
79
- private _checkIfElementIsBeingProcessed;
80
- /**
81
- * Closes the CKBox Image Editor dialog.
82
- */
83
- private _handleImageEditorClose;
84
- /**
85
- * Save edited image. In case server respond with "success" replace with edited image,
86
- * otherwise show notification error.
87
- */
88
- private _handleImageEditorSave;
89
- /**
90
- * Get asset's status on server. If server responds with "success" status then
91
- * image is already proceeded and ready for saving.
92
- */
93
- private _getAssetStatusFromServer;
94
- /**
95
- * Waits for an asset to be processed.
96
- * It retries retrieving asset status from the server in case of failure.
97
- */
98
- private _waitForAssetProcessed;
99
- /**
100
- * Shows processing indicator while image is processing.
101
- *
102
- * @param asset Data about certain asset.
103
- */
104
- private _showImageProcessingIndicator;
105
- /**
106
- * Replace the edited image with the new one.
107
- */
108
- private _replaceImage;
109
- }
@@ -1,36 +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 ckbox/ckboximageedit/ckboximageeditediting
11
- */
12
- import { PendingActions, Plugin } from 'ckeditor5/src/core.js';
13
- import { Notification } from 'ckeditor5/src/ui.js';
14
- import CKBoxEditing from '../ckboxediting.js';
15
- import CKBoxUtils from '../ckboxutils.js';
16
- /**
17
- * The CKBox image edit editing plugin.
18
- */
19
- export default class CKBoxImageEditEditing extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "CKBoxImageEditEditing";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get isOfficialPlugin(): true;
28
- /**
29
- * @inheritDoc
30
- */
31
- static get requires(): readonly [typeof CKBoxEditing, typeof CKBoxUtils, typeof PendingActions, typeof Notification, "ImageUtils", "ImageEditing"];
32
- /**
33
- * @inheritDoc
34
- */
35
- init(): void;
36
- }
@@ -1,32 +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 ckbox/ckboximageedit/ckboximageeditui
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- /**
14
- * The UI plugin of the CKBox image edit feature.
15
- *
16
- * It registers the `'ckboxImageEdit'` UI button in the editor's {@link module:ui/componentfactory~ComponentFactory component factory}
17
- * that allows you to open the CKBox dialog and edit the image.
18
- */
19
- export default class CKBoxImageEditUI extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "CKBoxImageEditUI";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get isOfficialPlugin(): true;
28
- /**
29
- * @inheritDoc
30
- */
31
- init(): void;
32
- }
@@ -1,14 +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 { Element } from 'ckeditor5/src/engine.js';
10
- import type { CKBoxConfig } from '../ckboxconfig.js';
11
- /**
12
- * @internal
13
- */
14
- export declare function createEditabilityChecker(allowExternalImagesEditing: CKBoxConfig['allowExternalImagesEditing']): (element: Element) => boolean;
@@ -1,32 +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 ckbox/ckboximageedit
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import CKBoxImageEditEditing from './ckboximageedit/ckboximageeditediting.js';
14
- import CKBoxImageEditUI from './ckboximageedit/ckboximageeditui.js';
15
- import '../theme/ckboximageedit.css';
16
- /**
17
- * The CKBox image edit feature.
18
- */
19
- export default class CKBoxImageEdit extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "CKBoxImageEdit";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get isOfficialPlugin(): true;
28
- /**
29
- * @inheritDoc
30
- */
31
- static get requires(): readonly [typeof CKBoxImageEditEditing, typeof CKBoxImageEditUI];
32
- }
package/dist/ckboxui.d.ts DELETED
@@ -1,60 +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 ckbox/ckboxui
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- /**
14
- * Introduces UI components for the `CKBox` plugin.
15
- *
16
- * The plugin introduces two UI components to the {@link module:ui/componentfactory~ComponentFactory UI component factory}:
17
- *
18
- * * the `'ckbox'` toolbar button,
19
- * * the `'menuBar:ckbox'` menu bar component, which is by default added to the `'Insert'` menu.
20
- *
21
- * It also integrates with the `insertImage` toolbar component and `menuBar:insertImage` menu component.
22
- */
23
- export default class CKBoxUI extends Plugin {
24
- /**
25
- * @inheritDoc
26
- */
27
- static get pluginName(): "CKBoxUI";
28
- /**
29
- * @inheritDoc
30
- */
31
- static get isOfficialPlugin(): true;
32
- /**
33
- * @inheritDoc
34
- */
35
- afterInit(): void;
36
- /**
37
- * Creates the base for various kinds of the button component provided by this feature.
38
- */
39
- private _createButton;
40
- /**
41
- * Creates a simple toolbar button for files management, with an icon and a tooltip.
42
- */
43
- private _createFileToolbarButton;
44
- /**
45
- * Creates a simple toolbar button for images management, with an icon and a tooltip.
46
- */
47
- private _createImageToolbarButton;
48
- /**
49
- * Creates a button for images management for the dropdown view, with an icon, text and no tooltip.
50
- */
51
- private _createImageDropdownButton;
52
- /**
53
- * Creates a button for files management for the menu bar.
54
- */
55
- private _createFileMenuBarButton;
56
- /**
57
- * Creates a button for images management for the menu bar.
58
- */
59
- private _createImageMenuBarButton;
60
- }
@@ -1,41 +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 ckbox/ckboxuploadadapter
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import { FileRepository } from 'ckeditor5/src/upload.js';
14
- import CKBoxEditing from './ckboxediting.js';
15
- /**
16
- * A plugin that enables file uploads in CKEditor 5 using the CKBox server–side connector.
17
- * See the {@glink features/file-management/ckbox CKBox file manager integration} guide to learn how to configure
18
- * and use this feature as well as find out more about the full integration with the file manager
19
- * provided by the {@link module:ckbox/ckbox~CKBox} plugin.
20
- *
21
- * Check out the {@glink features/images/image-upload/image-upload Image upload overview} guide to learn about
22
- * other ways to upload images into CKEditor 5.
23
- */
24
- export default class CKBoxUploadAdapter extends Plugin {
25
- /**
26
- * @inheritDoc
27
- */
28
- static get requires(): readonly ["ImageUploadEditing", "ImageUploadProgress", typeof FileRepository, typeof CKBoxEditing];
29
- /**
30
- * @inheritDoc
31
- */
32
- static get pluginName(): "CKBoxUploadAdapter";
33
- /**
34
- * @inheritDoc
35
- */
36
- static get isOfficialPlugin(): true;
37
- /**
38
- * @inheritDoc
39
- */
40
- afterInit(): Promise<void>;
41
- }
@@ -1,58 +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 ckbox/ckboxutils
11
- */
12
- import type { InitializedToken } from '@ckeditor/ckeditor5-cloud-services';
13
- import { Plugin } from 'ckeditor5/src/core.js';
14
- /**
15
- * The CKBox utilities plugin.
16
- */
17
- export default class CKBoxUtils extends Plugin {
18
- /**
19
- * CKEditor Cloud Services access token.
20
- */
21
- private _token;
22
- /**
23
- * @inheritDoc
24
- */
25
- static get pluginName(): "CKBoxUtils";
26
- /**
27
- * @inheritDoc
28
- */
29
- static get isOfficialPlugin(): true;
30
- /**
31
- * @inheritDoc
32
- */
33
- static get requires(): readonly ["CloudServices"];
34
- /**
35
- * @inheritDoc
36
- */
37
- init(): void;
38
- /**
39
- * Returns a token used by the CKBox plugin for communication with the CKBox service.
40
- */
41
- getToken(): Promise<InitializedToken>;
42
- /**
43
- * The ID of workspace to use when uploading an image.
44
- */
45
- getWorkspaceId(): Promise<string>;
46
- /**
47
- * Resolves a promise with an object containing a category with which the uploaded file is associated or an error code.
48
- */
49
- getCategoryIdForFile(fileOrUrl: File | string, options: {
50
- signal: AbortSignal;
51
- }): Promise<string>;
52
- /**
53
- * Resolves a promise with an array containing available categories with which the uploaded file can be associated.
54
- *
55
- * If the API returns limited results, the method will collect all items.
56
- */
57
- private _getAvailableCategories;
58
- }
package/dist/index.d.ts DELETED
@@ -1,21 +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 ckbox
11
- */
12
- export { default as CKBox } from './ckbox.js';
13
- export { default as CKBoxEditing } from './ckboxediting.js';
14
- export { default as CKBoxUI } from './ckboxui.js';
15
- export { default as CKBoxImageEditEditing } from './ckboximageedit/ckboximageeditediting.js';
16
- export { default as CKBoxImageEditUI } from './ckboximageedit/ckboximageeditui.js';
17
- export { default as CKBoxImageEdit } from './ckboximageedit.js';
18
- export type { default as CKBoxCommand } from './ckboxcommand.js';
19
- export type { default as CKBoxImageEditCommand } from './ckboximageedit/ckboximageeditcommand.js';
20
- export type { CKBoxConfig } from './ckboxconfig.js';
21
- import './augmentation.js';
package/dist/utils.d.ts DELETED
@@ -1,67 +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 ckbox/utils
11
- */
12
- import type { InitializedToken } from '@ckeditor/ckeditor5-cloud-services';
13
- import type { CKBoxImageUrls } from './ckboxconfig.js';
14
- /**
15
- * Converts image source set provided by the CKBox into an object containing:
16
- * - responsive URLs for the "webp" image format,
17
- * - one fallback URL for browsers that do not support the "webp" format.
18
- */
19
- export declare function getImageUrls(imageUrls: CKBoxImageUrls): {
20
- imageFallbackUrl: string;
21
- imageSources: Array<{
22
- srcset: string;
23
- sizes: string;
24
- type: string;
25
- }>;
26
- };
27
- /**
28
- * Returns a workspace id to use for communication with the CKBox service.
29
- *
30
- * @param defaultWorkspaceId The default workspace to use taken from editor config.
31
- */
32
- export declare function getWorkspaceId(token: InitializedToken, defaultWorkspaceId?: string): string | null;
33
- /**
34
- * Generates an image data URL from its `blurhash` representation.
35
- */
36
- export declare function blurHashToDataUrl(hash?: string): string | undefined;
37
- /**
38
- * Sends the HTTP request.
39
- *
40
- * @internal
41
- * @param config.url the URL where the request will be sent.
42
- * @param config.method The HTTP method.
43
- * @param config.data Additional data to send.
44
- * @param config.onUploadProgress A callback informing about the upload progress.
45
- */
46
- export declare function sendHttpRequest({ url, method, data, onUploadProgress, signal, authorization }: {
47
- url: URL;
48
- signal: AbortSignal;
49
- authorization: string;
50
- method?: 'GET' | 'POST';
51
- data?: FormData | null;
52
- onUploadProgress?: (evt: ProgressEvent) => void;
53
- }): Promise<any>;
54
- /**
55
- * Returns an extension a typical file in the specified `mimeType` format would have.
56
- */
57
- export declare function convertMimeTypeToExtension(mimeType: string): string;
58
- /**
59
- * Tries to fetch the given `url` and returns 'content-type' of the response.
60
- */
61
- export declare function getContentTypeOfUrl(url: string, options: {
62
- signal: AbortSignal;
63
- }): Promise<string>;
64
- /**
65
- * Returns an extension from the given value.
66
- */
67
- export declare function getFileExtension(file: File): string;