@ckeditor/ckeditor5-adapter-ckfinder 45.2.1 → 46.0.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.
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md.
4
- */(()=>{var e={237:e=>{"use strict";e.exports=CKEditor5.dll},260:(e,t,r)=>{e.exports=r(237)("./src/upload.js")},782:(e,t,r)=>{e.exports=r(237)("./src/core.js")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";r.r(o),r.d(o,{CKFinderUploadAdapter:()=>a});var e=r(782),t=r(260);const n="ckCsrfToken",s="abcdefghijklmnopqrstuvwxyz0123456789";function i(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const r of t){const t=r.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}(n);var t,r;return e&&40==e.length||(e=function(e){let t="";const r=new Uint8Array(e);window.crypto.getRandomValues(r);for(let e=0;e<r.length;e++){const o=s.charAt(r[e]%36);t+=Math.random()>.5?o.toUpperCase():o}return t}(40),t=n,r=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(r)+";path=/"),e}class a extends e.Plugin{static get requires(){return[t.FileRepository]}static get pluginName(){return"CKFinderUploadAdapter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(t.FileRepository).createUploadAdapter=t=>new d(t,e,this.editor.t))}}class d{loader;url;t;xhr;constructor(e,t,r){this.loader=e,this.url=t,this.t=r}upload(){return this.loader.file.then(e=>new Promise((t,r)=>{this._initRequest(),this._initListeners(t,r,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,r){const o=this.xhr,n=this.loader,s=(0,this.t)("Cannot upload file:")+` ${r.name}.`;o.addEventListener("error",()=>t(s)),o.addEventListener("abort",()=>t()),o.addEventListener("load",()=>{const r=o.response;if(!r||!r.uploaded)return t(r&&r.error&&r.error.message?r.error.message:s);e({default:r.url})}),o.upload&&o.upload.addEventListener("progress",e=>{e.lengthComputable&&(n.uploadTotal=e.total,n.uploaded=e.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",i()),this.xhr.send(t)}}})(),(window.CKEditor5=window.CKEditor5||{}).adapterCkfinder=o})();
4
+ */(()=>{var e={237:e=>{"use strict";e.exports=CKEditor5.dll},260:(e,t,r)=>{e.exports=r(237)("./src/upload.js")},782:(e,t,r)=>{e.exports=r(237)("./src/core.js")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";r.r(o),r.d(o,{CKFinderUploadAdapter:()=>p,_getCKFinderCookie:()=>a,_getCKFinderCsrfToken:()=>d,_setCKFinderCookie:()=>l});var e=r(782),t=r(260);const n="ckCsrfToken",s=40,i="abcdefghijklmnopqrstuvwxyz0123456789";function d(){let e=a(n);return e&&e.length==s||(e=function(e){let t="";const r=new Uint8Array(e);window.crypto.getRandomValues(r);for(let e=0;e<r.length;e++){const o=i.charAt(r[e]%i.length);t+=Math.random()>.5?o.toUpperCase():o}return t}(s),l(n,e)),e}function a(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const r of t){const t=r.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}function l(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"}class p extends e.Plugin{static get requires(){return[t.FileRepository]}static get pluginName(){return"CKFinderUploadAdapter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(t.FileRepository).createUploadAdapter=t=>new u(t,e,this.editor.t))}}class u{loader;url;t;xhr;constructor(e,t,r){this.loader=e,this.url=t,this.t=r}upload(){return this.loader.file.then(e=>new Promise((t,r)=>{this._initRequest(),this._initListeners(t,r,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,r){const o=this.xhr,n=this.loader,s=(0,this.t)("Cannot upload file:")+` ${r.name}.`;o.addEventListener("error",()=>t(s)),o.addEventListener("abort",()=>t()),o.addEventListener("load",()=>{const r=o.response;if(!r||!r.uploaded)return t(r&&r.error&&r.error.message?r.error.message:s);e({default:r.url})}),o.upload&&o.upload.addEventListener("progress",e=>{e.lengthComputable&&(n.uploadTotal=e.total,n.uploaded=e.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",d()),this.xhr.send(t)}}})(),(window.CKEditor5=window.CKEditor5||{}).adapterCkfinder=o})();
package/dist/index.js CHANGED
@@ -17,6 +17,8 @@ const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
17
17
  * Returns the CSRF token value. The value is a hash stored in `document.cookie`
18
18
  * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
19
19
  * between the web browser and the CKFinder server.
20
+ *
21
+ * @internal
20
22
  */ function getCsrfToken() {
21
23
  let token = getCookie(TOKEN_COOKIE_NAME);
22
24
  if (!token || token.length != TOKEN_LENGTH) {
@@ -27,6 +29,8 @@ const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
27
29
  }
28
30
  /**
29
31
  * Returns the value of the cookie with a given name or `null` if the cookie is not found.
32
+ *
33
+ * @internal
30
34
  */ function getCookie(name) {
31
35
  name = name.toLowerCase();
32
36
  const parts = document.cookie.split(';');
@@ -41,6 +45,8 @@ const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
41
45
  }
42
46
  /**
43
47
  * Sets the value of the cookie with a given name.
48
+ *
49
+ * @internal
44
50
  */ function setCookie(name, value) {
45
51
  document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=/';
46
52
  }
@@ -190,5 +196,5 @@ const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
190
196
  }
191
197
  }
192
198
 
193
- export { CKFinderUploadAdapter };
199
+ export { CKFinderUploadAdapter, getCookie as _getCKFinderCookie, getCsrfToken as _getCKFinderCsrfToken, setCookie as _setCKFinderCookie };
194
200
  //# 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,CAAC;AAC/D,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;ACDzE,CAAA,CAAA;ADIA,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ;AACpF,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;AAClF,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;ACA3B,CAAA,CAAA,CAAA,CAED,KAAA,CAAMA,iBAAAA,CAAAA,CAAAA,CAAoB,CAAA,WAAA,CAAA;AAC1B,KAAA,CAAMC,YAAAA,CAAAA,CAAAA,CAAe,EAAA;AACrB,KAAA,CAAMC,YAAAA,CAAAA,CAAAA,CAAe,CAAA,oCAAA,CAAA;AAErB,CAAA,CAAA;ADDA,CAAC,CAAC,CAAC,OAAO,CAAC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AcP,IAAU,CAAA,CAAG;AFFpC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;AEI1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAMwB,IAAAA,CAAAA,CAAAA,CAAO,GAAA,CAAIC,QAAAA,CAAAA,CAAAA;AFFnB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CEGLD,IAAAA,CAAKE,MAAM,CAAE,CAAA,MAAA,CAAA,CAAA,CAAU1B,IAAAA,CAAAA;AFFzB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CEGLwB,IAAAA,CAAKE,MAAM,CAAE,CAAA,WAAA,CAAA,CAAA,CAAe3E,YAAAA,CAAAA,CAAAA,CAAAA;AFF9B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;AEKrB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAI,CAAC+C,GAAG,CAAE6B,IAAI,CAAEH,IAAAA,CAAAA;AACjB,CAAA,CAAA,CAAA,CAAA;AACD;;AFFA,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;AAChC,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-2025, 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 */ 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 */ 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 */ 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 };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2025, 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 */\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 */\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 */\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-2025, 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 'ckeditor5/src/core.js';\nimport {\n\tFileRepository,\n\ttype UploadAdapter as UploadAdapterInterface,\n\ttype FileLoader,\n\ttype UploadResponse\n} from 'ckeditor5/src/upload.js';\nimport type { LocaleTranslate } from 'ckeditor5/src/utils.js';\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 default 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":["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,CAAC;AAC/D,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;ACDzE,CAAA,CAAA;ADIA,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ;AACpF,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;AAClF,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;ACA3B,CAAA,CAAA,CAAA,CAED,KAAA,CAAMA,iBAAAA,CAAAA,CAAAA,CAAoB,CAAA,WAAA,CAAA;AAC1B,KAAA,CAAMC,YAAAA,CAAAA,CAAAA,CAAe,EAAA;AACrB,KAAA,CAAMC,YAAAA,CAAAA,CAAAA,CAAe,CAAA,oCAAA,CAAA;AAErB,CAAA,C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ckeditor/ckeditor5-core/dist/index.js';\nimport { FileRepository } from '@ckeditor/ckeditor5-upload/dist/index.js';\n\n/**\n * @license Copyright (c) 2003-2025, 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-2025, 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-2025, 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 'ckeditor5/src/core.js';\nimport {\n\tFileRepository,\n\ttype UploadAdapter as UploadAdapterInterface,\n\ttype FileLoader,\n\ttype UploadResponse\n} from 'ckeditor5/src/upload.js';\nimport type { LocaleTranslate } from 'ckeditor5/src/utils.js';\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-adapter-ckfinder",
3
- "version": "45.2.1",
3
+ "version": "46.0.0-alpha.0",
4
4
  "description": "CKFinder adapter for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,9 +13,9 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "@ckeditor/ckeditor5-core": "45.2.1",
17
- "@ckeditor/ckeditor5-upload": "45.2.1",
18
- "ckeditor5": "45.2.1"
16
+ "@ckeditor/ckeditor5-core": "46.0.0-alpha.0",
17
+ "@ckeditor/ckeditor5-upload": "46.0.0-alpha.0",
18
+ "ckeditor5": "46.0.0-alpha.0"
19
19
  },
20
20
  "author": "CKSource (http://cksource.com/)",
21
21
  "license": "SEE LICENSE IN LICENSE.md",
package/src/index.d.ts CHANGED
@@ -5,5 +5,6 @@
5
5
  /**
6
6
  * @module adapter-ckfinder
7
7
  */
8
- export { default as CKFinderUploadAdapter } from './uploadadapter.js';
8
+ export { CKFinderUploadAdapter } from './uploadadapter.js';
9
+ export { getCsrfToken as _getCKFinderCsrfToken, getCookie as _getCKFinderCookie, setCookie as _setCKFinderCookie } from './utils.js';
9
10
  import './augmentation.js';
package/src/index.js CHANGED
@@ -5,5 +5,6 @@
5
5
  /**
6
6
  * @module adapter-ckfinder
7
7
  */
8
- export { default as CKFinderUploadAdapter } from './uploadadapter.js';
8
+ export { CKFinderUploadAdapter } from './uploadadapter.js';
9
+ export { getCsrfToken as _getCKFinderCsrfToken, getCookie as _getCKFinderCookie, setCookie as _setCKFinderCookie } from './utils.js';
9
10
  import './augmentation.js';
@@ -17,7 +17,7 @@ import { FileRepository } from 'ckeditor5/src/upload.js';
17
17
  * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} guide to learn
18
18
  * about other ways to upload images into CKEditor 5.
19
19
  */
20
- export default class CKFinderUploadAdapter extends Plugin {
20
+ export declare class CKFinderUploadAdapter extends Plugin {
21
21
  /**
22
22
  * @inheritDoc
23
23
  */
@@ -18,7 +18,7 @@ import { getCsrfToken } from './utils.js';
18
18
  * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} guide to learn
19
19
  * about other ways to upload images into CKEditor 5.
20
20
  */
21
- export default class CKFinderUploadAdapter extends Plugin {
21
+ export class CKFinderUploadAdapter extends Plugin {
22
22
  /**
23
23
  * @inheritDoc
24
24
  */
package/src/utils.d.ts CHANGED
@@ -6,13 +6,19 @@
6
6
  * Returns the CSRF token value. The value is a hash stored in `document.cookie`
7
7
  * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
8
8
  * between the web browser and the CKFinder server.
9
+ *
10
+ * @internal
9
11
  */
10
12
  export declare function getCsrfToken(): string;
11
13
  /**
12
14
  * Returns the value of the cookie with a given name or `null` if the cookie is not found.
15
+ *
16
+ * @internal
13
17
  */
14
18
  export declare function getCookie(name: string): string | null;
15
19
  /**
16
20
  * Sets the value of the cookie with a given name.
21
+ *
22
+ * @internal
17
23
  */
18
24
  export declare function setCookie(name: string, value: string): void;
package/src/utils.js CHANGED
@@ -12,6 +12,8 @@ const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
12
12
  * Returns the CSRF token value. The value is a hash stored in `document.cookie`
13
13
  * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
14
14
  * between the web browser and the CKFinder server.
15
+ *
16
+ * @internal
15
17
  */
16
18
  export function getCsrfToken() {
17
19
  let token = getCookie(TOKEN_COOKIE_NAME);
@@ -23,6 +25,8 @@ export function getCsrfToken() {
23
25
  }
24
26
  /**
25
27
  * Returns the value of the cookie with a given name or `null` if the cookie is not found.
28
+ *
29
+ * @internal
26
30
  */
27
31
  export function getCookie(name) {
28
32
  name = name.toLowerCase();
@@ -38,6 +42,8 @@ export function getCookie(name) {
38
42
  }
39
43
  /**
40
44
  * Sets the value of the cookie with a given name.
45
+ *
46
+ * @internal
41
47
  */
42
48
  export function setCookie(name, value) {
43
49
  document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=/';