fx-platform-ui 0.0.13-alpha13 → 0.0.13-alpha15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/lib/fx-platform-ui.mjs +30783 -62614
  2. package/lib/fx-platform-ui.umd.js +68 -112
  3. package/lib/packages/components/editor/src/index.vue.d.ts +16 -0
  4. package/lib/style.css +1 -1
  5. package/lib/tinymce/CHANGELOG.md +2957 -0
  6. package/lib/tinymce/README.md +71 -0
  7. package/lib/tinymce/bower.json +27 -0
  8. package/lib/tinymce/composer.json +52 -0
  9. package/lib/tinymce/icons/default/icons.js +182 -0
  10. package/lib/tinymce/icons/default/icons.min.js +1 -0
  11. package/lib/tinymce/icons/default/index.js +7 -0
  12. package/lib/tinymce/license.txt +21 -0
  13. package/lib/tinymce/models/dom/index.js +7 -0
  14. package/lib/tinymce/models/dom/model.js +7975 -0
  15. package/lib/tinymce/models/dom/model.min.js +4 -0
  16. package/lib/tinymce/package.json +32 -0
  17. package/lib/tinymce/plugins/advlist/index.js +7 -0
  18. package/lib/tinymce/plugins/advlist/plugin.js +246 -0
  19. package/lib/tinymce/plugins/advlist/plugin.min.js +4 -0
  20. package/lib/tinymce/plugins/anchor/index.js +7 -0
  21. package/lib/tinymce/plugins/anchor/plugin.js +195 -0
  22. package/lib/tinymce/plugins/anchor/plugin.min.js +4 -0
  23. package/lib/tinymce/plugins/autolink/index.js +7 -0
  24. package/lib/tinymce/plugins/autolink/plugin.js +232 -0
  25. package/lib/tinymce/plugins/autolink/plugin.min.js +4 -0
  26. package/lib/tinymce/plugins/autoresize/index.js +7 -0
  27. package/lib/tinymce/plugins/autoresize/plugin.js +156 -0
  28. package/lib/tinymce/plugins/autoresize/plugin.min.js +4 -0
  29. package/lib/tinymce/plugins/autosave/index.js +7 -0
  30. package/lib/tinymce/plugins/autosave/plugin.js +232 -0
  31. package/lib/tinymce/plugins/autosave/plugin.min.js +4 -0
  32. package/lib/tinymce/plugins/charmap/index.js +7 -0
  33. package/lib/tinymce/plugins/charmap/plugin.js +1636 -0
  34. package/lib/tinymce/plugins/charmap/plugin.min.js +4 -0
  35. package/lib/tinymce/plugins/code/index.js +7 -0
  36. package/lib/tinymce/plugins/code/plugin.js +85 -0
  37. package/lib/tinymce/plugins/code/plugin.min.js +4 -0
  38. package/lib/tinymce/plugins/codesample/index.js +7 -0
  39. package/lib/tinymce/plugins/codesample/plugin.js +2451 -0
  40. package/lib/tinymce/plugins/codesample/plugin.min.js +4 -0
  41. package/lib/tinymce/plugins/directionality/index.js +7 -0
  42. package/lib/tinymce/plugins/directionality/plugin.js +384 -0
  43. package/lib/tinymce/plugins/directionality/plugin.min.js +4 -0
  44. package/lib/tinymce/plugins/emoticons/index.js +7 -0
  45. package/lib/tinymce/plugins/emoticons/js/emojiimages.js +1 -0
  46. package/lib/tinymce/plugins/emoticons/js/emojiimages.min.js +3 -0
  47. package/lib/tinymce/plugins/emoticons/js/emojis.js +1 -0
  48. package/lib/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
  49. package/lib/tinymce/plugins/emoticons/plugin.js +577 -0
  50. package/lib/tinymce/plugins/emoticons/plugin.min.js +4 -0
  51. package/lib/tinymce/plugins/fullscreen/index.js +7 -0
  52. package/lib/tinymce/plugins/fullscreen/plugin.js +1190 -0
  53. package/lib/tinymce/plugins/fullscreen/plugin.min.js +4 -0
  54. package/lib/tinymce/plugins/help/index.js +7 -0
  55. package/lib/tinymce/plugins/help/plugin.js +848 -0
  56. package/lib/tinymce/plugins/help/plugin.min.js +4 -0
  57. package/lib/tinymce/plugins/image/index.js +7 -0
  58. package/lib/tinymce/plugins/image/plugin.js +1475 -0
  59. package/lib/tinymce/plugins/image/plugin.min.js +4 -0
  60. package/lib/tinymce/plugins/importcss/index.js +7 -0
  61. package/lib/tinymce/plugins/importcss/plugin.js +342 -0
  62. package/lib/tinymce/plugins/importcss/plugin.min.js +4 -0
  63. package/lib/tinymce/plugins/insertdatetime/index.js +7 -0
  64. package/lib/tinymce/plugins/insertdatetime/plugin.js +176 -0
  65. package/lib/tinymce/plugins/insertdatetime/plugin.min.js +4 -0
  66. package/lib/tinymce/plugins/link/index.js +7 -0
  67. package/lib/tinymce/plugins/link/plugin.js +1190 -0
  68. package/lib/tinymce/plugins/link/plugin.min.js +4 -0
  69. package/lib/tinymce/plugins/lists/index.js +7 -0
  70. package/lib/tinymce/plugins/lists/plugin.js +1820 -0
  71. package/lib/tinymce/plugins/lists/plugin.min.js +4 -0
  72. package/lib/tinymce/plugins/media/index.js +7 -0
  73. package/lib/tinymce/plugins/media/plugin.js +1157 -0
  74. package/lib/tinymce/plugins/media/plugin.min.js +4 -0
  75. package/lib/tinymce/plugins/nonbreaking/index.js +7 -0
  76. package/lib/tinymce/plugins/nonbreaking/plugin.js +111 -0
  77. package/lib/tinymce/plugins/nonbreaking/plugin.min.js +4 -0
  78. package/lib/tinymce/plugins/pagebreak/index.js +7 -0
  79. package/lib/tinymce/plugins/pagebreak/plugin.js +105 -0
  80. package/lib/tinymce/plugins/pagebreak/plugin.min.js +4 -0
  81. package/lib/tinymce/plugins/preview/index.js +7 -0
  82. package/lib/tinymce/plugins/preview/plugin.js +97 -0
  83. package/lib/tinymce/plugins/preview/plugin.min.js +4 -0
  84. package/lib/tinymce/plugins/quickbars/index.js +7 -0
  85. package/lib/tinymce/plugins/quickbars/plugin.js +421 -0
  86. package/lib/tinymce/plugins/quickbars/plugin.min.js +4 -0
  87. package/lib/tinymce/plugins/save/index.js +7 -0
  88. package/lib/tinymce/plugins/save/plugin.js +118 -0
  89. package/lib/tinymce/plugins/save/plugin.min.js +4 -0
  90. package/lib/tinymce/plugins/searchreplace/index.js +7 -0
  91. package/lib/tinymce/plugins/searchreplace/plugin.js +1079 -0
  92. package/lib/tinymce/plugins/searchreplace/plugin.min.js +4 -0
  93. package/lib/tinymce/plugins/table/index.js +7 -0
  94. package/lib/tinymce/plugins/table/plugin.js +3393 -0
  95. package/lib/tinymce/plugins/table/plugin.min.js +4 -0
  96. package/lib/tinymce/plugins/template/index.js +7 -0
  97. package/lib/tinymce/plugins/template/plugin.js +548 -0
  98. package/lib/tinymce/plugins/template/plugin.min.js +4 -0
  99. package/lib/tinymce/plugins/visualblocks/index.js +7 -0
  100. package/lib/tinymce/plugins/visualblocks/plugin.js +98 -0
  101. package/lib/tinymce/plugins/visualblocks/plugin.min.js +4 -0
  102. package/lib/tinymce/plugins/visualchars/index.js +7 -0
  103. package/lib/tinymce/plugins/visualchars/plugin.js +506 -0
  104. package/lib/tinymce/plugins/visualchars/plugin.min.js +4 -0
  105. package/lib/tinymce/plugins/wordcount/index.js +7 -0
  106. package/lib/tinymce/plugins/wordcount/plugin.js +404 -0
  107. package/lib/tinymce/plugins/wordcount/plugin.min.js +4 -0
  108. package/lib/tinymce/themes/silver/index.js +7 -0
  109. package/lib/tinymce/themes/silver/theme.js +26184 -0
  110. package/lib/tinymce/themes/silver/theme.min.js +4 -0
  111. package/lib/tinymce/tinymce.d.ts +2895 -0
  112. package/lib/tinymce/tinymce.js +29400 -0
  113. package/package.json +1 -1
  114. package/packages/components/editor/src/index.vue +24 -23
@@ -0,0 +1,4 @@
1
+ /**
2
+ * TinyMCE version 6.1.2 (2022-07-29)
3
+ */
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=Object.getPrototypeOf,a=(e,t,a)=>{var i;return!!a(e,t.prototype)||(null===(i=e.constructor)||void 0===i?void 0:i.name)===t.name},i=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&a(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,s=e=>t=>typeof t===e,r=i("string"),o=i("object"),n=e=>((e,i)=>o(e)&&a(e,i,((e,a)=>t(e)===a)))(e,Object),l=i("array"),c=(null,e=>null===e);const m=s("boolean"),d=e=>!(e=>null==e)(e),g=s("function"),p=s("number"),u=()=>{};class h{constructor(e,t){this.tag=e,this.value=t}static some(e){return new h(!0,e)}static none(){return h.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?h.some(e(this.value)):h.none()}bind(e){return this.tag?e(this.value):h.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:h.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return d(e)?h.some(e):h.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}h.singletonNone=new h(!1);const b=Object.keys,y=Object.hasOwnProperty,v=(e,t)=>y.call(e,t),f=Array.prototype.push,w=e=>{const t=[];for(let a=0,i=e.length;a<i;++a){if(!l(e[a]))throw new Error("Arr.flatten item "+a+" was not an array, input: "+e);f.apply(t,e[a])}return t};"undefined"!=typeof window?window:Function("return this;")();const A=(e,t,a)=>{((e,t,a)=>{if(!(r(a)||m(a)||p(a)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",a,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,a+"")})(e.dom,t,a)},D=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},_=D;var C=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),I=tinymce.util.Tools.resolve("tinymce.util.URI");const U=e=>e.length>0,x=e=>t=>t.options.get(e),S=x("image_dimensions"),N=x("image_advtab"),T=x("image_uploadtab"),O=x("image_prepend_url"),L=x("image_class_list"),E=x("image_description"),j=x("image_title"),M=x("image_caption"),R=x("image_list"),k=x("a11y_advanced_options"),z=x("automatic_uploads"),P=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10)),B=e=>(e&&(e=e.replace(/px$/,"")),e),F=e=>(e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e),H=e=>"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder")),G=(e,t)=>{const a=e.options.get;return I.isDomSafe(t,"img",{allow_html_data_urls:a("allow_html_data_urls"),allow_script_urls:a("allow_script_urls"),allow_svg_data_urls:a("allow_svg_data_urls")})},W=C.DOM,$=e=>e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?B(e.style.marginLeft):"",V=e=>e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?B(e.style.marginTop):"",K=e=>e.style.borderWidth?B(e.style.borderWidth):"",Z=(e,t)=>e.hasAttribute(t)?e.getAttribute(t):"",q=(e,t)=>e.style[t]?e.style[t]:"",J=e=>null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName,Q=(e,t,a)=>{""===a?e.removeAttribute(t):e.setAttribute(t,a)},X=(e,t)=>{const a=e.getAttribute("style"),i=t(null!==a?a:"");i.length>0?(e.setAttribute("style",i),e.setAttribute("data-mce-style",i)):e.removeAttribute("style")},Y=(e,t)=>(e,a,i)=>{e.style[a]?(e.style[a]=F(i),X(e,t)):Q(e,a,i)},ee=(e,t)=>e.style[t]?B(e.style[t]):Z(e,t),te=(e,t)=>{const a=F(t);e.style.marginLeft=a,e.style.marginRight=a},ae=(e,t)=>{const a=F(t);e.style.marginTop=a,e.style.marginBottom=a},ie=(e,t)=>{const a=F(t);e.style.borderWidth=a},se=(e,t)=>{e.style.borderStyle=t},re=e=>"FIGURE"===e.nodeName,oe=e=>0===W.getAttrib(e,"alt").length&&"presentation"===W.getAttrib(e,"role"),ne=e=>oe(e)?"":Z(e,"alt"),le=(e,t)=>{const a=document.createElement("img");return Q(a,"style",t.style),($(a)||""!==t.hspace)&&te(a,t.hspace),(V(a)||""!==t.vspace)&&ae(a,t.vspace),(K(a)||""!==t.border)&&ie(a,t.border),((e=>q(e,"borderStyle"))(a)||""!==t.borderStyle)&&se(a,t.borderStyle),e(a.getAttribute("style"))},ce=(e,t)=>({src:Z(t,"src"),alt:ne(t),title:Z(t,"title"),width:ee(t,"width"),height:ee(t,"height"),class:Z(t,"class"),style:e(Z(t,"style")),caption:J(t),hspace:$(t),vspace:V(t),border:K(t),borderStyle:q(t,"borderStyle"),isDecorative:oe(t)}),me=(e,t,a,i,s)=>{a[i]!==t[i]&&s(e,i,a[i])},de=(e,t,a)=>{if(a){W.setAttrib(e,"role","presentation");const t=_(e);A(t,"alt","")}else{if(c(t)){"alt",_(e).dom.removeAttribute("alt")}else{const a=_(e);A(a,"alt",t)}"presentation"===W.getAttrib(e,"role")&&W.setAttrib(e,"role","")}},ge=(e,t)=>(a,i,s)=>{e(a,s),X(a,t)},pe=(e,t,a)=>{const i=ce(e,a);me(a,i,t,"caption",((e,t,a)=>(e=>{J(e)?(e=>{const t=e.parentNode;W.insertAfter(e,t),W.remove(t)})(e):(e=>{const t=W.create("figure",{class:"image"});W.insertAfter(t,e),t.appendChild(e),t.appendChild(W.create("figcaption",{contentEditable:"true"},"Caption")),t.contentEditable="false"})(e)})(e))),me(a,i,t,"src",Q),me(a,i,t,"title",Q),me(a,i,t,"width",Y(0,e)),me(a,i,t,"height",Y(0,e)),me(a,i,t,"class",Q),me(a,i,t,"style",ge(((e,t)=>Q(e,"style",t)),e)),me(a,i,t,"hspace",ge(te,e)),me(a,i,t,"vspace",ge(ae,e)),me(a,i,t,"border",ge(ie,e)),me(a,i,t,"borderStyle",ge(se,e)),((e,t,a)=>{a.alt===t.alt&&a.isDecorative===t.isDecorative||de(e,a.alt,a.isDecorative)})(a,i,t)},ue=(e,t)=>{const a=(e=>{if(e.margin){const t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e})(e.dom.styles.parse(t)),i=e.dom.styles.parse(e.dom.styles.serialize(a));return e.dom.styles.serialize(i)},he=e=>{const t=e.selection.getNode(),a=e.dom.getParent(t,"figure.image");return a?e.dom.select("img",a)[0]:t&&("IMG"!==t.nodeName||H(t))?null:t},be=(e,t)=>{const a=e.dom,i=((t,a)=>{const i={};var s;return((e,t,a,i)=>{((e,t)=>{const a=b(e);for(let i=0,s=a.length;i<s;i++){const s=a[i];t(e[s],s)}})(e,((e,s)=>{(t(e,s)?a:i)(e,s)}))})(t,((t,a)=>!e.schema.isValidChild(a,"figure")),(s=i,(e,t)=>{s[t]=e}),u),i})(e.schema.getTextBlockElements()),s=a.getParent(t.parentNode,(e=>{return t=i,a=e.nodeName,v(t,a)&&void 0!==t[a]&&null!==t[a];var t,a}),e.getBody());return s?a.split(s,t):t},ye=(e,t)=>{const a=((t,a)=>{const i=document.createElement("img");if(pe((t=>ue(e,t)),{...a,caption:!1},i),de(i,a.alt,a.isDecorative),a.caption){const e=W.create("figure",{class:"image"});return e.appendChild(i),e.appendChild(W.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false",e}return i})(0,t);e.dom.setAttrib(a,"data-mce-id","__mcenew"),e.focus(),e.selection.setContent(a.outerHTML);const i=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(i,"data-mce-id",null),re(i)){const t=be(e,i);e.selection.select(t)}else e.selection.select(i)},ve=(e,t)=>{const a=he(e);if(a){const i={...ce((t=>ue(e,t)),a),...t},s=((e,t)=>{const a=t.src;return{...t,src:G(e,a)?a:""}})(e,i);i.src?((e,t)=>{const a=he(e);if(pe((t=>ue(e,t)),t,a),((e,t)=>{e.dom.setAttrib(t,"src",t.getAttribute("src"))})(e,a),re(a.parentNode)){const t=a.parentNode;be(e,t),e.selection.select(a.parentNode)}else e.selection.select(a),((e,t,a)=>{const i=()=>{a.onload=a.onerror=null,e.selection&&(e.selection.select(a),e.nodeChanged())};a.onload=()=>{t.width||t.height||!S(e)||e.dom.setAttribs(a,{width:String(a.clientWidth),height:String(a.clientHeight)}),i()},a.onerror=i})(e,t,a)})(e,s):((e,t)=>{if(t){const a=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(a),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}})(e,a)}else t.src&&ye(e,{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1,...t})},fe=(we=(e,t)=>n(e)&&n(t)?fe(e,t):t,(...e)=>{if(0===e.length)throw new Error("Can't merge zero objects");const t={};for(let a=0;a<e.length;a++){const i=e[a];for(const e in i)v(i,e)&&(t[e]=we(t[e],i[e]))}return t});var we,Ae=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),De=tinymce.util.Tools.resolve("tinymce.util.Tools");const _e=e=>r(e.value)?e.value:"",Ce=(e,t)=>{const a=[];return De.each(e,(e=>{const i=(e=>r(e.text)?e.text:r(e.title)?e.title:"")(e);if(void 0!==e.menu){const s=Ce(e.menu,t);a.push({text:i,items:s})}else{const s=t(e);a.push({text:i,value:s})}})),a},Ie=(e=_e)=>t=>t?h.from(t).map((t=>Ce(t,e))):h.none(),Ue=(e,t)=>((e,a)=>{for(let a=0;a<e.length;a++){const s=(e=>v(e,"items"))(i=e[a])?Ue(i.items,t):i.value===t?h.some(i):h.none();if(s.isSome())return s}var i;return h.none()})(e),xe=Ie,Se=(e,t)=>e.bind((e=>Ue(e,t))),Ne=e=>{const t=xe((t=>e.convertURL(t.value||t.url,"src"))),a=new Promise((a=>{((e,t)=>{const a=R(e);r(a)?fetch(a).then((e=>{e.ok&&e.json().then(t)})):g(a)?a(t):t(a)})(e,(e=>{a(t(e).map((e=>w([[{text:"None",value:""}],e]))))}))})),i=(A=L(e),Ie(_e)(A)),s=N(e),o=T(e),n=(e=>U(e.options.get("images_upload_url")))(e),l=(e=>d(e.options.get("images_upload_handler")))(e),c=(e=>{const t=he(e);return t?ce((t=>ue(e,t)),t):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}})(e),m=E(e),p=j(e),u=S(e),b=M(e),y=k(e),v=z(e),f=h.some(O(e)).filter((e=>r(e)&&e.length>0));var A;return a.then((e=>({image:c,imageList:e,classList:i,hasAdvTab:s,hasUploadTab:o,hasUploadUrl:n,hasUploadHandler:l,hasDescription:m,hasImageTitle:p,hasDimensions:u,hasImageCaption:b,prependURL:f,hasAccessibilityOptions:y,automaticUploads:v})))},Te=e=>{const t=e.imageList.map((e=>({name:"images",type:"listbox",label:"Image list",items:e}))),a={name:"alt",type:"input",label:"Alternative description",enabled:!(e.hasAccessibilityOptions&&e.image.isDecorative)},i=e.classList.map((e=>({name:"classes",type:"listbox",label:"Class",items:e})));return w([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[a]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{...(s=e.classList.isSome()&&e.hasImageCaption,s?{type:"grid",columns:2}:{type:"panel"}),items:w([i.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]]);var s},Oe=e=>({title:"General",name:"general",items:Te(e)}),Le=Te,Ee=e=>({src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}),je=(e,t)=>({src:e.src.value,alt:0===e.alt.length&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}),Me=(e,t,a,i)=>{((e,t)=>{const a=t.getData();((e,t)=>/^(?:[a-zA-Z]+:)?\/\//.test(t)?h.none():e.prependURL.bind((e=>t.substring(0,e.length)!==e?h.some(e+t):h.none())))(e,a.src.value).each((e=>{t.setData({src:{value:e,meta:a.src.meta}})}))})(t,i),((e,t)=>{const a=t.getData(),i=a.src.meta;if(void 0!==i){const s=fe({},a);((e,t,a)=>{e.hasDescription&&r(a.alt)&&(t.alt=a.alt),e.hasAccessibilityOptions&&(t.isDecorative=a.isDecorative||t.isDecorative||!1),e.hasImageTitle&&r(a.title)&&(t.title=a.title),e.hasDimensions&&(r(a.width)&&(t.dimensions.width=a.width),r(a.height)&&(t.dimensions.height=a.height)),r(a.class)&&Se(e.classList,a.class).each((e=>{t.classes=e.value})),e.hasImageCaption&&m(a.caption)&&(t.caption=a.caption),e.hasAdvTab&&(r(a.style)&&(t.style=a.style),r(a.vspace)&&(t.vspace=a.vspace),r(a.border)&&(t.border=a.border),r(a.hspace)&&(t.hspace=a.hspace),r(a.borderstyle)&&(t.borderstyle=a.borderstyle))})(e,s,i),t.setData(s)}})(t,i),((e,t,a,i)=>{const s=i.getData(),r=s.src.value,o=s.src.meta||{};o.width||o.height||!t.hasDimensions||(U(r)?e.imageSize(r).then((e=>{a.open&&i.setData({dimensions:e})})).catch((e=>console.error(e))):i.setData({dimensions:{width:"",height:""}}))})(e,t,a,i),((e,t,a)=>{const i=a.getData(),s=Se(e.imageList,i.src.value);t.prevImage=s,a.setData({images:s.map((e=>e.value)).getOr("")})})(t,a,i)},Re=(e,t,a,i)=>{const s=i.getData();var r;i.block("Uploading image"),(r=s.fileinput,((e,t)=>0<e.length?h.some(e[0]):h.none())(r)).fold((()=>{i.unblock()}),(s=>{const r=URL.createObjectURL(s),o=()=>{i.unblock(),URL.revokeObjectURL(r)},n=s=>{i.setData({src:{value:s,meta:{}}}),i.showTab("general"),Me(e,t,a,i)};var l;(l=s,new Promise(((e,t)=>{const a=new FileReader;a.onload=()=>{e(a.result)},a.onerror=()=>{t(a.error.message)},a.readAsDataURL(l)}))).then((a=>{const l=e.createBlobCache(s,r,a);t.automaticUploads?e.uploadImage(l).then((e=>{n(e.url),o()})).catch((t=>{o(),e.alertErr(t)})):(e.addToBlobCache(l),n(l.blobUri()),i.unblock())}))}))},ke=(e,t,a)=>(i,s)=>{"src"===s.name?Me(e,t,a,i):"images"===s.name?((e,t,a,i)=>{const s=i.getData(),r=Se(t.imageList,s.images);r.each((e=>{const t=""===s.alt||a.prevImage.map((e=>e.text===s.alt)).getOr(!1);t?""===e.value?i.setData({src:e,alt:a.prevAlt}):i.setData({src:e,alt:e.text}):i.setData({src:e})})),a.prevImage=r,Me(e,t,a,i)})(e,t,a,i):"alt"===s.name?a.prevAlt=i.getData().alt:"fileinput"===s.name?Re(e,t,a,i):"isDecorative"===s.name&&i.setEnabled("alt",!i.getData().isDecorative)},ze=e=>()=>{e.open=!1},Pe=e=>e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler?{type:"tabpanel",tabs:w([[Oe(e)],e.hasAdvTab?[{title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}]:[]])}:{type:"panel",items:Le(e)},Be=(e,t,a)=>i=>{const s=fe(Ee(t.image),i.getData()),r={...s,style:le(a.normalizeCss,je(s,!1))};e.execCommand("mceUpdateImage",!1,je(r,t.hasAccessibilityOptions)),e.editorUpload.uploadImagesAuto(),i.close()},Fe=e=>t=>G(e,t)?(e=>new Promise((t=>{const a=document.createElement("img"),i=e=>{a.onload=a.onerror=null,a.parentNode&&a.parentNode.removeChild(a),t(e)};a.onload=()=>{const e={width:P(a.width,a.clientWidth),height:P(a.height,a.clientHeight)};i(Promise.resolve(e))},a.onerror=()=>{i(Promise.reject(`Failed to get image dimensions for: ${e}`))};const s=a.style;s.visibility="hidden",s.position="fixed",s.bottom=s.left="0px",s.width=s.height="auto",document.body.appendChild(a),a.src=e})))(e.documentBaseURI.toAbsolute(t)).then((e=>({width:String(e.width),height:String(e.height)}))):Promise.resolve({width:"",height:""}),He=e=>(t,a,i)=>e.editorUpload.blobCache.create({blob:t,blobUri:a,name:t.name?t.name.replace(/\.[^\.]+$/,""):null,filename:t.name,base64:i.split(",")[1]}),Ge=e=>t=>{e.editorUpload.blobCache.add(t)},We=e=>t=>{e.windowManager.alert(t)},$e=e=>t=>ue(e,t),Ve=e=>t=>e.dom.parseStyle(t),Ke=e=>(t,a)=>e.dom.serializeStyle(t,a),Ze=e=>t=>Ae(e).upload([t],!1).then((e=>0===e.length?Promise.reject("Failed to upload image"):!1===e[0].status?Promise.reject(e[0].error.message):e[0])),qe=e=>{const t={imageSize:Fe(e),addToBlobCache:Ge(e),createBlobCache:He(e),alertErr:We(e),normalizeCss:$e(e),parseStyle:Ve(e),serializeStyle:Ke(e),uploadImage:Ze(e)};return{open:()=>{Ne(e).then((a=>{const i=(e=>({prevImage:Se(e.imageList,e.image.src),prevAlt:e.image.alt,open:!0}))(a);return{title:"Insert/Edit Image",size:"normal",body:Pe(a),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ee(a.image),onSubmit:Be(e,a,t),onChange:ke(t,a,i),onClose:ze(i)}})).then(e.windowManager.open)}}},Je=e=>{const t=e.attr("class");return t&&/\bimage\b/.test(t)},Qe=e=>t=>{let a=t.length;const i=t=>{t.attr("contenteditable",e?"true":null)};for(;a--;){const s=t[a];Je(s)&&(s.attr("contenteditable",e?"false":null),De.each(s.getAll("figcaption"),i))}};e.add("image",(e=>{(e=>{const t=e.options.register;t("image_dimensions",{processor:"boolean",default:!0}),t("image_advtab",{processor:"boolean",default:!1}),t("image_uploadtab",{processor:"boolean",default:!0}),t("image_prepend_url",{processor:"string",default:""}),t("image_class_list",{processor:"object[]"}),t("image_description",{processor:"boolean",default:!0}),t("image_title",{processor:"boolean",default:!1}),t("image_caption",{processor:"boolean",default:!1}),t("image_list",{processor:e=>{const t=!1===e||r(e)||((e,t)=>{if(l(e)){for(let a=0,i=e.length;a<i;++a)if(!t(e[a]))return!1;return!0}return!1})(e,o)||g(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("figure",Qe(!0)),e.serializer.addNodeFilter("figure",Qe(!1))}))})(e),(e=>{e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:qe(e).open,onSetup:t=>(t.setActive(d(he(e))),e.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",t.setActive).unbind)}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:qe(e).open}),e.ui.registry.addContextMenu("image",{update:e=>re(e)||"IMG"===e.nodeName&&!H(e)?["image"]:[]})})(e),(e=>{e.addCommand("mceImage",qe(e).open),e.addCommand("mceUpdateImage",((t,a)=>{e.undoManager.transact((()=>ve(e,a)))}))})(e)}))}();
@@ -0,0 +1,7 @@
1
+ // Exports the "importcss" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/importcss')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/importcss'
7
+ require('./plugin.js');
@@ -0,0 +1,342 @@
1
+ /**
2
+ * TinyMCE version 6.1.2 (2022-07-29)
3
+ */
4
+
5
+ (function () {
6
+ 'use strict';
7
+
8
+ var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
+
10
+ const hasProto = (v, constructor, predicate) => {
11
+ var _a;
12
+ if (predicate(v, constructor.prototype)) {
13
+ return true;
14
+ } else {
15
+ return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;
16
+ }
17
+ };
18
+ const typeOf = x => {
19
+ const t = typeof x;
20
+ if (x === null) {
21
+ return 'null';
22
+ } else if (t === 'object' && Array.isArray(x)) {
23
+ return 'array';
24
+ } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {
25
+ return 'string';
26
+ } else {
27
+ return t;
28
+ }
29
+ };
30
+ const isType = type => value => typeOf(value) === type;
31
+ const isSimpleType = type => value => typeof value === type;
32
+ const isString = isType('string');
33
+ const isObject = isType('object');
34
+ const isArray = isType('array');
35
+ const isFunction = isSimpleType('function');
36
+
37
+ var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
38
+
39
+ var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
40
+
41
+ var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
42
+
43
+ var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
44
+
45
+ const option = name => editor => editor.options.get(name);
46
+ const register = editor => {
47
+ const registerOption = editor.options.register;
48
+ const filterProcessor = value => isString(value) || isFunction(value) || isObject(value);
49
+ registerOption('importcss_merge_classes', {
50
+ processor: 'boolean',
51
+ default: true
52
+ });
53
+ registerOption('importcss_exclusive', {
54
+ processor: 'boolean',
55
+ default: true
56
+ });
57
+ registerOption('importcss_selector_converter', { processor: 'function' });
58
+ registerOption('importcss_selector_filter', { processor: filterProcessor });
59
+ registerOption('importcss_file_filter', { processor: filterProcessor });
60
+ registerOption('importcss_groups', { processor: 'object[]' });
61
+ registerOption('importcss_append', {
62
+ processor: 'boolean',
63
+ default: false
64
+ });
65
+ };
66
+ const shouldMergeClasses = option('importcss_merge_classes');
67
+ const shouldImportExclusive = option('importcss_exclusive');
68
+ const getSelectorConverter = option('importcss_selector_converter');
69
+ const getSelectorFilter = option('importcss_selector_filter');
70
+ const getCssGroups = option('importcss_groups');
71
+ const shouldAppend = option('importcss_append');
72
+ const getFileFilter = option('importcss_file_filter');
73
+ const getSkin = option('skin');
74
+ const getSkinUrl = option('skin_url');
75
+
76
+ const nativePush = Array.prototype.push;
77
+ const map = (xs, f) => {
78
+ const len = xs.length;
79
+ const r = new Array(len);
80
+ for (let i = 0; i < len; i++) {
81
+ const x = xs[i];
82
+ r[i] = f(x, i);
83
+ }
84
+ return r;
85
+ };
86
+ const flatten = xs => {
87
+ const r = [];
88
+ for (let i = 0, len = xs.length; i < len; ++i) {
89
+ if (!isArray(xs[i])) {
90
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
91
+ }
92
+ nativePush.apply(r, xs[i]);
93
+ }
94
+ return r;
95
+ };
96
+ const bind = (xs, f) => flatten(map(xs, f));
97
+
98
+ const generate = () => {
99
+ const ungroupedOrder = [];
100
+ const groupOrder = [];
101
+ const groups = {};
102
+ const addItemToGroup = (groupTitle, itemInfo) => {
103
+ if (groups[groupTitle]) {
104
+ groups[groupTitle].push(itemInfo);
105
+ } else {
106
+ groupOrder.push(groupTitle);
107
+ groups[groupTitle] = [itemInfo];
108
+ }
109
+ };
110
+ const addItem = itemInfo => {
111
+ ungroupedOrder.push(itemInfo);
112
+ };
113
+ const toFormats = () => {
114
+ const groupItems = bind(groupOrder, g => {
115
+ const items = groups[g];
116
+ return items.length === 0 ? [] : [{
117
+ title: g,
118
+ items
119
+ }];
120
+ });
121
+ return groupItems.concat(ungroupedOrder);
122
+ };
123
+ return {
124
+ addItemToGroup,
125
+ addItem,
126
+ toFormats
127
+ };
128
+ };
129
+
130
+ const internalEditorStyle = /^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;
131
+ const removeCacheSuffix = url => {
132
+ const cacheSuffix = global$1.cacheSuffix;
133
+ if (isString(url)) {
134
+ url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
135
+ }
136
+ return url;
137
+ };
138
+ const isSkinContentCss = (editor, href) => {
139
+ const skin = getSkin(editor);
140
+ if (skin) {
141
+ const skinUrlBase = getSkinUrl(editor);
142
+ const skinUrl = skinUrlBase ? editor.documentBaseURI.toAbsolute(skinUrlBase) : global$2.baseURL + '/skins/ui/' + skin;
143
+ const contentSkinUrlPart = global$2.baseURL + '/skins/content/';
144
+ return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css' || href.indexOf(contentSkinUrlPart) !== -1;
145
+ }
146
+ return false;
147
+ };
148
+ const compileFilter = filter => {
149
+ if (isString(filter)) {
150
+ return value => {
151
+ return value.indexOf(filter) !== -1;
152
+ };
153
+ } else if (filter instanceof RegExp) {
154
+ return value => {
155
+ return filter.test(value);
156
+ };
157
+ }
158
+ return filter;
159
+ };
160
+ const isCssImportRule = rule => rule.styleSheet;
161
+ const isCssPageRule = rule => rule.selectorText;
162
+ const getSelectors = (editor, doc, fileFilter) => {
163
+ const selectors = [];
164
+ const contentCSSUrls = {};
165
+ const append = (styleSheet, imported) => {
166
+ let href = styleSheet.href, rules;
167
+ href = removeCacheSuffix(href);
168
+ if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
169
+ return;
170
+ }
171
+ global.each(styleSheet.imports, styleSheet => {
172
+ append(styleSheet, true);
173
+ });
174
+ try {
175
+ rules = styleSheet.cssRules || styleSheet.rules;
176
+ } catch (e) {
177
+ }
178
+ global.each(rules, cssRule => {
179
+ if (isCssImportRule(cssRule)) {
180
+ append(cssRule.styleSheet, true);
181
+ } else if (isCssPageRule(cssRule)) {
182
+ global.each(cssRule.selectorText.split(','), selector => {
183
+ selectors.push(global.trim(selector));
184
+ });
185
+ }
186
+ });
187
+ };
188
+ global.each(editor.contentCSS, url => {
189
+ contentCSSUrls[url] = true;
190
+ });
191
+ if (!fileFilter) {
192
+ fileFilter = (href, imported) => {
193
+ return imported || contentCSSUrls[href];
194
+ };
195
+ }
196
+ try {
197
+ global.each(doc.styleSheets, styleSheet => {
198
+ append(styleSheet);
199
+ });
200
+ } catch (e) {
201
+ }
202
+ return selectors;
203
+ };
204
+ const defaultConvertSelectorToFormat = (editor, selectorText) => {
205
+ let format;
206
+ const selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
207
+ if (!selector) {
208
+ return;
209
+ }
210
+ const elementName = selector[1];
211
+ const classes = selector[2].substr(1).split('.').join(' ');
212
+ const inlineSelectorElements = global.makeMap('a,img');
213
+ if (selector[1]) {
214
+ format = { title: selectorText };
215
+ if (editor.schema.getTextBlockElements()[elementName]) {
216
+ format.block = elementName;
217
+ } else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
218
+ format.selector = elementName;
219
+ } else {
220
+ format.inline = elementName;
221
+ }
222
+ } else if (selector[2]) {
223
+ format = {
224
+ inline: 'span',
225
+ title: selectorText.substr(1),
226
+ classes
227
+ };
228
+ }
229
+ if (shouldMergeClasses(editor)) {
230
+ format.classes = classes;
231
+ } else {
232
+ format.attributes = { class: classes };
233
+ }
234
+ return format;
235
+ };
236
+ const getGroupsBySelector = (groups, selector) => {
237
+ return global.grep(groups, group => {
238
+ return !group.filter || group.filter(selector);
239
+ });
240
+ };
241
+ const compileUserDefinedGroups = groups => {
242
+ return global.map(groups, group => {
243
+ return global.extend({}, group, {
244
+ original: group,
245
+ selectors: {},
246
+ filter: compileFilter(group.filter)
247
+ });
248
+ });
249
+ };
250
+ const isExclusiveMode = (editor, group) => {
251
+ return group === null || shouldImportExclusive(editor);
252
+ };
253
+ const isUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
254
+ return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
255
+ };
256
+ const markUniqueSelector = (editor, selector, group, globallyUniqueSelectors) => {
257
+ if (isExclusiveMode(editor, group)) {
258
+ globallyUniqueSelectors[selector] = true;
259
+ } else {
260
+ group.selectors[selector] = true;
261
+ }
262
+ };
263
+ const convertSelectorToFormat = (editor, plugin, selector, group) => {
264
+ let selectorConverter;
265
+ if (group && group.selector_converter) {
266
+ selectorConverter = group.selector_converter;
267
+ } else if (getSelectorConverter(editor)) {
268
+ selectorConverter = getSelectorConverter(editor);
269
+ } else {
270
+ selectorConverter = () => {
271
+ return defaultConvertSelectorToFormat(editor, selector);
272
+ };
273
+ }
274
+ return selectorConverter.call(plugin, selector, group);
275
+ };
276
+ const setup = editor => {
277
+ editor.on('init', () => {
278
+ const model = generate();
279
+ const globallyUniqueSelectors = {};
280
+ const selectorFilter = compileFilter(getSelectorFilter(editor));
281
+ const groups = compileUserDefinedGroups(getCssGroups(editor));
282
+ const processSelector = (selector, group) => {
283
+ if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
284
+ markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
285
+ const format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
286
+ if (format) {
287
+ const formatName = format.name || global$3.DOM.uniqueId();
288
+ editor.formatter.register(formatName, format);
289
+ return {
290
+ title: format.title,
291
+ format: formatName
292
+ };
293
+ }
294
+ }
295
+ return null;
296
+ };
297
+ global.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), selector => {
298
+ if (!internalEditorStyle.test(selector)) {
299
+ if (!selectorFilter || selectorFilter(selector)) {
300
+ const selectorGroups = getGroupsBySelector(groups, selector);
301
+ if (selectorGroups.length > 0) {
302
+ global.each(selectorGroups, group => {
303
+ const menuItem = processSelector(selector, group);
304
+ if (menuItem) {
305
+ model.addItemToGroup(group.title, menuItem);
306
+ }
307
+ });
308
+ } else {
309
+ const menuItem = processSelector(selector, null);
310
+ if (menuItem) {
311
+ model.addItem(menuItem);
312
+ }
313
+ }
314
+ }
315
+ }
316
+ });
317
+ const items = model.toFormats();
318
+ editor.dispatch('addStyleModifications', {
319
+ items,
320
+ replace: !shouldAppend(editor)
321
+ });
322
+ });
323
+ };
324
+
325
+ const get = editor => {
326
+ const convertSelectorToFormat = selectorText => {
327
+ return defaultConvertSelectorToFormat(editor, selectorText);
328
+ };
329
+ return { convertSelectorToFormat };
330
+ };
331
+
332
+ var Plugin = () => {
333
+ global$4.add('importcss', editor => {
334
+ register(editor);
335
+ setup(editor);
336
+ return get(editor);
337
+ });
338
+ };
339
+
340
+ Plugin();
341
+
342
+ })();
@@ -0,0 +1,4 @@
1
+ /**
2
+ * TinyMCE version 6.1.2 (2022-07-29)
3
+ */
4
+ !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;return o=r&&r.selector_converter?r.selector_converter:f(e)?f(e):()=>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(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))))}();
@@ -0,0 +1,7 @@
1
+ // Exports the "insertdatetime" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/insertdatetime')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/insertdatetime'
7
+ require('./plugin.js');
@@ -0,0 +1,176 @@
1
+ /**
2
+ * TinyMCE version 6.1.2 (2022-07-29)
3
+ */
4
+
5
+ (function () {
6
+ 'use strict';
7
+
8
+ var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
9
+
10
+ const option = name => editor => editor.options.get(name);
11
+ const register$2 = editor => {
12
+ const registerOption = editor.options.register;
13
+ registerOption('insertdatetime_dateformat', {
14
+ processor: 'string',
15
+ default: editor.translate('%Y-%m-%d')
16
+ });
17
+ registerOption('insertdatetime_timeformat', {
18
+ processor: 'string',
19
+ default: editor.translate('%H:%M:%S')
20
+ });
21
+ registerOption('insertdatetime_formats', {
22
+ processor: 'string[]',
23
+ default: [
24
+ '%H:%M:%S',
25
+ '%Y-%m-%d',
26
+ '%I:%M:%S %p',
27
+ '%D'
28
+ ]
29
+ });
30
+ registerOption('insertdatetime_element', {
31
+ processor: 'boolean',
32
+ default: false
33
+ });
34
+ };
35
+ const getDateFormat = option('insertdatetime_dateformat');
36
+ const getTimeFormat = option('insertdatetime_timeformat');
37
+ const getFormats = option('insertdatetime_formats');
38
+ const shouldInsertTimeElement = option('insertdatetime_element');
39
+ const getDefaultDateTime = editor => {
40
+ const formats = getFormats(editor);
41
+ return formats.length > 0 ? formats[0] : getTimeFormat(editor);
42
+ };
43
+
44
+ const daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' ');
45
+ const daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' ');
46
+ const monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
47
+ const monthsLong = 'January February March April May June July August September October November December'.split(' ');
48
+ const addZeros = (value, len) => {
49
+ value = '' + value;
50
+ if (value.length < len) {
51
+ for (let i = 0; i < len - value.length; i++) {
52
+ value = '0' + value;
53
+ }
54
+ }
55
+ return value;
56
+ };
57
+ const getDateTime = (editor, fmt, date = new Date()) => {
58
+ fmt = fmt.replace('%D', '%m/%d/%Y');
59
+ fmt = fmt.replace('%r', '%I:%M:%S %p');
60
+ fmt = fmt.replace('%Y', '' + date.getFullYear());
61
+ fmt = fmt.replace('%y', '' + date.getYear());
62
+ fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2));
63
+ fmt = fmt.replace('%d', addZeros(date.getDate(), 2));
64
+ fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2));
65
+ fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2));
66
+ fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2));
67
+ fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1));
68
+ fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM'));
69
+ fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()]));
70
+ fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()]));
71
+ fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()]));
72
+ fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()]));
73
+ fmt = fmt.replace('%%', '%');
74
+ return fmt;
75
+ };
76
+ const updateElement = (editor, timeElm, computerTime, userTime) => {
77
+ const newTimeElm = editor.dom.create('time', { datetime: computerTime }, userTime);
78
+ timeElm.parentNode.insertBefore(newTimeElm, timeElm);
79
+ editor.dom.remove(timeElm);
80
+ editor.selection.select(newTimeElm, true);
81
+ editor.selection.collapse(false);
82
+ };
83
+ const insertDateTime = (editor, format) => {
84
+ if (shouldInsertTimeElement(editor)) {
85
+ const userTime = getDateTime(editor, format);
86
+ let computerTime;
87
+ if (/%[HMSIp]/.test(format)) {
88
+ computerTime = getDateTime(editor, '%Y-%m-%dT%H:%M');
89
+ } else {
90
+ computerTime = getDateTime(editor, '%Y-%m-%d');
91
+ }
92
+ const timeElm = editor.dom.getParent(editor.selection.getStart(), 'time');
93
+ if (timeElm) {
94
+ updateElement(editor, timeElm, computerTime, userTime);
95
+ } else {
96
+ editor.insertContent('<time datetime="' + computerTime + '">' + userTime + '</time>');
97
+ }
98
+ } else {
99
+ editor.insertContent(getDateTime(editor, format));
100
+ }
101
+ };
102
+
103
+ const register$1 = editor => {
104
+ editor.addCommand('mceInsertDate', (_ui, value) => {
105
+ insertDateTime(editor, value !== null && value !== void 0 ? value : getDateFormat(editor));
106
+ });
107
+ editor.addCommand('mceInsertTime', (_ui, value) => {
108
+ insertDateTime(editor, value !== null && value !== void 0 ? value : getTimeFormat(editor));
109
+ });
110
+ };
111
+
112
+ const Cell = initial => {
113
+ let value = initial;
114
+ const get = () => {
115
+ return value;
116
+ };
117
+ const set = v => {
118
+ value = v;
119
+ };
120
+ return {
121
+ get,
122
+ set
123
+ };
124
+ };
125
+
126
+ var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
127
+
128
+ const register = editor => {
129
+ const formats = getFormats(editor);
130
+ const defaultFormat = Cell(getDefaultDateTime(editor));
131
+ const insertDateTime = format => editor.execCommand('mceInsertDate', false, format);
132
+ editor.ui.registry.addSplitButton('insertdatetime', {
133
+ icon: 'insert-time',
134
+ tooltip: 'Insert date/time',
135
+ select: value => value === defaultFormat.get(),
136
+ fetch: done => {
137
+ done(global.map(formats, format => ({
138
+ type: 'choiceitem',
139
+ text: getDateTime(editor, format),
140
+ value: format
141
+ })));
142
+ },
143
+ onAction: _api => {
144
+ insertDateTime(defaultFormat.get());
145
+ },
146
+ onItemAction: (_api, value) => {
147
+ defaultFormat.set(value);
148
+ insertDateTime(value);
149
+ }
150
+ });
151
+ const makeMenuItemHandler = format => () => {
152
+ defaultFormat.set(format);
153
+ insertDateTime(format);
154
+ };
155
+ editor.ui.registry.addNestedMenuItem('insertdatetime', {
156
+ icon: 'insert-time',
157
+ text: 'Date/time',
158
+ getSubmenuItems: () => global.map(formats, format => ({
159
+ type: 'menuitem',
160
+ text: getDateTime(editor, format),
161
+ onAction: makeMenuItemHandler(format)
162
+ }))
163
+ });
164
+ };
165
+
166
+ var Plugin = () => {
167
+ global$1.add('insertdatetime', editor => {
168
+ register$2(editor);
169
+ register$1(editor);
170
+ register(editor);
171
+ });
172
+ };
173
+
174
+ Plugin();
175
+
176
+ })();
@@ -0,0 +1,4 @@
1
+ /**
2
+ * TinyMCE version 6.1.2 (2022-07-29)
3
+ */
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>t.options.get(e),r=t("insertdatetime_dateformat"),a=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 r=0;r<t-e.length;r++)e="0"+e;return e},d=(e,t,r=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",""+r.getFullYear())).replace("%y",""+r.getYear())).replace("%m",c(r.getMonth()+1,2))).replace("%d",c(r.getDate(),2))).replace("%H",""+c(r.getHours(),2))).replace("%M",""+c(r.getMinutes(),2))).replace("%S",""+c(r.getSeconds(),2))).replace("%I",""+((r.getHours()+11)%12+1))).replace("%p",r.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(m[r.getMonth()]))).replace("%b",""+e.translate(l[r.getMonth()]))).replace("%A",""+e.translate(o[r.getDay()]))).replace("%a",""+e.translate(i[r.getDay()]))).replace("%%","%"),u=(e,t)=>{if(s(e)){const r=d(e,t);let a;a=/%[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,r,a)=>{const n=e.dom.create("time",{datetime:r},a);t.parentNode.insertBefore(n,t),e.dom.remove(t),e.selection.select(n,!0),e.selection.collapse(!1)})(e,n,a,r):e.insertContent('<time datetime="'+a+'">'+r+"</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,a)=>{u(e,null!=a?a:r(e))})),e.addCommand("mceInsertTime",((t,r)=>{u(e,null!=r?r:a(e))}))})(e),(e=>{const t=n(e),r=(e=>{let t=e;return{get:()=>t,set:e=>{t=e}}})((e=>{const t=n(e);return t.length>0?t[0]:a(e)})(e)),s=t=>e.execCommand("mceInsertDate",!1,t);e.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:e=>e===r.get(),fetch:r=>{r(p.map(t,(t=>({type:"choiceitem",text:d(e,t),value:t}))))},onAction:e=>{s(r.get())},onItemAction:(e,t)=>{r.set(t),s(t)}});const i=e=>()=>{r.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)}))}();
@@ -0,0 +1,7 @@
1
+ // Exports the "link" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/link')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/link'
7
+ require('./plugin.js');