spell-ui 0.8.12 → 0.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-components.md +5 -3
- package/dist/{Dragging-B93hbRxF.js → Dragging-tHPSvf3G.js} +56 -13
- package/dist/Dragging-tHPSvf3G.js.map +1 -0
- package/dist/_spell-element/DOMElement.d.ts +8 -1
- package/dist/_spell-element/drawnWindow.d.ts +62 -0
- package/dist/_util/Dragging.d.ts +7 -0
- package/dist/components/components.types.d.ts +2 -0
- package/dist/components/ui-diagram/UIDiagram.d.ts +3 -0
- package/dist/components/ui-graph/GraphLayout.d.ts +54 -0
- package/dist/components/ui-graph/UIGraph.d.ts +355 -0
- package/dist/components/ui-graph/UIGraph.en.d.ts +137 -0
- package/dist/components/ui-graph/UIGraph.es.d.ts +48 -0
- package/dist/components/ui-graph/UIGraph.types.d.ts +193 -0
- package/dist/components/ui-graph/index.d.ts +5 -0
- package/dist/components/ui-json/UIJson.d.ts +275 -10
- package/dist/components/ui-json/UIJson.en.d.ts +148 -9
- package/dist/components/ui-json/UIJson.es.d.ts +34 -3
- package/dist/components/ui-json/index.d.ts +2 -2
- package/dist/components/ui-split-panel/UISplitPanel.d.ts +2 -16
- package/dist/components/ui-tree/UITree.d.ts +758 -26
- package/dist/components/ui-tree/UITree.en.d.ts +113 -3
- package/dist/components/ui-tree/UITree.es.d.ts +24 -0
- package/dist/components/ui-tree/UITree.types.d.ts +34 -0
- package/dist/components/ui-tree/UITreeItem.d.ts +40 -1
- package/dist/components/ui-tree/UITreeItem.en.d.ts +9 -0
- package/dist/components/ui-tree/UITreeItem.es.d.ts +2 -0
- package/dist/components/ui-tree/index.d.ts +3 -2
- package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +3 -0
- package/dist/{components.es-DEa8Ep42.js → components.es-DilRG1VO.js} +117 -9
- package/dist/components.es-DilRG1VO.js.map +1 -0
- package/dist/core.js +713 -671
- package/dist/core.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +97 -96
- package/dist/jsx.d.ts +489 -20
- package/dist/ui-diagram.js +2 -2
- package/dist/ui-diagram.js.map +1 -1
- package/dist/ui-graph.editor-DLsXPyby.js +5 -0
- package/dist/ui-graph.editor-DLsXPyby.js.map +1 -0
- package/dist/ui-graph.js +1295 -0
- package/dist/ui-graph.js.map +1 -0
- package/dist/ui-json.editor-BS-v1bqO.js +5 -0
- package/dist/ui-json.editor-BS-v1bqO.js.map +1 -0
- package/dist/ui-json.js +629 -32
- package/dist/ui-json.js.map +1 -1
- package/dist/ui-property-editor.js +3 -2
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-root.js +34 -3
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-site-nav.js +4 -4
- package/dist/ui-site-nav.js.map +1 -1
- package/dist/ui-split-panel.js +31 -61
- package/dist/ui-split-panel.js.map +1 -1
- package/dist/ui-tree-diagram.js +1 -1
- package/dist/ui-tree-diagram.js.map +1 -1
- package/dist/ui-tree.editor-Bqsa0dYQ.js +5 -0
- package/dist/ui-tree.editor-Bqsa0dYQ.js.map +1 -0
- package/dist/ui-tree.js +1734 -237
- package/dist/ui-tree.js.map +1 -1
- package/dist/util/PaneSizes.d.ts +42 -0
- package/dist/util/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/Dragging-B93hbRxF.js.map +0 -1
- package/dist/components.es-DEa8Ep42.js.map +0 -1
- package/dist/ui-json.editor-BgZbrB_W.js +0 -5
- package/dist/ui-json.editor-BgZbrB_W.js.map +0 -1
- package/dist/ui-tree.editor-BoQztwdz.js +0 -5
- package/dist/ui-tree.editor-BoQztwdz.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-split-panel.js","names":["<For each={this.panes.slice(1)}>\n {(_pane, index) => <div\n class=\"bar\"\n part={index() === this.panes.length - 2 ? this.lastBarPart : this.partForName(\"bar\")}\n style={{ order: index() * 2 + 1 }}\n role={this.resizable ? \"separator\" : void 0}\n tabindex={this.resizable ? 0 : void 0}\n aria-label={this.resizable ? this.translationForKey(\"resizePanes\") : void 0}\n aria-orientation={this.isRows ? \"horizontal\" : \"vertical\"}\n aria-valuenow={this.resizable ? this.barPlaces[index()] ?? MIDDLE : void 0}\n onPointerDown={(event) => this.startDragging(event, index())}\n onPointerMove={this.drag}\n onPointerUp={this.stopDragging}\n onPointerCancel={this.stopDragging}\n onKeyDown={(event) => this.moveByKey(event, index())}\n />}\n </For>","this","order: index() * 2 + 1","role={this.resizable ? \"separator\" : void 0}","tabindex={this.resizable ? 0 : void 0}","aria-label={this.resizable ? this.translationForKey(\"resizePanes\") : void 0}","aria-orientation={this.isRows ? \"horizontal\" : \"vertical\"}","aria-valuenow={this.resizable ? this.barPlaces[index()] ?? MIDDLE : void 0}","E.UIComponent","E.proto","E.protoMerged","E.state","E.isSameList","E.cssState","E.on","E.watches","E.onChange","E.untracked","_$getOwner","_$setAttribute","_$setStyleProperty","__name","splitPanelCSS","__decoratorStart","__publicField","__name$1","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","getOwner$1","splitPanelVocabulary","UISplitPanel_default","_tmpl$","_tmpl$2","_moveByKey_dec","_stopDragging_dec","_drag_dec","_onPanesChanged_dec","_onHiddenChanged_dec","_onSlotChanged_dec","_isRows_dec","_barPlaces_dec","_isDragging_dec","_panes_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_panes","_isDragging","_barPlaces","_UISplitPanel","UIComponent","proto","protoMerged","state","isSameList","cssState","on","watches","onChange","untracked","event","grows","position","_self$","_el$","createComponent","For","_el$2","index","addEvent","effect","MIDDLE","_p$","setAttribute","t","setStyleProperty","a","o","i","n","mutations","target","child","sizesGiven","panes","isServer","beforeNextPaint","lengths","pane","height","width","before","after","sizes","fixedShrink","size","AUTO","FIT_ATTRIBUTE","bar","direction","ROW_KEYS","COLUMN_KEYS","held","KEY_STEP_PX","SHIFT_STEPS","isRows","minShare","minPixels","total","sum","length","bounds","own","shareLeast","canResize","pane1","pane2","pointer","moved","growing","gaining","losing","room","list","way","left","next","gain","step","isShare","shares","fixed","wanted","size1","size2","bounds1","bounds2","value","sized","growingLeast","DEFAULT_MIN_SHARE","most","given","spec","count","STAR","stars","percents","text","match","NUMBER_WITH_UNITS","units","perStar","style","least","flex","FAR_MORE_PX","minSize","UISplitPanel","delegateEvents"],"sources":["../src/components/ui-split-panel/UISplitPanel.en.ts","../src/components/ui-split-panel/UISplitPanel.tsx","../src/components/ui-split-panel/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-split-panel>`: every name the tag uses.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `splitPanelVocabulary`\n * The names of `<ui-split-panel>`: its children side by side or one above the other,\n * sized as `columns` or `rows` say, with bars to drag between them when `resizable`.\n ****************/\nexport const splitPanelVocabulary = {\n tag: \"ui-split-panel\",\n icon: \"columns\",\n topics: [\"layout\", \"containers\"],\n aka: [\"split view\", \"split pane\", \"resizable panes\", \"panes\", \"splitter\", \"sash\"],\n noun: \"split panel\",\n partOfSpeech: \"structure\",\n description: \"A split panel lays its children out side by side or one above the other, with bars to resize them.\",\n attributes: [\n {\n name: \"columns\",\n group: \"layout\",\n kind: \"string\",\n description:\n 'Side by side, sized across: a comma list, one size for each pane, such as `\"20%,*,380px\"`. ' +\n \"A number, `px` or `em` is a fixed size; `%` is that share of what the fixed panes leave; \" +\n \"`*` or a missing size shares the percent that's left; `auto` is as big as its content. Empty: all the same.\"\n },\n {\n name: \"rows\",\n group: \"layout\",\n kind: \"string\",\n description: \"One above the other, sized down, as `columns` says. With neither, the panes are side by side.\"\n },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"A bar between each two panes, to drag or to move with the arrow keys.\"\n },\n {\n name: \"grows\",\n group: \"behaviour\",\n kind: \"string\",\n description:\n \"The one pane that takes every change: `first`, `last` or its number from 1, such as the app between its tools. \" +\n \"A bar then sizes the pane on its other side, and this one takes the difference, so the panes between keep \" +\n \"their widths; the panel growing or shrinking is this pane's too.\"\n },\n {\n name: \"min-size\",\n group: \"behaviour\",\n kind: \"string\",\n description:\n \"The smallest a dragged pane may get, `10%` for shares or `60px` for any pane. Default: `5%` and `0px`. \" +\n \"A pane's own `min-width` / `max-width` (`min-height` / `max-height` in rows) bound it too; \" +\n \"one whose least and most are the same isn't resized: a bar beside it sizes the panes across it.\"\n }\n ],\n events: [\n {\n name: \"ui-changed\",\n detail: \"{ sizes: string, panes: HTMLElement[] }\",\n description:\n \"A bar was let go, or moved with a key: `sizes` in the form `columns` and `rows` take, to keep and give back.\"\n }\n ],\n slots: [\n {\n name: \"\",\n description:\n \"The panes, one per child. A child with `hidden` isn't one: the others share its room, and it stays as it is.\"\n }\n ],\n parts: [\n { name: \"bar\", description: \"The bar between two panes.\" },\n { name: \"last-bar\", description: \"The last of them, also a `bar`: before the last pane.\" }\n ],\n states: [\n { name: \"rows\", description: \"One above the other.\" },\n { name: \"resizable\", description: \"Its bars drag.\" },\n { name: \"dragging\", description: \"A bar is being dragged.\" }\n ],\n texts: [{ key: \"resizePanes\", text: \"Resize these panes\", description: \"A bar's name, for a screen reader.\" }]\n} as const satisfies E.ComponentVocabulary\n","import { For } from \"solid-js\"\nimport { isServer } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { splitPanelVocabulary } from \"./UISplitPanel.en\"\n\nimport splitPanelCSS from \"./UISplitPanel.css?inline\"\n\n/****************\n * ### `UISplitPanel`\n * The component behind `<ui-split-panel>`: its children side by side (`columns`) or one above the other (`rows`),\n * sized as those say, with a bar between each two to drag when `resizable`.\n *\n * <slot></slot> (the panes: your children, in the host's flex row)\n * <div part=\"bar\" role=\"separator\"></div> (one less than the panes)\n *\n * - Each child is a pane, written anywhere: `<ui-panel parent=\"its id\">` joins it, as a section joins a section.\n * - A child with `hidden` isn't a pane: the others share its room, and nothing in it is redrawn.\n * - A pane is never moved or redrawn as panes come and go or bars drag: the sizes are its inline `flex`,\n * and its place is its inline `order`, between the bars'. So a running program in one keeps running.\n * - The price: Tab reaches the bars after every pane, not between them.\n * - The sizes aren't remembered here: `ui-changed` hands over `sizes`, to keep and give back as `columns` or `rows`.\n * - Sizes, in `columns` or `rows`: a comma list, one for each pane (`\"20%,*,380px\"`).\n * - a number, `px` or `em`: fixed\n * - `%`: that share of what the fixed panes leave\n * - `*`, or missing: an equal share of the percent left\n * - `auto`: as big as its content, shrinking when there's no room, marked `data-split-fit`; a drag fixes it, in px\n * - `grows`: ONE pane takes every change, e.g. the app between its tools (`grows=\"first\"`):\n * - a bar sizes the pane on its other side, in px, and the growing pane takes the difference\n * - so the panes between keep their widths, and slide\n * - the panel's own growth and shrinking is that pane's too; past its `min-width`, the others give way\n * - A dragged bar stays under the pointer, until a pane's least or most stops it:\n * - the panes on each side of it take the move, the nearest first: one at its most (or least) passes the rest on\n * - a pane's own `min-height` / `max-height` (`min-width` / `max-width` side by side) bound it, whatever they say:\n * px, a percent, `max-content`\n * - one whose least and most are the same can't be resized, e.g. a folded card, its header alone:\n * a bar beside it sizes the nearest panes that can be, across it, and it keeps its size\n * - let go, each pane keeps its kind of size: a share's new share puts it where it was dragged to\n * - Keyboard: a bar takes the focus; the arrow keys along it move it, Shift by ten times as much.\n ****************/\nexport class UISplitPanel extends E.UIComponent<typeof splitPanelVocabulary> {\n @E.proto static vocabulary = splitPanelVocabulary\n @E.protoMerged static elementSetup: Partial<E.ElementSetup> = {\n styleSheets: { splitPanel: splitPanelCSS },\n cssStates: [\"resizable\"]\n }\n\n /** The panes now, in order: the children without `hidden`. */\n @E.state({ equals: E.isSameList }) accessor panes: HTMLElement[] = []\n\n /** A bar is being dragged. */\n @E.state @E.cssState(\"dragging\") accessor isDragging = false\n\n /** Each bar's place, as a percent of the room of the two panes beside it: what a screen reader says. */\n @E.state({ equals: E.isSameList }) accessor barPlaces: number[] = []\n\n /** Sizes now, one per pane. NOT a reactive member: a drag rewrites them on every move. */\n private sizes: PaneSize[] = []\n\n /** What a drag works from, measured when it starts. */\n private dragged: BarDrag | undefined\n\n /** One above the other. */\n @E.cssState(\"rows\")\n get isRows(): boolean {\n return this.rows !== undefined\n }\n\n /** The sizes as given, whichever way the panes go. */\n get sizesGiven(): string {\n return (this.isRows ? this.rows : this.columns) ?? \"\"\n }\n\n /** Index of the pane that takes every change (`grows`): `undefined` without one. */\n private get growingPane(): number | undefined {\n const grows = this.grows?.trim()\n if (!grows) return undefined\n if (grows === \"first\") return 0\n if (grows === \"last\") return this.panes.length - 1\n const position = parseInt(grows, 10)\n return position >= 1 && position <= this.panes.length ? position - 1 : undefined\n }\n\n /** The last bar's parts: it's a bar, and the last. */\n private get lastBarPart(): string {\n return `${this.partForName(\"bar\")} ${this.partForName(\"last-bar\")}`\n }\n\n render() {\n return (\n <>\n <slot />\n <For each={this.panes.slice(1)}>\n {(_pane, index) => (\n <div\n class=\"bar\"\n part={index() === this.panes.length - 2 ? this.lastBarPart : this.partForName(\"bar\")}\n style={{ order: index() * 2 + 1 }}\n role={this.resizable ? \"separator\" : undefined}\n tabindex={this.resizable ? 0 : undefined}\n aria-label={this.resizable ? this.translationForKey(\"resizePanes\") : undefined}\n aria-orientation={this.isRows ? \"horizontal\" : \"vertical\"}\n aria-valuenow={this.resizable ? (this.barPlaces[index()] ?? MIDDLE) : undefined}\n onPointerDown={(event) => this.startDragging(event, index())}\n onPointerMove={this.drag}\n onPointerUp={this.stopDragging}\n onPointerCancel={this.stopDragging}\n onKeyDown={(event) => this.moveByKey(event, index())}\n />\n )}\n </For>\n </>\n )\n }\n\n ////////////////\n // ## Panes\n ////////////////\n\n /** Children came or went: they're the panes now. */\n @E.on(\"slotchange\", { target: \"renderRoot\" })\n protected onSlotChanged() {\n this.findPanes()\n }\n\n /** A child's `hidden` changed. */\n @E.watches({ attributes: true, attributeFilter: [\"hidden\"], subtree: true })\n protected onHiddenChanged(mutations: MutationRecord[]) {\n if (mutations.some(({ target }) => target.parentNode === this.domElement)) this.findPanes()\n }\n\n /** Read the panes from the children. */\n private findPanes() {\n this.panes = [...this.domElement.children].filter((child) => !child.hasAttribute(\"hidden\")) as HTMLElement[]\n }\n\n /** Size the panes once drawn, and again when their number or the sizes given change. */\n @E.onChange(\"panes\", \"sizesGiven\", { writesDOMElement: true })\n protected onPanesChanged(panes: HTMLElement[], sizesGiven: string) {\n this.apply(UISplitPanel.sizesFor(sizesGiven, panes.length))\n // measured once laid out, after this update: the bars read the places, so a write now would draw them twice\n if (!isServer) E.beforeNextPaint(() => this.findBarPlaces())\n }\n\n /** Read each bar's place from where the panes are now: not on every move of a drag. */\n private findBarPlaces() {\n const lengths = this.panes.map((pane) => {\n const { width, height } = pane.getBoundingClientRect()\n return this.isRows ? height : width\n })\n this.barPlaces = lengths.slice(1).map((after, index) => {\n const before = lengths[index]\n return before + after ? Math.round((before * 100) / (before + after)) : MIDDLE\n })\n }\n\n /** Make `sizes` the sizes: each pane's inline `order` and `flex`. */\n private apply(sizes: PaneSize[]) {\n this.sizes = sizes\n // beside a growing pane, a fixed pane still gives way once that one is as small as it gets\n const fixedShrink = this.growingPane === undefined ? 0 : 1\n this.panes.forEach((pane, index) => {\n const size = sizes[index]\n pane.style.order = String(index * 2)\n pane.style.flex =\n size.units === \"%\"\n ? `${size.value} ${size.value} 0`\n : size.units === AUTO\n ? \"0 1 auto\"\n : `0 ${fixedShrink} ${size.value}${size.units}`\n pane.toggleAttribute(FIT_ATTRIBUTE, size.units === AUTO)\n })\n }\n\n ////////////////\n // ## Dragging a bar\n ////////////////\n\n /** A bar's `pointerdown`: measure the two panes it sits between, and take the pointer until it's let go. */\n private startDragging(event: PointerEvent & { currentTarget: HTMLElement }, bar: number) {\n if (!this.resizable || event.button !== 0) return\n this.dragged = this.measure(bar, this.isRows ? event.clientY : event.clientX)\n if (!this.dragged) return\n event.currentTarget.setPointerCapture(event.pointerId)\n this.isDragging = true\n event.preventDefault()\n }\n\n /** `pointermove` while dragging: the bar follows the pointer. */\n @E.untracked private readonly drag = (event: PointerEvent) => {\n if (this.dragged) this.moveTo(this.dragged, this.isRows ? event.clientY : event.clientX)\n }\n\n /** Let go: say where the sizes ended up. */\n @E.untracked private readonly stopDragging = () => {\n if (!this.dragged) return\n this.settle(this.dragged)\n this.dragged = undefined\n this.isDragging = false\n this.findBarPlaces()\n this.sendSizes()\n }\n\n /** An arrow key along the bar moves it, Shift by ten times as much. */\n @E.untracked private moveByKey(event: KeyboardEvent, bar: number) {\n const direction = (this.isRows ? ROW_KEYS : COLUMN_KEYS)[event.key]\n if (!this.resizable || !direction) return\n const held = this.measure(bar, 0)\n if (!held) return\n this.moveTo(held, direction * KEY_STEP_PX * (event.shiftKey ? SHIFT_STEPS : 1))\n this.settle(held)\n this.findBarPlaces()\n this.sendSizes()\n event.preventDefault()\n }\n\n /** Say the sizes now, in the form `columns` and `rows` take. */\n private sendSizes() {\n this.send(\"ui-changed\", { sizes: UISplitPanel.sizeText(this.sizes), panes: this.panes })\n }\n\n /**\n * What moving bar `bar` works from, with the pointer at `pointer`: `undefined` when it can't move.\n * - Every pane's size and its least and most (`PaneBounds`), whatever sets them.\n * - `undefined` when no pane on one side of the bar can be resized (its least and most the same).\n * - Measures ONCE, here: `getBoundingClientRect()` is too slow for every move.\n */\n private measure(bar: number, pointer: number): BarDrag | undefined {\n const isRows = this.isRows\n const [minShare, minPixels] = UISplitPanel.minimums(this.minSize)\n const lengths = this.panes.map((pane) => {\n const { width, height } = pane.getBoundingClientRect()\n return isRows ? height : width\n })\n const total = lengths.reduce((sum, length) => sum + length, 0)\n const bounds = this.panes.map((pane, index) => {\n const own = UISplitPanel.boundsOf(pane, isRows)\n const shareLeast = this.sizes[index]?.units === \"%\" ? (total * minShare) / 100 : 0\n // never above its most, nor above what it is now: a pane can always stay as it is\n const least = Math.min(Math.max(own.least, minPixels, shareLeast), own.most, lengths[index])\n return { least, most: Math.max(own.most, lengths[index]) }\n })\n const canResize = (index: number) => bounds[index].most - bounds[index].least >= 1\n let pane1 = bar\n while (pane1 >= 0 && !canResize(pane1)) pane1--\n let pane2 = bar + 1\n while (pane2 < this.panes.length && !canResize(pane2)) pane2++\n if (pane1 < 0 || pane2 >= this.panes.length) return undefined\n return {\n bar,\n lengths,\n bounds,\n sizes: this.sizes,\n pane1,\n pane2,\n pointerStart: pointer,\n size1: lengths[pane1],\n size2: lengths[pane2],\n bounds1: bounds[pane1],\n bounds2: bounds[pane2],\n minPixels\n }\n }\n\n /**\n * Move the bar to `pointer`: it stays under it, until a pane's least or most stops it.\n * - The panes before the bar take the move, the nearest first, each up to its most (or down to its least);\n * the panes after it give it up, the same way.\n * - So a pane that can't be resized is skipped, and one at its most passes the rest on.\n * - While dragging, every pane is held at its size in px: shares laid out by `flex` would spread a move over\n * every pane, and a pane CSS stops (`max-height: max-content`) passes its part to the others.\n * Let go (`settle()`), they're shares again.\n * - Beside an `auto` pane, a fixed pane takes the move, limited only by `min-size`: the panel grows with it.\n */\n private moveTo(held: BarDrag, pointer: number) {\n const moved = pointer - held.pointerStart\n const growing = this.growingPane\n if (growing !== undefined) return this.moveBeside(held, growing, moved)\n const { pane1, pane2, sizes } = held\n if (sizes[pane1]?.units === AUTO || sizes[pane2]?.units === AUTO) return this.moveBesideAuto(held, moved)\n const { lengths, bounds, bar } = held\n const before = lengths.map((_, index) => bar - index).filter((index) => index >= 0)\n const after = lengths.map((_, index) => bar + 1 + index).filter((index) => index < lengths.length)\n const [gaining, losing] = moved >= 0 ? [before, after] : [after, before]\n const room = (list: number[], way: \"grow\" | \"shrink\") =>\n list.reduce(\n (sum, index) =>\n sum + (way === \"grow\" ? bounds[index].most - lengths[index] : lengths[index] - bounds[index].least),\n 0\n )\n let left = Math.min(Math.abs(moved), room(gaining, \"grow\"), room(losing, \"shrink\"))\n const next = [...lengths]\n let gain = left\n for (const index of gaining) {\n const step = Math.min(gain, bounds[index].most - lengths[index])\n next[index] += step\n gain -= step\n }\n for (const index of losing) {\n const step = Math.min(left, lengths[index] - bounds[index].least)\n next[index] -= step\n left -= step\n }\n held.moved = next\n this.apply(next.map((length) => ({ value: Math.round(length * 100) / 100, units: \"px\" })))\n }\n\n /**\n * Let go of a move: the panes go back to their kinds of size, at the sizes they were moved to.\n * - A share's new share is its part of what the shares have now, so laid out by `flex` it's as tall (wide) as it\n * was moved to: every share in proportion to its size, and none stopped by its least or most.\n * - A fixed pane keeps its size in px; an `auto` pane moved is fixed in px, one not moved stays `auto`.\n */\n private settle(held: BarDrag) {\n const moved = held.moved\n if (!moved) return\n const { sizes, lengths } = held\n const isShare = (index: number) => sizes[index]?.units === \"%\"\n const shares = sizes.reduce((sum, size, index) => (isShare(index) ? sum + size.value : sum), 0)\n const room = moved.reduce((sum, length, index) => (isShare(index) ? sum + length : sum), 0)\n this.apply(\n sizes.map((size, index) => {\n if (isShare(index))\n return { value: room ? Math.round(((moved[index] * shares) / room) * 100) / 100 : size.value, units: \"%\" }\n return Math.abs(moved[index] - lengths[index]) < 0.5 ? size : { value: Math.round(moved[index]), units: \"px\" }\n })\n )\n }\n\n /**\n * Move a bar beside an `auto` pane: the fixed pane takes the move in px, the `auto` one is as big as its content.\n * - Only limited by `min-size` and the fixed pane's own bounds: the panel grows with it.\n * - Two `auto` panes: the first becomes fixed.\n */\n private moveBesideAuto(held: BarDrag, moved: number) {\n const { pane1, pane2, size1, size2, bounds1, bounds2, sizes } = held\n const fixed = [pane1, pane2].find((index) => sizes[index]?.units !== AUTO) ?? pane1\n const wanted = fixed === pane1 ? size1 + moved : size2 - moved\n const own = fixed === pane1 ? bounds1 : bounds2\n const value = Math.round(Math.min(own.most, Math.max(own.least, held.minPixels, wanted)))\n this.apply(sizes.map((size, index) => (index === fixed ? { value, units: \"px\" } : size)))\n }\n\n /**\n * Move a bar in a panel with a growing pane (`grows`): the pane on the bar's other side takes the move, in px,\n * and the growing pane the difference.\n * - Every other pane is fixed at its width as the drag started, so none moves but those two.\n * - Neither gets smaller than `min-size` (px), and the growing pane keeps `DEFAULT_MIN_SHARE` of the room.\n */\n private moveBeside(held: BarDrag, growing: number, moved: number) {\n const { pane1, pane2, size1, size2, bounds1, bounds2, lengths, minPixels } = held\n const sized = growing <= pane1 ? pane2 : pane1\n const bounds = sized === pane1 ? bounds1 : bounds2\n const wanted = sized === pane1 ? size1 + moved : size2 - moved\n const room = lengths.reduce((total, length) => total + length, 0)\n const growingLeast = Math.max(minPixels, (room * DEFAULT_MIN_SHARE) / 100)\n const most = Math.min(bounds.most, lengths[sized] + lengths[growing] - growingLeast)\n const value = Math.round(Math.min(most, Math.max(bounds.least, wanted)))\n this.apply(\n this.sizes.map((size, index) => {\n if (index === growing) return { value: 100, units: \"%\" }\n if (index === sized) return { value, units: \"px\" }\n return size.units === \"%\" || size.units === AUTO ? { value: Math.round(lengths[index]), units: \"px\" } : size\n })\n )\n }\n\n ////////////////\n // ## Sizes\n ////////////////\n\n /**\n * One `PaneSize` per pane from `spec`, in the form `columns` and `rows` take.\n * - Cut or padded to `count`: a missing or unreadable entry counts as `*`.\n * - `*` entries share the percent the `%` entries leave, equally (at least 1% each).\n */\n static sizesFor(spec: string, count: number): PaneSize[] {\n const given = spec ? spec.split(\",\").slice(0, count) : []\n while (given.length < count) given.push(STAR)\n let stars = 0\n let percents = 0\n const sizes = given.map((text): { value: number | typeof STAR; units: string } => {\n const size = text.trim()\n if (size === AUTO) return { value: 0, units: AUTO }\n const match = NUMBER_WITH_UNITS.exec(size)\n if (match) {\n const units = match[2] || \"px\"\n const value = parseFloat(match[1])\n if (units === \"%\") percents += value\n return { value, units }\n }\n if (size !== STAR) console.warn(`<ui-split-panel>: the size \"${size}\" isn't one; it shares what's left`)\n stars++\n return { value: STAR, units: \"%\" }\n })\n const perStar = Math.max(1, (100 - percents) / Math.max(stars, 1))\n return sizes.map(({ value, units }) => ({ value: value === STAR ? perStar : value, units }))\n }\n\n /** `sizes` in the form `columns` and `rows` take: `\"60%,40%\"`. */\n static sizeText(sizes: PaneSize[]): string {\n return sizes.map(({ value, units }) => (units === AUTO ? AUTO : `${value}${units}`)).join(\",\")\n }\n\n /**\n * The least and most `pane` may be dragged to, px: its own `min-` and `max-height` (`-width` side by side).\n * - Its least: only px count; `auto` is 0.\n * - Its most: whatever its `max-height` says, `max-content` or a percent too, found by asking for far more\n * and measuring what it takes; `none` is `Infinity`.\n * - SIDE EFFECT: lays the page out again, once per pane with a most.\n */\n private static boundsOf(pane: HTMLElement, isRows: boolean): PaneBounds {\n const style = getComputedStyle(pane)\n const least = isRows ? style.minHeight : style.minWidth\n const most = isRows ? style.maxHeight : style.maxWidth\n return {\n least: least.endsWith(\"px\") ? parseFloat(least) : 0,\n most: most === \"none\" ? Infinity : UISplitPanel.mostOf(pane, isRows)\n }\n }\n\n /** How big `pane` gets when asked for far more than there's room for, px: what its `max-height` allows. */\n private static mostOf(pane: HTMLElement, isRows: boolean): number {\n const flex = pane.style.flex\n pane.style.flex = `0 0 ${FAR_MORE_PX}px`\n const { width, height } = pane.getBoundingClientRect()\n pane.style.flex = flex\n return isRows ? height : width\n }\n\n /** `min-size`, as the smallest share and the smallest px. */\n private static minimums(minSize: string | undefined): [share: number, pixels: number] {\n const match = NUMBER_WITH_UNITS.exec(minSize?.trim() ?? \"\")\n if (!match) return [DEFAULT_MIN_SHARE, 0]\n const value = parseFloat(match[1])\n return match[2] === \"%\" ? [value, 0] : [DEFAULT_MIN_SHARE, value]\n }\n}\n\nexport interface UISplitPanel extends E.AttributeValues<typeof splitPanelVocabulary> {}\n\n/** One pane's size, e.g. `{ value: 20, units: \"%\" }`. */\nexport type PaneSize = {\n /** How much, in `units`. */\n value: number\n /** `px`, `em`, `%` or `auto` (its `value` unused). */\n units: string\n}\n\n/** The least and most a pane may be dragged to, px, from its own CSS: the same, and it can't be resized. */\ntype PaneBounds = {\n /** Its `min-height` (`min-width`), else 0. */\n least: number\n /** Its `max-height` (`max-width`), else `Infinity`. */\n most: number\n}\n\n/** What moving a bar works from, measured once as it starts. */\ntype BarDrag = {\n /** Index of the bar. */\n bar: number\n /** Every pane's size as it started, px. */\n lengths: number[]\n /** Every pane's least and most, px, `min-size` included. */\n bounds: PaneBounds[]\n /** The sizes given as it started: each pane's kind of size, which it goes back to when let go. */\n sizes: PaneSize[]\n /** Every pane's size now, px, once the bar has moved. */\n moved?: number[]\n /** Index of the pane before the bar. */\n pane1: number\n /** Index of the pane after it. */\n pane2: number\n /** Where the pointer was as it started, px. */\n pointerStart: number\n /** `pane1`'s size as it started, px. */\n size1: number\n /** `pane2`'s size as it started, px. */\n size2: number\n /** The least and most `pane1` may be, px, `min-size` included. */\n bounds1: PaneBounds\n /** The least and most `pane2` may be, px, `min-size` included. */\n bounds2: PaneBounds\n /** Smallest size a fixed pane may have, px. */\n minPixels: number\n}\n\n/** A pane as big as its content: its units, and how a spec says it. */\nconst AUTO = \"auto\"\n/** A size that shares what's left. */\nconst STAR = \"*\"\n/** The attribute an `auto` pane carries, for what it holds to lay out in it rather than over it. */\nconst FIT_ATTRIBUTE = \"data-split-fit\"\n/** A bar's place before the panes are measured. */\nconst MIDDLE = 50\n/** One size in a spec: a number with optional units. */\nconst NUMBER_WITH_UNITS = /^([0-9]*\\.?[0-9]+)(px|em|rem|%)?$/\n/** Smallest share a pane may be dragged to, unless `min-size` says. */\nconst DEFAULT_MIN_SHARE = 5\n/** Far more than any pane could be, px: what a pane is asked for to find its most. */\nconst FAR_MORE_PX = 100_000\n/** How far an arrow key moves a bar, px. */\nconst KEY_STEP_PX = 16\n/** How many steps Shift makes it. */\nconst SHIFT_STEPS = 10\n/** The arrow keys along a bar between panes side by side, and which way each moves it. */\nconst COLUMN_KEYS: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1 }\n/** The arrow keys along a bar between panes one above the other, and which way each moves it. */\nconst ROW_KEYS: Record<string, number> = { ArrowUp: -1, ArrowDown: 1 }\n","/**\n * The split panel family: defines `<ui-split-panel>` and exports its component, `UISplitPanel`.\n * - SIDE EFFECT: importing it defines the tag.\n * - Also the library's `spell/ui/ui-split-panel` entry.\n */\n\nimport { UISplitPanel } from \"./U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B,EAAAqB,GAAMI,CAAA,GAAgE/B,EAAA+B,GAAA,cAAA,GAClE5B,EADE4B,GACK,cAAaxB,EAApBoB,GAAA,IADEI,GACkBrB,CAAA,CAAA,GAApBH,EAAAoB,GAAA,IADEI,CAAA,GAEI5B,EAFJ4B,GAEW,gBAAwCxB,EAA/CoB,GAAA,IAFJI,GAEmD;CAC5D,aAAa,EAAE,YAAY9B,EAAc;CACzC,WAAW,CAAC,WAAW;AACzB,CAAA,CAAA,GAHeM,EAAAoB,GAAA,IAFJI,CAAA;AAAN,IAAM6G,IAAN7G,GAgcD+C,IAAO,QAEPiD,IAAO,KAEPhD,IAAgB,kBAEhB1B,IAAS,IAET+E,IAAoB,qCAEpBV,IAAoB,GAEpBgB,KAAc,KAEdrD,KAAc,IAEdC,KAAc,IAEdH,KAAsC;CAAE,WAAW;CAAI,YAAY;AAAE,GAErED,KAAmC;CAAE,SAAS;CAAI,WAAW;AAAE;;;;;;;A,ICpfrE0D,EAAa,OAAO"}
|
|
1
|
+
{"version":3,"file":"ui-split-panel.js","names":["<For each={this.panes.slice(1)}>\n {(_pane, index) => <div\n class=\"bar\"\n part={index() === this.panes.length - 2 ? this.lastBarPart : this.partForName(\"bar\")}\n style={{ order: index() * 2 + 1 }}\n role={this.resizable ? \"separator\" : void 0}\n tabindex={this.resizable ? 0 : void 0}\n aria-label={this.resizable ? this.translationForKey(\"resizePanes\") : void 0}\n aria-orientation={this.isRows ? \"horizontal\" : \"vertical\"}\n aria-valuenow={this.resizable ? this.barPlaces[index()] ?? MIDDLE : void 0}\n onPointerDown={(event) => this.startDragging(event, index())}\n onPointerMove={this.drag}\n onPointerUp={this.stopDragging}\n onPointerCancel={this.stopDragging}\n onKeyDown={(event) => this.moveByKey(event, index())}\n />}\n </For>","this","order: index() * 2 + 1","role={this.resizable ? \"separator\" : void 0}","tabindex={this.resizable ? 0 : void 0}","aria-label={this.resizable ? this.translationForKey(\"resizePanes\") : void 0}","aria-orientation={this.isRows ? \"horizontal\" : \"vertical\"}","aria-valuenow={this.resizable ? this.barPlaces[index()] ?? MIDDLE : void 0}","E.UIComponent","E.proto","E.protoMerged","E.state","E.isSameList","E.cssState","E.on","E.watches","E.onChange","E.untracked","_$getOwner","_$setAttribute","_$setStyleProperty","__name","splitPanelCSS","__decoratorStart","__publicField","__name$1","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","getOwner$1","splitPanelVocabulary","UISplitPanel_default","_tmpl$","_tmpl$2","_moveByKey_dec","_stopDragging_dec","_drag_dec","_onPanesChanged_dec","_onHiddenChanged_dec","_onSlotChanged_dec","_isRows_dec","_barPlaces_dec","_isDragging_dec","_panes_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_panes","_isDragging","_barPlaces","_UISplitPanel","UIComponent","proto","protoMerged","state","isSameList","cssState","on","watches","onChange","untracked","event","grows","position","_self$","_el$","createComponent","For","_el$2","index","addEvent","effect","MIDDLE","_p$","setAttribute","t","setStyleProperty","a","o","i","n","mutations","target","child","PaneSizes","sizesGiven","panes","isServer","beforeNextPaint","lengths","pane","height","width","before","after","sizes","fixedShrink","size","AUTO","FIT_ATTRIBUTE","bar","direction","ROW_KEYS","COLUMN_KEYS","held","KEY_STEP_PX","SHIFT_STEPS","isRows","minShare","minPixels","total","sum","length","bounds","own","shareLeast","canResize","pane1","pane2","pointer","moved","growing","gaining","losing","room","list","way","left","next","gain","step","isShare","shares","fixed","wanted","size1","size2","bounds1","bounds2","value","sized","growingLeast","DEFAULT_MIN_SHARE","most","style","least","flex","FAR_MORE_PX","match","NUMBER_WITH_UNITS","minSize","UISplitPanel","delegateEvents"],"sources":["../src/components/ui-split-panel/UISplitPanel.en.ts","../src/components/ui-split-panel/UISplitPanel.tsx","../src/components/ui-split-panel/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-split-panel>`: every name the tag uses.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `splitPanelVocabulary`\n * The names of `<ui-split-panel>`: its children side by side or one above the other,\n * sized as `columns` or `rows` say, with bars to drag between them when `resizable`.\n ****************/\nexport const splitPanelVocabulary = {\n tag: \"ui-split-panel\",\n icon: \"columns\",\n topics: [\"layout\", \"containers\"],\n aka: [\"split view\", \"split pane\", \"resizable panes\", \"panes\", \"splitter\", \"sash\"],\n noun: \"split panel\",\n partOfSpeech: \"structure\",\n description: \"A split panel lays its children out side by side or one above the other, with bars to resize them.\",\n attributes: [\n {\n name: \"columns\",\n group: \"layout\",\n kind: \"string\",\n description:\n 'Side by side, sized across: a comma list, one size for each pane, such as `\"20%,*,380px\"`. ' +\n \"A number, `px` or `em` is a fixed size; `%` is that share of what the fixed panes leave; \" +\n \"`*` or a missing size shares the percent that's left; `auto` is as big as its content. Empty: all the same.\"\n },\n {\n name: \"rows\",\n group: \"layout\",\n kind: \"string\",\n description: \"One above the other, sized down, as `columns` says. With neither, the panes are side by side.\"\n },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"A bar between each two panes, to drag or to move with the arrow keys.\"\n },\n {\n name: \"grows\",\n group: \"behaviour\",\n kind: \"string\",\n description:\n \"The one pane that takes every change: `first`, `last` or its number from 1, such as the app between its tools. \" +\n \"A bar then sizes the pane on its other side, and this one takes the difference, so the panes between keep \" +\n \"their widths; the panel growing or shrinking is this pane's too.\"\n },\n {\n name: \"min-size\",\n group: \"behaviour\",\n kind: \"string\",\n description:\n \"The smallest a dragged pane may get, `10%` for shares or `60px` for any pane. Default: `5%` and `0px`. \" +\n \"A pane's own `min-width` / `max-width` (`min-height` / `max-height` in rows) bound it too; \" +\n \"one whose least and most are the same isn't resized: a bar beside it sizes the panes across it.\"\n }\n ],\n events: [\n {\n name: \"ui-changed\",\n detail: \"{ sizes: string, panes: HTMLElement[] }\",\n description:\n \"A bar was let go, or moved with a key: `sizes` in the form `columns` and `rows` take, to keep and give back.\"\n }\n ],\n slots: [\n {\n name: \"\",\n description:\n \"The panes, one per child. A child with `hidden` isn't one: the others share its room, and it stays as it is.\"\n }\n ],\n parts: [\n { name: \"bar\", description: \"The bar between two panes.\" },\n { name: \"last-bar\", description: \"The last of them, also a `bar`: before the last pane.\" }\n ],\n states: [\n { name: \"rows\", description: \"One above the other.\" },\n { name: \"resizable\", description: \"Its bars drag.\" },\n { name: \"dragging\", description: \"A bar is being dragged.\" }\n ],\n texts: [{ key: \"resizePanes\", text: \"Resize these panes\", description: \"A bar's name, for a screen reader.\" }]\n} as const satisfies E.ComponentVocabulary\n","import { For } from \"solid-js\"\nimport { isServer } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { splitPanelVocabulary } from \"./UISplitPanel.en\"\n\nimport splitPanelCSS from \"./UISplitPanel.css?inline\"\n\n/****************\n * ### `UISplitPanel`\n * The component behind `<ui-split-panel>`: its children side by side (`columns`) or one above the other (`rows`),\n * sized as those say, with a bar between each two to drag when `resizable`.\n *\n * <slot></slot> (the panes: your children, in the host's flex row)\n * <div part=\"bar\" role=\"separator\"></div> (one less than the panes)\n *\n * - Each child is a pane, written anywhere: `<ui-panel parent=\"its id\">` joins it, as a section joins a section.\n * - A child with `hidden` isn't a pane: the others share its room, and nothing in it is redrawn.\n * - A pane is never moved or redrawn as panes come and go or bars drag: the sizes are its inline `flex`,\n * and its place is its inline `order`, between the bars'. So a running program in one keeps running.\n * - The price: Tab reaches the bars after every pane, not between them.\n * - The sizes aren't remembered here: `ui-changed` hands over `sizes`, to keep and give back as `columns` or `rows`.\n * - Sizes, in `columns` or `rows`: a comma list, one for each pane (`\"20%, *, 380px\"`), read by `E.PaneSizes`,\n * as `<ui-tree>` reads its columns' `size`.\n * - a number, `px` or `em`: fixed\n * - `%`: that share of what the fixed panes leave\n * - `*`, or missing: an equal share of the percent left\n * - `auto`: as big as its content, shrinking when there's no room, marked `data-split-fit`; a drag fixes it, in px\n * - `grows`: ONE pane takes every change, e.g. the app between its tools (`grows=\"first\"`):\n * - a bar sizes the pane on its other side, in px, and the growing pane takes the difference\n * - so the panes between keep their widths, and slide\n * - the panel's own growth and shrinking is that pane's too; past its `min-width`, the others give way\n * - A dragged bar stays under the pointer, until a pane's least or most stops it:\n * - the panes on each side of it take the move, the nearest first: one at its most (or least) passes the rest on\n * - a pane's own `min-height` / `max-height` (`min-width` / `max-width` side by side) bound it, whatever they say:\n * px, a percent, `max-content`\n * - one whose least and most are the same can't be resized, e.g. a folded card, its header alone:\n * a bar beside it sizes the nearest panes that can be, across it, and it keeps its size\n * - let go, each pane keeps its kind of size: a share's new share puts it where it was dragged to\n * - Keyboard: a bar takes the focus; the arrow keys along it move it, Shift by ten times as much.\n ****************/\nexport class UISplitPanel extends E.UIComponent<typeof splitPanelVocabulary> {\n @E.proto static vocabulary = splitPanelVocabulary\n @E.protoMerged static elementSetup: Partial<E.ElementSetup> = {\n styleSheets: { splitPanel: splitPanelCSS },\n cssStates: [\"resizable\"]\n }\n\n /** The panes now, in order: the children without `hidden`. */\n @E.state({ equals: E.isSameList }) accessor panes: HTMLElement[] = []\n\n /** A bar is being dragged. */\n @E.state @E.cssState(\"dragging\") accessor isDragging = false\n\n /** Each bar's place, as a percent of the room of the two panes beside it: what a screen reader says. */\n @E.state({ equals: E.isSameList }) accessor barPlaces: number[] = []\n\n /** Sizes now, one per pane. NOT a reactive member: a drag rewrites them on every move. */\n private sizes: E.PaneSize[] = []\n\n /** What a drag works from, measured when it starts. */\n private dragged: BarDrag | undefined\n\n /** One above the other. */\n @E.cssState(\"rows\")\n get isRows(): boolean {\n return this.rows !== undefined\n }\n\n /** The sizes as given, whichever way the panes go. */\n get sizesGiven(): string {\n return (this.isRows ? this.rows : this.columns) ?? \"\"\n }\n\n /** Index of the pane that takes every change (`grows`): `undefined` without one. */\n private get growingPane(): number | undefined {\n const grows = this.grows?.trim()\n if (!grows) return undefined\n if (grows === \"first\") return 0\n if (grows === \"last\") return this.panes.length - 1\n const position = parseInt(grows, 10)\n return position >= 1 && position <= this.panes.length ? position - 1 : undefined\n }\n\n /** The last bar's parts: it's a bar, and the last. */\n private get lastBarPart(): string {\n return `${this.partForName(\"bar\")} ${this.partForName(\"last-bar\")}`\n }\n\n render() {\n return (\n <>\n <slot />\n <For each={this.panes.slice(1)}>\n {(_pane, index) => (\n <div\n class=\"bar\"\n part={index() === this.panes.length - 2 ? this.lastBarPart : this.partForName(\"bar\")}\n style={{ order: index() * 2 + 1 }}\n role={this.resizable ? \"separator\" : undefined}\n tabindex={this.resizable ? 0 : undefined}\n aria-label={this.resizable ? this.translationForKey(\"resizePanes\") : undefined}\n aria-orientation={this.isRows ? \"horizontal\" : \"vertical\"}\n aria-valuenow={this.resizable ? (this.barPlaces[index()] ?? MIDDLE) : undefined}\n onPointerDown={(event) => this.startDragging(event, index())}\n onPointerMove={this.drag}\n onPointerUp={this.stopDragging}\n onPointerCancel={this.stopDragging}\n onKeyDown={(event) => this.moveByKey(event, index())}\n />\n )}\n </For>\n </>\n )\n }\n\n ////////////////\n // ## Panes\n ////////////////\n\n /** Children came or went: they're the panes now. */\n @E.on(\"slotchange\", { target: \"renderRoot\" })\n protected onSlotChanged() {\n this.findPanes()\n }\n\n /** A child's `hidden` changed. */\n @E.watches({ attributes: true, attributeFilter: [\"hidden\"], subtree: true })\n protected onHiddenChanged(mutations: MutationRecord[]) {\n if (mutations.some(({ target }) => target.parentNode === this.domElement)) this.findPanes()\n }\n\n /** Read the panes from the children. */\n private findPanes() {\n this.panes = [...this.domElement.children].filter((child) => !child.hasAttribute(\"hidden\")) as HTMLElement[]\n }\n\n /** Size the panes once drawn, and again when their number or the sizes given change. */\n @E.onChange(\"panes\", \"sizesGiven\", { writesDOMElement: true })\n protected onPanesChanged(panes: HTMLElement[], sizesGiven: string) {\n this.apply(E.PaneSizes.sizesFor(sizesGiven, panes.length, { source: \"<ui-split-panel>\" }))\n // measured once laid out, after this update: the bars read the places, so a write now would draw them twice\n if (!isServer) E.beforeNextPaint(() => this.findBarPlaces())\n }\n\n /** Read each bar's place from where the panes are now: not on every move of a drag. */\n private findBarPlaces() {\n const lengths = this.panes.map((pane) => {\n const { width, height } = pane.getBoundingClientRect()\n return this.isRows ? height : width\n })\n this.barPlaces = lengths.slice(1).map((after, index) => {\n const before = lengths[index]\n return before + after ? Math.round((before * 100) / (before + after)) : MIDDLE\n })\n }\n\n /** Make `sizes` the sizes: each pane's inline `order` and `flex`. */\n private apply(sizes: E.PaneSize[]) {\n this.sizes = sizes\n // beside a growing pane, a fixed pane still gives way once that one is as small as it gets\n const fixedShrink = this.growingPane === undefined ? 0 : 1\n this.panes.forEach((pane, index) => {\n const size = sizes[index]\n pane.style.order = String(index * 2)\n pane.style.flex =\n size.units === \"%\"\n ? `${size.value} ${size.value} 0`\n : size.units === AUTO\n ? \"0 1 auto\"\n : `0 ${fixedShrink} ${size.value}${size.units}`\n pane.toggleAttribute(FIT_ATTRIBUTE, size.units === AUTO)\n })\n }\n\n ////////////////\n // ## Dragging a bar\n ////////////////\n\n /** A bar's `pointerdown`: measure the two panes it sits between, and take the pointer until it's let go. */\n private startDragging(event: PointerEvent & { currentTarget: HTMLElement }, bar: number) {\n if (!this.resizable || event.button !== 0) return\n this.dragged = this.measure(bar, this.isRows ? event.clientY : event.clientX)\n if (!this.dragged) return\n event.currentTarget.setPointerCapture(event.pointerId)\n this.isDragging = true\n event.preventDefault()\n }\n\n /** `pointermove` while dragging: the bar follows the pointer. */\n @E.untracked private readonly drag = (event: PointerEvent) => {\n if (this.dragged) this.moveTo(this.dragged, this.isRows ? event.clientY : event.clientX)\n }\n\n /** Let go: say where the sizes ended up. */\n @E.untracked private readonly stopDragging = () => {\n if (!this.dragged) return\n this.settle(this.dragged)\n this.dragged = undefined\n this.isDragging = false\n this.findBarPlaces()\n this.sendSizes()\n }\n\n /** An arrow key along the bar moves it, Shift by ten times as much. */\n @E.untracked private moveByKey(event: KeyboardEvent, bar: number) {\n const direction = (this.isRows ? ROW_KEYS : COLUMN_KEYS)[event.key]\n if (!this.resizable || !direction) return\n const held = this.measure(bar, 0)\n if (!held) return\n this.moveTo(held, direction * KEY_STEP_PX * (event.shiftKey ? SHIFT_STEPS : 1))\n this.settle(held)\n this.findBarPlaces()\n this.sendSizes()\n event.preventDefault()\n }\n\n /** Say the sizes now, in the form `columns` and `rows` take. */\n private sendSizes() {\n this.send(\"ui-changed\", { sizes: E.PaneSizes.sizeText(this.sizes), panes: this.panes })\n }\n\n /**\n * What moving bar `bar` works from, with the pointer at `pointer`: `undefined` when it can't move.\n * - Every pane's size and its least and most (`PaneBounds`), whatever sets them.\n * - `undefined` when no pane on one side of the bar can be resized (its least and most the same).\n * - Measures ONCE, here: `getBoundingClientRect()` is too slow for every move.\n */\n private measure(bar: number, pointer: number): BarDrag | undefined {\n const isRows = this.isRows\n const [minShare, minPixels] = UISplitPanel.minimums(this.minSize)\n const lengths = this.panes.map((pane) => {\n const { width, height } = pane.getBoundingClientRect()\n return isRows ? height : width\n })\n const total = lengths.reduce((sum, length) => sum + length, 0)\n const bounds = this.panes.map((pane, index) => {\n const own = UISplitPanel.boundsOf(pane, isRows)\n const shareLeast = this.sizes[index]?.units === \"%\" ? (total * minShare) / 100 : 0\n // never above its most, nor above what it is now: a pane can always stay as it is\n const least = Math.min(Math.max(own.least, minPixels, shareLeast), own.most, lengths[index])\n return { least, most: Math.max(own.most, lengths[index]) }\n })\n const canResize = (index: number) => bounds[index].most - bounds[index].least >= 1\n let pane1 = bar\n while (pane1 >= 0 && !canResize(pane1)) pane1--\n let pane2 = bar + 1\n while (pane2 < this.panes.length && !canResize(pane2)) pane2++\n if (pane1 < 0 || pane2 >= this.panes.length) return undefined\n return {\n bar,\n lengths,\n bounds,\n sizes: this.sizes,\n pane1,\n pane2,\n pointerStart: pointer,\n size1: lengths[pane1],\n size2: lengths[pane2],\n bounds1: bounds[pane1],\n bounds2: bounds[pane2],\n minPixels\n }\n }\n\n /**\n * Move the bar to `pointer`: it stays under it, until a pane's least or most stops it.\n * - The panes before the bar take the move, the nearest first, each up to its most (or down to its least);\n * the panes after it give it up, the same way.\n * - So a pane that can't be resized is skipped, and one at its most passes the rest on.\n * - While dragging, every pane is held at its size in px: shares laid out by `flex` would spread a move over\n * every pane, and a pane CSS stops (`max-height: max-content`) passes its part to the others.\n * Let go (`settle()`), they're shares again.\n * - Beside an `auto` pane, a fixed pane takes the move, limited only by `min-size`: the panel grows with it.\n */\n private moveTo(held: BarDrag, pointer: number) {\n const moved = pointer - held.pointerStart\n const growing = this.growingPane\n if (growing !== undefined) return this.moveBeside(held, growing, moved)\n const { pane1, pane2, sizes } = held\n if (sizes[pane1]?.units === AUTO || sizes[pane2]?.units === AUTO) return this.moveBesideAuto(held, moved)\n const { lengths, bounds, bar } = held\n const before = lengths.map((_, index) => bar - index).filter((index) => index >= 0)\n const after = lengths.map((_, index) => bar + 1 + index).filter((index) => index < lengths.length)\n const [gaining, losing] = moved >= 0 ? [before, after] : [after, before]\n const room = (list: number[], way: \"grow\" | \"shrink\") =>\n list.reduce(\n (sum, index) =>\n sum + (way === \"grow\" ? bounds[index].most - lengths[index] : lengths[index] - bounds[index].least),\n 0\n )\n let left = Math.min(Math.abs(moved), room(gaining, \"grow\"), room(losing, \"shrink\"))\n const next = [...lengths]\n let gain = left\n for (const index of gaining) {\n const step = Math.min(gain, bounds[index].most - lengths[index])\n next[index] += step\n gain -= step\n }\n for (const index of losing) {\n const step = Math.min(left, lengths[index] - bounds[index].least)\n next[index] -= step\n left -= step\n }\n held.moved = next\n this.apply(next.map((length) => ({ value: Math.round(length * 100) / 100, units: \"px\" })))\n }\n\n /**\n * Let go of a move: the panes go back to their kinds of size, at the sizes they were moved to.\n * - A share's new share is its part of what the shares have now, so laid out by `flex` it's as tall (wide) as it\n * was moved to: every share in proportion to its size, and none stopped by its least or most.\n * - A fixed pane keeps its size in px; an `auto` pane moved is fixed in px, one not moved stays `auto`.\n */\n private settle(held: BarDrag) {\n const moved = held.moved\n if (!moved) return\n const { sizes, lengths } = held\n const isShare = (index: number) => sizes[index]?.units === \"%\"\n const shares = sizes.reduce((sum, size, index) => (isShare(index) ? sum + size.value : sum), 0)\n const room = moved.reduce((sum, length, index) => (isShare(index) ? sum + length : sum), 0)\n this.apply(\n sizes.map((size, index) => {\n if (isShare(index))\n return { value: room ? Math.round(((moved[index] * shares) / room) * 100) / 100 : size.value, units: \"%\" }\n return Math.abs(moved[index] - lengths[index]) < 0.5 ? size : { value: Math.round(moved[index]), units: \"px\" }\n })\n )\n }\n\n /**\n * Move a bar beside an `auto` pane: the fixed pane takes the move in px, the `auto` one is as big as its content.\n * - Only limited by `min-size` and the fixed pane's own bounds: the panel grows with it.\n * - Two `auto` panes: the first becomes fixed.\n */\n private moveBesideAuto(held: BarDrag, moved: number) {\n const { pane1, pane2, size1, size2, bounds1, bounds2, sizes } = held\n const fixed = [pane1, pane2].find((index) => sizes[index]?.units !== AUTO) ?? pane1\n const wanted = fixed === pane1 ? size1 + moved : size2 - moved\n const own = fixed === pane1 ? bounds1 : bounds2\n const value = Math.round(Math.min(own.most, Math.max(own.least, held.minPixels, wanted)))\n this.apply(sizes.map((size, index) => (index === fixed ? { value, units: \"px\" } : size)))\n }\n\n /**\n * Move a bar in a panel with a growing pane (`grows`): the pane on the bar's other side takes the move, in px,\n * and the growing pane the difference.\n * - Every other pane is fixed at its width as the drag started, so none moves but those two.\n * - Neither gets smaller than `min-size` (px), and the growing pane keeps `DEFAULT_MIN_SHARE` of the room.\n */\n private moveBeside(held: BarDrag, growing: number, moved: number) {\n const { pane1, pane2, size1, size2, bounds1, bounds2, lengths, minPixels } = held\n const sized = growing <= pane1 ? pane2 : pane1\n const bounds = sized === pane1 ? bounds1 : bounds2\n const wanted = sized === pane1 ? size1 + moved : size2 - moved\n const room = lengths.reduce((total, length) => total + length, 0)\n const growingLeast = Math.max(minPixels, (room * DEFAULT_MIN_SHARE) / 100)\n const most = Math.min(bounds.most, lengths[sized] + lengths[growing] - growingLeast)\n const value = Math.round(Math.min(most, Math.max(bounds.least, wanted)))\n this.apply(\n this.sizes.map((size, index) => {\n if (index === growing) return { value: 100, units: \"%\" }\n if (index === sized) return { value, units: \"px\" }\n return size.units === \"%\" || size.units === AUTO ? { value: Math.round(lengths[index]), units: \"px\" } : size\n })\n )\n }\n\n ////////////////\n // ## Sizes\n ////////////////\n\n /**\n * The least and most `pane` may be dragged to, px: its own `min-` and `max-height` (`-width` side by side).\n * - Its least: only px count; `auto` is 0.\n * - Its most: whatever its `max-height` says, `max-content` or a percent too, found by asking for far more\n * and measuring what it takes; `none` is `Infinity`.\n * - SIDE EFFECT: lays the page out again, once per pane with a most.\n */\n private static boundsOf(pane: HTMLElement, isRows: boolean): PaneBounds {\n const style = getComputedStyle(pane)\n const least = isRows ? style.minHeight : style.minWidth\n const most = isRows ? style.maxHeight : style.maxWidth\n return {\n least: least.endsWith(\"px\") ? parseFloat(least) : 0,\n most: most === \"none\" ? Infinity : UISplitPanel.mostOf(pane, isRows)\n }\n }\n\n /** How big `pane` gets when asked for far more than there's room for, px: what its `max-height` allows. */\n private static mostOf(pane: HTMLElement, isRows: boolean): number {\n const flex = pane.style.flex\n pane.style.flex = `0 0 ${FAR_MORE_PX}px`\n const { width, height } = pane.getBoundingClientRect()\n pane.style.flex = flex\n return isRows ? height : width\n }\n\n /** `min-size`, as the smallest share and the smallest px. */\n private static minimums(minSize: string | undefined): [share: number, pixels: number] {\n const match = NUMBER_WITH_UNITS.exec(minSize?.trim() ?? \"\")\n if (!match) return [DEFAULT_MIN_SHARE, 0]\n const value = parseFloat(match[1])\n return match[2] === \"%\" ? [value, 0] : [DEFAULT_MIN_SHARE, value]\n }\n}\n\nexport interface UISplitPanel extends E.AttributeValues<typeof splitPanelVocabulary> {}\n\n/** The least and most a pane may be dragged to, px, from its own CSS: the same, and it can't be resized. */\ntype PaneBounds = {\n /** Its `min-height` (`min-width`), else 0. */\n least: number\n /** Its `max-height` (`max-width`), else `Infinity`. */\n most: number\n}\n\n/** What moving a bar works from, measured once as it starts. */\ntype BarDrag = {\n /** Index of the bar. */\n bar: number\n /** Every pane's size as it started, px. */\n lengths: number[]\n /** Every pane's least and most, px, `min-size` included. */\n bounds: PaneBounds[]\n /** The sizes given as it started: each pane's kind of size, which it goes back to when let go. */\n sizes: E.PaneSize[]\n /** Every pane's size now, px, once the bar has moved. */\n moved?: number[]\n /** Index of the pane before the bar. */\n pane1: number\n /** Index of the pane after it. */\n pane2: number\n /** Where the pointer was as it started, px. */\n pointerStart: number\n /** `pane1`'s size as it started, px. */\n size1: number\n /** `pane2`'s size as it started, px. */\n size2: number\n /** The least and most `pane1` may be, px, `min-size` included. */\n bounds1: PaneBounds\n /** The least and most `pane2` may be, px, `min-size` included. */\n bounds2: PaneBounds\n /** Smallest size a fixed pane may have, px. */\n minPixels: number\n}\n\n/** A pane as big as its content: its units (`E.PaneSizes`). */\nconst AUTO = \"auto\"\n/** The attribute an `auto` pane carries, for what it holds to lay out in it rather than over it. */\nconst FIT_ATTRIBUTE = \"data-split-fit\"\n/** A bar's place before the panes are measured. */\nconst MIDDLE = 50\n/** One size in a spec: a number with optional units. */\nconst NUMBER_WITH_UNITS = /^([0-9]*\\.?[0-9]+)(px|em|rem|%)?$/\n/** Smallest share a pane may be dragged to, unless `min-size` says. */\nconst DEFAULT_MIN_SHARE = 5\n/** Far more than any pane could be, px: what a pane is asked for to find its most. */\nconst FAR_MORE_PX = 100_000\n/** How far an arrow key moves a bar, px. */\nconst KEY_STEP_PX = 16\n/** How many steps Shift makes it. */\nconst SHIFT_STEPS = 10\n/** The arrow keys along a bar between panes side by side, and which way each moves it. */\nconst COLUMN_KEYS: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1 }\n/** The arrow keys along a bar between panes one above the other, and which way each moves it. */\nconst ROW_KEYS: Record<string, number> = { ArrowUp: -1, ArrowDown: 1 }\n","/**\n * The split panel family: defines `<ui-split-panel>` and exports its component, `UISplitPanel`.\n * - SIDE EFFECT: importing it defines the tag.\n * - Also the library's `spell/ui/ui-split-panel` entry.\n */\n\nimport { UISplitPanel } from \"./UISplitPanel\"\n\nUISplitPanel.define()\n\n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EAAAsB,GAAA,GAAQ,aAArBb,GApKWiB,CAAA,GACF1B,EAAAsB,GAAA,IAAO,cAAhBF,GADWM,CAAA,GAEI1B,EAAAsB,GAAA,IAAO,gBAAtBH,GAFWO,CAAA,GAqJE1B,EAAAsB,GAAA,GAAiB,QAA9BX,GArJWe,CAAA,GA0JE1B,EAAAsB,GAAA,GAAiB,gBAA9BZ,GA1JWgB,CAAA,GAANzB,EAAAqB,GAAMI,CAAA,GAAgE/B,EAAA+B,GAAA,cAAA,GAClE5B,EADE4B,GACK,cAAaxB,EAApBoB,GAAA,IADEI,GACkBrB,CAAA,CAAA,GAApBH,EAAAoB,GAAA,IADEI,CAAA,GAEI5B,EAFJ4B,GAEW,gBAAwCxB,EAA/CoB,GAAA,IAFJI,GAEmD;CAC5D,aAAa,EAAE,YAAY9B,GAAc;CACzC,WAAW,CAAC,WAAW;AACzB,CAAA,CAAA,GAHeM,EAAAoB,GAAA,IAFJI,CAAA;AAAN,IAAMqG,IAANrG,GAuZDgD,IAAO,QAEPC,KAAgB,kBAEhB3B,IAAS,IAET6E,KAAoB,qCAEpBP,IAAoB,GAEpBK,KAAc,KAEd1C,KAAc,IAEdC,KAAc,IAEdH,KAAsC;CAAE,WAAW;CAAI,YAAY;AAAE,GAErED,KAAmC;CAAE,SAAS;CAAI,WAAW;AAAE;;;;;;;A,IC1crEiD,EAAa,OAAO"}
|
package/dist/ui-tree-diagram.js
CHANGED
|
@@ -548,7 +548,7 @@ B = n(z), V = /* @__PURE__ */ new WeakMap(), s(B, 4, "placement", fe, U, V), s(B
|
|
|
548
548
|
delegatesFocus: !1,
|
|
549
549
|
slotAssignment: "manual"
|
|
550
550
|
})), l(B, 19, U);
|
|
551
|
-
var W = U, he = "placed", G = 1, ge = 3, _e = "@layer ui.components.tree-diagram.types{:host{max-width:100%;display:block;overflow-x:auto}.canvas{width:fit-content;min-width:min-content;max-width:100%;position:relative}.font-sentinel{visibility:hidden;pointer-events:none;font-family:var(--_ui-tree-diagram-font-family);font-size:14px;line-height:1;position:absolute;top:0;left:0}.font-sentinel,.ui.tree.diagram,.ui.tree.diagram :is(.node,.edge,.edge-label){--_ui-tree-diagram-font-family:var(--ui-tree-diagram-font-family,var(--ui-font-family));--_ui-tree-diagram-font-size:var(--ui-tree-diagram-font-size,.8125em);--_ui-tree-diagram-edge-label-font-family:var(--ui-tree-diagram-edge-label-font-family,var(--ui-font-family));--_ui-tree-diagram-min-scale:var(--ui-tree-diagram-min-scale,.75);--_ui-tree-diagram-radius:var(--ui-tree-diagram-radius,var(--ui-radius-m));--_ui-tree-diagram-node-background:var(--ui-tree-diagram-node-background,var(--ui-surface-muted));--_ui-tree-diagram-node-border-color:var(--ui-tree-diagram-node-border-color,var(--ui-border-color-strong));--_ui-tree-diagram-root-background:var(--ui-tree-diagram-root-background,var(--ui-primary-background));--_ui-tree-diagram-root-border-color:var(--ui-tree-diagram-root-border-color,var(--ui-primary));--_ui-tree-diagram-label-color:var(--ui-tree-diagram-label-color,var(--ui-text-color));--_ui-tree-diagram-detail-color:var(--ui-tree-diagram-detail-color,var(--ui-text-muted));--_ui-tree-diagram-edge-color:var(--ui-tree-diagram-edge-color,var(--ui-text-light));--_ui-tree-diagram-edge-label-color:var(--ui-tree-diagram-edge-label-color,var(--ui-text-muted));--_ui-tree-diagram-focus-color:var(--ui-tree-diagram-focus-color,var(--ui-primary))}svg.ui.tree.diagram{font-family:var(--_ui-tree-diagram-font-family);font-size:var(--_ui-tree-diagram-font-size);width:calc(var(--_ui-tree-diagram-natural-width,0) * 1em);min-width:calc(var(--_ui-tree-diagram-natural-width,0) * var(--_ui-tree-diagram-min-scale) * 1em);max-width:100%;height:auto;display:block;overflow:visible}}@layer ui.components.tree-diagram.content{.ui.tree.diagram{& .box{fill:var(--_ui-tree-diagram-node-background);stroke:var(--_ui-tree-diagram-node-border-color);stroke-width:1px;rx:var(--_ui-tree-diagram-radius)}& .root .box{fill:var(--_ui-tree-diagram-root-background);stroke:var(--_ui-tree-diagram-root-border-color);stroke-width:2px}& :is(.label,.detail,.edge-label){text-anchor:middle;dominant-baseline:central}& .label{fill:var(--_ui-tree-diagram-label-color)}& .root .label{font-weight:var(--ui-font-weight-semibold)}& .detail{fill:var(--_ui-tree-diagram-detail-color)}& .edge{fill:none;stroke:var(--_ui-tree-diagram-edge-color);stroke-width:1.5px;stroke-linecap:round}& .edge-label{fill:var(--_ui-tree-diagram-edge-label-color);font-family:var(--_ui-tree-diagram-edge-label-font-family);font-style:italic}& .label,& .detail{font-family:var(--_ui-tree-diagram-font-family)}& .toggle{cursor:var(--ui-control-cursor,pointer)}& .toggle-target{fill:#0000}& .toggle-circle{fill:var(--_ui-tree-diagram-edge-color)}& .toggle-mark{fill:none;stroke:var(--ui-text-inverted-color);stroke-width:1.5px;stroke-linecap:round}& .clickable{cursor:var(--ui-control-cursor,pointer)}& .clickable:hover .box{stroke:var(--_ui-tree-diagram-focus-color)}& :is(.clickable,.toggle):focus{outline:none}& .clickable:focus-visible .box,& .toggle:focus-visible .toggle-circle{stroke:var(--_ui-tree-diagram-focus-color);stroke-width:2.5px}& .toggle:hover .toggle-circle{fill:var(--_ui-tree-diagram-focus-color)}}}@layer ui.components.tree-diagram.variations;@layer ui.components.tree-diagram.states{.ui.tree.diagram.empty{display:none}}", ve = /* @__PURE__ */ F("<div><svg><!><!><!></svg><span aria-hidden=true>Mg</span><slot>"), ye = /* @__PURE__ */ F("<svg><defs><g><text></text></g><g><text></text><text></text></g><text></svg>", 2), K = /* @__PURE__ */ F("<svg><text></svg>", 2), be = /* @__PURE__ */ F("<svg><g><rect></rect><!><!><!></svg>", 2), xe = /* @__PURE__ */ F("<title>"), Se = /* @__PURE__ */ F("<svg><g role=button tabindex=0><title></title><circle></circle><circle></circle><path></svg>", 2), Ce = /* @__PURE__ */ F("<svg><path></svg>", 2), we, Te, Ee, De, Oe, ke, Ae, je, Me, Ne, Pe, Fe, Ie, Le, Re, ze, Be, Ve, He, Ue, We, q, J, Y, X, Z, Ge, Q = class _UITreeDiagram extends (q = o, We = [p], Ue = [m], He = [v({
|
|
551
|
+
var W = U, he = "placed", G = 1, ge = 3, _e = "@layer ui.components.tree-diagram.types{:host{max-width:100%;display:block;overflow-x:auto}::slotted(:is(ui-json,es-json)){display:none}.canvas{width:fit-content;min-width:min-content;max-width:100%;position:relative}.font-sentinel{visibility:hidden;pointer-events:none;font-family:var(--_ui-tree-diagram-font-family);font-size:14px;line-height:1;position:absolute;top:0;left:0}.font-sentinel,.ui.tree.diagram,.ui.tree.diagram :is(.node,.edge,.edge-label){--_ui-tree-diagram-font-family:var(--ui-tree-diagram-font-family,var(--ui-font-family));--_ui-tree-diagram-font-size:var(--ui-tree-diagram-font-size,.8125em);--_ui-tree-diagram-edge-label-font-family:var(--ui-tree-diagram-edge-label-font-family,var(--ui-font-family));--_ui-tree-diagram-min-scale:var(--ui-tree-diagram-min-scale,.75);--_ui-tree-diagram-radius:var(--ui-tree-diagram-radius,var(--ui-radius-m));--_ui-tree-diagram-node-background:var(--ui-tree-diagram-node-background,var(--ui-surface-muted));--_ui-tree-diagram-node-border-color:var(--ui-tree-diagram-node-border-color,var(--ui-border-color-strong));--_ui-tree-diagram-root-background:var(--ui-tree-diagram-root-background,var(--ui-primary-background));--_ui-tree-diagram-root-border-color:var(--ui-tree-diagram-root-border-color,var(--ui-primary));--_ui-tree-diagram-label-color:var(--ui-tree-diagram-label-color,var(--ui-text-color));--_ui-tree-diagram-detail-color:var(--ui-tree-diagram-detail-color,var(--ui-text-muted));--_ui-tree-diagram-edge-color:var(--ui-tree-diagram-edge-color,var(--ui-text-light));--_ui-tree-diagram-edge-label-color:var(--ui-tree-diagram-edge-label-color,var(--ui-text-muted));--_ui-tree-diagram-focus-color:var(--ui-tree-diagram-focus-color,var(--ui-primary))}svg.ui.tree.diagram{font-family:var(--_ui-tree-diagram-font-family);font-size:var(--_ui-tree-diagram-font-size);width:calc(var(--_ui-tree-diagram-natural-width,0) * 1em);min-width:calc(var(--_ui-tree-diagram-natural-width,0) * var(--_ui-tree-diagram-min-scale) * 1em);max-width:100%;height:auto;display:block;overflow:visible}}@layer ui.components.tree-diagram.content{.ui.tree.diagram{& .box{fill:var(--_ui-tree-diagram-node-background);stroke:var(--_ui-tree-diagram-node-border-color);stroke-width:1px;rx:var(--_ui-tree-diagram-radius)}& .root .box{fill:var(--_ui-tree-diagram-root-background);stroke:var(--_ui-tree-diagram-root-border-color);stroke-width:2px}& :is(.label,.detail,.edge-label){text-anchor:middle;dominant-baseline:central}& .label{fill:var(--_ui-tree-diagram-label-color)}& .root .label{font-weight:var(--ui-font-weight-semibold)}& .detail{fill:var(--_ui-tree-diagram-detail-color)}& .edge{fill:none;stroke:var(--_ui-tree-diagram-edge-color);stroke-width:1.5px;stroke-linecap:round}& .edge-label{fill:var(--_ui-tree-diagram-edge-label-color);font-family:var(--_ui-tree-diagram-edge-label-font-family);font-style:italic}& .label,& .detail{font-family:var(--_ui-tree-diagram-font-family)}& .toggle{cursor:var(--ui-control-cursor,pointer)}& .toggle-target{fill:#0000}& .toggle-circle{fill:var(--_ui-tree-diagram-edge-color)}& .toggle-mark{fill:none;stroke:var(--ui-text-inverted-color);stroke-width:1.5px;stroke-linecap:round}& .clickable{cursor:var(--ui-control-cursor,pointer)}& .clickable:hover .box{stroke:var(--_ui-tree-diagram-focus-color)}& :is(.clickable,.toggle):focus{outline:none}& .clickable:focus-visible .box,& .toggle:focus-visible .toggle-circle{stroke:var(--_ui-tree-diagram-focus-color);stroke-width:2.5px}& .toggle:hover .toggle-circle{fill:var(--_ui-tree-diagram-focus-color)}}}@layer ui.components.tree-diagram.variations;@layer ui.components.tree-diagram.states{.ui.tree.diagram.empty{display:none}}", ve = /* @__PURE__ */ F("<div><svg><!><!><!></svg><span aria-hidden=true>Mg</span><slot>"), ye = /* @__PURE__ */ F("<svg><defs><g><text></text></g><g><text></text><text></text></g><text></svg>", 2), K = /* @__PURE__ */ F("<svg><text></svg>", 2), be = /* @__PURE__ */ F("<svg><g><rect></rect><!><!><!></svg>", 2), xe = /* @__PURE__ */ F("<title>"), Se = /* @__PURE__ */ F("<svg><g role=button tabindex=0><title></title><circle></circle><circle></circle><path></svg>", 2), Ce = /* @__PURE__ */ F("<svg><path></svg>", 2), we, Te, Ee, De, Oe, ke, Ae, je, Me, Ne, Pe, Fe, Ie, Le, Re, ze, Be, Ve, He, Ue, We, q, J, Y, X, Z, Ge, Q = class _UITreeDiagram extends (q = o, We = [p], Ue = [m], He = [v({
|
|
552
552
|
childList: !0,
|
|
553
553
|
characterData: !0,
|
|
554
554
|
subtree: !0
|