@themarioga/grid-editor 9.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.esm.js +78 -10
- package/dist/grideditor.js +78 -10
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +3 -3
- package/dist/plugins/grideditor.carousel.esm.js +8 -2
- package/dist/plugins/grideditor.carousel.js +8 -2
- package/dist/plugins/grideditor.carousel.min.js +1 -1
- package/dist/plugins/grideditor.carousel.min.js.map +3 -3
- package/dist/plugins/grideditor.clipboard.esm.js +1 -1
- package/dist/plugins/grideditor.clipboard.js +1 -1
- package/dist/plugins/grideditor.clipboard.min.js +1 -1
- package/dist/plugins/grideditor.clipboard.min.js.map +2 -2
- package/dist/plugins/grideditor.inline-style.esm.js +4 -1
- package/dist/plugins/grideditor.inline-style.js +4 -1
- package/dist/plugins/grideditor.inline-style.min.js +3 -3
- package/dist/plugins/grideditor.inline-style.min.js.map +2 -2
- package/dist/plugins/grideditor.offcanvas.esm.js +7 -1
- package/dist/plugins/grideditor.offcanvas.js +7 -1
- package/dist/plugins/grideditor.offcanvas.min.js +1 -1
- package/dist/plugins/grideditor.offcanvas.min.js.map +3 -3
- package/dist/plugins/grideditor.sections.esm.js +1 -1
- package/dist/plugins/grideditor.sections.js +1 -1
- package/dist/plugins/grideditor.sections.min.js +1 -1
- package/dist/plugins/grideditor.sections.min.js.map +2 -2
- package/dist/plugins/grideditor.tabs.esm.js +7 -1
- package/dist/plugins/grideditor.tabs.js +7 -1
- package/dist/plugins/grideditor.tabs.min.js +1 -1
- package/dist/plugins/grideditor.tabs.min.js.map +3 -3
- package/docs/plugins.md +10 -2
- package/package.json +1 -1
- package/src/js/grideditor.js +85 -7
- package/src/js/inline-style/catalog.js +1 -1
- package/src/js/plugins/grideditor.carousel.js +9 -2
- package/src/js/plugins/grideditor.clipboard.js +1 -1
- package/src/js/plugins/grideditor.inline-style.js +3 -0
- package/src/js/plugins/grideditor.offcanvas.js +8 -1
- package/src/js/plugins/grideditor.sections.js +1 -1
- package/src/js/plugins/grideditor.tabs.js +8 -1
|
@@ -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.clipboard.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 // 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 * Copy and paste for grid-editor.\n *\n * A feature plugin: load this file after the editor and every row, column,\n * section, text block, container and element gets a copy tool, and every\n * place one of them can go gets a paste tool while there is something copied\n * that fits.\n * What it can ask the editor for is the handle its factory is called with,\n * described in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.clipboard.min.js\"></script>\n *\n * What is copied is kept in localStorage, so it survives a reload and can be\n * pasted in another tab or another editor of the same site. A browser that\n * will not give the page its storage keeps it in memory, for this page only.\n *\n * Cut is a copy and a removal in one: its tool in the same drawers, and Ctrl+X.\n * It never asks, and is all or nothing: a before-delete that turns the\n * removal away leaves the clipboard as it was. The target goes to what held\n * the node, so a paste right after puts it back.\n *\n * A paste is an add like any other - before-add-* and after-add-*, with\n * `source: 'paste'` - so a host can turn one away.\n *\n * With active_target (which the sidebar turns on), Ctrl+C copies the target,\n * Ctrl+X cuts it and Ctrl+V pastes into it, as the toolbar adds to it.\n * `clipboard: { shortcuts: false }` turns them off. They go through the same\n * store as the tools, never the system clipboard.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'tool.copy': 'Copy',\n 'tool.cut': 'Cut',\n 'tool.paste': 'Paste',\n 'clipboard.paste_row': 'Paste row',\n 'clipboard.paste_section': 'Paste section',\n});\n\nvar STORAGE_ITEM = 'grideditor.clipboard';\nvar CHANGE = 'grideditor-clipboard';\nvar VERSION = 1;\n\n/** Where nothing can be stored, what was copied lives here, for this page. */\nvar memory = null;\n\n/**\n * What each drawer takes when something is pasted into it, by the kind of the\n * node the drawer belongs to. A category is what was copied: a row, a column,\n * a section, a text block, a container of any type, an element.\n */\nvar TARGETS = {\n column: ['row', 'text', 'container', 'element'],\n row: ['column'],\n section: ['row'],\n};\n\nfunction read() {\n var raw;\n\n try {\n raw = window.localStorage.getItem(STORAGE_ITEM);\n } catch (error) {\n return memory;\n }\n if (raw === null) { return memory; }\n\n try {\n var clip = JSON.parse(raw);\n return clip && clip.version === VERSION && clip.html ? clip : null;\n } catch (error) {\n return null;\n }\n}\n\nfunction write(clip) {\n try {\n window.localStorage.setItem(STORAGE_ITEM, JSON.stringify(clip));\n memory = null;\n } catch (error) {\n memory = clip;\n }\n\n announce();\n}\n\n/** Every editor on the page looks at the clipboard again. */\nfunction announce() {\n document.dispatchEvent(new CustomEvent(CHANGE));\n}\n\n// Another tab copied something: every editor here looks again\nwindow.addEventListener('storage', function(e) {\n if (e.key === STORAGE_ITEM) { announce(); }\n});\n\n/** The editors listening for the shortcuts, and the one used last, which a key press goes to. */\nvar listeningEditors = [];\nvar lastEditor = null;\n\nfunction track(e) {\n lastEditor = listeningEditors.filter(function(ge) { return ge.contains(e.target); })[0] || null;\n}\n\n// Captured: a control that stops the event still counts as using its editor\ndocument.addEventListener('pointerdown', track, true);\ndocument.addEventListener('focusin', track, true);\n\n/** 'c', 'x', 'v' or null, from the letter typed or, on a layout without Latin letters, the key's place. */\nfunction shortcutKey(e) {\n var key = (e.key || '').toLowerCase();\n if (!/^[a-z]$/.test(key)) { key = { KeyC: 'c', KeyX: 'x', KeyV: 'v' }[e.code] || ''; }\n\n return key === 'c' || key === 'x' || key === 'v' ? key : null;\n}\n\nfunction typing() {\n var focus = document.activeElement;\n return !!focus && (dom.is(focus, 'input, textarea, select') || focus.isContentEditable);\n}\n\nfunction textSelected() {\n var selection = window.getSelection ? window.getSelection() : null;\n return !!selection && !selection.isCollapsed && selection.toString() !== '';\n}\n\nGridEditor.features.clipboard = function(ge) {\n\n var shown = null; // What the toolbar's paste buttons stand for\n var listening = false; // Whether refresh is on the document's change event\n var shortcuts = shortcutsSetting();\n\n function used(name) {\n return !ge.settings.plugins || ge.settings.plugins.indexOf(name) !== -1;\n }\n\n /** A category this editor can take: the plugin that makes it is here. */\n function available(clip) {\n if (clip.category === 'container') {\n return !!GridEditor.containers[clip.kind] && used(clip.kind);\n }\n if (clip.category === 'section') { return !!GridEditor.features.sections && used('sections'); }\n if (clip.category === 'element') { return !!GridEditor.features.elements && used('elements'); }\n\n return true;\n }\n\n function fits(clip, categories) {\n return !!clip && categories.indexOf(clip.category) !== -1 && available(clip);\n }\n\n function categoryOf(kind) {\n if (GridEditor.containers[kind]) { return 'container'; }\n\n return ['row', 'column', 'section', 'text', 'element'].indexOf(kind) !== -1 ? kind : null;\n }\n\n /** On, unless the host said otherwise: with no target there is nothing for a key to act on. */\n function shortcutsSetting() {\n var wanted = (ge.settings.clipboard || {}).shortcuts;\n var target = !!ge.settings.active_target;\n\n if (wanted !== undefined && typeof wanted !== 'boolean') {\n ge.warn('clipboard.shortcuts is true or false: ' + (target ? 'on' : 'off') + ', as with active_target, is used');\n wanted = undefined;\n }\n if (wanted === undefined) { return target; }\n if (wanted && !target) {\n ge.warn('clipboard.shortcuts needs active_target, or settings_panel \"sidebar\": without it, Ctrl+C, Ctrl+X and Ctrl+V do nothing');\n return false;\n }\n\n return wanted;\n }\n\n /** What is copied, kept, and said: by a copy, or by a cut on its way to removing the node. */\n function keep(node, kind, source, removing) {\n write({ version: VERSION, category: categoryOf(kind), kind: kind, html: ge.nodeHtml(node) });\n ge.emit('after-copy', ge.payloadFor(kind, node, { source: source || 'tool', cut: removing }));\n }\n\n function copy(node, kind, source) {\n keep(node, kind, source, false);\n\n // The canvas came back with new drawers: the one to flash is the\n // node's new copy tool\n var tool = dom.child(ge.drawerOf(node), '.ge-copy');\n if (!tool) { return; }\n\n var icon = dom.one(tool, 'i');\n dom.addClass(tool, 'ge-copied');\n if (icon) { icon.setAttribute('class', 'bi bi-check2'); }\n setTimeout(function() {\n dom.removeClass(tool, 'ge-copied');\n if (icon) { icon.setAttribute('class', 'bi bi-copy'); }\n }, 1200);\n }\n\n /**\n * Copy the node and remove it, as its delete tool does but without the\n * question: all or nothing, so a before-delete that turns it away leaves\n * the clipboard as it was. The target, if it was this node or in it, goes\n * to what held it before the node leaves, so a paste right after goes\n * there.\n */\n function cut(node, kind, source) {\n return ge.removeNode(node, {\n source: 'cut',\n confirm: false,\n before: function() {\n keep(node, kind, source, true);\n\n var target = ge.getActiveTarget();\n if (source !== 'tool' && !(target && node.contains(target))) { return; }\n\n var parent = node.parentElement;\n while (parent && parent !== ge.canvas && !ge.detailsOf(parent)) { parent = parent.parentElement; }\n ge.setActiveTarget(parent && parent !== ge.canvas ? parent : null);\n },\n });\n }\n\n function paste(target, categories) {\n var clip = read();\n if (!fits(clip, categories)) { return; }\n\n ge.place(ge.freshNode(clip.html), clip.kind, { appendTo: target, source: 'paste' });\n }\n\n /**\n * Ctrl+V: into the target, where the toolbar would add it - at the end\n * of what the target holds, in the row or column it lacks, a section on\n * the canvas after the block the target is in. What the target cannot\n * take is not pasted anywhere else.\n */\n function pasteByShortcut() {\n var clip = read();\n if (!clip || !ge.getActiveTarget() || !available(clip)) { return false; }\n\n var made = ge.placeInTarget(ge.freshNode(clip.html), clip.kind, 'paste');\n if (made && made.scrollIntoView) { made.scrollIntoView({ behavior: 'smooth' }); }\n\n return true;\n }\n\n function copyByShortcut() {\n if (textSelected()) { return false; }\n\n var node = ge.getActiveTarget();\n var kind = node && ge.kindOf(node);\n if (!kind || !categoryOf(kind)) { return false; }\n\n copy(node, kind, 'shortcut');\n return true;\n }\n\n function cutByShortcut() {\n if (textSelected()) { return false; }\n\n var node = ge.getActiveTarget();\n var kind = node && ge.kindOf(node);\n if (!kind || !categoryOf(kind)) { return false; }\n\n return cut(node, kind, 'shortcut');\n }\n\n function onKeydown(e) {\n if (lastEditor !== ge || e.repeat || e.shiftKey || e.altKey || !(e.ctrlKey || e.metaKey)) { return; }\n var key = shortcutKey(e);\n if (!key || !dom.hasClass(ge.canvas, 'ge-editing') || typing() || ge.panelOpen()) { return; }\n\n // Left alone, it is the browser's: a copy of the text, a paste in a field\n var acted = { c: copyByShortcut, x: cutByShortcut, v: pasteByShortcut }[key]();\n if (acted) { e.preventDefault(); }\n }\n\n function listenForShortcuts(on) {\n var at = listeningEditors.indexOf(ge);\n\n if (on && at === -1) {\n listeningEditors.push(ge);\n document.addEventListener('keydown', onKeydown);\n } else if (!on && at !== -1) {\n listeningEditors.splice(at, 1);\n document.removeEventListener('keydown', onKeydown);\n }\n }\n\n /** Show the paste tools, and the toolbar's paste buttons, that fit what is copied. */\n function refresh() {\n var clip = read();\n\n dom.all(ge.canvas, '.ge-paste').forEach(function(tool) {\n dom.toggle(tool, fits(clip, tool.getAttribute('data-ge-paste').split(' ')));\n });\n\n ge.toolbarItems('clipboard').forEach(function(button) {\n var item = TOOLBAR[parseInt(button.getAttribute('data-ge-item'), 10)];\n dom.toggle(button, fits(clip, [item.kind]));\n });\n\n shown = clip;\n }\n\n var TOOLBAR = [\n { kind: 'row', labelKey: 'clipboard.paste_row' },\n { kind: 'section', labelKey: 'clipboard.paste_section' },\n ].map(function(item) {\n return Object.assign(item, {\n iconClass: 'bi bi-clipboard-plus',\n // On the right, as an icon: pasting is not one of the things\n // the add buttons make\n align: 'end',\n source: 'paste',\n // A toolbar built again - another plugin's buttons changed -\n // shows only what fits, as refresh would\n hidden: function() { return !fits(read(), [item.kind]); },\n // What the button showed, even if another tab has copied\n // something else since\n create: function() { return ge.freshNode(shown.html); },\n });\n });\n\n return {\n drawerTools: function(drawer, node, kind) {\n if (categoryOf(kind)) {\n ge.createTool(drawer, ge.t('tool.copy'), 'ge-copy', 'bi bi-copy', function() {\n copy(node, kind);\n });\n ge.createTool(drawer, ge.t('tool.cut'), 'ge-cut', 'bi bi-scissors', function(e) {\n // The click that picks the node it is in would pick it as\n // the target again, after it has gone to what held it\n e.stopPropagation();\n cut(node, kind, 'tool');\n });\n }\n\n var categories = TARGETS[kind];\n if (!categories) { return; }\n\n var tool = ge.createTool(drawer, ge.t('tool.paste'), 'ge-paste', 'bi bi-clipboard-plus', function() {\n paste(node, categories);\n });\n tool.setAttribute('data-ge-paste', categories.join(' '));\n dom.toggle(tool, fits(read(), categories));\n },\n\n toolbar: TOOLBAR,\n\n onInit: function() {\n refresh();\n if (!listening) {\n document.addEventListener(CHANGE, refresh);\n listening = true;\n }\n listenForShortcuts(shortcuts);\n },\n\n onDeinit: function() {\n document.removeEventListener(CHANGE, refresh);\n listening = false;\n // A copy takes the canvas out of editing and back: the editor\n // stays the one used last, as it is still\n listenForShortcuts(false);\n },\n\n onDestroy: function() {\n if (lastEditor === ge) { lastEditor = null; }\n },\n\n // Nothing of its own on the canvas: the tools are in the drawers\n cleanMarkup: function() {},\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,CAYO,SAASE,EAASC,EAAMC,EAAU,CACrC,OAAKD,EAEE,MAAM,UAAU,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EACrD,WAAW,UAAW,CACdG,EAAYL,EAAM,WAAW,EAC7BE,GAAQA,EAAK,aAAa,QAAS,YAAY,CACvD,EAAG,IAAI,EACX,CASA,SAASI,EAAIV,EAAMJ,EAAMK,EAAQ,CAC7B,OAAOvB,EAAG,WAAWsB,EAAM,CACvB,OAAQ,MACR,QAAS,GACT,OAAQ,UAAW,CACfD,EAAKC,EAAMJ,EAAMK,EAAQ,EAAI,EAE7B,IAAIH,EAASpB,EAAG,gBAAgB,EAChC,GAAI,EAAAuB,IAAW,QAAU,EAAEH,GAAUE,EAAK,SAASF,CAAM,IAGzD,SADIa,EAASX,EAAK,cACXW,GAAUA,IAAWjC,EAAG,QAAU,CAACA,EAAG,UAAUiC,
|
|
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 * Copy and paste for grid-editor.\n *\n * A feature plugin: load this file after the editor and every row, column,\n * section, text block, container and element gets a copy tool, and every\n * place one of them can go gets a paste tool while there is something copied\n * that fits.\n * What it can ask the editor for is the handle its factory is called with,\n * described in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.clipboard.min.js\"></script>\n *\n * What is copied is kept in localStorage, so it survives a reload and can be\n * pasted in another tab or another editor of the same site. A browser that\n * will not give the page its storage keeps it in memory, for this page only.\n *\n * Cut is a copy and a removal in one: its tool in the same drawers, and Ctrl+X.\n * It never asks, and is all or nothing: a before-delete that turns the\n * removal away leaves the clipboard as it was. The target goes to what held\n * the node, so a paste right after puts it back.\n *\n * A paste is an add like any other - before-add-* and after-add-*, with\n * `source: 'paste'` - so a host can turn one away.\n *\n * With active_target (which the sidebar turns on), Ctrl+C copies the target,\n * Ctrl+X cuts it and Ctrl+V pastes into it, as the toolbar adds to it.\n * `clipboard: { shortcuts: false }` turns them off. They go through the same\n * store as the tools, never the system clipboard.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'tool.copy': 'Copy',\n 'tool.cut': 'Cut',\n 'tool.paste': 'Paste',\n 'clipboard.paste_row': 'Paste row',\n 'clipboard.paste_section': 'Paste section',\n});\n\nvar STORAGE_ITEM = 'grideditor.clipboard';\nvar CHANGE = 'grideditor-clipboard';\nvar VERSION = 1;\n\n/** Where nothing can be stored, what was copied lives here, for this page. */\nvar memory = null;\n\n/**\n * What each drawer takes when something is pasted into it, by the kind of the\n * node the drawer belongs to. A category is what was copied: a row, a column,\n * a section, a text block, a container of any type, an element.\n */\nvar TARGETS = {\n column: ['row', 'text', 'container', 'element'],\n row: ['column'],\n section: ['row'],\n};\n\nfunction read() {\n var raw;\n\n try {\n raw = window.localStorage.getItem(STORAGE_ITEM);\n } catch (error) {\n return memory;\n }\n if (raw === null) { return memory; }\n\n try {\n var clip = JSON.parse(raw);\n return clip && clip.version === VERSION && clip.html ? clip : null;\n } catch (error) {\n return null;\n }\n}\n\nfunction write(clip) {\n try {\n window.localStorage.setItem(STORAGE_ITEM, JSON.stringify(clip));\n memory = null;\n } catch (error) {\n memory = clip;\n }\n\n announce();\n}\n\n/** Every editor on the page looks at the clipboard again. */\nfunction announce() {\n document.dispatchEvent(new CustomEvent(CHANGE));\n}\n\n// Another tab copied something: every editor here looks again\nwindow.addEventListener('storage', function(e) {\n if (e.key === STORAGE_ITEM) { announce(); }\n});\n\n/** The editors listening for the shortcuts, and the one used last, which a key press goes to. */\nvar listeningEditors = [];\nvar lastEditor = null;\n\nfunction track(e) {\n lastEditor = listeningEditors.filter(function(ge) { return ge.contains(e.target); })[0] || null;\n}\n\n// Captured: a control that stops the event still counts as using its editor\ndocument.addEventListener('pointerdown', track, true);\ndocument.addEventListener('focusin', track, true);\n\n/** 'c', 'x', 'v' or null, from the letter typed or, on a layout without Latin letters, the key's place. */\nfunction shortcutKey(e) {\n var key = (e.key || '').toLowerCase();\n if (!/^[a-z]$/.test(key)) { key = { KeyC: 'c', KeyX: 'x', KeyV: 'v' }[e.code] || ''; }\n\n return key === 'c' || key === 'x' || key === 'v' ? key : null;\n}\n\nfunction typing() {\n var focus = document.activeElement;\n return !!focus && (dom.is(focus, 'input, textarea, select') || focus.isContentEditable);\n}\n\nfunction textSelected() {\n var selection = window.getSelection ? window.getSelection() : null;\n return !!selection && !selection.isCollapsed && selection.toString() !== '';\n}\n\nGridEditor.features.clipboard = function(ge) {\n\n var shown = null; // What the toolbar's paste buttons stand for\n var listening = false; // Whether refresh is on the document's change event\n var shortcuts = shortcutsSetting();\n\n function used(name) {\n return !ge.settings.plugins || ge.settings.plugins.indexOf(name) !== -1;\n }\n\n /** A category this editor can take: the plugin that makes it is here. */\n function available(clip) {\n if (clip.category === 'container') {\n return !!GridEditor.containers[clip.kind] && used(clip.kind);\n }\n if (clip.category === 'section') { return !!GridEditor.features.sections && used('sections'); }\n if (clip.category === 'element') { return !!GridEditor.features.elements && used('elements'); }\n\n return true;\n }\n\n function fits(clip, categories) {\n return !!clip && categories.indexOf(clip.category) !== -1 && available(clip);\n }\n\n function categoryOf(kind) {\n if (GridEditor.containers[kind]) { return 'container'; }\n\n return ['row', 'column', 'section', 'text', 'element'].indexOf(kind) !== -1 ? kind : null;\n }\n\n /** On, unless the host said otherwise: with no target there is nothing for a key to act on. */\n function shortcutsSetting() {\n var wanted = (ge.settings.clipboard || {}).shortcuts;\n var target = !!ge.settings.active_target;\n\n if (wanted !== undefined && typeof wanted !== 'boolean') {\n ge.warn('clipboard.shortcuts is true or false: ' + (target ? 'on' : 'off') + ', as with active_target, is used');\n wanted = undefined;\n }\n if (wanted === undefined) { return target; }\n if (wanted && !target) {\n ge.warn('clipboard.shortcuts needs active_target, or settings_panel \"sidebar\": without it, Ctrl+C, Ctrl+X and Ctrl+V do nothing');\n return false;\n }\n\n return wanted;\n }\n\n /** What is copied, kept, and said: by a copy, or by a cut on its way to removing the node. */\n function keep(node, kind, source, removing) {\n write({ version: VERSION, category: categoryOf(kind), kind: kind, html: ge.nodeHtml(node) });\n ge.emit('after-copy', ge.payloadFor(kind, node, { source: source || 'tool', cut: removing }));\n }\n\n function copy(node, kind, source) {\n keep(node, kind, source, false);\n\n // The canvas came back with new drawers: the one to flash is the\n // node's new copy tool\n var tool = dom.child(ge.drawerOf(node), '.ge-copy');\n if (!tool) { return; }\n\n var icon = dom.one(tool, 'i');\n dom.addClass(tool, 'ge-copied');\n if (icon) { icon.setAttribute('class', 'bi bi-check2'); }\n setTimeout(function() {\n dom.removeClass(tool, 'ge-copied');\n if (icon) { icon.setAttribute('class', 'bi bi-copy'); }\n }, 1200);\n }\n\n /**\n * Copy the node and remove it, as its delete tool does but without the\n * question: all or nothing, so a before-delete that turns it away leaves\n * the clipboard as it was. The target, if it was this node or in it, goes\n * to what held it before the node leaves, so a paste right after goes\n * there.\n */\n function cut(node, kind, source) {\n return ge.removeNode(node, {\n source: 'cut',\n confirm: false,\n before: function() {\n keep(node, kind, source, true);\n\n var target = ge.getActiveTarget();\n if (source !== 'tool' && !(target && node.contains(target))) { return; }\n\n var parent = node.parentElement;\n while (parent && parent !== ge.canvas && !ge.detailsOf(parent, { build: false })) { parent = parent.parentElement; }\n ge.setActiveTarget(parent && parent !== ge.canvas ? parent : null);\n },\n });\n }\n\n function paste(target, categories) {\n var clip = read();\n if (!fits(clip, categories)) { return; }\n\n ge.place(ge.freshNode(clip.html), clip.kind, { appendTo: target, source: 'paste' });\n }\n\n /**\n * Ctrl+V: into the target, where the toolbar would add it - at the end\n * of what the target holds, in the row or column it lacks, a section on\n * the canvas after the block the target is in. What the target cannot\n * take is not pasted anywhere else.\n */\n function pasteByShortcut() {\n var clip = read();\n if (!clip || !ge.getActiveTarget() || !available(clip)) { return false; }\n\n var made = ge.placeInTarget(ge.freshNode(clip.html), clip.kind, 'paste');\n if (made && made.scrollIntoView) { made.scrollIntoView({ behavior: 'smooth' }); }\n\n return true;\n }\n\n function copyByShortcut() {\n if (textSelected()) { return false; }\n\n var node = ge.getActiveTarget();\n var kind = node && ge.kindOf(node);\n if (!kind || !categoryOf(kind)) { return false; }\n\n copy(node, kind, 'shortcut');\n return true;\n }\n\n function cutByShortcut() {\n if (textSelected()) { return false; }\n\n var node = ge.getActiveTarget();\n var kind = node && ge.kindOf(node);\n if (!kind || !categoryOf(kind)) { return false; }\n\n return cut(node, kind, 'shortcut');\n }\n\n function onKeydown(e) {\n if (lastEditor !== ge || e.repeat || e.shiftKey || e.altKey || !(e.ctrlKey || e.metaKey)) { return; }\n var key = shortcutKey(e);\n if (!key || !dom.hasClass(ge.canvas, 'ge-editing') || typing() || ge.panelOpen()) { return; }\n\n // Left alone, it is the browser's: a copy of the text, a paste in a field\n var acted = { c: copyByShortcut, x: cutByShortcut, v: pasteByShortcut }[key]();\n if (acted) { e.preventDefault(); }\n }\n\n function listenForShortcuts(on) {\n var at = listeningEditors.indexOf(ge);\n\n if (on && at === -1) {\n listeningEditors.push(ge);\n document.addEventListener('keydown', onKeydown);\n } else if (!on && at !== -1) {\n listeningEditors.splice(at, 1);\n document.removeEventListener('keydown', onKeydown);\n }\n }\n\n /** Show the paste tools, and the toolbar's paste buttons, that fit what is copied. */\n function refresh() {\n var clip = read();\n\n dom.all(ge.canvas, '.ge-paste').forEach(function(tool) {\n dom.toggle(tool, fits(clip, tool.getAttribute('data-ge-paste').split(' ')));\n });\n\n ge.toolbarItems('clipboard').forEach(function(button) {\n var item = TOOLBAR[parseInt(button.getAttribute('data-ge-item'), 10)];\n dom.toggle(button, fits(clip, [item.kind]));\n });\n\n shown = clip;\n }\n\n var TOOLBAR = [\n { kind: 'row', labelKey: 'clipboard.paste_row' },\n { kind: 'section', labelKey: 'clipboard.paste_section' },\n ].map(function(item) {\n return Object.assign(item, {\n iconClass: 'bi bi-clipboard-plus',\n // On the right, as an icon: pasting is not one of the things\n // the add buttons make\n align: 'end',\n source: 'paste',\n // A toolbar built again - another plugin's buttons changed -\n // shows only what fits, as refresh would\n hidden: function() { return !fits(read(), [item.kind]); },\n // What the button showed, even if another tab has copied\n // something else since\n create: function() { return ge.freshNode(shown.html); },\n });\n });\n\n return {\n drawerTools: function(drawer, node, kind) {\n if (categoryOf(kind)) {\n ge.createTool(drawer, ge.t('tool.copy'), 'ge-copy', 'bi bi-copy', function() {\n copy(node, kind);\n });\n ge.createTool(drawer, ge.t('tool.cut'), 'ge-cut', 'bi bi-scissors', function(e) {\n // The click that picks the node it is in would pick it as\n // the target again, after it has gone to what held it\n e.stopPropagation();\n cut(node, kind, 'tool');\n });\n }\n\n var categories = TARGETS[kind];\n if (!categories) { return; }\n\n var tool = ge.createTool(drawer, ge.t('tool.paste'), 'ge-paste', 'bi bi-clipboard-plus', function() {\n paste(node, categories);\n });\n tool.setAttribute('data-ge-paste', categories.join(' '));\n dom.toggle(tool, fits(read(), categories));\n },\n\n toolbar: TOOLBAR,\n\n onInit: function() {\n refresh();\n if (!listening) {\n document.addEventListener(CHANGE, refresh);\n listening = true;\n }\n listenForShortcuts(shortcuts);\n },\n\n onDeinit: function() {\n document.removeEventListener(CHANGE, refresh);\n listening = false;\n // A copy takes the canvas out of editing and back: the editor\n // stays the one used last, as it is still\n listenForShortcuts(false);\n },\n\n onDestroy: function() {\n if (lastEditor === ge) { lastEditor = null; }\n },\n\n // Nothing of its own on the canvas: the tools are in the drawers\n cleanMarkup: function() {},\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,CAA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CAC1B,CAAC,EACDU,EAAK,aAAa,gBAAiBV,EAAW,KAAK,GAAG,CAAC,EACnD+B,EAAOrB,EAAMX,EAAKzB,EAAK,EAAG0B,CAAU,CAAC,EAC7C,EAEA,QAASkC,EAET,OAAQ,UAAW,CACfL,EAAQ,EACHpC,IACD,SAAS,iBAAiBvB,EAAQ2D,CAAO,EACzCpC,EAAY,IAEhBiC,EAAmBhC,CAAS,CAChC,EAEA,SAAU,UAAW,CACjB,SAAS,oBAAoBxB,EAAQ2D,CAAO,EAC5CpC,EAAY,GAGZiC,EAAmB,EAAK,CAC5B,EAEA,UAAW,UAAW,CACd5C,IAAeE,IAAMF,EAAa,KAC1C,EAGA,YAAa,UAAW,CAAC,CAC7B,CACJ",
|
|
6
6
|
"names": ["GridEditor", "all", "root", "selector", "one", "children", "node", "selector", "each", "child", "is", "node", "selector", "addClass", "node", "names", "split", "name", "removeClass", "hasClass", "node", "name", "split", "names", "defaultDisplays", "defaultDisplay", "node", "tag", "probe", "show", "hide", "toggle", "state", "visible", "GridEditor", "STORAGE_ITEM", "CHANGE", "VERSION", "memory", "TARGETS", "read", "raw", "error", "clip", "write", "announce", "e", "listeningEditors", "lastEditor", "track", "ge", "shortcutKey", "key", "typing", "focus", "is", "textSelected", "selection", "shown", "listening", "shortcuts", "shortcutsSetting", "used", "name", "available", "fits", "categories", "categoryOf", "kind", "wanted", "target", "keep", "node", "source", "removing", "copy", "tool", "child", "icon", "one", "addClass", "removeClass", "cut", "parent", "paste", "pasteByShortcut", "made", "copyByShortcut", "cutByShortcut", "onKeydown", "hasClass", "acted", "listenForShortcuts", "on", "at", "refresh", "all", "toggle", "button", "item", "TOOLBAR", "drawer"]
|
|
7
7
|
}
|
|
@@ -1593,7 +1593,7 @@ function classesOf2(node) {
|
|
|
1593
1593
|
return (node.getAttribute("class") || "").split(/\s+/).filter(Boolean);
|
|
1594
1594
|
}
|
|
1595
1595
|
function choose(ge, node, group2, name) {
|
|
1596
|
-
var details = ge.detailsOf(node);
|
|
1596
|
+
var details = ge.detailsOf(node, { build: false });
|
|
1597
1597
|
var input = details ? one(details, ".ge-classes") : null;
|
|
1598
1598
|
if (!input) {
|
|
1599
1599
|
return;
|
|
@@ -1973,6 +1973,9 @@ GridEditor7.utilities["inline-style"] = function(ge) {
|
|
|
1973
1973
|
if (!accordion) {
|
|
1974
1974
|
return null;
|
|
1975
1975
|
}
|
|
1976
|
+
accordions = accordions.filter(function(entry) {
|
|
1977
|
+
return entry.accordion.element.isConnected;
|
|
1978
|
+
});
|
|
1976
1979
|
accordions.push({ node, accordion });
|
|
1977
1980
|
return { labelKey: "inline_style.section_title", titleKey: "inline_style.dialog_title", body: accordion.element };
|
|
1978
1981
|
},
|
|
@@ -1589,7 +1589,7 @@
|
|
|
1589
1589
|
return (node.getAttribute("class") || "").split(/\s+/).filter(Boolean);
|
|
1590
1590
|
}
|
|
1591
1591
|
function choose(ge, node, group2, name) {
|
|
1592
|
-
var details = ge.detailsOf(node);
|
|
1592
|
+
var details = ge.detailsOf(node, { build: false });
|
|
1593
1593
|
var input = details ? one(details, ".ge-classes") : null;
|
|
1594
1594
|
if (!input) {
|
|
1595
1595
|
return;
|
|
@@ -1969,6 +1969,9 @@
|
|
|
1969
1969
|
if (!accordion) {
|
|
1970
1970
|
return null;
|
|
1971
1971
|
}
|
|
1972
|
+
accordions = accordions.filter(function(entry) {
|
|
1973
|
+
return entry.accordion.element.isConnected;
|
|
1974
|
+
});
|
|
1972
1975
|
accordions.push({ node, accordion });
|
|
1973
1976
|
return { labelKey: "inline_style.section_title", titleKey: "inline_style.dialog_title", body: accordion.element };
|
|
1974
1977
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var T=window.GridEditor;if(!T||typeof T.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function P(e,t){return e?Array.prototype.slice.call(e.querySelectorAll(t)):[]}function M(e,t){return e?e.querySelector(t):null}function I(e,t){if(!e)return[];var n=P(e,t);return e.nodeType===1&&e.matches(t)&&n.unshift(e),n}function J(e,t){return e?Array.prototype.filter.call(e.children,function(n){return!t||n.matches(t)}):[]}function j(e,t){return J(e,t)[0]||null}function D(e,t){return!!e&&e.nodeType===1&&e.matches(t)}function y(e,t,n){var i=document.createElement(e);return Object.keys(t||{}).forEach(function(a){var l=t[a];l!=null&&l!==!1&&i.setAttribute(a,l)}),n!=null&&(i.textContent=n),i}function Z(e,t){return oe(t).forEach(function(n){e.classList.add(n)}),e}function z(e,t){return oe(t).forEach(function(n){e.classList.remove(n)}),e}function B(e,t,n){return oe(t).forEach(function(i){n===void 0?e.classList.toggle(i):e.classList.toggle(i,!!n)}),e}function R(e,t){return!!e&&e.nodeType===1&&e.classList.contains(t)}function oe(e){return String(e||"").split(/\s+/).filter(Boolean)}function W(e){return e.getAttribute("class")||e.removeAttribute("class"),e}function ae(e,t){return Object.keys(t).forEach(function(n){var i=t[n];typeof i=="number"&&!Xe[n]&&(i=i+"px"),e.style.setProperty(n,i==null?"":String(i))}),e}var Xe={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},V={};function Ye(e){var t=e.nodeName;if(!V[t]){var n=document.body.appendChild(document.createElement(t));V[t]=getComputedStyle(n).display,n.remove(),V[t]==="none"&&(V[t]="block")}return V[t]}function Je(e){return e.style.removeProperty("display"),getComputedStyle(e).display==="none"&&(e.style.display=Ye(e)),e}function Ze(e){return e.style.display="none",e}function F(e,t){return t===void 0&&(t=!Qe(e)),t?Je(e):Ze(e)}function Qe(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}Object.assign(T.locales.en,{"utility.padding":"Padding","utility.margin":"Margin","utility.side_all":"All sides","utility.side_x":"Left and right","utility.side_y":"Top and bottom","utility.side_t":"Top","utility.side_b":"Bottom","utility.side_s":"Start","utility.side_e":"End","utility.spacing_gutter":"A column's side padding is its gutter: changing it changes the gutter"});var q=["0","1","2","3","4","5"],et=["0",".25rem",".5rem","1rem","1.5rem","3rem"],Q=["","x","y","t","e","b","s"],tt={"":["top","right","bottom","left"],x:["left","right"],y:["top","bottom"],t:["top"],e:["right"],b:["bottom"],s:["left"]},he=["","sm","md","lg","xl","xxl"],se={p:"padding",m:"margin"};function ve(e){return new RegExp("^"+e+"[xytbse]?-(?:(?:sm|md|lg|xl|xxl)-)?(?:[0-5]|auto)$")}function be(e,t){var n=Object.assign({values:q,scale:et},t),i={p:ve("p"),m:ve("m")};function a(r,o){return o==="row"||o==="column"||o==="element"||D(r,"[data-ge-container]")}function l(r){return(r.getAttribute("class")||"").split(/\s+/)}function p(r,o){return l(r).some(function(s){return i[o].test(s)})}function u(r,o,s){for(var b=l(r),x=o.charAt(0)==="m"?q.concat(["auto"]):q,_=s;_>=0;_--)for(var C=0;C<x.length;C++){var O=o+(he[_]?"-"+he[_]:"")+"-"+x[C];if(b.indexOf(O)!==-1)return{tier:_,value:x[C]}}return null}function c(r,o){var s=r.getAttribute("class"),b,x={};return r.setAttribute("class",l(r).filter(function(_){return!i[o].test(_)}).join(" ")),b=getComputedStyle(r),["top","right","bottom","left"].forEach(function(_){x[_]=b.getPropertyValue(se[o]+"-"+_)}),s===null?r.removeAttribute("class"):r.setAttribute("class",s),x}function m(r,o,s){var b=e.breakpoints.indexOf(s),x={},_={},C=null;return Q.forEach(function(O,K){var A=u(r,o+O,b);A&&tt[O].forEach(function(G){var Y=x[G];(!Y||A.tier>Y.tier||A.tier===Y.tier&&K>Y.order)&&(x[G]={tier:A.tier,order:K,value:A.value})})}),["top","right","bottom","left"].forEach(function(O){var K=x[O];K?_[se[o]+"-"+O]=K.value==="auto"?"auto":n.scale[K.value]:(C=C||c(r,o),_[se[o]+"-"+O]=C[O])}),_}function v(r,o){var s=l(r).filter(function(x){return i[o].test(x)}),b=Q.filter(function(x){return s.some(function(_){return _.indexOf(o+x+"-")===0})});return b.length?b[0]:""}function g(r){switch(r){case"x":return e.t("utility.side_x");case"y":return e.t("utility.side_y");case"t":return e.t("utility.side_t");case"b":return e.t("utility.side_b");case"s":return e.t("utility.side_s");case"e":return e.t("utility.side_e");default:return e.t("utility.side_all")}}function f(r,o,s){var b=y("div",{class:"ge-spacing-group","data-ge-spacing":o}),x=y("select",{class:"ge-spacing-side form-select form-select-sm"});b.appendChild(y("span",{class:"ge-utility-label"},s)),Q.forEach(function(C){x.appendChild(y("option",{value:C},g(C)))});var _=e.utilityField(r,o+v(r,o));return x.value=_.getAttribute("data-ge-family").slice(1),x.addEventListener("change",function(){var C=e.utilityField(r,o+this.value);_.replaceWith(C),_=C}),b.appendChild(x),b.appendChild(_),b}var E=".row, .column, .ge-element, [data-ge-container]";function k(r){I(r,E).forEach(function(o){var s=j(o,".ge-tools-drawer");if(!(!s||!a(o,e.kindOf(o)))){if(p(o,"p")){var b=getComputedStyle(o);ae(s,{"margin-top":"-"+b.paddingTop,"margin-left":"-"+b.paddingLeft,"margin-right":"-"+b.paddingRight,width:"calc(100% + "+b.paddingLeft+" + "+b.paddingRight+")"})}else ae(s,{"margin-top":"","margin-left":"","margin-right":"",width:""});if(R(o,"column")){var x=l(o).some(function(_){return/^p[xse]?-/.test(_)&&i.p.test(_)});P(s,".ge-spacing-gutter").forEach(function(_){F(_,x)})}}})}function d(r,o){var s=r==="m"?q.concat(["auto"]):q,b=n.values.concat(r==="m"?["auto"]:[]);return Q.map(function(x){return{name:r+x,prefix:r+x,values:s,appliesTo:["row","column","text","element","container"],labelKey:o,panel:!1,choices:function(){return s.filter(function(_){return b.indexOf(_)!==-1})}}})}return{families:d("p","utility.padding").concat(d("m","utility.margin")),panel:function(r,o){if(!a(r,o))return null;var s=y("div",{class:"ge-spacing"});return s.appendChild(f(r,"p",e.t("utility.padding"))),s.appendChild(f(r,"m",e.t("utility.margin"))),o==="column"&&s.appendChild(y("small",{class:"ge-spacing-gutter"},e.t("utility.spacing_gutter"))),s},preview:function(r,o,s){if(!a(r,o))return{};var b={};return["p","m"].forEach(function(x){p(r,x)&&Object.assign(b,m(r,x,s))}),b},onRefresh:k}}Object.assign(T.locales.en,{"utility.text_align":"Text alignment","utility.text_start":"Start","utility.text_center":"Center","utility.text_end":"End"});var nt={start:"left",center:"center",end:"right"};function _e(e){function t(n){return n==="start"?e.t("utility.text_start"):n==="center"?e.t("utility.text_center"):e.t("utility.text_end")}return{families:[{name:"text-align",prefix:"text",values:["start","center","end"],appliesTo:["row","column","text","element","container"],labelKey:"utility.text_align",label:t,preview:function(n,i){return{"text-align":n===null?e.bareStyle(i,"text-align","text-align"):nt[n]}}}]}}Object.assign(T.locales.en,{"utility.display":"Display","utility.visibility_hidden":"Hidden","tool.hide_in_view":"Hide in this view","tool.show_in_view":"Show in this view","badge.hidden_in":"Hidden at {breakpoints}"});var te=["none","inline","inline-block","block","grid","inline-grid","flex","inline-flex"],it=new RegExp("(?:^|\\s)d-(?:(?:sm|md|lg|xl|xxl)-)?(?:"+te.join("|")+")(?:\\s|$)"),rt=/^d-(?:(?:sm|md|lg|xl|xxl)-)?none$/,lt=".row, .column, .ge-content, .ge-element, [data-ge-container]",ee="data-ge-display";function xe(e,t){var n=Object.assign({drawer:!0},t);function i(d){return d==="row"?["none","flex"]:d==="text"||d==="plain"?["none","block"]:te}function a(d){return d==="row"?"flex":"block"}function l(d,r){return r==="row"||r==="column"||r==="element"||r==="text"||r==="plain"||D(d,"[data-ge-container]")}function p(d,r){return e.getUtility(d,"display",r)==="none"}function u(d){return e.breakpoints.filter(function(r){return p(d,r)})}function c(d){return e.view()==="all"?u(d).length===e.breakpoints.length:p(d,e.view())}function m(d){var r=e.breakpoints.indexOf(e.view());return r>0&&p(d,e.breakpoints[r-1])}function v(d,r){for(var o=e.breakpoints.indexOf(r)-1;o>=0;o--){var s=e.getUtility(d,"display",e.breakpoints[o]);if(s===null)return null;if(s!=="none")return s}return null}function g(d,r){var o=!c(d),s;e.view()==="all"?s=o?"none":null:o?s=m(d)?null:"none":s=m(d)?v(d,e.view())||a(r):null,e.setUtility(d,"display",s,{source:"tool"})}function f(d){var r=d.getAttribute("class");d.setAttribute("class",r.split(/\s+/).filter(function(s){return!rt.test(s)}).join(" "));var o=getComputedStyle(d).display;return d.setAttribute("class",r),o!=="none"&&te.indexOf(o)!==-1?o:"block"}function E(d){I(d,lt).forEach(function(r){var o=e.kindOf(r),s=l(r,o)&&it.test(r.getAttribute("class")||""),b=s?u(r):[],x=s&&c(r),_=s&&e.view()==="all"&&b.length>0&&!x;r.removeAttribute(ee),s&&getComputedStyle(r).display==="none"&&r.setAttribute(ee,f(r)),B(r,"ge-hidden-in-view",x),_?r.setAttribute("data-ge-hidden-in",e.t("badge.hidden_in",{breakpoints:b.join(", ")})):r.removeAttribute("data-ge-hidden-in"),J(r,".ge-tools-drawer").forEach(function(C){J(C,".ge-visibility-tool").forEach(function(O){O.setAttribute("title",x?e.t("tool.show_in_view"):e.t("tool.hide_in_view")),P(O,"i").forEach(function(K){K.setAttribute("class",x?"bi bi-eye-slash":"bi bi-eye")})})})})}function k(d){P(d||e.canvas,".ge-hidden-in-view, [data-ge-hidden-in], ["+ee+"]").forEach(function(r){z(r,"ge-hidden-in-view"),r.removeAttribute("data-ge-hidden-in"),r.removeAttribute(ee),W(r)})}return{families:[{name:"display",prefix:"d",values:te,appliesTo:["row","column","text","element","container"],labelKey:"utility.display",choices:function(d,r){return i(r)},label:function(d){return d==="none"?e.t("utility.visibility_hidden"):d},preview:function(d,r){return d==="none"&&(d=v(r,e.view())),{display:d===null?e.bareStyle(r,"display","display"):d}}}],drawerTools:function(d,r,o){!n.drawer||!l(r,o)||e.createTool(d,e.t("tool.hide_in_view"),"ge-visibility-tool","bi bi-eye",function(){g(r,o)})},onRefresh:E,onDeinit:function(){k()},cleanMarkup:k}}Object.assign(T.locales.en,{"utility.flex_direction":"Direction","utility.flex_wrap":"Wrap","utility.justify_content":"Justify columns","utility.align_items":"Align columns","utility.align_content":"Align lines","utility.gap":"Gap","utility.row_gap":"Row gap","utility.column_gap":"Column gap","utility.flex_fill":"Fill","utility.flex_grow":"Grow","utility.flex_shrink":"Shrink"});var ot={start:"flex-start",end:"flex-end",center:"center",between:"space-between",around:"space-around",evenly:"space-evenly",baseline:"baseline",stretch:"stretch"},at=["0","1","2","3","4","5"],st=["0",".25rem",".5rem","1rem","1.5rem","3rem"],ue=["row","column","element","container"],ne=["column","element","container"];function we(e,t){var n=t&&t.scale||st;function i(u){var c=u.property||u.name;return Object.assign({prefix:u.name,panel:!1,preview:function(m,v){var g={};return g[c]=m===null?e.bareStyle(v,u.name,c):u.css(m),g}},u)}function a(u){return i(Object.assign({appliesTo:ue,preview:function(c){var m={};return m[u.name]=c===null?"normal":ot[c],m}},u))}function l(u){return i(Object.assign({values:at,appliesTo:ne,css:function(c){return n[c]}},u))}function p(u){return u}return{families:[i({name:"flex-direction",prefix:"flex",labelKey:"utility.flex_direction",values:["row","row-reverse","column","column-reverse"],appliesTo:ue,css:p}),i({name:"flex-wrap",prefix:"flex",labelKey:"utility.flex_wrap",values:["wrap","nowrap","wrap-reverse"],appliesTo:ue,css:p}),a({name:"justify-content",labelKey:"utility.justify_content",values:["start","center","end","between","around","evenly"]}),a({name:"align-items",labelKey:"utility.align_items",values:["start","center","end","baseline","stretch"]}),a({name:"align-content",labelKey:"utility.align_content",values:["start","center","end","between","around","stretch"]}),l({name:"gap",labelKey:"utility.gap"}),l({name:"row-gap",labelKey:"utility.row_gap"}),l({name:"column-gap",labelKey:"utility.column_gap"}),i({name:"flex-fill",prefix:"flex",property:"flex",labelKey:"utility.flex_fill",values:["fill"],appliesTo:ne,css:function(){return"1 1 auto"}}),i({name:"flex-grow",prefix:"flex",labelKey:"utility.flex_grow",values:["grow-0","grow-1"],appliesTo:ne,css:function(u){return u.slice(-1)}}),i({name:"flex-shrink",prefix:"flex",labelKey:"utility.flex_shrink",values:["shrink-0","shrink-1"],appliesTo:ne,css:function(u){return u.slice(-1)}})]}}Object.assign(T.locales.en,{"utility.float":"Float","utility.float_start":"Start","utility.float_end":"End","utility.float_none":"None"});var ut={start:"left",end:"right",none:"none"};function Ee(e){function t(n){return n==="start"?e.t("utility.float_start"):n==="end"?e.t("utility.float_end"):e.t("utility.float_none")}return{families:[{name:"float",prefix:"float",values:["start","end","none"],appliesTo:["element"],labelKey:"utility.float",label:t,preview:function(n,i){return{float:n===null?e.bareStyle(i,"float","float"):ut[n]}}}]}}Object.assign(T.locales.en,{"utility.sticky":"Sticky"});var ct={top:{position:"sticky",top:"0","z-index":"1020"},bottom:{position:"sticky",bottom:"0","z-index":"1020"}};function Ce(e){return{families:[{name:"sticky",prefix:"sticky",values:["top","bottom"],appliesTo:["row","column","element","container"],labelKey:"utility.sticky",panel:!1,preview:function(t,n){return t!==null?ct[t]:{position:e.bareStyle(n,"sticky","position")}}}]}}var pt=".row, .column, .ge-element, [data-ge-container]",U="ge-drawer-out",ie="data-ge-drawer-out",dt=5,ft=/^(?:inline-)?(?:flex|grid)$/;function Se(e){var t=null,n={},i=null;function a(g){if(!n[g]){n[g]=!0,t||(t=document.head.appendChild(y("style",{"data-ge-drawer-flow":""})));var f=".ge-canvas.ge-editing ["+ie+'="'+g+'"]';t.appendChild(document.createTextNode(f+" { border-top-width: "+g+`px !important; }
|
|
1
|
+
(()=>{var T=window.GridEditor;if(!T||typeof T.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function P(e,t){return e?Array.prototype.slice.call(e.querySelectorAll(t)):[]}function M(e,t){return e?e.querySelector(t):null}function I(e,t){if(!e)return[];var n=P(e,t);return e.nodeType===1&&e.matches(t)&&n.unshift(e),n}function J(e,t){return e?Array.prototype.filter.call(e.children,function(n){return!t||n.matches(t)}):[]}function j(e,t){return J(e,t)[0]||null}function D(e,t){return!!e&&e.nodeType===1&&e.matches(t)}function y(e,t,n){var i=document.createElement(e);return Object.keys(t||{}).forEach(function(a){var l=t[a];l!=null&&l!==!1&&i.setAttribute(a,l)}),n!=null&&(i.textContent=n),i}function Z(e,t){return oe(t).forEach(function(n){e.classList.add(n)}),e}function z(e,t){return oe(t).forEach(function(n){e.classList.remove(n)}),e}function B(e,t,n){return oe(t).forEach(function(i){n===void 0?e.classList.toggle(i):e.classList.toggle(i,!!n)}),e}function R(e,t){return!!e&&e.nodeType===1&&e.classList.contains(t)}function oe(e){return String(e||"").split(/\s+/).filter(Boolean)}function W(e){return e.getAttribute("class")||e.removeAttribute("class"),e}function ae(e,t){return Object.keys(t).forEach(function(n){var i=t[n];typeof i=="number"&&!Xe[n]&&(i=i+"px"),e.style.setProperty(n,i==null?"":String(i))}),e}var Xe={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},V={};function Ye(e){var t=e.nodeName;if(!V[t]){var n=document.body.appendChild(document.createElement(t));V[t]=getComputedStyle(n).display,n.remove(),V[t]==="none"&&(V[t]="block")}return V[t]}function Je(e){return e.style.removeProperty("display"),getComputedStyle(e).display==="none"&&(e.style.display=Ye(e)),e}function Ze(e){return e.style.display="none",e}function F(e,t){return t===void 0&&(t=!Qe(e)),t?Je(e):Ze(e)}function Qe(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}Object.assign(T.locales.en,{"utility.padding":"Padding","utility.margin":"Margin","utility.side_all":"All sides","utility.side_x":"Left and right","utility.side_y":"Top and bottom","utility.side_t":"Top","utility.side_b":"Bottom","utility.side_s":"Start","utility.side_e":"End","utility.spacing_gutter":"A column's side padding is its gutter: changing it changes the gutter"});var q=["0","1","2","3","4","5"],et=["0",".25rem",".5rem","1rem","1.5rem","3rem"],Q=["","x","y","t","e","b","s"],tt={"":["top","right","bottom","left"],x:["left","right"],y:["top","bottom"],t:["top"],e:["right"],b:["bottom"],s:["left"]},he=["","sm","md","lg","xl","xxl"],se={p:"padding",m:"margin"};function ve(e){return new RegExp("^"+e+"[xytbse]?-(?:(?:sm|md|lg|xl|xxl)-)?(?:[0-5]|auto)$")}function be(e,t){var n=Object.assign({values:q,scale:et},t),i={p:ve("p"),m:ve("m")};function a(r,o){return o==="row"||o==="column"||o==="element"||D(r,"[data-ge-container]")}function l(r){return(r.getAttribute("class")||"").split(/\s+/)}function p(r,o){return l(r).some(function(s){return i[o].test(s)})}function u(r,o,s){for(var b=l(r),x=o.charAt(0)==="m"?q.concat(["auto"]):q,_=s;_>=0;_--)for(var C=0;C<x.length;C++){var O=o+(he[_]?"-"+he[_]:"")+"-"+x[C];if(b.indexOf(O)!==-1)return{tier:_,value:x[C]}}return null}function c(r,o){var s=r.getAttribute("class"),b,x={};return r.setAttribute("class",l(r).filter(function(_){return!i[o].test(_)}).join(" ")),b=getComputedStyle(r),["top","right","bottom","left"].forEach(function(_){x[_]=b.getPropertyValue(se[o]+"-"+_)}),s===null?r.removeAttribute("class"):r.setAttribute("class",s),x}function m(r,o,s){var b=e.breakpoints.indexOf(s),x={},_={},C=null;return Q.forEach(function(O,K){var A=u(r,o+O,b);A&&tt[O].forEach(function(G){var Y=x[G];(!Y||A.tier>Y.tier||A.tier===Y.tier&&K>Y.order)&&(x[G]={tier:A.tier,order:K,value:A.value})})}),["top","right","bottom","left"].forEach(function(O){var K=x[O];K?_[se[o]+"-"+O]=K.value==="auto"?"auto":n.scale[K.value]:(C=C||c(r,o),_[se[o]+"-"+O]=C[O])}),_}function h(r,o){var s=l(r).filter(function(x){return i[o].test(x)}),b=Q.filter(function(x){return s.some(function(_){return _.indexOf(o+x+"-")===0})});return b.length?b[0]:""}function g(r){switch(r){case"x":return e.t("utility.side_x");case"y":return e.t("utility.side_y");case"t":return e.t("utility.side_t");case"b":return e.t("utility.side_b");case"s":return e.t("utility.side_s");case"e":return e.t("utility.side_e");default:return e.t("utility.side_all")}}function f(r,o,s){var b=y("div",{class:"ge-spacing-group","data-ge-spacing":o}),x=y("select",{class:"ge-spacing-side form-select form-select-sm"});b.appendChild(y("span",{class:"ge-utility-label"},s)),Q.forEach(function(C){x.appendChild(y("option",{value:C},g(C)))});var _=e.utilityField(r,o+h(r,o));return x.value=_.getAttribute("data-ge-family").slice(1),x.addEventListener("change",function(){var C=e.utilityField(r,o+this.value);_.replaceWith(C),_=C}),b.appendChild(x),b.appendChild(_),b}var E=".row, .column, .ge-element, [data-ge-container]";function k(r){I(r,E).forEach(function(o){var s=j(o,".ge-tools-drawer");if(!(!s||!a(o,e.kindOf(o)))){if(p(o,"p")){var b=getComputedStyle(o);ae(s,{"margin-top":"-"+b.paddingTop,"margin-left":"-"+b.paddingLeft,"margin-right":"-"+b.paddingRight,width:"calc(100% + "+b.paddingLeft+" + "+b.paddingRight+")"})}else ae(s,{"margin-top":"","margin-left":"","margin-right":"",width:""});if(R(o,"column")){var x=l(o).some(function(_){return/^p[xse]?-/.test(_)&&i.p.test(_)});P(s,".ge-spacing-gutter").forEach(function(_){F(_,x)})}}})}function d(r,o){var s=r==="m"?q.concat(["auto"]):q,b=n.values.concat(r==="m"?["auto"]:[]);return Q.map(function(x){return{name:r+x,prefix:r+x,values:s,appliesTo:["row","column","text","element","container"],labelKey:o,panel:!1,choices:function(){return s.filter(function(_){return b.indexOf(_)!==-1})}}})}return{families:d("p","utility.padding").concat(d("m","utility.margin")),panel:function(r,o){if(!a(r,o))return null;var s=y("div",{class:"ge-spacing"});return s.appendChild(f(r,"p",e.t("utility.padding"))),s.appendChild(f(r,"m",e.t("utility.margin"))),o==="column"&&s.appendChild(y("small",{class:"ge-spacing-gutter"},e.t("utility.spacing_gutter"))),s},preview:function(r,o,s){if(!a(r,o))return{};var b={};return["p","m"].forEach(function(x){p(r,x)&&Object.assign(b,m(r,x,s))}),b},onRefresh:k}}Object.assign(T.locales.en,{"utility.text_align":"Text alignment","utility.text_start":"Start","utility.text_center":"Center","utility.text_end":"End"});var nt={start:"left",center:"center",end:"right"};function _e(e){function t(n){return n==="start"?e.t("utility.text_start"):n==="center"?e.t("utility.text_center"):e.t("utility.text_end")}return{families:[{name:"text-align",prefix:"text",values:["start","center","end"],appliesTo:["row","column","text","element","container"],labelKey:"utility.text_align",label:t,preview:function(n,i){return{"text-align":n===null?e.bareStyle(i,"text-align","text-align"):nt[n]}}}]}}Object.assign(T.locales.en,{"utility.display":"Display","utility.visibility_hidden":"Hidden","tool.hide_in_view":"Hide in this view","tool.show_in_view":"Show in this view","badge.hidden_in":"Hidden at {breakpoints}"});var te=["none","inline","inline-block","block","grid","inline-grid","flex","inline-flex"],it=new RegExp("(?:^|\\s)d-(?:(?:sm|md|lg|xl|xxl)-)?(?:"+te.join("|")+")(?:\\s|$)"),rt=/^d-(?:(?:sm|md|lg|xl|xxl)-)?none$/,lt=".row, .column, .ge-content, .ge-element, [data-ge-container]",ee="data-ge-display";function xe(e,t){var n=Object.assign({drawer:!0},t);function i(d){return d==="row"?["none","flex"]:d==="text"||d==="plain"?["none","block"]:te}function a(d){return d==="row"?"flex":"block"}function l(d,r){return r==="row"||r==="column"||r==="element"||r==="text"||r==="plain"||D(d,"[data-ge-container]")}function p(d,r){return e.getUtility(d,"display",r)==="none"}function u(d){return e.breakpoints.filter(function(r){return p(d,r)})}function c(d){return e.view()==="all"?u(d).length===e.breakpoints.length:p(d,e.view())}function m(d){var r=e.breakpoints.indexOf(e.view());return r>0&&p(d,e.breakpoints[r-1])}function h(d,r){for(var o=e.breakpoints.indexOf(r)-1;o>=0;o--){var s=e.getUtility(d,"display",e.breakpoints[o]);if(s===null)return null;if(s!=="none")return s}return null}function g(d,r){var o=!c(d),s;e.view()==="all"?s=o?"none":null:o?s=m(d)?null:"none":s=m(d)?h(d,e.view())||a(r):null,e.setUtility(d,"display",s,{source:"tool"})}function f(d){var r=d.getAttribute("class");d.setAttribute("class",r.split(/\s+/).filter(function(s){return!rt.test(s)}).join(" "));var o=getComputedStyle(d).display;return d.setAttribute("class",r),o!=="none"&&te.indexOf(o)!==-1?o:"block"}function E(d){I(d,lt).forEach(function(r){var o=e.kindOf(r),s=l(r,o)&&it.test(r.getAttribute("class")||""),b=s?u(r):[],x=s&&c(r),_=s&&e.view()==="all"&&b.length>0&&!x;r.removeAttribute(ee),s&&getComputedStyle(r).display==="none"&&r.setAttribute(ee,f(r)),B(r,"ge-hidden-in-view",x),_?r.setAttribute("data-ge-hidden-in",e.t("badge.hidden_in",{breakpoints:b.join(", ")})):r.removeAttribute("data-ge-hidden-in"),J(r,".ge-tools-drawer").forEach(function(C){J(C,".ge-visibility-tool").forEach(function(O){O.setAttribute("title",x?e.t("tool.show_in_view"):e.t("tool.hide_in_view")),P(O,"i").forEach(function(K){K.setAttribute("class",x?"bi bi-eye-slash":"bi bi-eye")})})})})}function k(d){P(d||e.canvas,".ge-hidden-in-view, [data-ge-hidden-in], ["+ee+"]").forEach(function(r){z(r,"ge-hidden-in-view"),r.removeAttribute("data-ge-hidden-in"),r.removeAttribute(ee),W(r)})}return{families:[{name:"display",prefix:"d",values:te,appliesTo:["row","column","text","element","container"],labelKey:"utility.display",choices:function(d,r){return i(r)},label:function(d){return d==="none"?e.t("utility.visibility_hidden"):d},preview:function(d,r){return d==="none"&&(d=h(r,e.view())),{display:d===null?e.bareStyle(r,"display","display"):d}}}],drawerTools:function(d,r,o){!n.drawer||!l(r,o)||e.createTool(d,e.t("tool.hide_in_view"),"ge-visibility-tool","bi bi-eye",function(){g(r,o)})},onRefresh:E,onDeinit:function(){k()},cleanMarkup:k}}Object.assign(T.locales.en,{"utility.flex_direction":"Direction","utility.flex_wrap":"Wrap","utility.justify_content":"Justify columns","utility.align_items":"Align columns","utility.align_content":"Align lines","utility.gap":"Gap","utility.row_gap":"Row gap","utility.column_gap":"Column gap","utility.flex_fill":"Fill","utility.flex_grow":"Grow","utility.flex_shrink":"Shrink"});var ot={start:"flex-start",end:"flex-end",center:"center",between:"space-between",around:"space-around",evenly:"space-evenly",baseline:"baseline",stretch:"stretch"},at=["0","1","2","3","4","5"],st=["0",".25rem",".5rem","1rem","1.5rem","3rem"],ue=["row","column","element","container"],ne=["column","element","container"];function we(e,t){var n=t&&t.scale||st;function i(u){var c=u.property||u.name;return Object.assign({prefix:u.name,panel:!1,preview:function(m,h){var g={};return g[c]=m===null?e.bareStyle(h,u.name,c):u.css(m),g}},u)}function a(u){return i(Object.assign({appliesTo:ue,preview:function(c){var m={};return m[u.name]=c===null?"normal":ot[c],m}},u))}function l(u){return i(Object.assign({values:at,appliesTo:ne,css:function(c){return n[c]}},u))}function p(u){return u}return{families:[i({name:"flex-direction",prefix:"flex",labelKey:"utility.flex_direction",values:["row","row-reverse","column","column-reverse"],appliesTo:ue,css:p}),i({name:"flex-wrap",prefix:"flex",labelKey:"utility.flex_wrap",values:["wrap","nowrap","wrap-reverse"],appliesTo:ue,css:p}),a({name:"justify-content",labelKey:"utility.justify_content",values:["start","center","end","between","around","evenly"]}),a({name:"align-items",labelKey:"utility.align_items",values:["start","center","end","baseline","stretch"]}),a({name:"align-content",labelKey:"utility.align_content",values:["start","center","end","between","around","stretch"]}),l({name:"gap",labelKey:"utility.gap"}),l({name:"row-gap",labelKey:"utility.row_gap"}),l({name:"column-gap",labelKey:"utility.column_gap"}),i({name:"flex-fill",prefix:"flex",property:"flex",labelKey:"utility.flex_fill",values:["fill"],appliesTo:ne,css:function(){return"1 1 auto"}}),i({name:"flex-grow",prefix:"flex",labelKey:"utility.flex_grow",values:["grow-0","grow-1"],appliesTo:ne,css:function(u){return u.slice(-1)}}),i({name:"flex-shrink",prefix:"flex",labelKey:"utility.flex_shrink",values:["shrink-0","shrink-1"],appliesTo:ne,css:function(u){return u.slice(-1)}})]}}Object.assign(T.locales.en,{"utility.float":"Float","utility.float_start":"Start","utility.float_end":"End","utility.float_none":"None"});var ut={start:"left",end:"right",none:"none"};function Ee(e){function t(n){return n==="start"?e.t("utility.float_start"):n==="end"?e.t("utility.float_end"):e.t("utility.float_none")}return{families:[{name:"float",prefix:"float",values:["start","end","none"],appliesTo:["element"],labelKey:"utility.float",label:t,preview:function(n,i){return{float:n===null?e.bareStyle(i,"float","float"):ut[n]}}}]}}Object.assign(T.locales.en,{"utility.sticky":"Sticky"});var ct={top:{position:"sticky",top:"0","z-index":"1020"},bottom:{position:"sticky",bottom:"0","z-index":"1020"}};function Ce(e){return{families:[{name:"sticky",prefix:"sticky",values:["top","bottom"],appliesTo:["row","column","element","container"],labelKey:"utility.sticky",panel:!1,preview:function(t,n){return t!==null?ct[t]:{position:e.bareStyle(n,"sticky","position")}}}]}}var pt=".row, .column, .ge-element, [data-ge-container]",U="ge-drawer-out",ie="data-ge-drawer-out",dt=5,ft=/^(?:inline-)?(?:flex|grid)$/;function Se(e){var t=null,n={},i=null;function a(g){if(!n[g]){n[g]=!0,t||(t=document.head.appendChild(y("style",{"data-ge-drawer-flow":""})));var f=".ge-canvas.ge-editing ["+ie+'="'+g+'"]';t.appendChild(document.createTextNode(f+" { border-top-width: "+g+`px !important; }
|
|
2
2
|
`+f+" > .ge-tools-drawer { top: -"+g+`px; }
|
|
3
|
-
`))}}function l(g){var f=getComputedStyle(g);return ft.test(f.display)?!(R(g,"row")&&f.flexDirection==="row"&&f.flexWrap==="wrap"):!1}function p(g,f){var E=Math.ceil(f.offsetHeight)+dt;a(E),g.setAttribute(ie,String(E))}function u(g){typeof ResizeObserver!="undefined"&&(i||(i=new ResizeObserver(function(f){f.forEach(function(E){var k=E.target.parentNode;k&&R(k,U)&&p(k,E.target)})})),i.observe(g))}function c(g){I(g,pt).forEach(function(f){var E=j(f,".ge-tools-drawer");E&&(l(f)?(Z(f,U),p(f,E),u(E)):R(f,U)&&(z(f,U),f.removeAttribute(ie),W(f),i&&i.unobserve(E)))})}function m(g){P(g,"."+U).forEach(function(f){z(f,U),f.removeAttribute(ie),W(f)})}function v(){i&&i.disconnect(),i=null,m(e.canvas),t&&t.remove(),t=null,n={}}return{families:[],onRefresh:c,onDeinit:v,cleanMarkup:m}}var L=["primary","secondary","success","danger","warning","info","light","dark"],ce=["top","end","bottom","start"],ke=["10","25","50","75","100"];function S(e,t,n){return t.map(function(i){return e+i+(n||"")})}function w(e,t,n,i){return{classes:e,exclusive:t!==!1,notOn:n||[],onlyOn:i||null}}function h(e,t){return{name:e,labelKey:t.labelKey,type:t.type||"text",values:t.values||null,notOn:t.notOn||[]}}var $=["column"],Oe=["element"],fe=[{key:"size",labelKey:"inline_style.section_size",properties:[h("width",{labelKey:"inline_style.prop_width",notOn:$}),h("height",{labelKey:"inline_style.prop_height",notOn:$}),h("min-width",{labelKey:"inline_style.prop_min_width"}),h("min-height",{labelKey:"inline_style.prop_min_height"}),h("max-width",{labelKey:"inline_style.prop_max_width"}),h("max-height",{labelKey:"inline_style.prop_max_height"})],catalog:[w(S("w-",["25","50","75","100","auto"]),!0,$),w(S("h-",["25","50","75","100","auto"]),!0,$),w(["mw-100","mh-100","vw-100","vh-100","min-vw-100","min-vh-100"],!1,$),w(["img-fluid","img-thumbnail"],!1,[],Oe),w(S("object-fit-",["contain","cover","fill","scale","none"]),!0,[],Oe)],parts:[]},{key:"spacing",labelKey:"inline_style.section_spacing",properties:[h("margin-top",{labelKey:"inline_style.prop_margin_top"}),h("margin-right",{labelKey:"inline_style.prop_margin_right"}),h("margin-bottom",{labelKey:"inline_style.prop_margin_bottom"}),h("margin-left",{labelKey:"inline_style.prop_margin_left"}),h("padding-top",{labelKey:"inline_style.prop_padding_top"}),h("padding-right",{labelKey:"inline_style.prop_padding_right"}),h("padding-bottom",{labelKey:"inline_style.prop_padding_bottom"}),h("padding-left",{labelKey:"inline_style.prop_padding_left"})],catalog:[],parts:["spacing"]},{key:"border",labelKey:"inline_style.section_border",properties:[h("border-width",{labelKey:"inline_style.prop_border_width"}),h("border-style",{labelKey:"inline_style.prop_border_style",type:"select",values:["none","solid","dashed","dotted","double","groove","ridge","inset","outset"]}),h("border-color",{labelKey:"inline_style.prop_border_color",type:"color"}),h("border-radius",{labelKey:"inline_style.prop_border_radius"}),h("box-shadow",{labelKey:"inline_style.prop_box_shadow",type:"shadow"})],catalog:[w(["border","border-0"].concat(S("border-",ce),S("border-",ce,"-0")),!1),w(S("border-",["1","2","3","4","5"])),w(S("border-",L.concat(["black","white"])).concat(S("border-",L,"-subtle"))),w(S("border-opacity-",ke)),w(["rounded"].concat(S("rounded-",["0","1","2","3","4","5","circle","pill"]))),w(S("rounded-",ce),!1),w(["shadow-none","shadow-sm","shadow","shadow-lg"])],parts:[]},{key:"background",labelKey:"inline_style.section_background",properties:[h("background-color",{labelKey:"inline_style.prop_background_color",type:"color"}),h("background-image",{labelKey:"inline_style.prop_background_image",type:"url"}),h("background-size",{labelKey:"inline_style.prop_background_size"}),h("background-position",{labelKey:"inline_style.prop_background_position"}),h("background-repeat",{labelKey:"inline_style.prop_background_repeat",type:"select",values:["repeat","no-repeat","repeat-x","repeat-y","space","round"]})],catalog:[w(S("bg-",L.concat(["body","body-secondary","body-tertiary","white","black","transparent"])).concat(S("bg-",L,"-subtle"),S("text-bg-",L))),w(["bg-gradient"],!1),w(S("bg-opacity-",ke))],parts:[]},{key:"text",labelKey:"inline_style.section_text",properties:[h("color",{labelKey:"inline_style.prop_color",type:"color"}),h("font-size",{labelKey:"inline_style.prop_font_size"}),h("text-align",{labelKey:"inline_style.prop_text_align",type:"select",values:["start","center","end","left","right","justify"]}),h("text-shadow",{labelKey:"inline_style.prop_text_shadow",type:"shadow"})],catalog:[w(S("text-",L.concat(["body","body-secondary","body-tertiary","white","black"])).concat(S("text-",L,"-emphasis"),["text-body-emphasis"])),w(S("text-opacity-",["25","50","75","100"])),w(S("fs-",["1","2","3","4","5","6"])),w(S("text-decoration-",["none","underline","line-through"]))],parts:["textalign"]},{key:"typography",labelKey:"inline_style.section_typography",properties:[h("font-family",{labelKey:"inline_style.prop_font_family"}),h("font-weight",{labelKey:"inline_style.prop_font_weight",type:"select",values:["100","200","300","400","500","600","700","800","900","normal","bold","lighter","bolder"]}),h("font-style",{labelKey:"inline_style.prop_font_style",type:"select",values:["normal","italic","oblique"]}),h("line-height",{labelKey:"inline_style.prop_line_height"}),h("letter-spacing",{labelKey:"inline_style.prop_letter_spacing"}),h("text-transform",{labelKey:"inline_style.prop_text_transform",type:"select",values:["none","uppercase","lowercase","capitalize"]}),h("text-decoration",{labelKey:"inline_style.prop_text_decoration",type:"select",values:["none","underline","line-through","overline"]})],catalog:[w(S("fw-",["lighter","light","normal","medium","semibold","bold","bolder"])),w(S("fst-",["italic","normal"])),w(S("lh-",["1","sm","base","lg"])),w(S("text-",["lowercase","uppercase","capitalize"])),w(["font-monospace"],!1),w(["text-wrap","text-nowrap"]),w(["text-break"],!1)],parts:[]},{key:"display",labelKey:"inline_style.section_display",properties:[h("display",{labelKey:"inline_style.prop_display",type:"select",values:["none","block","inline","inline-block","flex","inline-flex","grid","inline-grid"]}),h("opacity",{labelKey:"inline_style.prop_opacity"}),h("overflow",{labelKey:"inline_style.prop_overflow",type:"select",values:["visible","hidden","auto","scroll","clip"]}),h("visibility",{labelKey:"inline_style.prop_visibility",type:"select",values:["visible","hidden"]})],catalog:[w(S("opacity-",["0","25","50","75","100"])),w(S("overflow-",["auto","hidden","visible","scroll"])),w(["visible","invisible"])],parts:["display"]},{key:"flex",labelKey:"inline_style.section_flex",properties:[],catalog:[w(["vstack","hstack"],!0,["row"])],parts:["flex"]},{key:"position",labelKey:"inline_style.section_position",properties:[h("position",{labelKey:"inline_style.prop_position",type:"select",values:["static","relative","absolute","fixed","sticky"]}),h("top",{labelKey:"inline_style.prop_top",notOn:$}),h("right",{labelKey:"inline_style.prop_right",notOn:$}),h("bottom",{labelKey:"inline_style.prop_bottom",notOn:$}),h("left",{labelKey:"inline_style.prop_left",notOn:$}),h("z-index",{labelKey:"inline_style.prop_z_index"})],catalog:[w(S("position-",["static","relative","absolute","fixed","sticky"])),w(S("top-",["0","50","100"])),w(S("bottom-",["0","50","100"])),w(S("start-",["0","50","100"])),w(S("end-",["0","50","100"])),w(["translate-middle","translate-middle-x","translate-middle-y"]),w(["z-n1","z-0","z-1","z-2","z-3"]),w(["fixed-top","fixed-bottom"])],parts:["float","sticky"]},{key:"custom",labelKey:"inline_style.section_custom",properties:[],catalog:[],parts:[],custom:!0}];function Ke(e){return fe.filter(function(t){return t.key===e})[0]||null}function le(e,t){return e.onlyOn&&e.onlyOn.indexOf(t)===-1?!1:e.notOn.indexOf(t)===-1}var re="(?:(?:sm|md|lg|xl|xxl)-)?",mt="(?:[0-5]|auto)",yt="(?:"+L.join("|")+"|black|white)",gt="(?:"+L.join("|")+"|body|body-secondary|body-tertiary|white|black|transparent)",ht="(?:"+L.join("|")+"|body|body-secondary|body-tertiary|white|black|muted|black-50|white-50)",pe="border(?:-(?:top|end|bottom|start))?(?:-0)?",Ae="(?:"+L.join("|")+")-subtle",vt="(?:"+L.join("|")+"|body)-emphasis",Te="text-bg-(?:"+L.join("|")+")",de="sticky-"+re;function N(e,t){var n={top:"[ty]?",bottom:"[by]?",left:"[sx]?",right:"[ex]?"}[t];return new RegExp("^"+e+n+"-"+re+mt+"$")}var bt={width:/^(?:w-(?:25|50|75|100|auto)|vw-100)$/,height:/^(?:h-(?:25|50|75|100|auto)|vh-100)$/,"max-width":/^mw-100$/,"max-height":/^mh-100$/,"min-width":/^min-vw-100$/,"min-height":/^min-vh-100$/,"margin-top":N("m","top"),"margin-right":N("m","right"),"margin-bottom":N("m","bottom"),"margin-left":N("m","left"),"padding-top":N("p","top"),"padding-right":N("p","right"),"padding-bottom":N("p","bottom"),"padding-left":N("p","left"),"border-width":new RegExp("^(?:"+pe+"|border-[1-5])$"),"border-style":new RegExp("^"+pe+"$"),"border-color":new RegExp("^(?:"+pe+"|border-"+yt+"|border-"+Ae+")$"),"border-radius":/^rounded(?:-(?:[0-5]|circle|pill|top|end|bottom|start))?$/,"box-shadow":/^shadow(?:-(?:none|sm|lg))?$/,"background-color":new RegExp("^(?:bg-"+gt+"|bg-"+Ae+"|"+Te+")$"),"background-image":/^bg-gradient$/,color:new RegExp("^(?:text-"+ht+"|text-"+vt+"|"+Te+")$"),"font-size":/^fs-[1-6]$/,"text-align":new RegExp("^text-"+re+"(?:start|center|end)$"),"text-decoration":/^text-decoration-(?:none|underline|line-through)$/,"font-family":/^font-monospace$/,"font-weight":/^fw-(?:lighter|light|normal|medium|semibold|bold|bolder)$/,"font-style":/^fst-(?:italic|normal)$/,"line-height":/^lh-(?:1|sm|base|lg)$/,"text-transform":/^text-(?:lowercase|uppercase|capitalize)$/,display:new RegExp("^(?:d-"+re+"(?:none|inline|inline-block|block|grid|inline-grid|table|table-row|table-cell|flex|inline-flex)|vstack|hstack)$"),opacity:/^opacity-(?:0|25|50|75|100)$/,overflow:/^overflow-(?:auto|hidden|visible|scroll)$/,visibility:/^(?:visible|invisible)$/,position:new RegExp("^(?:position-(?:static|relative|absolute|fixed|sticky)|fixed-(?:top|bottom)|"+de+"(?:top|bottom))$"),top:new RegExp("^(?:top-(?:0|50|100)|fixed-top|"+de+"top)$"),bottom:new RegExp("^(?:bottom-(?:0|50|100)|fixed-bottom|"+de+"bottom)$"),left:/^start-(?:0|50|100)$/,right:/^end-(?:0|50|100)$/,"z-index":/^z-(?:n1|[0-3])$/};function Le(e,t){var n=bt[e];return n&&t.filter(function(i){return n.test(i)})[0]||null}function _t(e,t){var n={};return Object.keys(t||{}).forEach(function(i){Ke(i)||e.warn('inline_style.sections: there is no "'+i+'" section: ignored')}),fe.forEach(function(i){var a=t&&t[i.key]!==void 0?t[i.key]:!0;if(a!==!1){var l=i.properties.map(function(c){return c.name}),p=i.properties,u=!0;a&&typeof a=="object"&&(Array.isArray(a.properties)&&(a.properties.forEach(function(c){l.indexOf(c)===-1&&e.warn("inline_style.sections."+i.key+': "'+c+'" is not one of its properties: ignored')}),p=a.properties.filter(function(c){return l.indexOf(c)!==-1}).map(function(c){return i.properties[l.indexOf(c)]})),a.catalog===!1&&(u=!1)),n[i.key]={section:i,properties:p,catalog:u}}}),n}function xt(e,t){return t==null?null:typeof t=="function"?t:(e.warn("inline_style.browse must be a function: ignored"),null)}function Pe(e){var t=e.settings.inline_style||{};return{browse:xt(e,t.browse),sections:_t(e,t.sections),spacing:t.spacing,visibility:t.visibility}}var ze=new WeakMap,wt=0;function Et(e){return(e.getAttribute("class")||"").split(/\s+/).filter(Boolean)}function Ne(e,t,n,i){var a=String(i==null?"":i).trim(),l=/\s*!\s*important\s*$/i.exec(a),p;return l&&(a=a.slice(0,l.index).trim(),p="important"),e.setHostStyle(t,n,a,p)}function Me(e,t,n){B(e,"is-invalid",!t),t?e.removeAttribute("title"):e.setAttribute("title",n.t("inline_style.invalid"))}function me(e,t){R(e,"is-invalid")||(e.value=t)}function X(e){return y("input",{type:"text",class:"form-control form-control-sm "+(e||"")})}var Ct=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function Re(e){var t=Ct.exec(e.trim());if(!t)return null;var n=t[1];return n.length===3&&(n=n.split("").map(function(i){return i+i}).join("")),"#"+n.toLowerCase()}function De(e){var t=y("div",{class:"input-group input-group-sm ge-inline-style-color"}),n=t.appendChild(y("input",{type:"color",class:"form-control form-control-color"})),i=t.appendChild(X());return n.addEventListener("input",function(){z(i,"is-invalid"),i.value=n.value,e(n.value,i)}),i.addEventListener("change",function(){var a=Re(i.value);a&&(n.value=a),e(i.value,i)}),{element:t,set:function(a){me(i,a);var l=Re(a);l&&(n.value=l)}}}var St=/^url\(\s*(["']?)(.*)\1\s*\)$/i;function He(e){var t=St.exec(e.trim());return t?t[1]?t[2].replace(/\\(["\\])/g,"$1"):t[2]:e}function Be(e){return e=e.trim(),e===""||/^(?:none|inherit|initial|unset|revert)$/i.test(e)||/^[a-z-]+\(/i.test(e)?e:'url("'+e.replace(/(["\\])/g,"\\$1")+'")'}function kt(e){for(var t=[],n=0,i="",a=0;a<e.length;a++){var l=e.charAt(a);l==="("&&n++,l===")"&&n--,n===0&&(l===" "||l===",")?(i&&t.push(i),l===","&&t.push(","),i=""):i+=l}return i&&t.push(i),t}var Ot=/^-?(?:\d*\.)?\d+(?:[a-z%]+)?$/i,$e=[{name:"x",labelKey:"inline_style.shadow_x"},{name:"y",labelKey:"inline_style.shadow_y"},{name:"blur",labelKey:"inline_style.shadow_blur"},{name:"spread",labelKey:"inline_style.shadow_spread"}];function je(e,t){if(e=e.trim(),e==="")return{inset:!1,lengths:[],color:""};if(/var\(/i.test(e))return null;var n=kt(e);if(n.indexOf(",")!==-1)return null;var i=!1,a=[],l=[];return n.forEach(function(p){t&&p.toLowerCase()==="inset"?i=!0:Ot.test(p)?a.push(p):l.push(p)}),l.length>1||a.length<2||a.length>(t?4:3)||l.length&&/^(?:none|inherit|initial|unset|revert)$/i.test(l[0])?null:{inset:i,lengths:a,color:l[0]||""}}function At(e,t){for(var n=e.lengths.slice(),i=n.length-1;i>=0;i--)n[i]===""&&n.slice(i+1).some(Boolean)&&(n[i]="0");if(n=n.filter(Boolean),!n.length&&!e.color&&!e.inset)return"";for(;n.length<2;)n.push("0");return(t&&e.inset?"inset ":"")+n.join(" ")+(e.color?" "+e.color:"")}function Tt(e,t,n,i){var a=n==="box-shadow",l=y("div",{class:"ge-inline-style-shadow"}),p=!1;function u(f,E){var k=Ne(e,t,n,f);return Me(E,k,e),k&&i(),k}function c(f){l.innerHTML="";var E=l.appendChild(y("div",{class:"ge-inline-style-shadow-builder"})),k=a?$e:$e.slice(0,3),d=k.map(function(C,O){var K=E.appendChild(y("label",{class:"ge-inline-style-shadow-part"}));K.appendChild(y("span",{class:"ge-inline-style-shadow-label"},e.t(C.labelKey)));var A=K.appendChild(X("ge-inline-style-shadow-"+C.name));return A.value=f.lengths[O]||"",A}),r=E.appendChild(y("label",{class:"ge-inline-style-shadow-part ge-inline-style-shadow-color"}));r.appendChild(y("span",{class:"ge-inline-style-shadow-label"},e.t("inline_style.shadow_color")));var o=De(function(){_()});r.appendChild(o.element),o.set(f.color);var s=null;if(a){var b=E.appendChild(y("label",{class:"form-check ge-inline-style-shadow-inset"}));s=b.appendChild(y("input",{type:"checkbox",class:"form-check-input"})),b.appendChild(y("span",{class:"form-check-label"},e.t("inline_style.shadow_inset"))),s.checked=f.inset,s.addEventListener("change",function(){_()})}d.forEach(function(C){C.addEventListener("change",function(){_()})});var x=l.appendChild(y("a",{href:"#",class:"ge-inline-style-shadow-mode"},e.t("inline_style.shadow_text_mode")));x.addEventListener("click",function(C){C.preventDefault(),p=!0,g()});function _(){var C=At({inset:s?s.checked:!1,lengths:d.map(function(O){return O.value.trim()}),color:M(o.element,'input[type="text"]').value.trim()},a);u(C,d[0])}}function m(f){l.innerHTML="";var E=l.appendChild(X("ge-inline-style-shadow-text"));if(E.value=f,E.addEventListener("change",function(){if(E.value.trim()===""){u("",E)&&(p=!1,g());return}u(E.value,E)}),je(f,a)){var k=l.appendChild(y("a",{href:"#",class:"ge-inline-style-shadow-mode"},e.t("inline_style.shadow_builder_mode")));k.addEventListener("click",function(d){d.preventDefault(),p=!1,g()})}}var v=null;function g(){if(!l.querySelector(".is-invalid")){var f=e.hostStyle(t,n).value,E=je(f,a);f===v&&l.firstChild&&p===!!l.querySelector(".ge-inline-style-shadow-text")||(v=f,p||!E?(p=!!f||p,m(f)):c(E))}}return{element:l,render:g,value:function(){return e.hostStyle(t,n).value}}}function Kt(e,t,n,i,a,l){var p=y("button",{type:"button",class:"btn btn-outline-secondary ge-inline-style-browse",title:e.t("inline_style.browse"),"aria-label":e.t("inline_style.browse")});return p.appendChild(y("i",{class:"bi bi-folder2-open","aria-hidden":"true"})),p.addEventListener("click",function(){var u=!1;function c(v){if(!u&&(u=!0,v!=null)){if(typeof v!="string"){e.warn("inline_style.browse gave "+typeof v+", not a text: ignored");return}v.trim()===""||i.destroyed||!e.canvas.contains(t)||l(v.trim())}}var m=i.browse(c,{node:t,property:n.name,value:He(a())});m&&typeof m.then=="function"&&m.then(c)}),p}function Ie(e,t,n,i,a){var l=y("div",{class:"ge-inline-style-field","data-ge-inline-style-property":n.name}),p=l.appendChild(y("label",{class:"ge-inline-style-label"},e.t(n.labelKey))),u;function c(){return e.hostStyle(t,n.name).value}function m(o,s){var b=Ne(e,t,n.name,o);Me(s,b,e),b&&i()}if(n.type==="select"){var v=l.appendChild(y("select",{class:"form-select form-select-sm"}));v.addEventListener("change",function(){m(v.value,v)}),u=function(){var o=c(),s=n.values.slice();o&&s.indexOf(o)===-1&&s.push(o),v.innerHTML="",v.appendChild(y("option",{value:""},"")),s.forEach(function(b){v.appendChild(y("option",{value:b},b))}),v.value=o}}else if(n.type==="color"){var g=De(function(o,s){m(o,s)});l.appendChild(g.element),u=function(){g.set(c())}}else if(n.type==="url"){var f=X();if(f.addEventListener("change",function(){m(Be(f.value),f)}),a&&a.browse){var E=l.appendChild(y("div",{class:"input-group input-group-sm ge-inline-style-url"}));E.appendChild(f),E.appendChild(Kt(e,t,n,a,c,function(o){z(f,"is-invalid"),f.value=o,m(Be(o),f)}))}else l.appendChild(f);u=function(){me(f,He(c()))}}else if(n.type==="shadow"){var k=Tt(e,t,n.name,i);l.appendChild(k.element),u=k.render}else{var d=l.appendChild(X());d.addEventListener("change",function(){m(d.value,d)}),u=function(){me(d,c())}}var r=l.querySelector("input, select");return r&&(r.id="ge-inline-style-field-"+ ++wt,p.setAttribute("for",r.id)),l.appendChild(y("small",{class:"ge-inline-style-note ge-inline-style-overridden"})),ze.set(l,function(){u();var o=c()?Le(n.name,Et(t)):null,s=j(l,".ge-inline-style-overridden");s.textContent=o?e.t("inline_style.overridden",{class:o}):"",F(s,!!o)}),ye(l),l}function ye(e){var t=ze.get(e);t&&t()}function Fe(e){return(e.getAttribute("class")||"").split(/\s+/).filter(Boolean)}function Lt(e,t,n,i){var a=e.detailsOf(t),l=a?M(a,".ge-classes"):null;if(l){var p=Fe(t).indexOf(i)!==-1,u=l.value.split(/\s+/).filter(Boolean).filter(function(c){return c===i?!1:!(n.exclusive&&!p&&n.classes.indexOf(c)!==-1)});p||u.push(i),l.value=u.join(" "),l.dispatchEvent(new Event("change",{bubbles:!0}))}}function Ue(e,t,n,i){var a=i.filter(function(p){return le(p,n)});if(!a.length)return null;var l=y("div",{class:"ge-inline-style-catalog"});return l.appendChild(y("span",{class:"ge-inline-style-label"},e.t("inline_style.catalog"))),a.forEach(function(p){var u=l.appendChild(y("div",{class:"ge-inline-style-chips"}));p.classes.forEach(function(c){var m=u.appendChild(y("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-inline-style-chip","data-ge-class":c,"aria-pressed":"false"},c));m.addEventListener("click",function(){Lt(e,t,p,c)})})}),ge(l,t),l}function ge(e,t){var n=Fe(t);P(e,".ge-inline-style-chip").forEach(function(i){var a=n.indexOf(i.getAttribute("data-ge-class"))!==-1;B(i,"active",a),i.setAttribute("aria-pressed",a?"true":"false")})}function Pt(e){var t=document.createElement("div").style,n=[];t.setProperty(e,"initial");for(var i=0;i<t.length;i++)n.push(t[i]);return n.length?n:[e]}function Ge(e){var t=document.createElement("div").style;return t.cssText=e,t}function Ve(e,t,n,i){var a={};n.forEach(function(m){Pt(m).forEach(function(v){a[v]=!0})});var l=y("div",{class:"ge-inline-style-custom"}),p=l.appendChild(y("textarea",{class:"form-control form-control-sm font-monospace ge-inline-style-custom-css",rows:"4",spellcheck:"false","aria-label":e.t("inline_style.section_custom")}));function u(){for(var m=Ge(e.hostStyle(t)),v=document.createElement("div").style,g=0;g<m.length;g++){var f=m[g];a[f]||v.setProperty(f,m.getPropertyValue(f),m.getPropertyPriority(f))}return v}p.addEventListener("change",function(){var m=u(),v=Ge(p.value),g;for(g=0;g<m.length;g++)v.getPropertyValue(m[g])===""&&e.setHostStyle(t,m[g],"");for(g=0;g<v.length;g++)e.setHostStyle(t,v[g],v.getPropertyValue(v[g]),v.getPropertyPriority(v[g]));c(),i()});function c(){document.activeElement!==p&&(p.value=u().cssText.replace(/; /g,`;
|
|
4
|
-
`))}return c(),{element:l,render:c}}function Rt(e,t){return t==="row"||t==="column"||t==="element"||t==="section"||D(e,"[data-ge-container]")?!0:!!j(e,".ge-tools-drawer.ge-pane-drawer")}function Bt(e,t,n){return n==="plain"&&(n="text"),e.appliesTo.indexOf(n)!==-1?!0:e.appliesTo.indexOf("container")!==-1&&D(t,"[data-ge-container]")}function $t(e,t,n,i){if(t.panel)return t.panel(n,i);var a=t.families.filter(function(p){return Bt(p,n,i)}).map(function(p){return e.utilityField(n,p.name)});if(a.length<2)return a[0]||null;var l=y("div",{class:"ge-inline-style-part-fields"});return a.forEach(function(p){l.appendChild(p)}),l}function We(e,t,n,i){var a=Rt(t,n),l=y("div",{class:"accordion ge-inline-style"}),p=[],u=[],c=[],m=null,
|
|
3
|
+
`))}}function l(g){var f=getComputedStyle(g);return ft.test(f.display)?!(R(g,"row")&&f.flexDirection==="row"&&f.flexWrap==="wrap"):!1}function p(g,f){var E=Math.ceil(f.offsetHeight)+dt;a(E),g.setAttribute(ie,String(E))}function u(g){typeof ResizeObserver!="undefined"&&(i||(i=new ResizeObserver(function(f){f.forEach(function(E){var k=E.target.parentNode;k&&R(k,U)&&p(k,E.target)})})),i.observe(g))}function c(g){I(g,pt).forEach(function(f){var E=j(f,".ge-tools-drawer");E&&(l(f)?(Z(f,U),p(f,E),u(E)):R(f,U)&&(z(f,U),f.removeAttribute(ie),W(f),i&&i.unobserve(E)))})}function m(g){P(g,"."+U).forEach(function(f){z(f,U),f.removeAttribute(ie),W(f)})}function h(){i&&i.disconnect(),i=null,m(e.canvas),t&&t.remove(),t=null,n={}}return{families:[],onRefresh:c,onDeinit:h,cleanMarkup:m}}var L=["primary","secondary","success","danger","warning","info","light","dark"],ce=["top","end","bottom","start"],ke=["10","25","50","75","100"];function S(e,t,n){return t.map(function(i){return e+i+(n||"")})}function w(e,t,n,i){return{classes:e,exclusive:t!==!1,notOn:n||[],onlyOn:i||null}}function v(e,t){return{name:e,labelKey:t.labelKey,type:t.type||"text",values:t.values||null,notOn:t.notOn||[]}}var $=["column"],Oe=["element"],fe=[{key:"size",labelKey:"inline_style.section_size",properties:[v("width",{labelKey:"inline_style.prop_width",notOn:$}),v("height",{labelKey:"inline_style.prop_height",notOn:$}),v("min-width",{labelKey:"inline_style.prop_min_width"}),v("min-height",{labelKey:"inline_style.prop_min_height"}),v("max-width",{labelKey:"inline_style.prop_max_width"}),v("max-height",{labelKey:"inline_style.prop_max_height"})],catalog:[w(S("w-",["25","50","75","100","auto"]),!0,$),w(S("h-",["25","50","75","100","auto"]),!0,$),w(["mw-100","mh-100","vw-100","vh-100","min-vw-100","min-vh-100"],!1,$),w(["img-fluid","img-thumbnail"],!1,[],Oe),w(S("object-fit-",["contain","cover","fill","scale","none"]),!0,[],Oe)],parts:[]},{key:"spacing",labelKey:"inline_style.section_spacing",properties:[v("margin-top",{labelKey:"inline_style.prop_margin_top"}),v("margin-right",{labelKey:"inline_style.prop_margin_right"}),v("margin-bottom",{labelKey:"inline_style.prop_margin_bottom"}),v("margin-left",{labelKey:"inline_style.prop_margin_left"}),v("padding-top",{labelKey:"inline_style.prop_padding_top"}),v("padding-right",{labelKey:"inline_style.prop_padding_right"}),v("padding-bottom",{labelKey:"inline_style.prop_padding_bottom"}),v("padding-left",{labelKey:"inline_style.prop_padding_left"})],catalog:[],parts:["spacing"]},{key:"border",labelKey:"inline_style.section_border",properties:[v("border-width",{labelKey:"inline_style.prop_border_width"}),v("border-style",{labelKey:"inline_style.prop_border_style",type:"select",values:["none","solid","dashed","dotted","double","groove","ridge","inset","outset"]}),v("border-color",{labelKey:"inline_style.prop_border_color",type:"color"}),v("border-radius",{labelKey:"inline_style.prop_border_radius"}),v("box-shadow",{labelKey:"inline_style.prop_box_shadow",type:"shadow"})],catalog:[w(["border","border-0"].concat(S("border-",ce),S("border-",ce,"-0")),!1),w(S("border-",["1","2","3","4","5"])),w(S("border-",L.concat(["black","white"])).concat(S("border-",L,"-subtle"))),w(S("border-opacity-",ke)),w(["rounded"].concat(S("rounded-",["0","1","2","3","4","5","circle","pill"]))),w(S("rounded-",ce),!1),w(["shadow-none","shadow-sm","shadow","shadow-lg"])],parts:[]},{key:"background",labelKey:"inline_style.section_background",properties:[v("background-color",{labelKey:"inline_style.prop_background_color",type:"color"}),v("background-image",{labelKey:"inline_style.prop_background_image",type:"url"}),v("background-size",{labelKey:"inline_style.prop_background_size"}),v("background-position",{labelKey:"inline_style.prop_background_position"}),v("background-repeat",{labelKey:"inline_style.prop_background_repeat",type:"select",values:["repeat","no-repeat","repeat-x","repeat-y","space","round"]})],catalog:[w(S("bg-",L.concat(["body","body-secondary","body-tertiary","white","black","transparent"])).concat(S("bg-",L,"-subtle"),S("text-bg-",L))),w(["bg-gradient"],!1),w(S("bg-opacity-",ke))],parts:[]},{key:"text",labelKey:"inline_style.section_text",properties:[v("color",{labelKey:"inline_style.prop_color",type:"color"}),v("font-size",{labelKey:"inline_style.prop_font_size"}),v("text-align",{labelKey:"inline_style.prop_text_align",type:"select",values:["start","center","end","left","right","justify"]}),v("text-shadow",{labelKey:"inline_style.prop_text_shadow",type:"shadow"})],catalog:[w(S("text-",L.concat(["body","body-secondary","body-tertiary","white","black"])).concat(S("text-",L,"-emphasis"),["text-body-emphasis"])),w(S("text-opacity-",["25","50","75","100"])),w(S("fs-",["1","2","3","4","5","6"])),w(S("text-decoration-",["none","underline","line-through"]))],parts:["textalign"]},{key:"typography",labelKey:"inline_style.section_typography",properties:[v("font-family",{labelKey:"inline_style.prop_font_family"}),v("font-weight",{labelKey:"inline_style.prop_font_weight",type:"select",values:["100","200","300","400","500","600","700","800","900","normal","bold","lighter","bolder"]}),v("font-style",{labelKey:"inline_style.prop_font_style",type:"select",values:["normal","italic","oblique"]}),v("line-height",{labelKey:"inline_style.prop_line_height"}),v("letter-spacing",{labelKey:"inline_style.prop_letter_spacing"}),v("text-transform",{labelKey:"inline_style.prop_text_transform",type:"select",values:["none","uppercase","lowercase","capitalize"]}),v("text-decoration",{labelKey:"inline_style.prop_text_decoration",type:"select",values:["none","underline","line-through","overline"]})],catalog:[w(S("fw-",["lighter","light","normal","medium","semibold","bold","bolder"])),w(S("fst-",["italic","normal"])),w(S("lh-",["1","sm","base","lg"])),w(S("text-",["lowercase","uppercase","capitalize"])),w(["font-monospace"],!1),w(["text-wrap","text-nowrap"]),w(["text-break"],!1)],parts:[]},{key:"display",labelKey:"inline_style.section_display",properties:[v("display",{labelKey:"inline_style.prop_display",type:"select",values:["none","block","inline","inline-block","flex","inline-flex","grid","inline-grid"]}),v("opacity",{labelKey:"inline_style.prop_opacity"}),v("overflow",{labelKey:"inline_style.prop_overflow",type:"select",values:["visible","hidden","auto","scroll","clip"]}),v("visibility",{labelKey:"inline_style.prop_visibility",type:"select",values:["visible","hidden"]})],catalog:[w(S("opacity-",["0","25","50","75","100"])),w(S("overflow-",["auto","hidden","visible","scroll"])),w(["visible","invisible"])],parts:["display"]},{key:"flex",labelKey:"inline_style.section_flex",properties:[],catalog:[w(["vstack","hstack"],!0,["row"])],parts:["flex"]},{key:"position",labelKey:"inline_style.section_position",properties:[v("position",{labelKey:"inline_style.prop_position",type:"select",values:["static","relative","absolute","fixed","sticky"]}),v("top",{labelKey:"inline_style.prop_top",notOn:$}),v("right",{labelKey:"inline_style.prop_right",notOn:$}),v("bottom",{labelKey:"inline_style.prop_bottom",notOn:$}),v("left",{labelKey:"inline_style.prop_left",notOn:$}),v("z-index",{labelKey:"inline_style.prop_z_index"})],catalog:[w(S("position-",["static","relative","absolute","fixed","sticky"])),w(S("top-",["0","50","100"])),w(S("bottom-",["0","50","100"])),w(S("start-",["0","50","100"])),w(S("end-",["0","50","100"])),w(["translate-middle","translate-middle-x","translate-middle-y"]),w(["z-n1","z-0","z-1","z-2","z-3"]),w(["fixed-top","fixed-bottom"])],parts:["float","sticky"]},{key:"custom",labelKey:"inline_style.section_custom",properties:[],catalog:[],parts:[],custom:!0}];function Ke(e){return fe.filter(function(t){return t.key===e})[0]||null}function le(e,t){return e.onlyOn&&e.onlyOn.indexOf(t)===-1?!1:e.notOn.indexOf(t)===-1}var re="(?:(?:sm|md|lg|xl|xxl)-)?",mt="(?:[0-5]|auto)",yt="(?:"+L.join("|")+"|black|white)",gt="(?:"+L.join("|")+"|body|body-secondary|body-tertiary|white|black|transparent)",ht="(?:"+L.join("|")+"|body|body-secondary|body-tertiary|white|black|muted|black-50|white-50)",pe="border(?:-(?:top|end|bottom|start))?(?:-0)?",Ae="(?:"+L.join("|")+")-subtle",vt="(?:"+L.join("|")+"|body)-emphasis",Te="text-bg-(?:"+L.join("|")+")",de="sticky-"+re;function N(e,t){var n={top:"[ty]?",bottom:"[by]?",left:"[sx]?",right:"[ex]?"}[t];return new RegExp("^"+e+n+"-"+re+mt+"$")}var bt={width:/^(?:w-(?:25|50|75|100|auto)|vw-100)$/,height:/^(?:h-(?:25|50|75|100|auto)|vh-100)$/,"max-width":/^mw-100$/,"max-height":/^mh-100$/,"min-width":/^min-vw-100$/,"min-height":/^min-vh-100$/,"margin-top":N("m","top"),"margin-right":N("m","right"),"margin-bottom":N("m","bottom"),"margin-left":N("m","left"),"padding-top":N("p","top"),"padding-right":N("p","right"),"padding-bottom":N("p","bottom"),"padding-left":N("p","left"),"border-width":new RegExp("^(?:"+pe+"|border-[1-5])$"),"border-style":new RegExp("^"+pe+"$"),"border-color":new RegExp("^(?:"+pe+"|border-"+yt+"|border-"+Ae+")$"),"border-radius":/^rounded(?:-(?:[0-5]|circle|pill|top|end|bottom|start))?$/,"box-shadow":/^shadow(?:-(?:none|sm|lg))?$/,"background-color":new RegExp("^(?:bg-"+gt+"|bg-"+Ae+"|"+Te+")$"),"background-image":/^bg-gradient$/,color:new RegExp("^(?:text-"+ht+"|text-"+vt+"|"+Te+")$"),"font-size":/^fs-[1-6]$/,"text-align":new RegExp("^text-"+re+"(?:start|center|end)$"),"text-decoration":/^text-decoration-(?:none|underline|line-through)$/,"font-family":/^font-monospace$/,"font-weight":/^fw-(?:lighter|light|normal|medium|semibold|bold|bolder)$/,"font-style":/^fst-(?:italic|normal)$/,"line-height":/^lh-(?:1|sm|base|lg)$/,"text-transform":/^text-(?:lowercase|uppercase|capitalize)$/,display:new RegExp("^(?:d-"+re+"(?:none|inline|inline-block|block|grid|inline-grid|table|table-row|table-cell|flex|inline-flex)|vstack|hstack)$"),opacity:/^opacity-(?:0|25|50|75|100)$/,overflow:/^overflow-(?:auto|hidden|visible|scroll)$/,visibility:/^(?:visible|invisible)$/,position:new RegExp("^(?:position-(?:static|relative|absolute|fixed|sticky)|fixed-(?:top|bottom)|"+de+"(?:top|bottom))$"),top:new RegExp("^(?:top-(?:0|50|100)|fixed-top|"+de+"top)$"),bottom:new RegExp("^(?:bottom-(?:0|50|100)|fixed-bottom|"+de+"bottom)$"),left:/^start-(?:0|50|100)$/,right:/^end-(?:0|50|100)$/,"z-index":/^z-(?:n1|[0-3])$/};function Le(e,t){var n=bt[e];return n&&t.filter(function(i){return n.test(i)})[0]||null}function _t(e,t){var n={};return Object.keys(t||{}).forEach(function(i){Ke(i)||e.warn('inline_style.sections: there is no "'+i+'" section: ignored')}),fe.forEach(function(i){var a=t&&t[i.key]!==void 0?t[i.key]:!0;if(a!==!1){var l=i.properties.map(function(c){return c.name}),p=i.properties,u=!0;a&&typeof a=="object"&&(Array.isArray(a.properties)&&(a.properties.forEach(function(c){l.indexOf(c)===-1&&e.warn("inline_style.sections."+i.key+': "'+c+'" is not one of its properties: ignored')}),p=a.properties.filter(function(c){return l.indexOf(c)!==-1}).map(function(c){return i.properties[l.indexOf(c)]})),a.catalog===!1&&(u=!1)),n[i.key]={section:i,properties:p,catalog:u}}}),n}function xt(e,t){return t==null?null:typeof t=="function"?t:(e.warn("inline_style.browse must be a function: ignored"),null)}function Pe(e){var t=e.settings.inline_style||{};return{browse:xt(e,t.browse),sections:_t(e,t.sections),spacing:t.spacing,visibility:t.visibility}}var ze=new WeakMap,wt=0;function Et(e){return(e.getAttribute("class")||"").split(/\s+/).filter(Boolean)}function Ne(e,t,n,i){var a=String(i==null?"":i).trim(),l=/\s*!\s*important\s*$/i.exec(a),p;return l&&(a=a.slice(0,l.index).trim(),p="important"),e.setHostStyle(t,n,a,p)}function Me(e,t,n){B(e,"is-invalid",!t),t?e.removeAttribute("title"):e.setAttribute("title",n.t("inline_style.invalid"))}function me(e,t){R(e,"is-invalid")||(e.value=t)}function X(e){return y("input",{type:"text",class:"form-control form-control-sm "+(e||"")})}var Ct=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function Re(e){var t=Ct.exec(e.trim());if(!t)return null;var n=t[1];return n.length===3&&(n=n.split("").map(function(i){return i+i}).join("")),"#"+n.toLowerCase()}function De(e){var t=y("div",{class:"input-group input-group-sm ge-inline-style-color"}),n=t.appendChild(y("input",{type:"color",class:"form-control form-control-color"})),i=t.appendChild(X());return n.addEventListener("input",function(){z(i,"is-invalid"),i.value=n.value,e(n.value,i)}),i.addEventListener("change",function(){var a=Re(i.value);a&&(n.value=a),e(i.value,i)}),{element:t,set:function(a){me(i,a);var l=Re(a);l&&(n.value=l)}}}var St=/^url\(\s*(["']?)(.*)\1\s*\)$/i;function He(e){var t=St.exec(e.trim());return t?t[1]?t[2].replace(/\\(["\\])/g,"$1"):t[2]:e}function Be(e){return e=e.trim(),e===""||/^(?:none|inherit|initial|unset|revert)$/i.test(e)||/^[a-z-]+\(/i.test(e)?e:'url("'+e.replace(/(["\\])/g,"\\$1")+'")'}function kt(e){for(var t=[],n=0,i="",a=0;a<e.length;a++){var l=e.charAt(a);l==="("&&n++,l===")"&&n--,n===0&&(l===" "||l===",")?(i&&t.push(i),l===","&&t.push(","),i=""):i+=l}return i&&t.push(i),t}var Ot=/^-?(?:\d*\.)?\d+(?:[a-z%]+)?$/i,$e=[{name:"x",labelKey:"inline_style.shadow_x"},{name:"y",labelKey:"inline_style.shadow_y"},{name:"blur",labelKey:"inline_style.shadow_blur"},{name:"spread",labelKey:"inline_style.shadow_spread"}];function je(e,t){if(e=e.trim(),e==="")return{inset:!1,lengths:[],color:""};if(/var\(/i.test(e))return null;var n=kt(e);if(n.indexOf(",")!==-1)return null;var i=!1,a=[],l=[];return n.forEach(function(p){t&&p.toLowerCase()==="inset"?i=!0:Ot.test(p)?a.push(p):l.push(p)}),l.length>1||a.length<2||a.length>(t?4:3)||l.length&&/^(?:none|inherit|initial|unset|revert)$/i.test(l[0])?null:{inset:i,lengths:a,color:l[0]||""}}function At(e,t){for(var n=e.lengths.slice(),i=n.length-1;i>=0;i--)n[i]===""&&n.slice(i+1).some(Boolean)&&(n[i]="0");if(n=n.filter(Boolean),!n.length&&!e.color&&!e.inset)return"";for(;n.length<2;)n.push("0");return(t&&e.inset?"inset ":"")+n.join(" ")+(e.color?" "+e.color:"")}function Tt(e,t,n,i){var a=n==="box-shadow",l=y("div",{class:"ge-inline-style-shadow"}),p=!1;function u(f,E){var k=Ne(e,t,n,f);return Me(E,k,e),k&&i(),k}function c(f){l.innerHTML="";var E=l.appendChild(y("div",{class:"ge-inline-style-shadow-builder"})),k=a?$e:$e.slice(0,3),d=k.map(function(C,O){var K=E.appendChild(y("label",{class:"ge-inline-style-shadow-part"}));K.appendChild(y("span",{class:"ge-inline-style-shadow-label"},e.t(C.labelKey)));var A=K.appendChild(X("ge-inline-style-shadow-"+C.name));return A.value=f.lengths[O]||"",A}),r=E.appendChild(y("label",{class:"ge-inline-style-shadow-part ge-inline-style-shadow-color"}));r.appendChild(y("span",{class:"ge-inline-style-shadow-label"},e.t("inline_style.shadow_color")));var o=De(function(){_()});r.appendChild(o.element),o.set(f.color);var s=null;if(a){var b=E.appendChild(y("label",{class:"form-check ge-inline-style-shadow-inset"}));s=b.appendChild(y("input",{type:"checkbox",class:"form-check-input"})),b.appendChild(y("span",{class:"form-check-label"},e.t("inline_style.shadow_inset"))),s.checked=f.inset,s.addEventListener("change",function(){_()})}d.forEach(function(C){C.addEventListener("change",function(){_()})});var x=l.appendChild(y("a",{href:"#",class:"ge-inline-style-shadow-mode"},e.t("inline_style.shadow_text_mode")));x.addEventListener("click",function(C){C.preventDefault(),p=!0,g()});function _(){var C=At({inset:s?s.checked:!1,lengths:d.map(function(O){return O.value.trim()}),color:M(o.element,'input[type="text"]').value.trim()},a);u(C,d[0])}}function m(f){l.innerHTML="";var E=l.appendChild(X("ge-inline-style-shadow-text"));if(E.value=f,E.addEventListener("change",function(){if(E.value.trim()===""){u("",E)&&(p=!1,g());return}u(E.value,E)}),je(f,a)){var k=l.appendChild(y("a",{href:"#",class:"ge-inline-style-shadow-mode"},e.t("inline_style.shadow_builder_mode")));k.addEventListener("click",function(d){d.preventDefault(),p=!1,g()})}}var h=null;function g(){if(!l.querySelector(".is-invalid")){var f=e.hostStyle(t,n).value,E=je(f,a);f===h&&l.firstChild&&p===!!l.querySelector(".ge-inline-style-shadow-text")||(h=f,p||!E?(p=!!f||p,m(f)):c(E))}}return{element:l,render:g,value:function(){return e.hostStyle(t,n).value}}}function Kt(e,t,n,i,a,l){var p=y("button",{type:"button",class:"btn btn-outline-secondary ge-inline-style-browse",title:e.t("inline_style.browse"),"aria-label":e.t("inline_style.browse")});return p.appendChild(y("i",{class:"bi bi-folder2-open","aria-hidden":"true"})),p.addEventListener("click",function(){var u=!1;function c(h){if(!u&&(u=!0,h!=null)){if(typeof h!="string"){e.warn("inline_style.browse gave "+typeof h+", not a text: ignored");return}h.trim()===""||i.destroyed||!e.canvas.contains(t)||l(h.trim())}}var m=i.browse(c,{node:t,property:n.name,value:He(a())});m&&typeof m.then=="function"&&m.then(c)}),p}function Ie(e,t,n,i,a){var l=y("div",{class:"ge-inline-style-field","data-ge-inline-style-property":n.name}),p=l.appendChild(y("label",{class:"ge-inline-style-label"},e.t(n.labelKey))),u;function c(){return e.hostStyle(t,n.name).value}function m(o,s){var b=Ne(e,t,n.name,o);Me(s,b,e),b&&i()}if(n.type==="select"){var h=l.appendChild(y("select",{class:"form-select form-select-sm"}));h.addEventListener("change",function(){m(h.value,h)}),u=function(){var o=c(),s=n.values.slice();o&&s.indexOf(o)===-1&&s.push(o),h.innerHTML="",h.appendChild(y("option",{value:""},"")),s.forEach(function(b){h.appendChild(y("option",{value:b},b))}),h.value=o}}else if(n.type==="color"){var g=De(function(o,s){m(o,s)});l.appendChild(g.element),u=function(){g.set(c())}}else if(n.type==="url"){var f=X();if(f.addEventListener("change",function(){m(Be(f.value),f)}),a&&a.browse){var E=l.appendChild(y("div",{class:"input-group input-group-sm ge-inline-style-url"}));E.appendChild(f),E.appendChild(Kt(e,t,n,a,c,function(o){z(f,"is-invalid"),f.value=o,m(Be(o),f)}))}else l.appendChild(f);u=function(){me(f,He(c()))}}else if(n.type==="shadow"){var k=Tt(e,t,n.name,i);l.appendChild(k.element),u=k.render}else{var d=l.appendChild(X());d.addEventListener("change",function(){m(d.value,d)}),u=function(){me(d,c())}}var r=l.querySelector("input, select");return r&&(r.id="ge-inline-style-field-"+ ++wt,p.setAttribute("for",r.id)),l.appendChild(y("small",{class:"ge-inline-style-note ge-inline-style-overridden"})),ze.set(l,function(){u();var o=c()?Le(n.name,Et(t)):null,s=j(l,".ge-inline-style-overridden");s.textContent=o?e.t("inline_style.overridden",{class:o}):"",F(s,!!o)}),ye(l),l}function ye(e){var t=ze.get(e);t&&t()}function Fe(e){return(e.getAttribute("class")||"").split(/\s+/).filter(Boolean)}function Lt(e,t,n,i){var a=e.detailsOf(t,{build:!1}),l=a?M(a,".ge-classes"):null;if(l){var p=Fe(t).indexOf(i)!==-1,u=l.value.split(/\s+/).filter(Boolean).filter(function(c){return c===i?!1:!(n.exclusive&&!p&&n.classes.indexOf(c)!==-1)});p||u.push(i),l.value=u.join(" "),l.dispatchEvent(new Event("change",{bubbles:!0}))}}function Ue(e,t,n,i){var a=i.filter(function(p){return le(p,n)});if(!a.length)return null;var l=y("div",{class:"ge-inline-style-catalog"});return l.appendChild(y("span",{class:"ge-inline-style-label"},e.t("inline_style.catalog"))),a.forEach(function(p){var u=l.appendChild(y("div",{class:"ge-inline-style-chips"}));p.classes.forEach(function(c){var m=u.appendChild(y("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-inline-style-chip","data-ge-class":c,"aria-pressed":"false"},c));m.addEventListener("click",function(){Lt(e,t,p,c)})})}),ge(l,t),l}function ge(e,t){var n=Fe(t);P(e,".ge-inline-style-chip").forEach(function(i){var a=n.indexOf(i.getAttribute("data-ge-class"))!==-1;B(i,"active",a),i.setAttribute("aria-pressed",a?"true":"false")})}function Pt(e){var t=document.createElement("div").style,n=[];t.setProperty(e,"initial");for(var i=0;i<t.length;i++)n.push(t[i]);return n.length?n:[e]}function Ge(e){var t=document.createElement("div").style;return t.cssText=e,t}function Ve(e,t,n,i){var a={};n.forEach(function(m){Pt(m).forEach(function(h){a[h]=!0})});var l=y("div",{class:"ge-inline-style-custom"}),p=l.appendChild(y("textarea",{class:"form-control form-control-sm font-monospace ge-inline-style-custom-css",rows:"4",spellcheck:"false","aria-label":e.t("inline_style.section_custom")}));function u(){for(var m=Ge(e.hostStyle(t)),h=document.createElement("div").style,g=0;g<m.length;g++){var f=m[g];a[f]||h.setProperty(f,m.getPropertyValue(f),m.getPropertyPriority(f))}return h}p.addEventListener("change",function(){var m=u(),h=Ge(p.value),g;for(g=0;g<m.length;g++)h.getPropertyValue(m[g])===""&&e.setHostStyle(t,m[g],"");for(g=0;g<h.length;g++)e.setHostStyle(t,h[g],h.getPropertyValue(h[g]),h.getPropertyPriority(h[g]));c(),i()});function c(){document.activeElement!==p&&(p.value=u().cssText.replace(/; /g,`;
|
|
4
|
+
`))}return c(),{element:l,render:c}}function Rt(e,t){return t==="row"||t==="column"||t==="element"||t==="section"||D(e,"[data-ge-container]")?!0:!!j(e,".ge-tools-drawer.ge-pane-drawer")}function Bt(e,t,n){return n==="plain"&&(n="text"),e.appliesTo.indexOf(n)!==-1?!0:e.appliesTo.indexOf("container")!==-1&&D(t,"[data-ge-container]")}function $t(e,t,n,i){if(t.panel)return t.panel(n,i);var a=t.families.filter(function(p){return Bt(p,n,i)}).map(function(p){return e.utilityField(n,p.name)});if(a.length<2)return a[0]||null;var l=y("div",{class:"ge-inline-style-part-fields"});return a.forEach(function(p){l.appendChild(p)}),l}function We(e,t,n,i){var a=Rt(t,n),l=y("div",{class:"accordion ge-inline-style"}),p=[],u=[],c=[],m=null,h=null,g=function(){d()};function f(r,o){var s=l.appendChild(y("div",{class:"accordion-item","data-ge-inline-style-section":r})),b=s.appendChild(y("h2",{class:"accordion-header"})),x=b.appendChild(y("button",{type:"button",class:"accordion-button collapsed","aria-expanded":"false"},e.t(o))),_=s.appendChild(y("div",{class:"accordion-collapse collapse"})),C=_.appendChild(y("div",{class:"accordion-body"}));return x.addEventListener("click",function(){var O=!R(_,"show");i.state.open=O?r:null,i.opened(i.state.open)}),{entry:s,body:C}}function E(r,o){B(M(r,".accordion-collapse"),"show",o);var s=M(r,".accordion-button");B(s,"collapsed",!o),s.setAttribute("aria-expanded",o?"true":"false")}if(Object.keys(i.sections).forEach(function(r){var o=i.sections[r],s=o.section;if(s.custom){a&&(h=f(r,s.labelKey));return}var b=s.parts.map(function(A){return i.parts[A]?$t(e,i.parts[A],t,n):null}).filter(Boolean),x=a?o.properties.filter(function(A){return le(A,n)}):[],_=a&&o.catalog?Ue(e,t,n,s.catalog):null;if(!(!b.length&&!x.length&&!_)){var C=f(r,s.labelKey).body;if(b.forEach(function(A){C.appendChild(Z(A,"ge-inline-style-part"))}),x.length){var O=C.appendChild(y("small",{class:"ge-inline-style-note ge-inline-style-all-sizes"},e.t("inline_style.all_sizes")));c.push(O);var K=C.appendChild(y("div",{class:"ge-inline-style-fields"}));x.forEach(function(A){var G=Ie(e,t,A,g,i);p.push(G),K.appendChild(G)})}_&&(u.push(_),C.appendChild(_))}}),h&&(m=Ve(e,t,p.map(function(r){return r.getAttribute("data-ge-inline-style-property")}),g),h.body.appendChild(m.element),l.appendChild(h.entry)),!l.children.length)return null;function k(r){P(l,".accordion-item").forEach(function(o){E(o,o.getAttribute("data-ge-inline-style-section")===r)})}k(i.state.open);function d(){p.forEach(ye),u.forEach(function(r){ge(r,t)}),m&&m.render(),c.forEach(function(r){F(r,e.view()!=="all")})}return d(),{element:l,render:d,open:k}}Object.assign(T.locales.en,{"inline_style.section_title":"Style","inline_style.dialog_title":"Style: {kind}","inline_style.section_size":"Size","inline_style.section_spacing":"Spacing","inline_style.section_border":"Border","inline_style.section_background":"Background","inline_style.section_text":"Text","inline_style.section_typography":"Typography","inline_style.section_display":"Display","inline_style.section_flex":"Flex","inline_style.section_position":"Position","inline_style.section_custom":"Custom css","inline_style.all_sizes":"Applies to every size","inline_style.overridden":"The class {class} takes priority over this value","inline_style.invalid":"Not a value this property takes","inline_style.catalog":"Bootstrap classes","inline_style.browse":"Browse\u2026","inline_style.shadow_x":"X","inline_style.shadow_y":"Y","inline_style.shadow_blur":"Blur","inline_style.shadow_spread":"Spread","inline_style.shadow_color":"Color","inline_style.shadow_inset":"Inset","inline_style.shadow_text_mode":"Edit as text","inline_style.shadow_builder_mode":"Edit with the builder","inline_style.prop_width":"Width","inline_style.prop_height":"Height","inline_style.prop_min_width":"Min width","inline_style.prop_min_height":"Min height","inline_style.prop_max_width":"Max width","inline_style.prop_max_height":"Max height","inline_style.prop_margin_top":"Margin top","inline_style.prop_margin_right":"Margin right","inline_style.prop_margin_bottom":"Margin bottom","inline_style.prop_margin_left":"Margin left","inline_style.prop_padding_top":"Padding top","inline_style.prop_padding_right":"Padding right","inline_style.prop_padding_bottom":"Padding bottom","inline_style.prop_padding_left":"Padding left","inline_style.prop_border_width":"Border width","inline_style.prop_border_style":"Border style","inline_style.prop_border_color":"Border color","inline_style.prop_border_radius":"Border radius","inline_style.prop_box_shadow":"Shadow","inline_style.prop_background_color":"Background color","inline_style.prop_background_image":"Background image","inline_style.prop_background_size":"Background size","inline_style.prop_background_position":"Background position","inline_style.prop_background_repeat":"Background repeat","inline_style.prop_color":"Color","inline_style.prop_font_size":"Font size","inline_style.prop_text_align":"Text align","inline_style.prop_text_shadow":"Text shadow","inline_style.prop_font_family":"Font family","inline_style.prop_font_weight":"Font weight","inline_style.prop_font_style":"Font style","inline_style.prop_line_height":"Line height","inline_style.prop_letter_spacing":"Letter spacing","inline_style.prop_text_transform":"Text transform","inline_style.prop_text_decoration":"Text decoration","inline_style.prop_display":"Display","inline_style.prop_opacity":"Opacity","inline_style.prop_overflow":"Overflow","inline_style.prop_visibility":"Visibility","inline_style.prop_position":"Position","inline_style.prop_top":"Top","inline_style.prop_right":"Right","inline_style.prop_bottom":"Bottom","inline_style.prop_left":"Left","inline_style.prop_z_index":"Z-index"});var qe=["spacing","textalign","display","flex","float","sticky","drawerflow"];T.utilities["inline-style"]=function(e){var t=Pe(e),n={spacing:be(e,t.spacing),textalign:_e(e),display:xe(e,t.visibility),flex:we(e,t.spacing),float:Ee(e),sticky:Ce(e),drawerflow:Se(e)},i=[],a={sections:t.sections,parts:n,state:{open:null},browse:t.browse,destroyed:!1,opened:function(u){i.forEach(function(c){c.accordion.open(u)})}};function l(u){return function(){var c=arguments;qe.forEach(function(m){n[m][u]&&n[m][u].apply(null,c)})}}var p=l("onRefresh");return{families:qe.reduce(function(u,c){return u.concat(n[c].families.map(function(m){return Object.assign({},m,{panel:!1})}))},[]),panelSection:function(u,c){var m=We(e,u,c,a);return m?(i=i.filter(function(h){return h.accordion.element.isConnected}),i.push({node:u,accordion:m}),{labelKey:"inline_style.section_title",titleKey:"inline_style.dialog_title",body:m.element}):null},preview:function(u,c,m){return n.spacing.preview(u,c,m)},onRefresh:function(u){p(u),i=i.filter(function(c){return c.accordion.element.isConnected}),i.forEach(function(c){(c.node===u||u.contains(c.node))&&c.accordion.render()})},drawerTools:l("drawerTools"),onDestroy:function(){a.destroyed=!0},onDeinit:function(){l("onDeinit")(),i=[]},cleanMarkup:l("cleanMarkup")}};})();
|