@ckeditor/ckeditor5-ckfinder 45.2.1-alpha.4 → 45.2.1-alpha.5

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/build/ckfinder.js CHANGED
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var e={237:e=>{"use strict";e.exports=CKEditor5.dll},311:(e,t,i)=>{e.exports=i(237)("./src/ui.js")},355:(e,t,i)=>{e.exports=i(237)("./src/icons.js")},584:(e,t,i)=>{e.exports=i(237)("./src/utils.js")},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.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:()=>d,CKFinderEditing:()=>l,CKFinderUI:()=>o});var e=i(782),t=i(311),r=i(355);class o extends e.Plugin{static get pluginName(){return"CKFinderUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("ckfinder",(()=>this._createFileToolbarButton())),e.ui.componentFactory.add("menuBar:ckfinder",(()=>this._createFileMenuBarButton())),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"assetManager",observable:()=>e.commands.get("ckfinder"),buttonViewCreator:()=>this._createImageToolbarButton(),formViewCreator:()=>this._createImageDropdownButton(),menuBarButtonViewCreator:e=>this._createImageMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=new e(t.locale),n=t.commands.get("ckfinder");return i.bind("isEnabled").to(n),i.on("execute",(()=>{t.execute("ckfinder"),t.editing.view.focus()})),i}_createFileToolbarButton(){const e=this.editor.locale.t,i=this._createButton(t.ButtonView);return i.icon=r.IconBrowseFiles,i.label=e("Insert image or file"),i.tooltip=!0,i}_createImageToolbarButton(){const e=this.editor.locale.t,i=this.editor.plugins.get("ImageInsertUI"),n=this._createButton(t.ButtonView);return n.icon=r.IconImageAssetManager,n.bind("label").to(i,"isImageSelected",(t=>e(t?"Replace image with file manager":"Insert image with file manager"))),n.tooltip=!0,n}_createImageDropdownButton(){const e=this.editor.locale.t,i=this.editor.plugins.get("ImageInsertUI"),n=this._createButton(t.ButtonView);return n.icon=r.IconImageAssetManager,n.withText=!0,n.bind("label").to(i,"isImageSelected",(t=>e(t?"Replace with file manager":"Insert with file manager"))),n.on("execute",(()=>{i.dropdownView.isOpen=!1})),n}_createFileMenuBarButton(){const e=this.editor.locale.t,i=this._createButton(t.MenuBarMenuListItemButtonView);return i.icon=r.IconBrowseFiles,i.withText=!0,i.label=e("File"),i}_createImageMenuBarButton(e){const i=this.editor.locale.t,n=this.editor.locale.t,o=this._createButton(t.MenuBarMenuListItemButtonView);switch(o.icon=r.IconImageAssetManager,o.withText=!0,e){case"insertOnly":o.label=i("Image");break;case"insertNested":o.label=n("With file manager")}return o}}var s=i(584);class a 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 s.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(),r=n.filter((e=>!e.isImage())),o=n.filter((e=>e.isImage()));for(const t of r)e.execute("link",t.getUrl());const s=[];for(const e of o){const i=e.getUrl();s.push(i||t.request("file:getProxyUrl",{file:e}))}s.length&&c(e,s)})),t.on("file:choose:resizedImage",(t=>{const i=t.data.resizedUrl;if(i)c(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 c(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 l extends e.Plugin{static get pluginName(){return"CKFinderEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[t.Notification,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new s.CKEditorError("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new a(e))}}class d extends e.Plugin{static get pluginName(){return"CKFinder"}static get isOfficialPlugin(){return!0}static get requires(){return["Link","CKFinderUploadAdapter",l,o]}}})(),(window.CKEditor5=window.CKEditor5||{}).ckfinder=n})();
5
+ */(()=>{var e={237:e=>{"use strict";e.exports=CKEditor5.dll},311:(e,t,i)=>{e.exports=i(237)("./src/ui.js")},355:(e,t,i)=>{e.exports=i(237)("./src/icons.js")},584:(e,t,i)=>{e.exports=i(237)("./src/utils.js")},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.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:()=>d,CKFinderEditing:()=>l,CKFinderUI:()=>o});var e=i(782),t=i(311),r=i(355);class o extends e.Plugin{static get pluginName(){return"CKFinderUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("ckfinder",()=>this._createFileToolbarButton()),e.ui.componentFactory.add("menuBar:ckfinder",()=>this._createFileMenuBarButton()),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"assetManager",observable:()=>e.commands.get("ckfinder"),buttonViewCreator:()=>this._createImageToolbarButton(),formViewCreator:()=>this._createImageDropdownButton(),menuBarButtonViewCreator:e=>this._createImageMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=new e(t.locale),n=t.commands.get("ckfinder");return i.bind("isEnabled").to(n),i.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),i}_createFileToolbarButton(){const e=this.editor.locale.t,i=this._createButton(t.ButtonView);return i.icon=r.IconBrowseFiles,i.label=e("Insert image or file"),i.tooltip=!0,i}_createImageToolbarButton(){const e=this.editor.locale.t,i=this.editor.plugins.get("ImageInsertUI"),n=this._createButton(t.ButtonView);return n.icon=r.IconImageAssetManager,n.bind("label").to(i,"isImageSelected",t=>e(t?"Replace image with file manager":"Insert image with file manager")),n.tooltip=!0,n}_createImageDropdownButton(){const e=this.editor.locale.t,i=this.editor.plugins.get("ImageInsertUI"),n=this._createButton(t.ButtonView);return n.icon=r.IconImageAssetManager,n.withText=!0,n.bind("label").to(i,"isImageSelected",t=>e(t?"Replace with file manager":"Insert with file manager")),n.on("execute",()=>{i.dropdownView.isOpen=!1}),n}_createFileMenuBarButton(){const e=this.editor.locale.t,i=this._createButton(t.MenuBarMenuListItemButtonView);return i.icon=r.IconBrowseFiles,i.withText=!0,i.label=e("File"),i}_createImageMenuBarButton(e){const i=this.editor.locale.t,n=this.editor.locale.t,o=this._createButton(t.MenuBarMenuListItemButtonView);switch(o.icon=r.IconImageAssetManager,o.withText=!0,e){case"insertOnly":o.label=i("Image");break;case"insertNested":o.label=n("With file manager")}return o}}var s=i(584);class a 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 s.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(),r=n.filter(e=>!e.isImage()),o=n.filter(e=>e.isImage());for(const t of r)e.execute("link",t.getUrl());const s=[];for(const e of o){const i=e.getUrl();s.push(i||t.request("file:getProxyUrl",{file:e}))}s.length&&c(e,s)}),t.on("file:choose:resizedImage",t=>{const i=t.data.resizedUrl;if(i)c(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 c(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 l extends e.Plugin{static get pluginName(){return"CKFinderEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[t.Notification,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new s.CKEditorError("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new a(e))}}class d extends e.Plugin{static get pluginName(){return"CKFinder"}static get isOfficialPlugin(){return!0}static get requires(){return["Link","CKFinderUploadAdapter",l,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": "45.2.1-alpha.4",
3
+ "version": "45.2.1-alpha.5",
4
4
  "description": "CKFinder integration for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,12 +13,12 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "@ckeditor/ckeditor5-core": "45.2.1-alpha.4",
17
- "@ckeditor/ckeditor5-icons": "45.2.1-alpha.4",
18
- "@ckeditor/ckeditor5-image": "45.2.1-alpha.4",
19
- "@ckeditor/ckeditor5-ui": "45.2.1-alpha.4",
20
- "@ckeditor/ckeditor5-utils": "45.2.1-alpha.4",
21
- "ckeditor5": "45.2.1-alpha.4"
16
+ "@ckeditor/ckeditor5-core": "45.2.1-alpha.5",
17
+ "@ckeditor/ckeditor5-icons": "45.2.1-alpha.5",
18
+ "@ckeditor/ckeditor5-image": "45.2.1-alpha.5",
19
+ "@ckeditor/ckeditor5-ui": "45.2.1-alpha.5",
20
+ "@ckeditor/ckeditor5-utils": "45.2.1-alpha.5",
21
+ "ckeditor5": "45.2.1-alpha.5"
22
22
  },
23
23
  "author": "CKSource (http://cksource.com/)",
24
24
  "license": "SEE LICENSE IN LICENSE.md",