WIP - New imap class
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -162,7 +162,7 @@
|
||||
const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);
|
||||
const isWithinNonEditableList = (editor, element) => {
|
||||
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
|
||||
return isWithinNonEditable(editor, parentList);
|
||||
return isWithinNonEditable(editor, parentList) && editor.selection.isEditable();
|
||||
};
|
||||
const setNodeChangeHandler = (editor, nodeChangeHandler) => {
|
||||
const initialNode = editor.selection.getNode();
|
||||
@@ -184,7 +184,7 @@
|
||||
const updateButtonState = (editor, parents) => {
|
||||
const element = editor.selection.getStart(true);
|
||||
api.setActive(inList(editor, parents, nodeName));
|
||||
api.setEnabled(!isWithinNonEditableList(editor, element));
|
||||
api.setEnabled(!isWithinNonEditableList(editor, element) && editor.selection.isEditable());
|
||||
};
|
||||
const nodeChangeHandler = e => updateButtonState(editor, e.parents);
|
||||
return setNodeChangeHandler(editor, nodeChangeHandler);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,s)=>{const r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===s?null:{"list-style-type":s})},s=t=>e=>e.options.get(t),r=s("advlist_number_styles"),n=s("advlist_bullet_styles"),l=t=>null==t,i=t=>!l(t);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return i(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=t=>e=>i(e)&&t.test(e.nodeName),d=u(/^(OL|UL|DL)$/),g=u(/^(TH|TD)$/),c=t=>l(t)||"default"===t?"":t,h=(t,e)=>s=>((t,e)=>{const s=t.selection.getNode();return e({parents:t.dom.getParents(s),element:s}),t.on("NodeChange",e),()=>t.off("NodeChange",e)})(t,(r=>((t,r)=>{const n=t.selection.getStart(!0);s.setActive(((t,e,s)=>((t,e,s)=>{for(let e=0,n=t.length;e<n;e++){const n=t[e];if(d(r=n)&&!/\btox\-/.test(r.className))return a.some(n);if(s(n,e))break}var r;return a.none()})(e,0,g).exists((e=>e.nodeName===s&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))))(t,r,e)),s.setEnabled(!((t,e)=>{const s=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,s)})(t,n))})(t,r.parents))),m=(t,s,r,n,l,i)=>{i.length>1?((t,s,r,n,l,i)=>{t.ui.registry.addSplitButton(s,{tooltip:r,icon:"OL"===l?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(o.map(i,(t=>{const e="OL"===l?"num":"bull",s="disc"===t||"decimal"===t?"default":t,r=c(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:r,icon:"list-"+e+"-"+s,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(s,r)=>{e(t,l,r)},select:e=>{const s=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),s=t.dom.getStyle(e,"listStyleType");return a.from(s)})(t);return s.map((t=>e===t)).getOr(!1)},onSetup:h(t,l)})})(t,s,r,n,l,i):((t,s,r,n,l,i)=>{t.ui.registry.addToggleButton(s,{active:!1,tooltip:r,icon:"OL"===l?"ordered-list":"unordered-list",onSetup:h(t,l),onAction:()=>t.queryCommandState(n)||""===i?t.execCommand(n):e(t,l,i)})})(t,s,r,n,l,c(i[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{m(t,"numlist","Numbered list","InsertOrderedList","OL",r(t)),m(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((s,r)=>{e(t,"UL",r["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((s,r)=>{e(t,"OL",r["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}();
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(t,e,s)=>{const r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===s?null:{"list-style-type":s})},s=t=>e=>e.options.get(t),r=s("advlist_number_styles"),n=s("advlist_bullet_styles"),i=t=>null==t,l=t=>!i(t);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return l(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=t=>e=>l(e)&&t.test(e.nodeName),d=u(/^(OL|UL|DL)$/),g=u(/^(TH|TD)$/),c=t=>i(t)||"default"===t?"":t,h=(t,e)=>s=>((t,e)=>{const s=t.selection.getNode();return e({parents:t.dom.getParents(s),element:s}),t.on("NodeChange",e),()=>t.off("NodeChange",e)})(t,(r=>((t,r)=>{const n=t.selection.getStart(!0);s.setActive(((t,e,s)=>((t,e,s)=>{for(let e=0,n=t.length;e<n;e++){const n=t[e];if(d(r=n)&&!/\btox\-/.test(r.className))return a.some(n);if(s(n,e))break}var r;return a.none()})(e,0,g).exists((e=>e.nodeName===s&&((t,e)=>t.dom.isChildOf(e,t.getBody()))(t,e))))(t,r,e)),s.setEnabled(!((t,e)=>{const s=t.dom.getParent(e,"ol,ul,dl");return((t,e)=>null!==e&&!t.dom.isEditable(e))(t,s)&&t.selection.isEditable()})(t,n)&&t.selection.isEditable())})(t,r.parents))),m=(t,s,r,n,i,l)=>{l.length>1?((t,s,r,n,i,l)=>{t.ui.registry.addSplitButton(s,{tooltip:r,icon:"OL"===i?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:t=>{t(o.map(l,(t=>{const e="OL"===i?"num":"bull",s="disc"===t||"decimal"===t?"default":t,r=c(t),n=(t=>t.replace(/\-/g," ").replace(/\b\w/g,(t=>t.toUpperCase())))(t);return{type:"choiceitem",value:r,icon:"list-"+e+"-"+s,text:n}})))},onAction:()=>t.execCommand(n),onItemAction:(s,r)=>{e(t,i,r)},select:e=>{const s=(t=>{const e=t.dom.getParent(t.selection.getNode(),"ol,ul"),s=t.dom.getStyle(e,"listStyleType");return a.from(s)})(t);return s.map((t=>e===t)).getOr(!1)},onSetup:h(t,i)})})(t,s,r,n,i,l):((t,s,r,n,i,l)=>{t.ui.registry.addToggleButton(s,{active:!1,tooltip:r,icon:"OL"===i?"ordered-list":"unordered-list",onSetup:h(t,i),onAction:()=>t.queryCommandState(n)||""===l?t.execCommand(n):e(t,i,l)})})(t,s,r,n,i,c(l[0]))};t.add("advlist",(t=>{t.hasPlugin("lists")?((t=>{const e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})})(t),(t=>{m(t,"numlist","Numbered list","InsertOrderedList","OL",r(t)),m(t,"bullist","Bullet list","InsertUnorderedList","UL",n(t))})(t),(t=>{t.addCommand("ApplyUnorderedListStyle",((s,r)=>{e(t,"UL",r["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",((s,r)=>{e(t,"OL",r["list-style-type"])}))})(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}();
|
||||
24
vendor/tinymce/tinymce/plugins/anchor/plugin.js
vendored
24
vendor/tinymce/tinymce/plugins/anchor/plugin.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -164,18 +164,36 @@
|
||||
});
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const onAction = () => editor.execCommand('mceAnchor');
|
||||
editor.ui.registry.addToggleButton('anchor', {
|
||||
icon: 'bookmark',
|
||||
tooltip: 'Anchor',
|
||||
onAction,
|
||||
onSetup: buttonApi => editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind
|
||||
onSetup: buttonApi => {
|
||||
const unbindSelectorChanged = editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind;
|
||||
const unbindEditableChanged = onSetupEditable(editor)(buttonApi);
|
||||
return () => {
|
||||
unbindSelectorChanged();
|
||||
unbindEditableChanged();
|
||||
};
|
||||
}
|
||||
});
|
||||
editor.ui.registry.addMenuItem('anchor', {
|
||||
icon: 'bookmark',
|
||||
text: 'Anchor...',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.attr("contenteditable",e)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}();
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=("allow_html_in_named_anchor",e=>e.options.get("allow_html_in_named_anchor"));const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.attr("contenteditable",e)}},u=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const o=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,n=u(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:u(e)})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),h=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),w=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),h);if(!w)return null;let v=w.container;const _=k.backwards(w.container,w.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),h),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(w.container,w.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=$.length&&b.substr(0,0+$.length)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),n=t("autolink_pattern"),o=t("link_default_target"),r=t("link_default_protocol"),a=t("allow_unsafe_link_target"),s=("string",e=>"string"===(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=o=e,(r=String).prototype.isPrototypeOf(n)||(null===(a=o.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var n,o,r,a})(e));const l=(void 0,e=>undefined===e);const i=e=>!(e=>null==e)(e),c=Object.hasOwnProperty,d=e=>"\ufeff"===e;var u=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker");const f=e=>/^[(\[{ \u00a0]$/.test(e),g=(e,t,n)=>{for(let o=t-1;o>=0;o--){const t=e.charAt(o);if(!d(t)&&n(t))return o}return-1},m=(e,t)=>{var o;const a=e.schema.getVoidElements(),s=n(e),{dom:i,selection:d}=e;if(null!==i.getParent(d.getNode(),"a[href]"))return null;const m=d.getRng(),k=u(i,(e=>{return i.isBlock(e)||(t=a,n=e.nodeName.toLowerCase(),c.call(t,n))||"false"===i.getContentEditable(e);var t,n})),{container:p,offset:y}=((e,t)=>{let n=e,o=t;for(;1===n.nodeType&&n.childNodes[o];)n=n.childNodes[o],o=3===n.nodeType?n.data.length:n.childNodes.length;return{container:n,offset:o}})(m.endContainer,m.endOffset),w=null!==(o=i.getParent(p,i.isBlock))&&void 0!==o?o:i.getRoot(),h=k.backwards(p,y+t,((e,t)=>{const n=e.data,o=g(n,t,(r=f,e=>!r(e)));var r,a;return-1===o||(a=n[o],/[?!,.;:]/.test(a))?o:o+1}),w);if(!h)return null;let v=h.container;const _=k.backwards(h.container,h.offset,((e,t)=>{v=e;const n=g(e.data,t,f);return-1===n?n:n+1}),w),A=i.createRng();_?A.setStart(_.container,_.offset):A.setStart(v,0),A.setEnd(h.container,h.offset);const C=A.toString().replace(/\uFEFF/g,"").match(s);if(C){let t=C[0];return $="www.",(b=t).length>=4&&b.substr(0,4)===$?t=r(e)+"://"+t:((e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!l(o)||r+t.length<=o)})(t,"@")&&!(e=>/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(e))(t)&&(t="mailto:"+t),{rng:A,url:t}}var b,$;return null},k=(e,t)=>{const{dom:n,selection:r}=e,{rng:l,url:i}=t,c=r.getBookmark();r.setRng(l);const d="createlink",u={command:d,ui:!1,value:i};if(!e.dispatch("BeforeExecCommand",u).isDefaultPrevented()){e.getDoc().execCommand(d,!1,i),e.dispatch("ExecCommand",u);const t=o(e);if(s(t)){const o=r.getNode();n.setAttrib(o,"target",t),"_blank"!==t||a(e)||n.setAttrib(o,"rel","noopener")}}r.moveToBookmark(c),e.nodeChanged()},p=e=>{const t=m(e,-1);i(t)&&k(e,t)},y=p;e.add("autolink",(e=>{(e=>{const t=e.options.register;t("autolink_pattern",{processor:"regexp",default:new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i")}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"})})(e),(e=>{e.on("keydown",(t=>{13!==t.keyCode||t.isDefaultPrevented()||(e=>{const t=m(e,0);i(t)&&k(e,t)})(e)})),e.on("keyup",(t=>{32===t.keyCode?p(e):(48===t.keyCode&&t.shiftKey||221===t.keyCode)&&y(e)}))})(e)}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env");const o=e=>t=>t.options.get(e),s=o("min_height"),i=o("max_height"),n=o("autoresize_overflow_padding"),r=o("autoresize_bottom_margin"),l=(e,t)=>{const o=e.getBody();o&&(o.style.overflowY=t?"":"hidden",t||(o.scrollTop=0))},g=(e,t,o,s)=>{var i;const n=parseInt(null!==(i=e.getStyle(t,o,s))&&void 0!==i?i:"",10);return isNaN(n)?0:n},a=(e,o,r,c)=>{var d;const f=e.dom,u=e.getDoc();if(!u)return;if((e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen())(e))return void l(e,!0);const m=u.documentElement,h=c?c():n(e),p=null!==(d=s(e))&&void 0!==d?d:e.getElement().offsetHeight;let y=p;const S=g(f,m,"margin-top",!0),v=g(f,m,"margin-bottom",!0);let C=m.offsetHeight+S+v+h;C<0&&(C=0);const b=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;C+b>p&&(y=C+b);const w=i(e);if(w&&y>w?(y=w,l(e,!0)):l(e,!1),y!==o.get()){const s=y-o.get();if(f.setStyle(e.getContainer(),"height",y+"px"),o.set(y),(e=>{e.dispatch("ResizeEditor")})(e),t.browser.isSafari()&&(t.os.isMacOS()||t.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}e.hasFocus()&&(e=>{if("setcontent"===(null==e?void 0:e.type.toLowerCase())){const t=e;return!0===t.selection||!0===t.paste}return!1})(r)&&e.selection.scrollIntoView(),(t.browser.isSafari()||t.browser.isChromium())&&s<0&&a(e,o,r,c)}};e.add("autoresize",(e=>{if((e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1}),t("autoresize_bottom_margin",{processor:"number",default:50})})(e),e.options.isSet("resize")||e.options.set("resize",!1),!e.inline){const o=(e=>{let t=0;return{get:()=>t,set:e=>{t=e}}})();((e,t)=>{e.addCommand("mceAutoResize",(()=>{a(e,t)}))})(e,o),((e,o)=>{let s,i,l=()=>r(e);e.on("init",(i=>{s=0;const r=n(e),g=e.dom;g.setStyles(e.getDoc().documentElement,{height:"auto"}),t.browser.isEdge()||t.browser.isIE()?g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0}):g.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r}),a(e,o,i,l),s+=1})),e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(t=>{if(1===s)i=e.getContainer().offsetHeight,a(e,o,t,l),s+=1;else if(2===s){const t=i<e.getContainer().offsetHeight;if(t){const t=e.dom,o=e.getDoc();t.setStyles(o.documentElement,{"min-height":0}),t.setStyles(e.getBody(),{"min-height":"inherit"})}l=t?(0,()=>0):l,s+=1}else a(e,o,t,l)}))})(e,o)}}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(r=o=t,(a=String).prototype.isPrototypeOf(r)||(null===(s=o.constructor)||void 0===s?void 0:s.name)===a.name)?"string":e;var r,o,a,s})(t));const r=(void 0,t=>undefined===t);var o=tinymce.util.Tools.resolve("tinymce.util.Delay"),a=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),s=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=t=>{const e=/^(\d+)([ms]?)$/.exec(t);return(e&&e[2]?{s:1e3,m:6e4}[e[2]]:1)*parseInt(t,10)},i=t=>e=>e.options.get(t),u=i("autosave_ask_before_unload"),l=i("autosave_restore_when_empty"),c=i("autosave_interval"),d=i("autosave_retention"),m=t=>{const e=document.location;return t.options.get("autosave_prefix").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},v=(t,e)=>{if(r(e))return t.dom.isEmpty(t.getBody());{const r=s.trim(e);if(""===r)return!0;{const e=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(e)}}},f=t=>{var e;const r=parseInt(null!==(e=a.getItem(m(t)+"time"))&&void 0!==e?e:"0",10)||0;return!((new Date).getTime()-r>d(t)&&(p(t,!1),1))},p=(t,e)=>{const r=m(t);a.removeItem(r+"draft"),a.removeItem(r+"time"),!1!==e&&(t=>{t.dispatch("RemoveDraft")})(t)},g=t=>{const e=m(t);!v(t)&&t.isDirty()&&(a.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),a.setItem(e+"time",(new Date).getTime().toString()),(t=>{t.dispatch("StoreDraft")})(t))},y=t=>{var e;const r=m(t);f(t)&&(t.setContent(null!==(e=a.getItem(r+"draft"))&&void 0!==e?e:"",{format:"raw"}),(t=>{t.dispatch("RestoreDraft")})(t))};var D=tinymce.util.Tools.resolve("tinymce.EditorManager");const h=t=>e=>{e.setEnabled(f(t));const r=()=>e.setEnabled(f(t));return t.on("StoreDraft RestoreDraft RemoveDraft",r),()=>t.off("StoreDraft RestoreDraft RemoveDraft",r)};t.add("autosave",(t=>((t=>{const r=t.options.register,o=t=>{const r=e(t);return r?{value:n(t),valid:r}:{valid:!1,message:"Must be a string."}};r("autosave_ask_before_unload",{processor:"boolean",default:!0}),r("autosave_prefix",{processor:"string",default:"tinymce-autosave-{path}{query}{hash}-{id}-"}),r("autosave_restore_when_empty",{processor:"boolean",default:!1}),r("autosave_interval",{processor:o,default:"30s"}),r("autosave_retention",{processor:o,default:"20m"})})(t),(t=>{t.editorManager.on("BeforeUnload",(t=>{let e;s.each(D.get(),(t=>{t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&u(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))})),e&&(t.preventDefault(),t.returnValue=e)}))})(t),(t=>{(t=>{const e=c(t);o.setEditorInterval(t,(()=>{g(t)}),e)})(t);const e=()=>{(t=>{t.undoManager.transact((()=>{y(t),p(t)})),t.focus()})(t)};t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:e,onSetup:h(t)})})(t),t.on("init",(()=>{l(t)&&t.dom.isEmpty(t.getBody())&&y(t)})),(t=>({hasDraft:()=>f(t),storeDraft:()=>g(t),restoreDraft:()=>y(t),removeDraft:e=>p(t,e),isEmpty:e=>v(t,e)}))(t))))}();
|
||||
18
vendor/tinymce/tinymce/plugins/charmap/plugin.js
vendored
18
vendor/tinymce/tinymce/plugins/charmap/plugin.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -1616,17 +1616,29 @@
|
||||
});
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const onAction = () => editor.execCommand('mceShowCharmap');
|
||||
editor.ui.registry.addButton('charmap', {
|
||||
icon: 'insert-character',
|
||||
tooltip: 'Special character',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
editor.ui.registry.addMenuItem('charmap', {
|
||||
icon: 'insert-character',
|
||||
text: 'Special character...',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const o=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:o},onSubmit:o=>{((e,o)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(o)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,o.getData().code),o.close()}})})(e)}))})(e),(e=>{const o=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:o}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:o})})(e),{})))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -10,6 +10,8 @@
|
||||
const isNullable = a => a === null || a === undefined;
|
||||
const isNonNullable = a => !isNullable(a);
|
||||
|
||||
const noop = () => {
|
||||
};
|
||||
const constant = value => {
|
||||
return () => {
|
||||
return value;
|
||||
@@ -1222,7 +1224,7 @@
|
||||
Prism.languages.css = {
|
||||
'comment': /\/\*[\s\S]*?\*\//,
|
||||
'atrule': {
|
||||
pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
|
||||
pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
|
||||
inside: {
|
||||
'rule': /^@[\w-]+/,
|
||||
'selector-function-argument': {
|
||||
@@ -1319,7 +1321,8 @@
|
||||
'operator': {
|
||||
pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
|
||||
lookbehind: true
|
||||
}
|
||||
},
|
||||
'constant': /\b[A-Z][A-Z_\d]+\b/
|
||||
});
|
||||
Prism.languages.insertBefore('java', 'string', {
|
||||
'triple-quoted-string': {
|
||||
@@ -1549,7 +1552,10 @@
|
||||
pattern: /^=/,
|
||||
alias: 'attr-equals'
|
||||
},
|
||||
/"|'/
|
||||
{
|
||||
pattern: /^(\s*)["']|["']$/,
|
||||
lookbehind: true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -2300,7 +2306,7 @@
|
||||
type: 'panel',
|
||||
items: [
|
||||
{
|
||||
type: 'selectbox',
|
||||
type: 'listbox',
|
||||
name: 'language',
|
||||
label: 'Language',
|
||||
items: languages
|
||||
@@ -2405,6 +2411,17 @@
|
||||
});
|
||||
};
|
||||
|
||||
const onSetupEditable = (editor, onChanged = noop) => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
onChanged(api);
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const isCodeSampleSelection = editor => {
|
||||
const node = editor.selection.getStart();
|
||||
return editor.dom.is(node, 'pre[class*="language-"]');
|
||||
@@ -2415,18 +2432,15 @@
|
||||
icon: 'code-sample',
|
||||
tooltip: 'Insert/edit code sample',
|
||||
onAction,
|
||||
onSetup: api => {
|
||||
const nodeChangeHandler = () => {
|
||||
api.setActive(isCodeSampleSelection(editor));
|
||||
};
|
||||
editor.on('NodeChange', nodeChangeHandler);
|
||||
return () => editor.off('NodeChange', nodeChangeHandler);
|
||||
}
|
||||
onSetup: onSetupEditable(editor, api => {
|
||||
api.setActive(isCodeSampleSelection(editor));
|
||||
})
|
||||
});
|
||||
editor.ui.registry.addMenuItem('codesample', {
|
||||
text: 'Code sample...',
|
||||
icon: 'code-sample',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -315,27 +315,36 @@
|
||||
return normalizedElement.getOr(element);
|
||||
};
|
||||
const isListItem = isTag('li');
|
||||
const setDir = (editor, dir) => {
|
||||
const selectedBlocks = editor.selection.getSelectedBlocks();
|
||||
if (selectedBlocks.length > 0) {
|
||||
each(selectedBlocks, block => {
|
||||
const blockElement = SugarElement.fromDom(block);
|
||||
const isBlockElementListItem = isListItem(blockElement);
|
||||
const normalizedBlock = getNormalizedBlock(blockElement, isBlockElementListItem);
|
||||
const normalizedBlockParent = getParentElement(normalizedBlock);
|
||||
normalizedBlockParent.each(parent => {
|
||||
const parentDirection = getDirection(parent);
|
||||
if (parentDirection !== dir) {
|
||||
set(normalizedBlock, 'dir', dir);
|
||||
} else if (getDirection(normalizedBlock) !== dir) {
|
||||
remove(normalizedBlock, 'dir');
|
||||
}
|
||||
if (isBlockElementListItem) {
|
||||
const listItems = children(normalizedBlock, 'li[dir]');
|
||||
each(listItems, listItem => remove(listItem, 'dir'));
|
||||
}
|
||||
});
|
||||
const setDirOnElements = (dom, blocks, dir) => {
|
||||
each(blocks, block => {
|
||||
const blockElement = SugarElement.fromDom(block);
|
||||
const isBlockElementListItem = isListItem(blockElement);
|
||||
const normalizedBlock = getNormalizedBlock(blockElement, isBlockElementListItem);
|
||||
const normalizedBlockParent = getParentElement(normalizedBlock);
|
||||
normalizedBlockParent.each(parent => {
|
||||
dom.setStyle(normalizedBlock.dom, 'direction', null);
|
||||
const parentDirection = getDirection(parent);
|
||||
if (parentDirection === dir) {
|
||||
remove(normalizedBlock, 'dir');
|
||||
} else {
|
||||
set(normalizedBlock, 'dir', dir);
|
||||
}
|
||||
if (getDirection(normalizedBlock) !== dir) {
|
||||
dom.setStyle(normalizedBlock.dom, 'direction', dir);
|
||||
}
|
||||
if (isBlockElementListItem) {
|
||||
const listItems = children(normalizedBlock, 'li[dir],li[style]');
|
||||
each(listItems, listItem => {
|
||||
remove(listItem, 'dir');
|
||||
dom.setStyle(listItem.dom, 'direction', null);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const setDir = (editor, dir) => {
|
||||
if (editor.selection.isEditable()) {
|
||||
setDirOnElements(editor.dom, editor.selection.getSelectedBlocks(), dir);
|
||||
editor.nodeChanged();
|
||||
}
|
||||
};
|
||||
@@ -353,8 +362,10 @@
|
||||
const nodeChangeHandler = e => {
|
||||
const element = SugarElement.fromDom(e.element);
|
||||
api.setActive(getDirection(element) === dir);
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChangeHandler);
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
return () => editor.off('NodeChange', nodeChangeHandler);
|
||||
};
|
||||
const register = editor => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,o=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(o=r=t,(n=String).prototype.isPrototypeOf(o)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===n.name)?"string":e;var o,r,n,i})(t),r=e("boolean"),n=t=>!(t=>null==t)(t),i=e("function"),s=e("number"),l=(!1,()=>false);class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return n(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=(t,e)=>{for(let o=0,r=t.length;o<r;o++)e(t[o],o)},c=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},d=c,h=(t,e)=>{const o=t.dom;if(1!==o.nodeType)return!1;{const t=o;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}};"undefined"!=typeof window?window:Function("return this;")();const m=t=>e=>(t=>t.dom.nodeType)(e)===t,g=m(1),f=m(3),v=m(9),p=m(11),y=(t,e)=>{t.dom.removeAttribute(e)},w=i(Element.prototype.attachShadow)&&i(Node.prototype.getRootNode)?t=>d(t.dom.getRootNode()):t=>v(t)?t:d(t.dom.ownerDocument),N=t=>d(t.dom.host),b=t=>{const e=f(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;const o=e.ownerDocument;return(t=>{const e=w(t);return p(o=e)&&n(o.dom.host)?a.some(e):a.none();var o})(d(e)).fold((()=>o.body.contains(e)),(r=b,i=N,t=>r(i(t))));var r,i},S=t=>"rtl"===((t,e)=>{const o=t.dom,r=window.getComputedStyle(o).getPropertyValue(e);return""!==r||b(t)?r:((t,e)=>(t=>void 0!==t.style&&i(t.style.getPropertyValue))(t)?t.style.getPropertyValue(e):"")(o,e)})(t,"direction")?"rtl":"ltr",A=(t,e)=>((t,o)=>((t,e)=>{const o=[];for(let r=0,n=t.length;r<n;r++){const n=t[r];e(n,r)&&o.push(n)}return o})(((t,e)=>{const o=t.length,r=new Array(o);for(let n=0;n<o;n++){const o=t[n];r[n]=e(o,n)}return r})(t.dom.childNodes,d),(t=>h(t,e))))(t),T=("li",t=>g(t)&&"li"===t.dom.nodeName.toLowerCase());const C=(t,e)=>{const n=t.selection.getSelectedBlocks();n.length>0&&(u(n,(t=>{const n=d(t),c=T(n),m=((t,e)=>{return(e?(o=t,r="ol,ul",((t,e,o)=>{let n=t.dom;const s=i(o)?o:l;for(;n.parentNode;){n=n.parentNode;const t=d(n);if(h(t,r))return a.some(t);if(s(t))break}return a.none()})(o,0,n)):a.some(t)).getOr(t);var o,r,n})(n,c);var f;(f=m,(t=>a.from(t.dom.parentNode).map(d))(f).filter(g)).each((t=>{if(S(t)!==e?((t,e,n)=>{((t,e,n)=>{if(!(o(n)||r(n)||s(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")})(t.dom,e,n)})(m,"dir",e):S(m)!==e&&y(m,"dir"),c){const t=A(m,"li[dir]");u(t,(t=>y(t,"dir")))}}))})),t.nodeChanged())},D=(t,e)=>o=>{const r=t=>{const r=d(t.element);o.setActive(S(r)===e)};return t.on("NodeChange",r),()=>t.off("NodeChange",r)};t.add("directionality",(t=>{(t=>{t.addCommand("mceDirectionLTR",(()=>{C(t,"ltr")})),t.addCommand("mceDirectionRTL",(()=>{C(t,"rtl")}))})(t),(t=>{t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>t.execCommand("mceDirectionLTR"),onSetup:D(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>t.execCommand("mceDirectionRTL"),onSetup:D(t,"rtl")})})(t)}))}();
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,o=t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(o=r=t,(n=String).prototype.isPrototypeOf(o)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===n.name)?"string":e;var o,r,n,i})(t),r=e("boolean"),n=t=>!(t=>null==t)(t),i=e("function"),s=e("number"),l=(!1,()=>false);class a{constructor(t,e){this.tag=t,this.value=e}static some(t){return new a(!0,t)}static none(){return a.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?a.some(t(this.value)):a.none()}bind(t){return this.tag?t(this.value):a.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:a.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return n(t)?a.some(t):a.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}a.singletonNone=new a(!1);const u=(t,e)=>{for(let o=0,r=t.length;o<r;o++)e(t[o],o)},c=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},d=c,h=(t,e)=>{const o=t.dom;if(1!==o.nodeType)return!1;{const t=o;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}};"undefined"!=typeof window?window:Function("return this;")();const m=t=>e=>(t=>t.dom.nodeType)(e)===t,g=m(1),f=m(3),v=m(9),y=m(11),p=(t,e)=>{t.dom.removeAttribute(e)},w=i(Element.prototype.attachShadow)&&i(Node.prototype.getRootNode)?t=>d(t.dom.getRootNode()):t=>v(t)?t:d(t.dom.ownerDocument),b=t=>d(t.dom.host),N=t=>{const e=f(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;const o=e.ownerDocument;return(t=>{const e=w(t);return y(o=e)&&n(o.dom.host)?a.some(e):a.none();var o})(d(e)).fold((()=>o.body.contains(e)),(r=N,i=b,t=>r(i(t))));var r,i},S=t=>"rtl"===((t,e)=>{const o=t.dom,r=window.getComputedStyle(o).getPropertyValue(e);return""!==r||N(t)?r:((t,e)=>(t=>void 0!==t.style&&i(t.style.getPropertyValue))(t)?t.style.getPropertyValue(e):"")(o,e)})(t,"direction")?"rtl":"ltr",A=(t,e)=>((t,o)=>((t,e)=>{const o=[];for(let r=0,n=t.length;r<n;r++){const n=t[r];e(n,r)&&o.push(n)}return o})(((t,e)=>{const o=t.length,r=new Array(o);for(let n=0;n<o;n++){const o=t[n];r[n]=e(o,n)}return r})(t.dom.childNodes,d),(t=>h(t,e))))(t),E=("li",t=>g(t)&&"li"===t.dom.nodeName.toLowerCase());const T=(t,e,n)=>{u(e,(e=>{const c=d(e),m=E(c),f=((t,e)=>{return(e?(o=t,r="ol,ul",((t,e,o)=>{let n=t.dom;const s=i(o)?o:l;for(;n.parentNode;){n=n.parentNode;const t=d(n);if(h(t,r))return a.some(t);if(s(t))break}return a.none()})(o,0,n)):a.some(t)).getOr(t);var o,r,n})(c,m);var v;(v=f,(t=>a.from(t.dom.parentNode).map(d))(v).filter(g)).each((e=>{if(t.setStyle(f.dom,"direction",null),S(e)===n?p(f,"dir"):((t,e,n)=>{((t,e,n)=>{if(!(o(n)||r(n)||s(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")})(t.dom,e,n)})(f,"dir",n),S(f)!==n&&t.setStyle(f.dom,"direction",n),m){const e=A(f,"li[dir],li[style]");u(e,(e=>{p(e,"dir"),t.setStyle(e.dom,"direction",null)}))}}))}))},C=(t,e)=>{t.selection.isEditable()&&(T(t.dom,t.selection.getSelectedBlocks(),e),t.nodeChanged())},D=(t,e)=>o=>{const r=r=>{const n=d(r.element);o.setActive(S(n)===e),o.setEnabled(t.selection.isEditable())};return t.on("NodeChange",r),o.setEnabled(t.selection.isEditable()),()=>t.off("NodeChange",r)};t.add("directionality",(t=>{(t=>{t.addCommand("mceDirectionLTR",(()=>{C(t,"ltr")})),t.addCommand("mceDirectionRTL",(()=>{C(t,"rtl")}))})(t),(t=>{t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>t.execCommand("mceDirectionLTR"),onSetup:D(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>t.execCommand("mceDirectionRTL"),onSetup:D(t,"rtl")})})(t)}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -551,17 +551,29 @@
|
||||
});
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const onAction = () => editor.execCommand('mceEmoticons');
|
||||
editor.ui.registry.addButton('emoticons', {
|
||||
tooltip: 'Emojis',
|
||||
icon: 'emoji',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
editor.ui.registry.addMenuItem('emoticons', {
|
||||
text: 'Emojis...',
|
||||
icon: 'emoji',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
File diff suppressed because one or more lines are too long
151
vendor/tinymce/tinymce/plugins/help/plugin.js
vendored
151
vendor/tinymce/tinymce/plugins/help/plugin.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -19,7 +19,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
let unique = 0;
|
||||
const generate = prefix => {
|
||||
@@ -257,73 +257,23 @@
|
||||
return r;
|
||||
};
|
||||
|
||||
const description = `<h1>Editor UI keyboard navigation</h1>
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.Resource');
|
||||
|
||||
<h2>Activating keyboard navigation</h2>
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.util.I18n');
|
||||
|
||||
<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>
|
||||
<ul>
|
||||
<li>Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)</li>
|
||||
<li>Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)</li>
|
||||
<li>Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)</li>
|
||||
</ul>
|
||||
const pLoadHtmlByLangCode = (baseUrl, langCode) => global$3.load(`tinymce.html-i18n.help-keynav.${ langCode }`, `${ baseUrl }/js/i18n/keynav/${ langCode }.js`);
|
||||
const pLoadI18nHtml = baseUrl => pLoadHtmlByLangCode(baseUrl, global$2.getCode()).catch(() => pLoadHtmlByLangCode(baseUrl, 'en'));
|
||||
const initI18nLoad = (editor, baseUrl) => {
|
||||
editor.on('init', () => {
|
||||
pLoadI18nHtml(baseUrl);
|
||||
});
|
||||
};
|
||||
|
||||
<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>
|
||||
|
||||
<h2>Moving between UI sections</h2>
|
||||
|
||||
<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>
|
||||
<ul>
|
||||
<li>the menubar</li>
|
||||
<li>each group of the toolbar </li>
|
||||
<li>the sidebar</li>
|
||||
<li>the element path in the footer </li>
|
||||
<li>the wordcount toggle button in the footer </li>
|
||||
<li>the branding link in the footer </li>
|
||||
<li>the editor resize handle in the footer</li>
|
||||
</ul>
|
||||
|
||||
<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>
|
||||
|
||||
<h2>Moving within UI sections</h2>
|
||||
|
||||
<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>
|
||||
<ul>
|
||||
<li>moving between menus in the menubar</li>
|
||||
<li>moving between buttons in a toolbar group</li>
|
||||
<li>moving between items in the element path</li>
|
||||
</ul>
|
||||
|
||||
<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>
|
||||
|
||||
<h1>Executing buttons</h1>
|
||||
|
||||
<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>
|
||||
|
||||
<h1>Opening, navigating and closing menus</h1>
|
||||
|
||||
<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>
|
||||
|
||||
<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>
|
||||
|
||||
<h1>Context toolbars and menus</h1>
|
||||
|
||||
<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).</p>
|
||||
|
||||
<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>
|
||||
|
||||
<h1>Dialog navigation</h1>
|
||||
|
||||
<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>
|
||||
|
||||
<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>
|
||||
|
||||
<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>`;
|
||||
const tab$3 = () => {
|
||||
const pTab = async pluginUrl => {
|
||||
const body = {
|
||||
type: 'htmlpanel',
|
||||
presets: 'document',
|
||||
html: description
|
||||
html: await pLoadI18nHtml(pluginUrl)
|
||||
};
|
||||
return {
|
||||
name: 'keyboardnav',
|
||||
@@ -332,10 +282,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
const convertText = source => {
|
||||
const isMac = global$2.os.isMacOS() || global$2.os.isiOS();
|
||||
const isMac = global$1.os.isMacOS() || global$1.os.isiOS();
|
||||
const mac = {
|
||||
alt: '⌥',
|
||||
ctrl: '⌃',
|
||||
@@ -485,9 +435,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.I18n');
|
||||
|
||||
const urls = map([
|
||||
{
|
||||
key: 'accordion',
|
||||
name: 'Accordion'
|
||||
},
|
||||
{
|
||||
key: 'advlist',
|
||||
name: 'Advanced List'
|
||||
@@ -633,6 +585,11 @@
|
||||
type: 'premium',
|
||||
slug: 'advanced-templates'
|
||||
},
|
||||
{
|
||||
key: 'ai',
|
||||
name: 'AI Assistant',
|
||||
type: 'premium'
|
||||
},
|
||||
{
|
||||
key: 'casechange',
|
||||
name: 'Case Change',
|
||||
@@ -759,9 +716,9 @@
|
||||
});
|
||||
const sortedPremiumPlugins = sort(map(premiumPlugins, p => p.name), (s1, s2) => s1.localeCompare(s2));
|
||||
const premiumPluginList = map(sortedPremiumPlugins, pluginName => `<li>${ pluginName }</li>`).join('');
|
||||
return '<div data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$1.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" rel="noopener" target="_blank">' + global$1.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
|
||||
return '<div>' + '<p><b>' + global$2.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" ">' + '<a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" rel="noopener" target="_blank"' + ' data-alloy-tabstop="true" tabindex="-1">' + global$2.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
|
||||
};
|
||||
const makeLink = p => `<a href="${ p.url }" target="_blank" rel="noopener">${ p.name }</a>`;
|
||||
const makeLink = p => `<a data-alloy-tabstop="true" tabindex="-1" href="${ p.url }" target="_blank" rel="noopener">${ p.name }</a>`;
|
||||
const identifyUnknownPlugin = (editor, key) => {
|
||||
const getMetadata = editor.plugins[key].getMetadata;
|
||||
if (isFunction(getMetadata)) {
|
||||
@@ -805,7 +762,7 @@
|
||||
});
|
||||
const count = pluginLis.length;
|
||||
const pluginsString = pluginLis.join('');
|
||||
const html = '<p><b>' + global$1.translate([
|
||||
const html = '<p><b>' + global$2.translate([
|
||||
'Plugins installed ({0}):',
|
||||
count
|
||||
]) + '</b></p>' + '<ul>' + pluginsString + '</ul>';
|
||||
@@ -815,7 +772,7 @@
|
||||
if (editor == null) {
|
||||
return '';
|
||||
}
|
||||
return '<div data-mce-tabstop="1" tabindex="-1">' + pluginLister(editor) + '</div>';
|
||||
return '<div>' + pluginLister(editor) + '</div>';
|
||||
};
|
||||
const htmlPanel = {
|
||||
type: 'htmlpanel',
|
||||
@@ -837,10 +794,10 @@
|
||||
const tab = () => {
|
||||
const getVersion = (major, minor) => major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor;
|
||||
const version = getVersion(global.majorVersion, global.minorVersion);
|
||||
const changeLogLink = '<a href="https://www.tiny.cloud/docs/tinymce/6/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" rel="noopener" target="_blank">TinyMCE ' + version + '</a>';
|
||||
const changeLogLink = '<a data-alloy-tabstop="true" tabindex="-1" href="https://www.tiny.cloud/docs/tinymce/6/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" rel="noopener" target="_blank">TinyMCE ' + version + '</a>';
|
||||
const htmlPanel = {
|
||||
type: 'htmlpanel',
|
||||
html: '<p>' + global$1.translate([
|
||||
html: '<p>' + global$2.translate([
|
||||
'You are using {0}',
|
||||
changeLogLink
|
||||
]) + '</p>',
|
||||
@@ -885,9 +842,9 @@
|
||||
names
|
||||
};
|
||||
};
|
||||
const parseCustomTabs = (editor, customTabs) => {
|
||||
const pParseCustomTabs = async (editor, customTabs, pluginUrl) => {
|
||||
const shortcuts = tab$2();
|
||||
const nav = tab$3();
|
||||
const nav = await pTab(pluginUrl);
|
||||
const plugins = tab$1(editor);
|
||||
const versions = tab();
|
||||
const tabs = {
|
||||
@@ -899,37 +856,39 @@
|
||||
};
|
||||
return Optional.from(getHelpTabs(editor)).fold(() => getNamesFromTabs(tabs), tabsFromSettings => parseHelpTabsSetting(tabsFromSettings, tabs));
|
||||
};
|
||||
const init = (editor, customTabs) => () => {
|
||||
const {tabs, names} = parseCustomTabs(editor, customTabs);
|
||||
const foundTabs = map(names, name => get(tabs, name));
|
||||
const dialogTabs = cat(foundTabs);
|
||||
const body = {
|
||||
type: 'tabpanel',
|
||||
tabs: dialogTabs
|
||||
};
|
||||
editor.windowManager.open({
|
||||
title: 'Help',
|
||||
size: 'normal',
|
||||
body,
|
||||
buttons: [{
|
||||
type: 'cancel',
|
||||
name: 'close',
|
||||
text: 'Close',
|
||||
primary: true
|
||||
}],
|
||||
initialData: {}
|
||||
const init = (editor, customTabs, pluginUrl) => () => {
|
||||
pParseCustomTabs(editor, customTabs, pluginUrl).then(({tabs, names}) => {
|
||||
const foundTabs = map(names, name => get(tabs, name));
|
||||
const dialogTabs = cat(foundTabs);
|
||||
const body = {
|
||||
type: 'tabpanel',
|
||||
tabs: dialogTabs
|
||||
};
|
||||
editor.windowManager.open({
|
||||
title: 'Help',
|
||||
size: 'medium',
|
||||
body,
|
||||
buttons: [{
|
||||
type: 'cancel',
|
||||
name: 'close',
|
||||
text: 'Close',
|
||||
primary: true
|
||||
}],
|
||||
initialData: {}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var Plugin = () => {
|
||||
global$3.add('help', editor => {
|
||||
global$4.add('help', (editor, pluginUrl) => {
|
||||
const customTabs = Cell({});
|
||||
const api = get$1(customTabs);
|
||||
register$1(editor);
|
||||
const dialogOpener = init(editor, customTabs);
|
||||
const dialogOpener = init(editor, customTabs, pluginUrl);
|
||||
register(editor, dialogOpener);
|
||||
register$2(editor, dialogOpener);
|
||||
editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp');
|
||||
initI18nLoad(editor, pluginUrl);
|
||||
return api;
|
||||
});
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
24
vendor/tinymce/tinymce/plugins/image/plugin.js
vendored
24
vendor/tinymce/tinymce/plugins/image/plugin.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -1456,6 +1456,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
editor.ui.registry.addToggleButton('image', {
|
||||
icon: 'image',
|
||||
@@ -1463,15 +1473,21 @@
|
||||
onAction: Dialog(editor).open,
|
||||
onSetup: buttonApi => {
|
||||
buttonApi.setActive(isNonNullable(getSelectedImage(editor)));
|
||||
return editor.selection.selectorChangedWithUnbind('img:not([data-mce-object]):not([data-mce-placeholder]),figure.image', buttonApi.setActive).unbind;
|
||||
const unbindSelectorChanged = editor.selection.selectorChangedWithUnbind('img:not([data-mce-object]):not([data-mce-placeholder]),figure.image', buttonApi.setActive).unbind;
|
||||
const unbindEditable = onSetupEditable(editor)(buttonApi);
|
||||
return () => {
|
||||
unbindSelectorChanged();
|
||||
unbindEditable();
|
||||
};
|
||||
}
|
||||
});
|
||||
editor.ui.registry.addMenuItem('image', {
|
||||
icon: 'image',
|
||||
text: 'Image...',
|
||||
onAction: Dialog(editor).open
|
||||
onAction: Dialog(editor).open,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
editor.ui.registry.addContextMenu('image', { update: element => isFigure(element) || isImage(element) && !isPlaceholderImage(element) ? ['image'] : [] });
|
||||
editor.ui.registry.addContextMenu('image', { update: element => editor.selection.isEditable() && (isFigure(element) || isImage(element) && !isPlaceholderImage(element)) ? ['image'] : [] });
|
||||
};
|
||||
|
||||
var Plugin = () => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(s=r=e,(o=String).prototype.isPrototypeOf(s)||(null===(n=r.constructor)||void 0===n?void 0:n.name)===o.name)?"string":t;var s,r,o,n})(t)===e,s=t("string"),r=t("object"),o=t("array"),n=("function",e=>"function"==typeof e);var c=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Tools");const p=e=>t=>t.options.get(e),u=p("importcss_merge_classes"),m=p("importcss_exclusive"),f=p("importcss_selector_converter"),y=p("importcss_selector_filter"),d=p("importcss_groups"),h=p("importcss_append"),_=p("importcss_file_filter"),g=p("skin"),v=p("skin_url"),b=Array.prototype.push,x=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,T=e=>s(e)?t=>-1!==t.indexOf(e):e instanceof RegExp?t=>e.test(t):e,S=(e,t)=>{let s={};const r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(!r)return;const o=r[1],n=r[2].substr(1).split(".").join(" "),c=a.makeMap("a,img");return r[1]?(s={title:t},e.schema.getTextBlockElements()[o]?s.block=o:e.schema.getBlockElements()[o]||c[o.toLowerCase()]?s.selector=o:s.inline=o):r[2]&&(s={inline:"span",title:t.substr(1),classes:n}),u(e)?s.classes=n:s.attributes={class:n},s},k=(e,t)=>null===t||m(e),w=e=>{e.on("init",(()=>{const t=(()=>{const e=[],t=[],s={};return{addItemToGroup:(e,r)=>{s[e]?s[e].push(r):(t.push(e),s[e]=[r])},addItem:t=>{e.push(t)},toFormats:()=>{return(r=t,n=e=>{const t=s[e];return 0===t.length?[]:[{title:e,items:t}]},(e=>{const t=[];for(let s=0,r=e.length;s<r;++s){if(!o(e[s]))throw new Error("Arr.flatten item "+s+" was not an array, input: "+e);b.apply(t,e[s])}return t})(((e,t)=>{const s=e.length,r=new Array(s);for(let o=0;o<s;o++){const s=e[o];r[o]=t(s,o)}return r})(r,n))).concat(e);var r,n}}})(),r={},n=T(y(e)),p=(e=>a.map(e,(e=>a.extend({},e,{original:e,selectors:{},filter:T(e.filter)}))))(d(e)),u=(t,s)=>{if(((e,t,s,r)=>!(k(e,s)?t in r:t in s.selectors))(e,t,s,r)){((e,t,s,r)=>{k(e,s)?r[t]=!0:s.selectors[t]=!0})(e,t,s,r);const o=((e,t,s,r)=>{let o;const n=f(e);return o=r&&r.selector_converter?r.selector_converter:n||(()=>S(e,s)),o.call(t,s,r)})(e,e.plugins.importcss,t,s);if(o){const t=o.name||c.DOM.uniqueId();return e.formatter.register(t,o),{title:o.title,format:t}}}return null};a.each(((e,t,r)=>{const o=[],n={},c=(t,n)=>{let p,u=t.href;if(u=(e=>{const t=l.cacheSuffix;return s(e)&&(e=e.replace("?"+t,"").replace("&"+t,"")),e})(u),u&&(!r||r(u,n))&&!((e,t)=>{const s=g(e);if(s){const r=v(e),o=r?e.documentBaseURI.toAbsolute(r):i.baseURL+"/skins/ui/"+s,n=i.baseURL+"/skins/content/";return t===o+"/content"+(e.inline?".inline":"")+".min.css"||-1!==t.indexOf(n)}return!1})(e,u)){a.each(t.imports,(e=>{c(e,!0)}));try{p=t.cssRules||t.rules}catch(e){}a.each(p,(e=>{e.styleSheet?c(e.styleSheet,!0):e.selectorText&&a.each(e.selectorText.split(","),(e=>{o.push(a.trim(e))}))}))}};a.each(e.contentCSS,(e=>{n[e]=!0})),r||(r=(e,t)=>t||n[e]);try{a.each(t.styleSheets,(e=>{c(e)}))}catch(e){}return o})(e,e.getDoc(),T(_(e))),(e=>{if(!x.test(e)&&(!n||n(e))){const s=((e,t)=>a.grep(e,(e=>!e.filter||e.filter(t))))(p,e);if(s.length>0)a.each(s,(s=>{const r=u(e,s);r&&t.addItemToGroup(s.title,r)}));else{const s=u(e,null);s&&t.addItem(s)}}}));const m=t.toFormats();e.dispatch("addStyleModifications",{items:m,replace:!h(e)})}))};e.add("importcss",(e=>((e=>{const t=e.options.register,o=e=>s(e)||n(e)||r(e);t("importcss_merge_classes",{processor:"boolean",default:!0}),t("importcss_exclusive",{processor:"boolean",default:!0}),t("importcss_selector_converter",{processor:"function"}),t("importcss_selector_filter",{processor:o}),t("importcss_file_filter",{processor:o}),t("importcss_groups",{processor:"object[]"}),t("importcss_append",{processor:"boolean",default:!1})})(e),w(e),(e=>({convertSelectorToFormat:t=>S(e,t)}))(e))))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -124,6 +124,16 @@
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const formats = getFormats(editor);
|
||||
const defaultFormat = Cell(getDefaultDateTime(editor));
|
||||
@@ -145,7 +155,8 @@
|
||||
onItemAction: (_api, value) => {
|
||||
defaultFormat.set(value);
|
||||
insertDateTime(value);
|
||||
}
|
||||
},
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
const makeMenuItemHandler = format => () => {
|
||||
defaultFormat.set(format);
|
||||
@@ -158,7 +169,8 @@
|
||||
type: 'menuitem',
|
||||
text: getDateTime(editor, format),
|
||||
onAction: makeMenuItemHandler(format)
|
||||
}))
|
||||
})),
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),a=t("insertdatetime_dateformat"),r=t("insertdatetime_timeformat"),n=t("insertdatetime_formats"),s=t("insertdatetime_element"),i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),c=(e,t)=>{if((e=""+e).length<t)for(let a=0;a<t-e.length;a++)e="0"+e;return e},d=(e,t,a=new Date)=>(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",c(a.getMonth()+1,2))).replace("%d",c(a.getDate(),2))).replace("%H",""+c(a.getHours(),2))).replace("%M",""+c(a.getMinutes(),2))).replace("%S",""+c(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[a.getMonth()]))).replace("%b",""+e.translate(l[a.getMonth()]))).replace("%A",""+e.translate(o[a.getDay()]))).replace("%a",""+e.translate(i[a.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)){const a=d(e,t);let r;r=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");const n=e.dom.getParent(e.selection.getStart(),"time");n?((e,t,a,r)=>{const n=e.dom.create("time",{datetime:a},r);e.dom.replace(n,t),e.selection.select(n,!0),e.selection.collapse(!1)})(e,n,r,a):e.insertContent('<time datetime="'+r+'">'+a+"</time>")}else e.insertContent(d(e,t))};var p=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",(e=>{(e=>{const t=e.options.register;t("insertdatetime_dateformat",{processor:"string",default:e.translate("%Y-%m-%d")}),t("insertdatetime_timeformat",{processor:"string",default:e.translate("%H:%M:%S")}),t("insertdatetime_formats",{processor:"string[]",default:["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"]}),t("insertdatetime_element",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceInsertDate",((t,r)=>{u(e,null!=r?r:a(e))})),e.addCommand("mceInsertTime",((t,a)=>{u(e,null!=a?a:r(e))}))})(e),(e=>{const t=n(e),a=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=n(e);return t.length>0?t[0]:r(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:e=>e===a.get(),fetch:a=>{a(p.map(t,(t=>({type:"choiceitem",text:d(e,t),value:t}))))},onAction:e=>{s(a.get())},onItemAction:(e,t)=>{a.set(t),s(t)}});const i=e=>()=>{a.set(e),s(e)};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:()=>p.map(t,(t=>({type:"menuitem",text:d(e,t),onAction:i(t)})))})})(e)}))}();
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),a=t("insertdatetime_dateformat"),n=t("insertdatetime_timeformat"),r=t("insertdatetime_formats"),s=t("insertdatetime_element"),i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),c=(e,t)=>{if((e=""+e).length<t)for(let a=0;a<t-e.length;a++)e="0"+e;return e},d=(e,t,a=new Date)=>(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",c(a.getMonth()+1,2))).replace("%d",c(a.getDate(),2))).replace("%H",""+c(a.getHours(),2))).replace("%M",""+c(a.getMinutes(),2))).replace("%S",""+c(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[a.getMonth()]))).replace("%b",""+e.translate(l[a.getMonth()]))).replace("%A",""+e.translate(o[a.getDay()]))).replace("%a",""+e.translate(i[a.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)){const a=d(e,t);let n;n=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d");const r=e.dom.getParent(e.selection.getStart(),"time");r?((e,t,a,n)=>{const r=e.dom.create("time",{datetime:a},n);e.dom.replace(r,t),e.selection.select(r,!0),e.selection.collapse(!1)})(e,r,n,a):e.insertContent('<time datetime="'+n+'">'+a+"</time>")}else e.insertContent(d(e,t))};var p=tinymce.util.Tools.resolve("tinymce.util.Tools");const g=e=>t=>{const a=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",a),a(),()=>{e.off("NodeChange",a)}};e.add("insertdatetime",(e=>{(e=>{const t=e.options.register;t("insertdatetime_dateformat",{processor:"string",default:e.translate("%Y-%m-%d")}),t("insertdatetime_timeformat",{processor:"string",default:e.translate("%H:%M:%S")}),t("insertdatetime_formats",{processor:"string[]",default:["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"]}),t("insertdatetime_element",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mceInsertDate",((t,n)=>{u(e,null!=n?n:a(e))})),e.addCommand("mceInsertTime",((t,a)=>{u(e,null!=a?a:n(e))}))})(e),(e=>{const t=r(e),a=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=r(e);return t.length>0?t[0]:n(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:e=>e===a.get(),fetch:a=>{a(p.map(t,(t=>({type:"choiceitem",text:d(e,t),value:t}))))},onAction:e=>{s(a.get())},onItemAction:(e,t)=>{a.set(t),s(t)},onSetup:g(e)});const i=e=>()=>{a.set(e),s(e)};e.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:()=>p.map(t,(t=>({type:"menuitem",text:d(e,t),onAction:i(t)}))),onSetup:g(e)})})(e)}))}();
|
||||
36
vendor/tinymce/tinymce/plugins/link/plugin.js
vendored
36
vendor/tinymce/tinymce/plugins/link/plugin.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -1043,8 +1043,18 @@
|
||||
editor.on('NodeChange', toggler);
|
||||
return () => editor.off('NodeChange', toggler);
|
||||
};
|
||||
const toggleActiveState = editor => api => {
|
||||
const updateState = () => api.setActive(!editor.mode.isReadOnly() && isInAnchor(editor, editor.selection.getNode()));
|
||||
const toggleLinkState = editor => api => {
|
||||
const updateState = () => {
|
||||
api.setActive(!editor.mode.isReadOnly() && isInAnchor(editor, editor.selection.getNode()));
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
updateState();
|
||||
return toggleState(editor, updateState);
|
||||
};
|
||||
const toggleLinkMenuState = editor => api => {
|
||||
const updateState = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
updateState();
|
||||
return toggleState(editor, updateState);
|
||||
};
|
||||
@@ -1052,7 +1062,7 @@
|
||||
const links = editor.selection.isCollapsed() ? getLinks$1(editor.dom.getParents(editor.selection.getStart())) : getLinksInSelection(editor.selection.getRng());
|
||||
return links.length === 1;
|
||||
};
|
||||
const toggleEnabledState = editor => api => {
|
||||
const toggleGotoLinkState = editor => api => {
|
||||
const updateState = () => api.setEnabled(hasExactlyOneLinkInSelection(editor));
|
||||
updateState();
|
||||
return toggleState(editor, updateState);
|
||||
@@ -1060,8 +1070,11 @@
|
||||
const toggleUnlinkState = editor => api => {
|
||||
const hasLinks$1 = parents => hasLinks(parents) || hasLinksInSelection(editor.selection.getRng());
|
||||
const parents = editor.dom.getParents(editor.selection.getStart());
|
||||
api.setEnabled(hasLinks$1(parents));
|
||||
return toggleState(editor, e => api.setEnabled(hasLinks$1(e.parents)));
|
||||
const updateEnabled = parents => {
|
||||
api.setEnabled(hasLinks$1(parents) && editor.selection.isEditable());
|
||||
};
|
||||
updateEnabled(parents);
|
||||
return toggleState(editor, e => updateEnabled(e.parents));
|
||||
};
|
||||
|
||||
const setup = editor => {
|
||||
@@ -1075,13 +1088,13 @@
|
||||
icon: 'link',
|
||||
tooltip: 'Insert/edit link',
|
||||
onAction: openDialog(editor),
|
||||
onSetup: toggleActiveState(editor)
|
||||
onSetup: toggleLinkState(editor)
|
||||
});
|
||||
editor.ui.registry.addButton('openlink', {
|
||||
icon: 'new-tab',
|
||||
tooltip: 'Open link',
|
||||
onAction: gotoSelectedLink(editor),
|
||||
onSetup: toggleEnabledState(editor)
|
||||
onSetup: toggleGotoLinkState(editor)
|
||||
});
|
||||
editor.ui.registry.addButton('unlink', {
|
||||
icon: 'unlink',
|
||||
@@ -1095,12 +1108,13 @@
|
||||
text: 'Open link',
|
||||
icon: 'new-tab',
|
||||
onAction: gotoSelectedLink(editor),
|
||||
onSetup: toggleEnabledState(editor)
|
||||
onSetup: toggleGotoLinkState(editor)
|
||||
});
|
||||
editor.ui.registry.addMenuItem('link', {
|
||||
icon: 'link',
|
||||
text: 'Link...',
|
||||
shortcut: 'Meta+K',
|
||||
onSetup: toggleLinkMenuState(editor),
|
||||
onAction: openDialog(editor)
|
||||
});
|
||||
editor.ui.registry.addMenuItem('unlink', {
|
||||
@@ -1147,7 +1161,7 @@
|
||||
type: 'contextformtogglebutton',
|
||||
icon: 'link',
|
||||
tooltip: 'Link',
|
||||
onSetup: toggleActiveState(editor)
|
||||
onSetup: toggleLinkState(editor)
|
||||
},
|
||||
label: 'Link',
|
||||
predicate: node => hasContextToolbar(editor) && isInAnchor(editor, node),
|
||||
@@ -1164,7 +1178,7 @@
|
||||
onSetup: buttonApi => {
|
||||
const node = editor.selection.getNode();
|
||||
buttonApi.setActive(isInAnchor(editor, node));
|
||||
return toggleActiveState(editor)(buttonApi);
|
||||
return toggleLinkState(editor)(buttonApi);
|
||||
},
|
||||
onAction: formApi => {
|
||||
const value = formApi.getValue();
|
||||
|
||||
File diff suppressed because one or more lines are too long
79
vendor/tinymce/tinymce/plugins/lists/plugin.js
vendored
79
vendor/tinymce/tinymce/plugins/lists/plugin.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -48,6 +48,12 @@
|
||||
const tripleEquals = (a, b) => {
|
||||
return a === b;
|
||||
};
|
||||
function curry(fn, ...initialArgs) {
|
||||
return (...restArgs) => {
|
||||
const all = initialArgs.concat(restArgs);
|
||||
return fn.apply(null, all);
|
||||
};
|
||||
}
|
||||
const not = f => t => !f(t);
|
||||
const never = constant(false);
|
||||
|
||||
@@ -359,7 +365,7 @@
|
||||
const firstChild = element => child(element, 0);
|
||||
const lastChild = element => child(element, element.dom.childNodes.length - 1);
|
||||
|
||||
const ancestor = (scope, predicate, isRoot) => {
|
||||
const ancestor$2 = (scope, predicate, isRoot) => {
|
||||
let element = scope.dom;
|
||||
const stop = isFunction(isRoot) ? isRoot : never;
|
||||
while (element.parentNode) {
|
||||
@@ -375,7 +381,7 @@
|
||||
};
|
||||
const closest = (scope, predicate, isRoot) => {
|
||||
const is = (s, test) => test(s);
|
||||
return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot);
|
||||
return ClosestOrAncestor(is, ancestor$2, scope, predicate, isRoot);
|
||||
};
|
||||
|
||||
const before$1 = (marker, element) => {
|
||||
@@ -745,7 +751,6 @@
|
||||
const parentList = editor.dom.getParent(element, 'ol,ul,dl');
|
||||
return isWithinNonEditable(editor, parentList);
|
||||
};
|
||||
const hasNonEditableBlocksSelected = editor => exists(editor.selection.getSelectedBlocks(), not(editor.dom.isEditable));
|
||||
const setNodeChangeHandler = (editor, nodeChangeHandler) => {
|
||||
const initialNode = editor.selection.getNode();
|
||||
nodeChangeHandler({
|
||||
@@ -1029,6 +1034,10 @@
|
||||
const zeroWidth = '\uFEFF';
|
||||
const isZwsp = char => char === zeroWidth;
|
||||
|
||||
const ancestor$1 = (scope, predicate, isRoot) => ancestor$2(scope, predicate, isRoot).isSome();
|
||||
|
||||
const ancestor = (element, target) => ancestor$1(element, curry(eq, target));
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager');
|
||||
|
||||
const DOM$1 = global$3.DOM;
|
||||
@@ -1148,9 +1157,15 @@
|
||||
if (!start && isBr(container.nextSibling)) {
|
||||
container = container.nextSibling;
|
||||
}
|
||||
const findBlockAncestor = node => {
|
||||
while (!editor.dom.isBlock(node) && node.parentNode && root !== node) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
return node;
|
||||
};
|
||||
const findBetterContainer = (container, forward) => {
|
||||
var _a;
|
||||
const walker = new global$5(container, root);
|
||||
const walker = new global$5(container, findBlockAncestor(container));
|
||||
const dir = forward ? 'next' : 'prev';
|
||||
let node;
|
||||
while (node = walker[dir]()) {
|
||||
@@ -1245,10 +1260,19 @@
|
||||
detailStyle = detailStyle === null ? '' : detailStyle;
|
||||
return sibStyle === detailStyle;
|
||||
};
|
||||
const getRootSearchStart = (editor, range) => {
|
||||
const start = editor.selection.getStart(true);
|
||||
const startPoint = getEndPointNode(editor, range, true, editor.getBody());
|
||||
if (ancestor(SugarElement.fromDom(startPoint), SugarElement.fromDom(range.commonAncestorContainer))) {
|
||||
return range.commonAncestorContainer;
|
||||
} else {
|
||||
return start;
|
||||
}
|
||||
};
|
||||
const applyList = (editor, listName, detail) => {
|
||||
const rng = editor.selection.getRng();
|
||||
let listItemName = 'LI';
|
||||
const root = getClosestListHost(editor, editor.selection.getStart(true));
|
||||
const root = getClosestListHost(editor, getRootSearchStart(editor, rng));
|
||||
const dom = editor.dom;
|
||||
if (dom.getContentEditable(editor.selection.getNode()) === 'false') {
|
||||
return;
|
||||
@@ -1258,7 +1282,7 @@
|
||||
listItemName = 'DT';
|
||||
}
|
||||
const bookmark = createBookmark(rng);
|
||||
const selectedTextBlocks = getSelectedTextBlocks(editor, rng, root);
|
||||
const selectedTextBlocks = filter$1(getSelectedTextBlocks(editor, rng, root), editor.dom.isEditable);
|
||||
global$2.each(selectedTextBlocks, block => {
|
||||
let listBlock;
|
||||
const sibling = block.previousSibling;
|
||||
@@ -1335,9 +1359,27 @@
|
||||
fireListEvent(editor, listToggleActionFromListName(listName), list);
|
||||
}
|
||||
};
|
||||
const updateCustomList = (editor, list, listName, detail) => {
|
||||
list.classList.forEach((cls, _, classList) => {
|
||||
if (cls.startsWith('tox-')) {
|
||||
classList.remove(cls);
|
||||
if (classList.length === 0) {
|
||||
list.removeAttribute('class');
|
||||
}
|
||||
}
|
||||
});
|
||||
if (list.nodeName !== listName) {
|
||||
const newList = editor.dom.rename(list, listName);
|
||||
updateListWithDetails(editor.dom, newList, detail);
|
||||
fireListEvent(editor, listToggleActionFromListName(listName), newList);
|
||||
} else {
|
||||
updateListWithDetails(editor.dom, list, detail);
|
||||
fireListEvent(editor, listToggleActionFromListName(listName), list);
|
||||
}
|
||||
};
|
||||
const toggleMultipleLists = (editor, parentList, lists, listName, detail) => {
|
||||
const parentIsList = isListNode(parentList);
|
||||
if (parentIsList && parentList.nodeName === listName && !hasListStyleDetail(detail)) {
|
||||
if (parentIsList && parentList.nodeName === listName && !hasListStyleDetail(detail) && !isCustomList(parentList)) {
|
||||
flattenListSelection(editor);
|
||||
} else {
|
||||
applyList(editor, listName, detail);
|
||||
@@ -1346,8 +1388,9 @@
|
||||
parentList,
|
||||
...lists
|
||||
] : lists;
|
||||
const updateFunction = parentIsList && isCustomList(parentList) ? updateCustomList : updateList$1;
|
||||
global$2.each(allLists, elm => {
|
||||
updateList$1(editor, elm, listName, detail);
|
||||
updateFunction(editor, elm, listName, detail);
|
||||
});
|
||||
editor.selection.setRng(resolveBookmark(bookmark));
|
||||
}
|
||||
@@ -1364,6 +1407,16 @@
|
||||
flattenListSelection(editor);
|
||||
} else {
|
||||
const bookmark = createBookmark(editor.selection.getRng());
|
||||
if (isCustomList(parentList)) {
|
||||
parentList.classList.forEach((cls, _, classList) => {
|
||||
if (cls.startsWith('tox-')) {
|
||||
classList.remove(cls);
|
||||
if (classList.length === 0) {
|
||||
parentList.removeAttribute('class');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
updateListWithDetails(editor.dom, parentList, detail);
|
||||
const newList = editor.dom.rename(parentList, listName);
|
||||
mergeWithAdjacentLists(editor.dom, newList);
|
||||
@@ -1378,7 +1431,7 @@
|
||||
};
|
||||
const toggleList = (editor, listName, _detail) => {
|
||||
const parentList = getParentList(editor);
|
||||
if (isWithinNonEditableList(editor, parentList) || hasNonEditableBlocksSelected(editor)) {
|
||||
if (isWithinNonEditableList(editor, parentList)) {
|
||||
return;
|
||||
}
|
||||
const selectedSubLists = getSelectedSubLists(editor);
|
||||
@@ -1586,8 +1639,9 @@
|
||||
return false;
|
||||
}
|
||||
editor.undoManager.transact(() => {
|
||||
const parentNode = otherLi.parentNode;
|
||||
removeBlock(dom, block, root);
|
||||
mergeWithAdjacentLists(dom, otherLi.parentNode);
|
||||
mergeWithAdjacentLists(dom, parentNode);
|
||||
editor.selection.select(otherLi, true);
|
||||
editor.selection.collapse(isForward);
|
||||
});
|
||||
@@ -1883,8 +1937,9 @@
|
||||
const setupToggleButtonHandler = (editor, listName) => api => {
|
||||
const toggleButtonHandler = e => {
|
||||
api.setActive(inList(e.parents, listName));
|
||||
api.setEnabled(!isWithinNonEditableList(editor, e.element));
|
||||
api.setEnabled(!isWithinNonEditableList(editor, e.element) && editor.selection.isEditable());
|
||||
};
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
return setNodeChangeHandler(editor, toggleButtonHandler);
|
||||
};
|
||||
const register$1 = editor => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
98
vendor/tinymce/tinymce/plugins/media/plugin.js
vendored
98
vendor/tinymce/tinymce/plugins/media/plugin.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -255,12 +255,6 @@
|
||||
}
|
||||
data = global$5.extend(node.attributes.map, data);
|
||||
}
|
||||
if (name === 'script') {
|
||||
data = {
|
||||
type: 'script',
|
||||
source: node.attr('src')
|
||||
};
|
||||
}
|
||||
if (name === 'source') {
|
||||
if (!data.source) {
|
||||
data.source = node.attr('src');
|
||||
@@ -425,6 +419,22 @@
|
||||
url: 'www.youtube.com/embed/$1',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
regex: /vimeo\.com\/([0-9]+)\?h=(\w+)/,
|
||||
type: 'iframe',
|
||||
w: 425,
|
||||
h: 350,
|
||||
url: 'player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
regex: /vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,
|
||||
type: 'iframe',
|
||||
w: 425,
|
||||
h: 350,
|
||||
url: 'player.vimeo.com/video/$2?h=$3&title=0&byline=0',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
regex: /vimeo\.com\/([0-9]+)/,
|
||||
type: 'iframe',
|
||||
@@ -524,9 +534,6 @@
|
||||
return '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source + '"' + (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' + (data.altsource ? '<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</video>';
|
||||
}
|
||||
};
|
||||
const getScriptHtml = data => {
|
||||
return '<script src="' + data.source + '"></script>';
|
||||
};
|
||||
const dataToHtml = (editor, dataIn) => {
|
||||
var _a;
|
||||
const data = global$5.extend({}, dataIn);
|
||||
@@ -572,8 +579,6 @@
|
||||
return getFlashHtml(data);
|
||||
} else if (data.sourcemime.indexOf('audio') !== -1) {
|
||||
return getAudioHtml(data, audioTemplateCallback);
|
||||
} else if (data.type === 'script') {
|
||||
return getScriptHtml(data);
|
||||
} else {
|
||||
return getVideoHtml(data, videoTemplateCallback);
|
||||
}
|
||||
@@ -590,12 +595,6 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
editor.on('ObjectSelected', e => {
|
||||
const objectType = e.target.getAttribute('data-mce-object');
|
||||
if (objectType === 'script') {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
editor.on('ObjectResized', e => {
|
||||
const target = e.target;
|
||||
if (target.getAttribute('data-mce-object')) {
|
||||
@@ -702,9 +701,23 @@
|
||||
const getEditorData = editor => {
|
||||
const element = editor.selection.getNode();
|
||||
const snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';
|
||||
const data = htmlToData(snippet, editor.schema);
|
||||
const getDimensionsOfElement = () => {
|
||||
if (isEmbedIframe(data.source, data.type)) {
|
||||
const rect = editor.dom.getRect(element);
|
||||
return {
|
||||
width: rect.w.toString().replace(/px$/, ''),
|
||||
height: rect.h.toString().replace(/px$/, '')
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
const dimensions = getDimensionsOfElement();
|
||||
return {
|
||||
embed: snippet,
|
||||
...htmlToData(snippet, editor.schema)
|
||||
...data,
|
||||
...dimensions
|
||||
};
|
||||
};
|
||||
const addEmbedHtml = (api, editor) => response => {
|
||||
@@ -736,9 +749,17 @@
|
||||
selectPlaceholder(editor, beforeObjects);
|
||||
editor.nodeChanged();
|
||||
};
|
||||
const isEmbedIframe = (url, mediaDataType) => isNonNullable(mediaDataType) && mediaDataType === 'ephox-embed-iri' && isNonNullable(matchPattern(url));
|
||||
const shouldInsertAsNewIframe = (prevData, newData) => {
|
||||
const hasDimensionsChanged = (prevData, newData) => prevData.width !== newData.width || prevData.height !== newData.height;
|
||||
return hasDimensionsChanged(prevData, newData) && isEmbedIframe(newData.source, prevData.type);
|
||||
};
|
||||
const submitForm = (prevData, newData, editor) => {
|
||||
var _a;
|
||||
newData.embed = updateHtml((_a = newData.embed) !== null && _a !== void 0 ? _a : '', newData, false, editor.schema);
|
||||
newData.embed = shouldInsertAsNewIframe(prevData, newData) && hasDimensions(editor) ? dataToHtml(editor, {
|
||||
...newData,
|
||||
embed: ''
|
||||
}) : updateHtml((_a = newData.embed) !== null && _a !== void 0 ? _a : '', newData, false, editor.schema);
|
||||
if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) {
|
||||
handleInsert(editor, newData.embed);
|
||||
} else {
|
||||
@@ -767,8 +788,12 @@
|
||||
const dataFromEmbed = htmlToData((_a = data.embed) !== null && _a !== void 0 ? _a : '', editor.schema);
|
||||
api.setData(wrap(dataFromEmbed));
|
||||
};
|
||||
const handleUpdate = (api, sourceInput) => {
|
||||
const data = unwrap(api.getData(), sourceInput);
|
||||
const handleUpdate = (api, sourceInput, prevData) => {
|
||||
const dialogData = unwrap(api.getData(), sourceInput);
|
||||
const data = shouldInsertAsNewIframe(prevData, dialogData) && hasDimensions(editor) ? {
|
||||
...dialogData,
|
||||
embed: ''
|
||||
} : dialogData;
|
||||
const embed = dataToHtml(editor, data);
|
||||
api.setData(wrap({
|
||||
...data,
|
||||
@@ -870,7 +895,7 @@
|
||||
case 'dimensions':
|
||||
case 'altsource':
|
||||
case 'poster':
|
||||
handleUpdate(api, detail.name);
|
||||
handleUpdate(api, detail.name, currentData.get());
|
||||
break;
|
||||
}
|
||||
currentData.set(unwrap(api.getData()));
|
||||
@@ -1076,7 +1101,7 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
parser.addNodeFilter('iframe,video,audio,object,embed,script', placeHolderConverter(editor));
|
||||
parser.addNodeFilter('iframe,video,audio,object,embed', placeHolderConverter(editor));
|
||||
serializer.addAttributeFilter('data-mce-object', (nodes, name) => {
|
||||
var _a;
|
||||
let i = nodes.length;
|
||||
@@ -1087,7 +1112,7 @@
|
||||
}
|
||||
const realElmName = node.attr(name);
|
||||
const realElm = new global$2(realElmName, 1);
|
||||
if (realElmName !== 'audio' && realElmName !== 'script') {
|
||||
if (realElmName !== 'audio') {
|
||||
const className = node.attr('class');
|
||||
if (className && className.indexOf('mce-preview-object') !== -1 && node.firstChild) {
|
||||
realElm.attr({
|
||||
@@ -1110,9 +1135,6 @@
|
||||
realElm.attr(attrName.substr(11), attribs[ai].value);
|
||||
}
|
||||
}
|
||||
if (realElmName === 'script') {
|
||||
realElm.attr('type', 'text/javascript');
|
||||
}
|
||||
const innerHtml = node.attr('data-mce-html');
|
||||
if (innerHtml) {
|
||||
const fragment = parseAndSanitize(editor, realElmName, unescape(innerHtml));
|
||||
@@ -1141,6 +1163,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const onAction = () => editor.execCommand('mceMedia');
|
||||
editor.ui.registry.addToggleButton('media', {
|
||||
@@ -1150,13 +1182,19 @@
|
||||
onSetup: buttonApi => {
|
||||
const selection = editor.selection;
|
||||
buttonApi.setActive(isMediaElement(selection.getNode()));
|
||||
return selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind;
|
||||
const unbindSelectorChanged = selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind;
|
||||
const unbindEditable = onSetupEditable(editor)(buttonApi);
|
||||
return () => {
|
||||
unbindSelectorChanged();
|
||||
unbindEditable();
|
||||
};
|
||||
}
|
||||
});
|
||||
editor.ui.registry.addMenuItem('media', {
|
||||
icon: 'embed',
|
||||
text: 'Media...',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -83,17 +83,29 @@
|
||||
}
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const onAction = () => editor.execCommand('mceNonBreaking');
|
||||
editor.ui.registry.addButton('nonbreaking', {
|
||||
icon: 'non-breaking',
|
||||
tooltip: 'Nonbreaking space',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
editor.ui.registry.addMenuItem('nonbreaking', {
|
||||
icon: 'non-breaking',
|
||||
text: 'Nonbreaking space',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=n=>e=>typeof e===n,a=e("boolean"),o=e("number"),t=n=>e=>e.options.get(n),i=t("nonbreaking_force_tab"),r=t("nonbreaking_wrap"),s=(n,e)=>{let a="";for(let o=0;o<e;o++)a+=n;return a},c=(n,e)=>{const a=r(n)||n.plugins.visualchars?`<span class="${(n=>!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled())(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap"}" contenteditable="false">${s(" ",e)}</span>`:s(" ",e);n.undoManager.transact((()=>n.insertContent(a)))};var l=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",(n=>{(n=>{const e=n.options.register;e("nonbreaking_force_tab",{processor:n=>a(n)?{value:n?3:0,valid:!0}:o(n)?{value:n,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),e("nonbreaking_wrap",{processor:"boolean",default:!0})})(n),(n=>{n.addCommand("mceNonBreaking",(()=>{c(n,1)}))})(n),(n=>{const e=()=>n.execCommand("mceNonBreaking");n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:e}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:e})})(n),(n=>{const e=i(n);e>0&&n.on("keydown",(a=>{if(a.keyCode===l.TAB&&!a.isDefaultPrevented()){if(a.shiftKey)return;a.preventDefault(),a.stopImmediatePropagation(),c(n,e)}}))})(n)}))}();
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=n=>e=>typeof e===n,o=e("boolean"),a=e("number"),t=n=>e=>e.options.get(n),i=t("nonbreaking_force_tab"),s=t("nonbreaking_wrap"),r=(n,e)=>{let o="";for(let a=0;a<e;a++)o+=n;return o},c=(n,e)=>{const o=s(n)||n.plugins.visualchars?`<span class="${(n=>!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled())(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap"}" contenteditable="false">${r(" ",e)}</span>`:r(" ",e);n.undoManager.transact((()=>n.insertContent(o)))};var l=tinymce.util.Tools.resolve("tinymce.util.VK");const u=n=>e=>{const o=()=>{e.setEnabled(n.selection.isEditable())};return n.on("NodeChange",o),o(),()=>{n.off("NodeChange",o)}};n.add("nonbreaking",(n=>{(n=>{const e=n.options.register;e("nonbreaking_force_tab",{processor:n=>o(n)?{value:n?3:0,valid:!0}:a(n)?{value:n,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),e("nonbreaking_wrap",{processor:"boolean",default:!0})})(n),(n=>{n.addCommand("mceNonBreaking",(()=>{c(n,1)}))})(n),(n=>{const e=()=>n.execCommand("mceNonBreaking");n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:e,onSetup:u(n)}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:e,onSetup:u(n)})})(n),(n=>{const e=i(n);e>0&&n.on("keydown",(o=>{if(o.keyCode===l.TAB&&!o.isDefaultPrevented()){if(o.shiftKey)return;o.preventDefault(),o.stopImmediatePropagation(),c(n,e)}}))})(n)}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -76,17 +76,29 @@
|
||||
});
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const onAction = () => editor.execCommand('mcePageBreak');
|
||||
editor.ui.registry.addButton('pagebreak', {
|
||||
icon: 'page-break',
|
||||
tooltip: 'Page break',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
editor.ui.registry.addMenuItem('pagebreak', {
|
||||
text: 'Page break',
|
||||
icon: 'page-break',
|
||||
onAction
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const t=e=>a=>a.options.get(e),r=t("pagebreak_separator"),n=t("pagebreak_split_block"),o="mce-pagebreak",s=e=>{const t=`<img src="${a.transparentSrc}" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />`;return e?`<p>${t}</p>`:t};e.add("pagebreak",(e=>{(e=>{const a=e.options.register;a("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),a("pagebreak_split_block",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mcePageBreak",(()=>{e.insertContent(s(n(e)))}))})(e),(e=>{const a=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:a}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:a})})(e),(e=>{const a=r(e),t=()=>n(e),c=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(e=>"\\"+e)),"gi");e.on("BeforeSetContent",(e=>{e.content=e.content.replace(c,s(t()))})),e.on("PreInit",(()=>{e.serializer.addNodeFilter("img",(r=>{let n,s,c=r.length;for(;c--;)if(n=r[c],s=n.attr("class"),s&&-1!==s.indexOf(o)){const r=n.parent;if(r&&e.schema.getBlockElements()[r.name]&&t()){r.type=3,r.value=a,r.raw=!0,n.remove();continue}n.type=3,n.value=a,n.raw=!0}}))}))})(e),(e=>{e.on("ResolveName",(a=>{"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,o)&&(a.name="pagebreak")}))})(e)}))}();
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const t=e=>a=>a.options.get(e),n=t("pagebreak_separator"),o=t("pagebreak_split_block"),r="mce-pagebreak",s=e=>{const t=`<img src="${a.transparentSrc}" class="${r}" data-mce-resize="false" data-mce-placeholder />`;return e?`<p>${t}</p>`:t},c=e=>a=>{const t=()=>{a.setEnabled(e.selection.isEditable())};return e.on("NodeChange",t),t(),()=>{e.off("NodeChange",t)}};e.add("pagebreak",(e=>{(e=>{const a=e.options.register;a("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),a("pagebreak_split_block",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mcePageBreak",(()=>{e.insertContent(s(o(e)))}))})(e),(e=>{const a=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:a,onSetup:c(e)}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:a,onSetup:c(e)})})(e),(e=>{const a=n(e),t=()=>o(e),c=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(e=>"\\"+e)),"gi");e.on("BeforeSetContent",(e=>{e.content=e.content.replace(c,s(t()))})),e.on("PreInit",(()=>{e.serializer.addNodeFilter("img",(n=>{let o,s,c=n.length;for(;c--;)if(o=n[c],s=o.attr("class"),s&&-1!==s.indexOf(r)){const n=o.parent;if(n&&e.schema.getBlockElements()[n.name]&&t()){n.type=3,n.value=a,n.raw=!0,o.remove();continue}o.type=3,o.value=a,o.raw=!0}}))}))})(e),(e=>{e.on("ResolveName",(a=>{"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,r)&&(a.name="pagebreak")}))})(e)}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>t=>t.options.get(e),i=n("content_style"),s=n("content_css_cors"),c=n("body_class"),r=n("body_id");e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{(e=>{const n=(e=>{var n;let l="";const a=e.dom.encode,d=null!==(n=i(e))&&void 0!==n?n:"";l+='<base href="'+a(e.documentBaseURI.getURI())+'">';const m=s(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{l+='<link type="text/css" rel="stylesheet" href="'+a(e.documentBaseURI.toAbsolute(t))+'"'+m+">"})),d&&(l+='<style type="text/css">'+d+"</style>");const y=r(e),u=c(e),v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(t.os.isMacOS()||t.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",p=e.getBody().dir,w=p?' dir="'+a(p)+'"':"";return"<!DOCTYPE html><html><head>"+l+'</head><body id="'+a(y)+'" class="mce-content-body '+a(u)+'"'+w+">"+e.getContent()+v+"</body></html>"})(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:n}}).focus("close")})(e)}))})(e),(e=>{const t=()=>e.execCommand("mcePreview");e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t})})(e)}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -286,7 +286,7 @@
|
||||
return r.toLowerCase();
|
||||
};
|
||||
|
||||
const has = (element, key) => {
|
||||
const has$1 = (element, key) => {
|
||||
const dom = element.dom;
|
||||
return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;
|
||||
};
|
||||
@@ -392,7 +392,7 @@
|
||||
const sugarNode = SugarElement.fromDom(node);
|
||||
const textBlockElementsMap = editor.schema.getTextBlockElements();
|
||||
const isRoot = elem => elem.dom === editor.getBody();
|
||||
return !has(sugarNode, 'data-mce-bogus') && closest(sugarNode, 'table,[data-mce-bogus="all"]', isRoot).fold(() => closest$1(sugarNode, elem => name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom), isRoot), never);
|
||||
return !has$1(sugarNode, 'data-mce-bogus') && closest(sugarNode, 'table,[data-mce-bogus="all"]', isRoot).fold(() => closest$1(sugarNode, elem => name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom), isRoot), never);
|
||||
},
|
||||
items: insertToolbarItems,
|
||||
position: 'line',
|
||||
@@ -401,9 +401,19 @@
|
||||
}
|
||||
};
|
||||
|
||||
const supports = element => element.dom.classList !== undefined;
|
||||
|
||||
const has = (element, clazz) => supports(element) && element.dom.classList.contains(clazz);
|
||||
|
||||
const addToEditor = editor => {
|
||||
const isEditable = node => editor.dom.getContentEditableParent(node) !== 'false';
|
||||
const isImage = node => node.nodeName === 'IMG' || node.nodeName === 'FIGURE' && /image/i.test(node.className);
|
||||
const isEditable = node => editor.dom.isEditable(node);
|
||||
const isInEditableContext = el => isEditable(el.parentElement);
|
||||
const isImage = node => {
|
||||
const isImageFigure = node.nodeName === 'FIGURE' && /image/i.test(node.className);
|
||||
const isImage = node.nodeName === 'IMG' || isImageFigure;
|
||||
const isPagebreak = has(SugarElement.fromDom(node), 'mce-pagebreak');
|
||||
return isImage && isInEditableContext(node) && !isPagebreak;
|
||||
};
|
||||
const imageToolbarItems = getImageToolbarItems(editor);
|
||||
if (imageToolbarItems.length > 0) {
|
||||
editor.ui.registry.addContextToolbar('imageselection', {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const n=("function",e=>"function"==typeof e);var o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t=tinymce.util.Tools.resolve("tinymce.util.Tools");const a=e=>n=>n.options.get(e),c=a("save_enablewhendirty"),i=a("save_onsavecallback"),s=a("save_oncancelcallback"),r=(e,n)=>{e.notificationManager.open({text:n,type:"error"})},l=e=>n=>{const o=()=>{n.setEnabled(!c(e)||e.isDirty())};return o(),e.on("NodeChange dirty",o),()=>e.off("NodeChange dirty",o)};e.add("save",(e=>{(e=>{const n=e.options.register;n("save_enablewhendirty",{processor:"boolean",default:!0}),n("save_onsavecallback",{processor:"function"}),n("save_oncancelcallback",{processor:"function"})})(e),(e=>{e.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>e.execCommand("mceSave"),onSetup:l(e)}),e.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>e.execCommand("mceCancel"),onSetup:l(e)}),e.addShortcut("Meta+S","","mceSave")})(e),(e=>{e.addCommand("mceSave",(()=>{(e=>{const t=o.DOM.getParent(e.id,"form");if(c(e)&&!e.isDirty())return;e.save();const a=i(e);if(n(a))return a.call(e,e),void e.nodeChanged();t?(e.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():r(e,"Error: Form submit field collision.")),e.nodeChanged()):r(e,"Error: No form element found.")})(e)})),e.addCommand("mceCancel",(()=>{(e=>{const o=t.trim(e.startContent),a=s(e);n(a)?a.call(e,e):e.resetContent(o)})(e)}))})(e)}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -59,7 +59,7 @@
|
||||
};
|
||||
const always = constant(true);
|
||||
|
||||
const punctuationStr = '[!-#%-*,-\\/:;?@\\[-\\]_{}\xA1\xAB\xB7\xBB\xBF;\xB7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uff3f\uFF5B\uFF5D\uFF5F-\uFF65]';
|
||||
const punctuationStr = `[~\u2116|!-*+-\\/:;?@\\[-\`{}\u00A1\u00AB\u00B7\u00BB\u00BF;\u00B7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]`;
|
||||
|
||||
const punctuation$1 = constant(punctuationStr);
|
||||
|
||||
@@ -854,8 +854,8 @@
|
||||
const toggle = name => api.setEnabled(name, !disable);
|
||||
each(buttons, toggle);
|
||||
};
|
||||
const notFoundAlert = api => {
|
||||
api.redial(getDialogSpec(true, api.getData()));
|
||||
const toggleNotFoundAlert = (isVisible, api) => {
|
||||
api.redial(getDialogSpec(isVisible, api.getData()));
|
||||
};
|
||||
const focusButtonIfRequired = (api, name) => {
|
||||
if (global$2.browser.isSafari() && global$2.deviceType.isTouch() && (name === 'find' || name === 'replace' || name === 'replaceall')) {
|
||||
@@ -879,7 +879,7 @@
|
||||
} else {
|
||||
const count = find(editor, currentSearchState, data.findtext, data.matchcase, data.wholewords, data.inselection);
|
||||
if (count <= 0) {
|
||||
notFoundAlert(api);
|
||||
toggleNotFoundAlert(true, api);
|
||||
}
|
||||
disableAll(api, count === 0);
|
||||
}
|
||||
@@ -994,7 +994,7 @@
|
||||
initialData,
|
||||
onChange: (api, details) => {
|
||||
if (showNoMatchesAlertBanner) {
|
||||
api.redial(getDialogSpec(false, api.getData()));
|
||||
toggleNotFoundAlert(false, api);
|
||||
}
|
||||
if (details.name === 'findtext' && currentSearchState.get().count > 0) {
|
||||
reset(api);
|
||||
@@ -1028,6 +1028,7 @@
|
||||
case 'matchcase':
|
||||
case 'wholewords':
|
||||
case 'inselection':
|
||||
toggleNotFoundAlert(false, api);
|
||||
updateSearchState(api);
|
||||
reset(api);
|
||||
break;
|
||||
|
||||
File diff suppressed because one or more lines are too long
92
vendor/tinymce/tinymce/plugins/table/plugin.js
vendored
92
vendor/tinymce/tinymce/plugins/table/plugin.js
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -199,6 +199,14 @@
|
||||
};
|
||||
const has = (obj, key) => hasOwnProperty.call(obj, key);
|
||||
const hasNonNullableKey = (obj, key) => has(obj, key) && obj[key] !== undefined && obj[key] !== null;
|
||||
const isEmpty$1 = r => {
|
||||
for (const x in r) {
|
||||
if (hasOwnProperty.call(r, x)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const nativeIndexOf = Array.prototype.indexOf;
|
||||
const nativePush = Array.prototype.push;
|
||||
@@ -2566,20 +2574,22 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
const applyDataToElement = (editor, tableElm, data) => {
|
||||
const applyDataToElement = (editor, tableElm, data, shouldApplyOnCell) => {
|
||||
const dom = editor.dom;
|
||||
const attrs = {};
|
||||
const styles = {};
|
||||
const shouldStyleWithCss$1 = shouldStyleWithCss(editor);
|
||||
const hasAdvancedTableTab$1 = hasAdvancedTableTab(editor);
|
||||
if (!isUndefined(data.class)) {
|
||||
attrs.class = data.class;
|
||||
}
|
||||
styles.height = addPxSuffix(data.height);
|
||||
if (shouldStyleWithCss(editor)) {
|
||||
if (shouldStyleWithCss$1) {
|
||||
styles.width = addPxSuffix(data.width);
|
||||
} else if (dom.getAttrib(tableElm, 'width')) {
|
||||
attrs.width = removePxSuffix(data.width);
|
||||
}
|
||||
if (shouldStyleWithCss(editor)) {
|
||||
if (shouldStyleWithCss$1) {
|
||||
styles['border-width'] = addPxSuffix(data.border);
|
||||
styles['border-spacing'] = addPxSuffix(data.cellspacing);
|
||||
} else {
|
||||
@@ -2587,24 +2597,30 @@
|
||||
attrs.cellpadding = data.cellpadding;
|
||||
attrs.cellspacing = data.cellspacing;
|
||||
}
|
||||
if (shouldStyleWithCss(editor) && tableElm.children) {
|
||||
for (let i = 0; i < tableElm.children.length; i++) {
|
||||
styleTDTH(dom, tableElm.children[i], {
|
||||
'border-width': addPxSuffix(data.border),
|
||||
'padding': addPxSuffix(data.cellpadding)
|
||||
});
|
||||
if (hasAdvancedTableTab(editor)) {
|
||||
styleTDTH(dom, tableElm.children[i], { 'border-color': data.bordercolor });
|
||||
if (shouldStyleWithCss$1 && tableElm.children) {
|
||||
const cellStyles = {};
|
||||
if (shouldApplyOnCell.border) {
|
||||
cellStyles['border-width'] = addPxSuffix(data.border);
|
||||
}
|
||||
if (shouldApplyOnCell.cellpadding) {
|
||||
cellStyles.padding = addPxSuffix(data.cellpadding);
|
||||
}
|
||||
if (hasAdvancedTableTab$1 && shouldApplyOnCell.bordercolor) {
|
||||
cellStyles['border-color'] = data.bordercolor;
|
||||
}
|
||||
if (!isEmpty$1(cellStyles)) {
|
||||
for (let i = 0; i < tableElm.children.length; i++) {
|
||||
styleTDTH(dom, tableElm.children[i], cellStyles);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasAdvancedTableTab(editor)) {
|
||||
if (hasAdvancedTableTab$1) {
|
||||
const advData = data;
|
||||
styles['background-color'] = advData.backgroundcolor;
|
||||
styles['border-color'] = advData.bordercolor;
|
||||
styles['border-style'] = advData.borderstyle;
|
||||
}
|
||||
attrs.style = dom.serializeStyle({
|
||||
dom.setStyles(tableElm, {
|
||||
...getDefaultStyles(editor),
|
||||
...styles
|
||||
});
|
||||
@@ -2632,7 +2648,12 @@
|
||||
tableElm = getSelectionCell(getSelectionStart(editor), getIsRoot(editor)).bind(cell => table(cell, getIsRoot(editor))).map(table => table.dom).getOrDie();
|
||||
}
|
||||
if (size(modifiedData) > 0) {
|
||||
applyDataToElement(editor, tableElm, data);
|
||||
const applicableCellProperties = {
|
||||
border: has(modifiedData, 'border'),
|
||||
bordercolor: has(modifiedData, 'bordercolor'),
|
||||
cellpadding: has(modifiedData, 'cellpadding')
|
||||
};
|
||||
applyDataToElement(editor, tableElm, data, applicableCellProperties);
|
||||
const captionElm = dom.select('caption', tableElm)[0];
|
||||
if (captionElm && !data.caption || !captionElm && data.caption) {
|
||||
editor.execCommand('mceTableToggleCaption');
|
||||
@@ -2830,13 +2851,13 @@
|
||||
const onSetup = (api, isDisabled) => setupHandler(() => targets.get().fold(() => {
|
||||
api.setEnabled(false);
|
||||
}, targets => {
|
||||
api.setEnabled(!isDisabled(targets));
|
||||
api.setEnabled(!isDisabled(targets) && editor.selection.isEditable());
|
||||
}));
|
||||
const onSetupWithToggle = (api, isDisabled, isActive) => setupHandler(() => targets.get().fold(() => {
|
||||
api.setEnabled(false);
|
||||
api.setActive(false);
|
||||
}, targets => {
|
||||
api.setEnabled(!isDisabled(targets));
|
||||
api.setEnabled(!isDisabled(targets) && editor.selection.isEditable());
|
||||
api.setActive(isActive(targets));
|
||||
}));
|
||||
const isDisabledFromLocked = lockedDisable => selectionDetails.exists(details => details.locked[lockedDisable]);
|
||||
@@ -2888,10 +2909,21 @@
|
||||
const getRows = () => getData(tableTypeRow);
|
||||
const getColumns = () => getData(tableTypeColumn);
|
||||
|
||||
const onSetupEditable$1 = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const addButtons = (editor, selectionTargets) => {
|
||||
editor.ui.registry.addMenuButton('table', {
|
||||
tooltip: 'Table',
|
||||
icon: 'table',
|
||||
onSetup: onSetupEditable$1(editor),
|
||||
fetch: callback => callback('inserttable | cell row column | advtablesort | tableprops deletetable')
|
||||
});
|
||||
const cmd = command => () => editor.execCommand(command);
|
||||
@@ -3034,7 +3066,8 @@
|
||||
addButtonIfRegistered('tableinsertdialog', {
|
||||
tooltip: 'Insert table',
|
||||
command: 'mceInsertTableDialog',
|
||||
icon: 'table'
|
||||
icon: 'table',
|
||||
onSetup: onSetupEditable$1(editor)
|
||||
});
|
||||
const tableClassList = filterNoneItem(getTableClassList(editor));
|
||||
if (tableClassList.length !== 0 && editor.queryCommandSupported('mceTableToggleClass')) {
|
||||
@@ -3108,11 +3141,11 @@
|
||||
});
|
||||
};
|
||||
const addToolbars = editor => {
|
||||
const isTable = table => editor.dom.is(table, 'table') && editor.getBody().contains(table);
|
||||
const isEditableTable = table => editor.dom.is(table, 'table') && editor.getBody().contains(table) && editor.dom.isEditable(table.parentNode);
|
||||
const toolbar = getToolbar(editor);
|
||||
if (toolbar.length > 0) {
|
||||
editor.ui.registry.addContextToolbar('table', {
|
||||
predicate: isTable,
|
||||
predicate: isEditableTable,
|
||||
items: toolbar,
|
||||
scope: 'node',
|
||||
position: 'node'
|
||||
@@ -3120,6 +3153,16 @@
|
||||
}
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const addMenuItems = (editor, selectionTargets) => {
|
||||
const cmd = command => () => editor.execCommand(command);
|
||||
const addMenuIfRegistered = (name, spec) => {
|
||||
@@ -3265,7 +3308,8 @@
|
||||
editor.ui.registry.addMenuItem('inserttable', {
|
||||
text: 'Table',
|
||||
icon: 'table',
|
||||
onAction: cmd('mceInsertTableDialog')
|
||||
onAction: cmd('mceInsertTableDialog'),
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
} else {
|
||||
editor.ui.registry.addNestedMenuItem('inserttable', {
|
||||
@@ -3275,13 +3319,15 @@
|
||||
type: 'fancymenuitem',
|
||||
fancytype: 'inserttable',
|
||||
onAction: insertTableAction
|
||||
}]
|
||||
}],
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
}
|
||||
editor.ui.registry.addMenuItem('inserttabledialog', {
|
||||
text: 'Insert table',
|
||||
icon: 'table',
|
||||
onAction: cmd('mceInsertTableDialog')
|
||||
onAction: cmd('mceInsertTableDialog'),
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
addMenuIfRegistered('tableprops', {
|
||||
text: 'Table properties',
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -351,6 +351,7 @@
|
||||
|
||||
const getPreviewContent = (editor, html) => {
|
||||
var _a;
|
||||
let previewHtml = parseAndSerialize(editor, html);
|
||||
if (html.indexOf('<html>') === -1) {
|
||||
let contentCssEntries = '';
|
||||
const contentStyle = (_a = getContentStyle(editor)) !== null && _a !== void 0 ? _a : '';
|
||||
@@ -367,9 +368,9 @@
|
||||
const preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener("click", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === "A" && !(' + isMetaKeyPressed + ')) {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';
|
||||
const directionality = editor.getBody().dir;
|
||||
const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
|
||||
html = '<!DOCTYPE html>' + '<html>' + '<head>' + '<base href="' + encode(editor.documentBaseURI.getURI()) + '">' + contentCssEntries + preventClicksOnLinksScript + '</head>' + '<body class="' + encode(bodyClass) + '"' + dirAttr + '>' + parseAndSerialize(editor, html) + '</body>' + '</html>';
|
||||
previewHtml = '<!DOCTYPE html>' + '<html>' + '<head>' + '<base href="' + encode(editor.documentBaseURI.getURI()) + '">' + contentCssEntries + preventClicksOnLinksScript + '</head>' + '<body class="' + encode(bodyClass) + '"' + dirAttr + '>' + previewHtml + '</body>' + '</html>';
|
||||
}
|
||||
return replaceTemplateValues(html, getPreviewReplaceValues(editor));
|
||||
return replaceTemplateValues(previewHtml, getPreviewReplaceValues(editor));
|
||||
};
|
||||
const open = (editor, templateList) => {
|
||||
const createTemplates = () => {
|
||||
@@ -460,7 +461,7 @@
|
||||
const content = getPreviewContent(editor, previewHtml);
|
||||
const bodyItems = [
|
||||
{
|
||||
type: 'selectbox',
|
||||
type: 'listbox',
|
||||
name: 'template',
|
||||
label: 'Templates',
|
||||
items: selectBoxItems
|
||||
@@ -526,16 +527,28 @@
|
||||
});
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const onAction = () => editor.execCommand('mceTemplate');
|
||||
editor.ui.registry.addButton('template', {
|
||||
icon: 'template',
|
||||
tooltip: 'Insert template',
|
||||
onSetup: onSetupEditable(editor),
|
||||
onAction
|
||||
});
|
||||
editor.ui.registry.addMenuItem('template', {
|
||||
icon: 'template',
|
||||
text: 'Insert template...',
|
||||
onSetup: onSetupEditable(editor),
|
||||
onAction
|
||||
});
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const s=(t,s,o)=>{t.dom.toggleClass(t.getBody(),"mce-visualblocks"),o.set(!o.get()),((t,s)=>{t.dispatch("VisualBlocks",{state:s})})(t,o.get())},o=("visualblocks_default_state",t=>t.options.get("visualblocks_default_state"));const e=(t,s)=>o=>{o.setActive(s.get());const e=t=>o.setActive(t.state);return t.on("VisualBlocks",e),()=>t.off("VisualBlocks",e)};t.add("visualblocks",((t,l)=>{(t=>{(0,t.options.register)("visualblocks_default_state",{processor:"boolean",default:!1})})(t);const a=(t=>{let s=!1;return{get:()=>s,set:t=>{s=t}}})();((t,o,e)=>{t.addCommand("mceVisualBlocks",(()=>{s(t,0,e)}))})(t,0,a),((t,s)=>{const o=()=>t.execCommand("mceVisualBlocks");t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:o,onSetup:e(t,s)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:o,onSetup:e(t,s)})})(t,a),((t,e,l)=>{t.on("PreviewFormats AfterPreviewFormats",(s=>{l.get()&&t.dom.toggleClass(t.getBody(),"mce-visualblocks","afterpreviewformats"===s.type)})),t.on("init",(()=>{o(t)&&s(t,0,l)}))})(t,0,a)}))}();
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* TinyMCE version 6.4.2 (2023-04-26)
|
||||
* TinyMCE version 6.7.0 (2023-08-30)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
@@ -14,9 +14,6 @@
|
||||
return x;
|
||||
};
|
||||
|
||||
const zeroWidth = '\uFEFF';
|
||||
const removeZwsp$1 = s => s.replace(/\uFEFF/g, '');
|
||||
|
||||
const map = (xs, f) => {
|
||||
const len = xs.length;
|
||||
const r = new Array(len);
|
||||
@@ -27,7 +24,7 @@
|
||||
return r;
|
||||
};
|
||||
|
||||
const punctuationStr = '[!-#%-*,-\\/:;?@\\[-\\]_{}\xA1\xAB\xB7\xBB\xBF;\xB7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uff3f\uFF5B\uFF5D\uFF5F-\uFF65]';
|
||||
const punctuationStr = `[~\u2116|!-*+-\\/:;?@\\[-\`{}\u00A1\u00AB\u00B7\u00BB\u00BF;\u00B7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]`;
|
||||
const regExps = {
|
||||
aletter: '[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05F3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24B6-\u24E9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]',
|
||||
midnumlet: `[-'\\.\u2018\u2019\u2024\uFE52\uFF07\uFF0E]`,
|
||||
@@ -135,7 +132,7 @@
|
||||
if (type === characterIndices.NUMERIC && (nextType === characterIndices.MIDNUM || nextType === characterIndices.MIDNUMLET) && nextNextType === characterIndices.NUMERIC) {
|
||||
return false;
|
||||
}
|
||||
if (type === characterIndices.EXTEND || type === characterIndices.FORMAT || prevType === characterIndices.EXTEND || prevType === characterIndices.FORMAT || nextType === characterIndices.EXTEND || nextType === characterIndices.FORMAT) {
|
||||
if ((type === characterIndices.EXTEND || type === characterIndices.FORMAT) && (nextType === characterIndices.ALETTER || nextType === characterIndices.NUMERIC || nextType === characterIndices.KATAKANA || nextType === characterIndices.EXTEND || nextType === characterIndices.FORMAT) || (nextType === characterIndices.EXTEND || nextType === characterIndices.FORMAT && (nextNextType === characterIndices.ALETTER || nextNextType === characterIndices.NUMERIC || nextNextType === characterIndices.KATAKANA || nextNextType === characterIndices.EXTEND || nextNextType === characterIndices.FORMAT)) && (type === characterIndices.ALETTER || type === characterIndices.NUMERIC || type === characterIndices.KATAKANA || type === characterIndices.EXTEND || type === characterIndices.FORMAT)) {
|
||||
return false;
|
||||
}
|
||||
if (type === characterIndices.CR && nextType === characterIndices.LF) {
|
||||
@@ -180,8 +177,9 @@
|
||||
const peakedWord = characters.slice(startIndex + 1, endIndex).join(EMPTY_STRING);
|
||||
return peakedWord.substr(0, 3) === '://' ? endIndex : startIndex;
|
||||
};
|
||||
const findWords = (chars, sChars, characterMap, options) => {
|
||||
const findWordsWithIndices = (chars, sChars, characterMap, options) => {
|
||||
const words = [];
|
||||
const indices = [];
|
||||
let word = [];
|
||||
for (let i = 0; i < characterMap.length; ++i) {
|
||||
word.push(chars[i]);
|
||||
@@ -198,36 +196,38 @@
|
||||
i = endOfUrl;
|
||||
}
|
||||
words.push(word);
|
||||
indices.push({
|
||||
start: startOfWord,
|
||||
end: endOfWord
|
||||
});
|
||||
}
|
||||
word = [];
|
||||
}
|
||||
}
|
||||
return words;
|
||||
return {
|
||||
words,
|
||||
indices
|
||||
};
|
||||
};
|
||||
const getDefaultOptions = () => ({
|
||||
includeWhitespace: false,
|
||||
includePunctuation: false
|
||||
});
|
||||
const getWords$1 = (chars, extract, options) => {
|
||||
const getWordsWithIndices = (chars, extract, options) => {
|
||||
options = {
|
||||
...getDefaultOptions(),
|
||||
...options
|
||||
};
|
||||
const filteredChars = [];
|
||||
const extractedChars = [];
|
||||
for (let i = 0; i < chars.length; i++) {
|
||||
const ch = extract(chars[i]);
|
||||
if (ch !== zeroWidth) {
|
||||
filteredChars.push(chars[i]);
|
||||
extractedChars.push(ch);
|
||||
}
|
||||
}
|
||||
const extractedChars = map(chars, extract);
|
||||
const characterMap = classify(extractedChars);
|
||||
return findWords(filteredChars, extractedChars, characterMap, options);
|
||||
return findWordsWithIndices(chars, extractedChars, characterMap, options);
|
||||
};
|
||||
const getWords$1 = (chars, extract, options) => getWordsWithIndices(chars, extract, options).words;
|
||||
|
||||
const getWords = getWords$1;
|
||||
|
||||
const removeZwsp$1 = s => s.replace(/\uFEFF/g, '');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
|
||||
|
||||
const getText = (node, schema) => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user