spell-ui 0.8.15 → 0.8.17
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 +4 -2
- package/README-runtime.md +26 -1
- package/README.md +2 -1
- package/dist/SliderScale-DunjyaDW.js +67 -0
- package/dist/SliderScale-DunjyaDW.js.map +1 -0
- package/dist/{ThemeDraft-CyX3YA_L.js → ThemeDraft-spaNC2dD.js} +2 -2
- package/dist/{ThemeDraft-CyX3YA_L.js.map → ThemeDraft-spaNC2dD.js.map} +1 -1
- package/dist/{UIInput-B3K0w4ow.js → UIInput-8s1aiaw1.js} +2 -2
- package/dist/UIInput-8s1aiaw1.js.map +1 -0
- package/dist/{UIRuntime-DCv4sy30.js → UIRuntime-BaokNnwk.js} +900 -158
- package/dist/UIRuntime-BaokNnwk.js.map +1 -0
- package/dist/_spell-element/UIComponent.d.ts +7 -0
- package/dist/_spell-element/elements.types.d.ts +6 -0
- package/dist/_spell-element/vocabulary.types.d.ts +27 -0
- package/dist/_util/dom.d.ts +7 -0
- package/dist/components/components.es.d.ts +1 -0
- package/dist/components/ui-dial/DialArc.d.ts +43 -0
- package/dist/components/ui-dial/UIDial.d.ts +263 -0
- package/dist/components/ui-dial/UIDial.en.d.ts +149 -0
- package/dist/components/ui-dial/UIDial.es.d.ts +25 -0
- package/dist/components/ui-dial/UIDial.fallback.d.ts +167 -0
- package/dist/components/ui-dial/UIDial.types.d.ts +11 -0
- package/dist/components/ui-dial/index.d.ts +3 -0
- package/dist/components/ui-graph/UIGraph.d.ts +17 -0
- package/dist/components/ui-graph/UIGraph.en.d.ts +17 -0
- package/dist/components/ui-graph/UIGraph.es.d.ts +6 -0
- package/dist/components/ui-input/UIInput.d.ts +46 -3
- package/dist/components/ui-input/UIInput.en.d.ts +6 -1
- package/dist/components/ui-input/UIInput.es.d.ts +1 -0
- package/dist/components/ui-input/UIInput.fallback.d.ts +6 -1
- package/dist/components/ui-json/UIJson.d.ts +5 -4
- package/dist/components/ui-modal/ChoiceRows.d.ts +61 -0
- package/dist/components/ui-modal/ModalDialogs.d.ts +15 -1
- package/dist/components/ui-modal/UIModal.d.ts +6 -2
- package/dist/components/ui-modal/UIModal.en.d.ts +6 -2
- package/dist/components/ui-modal/UIModal.es.d.ts +1 -0
- package/dist/components/ui-page-layout/UIPageLayout.d.ts +141 -8
- package/dist/components/ui-page-layout/UIPageLayout.en.d.ts +51 -2
- package/dist/components/ui-page-layout/UIPageLayout.es.d.ts +3 -0
- package/dist/components/ui-property-editor/UIProperty.d.ts +2 -2
- package/dist/components/ui-site-links/UISiteLinks.d.ts +124 -0
- package/dist/components/ui-site-links/UISiteLinks.en.d.ts +60 -0
- package/dist/components/ui-site-links/UISiteLinks.es.d.ts +26 -0
- package/dist/components/ui-site-links/index.d.ts +1 -0
- package/dist/components/ui-site-nav-button/UISiteNavButton.d.ts +12 -5
- package/dist/components/ui-site-nav-button/UISiteNavButton.en.d.ts +32 -12
- package/dist/components/ui-site-nav-button/UISiteNavButton.es.d.ts +3 -0
- package/dist/components/ui-site-tabs/UISiteTabs.d.ts +13 -0
- package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +9 -0
- package/dist/components/ui-slider/SliderScale.d.ts +26 -2
- package/dist/components/ui-slider/UISlider.d.ts +0 -2
- package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
- package/dist/components/ui-toc/TocIndex.d.ts +16 -1
- package/dist/components/ui-toc/UIToc.d.ts +27 -3
- package/dist/components/ui-toc/UIToc.en.d.ts +1 -1
- package/dist/components/ui-toc/UIToc.types.d.ts +5 -0
- package/dist/components/ui-tree/UITree.d.ts +38 -2
- package/dist/components/ui-tree/UITree.en.d.ts +9 -0
- package/dist/components/ui-tree/UITree.es.d.ts +4 -0
- package/dist/components/ui-uploader/UIUploader.d.ts +721 -0
- package/dist/components/ui-uploader/UIUploader.en.d.ts +394 -0
- package/dist/components/ui-uploader/UIUploader.es.d.ts +112 -0
- package/dist/components/ui-uploader/index.d.ts +1 -0
- package/dist/{components.es-DilRG1VO.js → components.es-jY2nBwuP.js} +249 -65
- package/dist/components.es-jY2nBwuP.js.map +1 -0
- package/dist/core.js +605 -571
- package/dist/core.js.map +1 -1
- package/dist/docs-components/docs-components.types.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +101 -97
- package/dist/jsx.d.ts +1138 -21
- package/dist/runtime/DataTooltips.d.ts +10 -0
- package/dist/runtime/Modals.d.ts +7 -2
- package/dist/runtime/Styles.d.ts +7 -1
- package/dist/runtime/UIRuntime.d.ts +6 -0
- package/dist/runtime/runtime.types.d.ts +26 -1
- package/dist/sound-library/back.ogg +0 -0
- package/dist/sound-library/beep.ogg +0 -0
- package/dist/sound-library/bell.ogg +0 -0
- package/dist/sound-library/big-punch.ogg +0 -0
- package/dist/sound-library/bong.ogg +0 -0
- package/dist/sound-library/book-close.ogg +0 -0
- package/dist/sound-library/book-down.ogg +0 -0
- package/dist/sound-library/book-open.ogg +0 -0
- package/dist/sound-library/card-fan-2.ogg +0 -0
- package/dist/sound-library/card-fan.ogg +0 -0
- package/dist/sound-library/card-place-2.ogg +0 -0
- package/dist/sound-library/card-place-3.ogg +0 -0
- package/dist/sound-library/card-place.ogg +0 -0
- package/dist/sound-library/card-shove-2.ogg +0 -0
- package/dist/sound-library/card-shove.ogg +0 -0
- package/dist/sound-library/card-slide-2.ogg +0 -0
- package/dist/sound-library/card-slide-3.ogg +0 -0
- package/dist/sound-library/card-slide-4.ogg +0 -0
- package/dist/sound-library/card-slide.ogg +0 -0
- package/dist/sound-library/chip-down-2.ogg +0 -0
- package/dist/sound-library/chip-down.ogg +0 -0
- package/dist/sound-library/chips-collide.ogg +0 -0
- package/dist/sound-library/chips-handle.ogg +0 -0
- package/dist/sound-library/chips-stack-2.ogg +0 -0
- package/dist/sound-library/chips-stack.ogg +0 -0
- package/dist/sound-library/chop.ogg +0 -0
- package/dist/sound-library/click-2.ogg +0 -0
- package/dist/sound-library/click-3.ogg +0 -0
- package/dist/sound-library/click.ogg +0 -0
- package/dist/sound-library/close.ogg +0 -0
- package/dist/sound-library/cloth.ogg +0 -0
- package/dist/sound-library/coins-2.ogg +0 -0
- package/dist/sound-library/coins.ogg +0 -0
- package/dist/sound-library/confirm-2.ogg +0 -0
- package/dist/sound-library/confirm.ogg +0 -0
- package/dist/sound-library/creak.ogg +0 -0
- package/dist/sound-library/deck-open.ogg +0 -0
- package/dist/sound-library/deck-take-out.ogg +0 -0
- package/dist/sound-library/dice-grab.ogg +0 -0
- package/dist/sound-library/dice-shake-2.ogg +0 -0
- package/dist/sound-library/dice-shake.ogg +0 -0
- package/dist/sound-library/dice-throw-2.ogg +0 -0
- package/dist/sound-library/dice-throw.ogg +0 -0
- package/dist/sound-library/die-throw-2.ogg +0 -0
- package/dist/sound-library/die-throw.ogg +0 -0
- package/dist/sound-library/door-close.ogg +0 -0
- package/dist/sound-library/door-open.ogg +0 -0
- package/dist/sound-library/drop.ogg +0 -0
- package/dist/sound-library/error-2.ogg +0 -0
- package/dist/sound-library/error.ogg +0 -0
- package/dist/sound-library/fail.ogg +0 -0
- package/dist/sound-library/fall.ogg +0 -0
- package/dist/sound-library/glass-break.ogg +0 -0
- package/dist/sound-library/glass-clink.ogg +0 -0
- package/dist/sound-library/glass-tap.ogg +0 -0
- package/dist/sound-library/glass.ogg +0 -0
- package/dist/sound-library/glitch.ogg +0 -0
- package/dist/sound-library/grow.ogg +0 -0
- package/dist/sound-library/high-up.ogg +0 -0
- package/dist/sound-library/hover-2.ogg +0 -0
- package/dist/sound-library/hover.ogg +0 -0
- package/dist/sound-library/jingle-2.ogg +0 -0
- package/dist/sound-library/jingle-3.ogg +0 -0
- package/dist/sound-library/jingle-4.ogg +0 -0
- package/dist/sound-library/jingle.ogg +0 -0
- package/dist/sound-library/jump.ogg +0 -0
- package/dist/sound-library/knife-draw.ogg +0 -0
- package/dist/sound-library/knife-slice.ogg +0 -0
- package/dist/sound-library/laser-2.ogg +0 -0
- package/dist/sound-library/laser.ogg +0 -0
- package/dist/sound-library/latch.ogg +0 -0
- package/dist/sound-library/level-up.ogg +0 -0
- package/dist/sound-library/lose-2.ogg +0 -0
- package/dist/sound-library/lose-3.ogg +0 -0
- package/dist/sound-library/lose-4.ogg +0 -0
- package/dist/sound-library/lose.ogg +0 -0
- package/dist/sound-library/low-down.ogg +0 -0
- package/dist/sound-library/metal-clang.ogg +0 -0
- package/dist/sound-library/metal-click.ogg +0 -0
- package/dist/sound-library/metal-crash.ogg +0 -0
- package/dist/sound-library/metal-tap.ogg +0 -0
- package/dist/sound-library/mouse-click.ogg +0 -0
- package/dist/sound-library/mouse-release.ogg +0 -0
- package/dist/sound-library/open.ogg +0 -0
- package/dist/sound-library/orchestra-hit-2.ogg +0 -0
- package/dist/sound-library/orchestra-hit.ogg +0 -0
- package/dist/sound-library/page-turn-2.ogg +0 -0
- package/dist/sound-library/page-turn.ogg +0 -0
- package/dist/sound-library/pickaxe.ogg +0 -0
- package/dist/sound-library/piece-down-2.ogg +0 -0
- package/dist/sound-library/piece-down-3.ogg +0 -0
- package/dist/sound-library/piece-down.ogg +0 -0
- package/dist/sound-library/piece-take-2.ogg +0 -0
- package/dist/sound-library/piece-take.ogg +0 -0
- package/dist/sound-library/piece-tap-2.ogg +0 -0
- package/dist/sound-library/piece-tap.ogg +0 -0
- package/dist/sound-library/plank.ogg +0 -0
- package/dist/sound-library/plate.ogg +0 -0
- package/dist/sound-library/pluck.ogg +0 -0
- package/dist/sound-library/pot.ogg +0 -0
- package/dist/sound-library/power-up-2.ogg +0 -0
- package/dist/sound-library/power-up-3.ogg +0 -0
- package/dist/sound-library/power-up.ogg +0 -0
- package/dist/sound-library/punch.ogg +0 -0
- package/dist/sound-library/question.ogg +0 -0
- package/dist/sound-library/rise.ogg +0 -0
- package/dist/sound-library/scratch.ogg +0 -0
- package/dist/sound-library/scroll.ogg +0 -0
- package/dist/sound-library/select-2.ogg +0 -0
- package/dist/sound-library/select.ogg +0 -0
- package/dist/sound-library/shrink.ogg +0 -0
- package/dist/sound-library/shuffle.ogg +0 -0
- package/dist/sound-library/soft-thud-2.ogg +0 -0
- package/dist/sound-library/soft-thud.ogg +0 -0
- package/dist/sound-library/space-junk.ogg +0 -0
- package/dist/sound-library/step-2.ogg +0 -0
- package/dist/sound-library/step-on-carpet.ogg +0 -0
- package/dist/sound-library/step-on-grass.ogg +0 -0
- package/dist/sound-library/step-on-snow.ogg +0 -0
- package/dist/sound-library/step-on-stone.ogg +0 -0
- package/dist/sound-library/step-on-wood.ogg +0 -0
- package/dist/sound-library/step.ogg +0 -0
- package/dist/sound-library/switch-2.ogg +0 -0
- package/dist/sound-library/switch.ogg +0 -0
- package/dist/sound-library/tap-2.ogg +0 -0
- package/dist/sound-library/tap.ogg +0 -0
- package/dist/sound-library/three-tones.ogg +0 -0
- package/dist/sound-library/tick-2.ogg +0 -0
- package/dist/sound-library/tick.ogg +0 -0
- package/dist/sound-library/tin.ogg +0 -0
- package/dist/sound-library/toggle-2.ogg +0 -0
- package/dist/sound-library/toggle.ogg +0 -0
- package/dist/sound-library/two-tones.ogg +0 -0
- package/dist/sound-library/win-2.ogg +0 -0
- package/dist/sound-library/win-3.ogg +0 -0
- package/dist/sound-library/win-4.ogg +0 -0
- package/dist/sound-library/win.ogg +0 -0
- package/dist/sound-library/wood-thud.ogg +0 -0
- package/dist/sound-library/zap.ogg +0 -0
- package/dist/sounds/BuiltInSounds.d.ts +41 -0
- package/dist/sounds/index.d.ts +9 -0
- package/dist/sounds/sounds.types.d.ts +22 -0
- package/dist/ui-calendar.js +1 -1
- package/dist/ui-dial.editor-CjjdKi5L.js +5 -0
- package/dist/ui-dial.editor-CjjdKi5L.js.map +1 -0
- package/dist/ui-dial.js +467 -0
- package/dist/ui-dial.js.map +1 -0
- package/dist/ui-graph.js +22 -0
- package/dist/ui-graph.js.map +1 -1
- package/dist/{ui-input.editor-budoNoB0.js → ui-input.editor-D11iRgXR.js} +2 -2
- package/dist/ui-input.editor-D11iRgXR.js.map +1 -0
- package/dist/ui-input.js +84 -54
- package/dist/ui-input.js.map +1 -1
- package/dist/ui-json.js +8 -8
- package/dist/ui-json.js.map +1 -1
- package/dist/ui-modal.js +183 -97
- package/dist/ui-modal.js.map +1 -1
- package/dist/ui-page-layout.editor-IgDEveUY.js +5 -0
- package/dist/ui-page-layout.editor-IgDEveUY.js.map +1 -0
- package/dist/ui-page-layout.js +217 -72
- package/dist/ui-page-layout.js.map +1 -1
- package/dist/ui-popup.js +34 -34
- package/dist/ui-popup.js.map +1 -1
- package/dist/ui-property-editor.js +7 -4
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-root.js +71 -5
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-search.js +1 -1
- package/dist/ui-section.js +97 -96
- package/dist/ui-section.js.map +1 -1
- package/dist/ui-site-links.editor-BME3sw5H.js +5 -0
- package/dist/ui-site-links.editor-BME3sw5H.js.map +1 -0
- package/dist/ui-site-links.js +150 -0
- package/dist/ui-site-links.js.map +1 -0
- package/dist/ui-site-nav-button.editor-ChY4xe1U.js +5 -0
- package/dist/ui-site-nav-button.editor-ChY4xe1U.js.map +1 -0
- package/dist/ui-site-nav-button.js +57 -18
- package/dist/ui-site-nav-button.js.map +1 -1
- package/dist/{ui-site-tabs.editor-DDvQfH6S.js → ui-site-tabs.editor-CdMIw4jw.js} +2 -2
- package/dist/ui-site-tabs.editor-CdMIw4jw.js.map +1 -0
- package/dist/ui-site-tabs.js +30 -14
- package/dist/ui-site-tabs.js.map +1 -1
- package/dist/ui-slider.js +75 -124
- package/dist/ui-slider.js.map +1 -1
- package/dist/ui-statistic.js +1 -0
- package/dist/ui-statistic.js.map +1 -1
- package/dist/ui-theme-editor.js +2 -2
- package/dist/{ui-theme-menu-BZYUMrHe.js → ui-theme-menu-BEBu6dyq.js} +3 -3
- package/dist/{ui-theme-menu-BZYUMrHe.js.map → ui-theme-menu-BEBu6dyq.js.map} +1 -1
- package/dist/ui-toc.js +159 -122
- package/dist/ui-toc.js.map +1 -1
- package/dist/ui-tree.js +142 -87
- package/dist/ui-tree.js.map +1 -1
- package/dist/ui-uploader.editor-DrE80KjL.js +5 -0
- package/dist/ui-uploader.editor-DrE80KjL.js.map +1 -0
- package/dist/ui-uploader.js +1442 -0
- package/dist/ui-uploader.js.map +1 -0
- package/dist/vocabulary/hooks.generated.d.ts +7 -0
- package/package.json +1 -1
- package/dist/UIInput-B3K0w4ow.js.map +0 -1
- package/dist/UIRuntime-DCv4sy30.js.map +0 -1
- package/dist/components.es-DilRG1VO.js.map +0 -1
- package/dist/ui-input.editor-budoNoB0.js.map +0 -1
- package/dist/ui-page-layout.editor-xtQW0FZk.js +0 -5
- package/dist/ui-page-layout.editor-xtQW0FZk.js.map +0 -1
- package/dist/ui-site-nav-button.editor-6J-zJLtZ.js +0 -5
- package/dist/ui-site-nav-button.editor-6J-zJLtZ.js.map +0 -1
- package/dist/ui-site-tabs.editor-DDvQfH6S.js.map +0 -1
package/dist/ui-toc.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./rolldown-runtime-c6e9CmGy.js";
|
|
2
|
-
import { Gt as e, Jt as t, Kt as n, Mt as r, Queued as i, UIComponent as a, Ut as o, Wt as s, Yt as c, after as l, afterSolidUpdate as u, beforeNextPaint as d,
|
|
3
|
-
import { t as
|
|
2
|
+
import { Gt as e, Jt as t, Kt as n, Mt as r, Queued as i, UIComponent as a, Ut as o, Wt as s, Yt as c, after as l, afterSolidUpdate as u, beforeNextPaint as d, closestAcrossShadow as f, cssState as ee, derived as te, flatParentFor as p, it as ne, nextFrame as m, on as re, proto as ie, protoMerged as ae, qt as h, slug as oe, state as g, untracked as _, whileConnected as se } from "./core.js";
|
|
3
|
+
import { t as ce } from "./PrefStore-Di83C0bY.js";
|
|
4
4
|
import "./ui-menu.js";
|
|
5
5
|
import "./ui-item.js";
|
|
6
6
|
import "./ui-parts.js";
|
|
7
|
-
import { For as
|
|
8
|
-
import { className as
|
|
7
|
+
import { For as v, Show as y } from "solid-js";
|
|
8
|
+
import { className as b, createComponent as x, delegateEvents as le, effect as S, getOwner as C, insert as w, memo as ue, readShallow as T, setAttribute as E, template as D } from "@solidjs/web";
|
|
9
9
|
// src/components/ui-toc/UIToc.en.ts
|
|
10
10
|
var de = {
|
|
11
11
|
tag: "ui-toc",
|
|
@@ -28,18 +28,18 @@ var de = {
|
|
|
28
28
|
name: "for",
|
|
29
29
|
kind: "string",
|
|
30
30
|
property: "htmlFor",
|
|
31
|
-
description: "Id of the element whose headings to list. A `<ui-tabs>`: its SHOWN pane, followed as the tabs switch. Default: the page's `<main>`, else `<body>`."
|
|
31
|
+
description: "Id of the element whose headings to list. A `<ui-tabs>`: its SHOWN pane, followed as the tabs switch. Default: inside a `<ui-page-layout>` (a side bar of it), the layout's page, followed as the site shows another; else the page's `<main>`, else `<body>`."
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
name: "scroller",
|
|
35
35
|
kind: "string",
|
|
36
|
-
description: "Id of the element whose scroll it follows, when the content scrolls inside a box of its own (a pane) rather than the window. Its reading line is then that box's top. Default: the window."
|
|
36
|
+
description: "Id of the element whose scroll it follows, when the content scrolls inside a box of its own (a pane) rather than the window. Its reading line is then that box's top. Default: inside a `<ui-page-layout>`, the box the layout scrolls in; else the window."
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
name: "heading",
|
|
40
40
|
replaces: ["header"],
|
|
41
41
|
kind: "string",
|
|
42
|
-
description: "Title above the links, e.g. the page's name (Fomantic's `Button`). Its old name was `header`."
|
|
42
|
+
description: "Title above the links, e.g. the page's name (Fomantic's `Button`). Default: inside a `<ui-page-layout>`, the title of the layout's page (its level 1 heading). Its old name was `header`."
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
name: "size",
|
|
@@ -139,28 +139,28 @@ var de = {
|
|
|
139
139
|
description: "The header's toggle, while every section is open."
|
|
140
140
|
}
|
|
141
141
|
]
|
|
142
|
-
},
|
|
142
|
+
}, O = class PageOutline {
|
|
143
143
|
static sections(e) {
|
|
144
144
|
let t = [...e.querySelectorAll(fe)].filter((e) => !PageOutline.demoAround(e) && PageOutline.titleOf(e)), n = new Map(t.map((e, t) => [e, t])), r = {};
|
|
145
|
-
for (let t of e.querySelectorAll(
|
|
146
|
-
let e = t.getAttribute(
|
|
145
|
+
for (let t of e.querySelectorAll(k)) {
|
|
146
|
+
let e = t.getAttribute(j);
|
|
147
147
|
r[e] = t.getAttribute(ge) ?? e;
|
|
148
148
|
}
|
|
149
149
|
return {
|
|
150
150
|
sections: t.map((e) => {
|
|
151
|
-
let t = PageOutline.parentOf(e, n), r = t === void 0 ? e.closest(
|
|
151
|
+
let t = PageOutline.parentOf(e, n), r = t === void 0 ? e.closest(k) : void 0;
|
|
152
152
|
return {
|
|
153
153
|
id: e.id,
|
|
154
154
|
title: PageOutline.titleOf(e),
|
|
155
155
|
...t !== void 0 && { parent: t },
|
|
156
|
-
...r && { tab: r.getAttribute(
|
|
156
|
+
...r && { tab: r.getAttribute(j) }
|
|
157
157
|
};
|
|
158
158
|
}),
|
|
159
159
|
tabs: r
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
static titleOf(e) {
|
|
163
|
-
if (e.localName === me) return PageOutline.clean(
|
|
163
|
+
if (e.localName === me) return PageOutline.clean(ne.textOf(e) ?? "");
|
|
164
164
|
let t = e.cloneNode(!0);
|
|
165
165
|
for (let e of t.querySelectorAll(he)) e.remove();
|
|
166
166
|
return PageOutline.clean(t.textContent ?? "");
|
|
@@ -176,26 +176,45 @@ var de = {
|
|
|
176
176
|
return a ? [a, ...r] : r;
|
|
177
177
|
}
|
|
178
178
|
static parentOf(e, t) {
|
|
179
|
-
for (let n = e.parentElement?.closest(
|
|
179
|
+
for (let n = e.parentElement?.closest(A); n;) {
|
|
180
180
|
let e = t.get(n);
|
|
181
181
|
if (e !== void 0) return e;
|
|
182
|
-
n = n.parentElement?.closest(
|
|
182
|
+
n = n.parentElement?.closest(A);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
static clean(e) {
|
|
186
186
|
return e.replace(/\s+/g, " ").trim();
|
|
187
187
|
}
|
|
188
|
-
}, fe = "ui-section[id], ui-header[id][level='2'], ui-header[id][level='3'], ui-header[id][level='4'], h2[id], h3[id], h4[id]", pe = "ui-example, ui-docs-tokens, template, script",
|
|
188
|
+
}, fe = "ui-section[id], ui-header[id][level='2'], ui-header[id][level='3'], ui-header[id][level='4'], h2[id], h3[id], h4[id]", pe = "ui-example, ui-docs-tokens, template, script", k = "ui-tabs#site-tabs > ui-tab[value]", me = "ui-section", A = "ui-section[id]", he = "ui-header, ui-icon, [slot]", j = "value", ge = "label", M = "ui-header[level=\"2\"], h2, ui-section, ui-example[heading], ui-header[level=\"3\"], h3", N = "ui-section", P = "ui-tabs", _e = .2, ve = ["expanded", "collapsed"], F = {
|
|
189
189
|
store: "spell-ui-toc",
|
|
190
190
|
all: "all",
|
|
191
191
|
folds: "folds:"
|
|
192
|
-
},
|
|
193
|
-
static followed(e, t) {
|
|
194
|
-
let
|
|
195
|
-
if (
|
|
196
|
-
root:
|
|
197
|
-
|
|
198
|
-
}
|
|
192
|
+
}, I = class TocIndex {
|
|
193
|
+
static followed(e, t, n) {
|
|
194
|
+
let r = !t && n ? f(n, xe) : null;
|
|
195
|
+
if (r) return {
|
|
196
|
+
root: r,
|
|
197
|
+
layout: r
|
|
198
|
+
};
|
|
199
|
+
let i = t ? e.getElementById(t) : e.querySelector("main") ?? e.body;
|
|
200
|
+
if (i) return i.localName === "ui-tabs" ? {
|
|
201
|
+
root: i,
|
|
202
|
+
tabs: i
|
|
203
|
+
} : { root: i };
|
|
204
|
+
}
|
|
205
|
+
static layoutPage(e) {
|
|
206
|
+
return [...e.children].find((e) => !e.hasAttribute("slot"));
|
|
207
|
+
}
|
|
208
|
+
static pageTitle(e) {
|
|
209
|
+
let t = e.querySelector(Se);
|
|
210
|
+
if (t) return [...t.childNodes].filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent).join(" ").replace(/\s+/g, " ").trim() || t.textContent?.trim() || void 0;
|
|
211
|
+
}
|
|
212
|
+
static scrollerAround(e) {
|
|
213
|
+
let t = e.ownerDocument.defaultView;
|
|
214
|
+
for (let n = p(e); n; n = p(n)) {
|
|
215
|
+
if (n === e.ownerDocument.documentElement || n === e.ownerDocument.body) return;
|
|
216
|
+
if (/auto|scroll/.test(t?.getComputedStyle(n).overflowY ?? "")) return n;
|
|
217
|
+
}
|
|
199
218
|
}
|
|
200
219
|
static shownPane(e) {
|
|
201
220
|
let t = TocIndex.panes(e);
|
|
@@ -209,7 +228,7 @@ var de = {
|
|
|
209
228
|
}
|
|
210
229
|
static scan(e, t = /* @__PURE__ */ new Set()) {
|
|
211
230
|
let n = [], r = /* @__PURE__ */ new Map(), i = TocIndex.shadowHosts;
|
|
212
|
-
for (let a of e.querySelectorAll(i ? `${
|
|
231
|
+
for (let a of e.querySelectorAll(i ? `${M}, ${i}` : M)) {
|
|
213
232
|
if (TocIndex.insideExample(a, e)) continue;
|
|
214
233
|
if (i && a.matches(i)) {
|
|
215
234
|
let t = TocIndex.enclosing(a, e, r) ?? n.at(-1);
|
|
@@ -326,7 +345,7 @@ var de = {
|
|
|
326
345
|
n.addEventListener("ui-ready", onReady);
|
|
327
346
|
}
|
|
328
347
|
static slug(e) {
|
|
329
|
-
return
|
|
348
|
+
return oe(e.replace(/['’]/g, " "), { fallback: "section" });
|
|
330
349
|
}
|
|
331
350
|
static idOf(e, t, n) {
|
|
332
351
|
if (e.id) return e.id;
|
|
@@ -335,24 +354,24 @@ var de = {
|
|
|
335
354
|
return e.id = a, a;
|
|
336
355
|
}
|
|
337
356
|
static text(e) {
|
|
338
|
-
return ((e.localName === "ui-example" ? e.getAttribute(ye) :
|
|
357
|
+
return ((e.localName === "ui-example" ? e.getAttribute(ye) : O.titleOf(e)) ?? "").replace(/\s+/g, " ").trim();
|
|
339
358
|
}
|
|
340
359
|
static insideExample(e, t) {
|
|
341
|
-
let n =
|
|
360
|
+
let n = O.demoAround(e);
|
|
342
361
|
return !!n && t.contains(n);
|
|
343
362
|
}
|
|
344
363
|
static enclosing(e, t, n) {
|
|
345
|
-
for (let r = e.parentElement?.closest(
|
|
364
|
+
for (let r = e.parentElement?.closest(N); r;) {
|
|
346
365
|
if (!t.contains(r) || r === t) return;
|
|
347
366
|
let e = n.get(r);
|
|
348
367
|
if (e) return e;
|
|
349
|
-
r = r.parentElement?.closest(
|
|
368
|
+
r = r.parentElement?.closest(N);
|
|
350
369
|
}
|
|
351
370
|
}
|
|
352
371
|
static folded(e) {
|
|
353
|
-
for (let t = e.parentElement?.closest(
|
|
372
|
+
for (let t = e.parentElement?.closest(N); t;) {
|
|
354
373
|
if (t.hasAttribute("collapsible") && t.getAttribute("open") === "false") return !0;
|
|
355
|
-
t = t.parentElement?.closest(
|
|
374
|
+
t = t.parentElement?.closest(N);
|
|
356
375
|
}
|
|
357
376
|
return !1;
|
|
358
377
|
}
|
|
@@ -366,10 +385,10 @@ var de = {
|
|
|
366
385
|
return !1;
|
|
367
386
|
}
|
|
368
387
|
}
|
|
369
|
-
}, ye = "heading", be = Symbol.for("spell-ui:toc-shadow-hosts"),
|
|
388
|
+
}, ye = "heading", be = Symbol.for("spell-ui:toc-shadow-hosts"), xe = "ui-page-layout", Se = "h1, ui-header[level=\"1\"]", L = class HashLanding {
|
|
370
389
|
static forDocument(e) {
|
|
371
|
-
let t =
|
|
372
|
-
return t ||
|
|
390
|
+
let t = R.get(e);
|
|
391
|
+
return t || R.set(e, t = new HashLanding(e)), t;
|
|
373
392
|
}
|
|
374
393
|
document;
|
|
375
394
|
rules;
|
|
@@ -391,7 +410,7 @@ var de = {
|
|
|
391
410
|
}
|
|
392
411
|
landOnHash(e, t = {}) {
|
|
393
412
|
if (this.isPageOwned) return Promise.resolve(!1);
|
|
394
|
-
let n =
|
|
413
|
+
let n = I.decode(e.replace(/^#/, "")), r = n ? I.elementById(this.document, n) : void 0;
|
|
395
414
|
return r ? this.land(r, t) : Promise.resolve(!1);
|
|
396
415
|
}
|
|
397
416
|
async land(e, { scroll: t = "jump", opensTarget: n = !0 } = {}) {
|
|
@@ -400,15 +419,15 @@ var de = {
|
|
|
400
419
|
let i = await Promise.resolve(e).catch(() => void 0);
|
|
401
420
|
if (!i || r !== this.landings || (await this.rules.whenReady(i), r !== this.landings)) return !1;
|
|
402
421
|
let a = this.rules.reveal(i, { opensTarget: n });
|
|
403
|
-
for (let e = 0; e <
|
|
404
|
-
return a && await
|
|
422
|
+
for (let e = 0; e < Ee && this.rules.topOf(i) === void 0; e++) await m();
|
|
423
|
+
return a && await m(this.rules.revealFrames), r === this.landings && (this.scrollTo(i, t), l(this.rules.settleSeconds, () => {
|
|
405
424
|
r === this.landings && !this.hasViewerMoved && this.scrollTo(i, t);
|
|
406
425
|
}), !0);
|
|
407
426
|
}
|
|
408
427
|
scrollTo(e, t) {
|
|
409
428
|
let n = this.rules.topOf(e), r = this.document.defaultView;
|
|
410
429
|
if (n === void 0 || !r) return;
|
|
411
|
-
let i = t === "glide" && !r.matchMedia(
|
|
430
|
+
let i = t === "glide" && !r.matchMedia(Oe).matches;
|
|
412
431
|
r.scrollTo({
|
|
413
432
|
top: Math.max(0, r.scrollY + n - this.rules.lineFor(e)),
|
|
414
433
|
behavior: i ? "smooth" : "instant"
|
|
@@ -418,7 +437,7 @@ var de = {
|
|
|
418
437
|
let e = this.document.defaultView;
|
|
419
438
|
if (!this.isWatching && e) {
|
|
420
439
|
this.isWatching = !0;
|
|
421
|
-
for (let t of
|
|
440
|
+
for (let t of we) e.addEventListener(t, () => this.hasViewerMoved = !0, {
|
|
422
441
|
capture: !0,
|
|
423
442
|
passive: !0
|
|
424
443
|
});
|
|
@@ -426,22 +445,22 @@ var de = {
|
|
|
426
445
|
}
|
|
427
446
|
static defaultRules() {
|
|
428
447
|
return {
|
|
429
|
-
whenReady: (e) => new Promise((t) =>
|
|
448
|
+
whenReady: (e) => new Promise((t) => I.whenReady(I.lightElementOf(e), t)),
|
|
430
449
|
reveal: (e, { opensTarget: t }) => HashLanding.reveal(e, { opensTarget: t }),
|
|
431
450
|
lineFor: (e) => HashLanding.marginLine(e),
|
|
432
451
|
topOf: (e) => HashLanding.topOf(e),
|
|
433
|
-
revealFrames:
|
|
434
|
-
settleSeconds:
|
|
452
|
+
revealFrames: Te,
|
|
453
|
+
settleSeconds: De
|
|
435
454
|
};
|
|
436
455
|
}
|
|
437
456
|
static reveal(e, { opensTarget: t }) {
|
|
438
|
-
let n =
|
|
439
|
-
for (let e = n.parentElement?.closest(
|
|
440
|
-
let t =
|
|
441
|
-
t &&
|
|
457
|
+
let n = I.lightElementOf(e), r = !1;
|
|
458
|
+
for (let e = n.parentElement?.closest(P); e; e = e.parentElement?.closest(P)) {
|
|
459
|
+
let t = I.paneOf(e, n);
|
|
460
|
+
t && I.shownPane(e) !== t && (e.value = I.paneValue(e, t), r = !0);
|
|
442
461
|
}
|
|
443
|
-
let i = t ? n.closest(
|
|
444
|
-
for (let e = i; e; e = e.parentElement?.closest(
|
|
462
|
+
let i = t ? n.closest(N) : n.parentElement?.closest(N);
|
|
463
|
+
for (let e = i; e; e = e.parentElement?.closest(N)) e.getAttribute(z) === "false" && (e.removeAttribute(z), r = !0);
|
|
445
464
|
return r;
|
|
446
465
|
}
|
|
447
466
|
static topOf(e) {
|
|
@@ -455,42 +474,42 @@ var de = {
|
|
|
455
474
|
let t = e.ownerDocument.defaultView;
|
|
456
475
|
return t ? (parseFloat(t.getComputedStyle(e.ownerDocument.documentElement).scrollPaddingTop) || 0) + (parseFloat(t.getComputedStyle(e).scrollMarginTop) || 0) : 0;
|
|
457
476
|
}
|
|
458
|
-
},
|
|
477
|
+
}, Ce = Symbol.for("spell-ui:hash-landings"), R = globalThis[Ce] ??= /* @__PURE__ */ new WeakMap(), we = [
|
|
459
478
|
"wheel",
|
|
460
479
|
"touchstart",
|
|
461
480
|
"keydown",
|
|
462
481
|
"pointerdown"
|
|
463
|
-
],
|
|
482
|
+
], Te = 3, Ee = 30, De = .4, z = "open", Oe = "(prefers-reduced-motion: reduce)", B = class TocPreferences {
|
|
464
483
|
static all() {
|
|
465
|
-
let e = TocPreferences.store.get(
|
|
484
|
+
let e = TocPreferences.store.get(F.all);
|
|
466
485
|
return ve.find((t) => t === e);
|
|
467
486
|
}
|
|
468
487
|
static setAll(e) {
|
|
469
|
-
TocPreferences.store.set(
|
|
488
|
+
TocPreferences.store.set(F.all, e);
|
|
470
489
|
}
|
|
471
490
|
static foldsFor(e) {
|
|
472
|
-
let t = TocPreferences.store.get(
|
|
491
|
+
let t = TocPreferences.store.get(F.folds + e);
|
|
473
492
|
return !t || typeof t != "object" || Array.isArray(t) ? {} : Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "boolean"));
|
|
474
493
|
}
|
|
475
494
|
static setFoldsFor(e, t) {
|
|
476
|
-
TocPreferences.store.set(
|
|
495
|
+
TocPreferences.store.set(F.folds + e, Object.keys(t).length ? t : void 0);
|
|
477
496
|
}
|
|
478
497
|
static get store() {
|
|
479
|
-
return TocPreferences.made ??= new
|
|
498
|
+
return TocPreferences.made ??= new ce(F.store);
|
|
480
499
|
}
|
|
481
500
|
static made;
|
|
482
|
-
},
|
|
501
|
+
}, ke = "@layer ui.components.toc.types{:host{display:block}.ui.toc{--_ui-toc-indent:var(--ui-toc-indent,.5em);--_ui-toc-section-weight:var(--ui-toc-section-weight,bold);--_ui-toc-current-weight:var(--ui-toc-current-weight,bold);--_ui-toc-gutter:var(--ui-toc-gutter,1.25em);--_ui-toc-control-color:var(--ui-toc-control-color,var(--ui-text-muted));--_ui-toc-control-hover-color:var(--ui-toc-control-hover-color,var(--ui-link));--_ui-toc-control-hover-background:var(--ui-toc-control-hover-background,var(--ui-primary-background));--_ui-toc-head-background:var(--ui-toc-head-background,none);--_ui-toc-head-padding:var(--ui-toc-head-padding,0);--_ui-toc-head-height:var(--ui-toc-head-height,1.75em);--_ui-toc-head-gap:var(--ui-toc-head-gap,var(--ui-font-size));--_ui-toc-head-position:var(--ui-toc-head-position,static);--_ui-toc-padding:var(--ui-toc-padding,0);display:block}}@layer ui.components.toc.content{.head{min-height:var(--_ui-toc-head-height);box-sizing:border-box;position:var(--_ui-toc-head-position);z-index:1;padding:var(--_ui-toc-head-padding);background:var(--_ui-toc-head-background);align-items:center;gap:.5em;margin-block-end:var(--_ui-toc-head-gap);display:flex;inset-block-start:0}slot[name=tools]{display:contents}::slotted([slot=tools]){order:2}.toggle-room{flex:none;width:1.75em;margin-inline-start:auto}[part~=header]{--ui-header-margin-top:0;--ui-header-margin-bottom:0}.fold,.toggle-all{box-sizing:border-box;color:var(--_ui-toc-control-color);font:inherit;cursor:pointer;background:0 0;border:none;flex:none;place-items:center;padding:0;display:inline-grid}.fold:hover,.toggle-all:hover{color:var(--_ui-toc-control-hover-color)}.fold:focus-visible,.toggle-all:focus-visible{outline:2px solid var(--ui-focus-color,var(--ui-link));outline-offset:1px}.chevron,.chevrons{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;display:block}.toggle-all{border-radius:.4286em;width:1.75em;height:1.75em;margin-inline-start:auto}.toggle-all:hover{background:var(--_ui-toc-control-hover-background)}.chevrons{stroke-width:1.8px;width:1em;height:1em}.section-row{padding-inline-start:var(--_ui-toc-gutter);position:relative}.fold{width:var(--_ui-toc-gutter);border-radius:.25em;position:absolute;inset-block:0;inset-inline-start:0}.chevron{stroke-width:2px;width:.8571em;height:.8571em;transition:rotate var(--ui-duration-fast) var(--ui-ease);translate:0 -.1em}.fold[aria-expanded=true] .chevron{rotate:90deg}[part~=menu]{--ui-menu-margin:var(--_ui-toc-padding)}.section::part(item){font-weight:var(--_ui-toc-section-weight)}.entries{padding-inline-start:var(--_ui-toc-indent)}[part~=menu]>.entries{padding-inline-start:calc(var(--_ui-toc-gutter) + var(--_ui-toc-indent))}[part~=entries]{--ui-menu-margin:0}}@layer ui.components.toc.variations;@layer ui.components.toc.states{[part~=entry]:state(selected)::part(item){font-weight:var(--_ui-toc-current-weight)}}", Ae = /* @__PURE__ */ D("<ui-header>", 1), je = /* @__PURE__ */ D("<div><!><slot name=tools>"), Me = /* @__PURE__ */ D("<div><ui-menu direction=vertical appearance=text fluid>", 1), Ne = /* @__PURE__ */ D("<span aria-hidden=true>"), Pe = /* @__PURE__ */ D("<div><ui-item>", 1), Fe = /* @__PURE__ */ D("<button type=button><svg viewBox=\"0 0 16 16\"aria-hidden=true><path d=\"M6 3.5 10.5 8 6 12.5\">"), Ie = /* @__PURE__ */ D("<button type=button><svg viewBox=\"0 0 16 16\"aria-hidden=true><path>"), Le = /* @__PURE__ */ D("<ui-item padding=none-y><ui-menu direction=vertical appearance=text fluid>", 1), Re = /* @__PURE__ */ D("<ui-item>", 1), V, H, U, W, ze, Be, Ve, He, Ue, We, Ge, Ke, qe, Je, G, K, q, J, Y, X, Z, Q = class _UIToc extends (G = a, Je = [ie], qe = [ae], Ke = [g], Ge = [ee("empty")], We = [g], Ue = [te], He = [g], Ve = [g], Be = [_], ze = [_], W = [se], U = [_], H = [g], V = [re("click")], G) {
|
|
483
502
|
constructor() {
|
|
484
|
-
super(...arguments), c(K, 5, this),
|
|
503
|
+
super(...arguments), c(K, 5, this), h(this, q, c(K, 8, this, [])), c(K, 11, this), h(this, J, c(K, 12, this)), c(K, 15, this), h(this, Y, c(K, 16, this, {})), c(K, 19, this), h(this, X, c(K, 20, this)), c(K, 23, this), t(this, "frame", new i({
|
|
485
504
|
when: d,
|
|
486
505
|
run: /* @__PURE__ */ n(() => this.onFrame(), "run")
|
|
487
|
-
})), t(this, "queuedUpdate");
|
|
506
|
+
})), t(this, "queuedUpdate"), h(this, Z, c(K, 24, this)), c(K, 27, this);
|
|
488
507
|
}
|
|
489
508
|
get isEmpty() {
|
|
490
509
|
return !this.sections.length;
|
|
491
510
|
}
|
|
492
511
|
get pathInView() {
|
|
493
|
-
return
|
|
512
|
+
return I.pathTo(this.sections, this.idInView);
|
|
494
513
|
}
|
|
495
514
|
get sectionIdInView() {
|
|
496
515
|
return this.pathInView[0];
|
|
@@ -512,145 +531,151 @@ var de = {
|
|
|
512
531
|
this.handFolds = {
|
|
513
532
|
...this.handFolds,
|
|
514
533
|
[e.id]: !this.isSectionOpen(e)
|
|
515
|
-
},
|
|
534
|
+
}, B.setFoldsFor(this.path, this.handFolds);
|
|
516
535
|
}
|
|
517
536
|
toggleAll() {
|
|
518
|
-
this.allFolds = this.isAllOpen ? "collapsed" : "expanded", this.handFolds = {},
|
|
537
|
+
this.allFolds = this.isAllOpen ? "collapsed" : "expanded", this.handFolds = {}, B.setAll(this.allFolds), B.setFoldsFor(this.path, {});
|
|
519
538
|
}
|
|
520
539
|
get path() {
|
|
521
540
|
return this.domElement.ownerDocument.defaultView?.location.pathname ?? "";
|
|
522
541
|
}
|
|
523
542
|
loadFolds() {
|
|
524
|
-
this.handFolds =
|
|
543
|
+
this.handFolds = B.foldsFor(this.path), this.allFolds = B.all();
|
|
525
544
|
}
|
|
526
545
|
render() {
|
|
527
546
|
let e = this;
|
|
528
|
-
var t =
|
|
529
|
-
return
|
|
547
|
+
var t = Me(), n = t.firstChild;
|
|
548
|
+
return w(t, x(y, {
|
|
530
549
|
get when() {
|
|
531
|
-
return e.
|
|
550
|
+
return e.shownHeading || e.hasFolds;
|
|
532
551
|
},
|
|
533
552
|
get children() {
|
|
534
|
-
var t =
|
|
535
|
-
return
|
|
553
|
+
var t = je(), n = t.firstChild, r = n.nextSibling;
|
|
554
|
+
return w(t, x(y, {
|
|
536
555
|
get when() {
|
|
537
|
-
return e.
|
|
556
|
+
return e.shownHeading;
|
|
538
557
|
},
|
|
539
558
|
get children() {
|
|
540
|
-
var t =
|
|
541
|
-
return t._$owner =
|
|
542
|
-
|
|
559
|
+
var t = Ae();
|
|
560
|
+
return t._$owner = C(), w(t, () => e.shownHeading), S(() => e.partForName("header"), (e) => {
|
|
561
|
+
E(t, "part", e);
|
|
543
562
|
}), t;
|
|
544
563
|
}
|
|
545
|
-
}), n),
|
|
564
|
+
}), n), w(t, x(y, {
|
|
546
565
|
get when() {
|
|
547
566
|
return e.hasFolds;
|
|
548
567
|
},
|
|
568
|
+
get fallback() {
|
|
569
|
+
var e = Ne();
|
|
570
|
+
return S(() => T(at), (t, n) => {
|
|
571
|
+
b(e, t, n);
|
|
572
|
+
}), e;
|
|
573
|
+
},
|
|
549
574
|
get children() {
|
|
550
575
|
return e.toggleAllButton();
|
|
551
576
|
}
|
|
552
|
-
}), r), r._$owner =
|
|
553
|
-
e:
|
|
577
|
+
}), r), r._$owner = C(), S(() => ({
|
|
578
|
+
e: T(et),
|
|
554
579
|
t: e.partForName("head")
|
|
555
580
|
}), ({ e, t: n }, r) => {
|
|
556
|
-
|
|
581
|
+
b(t, e, r?.e), n !== r?.t && E(t, "part", n);
|
|
557
582
|
}), t;
|
|
558
583
|
}
|
|
559
|
-
}), n), n._$owner =
|
|
584
|
+
}), n), n._$owner = C(), w(n, x(v, {
|
|
560
585
|
get each() {
|
|
561
586
|
return e.sections;
|
|
562
587
|
},
|
|
563
588
|
children: (t) => e.section(t)
|
|
564
|
-
})),
|
|
565
|
-
e:
|
|
589
|
+
})), S(() => ({
|
|
590
|
+
e: T(e.rootClass),
|
|
566
591
|
t: e.partForName("toc"),
|
|
567
592
|
a: e.partForName("menu"),
|
|
568
593
|
o: e.menuSize,
|
|
569
594
|
i: e.translationForKey("label")
|
|
570
595
|
}), ({ e, t: r, a: i, o: a, i: o }, s) => {
|
|
571
|
-
|
|
596
|
+
b(t, e, s?.e), r !== s?.t && E(t, "part", r), i !== s?.a && E(n, "part", i), a !== s?.o && E(n, "size", a), o !== s?.i && E(n, "aria-label", o);
|
|
572
597
|
}), t;
|
|
573
598
|
}
|
|
574
599
|
section(e) {
|
|
575
600
|
let t = /* @__PURE__ */ n(() => !!e.entries.length && this.isSectionOpen(e), "isOpen"), r = this;
|
|
576
601
|
return [(() => {
|
|
577
|
-
var t =
|
|
578
|
-
return
|
|
602
|
+
var t = Pe(), n = t.firstChild;
|
|
603
|
+
return w(t, x(y, {
|
|
579
604
|
get when() {
|
|
580
605
|
return e.entries.length;
|
|
581
606
|
},
|
|
582
607
|
get children() {
|
|
583
608
|
return r.foldButton(e);
|
|
584
609
|
}
|
|
585
|
-
}), n), n._$owner =
|
|
586
|
-
e:
|
|
610
|
+
}), n), n._$owner = C(), w(n, () => e.text), S(() => ({
|
|
611
|
+
e: T(tt),
|
|
587
612
|
t: r.partForName("section-row"),
|
|
588
613
|
a: r.partForName("section"),
|
|
589
|
-
o:
|
|
614
|
+
o: T(Qe),
|
|
590
615
|
i: `#${e.id}`,
|
|
591
616
|
n: r.sectionIdInView === e.id ? "" : void 0
|
|
592
617
|
}), ({ e, t: r, a: i, o: a, i: o, n: s }, c) => {
|
|
593
|
-
|
|
618
|
+
b(t, e, c?.e), r !== c?.t && E(t, "part", r), i !== c?.a && E(n, "part", i), b(n, a, c?.o), o !== c?.i && E(n, "link", o), s !== c?.n && E(n, "selected", s);
|
|
594
619
|
}), t;
|
|
595
620
|
})(), ue(() => r.entries(e, t))];
|
|
596
621
|
}
|
|
597
622
|
foldButton(e) {
|
|
598
623
|
let t = /* @__PURE__ */ n(() => this.isSectionOpen(e), "isOpen"), r = /* @__PURE__ */ n(() => this.translationForKey(t() ? "foldSection" : "openSection", { section: e.text }), "tip"), i = this;
|
|
599
|
-
var a =
|
|
600
|
-
return a._$$click = () => i.toggleSection(e),
|
|
601
|
-
e:
|
|
624
|
+
var a = Fe(), o = a.firstChild;
|
|
625
|
+
return a._$$click = () => i.toggleSection(e), S(() => ({
|
|
626
|
+
e: T(nt),
|
|
602
627
|
t: i.partForName("fold"),
|
|
603
628
|
a: e.text,
|
|
604
629
|
o: t() ? "true" : "false",
|
|
605
630
|
i: r(),
|
|
606
|
-
n:
|
|
631
|
+
n: T(rt)
|
|
607
632
|
}), ({ e, t, a: n, o: r, i, n: s }, c) => {
|
|
608
|
-
|
|
633
|
+
b(a, e, c?.e), t !== c?.t && E(a, "part", t), n !== c?.a && E(a, "aria-label", n), r !== c?.o && E(a, "aria-expanded", r), i !== c?.i && E(a, "title", i), b(o, s, c?.n);
|
|
609
634
|
}), a;
|
|
610
635
|
}
|
|
611
636
|
toggleAllButton() {
|
|
612
637
|
let e = /* @__PURE__ */ n(() => this.translationForKey(this.isAllOpen ? "collapseAll" : "expandAll"), "label"), t = this;
|
|
613
|
-
var r =
|
|
614
|
-
return r._$$click = () => t.toggleAll(),
|
|
615
|
-
e:
|
|
638
|
+
var r = Ie(), i = r.firstChild, a = i.firstChild;
|
|
639
|
+
return r._$$click = () => t.toggleAll(), S(() => ({
|
|
640
|
+
e: T(it),
|
|
616
641
|
t: t.partForName("toggle-all"),
|
|
617
642
|
a: e(),
|
|
618
643
|
o: e(),
|
|
619
644
|
i: t.isAllOpen ? "true" : "false",
|
|
620
|
-
n:
|
|
621
|
-
s: t.isAllOpen ?
|
|
645
|
+
n: T(ot),
|
|
646
|
+
s: t.isAllOpen ? ct : st
|
|
622
647
|
}), ({ e, t, a: n, o, i: s, n: c, s: l }, u) => {
|
|
623
|
-
|
|
648
|
+
b(r, e, u?.e), t !== u?.t && E(r, "part", t), n !== u?.a && E(r, "aria-label", n), o !== u?.o && E(r, "title", o), s !== u?.i && E(r, "aria-pressed", s), b(i, c, u?.n), l !== u?.s && E(a, "d", l);
|
|
624
649
|
}), r;
|
|
625
650
|
}
|
|
626
651
|
entries(e, t) {
|
|
627
652
|
let r = /* @__PURE__ */ n(() => !!e.entries.length && (t ? t() : this.isOpenAllTheWay || this.pathInView.includes(e.id)), "isOpen"), i = this;
|
|
628
|
-
return
|
|
653
|
+
return x(y, {
|
|
629
654
|
get when() {
|
|
630
655
|
return r();
|
|
631
656
|
},
|
|
632
657
|
get children() {
|
|
633
|
-
var t =
|
|
634
|
-
return t._$owner =
|
|
658
|
+
var t = Le(), n = t.firstChild;
|
|
659
|
+
return t._$owner = C(), n._$owner = C(), w(n, x(v, {
|
|
635
660
|
get each() {
|
|
636
661
|
return e.entries;
|
|
637
662
|
},
|
|
638
663
|
children: (e) => [(() => {
|
|
639
|
-
var t =
|
|
640
|
-
return t._$owner =
|
|
664
|
+
var t = Re();
|
|
665
|
+
return t._$owner = C(), w(t, () => e.text), S(() => ({
|
|
641
666
|
e: i.partForName("entry"),
|
|
642
667
|
t: `#${e.id}`,
|
|
643
668
|
a: i.idInView === e.id ? "" : void 0
|
|
644
669
|
}), ({ e, t: n, a: r }, i) => {
|
|
645
|
-
e !== i?.e &&
|
|
670
|
+
e !== i?.e && E(t, "part", e), n !== i?.t && E(t, "link", n), r !== i?.a && E(t, "selected", r);
|
|
646
671
|
}), t;
|
|
647
672
|
})(), ue(() => i.entries(e))]
|
|
648
|
-
})),
|
|
649
|
-
e:
|
|
673
|
+
})), S(() => ({
|
|
674
|
+
e: T($e),
|
|
650
675
|
t: i.partForName("entries"),
|
|
651
676
|
a: i.menuSize
|
|
652
677
|
}), ({ e, t: r, a: i }, a) => {
|
|
653
|
-
|
|
678
|
+
b(t, e, a?.e), r !== a?.t && E(n, "part", r), i !== a?.a && E(n, "size", i);
|
|
654
679
|
}), t;
|
|
655
680
|
}
|
|
656
681
|
});
|
|
@@ -660,7 +685,7 @@ var de = {
|
|
|
660
685
|
}
|
|
661
686
|
watch() {
|
|
662
687
|
let e = this.domElement.ownerDocument, t = e.defaultView, r = new MutationObserver(() => this.schedule("rescan")), i = new ResizeObserver(() => this.schedule("follow")), a = /* @__PURE__ */ n(() => this.schedule("follow"), "onScroll"), o = /* @__PURE__ */ n(() => this.schedule("rescan"), "onShow"), s = /* @__PURE__ */ n((e) => {
|
|
663
|
-
let t =
|
|
688
|
+
let t = I.shadowHosts;
|
|
664
689
|
t && e.target.matches?.(t) && this.schedule("rescan");
|
|
665
690
|
}, "onDrawn"), c = /* @__PURE__ */ n(() => this.reveal(), "onHash");
|
|
666
691
|
this.loadFolds();
|
|
@@ -673,7 +698,7 @@ var de = {
|
|
|
673
698
|
}), d = this.scrollerElement(), d?.addEventListener("scroll", a, { passive: !0 });
|
|
674
699
|
}, "start");
|
|
675
700
|
return t.addEventListener("scroll", a, { passive: !0 }), t.addEventListener("resize", a, { passive: !0 }), t.addEventListener("hashchange", c), e.readyState === "loading" ? e.addEventListener("DOMContentLoaded", f, { once: !0 }) : u(f), () => {
|
|
676
|
-
r.disconnect(), i.disconnect(), l?.tabs?.removeEventListener(
|
|
701
|
+
r.disconnect(), i.disconnect(), l?.tabs?.removeEventListener(Ze, o), l?.root.removeEventListener($, s), d?.removeEventListener("scroll", a), e.removeEventListener("DOMContentLoaded", f), t.removeEventListener("scroll", a), t.removeEventListener("resize", a), t.removeEventListener("hashchange", c), this.frame.cancel(), this.queuedUpdate = void 0;
|
|
677
702
|
};
|
|
678
703
|
}
|
|
679
704
|
observe({ observer: e, resized: t, onShow: n, onDrawn: r }) {
|
|
@@ -682,8 +707,8 @@ var de = {
|
|
|
682
707
|
subtree: !0,
|
|
683
708
|
childList: !0,
|
|
684
709
|
attributes: !0,
|
|
685
|
-
attributeFilter:
|
|
686
|
-
}), t.observe(i.root), i.tabs?.addEventListener(
|
|
710
|
+
attributeFilter: Xe
|
|
711
|
+
}), t.observe(i.root), i.tabs?.addEventListener(Ze, n), i.root.addEventListener($, r), this.rescan(), this.reveal(), i;
|
|
687
712
|
}
|
|
688
713
|
schedule(e) {
|
|
689
714
|
e === "rescan" ? this.queuedUpdate = e : this.queuedUpdate ??= e, this.frame.ask();
|
|
@@ -693,39 +718,51 @@ var de = {
|
|
|
693
718
|
this.queuedUpdate = void 0, e === "rescan" ? this.rescan() : this.followScroll();
|
|
694
719
|
}
|
|
695
720
|
rescan() {
|
|
696
|
-
let e = this.followedContent(), t = e?.tabs ?
|
|
697
|
-
this.sections = n, this.send("ui-drawn", { ids:
|
|
721
|
+
let e = this.followedContent(), t = e?.tabs ? I.shownPane(e.tabs) : e?.layout ? I.layoutPage(e.layout) : e?.root, n = t ? I.scan(t, _UIToc.reservedIdsFor(e?.tabs)) : [];
|
|
722
|
+
this.pageTitle = e?.layout && t ? I.pageTitle(t) : void 0, this.sections = n, this.send("ui-drawn", { ids: I.flatten(n).map((e) => e.id) }), this.followScroll(n);
|
|
698
723
|
}
|
|
699
724
|
followScroll(e = this.sections) {
|
|
700
|
-
let t =
|
|
725
|
+
let t = I.current(e, this.domElement.ownerDocument, this.scrollerElement());
|
|
701
726
|
t !== this.idInView && (this.idInView = t, t && this.send("ui-scrolled-to", { value: t }));
|
|
702
727
|
}
|
|
703
728
|
reveal() {
|
|
704
729
|
let e = this.domElement.ownerDocument, t = e.defaultView.location.hash;
|
|
705
|
-
t &&
|
|
730
|
+
t && L.forDocument(e).landOnHash(t);
|
|
706
731
|
}
|
|
707
732
|
followedContent() {
|
|
708
|
-
return
|
|
733
|
+
return I.followed(this.domElement.ownerDocument, this.for || void 0, this.domElement);
|
|
709
734
|
}
|
|
710
735
|
scrollerElement() {
|
|
711
|
-
|
|
736
|
+
if (this.scroller) return this.domElement.ownerDocument.getElementById(this.scroller) ?? void 0;
|
|
737
|
+
let e = this.followedContent()?.layout;
|
|
738
|
+
return e ? I.scrollerAround(e) : void 0;
|
|
739
|
+
}
|
|
740
|
+
get shownHeading() {
|
|
741
|
+
return this.heading || this.pageTitle;
|
|
742
|
+
}
|
|
743
|
+
onLinkClick(e) {
|
|
744
|
+
if (!this.followedContent()?.layout || e.button !== 0 || e.metaKey || e.ctrlKey) return;
|
|
745
|
+
let t = e.composedPath().find((e) => e instanceof HTMLAnchorElement)?.getAttribute("href");
|
|
746
|
+
if (!t?.startsWith("#")) return;
|
|
747
|
+
let n = I.elementById(this.domElement.ownerDocument, decodeURIComponent(t.slice(1)));
|
|
748
|
+
n && (e.preventDefault(), n.scrollIntoView({ block: "start" }));
|
|
712
749
|
}
|
|
713
750
|
static reservedIdsFor(e) {
|
|
714
751
|
return e ? new Set([...e.children].map((e, t) => e.getAttribute("value") ?? String(t))) : /* @__PURE__ */ new Set();
|
|
715
752
|
}
|
|
716
753
|
};
|
|
717
|
-
K = e(G), q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), o(K, 4, "sections",
|
|
718
|
-
styleSheets: { toc:
|
|
754
|
+
K = e(G), q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), o(K, 4, "sections", Ke, Q, q), o(K, 2, "isEmpty", Ge, Q), o(K, 4, "idInView", We, Q, J), o(K, 2, "pathInView", Ue, Q), o(K, 4, "handFolds", He, Q, Y), o(K, 4, "allFolds", Ve, Q, X), o(K, 1, "toggleSection", Be, Q), o(K, 1, "toggleAll", ze, Q), o(K, 1, "watch", W, Q), o(K, 1, "followScroll", U, Q), o(K, 4, "pageTitle", H, Q, Z), o(K, 1, "onLinkClick", V, Q), o(K, 13, "vocabulary", Je, Q), o(K, 13, "elementSetup", qe, Q), s(K, Q), n(Q, "UIToc"), t(Q, "vocabulary", c(K, 28, Q, de)), c(K, 31, Q), t(Q, "elementSetup", c(K, 32, Q, {
|
|
755
|
+
styleSheets: { toc: ke },
|
|
719
756
|
delegatesFocus: !1
|
|
720
|
-
})), c(K,
|
|
721
|
-
var
|
|
757
|
+
})), c(K, 35, Q);
|
|
758
|
+
var Ye = Q, Xe = [
|
|
722
759
|
"heading",
|
|
723
760
|
"label",
|
|
724
761
|
"level",
|
|
725
762
|
"id"
|
|
726
|
-
],
|
|
763
|
+
], Ze = "ui-opened", $ = "ui-drawn", Qe = "section", $e = "entries", et = "head", tt = "section-row", nt = "fold", rt = "chevron", it = "toggle-all", at = "toggle-room", ot = "chevrons", st = "M4 3.5 8 7.5 12 3.5M4 7.5 8 11.5 12 7.5", ct = "M4 8.5 8 4.5 12 8.5M4 12.5 8 8.5 12 12.5";
|
|
727
764
|
// src/components/ui-toc/index.ts
|
|
728
|
-
le(["click"]),
|
|
729
|
-
export {
|
|
765
|
+
le(["click"]), Ye.define();
|
|
766
|
+
export { L as HashLanding, O as PageOutline, I as TocIndex, Ye as UIToc };
|
|
730
767
|
|
|
731
768
|
//# sourceMappingURL=ui-toc.js.map
|