turbo_boost-elements 0.0.19 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/builds/@turbo-boost/elements.js +1 -1
- data/app/assets/builds/@turbo-boost/elements.js.map +2 -2
- data/app/assets/builds/@turbo-boost/elements.metafile.json +1 -1
- data/app/commands/turbo_boost/elements/toggle_command.rb +9 -5
- data/app/javascript/version.js +1 -1
- data/lib/turbo_boost/elements/tag_builders/toggle_tags_builder.rb +1 -1
- data/lib/turbo_boost/elements/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3debec88762ff18cb3549d25b7f413cb768bf8dd85e251446000432b3bc4e9a7
|
4
|
+
data.tar.gz: dfed14b9432f77441bbce34e012118fbe9762c00d55f0d34851588663a3a37c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e55ddfe352d6399524a6725b0c58410599afcd7594c94a677bf056fee93c0501f5b7d2224e5a84ff880e724c14c0681fb4325ddaa6faf90add659719b05f1d3
|
7
|
+
data.tar.gz: e3345dcbc05206be49876742a46be14650b2963abeffded4a43df0830f38e4705deaf98509cdb6b720bf8ea89c5e9af62dbde78dcc98095b9d0cdc096e865e9c
|
@@ -209,7 +209,7 @@ import"@turbo-boost/commands";var K=Object.defineProperty,U=Object.definePropert
|
|
209
209
|
`,r=x(o,((t=this.delegate.targetTooltipData)==null?void 0:t.subtitle)||"",((e=this.delegate.targetTooltipData)==null?void 0:e.content)||"",{id:`${this.delegate.id}-target`,backgroundColor:"lightcyan",color:"darkcyan",position:"bottom"}),s=k(this.delegate.targetElement),i=Math.ceil(s.top+r.offsetHeight),n=Math.ceil(s.left+s.width+r.offsetWidth/3);return r.style.top=`${i}px`,r.style.left=`${n}px`,r.line=new LeaderLine(r,this.delegate.targetElement,h(c({},this.leaderLineOptions),{color:"darkcyan"})),r.drag=new PlainDraggable(r),r}createTriggerTooltip(t,e){var o,r;if(!this.delegate.triggerElement)return;let s=`
|
210
210
|
<svg xmlns="http://www.w3.org/2000/svg" style="display:inline;" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg>
|
211
211
|
TRIGGER - <${this.delegate.triggerElement.tagName.toLowerCase()}>
|
212
|
-
`,i=x(s,((o=this.delegate.triggerTooltipData)==null?void 0:o.subtitle)||"",((r=this.delegate.triggerTooltipData)==null?void 0:r.content)||"",{id:`${this.delegate.id}-trigger`,backgroundColor:"lavender",color:"blueviolet"}),n=k(this.delegate.triggerElement),g=Math.ceil(n.top-i.offsetHeight*2),J=Math.ceil(n.left+n.width+i.offsetWidth/3);return i.style.top=`${g}px`,i.style.left=`${J}px`,i.line=new LeaderLine(this.delegate.triggerElement,i,h(c({},this.leaderLineOptions),{color:"blueviolet"})),t&&(i.lineToTarget=new LeaderLine(i,t,h(c({},this.leaderLineOptions),{color:"blueviolet",middleLabel:this.delegate.targetLineLabel,size:2.1})),t.drag.onMove=()=>{var m,B;t.line.position(),(m=i.lineToTarget)==null||m.position(),(B=i.lineToRendering)==null||B.position()}),e&&(i.lineToRendering=new LeaderLine(i,e,h(c({},this.leaderLineOptions),{color:"blueviolet",middleLabel:this.delegate.renderingLineLabel,size:2.1})),e.drag.onMove=()=>{var m;e.line.position(),i.lineToTarget&&i.lineToTarget.position(),(m=i.lineToRendering)==null||m.position()}),i.drag=new PlainDraggable(i),i.drag.onMove=()=>{i.line.position(),i.lineToTarget&&i.lineToTarget.position(),i.lineToRendering&&i.lineToRendering.position()},i}get leaderLineOptions(){return{dash:{animation:!0},dropShadow:{opacity:.3},endPlug:"arrow3",endPlugSize:1.7,size:3,startPlug:"disc",startPlugSize:1}}},{restart:he,start:ue,stop:ge}=S;function z(t,e,o){Object.assign(t,{initializeDevtool(){let r=()=>this.devtool.show();addEventListener("turbo-boost:devtools-start",()=>{this.devtool=new D(this),this.addEventListener("mouseenter",r)}),addEventListener("turbo-boost:devtools-stop",()=>{this.removeEventListener("mouseenter",r),this.removeDevtool()}),this.dispatchEvent(new CustomEvent("turbo-boost:devtools-connect",{bubbles:!0}))},hideDevtool(){var r;(r=this.devtool)==null||r.hide({active:!1})},removeDevtool(){var r,s;(r=this.devtool)!=null&&r.hide&&this.devtool.hide({active:!1}),(s=this.devtool)!=null&&s.unregisterEventListeners&&this.devtool.unregisterEventListeners(),delete this.devtool},name:e,targetLineLabel:o}),["triggerElement","morphElement","targetElement"].filter(r=>t[r]===void 0).forEach(r=>{Object.defineProperty(t,r,{get(){return t}})})}var P={restart:he,start:ue,stop:ge,VERSION:Z};var V="0.0
|
212
|
+
`,i=x(s,((o=this.delegate.triggerTooltipData)==null?void 0:o.subtitle)||"",((r=this.delegate.triggerTooltipData)==null?void 0:r.content)||"",{id:`${this.delegate.id}-trigger`,backgroundColor:"lavender",color:"blueviolet"}),n=k(this.delegate.triggerElement),g=Math.ceil(n.top-i.offsetHeight*2),J=Math.ceil(n.left+n.width+i.offsetWidth/3);return i.style.top=`${g}px`,i.style.left=`${J}px`,i.line=new LeaderLine(this.delegate.triggerElement,i,h(c({},this.leaderLineOptions),{color:"blueviolet"})),t&&(i.lineToTarget=new LeaderLine(i,t,h(c({},this.leaderLineOptions),{color:"blueviolet",middleLabel:this.delegate.targetLineLabel,size:2.1})),t.drag.onMove=()=>{var m,B;t.line.position(),(m=i.lineToTarget)==null||m.position(),(B=i.lineToRendering)==null||B.position()}),e&&(i.lineToRendering=new LeaderLine(i,e,h(c({},this.leaderLineOptions),{color:"blueviolet",middleLabel:this.delegate.renderingLineLabel,size:2.1})),e.drag.onMove=()=>{var m;e.line.position(),i.lineToTarget&&i.lineToTarget.position(),(m=i.lineToRendering)==null||m.position()}),i.drag=new PlainDraggable(i),i.drag.onMove=()=>{i.line.position(),i.lineToTarget&&i.lineToTarget.position(),i.lineToRendering&&i.lineToRendering.position()},i}get leaderLineOptions(){return{dash:{animation:!0},dropShadow:{opacity:.3},endPlug:"arrow3",endPlugSize:1.7,size:3,startPlug:"disc",startPlugSize:1}}},{restart:he,start:ue,stop:ge}=S;function z(t,e,o){Object.assign(t,{initializeDevtool(){let r=()=>this.devtool.show();addEventListener("turbo-boost:devtools-start",()=>{this.devtool=new D(this),this.addEventListener("mouseenter",r)}),addEventListener("turbo-boost:devtools-stop",()=>{this.removeEventListener("mouseenter",r),this.removeDevtool()}),this.dispatchEvent(new CustomEvent("turbo-boost:devtools-connect",{bubbles:!0}))},hideDevtool(){var r;(r=this.devtool)==null||r.hide({active:!1})},removeDevtool(){var r,s;(r=this.devtool)!=null&&r.hide&&this.devtool.hide({active:!1}),(s=this.devtool)!=null&&s.unregisterEventListeners&&this.devtool.unregisterEventListeners(),delete this.devtool},name:e,targetLineLabel:o}),["triggerElement","morphElement","targetElement"].filter(r=>t[r]===void 0).forEach(r=>{Object.defineProperty(t,r,{get(){return t}})})}var P={restart:he,start:ue,stop:ge,VERSION:Z};var V="0.1.0";var a=class extends HTMLElement{constructor(e){super(),this.devtool="unknown",this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=e||"<slot></slot>"}connectedCallback(){this.ensureId()}ensureId(){this.id.trim().length||(this.id=`${this.tagName}-${this.uuidv4()}`.toLowerCase())}uuidv4(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}get viewStack(){let e=this.getAttribute("view-stack");return e?JSON.parse(e):[]}get partial(){return this.viewStack[0]}};var me=`
|
213
213
|
<turbo-boost>
|
214
214
|
<slot name="busy" hidden></slot>
|
215
215
|
<slot></slot>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../javascript/index.js", "../../../../node_modules/@turbo-boost/devtools/src/version.js", "../../../../node_modules/@turbo-boost/devtools/src/utils/dom.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/devtool_element.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/supervisor_element.js", "../../../../node_modules/@turbo-boost/devtools/src/elements/tooltip_element.js", "../../../../node_modules/@turbo-boost/devtools/src/dependencies.js", "../../../../node_modules/@turbo-boost/devtools/src/supervisor.js", "../../../../node_modules/@turbo-boost/devtools/src/devtool.js", "../../../../node_modules/@turbo-boost/devtools/src/index.js", "../../../javascript/version.js", "../../../javascript/elements/turbo_boost_element/index.js", "../../../javascript/elements/toggle_elements/toggle_element/index.js", "../../../javascript/elements/toggle_elements/target_element/index.js", "../../../javascript/elements/toggle_elements/trigger_element/focus.js", "../../../javascript/elements/toggle_elements/trigger_element/index.js", "../../../javascript/elements/index.js"],
|
4
|
-
"sourcesContent": ["import '@turbo-boost/commands'\nimport devtools from '@turbo-boost/devtools'\nimport VERSION from './version'\nimport './elements'\n\nself.TurboBoost = self.TurboBoost || {}\nself.TurboBoost.devtools = devtools\nself.TurboBoost.Elements = { VERSION }\n\nexport default self.TurboBoost.Elements\n", "export default '0.0.6'\n", "export function template(html) {\n let template = document.createElement('template')\n template.innerHTML = html\n return template\n}\n\nexport function appendHTML(html, parent) {\n parent = parent || document.body\n const clone = template(html).content.cloneNode(true)\n const child = clone.querySelector('*')\n return parent.appendChild(child)\n}\n\nexport function addHighlight(element, options = {}) {\n if (!element) return\n removeHighlight(element)\n let { outline, outlineOffset } = options\n\n outline = outline || 'dashed 3px red'\n outlineOffset = outlineOffset || '0px'\n\n element.originalStyles = element.originalStyles || {\n display: element.style.display,\n minHeight: element.style.minHeight,\n minWidth: element.style.minWidth,\n outline: element.style.outline,\n outlineOffset: element.style.outlineOffset\n }\n\n if (\n getComputedStyle(element).display.match(/^inline$/i) &&\n element.offsetWidth === 0 &&\n element.offsetHeight === 0\n ) {\n element.style.display = 'inline-block'\n element.style.minHeight = '2px'\n element.style.minWidth = '2px'\n }\n element.style.outline = outline\n element.style.outlineOffset = outlineOffset\n element.dataset.turboBoostHighlight = true\n}\n\nexport function removeHighlight(element) {\n if (!element) return\n if (element.originalStyles) {\n for (const [key, value] of Object.entries(element.originalStyles))\n value ? (element.style[key] = value) : (element.style[key] = '')\n delete element.originalStyles\n }\n delete element.dataset.turboBoostHighlight\n}\n\nexport function coordinates(element) {\n if (!element) return {}\n const rect = element.getBoundingClientRect()\n const width = element.offsetWidth\n const height = element.offsetHeight\n const top = rect.top + window.scrollY\n const left = rect.left + window.scrollX\n const right = left + width\n const bottom = top + height\n return { top, left, right, bottom, width, height }\n}\n\nexport function attempt(callback) {\n try {\n callback()\n } catch {}\n}\n", "export default class DevtoolElement extends HTMLElement {\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n this.labelElement.addEventListener('click', event => {\n event.preventDefault()\n this.toggle()\n })\n this.checkboxElement.addEventListener('change', event =>\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n )\n }\n\n toggle() {\n this.checked ? this.uncheck() : this.check()\n }\n\n check() {\n this.checkboxElement.checked = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n }\n\n uncheck() {\n this.checkboxElement.checked = false\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n }\n\n get name() {\n return this.getAttribute('name')\n }\n\n get checked() {\n return this.checkboxElement.checked\n }\n\n get checkboxElement() {\n return this.shadowRoot.querySelector('input')\n }\n\n get labelElement() {\n return this.shadowRoot.querySelector('label')\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div>\n <input name=\"checkbox\" type=\"checkbox\">\n <label for=\"checkbox\"><slot name=\"label\"></slot></label>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host, :host * {\n cursor: pointer;\n }\n\n div {\n display: flex;\n margin-right: 10px;\n }\n\n input:checked + label{\n font-weight: bold;\n }\n\n label {\n color: black;\n }\n `\n }\n}\n", "import { appendHTML } from '../utils/dom.js'\n\nexport default class SupervisorElement extends HTMLElement {\n constructor() {\n super()\n this.enabledDevtools = {}\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n this.shadowRoot.querySelector('button').addEventListener('click', () =>\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-close', {\n bubbles: true\n })\n )\n )\n\n this.addEventListener('change', event => {\n const devtoolElement = event.target\n const { checked, name } = devtoolElement\n checked ? this.enableDevtool(name) : this.disableDevtool(name)\n })\n }\n\n enableDevtool(name) {\n if (this.enabledDevtools[name]) return\n this.enabledDevtools[name] = true\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtool-enable', {\n bubbles: true,\n detail: { name: name }\n })\n )\n }\n\n disableDevtool(name) {\n if (!this.enabledDevtools[name]) return\n delete this.enabledDevtools[name]\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtool-disable', {\n bubbles: true,\n detail: { name: name }\n })\n )\n }\n\n close() {\n this.devtoolElements.forEach(el => {\n if (el.checked) el.uncheck()\n })\n this.remove()\n }\n\n get devtoolElements() {\n return this.querySelectorAll('[slot=\"devtool\"]')\n }\n\n get closeElement() {\n return this.querySelector('button')\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div>\n <img src=\"https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342\">\n <slot name=\"devtool\"></slot>\n <button>\u2715</button>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host {\n background-color: gainsboro;\n border-radius: 5px;\n bottom: 20px;\n display: block;\n filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));\n left: 50%;\n outline-offset: 1px;\n outline: solid 2px black;\n padding: 5px 10px;\n position: fixed;\n transform: translateX(-50%);\n z-index: 8999;\n }\n\n * {\n -webkit-user-select: none;\n font-family: helvetica, sans-serif;\n font-size: 1rem;\n user-select: none;\n }\n\n img {\n align-self: center;\n cursor: grab;\n height: 25px;\n margin-left: -5px;\n vertical-align: middle;\n }\n\n div {\n display: flex;\n gap: 0 5px;\n position: relative;\n }\n\n [slot=\"devtool\"] {\n align-self: center;\n }\n\n button {\n align-self: center;\n background-color: darkgray;\n border-radius: 50%;\n border: none;\n color: black;\n cursor: pointer;\n font-size: 10px;\n height: 18px;\n line-height: 18px;\n margin-right: -5px;\n opacity: 0.5;\n outline: solid 1px black;\n padding: 0 2px;\n width: 18px;\n }\n\n button:hover {\n opacity: 1;\n }\n `\n }\n}\n", "export default class TooltipElement extends HTMLElement {\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n }\n\n connectedCallback() {\n const savedTransform = localStorage.getItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`)\n\n if (savedTransform) {\n this.style.transform = savedTransform\n }\n }\n\n disconnectedCallback() {\n if (this.id !== 'undefined' && this.id !== '') {\n localStorage.setItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`, this.style.transform)\n }\n }\n\n get color() {\n return this.getAttribute('color') || 'darkslategray'\n }\n\n get backgroundColor() {\n return this.getAttribute('background-color') || 'gainsboro'\n }\n\n get position() {\n return this.getAttribute('position') || 'top'\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div role=\"container\">\n <div role=\"title\">\n <slot name=\"title\"></slot>\n <img src=\"https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342\">\n </div>\n <slot name=\"subtitle\"></slot>\n <slot name=\"content-top\"></slot>\n <slot name=\"content\"></slot>\n <slot name=\"content-bottom\"></slot>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host {\n display: block;\n position: absolute;\n z-index: 8999;\n }\n\n * {\n color: ${this.color}\n font-size: 1rem;\n }\n\n [role=\"container\"] {\n background-color: ${this.backgroundColor};\n border-radius: 15px;\n filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));\n font-family: monospace;\n min-height: 30px;\n min-width: 100px;\n opacity: 0.9;\n outline-offset: 1px;\n outline: dashed 3px ${this.color};\n padding: 12px;\n position: relative;\n white-space: nowrap;\n }\n\n [role=\"title\"] {\n display: flex;\n }\n\n [role=\"title\"] slot[name=\"title\"] {\n color: ${this.color};\n display: block;\n flex-grow: 1;\n font-weight: bold;\n }\n\n [role=\"title\"] img {\n height: 25px;\n vertical-align: middle;\n }\n\n slot[name=\"subtitle\"] {\n border-bottom: dotted 1px ${this.color};\n border-top: dotted 1px ${this.color};\n color: ${this.color};\n display: block;\n font-size: 0.8rem;\n font-weight: lighter;\n margin-bottom: 12px;\n margin-top: 8px;\n padding-bottom: 4px;\n padding-top: 4px;\n width: 100%;\n }\n\n slot[name=\"content-top\"],\n slot[name=\"content\"],\n slot[name=\"content-bottom\"] {\n display: block;\n font-weight: normal;\n }\n\n slot[name=\"content-top\"] {\n color: ${this.color};\n margin-bottom: 8px;\n }\n\n slot[name=\"content\"],\n slot[name=\"content-bottom\"] {\n opacity: 0.7;\n padding-left: 12px;\n }\n\n slot[name=\"content\"] {\n color: ${this.color};\n }\n\n slot[name=\"content-bottom\"] {\n color: red;\n }\n `\n }\n}\n", "const added = []\n\nconst dependencies = {\n LeaderLine: {\n src: 'https://cdnjs.cloudflare.com/ajax/libs/leader-line/1.0.7/leader-line.min.js',\n integrity:\n 'sha512-0dNdzMjpT6pJdFGF1DwybFCfm3K/lzHhxaMXC/92J9/DZujHlqYFqmhTOAoD0o+LkeEsVK2ar/ESs7/Q2B6wJg==',\n global: 'LeaderLine'\n },\n\n PlainDraggable: {\n src: 'https://cdn.jsdelivr.net/npm/plain-draggable@2.5.14/plain-draggable.min.js',\n global: 'PlainDraggable'\n }\n}\n\nfunction exists(dependency) {\n if (dependency.global && self[dependency.global]) return true\n if (document.querySelector(`[src='${dependency.src}']`)) return true\n return added.includes(dependency)\n}\n\nfunction add(dependency) {\n if (exists(dependency)) return\n added.push(dependency)\n\n const { src, integrity } = dependency\n const script = document.createElement('script')\n script.setAttribute('src', src)\n script.setAttribute('crossorigin', 'anonymous')\n script.setAttribute('referrerpolicy', 'no-referrer')\n if (integrity) script.setAttribute('integrity', integrity)\n document.head.appendChild(script)\n}\n\nfunction remove(dependency) {\n if (!added.includes(dependency)) return\n added.splice(added.indexOf(dependency), 1)\n\n const { src } = dependency\n const el = document.querySelector(`script[src='${src}']`)\n if (el) el.remove()\n if (dependency.global && self[dependency.global]) self[dependency.global] = null\n}\n\nfunction removeAll() {\n ;[...added].forEach(dependency => remove(dependency))\n}\n\nexport default { ...dependencies, add, remove, removeAll }\n", "import { appendHTML } from './utils/dom'\nimport DevtoolElement from './elements/devtool_element'\nimport SupervisorElement from './elements/supervisor_element'\nimport TooltipElement from './elements/tooltip_element'\nimport dependencies from './dependencies'\n\ncustomElements.define('turbo-boost-devtool', DevtoolElement)\ncustomElements.define('turbo-boost-devtool-supervisor', SupervisorElement)\ncustomElements.define('turbo-boost-devtool-tooltip', TooltipElement)\n\nlet supervisorElement\n\nfunction makeDraggable() {\n if (!supervisorElement) return\n try {\n new PlainDraggable(supervisorElement)\n } catch {\n setTimeout(makeDraggable, 200)\n }\n}\n\nfunction stop() {\n if (stopped()) return\n supervisorElement.close()\n supervisorElement.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-stop', {\n bubbles: true\n })\n )\n supervisorElement = null\n dependencies.removeAll()\n}\n\nfunction start() {\n if (started()) return\n dependencies.add(dependencies.LeaderLine)\n dependencies.add(dependencies.PlainDraggable)\n supervisorElement = appendHTML('<turbo-boost-devtool-supervisor></turbo-boost-devtool-supervisor>')\n setTimeout(makeDraggable, 200)\n supervisorElement.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-start', {\n bubbles: true\n })\n )\n}\n\nfunction restart() {\n const enabledList = supervisorElement ? Object.keys(supervisorElement.enabledDevtools) : []\n\n stop()\n start()\n\n supervisorElement.devtoolElements.forEach(el => {\n if (enabledList.includes(el.name)) el.check()\n })\n}\n\nfunction started() {\n return !!supervisorElement\n}\n\nfunction stopped() {\n return !started()\n}\n\nlet restartTimeout\nfunction debouncedRestart() {\n clearTimeout(restartTimeout)\n restartTimeout = setTimeout(restart, 25)\n}\n\nfunction autoRestart() {\n if (started()) debouncedRestart()\n}\n\naddEventListener('turbo:load', autoRestart)\naddEventListener('turbo-frame:load', autoRestart)\naddEventListener('turbo-boost:devtools-connect', autoRestart)\naddEventListener('turbo-boost:devtools-close', stop)\n\nif (window.TurboBoost) {\n addEventListener(TurboBoost.Commands.events.success, autoRestart)\n addEventListener(TurboBoost.Commands.events.finish, autoRestart)\n}\n\nfunction register(name, label) {\n if (!supervisorElement) return\n return appendHTML(\n `\n <turbo-boost-devtool name=\"${name}\" slot=\"devtool\">\n <span slot=\"label\">${label}</span>\n </turbo-boost-devtool>\n `,\n supervisorElement\n )\n}\n\nfunction enabled(name) {\n if (!supervisorElement) return false\n return supervisorElement.enabledDevtools[name]\n}\n\nexport default {\n enabled,\n register,\n start,\n stop,\n restart: debouncedRestart,\n get started() {\n return started()\n },\n get stopped() {\n return stopped()\n }\n}\n", "// Icons courtesy of https://feathericons.com/\nimport supervisor from './supervisor'\nimport { appendHTML, addHighlight, attempt, coordinates, removeHighlight } from './utils/dom.js'\n\nfunction appendTooltip(title, subtitle, content, options = {}) {\n let { backgroundColor, color, position, id } = options\n color = color || 'white'\n position = position || 'top'\n return appendHTML(`\n <turbo-boost-devtool-tooltip id=\"${id}\" position=\"${position}\" background-color=\"${backgroundColor}\" color=\"${color}\">\n <div slot='title'>${title}</div>\n <div slot='subtitle'>${subtitle}</div>\n ${content}\n </turbo-boost-devtool-tooltip>\n `)\n}\n\nlet activeTarget\n\nexport default class Devtool {\n constructor(delegate) {\n this.delegate = delegate\n\n let hideTimeout\n const debouncedHide = () => {\n clearTimeout(hideTimeout)\n hideTimeout = setTimeout(this.hide({ active: false }), 25)\n }\n\n this.eventListeners['turbo-boost:devtool-enable'] = event => {\n // LeaderLine.positionByWindowResize = false\n const { name } = event.detail\n if (name !== this.delegate.name) return\n\n addHighlight(this.delegate.triggerElement, {\n outline: '3px dashed blueviolet',\n outlineOffset: '2px'\n })\n\n this.hide({ active: false })\n if (this.active) this.show()\n }\n\n this.eventListeners['turbo-boost:devtool-disable'] = event => {\n const { name } = event.detail\n if (name === this.delegate.name) removeHighlight(this.delegate.triggerElement)\n }\n\n this.eventListeners['click'] = event => {\n if (event.target.closest('turbo-boost-devtool-tooltip')) return\n debouncedHide()\n }\n\n this.eventListeners['turbo:load'] = debouncedHide\n this.eventListeners['turbo-frame:load'] = debouncedHide\n if (window.TurboBoost) {\n this.eventListeners[TurboBoost.Commands.events.finish] = debouncedHide\n }\n\n this.registerEventListeners()\n }\n\n registerEventListeners() {\n Object.entries(this.eventListeners).forEach(([type, listener]) => {\n addEventListener(type, listener)\n })\n }\n\n unregisterEventListeners() {\n Object.entries(this.eventListeners).forEach(([type, listener]) => {\n removeEventListener(type, listener)\n })\n }\n\n get eventListeners() {\n return this._eventListeners || (this._eventListeners = {})\n }\n\n show() {\n if (!this.enabled) return\n\n if (this.active) return\n this.active = true\n\n this.hide({ active: true })\n\n addHighlight(this.delegate.targetElement, {\n outline: '3px dashed darkcyan',\n outlineOffset: '-2px'\n })\n\n addHighlight(this.delegate.morphElement, {\n outline: '3px dashed chocolate',\n outlineOffset: '3px'\n })\n\n this.renderingTooltip = this.createRenderingTooltip()\n this.targetTooltip = this.createTargetTooltip()\n this.triggerTooltip = this.createTriggerTooltip(this.targetTooltip, this.renderingTooltip)\n\n document.querySelectorAll('.leader-line').forEach(el => (el.style.zIndex = 100000))\n\n const data = {\n morph: {\n partial: this.delegate.triggerElement.renders,\n id: this.delegate.triggerElement.morphs,\n status: this.delegate.morphElement ? 'OK' : 'Not Found'\n },\n trigger: { partial: null, id: null, status: 'Not Found' },\n target: { partial: null, id: null, status: 'Not Found' }\n }\n\n if (this.delegate.triggerElement) {\n data.trigger = {\n partial: this.delegate.triggerElement.partial,\n id: this.delegate.triggerElement.id,\n status: 'OK'\n }\n data.target.id = this.delegate.triggerElement.controls\n }\n\n if (this.delegate.targetElement)\n data.target = {\n partial: this.delegate.targetElement.partial,\n dom_id: this.delegate.targetElement.id,\n status: 'OK'\n }\n\n console.table(data)\n }\n\n hide({ active: active = false }) {\n document.querySelectorAll('turbo-boost-devtool-tooltip').forEach(tooltip => {\n attempt(() => tooltip.line.remove())\n attempt(() => tooltip.drag.remove())\n attempt(() => tooltip.lineToRendering.remove())\n attempt(() => tooltip.lineToTarget.remove())\n attempt(() => tooltip.remove())\n })\n\n document.querySelectorAll('[data-turbo-boost-highlight]').forEach(el => {\n if (!el.tagName.match(/turbo-boost-toggle-trigger/i)) removeHighlight(el)\n })\n\n this.active = active\n }\n\n get active() {\n return activeTarget === this.delegate\n }\n\n set active(value) {\n if (value) activeTarget = this.delegate\n else activeTarget = null\n }\n\n get enabled() {\n return supervisor.enabled(this.delegate.name)\n }\n\n static register(name, label) {\n supervisor.register(name, label)\n }\n\n createRenderingTooltip() {\n if (!this.delegate.triggerElement.renders)\n return console.debug(\n `Unable to create the rendering tooltip! The trigger element must set the 'renders' attribute.`\n )\n\n if (!this.delegate.triggerElement.morphs)\n return console.debug(\n `Unable to create the rendering tooltip! The trigger element specified the 'morphs' attrbiute but no element matches the DOM id: '${this.triggerElement.morphs}'`\n )\n\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 19l7-7 3 3-7 7-3-3z\"></path><path d=\"M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z\"></path><path d=\"M2 2l7.586 7.586\"></path><circle cx=\"11\" cy=\"11\" r=\"2\"></circle></svg>\n RENDERING - <${this.delegate.triggerElement.tagName.toLowerCase()}>\n `\n const subtitle = `\n <b>partial</b>: ${this.delegate.triggerElement.renders || 'unknown'}<br>\n <b>morphs</b>: ${this.delegate.triggerElement.morphs || 'unknown'}<br>\n `\n const content = `\n <div slot=\"content-top\" style=\"font-size:85%; font-style:italic; font-weight:100;\">\n The <b>TRIGGER</b> toggles the <b>TARGET</b> then renders the partial & morphs the element.<br>\n </div>\n `\n const tooltip = appendTooltip(title, subtitle, content, {\n id: `${this.delegate.id}-rendering`,\n backgroundColor: 'lightyellow',\n color: 'chocolate'\n })\n\n const coords = coordinates(this.delegate.morphElement)\n const top = Math.ceil(coords.top + coords.height / 2 - tooltip.offsetHeight / 2)\n const left = Math.ceil(coords.left + coords.width + 100)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(tooltip, this.delegate.morphElement, {\n ...this.leaderLineOptions,\n color: 'chocolate'\n })\n\n tooltip.drag = new PlainDraggable(tooltip)\n return tooltip\n }\n\n createTargetTooltip() {\n if (!this.delegate.targetElement)\n return console.debug(\n `Unable to create the target tooltip! No element matches the DOM id: '${this.delegate.triggerElement.controls}'`\n )\n\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><circle cx=\"12\" cy=\"12\" r=\"6\"></circle><circle cx=\"12\" cy=\"12\" r=\"2\"></circle></svg>\n TARGET - <${this.delegate.targetElement.tagName.toLowerCase()}>\n `\n\n const tooltip = appendTooltip(\n title,\n this.delegate.targetTooltipData?.subtitle || '',\n this.delegate.targetTooltipData?.content || '',\n {\n id: `${this.delegate.id}-target`,\n backgroundColor: 'lightcyan',\n color: 'darkcyan',\n position: 'bottom'\n }\n )\n\n const coords = coordinates(this.delegate.targetElement)\n const top = Math.ceil(coords.top + tooltip.offsetHeight)\n const left = Math.ceil(coords.left + coords.width + tooltip.offsetWidth / 3)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(tooltip, this.delegate.targetElement, {\n ...this.leaderLineOptions,\n color: 'darkcyan'\n })\n\n tooltip.drag = new PlainDraggable(tooltip)\n return tooltip\n }\n\n createTriggerTooltip(targetTooltip, renderingTooltip) {\n if (!this.delegate.triggerElement) return\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"13 2 3 14 12 14 11 22 21 10 12 10 13 2\"></polygon></svg>\n TRIGGER - <${this.delegate.triggerElement.tagName.toLowerCase()}>\n `\n\n const tooltip = appendTooltip(\n title,\n this.delegate.triggerTooltipData?.subtitle || '',\n this.delegate.triggerTooltipData?.content || '',\n {\n id: `${this.delegate.id}-trigger`,\n backgroundColor: 'lavender',\n color: 'blueviolet'\n }\n )\n\n const coords = coordinates(this.delegate.triggerElement)\n const top = Math.ceil(coords.top - tooltip.offsetHeight * 2)\n const left = Math.ceil(coords.left + coords.width + tooltip.offsetWidth / 3)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(this.delegate.triggerElement, tooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet'\n })\n\n if (targetTooltip) {\n tooltip.lineToTarget = new LeaderLine(tooltip, targetTooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet',\n middleLabel: this.delegate.targetLineLabel,\n size: 2.1\n })\n\n targetTooltip.drag.onMove = () => {\n targetTooltip.line.position()\n tooltip.lineToTarget?.position()\n tooltip.lineToRendering?.position()\n }\n }\n\n if (renderingTooltip) {\n tooltip.lineToRendering = new LeaderLine(tooltip, renderingTooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet',\n middleLabel: this.delegate.renderingLineLabel,\n size: 2.1\n })\n\n renderingTooltip.drag.onMove = () => {\n renderingTooltip.line.position()\n if (tooltip.lineToTarget) tooltip.lineToTarget.position()\n tooltip.lineToRendering?.position()\n }\n }\n\n tooltip.drag = new PlainDraggable(tooltip)\n tooltip.drag.onMove = () => {\n tooltip.line.position()\n if (tooltip.lineToTarget) tooltip.lineToTarget.position()\n if (tooltip.lineToRendering) tooltip.lineToRendering.position()\n }\n\n return tooltip\n }\n\n get leaderLineOptions() {\n return {\n dash: { animation: true },\n dropShadow: { opacity: 0.3 },\n endPlug: 'arrow3',\n endPlugSize: 1.7,\n size: 3,\n startPlug: 'disc',\n startPlugSize: 1\n }\n }\n}\n", "import VERSION from './version'\nimport supervisor from './supervisor'\nimport Devtool from './devtool'\n\nconst { restart, start, stop } = supervisor\n\nfunction decorateElementWithDevtool(element, name, label) {\n Object.assign(element, {\n initializeDevtool() {\n const mouseenter = () => this.devtool.show()\n\n addEventListener('turbo-boost:devtools-start', () => {\n this.devtool = new Devtool(this)\n this.addEventListener('mouseenter', mouseenter)\n })\n\n addEventListener('turbo-boost:devtools-stop', () => {\n this.removeEventListener('mouseenter', mouseenter)\n this.removeDevtool()\n })\n\n this.dispatchEvent(new CustomEvent('turbo-boost:devtools-connect', { bubbles: true }))\n },\n hideDevtool() {\n this.devtool?.hide({ active: false })\n },\n removeDevtool() {\n if (this.devtool?.hide) this.devtool.hide({ active: false })\n if (this.devtool?.unregisterEventListeners) this.devtool.unregisterEventListeners()\n delete this.devtool\n },\n name,\n targetLineLabel: label\n })\n\n // the element references below are defaults that are placed on the receiver if not present\n const properties = ['triggerElement', 'morphElement', 'targetElement']\n\n properties\n .filter(property => {\n return element[property] === undefined\n })\n .forEach(property => {\n Object.defineProperty(element, property, {\n get() {\n return element\n }\n })\n })\n}\n\n//;(async () => {\n// // we cannot detect customElements.get(\"cable-ready-updates-for\") because they are lazily initialized\n// if (window.CableReady) await import('./delegates/cable_ready.js')\n//})()\n\nexport { Devtool, decorateElementWithDevtool }\n\nexport default { restart, start, stop, VERSION }\n", "export default '0.0.19'\n", "export default class TurboBoostElement extends HTMLElement {\n constructor(html) {\n super()\n this.devtool = 'unknown'\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = html || '<slot></slot>'\n }\n\n connectedCallback() {\n this.ensureId()\n }\n\n ensureId() {\n if (this.id.trim().length) return\n this.id = `${this.tagName}-${this.uuidv4()}`.toLowerCase()\n }\n\n // SEE: https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid\n uuidv4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n )\n }\n\n get viewStack() {\n const value = this.getAttribute('view-stack')\n if (!value) return []\n return JSON.parse(value)\n }\n\n get partial() {\n return this.viewStack[0]\n }\n}\n", "import TurboBoostElement from '../../turbo_boost_element'\n\nconst html = `\n <turbo-boost>\n <slot name=\"busy\" hidden></slot>\n <slot></slot>\n </turbo-boost>\n`\n\nexport const busyDelay = 100 // milliseconds - time to wait before showing busy element\nexport const busyDuration = 400 // milliseconds - minimum time that busy element is shown\n\nexport default class ToggleElement extends TurboBoostElement {\n constructor() {\n super(html)\n }\n\n // TODO: Should we timeout after a theoretical max wait time?\n // The idea being that a server error occurred and the toggle failed.\n showBusyElement() {\n clearTimeout(this.showBusyElementTimeout)\n clearTimeout(this.hideBusyElementTimeout)\n\n if (!this.busyElement) return\n\n this.busyStartedAt = Date.now() + busyDelay\n this.showBusyElementTimeout = setTimeout(() => {\n this.busySlotElement.hidden = false\n this.defaultSlotElement.hidden = true\n }, busyDelay)\n }\n\n hideBusyElement() {\n clearTimeout(this.showBusyElementTimeout)\n clearTimeout(this.hideBusyElementTimeout)\n\n if (!this.busyElement) return\n\n let delay = busyDuration - (Date.now() - this.busyStartedAt)\n if (delay < 0) delay = 0\n\n delete this.busyStartedAt\n this.hideBusyElementTimeout = setTimeout(() => {\n this.busySlotElement.hidden = true\n this.defaultSlotElement.hidden = false\n }, delay)\n }\n\n get busyElement() {\n return this.querySelector(':scope > [slot=\"busy\"]')\n }\n\n get busySlotElement() {\n return this.shadowRoot.querySelector('slot[name=\"busy\"]')\n }\n\n get defaultSlotElement() {\n return this.shadowRoot.querySelector('slot:not([name])')\n }\n\n // indicates if an rpc call is active/busy\n get busy() {\n return this.getAttribute('busy') === 'true'\n }\n\n // indicates if an rpc call is active/busy\n set busy(value) {\n value = !!value\n if (this.busy === value) return\n this.setAttribute('busy', value)\n if (value) this.showBusyElement()\n else this.hideBusyElement()\n }\n\n get busyStartedAt() {\n if (!this.dataset.busyStartedAt) return 0\n return Number(this.dataset.busyStartedAt)\n }\n\n set busyStartedAt(value) {\n this.dataset.busyStartedAt = value\n }\n}\n", "import ToggleElement from '../toggle_element'\n\nexport default class ToggleTargetElement extends ToggleElement {\n connectedCallback() {\n super.connectedCallback()\n\n this.mouseenterHandler = this.onMouseenter.bind(this)\n this.addEventListener('mouseenter', this.mouseenterHandler)\n\n this.collapseHandler = this.collapse.bind(this)\n this.collapseNowHandler = this.collapseNow.bind(this)\n\n this.collapseOn.forEach(entry => {\n const parts = entry.split('@')\n const name = parts[0]\n\n if (parts.length > 1) {\n const target = parts[1].match(/^self|window$/) ? self : self[parts[1]]\n target.addEventListener(name, this.collapseNowHandler)\n } else {\n this.addEventListener(name, this.collapseHandler)\n }\n })\n }\n\n disconnectedCallback() {\n this.removeEventListener('mouseenter', this.mouseenterHandler)\n\n this.collapseOn.forEach(entry => {\n const parts = entry.split('@')\n const name = parts[0]\n\n if (parts.length > 1) {\n const target = parts[1].match(/^self|window$/) ? self : self[parts[1]]\n target.removeEventListener(name, this.collapseNowHandler)\n } else {\n this.removeEventListener(name, this.collapseHandler)\n }\n })\n }\n\n // TODO: get cached content working properly\n // perhaps use a mechanic other than morph\n\n // TODO: implement cache (similar to Turbo Drive restoration visit)\n cacheHTML() {\n // this.cachedHTML = this.innerHTML\n }\n\n // TODO: implement cache (similar to Turbo Drive restoration visit)\n renderCachedHTML() {\n // if (!this.cachedHTML) return\n // this.innerHTML = this.cachedHTML\n }\n\n onMouseenter() {\n clearTimeout(this.collapseTimeout)\n }\n\n collapse(delay = 250) {\n clearTimeout(this.collapseTimeout)\n if (this.busy) return\n if (typeof delay !== 'number') delay = 250\n\n if (delay > 0) return (this.collapseTimeout = setTimeout(() => this.collapse(0), delay))\n\n this.innerHTML = ''\n try {\n this.expanded = false\n this.triggerElement.hideDevtool()\n } catch {}\n }\n\n collapseNow(event) {\n if (event.target.closest('turbo-boost-devtool-tooltip')) return\n this.collapse(0)\n }\n\n collapseMatches() {\n document.querySelectorAll(this.collapseSelector).forEach(el => {\n if (el.id === this.id) return\n if (el.collapse) el.collapse(0)\n })\n }\n\n get collapseSelector() {\n return this.triggerElement.collapseSelector || this.getAttribute('collapse-selector')\n }\n\n get focusSelector() {\n return this.getAttribute('focus-selector')\n }\n\n // the active trigger\n get triggerElement() {\n return document.getElementById(this.labeledBy)\n }\n\n // all triggers\n get triggerElements() {\n return document.querySelectorAll(`[aria-controls=\"${this.id}\"]`)\n }\n\n // the dom id of the active trigger\n get labeledBy() {\n return this.getAttribute('aria-labeledby')\n }\n\n set labeledBy(value) {\n return this.setAttribute('aria-labeledby', value)\n }\n\n get collapseOn() {\n const value = this.getAttribute('collapse-on')\n if (!value) return []\n return JSON.parse(value)\n }\n\n get expanded() {\n return this.triggerElement ? this.triggerElement.expanded : false\n }\n\n set expanded(value) {\n this.triggerElements.forEach(el => (el.expanded = value))\n }\n\n get busy() {\n return this.triggerElement && this.triggerElement.busy\n }\n}\n", "let focusTimeout\n\nfunction deactivateTrixAttributes(editor) {\n const attributes = ['bold', 'bullet', 'code', 'heading1', 'href', 'italic', 'number', 'quote', 'strike']\n attributes.forEach(name => editor.deactivateAttribute(name))\n}\n\nfunction focusTrixEditorElement(element) {\n if (element.value.length === 0) return\n\n const editor = element.editor\n\n // move cursor to the end\n let lastRange = []\n while (lastRange[0] !== editor.getSelectedRange()[0] && lastRange[1] !== editor.getSelectedRange()[1]) {\n lastRange = editor.getSelectedRange()\n editor.moveCursorInDirection('forward')\n }\n\n // insert an empty char and select it\n editor.insertString(' ')\n editor.moveCursorInDirection('forward')\n editor.setSelectedRange([lastRange[1], editor.getSelectedRange()[1]])\n\n // deactivate all trix features for the selection\n deactivateTrixAttributes(editor)\n\n // move cursor to end and collapse the selection\n editor.setSelectedRange([editor.getSelectedRange()[1], editor.getSelectedRange()[1]])\n}\n\nfunction debouncedFocus(element) {\n clearTimeout(focusTimeout)\n\n focusTimeout = setTimeout(() => {\n if (!element) return\n\n element.focus()\n const trixEditorElement = element.closest('trix-editor')\n\n try {\n if (trixEditorElement) {\n focusTrixEditorElement(trixEditorElement)\n } else {\n element.selectionStart = element.selectionEnd = element.value.length\n }\n } catch (_) {\n } finally {\n element.scrollIntoView({ block: 'center', behavior: 'smooth' })\n }\n }, 100)\n}\n\nexport default element => debouncedFocus(element)\n", "import { Devtool, decorateElementWithDevtool } from '@turbo-boost/devtools'\n\nimport ToggleElement, { busyDuration } from '../toggle_element'\nimport focus from './focus'\n\ndocument.addEventListener('turbo-boost:devtools-start', () => Devtool.register('toggle', 'toggles'))\n\nlet currentFocusSelector\n\nexport default class ToggleTriggerElement extends ToggleElement {\n constructor() {\n super()\n\n decorateElementWithDevtool(this, 'toggle', 'toggles')\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n const { start: commandStartEvent } = TurboBoost.Commands.events\n this.commandStartHandler = this.onCommandStart.bind(this)\n this.addEventListener(commandStartEvent, this.commandStartHandler)\n\n const { before: beforeInvokeEvent } = TurboBoost.Streams.invokeEvents\n this.beforeInvokeHandler = this.onBeforeInvoke.bind(this)\n addEventListener(beforeInvokeEvent, this.beforeInvokeHandler)\n\n // fires after receiving the toggle morph Turbo Stream but before it is executed\n // this.addEventListener(TurboBoost.Commands.events.success, event => {\n // // TODO: imlement cache, this.targetElement.cacheHTML()\n // })\n\n this.initializeDevtool()\n }\n\n disconnectedCallback() {\n // delay cleanup because the trigger may have been morphed out of the DOM,\n // but it's needed to apply behavior like focus etc...\n setTimeout(() => {\n const { start: commandStartEvent } = TurboBoost.Commands.events\n this.removeEventListener(commandStartEvent, this.commandStartHandler)\n\n const { before: beforeInvokeEvent } = TurboBoost.Streams.invokeEvents\n removeEventListener(beforeInvokeEvent, this.beforeInvokeHandler)\n\n this.removeDevtool()\n }, 1000)\n }\n\n onCommandStart(event) {\n currentFocusSelector = this.focusSelector\n this.targetElement.labeledBy = this.id\n this.targetElement.collapseMatches()\n this.busy = true\n // TODO: implement cache - this.targetElement.renderCachedHTML()\n }\n\n // runs before an invoke turbo stream is executed\n onBeforeInvoke(event) {\n // return early if we're not the element responsible for this invoke\n if (event.detail.method !== 'morph') return\n if (event.target.id !== this.morphs) return\n const selector = `turbo-boost-toggle-target[aria-labeledby=\"${this.id}\"]`\n if (!event.target.querySelector(selector)) return\n\n // ensure the busy element is shown long enough for a good user experience\n // we accomplish this by modifying the event.detail with invoke instructions i.e. { delay }\n // SEE: the TurboBoost Streams library for details on how this works\n const duration = Date.now() - this.busyStartedAt\n let delay = busyDuration - duration\n if (delay < 10) delay = 10\n event.detail.invoke = { delay }\n\n // runs before the morph is executed\n setTimeout(() => {\n this.busy = false\n this.morphToggleTriggerElements.forEach(el => (el.busy = false))\n }, delay - 10)\n\n // runs after the morph is executed\n setTimeout(() => focus(this.targetElement.querySelector(currentFocusSelector)), delay + 100)\n }\n\n // a list of views shared between the trigger and target\n get sharedViews() {\n if (!this.targetElement) return []\n if (!this.targetElement.viewStack) return []\n const reducer = (memo, view) => {\n if (this.targetElement.viewStack.includes(view)) memo.push(view)\n return memo\n }\n return this.viewStack.reduce(reducer.bind(this), [])\n }\n\n // the partial to render\n get renders() {\n return this.getAttribute('renders')\n }\n\n // the renderered partial's top wrapping dom_id\n get morphs() {\n return this.getAttribute('morphs')\n }\n\n // all toggle elements contained by the `morphElement`\n get morphToggleTriggerElements() {\n return Array.from(this.morphElement.querySelectorAll('turbo-boost-toggle-trigger'))\n }\n\n // the target's dom_id\n get controls() {\n return this.getAttribute('aria-controls')\n }\n\n get collapseSelector() {\n return this.getAttribute('collapse-selector')\n }\n\n get focusSelector() {\n return this.getAttribute('focus-selector') || this.targetElement.focusSelector\n }\n\n // indicates if the toggle state should be remembered across requests\n get remember() {\n return this.getAttribute('remember') === 'true'\n }\n\n set remember(value) {\n return this.setAttribute('remember', !!value)\n }\n\n // indicates if the target is expanded\n get expanded() {\n return this.getAttribute('aria-expanded') === 'true'\n }\n\n set expanded(value) {\n this.setAttribute('aria-expanded', !!value)\n }\n\n // indicates if the target is expanded\n get collapsed() {\n return !this.expanded\n }\n\n // ------ DevToolDelegate ------\n get command() {\n return this.dataset.turboCommand\n }\n\n get renderingLineLabel() {\n return 'renders & morphs'\n }\n\n // the morph element\n get morphElement() {\n if (!this.morphs) return null\n return document.getElementById(this.morphs)\n }\n\n // the target element\n get targetElement() {\n if (!this.controls) return null\n return document.getElementById(this.controls)\n }\n\n get triggerTooltipData() {\n let content = this.triggerElement.viewStack\n .reverse()\n .map((view, index) => {\n return this.triggerElement.sharedViews.includes(view)\n ? `<div slot=\"content\">${index + 1}. ${view}</div>`\n : `<div slot=\"content-bottom\">${index + 1}. ${view}</div>`\n }, this)\n .join('')\n\n return {\n subtitle: `\n <b>id</b>: ${this.triggerElement.id}<br>\n <b>aria-controls</b>: ${this.triggerElement.controls}<br>\n <b>aria-expanded</b>: ${this.triggerElement.expanded}<br>\n <b>remember</b>: ${this.triggerElement.remember}<br>\n `,\n content: `\n <div slot=\"content-top\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"12 2 2 7 12 12 22 7 12 2\"></polygon><polyline points=\"2 17 12 22 22 17\"></polyline><polyline points=\"2 12 12 17 22 12\"></polyline></svg>\n <b>View Stack</b>\n </div>\n ${content}\n `\n }\n }\n\n get targetTooltipData() {\n let content = this.targetElement.viewStack\n .reverse()\n .map((view, index) => {\n return this.triggerElement.sharedViews.includes(view)\n ? `<div slot=\"content\">${index + 1}. ${view}</div>`\n : `<div slot=\"content-bottom\">${index + 1}. ${view}</div>`\n }, this)\n .join('')\n\n return {\n subtitle: `<b>id</b>: ${this.targetElement.id}<br>\n <b>aria-labeled-by</b>: ${this.targetElement.labeledBy}<br>\n`,\n content: `\n <div slot=\"content-top\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"12 2 2 7 12 12 22 7 12 2\"></polygon><polyline points=\"2 17 12 22 22 17\"></polyline><polyline points=\"2 12 12 17 22 12\"></polyline></svg>\n <b>View Stack</b>\n </div>\n ${content}\n `\n }\n }\n}\n", "import TurboBoostElement from './turbo_boost_element'\nimport ToggleTargetElement from './toggle_elements/target_element'\nimport ToggleTriggerElement from './toggle_elements/trigger_element'\n\n// Valid custom element names: https://html.spec.whatwg.org/#valid-custom-element-name\n\ncustomElements.define('turbo-boost', TurboBoostElement)\ncustomElements.define('turbo-boost-toggle-target', ToggleTargetElement)\ncustomElements.define('turbo-boost-toggle-trigger', ToggleTriggerElement)\n"],
|
5
|
-
"mappings": "AAAA,MAAO,qbCAAA,EAAQ,QCAR,SAASC,GAASC,EAAM,CAC7B,IAAID,EAAW,SAAS,cAAc,UAAU,EAChD,OAAAA,EAAS,UAAYC,EACdD,CACT,CAEO,SAASE,EAAWD,EAAME,EAAQ,CACvCA,EAASA,GAAU,SAAS,KAE5B,IAAMC,EADQJ,GAASC,CAAI,EAAE,QAAQ,UAAU,EAAI,EAC/B,cAAc,GAAG,EACrC,OAAOE,EAAO,YAAYC,CAAK,CACjC,CAEO,SAASC,EAAaC,EAASC,EAAU,CAAC,EAAG,CAClD,GAAI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Ae,YAAY,SAASH,CAAI,EAChD,uBAAuBG,EAAQ,CAAC,KAAKH,CAAI,SACzC,8BAA8BG,EAAQ,CAAC,KAAKH,CAAI,SACnD,IAAI,EACN,KAAK,EAAE,EAEV,MAAO,CACL,SAAU;AAAA,mBACG,KAAK,eAAe,EAAE;AAAA,8BACX,KAAK,eAAe,QAAQ;AAAA,8BAC5B,KAAK,eAAe,QAAQ;AAAA,yBACjC,KAAK,eAAe,QAAQ;AAAA,MAE/C,QAAS;AAAA;AAAA;AAAA;AAAA;AAAA,QAKPE,CAAO;AAAA,KAEX,CACF,CAEA,IAAI,mBAAoB,CACtB,IAAIA,EAAU,KAAK,cAAc,UAC9B,QAAQ,EACR,IAAI,CAACF,EAAMG,IACH,KAAK,eAAe,YAAY,SAASH,CAAI,EAChD,uBAAuBG,EAAQ,CAAC,KAAKH,CAAI,SACzC,8BAA8BG,EAAQ,CAAC,KAAKH,CAAI,SACnD,IAAI,EACN,KAAK,EAAE,EAEV,MAAO,CACL,SAAU,cAAc,KAAK,cAAc,EAAE;AAAA,gCACnB,KAAK,cAAc,SAAS;AAAA,EAEtD,QAAS;AAAA;AAAA;AAAA;AAAA;AAAA,QAKPE,CAAO;AAAA,KAEX,CACF,CACF,EClNA,eAAe,OAAO,cAAeE,CAAiB,EACtD,eAAe,OAAO,4BAA6BC,CAAmB,EACtE,eAAe,OAAO,6BAA8BC,CAAoB,EhBHxE,KAAK,WAAa,KAAK,YAAc,CAAC,EACtC,KAAK,WAAW,SAAWC,EAC3B,KAAK,WAAW,SAAW,CAAE,QAAAC,CAAQ,EAErC,IAAOC,GAAQ,KAAK,WAAW",
|
4
|
+
"sourcesContent": ["import '@turbo-boost/commands'\nimport devtools from '@turbo-boost/devtools'\nimport VERSION from './version'\nimport './elements'\n\nself.TurboBoost = self.TurboBoost || {}\nself.TurboBoost.devtools = devtools\nself.TurboBoost.Elements = { VERSION }\n\nexport default self.TurboBoost.Elements\n", "export default '0.0.6'\n", "export function template(html) {\n let template = document.createElement('template')\n template.innerHTML = html\n return template\n}\n\nexport function appendHTML(html, parent) {\n parent = parent || document.body\n const clone = template(html).content.cloneNode(true)\n const child = clone.querySelector('*')\n return parent.appendChild(child)\n}\n\nexport function addHighlight(element, options = {}) {\n if (!element) return\n removeHighlight(element)\n let { outline, outlineOffset } = options\n\n outline = outline || 'dashed 3px red'\n outlineOffset = outlineOffset || '0px'\n\n element.originalStyles = element.originalStyles || {\n display: element.style.display,\n minHeight: element.style.minHeight,\n minWidth: element.style.minWidth,\n outline: element.style.outline,\n outlineOffset: element.style.outlineOffset\n }\n\n if (\n getComputedStyle(element).display.match(/^inline$/i) &&\n element.offsetWidth === 0 &&\n element.offsetHeight === 0\n ) {\n element.style.display = 'inline-block'\n element.style.minHeight = '2px'\n element.style.minWidth = '2px'\n }\n element.style.outline = outline\n element.style.outlineOffset = outlineOffset\n element.dataset.turboBoostHighlight = true\n}\n\nexport function removeHighlight(element) {\n if (!element) return\n if (element.originalStyles) {\n for (const [key, value] of Object.entries(element.originalStyles))\n value ? (element.style[key] = value) : (element.style[key] = '')\n delete element.originalStyles\n }\n delete element.dataset.turboBoostHighlight\n}\n\nexport function coordinates(element) {\n if (!element) return {}\n const rect = element.getBoundingClientRect()\n const width = element.offsetWidth\n const height = element.offsetHeight\n const top = rect.top + window.scrollY\n const left = rect.left + window.scrollX\n const right = left + width\n const bottom = top + height\n return { top, left, right, bottom, width, height }\n}\n\nexport function attempt(callback) {\n try {\n callback()\n } catch {}\n}\n", "export default class DevtoolElement extends HTMLElement {\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n this.labelElement.addEventListener('click', event => {\n event.preventDefault()\n this.toggle()\n })\n this.checkboxElement.addEventListener('change', event =>\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n )\n }\n\n toggle() {\n this.checked ? this.uncheck() : this.check()\n }\n\n check() {\n this.checkboxElement.checked = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n }\n\n uncheck() {\n this.checkboxElement.checked = false\n this.dispatchEvent(new CustomEvent('change', { bubbles: true }))\n }\n\n get name() {\n return this.getAttribute('name')\n }\n\n get checked() {\n return this.checkboxElement.checked\n }\n\n get checkboxElement() {\n return this.shadowRoot.querySelector('input')\n }\n\n get labelElement() {\n return this.shadowRoot.querySelector('label')\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div>\n <input name=\"checkbox\" type=\"checkbox\">\n <label for=\"checkbox\"><slot name=\"label\"></slot></label>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host, :host * {\n cursor: pointer;\n }\n\n div {\n display: flex;\n margin-right: 10px;\n }\n\n input:checked + label{\n font-weight: bold;\n }\n\n label {\n color: black;\n }\n `\n }\n}\n", "import { appendHTML } from '../utils/dom.js'\n\nexport default class SupervisorElement extends HTMLElement {\n constructor() {\n super()\n this.enabledDevtools = {}\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n this.shadowRoot.querySelector('button').addEventListener('click', () =>\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-close', {\n bubbles: true\n })\n )\n )\n\n this.addEventListener('change', event => {\n const devtoolElement = event.target\n const { checked, name } = devtoolElement\n checked ? this.enableDevtool(name) : this.disableDevtool(name)\n })\n }\n\n enableDevtool(name) {\n if (this.enabledDevtools[name]) return\n this.enabledDevtools[name] = true\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtool-enable', {\n bubbles: true,\n detail: { name: name }\n })\n )\n }\n\n disableDevtool(name) {\n if (!this.enabledDevtools[name]) return\n delete this.enabledDevtools[name]\n this.dispatchEvent(\n new CustomEvent('turbo-boost:devtool-disable', {\n bubbles: true,\n detail: { name: name }\n })\n )\n }\n\n close() {\n this.devtoolElements.forEach(el => {\n if (el.checked) el.uncheck()\n })\n this.remove()\n }\n\n get devtoolElements() {\n return this.querySelectorAll('[slot=\"devtool\"]')\n }\n\n get closeElement() {\n return this.querySelector('button')\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div>\n <img src=\"https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342\">\n <slot name=\"devtool\"></slot>\n <button>\u2715</button>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host {\n background-color: gainsboro;\n border-radius: 5px;\n bottom: 20px;\n display: block;\n filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));\n left: 50%;\n outline-offset: 1px;\n outline: solid 2px black;\n padding: 5px 10px;\n position: fixed;\n transform: translateX(-50%);\n z-index: 8999;\n }\n\n * {\n -webkit-user-select: none;\n font-family: helvetica, sans-serif;\n font-size: 1rem;\n user-select: none;\n }\n\n img {\n align-self: center;\n cursor: grab;\n height: 25px;\n margin-left: -5px;\n vertical-align: middle;\n }\n\n div {\n display: flex;\n gap: 0 5px;\n position: relative;\n }\n\n [slot=\"devtool\"] {\n align-self: center;\n }\n\n button {\n align-self: center;\n background-color: darkgray;\n border-radius: 50%;\n border: none;\n color: black;\n cursor: pointer;\n font-size: 10px;\n height: 18px;\n line-height: 18px;\n margin-right: -5px;\n opacity: 0.5;\n outline: solid 1px black;\n padding: 0 2px;\n width: 18px;\n }\n\n button:hover {\n opacity: 1;\n }\n `\n }\n}\n", "export default class TooltipElement extends HTMLElement {\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = this.html\n }\n\n connectedCallback() {\n const savedTransform = localStorage.getItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`)\n\n if (savedTransform) {\n this.style.transform = savedTransform\n }\n }\n\n disconnectedCallback() {\n if (this.id !== 'undefined' && this.id !== '') {\n localStorage.setItem(`turbo-boost-devtools-${location.href}-${this.id}-transform`, this.style.transform)\n }\n }\n\n get color() {\n return this.getAttribute('color') || 'darkslategray'\n }\n\n get backgroundColor() {\n return this.getAttribute('background-color') || 'gainsboro'\n }\n\n get position() {\n return this.getAttribute('position') || 'top'\n }\n\n get html() {\n return `\n <style>${this.stylesheet}</style>\n <div role=\"container\">\n <div role=\"title\">\n <slot name=\"title\"></slot>\n <img src=\"https://ik.imagekit.io/hopsoft/turbo-boost-logo_zHiiimlvT.webp?ik-sdk-version=javascript-1.4.3&updatedAt=1671722004342\">\n </div>\n <slot name=\"subtitle\"></slot>\n <slot name=\"content-top\"></slot>\n <slot name=\"content\"></slot>\n <slot name=\"content-bottom\"></slot>\n </div>\n `\n }\n\n get stylesheet() {\n return `\n :host {\n display: block;\n position: absolute;\n z-index: 8999;\n }\n\n * {\n color: ${this.color}\n font-size: 1rem;\n }\n\n [role=\"container\"] {\n background-color: ${this.backgroundColor};\n border-radius: 15px;\n filter: drop-shadow(3px 3px 3px rgba(0,0,0,0.3));\n font-family: monospace;\n min-height: 30px;\n min-width: 100px;\n opacity: 0.9;\n outline-offset: 1px;\n outline: dashed 3px ${this.color};\n padding: 12px;\n position: relative;\n white-space: nowrap;\n }\n\n [role=\"title\"] {\n display: flex;\n }\n\n [role=\"title\"] slot[name=\"title\"] {\n color: ${this.color};\n display: block;\n flex-grow: 1;\n font-weight: bold;\n }\n\n [role=\"title\"] img {\n height: 25px;\n vertical-align: middle;\n }\n\n slot[name=\"subtitle\"] {\n border-bottom: dotted 1px ${this.color};\n border-top: dotted 1px ${this.color};\n color: ${this.color};\n display: block;\n font-size: 0.8rem;\n font-weight: lighter;\n margin-bottom: 12px;\n margin-top: 8px;\n padding-bottom: 4px;\n padding-top: 4px;\n width: 100%;\n }\n\n slot[name=\"content-top\"],\n slot[name=\"content\"],\n slot[name=\"content-bottom\"] {\n display: block;\n font-weight: normal;\n }\n\n slot[name=\"content-top\"] {\n color: ${this.color};\n margin-bottom: 8px;\n }\n\n slot[name=\"content\"],\n slot[name=\"content-bottom\"] {\n opacity: 0.7;\n padding-left: 12px;\n }\n\n slot[name=\"content\"] {\n color: ${this.color};\n }\n\n slot[name=\"content-bottom\"] {\n color: red;\n }\n `\n }\n}\n", "const added = []\n\nconst dependencies = {\n LeaderLine: {\n src: 'https://cdnjs.cloudflare.com/ajax/libs/leader-line/1.0.7/leader-line.min.js',\n integrity:\n 'sha512-0dNdzMjpT6pJdFGF1DwybFCfm3K/lzHhxaMXC/92J9/DZujHlqYFqmhTOAoD0o+LkeEsVK2ar/ESs7/Q2B6wJg==',\n global: 'LeaderLine'\n },\n\n PlainDraggable: {\n src: 'https://cdn.jsdelivr.net/npm/plain-draggable@2.5.14/plain-draggable.min.js',\n global: 'PlainDraggable'\n }\n}\n\nfunction exists(dependency) {\n if (dependency.global && self[dependency.global]) return true\n if (document.querySelector(`[src='${dependency.src}']`)) return true\n return added.includes(dependency)\n}\n\nfunction add(dependency) {\n if (exists(dependency)) return\n added.push(dependency)\n\n const { src, integrity } = dependency\n const script = document.createElement('script')\n script.setAttribute('src', src)\n script.setAttribute('crossorigin', 'anonymous')\n script.setAttribute('referrerpolicy', 'no-referrer')\n if (integrity) script.setAttribute('integrity', integrity)\n document.head.appendChild(script)\n}\n\nfunction remove(dependency) {\n if (!added.includes(dependency)) return\n added.splice(added.indexOf(dependency), 1)\n\n const { src } = dependency\n const el = document.querySelector(`script[src='${src}']`)\n if (el) el.remove()\n if (dependency.global && self[dependency.global]) self[dependency.global] = null\n}\n\nfunction removeAll() {\n ;[...added].forEach(dependency => remove(dependency))\n}\n\nexport default { ...dependencies, add, remove, removeAll }\n", "import { appendHTML } from './utils/dom'\nimport DevtoolElement from './elements/devtool_element'\nimport SupervisorElement from './elements/supervisor_element'\nimport TooltipElement from './elements/tooltip_element'\nimport dependencies from './dependencies'\n\ncustomElements.define('turbo-boost-devtool', DevtoolElement)\ncustomElements.define('turbo-boost-devtool-supervisor', SupervisorElement)\ncustomElements.define('turbo-boost-devtool-tooltip', TooltipElement)\n\nlet supervisorElement\n\nfunction makeDraggable() {\n if (!supervisorElement) return\n try {\n new PlainDraggable(supervisorElement)\n } catch {\n setTimeout(makeDraggable, 200)\n }\n}\n\nfunction stop() {\n if (stopped()) return\n supervisorElement.close()\n supervisorElement.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-stop', {\n bubbles: true\n })\n )\n supervisorElement = null\n dependencies.removeAll()\n}\n\nfunction start() {\n if (started()) return\n dependencies.add(dependencies.LeaderLine)\n dependencies.add(dependencies.PlainDraggable)\n supervisorElement = appendHTML('<turbo-boost-devtool-supervisor></turbo-boost-devtool-supervisor>')\n setTimeout(makeDraggable, 200)\n supervisorElement.dispatchEvent(\n new CustomEvent('turbo-boost:devtools-start', {\n bubbles: true\n })\n )\n}\n\nfunction restart() {\n const enabledList = supervisorElement ? Object.keys(supervisorElement.enabledDevtools) : []\n\n stop()\n start()\n\n supervisorElement.devtoolElements.forEach(el => {\n if (enabledList.includes(el.name)) el.check()\n })\n}\n\nfunction started() {\n return !!supervisorElement\n}\n\nfunction stopped() {\n return !started()\n}\n\nlet restartTimeout\nfunction debouncedRestart() {\n clearTimeout(restartTimeout)\n restartTimeout = setTimeout(restart, 25)\n}\n\nfunction autoRestart() {\n if (started()) debouncedRestart()\n}\n\naddEventListener('turbo:load', autoRestart)\naddEventListener('turbo-frame:load', autoRestart)\naddEventListener('turbo-boost:devtools-connect', autoRestart)\naddEventListener('turbo-boost:devtools-close', stop)\n\nif (window.TurboBoost) {\n addEventListener(TurboBoost.Commands.events.success, autoRestart)\n addEventListener(TurboBoost.Commands.events.finish, autoRestart)\n}\n\nfunction register(name, label) {\n if (!supervisorElement) return\n return appendHTML(\n `\n <turbo-boost-devtool name=\"${name}\" slot=\"devtool\">\n <span slot=\"label\">${label}</span>\n </turbo-boost-devtool>\n `,\n supervisorElement\n )\n}\n\nfunction enabled(name) {\n if (!supervisorElement) return false\n return supervisorElement.enabledDevtools[name]\n}\n\nexport default {\n enabled,\n register,\n start,\n stop,\n restart: debouncedRestart,\n get started() {\n return started()\n },\n get stopped() {\n return stopped()\n }\n}\n", "// Icons courtesy of https://feathericons.com/\nimport supervisor from './supervisor'\nimport { appendHTML, addHighlight, attempt, coordinates, removeHighlight } from './utils/dom.js'\n\nfunction appendTooltip(title, subtitle, content, options = {}) {\n let { backgroundColor, color, position, id } = options\n color = color || 'white'\n position = position || 'top'\n return appendHTML(`\n <turbo-boost-devtool-tooltip id=\"${id}\" position=\"${position}\" background-color=\"${backgroundColor}\" color=\"${color}\">\n <div slot='title'>${title}</div>\n <div slot='subtitle'>${subtitle}</div>\n ${content}\n </turbo-boost-devtool-tooltip>\n `)\n}\n\nlet activeTarget\n\nexport default class Devtool {\n constructor(delegate) {\n this.delegate = delegate\n\n let hideTimeout\n const debouncedHide = () => {\n clearTimeout(hideTimeout)\n hideTimeout = setTimeout(this.hide({ active: false }), 25)\n }\n\n this.eventListeners['turbo-boost:devtool-enable'] = event => {\n // LeaderLine.positionByWindowResize = false\n const { name } = event.detail\n if (name !== this.delegate.name) return\n\n addHighlight(this.delegate.triggerElement, {\n outline: '3px dashed blueviolet',\n outlineOffset: '2px'\n })\n\n this.hide({ active: false })\n if (this.active) this.show()\n }\n\n this.eventListeners['turbo-boost:devtool-disable'] = event => {\n const { name } = event.detail\n if (name === this.delegate.name) removeHighlight(this.delegate.triggerElement)\n }\n\n this.eventListeners['click'] = event => {\n if (event.target.closest('turbo-boost-devtool-tooltip')) return\n debouncedHide()\n }\n\n this.eventListeners['turbo:load'] = debouncedHide\n this.eventListeners['turbo-frame:load'] = debouncedHide\n if (window.TurboBoost) {\n this.eventListeners[TurboBoost.Commands.events.finish] = debouncedHide\n }\n\n this.registerEventListeners()\n }\n\n registerEventListeners() {\n Object.entries(this.eventListeners).forEach(([type, listener]) => {\n addEventListener(type, listener)\n })\n }\n\n unregisterEventListeners() {\n Object.entries(this.eventListeners).forEach(([type, listener]) => {\n removeEventListener(type, listener)\n })\n }\n\n get eventListeners() {\n return this._eventListeners || (this._eventListeners = {})\n }\n\n show() {\n if (!this.enabled) return\n\n if (this.active) return\n this.active = true\n\n this.hide({ active: true })\n\n addHighlight(this.delegate.targetElement, {\n outline: '3px dashed darkcyan',\n outlineOffset: '-2px'\n })\n\n addHighlight(this.delegate.morphElement, {\n outline: '3px dashed chocolate',\n outlineOffset: '3px'\n })\n\n this.renderingTooltip = this.createRenderingTooltip()\n this.targetTooltip = this.createTargetTooltip()\n this.triggerTooltip = this.createTriggerTooltip(this.targetTooltip, this.renderingTooltip)\n\n document.querySelectorAll('.leader-line').forEach(el => (el.style.zIndex = 100000))\n\n const data = {\n morph: {\n partial: this.delegate.triggerElement.renders,\n id: this.delegate.triggerElement.morphs,\n status: this.delegate.morphElement ? 'OK' : 'Not Found'\n },\n trigger: { partial: null, id: null, status: 'Not Found' },\n target: { partial: null, id: null, status: 'Not Found' }\n }\n\n if (this.delegate.triggerElement) {\n data.trigger = {\n partial: this.delegate.triggerElement.partial,\n id: this.delegate.triggerElement.id,\n status: 'OK'\n }\n data.target.id = this.delegate.triggerElement.controls\n }\n\n if (this.delegate.targetElement)\n data.target = {\n partial: this.delegate.targetElement.partial,\n dom_id: this.delegate.targetElement.id,\n status: 'OK'\n }\n\n console.table(data)\n }\n\n hide({ active: active = false }) {\n document.querySelectorAll('turbo-boost-devtool-tooltip').forEach(tooltip => {\n attempt(() => tooltip.line.remove())\n attempt(() => tooltip.drag.remove())\n attempt(() => tooltip.lineToRendering.remove())\n attempt(() => tooltip.lineToTarget.remove())\n attempt(() => tooltip.remove())\n })\n\n document.querySelectorAll('[data-turbo-boost-highlight]').forEach(el => {\n if (!el.tagName.match(/turbo-boost-toggle-trigger/i)) removeHighlight(el)\n })\n\n this.active = active\n }\n\n get active() {\n return activeTarget === this.delegate\n }\n\n set active(value) {\n if (value) activeTarget = this.delegate\n else activeTarget = null\n }\n\n get enabled() {\n return supervisor.enabled(this.delegate.name)\n }\n\n static register(name, label) {\n supervisor.register(name, label)\n }\n\n createRenderingTooltip() {\n if (!this.delegate.triggerElement.renders)\n return console.debug(\n `Unable to create the rendering tooltip! The trigger element must set the 'renders' attribute.`\n )\n\n if (!this.delegate.triggerElement.morphs)\n return console.debug(\n `Unable to create the rendering tooltip! The trigger element specified the 'morphs' attrbiute but no element matches the DOM id: '${this.triggerElement.morphs}'`\n )\n\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 19l7-7 3 3-7 7-3-3z\"></path><path d=\"M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z\"></path><path d=\"M2 2l7.586 7.586\"></path><circle cx=\"11\" cy=\"11\" r=\"2\"></circle></svg>\n RENDERING - <${this.delegate.triggerElement.tagName.toLowerCase()}>\n `\n const subtitle = `\n <b>partial</b>: ${this.delegate.triggerElement.renders || 'unknown'}<br>\n <b>morphs</b>: ${this.delegate.triggerElement.morphs || 'unknown'}<br>\n `\n const content = `\n <div slot=\"content-top\" style=\"font-size:85%; font-style:italic; font-weight:100;\">\n The <b>TRIGGER</b> toggles the <b>TARGET</b> then renders the partial & morphs the element.<br>\n </div>\n `\n const tooltip = appendTooltip(title, subtitle, content, {\n id: `${this.delegate.id}-rendering`,\n backgroundColor: 'lightyellow',\n color: 'chocolate'\n })\n\n const coords = coordinates(this.delegate.morphElement)\n const top = Math.ceil(coords.top + coords.height / 2 - tooltip.offsetHeight / 2)\n const left = Math.ceil(coords.left + coords.width + 100)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(tooltip, this.delegate.morphElement, {\n ...this.leaderLineOptions,\n color: 'chocolate'\n })\n\n tooltip.drag = new PlainDraggable(tooltip)\n return tooltip\n }\n\n createTargetTooltip() {\n if (!this.delegate.targetElement)\n return console.debug(\n `Unable to create the target tooltip! No element matches the DOM id: '${this.delegate.triggerElement.controls}'`\n )\n\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><circle cx=\"12\" cy=\"12\" r=\"6\"></circle><circle cx=\"12\" cy=\"12\" r=\"2\"></circle></svg>\n TARGET - <${this.delegate.targetElement.tagName.toLowerCase()}>\n `\n\n const tooltip = appendTooltip(\n title,\n this.delegate.targetTooltipData?.subtitle || '',\n this.delegate.targetTooltipData?.content || '',\n {\n id: `${this.delegate.id}-target`,\n backgroundColor: 'lightcyan',\n color: 'darkcyan',\n position: 'bottom'\n }\n )\n\n const coords = coordinates(this.delegate.targetElement)\n const top = Math.ceil(coords.top + tooltip.offsetHeight)\n const left = Math.ceil(coords.left + coords.width + tooltip.offsetWidth / 3)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(tooltip, this.delegate.targetElement, {\n ...this.leaderLineOptions,\n color: 'darkcyan'\n })\n\n tooltip.drag = new PlainDraggable(tooltip)\n return tooltip\n }\n\n createTriggerTooltip(targetTooltip, renderingTooltip) {\n if (!this.delegate.triggerElement) return\n const title = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"13 2 3 14 12 14 11 22 21 10 12 10 13 2\"></polygon></svg>\n TRIGGER - <${this.delegate.triggerElement.tagName.toLowerCase()}>\n `\n\n const tooltip = appendTooltip(\n title,\n this.delegate.triggerTooltipData?.subtitle || '',\n this.delegate.triggerTooltipData?.content || '',\n {\n id: `${this.delegate.id}-trigger`,\n backgroundColor: 'lavender',\n color: 'blueviolet'\n }\n )\n\n const coords = coordinates(this.delegate.triggerElement)\n const top = Math.ceil(coords.top - tooltip.offsetHeight * 2)\n const left = Math.ceil(coords.left + coords.width + tooltip.offsetWidth / 3)\n tooltip.style.top = `${top}px`\n tooltip.style.left = `${left}px`\n\n tooltip.line = new LeaderLine(this.delegate.triggerElement, tooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet'\n })\n\n if (targetTooltip) {\n tooltip.lineToTarget = new LeaderLine(tooltip, targetTooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet',\n middleLabel: this.delegate.targetLineLabel,\n size: 2.1\n })\n\n targetTooltip.drag.onMove = () => {\n targetTooltip.line.position()\n tooltip.lineToTarget?.position()\n tooltip.lineToRendering?.position()\n }\n }\n\n if (renderingTooltip) {\n tooltip.lineToRendering = new LeaderLine(tooltip, renderingTooltip, {\n ...this.leaderLineOptions,\n color: 'blueviolet',\n middleLabel: this.delegate.renderingLineLabel,\n size: 2.1\n })\n\n renderingTooltip.drag.onMove = () => {\n renderingTooltip.line.position()\n if (tooltip.lineToTarget) tooltip.lineToTarget.position()\n tooltip.lineToRendering?.position()\n }\n }\n\n tooltip.drag = new PlainDraggable(tooltip)\n tooltip.drag.onMove = () => {\n tooltip.line.position()\n if (tooltip.lineToTarget) tooltip.lineToTarget.position()\n if (tooltip.lineToRendering) tooltip.lineToRendering.position()\n }\n\n return tooltip\n }\n\n get leaderLineOptions() {\n return {\n dash: { animation: true },\n dropShadow: { opacity: 0.3 },\n endPlug: 'arrow3',\n endPlugSize: 1.7,\n size: 3,\n startPlug: 'disc',\n startPlugSize: 1\n }\n }\n}\n", "import VERSION from './version'\nimport supervisor from './supervisor'\nimport Devtool from './devtool'\n\nconst { restart, start, stop } = supervisor\n\nfunction decorateElementWithDevtool(element, name, label) {\n Object.assign(element, {\n initializeDevtool() {\n const mouseenter = () => this.devtool.show()\n\n addEventListener('turbo-boost:devtools-start', () => {\n this.devtool = new Devtool(this)\n this.addEventListener('mouseenter', mouseenter)\n })\n\n addEventListener('turbo-boost:devtools-stop', () => {\n this.removeEventListener('mouseenter', mouseenter)\n this.removeDevtool()\n })\n\n this.dispatchEvent(new CustomEvent('turbo-boost:devtools-connect', { bubbles: true }))\n },\n hideDevtool() {\n this.devtool?.hide({ active: false })\n },\n removeDevtool() {\n if (this.devtool?.hide) this.devtool.hide({ active: false })\n if (this.devtool?.unregisterEventListeners) this.devtool.unregisterEventListeners()\n delete this.devtool\n },\n name,\n targetLineLabel: label\n })\n\n // the element references below are defaults that are placed on the receiver if not present\n const properties = ['triggerElement', 'morphElement', 'targetElement']\n\n properties\n .filter(property => {\n return element[property] === undefined\n })\n .forEach(property => {\n Object.defineProperty(element, property, {\n get() {\n return element\n }\n })\n })\n}\n\n//;(async () => {\n// // we cannot detect customElements.get(\"cable-ready-updates-for\") because they are lazily initialized\n// if (window.CableReady) await import('./delegates/cable_ready.js')\n//})()\n\nexport { Devtool, decorateElementWithDevtool }\n\nexport default { restart, start, stop, VERSION }\n", "export default '0.1.0'\n", "export default class TurboBoostElement extends HTMLElement {\n constructor(html) {\n super()\n this.devtool = 'unknown'\n this.attachShadow({ mode: 'open' })\n this.shadowRoot.innerHTML = html || '<slot></slot>'\n }\n\n connectedCallback() {\n this.ensureId()\n }\n\n ensureId() {\n if (this.id.trim().length) return\n this.id = `${this.tagName}-${this.uuidv4()}`.toLowerCase()\n }\n\n // SEE: https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid\n uuidv4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>\n (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n )\n }\n\n get viewStack() {\n const value = this.getAttribute('view-stack')\n if (!value) return []\n return JSON.parse(value)\n }\n\n get partial() {\n return this.viewStack[0]\n }\n}\n", "import TurboBoostElement from '../../turbo_boost_element'\n\nconst html = `\n <turbo-boost>\n <slot name=\"busy\" hidden></slot>\n <slot></slot>\n </turbo-boost>\n`\n\nexport const busyDelay = 100 // milliseconds - time to wait before showing busy element\nexport const busyDuration = 400 // milliseconds - minimum time that busy element is shown\n\nexport default class ToggleElement extends TurboBoostElement {\n constructor() {\n super(html)\n }\n\n // TODO: Should we timeout after a theoretical max wait time?\n // The idea being that a server error occurred and the toggle failed.\n showBusyElement() {\n clearTimeout(this.showBusyElementTimeout)\n clearTimeout(this.hideBusyElementTimeout)\n\n if (!this.busyElement) return\n\n this.busyStartedAt = Date.now() + busyDelay\n this.showBusyElementTimeout = setTimeout(() => {\n this.busySlotElement.hidden = false\n this.defaultSlotElement.hidden = true\n }, busyDelay)\n }\n\n hideBusyElement() {\n clearTimeout(this.showBusyElementTimeout)\n clearTimeout(this.hideBusyElementTimeout)\n\n if (!this.busyElement) return\n\n let delay = busyDuration - (Date.now() - this.busyStartedAt)\n if (delay < 0) delay = 0\n\n delete this.busyStartedAt\n this.hideBusyElementTimeout = setTimeout(() => {\n this.busySlotElement.hidden = true\n this.defaultSlotElement.hidden = false\n }, delay)\n }\n\n get busyElement() {\n return this.querySelector(':scope > [slot=\"busy\"]')\n }\n\n get busySlotElement() {\n return this.shadowRoot.querySelector('slot[name=\"busy\"]')\n }\n\n get defaultSlotElement() {\n return this.shadowRoot.querySelector('slot:not([name])')\n }\n\n // indicates if an rpc call is active/busy\n get busy() {\n return this.getAttribute('busy') === 'true'\n }\n\n // indicates if an rpc call is active/busy\n set busy(value) {\n value = !!value\n if (this.busy === value) return\n this.setAttribute('busy', value)\n if (value) this.showBusyElement()\n else this.hideBusyElement()\n }\n\n get busyStartedAt() {\n if (!this.dataset.busyStartedAt) return 0\n return Number(this.dataset.busyStartedAt)\n }\n\n set busyStartedAt(value) {\n this.dataset.busyStartedAt = value\n }\n}\n", "import ToggleElement from '../toggle_element'\n\nexport default class ToggleTargetElement extends ToggleElement {\n connectedCallback() {\n super.connectedCallback()\n\n this.mouseenterHandler = this.onMouseenter.bind(this)\n this.addEventListener('mouseenter', this.mouseenterHandler)\n\n this.collapseHandler = this.collapse.bind(this)\n this.collapseNowHandler = this.collapseNow.bind(this)\n\n this.collapseOn.forEach(entry => {\n const parts = entry.split('@')\n const name = parts[0]\n\n if (parts.length > 1) {\n const target = parts[1].match(/^self|window$/) ? self : self[parts[1]]\n target.addEventListener(name, this.collapseNowHandler)\n } else {\n this.addEventListener(name, this.collapseHandler)\n }\n })\n }\n\n disconnectedCallback() {\n this.removeEventListener('mouseenter', this.mouseenterHandler)\n\n this.collapseOn.forEach(entry => {\n const parts = entry.split('@')\n const name = parts[0]\n\n if (parts.length > 1) {\n const target = parts[1].match(/^self|window$/) ? self : self[parts[1]]\n target.removeEventListener(name, this.collapseNowHandler)\n } else {\n this.removeEventListener(name, this.collapseHandler)\n }\n })\n }\n\n // TODO: get cached content working properly\n // perhaps use a mechanic other than morph\n\n // TODO: implement cache (similar to Turbo Drive restoration visit)\n cacheHTML() {\n // this.cachedHTML = this.innerHTML\n }\n\n // TODO: implement cache (similar to Turbo Drive restoration visit)\n renderCachedHTML() {\n // if (!this.cachedHTML) return\n // this.innerHTML = this.cachedHTML\n }\n\n onMouseenter() {\n clearTimeout(this.collapseTimeout)\n }\n\n collapse(delay = 250) {\n clearTimeout(this.collapseTimeout)\n if (this.busy) return\n if (typeof delay !== 'number') delay = 250\n\n if (delay > 0) return (this.collapseTimeout = setTimeout(() => this.collapse(0), delay))\n\n this.innerHTML = ''\n try {\n this.expanded = false\n this.triggerElement.hideDevtool()\n } catch {}\n }\n\n collapseNow(event) {\n if (event.target.closest('turbo-boost-devtool-tooltip')) return\n this.collapse(0)\n }\n\n collapseMatches() {\n document.querySelectorAll(this.collapseSelector).forEach(el => {\n if (el.id === this.id) return\n if (el.collapse) el.collapse(0)\n })\n }\n\n get collapseSelector() {\n return this.triggerElement.collapseSelector || this.getAttribute('collapse-selector')\n }\n\n get focusSelector() {\n return this.getAttribute('focus-selector')\n }\n\n // the active trigger\n get triggerElement() {\n return document.getElementById(this.labeledBy)\n }\n\n // all triggers\n get triggerElements() {\n return document.querySelectorAll(`[aria-controls=\"${this.id}\"]`)\n }\n\n // the dom id of the active trigger\n get labeledBy() {\n return this.getAttribute('aria-labeledby')\n }\n\n set labeledBy(value) {\n return this.setAttribute('aria-labeledby', value)\n }\n\n get collapseOn() {\n const value = this.getAttribute('collapse-on')\n if (!value) return []\n return JSON.parse(value)\n }\n\n get expanded() {\n return this.triggerElement ? this.triggerElement.expanded : false\n }\n\n set expanded(value) {\n this.triggerElements.forEach(el => (el.expanded = value))\n }\n\n get busy() {\n return this.triggerElement && this.triggerElement.busy\n }\n}\n", "let focusTimeout\n\nfunction deactivateTrixAttributes(editor) {\n const attributes = ['bold', 'bullet', 'code', 'heading1', 'href', 'italic', 'number', 'quote', 'strike']\n attributes.forEach(name => editor.deactivateAttribute(name))\n}\n\nfunction focusTrixEditorElement(element) {\n if (element.value.length === 0) return\n\n const editor = element.editor\n\n // move cursor to the end\n let lastRange = []\n while (lastRange[0] !== editor.getSelectedRange()[0] && lastRange[1] !== editor.getSelectedRange()[1]) {\n lastRange = editor.getSelectedRange()\n editor.moveCursorInDirection('forward')\n }\n\n // insert an empty char and select it\n editor.insertString(' ')\n editor.moveCursorInDirection('forward')\n editor.setSelectedRange([lastRange[1], editor.getSelectedRange()[1]])\n\n // deactivate all trix features for the selection\n deactivateTrixAttributes(editor)\n\n // move cursor to end and collapse the selection\n editor.setSelectedRange([editor.getSelectedRange()[1], editor.getSelectedRange()[1]])\n}\n\nfunction debouncedFocus(element) {\n clearTimeout(focusTimeout)\n\n focusTimeout = setTimeout(() => {\n if (!element) return\n\n element.focus()\n const trixEditorElement = element.closest('trix-editor')\n\n try {\n if (trixEditorElement) {\n focusTrixEditorElement(trixEditorElement)\n } else {\n element.selectionStart = element.selectionEnd = element.value.length\n }\n } catch (_) {\n } finally {\n element.scrollIntoView({ block: 'center', behavior: 'smooth' })\n }\n }, 100)\n}\n\nexport default element => debouncedFocus(element)\n", "import { Devtool, decorateElementWithDevtool } from '@turbo-boost/devtools'\n\nimport ToggleElement, { busyDuration } from '../toggle_element'\nimport focus from './focus'\n\ndocument.addEventListener('turbo-boost:devtools-start', () => Devtool.register('toggle', 'toggles'))\n\nlet currentFocusSelector\n\nexport default class ToggleTriggerElement extends ToggleElement {\n constructor() {\n super()\n\n decorateElementWithDevtool(this, 'toggle', 'toggles')\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n const { start: commandStartEvent } = TurboBoost.Commands.events\n this.commandStartHandler = this.onCommandStart.bind(this)\n this.addEventListener(commandStartEvent, this.commandStartHandler)\n\n const { before: beforeInvokeEvent } = TurboBoost.Streams.invokeEvents\n this.beforeInvokeHandler = this.onBeforeInvoke.bind(this)\n addEventListener(beforeInvokeEvent, this.beforeInvokeHandler)\n\n // fires after receiving the toggle morph Turbo Stream but before it is executed\n // this.addEventListener(TurboBoost.Commands.events.success, event => {\n // // TODO: imlement cache, this.targetElement.cacheHTML()\n // })\n\n this.initializeDevtool()\n }\n\n disconnectedCallback() {\n // delay cleanup because the trigger may have been morphed out of the DOM,\n // but it's needed to apply behavior like focus etc...\n setTimeout(() => {\n const { start: commandStartEvent } = TurboBoost.Commands.events\n this.removeEventListener(commandStartEvent, this.commandStartHandler)\n\n const { before: beforeInvokeEvent } = TurboBoost.Streams.invokeEvents\n removeEventListener(beforeInvokeEvent, this.beforeInvokeHandler)\n\n this.removeDevtool()\n }, 1000)\n }\n\n onCommandStart(event) {\n currentFocusSelector = this.focusSelector\n this.targetElement.labeledBy = this.id\n this.targetElement.collapseMatches()\n this.busy = true\n // TODO: implement cache - this.targetElement.renderCachedHTML()\n }\n\n // runs before an invoke turbo stream is executed\n onBeforeInvoke(event) {\n // return early if we're not the element responsible for this invoke\n if (event.detail.method !== 'morph') return\n if (event.target.id !== this.morphs) return\n const selector = `turbo-boost-toggle-target[aria-labeledby=\"${this.id}\"]`\n if (!event.target.querySelector(selector)) return\n\n // ensure the busy element is shown long enough for a good user experience\n // we accomplish this by modifying the event.detail with invoke instructions i.e. { delay }\n // SEE: the TurboBoost Streams library for details on how this works\n const duration = Date.now() - this.busyStartedAt\n let delay = busyDuration - duration\n if (delay < 10) delay = 10\n event.detail.invoke = { delay }\n\n // runs before the morph is executed\n setTimeout(() => {\n this.busy = false\n this.morphToggleTriggerElements.forEach(el => (el.busy = false))\n }, delay - 10)\n\n // runs after the morph is executed\n setTimeout(() => focus(this.targetElement.querySelector(currentFocusSelector)), delay + 100)\n }\n\n // a list of views shared between the trigger and target\n get sharedViews() {\n if (!this.targetElement) return []\n if (!this.targetElement.viewStack) return []\n const reducer = (memo, view) => {\n if (this.targetElement.viewStack.includes(view)) memo.push(view)\n return memo\n }\n return this.viewStack.reduce(reducer.bind(this), [])\n }\n\n // the partial to render\n get renders() {\n return this.getAttribute('renders')\n }\n\n // the renderered partial's top wrapping dom_id\n get morphs() {\n return this.getAttribute('morphs')\n }\n\n // all toggle elements contained by the `morphElement`\n get morphToggleTriggerElements() {\n return Array.from(this.morphElement.querySelectorAll('turbo-boost-toggle-trigger'))\n }\n\n // the target's dom_id\n get controls() {\n return this.getAttribute('aria-controls')\n }\n\n get collapseSelector() {\n return this.getAttribute('collapse-selector')\n }\n\n get focusSelector() {\n return this.getAttribute('focus-selector') || this.targetElement.focusSelector\n }\n\n // indicates if the toggle state should be remembered across requests\n get remember() {\n return this.getAttribute('remember') === 'true'\n }\n\n set remember(value) {\n return this.setAttribute('remember', !!value)\n }\n\n // indicates if the target is expanded\n get expanded() {\n return this.getAttribute('aria-expanded') === 'true'\n }\n\n set expanded(value) {\n this.setAttribute('aria-expanded', !!value)\n }\n\n // indicates if the target is expanded\n get collapsed() {\n return !this.expanded\n }\n\n // ------ DevToolDelegate ------\n get command() {\n return this.dataset.turboCommand\n }\n\n get renderingLineLabel() {\n return 'renders & morphs'\n }\n\n // the morph element\n get morphElement() {\n if (!this.morphs) return null\n return document.getElementById(this.morphs)\n }\n\n // the target element\n get targetElement() {\n if (!this.controls) return null\n return document.getElementById(this.controls)\n }\n\n get triggerTooltipData() {\n let content = this.triggerElement.viewStack\n .reverse()\n .map((view, index) => {\n return this.triggerElement.sharedViews.includes(view)\n ? `<div slot=\"content\">${index + 1}. ${view}</div>`\n : `<div slot=\"content-bottom\">${index + 1}. ${view}</div>`\n }, this)\n .join('')\n\n return {\n subtitle: `\n <b>id</b>: ${this.triggerElement.id}<br>\n <b>aria-controls</b>: ${this.triggerElement.controls}<br>\n <b>aria-expanded</b>: ${this.triggerElement.expanded}<br>\n <b>remember</b>: ${this.triggerElement.remember}<br>\n `,\n content: `\n <div slot=\"content-top\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"12 2 2 7 12 12 22 7 12 2\"></polygon><polyline points=\"2 17 12 22 22 17\"></polyline><polyline points=\"2 12 12 17 22 12\"></polyline></svg>\n <b>View Stack</b>\n </div>\n ${content}\n `\n }\n }\n\n get targetTooltipData() {\n let content = this.targetElement.viewStack\n .reverse()\n .map((view, index) => {\n return this.triggerElement.sharedViews.includes(view)\n ? `<div slot=\"content\">${index + 1}. ${view}</div>`\n : `<div slot=\"content-bottom\">${index + 1}. ${view}</div>`\n }, this)\n .join('')\n\n return {\n subtitle: `<b>id</b>: ${this.targetElement.id}<br>\n <b>aria-labeled-by</b>: ${this.targetElement.labeledBy}<br>\n`,\n content: `\n <div slot=\"content-top\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display:inline-block;\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"12 2 2 7 12 12 22 7 12 2\"></polygon><polyline points=\"2 17 12 22 22 17\"></polyline><polyline points=\"2 12 12 17 22 12\"></polyline></svg>\n <b>View Stack</b>\n </div>\n ${content}\n `\n }\n }\n}\n", "import TurboBoostElement from './turbo_boost_element'\nimport ToggleTargetElement from './toggle_elements/target_element'\nimport ToggleTriggerElement from './toggle_elements/trigger_element'\n\n// Valid custom element names: https://html.spec.whatwg.org/#valid-custom-element-name\n\ncustomElements.define('turbo-boost', TurboBoostElement)\ncustomElements.define('turbo-boost-toggle-target', ToggleTargetElement)\ncustomElements.define('turbo-boost-toggle-trigger', ToggleTriggerElement)\n"],
|
5
|
+
"mappings": "AAAA,MAAO,qbCAAA,EAAQ,QCAR,SAASC,GAASC,EAAM,CAC7B,IAAID,EAAW,SAAS,cAAc,UAAU,EAChD,OAAAA,EAAS,UAAYC,EACdD,CACT,CAEO,SAASE,EAAWD,EAAME,EAAQ,CACvCA,EAASA,GAAU,SAAS,KAE5B,IAAMC,EADQJ,GAASC,CAAI,EAAE,QAAQ,UAAU,EAAI,EAC/B,cAAc,GAAG,EACrC,OAAOE,EAAO,YAAYC,CAAK,CACjC,CAEO,SAASC,EAAaC,EAASC,EAAU,CAAC,EAAG,CAClD,GAAI,CAACD,EAAS,OACdE,EAAgBF,CAAO,EACvB,GAAI,CAAE,QAAAG,EAAS,cAAAC,CAAc,EAAIH,EAEjCE,EAAUA,GAAW,iBACrBC,EAAgBA,GAAiB,MAEjCJ,EAAQ,eAAiBA,EAAQ,gBAAkB,CACjD,QAASA,EAAQ,MAAM,QACvB,UAAWA,EAAQ,MAAM,UACzB,SAAUA,EAAQ,MAAM,SACxB,QAASA,EAAQ,MAAM,QACvB,cAAeA,EAAQ,MAAM,aAC/B,EAGE,iBAAiBA,CAAO,EAAE,QAAQ,MAAM,WAAW,GACnDA,EAAQ,cAAgB,GACxBA,EAAQ,eAAiB,IAEzBA,EAAQ,MAAM,QAAU,eACxBA,EAAQ,MAAM,UAAY,MAC1BA,EAAQ,MAAM,SAAW,OAE3BA,EAAQ,MAAM,QAAUG,EACxBH,EAAQ,MAAM,cAAgBI,EAC9BJ,EAAQ,QAAQ,oBAAsB,EACxC,CAEO,SAASE,EAAgBF,EAAS,CACvC,GAAKA,EACL,CAAA,GAAIA,EAAQ,eAAgB,CAC1B,OAAW,CAACK,EAAKC,CAAK,IAAK,OAAO,QAAQN,EAAQ,cAAc,EAC9DM,EAASN,EAAQ,MAAMK,CAAG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,KAEX,CACF,CACF,EClNA,eAAe,OAAO,cAAeE,CAAiB,EACtD,eAAe,OAAO,4BAA6BC,CAAmB,EACtE,eAAe,OAAO,6BAA8BC,CAAoB,EhBHxE,KAAK,WAAa,KAAK,YAAc,CAAC,EACtC,KAAK,WAAW,SAAWC,EAC3B,KAAK,WAAW,SAAW,CAAE,QAAAC,CAAQ,EAErC,IAAOC,GAAQ,KAAK,WAAW",
|
6
6
|
"names": ["version_default", "template", "html", "appendHTML", "parent", "child", "addHighlight", "element", "options", "removeHighlight", "outline", "outlineOffset", "key", "value", "coordinates", "rect", "width", "height", "top", "left", "right", "bottom", "attempt", "callback", "e", "DevtoolElement", "event", "SupervisorElement", "devtoolElement", "checked", "name", "el", "TooltipElement", "savedTransform", "added", "dependencies", "exists", "dependency", "add", "src", "integrity", "script", "remove", "removeAll", "dependencies_default", "__spreadProps", "__spreadValues", "supervisorElement", "makeDraggable", "stop", "stopped", "start", "started", "restart", "enabledList", "restartTimeout", "debouncedRestart", "autoRestart", "register", "label", "enabled", "supervisor_default", "appendTooltip", "title", "subtitle", "content", "backgroundColor", "color", "position", "id", "activeTarget", "Devtool", "delegate", "hideTimeout", "debouncedHide", "type", "listener", "data", "active", "tooltip", "coords", "_a", "_b", "targetTooltip", "renderingTooltip", "decorateElementWithDevtool", "mouseenter", "property", "src_default", "version_default", "TurboBoostElement", "html", "c", "value", "html", "busyDelay", "busyDuration", "ToggleElement", "TurboBoostElement", "delay", "value", "ToggleTargetElement", "ToggleElement", "entry", "parts", "name", "delay", "e", "event", "el", "value", "focusTimeout", "deactivateTrixAttributes", "editor", "name", "focusTrixEditorElement", "element", "lastRange", "debouncedFocus", "trixEditorElement", "_", "focus_default", "y", "currentFocusSelector", "ToggleTriggerElement", "ToggleElement", "$t", "commandStartEvent", "beforeInvokeEvent", "event", "selector", "duration", "delay", "busyDuration", "el", "focus_default", "reducer", "memo", "view", "value", "content", "index", "TurboBoostElement", "ToggleTargetElement", "ToggleTriggerElement", "Dt", "version_default", "javascript_default"]
|
7
7
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"inputs":{"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytes":19453,"imports":[],"format":"esm"},"app/javascript/version.js":{"bytes":
|
1
|
+
{"inputs":{"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytes":19453,"imports":[],"format":"esm"},"app/javascript/version.js":{"bytes":23,"imports":[],"format":"esm"},"app/javascript/elements/turbo_boost_element/index.js":{"bytes":844,"imports":[],"format":"esm"},"app/javascript/elements/toggle_elements/toggle_element/index.js":{"bytes":2193,"imports":[{"path":"app/javascript/elements/turbo_boost_element/index.js","kind":"import-statement","original":"../../turbo_boost_element"}],"format":"esm"},"app/javascript/elements/toggle_elements/target_element/index.js":{"bytes":3370,"imports":[{"path":"app/javascript/elements/toggle_elements/toggle_element/index.js","kind":"import-statement","original":"../toggle_element"}],"format":"esm"},"app/javascript/elements/toggle_elements/trigger_element/focus.js":{"bytes":1585,"imports":[],"format":"esm"},"app/javascript/elements/toggle_elements/trigger_element/index.js":{"bytes":7168,"imports":[{"path":"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js","kind":"import-statement","original":"@turbo-boost/devtools"},{"path":"app/javascript/elements/toggle_elements/toggle_element/index.js","kind":"import-statement","original":"../toggle_element"},{"path":"app/javascript/elements/toggle_elements/trigger_element/focus.js","kind":"import-statement","original":"./focus"}],"format":"esm"},"app/javascript/elements/index.js":{"bytes":481,"imports":[{"path":"app/javascript/elements/turbo_boost_element/index.js","kind":"import-statement","original":"./turbo_boost_element"},{"path":"app/javascript/elements/toggle_elements/target_element/index.js","kind":"import-statement","original":"./toggle_elements/target_element"},{"path":"app/javascript/elements/toggle_elements/trigger_element/index.js","kind":"import-statement","original":"./toggle_elements/trigger_element"}],"format":"esm"},"app/javascript/index.js":{"bytes":285,"imports":[{"path":"@turbo-boost/commands","kind":"import-statement","external":true},{"path":"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js","kind":"import-statement","original":"@turbo-boost/devtools"},{"path":"app/javascript/version.js","kind":"import-statement","original":"./version"},{"path":"app/javascript/elements/index.js","kind":"import-statement","original":"./elements"}],"format":"esm"}},"outputs":{"app/assets/builds/@turbo-boost/elements.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":68585},"app/assets/builds/@turbo-boost/elements.js":{"imports":[{"path":"@turbo-boost/commands","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"app/javascript/index.js","inputs":{"app/javascript/index.js":{"bytesInOutput":162},"node_modules/@turbo-boost/devtools/dist/@turbo-boost/devtools.js":{"bytesInOutput":19332},"app/javascript/version.js":{"bytesInOutput":14},"app/javascript/elements/turbo_boost_element/index.js":{"bytesInOutput":546},"app/javascript/elements/toggle_elements/toggle_element/index.js":{"bytesInOutput":1279},"app/javascript/elements/toggle_elements/target_element/index.js":{"bytesInOutput":2040},"app/javascript/elements/toggle_elements/trigger_element/focus.js":{"bytesInOutput":764},"app/javascript/elements/toggle_elements/trigger_element/index.js":{"bytesInOutput":4292},"app/javascript/elements/index.js":{"bytesInOutput":146}},"bytes":28635}}}
|
@@ -17,7 +17,13 @@ class TurboBoost::Elements::ToggleCommand < TurboBoost::Elements::ApplicationCom
|
|
17
17
|
|
18
18
|
def hide
|
19
19
|
validate_element!
|
20
|
-
|
20
|
+
|
21
|
+
if element.remember?
|
22
|
+
state[element.aria.controls] = false
|
23
|
+
else
|
24
|
+
state.now[element.aria.controls] = false
|
25
|
+
end
|
26
|
+
|
21
27
|
morph id: element.morphs, html: render(element.render_options)
|
22
28
|
end
|
23
29
|
|
@@ -33,21 +39,19 @@ class TurboBoost::Elements::ToggleCommand < TurboBoost::Elements::ApplicationCom
|
|
33
39
|
|
34
40
|
def validate_element_attributes!
|
35
41
|
case element
|
36
|
-
in {renders: _, morphs: _} then
|
42
|
+
in {renders: _, morphs: _} then true
|
37
43
|
in {renders: _} then raise TurboBoost::Commands::InvalidElementError, "The trigger element is missing the `morphs` attribute!"
|
38
44
|
in {morphs: _} then raise TurboBoost::Commands::InvalidElementError, "The trigger element is missing the `renders` attribute!"
|
39
45
|
else raise TurboBoost::Commands::InvalidCommandError, "The trigger element is missing the `renders` and `moprhs` attributes!"
|
40
46
|
end
|
41
|
-
false
|
42
47
|
end
|
43
48
|
|
44
49
|
def validate_element_aria_attributes!
|
45
50
|
case element.aria
|
46
|
-
in {controls: _, expanded: _} then
|
51
|
+
in {controls: _, expanded: _} then true
|
47
52
|
in {controls: _} then raise TurboBoost::Commands::InvalidElementError, "The trigger element is missing the `aria-expanded` attribute!"
|
48
53
|
in {expanded: _} then raise TurboBoost::Commands::InvalidElementError, "The trigger element is missing the `aria-controls` attribute!"
|
49
54
|
else raise TurboBoost::Commands::InvalidElementError, "The trigger element is missing the `aria-controls` and `aria-expanded` attributes!"
|
50
55
|
end
|
51
|
-
false
|
52
56
|
end
|
53
57
|
end
|
data/app/javascript/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default '0.0
|
1
|
+
export default '0.1.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbo_boost-elements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Hopkins (hopsoft)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.3.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.3.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: magic_frozen_string_literal
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
- !ruby/object:Gem::Version
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
|
-
rubygems_version: 3.5.
|
177
|
+
rubygems_version: 3.5.10
|
178
178
|
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: Pre-built easy to use reactive TurboBoost elements for Rails/Hotwire apps.
|