@themarioga/grid-editor 9.0.0-beta.4 → 9.0.0-beta.6
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 +49 -0
- package/README.md +29 -17
- package/UPGRADING.md +24 -5
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +5 -4
- package/dist/grideditor.d.ts +10 -15
- package/dist/grideditor.esm.js +151 -113
- package/dist/grideditor.jquery.js +1 -3
- package/dist/grideditor.jquery.min.js +1 -1
- package/dist/grideditor.jquery.min.js.map +2 -2
- package/dist/grideditor.js +151 -113
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +2 -2
- package/dist/grideditor.min.js.map +3 -3
- package/dist/plugins/grideditor.accordion.esm.js +7 -0
- package/dist/plugins/grideditor.accordion.js +7 -0
- package/dist/plugins/grideditor.accordion.min.js +1 -1
- package/dist/plugins/grideditor.accordion.min.js.map +3 -3
- package/dist/plugins/grideditor.card.esm.js +4 -0
- package/dist/plugins/grideditor.card.js +4 -0
- package/dist/plugins/grideditor.card.min.js +1 -1
- package/dist/plugins/grideditor.card.min.js.map +3 -3
- package/dist/plugins/grideditor.carousel.esm.js +4 -0
- package/dist/plugins/grideditor.carousel.js +4 -0
- package/dist/plugins/grideditor.carousel.min.js +1 -1
- package/dist/plugins/grideditor.carousel.min.js.map +2 -2
- package/dist/plugins/grideditor.clipboard.esm.js +3 -18
- package/dist/plugins/grideditor.clipboard.js +3 -18
- package/dist/plugins/grideditor.clipboard.min.js +1 -1
- package/dist/plugins/grideditor.clipboard.min.js.map +3 -3
- package/dist/plugins/grideditor.history.esm.js +1 -6
- package/dist/plugins/grideditor.history.js +1 -6
- package/dist/plugins/grideditor.history.min.js +1 -1
- package/dist/plugins/grideditor.history.min.js.map +3 -3
- package/dist/plugins/grideditor.offcanvas.esm.js +185 -4
- package/dist/plugins/grideditor.offcanvas.js +185 -4
- package/dist/plugins/grideditor.offcanvas.min.js +1 -1
- package/dist/plugins/grideditor.offcanvas.min.js.map +3 -3
- package/dist/plugins/grideditor.popup.esm.js +185 -4
- package/dist/plugins/grideditor.popup.js +185 -4
- package/dist/plugins/grideditor.popup.min.js +1 -1
- package/dist/plugins/grideditor.popup.min.js.map +3 -3
- package/dist/plugins/grideditor.tabs.esm.js +4 -0
- package/dist/plugins/grideditor.tabs.js +4 -0
- package/dist/plugins/grideditor.tabs.min.js +1 -1
- package/dist/plugins/grideditor.tabs.min.js.map +2 -2
- package/docs/events.md +14 -11
- package/docs/plugins.md +20 -8
- package/example/clipboard.html +13 -10
- package/package.json +1 -1
- package/src/js/grideditor.jquery.js +0 -2
- package/src/js/grideditor.js +211 -125
- package/src/js/plugins/grideditor.accordion.js +9 -0
- package/src/js/plugins/grideditor.card.js +5 -0
- package/src/js/plugins/grideditor.carousel.js +5 -0
- package/src/js/plugins/grideditor.clipboard.js +11 -24
- package/src/js/plugins/grideditor.history.js +3 -6
- package/src/js/plugins/grideditor.offcanvas.js +8 -0
- package/src/js/plugins/grideditor.popup.js +7 -0
- package/src/js/plugins/grideditor.tabs.js +5 -0
- package/src/js/triggers/triggers.js +211 -11
- package/src/less/grideditor.less +5 -4
- package/types/grideditor.d.ts +10 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/js/register.js", "../../src/js/dom.js", "../../src/js/plugins/grideditor.tabs.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are jQuery's: 400 ms unless the caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Tabs for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a tabs container. What it can ask the editor for is the handle its factory is\n * called with, described in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.tabs.min.js\"></script>\n *\n * A container's variant - its style, width, alignment and whether it is laid\n * out vertically, from a breakpoint up - is Bootstrap's classes on its strip\n * and on itself, and nothing else: it is read from the markup, chosen in the\n * container's settings panel, or given to createContainer and the tabs\n * setting for the ones made new.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_tabs': 'Tabs',\n 'container.add_tab': 'Add tab',\n 'container.tab_label': 'Tab {number}',\n 'confirm.delete_tab': 'Delete this tab and everything in it?',\n 'container.tabs_section': 'Tabs',\n 'container.tabs_style': 'Style',\n 'container.tabs_style_tabs': 'Tabs',\n 'container.tabs_style_pills': 'Pills',\n 'container.tabs_style_underline': 'Underline',\n 'container.tabs_width': 'Width',\n 'container.tabs_width_natural': 'Natural',\n 'container.tabs_width_fill': 'Fill',\n 'container.tabs_width_justified': 'Justified',\n 'container.tabs_align': 'Alignment',\n 'container.tabs_align_start': 'Start',\n 'container.tabs_align_center': 'Center',\n 'container.tabs_align_end': 'End',\n 'container.tabs_layout': 'Layout',\n 'container.tabs_layout_horizontal': 'Horizontal',\n 'container.tabs_layout_vertical': 'Vertical',\n 'container.tabs_layout_vertical_from': 'Vertical from {breakpoint}',\n});\n\n/** Each variant's values, the first its default, and the class each puts on the strip. */\nvar STYLES = { tabs: 'nav-tabs', pills: 'nav-pills', underline: 'nav-underline' };\nvar WIDTHS = { natural: null, fill: 'nav-fill', justified: 'nav-justified' };\nvar ALIGNS = { start: null, center: 'justify-content-center', end: 'justify-content-end' };\nvar DEFAULTS = { variant: 'tabs', width: 'natural', align: 'start', vertical: false };\n\n/** Each variant's select in the panel: its label, and its choices'. */\nvar FIELDS = {\n variant: { labelKey: 'container.tabs_style', choices: [\n { value: 'tabs', labelKey: 'container.tabs_style_tabs' },\n { value: 'pills', labelKey: 'container.tabs_style_pills' },\n { value: 'underline', labelKey: 'container.tabs_style_underline' },\n ] },\n width: { labelKey: 'container.tabs_width', choices: [\n { value: 'natural', labelKey: 'container.tabs_width_natural' },\n { value: 'fill', labelKey: 'container.tabs_width_fill' },\n { value: 'justified', labelKey: 'container.tabs_width_justified' },\n ] },\n align: { labelKey: 'container.tabs_align', choices: [\n { value: 'start', labelKey: 'container.tabs_align_start' },\n { value: 'center', labelKey: 'container.tabs_align_center' },\n { value: 'end', labelKey: 'container.tabs_align_end' },\n ] },\n vertical: { labelKey: 'container.tabs_layout' },\n};\n\nvar fieldCounter = 0;\n\n/** Where the layout marks what the view being edited lays the tabs out as. */\nvar LAYOUT_ATTR = 'data-ge-tabs-layout';\n\nfunction classValues(map) {\n return Object.keys(map).map(function(key) { return map[key]; }).filter(Boolean);\n}\n\nGridEditor.containers.tabs = function(ge) {\n\n var sections = []; // { container, render } for every panel section built\n\n /** The strip: the container's first .nav, whatever its style. */\n function stripOf(container) {\n return dom.child(container, '.nav');\n }\n\n /** The breakpoints a layout can go vertical from; xs is always. */\n function fromBreakpoints() {\n return ge.breakpoints.slice(1);\n }\n\n /** The infix of a vertical layout's classes: none for always. */\n function infix(vertical) {\n return vertical === true ? '' : '-' + vertical;\n }\n\n function verticalClasses(vertical) {\n var at = infix(vertical);\n\n return {\n container: ['d' + at + '-flex', 'align-items' + at + '-start'],\n strip: ['flex' + at + '-column', 'me' + at + '-3'],\n };\n }\n\n /** Every vertical value: always, and from each breakpoint. */\n function verticals() {\n return [true].concat(fromBreakpoints());\n }\n\n /**\n * What a container's classes say it is. Vertical is read only when the\n * container's flex and the strip's column are of the same breakpoint;\n * anything else is horizontal, and is left as it is.\n */\n function read(container) {\n var strip = stripOf(container);\n var has = function(node, name) { return !!node && dom.hasClass(node, name); };\n var found = function(map, fallback) {\n return Object.keys(map).filter(function(key) { return map[key] && has(strip, map[key]); })[0] || fallback;\n };\n\n var vertical = verticals().filter(function(each) {\n var classes = verticalClasses(each);\n return has(container, classes.container[0]) && has(strip, classes.strip[0]);\n })[0];\n\n return {\n variant: found(STYLES, 'tabs'),\n width: found(WIDTHS, 'natural'),\n align: found(ALIGNS, 'start'),\n vertical: vertical === undefined ? false : vertical,\n };\n }\n\n /**\n * Write one variant, and take off what it makes meaningless: a vertical\n * layout has no width or alignment, and a full width no alignment.\n * Choosing a layout clears every layout class, at any breakpoint, the\n * user's own included.\n */\n function write(container, key, value) {\n var strip = stripOf(container);\n if (!strip) { return; }\n\n if (key === 'variant') {\n dom.removeClass(strip, classValues(STYLES).join(' '));\n dom.addClass(strip, STYLES[value]);\n }\n\n if (key === 'width' || key === 'vertical') {\n dom.removeClass(strip, classValues(WIDTHS).join(' '));\n if (key === 'width' && WIDTHS[value]) { dom.addClass(strip, WIDTHS[value]); }\n }\n\n if (key === 'align' || key === 'vertical' || (key === 'width' && value !== 'natural')) {\n dom.removeClass(strip, classValues(ALIGNS).join(' '));\n if (key === 'align' && ALIGNS[value]) { dom.addClass(strip, ALIGNS[value]); }\n }\n\n if (key === 'vertical') {\n verticals().forEach(function(each) {\n var classes = verticalClasses(each);\n dom.removeClass(container, classes.container.join(' '));\n dom.removeClass(strip, classes.strip.join(' '));\n });\n strip.removeAttribute('aria-orientation');\n\n if (value !== false) {\n var layout = verticalClasses(value);\n dom.addClass(container, layout.container.join(' '));\n dom.addClass(strip, layout.strip.join(' '));\n strip.setAttribute('aria-orientation', 'vertical');\n }\n }\n\n dom.dropEmptyClass(container);\n }\n\n /** The values a variant takes, as the warning lists them. */\n function valuesOf(key) {\n if (key === 'variant') { return Object.keys(STYLES); }\n if (key === 'width') { return Object.keys(WIDTHS); }\n if (key === 'align') { return Object.keys(ALIGNS); }\n\n return [false].concat(verticals());\n }\n\n /**\n * A variant for a new container: the option, or the tabs setting, or the\n * default. A value it does not take is warned about and the default used.\n */\n function chosen(options, key) {\n var setting = ge.settings.tabs || {};\n var value = options[key] !== undefined ? options[key] : setting[key];\n\n if (value === undefined) { return DEFAULTS[key]; }\n if (valuesOf(key).indexOf(value) !== -1) { return value; }\n\n ge.warn('tabs: ' + JSON.stringify(value) + ' is not a ' + key + ', which takes ' +\n JSON.stringify(valuesOf(key)) + ': ' + JSON.stringify(DEFAULTS[key]) + ' is used');\n return DEFAULTS[key];\n }\n\n /**\n * What the view being edited lays a container out as. A breakpoint view\n * narrows the canvas, not the window, and Bootstrap's classes answer to\n * the window: so the view says it, from the breakpoint the container\n * goes vertical at. The all view shows what the window gives.\n */\n function layoutHere(container) {\n var vertical = read(container).vertical;\n if (vertical === false) { return null; }\n\n if (ge.view() === 'all') {\n container.removeAttribute(LAYOUT_ATTR);\n return /flex$/.test(getComputedStyle(container).display) ? 'vertical' : 'horizontal';\n }\n if (vertical === true) { return 'vertical'; }\n\n return ge.breakpoints.indexOf(ge.view()) >= ge.breakpoints.indexOf(vertical) ? 'vertical' : 'horizontal';\n }\n\n function markLayout(container) {\n var layout = layoutHere(container);\n\n if (layout) {\n container.setAttribute(LAYOUT_ATTR, layout);\n } else {\n container.removeAttribute(LAYOUT_ATTR);\n }\n }\n\n function select(labelKey, options, onChange) {\n var box = dom.element('div', { 'class': 'ge-tabs-variant' });\n var id = 'ge-tabs-variant-' + (++fieldCounter);\n\n box.appendChild(dom.element('label', { 'class': 'form-label', 'for': id }, ge.t(labelKey)));\n var field = box.appendChild(dom.element('select', { 'class': 'form-select form-select-sm', id: id }));\n\n options.forEach(function(option) {\n field.appendChild(dom.element('option', { value: option.value }, option.label));\n });\n field.addEventListener('change', function() { onChange(field.value); });\n\n return { box: box, field: field };\n }\n\n /** The Tabs section of a tabs container's settings panel: a select per variant. */\n function createSection(container) {\n var body = dom.element('div', { 'class': 'ge-tabs-variants' });\n var fields = {};\n\n function change(key, value) {\n write(container, key, value);\n markLayout(container);\n render();\n }\n\n function options(key) {\n return FIELDS[key].choices.map(function(choice) {\n return { value: choice.value, label: ge.t(choice.labelKey) };\n });\n }\n\n ['variant', 'width', 'align'].forEach(function(key) {\n fields[key] = select(FIELDS[key].labelKey, options(key), function(value) { change(key, value); });\n });\n fields.vertical = select(FIELDS.vertical.labelKey, [\n { value: 'false', label: ge.t('container.tabs_layout_horizontal') },\n { value: 'true', label: ge.t('container.tabs_layout_vertical') },\n ].concat(fromBreakpoints().map(function(key) {\n return { value: key, label: ge.t('container.tabs_layout_vertical_from', { breakpoint: key }) };\n })), function(value) {\n change('vertical', value === 'true' ? true : value === 'false' ? false : value);\n });\n\n ['variant', 'width', 'align', 'vertical'].forEach(function(key) {\n fields[key].box.setAttribute('data-ge-tabs-variant', key);\n body.appendChild(fields[key].box);\n });\n\n /** Fill the selects from the classes, and turn off what does not apply. */\n function render() {\n var values = read(container);\n\n fields.variant.field.value = values.variant;\n fields.width.field.value = values.width;\n fields.align.field.value = values.align;\n fields.vertical.field.value = String(values.vertical);\n fields.width.field.disabled = values.vertical !== false;\n fields.align.field.disabled = values.vertical !== false || values.width !== 'natural';\n }\n\n render();\n sections.push({ container: container, element: body, render: render });\n\n return body;\n }\n\n function addTabTo(container, options) {\n options = options || {};\n\n var strip = stripOf(container);\n var content = dom.one(container, ':scope > .tab-content');\n var id = ge.containerId('tab');\n var number = dom.children(strip, '.nav-item').length + 1;\n\n var tab = strip.appendChild(dom.element('li', { 'class': 'nav-item ge-tab', role: 'presentation' }));\n var button = tab.appendChild(dom.element('button', {\n 'class': 'nav-link',\n type: 'button',\n role: 'tab',\n 'data-bs-toggle': 'tab',\n 'data-bs-target': '#' + id,\n 'aria-controls': id,\n }));\n button.appendChild(dom.element('span', { 'class': 'ge-pane-label' },\n options.label || ge.t('container.tab_label', { number: number })));\n\n var pane = content.appendChild(dom.element('div', {\n 'class': 'tab-pane fade',\n role: 'tabpanel',\n tabindex: '0',\n id: id,\n }));\n pane.appendChild(ge.defaultRegion());\n\n if (options.activate || number === 1) { activatePane(container, pane); }\n\n return pane;\n }\n\n function activatePane(container, pane) {\n var id = pane.getAttribute('id');\n\n dom.all(container, ':scope > .tab-content > .tab-pane').forEach(function(each) {\n dom.removeClass(each, 'show active');\n });\n dom.addClass(pane, 'show active');\n\n dom.all(stripOf(container) || container, '.nav-link').forEach(function(button) {\n var active = button.getAttribute('data-bs-target') === '#' + id;\n\n dom.toggleClass(button, 'active', active);\n button.setAttribute('aria-selected', active ? 'true' : 'false');\n });\n }\n\n function paneOf(container, tab) {\n var link = dom.one(tab, '.nav-link');\n var target = link ? link.getAttribute('data-bs-target') : null;\n\n return target ? dom.one(container, target) : null;\n }\n\n return {\n labelKey: 'container.add_tabs',\n\n // A tab strip sorts its own tabs, and the panes follow them. No\n // group: a tab belongs to the strip it was made in.\n onSortable: function(sortable) {\n sortable(dom.all(ge.canvas, '.ge-container-tabs').map(stripOf).filter(Boolean), {\n draggable: '.ge-tab',\n });\n },\n addPaneKey: 'container.add_tab',\n paneKind: 'tab',\n\n create: function(options) {\n var container = dom.element('div', { 'data-ge-container': 'tabs' });\n var labels = options.labels || [];\n var count = options.tabs || labels.length || 2;\n\n container.appendChild(dom.element('ul', { 'class': 'nav nav-tabs', role: 'tablist' }));\n container.appendChild(dom.element('div', { 'class': 'tab-content' }));\n\n // The layout last: it takes off what a vertical strip has no use for\n ['variant', 'width', 'align', 'vertical'].forEach(function(key) {\n write(container, key, chosen(options, key));\n });\n\n for (var i = 0; i < count; i++) {\n addTabTo(container, { label: labels[i] });\n }\n\n return container;\n },\n\n addPane: addTabTo,\n\n mark: function(container) {\n dom.all(container, ':scope > .tab-content > .tab-pane').forEach(function(pane) {\n dom.addClass(pane, 'ge-tab-pane');\n });\n\n dom.children(stripOf(container) || container, '.nav-item').forEach(function(tab) {\n dom.addClass(tab, 'ge-tab');\n\n var link = dom.one(tab, '.nav-link');\n if (link) { ge.makeLabelEditable(ge.labelIn(link)); }\n\n if (dom.child(tab, '.ge-tools-drawer')) { return; }\n\n ge.createPaneControls(tab, 'tab', ge.settings.tab_tools, ge.t('confirm.delete_tab'),\n function(removed) {\n var pane = paneOf(container, tab);\n var wasActive = dom.hasClass(pane, 'active');\n\n dom.fadeOut(tab, 200, function() {\n if (pane) { pane.remove(); }\n removed();\n\n var first = dom.one(container, ':scope > .tab-content > .tab-pane');\n if (wasActive && first) { activatePane(container, first); }\n });\n });\n });\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n container.removeAttribute(LAYOUT_ATTR);\n dom.all(container, '.ge-tab-pane').forEach(function(pane) {\n dom.removeClass(pane, 'ge-tab-pane');\n });\n dom.all(container, '.ge-tab').forEach(function(tab) {\n dom.removeClass(tab, 'ge-tab');\n dom.dropEmptyClass(tab);\n });\n ge.unwrapLabels(container);\n },\n\n // The same, on a copy of the canvas: unmark only touches markup\n cleanMarkup: function(root) {\n var definition = this;\n dom.all(root, '[data-ge-container=\"tabs\"]').forEach(function(container) { definition.unmark(container); });\n },\n\n panelSection: function(node, kind) {\n if (kind !== 'tabs' || !stripOf(node)) { return null; }\n\n return { labelKey: 'container.tabs_section', body: createSection(node) };\n },\n\n // After a view change or a change of classes: the layout marks and the\n // sections follow\n onRefresh: function(scope) {\n dom.selfAndAll(scope, '[data-ge-container=\"tabs\"]').forEach(markLayout);\n\n sections = sections.filter(function(entry) { return entry.element.isConnected; });\n sections.forEach(function(entry) {\n if (entry.container === scope || scope.contains(entry.container)) { entry.render(); }\n });\n },\n\n onDeinit: function() {\n sections = [];\n },\n\n /** Panes read in tab order, whatever order they were dropped in. */\n afterPaneMove: function(container) {\n var content = dom.one(container, ':scope > .tab-content');\n\n dom.children(stripOf(container) || container, '.nav-item').forEach(function(tab) {\n var pane = paneOf(container, tab);\n if (pane) { content.appendChild(pane); }\n });\n },\n };\n};\n"],
|
|
5
|
-
"mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECCvC,SAASC,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,cA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ASlD,EAAQC,CAAS,GAAKA,EAAW,WAAW,EAAE,QAAQ,SAASkD,EAAK,CAC7E,IAAIE,EAAOK,EAAOzD,EAAWkD,CAAG,EAC5BE,GAAQN,EAAQ,YAAYM,CAAI,CACxC,CAAC,CACL,CACJ,CACJ",
|
|
4
|
+
"sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are jQuery's: 400 ms unless the caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Tabs for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a tabs container. What it can ask the editor for is the handle its factory is\n * called with, described in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.tabs.min.js\"></script>\n *\n * A container's variant - its style, width, alignment and whether it is laid\n * out vertically, from a breakpoint up - is Bootstrap's classes on its strip\n * and on itself, and nothing else: it is read from the markup, chosen in the\n * container's settings panel, or given to createContainer and the tabs\n * setting for the ones made new.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_tabs': 'Tabs',\n 'container.add_tab': 'Add tab',\n 'container.tab_label': 'Tab {number}',\n 'confirm.delete_tab': 'Delete this tab and everything in it?',\n 'container.tabs_section': 'Tabs',\n 'container.tabs_style': 'Style',\n 'container.tabs_style_tabs': 'Tabs',\n 'container.tabs_style_pills': 'Pills',\n 'container.tabs_style_underline': 'Underline',\n 'container.tabs_width': 'Width',\n 'container.tabs_width_natural': 'Natural',\n 'container.tabs_width_fill': 'Fill',\n 'container.tabs_width_justified': 'Justified',\n 'container.tabs_align': 'Alignment',\n 'container.tabs_align_start': 'Start',\n 'container.tabs_align_center': 'Center',\n 'container.tabs_align_end': 'End',\n 'container.tabs_layout': 'Layout',\n 'container.tabs_layout_horizontal': 'Horizontal',\n 'container.tabs_layout_vertical': 'Vertical',\n 'container.tabs_layout_vertical_from': 'Vertical from {breakpoint}',\n});\n\n/** Each variant's values, the first its default, and the class each puts on the strip. */\nvar STYLES = { tabs: 'nav-tabs', pills: 'nav-pills', underline: 'nav-underline' };\nvar WIDTHS = { natural: null, fill: 'nav-fill', justified: 'nav-justified' };\nvar ALIGNS = { start: null, center: 'justify-content-center', end: 'justify-content-end' };\nvar DEFAULTS = { variant: 'tabs', width: 'natural', align: 'start', vertical: false };\n\n/** Each variant's select in the panel: its label, and its choices'. */\nvar FIELDS = {\n variant: { labelKey: 'container.tabs_style', choices: [\n { value: 'tabs', labelKey: 'container.tabs_style_tabs' },\n { value: 'pills', labelKey: 'container.tabs_style_pills' },\n { value: 'underline', labelKey: 'container.tabs_style_underline' },\n ] },\n width: { labelKey: 'container.tabs_width', choices: [\n { value: 'natural', labelKey: 'container.tabs_width_natural' },\n { value: 'fill', labelKey: 'container.tabs_width_fill' },\n { value: 'justified', labelKey: 'container.tabs_width_justified' },\n ] },\n align: { labelKey: 'container.tabs_align', choices: [\n { value: 'start', labelKey: 'container.tabs_align_start' },\n { value: 'center', labelKey: 'container.tabs_align_center' },\n { value: 'end', labelKey: 'container.tabs_align_end' },\n ] },\n vertical: { labelKey: 'container.tabs_layout' },\n};\n\nvar fieldCounter = 0;\n\n/** Where the layout marks what the view being edited lays the tabs out as. */\nvar LAYOUT_ATTR = 'data-ge-tabs-layout';\n\nfunction classValues(map) {\n return Object.keys(map).map(function(key) { return map[key]; }).filter(Boolean);\n}\n\nGridEditor.containers.tabs = function(ge) {\n\n var sections = []; // { container, render } for every panel section built\n\n /** The strip: the container's first .nav, whatever its style. */\n function stripOf(container) {\n return dom.child(container, '.nav');\n }\n\n /** The breakpoints a layout can go vertical from; xs is always. */\n function fromBreakpoints() {\n return ge.breakpoints.slice(1);\n }\n\n /** The infix of a vertical layout's classes: none for always. */\n function infix(vertical) {\n return vertical === true ? '' : '-' + vertical;\n }\n\n function verticalClasses(vertical) {\n var at = infix(vertical);\n\n return {\n container: ['d' + at + '-flex', 'align-items' + at + '-start'],\n strip: ['flex' + at + '-column', 'me' + at + '-3'],\n };\n }\n\n /** Every vertical value: always, and from each breakpoint. */\n function verticals() {\n return [true].concat(fromBreakpoints());\n }\n\n /**\n * What a container's classes say it is. Vertical is read only when the\n * container's flex and the strip's column are of the same breakpoint;\n * anything else is horizontal, and is left as it is.\n */\n function read(container) {\n var strip = stripOf(container);\n var has = function(node, name) { return !!node && dom.hasClass(node, name); };\n var found = function(map, fallback) {\n return Object.keys(map).filter(function(key) { return map[key] && has(strip, map[key]); })[0] || fallback;\n };\n\n var vertical = verticals().filter(function(each) {\n var classes = verticalClasses(each);\n return has(container, classes.container[0]) && has(strip, classes.strip[0]);\n })[0];\n\n return {\n variant: found(STYLES, 'tabs'),\n width: found(WIDTHS, 'natural'),\n align: found(ALIGNS, 'start'),\n vertical: vertical === undefined ? false : vertical,\n };\n }\n\n /**\n * Write one variant, and take off what it makes meaningless: a vertical\n * layout has no width or alignment, and a full width no alignment.\n * Choosing a layout clears every layout class, at any breakpoint, the\n * user's own included.\n */\n function write(container, key, value) {\n var strip = stripOf(container);\n if (!strip) { return; }\n\n if (key === 'variant') {\n dom.removeClass(strip, classValues(STYLES).join(' '));\n dom.addClass(strip, STYLES[value]);\n }\n\n if (key === 'width' || key === 'vertical') {\n dom.removeClass(strip, classValues(WIDTHS).join(' '));\n if (key === 'width' && WIDTHS[value]) { dom.addClass(strip, WIDTHS[value]); }\n }\n\n if (key === 'align' || key === 'vertical' || (key === 'width' && value !== 'natural')) {\n dom.removeClass(strip, classValues(ALIGNS).join(' '));\n if (key === 'align' && ALIGNS[value]) { dom.addClass(strip, ALIGNS[value]); }\n }\n\n if (key === 'vertical') {\n verticals().forEach(function(each) {\n var classes = verticalClasses(each);\n dom.removeClass(container, classes.container.join(' '));\n dom.removeClass(strip, classes.strip.join(' '));\n });\n strip.removeAttribute('aria-orientation');\n\n if (value !== false) {\n var layout = verticalClasses(value);\n dom.addClass(container, layout.container.join(' '));\n dom.addClass(strip, layout.strip.join(' '));\n strip.setAttribute('aria-orientation', 'vertical');\n }\n }\n\n dom.dropEmptyClass(container);\n }\n\n /** The values a variant takes, as the warning lists them. */\n function valuesOf(key) {\n if (key === 'variant') { return Object.keys(STYLES); }\n if (key === 'width') { return Object.keys(WIDTHS); }\n if (key === 'align') { return Object.keys(ALIGNS); }\n\n return [false].concat(verticals());\n }\n\n /**\n * A variant for a new container: the option, or the tabs setting, or the\n * default. A value it does not take is warned about and the default used.\n */\n function chosen(options, key) {\n var setting = ge.settings.tabs || {};\n var value = options[key] !== undefined ? options[key] : setting[key];\n\n if (value === undefined) { return DEFAULTS[key]; }\n if (valuesOf(key).indexOf(value) !== -1) { return value; }\n\n ge.warn('tabs: ' + JSON.stringify(value) + ' is not a ' + key + ', which takes ' +\n JSON.stringify(valuesOf(key)) + ': ' + JSON.stringify(DEFAULTS[key]) + ' is used');\n return DEFAULTS[key];\n }\n\n /**\n * What the view being edited lays a container out as. A breakpoint view\n * narrows the canvas, not the window, and Bootstrap's classes answer to\n * the window: so the view says it, from the breakpoint the container\n * goes vertical at. The all view shows what the window gives.\n */\n function layoutHere(container) {\n var vertical = read(container).vertical;\n if (vertical === false) { return null; }\n\n if (ge.view() === 'all') {\n container.removeAttribute(LAYOUT_ATTR);\n return /flex$/.test(getComputedStyle(container).display) ? 'vertical' : 'horizontal';\n }\n if (vertical === true) { return 'vertical'; }\n\n return ge.breakpoints.indexOf(ge.view()) >= ge.breakpoints.indexOf(vertical) ? 'vertical' : 'horizontal';\n }\n\n function markLayout(container) {\n var layout = layoutHere(container);\n\n if (layout) {\n container.setAttribute(LAYOUT_ATTR, layout);\n } else {\n container.removeAttribute(LAYOUT_ATTR);\n }\n }\n\n function select(labelKey, options, onChange) {\n var box = dom.element('div', { 'class': 'ge-tabs-variant' });\n var id = 'ge-tabs-variant-' + (++fieldCounter);\n\n box.appendChild(dom.element('label', { 'class': 'form-label', 'for': id }, ge.t(labelKey)));\n var field = box.appendChild(dom.element('select', { 'class': 'form-select form-select-sm', id: id }));\n\n options.forEach(function(option) {\n field.appendChild(dom.element('option', { value: option.value }, option.label));\n });\n field.addEventListener('change', function() { onChange(field.value); });\n\n return { box: box, field: field };\n }\n\n /** The Tabs section of a tabs container's settings panel: a select per variant. */\n function createSection(container) {\n var body = dom.element('div', { 'class': 'ge-tabs-variants' });\n var fields = {};\n\n function change(key, value) {\n write(container, key, value);\n markLayout(container);\n render();\n }\n\n function options(key) {\n return FIELDS[key].choices.map(function(choice) {\n return { value: choice.value, label: ge.t(choice.labelKey) };\n });\n }\n\n ['variant', 'width', 'align'].forEach(function(key) {\n fields[key] = select(FIELDS[key].labelKey, options(key), function(value) { change(key, value); });\n });\n fields.vertical = select(FIELDS.vertical.labelKey, [\n { value: 'false', label: ge.t('container.tabs_layout_horizontal') },\n { value: 'true', label: ge.t('container.tabs_layout_vertical') },\n ].concat(fromBreakpoints().map(function(key) {\n return { value: key, label: ge.t('container.tabs_layout_vertical_from', { breakpoint: key }) };\n })), function(value) {\n change('vertical', value === 'true' ? true : value === 'false' ? false : value);\n });\n\n ['variant', 'width', 'align', 'vertical'].forEach(function(key) {\n fields[key].box.setAttribute('data-ge-tabs-variant', key);\n body.appendChild(fields[key].box);\n });\n\n /** Fill the selects from the classes, and turn off what does not apply. */\n function render() {\n var values = read(container);\n\n fields.variant.field.value = values.variant;\n fields.width.field.value = values.width;\n fields.align.field.value = values.align;\n fields.vertical.field.value = String(values.vertical);\n fields.width.field.disabled = values.vertical !== false;\n fields.align.field.disabled = values.vertical !== false || values.width !== 'natural';\n }\n\n render();\n sections.push({ container: container, element: body, render: render });\n\n return body;\n }\n\n function addTabTo(container, options) {\n options = options || {};\n\n var strip = stripOf(container);\n var content = dom.one(container, ':scope > .tab-content');\n var id = ge.containerId('tab');\n var number = dom.children(strip, '.nav-item').length + 1;\n\n var tab = strip.appendChild(dom.element('li', { 'class': 'nav-item ge-tab', role: 'presentation' }));\n var button = tab.appendChild(dom.element('button', {\n 'class': 'nav-link',\n type: 'button',\n role: 'tab',\n 'data-bs-toggle': 'tab',\n 'data-bs-target': '#' + id,\n 'aria-controls': id,\n }));\n button.appendChild(dom.element('span', { 'class': 'ge-pane-label' },\n options.label || ge.t('container.tab_label', { number: number })));\n\n var pane = content.appendChild(dom.element('div', {\n 'class': 'tab-pane fade',\n role: 'tabpanel',\n tabindex: '0',\n id: id,\n }));\n pane.appendChild(ge.defaultRegion());\n\n if (options.activate || number === 1) { activatePane(container, pane); }\n\n return pane;\n }\n\n function activatePane(container, pane) {\n var id = pane.getAttribute('id');\n\n dom.all(container, ':scope > .tab-content > .tab-pane').forEach(function(each) {\n dom.removeClass(each, 'show active');\n });\n dom.addClass(pane, 'show active');\n\n dom.all(stripOf(container) || container, '.nav-link').forEach(function(button) {\n var active = button.getAttribute('data-bs-target') === '#' + id;\n\n dom.toggleClass(button, 'active', active);\n button.setAttribute('aria-selected', active ? 'true' : 'false');\n });\n }\n\n function paneOf(container, tab) {\n var link = dom.one(tab, '.nav-link');\n var target = link ? link.getAttribute('data-bs-target') : null;\n\n return target ? dom.one(container, target) : null;\n }\n\n return {\n labelKey: 'container.add_tabs',\n\n // A tab strip sorts its own tabs, and the panes follow them. No\n // group: a tab belongs to the strip it was made in.\n onSortable: function(sortable) {\n sortable(dom.all(ge.canvas, '.ge-container-tabs').map(stripOf).filter(Boolean), {\n draggable: '.ge-tab',\n });\n },\n addPaneKey: 'container.add_tab',\n paneKind: 'tab',\n\n // Where rows go: the pane showing, or the pane of the tab\n regionOf: function(container, tab) {\n return tab ? paneOf(container, tab) : dom.one(container, ':scope > .tab-content > .tab-pane.active');\n },\n\n create: function(options) {\n var container = dom.element('div', { 'data-ge-container': 'tabs' });\n var labels = options.labels || [];\n var count = options.tabs || labels.length || 2;\n\n container.appendChild(dom.element('ul', { 'class': 'nav nav-tabs', role: 'tablist' }));\n container.appendChild(dom.element('div', { 'class': 'tab-content' }));\n\n // The layout last: it takes off what a vertical strip has no use for\n ['variant', 'width', 'align', 'vertical'].forEach(function(key) {\n write(container, key, chosen(options, key));\n });\n\n for (var i = 0; i < count; i++) {\n addTabTo(container, { label: labels[i] });\n }\n\n return container;\n },\n\n addPane: addTabTo,\n\n mark: function(container) {\n dom.all(container, ':scope > .tab-content > .tab-pane').forEach(function(pane) {\n dom.addClass(pane, 'ge-tab-pane');\n });\n\n dom.children(stripOf(container) || container, '.nav-item').forEach(function(tab) {\n dom.addClass(tab, 'ge-tab');\n\n var link = dom.one(tab, '.nav-link');\n if (link) { ge.makeLabelEditable(ge.labelIn(link)); }\n\n if (dom.child(tab, '.ge-tools-drawer')) { return; }\n\n ge.createPaneControls(tab, 'tab', ge.settings.tab_tools, ge.t('confirm.delete_tab'),\n function(removed) {\n var pane = paneOf(container, tab);\n var wasActive = dom.hasClass(pane, 'active');\n\n dom.fadeOut(tab, 200, function() {\n if (pane) { pane.remove(); }\n removed();\n\n var first = dom.one(container, ':scope > .tab-content > .tab-pane');\n if (wasActive && first) { activatePane(container, first); }\n });\n });\n });\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n container.removeAttribute(LAYOUT_ATTR);\n dom.all(container, '.ge-tab-pane').forEach(function(pane) {\n dom.removeClass(pane, 'ge-tab-pane');\n });\n dom.all(container, '.ge-tab').forEach(function(tab) {\n dom.removeClass(tab, 'ge-tab');\n dom.dropEmptyClass(tab);\n });\n ge.unwrapLabels(container);\n },\n\n // The same, on a copy of the canvas: unmark only touches markup\n cleanMarkup: function(root) {\n var definition = this;\n dom.all(root, '[data-ge-container=\"tabs\"]').forEach(function(container) { definition.unmark(container); });\n },\n\n panelSection: function(node, kind) {\n if (kind !== 'tabs' || !stripOf(node)) { return null; }\n\n return { labelKey: 'container.tabs_section', body: createSection(node) };\n },\n\n // After a view change or a change of classes: the layout marks and the\n // sections follow\n onRefresh: function(scope) {\n dom.selfAndAll(scope, '[data-ge-container=\"tabs\"]').forEach(markLayout);\n\n sections = sections.filter(function(entry) { return entry.element.isConnected; });\n sections.forEach(function(entry) {\n if (entry.container === scope || scope.contains(entry.container)) { entry.render(); }\n });\n },\n\n onDeinit: function() {\n sections = [];\n },\n\n /** Panes read in tab order, whatever order they were dropped in. */\n afterPaneMove: function(container) {\n var content = dom.one(container, ':scope > .tab-content');\n\n dom.children(stripOf(container) || container, '.nav-item').forEach(function(tab) {\n var pane = paneOf(container, tab);\n if (pane) { content.appendChild(pane); }\n });\n },\n };\n};\n"],
|
|
5
|
+
"mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECCvC,SAASC,EAAIC,EAAMC,EAAU,CAChC,OAAOD,EAAO,MAAM,UAAU,MAAM,KAAKA,EAAK,iBAAiBC,CAAQ,CAAC,EAAI,CAAC,CACjF,CAGO,SAASC,EAAIF,EAAMC,EAAU,CAChC,OAAOD,EAAOA,EAAK,cAAcC,CAAQ,EAAI,IACjD,CAGO,SAASE,EAAWH,EAAMC,EAAU,CACvC,GAAI,CAACD,EAAQ,MAAO,CAAC,EAErB,IAAII,EAAQL,EAAIC,EAAMC,CAAQ,EAC9B,OAAID,EAAK,WAAa,GAAKA,EAAK,QAAQC,CAAQ,GAAKG,EAAM,QAAQJ,CAAI,EAChEI,CACX,CAGO,SAASC,EAASC,EAAML,EAAU,CACrC,OAAKK,EAEE,MAAM,UAAU,OAAO,KAAKA,EAAK,SAAU,SAASC,EAAM,CAC7D,MAAO,CAACN,GAAYM,EAAK,QAAQN,CAAQ,CAC7C,CAAC,EAJmB,CAAC,CAKzB,CAGO,SAASO,EAAMF,EAAML,EAAU,CAClC,OAAOI,EAASC,EAAML,CAAQ,EAAE,CAAC,GAAK,IAC1C,CA6DO,SAASQ,EAAQC,EAAKC,EAAYC,EAAM,CAC3C,IAAIC,EAAO,SAAS,cAAcH,CAAG,EAErC,cAAO,KAAKC,GAAc,CAAC,CAAC,EAAE,QAAQ,SAASG,EAAM,CACjD,I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YAAa,SAASoE,EAAM,CACxB,IAAIC,EAAa,KACbf,EAAIc,EAAM,4BAA4B,EAAE,QAAQ,SAASpE,EAAW,CAAEqE,EAAW,OAAOrE,CAAS,CAAG,CAAC,CAC7G,EAEA,aAAc,SAASW,EAAM2D,EAAM,CAC/B,OAAIA,IAAS,QAAU,CAACvE,EAAQY,CAAI,EAAY,KAEzC,CAAE,SAAU,yBAA0B,KAAM2B,EAAc3B,CAAI,CAAE,CAC3E,EAIA,UAAW,SAAS4D,EAAO,CACnBC,EAAWD,EAAO,4BAA4B,EAAE,QAAQ1C,CAAU,EAEtE/B,EAAWA,EAAS,OAAO,SAAS2E,EAAO,CAAE,OAAOA,EAAM,QAAQ,WAAa,CAAC,EAChF3E,EAAS,QAAQ,SAAS2E,EAAO,EACzBA,EAAM,YAAcF,GAASA,EAAM,SAASE,EAAM,SAAS,IAAKA,EAAM,OAAO,CACrF,CAAC,CACL,EAEA,SAAU,UAAW,CACjB3E,EAAW,CAAC,CAChB,EAGA,cAAe,SAASE,EAAW,CAC/B,IAAI8C,EAAcC,EAAI/C,EAAW,uBAAuB,EAEpDiD,EAASlD,EAAQC,CAAS,GAAKA,EAAW,WAAW,EAAE,QAAQ,SAASkD,EAAK,CAC7E,IAAIE,EAAOK,EAAOzD,EAAWkD,CAAG,EAC5BE,GAAQN,EAAQ,YAAYM,CAAI,CACxC,CAAC,CACL,CACJ,CACJ",
|
|
6
6
|
"names": ["GridEditor", "all", "root", "selector", "one", "selfAndAll", "found", "children", "node", "each", "child", "element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "toggleClass", "state", "hasClass", "dropEmptyClass", "hide", "node", "visible", "node", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "fadeOut", "node", "duration", "done", "animateAway", "style", "GridEditor", "STYLES", "WIDTHS", "ALIGNS", "DEFAULTS", "FIELDS", "fieldCounter", "LAYOUT_ATTR", "classValues", "map", "key", "ge", "sections", "stripOf", "container", "child", "fromBreakpoints", "infix", "vertical", "verticalClasses", "at", "verticals", "read", "strip", "has", "node", "name", "hasClass", "found", "fallback", "each", "classes", "write", "value", "removeClass", "addClass", "layout", "dropEmptyClass", "valuesOf", "chosen", "options", "setting", "layoutHere", "markLayout", "select", "labelKey", "onChange", "box", "element", "id", "field", "option", "createSection", "body", "fields", "change", "render", "choice", "values", "addTabTo", "content", "one", "number", "children", "tab", "button", "pane", "activatePane", "all", "active", "toggleClass", "paneOf", "link", "target", "sortable", "labels", "count", "i", "removed", "wasActive", "fadeOut", "first", "root", "definition", "kind", "scope", "selfAndAll", "entry"]
|
|
7
7
|
}
|
package/docs/events.md
CHANGED
|
@@ -92,8 +92,8 @@ about every insertion can bind `grideditor:before-add` and switch on
|
|
|
92
92
|
| `grideditor:before-utility` | — | yes | before a utility class is written, from the panel, a plugin's tool or `setUtility` |
|
|
93
93
|
| `grideditor:after-utility` | — | no | after the class is written and the preview redrawn, only if something changed |
|
|
94
94
|
| `grideditor:view-change` | — | no | after the view changes, only if it actually changed |
|
|
95
|
-
| `grideditor:
|
|
96
|
-
| `grideditor:
|
|
95
|
+
| `grideditor:preview-change` | — | no | after the preview button is pressed or let go; not while it is only hovered |
|
|
96
|
+
| `grideditor:target-change` | — | no | with `active_target`, after the node the toolbar adds to and the sidebar shows changes - any node with settings - only if it actually changed |
|
|
97
97
|
| `grideditor:after-copy` | — | no | with the clipboard plugin, after a node is copied: `source: 'tool'` from its Copy tool, `'shortcut'` from Ctrl+C |
|
|
98
98
|
| `grideditor:after-autosave` | — | no | with the autosave plugin, after a draft is written |
|
|
99
99
|
| `grideditor:after-restore-draft` | — | no | with the autosave plugin, after the user chose to restore a draft and the canvas is it |
|
|
@@ -177,16 +177,19 @@ The autosave events carry no node: `after-autosave` has `canvas`, `html`,
|
|
|
177
177
|
`saveDraft()`, or `destroy` -, `after-restore-draft` has `canvas`, `html` and
|
|
178
178
|
`savedAt`, and `autosave-error` has `canvas` and the `error` the storage threw.
|
|
179
179
|
|
|
180
|
+
`preview-change` carries no node either: its payload is `canvas` and
|
|
181
|
+
`previewing`, `true` when the button was pressed and `false` when it was let
|
|
182
|
+
go - by a click, or by the editor itself when the source view opens, when a
|
|
183
|
+
plugin replaces the canvas with `setHtml` (an undo does) and on `destroy`.
|
|
184
|
+
|
|
180
185
|
`target-change` carries no node either: its payload is `canvas`, `target` - the
|
|
181
|
-
|
|
182
|
-
- and `from`, the one before.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
and `from`, the one before. A node deleted while selected, or replaced by
|
|
189
|
-
`setHtml`, is a change to `null`. A handler's answer is ignored.
|
|
186
|
+
node the toolbar adds to now - any node with settings - or `null` for the end
|
|
187
|
+
of the canvas - and `from`, the one before. A node deleted while it is the
|
|
188
|
+
target, or replaced by `setHtml`, is a change to `null`. What a toolbar button
|
|
189
|
+
then adds fires its add events as any click does, with `source: 'tool'` (or
|
|
190
|
+
`'paste'`) and the place it went in - the target, its pane, or the row or
|
|
191
|
+
column it holds - or the canvas for a section, as the `parent`. A row or
|
|
192
|
+
column made around it fires none of its own.
|
|
190
193
|
|
|
191
194
|
`source` matters to a host that both drives the editor from its own palette and
|
|
192
195
|
listens for what the user does: `api` is your own call coming back to you,
|
package/docs/plugins.md
CHANGED
|
@@ -69,6 +69,8 @@ GridEditor.containers.gallery = function(ge) {
|
|
|
69
69
|
paneClass: 'ge-picture', // optional: the class mark gives its panes, which is how
|
|
70
70
|
// the editor knows one is a picture
|
|
71
71
|
paneLabelKey: 'panel.kind_picture', // optional: what a pane's settings panel calls it
|
|
72
|
+
regionOf: function(container, pane) { … }, // optional: where rows go when it is the active target:
|
|
73
|
+
// the pane's own (or the one showing, with no pane), or null
|
|
72
74
|
|
|
73
75
|
create: function(options) { … }, // returns the container
|
|
74
76
|
addPane: addPictureTo, // returns the new pane
|
|
@@ -80,6 +82,7 @@ GridEditor.containers.gallery = function(ge) {
|
|
|
80
82
|
tools: function(drawer, container) { … }, // optional, extra tools
|
|
81
83
|
onInit: function() { … }, // optional, per canvas init
|
|
82
84
|
onDeinit: function() { … }, // optional, per canvas deinit
|
|
85
|
+
onPreviewChange: function(previewing) { … }, // optional, the preview button pressed or let go
|
|
83
86
|
};
|
|
84
87
|
};
|
|
85
88
|
```
|
|
@@ -122,6 +125,14 @@ written for 6.x.
|
|
|
122
125
|
- **`onInit`/`onDeinit`** are for work that is about the whole canvas rather
|
|
123
126
|
than one container — the popup and offcanvas plugins wire up the host's
|
|
124
127
|
`data-ge-popup-target` and `data-ge-offcanvas-target` triggers there.
|
|
128
|
+
- **`onPreviewChange(previewing)`** is called when the preview button is
|
|
129
|
+
pressed (`true`) and let go (`false`), before the `preview-change` event; not
|
|
130
|
+
while it is only hovered. Pressed, the canvas has lost `ge-editing` and the
|
|
131
|
+
page's own controls may work: the popup and offcanvas plugins give their
|
|
132
|
+
triggers and close buttons back to Bootstrap, and on letting go close what
|
|
133
|
+
is open and put back what Bootstrap changed. A `getHtml` in the middle of a
|
|
134
|
+
preview runs `deinit` and `init` as ever, with `ge.previewing()` still true,
|
|
135
|
+
so an `onInit` can carry on with it.
|
|
125
136
|
- **`references`** lists the attributes of the container's own that hold an id,
|
|
126
137
|
as the id itself or as a `#selector`, which `ge.freshNode` renames along with
|
|
127
138
|
the id they point at when a copy is made: a popup's `data-ge-popup-id` and
|
|
@@ -162,6 +173,7 @@ element, and where there may be several, an array.
|
|
|
162
173
|
| `ge.operate(body)` | Run `body` as one operation, so a handler calling back in is queued |
|
|
163
174
|
| `ge.kindOf(node)` | What an event calls a node: `row`, `column`, `element`, a container's type… |
|
|
164
175
|
| `ge.view()` | The view being edited: a breakpoint key, or `'all'` |
|
|
176
|
+
| `ge.previewing()` | Whether the preview button is pressed: not when it is only hovered |
|
|
165
177
|
| `ge.viewTiers()` | The breakpoint key that view writes: the one being edited, or `xs` - the class with no breakpoint - in the all view |
|
|
166
178
|
| `ge.breakpoints` | Every breakpoint key, smallest first |
|
|
167
179
|
| `ge.getUtility(node, family, view?)` | A utility's value, as in the public method |
|
|
@@ -178,9 +190,9 @@ element, and where there may be several, an array.
|
|
|
178
190
|
| `ge.setHtml(html)` | The canvas made of other markup, and edited again: the source view closed if it is open, `deinit`, the markup in, `init`. No add or delete events: it is replaced as a whole. A `<script>` in it does not run in the editor |
|
|
179
191
|
| `ge.confirm(message, options, answer)` | A question in the editor's confirm modal, the one deleting asks in. `options`: `title`, `ok`, `cancel` - the texts, the locale's by default - and `danger`, a red ok button. `answer(true)` for ok, `answer(false)` for cancel, the close button or Escape, `answer(null)` when the modal is taken away unanswered: `setLocale`, `destroy`, or another question. The browser's `confirm` without Bootstrap's javascript |
|
|
180
192
|
| `ge.refreshToolbar()` | The toolbar built again, from what the feature plugins' `toolbar`s hold now: for a plugin whose buttons come and go. The category shown with `toolbar_groups`, the preview and the source view stay as they are. Does nothing before the toolbar is first built, and after `destroy` |
|
|
181
|
-
| `ge.
|
|
182
|
-
| `ge.
|
|
183
|
-
| `ge.
|
|
193
|
+
| `ge.getActiveTarget()` | The node the toolbar adds to and the sidebar shows - any node with settings - as the public method gives it: `null` without `active_target` |
|
|
194
|
+
| `ge.placeInTarget(node, kind, source)` | Add a node you made to the active target as the toolbar adds what it makes: at the end of what the target holds, in the row or column it lacks, a section on the canvas after the block the target is in. The add events fire with `kind` and `source`. The node added, or `null` with no target or when a handler canceled |
|
|
195
|
+
| `ge.setActiveTarget(node)` | Choose the node the toolbar adds to: the public method without its warnings. `true` when it took, `false` for a node that is not one with settings, or without `active_target`. A plugin that puts the choice back after it remade the canvas does not know the node is still one |
|
|
184
196
|
| `ge.panelOpen()` | Whether a settings panel is open in a popover, an offcanvas or a modal, or one is unfolded inline in a drawer, or the editor's dialog or delete confirmation is up. The sidebar does not count: it is always there |
|
|
185
197
|
| `ge.contains(node)` | Whether a node is this editor's: in its canvas, its toolbar, its settings panels (the sidebar too, when it has it), its dialog or its confirmation |
|
|
186
198
|
| `ge.toolbarItems(name)` | An array of the toolbar buttons the feature plugin `name` declared, for showing and hiding them |
|
|
@@ -339,7 +351,7 @@ node's kind as `{kind}` - or the label. `body` stays the panel's either way,
|
|
|
339
351
|
so `ge.detailsOf(node)` finds what is in it.
|
|
340
352
|
|
|
341
353
|
With `settings_panel: 'sidebar'` the panel has room, as the offcanvas does:
|
|
342
|
-
the sections are in it, and `body` is in the sidebar while its node is
|
|
354
|
+
the sections are in it, and `body` is in the sidebar while its node is the target.
|
|
343
355
|
|
|
344
356
|
A field made with `ge.utilityField` in a section follows the view and the
|
|
345
357
|
classes field as the Responsive section's do, wherever the section is at the
|
|
@@ -352,16 +364,16 @@ with `ge.hostStyle`: in a breakpoint view the node's `style` holds the
|
|
|
352
364
|
preview's `!important` values too, and they come off on `deinit` with
|
|
353
365
|
whatever was written under them.
|
|
354
366
|
|
|
355
|
-
### What the sidebar shows with
|
|
367
|
+
### What the sidebar shows with no target
|
|
356
368
|
|
|
357
369
|
**`sidebarEmpty(ge)`**, which any kind of plugin can have, returns what the
|
|
358
|
-
`'sidebar'` settings panel shows while
|
|
370
|
+
`'sidebar'` settings panel shows while there is no active target -
|
|
359
371
|
`{ titleKey, body }`, a locale key for the title and an element - or null. It
|
|
360
|
-
is called each time the sidebar is left with
|
|
372
|
+
is called each time the sidebar is left with no target. The host's own
|
|
361
373
|
`sidebar.empty` goes first; then the first plugin, in the order they were
|
|
362
374
|
registered, that returns something; with none, the editor's message. A result
|
|
363
375
|
without a `body` element counts as null. `body` is taken out of the sidebar,
|
|
364
|
-
not destroyed, when a node
|
|
376
|
+
not destroyed, when a node becomes the target, so keep it and give it back.
|
|
365
377
|
|
|
366
378
|
### Settings of your own, saved on the node
|
|
367
379
|
|
package/example/clipboard.html
CHANGED
|
@@ -34,9 +34,10 @@
|
|
|
34
34
|
// tinyMCE 7 is GPL-2.0-or-later: 'gpl' accepts that licence.
|
|
35
35
|
// A commercial licence passes its own key here instead.
|
|
36
36
|
tinymce: { config: { license_key: 'gpl' } },
|
|
37
|
-
// A click
|
|
38
|
-
// turns on Ctrl+C and Ctrl+V.
|
|
39
|
-
// would leave the keys to
|
|
37
|
+
// A click on a node - a row, a column, a container, a text...
|
|
38
|
+
// - makes it the target, which turns on Ctrl+C and Ctrl+V.
|
|
39
|
+
// clipboard: { shortcuts: false } would leave the keys to
|
|
40
|
+
// the browser
|
|
40
41
|
active_target: true,
|
|
41
42
|
};
|
|
42
43
|
|
|
@@ -81,16 +82,18 @@
|
|
|
81
82
|
drag it to where the copy should land.
|
|
82
83
|
</p>
|
|
83
84
|
<p class="text-body-secondary">
|
|
84
|
-
With the keyboard: click a
|
|
85
|
-
|
|
85
|
+
With the keyboard: click a node - a row, a column, a container, an
|
|
86
|
+
element, or a text - on its background or its drawer, and it
|
|
86
87
|
becomes the target, with a dashed outline. <kbd>Ctrl</kbd>+<kbd>C</kbd>
|
|
87
88
|
(<kbd>⌘</kbd>+<kbd>C</kbd> on a Mac) copies it, and
|
|
88
|
-
<kbd>Ctrl</kbd>+<kbd>V</kbd> pastes what is copied into it,
|
|
89
|
-
it
|
|
90
|
-
column, a
|
|
89
|
+
<kbd>Ctrl</kbd>+<kbd>V</kbd> pastes what is copied into it, at its
|
|
90
|
+
end and in the level it lacks: a row pasted into a row goes in a
|
|
91
|
+
new column of it, a column pasted into a column goes in a new row,
|
|
92
|
+
and a container or a text pasted into a container goes in the tab
|
|
93
|
+
or the item it shows. A section goes after the block the target
|
|
91
94
|
is in. While you are writing in a text, or have text selected, the
|
|
92
|
-
keys copy and paste the text as usual. Escape, or a click
|
|
93
|
-
canvas outside any
|
|
95
|
+
keys copy and paste the text as usual. Escape, or a click outside
|
|
96
|
+
the editor or on the canvas outside any node, clears the target.
|
|
94
97
|
</p>
|
|
95
98
|
<p class="text-body-secondary">
|
|
96
99
|
What is copied is kept in the browser, so it can be pasted in the
|
package/package.json
CHANGED