@ckeditor/ckeditor5-ckfinder 40.0.0 → 40.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,31 +5,31 @@ All changes in the package are documented in the main repository. See: https://g
5
5
 
6
6
  Changes for the past releases are available below.
7
7
 
8
- ## [19.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v18.0.0...v19.0.0) (2020-04-29)
8
+ ## [19.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v18.0.0...v19.0.0) (April 29, 2020)
9
9
 
10
10
  Internal changes only (updated dependencies, documentation, etc.).
11
11
 
12
12
 
13
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v17.0.0...v18.0.0) (2020-03-19)
13
+ ## [18.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v17.0.0...v18.0.0) (March 19, 2020)
14
14
 
15
15
  Internal changes only (updated dependencies, documentation, etc.).
16
16
 
17
17
 
18
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v16.0.0...v17.0.0) (2020-02-19)
18
+ ## [17.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v16.0.0...v17.0.0) (February 19, 2020)
19
19
 
20
20
  ### Other changes
21
21
 
22
22
  * Updated translations. ([2660bf3](https://github.com/ckeditor/ckeditor5-ckfinder/commit/2660bf3))
23
23
 
24
24
 
25
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v15.0.0...v16.0.0) (2019-12-04)
25
+ ## [16.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v15.0.0...v16.0.0) (December 4, 2019)
26
26
 
27
27
  ### Other changes
28
28
 
29
29
  * Updated translations. ([ff9da0b](https://github.com/ckeditor/ckeditor5-ckfinder/commit/ff9da0b))
30
30
 
31
31
 
32
- ## [15.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.5...v15.0.0) (2019-10-23)
32
+ ## [15.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.5...v15.0.0) (October 23, 2019)
33
33
 
34
34
  ### Bug fixes
35
35
 
@@ -40,7 +40,7 @@ Internal changes only (updated dependencies, documentation, etc.).
40
40
  * Updated translations. ([8e44572](https://github.com/ckeditor/ckeditor5-ckfinder/commit/8e44572))
41
41
 
42
42
 
43
- ## [11.0.5](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.4...v11.0.5) (2019-08-26)
43
+ ## [11.0.5](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.4...v11.0.5) (August 26, 2019)
44
44
 
45
45
  ### Bug fixes
46
46
 
@@ -52,26 +52,26 @@ Internal changes only (updated dependencies, documentation, etc.).
52
52
  * Updated translations. ([3c3e350](https://github.com/ckeditor/ckeditor5-ckfinder/commit/3c3e350))
53
53
 
54
54
 
55
- ## [11.0.4](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.3...v11.0.4) (2019-07-10)
55
+ ## [11.0.4](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.3...v11.0.4) (July 10, 2019)
56
56
 
57
57
  Internal changes only (updated dependencies, documentation, etc.).
58
58
 
59
59
 
60
- ## [11.0.3](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.2...v11.0.3) (2019-07-04)
60
+ ## [11.0.3](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.2...v11.0.3) (July 4, 2019)
61
61
 
62
62
  ### Other changes
63
63
 
64
64
  * Updated translations. ([e681af2](https://github.com/ckeditor/ckeditor5-ckfinder/commit/e681af2))
65
65
 
66
66
 
67
- ## [11.0.2](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.1...v11.0.2) (2019-06-05)
67
+ ## [11.0.2](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.1...v11.0.2) (June 6, 2019)
68
68
 
69
69
  ### Other changes
70
70
 
71
71
  * Updated translations. ([27f6f8b](https://github.com/ckeditor/ckeditor5-ckfinder/commit/27f6f8b))
72
72
 
73
73
 
74
- ## [11.0.1](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.0...v11.0.1) (2019-04-10)
74
+ ## [11.0.1](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v11.0.0...v11.0.1) (April 4, 2019)
75
75
 
76
76
  ### Other changes
77
77
 
@@ -79,7 +79,7 @@ Internal changes only (updated dependencies, documentation, etc.).
79
79
  * Updated translations. ([5b26349](https://github.com/ckeditor/ckeditor5-ckfinder/commit/5b26349))
80
80
 
81
81
 
82
- ## [11.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v10.0.0...v11.0.0) (2019-02-28)
82
+ ## [11.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/compare/v10.0.0...v11.0.0) (February 28, 2019)
83
83
 
84
84
  ### Other changes
85
85
 
@@ -90,6 +90,6 @@ Internal changes only (updated dependencies, documentation, etc.).
90
90
  * Upgraded minimal versions of Node to `8.0.0` and npm to `5.7.1`. See: [ckeditor/ckeditor5#1507](https://github.com/ckeditor/ckeditor5/issues/1507). ([612ea3c](https://github.com/ckeditor/ckeditor5-cloud-services/commit/612ea3c))
91
91
 
92
92
 
93
- ## [10.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/tree/v10.0.0) (2018-12-05)
93
+ ## [10.0.0](https://github.com/ckeditor/ckeditor5-ckfinder/tree/v10.0.0) (December 5, 2018)
94
94
 
95
95
  Initial implementation of the CKFinder file manager integration feature.
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor&nbsp;5 CKFinder feature** – https://github.com/ckeditor/ckeditor5-ckfinder <br>
5
- Copyright (c) 2003-2023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 20032023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
6
6
 
7
7
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
8
8
 
@@ -14,4 +14,4 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
14
14
  Trademarks
15
15
  ----------
16
16
 
17
- **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
17
+ **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
package/build/ckfinder.js CHANGED
@@ -1,5 +1,5 @@
1
- !function(e){const i=e.en=e.en||{};i.dictionary=Object.assign(i.dictionary||{},{"Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Insert image or file":"Insert image or file","Inserting image failed":"Inserting image failed","Selecting resized image failed":"Selecting resized image failed"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
1
+ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Insert image or file":"Insert image or file","Inserting image failed":"Inserting image failed","Selecting resized image failed":"Selecting resized image failed"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var e={704:(e,i,t)=>{e.exports=t(79)("./src/core.js")},273:(e,i,t)=>{e.exports=t(79)("./src/ui.js")},209:(e,i,t)=>{e.exports=t(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},i={};function t(n){var o=i[n];if(void 0!==o)return o.exports;var r=i[n]={exports:{}};return e[n](r,r.exports,t),r.exports}t.d=(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},t.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";t.r(n),t.d(n,{CKFinder:()=>c,CKFinderEditing:()=>d,CKFinderUI:()=>o});var e=t(704),i=t(273);class o extends e.Plugin{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t;t.add("ckfinder",(t=>{const o=e.commands.get("ckfinder"),r=new i.ButtonView(t);return r.set({label:n("Insert image or file"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',tooltip:!0}),r.bind("isEnabled").to(o),r.on("execute",(()=>{e.execute("ckfinder"),e.editing.view.focus()})),r}))}}var r=t(209);class s extends e.Command{constructor(e){super(e),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",(()=>this.refresh()),{priority:"low"})}refresh(){const e=this.editor.commands.get("insertImage"),i=this.editor.commands.get("link");this.isEnabled=e.isEnabled||i.isEnabled}execute(){const e=this.editor,i=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=i&&"modal"!=i)throw new r.CKEditorError("ckfinder-unknown-openermethod",e);const t=this.editor.config.get("ckfinder.options")||{};t.chooseFiles=!0;const n=t.onInit;t.language||(t.language=e.locale.uiLanguage),t.onInit=i=>{n&&n(i),i.on("files:choose",(t=>{const n=t.data.files.toArray(),o=n.filter((e=>!e.isImage())),r=n.filter((e=>e.isImage()));for(const i of o)e.execute("link",i.getUrl());const s=[];for(const e of r){const t=e.getUrl();s.push(t||i.request("file:getProxyUrl",{file:e}))}s.length&&a(e,s)})),i.on("file:choose:resizedImage",(i=>{const t=i.data.resizedUrl;if(t)a(e,[t]);else{const i=e.plugins.get("Notification"),t=e.locale.t;i.showWarning(t("Could not obtain resized image URL."),{title:t("Selecting resized image failed"),namespace:"ckfinder"})}}))},window.CKFinder[i](t)}}function a(e,i){if(e.commands.get("insertImage").isEnabled)e.execute("insertImage",{source:i});else{const i=e.plugins.get("Notification"),t=e.locale.t;i.showWarning(t("Could not insert image at the current position."),{title:t("Inserting image failed"),namespace:"ckfinder"})}}class d extends e.Plugin{static get pluginName(){return"CKFinderEditing"}static get requires(){return[i.Notification,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new r.CKEditorError("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new s(e))}}class c extends e.Plugin{static get pluginName(){return"CKFinder"}static get requires(){return["Link","CKFinderUploadAdapter",d,o]}}})(),(window.CKEditor5=window.CKEditor5||{}).ckfinder=n})();
5
+ */(()=>{var e={704:(e,t,i)=>{e.exports=i(79)("./src/core.js")},273:(e,t,i)=>{e.exports=i(79)("./src/ui.js")},209:(e,t,i)=>{e.exports=i(79)("./src/utils.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{CKFinder:()=>c,CKFinderEditing:()=>d,CKFinderUI:()=>o});var e=i(704),t=i(273);class o extends e.Plugin{static get pluginName(){return"CKFinderUI"}init(){const i=this.editor,n=i.ui.componentFactory,o=i.t;if(n.add("ckfinder",(e=>{const n=i.commands.get("ckfinder"),r=new t.ButtonView(e);return r.set({label:o("Insert image or file"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',tooltip:!0}),r.bind("isEnabled").to(n),r.on("execute",(()=>{i.execute("ckfinder"),i.editing.view.focus()})),r})),i.plugins.has("ImageInsertUI")){const t=i.plugins.get("ImageInsertUI"),n=i.commands.get("ckfinder");t.registerIntegration({name:"assetManager",observable:n,buttonViewCreator:()=>{const i=this.editor.ui.componentFactory.create("ckfinder");return i.icon=e.icons.imageAssetManager,i.bind("label").to(t,"isImageSelected",(e=>o(e?"Replace image with file manager":"Insert image with file manager"))),i},formViewCreator:()=>{const i=this.editor.ui.componentFactory.create("ckfinder");return i.icon=e.icons.imageAssetManager,i.withText=!0,i.bind("label").to(t,"isImageSelected",(e=>o(e?"Replace with file manager":"Insert with file manager"))),i.on("execute",(()=>{t.dropdownView.isOpen=!1})),i}})}}}var r=i(209);class s extends e.Command{constructor(e){super(e),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",(()=>this.refresh()),{priority:"low"})}refresh(){const e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=t&&"modal"!=t)throw new r.CKEditorError("ckfinder-unknown-openermethod",e);const i=this.editor.config.get("ckfinder.options")||{};i.chooseFiles=!0;const n=i.onInit;i.language||(i.language=e.locale.uiLanguage),i.onInit=t=>{n&&n(t),t.on("files:choose",(i=>{const n=i.data.files.toArray(),o=n.filter((e=>!e.isImage())),r=n.filter((e=>e.isImage()));for(const t of o)e.execute("link",t.getUrl());const s=[];for(const e of r){const i=e.getUrl();s.push(i||t.request("file:getProxyUrl",{file:e}))}s.length&&a(e,s)})),t.on("file:choose:resizedImage",(t=>{const i=t.data.resizedUrl;if(i)a(e,[i]);else{const t=e.plugins.get("Notification"),i=e.locale.t;t.showWarning(i("Could not obtain resized image URL."),{title:i("Selecting resized image failed"),namespace:"ckfinder"})}}))},window.CKFinder[t](i)}}function a(e,t){if(e.commands.get("insertImage").isEnabled)e.execute("insertImage",{source:t});else{const t=e.plugins.get("Notification"),i=e.locale.t;t.showWarning(i("Could not insert image at the current position."),{title:i("Inserting image failed"),namespace:"ckfinder"})}}class d extends e.Plugin{static get pluginName(){return"CKFinderEditing"}static get requires(){return[t.Notification,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new r.CKEditorError("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new s(e))}}class c extends e.Plugin{static get pluginName(){return"CKFinder"}static get requires(){return["Link","CKFinderUploadAdapter",d,o]}}})(),(window.CKEditor5=window.CKEditor5||{}).ckfinder=n})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ckfinder",
3
- "version": "40.0.0",
3
+ "version": "40.2.0",
4
4
  "description": "CKFinder integration for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "40.0.0"
15
+ "ckeditor5": "40.2.0"
16
16
  },
17
17
  "author": "CKSource (http://cksource.com/)",
18
18
  "license": "GPL-2.0-or-later",
@@ -1,22 +1,22 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import type { CKFinder, CKFinderCommand, CKFinderConfig, CKFinderEditing } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface EditorConfig {
8
- /**
9
- * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}.
10
- *
11
- * Read more in {@link module:ckfinder/ckfinderconfig~CKFinderConfig}.
12
- */
13
- ckfinder?: CKFinderConfig;
14
- }
15
- interface PluginsMap {
16
- [CKFinder.pluginName]: CKFinder;
17
- [CKFinderEditing.pluginName]: CKFinderEditing;
18
- }
19
- interface CommandsMap {
20
- ckfinder: CKFinderCommand;
21
- }
22
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type { CKFinder, CKFinderCommand, CKFinderConfig, CKFinderEditing } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface EditorConfig {
8
+ /**
9
+ * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}.
10
+ *
11
+ * Read more in {@link module:ckfinder/ckfinderconfig~CKFinderConfig}.
12
+ */
13
+ ckfinder?: CKFinderConfig;
14
+ }
15
+ interface PluginsMap {
16
+ [CKFinder.pluginName]: CKFinder;
17
+ [CKFinderEditing.pluginName]: CKFinderEditing;
18
+ }
19
+ interface CommandsMap {
20
+ ckfinder: CKFinderCommand;
21
+ }
22
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export {};
package/src/ckfinder.d.ts CHANGED
@@ -1,36 +1,36 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder/ckfinder
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import CKFinderUI from './ckfinderui';
10
- import CKFinderEditing from './ckfinderediting';
11
- /**
12
- * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
13
- * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
14
- *
15
- * This is a "glue" plugin which enables:
16
- *
17
- * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
18
- * * {@link module:ckfinder/ckfinderui~CKFinderUI},
19
- * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
20
- *
21
- * See the {@glink features/file-management/ckfinder "CKFinder integration" guide} to learn how to configure
22
- * and use this feature.
23
- *
24
- * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload" guide} to learn about
25
- * other ways to upload images into CKEditor 5.
26
- */
27
- export default class CKFinder extends Plugin {
28
- /**
29
- * @inheritDoc
30
- */
31
- static get pluginName(): "CKFinder";
32
- /**
33
- * @inheritDoc
34
- */
35
- static get requires(): readonly ["Link", "CKFinderUploadAdapter", typeof CKFinderEditing, typeof CKFinderUI];
36
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder/ckfinder
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import CKFinderUI from './ckfinderui';
10
+ import CKFinderEditing from './ckfinderediting';
11
+ /**
12
+ * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
13
+ * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
14
+ *
15
+ * This is a "glue" plugin which enables:
16
+ *
17
+ * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
18
+ * * {@link module:ckfinder/ckfinderui~CKFinderUI},
19
+ * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
20
+ *
21
+ * See the {@glink features/file-management/ckfinder "CKFinder integration" guide} to learn how to configure
22
+ * and use this feature.
23
+ *
24
+ * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload" guide} to learn about
25
+ * other ways to upload images into CKEditor 5.
26
+ */
27
+ export default class CKFinder extends Plugin {
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ static get pluginName(): "CKFinder";
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get requires(): readonly ["Link", "CKFinderUploadAdapter", typeof CKFinderEditing, typeof CKFinderUI];
36
+ }
package/src/ckfinder.js CHANGED
@@ -1,40 +1,40 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder/ckfinder
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import CKFinderUI from './ckfinderui';
10
- import CKFinderEditing from './ckfinderediting';
11
- /**
12
- * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
13
- * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
14
- *
15
- * This is a "glue" plugin which enables:
16
- *
17
- * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
18
- * * {@link module:ckfinder/ckfinderui~CKFinderUI},
19
- * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
20
- *
21
- * See the {@glink features/file-management/ckfinder "CKFinder integration" guide} to learn how to configure
22
- * and use this feature.
23
- *
24
- * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload" guide} to learn about
25
- * other ways to upload images into CKEditor 5.
26
- */
27
- export default class CKFinder extends Plugin {
28
- /**
29
- * @inheritDoc
30
- */
31
- static get pluginName() {
32
- return 'CKFinder';
33
- }
34
- /**
35
- * @inheritDoc
36
- */
37
- static get requires() {
38
- return ['Link', 'CKFinderUploadAdapter', CKFinderEditing, CKFinderUI];
39
- }
40
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder/ckfinder
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import CKFinderUI from './ckfinderui';
10
+ import CKFinderEditing from './ckfinderediting';
11
+ /**
12
+ * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
13
+ * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
14
+ *
15
+ * This is a "glue" plugin which enables:
16
+ *
17
+ * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
18
+ * * {@link module:ckfinder/ckfinderui~CKFinderUI},
19
+ * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
20
+ *
21
+ * See the {@glink features/file-management/ckfinder "CKFinder integration" guide} to learn how to configure
22
+ * and use this feature.
23
+ *
24
+ * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload" guide} to learn about
25
+ * other ways to upload images into CKEditor 5.
26
+ */
27
+ export default class CKFinder extends Plugin {
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ static get pluginName() {
32
+ return 'CKFinder';
33
+ }
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ static get requires() {
38
+ return ['Link', 'CKFinderUploadAdapter', CKFinderEditing, CKFinderUI];
39
+ }
40
+ }
@@ -1,36 +1,36 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder/ckfindercommand
7
- */
8
- import { Command, type Editor } from 'ckeditor5/src/core';
9
- /**
10
- * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}
11
- * to open the CKFinder file manager to insert an image or a link to a file into the editor content.
12
- *
13
- * ```ts
14
- * editor.execute( 'ckfinder' );
15
- * ```
16
- *
17
- * **Note:** This command uses other features to perform tasks:
18
- * - To insert images the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command
19
- * from the {@link module:image/image~Image Image feature}.
20
- * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command
21
- * from the {@link module:link/link~Link Link feature}.
22
- */
23
- export default class CKFinderCommand extends Command {
24
- /**
25
- * @inheritDoc
26
- */
27
- constructor(editor: Editor);
28
- /**
29
- * @inheritDoc
30
- */
31
- refresh(): void;
32
- /**
33
- * @inheritDoc
34
- */
35
- execute(): void;
36
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder/ckfindercommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core';
9
+ /**
10
+ * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}
11
+ * to open the CKFinder file manager to insert an image or a link to a file into the editor content.
12
+ *
13
+ * ```ts
14
+ * editor.execute( 'ckfinder' );
15
+ * ```
16
+ *
17
+ * **Note:** This command uses other features to perform tasks:
18
+ * - To insert images the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command
19
+ * from the {@link module:image/image~Image Image feature}.
20
+ * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command
21
+ * from the {@link module:link/link~Link Link feature}.
22
+ */
23
+ export default class CKFinderCommand extends Command {
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ constructor(editor: Editor);
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ refresh(): void;
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ execute(): void;
36
+ }
@@ -1,122 +1,122 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /* global window */
6
- /**
7
- * @module ckfinder/ckfindercommand
8
- */
9
- import { Command } from 'ckeditor5/src/core';
10
- import { CKEditorError } from 'ckeditor5/src/utils';
11
- /**
12
- * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}
13
- * to open the CKFinder file manager to insert an image or a link to a file into the editor content.
14
- *
15
- * ```ts
16
- * editor.execute( 'ckfinder' );
17
- * ```
18
- *
19
- * **Note:** This command uses other features to perform tasks:
20
- * - To insert images the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command
21
- * from the {@link module:image/image~Image Image feature}.
22
- * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command
23
- * from the {@link module:link/link~Link Link feature}.
24
- */
25
- export default class CKFinderCommand extends Command {
26
- /**
27
- * @inheritDoc
28
- */
29
- constructor(editor) {
30
- super(editor);
31
- // The CKFinder command does not affect data by itself.
32
- this.affectsData = false;
33
- // Remove default document listener to lower its priority.
34
- this.stopListening(this.editor.model.document, 'change');
35
- // Lower this command listener priority to be sure that refresh() will be called after link & image refresh.
36
- this.listenTo(this.editor.model.document, 'change', () => this.refresh(), { priority: 'low' });
37
- }
38
- /**
39
- * @inheritDoc
40
- */
41
- refresh() {
42
- const imageCommand = this.editor.commands.get('insertImage');
43
- const linkCommand = this.editor.commands.get('link');
44
- // The CKFinder command is enabled when one of image or link command is enabled.
45
- this.isEnabled = imageCommand.isEnabled || linkCommand.isEnabled;
46
- }
47
- /**
48
- * @inheritDoc
49
- */
50
- execute() {
51
- const editor = this.editor;
52
- const openerMethod = this.editor.config.get('ckfinder.openerMethod') || 'modal';
53
- if (openerMethod != 'popup' && openerMethod != 'modal') {
54
- /**
55
- * The `ckfinder.openerMethod` must be one of: "popup" or "modal".
56
- *
57
- * @error ckfinder-unknown-openermethod
58
- */
59
- throw new CKEditorError('ckfinder-unknown-openermethod', editor);
60
- }
61
- const options = this.editor.config.get('ckfinder.options') || {};
62
- options.chooseFiles = true;
63
- // Cache the user-defined onInit method
64
- const originalOnInit = options.onInit;
65
- // Pass the lang code to the CKFinder if not defined by user.
66
- if (!options.language) {
67
- options.language = editor.locale.uiLanguage;
68
- }
69
- // The onInit method allows to extend CKFinder's behavior. It is used to attach event listeners to file choosing related events.
70
- options.onInit = finder => {
71
- // Call original options.onInit if it was defined by user.
72
- if (originalOnInit) {
73
- originalOnInit(finder);
74
- }
75
- finder.on('files:choose', (evt) => {
76
- const files = evt.data.files.toArray();
77
- // Insert links
78
- const links = files.filter((file) => !file.isImage());
79
- const images = files.filter((file) => file.isImage());
80
- for (const linkFile of links) {
81
- editor.execute('link', linkFile.getUrl());
82
- }
83
- const imagesUrls = [];
84
- for (const image of images) {
85
- const url = image.getUrl();
86
- imagesUrls.push(url ? url : finder.request('file:getProxyUrl', { file: image }));
87
- }
88
- if (imagesUrls.length) {
89
- insertImages(editor, imagesUrls);
90
- }
91
- });
92
- finder.on('file:choose:resizedImage', (evt) => {
93
- const resizedUrl = evt.data.resizedUrl;
94
- if (!resizedUrl) {
95
- const notification = editor.plugins.get('Notification');
96
- const t = editor.locale.t;
97
- notification.showWarning(t('Could not obtain resized image URL.'), {
98
- title: t('Selecting resized image failed'),
99
- namespace: 'ckfinder'
100
- });
101
- return;
102
- }
103
- insertImages(editor, [resizedUrl]);
104
- });
105
- };
106
- window.CKFinder[openerMethod](options);
107
- }
108
- }
109
- function insertImages(editor, urls) {
110
- const imageCommand = editor.commands.get('insertImage');
111
- // Check if inserting an image is actually possible - it might be possible to only insert a link.
112
- if (!imageCommand.isEnabled) {
113
- const notification = editor.plugins.get('Notification');
114
- const t = editor.locale.t;
115
- notification.showWarning(t('Could not insert image at the current position.'), {
116
- title: t('Inserting image failed'),
117
- namespace: 'ckfinder'
118
- });
119
- return;
120
- }
121
- editor.execute('insertImage', { source: urls });
122
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /* global window */
6
+ /**
7
+ * @module ckfinder/ckfindercommand
8
+ */
9
+ import { Command } from 'ckeditor5/src/core';
10
+ import { CKEditorError } from 'ckeditor5/src/utils';
11
+ /**
12
+ * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}
13
+ * to open the CKFinder file manager to insert an image or a link to a file into the editor content.
14
+ *
15
+ * ```ts
16
+ * editor.execute( 'ckfinder' );
17
+ * ```
18
+ *
19
+ * **Note:** This command uses other features to perform tasks:
20
+ * - To insert images the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command
21
+ * from the {@link module:image/image~Image Image feature}.
22
+ * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command
23
+ * from the {@link module:link/link~Link Link feature}.
24
+ */
25
+ export default class CKFinderCommand extends Command {
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ constructor(editor) {
30
+ super(editor);
31
+ // The CKFinder command does not affect data by itself.
32
+ this.affectsData = false;
33
+ // Remove default document listener to lower its priority.
34
+ this.stopListening(this.editor.model.document, 'change');
35
+ // Lower this command listener priority to be sure that refresh() will be called after link & image refresh.
36
+ this.listenTo(this.editor.model.document, 'change', () => this.refresh(), { priority: 'low' });
37
+ }
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ refresh() {
42
+ const imageCommand = this.editor.commands.get('insertImage');
43
+ const linkCommand = this.editor.commands.get('link');
44
+ // The CKFinder command is enabled when one of image or link command is enabled.
45
+ this.isEnabled = imageCommand.isEnabled || linkCommand.isEnabled;
46
+ }
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ execute() {
51
+ const editor = this.editor;
52
+ const openerMethod = this.editor.config.get('ckfinder.openerMethod') || 'modal';
53
+ if (openerMethod != 'popup' && openerMethod != 'modal') {
54
+ /**
55
+ * The `ckfinder.openerMethod` must be one of: "popup" or "modal".
56
+ *
57
+ * @error ckfinder-unknown-openermethod
58
+ */
59
+ throw new CKEditorError('ckfinder-unknown-openermethod', editor);
60
+ }
61
+ const options = this.editor.config.get('ckfinder.options') || {};
62
+ options.chooseFiles = true;
63
+ // Cache the user-defined onInit method
64
+ const originalOnInit = options.onInit;
65
+ // Pass the lang code to the CKFinder if not defined by user.
66
+ if (!options.language) {
67
+ options.language = editor.locale.uiLanguage;
68
+ }
69
+ // The onInit method allows to extend CKFinder's behavior. It is used to attach event listeners to file choosing related events.
70
+ options.onInit = finder => {
71
+ // Call original options.onInit if it was defined by user.
72
+ if (originalOnInit) {
73
+ originalOnInit(finder);
74
+ }
75
+ finder.on('files:choose', (evt) => {
76
+ const files = evt.data.files.toArray();
77
+ // Insert links
78
+ const links = files.filter((file) => !file.isImage());
79
+ const images = files.filter((file) => file.isImage());
80
+ for (const linkFile of links) {
81
+ editor.execute('link', linkFile.getUrl());
82
+ }
83
+ const imagesUrls = [];
84
+ for (const image of images) {
85
+ const url = image.getUrl();
86
+ imagesUrls.push(url ? url : finder.request('file:getProxyUrl', { file: image }));
87
+ }
88
+ if (imagesUrls.length) {
89
+ insertImages(editor, imagesUrls);
90
+ }
91
+ });
92
+ finder.on('file:choose:resizedImage', (evt) => {
93
+ const resizedUrl = evt.data.resizedUrl;
94
+ if (!resizedUrl) {
95
+ const notification = editor.plugins.get('Notification');
96
+ const t = editor.locale.t;
97
+ notification.showWarning(t('Could not obtain resized image URL.'), {
98
+ title: t('Selecting resized image failed'),
99
+ namespace: 'ckfinder'
100
+ });
101
+ return;
102
+ }
103
+ insertImages(editor, [resizedUrl]);
104
+ });
105
+ };
106
+ window.CKFinder[openerMethod](options);
107
+ }
108
+ }
109
+ function insertImages(editor, urls) {
110
+ const imageCommand = editor.commands.get('insertImage');
111
+ // Check if inserting an image is actually possible - it might be possible to only insert a link.
112
+ if (!imageCommand.isEnabled) {
113
+ const notification = editor.plugins.get('Notification');
114
+ const t = editor.locale.t;
115
+ notification.showWarning(t('Could not insert image at the current position.'), {
116
+ title: t('Inserting image failed'),
117
+ namespace: 'ckfinder'
118
+ });
119
+ return;
120
+ }
121
+ editor.execute('insertImage', { source: urls });
122
+ }
@@ -1,73 +1,73 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder/ckfinderconfig
7
- */
8
- /**
9
- * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}
10
- * and its {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
11
- *
12
- * ```
13
- * ClassicEditor
14
- * .create( editorElement, {
15
- * ckfinder: {
16
- * options: {
17
- * resourceType: 'Images'
18
- * }
19
- * }
20
- * } )
21
- * .then( ... )
22
- * .catch( ... );
23
- * ```
24
- *
25
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
26
- */
27
- export interface CKFinderConfig {
28
- /**
29
- * The configuration options passed to the CKFinder file manager instance.
30
- *
31
- * Check the file manager [documentation](https://ckeditor.com/docs/ckfinder/ckfinder3/#!/api/CKFinder.Config-cfg-language)
32
- * for the complete list of options.
33
- */
34
- options?: CKFinderOptions;
35
- /**
36
- * The type of the CKFinder opener method.
37
- *
38
- * Supported types are:
39
- *
40
- * * `'modal'` &ndash; Opens CKFinder in a modal,
41
- * * `'popup'` &ndash; Opens CKFinder in a new "pop-up" window.
42
- *
43
- * Defaults to `'modal'`.
44
- */
45
- openerMethod?: 'modal' | 'popup';
46
- /**
47
- * The path (URL) to the connector which handles the file upload in CKFinder file manager.
48
- * When specified, it enables the automatic upload of resources such as images inserted into the content.
49
- *
50
- * For instance, to use CKFinder's
51
- * [quick upload](https://ckeditor.com/docs/ckfinder/ckfinder3-php/commands.html#command_quick_upload)
52
- * command, your can use the following (or similar) path:
53
- *
54
- * ```ts
55
- * ClassicEditor
56
- * .create( editorElement, {
57
- * ckfinder: {
58
- * uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'
59
- * }
60
- * } )
61
- * .then( ... )
62
- * .catch( ... );
63
- * ```
64
- *
65
- * Used by the {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
66
- */
67
- uploadUrl?: string;
68
- }
69
- export interface CKFinderOptions extends Record<string, unknown> {
70
- chooseFiles?: boolean;
71
- onInit?: (finder: any) => void;
72
- language?: string;
73
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder/ckfinderconfig
7
+ */
8
+ /**
9
+ * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}
10
+ * and its {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
11
+ *
12
+ * ```
13
+ * ClassicEditor
14
+ * .create( editorElement, {
15
+ * ckfinder: {
16
+ * options: {
17
+ * resourceType: 'Images'
18
+ * }
19
+ * }
20
+ * } )
21
+ * .then( ... )
22
+ * .catch( ... );
23
+ * ```
24
+ *
25
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
26
+ */
27
+ export interface CKFinderConfig {
28
+ /**
29
+ * The configuration options passed to the CKFinder file manager instance.
30
+ *
31
+ * Check the file manager [documentation](https://ckeditor.com/docs/ckfinder/ckfinder3/#!/api/CKFinder.Config-cfg-language)
32
+ * for the complete list of options.
33
+ */
34
+ options?: CKFinderOptions;
35
+ /**
36
+ * The type of the CKFinder opener method.
37
+ *
38
+ * Supported types are:
39
+ *
40
+ * * `'modal'` &ndash; Opens CKFinder in a modal,
41
+ * * `'popup'` &ndash; Opens CKFinder in a new "pop-up" window.
42
+ *
43
+ * Defaults to `'modal'`.
44
+ */
45
+ openerMethod?: 'modal' | 'popup';
46
+ /**
47
+ * The path (URL) to the connector which handles the file upload in CKFinder file manager.
48
+ * When specified, it enables the automatic upload of resources such as images inserted into the content.
49
+ *
50
+ * For instance, to use CKFinder's
51
+ * [quick upload](https://ckeditor.com/docs/ckfinder/ckfinder3-php/commands.html#command_quick_upload)
52
+ * command, your can use the following (or similar) path:
53
+ *
54
+ * ```ts
55
+ * ClassicEditor
56
+ * .create( editorElement, {
57
+ * ckfinder: {
58
+ * uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'
59
+ * }
60
+ * } )
61
+ * .then( ... )
62
+ * .catch( ... );
63
+ * ```
64
+ *
65
+ * Used by the {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
66
+ */
67
+ uploadUrl?: string;
68
+ }
69
+ export interface CKFinderOptions extends Record<string, unknown> {
70
+ chooseFiles?: boolean;
71
+ onInit?: (finder: any) => void;
72
+ language?: string;
73
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export {};
@@ -1,26 +1,26 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder/ckfinderediting
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { Notification } from 'ckeditor5/src/ui';
10
- /**
11
- * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.
12
- */
13
- export default class CKFinderEditing extends Plugin {
14
- /**
15
- * @inheritDoc
16
- */
17
- static get pluginName(): "CKFinderEditing";
18
- /**
19
- * @inheritDoc
20
- */
21
- static get requires(): readonly [typeof Notification, "LinkEditing"];
22
- /**
23
- * @inheritDoc
24
- */
25
- init(): void;
26
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder/ckfinderediting
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import { Notification } from 'ckeditor5/src/ui';
10
+ /**
11
+ * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.
12
+ */
13
+ export default class CKFinderEditing extends Plugin {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ static get pluginName(): "CKFinderEditing";
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get requires(): readonly [typeof Notification, "LinkEditing"];
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ init(): void;
26
+ }
@@ -1,50 +1,50 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder/ckfinderediting
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { Notification } from 'ckeditor5/src/ui';
10
- import { CKEditorError } from 'ckeditor5/src/utils';
11
- import CKFinderCommand from './ckfindercommand';
12
- /**
13
- * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.
14
- */
15
- export default class CKFinderEditing extends Plugin {
16
- /**
17
- * @inheritDoc
18
- */
19
- static get pluginName() {
20
- return 'CKFinderEditing';
21
- }
22
- /**
23
- * @inheritDoc
24
- */
25
- static get requires() {
26
- return [Notification, 'LinkEditing'];
27
- }
28
- /**
29
- * @inheritDoc
30
- */
31
- init() {
32
- const editor = this.editor;
33
- if (!editor.plugins.has('ImageBlockEditing') && !editor.plugins.has('ImageInlineEditing')) {
34
- /**
35
- * CKFinder requires at least one plugin providing support for images loaded in the editor. Please
36
- * make sure either:
37
- *
38
- * * {@link module:image/image~Image} (which loads both types of images),
39
- * * or {@link module:image/imageblock~ImageBlock},
40
- * * or {@link module:image/imageinline~ImageInline}.
41
- *
42
- * is loaded in your editor configuration.
43
- *
44
- * @error ckfinder-missing-image-plugin
45
- */
46
- throw new CKEditorError('ckfinder-missing-image-plugin', editor);
47
- }
48
- editor.commands.add('ckfinder', new CKFinderCommand(editor));
49
- }
50
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder/ckfinderediting
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import { Notification } from 'ckeditor5/src/ui';
10
+ import { CKEditorError } from 'ckeditor5/src/utils';
11
+ import CKFinderCommand from './ckfindercommand';
12
+ /**
13
+ * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.
14
+ */
15
+ export default class CKFinderEditing extends Plugin {
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static get pluginName() {
20
+ return 'CKFinderEditing';
21
+ }
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get requires() {
26
+ return [Notification, 'LinkEditing'];
27
+ }
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ init() {
32
+ const editor = this.editor;
33
+ if (!editor.plugins.has('ImageBlockEditing') && !editor.plugins.has('ImageInlineEditing')) {
34
+ /**
35
+ * CKFinder requires at least one plugin providing support for images loaded in the editor. Please
36
+ * make sure either:
37
+ *
38
+ * * {@link module:image/image~Image} (which loads both types of images),
39
+ * * or {@link module:image/imageblock~ImageBlock},
40
+ * * or {@link module:image/imageinline~ImageInline}.
41
+ *
42
+ * is loaded in your editor configuration.
43
+ *
44
+ * @error ckfinder-missing-image-plugin
45
+ */
46
+ throw new CKEditorError('ckfinder-missing-image-plugin', editor);
47
+ }
48
+ editor.commands.add('ckfinder', new CKFinderCommand(editor));
49
+ }
50
+ }
@@ -1,21 +1,21 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder/ckfinderui
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- /**
10
- * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.
11
- */
12
- export default class CKFinderUI extends Plugin {
13
- /**
14
- * @inheritDoc
15
- */
16
- static get pluginName(): "CKFinderUI";
17
- /**
18
- * @inheritDoc
19
- */
20
- init(): void;
21
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder/ckfinderui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ /**
10
+ * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.
11
+ */
12
+ export default class CKFinderUI extends Plugin {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get pluginName(): "CKFinderUI";
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ init(): void;
21
+ }
package/src/ckfinderui.js CHANGED
@@ -1,44 +1,72 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder/ckfinderui
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import { ButtonView } from 'ckeditor5/src/ui';
10
- import browseFilesIcon from '../theme/icons/browse-files.svg';
11
- /**
12
- * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.
13
- */
14
- export default class CKFinderUI extends Plugin {
15
- /**
16
- * @inheritDoc
17
- */
18
- static get pluginName() {
19
- return 'CKFinderUI';
20
- }
21
- /**
22
- * @inheritDoc
23
- */
24
- init() {
25
- const editor = this.editor;
26
- const componentFactory = editor.ui.componentFactory;
27
- const t = editor.t;
28
- componentFactory.add('ckfinder', locale => {
29
- const command = editor.commands.get('ckfinder');
30
- const button = new ButtonView(locale);
31
- button.set({
32
- label: t('Insert image or file'),
33
- icon: browseFilesIcon,
34
- tooltip: true
35
- });
36
- button.bind('isEnabled').to(command);
37
- button.on('execute', () => {
38
- editor.execute('ckfinder');
39
- editor.editing.view.focus();
40
- });
41
- return button;
42
- });
43
- }
44
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder/ckfinderui
7
+ */
8
+ import { icons, Plugin } from 'ckeditor5/src/core';
9
+ import { ButtonView } from 'ckeditor5/src/ui';
10
+ import browseFilesIcon from '../theme/icons/browse-files.svg';
11
+ /**
12
+ * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.
13
+ */
14
+ export default class CKFinderUI extends Plugin {
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ static get pluginName() {
19
+ return 'CKFinderUI';
20
+ }
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ init() {
25
+ const editor = this.editor;
26
+ const componentFactory = editor.ui.componentFactory;
27
+ const t = editor.t;
28
+ componentFactory.add('ckfinder', locale => {
29
+ const command = editor.commands.get('ckfinder');
30
+ const button = new ButtonView(locale);
31
+ button.set({
32
+ label: t('Insert image or file'),
33
+ icon: browseFilesIcon,
34
+ tooltip: true
35
+ });
36
+ button.bind('isEnabled').to(command);
37
+ button.on('execute', () => {
38
+ editor.execute('ckfinder');
39
+ editor.editing.view.focus();
40
+ });
41
+ return button;
42
+ });
43
+ if (editor.plugins.has('ImageInsertUI')) {
44
+ const imageInsertUI = editor.plugins.get('ImageInsertUI');
45
+ const command = editor.commands.get('ckfinder');
46
+ imageInsertUI.registerIntegration({
47
+ name: 'assetManager',
48
+ observable: command,
49
+ buttonViewCreator: () => {
50
+ const button = this.editor.ui.componentFactory.create('ckfinder');
51
+ button.icon = icons.imageAssetManager;
52
+ button.bind('label').to(imageInsertUI, 'isImageSelected', isImageSelected => isImageSelected ?
53
+ t('Replace image with file manager') :
54
+ t('Insert image with file manager'));
55
+ return button;
56
+ },
57
+ formViewCreator: () => {
58
+ const button = this.editor.ui.componentFactory.create('ckfinder');
59
+ button.icon = icons.imageAssetManager;
60
+ button.withText = true;
61
+ button.bind('label').to(imageInsertUI, 'isImageSelected', isImageSelected => isImageSelected ?
62
+ t('Replace with file manager') :
63
+ t('Insert with file manager'));
64
+ button.on('execute', () => {
65
+ imageInsertUI.dropdownView.isOpen = false;
66
+ });
67
+ return button;
68
+ }
69
+ });
70
+ }
71
+ }
72
+ }
package/src/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder
7
- */
8
- export { default as CKFinder } from './ckfinder';
9
- export { default as CKFinderEditing } from './ckfinderediting';
10
- export { default as CKFinderUI } from './ckfinderui';
11
- export type { CKFinderConfig } from './ckfinderconfig';
12
- export type { default as CKFinderCommand } from './ckfindercommand';
13
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder
7
+ */
8
+ export { default as CKFinder } from './ckfinder';
9
+ export { default as CKFinderEditing } from './ckfinderediting';
10
+ export { default as CKFinderUI } from './ckfinderui';
11
+ export type { CKFinderConfig } from './ckfinderconfig';
12
+ export type { default as CKFinderCommand } from './ckfindercommand';
13
+ import './augmentation';
package/src/index.js CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ckfinder
7
- */
8
- export { default as CKFinder } from './ckfinder';
9
- export { default as CKFinderEditing } from './ckfinderediting';
10
- export { default as CKFinderUI } from './ckfinderui';
11
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ckfinder
7
+ */
8
+ export { default as CKFinder } from './ckfinder';
9
+ export { default as CKFinderEditing } from './ckfinderediting';
10
+ export { default as CKFinderUI } from './ckfinderui';
11
+ import './augmentation';
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack://CKEditor5.ckfinder/./theme/icons/browse-files.svg","webpack://CKEditor5.ckfinder/./src/ckfinder.js","webpack://CKEditor5.ckfinder/./src/ckfindercommand.js","webpack://CKEditor5.ckfinder/./src/ckfinderediting.js","webpack://CKEditor5.ckfinder/./src/ckfinderui.js","webpack://CKEditor5.ckfinder/delegated \"./src/core.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.ckfinder/delegated \"./src/ui.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.ckfinder/delegated \"./src/utils.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.ckfinder/external var \"CKEditor5.dll\"","webpack://CKEditor5.ckfinder/webpack/bootstrap","webpack://CKEditor5.ckfinder/webpack/runtime/define property getters","webpack://CKEditor5.ckfinder/webpack/runtime/hasOwnProperty shorthand","webpack://CKEditor5.ckfinder/webpack/runtime/make namespace object","webpack://CKEditor5.ckfinder/./src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,iEAAe,odAAod;;;;;;;;;;;;;;;;;;ACAne;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;;AAEN;AACU;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,sDAAsD;AAC5D,MAAM,4CAA4C;AAClD,MAAM,kEAAkE;AACxE;AACA,YAAY,2EAA2E;AACvF;AACA;AACA,kBAAkB,qFAAqF;AACvG;AACA;AACA;AACA;AACe,uBAAuB,sDAAM;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,4CAA4C,wDAAe,EAAE,mDAAU;AACvE;AACA;;AAEA;AACA,6BAA6B,yDAAyD;AACtF;AACA,iBAAiB,8CAA8C;AAC/D;AACA,YAAY,yCAAyC;AACrD;;AAEA;AACA,6BAA6B;AAC7B,YAAY,iFAAiF;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,QAAQ,sEAAsE;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,uBAAuB;AACvB;AACA;AACA;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,gBAAgB,iFAAiF;AACjG;AACA,YAAY,QAAQ;AACpB;;;;;;;;;;;;;;;;;;ACtHA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAE6C;AACO;;AAEpD;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA,2BAA2B,8EAA8E;AACzG,aAAa,6CAA6C;AAC1D,mCAAmC,kDAAkD;AACrF,aAAa,yCAAyC;AACtD;AACA;AACA;AACe,8BAA8B,uDAAO;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,+EAA+E,kBAAkB;AACjG;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8DAAa;AAC1B;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,wEAAwE,cAAc;AACtF;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA,kCAAkC,eAAe;AACjD;;;;;;;;;;;;;;;;;;;;ACzJA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;AACI;AACI;;AAEJ;;AAEhD;AACA,oDAAoD,uEAAuE;AAC3H;AACA;AACA;AACe,8BAA8B,sDAAM;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,0DAAY;AACvB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS,gCAAgC;AACzC,YAAY,yCAAyC;AACrD,YAAY,2CAA2C;AACvD;AACA;AACA;AACA;AACA;AACA,aAAa,8DAAa;AAC1B;;AAEA,uCAAuC,wDAAe;AACtD;AACA;;;;;;;;;;;;;;;;;;;AC3DA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;AACE;;AAEgB;;AAE9D;AACA;AACA;AACA;AACA;AACe,yBAAyB,sDAAM;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,wDAAU;;AAEhC;AACA;AACA,UAAU,qEAAe;AACzB;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA,IAAI;AACJ;AACA;;;;;;;;;;;ACxDA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEiD;AACc;AACV","file":"ckfinder.js","sourcesContent":["export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z\\\"/><path d=\\\"M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module ckfinder/ckfinder\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\n\nimport CKFinderUI from './ckfinderui';\nimport CKFinderEditing from './ckfinderediting';\n\n/**\n * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the\n * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.\n *\n * This is a \"glue\" plugin which enables:\n *\n * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},\n * * {@link module:ckfinder/ckfinderui~CKFinderUI},\n * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.\n *\n * See the {@glink features/images/image-upload/ckfinder \"CKFinder integration\" guide} to learn how to configure\n * and use this feature.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload\" guide} to learn about\n * other ways to upload images into CKEditor 5.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class CKFinder extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'CKFinder';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ 'Link', 'CKFinderUploadAdapter', CKFinderEditing, CKFinderUI ];\n\t}\n}\n\n/**\n * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}.\n *\n * Read more in {@link module:ckfinder/ckfinder~CKFinderConfig}.\n *\n * @member {module:ckfinder/ckfinder~CKFinderConfig} module:core/editor/editorconfig~EditorConfig#ckfinder\n */\n\n/**\n * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}\n * and its {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\tckfinder: {\n *\t\t\t\t\toptions: {\n *\t\t\t\t\t\tresourceType: 'Images'\n *\t\t\t\t\t}\n *\t\t\t\t}\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.\n *\n * @interface CKFinderConfig\n */\n\n/**\n * The configuration options passed to the CKFinder file manager instance.\n *\n * Check the file manager [documentation](https://ckeditor.com/docs/ckfinder/ckfinder3/#!/api/CKFinder.Config-cfg-language)\n * for the complete list of options.\n *\n * @member {Object} module:ckfinder/ckfinder~CKFinderConfig#options\n */\n\n/**\n * The type of the CKFinder opener method.\n *\n * Supported types are:\n *\n * * `'modal'` &ndash; Opens CKFinder in a modal,\n * * `'popup'` &ndash; Opens CKFinder in a new \"pop-up\" window.\n *\n * Defaults to `'modal'`.\n *\n * @member {String} module:ckfinder/ckfinder~CKFinderConfig#openerMethod\n */\n\n/**\n * The path (URL) to the connector which handles the file upload in CKFinder file manager.\n * When specified, it enables the automatic upload of resources such as images inserted into the content.\n *\n * For instance, to use CKFinder's\n * [quick upload](https://ckeditor.com/docs/ckfinder/ckfinder3-php/commands.html#command_quick_upload)\n * command, your can use the following (or similar) path:\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n *\t\t\t\tckfinder: {\n *\t\t\t\t\tuploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'\n *\t\t\t\t}\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * Used by the {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.\n *\n * @member {String} module:ckfinder/ckfinder~CKFinderConfig#uploadUrl\n */\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* global window */\n\n/**\n * @module ckfinder/ckfindercommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\nimport { CKEditorError } from 'ckeditor5/src/utils';\n\n/**\n * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}\n * to open the CKFinder file manager to insert an image or a link to a file into the editor content.\n *\n *\t\teditor.execute( 'ckfinder' );\n *\n * **Note:** This command uses other features to perform tasks:\n * - To insert images the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command\n * from the {@link module:image/image~Image Image feature}.\n * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command\n * from the {@link module:link/link~Link Link feature}.\n *\n * @extends module:core/command~Command\n */\nexport default class CKFinderCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor ) {\n\t\tsuper( editor );\n\n\t\t// Remove default document listener to lower its priority.\n\t\tthis.stopListening( this.editor.model.document, 'change' );\n\n\t\t// Lower this command listener priority to be sure that refresh() will be called after link & image refresh.\n\t\tthis.listenTo( this.editor.model.document, 'change', () => this.refresh(), { priority: 'low' } );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tconst imageCommand = this.editor.commands.get( 'insertImage' );\n\t\tconst linkCommand = this.editor.commands.get( 'link' );\n\n\t\t// The CKFinder command is enabled when one of image or link command is enabled.\n\t\tthis.isEnabled = imageCommand.isEnabled || linkCommand.isEnabled;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\texecute() {\n\t\tconst editor = this.editor;\n\n\t\tconst openerMethod = this.editor.config.get( 'ckfinder.openerMethod' ) || 'modal';\n\n\t\tif ( openerMethod != 'popup' && openerMethod != 'modal' ) {\n\t\t\t/**\n\t\t\t * The `ckfinder.openerMethod` must be one of: \"popup\" or \"modal\".\n\t\t\t *\n\t\t\t * @error ckfinder-unknown-openermethod\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'ckfinder-unknown-openermethod', editor );\n\t\t}\n\n\t\tconst options = this.editor.config.get( 'ckfinder.options' ) || {};\n\n\t\toptions.chooseFiles = true;\n\n\t\t// Cache the user-defined onInit method\n\t\tconst originalOnInit = options.onInit;\n\n\t\t// Pass the lang code to the CKFinder if not defined by user.\n\t\tif ( !options.language ) {\n\t\t\toptions.language = editor.locale.uiLanguage;\n\t\t}\n\n\t\t// The onInit method allows to extend CKFinder's behavior. It is used to attach event listeners to file choosing related events.\n\t\toptions.onInit = finder => {\n\t\t\t// Call original options.onInit if it was defined by user.\n\t\t\tif ( originalOnInit ) {\n\t\t\t\toriginalOnInit( finder );\n\t\t\t}\n\n\t\t\tfinder.on( 'files:choose', evt => {\n\t\t\t\tconst files = evt.data.files.toArray();\n\n\t\t\t\t// Insert links\n\t\t\t\tconst links = files.filter( file => !file.isImage() );\n\t\t\t\tconst images = files.filter( file => file.isImage() );\n\n\t\t\t\tfor ( const linkFile of links ) {\n\t\t\t\t\teditor.execute( 'link', linkFile.getUrl() );\n\t\t\t\t}\n\n\t\t\t\tconst imagesUrls = [];\n\n\t\t\t\tfor ( const image of images ) {\n\t\t\t\t\tconst url = image.getUrl();\n\n\t\t\t\t\timagesUrls.push( url ? url : finder.request( 'file:getProxyUrl', { file: image } ) );\n\t\t\t\t}\n\n\t\t\t\tif ( imagesUrls.length ) {\n\t\t\t\t\tinsertImages( editor, imagesUrls );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tfinder.on( 'file:choose:resizedImage', evt => {\n\t\t\t\tconst resizedUrl = evt.data.resizedUrl;\n\n\t\t\t\tif ( !resizedUrl ) {\n\t\t\t\t\tconst notification = editor.plugins.get( 'Notification' );\n\t\t\t\t\tconst t = editor.locale.t;\n\n\t\t\t\t\tnotification.showWarning( t( 'Could not obtain resized image URL.' ), {\n\t\t\t\t\t\ttitle: t( 'Selecting resized image failed' ),\n\t\t\t\t\t\tnamespace: 'ckfinder'\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tinsertImages( editor, [ resizedUrl ] );\n\t\t\t} );\n\t\t};\n\n\t\twindow.CKFinder[ openerMethod ]( options );\n\t}\n}\n\nfunction insertImages( editor, urls ) {\n\tconst imageCommand = editor.commands.get( 'insertImage' );\n\n\t// Check if inserting an image is actually possible - it might be possible to only insert a link.\n\tif ( !imageCommand.isEnabled ) {\n\t\tconst notification = editor.plugins.get( 'Notification' );\n\t\tconst t = editor.locale.t;\n\n\t\tnotification.showWarning( t( 'Could not insert image at the current position.' ), {\n\t\t\ttitle: t( 'Inserting image failed' ),\n\t\t\tnamespace: 'ckfinder'\n\t\t} );\n\n\t\treturn;\n\t}\n\n\teditor.execute( 'insertImage', { source: urls } );\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module ckfinder/ckfinderediting\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Notification } from 'ckeditor5/src/ui';\nimport { CKEditorError } from 'ckeditor5/src/utils';\n\nimport CKFinderCommand from './ckfindercommand';\n\n/**\n * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class CKFinderEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'CKFinderEditing';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ Notification, 'LinkEditing' ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\n\t\tif ( !editor.plugins.has( 'ImageBlockEditing' ) && !editor.plugins.has( 'ImageInlineEditing' ) ) {\n\t\t\t/**\n\t\t\t * CKFinder requires at least one plugin providing support for images loaded in the editor. Please\n\t\t\t * make sure either:\n\t\t\t *\n\t\t\t * * {@link module:image/image~Image} (which loads both types of images),\n\t\t\t * * or {@link module:image/imageblock~ImageBlock},\n\t\t\t * * or {@link module:image/imageinline~ImageInline}.\n\t\t\t *\n\t\t\t * is loaded in your editor configuration.\n\t\t\t *\n\t\t\t * @error ckfinder-missing-image-plugin\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'ckfinder-missing-image-plugin', editor );\n\t\t}\n\n\t\teditor.commands.add( 'ckfinder', new CKFinderCommand( editor ) );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module ckfinder/ckfinderui\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\n\nimport browseFilesIcon from '../theme/icons/browse-files.svg';\n\n/**\n * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class CKFinderUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'CKFinderUI';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst componentFactory = editor.ui.componentFactory;\n\t\tconst t = editor.t;\n\n\t\tcomponentFactory.add( 'ckfinder', locale => {\n\t\t\tconst command = editor.commands.get( 'ckfinder' );\n\n\t\t\tconst button = new ButtonView( locale );\n\n\t\t\tbutton.set( {\n\t\t\t\tlabel: t( 'Insert image or file' ),\n\t\t\t\ticon: browseFilesIcon,\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\tbutton.bind( 'isEnabled' ).to( command );\n\n\t\t\tbutton.on( 'execute', () => {\n\t\t\t\teditor.execute( 'ckfinder' );\n\t\t\t\teditor.editing.view.focus();\n\t\t\t} );\n\n\t\t\treturn button;\n\t\t} );\n\t}\n}\n","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/core.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/ui.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/utils.js\");","module.exports = CKEditor5.dll;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module ckfinder\n */\n\nexport { default as CKFinder } from './ckfinder';\nexport { default as CKFinderEditing } from './ckfinderediting';\nexport { default as CKFinderUI } from './ckfinderui';\n"],"sourceRoot":""}