@themarioga/grid-editor 6.0.0 → 7.1.0

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 (147) hide show
  1. package/AUTO_SAVE.md +2 -2
  2. package/BUILDING.md +45 -29
  3. package/CHANGELOG.md +59 -0
  4. package/README.md +163 -87
  5. package/UPGRADING.md +119 -0
  6. package/dist/grideditor.bundle.min.js +14 -0
  7. package/dist/grideditor.d.ts +335 -0
  8. package/dist/grideditor.esm.js +3977 -0
  9. package/dist/grideditor.jquery.js +253 -0
  10. package/dist/grideditor.jquery.min.js +1 -0
  11. package/dist/grideditor.jquery.min.js.map +7 -0
  12. package/dist/grideditor.js +3983 -0
  13. package/dist/grideditor.min.js +6 -0
  14. package/dist/grideditor.min.js.map +7 -0
  15. package/dist/locales/grideditor.es.esm.js +158 -0
  16. package/dist/locales/grideditor.es.js +164 -168
  17. package/dist/locales/grideditor.es.min.js +6 -2
  18. package/dist/locales/grideditor.es.min.js.map +7 -1
  19. package/dist/plugins/grideditor.accordion.esm.js +294 -0
  20. package/dist/plugins/grideditor.accordion.js +286 -180
  21. package/dist/plugins/grideditor.accordion.min.js +1 -2
  22. package/dist/plugins/grideditor.accordion.min.js.map +7 -1
  23. package/dist/plugins/grideditor.alignment.esm.js +55 -0
  24. package/dist/plugins/grideditor.alignment.js +58 -77
  25. package/dist/plugins/grideditor.alignment.min.js +1 -2
  26. package/dist/plugins/grideditor.alignment.min.js.map +7 -1
  27. package/dist/plugins/grideditor.card.esm.js +73 -0
  28. package/dist/plugins/grideditor.card.js +74 -64
  29. package/dist/plugins/grideditor.card.min.js +1 -2
  30. package/dist/plugins/grideditor.card.min.js.map +7 -1
  31. package/dist/plugins/grideditor.ckeditor.esm.js +500 -0
  32. package/dist/plugins/grideditor.ckeditor.js +484 -449
  33. package/dist/plugins/grideditor.ckeditor.min.js +1 -2
  34. package/dist/plugins/grideditor.ckeditor.min.js.map +7 -1
  35. package/dist/plugins/grideditor.clipboard.esm.js +326 -0
  36. package/dist/plugins/grideditor.clipboard.js +298 -235
  37. package/dist/plugins/grideditor.clipboard.min.js +1 -2
  38. package/dist/plugins/grideditor.clipboard.min.js.map +7 -1
  39. package/dist/plugins/grideditor.codemirror-inline.esm.js +205 -0
  40. package/dist/plugins/grideditor.codemirror-inline.js +188 -168
  41. package/dist/plugins/grideditor.codemirror-inline.min.js +1 -2
  42. package/dist/plugins/grideditor.codemirror-inline.min.js.map +7 -1
  43. package/dist/plugins/grideditor.codemirror.esm.js +63 -0
  44. package/dist/plugins/grideditor.codemirror.js +60 -71
  45. package/dist/plugins/grideditor.codemirror.min.js +1 -2
  46. package/dist/plugins/grideditor.codemirror.min.js.map +7 -1
  47. package/dist/plugins/grideditor.elements.esm.js +271 -0
  48. package/dist/plugins/grideditor.elements.js +256 -149
  49. package/dist/plugins/grideditor.elements.min.js +1 -2
  50. package/dist/plugins/grideditor.elements.min.js.map +7 -1
  51. package/dist/plugins/grideditor.float.esm.js +34 -0
  52. package/dist/plugins/grideditor.float.js +37 -52
  53. package/dist/plugins/grideditor.float.min.js +1 -2
  54. package/dist/plugins/grideditor.float.min.js.map +7 -1
  55. package/dist/plugins/grideditor.gutters.esm.js +143 -0
  56. package/dist/plugins/grideditor.gutters.js +134 -131
  57. package/dist/plugins/grideditor.gutters.min.js +1 -2
  58. package/dist/plugins/grideditor.gutters.min.js.map +7 -1
  59. package/dist/plugins/grideditor.order.esm.js +189 -0
  60. package/dist/plugins/grideditor.order.js +170 -182
  61. package/dist/plugins/grideditor.order.min.js +1 -2
  62. package/dist/plugins/grideditor.order.min.js.map +7 -1
  63. package/dist/plugins/grideditor.popup.esm.js +187 -0
  64. package/dist/plugins/grideditor.popup.js +183 -134
  65. package/dist/plugins/grideditor.popup.min.js +1 -2
  66. package/dist/plugins/grideditor.popup.min.js.map +7 -1
  67. package/dist/plugins/grideditor.sections.esm.js +271 -0
  68. package/dist/plugins/grideditor.sections.js +250 -173
  69. package/dist/plugins/grideditor.sections.min.js +1 -2
  70. package/dist/plugins/grideditor.sections.min.js.map +7 -1
  71. package/dist/plugins/grideditor.spacing.esm.js +318 -0
  72. package/dist/plugins/grideditor.spacing.js +296 -272
  73. package/dist/plugins/grideditor.spacing.min.js +1 -2
  74. package/dist/plugins/grideditor.spacing.min.js.map +7 -1
  75. package/dist/plugins/grideditor.summernote.esm.js +509 -0
  76. package/dist/plugins/grideditor.summernote.js +493 -427
  77. package/dist/plugins/grideditor.summernote.min.js +1 -2
  78. package/dist/plugins/grideditor.summernote.min.js.map +7 -1
  79. package/dist/plugins/grideditor.tabs.esm.js +237 -0
  80. package/dist/plugins/grideditor.tabs.js +233 -139
  81. package/dist/plugins/grideditor.tabs.min.js +1 -2
  82. package/dist/plugins/grideditor.tabs.min.js.map +7 -1
  83. package/dist/plugins/grideditor.textalign.esm.js +40 -0
  84. package/dist/plugins/grideditor.textalign.js +43 -56
  85. package/dist/plugins/grideditor.textalign.min.js +1 -2
  86. package/dist/plugins/grideditor.textalign.min.js.map +7 -1
  87. package/dist/plugins/grideditor.tinymce.esm.js +519 -0
  88. package/dist/plugins/grideditor.tinymce.js +502 -490
  89. package/dist/plugins/grideditor.tinymce.min.js +1 -2
  90. package/dist/plugins/grideditor.tinymce.min.js.map +7 -1
  91. package/dist/plugins/grideditor.visibility.esm.js +158 -0
  92. package/dist/plugins/grideditor.visibility.js +140 -149
  93. package/dist/plugins/grideditor.visibility.min.js +1 -2
  94. package/dist/plugins/grideditor.visibility.min.js.map +7 -1
  95. package/docs/events.md +47 -21
  96. package/docs/locale-keys.md +6 -0
  97. package/docs/plugins.md +47 -25
  98. package/example/adapter.html +112 -0
  99. package/example/attributes.html +89 -62
  100. package/example/autocols.html +9 -9
  101. package/example/autosave.html +18 -16
  102. package/example/basic.html +8 -6
  103. package/example/breakpoints.html +5 -6
  104. package/example/ckeditor.html +4 -5
  105. package/example/clipboard.html +15 -11
  106. package/example/codemirror.html +13 -8
  107. package/example/containers.html +11 -9
  108. package/example/custom_editor.html +53 -34
  109. package/example/elements.html +14 -12
  110. package/example/index.html +16 -2
  111. package/example/locale.html +6 -7
  112. package/example/plugins.html +44 -29
  113. package/example/summernote.html +6 -5
  114. package/example/utilities.html +17 -13
  115. package/example/wrap_content.html +13 -10
  116. package/package.json +44 -12
  117. package/src/js/dom.js +401 -0
  118. package/src/js/grideditor.classic.js +16 -0
  119. package/src/js/grideditor.jquery.js +325 -0
  120. package/src/js/{jquery.grideditor.js → grideditor.js} +1284 -1124
  121. package/src/js/locales/grideditor.es.js +163 -156
  122. package/src/js/plugins/grideditor.accordion.js +97 -77
  123. package/src/js/plugins/grideditor.alignment.js +5 -7
  124. package/src/js/plugins/grideditor.card.js +23 -23
  125. package/src/js/plugins/grideditor.ckeditor.js +107 -106
  126. package/src/js/plugins/grideditor.clipboard.js +49 -37
  127. package/src/js/plugins/grideditor.codemirror-inline.js +50 -37
  128. package/src/js/plugins/grideditor.codemirror.js +9 -10
  129. package/src/js/plugins/grideditor.elements.js +57 -33
  130. package/src/js/plugins/grideditor.float.js +4 -6
  131. package/src/js/plugins/grideditor.gutters.js +20 -15
  132. package/src/js/plugins/grideditor.order.js +28 -25
  133. package/src/js/plugins/grideditor.popup.js +63 -51
  134. package/src/js/plugins/grideditor.sections.js +39 -32
  135. package/src/js/plugins/grideditor.spacing.js +42 -45
  136. package/src/js/plugins/grideditor.summernote.js +112 -76
  137. package/src/js/plugins/grideditor.tabs.js +65 -57
  138. package/src/js/plugins/grideditor.textalign.js +4 -6
  139. package/src/js/plugins/grideditor.tinymce.js +148 -140
  140. package/src/js/plugins/grideditor.visibility.js +24 -25
  141. package/src/js/register.js +18 -0
  142. package/src/js/text/grideditor.text.js +77 -56
  143. package/types/grideditor.d.ts +335 -0
  144. package/dist/jquery.grideditor.bundle.min.js +0 -10
  145. package/dist/jquery.grideditor.js +0 -4927
  146. package/dist/jquery.grideditor.min.js +0 -2
  147. package/dist/jquery.grideditor.min.js.map +0 -1
@@ -1,2 +1 @@
1
- (o=>{o.extend(o.fn.gridEditor.locales.en,{"utility.padding":"Padding","utility.margin":"Margin","utility.side_all":"All sides","utility.side_x":"Left and right","utility.side_y":"Top and bottom","utility.side_t":"Top","utility.side_b":"Bottom","utility.side_s":"Start","utility.side_e":"End","utility.spacing_gutter":"A column's side padding is its gutter: changing it changes the gutter"});var m=["0","1","2","3","4","5"],n=["0",".25rem",".5rem","1rem","1.5rem","3rem"],y=["","x","y","t","e","b","s"],h={"":["top","right","bottom","left"],x:["left","right"],y:["top","bottom"],t:["top"],e:["right"],b:["bottom"],s:["left"]},v=["","sm","md","lg","xl","xxl"],x={p:"padding",m:"margin"};function l(t){return new RegExp("^"+t+"[xytbse]?-(?:(?:sm|md|lg|xl|xxl)-)?(?:[0-5]|auto)$")}o.fn.gridEditor.utilities.spacing=function(d){var g=o.extend({values:m,scale:n},d.settings.utilities.spacing),p={p:l("p"),m:l("m")};function r(t,e){return"row"===e||"column"===e||"element"===e||t.is("[data-ge-container]")}function f(t){return(t.attr("class")||"").split(/\s+/)}function a(t,e){return f(t).some(function(t){return p[e].test(t)})}function u(u,l,t){var e=d.breakpoints.indexOf(t),o={},s={},c=null;return y.forEach(function(t,i){var n=((t,e,i)=>{for(var n=f(t),r="m"===e.charAt(0)?m.concat(["auto"]):m,a=i;0<=a;a--)for(var u=0;u<r.length;u++){var l=e+(v[a]?"-"+v[a]:"")+"-"+r[u];if(-1!==n.indexOf(l))return{tier:a,value:r[u]}}return null})(u,l+t,e);n&&h[t].forEach(function(t){var e=o[t];(!e||n.tier>e.tier||n.tier===e.tier&&i>e.order)&&(o[t]={tier:n.tier,order:i,value:n.value})})}),["top","right","bottom","left"].forEach(function(t){var e,i,n,r,a=o[t];a?s[x[l]+"-"+t]="auto"===a.value?"auto":g.scale[a.value]:(c=c||(e=l,n=(a=u).attr("class"),r={},a.attr("class",f(a).filter(function(t){return!p[e].test(t)}).join(" ")),i=getComputedStyle(a[0]),["top","right","bottom","left"].forEach(function(t){r[t]=i.getPropertyValue(x[e]+"-"+t)}),a.attr("class",n),r),s[x[l]+"-"+t]=c[t])}),s}function i(e,i,t){var n,r,a=o('<div class="ge-spacing-group" />').attr("data-ge-spacing",i),u=o('<select class="ge-spacing-side form-select form-select-sm" />'),l=(o('<span class="ge-utility-label" />').text(t).appendTo(a),y.forEach(function(t){o("<option />").attr("value",t).text((t=>{switch(t){case"x":return d.t("utility.side_x");case"y":return d.t("utility.side_y");case"t":return d.t("utility.side_t");case"b":return d.t("utility.side_b");case"s":return d.t("utility.side_s");case"e":return d.t("utility.side_e");default:return d.t("utility.side_all")}})(t)).appendTo(u)}),d.utilityField(e,i+(n=i,r=f(t=e).filter(function(t){return p[n].test(t)}),(t=y.filter(function(e){return r.some(function(t){return 0===t.indexOf(n+e+"-")})})).length?t[0]:"")));return u.val(l.attr("data-ge-family").slice(1)).on("change",function(){var t=d.utilityField(e,i+this.value);l.replaceWith(t),l=t}).appendTo(a),l.appendTo(a),a}var e=".row, .column, .ge-element, [data-ge-container]";function t(e,i){var n="m"===e?m.concat(["auto"]):m,r=g.values.concat("m"===e?["auto"]:[]);return y.map(function(t){return{name:e+t,prefix:e+t,values:n,appliesTo:["row","column","text","element","container"],labelKey:i,panel:!1,choices:function(){return n.filter(function(t){return-1!==r.indexOf(t)})}}})}return{families:t("p","utility.padding").concat(t("m","utility.margin")),panel:function(t,e){return r(t,e)?(t=o('<div class="ge-spacing" />').append(i(t,"p",d.t("utility.padding"))).append(i(t,"m",d.t("utility.margin"))),"column"===e&&o('<small class="ge-spacing-gutter" />').text(d.t("utility.spacing_gutter")).appendTo(t),t):null},preview:function(e,t,i){var n;return r(e,t)?(n={},["p","m"].forEach(function(t){a(e,t)&&o.extend(n,u(e,t,i))}),n):{}},onRefresh:function(t){t.find(e).addBack(e).each(function(){var t,e=o(this),i=e.children(".ge-tools-drawer");i.length&&r(e,d.kindOf(e))&&(a(e,"p")?(t=getComputedStyle(e[0]),i.css({marginTop:"-"+t.paddingTop,marginLeft:"-"+t.paddingLeft,marginRight:"-"+t.paddingRight,width:"calc(100% + "+t.paddingLeft+" + "+t.paddingRight+")"})):i.css({marginTop:"",marginLeft:"",marginRight:"",width:""}),e.hasClass("column"))&&i.find(".ge-spacing-gutter").toggle(f(e).some(function(t){return/^p[xse]?-/.test(t)&&p.p.test(t)}))})}}}})(jQuery);
2
- //# sourceMappingURL=grideditor.spacing.min.js.map
1
+ (()=>{var h=window.GridEditor;if(!h||typeof h.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function w(t,n){return t?Array.prototype.slice.call(t.querySelectorAll(n)):[]}function O(t,n){if(!t)return[];var l=w(t,n);return t.nodeType===1&&t.matches(n)&&l.unshift(t),l}function G(t,n){return t?Array.prototype.filter.call(t.children,function(l){return!n||l.matches(n)}):[]}function _(t,n){return G(t,n)[0]||null}function B(t,n){return!!t&&t.nodeType===1&&t.matches(n)}function m(t,n,l){var f=document.createElement(t);return Object.keys(n||{}).forEach(function(p){var d=n[p];d!=null&&d!==!1&&f.setAttribute(p,d)}),l!=null&&(f.textContent=l),f}function j(t,n){return!!t&&t.nodeType===1&&t.classList.contains(n)}function A(t,n){return Object.keys(n).forEach(function(l){var f=n[l];typeof f=="number"&&!W[l]&&(f=f+"px"),t.style.setProperty(l,f==null?"":String(f))}),t}var W={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},x={};function V(t){var n=t.nodeName;if(!x[n]){var l=document.body.appendChild(document.createElement(n));x[n]=getComputedStyle(l).display,l.remove(),x[n]==="none"&&(x[n]="block")}return x[n]}function X(t){return t.style.removeProperty("display"),getComputedStyle(t).display==="none"&&(t.style.display=V(t)),t}function z(t){return t.style.display="none",t}function R(t,n){return n===void 0&&(n=!K(t)),n?X(t):z(t)}function K(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}Object.assign(h.locales.en,{"utility.padding":"Padding","utility.margin":"Margin","utility.side_all":"All sides","utility.side_x":"Left and right","utility.side_y":"Top and bottom","utility.side_t":"Top","utility.side_b":"Bottom","utility.side_s":"Start","utility.side_e":"End","utility.spacing_gutter":"A column's side padding is its gutter: changing it changes the gutter"});var y=["0","1","2","3","4","5"],$=["0",".25rem",".5rem","1rem","1.5rem","3rem"],b=["","x","y","t","e","b","s"],J={"":["top","right","bottom","left"],x:["left","right"],y:["top","bottom"],t:["top"],e:["right"],b:["bottom"],s:["left"]},N=["","sm","md","lg","xl","xxl"],C={p:"padding",m:"margin"};function P(t){return new RegExp("^"+t+"[xytbse]?-(?:(?:sm|md|lg|xl|xxl)-)?(?:[0-5]|auto)$")}h.utilities.spacing=function(t){var n=Object.assign({values:y,scale:$},t.settings.utilities.spacing),l={p:P("p"),m:P("m")};function f(e,r){return r==="row"||r==="column"||r==="element"||B(e,"[data-ge-container]")}function p(e){return(e.getAttribute("class")||"").split(/\s+/)}function d(e,r){return p(e).some(function(u){return l[r].test(u)})}function H(e,r,u){for(var o=p(e),a=r.charAt(0)==="m"?y.concat(["auto"]):y,i=u;i>=0;i--)for(var s=0;s<a.length;s++){var c=r+(N[i]?"-"+N[i]:"")+"-"+a[s];if(o.indexOf(c)!==-1)return{tier:i,value:a[s]}}return null}function I(e,r){var u=e.getAttribute("class"),o,a={};return e.setAttribute("class",p(e).filter(function(i){return!l[r].test(i)}).join(" ")),o=getComputedStyle(e),["top","right","bottom","left"].forEach(function(i){a[i]=o.getPropertyValue(C[r]+"-"+i)}),u===null?e.removeAttribute("class"):e.setAttribute("class",u),a}function D(e,r,u){var o=t.breakpoints.indexOf(u),a={},i={},s=null;return b.forEach(function(c,g){var v=H(e,r+c,o);v&&J[c].forEach(function(L){var E=a[L];(!E||v.tier>E.tier||v.tier===E.tier&&g>E.order)&&(a[L]={tier:v.tier,order:g,value:v.value})})}),["top","right","bottom","left"].forEach(function(c){var g=a[c];g?i[C[r]+"-"+c]=g.value==="auto"?"auto":n.scale[g.value]:(s=s||I(e,r),i[C[r]+"-"+c]=s[c])}),i}function F(e,r){var u=p(e).filter(function(a){return l[r].test(a)}),o=b.filter(function(a){return u.some(function(i){return i.indexOf(r+a+"-")===0})});return o.length?o[0]:""}function U(e){switch(e){case"x":return t.t("utility.side_x");case"y":return t.t("utility.side_y");case"t":return t.t("utility.side_t");case"b":return t.t("utility.side_b");case"s":return t.t("utility.side_s");case"e":return t.t("utility.side_e");default:return t.t("utility.side_all")}}function S(e,r,u){var o=m("div",{class:"ge-spacing-group","data-ge-spacing":r}),a=m("select",{class:"ge-spacing-side form-select form-select-sm"});o.appendChild(m("span",{class:"ge-utility-label"},u)),b.forEach(function(s){a.appendChild(m("option",{value:s},U(s)))});var i=t.utilityField(e,r+F(e,r));return a.value=i.getAttribute("data-ge-family").slice(1),a.addEventListener("change",function(){var s=t.utilityField(e,r+this.value);i.replaceWith(s),i=s}),o.appendChild(a),o.appendChild(i),o}var M=".row, .column, .ge-element, [data-ge-container]";function q(e){O(e,M).forEach(function(r){var u=_(r,".ge-tools-drawer");if(!(!u||!f(r,t.kindOf(r)))){if(d(r,"p")){var o=getComputedStyle(r);A(u,{"margin-top":"-"+o.paddingTop,"margin-left":"-"+o.paddingLeft,"margin-right":"-"+o.paddingRight,width:"calc(100% + "+o.paddingLeft+" + "+o.paddingRight+")"})}else A(u,{"margin-top":"","margin-left":"","margin-right":"",width:""});if(j(r,"column")){var a=p(r).some(function(i){return/^p[xse]?-/.test(i)&&l.p.test(i)});w(u,".ge-spacing-gutter").forEach(function(i){R(i,a)})}}})}function T(e,r){var u=e==="m"?y.concat(["auto"]):y,o=n.values.concat(e==="m"?["auto"]:[]);return b.map(function(a){return{name:e+a,prefix:e+a,values:u,appliesTo:["row","column","text","element","container"],labelKey:r,panel:!1,choices:function(){return u.filter(function(i){return o.indexOf(i)!==-1})}}})}return{families:T("p","utility.padding").concat(T("m","utility.margin")),panel:function(e,r){if(!f(e,r))return null;var u=m("div",{class:"ge-spacing"});return u.appendChild(S(e,"p",t.t("utility.padding"))),u.appendChild(S(e,"m",t.t("utility.margin"))),r==="column"&&u.appendChild(m("small",{class:"ge-spacing-gutter"},t.t("utility.spacing_gutter"))),u},preview:function(e,r,u){if(!f(e,r))return{};var o={};return["p","m"].forEach(function(a){d(e,a)&&Object.assign(o,D(e,a,u))}),o},onRefresh:q}};})();
@@ -1 +1,7 @@
1
- {"version":3,"file":"grideditor.spacing.min.js","sources":["../../src/js/plugins/grideditor.spacing.js"],"names":["$","extend","fn","gridEditor","locales","en","utility.padding","utility.margin","utility.side_all","utility.side_x","utility.side_y","utility.side_t","utility.side_b","utility.side_s","utility.side_e","utility.spacing_gutter","VALUES","SCALE","SIDES","SET","","x","y","t","e","b","s","INFIXES","PROPERTIES","p","m","pattern","key","RegExp","utilities","spacing","ge","options","values","scale","settings","patterns","applies","node","kind","is","classes","attr","split","carries","some","name","test","sides","breakpoint","tier","breakpoints","indexOf","winners","styles","neutral","forEach","side","order","found","family","names","charAt","concat","i","v","length","value","set","current","style","original","bare","winner","filter","join","getComputedStyle","getPropertyValue","group","labelText","box","field","text","appendTo","utilityField","val","slice","on","next","this","replaceWith","NODES","families","labelKey","offered","map","prefix","appliesTo","panel","choices","append","preview","onRefresh","scope","find","addBack","each","drawer","children","kindOf","css","marginTop","paddingTop","marginLeft","paddingLeft","marginRight","paddingRight","width","hasClass","toggle","jQuery"],"mappings":"CAmBUA,IAEVA,EAAEC,OAAOD,EAAEE,GAAGC,WAAWC,QAAQC,GAAI,CACjCC,kBAAmB,UACnBC,iBAAkB,SAClBC,mBAAoB,YACpBC,iBAAkB,iBAClBC,iBAAkB,iBAClBC,iBAAkB,MAClBC,iBAAkB,SAClBC,iBAAkB,QAClBC,iBAAkB,MAClBC,yBAA0B,uEAC9B,CAAC,EAED,IAAIC,EAAS,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,KAGnCC,EAAQ,CAAC,IAAK,SAAU,QAAS,OAAQ,SAAU,QAMnDC,EAAQ,CAAC,GAAI,IAAK,IAAK,IAAK,IAAK,IAAK,KAGtCC,EAAM,CACNC,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"sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are the ones 6.x had through jQuery: 400 ms unless the\n * caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Spacing for grid-editor.\n *\n * A utility plugin: load this file after the editor and every row, column,\n * element and container can have its padding and margin set per breakpoint,\n * with Bootstrap's p-{breakpoint}-*, pt-, px- \u2026 and m-{breakpoint}-*, mt-, mx-\n * \u2026 classes. What it can ask the editor for is the handle its factory is\n * called with, described in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.spacing.min.js\"></script>\n *\n * Fourteen families would be fourteen fields, so the panel has two, padding\n * and margin, each a choice of side and a value for that side.\n *\n * utilities.spacing.values narrows the values offered, and\n * utilities.spacing.scale is what 0 to 5 come to, for a page that changed\n * Bootstrap's $spacers.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'utility.padding': 'Padding',\n 'utility.margin': 'Margin',\n 'utility.side_all': 'All sides',\n 'utility.side_x': 'Left and right',\n 'utility.side_y': 'Top and bottom',\n 'utility.side_t': 'Top',\n 'utility.side_b': 'Bottom',\n 'utility.side_s': 'Start',\n 'utility.side_e': 'End',\n 'utility.spacing_gutter': 'A column\\'s side padding is its gutter: changing it changes the gutter',\n});\n\nvar VALUES = ['0', '1', '2', '3', '4', '5'];\n\n/** Bootstrap's $spacers. */\nvar SCALE = ['0', '.25rem', '.5rem', '1rem', '1.5rem', '3rem'];\n\n/**\n * The sides, in the order Bootstrap's css writes their rules: within one\n * breakpoint a later rule wins, so p-3 pt-1 has a top of .25rem.\n */\nvar SIDES = ['', 'x', 'y', 't', 'e', 'b', 's'];\n\n/** What each side sets. Start and end are left and right: Bootstrap's css is left to right. */\nvar SET = {\n '': ['top', 'right', 'bottom', 'left'],\n x: ['left', 'right'],\n y: ['top', 'bottom'],\n t: ['top'],\n e: ['right'],\n b: ['bottom'],\n s: ['left'],\n};\n\nvar INFIXES = ['', 'sm', 'md', 'lg', 'xl', 'xxl'];\n\nvar PROPERTIES = { p: 'padding', m: 'margin' };\n\n/** Every class of the plugin's, padding or margin. */\nfunction pattern(key) {\n return new RegExp('^' + key + '[xytbse]?-(?:(?:sm|md|lg|xl|xxl)-)?(?:[0-5]|auto)$');\n}\n\nGridEditor.utilities.spacing = function(ge) {\n\n var options = Object.assign({ values: VALUES, scale: SCALE }, ge.settings.utilities.spacing);\n var patterns = { p: pattern('p'), m: pattern('m') };\n\n function applies(node, kind) {\n return kind === 'row' || kind === 'column' || kind === 'element' ||\n dom.is(node, '[data-ge-container]');\n }\n\n function classes(node) {\n return (node.getAttribute('class') || '').split(/\\s+/);\n }\n\n function carries(node, key) {\n return classes(node).some(function(name) { return patterns[key].test(name); });\n }\n\n /**\n * The class of one family that decides a side at a breakpoint: the\n * widest breakpoint up to it that has one, as { tier, value }.\n */\n function source(node, family, tier) {\n var names = classes(node);\n var values = family.charAt(0) === 'm' ? VALUES.concat(['auto']) : VALUES;\n\n for (var i = tier; i >= 0; i--) {\n for (var v = 0; v < values.length; v++) {\n var name = family + (INFIXES[i] ? '-' + INFIXES[i] : '') + '-' + values[v];\n if (names.indexOf(name) !== -1) { return { tier: i, value: values[v] }; }\n }\n }\n\n return null;\n }\n\n /**\n * What padding or margin is on each side with none of the plugin's\n * classes: the editor's frame for a row or a column, the host's css\n * for anything else. Read by taking the classes off for a moment,\n * since that is the only way to ask the browser.\n */\n function without(node, key) {\n var original = node.getAttribute('class');\n var style;\n var bare = {};\n\n node.setAttribute('class', classes(node).filter(function(name) { return !patterns[key].test(name); }).join(' '));\n style = getComputedStyle(node);\n ['top', 'right', 'bottom', 'left'].forEach(function(side) {\n bare[side] = style.getPropertyValue(PROPERTIES[key] + '-' + side);\n });\n if (original === null) { node.removeAttribute('class'); } else { node.setAttribute('class', original); }\n\n return bare;\n }\n\n /**\n * Each side the way Bootstrap's css settles it: the class from the\n * widest breakpoint wins, and within one breakpoint the side written\n * later in the css. A side no class reaches shows what it is without\n * any, over a wider breakpoint's class that is live in a wide window.\n */\n function sides(node, key, breakpoint) {\n var tier = ge.breakpoints.indexOf(breakpoint);\n var winners = {};\n var styles = {};\n var neutral = null;\n\n SIDES.forEach(function(side, order) {\n var found = source(node, key + side, tier);\n if (!found) { return; }\n\n SET[side].forEach(function(set) {\n var current = winners[set];\n if (!current || found.tier > current.tier || (found.tier === current.tier && order > current.order)) {\n winners[set] = { tier: found.tier, order: order, value: found.value };\n }\n });\n });\n\n ['top', 'right', 'bottom', 'left'].forEach(function(set) {\n var winner = winners[set];\n\n if (!winner) {\n neutral = neutral || without(node, key);\n styles[PROPERTIES[key] + '-' + set] = neutral[set];\n } else {\n styles[PROPERTIES[key] + '-' + set] = winner.value === 'auto' ? 'auto' : options.scale[winner.value];\n }\n });\n\n return styles;\n }\n\n /** The side a group's select starts on: the first that has a class, or all. */\n function startingSide(node, key) {\n var names = classes(node).filter(function(name) { return patterns[key].test(name); });\n var found = SIDES.filter(function(side) {\n return names.some(function(name) { return name.indexOf(key + side + '-') === 0; });\n });\n\n return found.length ? found[0] : '';\n }\n\n function sideLabel(side) {\n switch (side) {\n case 'x': return ge.t('utility.side_x');\n case 'y': return ge.t('utility.side_y');\n case 't': return ge.t('utility.side_t');\n case 'b': return ge.t('utility.side_b');\n case 's': return ge.t('utility.side_s');\n case 'e': return ge.t('utility.side_e');\n default: return ge.t('utility.side_all');\n }\n }\n\n /** A padding or margin group: its name, the side, and the field of that side's family. */\n function group(node, key, labelText) {\n var box = dom.element('div', { 'class': 'ge-spacing-group', 'data-ge-spacing': key });\n var side = dom.element('select', { 'class': 'ge-spacing-side form-select form-select-sm' });\n\n box.appendChild(dom.element('span', { 'class': 'ge-utility-label' }, labelText));\n\n SIDES.forEach(function(value) {\n side.appendChild(dom.element('option', { value: value }, sideLabel(value)));\n });\n\n var field = ge.utilityField(node, key + startingSide(node, key));\n\n side.value = field.getAttribute('data-ge-family').slice(1);\n side.addEventListener('change', function() {\n var next = ge.utilityField(node, key + this.value);\n field.replaceWith(next);\n field = next;\n });\n box.appendChild(side);\n box.appendChild(field);\n\n return box;\n }\n\n var NODES = '.row, .column, .ge-element, [data-ge-container]';\n\n /**\n * Keep each drawer on its node's edges. A drawer is pulled out over the\n * editor's frame by as much as the frame pads the node, and a padding\n * class replaces the frame, so a padded node's drawer is pulled out by\n * its real padding instead. And a column padded at the sides gets a word\n * about what that does to its gutter.\n */\n function mark(scope) {\n dom.selfAndAll(scope, NODES).forEach(function(node) {\n var drawer = dom.child(node, '.ge-tools-drawer');\n\n if (!drawer || !applies(node, ge.kindOf(node))) { return; }\n\n if (carries(node, 'p')) {\n var style = getComputedStyle(node);\n\n dom.css(drawer, {\n 'margin-top': '-' + style.paddingTop,\n 'margin-left': '-' + style.paddingLeft,\n 'margin-right': '-' + style.paddingRight,\n width: 'calc(100% + ' + style.paddingLeft + ' + ' + style.paddingRight + ')',\n });\n } else {\n dom.css(drawer, { 'margin-top': '', 'margin-left': '', 'margin-right': '', width: '' });\n }\n\n if (dom.hasClass(node, 'column')) {\n var padded = classes(node).some(function(name) {\n return /^p[xse]?-/.test(name) && patterns.p.test(name);\n });\n dom.all(drawer, '.ge-spacing-gutter').forEach(function(note) { dom.toggle(note, padded); });\n }\n });\n }\n\n function families(key, labelKey) {\n var values = key === 'm' ? VALUES.concat(['auto']) : VALUES;\n var offered = options.values.concat(key === 'm' ? ['auto'] : []);\n\n return SIDES.map(function(side) {\n return {\n name: key + side,\n prefix: key + side,\n values: values,\n appliesTo: ['row', 'column', 'text', 'element', 'container'],\n labelKey: labelKey,\n panel: false,\n choices: function() {\n return values.filter(function(value) { return offered.indexOf(value) !== -1; });\n },\n };\n });\n }\n\n return {\n families: families('p', 'utility.padding').concat(families('m', 'utility.margin')),\n\n panel: function(node, kind) {\n if (!applies(node, kind)) { return null; }\n\n var box = dom.element('div', { 'class': 'ge-spacing' });\n box.appendChild(group(node, 'p', ge.t('utility.padding')));\n box.appendChild(group(node, 'm', ge.t('utility.margin')));\n\n if (kind === 'column') {\n box.appendChild(dom.element('small', { 'class': 'ge-spacing-gutter' }, ge.t('utility.spacing_gutter')));\n }\n\n return box;\n },\n\n preview: function(node, kind, breakpoint) {\n if (!applies(node, kind)) { return {}; }\n\n var styles = {};\n\n ['p', 'm'].forEach(function(key) {\n if (carries(node, key)) { Object.assign(styles, sides(node, key, breakpoint)); }\n });\n\n return styles;\n },\n\n onRefresh: mark,\n };\n};\n"],
5
+ "mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECCvC,SAASC,EAAIC,EAAMC,EAAU,CAChC,OAAOD,EAAO,MAAM,UAAU,MAAM,KAAKA,EAAK,iBAAiBC,CAAQ,CAAC,EAAI,CAAC,CACjF,CAQO,SAASC,EAAWC,EAAMC,EAAU,CACvC,GAAI,CAACD,EAAQ,MAAO,CAAC,EAErB,IAAIE,EAAQC,EAAIH,EAAMC,CAAQ,EAC9B,OAAID,EAAK,WAAa,GAAKA,EAAK,QAAQC,CAAQ,GAAKC,EAAM,QAAQF,CAAI,EAChEE,CACX,CAGO,SAASE,EAASC,EAAMJ,EAAU,CACrC,OAAKI,EAEE,MAAM,UAAU,OAAO,KAAKA,EAAK,SAAU,SAASC,EAAM,CAC7D,MAAO,CAACL,GAAYK,EAAK,QAAQL,CAAQ,CAC7C,CAAC,EAJmB,CAAC,CAKzB,CAGO,SAASM,EAAMF,EAAMJ,EAAU,CAClC,OAAOG,EAASC,EAAMJ,CAAQ,EAAE,CAAC,GAAK,IAC1C,CAWO,SAASO,EAAGC,EAAMC,EAAU,CAC/B,MAAO,CAAC,CAACD,GAAQA,EAAK,WAAa,GAAKA,EAAK,QAAQC,CAAQ,CACjE,CAgDO,SAASC,EAAQC,EAAKC,EAAYC,EAA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AO,SAAU,OAAQ,UAAW,WAAW,EAC3D,SAAUuC,EACV,MAAO,GACP,QAAS,UAAW,CAChB,OAAOvC,EAAO,OAAO,SAASuB,EAAO,CAAE,OAAOiB,EAAQ,QAAQjB,CAAK,IAAM,EAAI,CAAC,CAClF,CACJ,CACJ,CAAC,CACL,CAEA,MAAO,CACH,SAAUe,EAAS,IAAK,iBAAiB,EAAE,OAAOA,EAAS,IAAK,gBAAgB,CAAC,EAEjF,MAAO,SAAShD,EAAMC,EAAM,CACxB,GAAI,CAACF,EAAQC,EAAMC,CAAI,EAAK,OAAO,KAEnC,IAAI8B,EAAUC,EAAQ,MAAO,CAAE,MAAS,YAAa,CAAC,EACtD,OAAAD,EAAI,YAAYF,EAAM7B,EAAM,IAAKJ,EAAG,EAAE,iBAAiB,CAAC,CAAC,EACzDmC,EAAI,YAAYF,EAAM7B,EAAM,IAAKJ,EAAG,EAAE,gBAAgB,CAAC,CAAC,EAEpDK,IAAS,UACT8B,EAAI,YAAgBC,EAAQ,QAAS,CAAE,MAAS,mBAAoB,EAAGpC,EAAG,EAAE,wBAAwB,CAAC,CAAC,EAGnGmC,CACX,EAEA,QAAS,SAAS/B,EAAMC,EAAMiB,EAAY,CACtC,GAAI,CAACnB,EAAQC,EAAMC,CAAI,EAAK,MAAO,CAAC,EAEpC,IAAImB,EAAS,CAAC,EAEd,OAAC,IAAK,GAAG,EAAE,QAAQ,SAASzB,EAAK,CACzBS,EAAQJ,EAAML,CAAG,GAAK,OAAO,OAAOyB,EAAQH,EAAMjB,EAAML,EAAKuB,CAAU,CAAC,CAChF,CAAC,EAEME,CACX,EAEA,UAAWiB,CACf,CACJ",
6
+ "names": ["GridEditor", "all", "root", "selector", "selfAndAll", "root", "selector", "found", "all", "children", "node", "each", "child", "is", "node", "selector", "element", "tag", "attributes", "text", "node", "name", "value", "hasClass", "node", "name", "css", "node", "styles", "property", "value", "UNITLESS", "defaultDisplays", "defaultDisplay", "tag", "probe", "show", "hide", "toggle", "state", "visible", "GridEditor", "VALUES", "SCALE", "SIDES", "SET", "INFIXES", "PROPERTIES", "pattern", "key", "ge", "options", "patterns", "applies", "node", "kind", "is", "classes", "carries", "name", "source", "family", "tier", "names", "values", "v", "without", "original", "style", "bare", "side", "sides", "breakpoint", "winners", "styles", "neutral", "order", "found", "set", "current", "winner", "startingSide", "sideLabel", "group", "labelText", "box", "element", "value", "field", "next", "NODES", "mark", "scope", "selfAndAll", "drawer", "child", "css", "hasClass", "padded", "all", "note", "toggle", "families", "labelKey", "offered"]
7
+ }
@@ -0,0 +1,509 @@
1
+ // src/js/plugins/grideditor.summernote.js
2
+ import { GridEditor as GridEditor2 } from "../grideditor.esm.js";
3
+
4
+ // src/js/dom.js
5
+ function all(root, selector) {
6
+ return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];
7
+ }
8
+ function children(node, selector) {
9
+ if (!node) {
10
+ return [];
11
+ }
12
+ return Array.prototype.filter.call(node.children, function(each) {
13
+ return !selector || each.matches(selector);
14
+ });
15
+ }
16
+ function child(node, selector) {
17
+ return children(node, selector)[0] || null;
18
+ }
19
+ function closest(node, selector, stopAt) {
20
+ var found = node && node.nodeType === 1 ? node.closest(selector) : null;
21
+ if (found && stopAt && found !== stopAt && !stopAt.contains(found)) {
22
+ return null;
23
+ }
24
+ return found;
25
+ }
26
+ function element(tag, attributes, text) {
27
+ var node = document.createElement(tag);
28
+ Object.keys(attributes || {}).forEach(function(name) {
29
+ var value = attributes[name];
30
+ if (value !== null && value !== void 0 && value !== false) {
31
+ node.setAttribute(name, value);
32
+ }
33
+ });
34
+ if (text !== void 0 && text !== null) {
35
+ node.textContent = text;
36
+ }
37
+ return node;
38
+ }
39
+ function setHtml(node, html) {
40
+ node.innerHTML = html === void 0 || html === null ? "" : String(html);
41
+ return node;
42
+ }
43
+ function addClass(node, names) {
44
+ split(names).forEach(function(name) {
45
+ node.classList.add(name);
46
+ });
47
+ return node;
48
+ }
49
+ function removeClass(node, names) {
50
+ split(names).forEach(function(name) {
51
+ node.classList.remove(name);
52
+ });
53
+ return node;
54
+ }
55
+ function hasClass(node, name) {
56
+ return !!node && node.nodeType === 1 && node.classList.contains(name);
57
+ }
58
+ function split(names) {
59
+ return String(names || "").split(/\s+/).filter(Boolean);
60
+ }
61
+ function hide(node) {
62
+ node.style.display = "none";
63
+ return node;
64
+ }
65
+ function visible(node) {
66
+ return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);
67
+ }
68
+ function delegate(root, types, selector, handler, options) {
69
+ var listener = function(event) {
70
+ var match = closest(event.target, selector, root);
71
+ if (match && root.contains(match)) {
72
+ return handler.call(match, event);
73
+ }
74
+ return void 0;
75
+ };
76
+ split(types).forEach(function(type) {
77
+ root.addEventListener(type, listener, options);
78
+ });
79
+ return listener;
80
+ }
81
+ var DEFAULT_DURATION = 400;
82
+ function animateAway(node, frames, duration, done) {
83
+ duration = duration === void 0 ? DEFAULT_DURATION : duration;
84
+ var finish = function() {
85
+ hide(node);
86
+ if (done) {
87
+ done();
88
+ }
89
+ };
90
+ if (!visible(node) || !node.animate || duration <= 0) {
91
+ window.setTimeout(finish, 0);
92
+ return;
93
+ }
94
+ var animation = node.animate(frames(getComputedStyle(node)), {
95
+ duration,
96
+ easing: "ease-in-out"
97
+ });
98
+ var called = false;
99
+ var once = function() {
100
+ if (called) {
101
+ return;
102
+ }
103
+ called = true;
104
+ finish();
105
+ };
106
+ animation.onfinish = once;
107
+ animation.oncancel = once;
108
+ }
109
+ function slideUp(node, duration, done) {
110
+ if (typeof duration === "function") {
111
+ done = duration;
112
+ duration = void 0;
113
+ }
114
+ node.style.overflow = "hidden";
115
+ animateAway(node, function(style) {
116
+ return [
117
+ {
118
+ height: style.height,
119
+ paddingTop: style.paddingTop,
120
+ paddingBottom: style.paddingBottom,
121
+ marginTop: style.marginTop,
122
+ marginBottom: style.marginBottom
123
+ },
124
+ { height: "0px", paddingTop: "0px", paddingBottom: "0px", marginTop: "0px", marginBottom: "0px" }
125
+ ];
126
+ }, duration, function() {
127
+ node.style.removeProperty("overflow");
128
+ if (done) {
129
+ done();
130
+ }
131
+ });
132
+ }
133
+
134
+ // src/js/text/grideditor.text.js
135
+ import { GridEditor } from "../grideditor.esm.js";
136
+ if (!GridEditor.features.text) {
137
+ let attributesOf = function(element2) {
138
+ var found = {};
139
+ Array.prototype.slice.call(element2.attributes).forEach(function(attribute) {
140
+ found[attribute.name] = attribute.value;
141
+ });
142
+ return found;
143
+ }, classesIn = function(value) {
144
+ return (value || "").split(/\s+/).filter(function(name) {
145
+ return name !== "" && !EDITOR_CLASS.test(name);
146
+ });
147
+ }, restoreAttributes = function(block, before, ready, open) {
148
+ var result = Object.assign({}, before);
149
+ Object.keys(Object.assign({}, ready, open)).forEach(function(name) {
150
+ if (name === "class" || EDITOR_ATTRIBUTE.test(name) || ready[name] === open[name]) {
151
+ return;
152
+ }
153
+ if (open[name] === void 0) {
154
+ delete result[name];
155
+ } else {
156
+ result[name] = open[name];
157
+ }
158
+ });
159
+ var readyClasses = classesIn(ready["class"]);
160
+ var openClasses = classesIn(open["class"]);
161
+ var classes = classesIn(before["class"]).filter(function(name) {
162
+ return openClasses.indexOf(name) !== -1 || readyClasses.indexOf(name) === -1;
163
+ });
164
+ openClasses.forEach(function(name) {
165
+ if (readyClasses.indexOf(name) === -1 && classes.indexOf(name) === -1) {
166
+ classes.push(name);
167
+ }
168
+ });
169
+ if (classes.length) {
170
+ result["class"] = classes.join(" ");
171
+ } else {
172
+ delete result["class"];
173
+ }
174
+ Object.keys(attributesOf(block)).forEach(function(name) {
175
+ block.removeAttribute(name);
176
+ });
177
+ Object.keys(result).forEach(function(name) {
178
+ block.setAttribute(name, result[name]);
179
+ });
180
+ }, textFeature = function(ge) {
181
+ var settings = ge.settings;
182
+ var TEXTS = {};
183
+ var warned = {};
184
+ Object.keys(GridEditor.texts).forEach(function(type) {
185
+ TEXTS[type] = GridEditor.texts[type](ge);
186
+ });
187
+ if (!Array.isArray(settings.content_types)) {
188
+ settings.content_types = Object.keys(TEXTS);
189
+ }
190
+ if (!Array.isArray(settings.text_tools)) {
191
+ settings.text_tools = [];
192
+ }
193
+ if (!Array.isArray(settings.text_classes)) {
194
+ settings.text_classes = [];
195
+ }
196
+ function offeredTexts() {
197
+ return settings.content_types.filter(function(type) {
198
+ return !!TEXTS[type];
199
+ });
200
+ }
201
+ function textLabel(type) {
202
+ var text = TEXTS[type];
203
+ return text && text.labelKey ? ge.t(text.labelKey) : type;
204
+ }
205
+ function makeText(type, content) {
206
+ var text = TEXTS[type];
207
+ var block = element("div", {
208
+ "class": "ge-content ge-content-type-" + type,
209
+ "data-ge-content-type": type
210
+ });
211
+ if (content && content.nodeType) {
212
+ block.appendChild(content);
213
+ } else {
214
+ setHtml(block, content !== void 0 ? content : text && text.initialContent || "");
215
+ }
216
+ return block;
217
+ }
218
+ function apiCreateText(type, options) {
219
+ if (type && typeof type === "object") {
220
+ options = type;
221
+ type = void 0;
222
+ }
223
+ options = options || {};
224
+ type = type || offeredTexts()[0];
225
+ if (!type || !TEXTS[type]) {
226
+ if (!warned["createText:" + type]) {
227
+ warned["createText:" + type] = true;
228
+ ge.warn('createText: no text editor "' + type + '" is loaded; load its plugin and name it in content_types');
229
+ }
230
+ return null;
231
+ }
232
+ return ge.place(makeText(type, options.content), "text", options);
233
+ }
234
+ function isOurs(block) {
235
+ return !!TEXTS[block.getAttribute("data-ge-content-type")];
236
+ }
237
+ function startText(block) {
238
+ if (hasClass(block, "ge-rte-active")) {
239
+ return;
240
+ }
241
+ if (!visible(block)) {
242
+ return;
243
+ }
244
+ var text = TEXTS[block.getAttribute("data-ge-content-type")];
245
+ if (!text) {
246
+ return;
247
+ }
248
+ if (text.available && !text.available()) {
249
+ if (text.missingKey) {
250
+ console.error(ge.t(text.missingKey));
251
+ }
252
+ return;
253
+ }
254
+ readBefore.set(block, attributesOf(block));
255
+ readReady.delete(block);
256
+ addClass(block, "ge-rte-active");
257
+ text.start([block]);
258
+ }
259
+ function onClick() {
260
+ startText(this);
261
+ }
262
+ function closeText(block) {
263
+ var text = TEXTS[block.getAttribute("data-ge-content-type")];
264
+ var before = readBefore.get(block);
265
+ var open = before ? attributesOf(block) : null;
266
+ if (text) {
267
+ text.stop([block]);
268
+ }
269
+ removeClass(block, "ge-rte-active");
270
+ if (before) {
271
+ restoreAttributes(block, before, readReady.get(block) || before, open);
272
+ readBefore.delete(block);
273
+ readReady.delete(block);
274
+ }
275
+ }
276
+ function createTextControls(textBlock) {
277
+ var block = child(textBlock, ".ge-content");
278
+ var type = block.getAttribute("data-ge-content-type");
279
+ var drawer = element("div", { "class": "ge-tools-drawer ge-text-drawer" });
280
+ textBlock.insertBefore(drawer, textBlock.firstChild);
281
+ ge.createMoveTool(drawer);
282
+ var details = ge.addSettingsTool(drawer, block, settings.text_classes);
283
+ var general = child(details, ".ge-details-general");
284
+ var editor = element("div", { "class": "ge-field ge-text-editor" });
285
+ editor.appendChild(element("span", { "class": "ge-field-label" }, ge.t("panel.editor")));
286
+ editor.appendChild(element("span", { "class": "ge-field-value" }, textLabel(type)));
287
+ general.insertBefore(editor, general.firstChild);
288
+ settings.text_tools.forEach(function(hostTool) {
289
+ ge.createTool(
290
+ drawer,
291
+ hostTool.title || "",
292
+ hostTool.className || "",
293
+ hostTool.iconClass || "bi bi-wrench",
294
+ hostTool.on
295
+ );
296
+ });
297
+ ge.createTool(drawer, ge.t("tool.delete_text"), "ge-delete-text", "bi bi-trash", function() {
298
+ ge.deleteNode("text", block, ge.t("confirm.delete_text"), function(removed) {
299
+ closeText(block);
300
+ slideUp(textBlock, function() {
301
+ textBlock.remove();
302
+ removed();
303
+ });
304
+ });
305
+ });
306
+ }
307
+ function markTexts() {
308
+ all(ge.canvas, ".ge-text-block").forEach(function(textBlock) {
309
+ if (child(textBlock, ".ge-tools-drawer")) {
310
+ return;
311
+ }
312
+ var block = child(textBlock, ".ge-content");
313
+ if (!block || !isOurs(block)) {
314
+ return;
315
+ }
316
+ createTextControls(textBlock);
317
+ });
318
+ }
319
+ var texts = offeredTexts();
320
+ var clicks = null;
321
+ return {
322
+ methods: {
323
+ createText: apiCreateText
324
+ },
325
+ /**
326
+ * The types this plugin edits, for the core: every editor loaded
327
+ * is the owner of its texts, and the ones offered are what the
328
+ * host's plain content can be made.
329
+ */
330
+ textTypes: function() {
331
+ var offered = offeredTexts();
332
+ var others = Object.keys(TEXTS).filter(function(type) {
333
+ return offered.indexOf(type) === -1;
334
+ });
335
+ return offered.concat(others).map(function(type) {
336
+ var text = TEXTS[type];
337
+ return {
338
+ type,
339
+ label: textLabel(type),
340
+ offered: offered.indexOf(type) !== -1,
341
+ available: text.available ? function() {
342
+ return text.available();
343
+ } : null,
344
+ missingKey: text.missingKey,
345
+ edit: function(block) {
346
+ var textBlock = block.parentElement;
347
+ if (hasClass(textBlock, "ge-text-block") && !child(textBlock, ".ge-tools-drawer")) {
348
+ createTextControls(textBlock);
349
+ }
350
+ startText(block);
351
+ }
352
+ };
353
+ });
354
+ },
355
+ // A text block of each editor offered. Like a container, it goes
356
+ // into a row of its own when clicked, or where it is dropped
357
+ toolbar: texts.map(function(type) {
358
+ return {
359
+ label: function() {
360
+ return texts.length > 1 ? ge.t("text.add_type", { editor: textLabel(type) }) : ge.t("text.add");
361
+ },
362
+ iconClass: TEXTS[type].iconClass,
363
+ className: "ge-add-text-button",
364
+ kind: "text",
365
+ inColumn: true,
366
+ create: function() {
367
+ return makeText(type);
368
+ }
369
+ };
370
+ }),
371
+ onInit: function() {
372
+ markTexts();
373
+ if (clicks) {
374
+ ge.canvas.removeEventListener("click", clicks);
375
+ }
376
+ clicks = delegate(ge.canvas, "click", ".ge-content", onClick);
377
+ },
378
+ // While the drawers and the text blocks are still there, as the
379
+ // editors left them
380
+ onBeforeDeinit: function() {
381
+ all(ge.canvas, ".ge-content").forEach(function(block) {
382
+ if (isOurs(block)) {
383
+ closeText(block);
384
+ }
385
+ });
386
+ },
387
+ onDeinit: function() {
388
+ if (clicks) {
389
+ ge.canvas.removeEventListener("click", clicks);
390
+ }
391
+ clicks = null;
392
+ },
393
+ // The first time only: an undo says ready again, and by then the
394
+ // host may have changed the content area itself
395
+ onContentReady: function(area) {
396
+ if (readBefore.has(area) && !readReady.has(area)) {
397
+ readReady.set(area, attributesOf(area));
398
+ }
399
+ }
400
+ };
401
+ };
402
+ Object.assign(GridEditor.locales.en, {
403
+ "text.add": "Text",
404
+ "text.add_type": "Text ({editor})",
405
+ "panel.editor": "Editor",
406
+ "panel.kind_text": "Text"
407
+ });
408
+ readBefore = /* @__PURE__ */ new WeakMap();
409
+ readReady = /* @__PURE__ */ new WeakMap();
410
+ EDITOR_CLASS = /^(mce-|cke|note-)|^(active|ge-rte-active)$/;
411
+ EDITOR_ATTRIBUTE = /^(data-mce-|contenteditable$|spellcheck$)/;
412
+ textFeature.always = true;
413
+ GridEditor.features.text = textFeature;
414
+ }
415
+ var readBefore;
416
+ var readReady;
417
+ var EDITOR_CLASS;
418
+ var EDITOR_ATTRIBUTE;
419
+
420
+ // src/js/plugins/grideditor.summernote.js
421
+ Object.assign(GridEditor2.locales.en, {
422
+ "text.summernote": "Summernote"
423
+ });
424
+ var INITIAL_CONTENT = "<p>Lorem ipsum dolores</p>";
425
+ function isPlainObject(value) {
426
+ return !!value && Object.prototype.toString.call(value) === "[object Object]";
427
+ }
428
+ function deepMerge(target) {
429
+ Array.prototype.slice.call(arguments, 1).forEach(function(source) {
430
+ Object.keys(source || {}).forEach(function(key) {
431
+ var value = source[key];
432
+ if (value === void 0 || value === target) {
433
+ return;
434
+ }
435
+ if (Array.isArray(value)) {
436
+ target[key] = deepMerge(Array.isArray(target[key]) ? target[key] : [], value);
437
+ } else if (isPlainObject(value)) {
438
+ target[key] = deepMerge(isPlainObject(target[key]) ? target[key] : {}, value);
439
+ } else {
440
+ target[key] = value;
441
+ }
442
+ });
443
+ });
444
+ return target;
445
+ }
446
+ GridEditor2.texts.summernote = function(ge) {
447
+ return {
448
+ labelKey: "text.summernote",
449
+ initialContent: INITIAL_CONTENT,
450
+ missingKey: "error.summernote_missing",
451
+ available: function() {
452
+ return !!(window.jQuery && window.jQuery.fn && window.jQuery.fn.summernote);
453
+ },
454
+ start: function(contentAreas) {
455
+ var settings = ge.settings;
456
+ var $ = window.jQuery;
457
+ if (!$.now) {
458
+ $.now = Date.now;
459
+ }
460
+ contentAreas.forEach(function(contentArea) {
461
+ if (hasClass(contentArea, "active")) {
462
+ return;
463
+ }
464
+ if (contentArea.innerHTML == INITIAL_CONTENT) {
465
+ contentArea.innerHTML = "";
466
+ }
467
+ addClass(contentArea, "active");
468
+ var configuration = deepMerge(
469
+ {},
470
+ settings.summernote && settings.summernote.config ? settings.summernote.config : {},
471
+ {
472
+ tabsize: 2,
473
+ airMode: true,
474
+ // Focus editor on creation
475
+ callbacks: {
476
+ onInit: function() {
477
+ var callback;
478
+ try {
479
+ callback = settings.summernote.config.callbacks.onInit;
480
+ } catch (err) {
481
+ }
482
+ if (callback) {
483
+ callback.call(this);
484
+ }
485
+ ge.textReady(contentArea);
486
+ $(contentArea).summernote("focus");
487
+ }
488
+ }
489
+ }
490
+ );
491
+ $(contentArea).summernote(configuration);
492
+ });
493
+ },
494
+ stop: function(contentAreas) {
495
+ var $ = window.jQuery;
496
+ contentAreas.filter(function(contentArea) {
497
+ return hasClass(contentArea, "active");
498
+ }).forEach(function(contentArea) {
499
+ if ($ && $.fn.summernote) {
500
+ $(contentArea).summernote("destroy");
501
+ }
502
+ removeClass(contentArea, "active");
503
+ ["id", "style", "spellcheck"].forEach(function(name) {
504
+ contentArea.removeAttribute(name);
505
+ });
506
+ });
507
+ }
508
+ };
509
+ };