@themarioga/grid-editor 8.5.0 → 8.7.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 (105) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +78 -4
  3. package/dist/grideditor.bundle.min.js +3 -3
  4. package/dist/grideditor.css +15 -4
  5. package/dist/grideditor.d.ts +59 -3
  6. package/dist/grideditor.esm.js +226 -38
  7. package/dist/grideditor.js +226 -38
  8. package/dist/grideditor.min.css +1 -1
  9. package/dist/grideditor.min.css.map +1 -1
  10. package/dist/grideditor.min.js +2 -2
  11. package/dist/grideditor.min.js.map +3 -3
  12. package/dist/locales/grideditor.es.esm.js +4 -0
  13. package/dist/locales/grideditor.es.js +4 -0
  14. package/dist/locales/grideditor.es.min.js +1 -1
  15. package/dist/locales/grideditor.es.min.js.map +2 -2
  16. package/dist/plugins/grideditor.accordion.esm.js +7 -0
  17. package/dist/plugins/grideditor.accordion.js +7 -0
  18. package/dist/plugins/grideditor.accordion.min.js +1 -1
  19. package/dist/plugins/grideditor.accordion.min.js.map +3 -3
  20. package/dist/plugins/grideditor.autosave.esm.js +309 -0
  21. package/dist/plugins/grideditor.autosave.js +316 -0
  22. package/dist/plugins/grideditor.autosave.min.js +1 -0
  23. package/dist/plugins/grideditor.autosave.min.js.map +7 -0
  24. package/dist/plugins/grideditor.card.esm.js +10 -0
  25. package/dist/plugins/grideditor.card.js +10 -0
  26. package/dist/plugins/grideditor.card.min.js +1 -1
  27. package/dist/plugins/grideditor.card.min.js.map +3 -3
  28. package/dist/plugins/grideditor.ckeditor.esm.js +29 -0
  29. package/dist/plugins/grideditor.ckeditor.js +29 -0
  30. package/dist/plugins/grideditor.ckeditor.min.js +1 -1
  31. package/dist/plugins/grideditor.ckeditor.min.js.map +3 -3
  32. package/dist/plugins/grideditor.clipboard.esm.js +3 -0
  33. package/dist/plugins/grideditor.clipboard.js +3 -0
  34. package/dist/plugins/grideditor.clipboard.min.js +1 -1
  35. package/dist/plugins/grideditor.clipboard.min.js.map +2 -2
  36. package/dist/plugins/grideditor.codemirror-inline.esm.js +11 -0
  37. package/dist/plugins/grideditor.codemirror-inline.js +11 -0
  38. package/dist/plugins/grideditor.codemirror-inline.min.js +1 -1
  39. package/dist/plugins/grideditor.codemirror-inline.min.js.map +3 -3
  40. package/dist/plugins/grideditor.elements.esm.js +6 -3
  41. package/dist/plugins/grideditor.elements.js +6 -3
  42. package/dist/plugins/grideditor.elements.min.js +1 -1
  43. package/dist/plugins/grideditor.elements.min.js.map +3 -3
  44. package/dist/plugins/grideditor.gutters.esm.js +5 -0
  45. package/dist/plugins/grideditor.gutters.js +5 -0
  46. package/dist/plugins/grideditor.gutters.min.js +1 -1
  47. package/dist/plugins/grideditor.gutters.min.js.map +3 -3
  48. package/dist/plugins/grideditor.inline-style.esm.js +18 -10
  49. package/dist/plugins/grideditor.inline-style.js +18 -10
  50. package/dist/plugins/grideditor.inline-style.min.js +3 -3
  51. package/dist/plugins/grideditor.inline-style.min.js.map +3 -3
  52. package/dist/plugins/grideditor.order.esm.js +5 -0
  53. package/dist/plugins/grideditor.order.js +5 -0
  54. package/dist/plugins/grideditor.order.min.js +1 -1
  55. package/dist/plugins/grideditor.order.min.js.map +3 -3
  56. package/dist/plugins/grideditor.popup.esm.js +17 -6
  57. package/dist/plugins/grideditor.popup.js +17 -6
  58. package/dist/plugins/grideditor.popup.min.js +1 -1
  59. package/dist/plugins/grideditor.popup.min.js.map +3 -3
  60. package/dist/plugins/grideditor.sections.esm.js +6 -3
  61. package/dist/plugins/grideditor.sections.js +6 -3
  62. package/dist/plugins/grideditor.sections.min.js +1 -1
  63. package/dist/plugins/grideditor.sections.min.js.map +3 -3
  64. package/dist/plugins/grideditor.summernote.esm.js +39 -0
  65. package/dist/plugins/grideditor.summernote.js +39 -0
  66. package/dist/plugins/grideditor.summernote.min.js +1 -1
  67. package/dist/plugins/grideditor.summernote.min.js.map +3 -3
  68. package/dist/plugins/grideditor.tabs.esm.js +7 -0
  69. package/dist/plugins/grideditor.tabs.js +7 -0
  70. package/dist/plugins/grideditor.tabs.min.js +1 -1
  71. package/dist/plugins/grideditor.tabs.min.js.map +3 -3
  72. package/dist/plugins/grideditor.tinymce.esm.js +31 -0
  73. package/dist/plugins/grideditor.tinymce.js +31 -0
  74. package/dist/plugins/grideditor.tinymce.min.js +1 -1
  75. package/dist/plugins/grideditor.tinymce.min.js.map +3 -3
  76. package/docs/events.md +8 -0
  77. package/docs/locale-keys.md +14 -0
  78. package/docs/plugins.md +86 -2
  79. package/example/autosave.html +39 -22
  80. package/example/index.html +1 -1
  81. package/example/plugins.html +10 -0
  82. package/package.json +1 -3
  83. package/src/js/grideditor.js +280 -30
  84. package/src/js/inline-style/display.js +4 -3
  85. package/src/js/inline-style/drawerflow.js +10 -5
  86. package/src/js/locales/grideditor.es.js +4 -0
  87. package/src/js/plugins/grideditor.accordion.js +6 -0
  88. package/src/js/plugins/grideditor.autosave.js +349 -0
  89. package/src/js/plugins/grideditor.card.js +6 -0
  90. package/src/js/plugins/grideditor.ckeditor.js +6 -0
  91. package/src/js/plugins/grideditor.clipboard.js +3 -0
  92. package/src/js/plugins/grideditor.codemirror-inline.js +7 -0
  93. package/src/js/plugins/grideditor.elements.js +4 -3
  94. package/src/js/plugins/grideditor.gutters.js +4 -0
  95. package/src/js/plugins/grideditor.inline-style.js +2 -0
  96. package/src/js/plugins/grideditor.order.js +4 -0
  97. package/src/js/plugins/grideditor.popup.js +15 -6
  98. package/src/js/plugins/grideditor.sections.js +4 -3
  99. package/src/js/plugins/grideditor.summernote.js +14 -0
  100. package/src/js/plugins/grideditor.tabs.js +6 -0
  101. package/src/js/plugins/grideditor.tinymce.js +8 -0
  102. package/src/js/text/grideditor.text.js +26 -0
  103. package/src/less/grideditor.less +16 -8
  104. package/types/grideditor.d.ts +59 -3
  105. package/AUTO_SAVE.md +0 -30
@@ -1 +1 @@
1
- (()=>{var x=window.GridEditor;if(!x||typeof x.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 h(t,l){return t?Array.prototype.slice.call(t.querySelectorAll(l)):[]}function g(t,l){return t?t.querySelector(l):null}function F(t,l){if(!t)return[];var o=h(t,l);return t.nodeType===1&&t.matches(l)&&o.unshift(t),o}function w(t,l){return t?Array.prototype.filter.call(t.children,function(o){return!l||o.matches(l)}):[]}function j(t,l){return w(t,l)[0]||null}function f(t,l,o){var c=document.createElement(t);return Object.keys(l||{}).forEach(function(m){var d=l[m];d!=null&&d!==!1&&c.setAttribute(m,d)}),o!=null&&(c.textContent=o),c}function b(t,l){return L(l).forEach(function(o){t.classList.add(o)}),t}function p(t,l){return L(l).forEach(function(o){t.classList.remove(o)}),t}function G(t,l,o){return L(l).forEach(function(c){o===void 0?t.classList.toggle(c):t.classList.toggle(c,!!o)}),t}function O(t,l){return!!t&&t.nodeType===1&&t.classList.contains(l)}function L(t){return String(t||"").split(/\s+/).filter(Boolean)}function J(t){return t.getAttribute("class")||t.removeAttribute("class"),t}function Y(t){return t.style.display="none",t}function k(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}var X=400;function $(t,l,o,c){o=o===void 0?X:o;var m=function(){Y(t),c&&c()};if(!k(t)||!t.animate||o<=0){window.setTimeout(m,0);return}var d=t.animate(l(getComputedStyle(t)),{duration:o,easing:"ease-in-out"}),y=!1,_=function(){y||(y=!0,m())};d.onfinish=_,d.oncancel=_}function M(t,l,o){$(t,function(c){return[{opacity:c.opacity},{opacity:0}]},l,o)}Object.assign(x.locales.en,{"container.add_tabs":"Tabs","container.add_tab":"Add tab","container.tab_label":"Tab {number}","confirm.delete_tab":"Delete this tab and everything in it?","container.tabs_section":"Tabs","container.tabs_style":"Style","container.tabs_style_tabs":"Tabs","container.tabs_style_pills":"Pills","container.tabs_style_underline":"Underline","container.tabs_width":"Width","container.tabs_width_natural":"Natural","container.tabs_width_fill":"Fill","container.tabs_width_justified":"Justified","container.tabs_align":"Alignment","container.tabs_align_start":"Start","container.tabs_align_center":"Center","container.tabs_align_end":"End","container.tabs_layout":"Layout","container.tabs_layout_horizontal":"Horizontal","container.tabs_layout_vertical":"Vertical","container.tabs_layout_vertical_from":"Vertical from {breakpoint}"});var A={tabs:"nav-tabs",pills:"nav-pills",underline:"nav-underline"},C={natural:null,fill:"nav-fill",justified:"nav-justified"},E={start:null,center:"justify-content-center",end:"justify-content-end"},K={variant:"tabs",width:"natural",align:"start",vertical:!1},B={variant:{labelKey:"container.tabs_style",choices:[{value:"tabs",labelKey:"container.tabs_style_tabs"},{value:"pills",labelKey:"container.tabs_style_pills"},{value:"underline",labelKey:"container.tabs_style_underline"}]},width:{labelKey:"container.tabs_width",choices:[{value:"natural",labelKey:"container.tabs_width_natural"},{value:"fill",labelKey:"container.tabs_width_fill"},{value:"justified",labelKey:"container.tabs_width_justified"}]},align:{labelKey:"container.tabs_align",choices:[{value:"start",labelKey:"container.tabs_align_start"},{value:"center",labelKey:"container.tabs_align_center"},{value:"end",labelKey:"container.tabs_align_end"}]},vertical:{labelKey:"container.tabs_layout"}},Z=0,S="data-ge-tabs-layout";function N(t){return Object.keys(t).map(function(l){return t[l]}).filter(Boolean)}x.containers.tabs=function(t){var l=[];function o(n){return j(n,".nav")}function c(){return t.breakpoints.slice(1)}function m(n){return n===!0?"":"-"+n}function d(n){var e=m(n);return{container:["d"+e+"-flex","align-items"+e+"-start"],strip:["flex"+e+"-column","me"+e+"-3"]}}function y(){return[!0].concat(c())}function _(n){var e=o(n),i=function(s,r){return!!s&&O(s,r)},a=function(s,r){return Object.keys(s).filter(function(v){return s[v]&&i(e,s[v])})[0]||r},u=y().filter(function(s){var r=d(s);return i(n,r.container[0])&&i(e,r.strip[0])})[0];return{variant:a(A,"tabs"),width:a(C,"natural"),align:a(E,"start"),vertical:u===void 0?!1:u}}function H(n,e,i){var a=o(n);if(a){if(e==="variant"&&(p(a,N(A).join(" ")),b(a,A[i])),(e==="width"||e==="vertical")&&(p(a,N(C).join(" ")),e==="width"&&C[i]&&b(a,C[i])),(e==="align"||e==="vertical"||e==="width"&&i!=="natural")&&(p(a,N(E).join(" ")),e==="align"&&E[i]&&b(a,E[i])),e==="vertical"&&(y().forEach(function(s){var r=d(s);p(n,r.container.join(" ")),p(a,r.strip.join(" "))}),a.removeAttribute("aria-orientation"),i!==!1)){var u=d(i);b(n,u.container.join(" ")),b(a,u.strip.join(" ")),a.setAttribute("aria-orientation","vertical")}J(n)}}function P(n){return n==="variant"?Object.keys(A):n==="width"?Object.keys(C):n==="align"?Object.keys(E):[!1].concat(y())}function W(n,e){var i=t.settings.tabs||{},a=n[e]!==void 0?n[e]:i[e];return a===void 0?K[e]:P(e).indexOf(a)!==-1?a:(t.warn("tabs: "+JSON.stringify(a)+" is not a "+e+", which takes "+JSON.stringify(P(e))+": "+JSON.stringify(K[e])+" is used"),K[e])}function q(n){var e=_(n).vertical;return e===!1?null:t.view()==="all"?(n.removeAttribute(S),/flex$/.test(getComputedStyle(n).display)?"vertical":"horizontal"):e===!0||t.breakpoints.indexOf(t.view())>=t.breakpoints.indexOf(e)?"vertical":"horizontal"}function D(n){var e=q(n);e?n.setAttribute(S,e):n.removeAttribute(S)}function I(n,e,i){var a=f("div",{class:"ge-tabs-variant"}),u="ge-tabs-variant-"+ ++Z;a.appendChild(f("label",{class:"form-label",for:u},t.t(n)));var s=a.appendChild(f("select",{class:"form-select form-select-sm",id:u}));return e.forEach(function(r){s.appendChild(f("option",{value:r.value},r.label))}),s.addEventListener("change",function(){i(s.value)}),{box:a,field:s}}function V(n){var e=f("div",{class:"ge-tabs-variants"}),i={};function a(r,v){H(n,r,v),D(n),s()}function u(r){return B[r].choices.map(function(v){return{value:v.value,label:t.t(v.labelKey)}})}["variant","width","align"].forEach(function(r){i[r]=I(B[r].labelKey,u(r),function(v){a(r,v)})}),i.vertical=I(B.vertical.labelKey,[{value:"false",label:t.t("container.tabs_layout_horizontal")},{value:"true",label:t.t("container.tabs_layout_vertical")}].concat(c().map(function(r){return{value:r,label:t.t("container.tabs_layout_vertical_from",{breakpoint:r})}})),function(r){a("vertical",r==="true"?!0:r==="false"?!1:r)}),["variant","width","align","vertical"].forEach(function(r){i[r].box.setAttribute("data-ge-tabs-variant",r),e.appendChild(i[r].box)});function s(){var r=_(n);i.variant.field.value=r.variant,i.width.field.value=r.width,i.align.field.value=r.align,i.vertical.field.value=String(r.vertical),i.width.field.disabled=r.vertical!==!1,i.align.field.disabled=r.vertical!==!1||r.width!=="natural"}return s(),l.push({container:n,element:e,render:s}),e}function R(n,e){e=e||{};var i=o(n),a=g(n,":scope > .tab-content"),u=t.containerId("tab"),s=w(i,".nav-item").length+1,r=i.appendChild(f("li",{class:"nav-item ge-tab",role:"presentation"})),v=r.appendChild(f("button",{class:"nav-link",type:"button",role:"tab","data-bs-toggle":"tab","data-bs-target":"#"+u,"aria-controls":u}));v.appendChild(f("span",{class:"ge-pane-label"},e.label||t.t("container.tab_label",{number:s})));var T=a.appendChild(f("div",{class:"tab-pane fade",role:"tabpanel",tabindex:"0",id:u}));return T.appendChild(t.defaultRegion()),(e.activate||s===1)&&U(n,T),T}function U(n,e){var i=e.getAttribute("id");h(n,":scope > .tab-content > .tab-pane").forEach(function(a){p(a,"show active")}),b(e,"show active"),h(o(n)||n,".nav-link").forEach(function(a){var u=a.getAttribute("data-bs-target")==="#"+i;G(a,"active",u),a.setAttribute("aria-selected",u?"true":"false")})}function z(n,e){var i=g(e,".nav-link"),a=i?i.getAttribute("data-bs-target"):null;return a?g(n,a):null}return{labelKey:"container.add_tabs",onSortable:function(n){n(h(t.canvas,".ge-container-tabs").map(o).filter(Boolean),{draggable:".ge-tab"})},addPaneKey:"container.add_tab",paneKind:"tab",create:function(n){var e=f("div",{"data-ge-container":"tabs"}),i=n.labels||[],a=n.tabs||i.length||2;e.appendChild(f("ul",{class:"nav nav-tabs",role:"tablist"})),e.appendChild(f("div",{class:"tab-content"})),["variant","width","align","vertical"].forEach(function(s){H(e,s,W(n,s))});for(var u=0;u<a;u++)R(e,{label:i[u]});return e},addPane:R,mark:function(n){h(n,":scope > .tab-content > .tab-pane").forEach(function(e){b(e,"ge-tab-pane")}),w(o(n)||n,".nav-item").forEach(function(e){b(e,"ge-tab");var i=g(e,".nav-link");i&&t.makeLabelEditable(t.labelIn(i)),!j(e,".ge-tools-drawer")&&t.createPaneControls(e,"tab",t.settings.tab_tools,t.t("confirm.delete_tab"),function(a){var u=z(n,e),s=O(u,"active");M(e,200,function(){u&&u.remove(),a();var r=g(n,":scope > .tab-content > .tab-pane");s&&r&&U(n,r)})})})},unmark:function(n){t.resumeToggles(n),n.removeAttribute(S),h(n,".ge-tab-pane").forEach(function(e){p(e,"ge-tab-pane")}),t.unwrapLabels(n)},panelSection:function(n,e){return e!=="tabs"||!o(n)?null:{labelKey:"container.tabs_section",body:V(n)}},onRefresh:function(n){F(n,'[data-ge-container="tabs"]').forEach(D),l=l.filter(function(e){return e.element.isConnected}),l.forEach(function(e){(e.container===n||n.contains(e.container))&&e.render()})},onDeinit:function(){l=[]},afterPaneMove:function(n){var e=g(n,":scope > .tab-content");w(o(n)||n,".nav-item").forEach(function(i){var a=z(n,i);a&&e.appendChild(a)})}}};})();
1
+ (()=>{var x=window.GridEditor;if(!x||typeof x.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 p(t,l){return t?Array.prototype.slice.call(t.querySelectorAll(l)):[]}function g(t,l){return t?t.querySelector(l):null}function F(t,l){if(!t)return[];var o=p(t,l);return t.nodeType===1&&t.matches(l)&&o.unshift(t),o}function w(t,l){return t?Array.prototype.filter.call(t.children,function(o){return!l||o.matches(l)}):[]}function j(t,l){return w(t,l)[0]||null}function f(t,l,o){var c=document.createElement(t);return Object.keys(l||{}).forEach(function(h){var d=l[h];d!=null&&d!==!1&&c.setAttribute(h,d)}),o!=null&&(c.textContent=o),c}function b(t,l){return L(l).forEach(function(o){t.classList.add(o)}),t}function m(t,l){return L(l).forEach(function(o){t.classList.remove(o)}),t}function M(t,l,o){return L(l).forEach(function(c){o===void 0?t.classList.toggle(c):t.classList.toggle(c,!!o)}),t}function O(t,l){return!!t&&t.nodeType===1&&t.classList.contains(l)}function L(t){return String(t||"").split(/\s+/).filter(Boolean)}function k(t){return t.getAttribute("class")||t.removeAttribute("class"),t}function V(t){return t.style.display="none",t}function Y(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}var X=400;function $(t,l,o,c){o=o===void 0?X:o;var h=function(){V(t),c&&c()};if(!Y(t)||!t.animate||o<=0){window.setTimeout(h,0);return}var d=t.animate(l(getComputedStyle(t)),{duration:o,easing:"ease-in-out"}),y=!1,_=function(){y||(y=!0,h())};d.onfinish=_,d.oncancel=_}function G(t,l,o){$(t,function(c){return[{opacity:c.opacity},{opacity:0}]},l,o)}Object.assign(x.locales.en,{"container.add_tabs":"Tabs","container.add_tab":"Add tab","container.tab_label":"Tab {number}","confirm.delete_tab":"Delete this tab and everything in it?","container.tabs_section":"Tabs","container.tabs_style":"Style","container.tabs_style_tabs":"Tabs","container.tabs_style_pills":"Pills","container.tabs_style_underline":"Underline","container.tabs_width":"Width","container.tabs_width_natural":"Natural","container.tabs_width_fill":"Fill","container.tabs_width_justified":"Justified","container.tabs_align":"Alignment","container.tabs_align_start":"Start","container.tabs_align_center":"Center","container.tabs_align_end":"End","container.tabs_layout":"Layout","container.tabs_layout_horizontal":"Horizontal","container.tabs_layout_vertical":"Vertical","container.tabs_layout_vertical_from":"Vertical from {breakpoint}"});var A={tabs:"nav-tabs",pills:"nav-pills",underline:"nav-underline"},C={natural:null,fill:"nav-fill",justified:"nav-justified"},E={start:null,center:"justify-content-center",end:"justify-content-end"},K={variant:"tabs",width:"natural",align:"start",vertical:!1},B={variant:{labelKey:"container.tabs_style",choices:[{value:"tabs",labelKey:"container.tabs_style_tabs"},{value:"pills",labelKey:"container.tabs_style_pills"},{value:"underline",labelKey:"container.tabs_style_underline"}]},width:{labelKey:"container.tabs_width",choices:[{value:"natural",labelKey:"container.tabs_width_natural"},{value:"fill",labelKey:"container.tabs_width_fill"},{value:"justified",labelKey:"container.tabs_width_justified"}]},align:{labelKey:"container.tabs_align",choices:[{value:"start",labelKey:"container.tabs_align_start"},{value:"center",labelKey:"container.tabs_align_center"},{value:"end",labelKey:"container.tabs_align_end"}]},vertical:{labelKey:"container.tabs_layout"}},Z=0,S="data-ge-tabs-layout";function N(t){return Object.keys(t).map(function(l){return t[l]}).filter(Boolean)}x.containers.tabs=function(t){var l=[];function o(n){return j(n,".nav")}function c(){return t.breakpoints.slice(1)}function h(n){return n===!0?"":"-"+n}function d(n){var e=h(n);return{container:["d"+e+"-flex","align-items"+e+"-start"],strip:["flex"+e+"-column","me"+e+"-3"]}}function y(){return[!0].concat(c())}function _(n){var e=o(n),a=function(s,i){return!!s&&O(s,i)},r=function(s,i){return Object.keys(s).filter(function(v){return s[v]&&a(e,s[v])})[0]||i},u=y().filter(function(s){var i=d(s);return a(n,i.container[0])&&a(e,i.strip[0])})[0];return{variant:r(A,"tabs"),width:r(C,"natural"),align:r(E,"start"),vertical:u===void 0?!1:u}}function H(n,e,a){var r=o(n);if(r){if(e==="variant"&&(m(r,N(A).join(" ")),b(r,A[a])),(e==="width"||e==="vertical")&&(m(r,N(C).join(" ")),e==="width"&&C[a]&&b(r,C[a])),(e==="align"||e==="vertical"||e==="width"&&a!=="natural")&&(m(r,N(E).join(" ")),e==="align"&&E[a]&&b(r,E[a])),e==="vertical"&&(y().forEach(function(s){var i=d(s);m(n,i.container.join(" ")),m(r,i.strip.join(" "))}),r.removeAttribute("aria-orientation"),a!==!1)){var u=d(a);b(n,u.container.join(" ")),b(r,u.strip.join(" ")),r.setAttribute("aria-orientation","vertical")}k(n)}}function P(n){return n==="variant"?Object.keys(A):n==="width"?Object.keys(C):n==="align"?Object.keys(E):[!1].concat(y())}function J(n,e){var a=t.settings.tabs||{},r=n[e]!==void 0?n[e]:a[e];return r===void 0?K[e]:P(e).indexOf(r)!==-1?r:(t.warn("tabs: "+JSON.stringify(r)+" is not a "+e+", which takes "+JSON.stringify(P(e))+": "+JSON.stringify(K[e])+" is used"),K[e])}function W(n){var e=_(n).vertical;return e===!1?null:t.view()==="all"?(n.removeAttribute(S),/flex$/.test(getComputedStyle(n).display)?"vertical":"horizontal"):e===!0||t.breakpoints.indexOf(t.view())>=t.breakpoints.indexOf(e)?"vertical":"horizontal"}function D(n){var e=W(n);e?n.setAttribute(S,e):n.removeAttribute(S)}function I(n,e,a){var r=f("div",{class:"ge-tabs-variant"}),u="ge-tabs-variant-"+ ++Z;r.appendChild(f("label",{class:"form-label",for:u},t.t(n)));var s=r.appendChild(f("select",{class:"form-select form-select-sm",id:u}));return e.forEach(function(i){s.appendChild(f("option",{value:i.value},i.label))}),s.addEventListener("change",function(){a(s.value)}),{box:r,field:s}}function q(n){var e=f("div",{class:"ge-tabs-variants"}),a={};function r(i,v){H(n,i,v),D(n),s()}function u(i){return B[i].choices.map(function(v){return{value:v.value,label:t.t(v.labelKey)}})}["variant","width","align"].forEach(function(i){a[i]=I(B[i].labelKey,u(i),function(v){r(i,v)})}),a.vertical=I(B.vertical.labelKey,[{value:"false",label:t.t("container.tabs_layout_horizontal")},{value:"true",label:t.t("container.tabs_layout_vertical")}].concat(c().map(function(i){return{value:i,label:t.t("container.tabs_layout_vertical_from",{breakpoint:i})}})),function(i){r("vertical",i==="true"?!0:i==="false"?!1:i)}),["variant","width","align","vertical"].forEach(function(i){a[i].box.setAttribute("data-ge-tabs-variant",i),e.appendChild(a[i].box)});function s(){var i=_(n);a.variant.field.value=i.variant,a.width.field.value=i.width,a.align.field.value=i.align,a.vertical.field.value=String(i.vertical),a.width.field.disabled=i.vertical!==!1,a.align.field.disabled=i.vertical!==!1||i.width!=="natural"}return s(),l.push({container:n,element:e,render:s}),e}function R(n,e){e=e||{};var a=o(n),r=g(n,":scope > .tab-content"),u=t.containerId("tab"),s=w(a,".nav-item").length+1,i=a.appendChild(f("li",{class:"nav-item ge-tab",role:"presentation"})),v=i.appendChild(f("button",{class:"nav-link",type:"button",role:"tab","data-bs-toggle":"tab","data-bs-target":"#"+u,"aria-controls":u}));v.appendChild(f("span",{class:"ge-pane-label"},e.label||t.t("container.tab_label",{number:s})));var T=r.appendChild(f("div",{class:"tab-pane fade",role:"tabpanel",tabindex:"0",id:u}));return T.appendChild(t.defaultRegion()),(e.activate||s===1)&&U(n,T),T}function U(n,e){var a=e.getAttribute("id");p(n,":scope > .tab-content > .tab-pane").forEach(function(r){m(r,"show active")}),b(e,"show active"),p(o(n)||n,".nav-link").forEach(function(r){var u=r.getAttribute("data-bs-target")==="#"+a;M(r,"active",u),r.setAttribute("aria-selected",u?"true":"false")})}function z(n,e){var a=g(e,".nav-link"),r=a?a.getAttribute("data-bs-target"):null;return r?g(n,r):null}return{labelKey:"container.add_tabs",onSortable:function(n){n(p(t.canvas,".ge-container-tabs").map(o).filter(Boolean),{draggable:".ge-tab"})},addPaneKey:"container.add_tab",paneKind:"tab",create:function(n){var e=f("div",{"data-ge-container":"tabs"}),a=n.labels||[],r=n.tabs||a.length||2;e.appendChild(f("ul",{class:"nav nav-tabs",role:"tablist"})),e.appendChild(f("div",{class:"tab-content"})),["variant","width","align","vertical"].forEach(function(s){H(e,s,J(n,s))});for(var u=0;u<r;u++)R(e,{label:a[u]});return e},addPane:R,mark:function(n){p(n,":scope > .tab-content > .tab-pane").forEach(function(e){b(e,"ge-tab-pane")}),w(o(n)||n,".nav-item").forEach(function(e){b(e,"ge-tab");var a=g(e,".nav-link");a&&t.makeLabelEditable(t.labelIn(a)),!j(e,".ge-tools-drawer")&&t.createPaneControls(e,"tab",t.settings.tab_tools,t.t("confirm.delete_tab"),function(r){var u=z(n,e),s=O(u,"active");G(e,200,function(){u&&u.remove(),r();var i=g(n,":scope > .tab-content > .tab-pane");s&&i&&U(n,i)})})})},unmark:function(n){t.resumeToggles(n),n.removeAttribute(S),p(n,".ge-tab-pane").forEach(function(e){m(e,"ge-tab-pane")}),t.unwrapLabels(n)},cleanMarkup:function(n){var e=this;p(n,'[data-ge-container="tabs"]').forEach(function(a){e.unmark(a)})},panelSection:function(n,e){return e!=="tabs"||!o(n)?null:{labelKey:"container.tabs_section",body:q(n)}},onRefresh:function(n){F(n,'[data-ge-container="tabs"]').forEach(D),l=l.filter(function(e){return e.element.isConnected}),l.forEach(function(e){(e.container===n||n.contains(e.container))&&e.render()})},onDeinit:function(){l=[]},afterPaneMove:function(n){var e=g(n,":scope > .tab-content");w(o(n)||n,".nav-item").forEach(function(a){var r=z(n,a);r&&e.appendChild(r)})}}};})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/js/register.js", "../../src/js/dom.js", "../../src/js/plugins/grideditor.tabs.js"],
4
- "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 jQuery's: 400 ms unless the 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 * Tabs for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a tabs container. 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.tabs.min.js\"></script>\n *\n * A container's variant - its style, width, alignment and whether it is laid\n * out vertically, from a breakpoint up - is Bootstrap's classes on its strip\n * and on itself, and nothing else: it is read from the markup, chosen in the\n * container's settings panel, or given to createContainer and the tabs\n * setting for the ones made new.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_tabs': 'Tabs',\n 'container.add_tab': 'Add tab',\n 'container.tab_label': 'Tab {number}',\n 'confirm.delete_tab': 'Delete this tab and everything in it?',\n 'container.tabs_section': 'Tabs',\n 'container.tabs_style': 'Style',\n 'container.tabs_style_tabs': 'Tabs',\n 'container.tabs_style_pills': 'Pills',\n 'container.tabs_style_underline': 'Underline',\n 'container.tabs_width': 'Width',\n 'container.tabs_width_natural': 'Natural',\n 'container.tabs_width_fill': 'Fill',\n 'container.tabs_width_justified': 'Justified',\n 'container.tabs_align': 'Alignment',\n 'container.tabs_align_start': 'Start',\n 'container.tabs_align_center': 'Center',\n 'container.tabs_align_end': 'End',\n 'container.tabs_layout': 'Layout',\n 'container.tabs_layout_horizontal': 'Horizontal',\n 'container.tabs_layout_vertical': 'Vertical',\n 'container.tabs_layout_vertical_from': 'Vertical from {breakpoint}',\n});\n\n/** Each variant's values, the first its default, and the class each puts on the strip. */\nvar STYLES = { tabs: 'nav-tabs', pills: 'nav-pills', underline: 'nav-underline' };\nvar WIDTHS = { natural: null, fill: 'nav-fill', justified: 'nav-justified' };\nvar ALIGNS = { start: null, center: 'justify-content-center', end: 'justify-content-end' };\nvar DEFAULTS = { variant: 'tabs', width: 'natural', align: 'start', vertical: false };\n\n/** Each variant's select in the panel: its label, and its choices'. */\nvar FIELDS = {\n variant: { labelKey: 'container.tabs_style', choices: [\n { value: 'tabs', labelKey: 'container.tabs_style_tabs' },\n { value: 'pills', labelKey: 'container.tabs_style_pills' },\n { value: 'underline', labelKey: 'container.tabs_style_underline' },\n ] },\n width: { labelKey: 'container.tabs_width', choices: [\n { value: 'natural', labelKey: 'container.tabs_width_natural' },\n { value: 'fill', labelKey: 'container.tabs_width_fill' },\n { value: 'justified', labelKey: 'container.tabs_width_justified' },\n ] },\n align: { labelKey: 'container.tabs_align', choices: [\n { value: 'start', labelKey: 'container.tabs_align_start' },\n { value: 'center', labelKey: 'container.tabs_align_center' },\n { value: 'end', labelKey: 'container.tabs_align_end' },\n ] },\n vertical: { labelKey: 'container.tabs_layout' },\n};\n\nvar fieldCounter = 0;\n\n/** Where the layout marks what the view being edited lays the tabs out as. */\nvar LAYOUT_ATTR = 'data-ge-tabs-layout';\n\nfunction classValues(map) {\n return Object.keys(map).map(function(key) { return map[key]; }).filter(Boolean);\n}\n\nGridEditor.containers.tabs = function(ge) {\n\n var sections = []; // { container, render } for every panel section built\n\n /** The strip: the container's first .nav, whatever its style. */\n function stripOf(container) {\n return dom.child(container, '.nav');\n }\n\n /** The breakpoints a layout can go vertical from; xs is always. */\n function fromBreakpoints() {\n return ge.breakpoints.slice(1);\n }\n\n /** The infix of a vertical layout's classes: none for always. */\n function infix(vertical) {\n return vertical === true ? '' : '-' + vertical;\n }\n\n function verticalClasses(vertical) {\n var at = infix(vertical);\n\n return {\n container: ['d' + at + '-flex', 'align-items' + at + '-start'],\n strip: ['flex' + at + '-column', 'me' + at + '-3'],\n };\n }\n\n /** Every vertical value: always, and from each breakpoint. */\n function verticals() {\n return [true].concat(fromBreakpoints());\n }\n\n /**\n * What a container's classes say it is. Vertical is read only when the\n * container's flex and the strip's column are of the same breakpoint;\n * anything else is horizontal, and is left as it is.\n */\n function read(container) {\n var strip = stripOf(container);\n var has = function(node, name) { return !!node && dom.hasClass(node, name); };\n var found = function(map, fallback) {\n return Object.keys(map).filter(function(key) { return map[key] && has(strip, map[key]); })[0] || fallback;\n };\n\n var vertical = verticals().filter(function(each) {\n var classes = verticalClasses(each);\n return has(container, classes.container[0]) && has(strip, classes.strip[0]);\n })[0];\n\n return {\n variant: found(STYLES, 'tabs'),\n width: found(WIDTHS, 'natural'),\n align: found(ALIGNS, 'start'),\n vertical: vertical === undefined ? false : vertical,\n };\n }\n\n /**\n * Write one variant, and take off what it makes meaningless: a vertical\n * layout has no width or alignment, and a full width no alignment.\n * Choosing a layout clears every layout class, at any breakpoint, the\n * user's own included.\n */\n function write(container, key, value) {\n var strip = stripOf(container);\n if (!strip) { return; }\n\n if (key === 'variant') {\n dom.removeClass(strip, classValues(STYLES).join(' '));\n dom.addClass(strip, STYLES[value]);\n }\n\n if (key === 'width' || key === 'vertical') {\n dom.removeClass(strip, classValues(WIDTHS).join(' '));\n if (key === 'width' && WIDTHS[value]) { dom.addClass(strip, WIDTHS[value]); }\n }\n\n if (key === 'align' || key === 'vertical' || (key === 'width' && value !== 'natural')) {\n dom.removeClass(strip, classValues(ALIGNS).join(' '));\n if (key === 'align' && ALIGNS[value]) { dom.addClass(strip, ALIGNS[value]); }\n }\n\n if (key === 'vertical') {\n verticals().forEach(function(each) {\n var classes = verticalClasses(each);\n dom.removeClass(container, classes.container.join(' '));\n dom.removeClass(strip, classes.strip.join(' '));\n });\n strip.removeAttribute('aria-orientation');\n\n if (value !== false) {\n var layout = verticalClasses(value);\n dom.addClass(container, layout.container.join(' '));\n dom.addClass(strip, layout.strip.join(' '));\n strip.setAttribute('aria-orientation', 'vertical');\n }\n }\n\n dom.dropEmptyClass(container);\n }\n\n /** The values a variant takes, as the warning lists them. */\n function valuesOf(key) {\n if (key === 'variant') { return Object.keys(STYLES); }\n if (key === 'width') { return Object.keys(WIDTHS); }\n if (key === 'align') { return Object.keys(ALIGNS); }\n\n return [false].concat(verticals());\n }\n\n /**\n * A variant for a new container: the option, or the tabs setting, or the\n * default. A value it does not take is warned about and the default used.\n */\n function chosen(options, key) {\n var setting = ge.settings.tabs || {};\n var value = options[key] !== undefined ? options[key] : setting[key];\n\n if (value === undefined) { return DEFAULTS[key]; }\n if (valuesOf(key).indexOf(value) !== -1) { return value; }\n\n ge.warn('tabs: ' + JSON.stringify(value) + ' is not a ' + key + ', which takes ' +\n JSON.stringify(valuesOf(key)) + ': ' + JSON.stringify(DEFAULTS[key]) + ' is used');\n return DEFAULTS[key];\n }\n\n /**\n * What the view being edited lays a container out as. A breakpoint view\n * narrows the canvas, not the window, and Bootstrap's classes answer to\n * the window: so the view says it, from the breakpoint the container\n * goes vertical at. The all view shows what the window gives.\n */\n function layoutHere(container) {\n var vertical = read(container).vertical;\n if (vertical === false) { return null; }\n\n if (ge.view() === 'all') {\n container.removeAttribute(LAYOUT_ATTR);\n return /flex$/.test(getComputedStyle(container).display) ? 'vertical' : 'horizontal';\n }\n if (vertical === true) { return 'vertical'; }\n\n return ge.breakpoints.indexOf(ge.view()) >= ge.breakpoints.indexOf(vertical) ? 'vertical' : 'horizontal';\n }\n\n function markLayout(container) {\n var layout = layoutHere(container);\n\n if (layout) {\n container.setAttribute(LAYOUT_ATTR, layout);\n } else {\n container.removeAttribute(LAYOUT_ATTR);\n }\n }\n\n function select(labelKey, options, onChange) {\n var box = dom.element('div', { 'class': 'ge-tabs-variant' });\n var id = 'ge-tabs-variant-' + (++fieldCounter);\n\n box.appendChild(dom.element('label', { 'class': 'form-label', 'for': id }, ge.t(labelKey)));\n var field = box.appendChild(dom.element('select', { 'class': 'form-select form-select-sm', id: id }));\n\n options.forEach(function(option) {\n field.appendChild(dom.element('option', { value: option.value }, option.label));\n });\n field.addEventListener('change', function() { onChange(field.value); });\n\n return { box: box, field: field };\n }\n\n /** The Tabs section of a tabs container's settings panel: a select per variant. */\n function createSection(container) {\n var body = dom.element('div', { 'class': 'ge-tabs-variants' });\n var fields = {};\n\n function change(key, value) {\n write(container, key, value);\n markLayout(container);\n render();\n }\n\n function options(key) {\n return FIELDS[key].choices.map(function(choice) {\n return { value: choice.value, label: ge.t(choice.labelKey) };\n });\n }\n\n ['variant', 'width', 'align'].forEach(function(key) {\n fields[key] = select(FIELDS[key].labelKey, options(key), function(value) { change(key, value); });\n });\n fields.vertical = select(FIELDS.vertical.labelKey, [\n { value: 'false', label: ge.t('container.tabs_layout_horizontal') },\n { value: 'true', label: ge.t('container.tabs_layout_vertical') },\n ].concat(fromBreakpoints().map(function(key) {\n return { value: key, label: ge.t('container.tabs_layout_vertical_from', { breakpoint: key }) };\n })), function(value) {\n change('vertical', value === 'true' ? true : value === 'false' ? false : value);\n });\n\n ['variant', 'width', 'align', 'vertical'].forEach(function(key) {\n fields[key].box.setAttribute('data-ge-tabs-variant', key);\n body.appendChild(fields[key].box);\n });\n\n /** Fill the selects from the classes, and turn off what does not apply. */\n function render() {\n var values = read(container);\n\n fields.variant.field.value = values.variant;\n fields.width.field.value = values.width;\n fields.align.field.value = values.align;\n fields.vertical.field.value = String(values.vertical);\n fields.width.field.disabled = values.vertical !== false;\n fields.align.field.disabled = values.vertical !== false || values.width !== 'natural';\n }\n\n render();\n sections.push({ container: container, element: body, render: render });\n\n return body;\n }\n\n function addTabTo(container, options) {\n options = options || {};\n\n var strip = stripOf(container);\n var content = dom.one(container, ':scope > .tab-content');\n var id = ge.containerId('tab');\n var number = dom.children(strip, '.nav-item').length + 1;\n\n var tab = strip.appendChild(dom.element('li', { 'class': 'nav-item ge-tab', role: 'presentation' }));\n var button = tab.appendChild(dom.element('button', {\n 'class': 'nav-link',\n type: 'button',\n role: 'tab',\n 'data-bs-toggle': 'tab',\n 'data-bs-target': '#' + id,\n 'aria-controls': id,\n }));\n button.appendChild(dom.element('span', { 'class': 'ge-pane-label' },\n options.label || ge.t('container.tab_label', { number: number })));\n\n var pane = content.appendChild(dom.element('div', {\n 'class': 'tab-pane fade',\n role: 'tabpanel',\n tabindex: '0',\n id: id,\n }));\n pane.appendChild(ge.defaultRegion());\n\n if (options.activate || number === 1) { activatePane(container, pane); }\n\n return pane;\n }\n\n function activatePane(container, pane) {\n var id = pane.getAttribute('id');\n\n dom.all(container, ':scope > .tab-content > .tab-pane').forEach(function(each) {\n dom.removeClass(each, 'show active');\n });\n dom.addClass(pane, 'show active');\n\n dom.all(stripOf(container) || container, '.nav-link').forEach(function(button) {\n var active = button.getAttribute('data-bs-target') === '#' + id;\n\n dom.toggleClass(button, 'active', active);\n button.setAttribute('aria-selected', active ? 'true' : 'false');\n });\n }\n\n function paneOf(container, tab) {\n var link = dom.one(tab, '.nav-link');\n var target = link ? link.getAttribute('data-bs-target') : null;\n\n return target ? dom.one(container, target) : null;\n }\n\n return {\n labelKey: 'container.add_tabs',\n\n // A tab strip sorts its own tabs, and the panes follow them. No\n // group: a tab belongs to the strip it was made in.\n onSortable: function(sortable) {\n sortable(dom.all(ge.canvas, '.ge-container-tabs').map(stripOf).filter(Boolean), {\n draggable: '.ge-tab',\n });\n },\n addPaneKey: 'container.add_tab',\n paneKind: 'tab',\n\n create: function(options) {\n var container = dom.element('div', { 'data-ge-container': 'tabs' });\n var labels = options.labels || [];\n var count = options.tabs || labels.length || 2;\n\n container.appendChild(dom.element('ul', { 'class': 'nav nav-tabs', role: 'tablist' }));\n container.appendChild(dom.element('div', { 'class': 'tab-content' }));\n\n // The layout last: it takes off what a vertical strip has no use for\n ['variant', 'width', 'align', 'vertical'].forEach(function(key) {\n write(container, key, chosen(options, key));\n });\n\n for (var i = 0; i < count; i++) {\n addTabTo(container, { label: labels[i] });\n }\n\n return container;\n },\n\n addPane: addTabTo,\n\n mark: function(container) {\n dom.all(container, ':scope > .tab-content > .tab-pane').forEach(function(pane) {\n dom.addClass(pane, 'ge-tab-pane');\n });\n\n dom.children(stripOf(container) || container, '.nav-item').forEach(function(tab) {\n dom.addClass(tab, 'ge-tab');\n\n var link = dom.one(tab, '.nav-link');\n if (link) { ge.makeLabelEditable(ge.labelIn(link)); }\n\n if (dom.child(tab, '.ge-tools-drawer')) { return; }\n\n ge.createPaneControls(tab, 'tab', ge.settings.tab_tools, ge.t('confirm.delete_tab'),\n function(removed) {\n var pane = paneOf(container, tab);\n var wasActive = dom.hasClass(pane, 'active');\n\n dom.fadeOut(tab, 200, function() {\n if (pane) { pane.remove(); }\n removed();\n\n var first = dom.one(container, ':scope > .tab-content > .tab-pane');\n if (wasActive && first) { activatePane(container, first); }\n });\n });\n });\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n container.removeAttribute(LAYOUT_ATTR);\n dom.all(container, '.ge-tab-pane').forEach(function(pane) {\n dom.removeClass(pane, 'ge-tab-pane');\n });\n ge.unwrapLabels(container);\n },\n\n panelSection: function(node, kind) {\n if (kind !== 'tabs' || !stripOf(node)) { return null; }\n\n return { labelKey: 'container.tabs_section', body: createSection(node) };\n },\n\n // After a view change or a change of classes: the layout marks and the\n // sections follow\n onRefresh: function(scope) {\n dom.selfAndAll(scope, '[data-ge-container=\"tabs\"]').forEach(markLayout);\n\n sections = sections.filter(function(entry) { return entry.element.isConnected; });\n sections.forEach(function(entry) {\n if (entry.container === scope || scope.contains(entry.container)) { entry.render(); }\n });\n },\n\n onDeinit: function() {\n sections = [];\n },\n\n /** Panes read in tab order, whatever order they were dropped in. */\n afterPaneMove: function(container) {\n var content = dom.one(container, ':scope > .tab-content');\n\n dom.children(stripOf(container) || container, '.nav-item').forEach(function(tab) {\n var pane = paneOf(container, tab);\n if (pane) { content.appendChild(pane); }\n });\n },\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,CAGO,SAASC,EAAIF,EAAMC,EAAU,CAChC,OAAOD,EAAOA,EAAK,cAAcC,CAAQ,EAAI,IACjD,CAGO,SAASE,EAAWH,EAAMC,EAAU,CACvC,GAAI,CAACD,EAAQ,MAAO,CAAC,EAErB,IAAII,EAAQL,EAAIC,EAAMC,CAAQ,EAC9B,OAAID,EAAK,WAAa,GAAKA,EAAK,QAAQC,CAAQ,GAAKG,EAAM,QAAQJ,CAAI,EAChEI,CACX,CAGO,SAASC,EAASC,EAAML,EAAU,CACrC,OAAKK,EAEE,MAAM,UAAU,OAAO,KAAKA,EAAK,SAAU,SAASC,EAAM,CAC7D,MAAO,CAACN,GAAYM,EAAK,QAAQN,CAAQ,CAC7C,CAAC,EAJmB,CAAC,CAKzB,CAGO,SAASO,EAAMF,EAAML,EAAU,CAClC,OAAOI,EAASC,EAAML,CAAQ,EAAE,CAAC,GAAK,IAC1C,CA6DO,SAASQ,EAAQC,EAAKC,EAAYC,EAAM,CAC3C,IAAIC,EAAO,SAAS,cAAcH,CAAG,EAErC,cAAO,KAAKC,GAAc,CAAC,CAAC,EAAE,QAAQ,SAASG,EAAM,CACjD,IAAIC,EAAQJ,EAAWG,CAAI,EACvBC,GAAU,M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EAAM,QAAQ,WAAa,CAAC,EAChFzE,EAAS,QAAQ,SAASyE,EAAO,EACzBA,EAAM,YAAcF,GAASA,EAAM,SAASE,EAAM,SAAS,IAAKA,EAAM,OAAO,CACrF,CAAC,CACL,EAEA,SAAU,UAAW,CACjBzE,EAAW,CAAC,CAChB,EAGA,cAAe,SAASE,EAAW,CAC/B,IAAI8C,EAAcC,EAAI/C,EAAW,uBAAuB,EAEpDiD,EAASlD,EAAQC,CAAS,GAAKA,EAAW,WAAW,EAAE,QAAQ,SAASkD,EAAK,CAC7E,IAAIE,EAAOK,EAAOzD,EAAWkD,CAAG,EAC5BE,GAAQN,EAAQ,YAAYM,CAAI,CACxC,CAAC,CACL,CACJ,CACJ",
6
- "names": ["GridEditor", "all", "root", "selector", "one", "selfAndAll", "found", "children", "node", "each", "child", "element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "toggleClass", "state", "hasClass", "dropEmptyClass", "hide", "node", "visible", "node", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "fadeOut", "node", "duration", "done", "animateAway", "style", "GridEditor", "STYLES", "WIDTHS", "ALIGNS", "DEFAULTS", "FIELDS", "fieldCounter", "LAYOUT_ATTR", "classValues", "map", "key", "ge", "sections", "stripOf", "container", "child", "fromBreakpoints", "infix", "vertical", "verticalClasses", "at", "verticals", "read", "strip", "has", "node", "name", "hasClass", "found", "fallback", "each", "classes", "write", "value", "removeClass", "addClass", "layout", "dropEmptyClass", "valuesOf", "chosen", "options", "setting", "layoutHere", "markLayout", "select", "labelKey", "onChange", "box", "element", "id", "field", "option", "createSection", "body", "fields", "change", "render", "choice", "values", "addTabTo", "content", "one", "number", "children", "tab", "button", "pane", "activatePane", "all", "active", "toggleClass", "paneOf", "link", "target", "sortable", "labels", "count", "i", "removed", "wasActive", "fadeOut", "first", "kind", "scope", "selfAndAll", "entry"]
4
+ "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 jQuery's: 400 ms unless the 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 * Tabs for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a tabs container. 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.tabs.min.js\"></script>\n *\n * A container's variant - its style, width, alignment and whether it is laid\n * out vertically, from a breakpoint up - is Bootstrap's classes on its strip\n * and on itself, and nothing else: it is read from the markup, chosen in the\n * container's settings panel, or given to createContainer and the tabs\n * setting for the ones made new.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_tabs': 'Tabs',\n 'container.add_tab': 'Add tab',\n 'container.tab_label': 'Tab {number}',\n 'confirm.delete_tab': 'Delete this tab and everything in it?',\n 'container.tabs_section': 'Tabs',\n 'container.tabs_style': 'Style',\n 'container.tabs_style_tabs': 'Tabs',\n 'container.tabs_style_pills': 'Pills',\n 'container.tabs_style_underline': 'Underline',\n 'container.tabs_width': 'Width',\n 'container.tabs_width_natural': 'Natural',\n 'container.tabs_width_fill': 'Fill',\n 'container.tabs_width_justified': 'Justified',\n 'container.tabs_align': 'Alignment',\n 'container.tabs_align_start': 'Start',\n 'container.tabs_align_center': 'Center',\n 'container.tabs_align_end': 'End',\n 'container.tabs_layout': 'Layout',\n 'container.tabs_layout_horizontal': 'Horizontal',\n 'container.tabs_layout_vertical': 'Vertical',\n 'container.tabs_layout_vertical_from': 'Vertical from {breakpoint}',\n});\n\n/** Each variant's values, the first its default, and the class each puts on the strip. */\nvar STYLES = { tabs: 'nav-tabs', pills: 'nav-pills', underline: 'nav-underline' };\nvar WIDTHS = { natural: null, fill: 'nav-fill', justified: 'nav-justified' };\nvar ALIGNS = { start: null, center: 'justify-content-center', end: 'justify-content-end' };\nvar DEFAULTS = { variant: 'tabs', width: 'natural', align: 'start', vertical: false };\n\n/** Each variant's select in the panel: its label, and its choices'. */\nvar FIELDS = {\n variant: { labelKey: 'container.tabs_style', choices: [\n { value: 'tabs', labelKey: 'container.tabs_style_tabs' },\n { value: 'pills', labelKey: 'container.tabs_style_pills' },\n { value: 'underline', labelKey: 'container.tabs_style_underline' },\n ] },\n width: { labelKey: 'container.tabs_width', choices: [\n { value: 'natural', labelKey: 'container.tabs_width_natural' },\n { value: 'fill', labelKey: 'container.tabs_width_fill' },\n { value: 'justified', labelKey: 'container.tabs_width_justified' },\n ] },\n align: { labelKey: 'container.tabs_align', choices: [\n { value: 'start', labelKey: 'container.tabs_align_start' },\n { value: 'center', labelKey: 'container.tabs_align_center' },\n { value: 'end', labelKey: 'container.tabs_align_end' },\n ] },\n vertical: { labelKey: 'container.tabs_layout' },\n};\n\nvar fieldCounter = 0;\n\n/** Where the layout marks what the view being edited lays the tabs out as. */\nvar LAYOUT_ATTR = 'data-ge-tabs-layout';\n\nfunction classValues(map) {\n return Object.keys(map).map(function(key) { return map[key]; }).filter(Boolean);\n}\n\nGridEditor.containers.tabs = function(ge) {\n\n var sections = []; // { container, render } for every panel section built\n\n /** The strip: the container's first .nav, whatever its style. */\n function stripOf(container) {\n return dom.child(container, '.nav');\n }\n\n /** The breakpoints a layout can go vertical from; xs is always. */\n function fromBreakpoints() {\n return ge.breakpoints.slice(1);\n }\n\n /** The infix of a vertical layout's classes: none for always. */\n function infix(vertical) {\n return vertical === true ? '' : '-' + vertical;\n }\n\n function verticalClasses(vertical) {\n var at = infix(vertical);\n\n return {\n container: ['d' + at + '-flex', 'align-items' + at + '-start'],\n strip: ['flex' + at + '-column', 'me' + at + '-3'],\n };\n }\n\n /** Every vertical value: always, and from each breakpoint. */\n function verticals() {\n return [true].concat(fromBreakpoints());\n }\n\n /**\n * What a container's classes say it is. Vertical is read only when the\n * container's flex and the strip's column are of the same breakpoint;\n * anything else is horizontal, and is left as it is.\n */\n function read(container) {\n var strip = stripOf(container);\n var has = function(node, name) { return !!node && dom.hasClass(node, name); };\n var found = function(map, fallback) {\n return Object.keys(map).filter(function(key) { return map[key] && has(strip, map[key]); })[0] || fallback;\n };\n\n var vertical = verticals().filter(function(each) {\n var classes = verticalClasses(each);\n return has(container, classes.container[0]) && has(strip, classes.strip[0]);\n })[0];\n\n return {\n variant: found(STYLES, 'tabs'),\n width: found(WIDTHS, 'natural'),\n align: found(ALIGNS, 'start'),\n vertical: vertical === undefined ? false : vertical,\n };\n }\n\n /**\n * Write one variant, and take off what it makes meaningless: a vertical\n * layout has no width or alignment, and a full width no alignment.\n * Choosing a layout clears every layout class, at any breakpoint, the\n * user's own included.\n */\n function write(container, key, value) {\n var strip = stripOf(container);\n if (!strip) { return; }\n\n if (key === 'variant') {\n dom.removeClass(strip, classValues(STYLES).join(' '));\n dom.addClass(strip, STYLES[value]);\n }\n\n if (key === 'width' || key === 'vertical') {\n dom.removeClass(strip, classValues(WIDTHS).join(' '));\n if (key === 'width' && WIDTHS[value]) { dom.addClass(strip, WIDTHS[value]); }\n }\n\n if (key === 'align' || key === 'vertical' || (key === 'width' && value !== 'natural')) {\n dom.removeClass(strip, classValues(ALIGNS).join(' '));\n if (key === 'align' && ALIGNS[value]) { dom.addClass(strip, ALIGNS[value]); }\n }\n\n if (key === 'vertical') {\n verticals().forEach(function(each) {\n var classes = verticalClasses(each);\n dom.removeClass(container, classes.container.join(' '));\n dom.removeClass(strip, classes.strip.join(' '));\n });\n strip.removeAttribute('aria-orientation');\n\n if (value !== false) {\n var layout = verticalClasses(value);\n dom.addClass(container, layout.container.join(' '));\n dom.addClass(strip, layout.strip.join(' '));\n strip.setAttribute('aria-orientation', 'vertical');\n }\n }\n\n dom.dropEmptyClass(container);\n }\n\n /** The values a variant takes, as the warning lists them. */\n function valuesOf(key) {\n if (key === 'variant') { return Object.keys(STYLES); }\n if (key === 'width') { return Object.keys(WIDTHS); }\n if (key === 'align') { return Object.keys(ALIGNS); }\n\n return [false].concat(verticals());\n }\n\n /**\n * A variant for a new container: the option, or the tabs setting, or the\n * default. A value it does not take is warned about and the default used.\n */\n function chosen(options, key) {\n var setting = ge.settings.tabs || {};\n var value = options[key] !== undefined ? options[key] : setting[key];\n\n if (value === undefined) { return DEFAULTS[key]; }\n if (valuesOf(key).indexOf(value) !== -1) { return value; }\n\n ge.warn('tabs: ' + JSON.stringify(value) + ' is not a ' + key + ', which takes ' +\n JSON.stringify(valuesOf(key)) + ': ' + JSON.stringify(DEFAULTS[key]) + ' is used');\n return DEFAULTS[key];\n }\n\n /**\n * What the view being edited lays a container out as. A breakpoint view\n * narrows the canvas, not the window, and Bootstrap's classes answer to\n * the window: so the view says it, from the breakpoint the container\n * goes vertical at. The all view shows what the window gives.\n */\n function layoutHere(container) {\n var vertical = read(container).vertical;\n if (vertical === false) { return null; }\n\n if (ge.view() === 'all') {\n container.removeAttribute(LAYOUT_ATTR);\n return /flex$/.test(getComputedStyle(container).display) ? 'vertical' : 'horizontal';\n }\n if (vertical === true) { return 'vertical'; }\n\n return ge.breakpoints.indexOf(ge.view()) >= ge.breakpoints.indexOf(vertical) ? 'vertical' : 'horizontal';\n }\n\n function markLayout(container) {\n var layout = layoutHere(container);\n\n if (layout) {\n container.setAttribute(LAYOUT_ATTR, layout);\n } else {\n container.removeAttribute(LAYOUT_ATTR);\n }\n }\n\n function select(labelKey, options, onChange) {\n var box = dom.element('div', { 'class': 'ge-tabs-variant' });\n var id = 'ge-tabs-variant-' + (++fieldCounter);\n\n box.appendChild(dom.element('label', { 'class': 'form-label', 'for': id }, ge.t(labelKey)));\n var field = box.appendChild(dom.element('select', { 'class': 'form-select form-select-sm', id: id }));\n\n options.forEach(function(option) {\n field.appendChild(dom.element('option', { value: option.value }, option.label));\n });\n field.addEventListener('change', function() { onChange(field.value); });\n\n return { box: box, field: field };\n }\n\n /** The Tabs section of a tabs container's settings panel: a select per variant. */\n function createSection(container) {\n var body = dom.element('div', { 'class': 'ge-tabs-variants' });\n var fields = {};\n\n function change(key, value) {\n write(container, key, value);\n markLayout(container);\n render();\n }\n\n function options(key) {\n return FIELDS[key].choices.map(function(choice) {\n return { value: choice.value, label: ge.t(choice.labelKey) };\n });\n }\n\n ['variant', 'width', 'align'].forEach(function(key) {\n fields[key] = select(FIELDS[key].labelKey, options(key), function(value) { change(key, value); });\n });\n fields.vertical = select(FIELDS.vertical.labelKey, [\n { value: 'false', label: ge.t('container.tabs_layout_horizontal') },\n { value: 'true', label: ge.t('container.tabs_layout_vertical') },\n ].concat(fromBreakpoints().map(function(key) {\n return { value: key, label: ge.t('container.tabs_layout_vertical_from', { breakpoint: key }) };\n })), function(value) {\n change('vertical', value === 'true' ? true : value === 'false' ? false : value);\n });\n\n ['variant', 'width', 'align', 'vertical'].forEach(function(key) {\n fields[key].box.setAttribute('data-ge-tabs-variant', key);\n body.appendChild(fields[key].box);\n });\n\n /** Fill the selects from the classes, and turn off what does not apply. */\n function render() {\n var values = read(container);\n\n fields.variant.field.value = values.variant;\n fields.width.field.value = values.width;\n fields.align.field.value = values.align;\n fields.vertical.field.value = String(values.vertical);\n fields.width.field.disabled = values.vertical !== false;\n fields.align.field.disabled = values.vertical !== false || values.width !== 'natural';\n }\n\n render();\n sections.push({ container: container, element: body, render: render });\n\n return body;\n }\n\n function addTabTo(container, options) {\n options = options || {};\n\n var strip = stripOf(container);\n var content = dom.one(container, ':scope > .tab-content');\n var id = ge.containerId('tab');\n var number = dom.children(strip, '.nav-item').length + 1;\n\n var tab = strip.appendChild(dom.element('li', { 'class': 'nav-item ge-tab', role: 'presentation' }));\n var button = tab.appendChild(dom.element('button', {\n 'class': 'nav-link',\n type: 'button',\n role: 'tab',\n 'data-bs-toggle': 'tab',\n 'data-bs-target': '#' + id,\n 'aria-controls': id,\n }));\n button.appendChild(dom.element('span', { 'class': 'ge-pane-label' },\n options.label || ge.t('container.tab_label', { number: number })));\n\n var pane = content.appendChild(dom.element('div', {\n 'class': 'tab-pane fade',\n role: 'tabpanel',\n tabindex: '0',\n id: id,\n }));\n pane.appendChild(ge.defaultRegion());\n\n if (options.activate || number === 1) { activatePane(container, pane); }\n\n return pane;\n }\n\n function activatePane(container, pane) {\n var id = pane.getAttribute('id');\n\n dom.all(container, ':scope > .tab-content > .tab-pane').forEach(function(each) {\n dom.removeClass(each, 'show active');\n });\n dom.addClass(pane, 'show active');\n\n dom.all(stripOf(container) || container, '.nav-link').forEach(function(button) {\n var active = button.getAttribute('data-bs-target') === '#' + id;\n\n dom.toggleClass(button, 'active', active);\n button.setAttribute('aria-selected', active ? 'true' : 'false');\n });\n }\n\n function paneOf(container, tab) {\n var link = dom.one(tab, '.nav-link');\n var target = link ? link.getAttribute('data-bs-target') : null;\n\n return target ? dom.one(container, target) : null;\n }\n\n return {\n labelKey: 'container.add_tabs',\n\n // A tab strip sorts its own tabs, and the panes follow them. No\n // group: a tab belongs to the strip it was made in.\n onSortable: function(sortable) {\n sortable(dom.all(ge.canvas, '.ge-container-tabs').map(stripOf).filter(Boolean), {\n draggable: '.ge-tab',\n });\n },\n addPaneKey: 'container.add_tab',\n paneKind: 'tab',\n\n create: function(options) {\n var container = dom.element('div', { 'data-ge-container': 'tabs' });\n var labels = options.labels || [];\n var count = options.tabs || labels.length || 2;\n\n container.appendChild(dom.element('ul', { 'class': 'nav nav-tabs', role: 'tablist' }));\n container.appendChild(dom.element('div', { 'class': 'tab-content' }));\n\n // The layout last: it takes off what a vertical strip has no use for\n ['variant', 'width', 'align', 'vertical'].forEach(function(key) {\n write(container, key, chosen(options, key));\n });\n\n for (var i = 0; i < count; i++) {\n addTabTo(container, { label: labels[i] });\n }\n\n return container;\n },\n\n addPane: addTabTo,\n\n mark: function(container) {\n dom.all(container, ':scope > .tab-content > .tab-pane').forEach(function(pane) {\n dom.addClass(pane, 'ge-tab-pane');\n });\n\n dom.children(stripOf(container) || container, '.nav-item').forEach(function(tab) {\n dom.addClass(tab, 'ge-tab');\n\n var link = dom.one(tab, '.nav-link');\n if (link) { ge.makeLabelEditable(ge.labelIn(link)); }\n\n if (dom.child(tab, '.ge-tools-drawer')) { return; }\n\n ge.createPaneControls(tab, 'tab', ge.settings.tab_tools, ge.t('confirm.delete_tab'),\n function(removed) {\n var pane = paneOf(container, tab);\n var wasActive = dom.hasClass(pane, 'active');\n\n dom.fadeOut(tab, 200, function() {\n if (pane) { pane.remove(); }\n removed();\n\n var first = dom.one(container, ':scope > .tab-content > .tab-pane');\n if (wasActive && first) { activatePane(container, first); }\n });\n });\n });\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n container.removeAttribute(LAYOUT_ATTR);\n dom.all(container, '.ge-tab-pane').forEach(function(pane) {\n dom.removeClass(pane, 'ge-tab-pane');\n });\n ge.unwrapLabels(container);\n },\n\n // The same, on a copy of the canvas: unmark only touches markup\n cleanMarkup: function(root) {\n var definition = this;\n dom.all(root, '[data-ge-container=\"tabs\"]').forEach(function(container) { definition.unmark(container); });\n },\n\n panelSection: function(node, kind) {\n if (kind !== 'tabs' || !stripOf(node)) { return null; }\n\n return { labelKey: 'container.tabs_section', body: createSection(node) };\n },\n\n // After a view change or a change of classes: the layout marks and the\n // sections follow\n onRefresh: function(scope) {\n dom.selfAndAll(scope, '[data-ge-container=\"tabs\"]').forEach(markLayout);\n\n sections = sections.filter(function(entry) { return entry.element.isConnected; });\n sections.forEach(function(entry) {\n if (entry.container === scope || scope.contains(entry.container)) { entry.render(); }\n });\n },\n\n onDeinit: function() {\n sections = [];\n },\n\n /** Panes read in tab order, whatever order they were dropped in. */\n afterPaneMove: function(container) {\n var content = dom.one(container, ':scope > .tab-content');\n\n dom.children(stripOf(container) || container, '.nav-item').forEach(function(tab) {\n var pane = paneOf(container, tab);\n if (pane) { content.appendChild(pane); }\n });\n },\n };\n};\n"],
5
+ "mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECCvC,SAASC,E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B,IAAI8C,EAAcC,EAAI/C,EAAW,uBAAuB,EAEpDiD,EAASlD,EAAQC,CAAS,GAAKA,EAAW,WAAW,EAAE,QAAQ,SAASkD,EAAK,CAC7E,IAAIE,EAAOK,EAAOzD,EAAWkD,CAAG,EAC5BE,GAAQN,EAAQ,YAAYM,CAAI,CACxC,CAAC,CACL,CACJ,CACJ",
6
+ "names": ["GridEditor", "all", "root", "selector", "one", "selfAndAll", "found", "children", "node", "each", "child", "element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "toggleClass", "state", "hasClass", "dropEmptyClass", "hide", "node", "visible", "node", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "fadeOut", "node", "duration", "done", "animateAway", "style", "GridEditor", "STYLES", "WIDTHS", "ALIGNS", "DEFAULTS", "FIELDS", "fieldCounter", "LAYOUT_ATTR", "classValues", "map", "key", "ge", "sections", "stripOf", "container", "child", "fromBreakpoints", "infix", "vertical", "verticalClasses", "at", "verticals", "read", "strip", "has", "node", "name", "hasClass", "found", "fallback", "each", "classes", "write", "value", "removeClass", "addClass", "layout", "dropEmptyClass", "valuesOf", "chosen", "options", "setting", "layoutHere", "markLayout", "select", "labelKey", "onChange", "box", "element", "id", "field", "option", "createSection", "body", "fields", "change", "render", "choice", "values", "addTabTo", "content", "one", "number", "children", "tab", "button", "pane", "activatePane", "all", "active", "toggleClass", "paneOf", "link", "target", "sortable", "labels", "count", "i", "removed", "wasActive", "fadeOut", "first", "root", "definition", "kind", "scope", "selfAndAll", "entry"]
7
7
  }
@@ -391,6 +391,30 @@ if (!GridEditor.features.text) {
391
391
  }
392
392
  clicks = null;
393
393
  },
394
+ // What closing the editors does, on a copy of the canvas: each
395
+ // open text holds what its editor says it holds, and the
396
+ // attributes the host gave it, as closeText leaves them. An
397
+ // editor that cannot say - no read, or not started yet - and the
398
+ // canvas has to leave editing to be read
399
+ cleanMarkup: function(root, liveOf) {
400
+ var blocks = all(root, ".ge-content.ge-rte-active").filter(isOurs);
401
+ for (var i = 0; i < blocks.length; i++) {
402
+ var copy = blocks[i];
403
+ var block = liveOf(copy);
404
+ var text = TEXTS[copy.getAttribute("data-ge-content-type")];
405
+ var before = block && readBefore.get(block);
406
+ var html = before && text.read ? text.read(block) : null;
407
+ if (typeof html !== "string") {
408
+ return false;
409
+ }
410
+ setHtml(copy, html);
411
+ restoreAttributes(copy, before, readReady.get(block) || before, attributesOf(block));
412
+ if (text.cleanCopy) {
413
+ text.cleanCopy(copy, block);
414
+ }
415
+ }
416
+ return true;
417
+ },
394
418
  // The first time only: an undo says ready again, and by then the
395
419
  // host may have changed the content area itself
396
420
  onContentReady: function(area) {
@@ -495,6 +519,13 @@ GridEditor2.texts.tinymce = function(ge) {
495
519
  window.tinymce.init(configuration);
496
520
  });
497
521
  },
522
+ // What remove() leaves in the content area: tinyMCE writes its
523
+ // content back as it removes an inline editor. Null while it is
524
+ // still starting, when there is nothing to ask
525
+ read: function(contentArea) {
526
+ var editor = editors.get(contentArea);
527
+ return editor ? editor.getContent() : null;
528
+ },
498
529
  stop: function(contentAreas) {
499
530
  contentAreas.filter(function(contentArea) {
500
531
  return hasClass(contentArea, "active");
@@ -394,6 +394,30 @@
394
394
  }
395
395
  clicks = null;
396
396
  },
397
+ // What closing the editors does, on a copy of the canvas: each
398
+ // open text holds what its editor says it holds, and the
399
+ // attributes the host gave it, as closeText leaves them. An
400
+ // editor that cannot say - no read, or not started yet - and the
401
+ // canvas has to leave editing to be read
402
+ cleanMarkup: function(root, liveOf) {
403
+ var blocks = all(root, ".ge-content.ge-rte-active").filter(isOurs);
404
+ for (var i = 0; i < blocks.length; i++) {
405
+ var copy = blocks[i];
406
+ var block = liveOf(copy);
407
+ var text = TEXTS[copy.getAttribute("data-ge-content-type")];
408
+ var before = block && readBefore.get(block);
409
+ var html = before && text.read ? text.read(block) : null;
410
+ if (typeof html !== "string") {
411
+ return false;
412
+ }
413
+ setHtml(copy, html);
414
+ restoreAttributes(copy, before, readReady.get(block) || before, attributesOf(block));
415
+ if (text.cleanCopy) {
416
+ text.cleanCopy(copy, block);
417
+ }
418
+ }
419
+ return true;
420
+ },
397
421
  // The first time only: an undo says ready again, and by then the
398
422
  // host may have changed the content area itself
399
423
  onContentReady: function(area) {
@@ -498,6 +522,13 @@
498
522
  window.tinymce.init(configuration);
499
523
  });
500
524
  },
525
+ // What remove() leaves in the content area: tinyMCE writes its
526
+ // content back as it removes an inline editor. Null while it is
527
+ // still starting, when there is nothing to ask
528
+ read: function(contentArea) {
529
+ var editor = editors.get(contentArea);
530
+ return editor ? editor.getContent() : null;
531
+ },
501
532
  stop: function(contentAreas) {
502
533
  contentAreas.filter(function(contentArea) {
503
534
  return hasClass(contentArea, "active");
@@ -1 +1 @@
1
- (()=>{var p=window.GridEditor;if(!p||typeof p.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 k(e,r){return e?Array.prototype.slice.call(e.querySelectorAll(r)):[]}function J(e,r){return e?Array.prototype.filter.call(e.children,function(o){return!r||o.matches(r)}):[]}function b(e,r){return J(e,r)[0]||null}function Q(e,r,o){var u=e&&e.nodeType===1?e.closest(r):null;return u&&o&&u!==o&&!o.contains(u)?null:u}function w(e,r,o){var u=document.createElement(e);return Object.keys(r||{}).forEach(function(n){var s=r[n];s!=null&&s!==!1&&u.setAttribute(n,s)}),o!=null&&(u.textContent=o),u}function q(e,r){return e.innerHTML=r==null?"":String(r),e}function _(e,r){return S(r).forEach(function(o){e.classList.add(o)}),e}function A(e,r){return S(r).forEach(function(o){e.classList.remove(o)}),e}function E(e,r){return!!e&&e.nodeType===1&&e.classList.contains(r)}function S(e){return String(e||"").split(/\s+/).filter(Boolean)}function V(e){return e.style.display="none",e}function N(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function B(e,r,o,u,n){var s=function(i){var f=Q(i.target,o,e);if(f&&e.contains(f))return u.call(f,i)};return S(r).forEach(function(i){e.addEventListener(i,s,n)}),s}var Z=400;function R(e,r,o,u){o=o===void 0?Z:o;var n=function(){V(e),u&&u()};if(!N(e)||!e.animate||o<=0){window.setTimeout(n,0);return}var s=e.animate(r(getComputedStyle(e)),{duration:o,easing:"ease-in-out"}),i=!1,f=function(){i||(i=!0,n())};s.onfinish=f,s.oncancel=f}function G(e,r,o){typeof r=="function"&&(o=r,r=void 0),e.style.overflow="hidden",R(e,function(u){return[{height:u.height,paddingTop:u.paddingTop,paddingBottom:u.paddingBottom,marginTop:u.marginTop,marginBottom:u.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},r,function(){e.style.removeProperty("overflow"),o&&o()})}if(!p.features.text){let e=function(n){var s={};return Array.prototype.slice.call(n.attributes).forEach(function(i){s[i.name]=i.value}),s},r=function(n){return(n||"").split(/\s+/).filter(function(s){return s!==""&&!$.test(s)})},o=function(n,s,i,f){var m=Object.assign({},s);Object.keys(Object.assign({},i,f)).forEach(function(l){l==="class"||D.test(l)||i[l]===f[l]||(f[l]===void 0?delete m[l]:m[l]=f[l])});var v=r(i.class),T=r(f.class),x=r(s.class).filter(function(l){return T.indexOf(l)!==-1||v.indexOf(l)===-1});T.forEach(function(l){v.indexOf(l)===-1&&x.indexOf(l)===-1&&x.push(l)}),x.length?m.class=x.join(" "):delete m.class,Object.keys(e(n)).forEach(function(l){n.removeAttribute(l)}),Object.keys(m).forEach(function(l){n.setAttribute(l,m[l])})},u=function(n){var s=n.settings,i={},f={};Object.keys(p.texts).forEach(function(t){i[t]=p.texts[t](n)}),Array.isArray(s.content_types)||(s.content_types=Object.keys(i)),Array.isArray(s.text_tools)||(s.text_tools=[]),Array.isArray(s.text_classes)||(s.text_classes=[]);function m(){return s.content_types.filter(function(t){return!!i[t]})}function v(t){var a=i[t];return a&&a.labelKey?n.t(a.labelKey):t}function T(t,a){var c=i[t],d=w("div",{class:"ge-content ge-content-type-"+t,"data-ge-content-type":t});return a&&a.nodeType?d.appendChild(a):q(d,a!==void 0?a:c&&c.initialContent||""),d}function x(t,a){return t&&typeof t=="object"&&(a=t,t=void 0),a=a||{},t=t||m()[0],!t||!i[t]?(f["createText:"+t]||(f["createText:"+t]=!0,n.warn('createText: no text editor "'+t+'" is loaded; load its plugin and name it in content_types')),null):n.place(T(t,a.content),"text",a)}function l(t){return!!i[t.getAttribute("data-ge-content-type")]}function K(t){if(!E(t,"ge-rte-active")&&N(t)){var a=i[t.getAttribute("data-ge-content-type")];if(a){if(a.available&&!a.available()){a.missingKey&&console.error(n.t(a.missingKey));return}O.set(t,e(t)),C.delete(t),_(t,"ge-rte-active"),a.start([t])}}}function z(){K(this)}function F(t){var a=i[t.getAttribute("data-ge-content-type")],c=O.get(t),d=c?e(t):null;a&&a.stop([t]),A(t,"ge-rte-active"),c&&(o(t,c,C.get(t)||c,d),O.delete(t),C.delete(t))}function U(t){var a=b(t,".ge-content"),c=a.getAttribute("data-ge-content-type"),d=w("div",{class:"ge-tools-drawer ge-text-drawer"});t.insertBefore(d,t.firstChild),n.createMoveTool(d);var j=n.addSettingsTool(d,a,s.text_classes),h=b(j,".ge-details-general"),L=w("div",{class:"ge-field ge-text-editor"});L.appendChild(w("span",{class:"ge-field-label"},n.t("panel.editor"))),L.appendChild(w("span",{class:"ge-field-value"},v(c))),h.insertBefore(L,h.firstChild),s.text_tools.forEach(function(y){n.createTool(d,y.title||"",y.className||"",y.iconClass||"bi bi-wrench",y.on)}),n.createTool(d,n.t("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){n.deleteNode("text",a,n.t("confirm.delete_text"),function(y){F(a),G(t,function(){t.remove(),y()})})})}function Y(){k(n.canvas,".ge-text-block").forEach(function(t){if(!b(t,".ge-tools-drawer")){var a=b(t,".ge-content");!a||!l(a)||U(t)}})}var W=m(),g=null;return{methods:{createText:x},textTypes:function(){var t=m(),a=Object.keys(i).filter(function(c){return t.indexOf(c)===-1});return t.concat(a).map(function(c){var d=i[c];return{type:c,label:v(c),offered:t.indexOf(c)!==-1,available:d.available?function(){return d.available()}:null,missingKey:d.missingKey,edit:function(j){var h=j.parentElement;E(h,"ge-text-block")&&!b(h,".ge-tools-drawer")&&U(h),K(j)}}})},toolbar:W.map(function(t){return{label:function(){return W.length>1?n.t("text.add_type",{editor:v(t)}):n.t("text.add")},iconClass:i[t].iconClass,className:"ge-add-text-button",kind:"text",group:"elements",inColumn:!0,create:function(){return T(t)}}}),onInit:function(){Y(),g&&n.canvas.removeEventListener("click",g),g=B(n.canvas,"click",".ge-content",z)},onBeforeDeinit:function(){k(n.canvas,".ge-content").forEach(function(t){l(t)&&F(t)})},onDeinit:function(){g&&n.canvas.removeEventListener("click",g),g=null},onContentReady:function(t){O.has(t)&&!C.has(t)&&C.set(t,e(t))}}};Object.assign(p.locales.en,{"text.add":"Text","text.add_type":"Text ({editor})","panel.editor":"Editor","panel.kind_text":"Text"}),O=new WeakMap,C=new WeakMap,$=/^(mce-|cke|ck-|note-)|^(ck|active|ge-rte-active)$/,D=/^(data-mce-|contenteditable$|spellcheck$)/,u.always=!0,p.features.text=u}var O,C,$,D;Object.assign(p.locales.en,{"text.tinymce":"tinyMCE"});function I(e){A(e,"active ge-rte-active"),["id","style","spellcheck","contenteditable","data-mce-style"].forEach(function(r){e.removeAttribute(r)})}var X="<p>Lorem ipsum dolores</p>",H=new WeakMap,M=new WeakSet;p.texts.tinymce=function(e){return{labelKey:"text.tinymce",initialContent:X,missingKey:"error.tinymce_missing",available:function(){return!!window.tinymce},start:function(r){var o=e.settings,u=o.tinymce&&o.tinymce.config?o.tinymce.config:{};r.forEach(function(n){if(!E(n,"active")){n.innerHTML==X&&(n.innerHTML=""),_(n,"active");var s=Object.assign({promotion:!1},u,{target:n,inline:!0,init_instance_callback:function(i){if(M.has(n)){M.delete(n),i.remove(),I(n);return}H.set(n,i),e.textReady(n),i.on("Undo Redo",function(){e.textReady(n)}),window.requestAnimationFrame(function(){i.removed||!i.ui||!i.ui.show||i.ui.show()}),i.on("focus",function(){window.requestAnimationFrame(function(){i.removed||!i.ui||!i.ui.show||i.ui.show()})}),i.focus(),u.init_instance_callback&&u.init_instance_callback.call(this,i)}});delete s.selector,window.tinymce.init(s)}})},stop:function(r){r.filter(function(o){return E(o,"active")}).forEach(function(o){var u=H.get(o);u?(H.delete(o),u.remove()):M.add(o),I(o)})}}};})();
1
+ (()=>{var v=window.GridEditor;if(!v||typeof v.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 A(e,r){return e?Array.prototype.slice.call(e.querySelectorAll(r)):[]}function Q(e,r){return e?Array.prototype.filter.call(e.children,function(a){return!r||a.matches(r)}):[]}function E(e,r){return Q(e,r)[0]||null}function V(e,r,a){var s=e&&e.nodeType===1?e.closest(r):null;return s&&a&&s!==a&&!a.contains(s)?null:s}function T(e,r,a){var s=document.createElement(e);return Object.keys(r||{}).forEach(function(n){var u=r[n];u!=null&&u!==!1&&s.setAttribute(n,u)}),a!=null&&(s.textContent=a),s}function k(e,r){return e.innerHTML=r==null?"":String(r),e}function L(e,r){return H(r).forEach(function(a){e.classList.add(a)}),e}function S(e,r){return H(r).forEach(function(a){e.classList.remove(a)}),e}function O(e,r){return!!e&&e.nodeType===1&&e.classList.contains(r)}function H(e){return String(e||"").split(/\s+/).filter(Boolean)}function Z(e){return e.style.display="none",e}function M(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function G(e,r,a,s,n){var u=function(i){var d=V(i.target,a,e);if(d&&e.contains(d))return s.call(d,i)};return H(r).forEach(function(i){e.addEventListener(i,u,n)}),u}var R=400;function tt(e,r,a,s){a=a===void 0?R:a;var n=function(){Z(e),s&&s()};if(!M(e)||!e.animate||a<=0){window.setTimeout(n,0);return}var u=e.animate(r(getComputedStyle(e)),{duration:a,easing:"ease-in-out"}),i=!1,d=function(){i||(i=!0,n())};u.onfinish=d,u.oncancel=d}function P(e,r,a){typeof r=="function"&&(a=r,r=void 0),e.style.overflow="hidden",tt(e,function(s){return[{height:s.height,paddingTop:s.paddingTop,paddingBottom:s.paddingBottom,marginTop:s.marginTop,marginBottom:s.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},r,function(){e.style.removeProperty("overflow"),a&&a()})}if(!v.features.text){let e=function(n){var u={};return Array.prototype.slice.call(n.attributes).forEach(function(i){u[i.name]=i.value}),u},r=function(n){return(n||"").split(/\s+/).filter(function(u){return u!==""&&!D.test(u)})},a=function(n,u,i,d){var m=Object.assign({},u);Object.keys(Object.assign({},i,d)).forEach(function(l){l==="class"||I.test(l)||i[l]===d[l]||(d[l]===void 0?delete m[l]:m[l]=d[l])});var w=r(i.class),_=r(d.class),b=r(u.class).filter(function(l){return _.indexOf(l)!==-1||w.indexOf(l)===-1});_.forEach(function(l){w.indexOf(l)===-1&&b.indexOf(l)===-1&&b.push(l)}),b.length?m.class=b.join(" "):delete m.class,Object.keys(e(n)).forEach(function(l){n.removeAttribute(l)}),Object.keys(m).forEach(function(l){n.setAttribute(l,m[l])})},s=function(n){var u=n.settings,i={},d={};Object.keys(v.texts).forEach(function(t){i[t]=v.texts[t](n)}),Array.isArray(u.content_types)||(u.content_types=Object.keys(i)),Array.isArray(u.text_tools)||(u.text_tools=[]),Array.isArray(u.text_classes)||(u.text_classes=[]);function m(){return u.content_types.filter(function(t){return!!i[t]})}function w(t){var o=i[t];return o&&o.labelKey?n.t(o.labelKey):t}function _(t,o){var f=i[t],c=T("div",{class:"ge-content ge-content-type-"+t,"data-ge-content-type":t});return o&&o.nodeType?c.appendChild(o):k(c,o!==void 0?o:f&&f.initialContent||""),c}function b(t,o){return t&&typeof t=="object"&&(o=t,t=void 0),o=o||{},t=t||m()[0],!t||!i[t]?(d["createText:"+t]||(d["createText:"+t]=!0,n.warn('createText: no text editor "'+t+'" is loaded; load its plugin and name it in content_types')),null):n.place(_(t,o.content),"text",o)}function l(t){return!!i[t.getAttribute("data-ge-content-type")]}function F(t){if(!O(t,"ge-rte-active")&&M(t)){var o=i[t.getAttribute("data-ge-content-type")];if(o){if(o.available&&!o.available()){o.missingKey&&console.error(n.t(o.missingKey));return}j.set(t,e(t)),y.delete(t),L(t,"ge-rte-active"),o.start([t])}}}function Y(){F(this)}function U(t){var o=i[t.getAttribute("data-ge-content-type")],f=j.get(t),c=f?e(t):null;o&&o.stop([t]),S(t,"ge-rte-active"),f&&(a(t,f,y.get(t)||f,c),j.delete(t),y.delete(t))}function W(t){var o=E(t,".ge-content"),f=o.getAttribute("data-ge-content-type"),c=T("div",{class:"ge-tools-drawer ge-text-drawer"});t.insertBefore(c,t.firstChild),n.createMoveTool(c);var g=n.addSettingsTool(c,o,u.text_classes),p=E(g,".ge-details-general"),h=T("div",{class:"ge-field ge-text-editor"});h.appendChild(T("span",{class:"ge-field-label"},n.t("panel.editor"))),h.appendChild(T("span",{class:"ge-field-value"},w(f))),p.insertBefore(h,p.firstChild),u.text_tools.forEach(function(x){n.createTool(c,x.title||"",x.className||"",x.iconClass||"bi bi-wrench",x.on)}),n.createTool(c,n.t("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){n.deleteNode("text",o,n.t("confirm.delete_text"),function(x){U(o),P(t,function(){t.remove(),x()})})})}function J(){A(n.canvas,".ge-text-block").forEach(function(t){if(!E(t,".ge-tools-drawer")){var o=E(t,".ge-content");!o||!l(o)||W(t)}})}var q=m(),C=null;return{methods:{createText:b},textTypes:function(){var t=m(),o=Object.keys(i).filter(function(f){return t.indexOf(f)===-1});return t.concat(o).map(function(f){var c=i[f];return{type:f,label:w(f),offered:t.indexOf(f)!==-1,available:c.available?function(){return c.available()}:null,missingKey:c.missingKey,edit:function(g){var p=g.parentElement;O(p,"ge-text-block")&&!E(p,".ge-tools-drawer")&&W(p),F(g)}}})},toolbar:q.map(function(t){return{label:function(){return q.length>1?n.t("text.add_type",{editor:w(t)}):n.t("text.add")},iconClass:i[t].iconClass,className:"ge-add-text-button",kind:"text",group:"elements",inColumn:!0,create:function(){return _(t)}}}),onInit:function(){J(),C&&n.canvas.removeEventListener("click",C),C=G(n.canvas,"click",".ge-content",Y)},onBeforeDeinit:function(){A(n.canvas,".ge-content").forEach(function(t){l(t)&&U(t)})},onDeinit:function(){C&&n.canvas.removeEventListener("click",C),C=null},cleanMarkup:function(t,o){for(var f=A(t,".ge-content.ge-rte-active").filter(l),c=0;c<f.length;c++){var g=f[c],p=o(g),h=i[g.getAttribute("data-ge-content-type")],x=p&&j.get(p),B=x&&h.read?h.read(p):null;if(typeof B!="string")return!1;k(g,B),a(g,x,y.get(p)||x,e(p)),h.cleanCopy&&h.cleanCopy(g,p)}return!0},onContentReady:function(t){j.has(t)&&!y.has(t)&&y.set(t,e(t))}}};Object.assign(v.locales.en,{"text.add":"Text","text.add_type":"Text ({editor})","panel.editor":"Editor","panel.kind_text":"Text"}),j=new WeakMap,y=new WeakMap,D=/^(mce-|cke|ck-|note-)|^(ck|active|ge-rte-active)$/,I=/^(data-mce-|contenteditable$|spellcheck$)/,s.always=!0,v.features.text=s}var j,y,D,I;Object.assign(v.locales.en,{"text.tinymce":"tinyMCE"});function X(e){S(e,"active ge-rte-active"),["id","style","spellcheck","contenteditable","data-mce-style"].forEach(function(r){e.removeAttribute(r)})}var z="<p>Lorem ipsum dolores</p>",N=new WeakMap,K=new WeakSet;v.texts.tinymce=function(e){return{labelKey:"text.tinymce",initialContent:z,missingKey:"error.tinymce_missing",available:function(){return!!window.tinymce},start:function(r){var a=e.settings,s=a.tinymce&&a.tinymce.config?a.tinymce.config:{};r.forEach(function(n){if(!O(n,"active")){n.innerHTML==z&&(n.innerHTML=""),L(n,"active");var u=Object.assign({promotion:!1},s,{target:n,inline:!0,init_instance_callback:function(i){if(K.has(n)){K.delete(n),i.remove(),X(n);return}N.set(n,i),e.textReady(n),i.on("Undo Redo",function(){e.textReady(n)}),window.requestAnimationFrame(function(){i.removed||!i.ui||!i.ui.show||i.ui.show()}),i.on("focus",function(){window.requestAnimationFrame(function(){i.removed||!i.ui||!i.ui.show||i.ui.show()})}),i.focus(),s.init_instance_callback&&s.init_instance_callback.call(this,i)}});delete u.selector,window.tinymce.init(u)}})},read:function(r){var a=N.get(r);return a?a.getContent():null},stop:function(r){r.filter(function(a){return O(a,"active")}).forEach(function(a){var s=N.get(a);s?(N.delete(a),s.remove()):K.add(a),X(a)})}}};})();