@themarioga/grid-editor 8.7.0 → 8.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ (()=>{var _=window.GridEditor;if(!_||typeof _.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 z(n,i){return n?Array.prototype.slice.call(n.querySelectorAll(i)):[]}function x(n,i){return n?Array.prototype.filter.call(n.children,function(u){return!i||u.matches(i)}):[]}function f(n,i){return x(n,i)[0]||null}function c(n,i,u){var s=document.createElement(n);return Object.keys(i||{}).forEach(function(b){var m=i[b];m!=null&&m!==!1&&s.setAttribute(b,m)}),u!=null&&(s.textContent=u),s}function F(n,i){return j(i).forEach(function(u){n.classList.add(u)}),n}function y(n,i){return j(i).forEach(function(u){n.classList.remove(u)}),n}function C(n,i,u){return j(i).forEach(function(s){u===void 0?n.classList.toggle(s):n.classList.toggle(s,!!u)}),n}function K(n,i){return!!n&&n.nodeType===1&&n.classList.contains(i)}function j(n){return String(n||"").split(/\s+/).filter(Boolean)}function D(n){return n.getAttribute("class")||n.removeAttribute("class"),n}function he(n){return n.style.display="none",n}function be(n){return!!(n.offsetWidth||n.offsetHeight||n.getClientRects().length)}var ge=400;function xe(n,i,u,s){u=u===void 0?ge:u;var b=function(){he(n),s&&s()};if(!be(n)||!n.animate||u<=0){window.setTimeout(b,0);return}var m=n.animate(i(getComputedStyle(n)),{duration:u,easing:"ease-in-out"}),h=!1,E=function(){h||(h=!0,b())};m.onfinish=E,m.oncancel=E}function Y(n,i,u){xe(n,function(s){return[{opacity:s.opacity},{opacity:0}]},i,u)}Object.assign(_.locales.en,{"container.add_carousel":"Carousel","container.add_carousel_item":"Add slide","confirm.delete_carousel_item":"Delete this slide and everything in it?","panel.kind_carousel_item":"Slide","container.carousel_previous":"Previous","container.carousel_next":"Next","container.carousel_slide_label":"Slide {number}","container.carousel_counter":"{current} / {total}","tool.carousel_show_previous":"Previous slide","tool.carousel_show_next":"Next slide","tool.carousel_move_back":"Move back","tool.carousel_move_forward":"Move forward","container.carousel_section":"Carousel","container.carousel_controls":"Arrows","container.carousel_indicators":"Indicators","container.carousel_fade":"Fade","container.carousel_dark":"Dark theme","container.carousel_ride":"Autoplay","container.carousel_ride_no":"No","container.carousel_ride_load":"On load","container.carousel_ride_interaction":"After first interaction","container.carousel_interval":"Interval (s)","container.carousel_pause":"Pause on hover","container.carousel_wrap":"Wrap around","container.carousel_keyboard":"Keyboard","container.carousel_touch":"Touch swipe","container.carousel_item_section":"Slide"});var k={controls:!0,indicators:!0,fade:!1,dark:!1,ride:!1,interval:null,pause:!0,wrap:!0,keyboard:!0,touch:!0,slides:2},ye=["controls","indicators","fade","dark"],Q=["pause","wrap","keyboard","touch"],Ce={controls:{labelKey:"container.carousel_controls"},indicators:{labelKey:"container.carousel_indicators"},fade:{labelKey:"container.carousel_fade"},dark:{labelKey:"container.carousel_dark"},pause:{labelKey:"container.carousel_pause"},wrap:{labelKey:"container.carousel_wrap"},keyboard:{labelKey:"container.carousel_keyboard"},touch:{labelKey:"container.carousel_touch"}},Ee={labelKey:"container.carousel_ride"},Z={labelKey:"container.carousel_interval"},re=[!1,"carousel","true"],B=1e3,$="carousel-item-next carousel-item-prev carousel-item-start carousel-item-end";function ne(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n&&n>=B}var ee={ride:function(n){return re.indexOf(n)!==-1},interval:function(n){return n===null||ne(n)},slides:function(n){return typeof n=="number"&&Math.floor(n)===n&&n>=1}};function te(n){return n==="ride"?JSON.stringify(re):n==="interval"?"null or an integer of "+B+" or more":n==="slides"?"an integer of 1 or more":"[true,false]"}function we(n,i){return ee[n]?ee[n](i):typeof i=="boolean"}var Ae=0;_.containers.carousel=function(n){var i=new WeakMap,u=[];function s(t){return f(t,".carousel")}function b(t){return f(s(t),".carousel-inner")}function m(t){return!!b(t)}function h(t){return x(b(t),".carousel-item")}function E(t){return t.getAttribute("id")||t.setAttribute("id",n.containerId("carousel")),t.getAttribute("id")}function oe(t,e){var r=t.getAttribute("data-bs-"+e);return r===null?t.getAttribute("data-ge-bs-"+e):r}function H(t){var e=parseInt(t.getAttribute("data-bs-interval"),10);return isFinite(e)&&e>0?e:null}function S(t,e){e===null?t.removeAttribute("data-bs-interval"):t.setAttribute("data-bs-interval",String(e))}function ae(t){var e=s(t),r=oe(e,"ride"),o=function(a){return e.getAttribute("data-bs-"+a)!=="false"};return{controls:!!f(e,".carousel-control-prev, .carousel-control-next"),indicators:!!f(e,".carousel-indicators"),fade:K(e,"carousel-fade"),dark:e.getAttribute("data-bs-theme")==="dark",ride:r==="carousel"||r==="true"?r:!1,interval:H(e),pause:o("pause"),wrap:o("wrap"),keyboard:o("keyboard"),touch:o("touch")}}function P(t,e){var r=c("button",{class:"carousel-control-"+e,type:"button","data-bs-target":"#"+E(t),"data-bs-slide":e});return r.appendChild(c("span",{class:"carousel-control-"+e+"-icon","aria-hidden":"true"})),r.appendChild(c("span",{class:"visually-hidden"},e==="prev"?n.t("container.carousel_previous"):n.t("container.carousel_next"))),r}function ie(t,e){var r=s(t);x(r,".carousel-control-prev, .carousel-control-next").forEach(function(o){o.remove()}),e&&(r.appendChild(P(r,"prev")),r.appendChild(P(r,"next")))}function le(t,e){var r=s(t),o=f(r,".carousel-indicators");if(!e){o&&o.remove();return}o||(o=r.insertBefore(c("div",{class:"carousel-indicators"}),r.firstChild)),O(t)}function O(t,e){var r=s(t),o=f(r,".carousel-indicators");if(o){e=e||h(t);var a=E(r),l=0;e.forEach(function(d,p){K(d,"active")&&(l=p)}),o.textContent="",e.forEach(function(d,p){o.appendChild(c("button",{type:"button","data-bs-target":"#"+a,"data-bs-slide-to":String(p),"aria-label":n.t("container.carousel_slide_label",{number:p+1})}))}),L(t,e.length?l:-1)}}function L(t,e){var r=f(s(t),".carousel-indicators");x(r).forEach(function(o,a){C(o,"active",a===e),a===e?o.setAttribute("aria-current","true"):o.removeAttribute("aria-current")})}function U(t,e,r){var o=s(t);e==="controls"&&ie(t,r),e==="indicators"&&le(t,r),e==="fade"&&C(o,"carousel-fade",r),e==="dark"&&(r?o.setAttribute("data-bs-theme","dark"):o.getAttribute("data-bs-theme")==="dark"&&o.removeAttribute("data-bs-theme")),e==="ride"&&(o.removeAttribute("data-bs-ride"),o.removeAttribute("data-ge-bs-ride"),r&&o.setAttribute("data-bs-ride",r)),e==="interval"&&S(o,r),Q.indexOf(e)!==-1&&(r?o.removeAttribute("data-bs-"+e):o.setAttribute("data-bs-"+e,"false")),D(o)}function J(t,e){var r=n.settings.carousel||{},o=t[e]!==void 0?t[e]:r[e];return o===void 0?k[e]:we(e,o)?o:(n.warn("carousel: "+JSON.stringify(o)+" is not a "+e+", which takes "+te(e)+": "+JSON.stringify(k[e])+" is used"),k[e])}function N(t){var e=s(t);x(e,".carousel-control-prev, .carousel-control-next").forEach(n.suspendToggles),x(f(e,".carousel-indicators")).forEach(n.suspendToggles);var r=e.getAttribute("data-bs-ride");r!==null&&(e.setAttribute("data-ge-bs-ride",r),e.removeAttribute("data-bs-ride"))}function ue(t){var e=_.bootstrap||window.bootstrap,r=e&&e.Carousel?e.Carousel.getInstance(t):null;r&&(r.pause(),r.dispose())}function V(t,e,r){var o=b(t).appendChild(c("div",{class:e?"carousel-item active":"carousel-item"}));return o.appendChild(n.defaultRegion()),r!=null&&S(o,r),o}function w(t){var e=h(t),r=i.get(t);return r&&e.indexOf(r)!==-1?r:e.filter(function(o){return K(o,"active")})[0]||e[0]||null}function A(t,e,r){r=r||h(t),r.forEach(function(o){C(o,"active",o===e)}),e?i.set(t,e):i.delete(t),L(t,r.indexOf(e)),G(t)}function q(t,e){var r=h(t);if(!(r.length<2)){var o=r.indexOf(w(t));A(t,r[(o+e+r.length)%r.length])}}function T(t,e){t&&(C(t,"disabled",e),e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled"))}function I(t){return t.getAttribute("aria-disabled")==="true"}function G(t){var e=h(t),r=f(t,".ge-container-drawer"),o=e.indexOf(w(t));if(r){var a=f(r,".ge-carousel-counter");a&&(a.textContent=n.t("container.carousel_counter",{current:e.length?o+1:0,total:e.length})),T(f(r,".ge-carousel-previous"),e.length<2),T(f(r,".ge-carousel-next"),e.length<2)}e.forEach(function(l,d){var p=f(l,".ge-pane-drawer");T(f(p,".ge-carousel-move-back"),d===0),T(f(p,".ge-carousel-move-forward"),d===e.length-1)})}function W(t,e,r){var o=b(t),a=h(t),l=a.indexOf(e),d=l+r;if(!(d<0||d>=a.length)){var p={parent:o,index:l};n.operate(function(){n.emit("before-move",n.payloadFor("carousel-item",e,{parent:o,source:"tool",from:p}))&&(o.insertBefore(e,r<0?a[d]:a[d].nextSibling),A(t,w(t)),O(t),N(t),n.emit("after-move",n.payloadFor("carousel-item",e,{parent:o,source:"tool",from:p,to:{parent:o,index:d},container:t})))})}}function se(t,e,r){Y(e,200,function(){var o=h(t),a=o.filter(function(l){return l!==e});w(t)===e&&A(t,a[Math.min(o.indexOf(e),a.length-1)]||null,a),O(t,a),r()})}function ce(t,e){var r=n.createPaneControls(e,"carousel-item",n.settings.carousel_tools,n.t("confirm.delete_carousel_item"),function(d){se(t,e,d)}),o=f(r,".ge-move");o&&o.remove();var a=n.createTool(r,n.t("tool.carousel_move_back"),"ge-carousel-move-back","bi bi-arrow-left",function(){I(this)||W(t,e,-1)}),l=n.createTool(r,n.t("tool.carousel_move_forward"),"ge-carousel-move-forward","bi bi-arrow-right",function(){I(this)||W(t,e,1)});r.insertBefore(l,r.firstChild),r.insertBefore(a,l)}function de(t,e){if(e=e||{},!m(t))return n.warn("carousel: there is no .carousel-inner to add a slide to"),null;var r=null;e.interval!==void 0&&e.interval!==null&&(ne(e.interval)?r=e.interval:n.warn("carousel: "+JSON.stringify(e.interval)+" is not a interval, which takes "+te("interval")+": null is used"));var o=V(t,!1,r);return A(t,o),O(t),o}function R(t,e,r){var o=c("div",{class:"ge-carousel-option mb-2"});return o.appendChild(c("label",{class:"form-label",for:r},n.t(t))),o.appendChild(e),o}function M(){return"ge-carousel-option-"+ ++Ae}function X(t,e){var r=M(),o=c("input",{class:"form-control form-control-sm",id:r,type:"number",step:"0.1",min:String(B/1e3)});return o.addEventListener("change",function(){var a=o.value.trim(),l=parseFloat(a);if(a==="")y(o,"is-invalid"),S(t,null);else if(!isFinite(l)||Math.round(l*1e3)<B){F(o,"is-invalid");return}else y(o,"is-invalid"),S(t,Math.round(l*1e3));e&&e()}),{id:r,input:o,render:function(){var a=H(t);y(o,"is-invalid"),o.value=a===null?"":String(a/1e3)}}}function fe(t,e){var r=M(),o=c("div",{class:"form-check"}),a=o.appendChild(c("input",{class:"form-check-input",type:"checkbox",id:r}));return o.appendChild(c("label",{class:"form-check-label",for:r},n.t(t))),a.addEventListener("change",function(){e(a.checked)}),{box:o,input:a}}function pe(t){var e=c("div",{class:"ge-carousel-options"}),r={};function o(v,g){U(t,v,g),N(t),p()}var a=M(),l=c("select",{class:"form-select form-select-sm",id:a});[{value:"false",labelKey:"container.carousel_ride_no"},{value:"carousel",labelKey:"container.carousel_ride_load"},{value:"true",labelKey:"container.carousel_ride_interaction"}].forEach(function(v){l.appendChild(c("option",{value:v.value},n.t(v.labelKey)))}),l.addEventListener("change",function(){o("ride",l.value==="false"?!1:l.value)}),e.appendChild(R(Ee.labelKey,l,a));var d=X(s(t),function(){p()});e.appendChild(R(Z.labelKey,d.input,d.id)),ye.concat(Q).forEach(function(v){var g=fe(Ce[v].labelKey,function(me){o(v,me)});r[v]=g.input,g.box.setAttribute("data-ge-carousel-option",v),e.appendChild(g.box)});function p(){var v=ae(t);l.value=String(v.ride),d.render(),Object.keys(r).forEach(function(g){r[g].checked=v[g]}),d.input.disabled=v.ride===!1,r.pause.disabled=v.ride===!1}return p(),u.push({node:t,element:e,render:p}),e}function ve(t){var e=c("div",{class:"ge-carousel-options"}),r=X(t);return e.appendChild(R(Z.labelKey,r.input,r.id)),r.render(),u.push({node:t,element:e,render:r.render}),e}return{labelKey:"container.add_carousel",addPaneKey:"container.add_carousel_item",paneKind:"carousel-item",paneClass:"ge-carousel-item",paneLabelKey:"panel.kind_carousel_item",create:function(t){t=t||{};var e=c("div",{"data-ge-container":"carousel"}),r=e.appendChild(c("div",{class:"carousel slide",id:n.containerId("carousel")})),o=J(t,"slides");r.appendChild(c("div",{class:"carousel-inner"}));for(var a=0;a<o;a++)V(e,a===0);return Object.keys(k).filter(function(l){return l!=="slides"}).forEach(function(l){U(e,l,J(t,l))}),e},addPane:de,mark:function(t){var e=s(t);if(!(!e||!m(t))){ue(e),N(t);var r=w(t);h(t).forEach(function(o){F(o,"ge-carousel-item"),y(o,$),f(o,".ge-tools-drawer")||ce(t,o)}),A(t,r)}},unmark:function(t){n.resumeToggles(t),m(t)&&(h(t).forEach(function(e,r){y(e,"ge-carousel-item "+$),C(e,"active",r===0),D(e)}),L(t,h(t).length?0:-1))},cleanMarkup:function(t){var e=this;z(t,'[data-ge-container="carousel"]').forEach(function(r){e.unmark(r)})},tools:function(t,e){if(m(e)){n.createTool(t,n.t("tool.carousel_show_previous"),"ge-carousel-previous","bi bi-chevron-left",function(){I(this)||q(e,-1)});var r=n.createTool(t,"","ge-carousel-counter","",null);r.textContent="",r.removeAttribute("title"),n.createTool(t,n.t("tool.carousel_show_next"),"ge-carousel-next","bi bi-chevron-right",function(){I(this)||q(e,1)}),G(e)}},panelSection:function(t,e){return e==="carousel"&&m(t)?{labelKey:"container.carousel_section",body:pe(t)}:e==="carousel-item"?{labelKey:"container.carousel_item_section",body:ve(t)}:null},onRefresh:function(t){u=u.filter(function(e){return e.element.isConnected}),u.forEach(function(e){(e.node===t||t.contains(e.node))&&e.render()})},onDeinit:function(){u=[]}}};})();
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/js/register.js", "../../src/js/dom.js", "../../src/js/plugins/grideditor.carousel.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 * Carousels for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a carousel, a bootstrap carousel whose slides are editable regions. What it\n * can ask the editor for is the handle its factory is called with, described\n * in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.carousel.min.js\"></script>\n *\n * Only one slide shows on the canvas, as on the page. The container's drawer\n * says which, and moves to the next and the previous; Bootstrap's own arrows\n * and indicators are drawn but do not answer, and neither does its javascript:\n * the attributes it acts on are put aside while editing. A carousel's options\n * - arrows, indicators, fade, dark theme, autoplay and its interval, pause,\n * wrap, keyboard and touch - are Bootstrap's classes and attributes and\n * nothing else: they are read from the markup, chosen in the container's\n * settings panel, or given to createContainer and the carousel setting for\n * the ones made new.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_carousel': 'Carousel',\n 'container.add_carousel_item': 'Add slide',\n 'confirm.delete_carousel_item': 'Delete this slide and everything in it?',\n 'panel.kind_carousel_item': 'Slide',\n 'container.carousel_previous': 'Previous',\n 'container.carousel_next': 'Next',\n 'container.carousel_slide_label': 'Slide {number}',\n 'container.carousel_counter': '{current} / {total}',\n 'tool.carousel_show_previous': 'Previous slide',\n 'tool.carousel_show_next': 'Next slide',\n 'tool.carousel_move_back': 'Move back',\n 'tool.carousel_move_forward': 'Move forward',\n 'container.carousel_section': 'Carousel',\n 'container.carousel_controls': 'Arrows',\n 'container.carousel_indicators': 'Indicators',\n 'container.carousel_fade': 'Fade',\n 'container.carousel_dark': 'Dark theme',\n 'container.carousel_ride': 'Autoplay',\n 'container.carousel_ride_no': 'No',\n 'container.carousel_ride_load': 'On load',\n 'container.carousel_ride_interaction': 'After first interaction',\n 'container.carousel_interval': 'Interval (s)',\n 'container.carousel_pause': 'Pause on hover',\n 'container.carousel_wrap': 'Wrap around',\n 'container.carousel_keyboard': 'Keyboard',\n 'container.carousel_touch': 'Touch swipe',\n 'container.carousel_item_section': 'Slide',\n});\n\n/** What a carousel made new has when neither the call nor the setting says. */\nvar DEFAULTS = {\n controls: true,\n indicators: true,\n fade: false,\n dark: false,\n ride: false,\n interval: null,\n pause: true,\n wrap: true,\n keyboard: true,\n touch: true,\n slides: 2,\n};\n\nvar CHECKBOXES = ['controls', 'indicators', 'fade', 'dark'];\nvar BEHAVIOURS = ['pause', 'wrap', 'keyboard', 'touch'];\n\n/** Each option's checkbox in the panel, and its label. */\nvar LABELS = {\n controls: { labelKey: 'container.carousel_controls' },\n indicators: { labelKey: 'container.carousel_indicators' },\n fade: { labelKey: 'container.carousel_fade' },\n dark: { labelKey: 'container.carousel_dark' },\n pause: { labelKey: 'container.carousel_pause' },\n wrap: { labelKey: 'container.carousel_wrap' },\n keyboard: { labelKey: 'container.carousel_keyboard' },\n touch: { labelKey: 'container.carousel_touch' },\n};\nvar RIDE_LABEL = { labelKey: 'container.carousel_ride' };\nvar INTERVAL_LABEL = { labelKey: 'container.carousel_interval' };\nvar RIDES = [false, 'carousel', 'true'];\nvar MIN_INTERVAL = 1000; // ms\n\n/** What Bootstrap puts on a slide while it moves one in: never part of the page. */\nvar TRANSITION = 'carousel-item-next carousel-item-prev carousel-item-start carousel-item-end';\n\nfunction validInterval(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value && value >= MIN_INTERVAL;\n}\n\nvar CHECKS = {\n ride: function(value) { return RIDES.indexOf(value) !== -1; },\n interval: function(value) { return value === null || validInterval(value); },\n slides: function(value) { return typeof value === 'number' && Math.floor(value) === value && value >= 1; },\n};\n\n/** The values an option takes, as the warning lists them. */\nfunction takes(key) {\n if (key === 'ride') { return JSON.stringify(RIDES); }\n if (key === 'interval') { return 'null or an integer of ' + MIN_INTERVAL + ' or more'; }\n if (key === 'slides') { return 'an integer of 1 or more'; }\n\n return '[true,false]';\n}\n\nfunction isValid(key, value) {\n return CHECKS[key] ? CHECKS[key](value) : typeof value === 'boolean';\n}\n\nvar fieldCounter = 0;\n\nGridEditor.containers.carousel = function(ge) {\n\n var shown = new WeakMap(); // The slide each carousel shows, whatever its markup says\n var sections = []; // { node, element, render } for every panel section built\n\n function carouselOf(container) {\n return dom.child(container, '.carousel');\n }\n\n function innerOf(container) {\n return dom.child(carouselOf(container), '.carousel-inner');\n }\n\n /** A container with no carousel or no slides' holder is left as it is. */\n function usable(container) {\n return !!innerOf(container);\n }\n\n function itemsOf(container) {\n return dom.children(innerOf(container), '.carousel-item');\n }\n\n /** The carousel's id, which its arrows and indicators point at. */\n function idOf(carousel) {\n if (!carousel.getAttribute('id')) { carousel.setAttribute('id', ge.containerId('carousel')); }\n\n return carousel.getAttribute('id');\n }\n\n /** A Bootstrap attribute, whether it is where Bootstrap reads it or put aside for editing. */\n function bsAttribute(node, name) {\n var value = node.getAttribute('data-bs-' + name);\n\n return value === null ? node.getAttribute('data-ge-bs-' + name) : value;\n }\n\n function intervalOf(node) {\n var value = parseInt(node.getAttribute('data-bs-interval'), 10);\n\n return isFinite(value) && value > 0 ? value : null;\n }\n\n function writeInterval(node, value) {\n if (value === null) {\n node.removeAttribute('data-bs-interval');\n } else {\n node.setAttribute('data-bs-interval', String(value));\n }\n }\n\n /** What a carousel's classes and attributes say it is. */\n function read(container) {\n var carousel = carouselOf(container);\n var ride = bsAttribute(carousel, 'ride');\n var off = function(name) { return carousel.getAttribute('data-bs-' + name) !== 'false'; };\n\n return {\n controls: !!dom.child(carousel, '.carousel-control-prev, .carousel-control-next'),\n indicators: !!dom.child(carousel, '.carousel-indicators'),\n fade: dom.hasClass(carousel, 'carousel-fade'),\n dark: carousel.getAttribute('data-bs-theme') === 'dark',\n ride: ride === 'carousel' || ride === 'true' ? ride : false,\n interval: intervalOf(carousel),\n pause: off('pause'),\n wrap: off('wrap'),\n keyboard: off('keyboard'),\n touch: off('touch'),\n };\n }\n\n function controlButton(carousel, direction) {\n var button = dom.element('button', {\n 'class': 'carousel-control-' + direction,\n type: 'button',\n 'data-bs-target': '#' + idOf(carousel),\n 'data-bs-slide': direction,\n });\n\n button.appendChild(dom.element('span', { 'class': 'carousel-control-' + direction + '-icon', 'aria-hidden': 'true' }));\n button.appendChild(dom.element('span', { 'class': 'visually-hidden' },\n direction === 'prev' ? ge.t('container.carousel_previous') : ge.t('container.carousel_next')));\n\n return button;\n }\n\n function setControls(container, on) {\n var carousel = carouselOf(container);\n\n dom.children(carousel, '.carousel-control-prev, .carousel-control-next').forEach(function(button) { button.remove(); });\n\n if (on) {\n carousel.appendChild(controlButton(carousel, 'prev'));\n carousel.appendChild(controlButton(carousel, 'next'));\n }\n }\n\n function setIndicators(container, on) {\n var carousel = carouselOf(container);\n var bar = dom.child(carousel, '.carousel-indicators');\n\n if (!on) {\n if (bar) { bar.remove(); }\n return;\n }\n\n if (!bar) {\n bar = carousel.insertBefore(dom.element('div', { 'class': 'carousel-indicators' }), carousel.firstChild);\n }\n\n rebuildIndicators(container);\n }\n\n /** One indicator a slide, in the slides' order, the shown one marked. */\n function rebuildIndicators(container, list) {\n var carousel = carouselOf(container);\n var bar = dom.child(carousel, '.carousel-indicators');\n if (!bar) { return; }\n\n list = list || itemsOf(container);\n var id = idOf(carousel);\n var active = 0;\n\n list.forEach(function(item, index) {\n if (dom.hasClass(item, 'active')) { active = index; }\n });\n\n bar.textContent = '';\n list.forEach(function(item, index) {\n bar.appendChild(dom.element('button', {\n type: 'button',\n 'data-bs-target': '#' + id,\n 'data-bs-slide-to': String(index),\n 'aria-label': ge.t('container.carousel_slide_label', { number: index + 1 }),\n }));\n });\n\n syncIndicators(container, list.length ? active : -1);\n }\n\n function syncIndicators(container, index) {\n var bar = dom.child(carouselOf(container), '.carousel-indicators');\n\n dom.children(bar).forEach(function(indicator, position) {\n dom.toggleClass(indicator, 'active', position === index);\n\n if (position === index) {\n indicator.setAttribute('aria-current', 'true');\n } else {\n indicator.removeAttribute('aria-current');\n }\n });\n }\n\n function write(container, key, value) {\n var carousel = carouselOf(container);\n\n if (key === 'controls') { setControls(container, value); }\n if (key === 'indicators') { setIndicators(container, value); }\n if (key === 'fade') { dom.toggleClass(carousel, 'carousel-fade', value); }\n\n if (key === 'dark') {\n if (value) {\n carousel.setAttribute('data-bs-theme', 'dark');\n } else if (carousel.getAttribute('data-bs-theme') === 'dark') {\n carousel.removeAttribute('data-bs-theme');\n }\n }\n\n if (key === 'ride') {\n carousel.removeAttribute('data-bs-ride');\n carousel.removeAttribute('data-ge-bs-ride');\n if (value) { carousel.setAttribute('data-bs-ride', value); }\n }\n\n if (key === 'interval') { writeInterval(carousel, value); }\n\n if (BEHAVIOURS.indexOf(key) !== -1) {\n if (value) {\n carousel.removeAttribute('data-bs-' + key);\n } else {\n carousel.setAttribute('data-bs-' + key, 'false');\n }\n }\n\n dom.dropEmptyClass(carousel);\n }\n\n /**\n * A value for a new carousel: the option, or the carousel setting, or the\n * default. One the option does not take is warned about and the default used.\n */\n function chosen(options, key) {\n var setting = ge.settings.carousel || {};\n var value = options[key] !== undefined ? options[key] : setting[key];\n\n if (value === undefined) { return DEFAULTS[key]; }\n if (isValid(key, value)) { return value; }\n\n ge.warn('carousel: ' + JSON.stringify(value) + ' is not a ' + key + ', which takes ' +\n takes(key) + ': ' + JSON.stringify(DEFAULTS[key]) + ' is used');\n return DEFAULTS[key];\n }\n\n /** What stops Bootstrap's javascript acting on the carousel while it is edited. */\n function suspend(container) {\n var carousel = carouselOf(container);\n\n dom.children(carousel, '.carousel-control-prev, .carousel-control-next').forEach(ge.suspendToggles);\n dom.children(dom.child(carousel, '.carousel-indicators')).forEach(ge.suspendToggles);\n\n // By hand: suspendToggles(carousel) would take a tabs or an accordion\n // inside a slide off its toggles as well\n var ride = carousel.getAttribute('data-bs-ride');\n if (ride !== null) {\n carousel.setAttribute('data-ge-bs-ride', ride);\n carousel.removeAttribute('data-bs-ride');\n }\n }\n\n /** A carousel Bootstrap started before the editor did stops, and is forgotten. */\n function stopBootstrap(carousel) {\n var library = GridEditor.bootstrap || window.bootstrap;\n var instance = library && library.Carousel ? library.Carousel.getInstance(carousel) : null;\n\n if (instance) {\n instance.pause();\n instance.dispose();\n }\n }\n\n function buildItem(container, active, interval) {\n var item = innerOf(container).appendChild(dom.element('div', { 'class': active ? 'carousel-item active' : 'carousel-item' }));\n\n item.appendChild(ge.defaultRegion());\n if (interval !== null && interval !== undefined) { writeInterval(item, interval); }\n\n return item;\n }\n\n /** The slide the carousel shows: the one it was left on, or the markup's, or the first. */\n function currentOf(container) {\n var list = itemsOf(container);\n var kept = shown.get(container);\n\n if (kept && list.indexOf(kept) !== -1) { return kept; }\n\n return list.filter(function(item) { return dom.hasClass(item, 'active'); })[0] || list[0] || null;\n }\n\n /** Show one slide and only that one. */\n function show(container, item, list) {\n list = list || itemsOf(container);\n\n list.forEach(function(each) { dom.toggleClass(each, 'active', each === item); });\n\n if (item) {\n shown.set(container, item);\n } else {\n shown.delete(container);\n }\n\n syncIndicators(container, list.indexOf(item));\n refreshNavigation(container);\n }\n\n function step(container, offset) {\n var list = itemsOf(container);\n if (list.length < 2) { return; }\n\n var index = list.indexOf(currentOf(container));\n show(container, list[(index + offset + list.length) % list.length]);\n }\n\n function disable(tool, state) {\n if (!tool) { return; }\n\n dom.toggleClass(tool, 'disabled', state);\n\n if (state) {\n tool.setAttribute('aria-disabled', 'true');\n } else {\n tool.removeAttribute('aria-disabled');\n }\n }\n\n function disabled(tool) {\n return tool.getAttribute('aria-disabled') === 'true';\n }\n\n /** The container's counter and arrows, and every slide's move tools, as the slides stand. */\n function refreshNavigation(container) {\n var list = itemsOf(container);\n var drawer = dom.child(container, '.ge-container-drawer');\n var index = list.indexOf(currentOf(container));\n\n if (drawer) {\n var counter = dom.child(drawer, '.ge-carousel-counter');\n\n if (counter) {\n counter.textContent = ge.t('container.carousel_counter', {\n current: list.length ? index + 1 : 0,\n total: list.length,\n });\n }\n\n disable(dom.child(drawer, '.ge-carousel-previous'), list.length < 2);\n disable(dom.child(drawer, '.ge-carousel-next'), list.length < 2);\n }\n\n list.forEach(function(item, position) {\n var tools = dom.child(item, '.ge-pane-drawer');\n\n disable(dom.child(tools, '.ge-carousel-move-back'), position === 0);\n disable(dom.child(tools, '.ge-carousel-move-forward'), position === list.length - 1);\n });\n }\n\n function moveItem(container, item, offset) {\n var inner = innerOf(container);\n var list = itemsOf(container);\n var index = list.indexOf(item);\n var target = index + offset;\n\n if (target < 0 || target >= list.length) { return; }\n\n var from = { parent: inner, index: index };\n\n ge.operate(function() {\n if (!ge.emit('before-move', ge.payloadFor('carousel-item', item, {\n parent: inner,\n source: 'tool',\n from: from,\n }))) { return; }\n\n inner.insertBefore(item, offset < 0 ? list[target] : list[target].nextSibling);\n show(container, currentOf(container));\n rebuildIndicators(container);\n suspend(container);\n\n ge.emit('after-move', ge.payloadFor('carousel-item', item, {\n parent: inner,\n source: 'tool',\n from: from,\n to: { parent: inner, index: target },\n container: container,\n }));\n });\n }\n\n /** What the slide to show is once `item` goes: the next one, or the previous if it was the last. */\n function afterRemoving(container, item, removed) {\n dom.fadeOut(item, 200, function() {\n var list = itemsOf(container);\n var rest = list.filter(function(each) { return each !== item; });\n\n if (currentOf(container) === item) {\n show(container, rest[Math.min(list.indexOf(item), rest.length - 1)] || null, rest);\n }\n\n rebuildIndicators(container, rest);\n removed();\n });\n }\n\n function createItemControls(container, item) {\n var drawer = ge.createPaneControls(item, 'carousel-item', ge.settings.carousel_tools,\n ge.t('confirm.delete_carousel_item'), function(removed) {\n afterRemoving(container, item, removed);\n });\n\n // A slide moves a place at a time, not by dragging\n var handle = dom.child(drawer, '.ge-move');\n if (handle) { handle.remove(); }\n\n var back = ge.createTool(drawer, ge.t('tool.carousel_move_back'), 'ge-carousel-move-back', 'bi bi-arrow-left', function() {\n if (!disabled(this)) { moveItem(container, item, -1); }\n });\n var forward = ge.createTool(drawer, ge.t('tool.carousel_move_forward'), 'ge-carousel-move-forward', 'bi bi-arrow-right', function() {\n if (!disabled(this)) { moveItem(container, item, 1); }\n });\n\n drawer.insertBefore(forward, drawer.firstChild);\n drawer.insertBefore(back, forward);\n }\n\n function addSlideTo(container, options) {\n options = options || {};\n\n if (!usable(container)) {\n ge.warn('carousel: there is no .carousel-inner to add a slide to');\n return null;\n }\n\n var interval = null;\n\n if (options.interval !== undefined && options.interval !== null) {\n if (validInterval(options.interval)) {\n interval = options.interval;\n } else {\n ge.warn('carousel: ' + JSON.stringify(options.interval) + ' is not a interval, which takes ' +\n takes('interval') + ': null is used');\n }\n }\n\n var item = buildItem(container, false, interval);\n\n show(container, item);\n rebuildIndicators(container);\n\n return item;\n }\n\n function field(labelKey, control, id) {\n var box = dom.element('div', { 'class': 'ge-carousel-option mb-2' });\n\n box.appendChild(dom.element('label', { 'class': 'form-label', 'for': id }, ge.t(labelKey)));\n box.appendChild(control);\n\n return box;\n }\n\n function nextId() {\n return 'ge-carousel-option-' + (++fieldCounter);\n }\n\n /**\n * The interval in seconds, for a node: empty takes it off, under a\n * second is refused and the field says so, and anything else is written\n * in milliseconds.\n */\n function intervalField(node, onWrite) {\n var id = nextId();\n var input = dom.element('input', {\n 'class': 'form-control form-control-sm',\n id: id,\n type: 'number',\n step: '0.1',\n min: String(MIN_INTERVAL / 1000),\n });\n\n input.addEventListener('change', function() {\n var text = input.value.trim();\n var seconds = parseFloat(text);\n\n if (text === '') {\n dom.removeClass(input, 'is-invalid');\n writeInterval(node, null);\n } else if (!isFinite(seconds) || Math.round(seconds * 1000) < MIN_INTERVAL) {\n dom.addClass(input, 'is-invalid');\n return;\n } else {\n dom.removeClass(input, 'is-invalid');\n writeInterval(node, Math.round(seconds * 1000));\n }\n\n if (onWrite) { onWrite(); }\n });\n\n return {\n id: id,\n input: input,\n render: function() {\n var interval = intervalOf(node);\n\n dom.removeClass(input, 'is-invalid');\n input.value = interval === null ? '' : String(interval / 1000);\n },\n };\n }\n\n function checkbox(labelKey, onChange) {\n var id = nextId();\n var box = dom.element('div', { 'class': 'form-check' });\n var input = box.appendChild(dom.element('input', { 'class': 'form-check-input', type: 'checkbox', id: id }));\n\n box.appendChild(dom.element('label', { 'class': 'form-check-label', 'for': id }, ge.t(labelKey)));\n input.addEventListener('change', function() { onChange(input.checked); });\n\n return { box: box, input: input };\n }\n\n /** The Carousel section of a carousel's settings panel. */\n function createSection(container) {\n var body = dom.element('div', { 'class': 'ge-carousel-options' });\n var inputs = {};\n\n function change(key, value) {\n write(container, key, value);\n suspend(container);\n render();\n }\n\n var rideId = nextId();\n var ride = dom.element('select', { 'class': 'form-select form-select-sm', id: rideId });\n\n [\n { value: 'false', labelKey: 'container.carousel_ride_no' },\n { value: 'carousel', labelKey: 'container.carousel_ride_load' },\n { value: 'true', labelKey: 'container.carousel_ride_interaction' },\n ].forEach(function(choice) {\n ride.appendChild(dom.element('option', { value: choice.value }, ge.t(choice.labelKey)));\n });\n ride.addEventListener('change', function() { change('ride', ride.value === 'false' ? false : ride.value); });\n body.appendChild(field(RIDE_LABEL.labelKey, ride, rideId));\n\n var interval = intervalField(carouselOf(container), function() { render(); });\n body.appendChild(field(INTERVAL_LABEL.labelKey, interval.input, interval.id));\n\n CHECKBOXES.concat(BEHAVIOURS).forEach(function(key) {\n var each = checkbox(LABELS[key].labelKey, function(on) { change(key, on); });\n\n inputs[key] = each.input;\n each.box.setAttribute('data-ge-carousel-option', key);\n body.appendChild(each.box);\n });\n\n /** Fill the fields from the markup, and turn off what autoplay being off leaves without use. */\n function render() {\n var values = read(container);\n\n ride.value = String(values.ride);\n interval.render();\n Object.keys(inputs).forEach(function(key) { inputs[key].checked = values[key]; });\n\n interval.input.disabled = values.ride === false;\n inputs.pause.disabled = values.ride === false;\n }\n\n render();\n sections.push({ node: container, element: body, render: render });\n\n return body;\n }\n\n /** The Slide section of a slide's settings panel. */\n function createItemSection(item) {\n var body = dom.element('div', { 'class': 'ge-carousel-options' });\n var interval = intervalField(item);\n\n body.appendChild(field(INTERVAL_LABEL.labelKey, interval.input, interval.id));\n interval.render();\n sections.push({ node: item, element: body, render: interval.render });\n\n return body;\n }\n\n return {\n labelKey: 'container.add_carousel',\n addPaneKey: 'container.add_carousel_item',\n paneKind: 'carousel-item',\n paneClass: 'ge-carousel-item',\n paneLabelKey: 'panel.kind_carousel_item',\n\n /**\n * `slides` slides, each a region, and the options of DEFAULTS as the\n * call, the carousel setting or the defaults give them.\n */\n create: function(options) {\n options = options || {};\n\n var container = dom.element('div', { 'data-ge-container': 'carousel' });\n var carousel = container.appendChild(dom.element('div', { 'class': 'carousel slide', id: ge.containerId('carousel') }));\n var slides = chosen(options, 'slides');\n\n carousel.appendChild(dom.element('div', { 'class': 'carousel-inner' }));\n\n for (var i = 0; i < slides; i++) {\n buildItem(container, i === 0);\n }\n\n Object.keys(DEFAULTS).filter(function(key) { return key !== 'slides'; }).forEach(function(key) {\n write(container, key, chosen(options, key));\n });\n\n return container;\n },\n\n addPane: addSlideTo,\n\n mark: function(container) {\n var carousel = carouselOf(container);\n if (!carousel || !usable(container)) { return; }\n\n stopBootstrap(carousel);\n suspend(container);\n\n var current = currentOf(container);\n\n itemsOf(container).forEach(function(item) {\n dom.addClass(item, 'ge-carousel-item');\n dom.removeClass(item, TRANSITION);\n\n if (!dom.child(item, '.ge-tools-drawer')) { createItemControls(container, item); }\n });\n\n show(container, current);\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n if (!usable(container)) { return; }\n\n // What the page ships starts at the first slide, whichever one\n // the canvas was showing\n itemsOf(container).forEach(function(item, index) {\n dom.removeClass(item, 'ge-carousel-item ' + TRANSITION);\n dom.toggleClass(item, 'active', index === 0);\n dom.dropEmptyClass(item);\n });\n\n syncIndicators(container, itemsOf(container).length ? 0 : -1);\n },\n\n // The same, on a copy of the canvas: unmark only touches markup\n cleanMarkup: function(root) {\n var definition = this;\n dom.all(root, '[data-ge-container=\"carousel\"]').forEach(function(container) { definition.unmark(container); });\n },\n\n // The arrows, the counter and the arrow's other side: what moves the\n // carousel from slide to slide while it is edited\n tools: function(drawer, container) {\n if (!usable(container)) { return; }\n\n ge.createTool(drawer, ge.t('tool.carousel_show_previous'), 'ge-carousel-previous', 'bi bi-chevron-left', function() {\n if (!disabled(this)) { step(container, -1); }\n });\n\n var counter = ge.createTool(drawer, '', 'ge-carousel-counter', '', null);\n counter.textContent = '';\n counter.removeAttribute('title');\n\n ge.createTool(drawer, ge.t('tool.carousel_show_next'), 'ge-carousel-next', 'bi bi-chevron-right', function() {\n if (!disabled(this)) { step(container, 1); }\n });\n\n refreshNavigation(container);\n },\n\n panelSection: function(node, kind) {\n if (kind === 'carousel' && usable(node)) {\n return { labelKey: 'container.carousel_section', body: createSection(node) };\n }\n\n if (kind === 'carousel-item') {\n return { labelKey: 'container.carousel_item_section', body: createItemSection(node) };\n }\n\n return null;\n },\n\n // After a view change or a change of classes: the sections follow\n onRefresh: function(scope) {\n sections = sections.filter(function(entry) { return entry.element.isConnected; });\n sections.forEach(function(entry) {\n if (entry.node === scope || scope.contains(entry.node)) { entry.render(); }\n });\n },\n\n onDeinit: function() {\n sections = [];\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,CAiBO,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,cAA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,WAAW6D,EAAQ7D,EAAG,EAAE,yBAAyB,EAAG,mBAAoB,sBAAuB,UAAW,CACpG4D,EAAS,IAAI,GAAKL,EAAKnD,EAAW,CAAC,CAC5C,CAAC,EAEDkD,EAAkBlD,CAAS,EAC/B,EAEA,aAAc,SAASS,EAAM6F,EAAM,CAC/B,OAAIA,IAAS,YAAcnG,EAAOM,CAAI,EAC3B,CAAE,SAAU,6BAA8B,KAAM8E,GAAc9E,CAAI,CAAE,EAG3E6F,IAAS,gBACF,CAAE,SAAU,kCAAmC,KAAMP,GAAkBtF,CAAI,CAAE,EAGjF,IACX,EAGA,UAAW,SAAS8F,EAAO,CACvBzG,EAAWA,EAAS,OAAO,SAAS0G,EAAO,CAAE,OAAOA,EAAM,QAAQ,WAAa,CAAC,EAChF1G,EAAS,QAAQ,SAAS0G,EAAO,EACzBA,EAAM,OAASD,GAASA,EAAM,SAASC,EAAM,IAAI,IAAKA,EAAM,OAAO,CAC3E,CAAC,CACL,EAEA,SAAU,UAAW,CACjB1G,EAAW,CAAC,CAChB,CACJ,CACJ",
6
+ "names": ["GridEditor", "all", "root", "selector", "children", "node", "selector", "each", "child", "element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "toggleClass", "state", "hasClass", "dropEmptyClass", "hide", "node", "visible", "node", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "fadeOut", "node", "duration", "done", "animateAway", "style", "GridEditor", "DEFAULTS", "CHECKBOXES", "BEHAVIOURS", "LABELS", "RIDE_LABEL", "INTERVAL_LABEL", "RIDES", "MIN_INTERVAL", "TRANSITION", "validInterval", "value", "CHECKS", "takes", "key", "isValid", "fieldCounter", "ge", "shown", "sections", "carouselOf", "container", "child", "innerOf", "usable", "itemsOf", "children", "idOf", "carousel", "bsAttribute", "node", "name", "intervalOf", "writeInterval", "read", "ride", "off", "hasClass", "controlButton", "direction", "button", "element", "setControls", "on", "setIndicators", "bar", "rebuildIndicators", "list", "id", "active", "item", "index", "syncIndicators", "indicator", "position", "toggleClass", "write", "dropEmptyClass", "chosen", "options", "setting", "suspend", "stopBootstrap", "library", "instance", "buildItem", "interval", "currentOf", "kept", "show", "each", "refreshNavigation", "step", "offset", "disable", "tool", "state", "disabled", "drawer", "counter", "tools", "moveItem", "inner", "target", "from", "afterRemoving", "removed", "fadeOut", "rest", "createItemControls", "handle", "back", "forward", "addSlideTo", "field", "labelKey", "control", "box", "nextId", "intervalField", "onWrite", "input", "text", "seconds", "removeClass", "addClass", "checkbox", "onChange", "createSection", "body", "inputs", "change", "render", "rideId", "choice", "values", "createItemSection", "slides", "i", "current", "root", "definition", "all", "kind", "scope", "entry"]
7
+ }
package/docs/events.md CHANGED
@@ -63,12 +63,14 @@ about every insertion can bind `grideditor:before-add` and switch on
63
63
  | `grideditor:after-add-row` | `grideditor:after-add` | no | after insertion, once the canvas is up to date |
64
64
  | `grideditor:before-add-column` | `grideditor:before-add` | yes | before a column is inserted |
65
65
  | `grideditor:after-add-column` | `grideditor:after-add` | no | |
66
- | `grideditor:before-add-container` | `grideditor:before-add` | yes | before a container is inserted; `payload.kind` is `tabs`, `accordion` or `popup` |
66
+ | `grideditor:before-add-container` | `grideditor:before-add` | yes | before a container is inserted; `payload.kind` is `tabs`, `accordion`, `popup`, `carousel` or `card` |
67
67
  | `grideditor:after-add-container` | `grideditor:after-add` | no | |
68
68
  | `grideditor:before-add-tab` | `grideditor:before-add` | yes | before a tab is added to a tabs container |
69
69
  | `grideditor:after-add-tab` | `grideditor:after-add` | no | |
70
70
  | `grideditor:before-add-accordion-item` | `grideditor:before-add` | yes | before an item is added to an accordion |
71
71
  | `grideditor:after-add-accordion-item` | `grideditor:after-add` | no | |
72
+ | `grideditor:before-add-carousel-item` | `grideditor:before-add` | yes | before a slide is added to a carousel |
73
+ | `grideditor:after-add-carousel-item` | `grideditor:after-add` | no | |
72
74
  | `grideditor:before-add-element` | `grideditor:before-add` | yes | before an element is inserted |
73
75
  | `grideditor:after-add-element` | `grideditor:after-add` | no | |
74
76
  | `grideditor:before-add-text` | `grideditor:before-add` | yes | before a text block is inserted, from the add text tool, the toolbar or `createText` |
@@ -97,7 +99,7 @@ about every insertion can bind `grideditor:before-add` and switch on
97
99
 
98
100
  Two things here are not in the 3.0 specification's catalogue. The indent pair,
99
101
  because the indent tools are an operation like any other and announce
100
- themselves like one. And the add events for panes — a tab, an accordion item —
102
+ themselves like one. And the add events for panes — a tab, an accordion item, a carousel slide —
101
103
  which follow the same pattern as the rest.
102
104
 
103
105
 
@@ -107,7 +109,7 @@ The payload
107
109
  ```javascript
108
110
  {
109
111
  kind: 'row', // row | column | text | plain | element
110
- // tabs | accordion | popup | tab | accordion-item
112
+ // tabs | accordion | popup | carousel | card | tab | accordion-item | carousel-item
111
113
  // section, with the sections plugin
112
114
  node: Element, // the node added, deleted, moved or resized
113
115
  parent: Element, // where it is going, or where it came from on a delete;
@@ -115,6 +117,7 @@ The payload
115
117
  canvas: Element,
116
118
  breakpoint: 'lg', // the view at the time: a breakpoint key, or 'all'
117
119
  source: 'tool', // tool | api | dragdrop | panel (a width chosen in the panel)
120
+ // a carousel slide moved a place with its arrows is a move with source 'tool'
118
121
 
119
122
  // move only
120
123
  from: { parent: Element, index: 2 },
@@ -36,7 +36,11 @@ The tools in a drawer, and the buttons in the toolbar above the canvas.
36
36
  | `tool.delete_column` | Remove col | Column drawer |
37
37
  | `tool.delete_element` | Remove element | Element drawer |
38
38
  | `tool.delete_container` | Remove container | Container drawer |
39
- | `tool.delete_pane` | Remove pane | Drawer of a tab or an accordion item |
39
+ | `tool.delete_pane` | Remove pane | Drawer of a tab, an accordion item or a carousel slide |
40
+ | `tool.carousel_show_previous` | Previous slide | Carousel drawer, shows the previous slide |
41
+ | `tool.carousel_show_next` | Next slide | Carousel drawer, shows the next slide |
42
+ | `tool.carousel_move_back` | Move back | Slide drawer, moves the slide a place back |
43
+ | `tool.carousel_move_forward` | Move forward | Slide drawer, moves the slide a place on |
40
44
  | `tool.rename` | Double click to rename | Tooltip of a pane's label, which is edited in place |
41
45
  | `tool.toggle_popup` | Fold this popup away while editing | Popup drawer. Editing shows a popup unfolded, and this folds it away |
42
46
  | `tool.element_info` | Element: {name} | Tooltip of the element drawer's info tool. `{name}` is the element's `data-ge-label`, its `data-ge-element` type, or both |
@@ -90,12 +94,13 @@ title. `{kind}` is one of the `panel.kind_*` keys, or a container's own label.
90
94
  | `panel.kind_section` | Section | For a section |
91
95
  | `panel.kind_tab` | Tab | For a tab |
92
96
  | `panel.kind_accordion_item` | Accordion item | For an accordion item |
97
+ | `panel.kind_carousel_item` | Slide | For a carousel slide |
93
98
 
94
99
 
95
100
  container.*
96
101
  -----------
97
102
 
98
- The containers: tabs, accordions and popups, and the panes inside them.
103
+ The containers: tabs, accordions, popups, carousels and cards, and the panes inside them.
99
104
 
100
105
  | Key | English | Where |
101
106
  | --- | --- | --- |
@@ -122,6 +127,27 @@ The containers: tabs, accordions and popups, and the panes inside them.
122
127
  | `container.add_accordion` | Accordion | Toolbar button that adds an accordion |
123
128
  | `container.add_accordion_item` | Add item | Container drawer, adds an item |
124
129
  | `container.accordion_label` | Item {number} | Label of a new accordion item |
130
+ | `container.add_carousel` | Carousel | Toolbar button that adds a carousel |
131
+ | `container.add_carousel_item` | Add slide | Container drawer, adds a slide |
132
+ | `container.carousel_previous` | Previous | The text, hidden, of a carousel's previous arrow in the page |
133
+ | `container.carousel_next` | Next | The same for the next arrow |
134
+ | `container.carousel_slide_label` | Slide {number} | `aria-label` of a carousel's indicator. `{number}` is the slide's position |
135
+ | `container.carousel_counter` | {current} / {total} | The container's drawer says which slide is shown, and how many there are |
136
+ | `container.carousel_section` | Carousel | Heading of the carousel's section of its settings panel |
137
+ | `container.carousel_controls` | Arrows | Its checkbox for the previous and next arrows |
138
+ | `container.carousel_indicators` | Indicators | Its checkbox for the indicators |
139
+ | `container.carousel_fade` | Fade | Its checkbox for `carousel-fade` |
140
+ | `container.carousel_dark` | Dark theme | Its checkbox for `data-bs-theme="dark"` |
141
+ | `container.carousel_ride` | Autoplay | Its autoplay select, `data-bs-ride` |
142
+ | `container.carousel_ride_no` | No | Its choice for no autoplay |
143
+ | `container.carousel_ride_load` | On load | Its choice for `data-bs-ride="carousel"` |
144
+ | `container.carousel_ride_interaction` | After first interaction | Its choice for `data-bs-ride="true"` |
145
+ | `container.carousel_interval` | Interval (s) | The interval field, in seconds, of the carousel's section and of a slide's. `data-bs-interval` |
146
+ | `container.carousel_pause` | Pause on hover | Its checkbox for `data-bs-pause` |
147
+ | `container.carousel_wrap` | Wrap around | Its checkbox for `data-bs-wrap` |
148
+ | `container.carousel_keyboard` | Keyboard | Its checkbox for `data-bs-keyboard` |
149
+ | `container.carousel_touch` | Touch swipe | Its checkbox for `data-bs-touch` |
150
+ | `container.carousel_item_section` | Slide | Heading of a slide's section of its settings panel |
125
151
  | `container.add_popup` | Popup | Toolbar button that adds a popup |
126
152
  | `container.popup_title` | Title | Title of a new popup, in its modal header |
127
153
  | `container.popup_trigger` | Open | Label of the button a popup makes to open itself |
@@ -234,6 +260,7 @@ browser's own confirm instead.
234
260
  | `confirm.delete_container` | Delete this container and everything in it? | Before a container is removed |
235
261
  | `confirm.delete_tab` | Delete this tab and everything in it? | Before a tab and its pane are removed |
236
262
  | `confirm.delete_accordion_item` | Delete this item and everything in it? | Before an accordion item is removed |
263
+ | `confirm.delete_carousel_item` | Delete this slide and everything in it? | Before a carousel slide is removed |
237
264
 
238
265
 
239
266
  view.*
package/docs/plugins.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Writing a plugin
2
2
  ================
3
3
 
4
- Tabs, accordions, popups, cards and the element level controls are not built
4
+ Tabs, accordions, popups, carousels, cards and the element level controls are not built
5
5
  into grid-editor: each is a file you load beside it, and loading the file is
6
6
  what turns the feature on. `grideditor.card.js` is the shortest of them, and
7
7
  the one to read first if you are about to write your own.
@@ -51,23 +51,26 @@ called once per editor, with the handle below, and returns the definition:
51
51
 
52
52
  ```javascript
53
53
  Object.assign(GridEditor.locales.en, {
54
- 'container.add_carousel': 'Carousel',
55
- 'container.carousel_label': 'Slide {number}',
54
+ 'container.add_gallery': 'Gallery',
55
+ 'container.gallery_label': 'Picture {number}',
56
56
  });
57
57
 
58
- GridEditor.containers.carousel = function(ge) {
58
+ GridEditor.containers.gallery = function(ge) {
59
59
 
60
- function addSlideTo(container, options) { … }
60
+ function addPictureTo(container, options) { … }
61
61
 
62
62
  return {
63
- labelKey: 'container.add_carousel', // the toolbar button's label
63
+ labelKey: 'container.add_gallery', // the toolbar button's label
64
64
  iconClass: 'bi bi-images', // optional: the button shows it in place of the label
65
65
  group: 'media', // optional: its toolbar tab, with toolbar_groups
66
- addPaneKey: 'container.add_slide', // the drawer's add pane tool
67
- paneKind: 'slide', // the kind its panes report
66
+ addPaneKey: 'container.add_picture', // the drawer's add pane tool
67
+ paneKind: 'picture', // the kind its panes report
68
+ paneClass: 'ge-picture', // optional: the class mark gives its panes, which is how
69
+ // the editor knows one is a picture
70
+ paneLabelKey: 'panel.kind_picture', // optional: what a pane's settings panel calls it
68
71
 
69
72
  create: function(options) { … }, // returns the container
70
- addPane: addSlideTo, // returns the new pane
73
+ addPane: addPictureTo, // returns the new pane
71
74
  mark: function(container) { … }, // editing furniture on
72
75
  unmark: function(container) { … }, // and off again
73
76
  cleanMarkup: function(root, liveOf) { … }, // the same, on a copy: see "Reading on a copy"
@@ -86,11 +89,11 @@ it is imported, which is how the shipped plugins' modules work:
86
89
  ```javascript
87
90
  import { GridEditor } from '@themarioga/grid-editor';
88
91
 
89
- GridEditor.containers.carousel = function(ge) { … };
92
+ GridEditor.containers.gallery = function(ge) { … };
90
93
  ```
91
94
 
92
95
  A page or an app imports it for that side effect, after the editor:
93
- `import './carousel.js'`. Either way there is one registry per page, and the
96
+ `import './gallery.js'`. Either way there is one registry per page, and the
94
97
  editors made after a plugin registered have it.
95
98
 
96
99
  Everything the editor hands a plugin, and everything a plugin hands back, is
@@ -141,11 +144,11 @@ element, and where there may be several, an array.
141
144
  | `ge.detailsOf(node)` | A node's settings panel, wherever it is: in its drawer, or open in the offcanvas, popover or modal `settings_panel` names, outside the canvas. Find a panel's fields through it, never through the drawer. Null for a node with none |
142
145
  | `ge.deleteNode(kind, node, confirmText, animate)` | Remove a node: ask, animate, announce |
143
146
  | `ge.place(node, kind, options)` | Put a created node where `appendTo` and friends say, through the add events. `options.source` is the payload's `source`, `api` by default |
144
- | `ge.createPaneControls(pane, kind, hostTools, confirmText, remove)` | The drawer a pane gets: move, the host's tools, delete |
147
+ | `ge.createPaneControls(pane, kind, hostTools, confirmText, remove)` | The drawer a pane gets: move, the host's tools, delete. Returns the drawer, for a plugin that wants other tools in it |
145
148
  | `ge.makeLabelEditable(label)` | Rename in place, with the Bootstrap toggle suspended while typing |
146
149
  | `ge.labelIn(button)` | The label span inside a button, wrapped if it is not already |
147
150
  | `ge.unwrapLabels(scope)` | Take those wrappers off again, for `unmark` |
148
- | `ge.suspendToggles(scope)` / `ge.resumeToggles(scope)` | Move `data-bs-toggle` aside while editing, and back on the way out |
151
+ | `ge.suspendToggles(scope)` / `ge.resumeToggles(scope)` | Move the attributes Bootstrap's data api acts on - `data-bs-toggle`, `data-bs-dismiss`, `data-bs-slide`, `data-bs-slide-to` and `data-bs-ride` - aside while editing, and back on the way out. They take `scope` and everything under it: a plugin whose container holds others passes the elements that are its own |
149
152
  | `ge.emit(name, payload)` | Fire an event and its callbacks; false means a handler canceled |
150
153
  | `ge.payloadFor(kind, node, extra)` | Build a payload the documented way |
151
154
  | `ge.operate(body)` | Run `body` as one operation, so a handler calling back in is queued |
@@ -297,7 +300,7 @@ is, called for each container of the type under `root`:
297
300
  ```javascript
298
301
  cleanMarkup: function(root) {
299
302
  var definition = this;
300
- root.querySelectorAll('[data-ge-container="carousel"]').forEach(function(container) {
303
+ root.querySelectorAll('[data-ge-container="gallery"]').forEach(function(container) {
301
304
  definition.unmark(container);
302
305
  });
303
306
  },
@@ -23,6 +23,7 @@
23
23
  <script src="../dist/plugins/grideditor.accordion.min.js"></script>
24
24
  <script src="../dist/plugins/grideditor.popup.min.js"></script>
25
25
  <script src="../dist/plugins/grideditor.card.min.js"></script>
26
+ <script src="../dist/plugins/grideditor.carousel.min.js"></script>
26
27
 
27
28
  <script>
28
29
  document.addEventListener('DOMContentLoaded', function() {
@@ -87,9 +88,9 @@
87
88
  <p class="form-text">
88
89
  A container holds regions, and every region is an ordinary
89
90
  one: rows, columns, content areas and elements nest inside
90
- it exactly as they do at the top level. The four buttons in
91
- the toolbar add a tabs container, an accordion, a popup and
92
- a card &mdash; the first three hold a pane each, a card
91
+ it exactly as they do at the top level. The five buttons in
92
+ the toolbar add a tabs container, an accordion, a popup, a
93
+ carousel and a card &mdash; the first four hold a pane each, a card
93
94
  holds one region and an editable header.
94
95
  </p>
95
96
  <p class="form-text">
@@ -104,7 +105,11 @@
104
105
  an accordion item. A tabs container's gear has a Tabs
105
106
  section for its variant - tabs, pills or underline, full
106
107
  width, alignment, and vertical from a breakpoint up - and
107
- the last row has two of them.
108
+ the row after has two of them. The last row is a carousel:
109
+ one slide shows at a time, the arrows in its drawer move
110
+ between them, and the gear has a Carousel section for
111
+ fade, autoplay and the rest of Bootstrap's options, and a
112
+ slide&rsquo;s own gear has its interval.
108
113
  </p>
109
114
  <button class="btn btn-sm btn-secondary" id="output" type="button">Show the html this produces</button>
110
115
  <button class="btn btn-sm btn-primary" id="authored" type="button">Open that html as a real page</button>
@@ -301,6 +306,41 @@
301
306
  </div>
302
307
  </div>
303
308
 
309
+ <div class="row">
310
+ <div class="col-lg-12">
311
+ <div data-ge-container="carousel">
312
+ <div class="carousel slide carousel-fade" id="example-carousel" data-bs-ride="carousel" data-bs-interval="5000">
313
+ <div class="carousel-indicators">
314
+ <button type="button" data-bs-target="#example-carousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
315
+ <button type="button" data-bs-target="#example-carousel" data-bs-slide-to="1" aria-label="Slide 2"></button>
316
+ </div>
317
+ <div class="carousel-inner">
318
+ <div class="carousel-item active">
319
+ <div class="row"><div class="col-lg-12">
320
+ <div class="ge-content" data-ge-content-type="tinymce"><p>A carousel that fades and starts by itself on the page. In the editor it stays on one slide until you move it with the arrows in its drawer.</p></div>
321
+ </div></div>
322
+ </div>
323
+ <div class="carousel-item" data-bs-interval="2000">
324
+ <div class="row"><div class="col-lg-6">
325
+ <div class="ge-content" data-ge-content-type="tinymce"><p>A slide is a region like any other, and this one stays for two seconds only.</p></div>
326
+ </div><div class="col-lg-6">
327
+ <div class="ge-content" data-ge-content-type="tinymce"><p>So it takes rows and columns of its own.</p></div>
328
+ </div></div>
329
+ </div>
330
+ </div>
331
+ <button class="carousel-control-prev" type="button" data-bs-target="#example-carousel" data-bs-slide="prev">
332
+ <span class="carousel-control-prev-icon" aria-hidden="true"></span>
333
+ <span class="visually-hidden">Previous</span>
334
+ </button>
335
+ <button class="carousel-control-next" type="button" data-bs-target="#example-carousel" data-bs-slide="next">
336
+ <span class="carousel-control-next-icon" aria-hidden="true"></span>
337
+ <span class="visually-hidden">Next</span>
338
+ </button>
339
+ </div>
340
+ </div>
341
+ </div>
342
+ </div>
343
+
304
344
  </div> <!-- /#myGrid -->
305
345
  </div> <!-- /.container -->
306
346
 
package/package.json CHANGED
@@ -32,7 +32,7 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "version": "8.7.0",
35
+ "version": "8.8.0",
36
36
  "main": "dist/grideditor.js",
37
37
  "module": "dist/grideditor.esm.js",
38
38
  "types": "dist/grideditor.d.ts",