@ckeditor/ckeditor5-ckbox 37.0.1 → 38.0.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/build/ckbox.js +1 -1
- package/build/translations/uz.js +1 -0
- package/lang/translations/ar.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/es-co.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/uz.po +25 -0
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +16 -16
- package/src/ckboxuploadadapter.js +2 -2
package/README.md
CHANGED
@@ -6,11 +6,11 @@ CKEditor 5 CKBox integration
|
|
6
6
|
[![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://app.travis-ci.com/github/ckeditor/ckeditor5)
|
7
7
|
![Dependency Status](https://img.shields.io/librariesio/release/npm/@ckeditor/ckeditor5-ckbox)
|
8
8
|
|
9
|
-
This package implements the [CKBox feature](https://ckeditor.com/docs/ckeditor5/latest/features/ckbox.html).
|
9
|
+
This package implements the [CKBox feature](https://ckeditor.com/docs/ckeditor5/latest/features/file-management/ckbox.html). It allows you to easily insert images as well as links to files into the editor content. It is a bridge between CKEditor 5 WYSIWYG editor and [CKBox](https://ckeditor.com/ckbox/) file manager and uploader.
|
10
10
|
|
11
11
|
## Documentation
|
12
12
|
|
13
|
-
See the [CKBox integration guide](https://ckeditor.com/docs/ckeditor5/latest/features/ckbox.html) and the [plugin documentation](https://ckeditor.com/docs/ckeditor5/latest/api/ckbox.html) to learn more about the integration.
|
13
|
+
See the [CKBox integration guide](https://ckeditor.com/docs/ckeditor5/latest/features/file-management/ckbox.html) and the [plugin documentation](https://ckeditor.com/docs/ckeditor5/latest/api/ckbox.html) to learn more about the integration.
|
14
14
|
|
15
15
|
Check out the [comprehensive Image upload guide](https://ckeditor.com/docs/ckeditor5/latest/features/image-upload.html) to learn about other ways to upload images into CKEditor 5.
|
16
16
|
|
package/build/ckbox.js
CHANGED
@@ -2,4 +2,4 @@
|
|
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,t,i)=>{e.exports=i(79)("./src/core.js")},492:(e,t,i)=>{e.exports=i(79)("./src/engine.js")},273:(e,t,i)=>{e.exports=i(79)("./src/ui.js")},448:(e,t,i)=>{e.exports=i(79)("./src/upload.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,{CKBox:()=>C,CKBoxEditing:()=>v,CKBoxUI:()=>o});var e=i(704),t=i(273);class o extends e.Plugin{static get pluginName(){return"CKBoxUI"}afterInit(){const e=this.editor,i=e.commands.get("ckbox");if(!i)return;const n=e.t;e.ui.componentFactory.add("ckbox",(o=>{const r=new t.ButtonView(o);return r.set({label:n("Open file manager"),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("isOn","isEnabled").to(i,"value","isEnabled"),r.on("execute",(()=>{e.execute("ckbox")})),r}))}}var r=i(492),s=i(209);const a=4e3,c=80,d=10;function l({token:e,id:t,origin:i,width:n,extension:o}){const r=u(e),s=function(e){const t=[e*d/100,c],i=Math.floor(Math.max(...t)),n=[Math.min(e,a)];let o=n[0];for(;o-i>=i;)o-=i,n.unshift(o);return n}(n),l=function(e){if("bmp"===e||"tiff"===e||"jpg"===e)return"jpeg";return e}(o);return{imageFallbackUrl:g({environmentId:r,id:t,origin:i,width:n,extension:l}),imageSources:[{srcset:s.map((e=>`${g({environmentId:r,id:t,origin:i,width:e,extension:"webp"})} ${e}w`)).join(","),sizes:`(max-width: ${n}px) 100vw, ${n}px`,type:"image/webp"}]}}function u(e){const[,t]=e.value.split(".");return JSON.parse(atob(t)).aud}function g({environmentId:e,id:t,origin:i,width:n,extension:o}){return new URL(`${e}/assets/${t}/images/${n}.${o}`,i).toString()}class m extends e.Command{constructor(e){super(e),this._chosenAssets=new Set,this._wrapper=null,this._initListeners()}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){this.fire("ckbox:open")}_getValue(){return null!==this._wrapper}_checkEnabled(){const e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");return!(!e.isEnabled&&!t.isEnabled)}_prepareOptions(){const e=this.editor.config.get("ckbox");return{theme:e.theme,language:e.language,tokenUrl:e.tokenUrl,serviceOrigin:e.serviceOrigin,assetsOrigin:e.assetsOrigin,dialog:{onClose:()=>this.fire("ckbox:close")},assets:{onChoose:e=>this.fire("ckbox:choose",e)}}}_initListeners(){const e=this.editor,t=e.model,i=!e.config.get("ckbox.ignoreDataId");this.on("ckbox",(()=>{this.refresh()}),{priority:"low"}),this.on("ckbox:open",(()=>{this.isEnabled&&!this.value&&(this._wrapper=(0,s.createElement)(document,"div",{class:"ck ckbox-wrapper"}),document.body.appendChild(this._wrapper),window.CKBox.mount(this._wrapper,this._prepareOptions()))})),this.on("ckbox:close",(()=>{this.value&&(this._wrapper.remove(),this._wrapper=null)})),this.on("ckbox:choose",((n,o)=>{if(!this.isEnabled)return;const r=e.commands.get("insertImage"),s=e.commands.get("link"),a=e.plugins.get("CKBoxEditing"),c=function({assets:e,origin:t,token:i,isImageAllowed:n,isLinkAllowed:o}){return e.map((e=>function(e){const t=e.data.metadata;if(!t)return!1;return t.width&&t.height}(e)?{id:e.data.id,type:"image",attributes:h(e,i,t)}:{id:e.data.id,type:"link",attributes:b(e,i,t)})).filter((e=>"image"===e.type?n:o))}({assets:o,origin:e.config.get("ckbox.assetsOrigin"),token:a.getToken(),isImageAllowed:r.isEnabled,isLinkAllowed:s.isEnabled});0!==c.length&&t.change((e=>{for(const t of c){const n=t===c[c.length-1];this._insertAsset(t,n,e),i&&(setTimeout((()=>this._chosenAssets.delete(t)),1e3),this._chosenAssets.add(t))}}))})),this.listenTo(e,"destroy",(()=>{this.fire("ckbox:close"),this._chosenAssets.clear()}))}_insertAsset(e,t,i){const n=this.editor.model.document.selection;i.removeSelectionAttribute("linkHref"),"image"===e.type?this._insertImage(e):this._insertLink(e,i),t||i.setSelection(n.getLastPosition())}_insertImage(e){const t=this.editor,{imageFallbackUrl:i,imageSources:n,imageTextAlternative:o}=e.attributes;t.execute("insertImage",{source:{src:i,sources:n,alt:o}})}_insertLink(e,t){const i=this.editor,n=i.model,o=n.document.selection,{linkName:r,linkHref:a}=e.attributes;if(o.isCollapsed){const e=(0,s.toMap)(o.getAttributes()),i=t.createText(r,e),a=n.insertContent(i);t.setSelection(a)}i.execute("link",a)}}function h(e,t,i){const{imageFallbackUrl:n,imageSources:o}=l({token:t,origin:i,id:e.data.id,width:e.data.metadata.width,extension:e.data.extension});return{imageFallbackUrl:n,imageSources:o,imageTextAlternative:e.data.metadata.description||""}}function b(e,t,i){return{linkName:e.data.name,linkHref:p(e,t,i)}}function p(e,t,i){const n=u(t),o=new URL(`${n}/assets/${e.data.id}/file`,i);return o.searchParams.set("download","true"),o.toString()}var k=i(448);class f extends e.Plugin{static get requires(){return["ImageUploadEditing","ImageUploadProgress",k.FileRepository,v]}static get pluginName(){return"CKBoxUploadAdapter"}async afterInit(){const e=this.editor,t=!!e.config.get("ckbox"),i=!!window.CKBox;if(!t&&!i)return;const n=e.plugins.get(k.FileRepository),o=e.plugins.get(v);n.createUploadAdapter=t=>new x(t,o.getToken(),e);const r=!e.config.get("ckbox.ignoreDataId"),s=e.plugins.get("ImageUploadEditing");r&&s.on("uploadComplete",((t,{imageElement:i,data:n})=>{e.model.change((e=>{e.setAttribute("ckboxImageId",n.ckboxImageId,i)}))}))}}class x{constructor(e,t,i){this.loader=e,this.token=t,this.editor=i,this.controller=new AbortController,this.serviceOrigin=i.config.get("ckbox.serviceOrigin"),this.assetsOrigin=i.config.get("ckbox.assetsOrigin")}async getAvailableCategories(e=0){const t=new URL("categories",this.serviceOrigin);return t.searchParams.set("limit",50..toString()),t.searchParams.set("offset",e.toString()),this._sendHttpRequest({url:t}).then((async t=>{if(t.totalCount-(e+50)>0){const i=await this.getAvailableCategories(e+50);return[...t.items,...i]}return t.items})).catch((()=>{this.controller.signal.throwIfAborted(),(0,s.logError)("ckbox-fetch-category-http-error")}))}async getCategoryIdForFile(e){const t=w(e.name),i=await this.getAvailableCategories();if(!i)return null;const n=this.editor.config.get("ckbox.defaultUploadCategories");if(n){const e=Object.keys(n).find((e=>n[e].includes(t)));if(e){const t=i.find((t=>t.id===e||t.name===e));return t?t.id:null}}const o=i.find((e=>e.extensions.includes(t)));return o?o.id:null}async upload(){const e=this.editor.t,t=e("Cannot determine a category for the uploaded file."),i=await this.loader.file,n=await this.getCategoryIdForFile(i);if(!n)return Promise.reject(t);const o=new URL("assets",this.serviceOrigin),r=new FormData;r.append("categoryId",n),r.append("file",i);const s={method:"POST",url:o,data:r,onUploadProgress:e=>{e.lengthComputable&&(this.loader.uploadTotal=e.total,this.loader.uploaded=e.loaded)}};return this._sendHttpRequest(s).then((async e=>{const t=await this._getImageWidth(),n=w(i.name),o=l({token:this.token,id:e.id,origin:this.assetsOrigin,width:t,extension:n});return{ckboxImageId:e.id,default:o.imageFallbackUrl,sources:o.imageSources}})).catch((()=>{const t=e("Cannot upload file:")+` ${i.name}.`;return Promise.reject(t)}))}abort(){this.controller.abort()}_sendHttpRequest({url:e,method:t="GET",data:i,onUploadProgress:n}){const o=this.controller.signal,r=new XMLHttpRequest;r.open(t,e.toString(),!0),r.setRequestHeader("Authorization",this.token.value),r.setRequestHeader("CKBox-Version","CKEditor 5"),r.responseType="json";const s=()=>{r.abort()};return new Promise(((e,t)=>{o.addEventListener("abort",s),r.addEventListener("loadstart",(()=>{o.addEventListener("abort",s)})),r.addEventListener("loadend",(()=>{o.removeEventListener("abort",s)})),r.addEventListener("error",(()=>{t()})),r.addEventListener("abort",(()=>{t()})),r.addEventListener("load",(async()=>{const i=r.response;return!i||i.statusCode>=400?t(i&&i.message):e(i)})),n&&r.upload.addEventListener("progress",(e=>{n(e)})),r.send(i)}))}_getImageWidth(){return new Promise((e=>{const t=new Image;t.onload=()=>{URL.revokeObjectURL(t.src),e(t.width)},t.src=this.loader.data}))}}function w(e){return e.match(/\.(?<ext>[^.]+)$/).groups.ext}class v extends e.Plugin{static get pluginName(){return"CKBoxEditing"}static get requires(){return["CloudServices","LinkEditing","PictureEditing",f]}async init(){const e=this.editor,t=!!e.config.get("ckbox"),i=!!window.CKBox;if(!t&&!i)return;this._initConfig();const n=e.plugins.get("CloudServicesCore"),o=e.config.get("ckbox.tokenUrl");if(o===e.config.get("cloudServices.tokenUrl")){const t=e.plugins.get("CloudServices");this._token=t.token}else this._token=await n.createToken(o).init();e.config.get("ckbox.ignoreDataId")||(this._initSchema(),this._initConversion(),this._initFixers()),i&&e.commands.add("ckbox",new m(e))}getToken(){return this._token}_initConfig(){const e=this.editor;e.config.define("ckbox",{serviceOrigin:"https://api.ckbox.io",assetsOrigin:"https://ckbox.cloud",defaultUploadCategories:null,ignoreDataId:!1,language:e.locale.uiLanguage,theme:"default",tokenUrl:e.config.get("cloudServices.tokenUrl")});if(!e.config.get("ckbox.tokenUrl"))throw new s.CKEditorError("ckbox-plugin-missing-token-url",this);e.plugins.has("ImageBlockEditing")||e.plugins.has("ImageInlineEditing")||(0,s.logError)("ckbox-plugin-image-feature-missing",e)}_initSchema(){const e=this.editor.model.schema;e.extend("$text",{allowAttributes:"ckboxLinkId"}),e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),e.addAttributeCheck(((e,t)=>{if(!!!e.last.getAttribute("linkHref")&&"ckboxLinkId"===t)return!1}))}_initConversion(){const e=this.editor;e.conversion.for("downcast").add((e=>{e.on("attribute:ckboxLinkId:imageBlock",((e,t,i)=>{const{writer:n,mapper:o,consumable:r}=i;if(!r.consume(t.item,e.name))return;const s=[...o.toViewElement(t.item).getChildren()].find((e=>"a"===e.name));s&&(t.item.hasAttribute("ckboxLinkId")?n.setAttribute("data-ckbox-resource-id",t.item.getAttribute("ckboxLinkId"),s):n.removeAttribute("data-ckbox-resource-id",s))}),{priority:"low"}),e.on("attribute:ckboxLinkId",((e,t,i)=>{const{writer:n,mapper:o,consumable:r}=i;if(r.consume(t.item,e.name)){if(t.attributeOldValue){const e=A(n,t.attributeOldValue);n.unwrap(o.toViewRange(t.range),e)}if(t.attributeNewValue){const e=A(n,t.attributeNewValue);if(t.item.is("selection")){const t=n.document.selection;n.wrap(t.getFirstRange(),e)}else n.wrap(o.toViewRange(t.range),e)}}}),{priority:"low"})})),e.conversion.for("upcast").add((e=>{e.on("element:a",((e,t,i)=>{const{writer:n,consumable:o}=i;if(!t.viewItem.getAttribute("href"))return;if(!o.consume(t.viewItem,{attributes:["data-ckbox-resource-id"]}))return;const r=t.viewItem.getAttribute("data-ckbox-resource-id");if(r)if(t.modelRange)for(let e of t.modelRange.getItems())e.is("$textProxy")&&(e=e.textNode),y(e)&&n.setAttribute("ckboxLinkId",r,e);else{const e=t.modelCursor.nodeBefore||t.modelCursor.parent;n.setAttribute("ckboxLinkId",r,e)}}),{priority:"low"})})),e.conversion.for("downcast").attributeToAttribute({model:"ckboxImageId",view:"data-ckbox-resource-id"}),e.conversion.for("upcast").elementToAttribute({model:{key:"ckboxImageId",value:e=>e.getAttribute("data-ckbox-resource-id")},view:{attributes:{"data-ckbox-resource-id":/[\s\S]+/}}})}_initFixers(){const e=this.editor,t=e.model,i=t.document.selection;t.document.registerPostFixer(function(e){return t=>{let i=!1;const n=e.model,o=e.commands.get("ckbox");if(!o)return i;for(const e of n.document.differ.getChanges()){if("insert"!==e.type&&"attribute"!==e.type)continue;const n="insert"===e.type?new r.Range(e.position,e.position.getShiftedBy(e.length)):e.range,s="attribute"===e.type&&"linkHref"===e.attributeKey&&null===e.attributeNewValue;for(const e of n.getItems()){if(s&&e.hasAttribute("ckboxLinkId")){t.removeAttribute("ckboxLinkId",e),i=!0;continue}const n=I(e,o._chosenAssets);for(const o of n){const n="image"===o.type?"ckboxImageId":"ckboxLinkId";o.id!==e.getAttribute(n)&&(t.setAttribute(n,o.id,e),i=!0)}}}return i}}(e)),t.document.registerPostFixer(function(e){return t=>!(e.hasAttribute("linkHref")||!e.hasAttribute("ckboxLinkId"))&&(t.removeSelectionAttribute("ckboxLinkId"),!0)}(i))}}function I(e,t){const i=e.is("element","imageInline")||e.is("element","imageBlock"),n=e.hasAttribute("linkHref");return[...t].filter((t=>"image"===t.type&&i?t.attributes.imageFallbackUrl===e.getAttribute("src"):"link"===t.type&&n?t.attributes.linkHref===e.getAttribute("linkHref"):void 0))}function A(e,t){const i=e.createAttributeElement("a",{"data-ckbox-resource-id":t},{priority:5});return e.setCustomProperty("link",!0,i),i}function y(e){return!!e.is("$text")||!(!e.is("element","imageInline")&&!e.is("element","imageBlock"))}class C extends e.Plugin{static get pluginName(){return"CKBox"}static get requires(){return[v,o]}}})(),(window.CKEditor5=window.CKEditor5||{}).ckbox=n})();
|
5
|
+
*/(()=>{var e={704:(e,t,i)=>{e.exports=i(79)("./src/core.js")},492:(e,t,i)=>{e.exports=i(79)("./src/engine.js")},273:(e,t,i)=>{e.exports=i(79)("./src/ui.js")},448:(e,t,i)=>{e.exports=i(79)("./src/upload.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,{CKBox:()=>_,CKBoxEditing:()=>I,CKBoxUI:()=>o});var e=i(704),t=i(273);class o extends e.Plugin{static get pluginName(){return"CKBoxUI"}afterInit(){const e=this.editor,i=e.commands.get("ckbox");if(!i)return;const n=e.t;e.ui.componentFactory.add("ckbox",(o=>{const r=new t.ButtonView(o);return r.set({label:n("Open file manager"),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("isOn","isEnabled").to(i,"value","isEnabled"),r.on("execute",(()=>{e.execute("ckbox")})),r}))}}var r=i(492),s=i(209);const a=4e3,c=80,l=10;function d({token:e,id:t,origin:i,width:n,extension:o}){const r=u(e),s=function(e){const t=[e*l/100,c],i=Math.floor(Math.max(...t)),n=[Math.min(e,a)];let o=n[0];for(;o-i>=i;)o-=i,n.unshift(o);return n}(n),d=function(e){if("bmp"===e||"tiff"===e||"jpg"===e)return"jpeg";return e}(o);return{imageFallbackUrl:g({environmentId:r,id:t,origin:i,width:n,extension:d}),imageSources:[{srcset:s.map((e=>`${g({environmentId:r,id:t,origin:i,width:e,extension:"webp"})} ${e}w`)).join(","),sizes:`(max-width: ${n}px) 100vw, ${n}px`,type:"image/webp"}]}}function u(e){const[,t]=e.value.split(".");return JSON.parse(atob(t)).aud}function g({environmentId:e,id:t,origin:i,width:n,extension:o}){return new URL(`${e}/assets/${t}/images/${n}.${o}`,i).toString()}class m extends e.Command{constructor(e){super(e),this._chosenAssets=new Set,this._wrapper=null,this._initListeners()}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){this.fire("ckbox:open")}_getValue(){return null!==this._wrapper}_checkEnabled(){const e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");return!(!e.isEnabled&&!t.isEnabled)}_prepareOptions(){const e=this.editor.config.get("ckbox");return{theme:e.theme,language:e.language,tokenUrl:e.tokenUrl,serviceOrigin:e.serviceOrigin,assetsOrigin:e.assetsOrigin,dialog:{onClose:()=>this.fire("ckbox:close")},assets:{onChoose:e=>this.fire("ckbox:choose",e)}}}_initListeners(){const e=this.editor,t=e.model,i=!e.config.get("ckbox.ignoreDataId");this.on("ckbox",(()=>{this.refresh()}),{priority:"low"}),this.on("ckbox:open",(()=>{this.isEnabled&&!this.value&&(this._wrapper=(0,s.createElement)(document,"div",{class:"ck ckbox-wrapper"}),document.body.appendChild(this._wrapper),window.CKBox.mount(this._wrapper,this._prepareOptions()))})),this.on("ckbox:close",(()=>{this.value&&(this._wrapper.remove(),this._wrapper=null)})),this.on("ckbox:choose",((n,o)=>{if(!this.isEnabled)return;const r=e.commands.get("insertImage"),s=e.commands.get("link"),a=e.plugins.get("CKBoxEditing"),c=function({assets:e,origin:t,token:i,isImageAllowed:n,isLinkAllowed:o}){return e.map((e=>function(e){const t=e.data.metadata;if(!t)return!1;return t.width&&t.height}(e)?{id:e.data.id,type:"image",attributes:h(e,i,t)}:{id:e.data.id,type:"link",attributes:b(e,i,t)})).filter((e=>"image"===e.type?n:o))}({assets:o,origin:e.config.get("ckbox.assetsOrigin"),token:a.getToken(),isImageAllowed:r.isEnabled,isLinkAllowed:s.isEnabled});0!==c.length&&t.change((e=>{for(const t of c){const n=t===c[c.length-1];this._insertAsset(t,n,e),i&&(setTimeout((()=>this._chosenAssets.delete(t)),1e3),this._chosenAssets.add(t))}}))})),this.listenTo(e,"destroy",(()=>{this.fire("ckbox:close"),this._chosenAssets.clear()}))}_insertAsset(e,t,i){const n=this.editor.model.document.selection;i.removeSelectionAttribute("linkHref"),"image"===e.type?this._insertImage(e):this._insertLink(e,i),t||i.setSelection(n.getLastPosition())}_insertImage(e){const t=this.editor,{imageFallbackUrl:i,imageSources:n,imageTextAlternative:o}=e.attributes;t.execute("insertImage",{source:{src:i,sources:n,alt:o}})}_insertLink(e,t){const i=this.editor,n=i.model,o=n.document.selection,{linkName:r,linkHref:a}=e.attributes;if(o.isCollapsed){const e=(0,s.toMap)(o.getAttributes()),i=t.createText(r,e),a=n.insertContent(i);t.setSelection(a)}i.execute("link",a)}}function h(e,t,i){const{imageFallbackUrl:n,imageSources:o}=d({token:t,origin:i,id:e.data.id,width:e.data.metadata.width,extension:e.data.extension});return{imageFallbackUrl:n,imageSources:o,imageTextAlternative:e.data.metadata.description||""}}function b(e,t,i){return{linkName:e.data.name,linkHref:p(e,t,i)}}function p(e,t,i){const n=u(t),o=new URL(`${n}/assets/${e.data.id}/file`,i);return o.searchParams.set("download","true"),o.toString()}var f=i(448),k=(e,t,i)=>new Promise(((n,o)=>{var r=e=>{try{a(i.next(e))}catch(e){o(e)}},s=e=>{try{a(i.throw(e))}catch(e){o(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,s);a((i=i.apply(e,t)).next())}));class x extends e.Plugin{static get requires(){return["ImageUploadEditing","ImageUploadProgress",f.FileRepository,I]}static get pluginName(){return"CKBoxUploadAdapter"}afterInit(){return k(this,null,(function*(){const e=this.editor,t=!!e.config.get("ckbox"),i=!!window.CKBox;if(!t&&!i)return;const n=e.plugins.get(f.FileRepository),o=e.plugins.get(I);n.createUploadAdapter=t=>new w(t,o.getToken(),e);const r=!e.config.get("ckbox.ignoreDataId"),s=e.plugins.get("ImageUploadEditing");r&&s.on("uploadComplete",((t,{imageElement:i,data:n})=>{e.model.change((e=>{e.setAttribute("ckboxImageId",n.ckboxImageId,i)}))}))}))}}class w{constructor(e,t,i){this.loader=e,this.token=t,this.editor=i,this.controller=new AbortController,this.serviceOrigin=i.config.get("ckbox.serviceOrigin"),this.assetsOrigin=i.config.get("ckbox.assetsOrigin")}getAvailableCategories(e=0){return k(this,null,(function*(){const t=new URL("categories",this.serviceOrigin);return t.searchParams.set("limit",50..toString()),t.searchParams.set("offset",e.toString()),this._sendHttpRequest({url:t}).then((t=>k(this,null,(function*(){if(t.totalCount-(e+50)>0){const i=yield this.getAvailableCategories(e+50);return[...t.items,...i]}return t.items})))).catch((()=>{this.controller.signal.throwIfAborted(),(0,s.logError)("ckbox-fetch-category-http-error")}))}))}getCategoryIdForFile(e){return k(this,null,(function*(){const t=v(e.name),i=yield this.getAvailableCategories();if(!i)return null;const n=this.editor.config.get("ckbox.defaultUploadCategories");if(n){const e=Object.keys(n).find((e=>n[e].includes(t)));if(e){const t=i.find((t=>t.id===e||t.name===e));return t?t.id:null}}const o=i.find((e=>e.extensions.includes(t)));return o?o.id:null}))}upload(){return k(this,null,(function*(){const e=this.editor.t,t=e("Cannot determine a category for the uploaded file."),i=yield this.loader.file,n=yield this.getCategoryIdForFile(i);if(!n)return Promise.reject(t);const o=new URL("assets",this.serviceOrigin),r=new FormData;r.append("categoryId",n),r.append("file",i);const s={method:"POST",url:o,data:r,onUploadProgress:e=>{e.lengthComputable&&(this.loader.uploadTotal=e.total,this.loader.uploaded=e.loaded)}};return this._sendHttpRequest(s).then((e=>k(this,null,(function*(){const t=yield this._getImageWidth(),n=v(i.name),o=d({token:this.token,id:e.id,origin:this.assetsOrigin,width:t,extension:n});return{ckboxImageId:e.id,default:o.imageFallbackUrl,sources:o.imageSources}})))).catch((()=>{const t=e("Cannot upload file:")+` ${i.name}.`;return Promise.reject(t)}))}))}abort(){this.controller.abort()}_sendHttpRequest({url:e,method:t="GET",data:i,onUploadProgress:n}){const o=this.controller.signal,r=new XMLHttpRequest;r.open(t,e.toString(),!0),r.setRequestHeader("Authorization",this.token.value),r.setRequestHeader("CKBox-Version","CKEditor 5"),r.responseType="json";const s=()=>{r.abort()};return new Promise(((e,t)=>{o.addEventListener("abort",s),r.addEventListener("loadstart",(()=>{o.addEventListener("abort",s)})),r.addEventListener("loadend",(()=>{o.removeEventListener("abort",s)})),r.addEventListener("error",(()=>{t()})),r.addEventListener("abort",(()=>{t()})),r.addEventListener("load",(()=>k(this,null,(function*(){const i=r.response;return!i||i.statusCode>=400?t(i&&i.message):e(i)})))),n&&r.upload.addEventListener("progress",(e=>{n(e)})),r.send(i)}))}_getImageWidth(){return new Promise((e=>{const t=new Image;t.onload=()=>{URL.revokeObjectURL(t.src),e(t.width)},t.src=this.loader.data}))}}function v(e){const t=new RegExp("\\.(?<ext>[^.]+)$");return e.match(t).groups.ext}class I extends e.Plugin{static get pluginName(){return"CKBoxEditing"}static get requires(){return["CloudServices","LinkEditing","PictureEditing",x]}init(){return e=this,t=null,i=function*(){const e=this.editor,t=!!e.config.get("ckbox"),i=!!window.CKBox;if(!t&&!i)return;this._initConfig();const n=e.plugins.get("CloudServicesCore"),o=e.config.get("ckbox.tokenUrl");if(o===e.config.get("cloudServices.tokenUrl")){const t=e.plugins.get("CloudServices");this._token=t.token}else this._token=yield n.createToken(o).init();e.config.get("ckbox.ignoreDataId")||(this._initSchema(),this._initConversion(),this._initFixers()),i&&e.commands.add("ckbox",new m(e))},new Promise(((n,o)=>{var r=e=>{try{a(i.next(e))}catch(e){o(e)}},s=e=>{try{a(i.throw(e))}catch(e){o(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,s);a((i=i.apply(e,t)).next())}));var e,t,i}getToken(){return this._token}_initConfig(){const e=this.editor;e.config.define("ckbox",{serviceOrigin:"https://api.ckbox.io",assetsOrigin:"https://ckbox.cloud",defaultUploadCategories:null,ignoreDataId:!1,language:e.locale.uiLanguage,theme:"default",tokenUrl:e.config.get("cloudServices.tokenUrl")});if(!e.config.get("ckbox.tokenUrl"))throw new s.CKEditorError("ckbox-plugin-missing-token-url",this);e.plugins.has("ImageBlockEditing")||e.plugins.has("ImageInlineEditing")||(0,s.logError)("ckbox-plugin-image-feature-missing",e)}_initSchema(){const e=this.editor.model.schema;e.extend("$text",{allowAttributes:"ckboxLinkId"}),e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),e.addAttributeCheck(((e,t)=>{if(!!!e.last.getAttribute("linkHref")&&"ckboxLinkId"===t)return!1}))}_initConversion(){const e=this.editor;e.conversion.for("downcast").add((e=>{e.on("attribute:ckboxLinkId:imageBlock",((e,t,i)=>{const{writer:n,mapper:o,consumable:r}=i;if(!r.consume(t.item,e.name))return;const s=[...o.toViewElement(t.item).getChildren()].find((e=>"a"===e.name));s&&(t.item.hasAttribute("ckboxLinkId")?n.setAttribute("data-ckbox-resource-id",t.item.getAttribute("ckboxLinkId"),s):n.removeAttribute("data-ckbox-resource-id",s))}),{priority:"low"}),e.on("attribute:ckboxLinkId",((e,t,i)=>{const{writer:n,mapper:o,consumable:r}=i;if(r.consume(t.item,e.name)){if(t.attributeOldValue){const e=A(n,t.attributeOldValue);n.unwrap(o.toViewRange(t.range),e)}if(t.attributeNewValue){const e=A(n,t.attributeNewValue);if(t.item.is("selection")){const t=n.document.selection;n.wrap(t.getFirstRange(),e)}else n.wrap(o.toViewRange(t.range),e)}}}),{priority:"low"})})),e.conversion.for("upcast").add((e=>{e.on("element:a",((e,t,i)=>{const{writer:n,consumable:o}=i;if(!t.viewItem.getAttribute("href"))return;if(!o.consume(t.viewItem,{attributes:["data-ckbox-resource-id"]}))return;const r=t.viewItem.getAttribute("data-ckbox-resource-id");if(r)if(t.modelRange)for(let e of t.modelRange.getItems())e.is("$textProxy")&&(e=e.textNode),C(e)&&n.setAttribute("ckboxLinkId",r,e);else{const e=t.modelCursor.nodeBefore||t.modelCursor.parent;n.setAttribute("ckboxLinkId",r,e)}}),{priority:"low"})})),e.conversion.for("downcast").attributeToAttribute({model:"ckboxImageId",view:"data-ckbox-resource-id"}),e.conversion.for("upcast").elementToAttribute({model:{key:"ckboxImageId",value:e=>e.getAttribute("data-ckbox-resource-id")},view:{attributes:{"data-ckbox-resource-id":/[\s\S]+/}}})}_initFixers(){const e=this.editor,t=e.model,i=t.document.selection;t.document.registerPostFixer(function(e){return t=>{let i=!1;const n=e.model,o=e.commands.get("ckbox");if(!o)return i;for(const e of n.document.differ.getChanges()){if("insert"!==e.type&&"attribute"!==e.type)continue;const n="insert"===e.type?new r.Range(e.position,e.position.getShiftedBy(e.length)):e.range,s="attribute"===e.type&&"linkHref"===e.attributeKey&&null===e.attributeNewValue;for(const e of n.getItems()){if(s&&e.hasAttribute("ckboxLinkId")){t.removeAttribute("ckboxLinkId",e),i=!0;continue}const n=y(e,o._chosenAssets);for(const o of n){const n="image"===o.type?"ckboxImageId":"ckboxLinkId";o.id!==e.getAttribute(n)&&(t.setAttribute(n,o.id,e),i=!0)}}}return i}}(e)),t.document.registerPostFixer(function(e){return t=>!(e.hasAttribute("linkHref")||!e.hasAttribute("ckboxLinkId"))&&(t.removeSelectionAttribute("ckboxLinkId"),!0)}(i))}}function y(e,t){const i=e.is("element","imageInline")||e.is("element","imageBlock"),n=e.hasAttribute("linkHref");return[...t].filter((t=>"image"===t.type&&i?t.attributes.imageFallbackUrl===e.getAttribute("src"):"link"===t.type&&n?t.attributes.linkHref===e.getAttribute("linkHref"):void 0))}function A(e,t){const i=e.createAttributeElement("a",{"data-ckbox-resource-id":t},{priority:5});return e.setCustomProperty("link",!0,i),i}function C(e){return!!e.is("$text")||!(!e.is("element","imageInline")&&!e.is("element","imageBlock"))}class _ extends e.Plugin{static get pluginName(){return"CKBox"}static get requires(){return[I,o]}}})(),(window.CKEditor5=window.CKEditor5||{}).ckbox=n})();
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.uz=n.uz||{};i.dictionary=Object.assign(i.dictionary||{},{"Cannot determine a category for the uploaded file.":"Yuklangan fayl uchun toifani aniqlab bo‘lmadi.","Open file manager":"Fayl menejerini ochish"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/lang/translations/ar.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Arabic (https://
|
15
|
+
"Language-Team: Arabic (https://app.transifex.com/ckeditor/teams/11143/ar/)\n"
|
16
16
|
"Language: ar\n"
|
17
17
|
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
|
18
18
|
|
package/lang/translations/az.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Azerbaijani (https://
|
15
|
+
"Language-Team: Azerbaijani (https://app.transifex.com/ckeditor/teams/11143/az/)\n"
|
16
16
|
"Language: az\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/bg.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Bulgarian (https://
|
15
|
+
"Language-Team: Bulgarian (https://app.transifex.com/ckeditor/teams/11143/bg/)\n"
|
16
16
|
"Language: bg\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/bn.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Bengali (https://
|
15
|
+
"Language-Team: Bengali (https://app.transifex.com/ckeditor/teams/11143/bn/)\n"
|
16
16
|
"Language: bn\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/ca.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Catalan (https://
|
15
|
+
"Language-Team: Catalan (https://app.transifex.com/ckeditor/teams/11143/ca/)\n"
|
16
16
|
"Language: ca\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/cs.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Czech (https://
|
15
|
+
"Language-Team: Czech (https://app.transifex.com/ckeditor/teams/11143/cs/)\n"
|
16
16
|
"Language: cs\n"
|
17
17
|
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
|
18
18
|
|
package/lang/translations/da.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Danish (https://
|
15
|
+
"Language-Team: Danish (https://app.transifex.com/ckeditor/teams/11143/da/)\n"
|
16
16
|
"Language: da\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/de.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: German (https://
|
15
|
+
"Language-Team: German (https://app.transifex.com/ckeditor/teams/11143/de/)\n"
|
16
16
|
"Language: de\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/el.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Greek (https://
|
15
|
+
"Language-Team: Greek (https://app.transifex.com/ckeditor/teams/11143/el/)\n"
|
16
16
|
"Language: el\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: English (Australia) (https://
|
15
|
+
"Language-Team: English (Australia) (https://app.transifex.com/ckeditor/teams/11143/en_AU/)\n"
|
16
16
|
"Language: en_AU\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Spanish (Colombia) (https://
|
15
|
+
"Language-Team: Spanish (Colombia) (https://app.transifex.com/ckeditor/teams/11143/es_CO/)\n"
|
16
16
|
"Language: es_CO\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
18
18
|
|
package/lang/translations/es.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Spanish (https://
|
15
|
+
"Language-Team: Spanish (https://app.transifex.com/ckeditor/teams/11143/es/)\n"
|
16
16
|
"Language: es\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
18
18
|
|
package/lang/translations/et.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Estonian (https://
|
15
|
+
"Language-Team: Estonian (https://app.transifex.com/ckeditor/teams/11143/et/)\n"
|
16
16
|
"Language: et\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/fa.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Persian (https://
|
15
|
+
"Language-Team: Persian (https://app.transifex.com/ckeditor/teams/11143/fa/)\n"
|
16
16
|
"Language: fa\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
18
18
|
|
package/lang/translations/fi.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Finnish (https://
|
15
|
+
"Language-Team: Finnish (https://app.transifex.com/ckeditor/teams/11143/fi/)\n"
|
16
16
|
"Language: fi\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/fr.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: French (https://
|
15
|
+
"Language-Team: French (https://app.transifex.com/ckeditor/teams/11143/fr/)\n"
|
16
16
|
"Language: fr\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
18
18
|
|
package/lang/translations/gl.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Galician (https://
|
15
|
+
"Language-Team: Galician (https://app.transifex.com/ckeditor/teams/11143/gl/)\n"
|
16
16
|
"Language: gl\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/he.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Hebrew (https://
|
15
|
+
"Language-Team: Hebrew (https://app.transifex.com/ckeditor/teams/11143/he/)\n"
|
16
16
|
"Language: he\n"
|
17
17
|
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;\n"
|
18
18
|
|
package/lang/translations/hi.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Hindi (https://
|
15
|
+
"Language-Team: Hindi (https://app.transifex.com/ckeditor/teams/11143/hi/)\n"
|
16
16
|
"Language: hi\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/hr.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Croatian (https://
|
15
|
+
"Language-Team: Croatian (https://app.transifex.com/ckeditor/teams/11143/hr/)\n"
|
16
16
|
"Language: hr\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
18
18
|
|
package/lang/translations/hu.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Hungarian (https://
|
15
|
+
"Language-Team: Hungarian (https://app.transifex.com/ckeditor/teams/11143/hu/)\n"
|
16
16
|
"Language: hu\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/id.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Indonesian (https://
|
15
|
+
"Language-Team: Indonesian (https://app.transifex.com/ckeditor/teams/11143/id/)\n"
|
16
16
|
"Language: id\n"
|
17
17
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
18
18
|
|
package/lang/translations/it.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Italian (https://
|
15
|
+
"Language-Team: Italian (https://app.transifex.com/ckeditor/teams/11143/it/)\n"
|
16
16
|
"Language: it\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
18
18
|
|
package/lang/translations/ja.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Japanese (https://
|
15
|
+
"Language-Team: Japanese (https://app.transifex.com/ckeditor/teams/11143/ja/)\n"
|
16
16
|
"Language: ja\n"
|
17
17
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
18
18
|
|
package/lang/translations/ko.po
CHANGED
package/lang/translations/lt.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Lithuanian (https://
|
15
|
+
"Language-Team: Lithuanian (https://app.transifex.com/ckeditor/teams/11143/lt/)\n"
|
16
16
|
"Language: lt\n"
|
17
17
|
"Plural-Forms: nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);\n"
|
18
18
|
|
package/lang/translations/lv.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Latvian (https://
|
15
|
+
"Language-Team: Latvian (https://app.transifex.com/ckeditor/teams/11143/lv/)\n"
|
16
16
|
"Language: lv\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n"
|
18
18
|
|
package/lang/translations/ms.po
CHANGED
package/lang/translations/nl.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Dutch (https://
|
15
|
+
"Language-Team: Dutch (https://app.transifex.com/ckeditor/teams/11143/nl/)\n"
|
16
16
|
"Language: nl\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/no.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Norwegian (https://
|
15
|
+
"Language-Team: Norwegian (https://app.transifex.com/ckeditor/teams/11143/no/)\n"
|
16
16
|
"Language: no\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/pl.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Polish (https://
|
15
|
+
"Language-Team: Polish (https://app.transifex.com/ckeditor/teams/11143/pl/)\n"
|
16
16
|
"Language: pl\n"
|
17
17
|
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
|
18
18
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Portuguese (Brazil) (https://
|
15
|
+
"Language-Team: Portuguese (Brazil) (https://app.transifex.com/ckeditor/teams/11143/pt_BR/)\n"
|
16
16
|
"Language: pt_BR\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
18
18
|
|
package/lang/translations/pt.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Portuguese (https://
|
15
|
+
"Language-Team: Portuguese (https://app.transifex.com/ckeditor/teams/11143/pt/)\n"
|
16
16
|
"Language: pt\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
|
18
18
|
|
package/lang/translations/ro.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Romanian (https://
|
15
|
+
"Language-Team: Romanian (https://app.transifex.com/ckeditor/teams/11143/ro/)\n"
|
16
16
|
"Language: ro\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
|
18
18
|
|
package/lang/translations/ru.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Russian (https://
|
15
|
+
"Language-Team: Russian (https://app.transifex.com/ckeditor/teams/11143/ru/)\n"
|
16
16
|
"Language: ru\n"
|
17
17
|
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
|
18
18
|
|
package/lang/translations/sk.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Slovak (https://
|
15
|
+
"Language-Team: Slovak (https://app.transifex.com/ckeditor/teams/11143/sk/)\n"
|
16
16
|
"Language: sk\n"
|
17
17
|
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);\n"
|
18
18
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Serbian (Latin) (https://
|
15
|
+
"Language-Team: Serbian (Latin) (https://app.transifex.com/ckeditor/teams/11143/sr@latin/)\n"
|
16
16
|
"Language: sr@latin\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
18
18
|
|
package/lang/translations/sr.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Serbian (https://
|
15
|
+
"Language-Team: Serbian (https://app.transifex.com/ckeditor/teams/11143/sr/)\n"
|
16
16
|
"Language: sr\n"
|
17
17
|
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
18
18
|
|
package/lang/translations/sv.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Swedish (https://
|
15
|
+
"Language-Team: Swedish (https://app.transifex.com/ckeditor/teams/11143/sv/)\n"
|
16
16
|
"Language: sv\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/th.po
CHANGED
package/lang/translations/tr.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Turkish (https://
|
15
|
+
"Language-Team: Turkish (https://app.transifex.com/ckeditor/teams/11143/tr/)\n"
|
16
16
|
"Language: tr\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
18
18
|
|
package/lang/translations/ug.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Uyghur (https://
|
15
|
+
"Language-Team: Uyghur (https://app.transifex.com/ckeditor/teams/11143/ug/)\n"
|
16
16
|
"Language: ug\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
package/lang/translations/uk.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Ukrainian (https://
|
15
|
+
"Language-Team: Ukrainian (https://app.transifex.com/ckeditor/teams/11143/uk/)\n"
|
16
16
|
"Language: uk\n"
|
17
17
|
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
|
18
18
|
|
package/lang/translations/ur.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Urdu (https://
|
15
|
+
"Language-Team: Urdu (https://app.transifex.com/ckeditor/teams/11143/ur/)\n"
|
16
16
|
"Language: ur\n"
|
17
17
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
18
18
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
2
|
+
#
|
3
|
+
# !!! IMPORTANT !!!
|
4
|
+
#
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
7
|
+
#
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
9
|
+
#
|
10
|
+
# To learn more, check out the official contributor's guide:
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
12
|
+
#
|
13
|
+
msgid ""
|
14
|
+
msgstr ""
|
15
|
+
"Language-Team: Uzbek (https://app.transifex.com/ckeditor/teams/11143/uz/)\n"
|
16
|
+
"Language: uz\n"
|
17
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
18
|
+
|
19
|
+
msgctxt "Toolbar button tooltip for opening a file browser that allows inserting an image or a file to the editor."
|
20
|
+
msgid "Open file manager"
|
21
|
+
msgstr "Fayl menejerini ochish"
|
22
|
+
|
23
|
+
msgctxt "A message is displayed when CKEditor 5 cannot associate an image with any of the categories defined in CKBox while uploading an asset."
|
24
|
+
msgid "Cannot determine a category for the uploaded file."
|
25
|
+
msgstr "Yuklangan fayl uchun toifani aniqlab bo‘lmadi."
|
package/lang/translations/vi.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Vietnamese (https://
|
15
|
+
"Language-Team: Vietnamese (https://app.transifex.com/ckeditor/teams/11143/vi/)\n"
|
16
16
|
"Language: vi\n"
|
17
17
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
18
18
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Chinese (China) (https://
|
15
|
+
"Language-Team: Chinese (China) (https://app.transifex.com/ckeditor/teams/11143/zh_CN/)\n"
|
16
16
|
"Language: zh_CN\n"
|
17
17
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
18
18
|
|
package/lang/translations/zh.po
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#
|
13
13
|
msgid ""
|
14
14
|
msgstr ""
|
15
|
-
"Language-Team: Chinese (Taiwan) (https://
|
15
|
+
"Language-Team: Chinese (Taiwan) (https://app.transifex.com/ckeditor/teams/11143/zh_TW/)\n"
|
16
16
|
"Language: zh_TW\n"
|
17
17
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
18
18
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-ckbox",
|
3
|
-
"version": "
|
3
|
+
"version": "38.0.0-rc.0",
|
4
4
|
"description": "CKBox integration for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -12,23 +12,23 @@
|
|
12
12
|
],
|
13
13
|
"main": "src/index.js",
|
14
14
|
"dependencies": {
|
15
|
-
"ckeditor5": "^
|
15
|
+
"ckeditor5": "^38.0.0-rc.0"
|
16
16
|
},
|
17
17
|
"devDependencies": {
|
18
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
19
|
-
"@ckeditor/ckeditor5-core": "^
|
20
|
-
"@ckeditor/ckeditor5-clipboard": "^
|
21
|
-
"@ckeditor/ckeditor5-cloud-services": "^
|
22
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
23
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
24
|
-
"@ckeditor/ckeditor5-engine": "^
|
25
|
-
"@ckeditor/ckeditor5-image": "^
|
26
|
-
"@ckeditor/ckeditor5-link": "^
|
27
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
28
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
29
|
-
"@ckeditor/ckeditor5-ui": "^
|
30
|
-
"@ckeditor/ckeditor5-upload": "^
|
31
|
-
"@ckeditor/ckeditor5-utils": "^
|
18
|
+
"@ckeditor/ckeditor5-basic-styles": "^38.0.0-rc.0",
|
19
|
+
"@ckeditor/ckeditor5-core": "^38.0.0-rc.0",
|
20
|
+
"@ckeditor/ckeditor5-clipboard": "^38.0.0-rc.0",
|
21
|
+
"@ckeditor/ckeditor5-cloud-services": "^38.0.0-rc.0",
|
22
|
+
"@ckeditor/ckeditor5-dev-utils": "^37.0.0",
|
23
|
+
"@ckeditor/ckeditor5-editor-classic": "^38.0.0-rc.0",
|
24
|
+
"@ckeditor/ckeditor5-engine": "^38.0.0-rc.0",
|
25
|
+
"@ckeditor/ckeditor5-image": "^38.0.0-rc.0",
|
26
|
+
"@ckeditor/ckeditor5-link": "^38.0.0-rc.0",
|
27
|
+
"@ckeditor/ckeditor5-paragraph": "^38.0.0-rc.0",
|
28
|
+
"@ckeditor/ckeditor5-theme-lark": "^38.0.0-rc.0",
|
29
|
+
"@ckeditor/ckeditor5-ui": "^38.0.0-rc.0",
|
30
|
+
"@ckeditor/ckeditor5-upload": "^38.0.0-rc.0",
|
31
|
+
"@ckeditor/ckeditor5-utils": "^38.0.0-rc.0",
|
32
32
|
"typescript": "^4.8.4",
|
33
33
|
"webpack": "^5.58.1",
|
34
34
|
"webpack-cli": "^4.9.0"
|
@@ -165,7 +165,7 @@ class Adapter {
|
|
165
165
|
url: uploadUrl,
|
166
166
|
data: formData,
|
167
167
|
onUploadProgress: (evt) => {
|
168
|
-
/* istanbul ignore else */
|
168
|
+
/* istanbul ignore else -- @preserve */
|
169
169
|
if (evt.lengthComputable) {
|
170
170
|
this.loader.uploadTotal = evt.total;
|
171
171
|
this.loader.uploaded = evt.loaded;
|
@@ -242,7 +242,7 @@ class Adapter {
|
|
242
242
|
}
|
243
243
|
return resolve(response);
|
244
244
|
});
|
245
|
-
/* istanbul ignore else */
|
245
|
+
/* istanbul ignore else -- @preserve */
|
246
246
|
if (onUploadProgress) {
|
247
247
|
xhr.upload.addEventListener('progress', evt => {
|
248
248
|
onUploadProgress(evt);
|