tocco-fdp-bundle 3.13.3 → 3.13.4

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
@@ -1,3 +1,8 @@
1
+ 3.13.4
2
+ - use autogrow or fixed height in HtmlEdit
3
+ - only close top modal
4
+ - fix isLatest overlay with multiple apps
5
+
1
6
  3.13.3
2
7
  - implement cancel confirmation modal
3
8
  - support cancel confirmation for actions
@@ -0,0 +1,6 @@
1
+ "use strict";(this.webpackChunktocco_fdp_bundle=this.webpackChunktocco_fdp_bundle||[]).push([[262],{8810:(e,t,n)=>{n.r(t),n.d(t,{default:()=>X});var o,r=n(21259),a=n.n(r),i=n(26396),c=n.n(i),d=n(22056),u=n.n(d),l=n(4883);function s(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function p(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}function f(e,t){return"NEW_CKEDITOR"in window?Promise.resolve(NEW_CKEDITOR):"string"!=typeof e||e.length<1?Promise.reject(new TypeError("CKEditor URL must be a non-empty string.")):(o||(o=f.scriptLoader(e).then((function(e){return t&&t(e),e}))),o)}f.scriptLoader=function(e){return new Promise((function(t,n){
2
+ /**
3
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
4
+ * For licensing, see LICENSE.md.
5
+ */
6
+ var r,a,i,c,d;r=e,a=function(e){return o=void 0,e?n(e):window.NEW_CKEDITOR?void t(NEW_CKEDITOR):n(new Error("Script loaded from editorUrl doesn't provide NEW_CKEDITOR namespace."))},c=document.head||document.getElementsByTagName("head")[0],d=document.createElement("script"),"function"==typeof a&&(i=a,a={}),a=a||{},i=i||function(){},d.type=a.type||"text/javascript",d.charset=a.charset||"utf8",d.async=!("async"in a)||!!a.async,d.src=r,a.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(d,a.attrs),a.text&&(d.text=String(a.text)),("onload"in d?s:p)(d,i),d.onload||s(d,i),c.appendChild(d)}))};var y=n(5556),g=function(){return g=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},g.apply(this,arguments)};function h(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var m=["activeEnterModeChange","activeFilterChange","afterCommandExec","afterInsertHtml","afterPaste","afterPasteFromWord","afterSetData","afterUndoImage","ariaEditorHelpLabel","ariaWidget","autogrow","beforeCommandExec","beforeDestroy","beforeGetData","beforeModeUnload","beforeSetMode","beforeUndoImage","blur","change","configLoaded","contentDirChanged","contentDom","contentDomInvalidated","contentDomUnload","contentPreview","customConfigLoaded","dataFiltered","dataReady","destroy","dialogHide","dialogShow","dirChanged","doubleclick","dragend","dragstart","drop","elementsPathUpdate","exportPdf","fileUploadRequest","fileUploadResponse","floatingSpaceLayout","focus","getData","getSnapshot","insertElement","insertHtml","insertText","instanceReady","key","langLoaded","loadSnapshot","loaded","lockSnapshot","maximize","menuShow","mode","notificationHide","notificationShow","notificationUpdate","paste","pasteFromWord","pluginsLoaded","readOnly","removeFormatCleanup","required","resize","save","saveSnapshot","selectionChange","setData","stylesRemove","stylesSet","template","toDataFormat","toHtml","uiSpace","unlockSnapshot","updateSnapshot","widgetDefinition"],v=["beforeLoad","namespaceLoaded"],b=h(h([],m,!0),v,!0),O="__CKE__";function S(e){var t=e.substr(0,1).toUpperCase()+e.substr(1);return"on".concat(t)}function x(e){return e.substr(2,1).toLowerCase()+e.substr(3)}var k=h(h([],m,!0),v,!0).reduce((function(e,t){var n;return g(g({},e),((n={})[t]=function(e){return"".concat(O).concat(e)}(t),n))}),{});function C(e){return e.split(/(?=[A-Z])/).join("-").toLowerCase()}function w(e,t,n){var o={display:"none",visibility:"hidden"};return"classic"===e?o:"ready"===t?null!=n?n:void 0:o}function E(e){var t=e.debug,n=e.editor,o=e.evtName,r=e.handler,a=e.listenerData,i=e.priority,c=t&&Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),d=r;return t&&(d=function(e){console.log({operation:"invoke",editor:n.name,evtName:o,handlerId:c,data:e.data,listenerData:e.listenerData}),r(e)}),t&&console.log({operation:"register",editor:n.name,evtName:o,handlerId:c}),n.on(o,d,null,a,i),function(){t&&console.log({operation:"unregister",editor:n.name,evtName:o,handlerId:c}),n.removeListener(o,d)}}var D=l.useEffect,j=l.useReducer,L=l.useRef,_="https://cdn.ckeditor.com/4.22.1/standard-all/ckeditor.js",P={};function R(e,t){switch(t.type){case"init":return g(g({},e),{hookStatus:"init"});case"loading":return g(g({},e),{hookStatus:"loading"});case"unloaded":return{editor:t.payload,hookStatus:"unloaded"};case"loaded":return g(g({},e),{hookStatus:"loaded"});case"ready":return g(g({},e),{hookStatus:"ready"});case"destroyed":return{editor:void 0,hookStatus:"destroyed"};case"error":return{editor:void 0,hookStatus:"error"};default:return e}}var T=l.useEffect,U=l.useRef,N=l.useState;function H(e){var t=e.config,n=void 0===t?{}:t,o=e.debug,r=e.editorUrl,a=e.initData,i=e.name,c=e.readOnly,d=e.style,u=e.type,s=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["config","debug","editorUrl","initData","name","readOnly","style","type"]),p=N(null),y=p[0],g=p[1],h=U(s);n&&"boolean"==typeof c&&(n.readOnly=c);var m=function(e){var t=e.config,n=e.debug,o=e.dispatchEvent,r=e.subscribeTo,a=void 0===r?b:r,i=e.editorUrl,c=e.element,d=e.initContent,u=e.type,l=void 0===u?"classic":u,s=L(i||_),p=L(null!=a?a:b),y=L(n),g=L(o),h=L(d),m=L(t||P),S=L(l),x=j(R,{editor:void 0,hookStatus:"init"}),C=x[0],w=C.editor,T=C.hookStatus,U=x[1];return D((function(){return c&&!w&&(U({type:"loading"}),f(s.current,(function(e){var t;-1!==p.current.indexOf("namespaceLoaded")&&(null===(t=g.current)||void 0===t||t.call(g,{type:k.namespaceLoaded,payload:e}))})).then((function(e){var t,n="inline"===S.current,o=m.current.readOnly;-1!==p.current.indexOf("beforeLoad")&&(null===(t=g.current)||void 0===t||t.call(g,{type:k.beforeLoad,payload:e}));var r=e[n?"inline":"replace"](c,m.current);p.current.filter((function(e){return-1===v.indexOf(e)})).forEach((function(e){E({debug:y.current,editor:r,evtName:e,handler:function(t){var n;null===(n=g.current)||void 0===n||n.call(g,{type:"".concat(O).concat(e),payload:t})}})})),E({debug:y.current,editor:r,evtName:"loaded",handler:function(){U({type:"loaded"})},priority:-1}),E({debug:y.current,editor:r,evtName:"instanceReady",handler:function(e){var t=e.editor;U({type:"ready"}),n&&!o&&t.setReadOnly(!1),h.current&&t.setData(h.current,{noSnapshot:!0,callback:function(){t.resetUndo()}})},priority:-1}),E({debug:y.current,editor:r,evtName:"destroy",handler:function(){U({type:"destroyed"})},priority:-1}),U({type:"unloaded",payload:r})})).catch((function(e){console.error(e),U({type:"error"})}))),function(){w&&w.destroy()}}),[w,c]),{editor:w,status:null==w?void 0:w.status,error:"error"===T,loading:"loading"===T}}({config:n,dispatchEvent:function(e){var t=e.type,n=e.payload,o=S(t.substr(O.length)),r=h.current[o];r&&r(n)},debug:o,editorUrl:r,element:y,initContent:"string"==typeof a?a:void 0,subscribeTo:Object.keys(s).filter((function(e){return 0===e.indexOf("on")})).map(x),type:u}),H=m.editor,I=m.status;return T((function(){var e="inline"!==u&&H&&("loaded"===I||"ready"===I);return d&&e&&H.container.setStyles(d),function(){d&&e&&Object.keys(d).map(C).forEach((function(e){H.container.removeStyle(e)}))}}),[H,I,d,u]),T((function(){H&&"ready"===I&&"boolean"==typeof c&&H.setReadOnly(c)}),[H,I,c]),l.createElement("div",{id:null!=i?i:void 0,ref:g,style:w(null!=u?u:"classic",I,d)},"string"==typeof a?null:a)}var I=g({config:y.object,debug:y.bool,editorUrl:y.string,initData:y.node,name:y.string,readOnly:y.bool,style:y.object,type:y.oneOf(["classic","inline"])},b.reduce((function(e,t){var n;return g(g({},e),((n={})[S(t)]=y.func,n))}),{}));H.propTypes=I;var F=n(6442),A=n(73082);const z=Object.entries({"8px":"~6pt","9px":"~7pt","10px":"~7.5pt","11px":"~8pt","12px":"~9pt","13px":"~10pt","14px":"~10.5pt","15px":"~11pt","16px":"~12pt","17px":"~13pt","18px":"~13.5pt","19px":"~14pt","20px":"~14.5pt","22px":"~16pt","24px":"~18pt","26px":"~20pt","28px":"~21pt","29px":"~22pt","32px":"~24pt","36px":"~26pt","37px":"~28pt","48px":"~36pt","64px":"~48pt","72px":"~54pt"}).map((function(e){var t=u()(e,2),n=t[0],o=t[1];return"".concat(n," (").concat(o,")/").concat(n)})).join(";");var K,W=n(72189),B=n.n(W),M=n(51510),G=n(46005),J=M.Ay.div.withConfig({displayName:"StyledHtmlEditor"})(K||(K=B()(["\n && {\n .ck-editor {\n --ck-border-radius: 0.27rem;\n ","\n\n .ck.ck-list__item .ck-button.ck-fontsize-option .ck-button__label {\n line-height: 1;\n }\n\n .ck-editor__editable {\n min-height: 100px;\n }\n }\n }\n"])),(function(e){return(0,G.g)(e,"ckeditor")})),q=n(74848);function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}window.NEW_CKEDITOR_BASEPATH="".concat(n.p,"ckeditor4/");var Q=function(e){switch(e){case"fr-CH":return"fr";case"it-CH":return"it";case"en-US":return"en";case"fr":case"en":case"it":case"de":return e;case"de-CH":return"de-ch";default:return"de"}};const X=function(e){var t=e.id,o=e.value,r=void 0===o?"":o,i=e.onChange,c=e.contentLang,d=void 0===c?"de":c,s=e.defaultLinkTarget,p=e.ckEditorConfig,f=e.useAutogrow,y=e.height,g=e.minHeight,h=e.maxHeight,m=(0,F.A)().locale,v=(0,l.useState)(r),b=u()(v,2),O=b[0],S=b[1],x=(0,l.useState)(!1),k=u()(x,2),C=k[0],w=k[1],E=(0,l.useState)(y),D=u()(E,2),j=D[0],L=D[1],_=(0,l.useState)(Math.random()),P=u()(_,2),R=P[0],T=P[1];(0,l.useEffect)((function(){C&&O!==r&&T(Math.random())}),[r,C]);var U=Z(Z({language:Q(m),contentsLanguage:d,entities:!1,allowedContent:!0,toolbar:[["Bold","Italic","Underline","Strike","RemoveFormat"],["Format","Font","FontSize","TextColor"],["NumberedList","BulletedList","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"],["Link","Unlink"],["Table","SpecialChar","Image"],["PasteText"],["Source"]],extraPlugins:["colorbutton","colordialog","dialogadvtab","font","codemirror","justify"].concat(a()(f?["autogrow"]:[])),removeButtons:[],removeDialogTabs:"",removePlugins:["elementspath"],codemirror:{mode:"htmlmixed",enableCodeFormatting:!0,autoFormatOnStart:!0},versionCheck:!1,fontSize_sizes:z},p),f?{resize_enabled:!1,autoGrow_onStartup:!0,autoGrow_minHeight:g,autoGrow_maxHeight:h}:{height:j}),N=function(e){try{var t=e.data.name,n=e.data.definition;if("link"===t)n.getContents("info").get("protocol").default="https://",n.getContents("target").get("linkTargetType").default=s||"notSet"}catch(e){A.A.logError("Could not set default link attributes.")}};return(0,q.jsx)(J,{id:t,children:(0,q.jsx)(H,{config:U,initData:r,onBeforeLoad:function(e){return e.on("dialogDefinition",N)},type:"classic",onChange:function(e){var t=e.editor.getData();S(t),i(t)},onKey:function(e){"source"===e.editor.mode&&setTimeout((function(){var t=e.editor.editable().getValue();i(t)}),0)},editorUrl:"".concat(n.p,"ckeditor4/ckeditor-new.js"),onLoaded:function(){return w(!0)},onResize:f?function(){}:function(e){var t=e.data.contentsHeight;return L(t)}},R)})}}}]);
@@ -1 +1,5 @@
1
- NEW_CKEDITOR.plugins.add("autogrow",{init:function(e){e.elementMode!=NEW_CKEDITOR.ELEMENT_MODE_INLINE&&e.on("instanceReady",(function(){e.editable().isInline()?e.ui.space("contents").setStyle("height","auto"):function(e){function t(){i=e.document,a=i[NEW_CKEDITOR.env.ie?"getBody":"getDocumentElement"](),m=NEW_CKEDITOR.env.quirks?i.getBody():i.getDocumentElement();var t=NEW_CKEDITOR.env.quirks?m:m.findOne("body");t&&(t.setStyle("height","auto"),t.setStyle("min-height",NEW_CKEDITOR.env.safari?"0%":"auto")),d=NEW_CKEDITOR.dom.element.createFromHtml('<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">'+(NEW_CKEDITOR.env.webkit?"&nbsp;":"")+"</span>",i)}function o(){u&&m.setStyle("overflow-y","hidden");var t,o=e.window.getViewPaneSize().height;a.append(d),t=d.getDocumentPosition(i).y+d.$.offsetHeight,d.remove(),t+=g,t=Math.max(t,c),(t=Math.min(t,l))!=o&&n!=t&&(t=e.fire("autoGrow",{currentHeight:o,newHeight:t}).newHeight,e.resize(null,t,!0),n=t),u||(t<l&&m.$.scrollHeight>m.$.clientHeight?m.setStyle("overflow-y","hidden"):m.removeStyle("overflow-y"))}var n,i,a,m,d,r,g=e.config.autoGrow_bottomSpace||0,c=void 0!==e.config.autoGrow_minHeight?e.config.autoGrow_minHeight:200,l=e.config.autoGrow_maxHeight||1/0,u=!e.config.autoGrow_maxHeight;for(r in e.addCommand("autogrow",{exec:o,modes:{wysiwyg:1},readOnly:1,canUndo:!1,editorFocus:!1}),{contentDom:1,key:1,selectionChange:1,insertElement:1,mode:1})e.on(r,(function(t){"wysiwyg"==t.editor.mode&&setTimeout((function(){var t=e.getCommand("maximize");!e.window||t&&t.state==NEW_CKEDITOR.TRISTATE_ON?n=null:(o(),u||o())}),100)}));e.on("afterCommandExec",(function(e){"maximize"==e.data.name&&"wysiwyg"==e.editor.mode&&(e.data.command.state==NEW_CKEDITOR.TRISTATE_ON?m.removeStyle("overflow-y"):o())})),e.on("contentDom",t),t(),e.config.autoGrow_onStartup&&e.editable().isVisible()&&e.execCommand("autogrow")}(e)}))}});
1
+ /**
2
+ * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
+ * CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model.
4
+ */
5
+ "use strict";NEW_CKEDITOR.plugins.add("autogrow",{init:function(e){e.elementMode!=NEW_CKEDITOR.ELEMENT_MODE_INLINE&&e.on("instanceReady",(function(){e.editable().isInline()?e.ui.space("contents").setStyle("height","auto"):function(e){var t,o,n,i,a,r=e.config.autoGrow_bottomSpace||0,m=void 0!==e.config.autoGrow_minHeight?e.config.autoGrow_minHeight:200,d=e.config.autoGrow_maxHeight||1/0,c=!e.config.autoGrow_maxHeight;e.addCommand("autogrow",{exec:w,modes:{wysiwyg:1},readOnly:1,canUndo:!1,editorFocus:!1});var u={contentDom:1,key:1,selectionChange:1,insertElement:1,mode:1};for(var g in u)e.on(g,(function(e){"wysiwyg"==e.editor.mode&&setTimeout((function(){l()?t=null:(w(),c||w())}),100)}));function s(){o=e.document,n=o[NEW_CKEDITOR.env.ie?"getBody":"getDocumentElement"](),i=NEW_CKEDITOR.env.quirks?o.getBody():o.getDocumentElement();var t=NEW_CKEDITOR.env.quirks?i:i.findOne("body");t&&(t.setStyle("height","auto"),t.setStyle("min-height",NEW_CKEDITOR.env.safari?"0%":"auto")),a=NEW_CKEDITOR.dom.element.createFromHtml('<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">'+(NEW_CKEDITOR.env.webkit?"&nbsp;":"")+"</span>",o)}function l(){var t=e.getCommand("maximize");return!e.window||t&&t.state==NEW_CKEDITOR.TRISTATE_ON}function E(){n.append(a);var e=a.getDocumentPosition(o).y+a.$.offsetHeight;return a.remove(),e}function w(){c&&i.setStyle("overflow-y","hidden");var o=e.window.getViewPaneSize().height,n=E();n+=r,n=Math.max(n,m),(n=Math.min(n,d))!=o&&t!=n&&(n=e.fire("autoGrow",{currentHeight:o,newHeight:n}).newHeight,e.resize(null,n,!0),t=n),c||(n<d&&i.$.scrollHeight>i.$.clientHeight?i.setStyle("overflow-y","hidden"):i.removeStyle("overflow-y"))}e.on("afterCommandExec",(function(e){"maximize"==e.data.name&&"wysiwyg"==e.editor.mode&&(e.data.command.state==NEW_CKEDITOR.TRISTATE_ON?i.removeStyle("overflow-y"):w())})),e.on("contentDom",s),s(),e.config.autoGrow_onStartup&&e.editable().isVisible()&&e.execCommand("autogrow")}(e)}))}});