@themarioga/grid-editor 9.0.0-beta.5 → 9.0.0-beta.7

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 (96) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +43 -24
  3. package/UPGRADING.md +24 -5
  4. package/dist/grideditor.bundle.min.js +3 -3
  5. package/dist/grideditor.css +5 -4
  6. package/dist/grideditor.d.ts +13 -20
  7. package/dist/grideditor.esm.js +174 -104
  8. package/dist/grideditor.jquery.js +1 -3
  9. package/dist/grideditor.jquery.min.js +1 -1
  10. package/dist/grideditor.jquery.min.js.map +2 -2
  11. package/dist/grideditor.js +174 -104
  12. package/dist/grideditor.min.css +1 -1
  13. package/dist/grideditor.min.css.map +1 -1
  14. package/dist/grideditor.min.js +2 -2
  15. package/dist/grideditor.min.js.map +3 -3
  16. package/dist/locales/grideditor.es.esm.js +1 -0
  17. package/dist/locales/grideditor.es.js +1 -0
  18. package/dist/locales/grideditor.es.min.js +1 -1
  19. package/dist/locales/grideditor.es.min.js.map +2 -2
  20. package/dist/plugins/grideditor.accordion.esm.js +16 -0
  21. package/dist/plugins/grideditor.accordion.js +16 -0
  22. package/dist/plugins/grideditor.accordion.min.js +1 -1
  23. package/dist/plugins/grideditor.accordion.min.js.map +3 -3
  24. package/dist/plugins/grideditor.card.esm.js +4 -0
  25. package/dist/plugins/grideditor.card.js +4 -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.carousel.esm.js +7 -0
  29. package/dist/plugins/grideditor.carousel.js +7 -0
  30. package/dist/plugins/grideditor.carousel.min.js +1 -1
  31. package/dist/plugins/grideditor.carousel.min.js.map +3 -3
  32. package/dist/plugins/grideditor.ckeditor.esm.js +9 -0
  33. package/dist/plugins/grideditor.ckeditor.js +9 -0
  34. package/dist/plugins/grideditor.ckeditor.min.js +1 -1
  35. package/dist/plugins/grideditor.ckeditor.min.js.map +3 -3
  36. package/dist/plugins/grideditor.clipboard.esm.js +47 -25
  37. package/dist/plugins/grideditor.clipboard.js +47 -25
  38. package/dist/plugins/grideditor.clipboard.min.js +1 -1
  39. package/dist/plugins/grideditor.clipboard.min.js.map +3 -3
  40. package/dist/plugins/grideditor.codemirror-inline.min.js.map +1 -1
  41. package/dist/plugins/grideditor.codemirror.min.js.map +1 -1
  42. package/dist/plugins/grideditor.elements.esm.js +3 -0
  43. package/dist/plugins/grideditor.elements.js +3 -0
  44. package/dist/plugins/grideditor.elements.min.js +1 -1
  45. package/dist/plugins/grideditor.elements.min.js.map +3 -3
  46. package/dist/plugins/grideditor.gutters.min.js.map +1 -1
  47. package/dist/plugins/grideditor.history.esm.js +2 -7
  48. package/dist/plugins/grideditor.history.js +2 -7
  49. package/dist/plugins/grideditor.history.min.js +1 -1
  50. package/dist/plugins/grideditor.history.min.js.map +3 -3
  51. package/dist/plugins/grideditor.inline-style.min.js.map +1 -1
  52. package/dist/plugins/grideditor.offcanvas.esm.js +4 -0
  53. package/dist/plugins/grideditor.offcanvas.js +4 -0
  54. package/dist/plugins/grideditor.offcanvas.min.js +1 -1
  55. package/dist/plugins/grideditor.offcanvas.min.js.map +3 -3
  56. package/dist/plugins/grideditor.order.min.js +1 -1
  57. package/dist/plugins/grideditor.order.min.js.map +1 -1
  58. package/dist/plugins/grideditor.popup.esm.js +4 -0
  59. package/dist/plugins/grideditor.popup.js +4 -0
  60. package/dist/plugins/grideditor.popup.min.js +1 -1
  61. package/dist/plugins/grideditor.popup.min.js.map +3 -3
  62. package/dist/plugins/grideditor.sections.esm.js +9 -0
  63. package/dist/plugins/grideditor.sections.js +9 -0
  64. package/dist/plugins/grideditor.sections.min.js +1 -1
  65. package/dist/plugins/grideditor.sections.min.js.map +3 -3
  66. package/dist/plugins/grideditor.summernote.esm.js +9 -0
  67. package/dist/plugins/grideditor.summernote.js +9 -0
  68. package/dist/plugins/grideditor.summernote.min.js +1 -1
  69. package/dist/plugins/grideditor.summernote.min.js.map +3 -3
  70. package/dist/plugins/grideditor.tabs.esm.js +7 -0
  71. package/dist/plugins/grideditor.tabs.js +7 -0
  72. package/dist/plugins/grideditor.tabs.min.js +1 -1
  73. package/dist/plugins/grideditor.tabs.min.js.map +3 -3
  74. package/dist/plugins/grideditor.tinymce.esm.js +9 -0
  75. package/dist/plugins/grideditor.tinymce.js +9 -0
  76. package/dist/plugins/grideditor.tinymce.min.js +1 -1
  77. package/dist/plugins/grideditor.tinymce.min.js.map +3 -3
  78. package/docs/events.md +14 -12
  79. package/docs/locale-keys.md +1 -0
  80. package/docs/plugins.md +11 -8
  81. package/example/clipboard.html +20 -14
  82. package/package.json +1 -1
  83. package/src/js/dom.js +6 -0
  84. package/src/js/grideditor.jquery.js +0 -2
  85. package/src/js/grideditor.js +233 -114
  86. package/src/js/locales/grideditor.es.js +1 -0
  87. package/src/js/plugins/grideditor.accordion.js +9 -0
  88. package/src/js/plugins/grideditor.card.js +5 -0
  89. package/src/js/plugins/grideditor.carousel.js +5 -0
  90. package/src/js/plugins/grideditor.clipboard.js +70 -33
  91. package/src/js/plugins/grideditor.history.js +6 -9
  92. package/src/js/plugins/grideditor.offcanvas.js +5 -0
  93. package/src/js/plugins/grideditor.popup.js +5 -0
  94. package/src/js/plugins/grideditor.tabs.js +5 -0
  95. package/src/less/grideditor.less +5 -4
  96. package/types/grideditor.d.ts +13 -20
@@ -354,6 +354,10 @@ GridEditor.containers.popup = function(ge) {
354
354
  return {
355
355
  labelKey: "container.add_popup",
356
356
  paneKind: "popup",
357
+ // Where rows go: the popup's body
358
+ regionOf: function(container) {
359
+ return one(container, ".modal-body");
360
+ },
357
361
  // The ids a copy of a popup has to rename together
358
362
  references: ["data-ge-popup-id", "data-ge-popup-target"],
359
363
  onInit: triggers.onInit,
@@ -358,6 +358,10 @@
358
358
  return {
359
359
  labelKey: "container.add_popup",
360
360
  paneKind: "popup",
361
+ // Where rows go: the popup's body
362
+ regionOf: function(container) {
363
+ return one(container, ".modal-body");
364
+ },
361
365
  // The ids a copy of a popup has to rename together
362
366
  references: ["data-ge-popup-id", "data-ge-popup-target"],
363
367
  onInit: triggers.onInit,
@@ -1 +1 @@
1
- (()=>{var b=window.GridEditor;if(!b||typeof b.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 s(e,o){return e?Array.prototype.slice.call(e.querySelectorAll(o)):[]}function D(e,o){return e?e.querySelector(o):null}function Q(e,o,r){var a=e&&e.nodeType===1?e.closest(o):null;return a&&r&&a!==r&&!r.contains(a)?null:a}function V(e){var o=document.createElement("template");return o.innerHTML=e,Array.prototype.slice.call(o.content.childNodes)}function H(e){for(var o=V(e.trim()),r=0;r<o.length;r++)if(o[r].nodeType===1)return o[r];return null}function d(e,o,r){var a=document.createElement(e);return Object.keys(o||{}).forEach(function(l){var c=o[l];c!=null&&c!==!1&&a.setAttribute(l,c)}),r!=null&&(a.textContent=r),a}function E(e,o){return C(o).forEach(function(r){e.classList.add(r)}),e}function v(e,o){return C(o).forEach(function(r){e.classList.remove(r)}),e}function y(e,o,r){return C(o).forEach(function(a){r===void 0?e.classList.toggle(a):e.classList.toggle(a,!!r)}),e}function B(e,o){return!!e&&e.nodeType===1&&e.classList.contains(o)}function C(e){return String(e||"").split(/\s+/).filter(Boolean)}function F(e){return e.getAttribute("class")||e.removeAttribute("class"),e}function N(e,o,r,a,l){var c=function(p){var f=Q(p.target,r,e);if(f&&e.contains(f))return a.call(f,p)};return C(o).forEach(function(p){e.addEventListener(p,c,l)}),c}function U(e,o,r,a,l){var c="ge-"+o+"-trigger",p="ge-"+o+"-orphan",f=null,g=["style","aria-hidden","aria-modal","role"],O=["show","showing","hiding"],m=new Map,w=[],T=new Map,x=new Map,h=null,A=new Map,q={show:"opening",shown:"open",hide:"closing"};function S(n){return n.getAttribute(r)}function z(n){var t=S(n);return s(n,"[id]").filter(function(i){return i.id===t})[0]||null}function G(){return s(e.canvas,"["+r+"]").map(z).filter(Boolean)}function M(n,t){return s(t||e.canvas,"["+r+"]").some(function(i){return S(i)===n})}function K(){s(e.canvas,"["+a+"]").forEach(function(n){E(n,c);var t=n.getAttribute(a);if(n.removeAttribute("data-bs-toggle"),n.removeAttribute("data-bs-target"),M(t)){v(n,p);return}var i=n.closest(".column"),u=i?s(i,"["+r+"]"):[];if(u.length===1){n.setAttribute(a,S(u[0])),v(n,p);return}E(n,p),e.operate(function(){e.emit(o+"-orphan",e.payloadFor(o,n,{parent:n.parentElement,source:"api",missing:t}))})})}function _(n){s(n,"["+a+"]").forEach(function(t){var i=t.getAttribute(a);M(i,n)&&(t.setAttribute("data-bs-toggle",l),t.setAttribute("data-bs-target","#"+i))})}function W(){s(e.canvas,"["+a+"]").forEach(function(n){n.removeAttribute("data-bs-toggle"),n.removeAttribute("data-bs-target")})}function I(n){n=n||e.canvas,s(n,"["+a+"]").forEach(function(i){v(i,p),F(i)}),_(n);var t=new Map;m.forEach(function(i,u){t.set(u.id,i)}),A.forEach(function(i,u){t.set(u.id,i)}),t.size&&s(n,"[id]").forEach(function(i){t.has(i.id)&&L(i,t.get(i.id))})}function P(n){var t={classes:O.filter(function(i){return B(n,i)})};return g.forEach(function(i){t[i]=n.getAttribute(i)}),t}function L(n,t){O.forEach(function(i){y(n,i,t.classes.indexOf(i)!==-1)}),g.forEach(function(i){n.getAttribute(i),t[i]===null?n.removeAttribute(i):n.setAttribute(i,t[i])})}function k(){w=[],G().forEach(function(n){m.has(n)||m.set(n,P(n)),s(n,'[data-ge-bs-dismiss="'+l+'"]').forEach(function(t){e.resumeToggles(t),w.push(t)})}),_(e.canvas),h&&h.abort(),h=new AbortController,["show","shown","hide","hidden"].forEach(function(n){e.canvas.addEventListener(n+".bs."+l,function(t){m.has(t.target)&&(n==="hidden"?x.delete(t.target):x.set(t.target,q[n]))},{signal:h.signal})})}function X(){var n=window.bootstrap,t=l.charAt(0).toUpperCase()+l.slice(1);return n&&n[t]&&n[t].getInstance?n[t]:null}function Y(n){var t=X(),i=t?t.getInstance(n):null;if(i)return function(){i.hide()};var u=D(n,'[data-bs-dismiss="'+l+'"], [data-ge-bs-dismiss="'+l+'"]');return u?function(){e.resumeToggles(u),u.click(),e.suspendToggles(u)}:null}function J(){h&&h.abort(),h=null,m.forEach(function(n,t){var i=x.get(t),u=i&&i!=="closing"?Y(t):null,j=function(){A.delete(t),L(t,n)};if(!i||i!=="closing"&&!u){j();return}A.set(t,n),t.addEventListener("hidden.bs."+l,j,{once:!0}),i==="opening"?t.addEventListener("shown.bs."+l,u,{once:!0}):i==="open"&&u()}),m=new Map,x=new Map,w.forEach(function(n){e.suspendToggles(n)}),w=[],W()}return{write:I,onInit:function(){if(K(),f&&f.abort(),f=new AbortController,N(e.canvas,"click","."+c+", ["+a+"]",function(t){B(e.canvas,"ge-editing")&&t.preventDefault()},{signal:f.signal}),e.previewing()){var n=new Map(T);T=new Map,k(),n.forEach(function(t,i){e.canvas.contains(i)&&L(i,t)})}},onDeinit:function(){f&&f.abort(),f=null,e.previewing()&&m.forEach(function(n,t){T.set(t,P(t))}),I()},onPreviewChange:function(n){n?k():J()}}}Object.assign(b.locales.en,{"container.add_popup":"Popup","container.popup_title":"Title","container.popup_trigger":"Open","tool.toggle_popup":"Fold this popup away while editing"});b.containers.popup=function(e){var o=U(e,"popup","data-ge-popup-id","data-ge-popup-target","modal");return{labelKey:"container.add_popup",paneKind:"popup",references:["data-ge-popup-id","data-ge-popup-target"],onInit:o.onInit,onDeinit:o.onDeinit,onPreviewChange:o.onPreviewChange,cleanMarkup:function(r){var a=this;o.write(r),s(r,'[data-ge-container="popup"]').forEach(function(l){a.unmark(l)})},create:function(r){var a=e.containerId("popup"),l=d("div",{"data-ge-container":"popup","data-ge-popup-id":a});r.trigger!==!1&&l.appendChild(d("button",{type:"button",class:"btn btn-primary ge-popup-trigger","data-ge-popup-target":a},r.trigger_label||e.t("container.popup_trigger")));var c=l.appendChild(d("div",{class:"modal fade",tabindex:"-1","aria-hidden":"true",id:a})),p=c.appendChild(d("div",{class:"modal-dialog"}));r.size&&E(p,"modal-"+r.size);var f=p.appendChild(d("div",{class:"modal-content"})),g=f.appendChild(d("div",{class:"modal-header"}));return g.appendChild(d("h5",{class:"modal-title"})).appendChild(d("span",{class:"ge-pane-label"},r.title||e.t("container.popup_title"))),g.appendChild(H('<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>')),f.appendChild(d("div",{class:"modal-body"})).appendChild(e.defaultRegion()),l},mark:function(r){s(r,"[data-bs-dismiss]").forEach(function(a){e.suspendToggles(a)}),s(r,".modal-title").forEach(function(a){e.makeLabelEditable(e.labelIn(a))})},unmark:function(r){e.resumeToggles(r),v(r,"ge-popup-collapsed"),e.unwrapLabels(r)},tools:function(r,a){e.createTool(r,e.t("tool.toggle_popup"),"ge-toggle-popup","bi bi-chevron-bar-contract",function(){y(a,"ge-popup-collapsed")})}}};})();
1
+ (()=>{var b=window.GridEditor;if(!b||typeof b.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 s(e,o){return e?Array.prototype.slice.call(e.querySelectorAll(o)):[]}function y(e,o){return e?e.querySelector(o):null}function Q(e,o,r){var a=e&&e.nodeType===1?e.closest(o):null;return a&&r&&a!==r&&!r.contains(a)?null:a}function V(e){var o=document.createElement("template");return o.innerHTML=e,Array.prototype.slice.call(o.content.childNodes)}function H(e){for(var o=V(e.trim()),r=0;r<o.length;r++)if(o[r].nodeType===1)return o[r];return null}function d(e,o,r){var a=document.createElement(e);return Object.keys(o||{}).forEach(function(l){var c=o[l];c!=null&&c!==!1&&a.setAttribute(l,c)}),r!=null&&(a.textContent=r),a}function E(e,o){return T(o).forEach(function(r){e.classList.add(r)}),e}function v(e,o){return T(o).forEach(function(r){e.classList.remove(r)}),e}function C(e,o,r){return T(o).forEach(function(a){r===void 0?e.classList.toggle(a):e.classList.toggle(a,!!r)}),e}function O(e,o){return!!e&&e.nodeType===1&&e.classList.contains(o)}function T(e){return String(e||"").split(/\s+/).filter(Boolean)}function F(e){return e.getAttribute("class")||e.removeAttribute("class"),e}function N(e,o,r,a,l){var c=function(p){var f=Q(p.target,r,e);if(f&&e.contains(f))return a.call(f,p)};return T(o).forEach(function(p){e.addEventListener(p,c,l)}),c}function U(e,o,r,a,l){var c="ge-"+o+"-trigger",p="ge-"+o+"-orphan",f=null,g=["style","aria-hidden","aria-modal","role"],M=["show","showing","hiding"],m=new Map,w=[],A=new Map,x=new Map,h=null,S=new Map,q={show:"opening",shown:"open",hide:"closing"};function L(n){return n.getAttribute(r)}function z(n){var t=L(n);return s(n,"[id]").filter(function(i){return i.id===t})[0]||null}function G(){return s(e.canvas,"["+r+"]").map(z).filter(Boolean)}function _(n,t){return s(t||e.canvas,"["+r+"]").some(function(i){return L(i)===n})}function K(){s(e.canvas,"["+a+"]").forEach(function(n){E(n,c);var t=n.getAttribute(a);if(n.removeAttribute("data-bs-toggle"),n.removeAttribute("data-bs-target"),_(t)){v(n,p);return}var i=n.closest(".column"),u=i?s(i,"["+r+"]"):[];if(u.length===1){n.setAttribute(a,L(u[0])),v(n,p);return}E(n,p),e.operate(function(){e.emit(o+"-orphan",e.payloadFor(o,n,{parent:n.parentElement,source:"api",missing:t}))})})}function I(n){s(n,"["+a+"]").forEach(function(t){var i=t.getAttribute(a);_(i,n)&&(t.setAttribute("data-bs-toggle",l),t.setAttribute("data-bs-target","#"+i))})}function W(){s(e.canvas,"["+a+"]").forEach(function(n){n.removeAttribute("data-bs-toggle"),n.removeAttribute("data-bs-target")})}function P(n){n=n||e.canvas,s(n,"["+a+"]").forEach(function(i){v(i,p),F(i)}),I(n);var t=new Map;m.forEach(function(i,u){t.set(u.id,i)}),S.forEach(function(i,u){t.set(u.id,i)}),t.size&&s(n,"[id]").forEach(function(i){t.has(i.id)&&B(i,t.get(i.id))})}function k(n){var t={classes:M.filter(function(i){return O(n,i)})};return g.forEach(function(i){t[i]=n.getAttribute(i)}),t}function B(n,t){M.forEach(function(i){C(n,i,t.classes.indexOf(i)!==-1)}),g.forEach(function(i){n.getAttribute(i),t[i]===null?n.removeAttribute(i):n.setAttribute(i,t[i])})}function j(){w=[],G().forEach(function(n){m.has(n)||m.set(n,k(n)),s(n,'[data-ge-bs-dismiss="'+l+'"]').forEach(function(t){e.resumeToggles(t),w.push(t)})}),I(e.canvas),h&&h.abort(),h=new AbortController,["show","shown","hide","hidden"].forEach(function(n){e.canvas.addEventListener(n+".bs."+l,function(t){m.has(t.target)&&(n==="hidden"?x.delete(t.target):x.set(t.target,q[n]))},{signal:h.signal})})}function X(){var n=window.bootstrap,t=l.charAt(0).toUpperCase()+l.slice(1);return n&&n[t]&&n[t].getInstance?n[t]:null}function Y(n){var t=X(),i=t?t.getInstance(n):null;if(i)return function(){i.hide()};var u=y(n,'[data-bs-dismiss="'+l+'"], [data-ge-bs-dismiss="'+l+'"]');return u?function(){e.resumeToggles(u),u.click(),e.suspendToggles(u)}:null}function J(){h&&h.abort(),h=null,m.forEach(function(n,t){var i=x.get(t),u=i&&i!=="closing"?Y(t):null,D=function(){S.delete(t),B(t,n)};if(!i||i!=="closing"&&!u){D();return}S.set(t,n),t.addEventListener("hidden.bs."+l,D,{once:!0}),i==="opening"?t.addEventListener("shown.bs."+l,u,{once:!0}):i==="open"&&u()}),m=new Map,x=new Map,w.forEach(function(n){e.suspendToggles(n)}),w=[],W()}return{write:P,onInit:function(){if(K(),f&&f.abort(),f=new AbortController,N(e.canvas,"click","."+c+", ["+a+"]",function(t){O(e.canvas,"ge-editing")&&t.preventDefault()},{signal:f.signal}),e.previewing()){var n=new Map(A);A=new Map,j(),n.forEach(function(t,i){e.canvas.contains(i)&&B(i,t)})}},onDeinit:function(){f&&f.abort(),f=null,e.previewing()&&m.forEach(function(n,t){A.set(t,k(t))}),P()},onPreviewChange:function(n){n?j():J()}}}Object.assign(b.locales.en,{"container.add_popup":"Popup","container.popup_title":"Title","container.popup_trigger":"Open","tool.toggle_popup":"Fold this popup away while editing"});b.containers.popup=function(e){var o=U(e,"popup","data-ge-popup-id","data-ge-popup-target","modal");return{labelKey:"container.add_popup",paneKind:"popup",regionOf:function(r){return y(r,".modal-body")},references:["data-ge-popup-id","data-ge-popup-target"],onInit:o.onInit,onDeinit:o.onDeinit,onPreviewChange:o.onPreviewChange,cleanMarkup:function(r){var a=this;o.write(r),s(r,'[data-ge-container="popup"]').forEach(function(l){a.unmark(l)})},create:function(r){var a=e.containerId("popup"),l=d("div",{"data-ge-container":"popup","data-ge-popup-id":a});r.trigger!==!1&&l.appendChild(d("button",{type:"button",class:"btn btn-primary ge-popup-trigger","data-ge-popup-target":a},r.trigger_label||e.t("container.popup_trigger")));var c=l.appendChild(d("div",{class:"modal fade",tabindex:"-1","aria-hidden":"true",id:a})),p=c.appendChild(d("div",{class:"modal-dialog"}));r.size&&E(p,"modal-"+r.size);var f=p.appendChild(d("div",{class:"modal-content"})),g=f.appendChild(d("div",{class:"modal-header"}));return g.appendChild(d("h5",{class:"modal-title"})).appendChild(d("span",{class:"ge-pane-label"},r.title||e.t("container.popup_title"))),g.appendChild(H('<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>')),f.appendChild(d("div",{class:"modal-body"})).appendChild(e.defaultRegion()),l},mark:function(r){s(r,"[data-bs-dismiss]").forEach(function(a){e.suspendToggles(a)}),s(r,".modal-title").forEach(function(a){e.makeLabelEditable(e.labelIn(a))})},unmark:function(r){e.resumeToggles(r),v(r,"ge-popup-collapsed"),e.unwrapLabels(r)},tools:function(r,a){e.createTool(r,e.t("tool.toggle_popup"),"ge-toggle-popup","bi bi-chevron-bar-contract",function(){C(a,"ge-popup-collapsed")})}}};})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/js/register.js", "../../src/js/dom.js", "../../src/js/triggers/triggers.js", "../../src/js/plugins/grideditor.popup.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 * What the popup and the offcanvas plugins share: the host's triggers.\n *\n * A trigger is markup the host owns - a button, a link - anywhere in the\n * canvas, that points at a container by id. While editing it must not reach\n * Bootstrap, and one that points at nothing is warned about. With the\n * preview button pressed it does reach it, and opens the container as the\n * page will, until the button is let go. Not a public\n * API: the build puts a copy of this file in each plugin that imports it,\n * so it keeps nothing of its own between plugins.\n */\nimport * as dom from '../dom.js';\n\n/**\n * The trigger handling of one kind of container.\n *\n * `kind` names the container (`popup`), its classes (`ge-popup-trigger`,\n * `ge-popup-orphan`) and the event for a trigger left pointing at nothing\n * (`popup-orphan`). `idAttribute` is the attribute a container has its id in,\n * `targetAttribute` the one a trigger names it with, and `toggle` is\n * Bootstrap's `data-bs-toggle` for it, written on the way out.\n *\n * Gives back `onInit`, `onDeinit` and `onPreviewChange`, for the plugin to\n * hand the editor as its own, and `write(root)`, what onDeinit does to the\n * canvas, for cleanMarkup to do to a copy.\n */\nexport function triggersFor(ge, kind, idAttribute, targetAttribute, toggle) {\n var triggerClass = 'ge-' + kind + '-trigger';\n var orphanClass = 'ge-' + kind + '-orphan';\n var listening = null;\n\n // What Bootstrap changes on a container as it opens and closes it\n var STATE_ATTRIBUTES = ['style', 'aria-hidden', 'aria-modal', 'role'];\n var STATE_CLASSES = ['show', 'showing', 'hiding'];\n // Each container's element as the preview found it: what it goes back to\n var before = new Map();\n // The dismisses the preview gave back to Bootstrap, to take away again\n var dismisses = [];\n // What a getHtml in the middle of a preview took off, for onInit to put back\n var saved = new Map();\n // Where Bootstrap is with each container it has been asked to open:\n // opening, open or closing, as its events tell. Not there once closed\n var phases = new Map();\n var watching = null;\n // Let go of while Bootstrap was still closing them: what they go back to once it is done\n var pending = new Map();\n var PHASES = { show: 'opening', shown: 'open', hide: 'closing' };\n\n function idOf(container) {\n return container.getAttribute(idAttribute);\n }\n\n /** The modal, the panel: the element in a container with the container's id. */\n function targetOf(container) {\n var id = idOf(container);\n\n return dom.all(container, '[id]').filter(function(node) { return node.id === id; })[0] || null;\n }\n\n function targets() {\n return dom.all(ge.canvas, '[' + idAttribute + ']').map(targetOf).filter(Boolean);\n }\n\n /** Whether a container with this id is on the canvas. */\n function exists(id, root) {\n return dom.all(root || ge.canvas, '[' + idAttribute + ']').some(function(container) {\n return idOf(container) === id;\n });\n }\n\n function wire() {\n dom.all(ge.canvas, '[' + targetAttribute + ']').forEach(function(trigger) {\n dom.addClass(trigger, triggerClass);\n var wanted = trigger.getAttribute(targetAttribute);\n\n // Bootstrap's own attributes are written at getHtml time, not\n // while editing, so a click here cannot open a real container\n trigger.removeAttribute('data-bs-toggle');\n trigger.removeAttribute('data-bs-target');\n\n if (exists(wanted)) {\n dom.removeClass(trigger, orphanClass);\n return;\n }\n\n var column = trigger.closest('.column');\n var nearby = column ? dom.all(column, '[' + idAttribute + ']') : [];\n\n if (nearby.length === 1) {\n trigger.setAttribute(targetAttribute, idOf(nearby[0]));\n dom.removeClass(trigger, orphanClass);\n return;\n }\n\n dom.addClass(trigger, orphanClass);\n\n ge.operate(function() {\n ge.emit(kind + '-orphan', ge.payloadFor(kind, trigger, {\n parent: trigger.parentElement,\n source: 'api',\n missing: wanted,\n }));\n });\n });\n }\n\n /** Bootstrap's own attributes on the triggers that point at something. */\n function arm(root) {\n dom.all(root, '[' + targetAttribute + ']').forEach(function(trigger) {\n var wanted = trigger.getAttribute(targetAttribute);\n if (!exists(wanted, root)) { return; }\n\n trigger.setAttribute('data-bs-toggle', toggle);\n trigger.setAttribute('data-bs-target', '#' + wanted);\n });\n }\n\n function disarm() {\n dom.all(ge.canvas, '[' + targetAttribute + ']').forEach(function(trigger) {\n trigger.removeAttribute('data-bs-toggle');\n trigger.removeAttribute('data-bs-target');\n });\n }\n\n function write(root) {\n root = root || ge.canvas;\n\n // The warning marking is editing furniture, whether or not\n // the trigger can be wired up\n dom.all(root, '[' + targetAttribute + ']').forEach(function(trigger) {\n dom.removeClass(trigger, orphanClass);\n dom.dropEmptyClass(trigger);\n });\n\n arm(root);\n\n // A container the preview opened is read as the preview found it,\n // whether the preview goes on or Bootstrap is still closing it\n var quiet = new Map();\n before.forEach(function(state, target) { quiet.set(target.id, state); });\n pending.forEach(function(state, target) { quiet.set(target.id, state); });\n if (!quiet.size) { return; }\n\n dom.all(root, '[id]').forEach(function(node) {\n if (quiet.has(node.id)) { putState(node, quiet.get(node.id)); }\n });\n }\n\n /** What Bootstrap may change on a container, as it is now. */\n function stateOf(target) {\n var state = { classes: STATE_CLASSES.filter(function(name) { return dom.hasClass(target, name); }) };\n STATE_ATTRIBUTES.forEach(function(name) { state[name] = target.getAttribute(name); });\n return state;\n }\n\n function putState(target, state) {\n STATE_CLASSES.forEach(function(name) { dom.toggleClass(target, name, state.classes.indexOf(name) !== -1); });\n STATE_ATTRIBUTES.forEach(function(name) {\n // Read first: a style Bootstrap last wrote through the element's\n // style object is only written to the attribute when it is read,\n // and would otherwise come back, empty, after it is taken off\n target.getAttribute(name);\n\n if (state[name] === null) {\n target.removeAttribute(name);\n } else {\n target.setAttribute(name, state[name]);\n }\n });\n }\n\n /**\n * The preview pressed: the triggers reach Bootstrap, and so do the\n * container's own close buttons, which editing keeps from it.\n */\n function startPreview() {\n // Again after a getHtml, whose init took them away once more\n dismisses = [];\n targets().forEach(function(target) {\n if (!before.has(target)) { before.set(target, stateOf(target)); }\n\n dom.all(target, '[data-ge-bs-dismiss=\"' + toggle + '\"]').forEach(function(dismiss) {\n ge.resumeToggles(dismiss);\n dismisses.push(dismiss);\n });\n });\n arm(ge.canvas);\n\n if (watching) { watching.abort(); }\n watching = new AbortController();\n ['show', 'shown', 'hide', 'hidden'].forEach(function(name) {\n ge.canvas.addEventListener(name + '.bs.' + toggle, function(e) {\n if (!before.has(e.target)) { return; }\n\n if (name === 'hidden') {\n phases.delete(e.target);\n } else {\n phases.set(e.target, PHASES[name]);\n }\n }, { signal: watching.signal });\n });\n }\n\n /** Bootstrap's component for this kind, when the page has it on window. */\n function component() {\n var bootstrap = window.bootstrap;\n var name = toggle.charAt(0).toUpperCase() + toggle.slice(1);\n\n return bootstrap && bootstrap[name] && bootstrap[name].getInstance ? bootstrap[name] : null;\n }\n\n /**\n * Ask Bootstrap to close a container: through its instance, or, for a\n * page with no window.bootstrap - an app that imports it - through its\n * own close button, which its data api still listens for.\n */\n function closer(target) {\n var Component = component();\n var instance = Component ? Component.getInstance(target) : null;\n if (instance) { return function() { instance.hide(); }; }\n\n var dismiss = dom.one(target, '[data-bs-dismiss=\"' + toggle + '\"], [data-ge-bs-dismiss=\"' + toggle + '\"]');\n if (!dismiss) { return null; }\n\n return function() {\n ge.resumeToggles(dismiss);\n dismiss.click();\n ge.suspendToggles(dismiss);\n };\n }\n\n /**\n * The preview let go: an open container is closed, by Bootstrap so its\n * backdrop and the page's scroll go back too, and each is left as the\n * preview found it once Bootstrap is done with it. One still opening is\n * closed when it has opened, as Bootstrap will not close it before.\n */\n function endPreview() {\n if (watching) { watching.abort(); }\n watching = null;\n\n before.forEach(function(state, target) {\n var phase = phases.get(target);\n var close = phase && phase !== 'closing' ? closer(target) : null;\n var restore = function() {\n pending.delete(target);\n putState(target, state);\n };\n\n if (!phase || (phase !== 'closing' && !close)) {\n restore();\n return;\n }\n\n pending.set(target, state);\n target.addEventListener('hidden.bs.' + toggle, restore, { once: true });\n if (phase === 'opening') {\n target.addEventListener('shown.bs.' + toggle, close, { once: true });\n } else if (phase === 'open') {\n close();\n }\n });\n before = new Map();\n phases = new Map();\n\n dismisses.forEach(function(dismiss) { ge.suspendToggles(dismiss); });\n dismisses = [];\n disarm();\n }\n\n return {\n write: write,\n\n // Triggers are markup the host owns, anywhere in the canvas, so they\n // are looked at whenever the canvas is initialized rather than only\n // when a container is touched\n onInit: function() {\n wire();\n\n if (listening) { listening.abort(); }\n listening = new AbortController();\n\n // A trigger is often a link, and a link still navigates even\n // with its Bootstrap attributes suspended\n dom.delegate(ge.canvas, 'click', '.' + triggerClass + ', [' + targetAttribute + ']', function(e) {\n if (dom.hasClass(ge.canvas, 'ge-editing')) { e.preventDefault(); }\n }, { signal: listening.signal });\n\n // A getHtml in the middle of a preview: back to what it was\n if (ge.previewing()) {\n var live = new Map(saved);\n saved = new Map();\n startPreview();\n live.forEach(function(state, target) {\n if (ge.canvas.contains(target)) { putState(target, state); }\n });\n }\n },\n\n onDeinit: function() {\n if (listening) { listening.abort(); }\n listening = null;\n\n // In the middle of a preview, write reads the markup as the\n // preview found it, not with a container open: onInit puts it back\n if (ge.previewing()) {\n before.forEach(function(state, target) { saved.set(target, stateOf(target)); });\n }\n\n write();\n },\n\n onPreviewChange: function(previewing) {\n if (previewing) {\n startPreview();\n } else {\n endPreview();\n }\n },\n };\n}\n", "/**\n * Popups for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a popup: a bootstrap modal and its trigger. 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.popup.min.js\"></script>\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\nimport { triggersFor } from '../triggers/triggers.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_popup': 'Popup',\n 'container.popup_title': 'Title',\n 'container.popup_trigger': 'Open',\n 'tool.toggle_popup': 'Fold this popup away while editing',\n});\n\nGridEditor.containers.popup = function(ge) {\n\n var triggers = triggersFor(ge, 'popup', 'data-ge-popup-id', 'data-ge-popup-target', 'modal');\n\n return {\n labelKey: 'container.add_popup',\n paneKind: 'popup',\n\n // The ids a copy of a popup has to rename together\n references: ['data-ge-popup-id', 'data-ge-popup-target'],\n\n onInit: triggers.onInit,\n onDeinit: triggers.onDeinit,\n // The preview pressed, the triggers open the real thing; let go, it closes\n onPreviewChange: triggers.onPreviewChange,\n\n // What onDeinit and unmark do, on a copy of the canvas\n cleanMarkup: function(root) {\n var definition = this;\n triggers.write(root);\n dom.all(root, '[data-ge-container=\"popup\"]').forEach(function(container) { definition.unmark(container); });\n },\n\n create: function(options) {\n var id = ge.containerId('popup');\n var container = dom.element('div', { 'data-ge-container': 'popup', 'data-ge-popup-id': id });\n\n if (options.trigger !== false) {\n container.appendChild(dom.element('button', {\n type: 'button',\n 'class': 'btn btn-primary ge-popup-trigger',\n 'data-ge-popup-target': id,\n }, options.trigger_label || ge.t('container.popup_trigger')));\n }\n\n var modal = container.appendChild(dom.element('div', {\n 'class': 'modal fade',\n tabindex: '-1',\n 'aria-hidden': 'true',\n id: id,\n }));\n var dialog = modal.appendChild(dom.element('div', { 'class': 'modal-dialog' }));\n if (options.size) { dom.addClass(dialog, 'modal-' + options.size); }\n\n var content = dialog.appendChild(dom.element('div', { 'class': 'modal-content' }));\n var header = content.appendChild(dom.element('div', { 'class': 'modal-header' }));\n header.appendChild(dom.element('h5', { 'class': 'modal-title' }))\n .appendChild(dom.element('span', { 'class': 'ge-pane-label' },\n options.title || ge.t('container.popup_title')));\n header.appendChild(dom.create('<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>'));\n content.appendChild(dom.element('div', { 'class': 'modal-body' })).appendChild(ge.defaultRegion());\n\n return container;\n },\n\n mark: function(container) {\n // Nothing in a popup may reach Bootstrap while editing:\n // the modal is rendered unfolded and static, and a real\n // modal opening over it would be the editor fighting\n // itself\n dom.all(container, '[data-bs-dismiss]').forEach(function(dismiss) {\n ge.suspendToggles(dismiss);\n });\n dom.all(container, '.modal-title').forEach(function(title) {\n ge.makeLabelEditable(ge.labelIn(title));\n });\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n dom.removeClass(container, 'ge-popup-collapsed');\n ge.unwrapLabels(container);\n },\n\n /** A page of unfolded modals stays workable if they can be folded away. */\n tools: function(drawer, container) {\n ge.createTool(drawer, ge.t('tool.toggle_popup'), 'ge-toggle-popup', 'bi bi-chevron-bar-contract',\n function() {\n dom.toggleClass(container, 'ge-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c,EAAO,YAAgBC,EAAO,8FAA8F,CAAC,EAC7HF,EAAQ,YAAgBJ,EAAQ,MAAO,CAAE,MAAS,YAAa,CAAC,CAAC,EAAE,YAAYT,EAAG,cAAc,CAAC,EAE1FM,CACX,EAEA,KAAM,SAASA,EAAW,CAKlBD,EAAIC,EAAW,mBAAmB,EAAE,QAAQ,SAASU,EAAS,CAC9DhB,EAAG,eAAegB,CAAO,CAC7B,CAAC,EACGX,EAAIC,EAAW,cAAc,EAAE,QAAQ,SAASW,EAAO,CACvDjB,EAAG,kBAAkBA,EAAG,QAAQiB,CAAK,CAAC,CAC1C,CAAC,CACL,EAEA,OAAQ,SAASX,EAAW,CACxBN,EAAG,cAAcM,CAAS,EACtBY,EAAYZ,EAAW,oBAAoB,EAC/CN,EAAG,aAAaM,CAAS,CAC7B,EAGA,MAAO,SAASa,EAAQb,EAAW,CAC/BN,EAAG,WAAWmB,EAAQnB,EAAG,EAAE,mBAAmB,EAAG,kBAAmB,6BAChE,UAAW,CACHoB,EAAYd,EAAW,oBAAoB,CACnD,CAAC,CACT,CACJ,CACJ",
6
- "names": ["GridEditor", "all", "root", "selector", "one", "closest", "node", "selector", "stopAt", "found", "parse", "html", "template", "create", "nodes", "i", "element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "toggleClass", "state", "hasClass", "dropEmptyClass", "delegate", "root", "types", "selector", "handler", "options", "listener", "event", "match", "closest", "split", "type", "triggersFor", "ge", "kind", "idAttribute", "targetAttribute", "toggle", "triggerClass", "orphanClass", "listening", "STATE_ATTRIBUTES", "STATE_CLASSES", "before", "dismisses", "saved", "phases", "watching", "pending", "PHASES", "idOf", "container", "targetOf", "id", "all", "node", "targets", "exists", "root", "wire", "trigger", "addClass", "wanted", "removeClass", "column", "nearby", "arm", "disarm", "write", "dropEmptyClass", "quiet", "state", "target", "putState", "stateOf", "name", "hasClass", "toggleClass", "startPreview", "dismiss", "e", "component", "bootstrap", "closer", "Component", "instance", "one", "endPreview", "phase", "close", "restore", "delegate", "live", "previewing", "GridEditor", "ge", "triggers", "triggersFor", "root", "definition", "all", "container", "options", "id", "element", "modal", "dialog", "addClass", "content", "header", "create", "dismiss", "title", "removeClass", "drawer", "toggleClass"]
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 // Marked while it goes: the history plugin waits for it, rather than\n // keep the canvas halfway through as a step of its own\n addClass(node, 'ge-leaving');\n\n var finish = function() {\n removeClass(node, 'ge-leaving');\n dropEmptyClass(node);\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 * What the popup and the offcanvas plugins share: the host's triggers.\n *\n * A trigger is markup the host owns - a button, a link - anywhere in the\n * canvas, that points at a container by id. While editing it must not reach\n * Bootstrap, and one that points at nothing is warned about. With the\n * preview button pressed it does reach it, and opens the container as the\n * page will, until the button is let go. Not a public\n * API: the build puts a copy of this file in each plugin that imports it,\n * so it keeps nothing of its own between plugins.\n */\nimport * as dom from '../dom.js';\n\n/**\n * The trigger handling of one kind of container.\n *\n * `kind` names the container (`popup`), its classes (`ge-popup-trigger`,\n * `ge-popup-orphan`) and the event for a trigger left pointing at nothing\n * (`popup-orphan`). `idAttribute` is the attribute a container has its id in,\n * `targetAttribute` the one a trigger names it with, and `toggle` is\n * Bootstrap's `data-bs-toggle` for it, written on the way out.\n *\n * Gives back `onInit`, `onDeinit` and `onPreviewChange`, for the plugin to\n * hand the editor as its own, and `write(root)`, what onDeinit does to the\n * canvas, for cleanMarkup to do to a copy.\n */\nexport function triggersFor(ge, kind, idAttribute, targetAttribute, toggle) {\n var triggerClass = 'ge-' + kind + '-trigger';\n var orphanClass = 'ge-' + kind + '-orphan';\n var listening = null;\n\n // What Bootstrap changes on a container as it opens and closes it\n var STATE_ATTRIBUTES = ['style', 'aria-hidden', 'aria-modal', 'role'];\n var STATE_CLASSES = ['show', 'showing', 'hiding'];\n // Each container's element as the preview found it: what it goes back to\n var before = new Map();\n // The dismisses the preview gave back to Bootstrap, to take away again\n var dismisses = [];\n // What a getHtml in the middle of a preview took off, for onInit to put back\n var saved = new Map();\n // Where Bootstrap is with each container it has been asked to open:\n // opening, open or closing, as its events tell. Not there once closed\n var phases = new Map();\n var watching = null;\n // Let go of while Bootstrap was still closing them: what they go back to once it is done\n var pending = new Map();\n var PHASES = { show: 'opening', shown: 'open', hide: 'closing' };\n\n function idOf(container) {\n return container.getAttribute(idAttribute);\n }\n\n /** The modal, the panel: the element in a container with the container's id. */\n function targetOf(container) {\n var id = idOf(container);\n\n return dom.all(container, '[id]').filter(function(node) { return node.id === id; })[0] || null;\n }\n\n function targets() {\n return dom.all(ge.canvas, '[' + idAttribute + ']').map(targetOf).filter(Boolean);\n }\n\n /** Whether a container with this id is on the canvas. */\n function exists(id, root) {\n return dom.all(root || ge.canvas, '[' + idAttribute + ']').some(function(container) {\n return idOf(container) === id;\n });\n }\n\n function wire() {\n dom.all(ge.canvas, '[' + targetAttribute + ']').forEach(function(trigger) {\n dom.addClass(trigger, triggerClass);\n var wanted = trigger.getAttribute(targetAttribute);\n\n // Bootstrap's own attributes are written at getHtml time, not\n // while editing, so a click here cannot open a real container\n trigger.removeAttribute('data-bs-toggle');\n trigger.removeAttribute('data-bs-target');\n\n if (exists(wanted)) {\n dom.removeClass(trigger, orphanClass);\n return;\n }\n\n var column = trigger.closest('.column');\n var nearby = column ? dom.all(column, '[' + idAttribute + ']') : [];\n\n if (nearby.length === 1) {\n trigger.setAttribute(targetAttribute, idOf(nearby[0]));\n dom.removeClass(trigger, orphanClass);\n return;\n }\n\n dom.addClass(trigger, orphanClass);\n\n ge.operate(function() {\n ge.emit(kind + '-orphan', ge.payloadFor(kind, trigger, {\n parent: trigger.parentElement,\n source: 'api',\n missing: wanted,\n }));\n });\n });\n }\n\n /** Bootstrap's own attributes on the triggers that point at something. */\n function arm(root) {\n dom.all(root, '[' + targetAttribute + ']').forEach(function(trigger) {\n var wanted = trigger.getAttribute(targetAttribute);\n if (!exists(wanted, root)) { return; }\n\n trigger.setAttribute('data-bs-toggle', toggle);\n trigger.setAttribute('data-bs-target', '#' + wanted);\n });\n }\n\n function disarm() {\n dom.all(ge.canvas, '[' + targetAttribute + ']').forEach(function(trigger) {\n trigger.removeAttribute('data-bs-toggle');\n trigger.removeAttribute('data-bs-target');\n });\n }\n\n function write(root) {\n root = root || ge.canvas;\n\n // The warning marking is editing furniture, whether or not\n // the trigger can be wired up\n dom.all(root, '[' + targetAttribute + ']').forEach(function(trigger) {\n dom.removeClass(trigger, orphanClass);\n dom.dropEmptyClass(trigger);\n });\n\n arm(root);\n\n // A container the preview opened is read as the preview found it,\n // whether the preview goes on or Bootstrap is still closing it\n var quiet = new Map();\n before.forEach(function(state, target) { quiet.set(target.id, state); });\n pending.forEach(function(state, target) { quiet.set(target.id, state); });\n if (!quiet.size) { return; }\n\n dom.all(root, '[id]').forEach(function(node) {\n if (quiet.has(node.id)) { putState(node, quiet.get(node.id)); }\n });\n }\n\n /** What Bootstrap may change on a container, as it is now. */\n function stateOf(target) {\n var state = { classes: STATE_CLASSES.filter(function(name) { return dom.hasClass(target, name); }) };\n STATE_ATTRIBUTES.forEach(function(name) { state[name] = target.getAttribute(name); });\n return state;\n }\n\n function putState(target, state) {\n STATE_CLASSES.forEach(function(name) { dom.toggleClass(target, name, state.classes.indexOf(name) !== -1); });\n STATE_ATTRIBUTES.forEach(function(name) {\n // Read first: a style Bootstrap last wrote through the element's\n // style object is only written to the attribute when it is read,\n // and would otherwise come back, empty, after it is taken off\n target.getAttribute(name);\n\n if (state[name] === null) {\n target.removeAttribute(name);\n } else {\n target.setAttribute(name, state[name]);\n }\n });\n }\n\n /**\n * The preview pressed: the triggers reach Bootstrap, and so do the\n * container's own close buttons, which editing keeps from it.\n */\n function startPreview() {\n // Again after a getHtml, whose init took them away once more\n dismisses = [];\n targets().forEach(function(target) {\n if (!before.has(target)) { before.set(target, stateOf(target)); }\n\n dom.all(target, '[data-ge-bs-dismiss=\"' + toggle + '\"]').forEach(function(dismiss) {\n ge.resumeToggles(dismiss);\n dismisses.push(dismiss);\n });\n });\n arm(ge.canvas);\n\n if (watching) { watching.abort(); }\n watching = new AbortController();\n ['show', 'shown', 'hide', 'hidden'].forEach(function(name) {\n ge.canvas.addEventListener(name + '.bs.' + toggle, function(e) {\n if (!before.has(e.target)) { return; }\n\n if (name === 'hidden') {\n phases.delete(e.target);\n } else {\n phases.set(e.target, PHASES[name]);\n }\n }, { signal: watching.signal });\n });\n }\n\n /** Bootstrap's component for this kind, when the page has it on window. */\n function component() {\n var bootstrap = window.bootstrap;\n var name = toggle.charAt(0).toUpperCase() + toggle.slice(1);\n\n return bootstrap && bootstrap[name] && bootstrap[name].getInstance ? bootstrap[name] : null;\n }\n\n /**\n * Ask Bootstrap to close a container: through its instance, or, for a\n * page with no window.bootstrap - an app that imports it - through its\n * own close button, which its data api still listens for.\n */\n function closer(target) {\n var Component = component();\n var instance = Component ? Component.getInstance(target) : null;\n if (instance) { return function() { instance.hide(); }; }\n\n var dismiss = dom.one(target, '[data-bs-dismiss=\"' + toggle + '\"], [data-ge-bs-dismiss=\"' + toggle + '\"]');\n if (!dismiss) { return null; }\n\n return function() {\n ge.resumeToggles(dismiss);\n dismiss.click();\n ge.suspendToggles(dismiss);\n };\n }\n\n /**\n * The preview let go: an open container is closed, by Bootstrap so its\n * backdrop and the page's scroll go back too, and each is left as the\n * preview found it once Bootstrap is done with it. One still opening is\n * closed when it has opened, as Bootstrap will not close it before.\n */\n function endPreview() {\n if (watching) { watching.abort(); }\n watching = null;\n\n before.forEach(function(state, target) {\n var phase = phases.get(target);\n var close = phase && phase !== 'closing' ? closer(target) : null;\n var restore = function() {\n pending.delete(target);\n putState(target, state);\n };\n\n if (!phase || (phase !== 'closing' && !close)) {\n restore();\n return;\n }\n\n pending.set(target, state);\n target.addEventListener('hidden.bs.' + toggle, restore, { once: true });\n if (phase === 'opening') {\n target.addEventListener('shown.bs.' + toggle, close, { once: true });\n } else if (phase === 'open') {\n close();\n }\n });\n before = new Map();\n phases = new Map();\n\n dismisses.forEach(function(dismiss) { ge.suspendToggles(dismiss); });\n dismisses = [];\n disarm();\n }\n\n return {\n write: write,\n\n // Triggers are markup the host owns, anywhere in the canvas, so they\n // are looked at whenever the canvas is initialized rather than only\n // when a container is touched\n onInit: function() {\n wire();\n\n if (listening) { listening.abort(); }\n listening = new AbortController();\n\n // A trigger is often a link, and a link still navigates even\n // with its Bootstrap attributes suspended\n dom.delegate(ge.canvas, 'click', '.' + triggerClass + ', [' + targetAttribute + ']', function(e) {\n if (dom.hasClass(ge.canvas, 'ge-editing')) { e.preventDefault(); }\n }, { signal: listening.signal });\n\n // A getHtml in the middle of a preview: back to what it was\n if (ge.previewing()) {\n var live = new Map(saved);\n saved = new Map();\n startPreview();\n live.forEach(function(state, target) {\n if (ge.canvas.contains(target)) { putState(target, state); }\n });\n }\n },\n\n onDeinit: function() {\n if (listening) { listening.abort(); }\n listening = null;\n\n // In the middle of a preview, write reads the markup as the\n // preview found it, not with a container open: onInit puts it back\n if (ge.previewing()) {\n before.forEach(function(state, target) { saved.set(target, stateOf(target)); });\n }\n\n write();\n },\n\n onPreviewChange: function(previewing) {\n if (previewing) {\n startPreview();\n } else {\n endPreview();\n }\n },\n };\n}\n", "/**\n * Popups for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a popup: a bootstrap modal and its trigger. 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.popup.min.js\"></script>\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\nimport { triggersFor } from '../triggers/triggers.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_popup': 'Popup',\n 'container.popup_title': 'Title',\n 'container.popup_trigger': 'Open',\n 'tool.toggle_popup': 'Fold this popup away while editing',\n});\n\nGridEditor.containers.popup = function(ge) {\n\n var triggers = triggersFor(ge, 'popup', 'data-ge-popup-id', 'data-ge-popup-target', 'modal');\n\n return {\n labelKey: 'container.add_popup',\n paneKind: 'popup',\n\n // Where rows go: the popup's body\n regionOf: function(container) {\n return dom.one(container, '.modal-body');\n },\n\n // The ids a copy of a popup has to rename together\n references: ['data-ge-popup-id', 'data-ge-popup-target'],\n\n onInit: triggers.onInit,\n onDeinit: triggers.onDeinit,\n // The preview pressed, the triggers open the real thing; let go, it closes\n onPreviewChange: triggers.onPreviewChange,\n\n // What onDeinit and unmark do, on a copy of the canvas\n cleanMarkup: function(root) {\n var definition = this;\n triggers.write(root);\n dom.all(root, '[data-ge-container=\"popup\"]').forEach(function(container) { definition.unmark(container); });\n },\n\n create: function(options) {\n var id = ge.containerId('popup');\n var container = dom.element('div', { 'data-ge-container': 'popup', 'data-ge-popup-id': id });\n\n if (options.trigger !== false) {\n container.appendChild(dom.element('button', {\n type: 'button',\n 'class': 'btn btn-primary ge-popup-trigger',\n 'data-ge-popup-target': id,\n }, options.trigger_label || ge.t('container.popup_trigger')));\n }\n\n var modal = container.appendChild(dom.element('div', {\n 'class': 'modal fade',\n tabindex: '-1',\n 'aria-hidden': 'true',\n id: id,\n }));\n var dialog = modal.appendChild(dom.element('div', { 'class': 'modal-dialog' }));\n if (options.size) { dom.addClass(dialog, 'modal-' + options.size); }\n\n var content = dialog.appendChild(dom.element('div', { 'class': 'modal-content' }));\n var header = content.appendChild(dom.element('div', { 'class': 'modal-header' }));\n header.appendChild(dom.element('h5', { 'class': 'modal-title' }))\n .appendChild(dom.element('span', { 'class': 'ge-pane-label' },\n options.title || ge.t('container.popup_title')));\n header.appendChild(dom.create('<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>'));\n content.appendChild(dom.element('div', { 'class': 'modal-body' })).appendChild(ge.defaultRegion());\n\n return container;\n },\n\n mark: function(container) {\n // Nothing in a popup may reach Bootstrap while editing:\n // the modal is rendered unfolded and static, and a real\n // modal opening over it would be the editor fighting\n // itself\n dom.all(container, '[data-bs-dismiss]').forEach(function(dismiss) {\n ge.suspendToggles(dismiss);\n });\n dom.all(container, '.modal-title').forEach(function(title) {\n ge.makeLabelEditable(ge.labelIn(title));\n });\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n dom.removeClass(container, 'ge-popup-collapsed');\n ge.unwrapLabels(container);\n },\n\n /** A page of unfolded modals stays workable if they can be folded away. */\n tools: function(drawer, container) {\n ge.createTool(drawer, ge.t('tool.toggle_popup'), 'ge-toggle-popup', 'bi bi-chevron-bar-contract',\n function() {\n dom.toggleClass(container, 'ge-popup-collapsed');\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,CA0BO,SAASE,EAAQC,EAAMC,EAAUC,EAAQ,CAC5C,IAAIC,EAAQH,GAAQA,EAAK,WAAa,EAAIA,EAAK,QAAQC,CAAQ,EAAI,KAEnE,OAAIE,GAASD,GAAUC,IAAUD,GAAU,CAACA,EAAO,SAASC,CAAK,EAAY,KACtEA,CACX,CAoCO,SAASC,EAAMC,EAAM,CACxB,IAAIC,EAAW,SAAS,cAAc,UAAU,EAChD,OAAAA,EAAS,UAAYD,EACd,MAAM,UAAU,MAAM,KAAKC,EAAS,QAAQ,UAAU,CACjE,CAGO,SAASC,EAAOF,EAAM,CAGzB,QAFIG,EAAQJ,EAAMC,EAAK,KAAK,CAAC,EAEpBI,EAAI,EAAGA,EAAID,EAAM,OAAQC,IAC9B,GAAID,EAAMC,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"element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "toggleClass", "state", "hasClass", "dropEmptyClass", "delegate", "root", "types", "selector", "handler", "options", "listener", "event", "match", "closest", "split", "type", "triggersFor", "ge", "kind", "idAttribute", "targetAttribute", "toggle", "triggerClass", "orphanClass", "listening", "STATE_ATTRIBUTES", "STATE_CLASSES", "before", "dismisses", "saved", "phases", "watching", "pending", "PHASES", "idOf", "container", "targetOf", "id", "all", "node", "targets", "exists", "root", "wire", "trigger", "addClass", "wanted", "removeClass", "column", "nearby", "arm", "disarm", "write", "dropEmptyClass", "quiet", "state", "target", "putState", "stateOf", "name", "hasClass", "toggleClass", "startPreview", "dismiss", "e", "component", "bootstrap", "closer", "Component", "instance", "one", "endPreview", "phase", "close", "restore", "delegate", "live", "previewing", "GridEditor", "ge", "triggers", "triggersFor", "container", "one", "root", "definition", "all", "options", "id", "element", "modal", "dialog", "addClass", "content", "header", "create", "dismiss", "title", "removeClass", "drawer", "toggleClass"]
7
7
  }
@@ -47,6 +47,12 @@ function hasClass(node, name) {
47
47
  function split(names) {
48
48
  return String(names || "").split(/\s+/).filter(Boolean);
49
49
  }
50
+ function dropEmptyClass(node) {
51
+ if (!node.getAttribute("class")) {
52
+ node.removeAttribute("class");
53
+ }
54
+ return node;
55
+ }
50
56
  function hide(node) {
51
57
  node.style.display = "none";
52
58
  return node;
@@ -57,7 +63,10 @@ function visible(node) {
57
63
  var DEFAULT_DURATION = 400;
58
64
  function animateAway(node, frames, duration, done) {
59
65
  duration = duration === void 0 ? DEFAULT_DURATION : duration;
66
+ addClass(node, "ge-leaving");
60
67
  var finish = function() {
68
+ removeClass(node, "ge-leaving");
69
+ dropEmptyClass(node);
61
70
  hide(node);
62
71
  if (done) {
63
72
  done();
@@ -51,6 +51,12 @@
51
51
  function split(names) {
52
52
  return String(names || "").split(/\s+/).filter(Boolean);
53
53
  }
54
+ function dropEmptyClass(node) {
55
+ if (!node.getAttribute("class")) {
56
+ node.removeAttribute("class");
57
+ }
58
+ return node;
59
+ }
54
60
  function hide(node) {
55
61
  node.style.display = "none";
56
62
  return node;
@@ -61,7 +67,10 @@
61
67
  var DEFAULT_DURATION = 400;
62
68
  function animateAway(node, frames, duration, done) {
63
69
  duration = duration === void 0 ? DEFAULT_DURATION : duration;
70
+ addClass(node, "ge-leaving");
64
71
  var finish = function() {
72
+ removeClass(node, "ge-leaving");
73
+ dropEmptyClass(node);
65
74
  hide(node);
66
75
  if (done) {
67
76
  done();
@@ -1 +1 @@
1
- (()=>{var h=window.GridEditor;if(!h||typeof h.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function C(t,r){return t?t.querySelector(r):null}function g(t,r){return t?Array.prototype.filter.call(t.children,function(i){return!r||i.matches(r)}):[]}function T(t,r){return g(t,r)[0]||null}function c(t,r,i){var o=document.createElement(t);return Object.keys(r||{}).forEach(function(u){var l=r[u];l!=null&&l!==!1&&o.setAttribute(u,l)}),i!=null&&(o.textContent=i),o}function y(t,r){return S(r).forEach(function(i){t.classList.add(i)}),t}function w(t,r){return S(r).forEach(function(i){t.classList.remove(i)}),t}function m(t,r){return!!t&&t.nodeType===1&&t.classList.contains(r)}function S(t){return String(t||"").split(/\s+/).filter(Boolean)}function _(t){return t.style.display="none",t}function j(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}var F=400;function D(t,r,i,o){i=i===void 0?F:i;var u=function(){_(t),o&&o()};if(!j(t)||!t.animate||i<=0){window.setTimeout(u,0);return}var l=t.animate(r(getComputedStyle(t)),{duration:i,easing:"ease-in-out"}),v=!1,x=function(){v||(v=!0,u())};l.onfinish=x,l.oncancel=x}function A(t,r,i){typeof r=="function"&&(i=r,r=void 0),t.style.overflow="hidden",D(t,function(o){return[{height:o.height,paddingTop:o.paddingTop,paddingBottom:o.paddingBottom,marginTop:o.marginTop,marginBottom:o.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},r,function(){t.style.removeProperty("overflow"),i&&i()})}Object.assign(h.locales.en,{"section.add":"Section","section.width":"Width","section.fixed":"Fixed","section.fluid":"Full width","section.from":"Fixed from {breakpoint}","tool.add_row_to_section":"Add row","tool.delete_section":"Remove section","confirm.delete_section":"Delete this section and everything in it?"});var f={fixed:"container",fluid:"container-fluid",sm:"container-sm",md:"container-md",lg:"container-lg",xl:"container-xl",xxl:"container-xxl"},O=["fixed","sm","md","lg","xl","xxl","fluid"];h.features.sections=function(t){var r=Object.assign({widths:O},t.settings.sections);function i(e){var n=null;return Object.keys(f).forEach(function(a){!n&&m(e,f[a])&&(n=a)}),n}function o(e){return e.parentElement===t.canvas&&i(e)!==null}function u(){return g(t.canvas).filter(o)}function l(e){return e==="fixed"?t.t("section.fixed"):e==="fluid"?t.t("section.fluid"):t.t("section.from",{breakpoint:e})}function v(e,n,a){var s=i(e);return s===n||!f[n]?!1:t.operate(function(){var d=t.payloadFor("section",e,{family:"section",breakpoint:"all",tiers:[],from:s,to:n,source:a||"api"});if(!t.emit("before-utility",d)){var p=C(t.detailsOf(e),".ge-section-width select");return p&&(p.value=s),!1}return w(e,f[s]),y(e,f[n]),t.emit("after-utility",d),!0})}function x(e){var n=c("select",{class:"form-select form-select-sm"}),a=i(e),s=r.widths.indexOf(a)===-1?r.widths.concat([a]):r.widths;O.forEach(function(p){s.indexOf(p)!==-1&&n.appendChild(c("option",{value:p},l(p)))}),n.value=a,n.addEventListener("change",function(){v(e,this.value,"panel")});var d=c("label",{class:"ge-utility ge-section-width"});return d.appendChild(c("span",{class:"ge-utility-label"},t.t("section.width"))),d.appendChild(n),d}function k(e){var n=c("div",{class:"ge-tools-drawer ge-section-drawer"});e.insertBefore(n,e.firstChild),t.createMoveTool(n),t.addSettingsTool(n,e,t.settings.section_classes||[]).appendChild(x(e)),t.createTool(n,t.t("tool.delete_section"),"ge-delete-section","bi bi-trash",function(){t.deleteNode("section",e,t.t("confirm.delete_section"),function(a){A(e,a)})}),t.createTool(n,t.t("tool.add_row_to_section"),"ge-add-row","bi bi-plus-circle",function(){t.place(t.rowFromLayout([12]),"row",{appendTo:e})})}function B(){u().forEach(function(e){y(e,"ge-section"),T(e,".ge-tools-drawer")||k(e)})}function E(e){g(e||t.canvas,".ge-section").forEach(function(n){w(n,"ge-section")})}function b(e){e=e||{};var n=c("div",{class:f[e.width]||f.fixed});return(e.rows||[[12]]).forEach(function(a){n.appendChild(t.rowFromLayout(a))}),t.place(n,"section",e)}return{methods:{createSection:b},kindOf:function(e){return m(e,"ge-section")?"section":null},blocks:".ge-section",regions:".ge-section",accepts:function(e,n){return m(n,"ge-section")||L(n)?e===t.canvas:m(e,"ge-section")?m(n,"row"):!0},toolbar:[{labelKey:"section.add",kind:"section",group:"content",create:function(){return b()}}],onInit:B,onDeinit:function(){E()},cleanMarkup:E};function L(e){return!e.parentElement&&i(e)!==null}};})();
1
+ (()=>{var h=window.GridEditor;if(!h||typeof h.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function C(t,r){return t?t.querySelector(r):null}function g(t,r){return t?Array.prototype.filter.call(t.children,function(i){return!r||i.matches(r)}):[]}function T(t,r){return g(t,r)[0]||null}function c(t,r,i){var o=document.createElement(t);return Object.keys(r||{}).forEach(function(u){var l=r[u];l!=null&&l!==!1&&o.setAttribute(u,l)}),i!=null&&(o.textContent=i),o}function y(t,r){return S(r).forEach(function(i){t.classList.add(i)}),t}function w(t,r){return S(r).forEach(function(i){t.classList.remove(i)}),t}function m(t,r){return!!t&&t.nodeType===1&&t.classList.contains(r)}function S(t){return String(t||"").split(/\s+/).filter(Boolean)}function _(t){return t.getAttribute("class")||t.removeAttribute("class"),t}function j(t){return t.style.display="none",t}function F(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}var D=400;function H(t,r,i,o){i=i===void 0?D:i,y(t,"ge-leaving");var u=function(){w(t,"ge-leaving"),_(t),j(t),o&&o()};if(!F(t)||!t.animate||i<=0){window.setTimeout(u,0);return}var l=t.animate(r(getComputedStyle(t)),{duration:i,easing:"ease-in-out"}),v=!1,x=function(){v||(v=!0,u())};l.onfinish=x,l.oncancel=x}function A(t,r,i){typeof r=="function"&&(i=r,r=void 0),t.style.overflow="hidden",H(t,function(o){return[{height:o.height,paddingTop:o.paddingTop,paddingBottom:o.paddingBottom,marginTop:o.marginTop,marginBottom:o.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},r,function(){t.style.removeProperty("overflow"),i&&i()})}Object.assign(h.locales.en,{"section.add":"Section","section.width":"Width","section.fixed":"Fixed","section.fluid":"Full width","section.from":"Fixed from {breakpoint}","tool.add_row_to_section":"Add row","tool.delete_section":"Remove section","confirm.delete_section":"Delete this section and everything in it?"});var f={fixed:"container",fluid:"container-fluid",sm:"container-sm",md:"container-md",lg:"container-lg",xl:"container-xl",xxl:"container-xxl"},O=["fixed","sm","md","lg","xl","xxl","fluid"];h.features.sections=function(t){var r=Object.assign({widths:O},t.settings.sections);function i(e){var n=null;return Object.keys(f).forEach(function(a){!n&&m(e,f[a])&&(n=a)}),n}function o(e){return e.parentElement===t.canvas&&i(e)!==null}function u(){return g(t.canvas).filter(o)}function l(e){return e==="fixed"?t.t("section.fixed"):e==="fluid"?t.t("section.fluid"):t.t("section.from",{breakpoint:e})}function v(e,n,a){var s=i(e);return s===n||!f[n]?!1:t.operate(function(){var d=t.payloadFor("section",e,{family:"section",breakpoint:"all",tiers:[],from:s,to:n,source:a||"api"});if(!t.emit("before-utility",d)){var p=C(t.detailsOf(e),".ge-section-width select");return p&&(p.value=s),!1}return w(e,f[s]),y(e,f[n]),t.emit("after-utility",d),!0})}function x(e){var n=c("select",{class:"form-select form-select-sm"}),a=i(e),s=r.widths.indexOf(a)===-1?r.widths.concat([a]):r.widths;O.forEach(function(p){s.indexOf(p)!==-1&&n.appendChild(c("option",{value:p},l(p)))}),n.value=a,n.addEventListener("change",function(){v(e,this.value,"panel")});var d=c("label",{class:"ge-utility ge-section-width"});return d.appendChild(c("span",{class:"ge-utility-label"},t.t("section.width"))),d.appendChild(n),d}function k(e){var n=c("div",{class:"ge-tools-drawer ge-section-drawer"});e.insertBefore(n,e.firstChild),t.createMoveTool(n),t.addSettingsTool(n,e,t.settings.section_classes||[]).appendChild(x(e)),t.createTool(n,t.t("tool.delete_section"),"ge-delete-section","bi bi-trash",function(){t.deleteNode("section",e,t.t("confirm.delete_section"),function(a){A(e,a)})}),t.createTool(n,t.t("tool.add_row_to_section"),"ge-add-row","bi bi-plus-circle",function(){t.place(t.rowFromLayout([12]),"row",{appendTo:e})})}function B(){u().forEach(function(e){y(e,"ge-section"),T(e,".ge-tools-drawer")||k(e)})}function E(e){g(e||t.canvas,".ge-section").forEach(function(n){w(n,"ge-section")})}function b(e){e=e||{};var n=c("div",{class:f[e.width]||f.fixed});return(e.rows||[[12]]).forEach(function(a){n.appendChild(t.rowFromLayout(a))}),t.place(n,"section",e)}return{methods:{createSection:b},kindOf:function(e){return m(e,"ge-section")?"section":null},blocks:".ge-section",regions:".ge-section",accepts:function(e,n){return m(n,"ge-section")||L(n)?e===t.canvas:m(e,"ge-section")?m(n,"row"):!0},toolbar:[{labelKey:"section.add",kind:"section",group:"content",create:function(){return b()}}],onInit:B,onDeinit:function(){E()},cleanMarkup:E};function L(e){return!e.parentElement&&i(e)!==null}};})();
@@ -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.sections.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 * Sections for grid-editor.\n *\n * A feature plugin: load this file after the editor and the canvas can hold\n * sections - Bootstrap's .container, .container-fluid and .container-{bp} -\n * each grouping rows at a width of its own. What it can ask the editor for is\n * the handle its factory is called with, described in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.sections.min.js\"></script>\n *\n * Called sections, not containers, because a container is what the tabs,\n * accordion, popup and card plugins make. A section is recognised by its\n * Bootstrap class alone, and only as a child of the canvas: a .container\n * somewhere inside an element's markup is that element's business.\n *\n * sections.widths narrows the widths the field offers.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'section.add': 'Section',\n 'section.width': 'Width',\n 'section.fixed': 'Fixed',\n 'section.fluid': 'Full width',\n 'section.from': 'Fixed from {breakpoint}',\n 'tool.add_row_to_section': 'Add row',\n 'tool.delete_section': 'Remove section',\n 'confirm.delete_section': 'Delete this section and everything in it?',\n});\n\n/** Each width, and the class that gives it. */\nvar WIDTHS = {\n fixed: 'container',\n fluid: 'container-fluid',\n sm: 'container-sm',\n md: 'container-md',\n lg: 'container-lg',\n xl: 'container-xl',\n xxl: 'container-xxl',\n};\n\nvar ORDER = ['fixed', 'sm', 'md', 'lg', 'xl', 'xxl', 'fluid'];\n\nGridEditor.features.sections = function(ge) {\n\n var options = Object.assign({ widths: ORDER }, ge.settings.sections);\n\n function widthOf(section) {\n var found = null;\n\n Object.keys(WIDTHS).forEach(function(width) {\n if (!found && dom.hasClass(section, WIDTHS[width])) { found = width; }\n });\n\n return found;\n }\n\n function isSection(node) {\n return node.parentElement === ge.canvas && widthOf(node) !== null;\n }\n\n function sections() {\n return dom.children(ge.canvas).filter(isSection);\n }\n\n function label(width) {\n if (width === 'fixed') { return ge.t('section.fixed'); }\n if (width === 'fluid') { return ge.t('section.fluid'); }\n\n return ge.t('section.from', { breakpoint: width });\n }\n\n /**\n * Change a section's width, announced like a utility: the width is its\n * one container class, the same at every breakpoint.\n */\n function setWidth(section, width, source) {\n var from = widthOf(section);\n if (from === width || !WIDTHS[width]) { return false; }\n\n return ge.operate(function() {\n var payload = ge.payloadFor('section', section, {\n family: 'section',\n breakpoint: 'all',\n tiers: [],\n from: from,\n to: width,\n source: source || 'api',\n });\n\n if (!ge.emit('before-utility', payload)) {\n var select = dom.one(ge.detailsOf(section), '.ge-section-width select');\n if (select) { select.value = from; }\n return false;\n }\n\n dom.removeClass(section, WIDTHS[from]);\n dom.addClass(section, WIDTHS[width]);\n ge.emit('after-utility', payload);\n\n return true;\n });\n }\n\n function widthField(section) {\n var select = dom.element('select', { 'class': 'form-select form-select-sm' });\n var current = widthOf(section);\n var offered = options.widths.indexOf(current) === -1 ? options.widths.concat([current]) : options.widths;\n\n ORDER.forEach(function(width) {\n if (offered.indexOf(width) === -1) { return; }\n select.appendChild(dom.element('option', { value: width }, label(width)));\n });\n\n select.value = current;\n select.addEventListener('change', function() { setWidth(section, this.value, 'panel'); });\n\n var field = dom.element('label', { 'class': 'ge-utility ge-section-width' });\n field.appendChild(dom.element('span', { 'class': 'ge-utility-label' }, ge.t('section.width')));\n field.appendChild(select);\n\n return field;\n }\n\n function createControls(section) {\n var drawer = dom.element('div', { 'class': 'ge-tools-drawer ge-section-drawer' });\n section.insertBefore(drawer, section.firstChild);\n\n ge.createMoveTool(drawer);\n ge.addSettingsTool(drawer, section, ge.settings.section_classes || []).appendChild(widthField(section));\n\n ge.createTool(drawer, ge.t('tool.delete_section'), 'ge-delete-section', 'bi bi-trash', function() {\n ge.deleteNode('section', section, ge.t('confirm.delete_section'), function(removed) {\n dom.slideUp(section, removed);\n });\n });\n\n ge.createTool(drawer, ge.t('tool.add_row_to_section'), 'ge-add-row', 'bi bi-plus-circle', function() {\n ge.place(ge.rowFromLayout([12]), 'row', { appendTo: section });\n });\n }\n\n function mark() {\n sections().forEach(function(section) {\n dom.addClass(section, 'ge-section');\n if (!dom.child(section, '.ge-tools-drawer')) { createControls(section); }\n });\n }\n\n function unmark(root) {\n dom.children(root || ge.canvas, '.ge-section').forEach(function(section) {\n dom.removeClass(section, 'ge-section');\n });\n }\n\n /** createSection(options): a section, detached unless a placement is given. */\n function createSection(settings) {\n settings = settings || {};\n\n var section = dom.element('div', { 'class': WIDTHS[settings.width] || WIDTHS.fixed });\n\n (settings.rows || [[12]]).forEach(function(layout) {\n section.appendChild(ge.rowFromLayout(layout));\n });\n\n return ge.place(section, 'section', settings);\n }\n\n return {\n methods: {\n createSection: createSection,\n },\n\n kindOf: function(node) {\n return dom.hasClass(node, 'ge-section') ? 'section' : null;\n },\n\n // A section is a block the canvas moves, and a region rows move in\n blocks: '.ge-section',\n regions: '.ge-section',\n\n /** A section goes on the canvas and nowhere else, and holds rows and nothing else. */\n accepts: function(region, node) {\n if (dom.hasClass(node, 'ge-section') || isSectionMade(node)) { return region === ge.canvas; }\n if (dom.hasClass(region, 'ge-section')) { return dom.hasClass(node, 'row'); }\n\n return true;\n },\n\n toolbar: [{\n labelKey: 'section.add',\n kind: 'section',\n group: 'content',\n create: function() { return createSection(); },\n }],\n\n onInit: mark,\n onDeinit: function() { unmark(); },\n cleanMarkup: unmark,\n };\n\n /** A section the toolbar just made, before init has marked it. */\n function isSectionMade(node) {\n return !node.parentElement && widthOf(node) !== null;\n }\n};\n"],
5
- "mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECMvC,SAASC,EAAIC,EAAMC,EAAU,CAChC,OAAOD,EAAOA,EAAK,cAAcC,CAAQ,EAAI,IACjD,CAYO,SAASC,EAASC,EAAMC,EAAU,CACrC,OAAKD,EAEE,MAAM,UAAU,OAAO,KAAKA,EAAK,SAAU,SAASE,EAAM,CAC7D,MAAO,CAACD,GAAYC,EAAK,QAAQD,CAAQ,CAC7C,CAAC,EAJmB,CAAC,CAKzB,CAGO,SAASE,EAAMH,EAAMC,EAAU,CAClC,OAAOF,EAASC,EAAMC,CAAQ,EAAE,CAAC,GAAK,IAC1C,CA6DO,SAASG,EAAQC,E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EAAM3B,EAAS,kBAAkB,GAAKsB,EAAetB,CAAO,CACzE,CAAC,CACL,CAEA,SAAS4B,EAAOC,EAAM,CACdtB,EAASsB,GAAQhC,EAAG,OAAQ,aAAa,EAAE,QAAQ,SAASG,EAAS,CACjEe,EAAYf,EAAS,YAAY,CACzC,CAAC,CACL,CAGA,SAAS8B,EAAcC,EAAU,CAC7BA,EAAWA,GAAY,CAAC,EAExB,IAAI/B,EAAckB,EAAQ,MAAO,CAAE,MAASvB,EAAOoC,EAAS,KAAK,GAAKpC,EAAO,KAAM,CAAC,EAEpF,OAACoC,EAAS,MAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,SAASC,EAAQ,CAC/ChC,EAAQ,YAAYH,EAAG,cAAcmC,CAAM,CAAC,CAChD,CAAC,EAEMnC,EAAG,MAAMG,EAAS,UAAW+B,CAAQ,CAChD,CAEA,MAAO,CACH,QAAS,CACL,cAAeD,CACnB,EAEA,OAAQ,SAASzB,EAAM,CACnB,OAAWF,EAASE,EAAM,YAAY,EAAI,UAAY,IAC1D,EAGA,OAAQ,cACR,QAAS,cAGT,QAAS,SAAS4B,EAAQ5B,EAAM,CAC5B,OAAQF,EAASE,EAAM,YAAY,GAAK6B,EAAc7B,CAAI,EAAY4B,IAAWpC,EAAG,OAC5EM,EAAS8B,EAAQ,YAAY,EAAgB9B,EAASE,EAAM,KAAK,EAElE,EACX,EAEA,QAAS,CAAC,CACN,SAAU,cACV,KAAM,UACN,MAAO,UACP,OAAQ,UAAW,CAAE,OAAOyB,EAAc,CAAG,CACjD,CAAC,EAED,OAAQJ,EACR,SAAU,UAAW,CAAEE,EAAO,CAAG,EACjC,YAAaA,CACjB,EAGA,SAASM,EAAc7B,EAAM,CACzB,MAAO,CAACA,EAAK,eAAiBN,EAAQM,CAAI,IAAM,IACpD,CACJ",
6
- "names": ["GridEditor", "one", "root", "selector", "children", "node", "selector", "each", "child", "element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "hasClass", "node", "name", "split", "names", "hide", "node", "visible", "node", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "slideUp", "style", "GridEditor", "WIDTHS", "ORDER", "ge", "options", "widthOf", "section", "found", "width", "hasClass", "isSection", "node", "sections", "children", "label", "setWidth", "source", "from", "payload", "select", "one", "removeClass", "addClass", "widthField", "element", "current", "offered", "field", "createControls", "drawer", "removed", "slideUp", "mark", "child", "unmark", "root", "createSection", "settings", "layout", "region", "isSectionMade"]
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 // Marked while it goes: the history plugin waits for it, rather than\n // keep the canvas halfway through as a step of its own\n addClass(node, 'ge-leaving');\n\n var finish = function() {\n removeClass(node, 'ge-leaving');\n dropEmptyClass(node);\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 * Sections for grid-editor.\n *\n * A feature plugin: load this file after the editor and the canvas can hold\n * sections - Bootstrap's .container, .container-fluid and .container-{bp} -\n * each grouping rows at a width of its own. What it can ask the editor for is\n * the handle its factory is called with, described in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.sections.min.js\"></script>\n *\n * Called sections, not containers, because a container is what the tabs,\n * accordion, popup and card plugins make. A section is recognised by its\n * Bootstrap class alone, and only as a child of the canvas: a .container\n * somewhere inside an element's markup is that element's business.\n *\n * sections.widths narrows the widths the field offers.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'section.add': 'Section',\n 'section.width': 'Width',\n 'section.fixed': 'Fixed',\n 'section.fluid': 'Full width',\n 'section.from': 'Fixed from {breakpoint}',\n 'tool.add_row_to_section': 'Add row',\n 'tool.delete_section': 'Remove section',\n 'confirm.delete_section': 'Delete this section and everything in it?',\n});\n\n/** Each width, and the class that gives it. */\nvar WIDTHS = {\n fixed: 'container',\n fluid: 'container-fluid',\n sm: 'container-sm',\n md: 'container-md',\n lg: 'container-lg',\n xl: 'container-xl',\n xxl: 'container-xxl',\n};\n\nvar ORDER = ['fixed', 'sm', 'md', 'lg', 'xl', 'xxl', 'fluid'];\n\nGridEditor.features.sections = function(ge) {\n\n var options = Object.assign({ widths: ORDER }, ge.settings.sections);\n\n function widthOf(section) {\n var found = null;\n\n Object.keys(WIDTHS).forEach(function(width) {\n if (!found && dom.hasClass(section, WIDTHS[width])) { found = width; }\n });\n\n return found;\n }\n\n function isSection(node) {\n return node.parentElement === ge.canvas && widthOf(node) !== null;\n }\n\n function sections() {\n return dom.children(ge.canvas).filter(isSection);\n }\n\n function label(width) {\n if (width === 'fixed') { return ge.t('section.fixed'); }\n if (width === 'fluid') { return ge.t('section.fluid'); }\n\n return ge.t('section.from', { breakpoint: width });\n }\n\n /**\n * Change a section's width, announced like a utility: the width is its\n * one container class, the same at every breakpoint.\n */\n function setWidth(section, width, source) {\n var from = widthOf(section);\n if (from === width || !WIDTHS[width]) { return false; }\n\n return ge.operate(function() {\n var payload = ge.payloadFor('section', section, {\n family: 'section',\n breakpoint: 'all',\n tiers: [],\n from: from,\n to: width,\n source: source || 'api',\n });\n\n if (!ge.emit('before-utility', payload)) {\n var select = dom.one(ge.detailsOf(section), '.ge-section-width select');\n if (select) { select.value = from; }\n return false;\n }\n\n dom.removeClass(section, WIDTHS[from]);\n dom.addClass(section, WIDTHS[width]);\n ge.emit('after-utility', payload);\n\n return true;\n });\n }\n\n function widthField(section) {\n var select = dom.element('select', { 'class': 'form-select form-select-sm' });\n var current = widthOf(section);\n var offered = options.widths.indexOf(current) === -1 ? options.widths.concat([current]) : options.widths;\n\n ORDER.forEach(function(width) {\n if (offered.indexOf(width) === -1) { return; }\n select.appendChild(dom.element('option', { value: width }, label(width)));\n });\n\n select.value = current;\n select.addEventListener('change', function() { setWidth(section, this.value, 'panel'); });\n\n var field = dom.element('label', { 'class': 'ge-utility ge-section-width' });\n field.appendChild(dom.element('span', { 'class': 'ge-utility-label' }, ge.t('section.width')));\n field.appendChild(select);\n\n return field;\n }\n\n function createControls(section) {\n var drawer = dom.element('div', { 'class': 'ge-tools-drawer ge-section-drawer' });\n section.insertBefore(drawer, section.firstChild);\n\n ge.createMoveTool(drawer);\n ge.addSettingsTool(drawer, section, ge.settings.section_classes || []).appendChild(widthField(section));\n\n ge.createTool(drawer, ge.t('tool.delete_section'), 'ge-delete-section', 'bi bi-trash', function() {\n ge.deleteNode('section', section, ge.t('confirm.delete_section'), function(removed) {\n dom.slideUp(section, removed);\n });\n });\n\n ge.createTool(drawer, ge.t('tool.add_row_to_section'), 'ge-add-row', 'bi bi-plus-circle', function() {\n ge.place(ge.rowFromLayout([12]), 'row', { appendTo: section });\n });\n }\n\n function mark() {\n sections().forEach(function(section) {\n dom.addClass(section, 'ge-section');\n if (!dom.child(section, '.ge-tools-drawer')) { createControls(section); }\n });\n }\n\n function unmark(root) {\n dom.children(root || ge.canvas, '.ge-section').forEach(function(section) {\n dom.removeClass(section, 'ge-section');\n });\n }\n\n /** createSection(options): a section, detached unless a placement is given. */\n function createSection(settings) {\n settings = settings || {};\n\n var section = dom.element('div', { 'class': WIDTHS[settings.width] || WIDTHS.fixed });\n\n (settings.rows || [[12]]).forEach(function(layout) {\n section.appendChild(ge.rowFromLayout(layout));\n });\n\n return ge.place(section, 'section', settings);\n }\n\n return {\n methods: {\n createSection: createSection,\n },\n\n kindOf: function(node) {\n return dom.hasClass(node, 'ge-section') ? 'section' : null;\n },\n\n // A section is a block the canvas moves, and a region rows move in\n blocks: '.ge-section',\n regions: '.ge-section',\n\n /** A section goes on the canvas and nowhere else, and holds rows and nothing else. */\n accepts: function(region, node) {\n if (dom.hasClass(node, 'ge-section') || isSectionMade(node)) { return region === ge.canvas; }\n if (dom.hasClass(region, 'ge-section')) { return dom.hasClass(node, 'row'); }\n\n return true;\n },\n\n toolbar: [{\n labelKey: 'section.add',\n kind: 'section',\n group: 'content',\n create: function() { return createSection(); },\n }],\n\n onInit: mark,\n onDeinit: function() { unmark(); },\n cleanMarkup: unmark,\n };\n\n /** A section the toolbar just made, before init has marked it. */\n function isSectionMade(node) {\n return !node.parentElement && widthOf(node) !== null;\n }\n};\n"],
5
+ "mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECMvC,SAASC,EAAIC,EAAMC,EAAU,CAChC,OAAOD,EAAOA,EAAK,cAAcC,CAAQ,EAAI,IACjD,CAYO,SAASC,EAASC,EAAMC,EAAU,CACrC,OAAKD,EAEE,MAAM,UAAU,OAAO,KAAKA,EAAK,SAAU,SAASE,EAAM,CAC7D,MAAO,CAACD,GAAYC,EAAK,QAAQD,CAAQ,CAC7C,CAAC,EAJmB,CAAC,CAKzB,CAGO,SAASE,EAAMH,EAAMC,EAAU,CAClC,OAAOF,EAASC,EAAMC,CAAQ,EAAE,CAAC,GAAK,IAC1C,CA6DO,SAASG,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,MAA+BA,IAAU,IAASF,EAAK,aAAaC,EAAMC,CAAK,CACjG,CAAC,EACyBH,GAAS,OAAQC,EAAK,YAAcD,GAEvDC,CACX,CASO,SAASG,EAASC,EAAMC,EAAO,CAClC,OAAAC,EAAMD,CAAK,EAAE,QAAQ,SAASE,EAAM,CAAEH,EAAK,UAAU,IAAIG,CAAI,CAAG,CAAC,EAC1DH,CACX,CAEO,SAASI,EAAYJ,EAAMC,EAAO,CACrC,OAAAC,EAAMD,CAAK,EAAE,QAAQ,SAASE,EAAM,CAAEH,EAAK,UAAU,OAAOG,CAAI,CAA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C,EAAS,MAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,SAASC,EAAQ,CAC/ChC,EAAQ,YAAYH,EAAG,cAAcmC,CAAM,CAAC,CAChD,CAAC,EAEMnC,EAAG,MAAMG,EAAS,UAAW+B,CAAQ,CAChD,CAEA,MAAO,CACH,QAAS,CACL,cAAeD,CACnB,EAEA,OAAQ,SAASzB,EAAM,CACnB,OAAWF,EAASE,EAAM,YAAY,EAAI,UAAY,IAC1D,EAGA,OAAQ,cACR,QAAS,cAGT,QAAS,SAAS4B,EAAQ5B,EAAM,CAC5B,OAAQF,EAASE,EAAM,YAAY,GAAK6B,EAAc7B,CAAI,EAAY4B,IAAWpC,EAAG,OAC5EM,EAAS8B,EAAQ,YAAY,EAAgB9B,EAASE,EAAM,KAAK,EAElE,EACX,EAEA,QAAS,CAAC,CACN,SAAU,cACV,KAAM,UACN,MAAO,UACP,OAAQ,UAAW,CAAE,OAAOyB,EAAc,CAAG,CACjD,CAAC,EAED,OAAQJ,EACR,SAAU,UAAW,CAAEE,EAAO,CAAG,EACjC,YAAaA,CACjB,EAGA,SAASM,EAAc7B,EAAM,CACzB,MAAO,CAACA,EAAK,eAAiBN,EAAQM,CAAI,IAAM,IACpD,CACJ",
6
+ "names": ["GridEditor", "one", "root", "selector", "children", "node", "selector", "each", "child", "element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "hasClass", "node", "name", "split", "names", "dropEmptyClass", "hide", "node", "visible", "node", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "addClass", "finish", "removeClass", "dropEmptyClass", "hide", "visible", "animation", "called", "once", "slideUp", "style", "GridEditor", "WIDTHS", "ORDER", "ge", "options", "widthOf", "section", "found", "width", "hasClass", "isSection", "node", "sections", "children", "label", "setWidth", "source", "from", "payload", "select", "one", "removeClass", "addClass", "widthField", "element", "current", "offered", "field", "createControls", "drawer", "removed", "slideUp", "mark", "child", "unmark", "root", "createSection", "settings", "layout", "region", "isSectionMade"]
7
7
  }
@@ -58,6 +58,12 @@ function hasClass(node, name) {
58
58
  function split(names) {
59
59
  return String(names || "").split(/\s+/).filter(Boolean);
60
60
  }
61
+ function dropEmptyClass(node) {
62
+ if (!node.getAttribute("class")) {
63
+ node.removeAttribute("class");
64
+ }
65
+ return node;
66
+ }
61
67
  function hide(node) {
62
68
  node.style.display = "none";
63
69
  return node;
@@ -81,7 +87,10 @@ function delegate(root, types, selector, handler, options) {
81
87
  var DEFAULT_DURATION = 400;
82
88
  function animateAway(node, frames, duration, done) {
83
89
  duration = duration === void 0 ? DEFAULT_DURATION : duration;
90
+ addClass(node, "ge-leaving");
84
91
  var finish = function() {
92
+ removeClass(node, "ge-leaving");
93
+ dropEmptyClass(node);
85
94
  hide(node);
86
95
  if (done) {
87
96
  done();
@@ -62,6 +62,12 @@
62
62
  function split(names) {
63
63
  return String(names || "").split(/\s+/).filter(Boolean);
64
64
  }
65
+ function dropEmptyClass(node) {
66
+ if (!node.getAttribute("class")) {
67
+ node.removeAttribute("class");
68
+ }
69
+ return node;
70
+ }
65
71
  function hide(node) {
66
72
  node.style.display = "none";
67
73
  return node;
@@ -85,7 +91,10 @@
85
91
  var DEFAULT_DURATION = 400;
86
92
  function animateAway(node, frames, duration, done) {
87
93
  duration = duration === void 0 ? DEFAULT_DURATION : duration;
94
+ addClass(node, "ge-leaving");
88
95
  var finish = function() {
96
+ removeClass(node, "ge-leaving");
97
+ dropEmptyClass(node);
89
98
  hide(node);
90
99
  if (done) {
91
100
  done();