@ckeditor/ckeditor5-adapter-ckfinder 48.2.0 → 48.3.0-alpha.1

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,10 +1,10 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import type { CKFinderUploadAdapter } from './index.js';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface PluginsMap {
8
- [CKFinderUploadAdapter.pluginName]: CKFinderUploadAdapter;
9
- }
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import type { CKFinderUploadAdapter } from "./index.js";
6
+ declare module "@ckeditor/ckeditor5-core" {
7
+ interface PluginsMap {
8
+ [CKFinderUploadAdapter.pluginName]: CKFinderUploadAdapter;
9
+ }
10
10
  }
@@ -2,3 +2,4 @@
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
+
@@ -2,3 +2,4 @@
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
+
package/dist/index.css CHANGED
@@ -3,5 +3,3 @@
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
 
6
-
7
- /*# sourceMappingURL=index.css.map */
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module adapter-ckfinder
7
- */
8
- export { CKFinderUploadAdapter } from './uploadadapter.js';
9
- export { getCsrfToken as _getCKFinderCsrfToken, getCookie as _getCKFinderCookie, setCookie as _setCKFinderCookie } from './utils.js';
10
- import './augmentation.js';
6
+ * @module adapter-ckfinder
7
+ */
8
+ export { CKFinderUploadAdapter } from "./uploadadapter.js";
9
+ export { getCsrfToken as _getCKFinderCsrfToken, getCookie as _getCKFinderCookie, setCookie as _setCKFinderCookie } from "./utils.js";
10
+ import "./augmentation.js";
package/dist/index.js CHANGED
@@ -2,199 +2,214 @@
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 { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
6
- import { FileRepository } from '@ckeditor/ckeditor5-upload/dist/index.js';
5
+ import { Plugin } from "@ckeditor/ckeditor5-core";
6
+ import { FileRepository } from "@ckeditor/ckeditor5-upload";
7
7
 
8
8
  /**
9
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
10
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
11
- */ /**
12
- * @module adapter-ckfinder/utils
13
- */ const TOKEN_COOKIE_NAME = 'ckCsrfToken';
9
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
10
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
11
+ */
12
+ /**
13
+ * @module adapter-ckfinder/utils
14
+ */
15
+ const TOKEN_COOKIE_NAME = "ckCsrfToken";
14
16
  const TOKEN_LENGTH = 40;
15
- const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
17
+ const tokenCharset = "abcdefghijklmnopqrstuvwxyz0123456789";
16
18
  /**
17
- * Returns the CSRF token value. The value is a hash stored in `document.cookie`
18
- * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
19
- * between the web browser and the CKFinder server.
20
- *
21
- * @internal
22
- */ function getCsrfToken() {
23
- let token = getCookie(TOKEN_COOKIE_NAME);
24
- if (!token || token.length != TOKEN_LENGTH) {
25
- token = generateToken(TOKEN_LENGTH);
26
- setCookie(TOKEN_COOKIE_NAME, token);
27
- }
28
- return token;
19
+ * Returns the CSRF token value. The value is a hash stored in `document.cookie`
20
+ * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
21
+ * between the web browser and the CKFinder server.
22
+ *
23
+ * @internal
24
+ */
25
+ function getCsrfToken() {
26
+ let token = getCookie(TOKEN_COOKIE_NAME);
27
+ if (!token || token.length != TOKEN_LENGTH) {
28
+ token = generateToken(TOKEN_LENGTH);
29
+ setCookie(TOKEN_COOKIE_NAME, token);
30
+ }
31
+ return token;
29
32
  }
30
33
  /**
31
- * Returns the value of the cookie with a given name or `null` if the cookie is not found.
32
- *
33
- * @internal
34
- */ function getCookie(name) {
35
- name = name.toLowerCase();
36
- const parts = document.cookie.split(';');
37
- for (const part of parts){
38
- const pair = part.split('=');
39
- const key = decodeURIComponent(pair[0].trim().toLowerCase());
40
- if (key === name) {
41
- return decodeURIComponent(pair[1]);
42
- }
43
- }
44
- return null;
34
+ * Returns the value of the cookie with a given name or `null` if the cookie is not found.
35
+ *
36
+ * @internal
37
+ */
38
+ function getCookie(name) {
39
+ name = name.toLowerCase();
40
+ const parts = document.cookie.split(";");
41
+ for (const part of parts) {
42
+ const pair = part.split("=");
43
+ if (decodeURIComponent(pair[0].trim().toLowerCase()) === name) return decodeURIComponent(pair[1]);
44
+ }
45
+ return null;
45
46
  }
46
47
  /**
47
- * Sets the value of the cookie with a given name.
48
- *
49
- * @internal
50
- */ function setCookie(name, value) {
51
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=/';
48
+ * Sets the value of the cookie with a given name.
49
+ *
50
+ * @internal
51
+ */
52
+ function setCookie(name, value) {
53
+ document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + ";path=/";
52
54
  }
53
55
  /**
54
- * Generates the CSRF token with the given length.
55
- */ function generateToken(length) {
56
- let result = '';
57
- const randValues = new Uint8Array(length);
58
- window.crypto.getRandomValues(randValues);
59
- for(let j = 0; j < randValues.length; j++){
60
- const character = tokenCharset.charAt(randValues[j] % tokenCharset.length);
61
- result += Math.random() > 0.5 ? character.toUpperCase() : character;
62
- }
63
- return result;
56
+ * Generates the CSRF token with the given length.
57
+ */
58
+ function generateToken(length) {
59
+ let result = "";
60
+ const randValues = new Uint8Array(length);
61
+ window.crypto.getRandomValues(randValues);
62
+ for (let j = 0; j < randValues.length; j++) {
63
+ const character = tokenCharset.charAt(randValues[j] % 36);
64
+ result += Math.random() > .5 ? character.toUpperCase() : character;
65
+ }
66
+ return result;
64
67
  }
65
68
 
66
69
  /**
67
- * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.
68
- *
69
- * See the {@glink features/file-management/ckfinder "CKFinder file manager integration"} guide to learn how to configure
70
- * and use this feature as well as find out more about the full integration with the file manager
71
- * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.
72
- *
73
- * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} guide to learn
74
- * about other ways to upload images into CKEditor 5.
75
- */ class CKFinderUploadAdapter extends Plugin {
76
- /**
77
- * @inheritDoc
78
- */ static get requires() {
79
- return [
80
- FileRepository
81
- ];
82
- }
83
- /**
84
- * @inheritDoc
85
- */ static get pluginName() {
86
- return 'CKFinderUploadAdapter';
87
- }
88
- /**
89
- * @inheritDoc
90
- */ static get isOfficialPlugin() {
91
- return true;
92
- }
93
- /**
94
- * @inheritDoc
95
- */ init() {
96
- const url = this.editor.config.get('ckfinder.uploadUrl');
97
- if (!url) {
98
- return;
99
- }
100
- // Register CKFinderAdapter
101
- this.editor.plugins.get(FileRepository).createUploadAdapter = (loader)=>new UploadAdapter(loader, url, this.editor.t);
102
- }
103
- }
70
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
71
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
72
+ */
104
73
  /**
105
- * Upload adapter for CKFinder.
106
- */ class UploadAdapter {
107
- /**
108
- * FileLoader instance to use during the upload.
109
- */ loader;
110
- /**
111
- * Upload URL.
112
- */ url;
113
- /**
114
- * Locale translation method.
115
- */ t;
116
- xhr;
117
- /**
118
- * Creates a new adapter instance.
119
- */ constructor(loader, url, t){
120
- this.loader = loader;
121
- this.url = url;
122
- this.t = t;
123
- }
124
- /**
125
- * Starts the upload process.
126
- *
127
- * @see module:upload/filerepository~UploadAdapter#upload
128
- */ upload() {
129
- return this.loader.file.then((file)=>{
130
- return new Promise((resolve, reject)=>{
131
- this._initRequest();
132
- this._initListeners(resolve, reject, file);
133
- this._sendRequest(file);
134
- });
135
- });
136
- }
137
- /**
138
- * Aborts the upload process.
139
- *
140
- * @see module:upload/filerepository~UploadAdapter#abort
141
- */ abort() {
142
- if (this.xhr) {
143
- this.xhr.abort();
144
- }
145
- }
146
- /**
147
- * Initializes the XMLHttpRequest object.
148
- */ _initRequest() {
149
- const xhr = this.xhr = new XMLHttpRequest();
150
- xhr.open('POST', this.url, true);
151
- xhr.responseType = 'json';
152
- }
153
- /**
154
- * Initializes XMLHttpRequest listeners.
155
- *
156
- * @param resolve Callback function to be called when the request is successful.
157
- * @param reject Callback function to be called when the request cannot be completed.
158
- * @param file File instance to be uploaded.
159
- */ _initListeners(resolve, reject, file) {
160
- const xhr = this.xhr;
161
- const loader = this.loader;
162
- const t = this.t;
163
- const genericError = t('Cannot upload file:') + ` ${file.name}.`;
164
- xhr.addEventListener('error', ()=>reject(genericError));
165
- xhr.addEventListener('abort', ()=>reject());
166
- xhr.addEventListener('load', ()=>{
167
- const response = xhr.response;
168
- if (!response || !response.uploaded) {
169
- return reject(response && response.error && response.error.message ? response.error.message : genericError);
170
- }
171
- resolve({
172
- default: response.url
173
- });
174
- });
175
- // Upload progress when it's supported.
176
- /* istanbul ignore else -- @preserve */ if (xhr.upload) {
177
- xhr.upload.addEventListener('progress', (evt)=>{
178
- if (evt.lengthComputable) {
179
- loader.uploadTotal = evt.total;
180
- loader.uploaded = evt.loaded;
181
- }
182
- });
183
- }
184
- }
185
- /**
186
- * Prepares the data and sends the request.
187
- *
188
- * @param file File instance to be uploaded.
189
- */ _sendRequest(file) {
190
- // Prepare form data.
191
- const data = new FormData();
192
- data.append('upload', file);
193
- data.append('ckCsrfToken', getCsrfToken());
194
- // Send request.
195
- this.xhr.send(data);
196
- }
197
- }
74
+ * @module adapter-ckfinder/uploadadapter
75
+ */
76
+ /**
77
+ * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.
78
+ *
79
+ * See the {@glink features/file-management/ckfinder "CKFinder file manager integration"} guide to learn how to configure
80
+ * and use this feature as well as find out more about the full integration with the file manager
81
+ * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.
82
+ *
83
+ * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} guide to learn
84
+ * about other ways to upload images into CKEditor 5.
85
+ */
86
+ var CKFinderUploadAdapter = class extends Plugin {
87
+ /**
88
+ * @inheritDoc
89
+ */
90
+ static get requires() {
91
+ return [FileRepository];
92
+ }
93
+ /**
94
+ * @inheritDoc
95
+ */
96
+ static get pluginName() {
97
+ return "CKFinderUploadAdapter";
98
+ }
99
+ /**
100
+ * @inheritDoc
101
+ */
102
+ static get isOfficialPlugin() {
103
+ return true;
104
+ }
105
+ /**
106
+ * @inheritDoc
107
+ */
108
+ init() {
109
+ const url = this.editor.config.get("ckfinder.uploadUrl");
110
+ if (!url) return;
111
+ this.editor.plugins.get(FileRepository).createUploadAdapter = (loader) => new UploadAdapter(loader, url, this.editor.t);
112
+ }
113
+ };
114
+ /**
115
+ * Upload adapter for CKFinder.
116
+ */
117
+ var UploadAdapter = class {
118
+ /**
119
+ * FileLoader instance to use during the upload.
120
+ */
121
+ loader;
122
+ /**
123
+ * Upload URL.
124
+ */
125
+ url;
126
+ /**
127
+ * Locale translation method.
128
+ */
129
+ t;
130
+ xhr;
131
+ /**
132
+ * Creates a new adapter instance.
133
+ */
134
+ constructor(loader, url, t) {
135
+ this.loader = loader;
136
+ this.url = url;
137
+ this.t = t;
138
+ }
139
+ /**
140
+ * Starts the upload process.
141
+ *
142
+ * @see module:upload/filerepository~UploadAdapter#upload
143
+ */
144
+ upload() {
145
+ return this.loader.file.then((file) => {
146
+ return new Promise((resolve, reject) => {
147
+ this._initRequest();
148
+ this._initListeners(resolve, reject, file);
149
+ this._sendRequest(file);
150
+ });
151
+ });
152
+ }
153
+ /**
154
+ * Aborts the upload process.
155
+ *
156
+ * @see module:upload/filerepository~UploadAdapter#abort
157
+ */
158
+ abort() {
159
+ if (this.xhr) this.xhr.abort();
160
+ }
161
+ /**
162
+ * Initializes the XMLHttpRequest object.
163
+ */
164
+ _initRequest() {
165
+ const xhr = this.xhr = new XMLHttpRequest();
166
+ xhr.open("POST", this.url, true);
167
+ xhr.responseType = "json";
168
+ }
169
+ /**
170
+ * Initializes XMLHttpRequest listeners.
171
+ *
172
+ * @param resolve Callback function to be called when the request is successful.
173
+ * @param reject Callback function to be called when the request cannot be completed.
174
+ * @param file File instance to be uploaded.
175
+ */
176
+ _initListeners(resolve, reject, file) {
177
+ const xhr = this.xhr;
178
+ const loader = this.loader;
179
+ const t = this.t;
180
+ const genericError = t("Cannot upload file:") + ` ${file.name}.`;
181
+ xhr.addEventListener("error", () => reject(genericError));
182
+ xhr.addEventListener("abort", () => reject());
183
+ xhr.addEventListener("load", () => {
184
+ const response = xhr.response;
185
+ if (!response || !response.uploaded) return reject(response && response.error && response.error.message ? response.error.message : genericError);
186
+ resolve({ default: response.url });
187
+ });
188
+ /* v8 ignore else -- @preserve */
189
+ if (xhr.upload) xhr.upload.addEventListener("progress", (evt) => {
190
+ if (evt.lengthComputable) {
191
+ loader.uploadTotal = evt.total;
192
+ loader.uploaded = evt.loaded;
193
+ }
194
+ });
195
+ }
196
+ /**
197
+ * Prepares the data and sends the request.
198
+ *
199
+ * @param file File instance to be uploaded.
200
+ */
201
+ _sendRequest(file) {
202
+ const data = new FormData();
203
+ data.append("upload", file);
204
+ data.append("ckCsrfToken", getCsrfToken());
205
+ this.xhr.send(data);
206
+ }
207
+ };
208
+
209
+ /**
210
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
211
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
212
+ */
198
213
 
199
214
  export { CKFinderUploadAdapter, getCookie as _getCKFinderCookie, getCsrfToken as _getCKFinderCsrfToken, setCookie as _setCKFinderCookie };
200
- //# sourceMappingURL=index.js.map
215
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js","../src/utils.ts","../src/uploadadapter.ts"],"names":["TOKEN_COOKIE_NAME","TOKEN_LENGTH","tokenCharset","getCsrfToken","token","getCookie","length","generateToken","setCookie","name","toLowerCase","parts","document","cookie","split","part","pair","key","decodeURIComponent","trim","value","encodeURIComponent","result","randValues","Uint8Array","window","crypto","getRandomValues","j","character","charAt","Math","random","toUpperCase","CKFinderUploadAdapter","Plugin","requires","FileRepository","pluginName","isOfficialPlugin","init","url","editor","config","get","plugins","createUploadAdapter","loader","UploadAdapter","t","xhr","upload","file","then","Promise","resolve","reject","_initRequest","_initListeners","_sendRequest","abort","XMLHttpRequest","open","responseType","genericError","addEventListener","response","uploaded","error","message","default","evt","lengthComputable","uploadTotal","total","loaded","data","FormData","append","send"],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAMwB,IAAAA,CAAAA,CAAAA,CAAO,GAAA,CAAIC,QAAAA,CAAAA,CAAAA;AFInB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CEHLD,IAAAA,CAAKE,MAAM,CAAE,CAAA,MAAA,CAAA,CAAA,CAAU1B,IAAAA,CAAAA;AFIzB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CEHLwB,IAAAA,CAAKE,MAAM,CAAE,CAAA,WAAA,CAAA,CAAA,CAAe3E,YAAAA,CAAAA,CAAAA,CAAAA;AFI9B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;AEDrB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAI,CAAC+C,GAAG,CAAE6B,IAAI,CAAEH,IAAAA,CAAAA;AACjB,CAAA,CAAA,CAAA,CAAA;AACD;;AFIA,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AACzI,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC","file":"index.js.map","sourcesContent":["import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { FileRepository } from '@ckeditor/ckeditor5-upload/dist/index.js';\n\n/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module adapter-ckfinder/utils\n */ const TOKEN_COOKIE_NAME = 'ckCsrfToken';\nconst TOKEN_LENGTH = 40;\nconst tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';\n/**\n * Returns the CSRF token value. The value is a hash stored in `document.cookie`\n * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication\n * between the web browser and the CKFinder server.\n *\n * @internal\n */ function getCsrfToken() {\n let token = getCookie(TOKEN_COOKIE_NAME);\n if (!token || token.length != TOKEN_LENGTH) {\n token = generateToken(TOKEN_LENGTH);\n setCookie(TOKEN_COOKIE_NAME, token);\n }\n return token;\n}\n/**\n * Returns the value of the cookie with a given name or `null` if the cookie is not found.\n *\n * @internal\n */ function getCookie(name) {\n name = name.toLowerCase();\n const parts = document.cookie.split(';');\n for (const part of parts){\n const pair = part.split('=');\n const key = decodeURIComponent(pair[0].trim().toLowerCase());\n if (key === name) {\n return decodeURIComponent(pair[1]);\n }\n }\n return null;\n}\n/**\n * Sets the value of the cookie with a given name.\n *\n * @internal\n */ function setCookie(name, value) {\n document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=/';\n}\n/**\n * Generates the CSRF token with the given length.\n */ function generateToken(length) {\n let result = '';\n const randValues = new Uint8Array(length);\n window.crypto.getRandomValues(randValues);\n for(let j = 0; j < randValues.length; j++){\n const character = tokenCharset.charAt(randValues[j] % tokenCharset.length);\n result += Math.random() > 0.5 ? character.toUpperCase() : character;\n }\n return result;\n}\n\n/**\n * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.\n *\n * See the {@glink features/file-management/ckfinder \"CKFinder file manager integration\"} guide to learn how to configure\n * and use this feature as well as find out more about the full integration with the file manager\n * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} guide to learn\n * about other ways to upload images into CKEditor 5.\n */ class CKFinderUploadAdapter extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get requires() {\n return [\n FileRepository\n ];\n }\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'CKFinderUploadAdapter';\n }\n /**\n\t * @inheritDoc\n\t */ static get isOfficialPlugin() {\n return true;\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const url = this.editor.config.get('ckfinder.uploadUrl');\n if (!url) {\n return;\n }\n // Register CKFinderAdapter\n this.editor.plugins.get(FileRepository).createUploadAdapter = (loader)=>new UploadAdapter(loader, url, this.editor.t);\n }\n}\n/**\n * Upload adapter for CKFinder.\n */ class UploadAdapter {\n /**\n\t * FileLoader instance to use during the upload.\n\t */ loader;\n /**\n\t * Upload URL.\n\t */ url;\n /**\n\t * Locale translation method.\n\t */ t;\n xhr;\n /**\n\t * Creates a new adapter instance.\n\t */ constructor(loader, url, t){\n this.loader = loader;\n this.url = url;\n this.t = t;\n }\n /**\n\t * Starts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#upload\n\t */ upload() {\n return this.loader.file.then((file)=>{\n return new Promise((resolve, reject)=>{\n this._initRequest();\n this._initListeners(resolve, reject, file);\n this._sendRequest(file);\n });\n });\n }\n /**\n\t * Aborts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#abort\n\t */ abort() {\n if (this.xhr) {\n this.xhr.abort();\n }\n }\n /**\n\t * Initializes the XMLHttpRequest object.\n\t */ _initRequest() {\n const xhr = this.xhr = new XMLHttpRequest();\n xhr.open('POST', this.url, true);\n xhr.responseType = 'json';\n }\n /**\n\t * Initializes XMLHttpRequest listeners.\n\t *\n\t * @param resolve Callback function to be called when the request is successful.\n\t * @param reject Callback function to be called when the request cannot be completed.\n\t * @param file File instance to be uploaded.\n\t */ _initListeners(resolve, reject, file) {\n const xhr = this.xhr;\n const loader = this.loader;\n const t = this.t;\n const genericError = t('Cannot upload file:') + ` ${file.name}.`;\n xhr.addEventListener('error', ()=>reject(genericError));\n xhr.addEventListener('abort', ()=>reject());\n xhr.addEventListener('load', ()=>{\n const response = xhr.response;\n if (!response || !response.uploaded) {\n return reject(response && response.error && response.error.message ? response.error.message : genericError);\n }\n resolve({\n default: response.url\n });\n });\n // Upload progress when it's supported.\n /* istanbul ignore else -- @preserve */ if (xhr.upload) {\n xhr.upload.addEventListener('progress', (evt)=>{\n if (evt.lengthComputable) {\n loader.uploadTotal = evt.total;\n loader.uploaded = evt.loaded;\n }\n });\n }\n }\n /**\n\t * Prepares the data and sends the request.\n\t *\n\t * @param file File instance to be uploaded.\n\t */ _sendRequest(file) {\n // Prepare form data.\n const data = new FormData();\n data.append('upload', file);\n data.append('ckCsrfToken', getCsrfToken());\n // Send request.\n this.xhr.send(data);\n }\n}\n\nexport { CKFinderUploadAdapter, getCookie as _getCKFinderCookie, getCsrfToken as _getCKFinderCsrfToken, setCookie as _setCKFinderCookie };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module adapter-ckfinder/utils\n */\n\nconst TOKEN_COOKIE_NAME = 'ckCsrfToken';\nconst TOKEN_LENGTH = 40;\nconst tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';\n\n/**\n * Returns the CSRF token value. The value is a hash stored in `document.cookie`\n * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication\n * between the web browser and the CKFinder server.\n *\n * @internal\n */\nexport function getCsrfToken(): string {\n\tlet token = getCookie( TOKEN_COOKIE_NAME );\n\n\tif ( !token || token.length != TOKEN_LENGTH ) {\n\t\ttoken = generateToken( TOKEN_LENGTH );\n\t\tsetCookie( TOKEN_COOKIE_NAME, token );\n\t}\n\n\treturn token;\n}\n\n/**\n * Returns the value of the cookie with a given name or `null` if the cookie is not found.\n *\n * @internal\n */\nexport function getCookie( name: string ): string | null {\n\tname = name.toLowerCase();\n\tconst parts = document.cookie.split( ';' );\n\n\tfor ( const part of parts ) {\n\t\tconst pair = part.split( '=' );\n\t\tconst key = decodeURIComponent( pair[ 0 ].trim().toLowerCase() );\n\n\t\tif ( key === name ) {\n\t\t\treturn decodeURIComponent( pair[ 1 ] );\n\t\t}\n\t}\n\n\treturn null;\n}\n\n/**\n * Sets the value of the cookie with a given name.\n *\n * @internal\n */\nexport function setCookie( name: string, value: string ): void {\n\tdocument.cookie = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';path=/';\n}\n\n/**\n * Generates the CSRF token with the given length.\n */\nfunction generateToken( length: number ): string {\n\tlet result = '';\n\tconst randValues = new Uint8Array( length );\n\n\twindow.crypto.getRandomValues( randValues );\n\n\tfor ( let j = 0; j < randValues.length; j++ ) {\n\t\tconst character = tokenCharset.charAt( randValues[ j ] % tokenCharset.length );\n\t\tresult += Math.random() > 0.5 ? character.toUpperCase() : character;\n\t}\n\n\treturn result;\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module adapter-ckfinder/uploadadapter\n */\n\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport {\n\tFileRepository,\n\ttype UploadAdapter as UploadAdapterInterface,\n\ttype FileLoader,\n\ttype UploadResponse\n} from '@ckeditor/ckeditor5-upload';\nimport type { LocaleTranslate } from '@ckeditor/ckeditor5-utils';\n\nimport { getCsrfToken } from './utils.js';\n\n/**\n * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.\n *\n * See the {@glink features/file-management/ckfinder \"CKFinder file manager integration\"} guide to learn how to configure\n * and use this feature as well as find out more about the full integration with the file manager\n * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} guide to learn\n * about other ways to upload images into CKEditor 5.\n */\nexport class CKFinderUploadAdapter extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ FileRepository ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'CKFinderUploadAdapter' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst url = this.editor.config.get( 'ckfinder.uploadUrl' )! as string;\n\n\t\tif ( !url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Register CKFinderAdapter\n\t\tthis.editor.plugins.get( FileRepository ).createUploadAdapter = loader => new UploadAdapter( loader, url, this.editor.t );\n\t}\n}\n\n/**\n * Upload adapter for CKFinder.\n */\nclass UploadAdapter implements UploadAdapterInterface {\n\t/**\n\t * FileLoader instance to use during the upload.\n\t */\n\tpublic loader: FileLoader;\n\n\t/**\n\t * Upload URL.\n\t */\n\tpublic url: string;\n\n\t/**\n\t * Locale translation method.\n\t */\n\tpublic t: LocaleTranslate;\n\n\tprivate xhr?: XMLHttpRequest;\n\n\t/**\n\t * Creates a new adapter instance.\n\t */\n\tconstructor( loader: FileLoader, url: string, t: LocaleTranslate ) {\n\t\tthis.loader = loader;\n\t\tthis.url = url;\n\t\tthis.t = t;\n\t}\n\n\t/**\n\t * Starts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#upload\n\t */\n\tpublic upload() {\n\t\treturn this.loader.file.then( file => {\n\t\t\treturn new Promise<UploadResponse>( ( resolve, reject ) => {\n\t\t\t\tthis._initRequest();\n\t\t\t\tthis._initListeners( resolve, reject, file! );\n\t\t\t\tthis._sendRequest( file! );\n\t\t\t} );\n\t\t} );\n\t}\n\n\t/**\n\t * Aborts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#abort\n\t */\n\tpublic abort() {\n\t\tif ( this.xhr ) {\n\t\t\tthis.xhr.abort();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the XMLHttpRequest object.\n\t */\n\tprivate _initRequest() {\n\t\tconst xhr = this.xhr = new XMLHttpRequest();\n\n\t\txhr.open( 'POST', this.url, true );\n\t\txhr.responseType = 'json';\n\t}\n\n\t/**\n\t * Initializes XMLHttpRequest listeners.\n\t *\n\t * @param resolve Callback function to be called when the request is successful.\n\t * @param reject Callback function to be called when the request cannot be completed.\n\t * @param file File instance to be uploaded.\n\t */\n\tprivate _initListeners(\n\t\tresolve: ( value: UploadResponse ) => void,\n\t\treject: ( reason?: unknown ) => void,\n\t\tfile: File\n\t) {\n\t\tconst xhr = this.xhr!;\n\t\tconst loader = this.loader;\n\t\tconst t = this.t;\n\t\tconst genericError = t( 'Cannot upload file:' ) + ` ${ file.name }.`;\n\n\t\txhr.addEventListener( 'error', () => reject( genericError ) );\n\t\txhr.addEventListener( 'abort', () => reject() );\n\t\txhr.addEventListener( 'load', () => {\n\t\t\tconst response = xhr.response;\n\n\t\t\tif ( !response || !response.uploaded ) {\n\t\t\t\treturn reject( response && response.error && response.error.message ? response.error.message : genericError );\n\t\t\t}\n\n\t\t\tresolve( {\n\t\t\t\tdefault: response.url\n\t\t\t} );\n\t\t} );\n\n\t\t// Upload progress when it's supported.\n\t\t/* istanbul ignore else -- @preserve */\n\t\tif ( xhr.upload ) {\n\t\t\txhr.upload.addEventListener( 'progress', evt => {\n\t\t\t\tif ( evt.lengthComputable ) {\n\t\t\t\t\tloader.uploadTotal = evt.total;\n\t\t\t\t\tloader.uploaded = evt.loaded;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\t/**\n\t * Prepares the data and sends the request.\n\t *\n\t * @param file File instance to be uploaded.\n\t */\n\tprivate _sendRequest( file: File ) {\n\t\t// Prepare form data.\n\t\tconst data = new FormData();\n\t\tdata.append( 'upload', file );\n\t\tdata.append( 'ckCsrfToken', getCsrfToken() );\n\n\t\t// Send request.\n\t\tthis.xhr!.send( data );\n\t}\n}\n"]}
1
+ {"version":3,"sources":["index.js","../src/utils.ts","../src/uploadadapter.ts"],"names":[],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;AACjD,MAAM,CA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;AACjF,CAAC;;AAED,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AACzI,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC","file":"index.js.map","sourcesContent":["import { Plugin } from \"@ckeditor/ckeditor5-core\";\nimport { FileRepository } from \"@ckeditor/ckeditor5-upload\";\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module adapter-ckfinder/utils\n*/\nconst TOKEN_COOKIE_NAME = \"ckCsrfToken\";\nconst TOKEN_LENGTH = 40;\nconst tokenCharset = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n/**\n* Returns the CSRF token value. The value is a hash stored in `document.cookie`\n* under the `ckCsrfToken` key. The CSRF token can be used to secure the communication\n* between the web browser and the CKFinder server.\n*\n* @internal\n*/\nfunction getCsrfToken() {\n\tlet token = getCookie(TOKEN_COOKIE_NAME);\n\tif (!token || token.length != TOKEN_LENGTH) {\n\t\ttoken = generateToken(TOKEN_LENGTH);\n\t\tsetCookie(TOKEN_COOKIE_NAME, token);\n\t}\n\treturn token;\n}\n/**\n* Returns the value of the cookie with a given name or `null` if the cookie is not found.\n*\n* @internal\n*/\nfunction getCookie(name) {\n\tname = name.toLowerCase();\n\tconst parts = document.cookie.split(\";\");\n\tfor (const part of parts) {\n\t\tconst pair = part.split(\"=\");\n\t\tif (decodeURIComponent(pair[0].trim().toLowerCase()) === name) return decodeURIComponent(pair[1]);\n\t}\n\treturn null;\n}\n/**\n* Sets the value of the cookie with a given name.\n*\n* @internal\n*/\nfunction setCookie(name, value) {\n\tdocument.cookie = encodeURIComponent(name) + \"=\" + encodeURIComponent(value) + \";path=/\";\n}\n/**\n* Generates the CSRF token with the given length.\n*/\nfunction generateToken(length) {\n\tlet result = \"\";\n\tconst randValues = new Uint8Array(length);\n\twindow.crypto.getRandomValues(randValues);\n\tfor (let j = 0; j < randValues.length; j++) {\n\t\tconst character = tokenCharset.charAt(randValues[j] % 36);\n\t\tresult += Math.random() > .5 ? character.toUpperCase() : character;\n\t}\n\treturn result;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module adapter-ckfinder/uploadadapter\n*/\n/**\n* A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.\n*\n* See the {@glink features/file-management/ckfinder \"CKFinder file manager integration\"} guide to learn how to configure\n* and use this feature as well as find out more about the full integration with the file manager\n* provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.\n*\n* Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} guide to learn\n* about other ways to upload images into CKEditor 5.\n*/\nvar CKFinderUploadAdapter = class extends Plugin {\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get requires() {\n\t\treturn [FileRepository];\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get pluginName() {\n\t\treturn \"CKFinderUploadAdapter\";\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tstatic get isOfficialPlugin() {\n\t\treturn true;\n\t}\n\t/**\n\t* @inheritDoc\n\t*/\n\tinit() {\n\t\tconst url = this.editor.config.get(\"ckfinder.uploadUrl\");\n\t\tif (!url) return;\n\t\tthis.editor.plugins.get(FileRepository).createUploadAdapter = (loader) => new UploadAdapter(loader, url, this.editor.t);\n\t}\n};\n/**\n* Upload adapter for CKFinder.\n*/\nvar UploadAdapter = class {\n\t/**\n\t* FileLoader instance to use during the upload.\n\t*/\n\tloader;\n\t/**\n\t* Upload URL.\n\t*/\n\turl;\n\t/**\n\t* Locale translation method.\n\t*/\n\tt;\n\txhr;\n\t/**\n\t* Creates a new adapter instance.\n\t*/\n\tconstructor(loader, url, t) {\n\t\tthis.loader = loader;\n\t\tthis.url = url;\n\t\tthis.t = t;\n\t}\n\t/**\n\t* Starts the upload process.\n\t*\n\t* @see module:upload/filerepository~UploadAdapter#upload\n\t*/\n\tupload() {\n\t\treturn this.loader.file.then((file) => {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tthis._initRequest();\n\t\t\t\tthis._initListeners(resolve, reject, file);\n\t\t\t\tthis._sendRequest(file);\n\t\t\t});\n\t\t});\n\t}\n\t/**\n\t* Aborts the upload process.\n\t*\n\t* @see module:upload/filerepository~UploadAdapter#abort\n\t*/\n\tabort() {\n\t\tif (this.xhr) this.xhr.abort();\n\t}\n\t/**\n\t* Initializes the XMLHttpRequest object.\n\t*/\n\t_initRequest() {\n\t\tconst xhr = this.xhr = new XMLHttpRequest();\n\t\txhr.open(\"POST\", this.url, true);\n\t\txhr.responseType = \"json\";\n\t}\n\t/**\n\t* Initializes XMLHttpRequest listeners.\n\t*\n\t* @param resolve Callback function to be called when the request is successful.\n\t* @param reject Callback function to be called when the request cannot be completed.\n\t* @param file File instance to be uploaded.\n\t*/\n\t_initListeners(resolve, reject, file) {\n\t\tconst xhr = this.xhr;\n\t\tconst loader = this.loader;\n\t\tconst t = this.t;\n\t\tconst genericError = t(\"Cannot upload file:\") + ` ${file.name}.`;\n\t\txhr.addEventListener(\"error\", () => reject(genericError));\n\t\txhr.addEventListener(\"abort\", () => reject());\n\t\txhr.addEventListener(\"load\", () => {\n\t\t\tconst response = xhr.response;\n\t\t\tif (!response || !response.uploaded) return reject(response && response.error && response.error.message ? response.error.message : genericError);\n\t\t\tresolve({ default: response.url });\n\t\t});\n\t\t/* v8 ignore else -- @preserve */\n\t\tif (xhr.upload) xhr.upload.addEventListener(\"progress\", (evt) => {\n\t\t\tif (evt.lengthComputable) {\n\t\t\t\tloader.uploadTotal = evt.total;\n\t\t\t\tloader.uploaded = evt.loaded;\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Prepares the data and sends the request.\n\t*\n\t* @param file File instance to be uploaded.\n\t*/\n\t_sendRequest(file) {\n\t\tconst data = new FormData();\n\t\tdata.append(\"upload\", file);\n\t\tdata.append(\"ckCsrfToken\", getCsrfToken());\n\t\tthis.xhr.send(data);\n\t}\n};\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n\nexport { CKFinderUploadAdapter, getCookie as _getCKFinderCookie, getCsrfToken as _getCKFinderCsrfToken, setCookie as _setCKFinderCookie };\n//# sourceMappingURL=index.js.map","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module adapter-ckfinder/utils\n */\n\nconst TOKEN_COOKIE_NAME = 'ckCsrfToken';\nconst TOKEN_LENGTH = 40;\nconst tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';\n\n/**\n * Returns the CSRF token value. The value is a hash stored in `document.cookie`\n * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication\n * between the web browser and the CKFinder server.\n *\n * @internal\n */\nexport function getCsrfToken(): string {\n\tlet token = getCookie( TOKEN_COOKIE_NAME );\n\n\tif ( !token || token.length != TOKEN_LENGTH ) {\n\t\ttoken = generateToken( TOKEN_LENGTH );\n\t\tsetCookie( TOKEN_COOKIE_NAME, token );\n\t}\n\n\treturn token;\n}\n\n/**\n * Returns the value of the cookie with a given name or `null` if the cookie is not found.\n *\n * @internal\n */\nexport function getCookie( name: string ): string | null {\n\tname = name.toLowerCase();\n\tconst parts = document.cookie.split( ';' );\n\n\tfor ( const part of parts ) {\n\t\tconst pair = part.split( '=' );\n\t\tconst key = decodeURIComponent( pair[ 0 ].trim().toLowerCase() );\n\n\t\tif ( key === name ) {\n\t\t\treturn decodeURIComponent( pair[ 1 ] );\n\t\t}\n\t}\n\n\treturn null;\n}\n\n/**\n * Sets the value of the cookie with a given name.\n *\n * @internal\n */\nexport function setCookie( name: string, value: string ): void {\n\tdocument.cookie = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';path=/';\n}\n\n/**\n * Generates the CSRF token with the given length.\n */\nfunction generateToken( length: number ): string {\n\tlet result = '';\n\tconst randValues = new Uint8Array( length );\n\n\twindow.crypto.getRandomValues( randValues );\n\n\tfor ( let j = 0; j < randValues.length; j++ ) {\n\t\tconst character = tokenCharset.charAt( randValues[ j ] % tokenCharset.length );\n\t\tresult += Math.random() > 0.5 ? character.toUpperCase() : character;\n\t}\n\n\treturn result;\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n/**\n * @module adapter-ckfinder/uploadadapter\n */\n\nimport { Plugin, type PluginDependenciesOf } from '@ckeditor/ckeditor5-core';\nimport {\n\tFileRepository,\n\ttype UploadAdapter as UploadAdapterInterface,\n\ttype FileLoader,\n\ttype UploadResponse\n} from '@ckeditor/ckeditor5-upload';\nimport type { LocaleTranslate } from '@ckeditor/ckeditor5-utils';\n\nimport { getCsrfToken } from './utils.js';\n\n/**\n * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.\n *\n * See the {@glink features/file-management/ckfinder \"CKFinder file manager integration\"} guide to learn how to configure\n * and use this feature as well as find out more about the full integration with the file manager\n * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} guide to learn\n * about other ways to upload images into CKEditor 5.\n */\nexport class CKFinderUploadAdapter extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires(): PluginDependenciesOf<[ FileRepository ]> {\n\t\treturn [ FileRepository ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'CKFinderUploadAdapter' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static override get isOfficialPlugin(): true {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst url = this.editor.config.get( 'ckfinder.uploadUrl' )! as string;\n\n\t\tif ( !url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Register CKFinderAdapter\n\t\tthis.editor.plugins.get( FileRepository ).createUploadAdapter = loader => new UploadAdapter( loader, url, this.editor.t );\n\t}\n}\n\n/**\n * Upload adapter for CKFinder.\n */\nclass UploadAdapter implements UploadAdapterInterface {\n\t/**\n\t * FileLoader instance to use during the upload.\n\t */\n\tpublic loader: FileLoader;\n\n\t/**\n\t * Upload URL.\n\t */\n\tpublic url: string;\n\n\t/**\n\t * Locale translation method.\n\t */\n\tpublic t: LocaleTranslate;\n\n\tprivate xhr?: XMLHttpRequest;\n\n\t/**\n\t * Creates a new adapter instance.\n\t */\n\tconstructor( loader: FileLoader, url: string, t: LocaleTranslate ) {\n\t\tthis.loader = loader;\n\t\tthis.url = url;\n\t\tthis.t = t;\n\t}\n\n\t/**\n\t * Starts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#upload\n\t */\n\tpublic upload() {\n\t\treturn this.loader.file.then( file => {\n\t\t\treturn new Promise<UploadResponse>( ( resolve, reject ) => {\n\t\t\t\tthis._initRequest();\n\t\t\t\tthis._initListeners( resolve, reject, file! );\n\t\t\t\tthis._sendRequest( file! );\n\t\t\t} );\n\t\t} );\n\t}\n\n\t/**\n\t * Aborts the upload process.\n\t *\n\t * @see module:upload/filerepository~UploadAdapter#abort\n\t */\n\tpublic abort() {\n\t\tif ( this.xhr ) {\n\t\t\tthis.xhr.abort();\n\t\t}\n\t}\n\n\t/**\n\t * Initializes the XMLHttpRequest object.\n\t */\n\tprivate _initRequest() {\n\t\tconst xhr = this.xhr = new XMLHttpRequest();\n\n\t\txhr.open( 'POST', this.url, true );\n\t\txhr.responseType = 'json';\n\t}\n\n\t/**\n\t * Initializes XMLHttpRequest listeners.\n\t *\n\t * @param resolve Callback function to be called when the request is successful.\n\t * @param reject Callback function to be called when the request cannot be completed.\n\t * @param file File instance to be uploaded.\n\t */\n\tprivate _initListeners(\n\t\tresolve: ( value: UploadResponse ) => void,\n\t\treject: ( reason?: unknown ) => void,\n\t\tfile: File\n\t) {\n\t\tconst xhr = this.xhr!;\n\t\tconst loader = this.loader;\n\t\tconst t = this.t;\n\t\tconst genericError = t( 'Cannot upload file:' ) + ` ${ file.name }.`;\n\n\t\txhr.addEventListener( 'error', () => reject( genericError ) );\n\t\txhr.addEventListener( 'abort', () => reject() );\n\t\txhr.addEventListener( 'load', () => {\n\t\t\tconst response = xhr.response;\n\n\t\t\tif ( !response || !response.uploaded ) {\n\t\t\t\treturn reject( response && response.error && response.error.message ? response.error.message : genericError );\n\t\t\t}\n\n\t\t\tresolve( {\n\t\t\t\tdefault: response.url\n\t\t\t} );\n\t\t} );\n\n\t\t// Upload progress when it's supported.\n\t\t/* v8 ignore else -- @preserve */\n\t\tif ( xhr.upload ) {\n\t\t\txhr.upload.addEventListener( 'progress', evt => {\n\t\t\t\tif ( evt.lengthComputable ) {\n\t\t\t\t\tloader.uploadTotal = evt.total;\n\t\t\t\t\tloader.uploaded = evt.loaded;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\t/**\n\t * Prepares the data and sends the request.\n\t *\n\t * @param file File instance to be uploaded.\n\t */\n\tprivate _sendRequest( file: File ) {\n\t\t// Prepare form data.\n\t\tconst data = new FormData();\n\t\tdata.append( 'upload', file );\n\t\tdata.append( 'ckCsrfToken', getCsrfToken() );\n\n\t\t// Send request.\n\t\tthis.xhr!.send( data );\n\t}\n}\n"]}
@@ -1,37 +1,37 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module adapter-ckfinder/uploadadapter
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { FileRepository } from '@ckeditor/ckeditor5-upload';
6
+ * @module adapter-ckfinder/uploadadapter
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { FileRepository } from "@ckeditor/ckeditor5-upload";
10
10
  /**
11
- * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.
12
- *
13
- * See the {@glink features/file-management/ckfinder "CKFinder file manager integration"} guide to learn how to configure
14
- * and use this feature as well as find out more about the full integration with the file manager
15
- * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.
16
- *
17
- * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} guide to learn
18
- * about other ways to upload images into CKEditor 5.
19
- */
11
+ * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.
12
+ *
13
+ * See the {@glink features/file-management/ckfinder "CKFinder file manager integration"} guide to learn how to configure
14
+ * and use this feature as well as find out more about the full integration with the file manager
15
+ * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.
16
+ *
17
+ * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} guide to learn
18
+ * about other ways to upload images into CKEditor 5.
19
+ */
20
20
  export declare class CKFinderUploadAdapter extends Plugin {
21
- /**
22
- * @inheritDoc
23
- */
24
- static get requires(): readonly [typeof FileRepository];
25
- /**
26
- * @inheritDoc
27
- */
28
- static get pluginName(): "CKFinderUploadAdapter";
29
- /**
30
- * @inheritDoc
31
- */
32
- static get isOfficialPlugin(): true;
33
- /**
34
- * @inheritDoc
35
- */
36
- init(): void;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get requires(): PluginDependenciesOf<[FileRepository]>;
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get pluginName(): "CKFinderUploadAdapter";
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ static override get isOfficialPlugin(): true;
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ init(): void;
37
37
  }
package/dist/utils.d.ts CHANGED
@@ -1,24 +1,24 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * Returns the CSRF token value. The value is a hash stored in `document.cookie`
7
- * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
8
- * between the web browser and the CKFinder server.
9
- *
10
- * @internal
11
- */
6
+ * Returns the CSRF token value. The value is a hash stored in `document.cookie`
7
+ * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
8
+ * between the web browser and the CKFinder server.
9
+ *
10
+ * @internal
11
+ */
12
12
  export declare function getCsrfToken(): string;
13
13
  /**
14
- * Returns the value of the cookie with a given name or `null` if the cookie is not found.
15
- *
16
- * @internal
17
- */
14
+ * Returns the value of the cookie with a given name or `null` if the cookie is not found.
15
+ *
16
+ * @internal
17
+ */
18
18
  export declare function getCookie(name: string): string | null;
19
19
  /**
20
- * Sets the value of the cookie with a given name.
21
- *
22
- * @internal
23
- */
20
+ * Sets the value of the cookie with a given name.
21
+ *
22
+ * @internal
23
+ */
24
24
  export declare function setCookie(name: string, value: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-adapter-ckfinder",
3
- "version": "48.2.0",
3
+ "version": "48.3.0-alpha.1",
4
4
  "description": "CKFinder adapter for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -26,9 +26,9 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-core": "48.2.0",
30
- "@ckeditor/ckeditor5-upload": "48.2.0",
31
- "@ckeditor/ckeditor5-utils": "48.2.0"
29
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.1",
30
+ "@ckeditor/ckeditor5-upload": "48.3.0-alpha.1",
31
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.1"
32
32
  },
33
33
  "files": [
34
34
  "dist",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.css"],"names":[],"mappings":";;;;;;AAEA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["\n\n/*# sourceMappingURL=index.css.map */"]}