@ixfx/components 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.d.ts +365 -143
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +2330 -826
- package/bundle/index.js.map +1 -1
- package/dist/ac-text.d.ts +2 -3
- package/dist/ac-text.d.ts.map +1 -1
- package/dist/ac-text.js +5 -5
- package/dist/ac-text.js.map +1 -1
- package/dist/{button-DgKUzE5o.js → button-DMt5XWUK.js} +6 -6
- package/dist/button-DMt5XWUK.js.map +1 -0
- package/dist/button.d.ts +3 -4
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +1 -1
- package/dist/checkbox.d.ts +3 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +3 -3
- package/dist/checkbox.js.map +1 -1
- package/dist/{colour-C3MQIjFJ-BJV-QC-3.js → colour-C3MQIjFJ-BLXg8W3U.js} +2 -2
- package/dist/{colour-C3MQIjFJ-BJV-QC-3.js.map → colour-C3MQIjFJ-BLXg8W3U.js.map} +1 -1
- package/dist/{colour-picker-Bw-AZoWx.js → colour-picker-K6zu82lm.js} +8 -8
- package/dist/colour-picker-K6zu82lm.js.map +1 -0
- package/dist/colour-picker.d.ts +2 -2
- package/dist/colour-picker.js +1 -1
- package/dist/crumbs.d.ts +4 -6
- package/dist/crumbs.d.ts.map +1 -1
- package/dist/crumbs.js +12 -12
- package/dist/crumbs.js.map +1 -1
- package/dist/data-display.d.ts +1 -2
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data-display.js +4 -5
- package/dist/data-display.js.map +1 -1
- package/dist/decorate-D7rC1gLP.js +27 -0
- package/dist/decorate-D7rC1gLP.js.map +1 -0
- package/dist/{defaults-FEZaGiYZ.js → defaults-C7elhuyJ.js} +2 -2
- package/dist/{defaults-FEZaGiYZ.js.map → defaults-C7elhuyJ.js.map} +1 -1
- package/dist/{dist-By5URG0Y.js → dist-BX0OVIm7.js} +2 -2
- package/dist/{dist-By5URG0Y.js.map → dist-BX0OVIm7.js.map} +1 -1
- package/dist/{dist-D7kJgnSE.js → dist-TAGYwaju.js} +1 -1
- package/dist/{dist-D7kJgnSE.js.map → dist-TAGYwaju.js.map} +1 -1
- package/dist/editable-label.d.ts +6 -1
- package/dist/editable-label.d.ts.map +1 -1
- package/dist/editable-label.js +51 -4
- package/dist/editable-label.js.map +1 -1
- package/dist/{hex-editor-Wd6ZtZA2.js → hex-editor-CsN_ySkH.js} +87 -87
- package/dist/hex-editor-CsN_ySkH.js.map +1 -0
- package/dist/{hex-editor-Gib1Grg2.d.ts → hex-editor-DlfoA65y.d.ts} +7 -8
- package/dist/hex-editor-DlfoA65y.d.ts.map +1 -0
- package/dist/hex.d.ts +1 -1
- package/dist/hex.js +1 -1
- package/dist/{highlight-CAjwQ4GE.js → highlight-TPbSHruI.js} +3 -3
- package/dist/highlight-TPbSHruI.js.map +1 -0
- package/dist/{icon-BR5aTIiP.js → icon-9NWTXtE1.js} +6 -7
- package/dist/icon-9NWTXtE1.js.map +1 -0
- package/dist/{icon-DQKdfR7U.d.ts → icon-CeTDJhC7.d.ts} +3 -4
- package/dist/icon-CeTDJhC7.d.ts.map +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +3 -3
- package/dist/icons.js.map +1 -1
- package/dist/{incr-search-BjCNClnC.js → incr-search-DSKKsk6w.js} +119 -117
- package/dist/incr-search-DSKKsk6w.js.map +1 -0
- package/dist/incr-search.d.ts +2 -2
- package/dist/incr-search.js +2 -2
- package/dist/{index-CPVcTTXo.d.ts → index--hrxPBkQ.d.ts} +73 -74
- package/dist/index--hrxPBkQ.d.ts.map +1 -0
- package/dist/index-B1hNR7Z9.d.ts.map +1 -1
- package/dist/{index-CpbBI3n7.d.ts → index-CnL9krsH.d.ts} +3 -4
- package/dist/index-CnL9krsH.d.ts.map +1 -0
- package/dist/{index-CQxanqXF.d.ts → index-DSlPeWLK.d.ts} +28 -29
- package/dist/index-DSlPeWLK.d.ts.map +1 -0
- package/dist/{index-C5dK8RZa.d.ts → index-DrQjA8Gs.d.ts} +3 -4
- package/dist/index-DrQjA8Gs.d.ts.map +1 -0
- package/dist/{index-C9iBN908.d.ts → index-hXFn14tM.d.ts} +32 -32
- package/dist/index-hXFn14tM.d.ts.map +1 -0
- package/dist/index.d.ts +246 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1464 -32
- package/dist/index.js.map +1 -1
- package/dist/keyboard-De_vOHLg.js.map +1 -1
- package/dist/{labelled-input-base-DS6-6C0r.js → labelled-input-base-CqPL5rKm.js} +2 -2
- package/dist/labelled-input-base-CqPL5rKm.js.map +1 -0
- package/dist/{labelled-input-base-DnRh4reU.d.ts → labelled-input-base-D-Y7agky.d.ts} +2 -3
- package/dist/labelled-input-base-D-Y7agky.d.ts.map +1 -0
- package/dist/labelled-radial-input.d.ts +4 -5
- package/dist/labelled-radial-input.d.ts.map +1 -1
- package/dist/labelled-radial-input.js +5 -5
- package/dist/labelled-radial-input.js.map +1 -1
- package/dist/labelled-range-input.d.ts +1 -1
- package/dist/labelled-range-input.js +4 -4
- package/dist/labelled-range-input.js.map +1 -1
- package/dist/led.d.ts +2 -3
- package/dist/led.d.ts.map +1 -1
- package/dist/led.js +3 -3
- package/dist/led.js.map +1 -1
- package/dist/{menu-BV6UFx_z.js → menu-DJJuCm-5.js} +55 -55
- package/dist/menu-DJJuCm-5.js.map +1 -0
- package/dist/{menu-item-DEzL_Yjk.js → menu-item-CKRfP0pN.js} +14 -14
- package/dist/menu-item-CKRfP0pN.js.map +1 -0
- package/dist/{menu-item-Cikacp4F.d.ts → menu-item-ClQF2DKN.d.ts} +7 -8
- package/dist/menu-item-ClQF2DKN.d.ts.map +1 -0
- package/dist/menu.d.ts +3 -3
- package/dist/menu.js +2 -2
- package/dist/miller.d.ts +7 -10
- package/dist/miller.d.ts.map +1 -1
- package/dist/miller.js +17 -17
- package/dist/miller.js.map +1 -1
- package/dist/narrowed-text.d.ts +2 -3
- package/dist/narrowed-text.d.ts.map +1 -1
- package/dist/narrowed-text.js +6 -6
- package/dist/narrowed-text.js.map +1 -1
- package/dist/panel.d.ts +2 -3
- package/dist/panel.d.ts.map +1 -1
- package/dist/panel.js +4 -4
- package/dist/panel.js.map +1 -1
- package/dist/plots.d.ts +1 -1
- package/dist/plots.js +1 -1
- package/dist/polar-pad.d.ts +1 -2
- package/dist/polar-pad.d.ts.map +1 -1
- package/dist/polar-pad.js +3 -3
- package/dist/polar-pad.js.map +1 -1
- package/dist/{popup-Ddx9LCzY.js → popup-ImtS9KnS.js} +1 -1
- package/dist/{popup-Ddx9LCzY.js.map → popup-ImtS9KnS.js.map} +1 -1
- package/dist/{prominence-CreDBdCs.js → prominence--ic9uWBl.js} +1 -1
- package/dist/{prominence-CreDBdCs.js.map → prominence--ic9uWBl.js.map} +1 -1
- package/dist/{radial-input-CNJ8asY2.js → radial-input-DZA6WaFu.js} +16 -16
- package/dist/radial-input-DZA6WaFu.js.map +1 -0
- package/dist/{radial-input-xSTd4kEz.d.ts → radial-input-LUSBEycd.d.ts} +2 -3
- package/dist/radial-input-LUSBEycd.d.ts.map +1 -0
- package/dist/radial-input.d.ts +1 -1
- package/dist/radial-input.js +1 -1
- package/dist/range-input.d.ts +2 -3
- package/dist/range-input.d.ts.map +1 -1
- package/dist/range-input.js +3 -3
- package/dist/range-input.js.map +1 -1
- package/dist/range.d.ts +2 -3
- package/dist/range.d.ts.map +1 -1
- package/dist/range.js +4 -4
- package/dist/range.js.map +1 -1
- package/dist/{registry-CZEB1YI9.js → registry-Q2gYQCHM.js} +1 -1
- package/dist/{registry-CZEB1YI9.js.map → registry-Q2gYQCHM.js.map} +1 -1
- package/dist/selecthorizontal.d.ts +2 -3
- package/dist/selecthorizontal.d.ts.map +1 -1
- package/dist/selecthorizontal.js +3 -3
- package/dist/selecthorizontal.js.map +1 -1
- package/dist/snap-container.d.ts +1 -2
- package/dist/snap-container.d.ts.map +1 -1
- package/dist/snap-container.js +3 -3
- package/dist/snap-container.js.map +1 -1
- package/dist/split-layout.d.ts +2 -3
- package/dist/split-layout.d.ts.map +1 -1
- package/dist/split-layout.js +6 -6
- package/dist/split-layout.js.map +1 -1
- package/dist/swipe.d.ts +1 -2
- package/dist/swipe.d.ts.map +1 -1
- package/dist/swipe.js +4 -4
- package/dist/swipe.js.map +1 -1
- package/dist/{tab-list-CFF7uSYH.d.ts → tab-list-BnqISNvO.d.ts} +5 -6
- package/dist/tab-list-BnqISNvO.d.ts.map +1 -0
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +4 -4
- package/dist/tabs.js.map +1 -1
- package/dist/tickled-controller-Cq1Va0rR.d.ts.map +1 -1
- package/dist/tickled-styles-Bg3QbcrD.js.map +1 -1
- package/dist/{timeline-DBWJsSjd.js → timeline-Cv75Th2U.js} +123 -119
- package/dist/timeline-Cv75Th2U.js.map +1 -0
- package/dist/timeline.d.ts +2 -2
- package/dist/timeline.js +1 -1
- package/dist/{tooltip-kfUBWYVB.d.ts → tooltip-CwGfb4lp.d.ts} +2 -3
- package/dist/tooltip-CwGfb4lp.d.ts.map +1 -0
- package/dist/tree-CvvKbO-f.js +1330 -0
- package/dist/tree-CvvKbO-f.js.map +1 -0
- package/dist/{tree-component-CQpoPo4s.d.ts → tree-component-D8Bg48tt.d.ts} +12 -12
- package/dist/tree-component-D8Bg48tt.d.ts.map +1 -0
- package/dist/tree.d.ts +4 -5
- package/dist/tree.d.ts.map +1 -1
- package/dist/tree.js +1 -1143
- package/dist/types-BKaqnpwx.d.ts.map +1 -1
- package/dist/{xy-axis-CIFok7MF.d.ts → xy-axis-D9uwpGTT.d.ts} +5 -6
- package/dist/xy-axis-D9uwpGTT.d.ts.map +1 -0
- package/dist/{xy-axis-BANbgrI5.js → xy-axis-DL0tfJDr.js} +13 -13
- package/dist/xy-axis-DL0tfJDr.js.map +1 -0
- package/dist/xy-pad.d.ts +1 -2
- package/dist/xy-pad.d.ts.map +1 -1
- package/dist/xy-pad.js +4 -4
- package/dist/xy-pad.js.map +1 -1
- package/package.json +17 -13
- package/dist/button-DgKUzE5o.js.map +0 -1
- package/dist/colour-picker-Bw-AZoWx.js.map +0 -1
- package/dist/decorate-BZbkqIhA.js +0 -9
- package/dist/hex-editor-Gib1Grg2.d.ts.map +0 -1
- package/dist/hex-editor-Wd6ZtZA2.js.map +0 -1
- package/dist/highlight-CAjwQ4GE.js.map +0 -1
- package/dist/icon-BR5aTIiP.js.map +0 -1
- package/dist/icon-DQKdfR7U.d.ts.map +0 -1
- package/dist/incr-search-BjCNClnC.js.map +0 -1
- package/dist/index-C5dK8RZa.d.ts.map +0 -1
- package/dist/index-C9iBN908.d.ts.map +0 -1
- package/dist/index-CPVcTTXo.d.ts.map +0 -1
- package/dist/index-CQxanqXF.d.ts.map +0 -1
- package/dist/index-CpbBI3n7.d.ts.map +0 -1
- package/dist/labelled-input-base-DS6-6C0r.js.map +0 -1
- package/dist/labelled-input-base-DnRh4reU.d.ts.map +0 -1
- package/dist/menu-BV6UFx_z.js.map +0 -1
- package/dist/menu-item-Cikacp4F.d.ts.map +0 -1
- package/dist/menu-item-DEzL_Yjk.js.map +0 -1
- package/dist/radial-input-CNJ8asY2.js.map +0 -1
- package/dist/radial-input-xSTd4kEz.d.ts.map +0 -1
- package/dist/tab-list-CFF7uSYH.d.ts.map +0 -1
- package/dist/timeline-DBWJsSjd.js.map +0 -1
- package/dist/tooltip-kfUBWYVB.d.ts.map +0 -1
- package/dist/tree-component-CQpoPo4s.d.ts.map +0 -1
- package/dist/tree-data-model-DGvRVOFY.js +0 -190
- package/dist/tree-data-model-DGvRVOFY.js.map +0 -1
- package/dist/tree.js.map +0 -1
- package/dist/xy-axis-BANbgrI5.js.map +0 -1
- package/dist/xy-axis-CIFok7MF.d.ts.map +0 -1
- /package/dist/{interaction-CQDQJf2Q.js → interaction-DG7X1rhI.js} +0 -0
package/bundle/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import "@clinth/vcanvas";
|
|
|
7
7
|
* Copyright 2019 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
9
|
*/
|
|
10
|
-
const t$
|
|
10
|
+
const t$5 = globalThis, e$8 = t$5.ShadowRoot && (void 0 === t$5.ShadyCSS || t$5.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$3 = Symbol(), o$7 = /* @__PURE__ */ new WeakMap();
|
|
11
11
|
var n$5 = class {
|
|
12
12
|
constructor(t, e, o) {
|
|
13
13
|
if (this._$cssResult$ = !0, o !== s$3) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -26,7 +26,7 @@ var n$5 = class {
|
|
|
26
26
|
return this.cssText;
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
const r$5 = (t) => new n$5("string" == typeof t ? t : t + "", void 0, s$3), i$
|
|
29
|
+
const r$5 = (t) => new n$5("string" == typeof t ? t : t + "", void 0, s$3), i$7 = (t, ...e) => {
|
|
30
30
|
return new n$5(1 === t.length ? t[0] : e.reduce((e, s, o) => e + ((t) => {
|
|
31
31
|
if (!0 === t._$cssResult$) return t.cssText;
|
|
32
32
|
if ("number" == typeof t) return t;
|
|
@@ -35,7 +35,7 @@ const r$5 = (t) => new n$5("string" == typeof t ? t : t + "", void 0, s$3), i$6
|
|
|
35
35
|
}, S$1 = (s, o) => {
|
|
36
36
|
if (e$8) s.adoptedStyleSheets = o.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
37
37
|
else for (const e of o) {
|
|
38
|
-
const o = document.createElement("style"), n = t$
|
|
38
|
+
const o = document.createElement("style"), n = t$5.litNonce;
|
|
39
39
|
void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
|
|
40
40
|
}
|
|
41
41
|
}, c$4 = e$8 ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((t) => {
|
|
@@ -49,7 +49,7 @@ const r$5 = (t) => new n$5("string" == typeof t ? t : t + "", void 0, s$3), i$6
|
|
|
49
49
|
* @license
|
|
50
50
|
* Copyright 2017 Google LLC
|
|
51
51
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
52
|
-
*/ const { is: i$
|
|
52
|
+
*/ const { is: i$6, defineProperty: e$7, getOwnPropertyDescriptor: h$2, getOwnPropertyNames: r$4, getOwnPropertySymbols: o$6, getPrototypeOf: n$4 } = Object, a$1 = globalThis, c$3 = a$1.trustedTypes, l$2 = c$3 ? c$3.emptyScript : "", p$2 = a$1.reactiveElementPolyfillSupport, d$2 = (t, s) => t, u$3 = {
|
|
53
53
|
toAttribute(t, s) {
|
|
54
54
|
switch (s) {
|
|
55
55
|
case Boolean:
|
|
@@ -78,7 +78,7 @@ const r$5 = (t) => new n$5("string" == typeof t ? t : t + "", void 0, s$3), i$6
|
|
|
78
78
|
}
|
|
79
79
|
return i;
|
|
80
80
|
}
|
|
81
|
-
}, f$2 = (t, s) => !i$
|
|
81
|
+
}, f$2 = (t, s) => !i$6(t, s), b$1 = {
|
|
82
82
|
attribute: !0,
|
|
83
83
|
type: String,
|
|
84
84
|
converter: u$3,
|
|
@@ -274,18 +274,17 @@ var y$1 = class extends HTMLElement {
|
|
|
274
274
|
};
|
|
275
275
|
y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$2("elementProperties")] = /* @__PURE__ */ new Map(), y$1[d$2("finalized")] = /* @__PURE__ */ new Map(), p$2?.({ ReactiveElement: y$1 }), (a$1.reactiveElementVersions ??= []).push("2.1.2");
|
|
276
276
|
//#endregion
|
|
277
|
-
//#region node_modules/.pnpm/lit-html@3.3.
|
|
277
|
+
//#region node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/lit-html.js
|
|
278
278
|
/**
|
|
279
279
|
* @license
|
|
280
280
|
* Copyright 2017 Google LLC
|
|
281
281
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
282
282
|
*/
|
|
283
|
-
const t$
|
|
283
|
+
const t$4 = globalThis, i$5 = (t) => t, s$2 = t$4.trustedTypes, e$6 = s$2 ? s$2.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, h$1 = "$lit$", o$5 = `lit$${Math.random().toFixed(9).slice(2)}$`, n$3 = "?" + o$5, r$3 = `<${n$3}>`, l$1 = document, c$2 = () => l$1.createComment(""), a = (t) => null === t || "object" != typeof t && "function" != typeof t, u$2 = Array.isArray, d$1 = (t) => u$2(t) || "function" == typeof t?.[Symbol.iterator], f$1 = "[ \n\f\r]", v$1 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _ = /-->/g, m$1 = />/g, p$1 = RegExp(`>|${f$1}(?:([^\\s"'>=/]+)(${f$1}*=${f$1}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), g = /'/g, $ = /"/g, y = /^(?:script|style|textarea|title)$/i, x = (t) => (i, ...s) => ({
|
|
284
284
|
_$litType$: t,
|
|
285
285
|
strings: i,
|
|
286
286
|
values: s
|
|
287
287
|
}), b = x(1), w = x(2);
|
|
288
|
-
x(3);
|
|
289
288
|
const E = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), C = /* @__PURE__ */ new WeakMap(), P = l$1.createTreeWalker(l$1, 129);
|
|
290
289
|
function V(t, i) {
|
|
291
290
|
if (!u$2(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
@@ -443,8 +442,8 @@ var k = class k {
|
|
|
443
442
|
}
|
|
444
443
|
_$AR(t = this._$AA.nextSibling, s) {
|
|
445
444
|
for (this._$AP?.(!1, !0, s); t !== this._$AB;) {
|
|
446
|
-
const s = i$
|
|
447
|
-
i$
|
|
445
|
+
const s = i$5(t).nextSibling;
|
|
446
|
+
i$5(t).remove(), t = s;
|
|
448
447
|
}
|
|
449
448
|
}
|
|
450
449
|
setConnected(t) {
|
|
@@ -531,8 +530,8 @@ const j$1 = {
|
|
|
531
530
|
U: z,
|
|
532
531
|
B: I,
|
|
533
532
|
F: Z
|
|
534
|
-
}, B = t$
|
|
535
|
-
B?.(S, k), (t$
|
|
533
|
+
}, B = t$4.litHtmlPolyfillSupport;
|
|
534
|
+
B?.(S, k), (t$4.litHtmlVersions ??= []).push("3.3.3");
|
|
536
535
|
const D = (t, i, s) => {
|
|
537
536
|
const e = s?.renderBefore ?? i;
|
|
538
537
|
let h = e._$litPart$;
|
|
@@ -549,7 +548,7 @@ const D = (t, i, s) => {
|
|
|
549
548
|
* Copyright 2017 Google LLC
|
|
550
549
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
551
550
|
*/ const s$1 = globalThis;
|
|
552
|
-
var i$
|
|
551
|
+
var i$4 = class extends y$1 {
|
|
553
552
|
constructor() {
|
|
554
553
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
555
554
|
}
|
|
@@ -571,23 +570,11 @@ var i$3 = class extends y$1 {
|
|
|
571
570
|
return E;
|
|
572
571
|
}
|
|
573
572
|
};
|
|
574
|
-
i$
|
|
573
|
+
i$4._$litElement$ = !0, i$4["finalized"] = !0, s$1.litElementHydrateSupport?.({ LitElement: i$4 });
|
|
575
574
|
const o$4 = s$1.litElementPolyfillSupport;
|
|
576
|
-
o$4?.({ LitElement: i$
|
|
575
|
+
o$4?.({ LitElement: i$4 });
|
|
577
576
|
(s$1.litElementVersions ??= []).push("4.2.2");
|
|
578
577
|
//#endregion
|
|
579
|
-
//#region node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
580
|
-
/**
|
|
581
|
-
* @license
|
|
582
|
-
* Copyright 2017 Google LLC
|
|
583
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
584
|
-
*/
|
|
585
|
-
const t$4 = (t) => (e, o) => {
|
|
586
|
-
void 0 !== o ? o.addInitializer(() => {
|
|
587
|
-
customElements.define(t, e);
|
|
588
|
-
}) : customElements.define(t, e);
|
|
589
|
-
};
|
|
590
|
-
//#endregion
|
|
591
578
|
//#region node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js
|
|
592
579
|
/**
|
|
593
580
|
* @license
|
|
@@ -750,12 +737,12 @@ function buildHighlightTargets(root, itemSelector, positionsByItem, getItem, get
|
|
|
750
737
|
}
|
|
751
738
|
return targets;
|
|
752
739
|
}
|
|
753
|
-
|
|
740
|
+
function findTextNode(element, expectedText) {
|
|
754
741
|
for (const node of element.childNodes) if (node.nodeType === Node.TEXT_NODE) {
|
|
755
742
|
if (expectedText === void 0 || node.textContent === expectedText) return node;
|
|
756
743
|
}
|
|
757
744
|
return null;
|
|
758
|
-
}
|
|
745
|
+
}
|
|
759
746
|
//#endregion
|
|
760
747
|
//#region src/interaction/tickled-controller.ts
|
|
761
748
|
/**
|
|
@@ -1018,7 +1005,7 @@ var TickledController = class TickledController {
|
|
|
1018
1005
|
* }
|
|
1019
1006
|
* ```
|
|
1020
1007
|
*/
|
|
1021
|
-
const tickledStyles = i$
|
|
1008
|
+
const tickledStyles = i$7`
|
|
1022
1009
|
/**
|
|
1023
1010
|
* No suppression needed - tickled styling is always active.
|
|
1024
1011
|
*/
|
|
@@ -1030,7 +1017,7 @@ const tickledStyles = i$6`
|
|
|
1030
1017
|
* Components should import this in addition to `tickledStyles` and can override
|
|
1031
1018
|
* CSS variables to customize appearance.
|
|
1032
1019
|
*/
|
|
1033
|
-
const tickledItemStyles = i$
|
|
1020
|
+
const tickledItemStyles = i$7`
|
|
1034
1021
|
:host {
|
|
1035
1022
|
--item-bg: transparent;
|
|
1036
1023
|
--item-bg-tickled: rgba(0, 0, 0, 0.06);
|
|
@@ -1080,7 +1067,23 @@ const tickledItemStyles = i$6`
|
|
|
1080
1067
|
}
|
|
1081
1068
|
`;
|
|
1082
1069
|
//#endregion
|
|
1083
|
-
//#region
|
|
1070
|
+
//#region src/util/custom-elements.ts
|
|
1071
|
+
function getRegistry() {
|
|
1072
|
+
if (typeof customElements === `undefined`) return void 0;
|
|
1073
|
+
return customElements;
|
|
1074
|
+
}
|
|
1075
|
+
function safeDefine(name, ctor) {
|
|
1076
|
+
const registry = getRegistry();
|
|
1077
|
+
if (!registry) return;
|
|
1078
|
+
if (registry.get(name) === void 0) registry.define(name, ctor);
|
|
1079
|
+
}
|
|
1080
|
+
function safeCustomElement(name) {
|
|
1081
|
+
return (ctor) => {
|
|
1082
|
+
safeDefine(name, ctor);
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
//#endregion
|
|
1086
|
+
//#region node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive.js
|
|
1084
1087
|
/**
|
|
1085
1088
|
* @license
|
|
1086
1089
|
* Copyright 2017 Google LLC
|
|
@@ -1097,7 +1100,7 @@ const t$2 = {
|
|
|
1097
1100
|
_$litDirective$: t,
|
|
1098
1101
|
values: e
|
|
1099
1102
|
});
|
|
1100
|
-
var i$
|
|
1103
|
+
var i$3 = class {
|
|
1101
1104
|
constructor(t) {}
|
|
1102
1105
|
get _$AU() {
|
|
1103
1106
|
return this._$AM._$AU;
|
|
@@ -1113,43 +1116,12 @@ var i$2 = class {
|
|
|
1113
1116
|
}
|
|
1114
1117
|
};
|
|
1115
1118
|
//#endregion
|
|
1116
|
-
//#region node_modules/.pnpm/lit-html@3.3.
|
|
1117
|
-
/**
|
|
1118
|
-
* @license
|
|
1119
|
-
* Copyright 2018 Google LLC
|
|
1120
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1121
|
-
*/ const n$1 = "important", i$1 = " !" + n$1, o$1 = e$3(class extends i$2 {
|
|
1122
|
-
constructor(t) {
|
|
1123
|
-
if (super(t), t.type !== t$2.ATTRIBUTE || "style" !== t.name || t.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
1124
|
-
}
|
|
1125
|
-
render(t) {
|
|
1126
|
-
return Object.keys(t).reduce((e, r) => {
|
|
1127
|
-
const s = t[r];
|
|
1128
|
-
return null == s ? e : e + `${r = r.includes("-") ? r : r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
|
|
1129
|
-
}, "");
|
|
1130
|
-
}
|
|
1131
|
-
update(e, [r]) {
|
|
1132
|
-
const { style: s } = e.element;
|
|
1133
|
-
if (void 0 === this.ft) return this.ft = new Set(Object.keys(r)), this.render(r);
|
|
1134
|
-
for (const t of this.ft) r[t] ?? (this.ft.delete(t), t.includes("-") ? s.removeProperty(t) : s[t] = null);
|
|
1135
|
-
for (const t in r) {
|
|
1136
|
-
const e = r[t];
|
|
1137
|
-
if (null != e) {
|
|
1138
|
-
this.ft.add(t);
|
|
1139
|
-
const r = "string" == typeof e && e.endsWith(i$1);
|
|
1140
|
-
t.includes("-") || r ? s.setProperty(t, r ? e.slice(0, -11) : e, r ? n$1 : "") : s[t] = e;
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
return E;
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
|
-
//#endregion
|
|
1147
|
-
//#region node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/unsafe-html.js
|
|
1119
|
+
//#region node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/unsafe-html.js
|
|
1148
1120
|
/**
|
|
1149
1121
|
* @license
|
|
1150
1122
|
* Copyright 2017 Google LLC
|
|
1151
1123
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1152
|
-
*/ var e$2 = class extends i$
|
|
1124
|
+
*/ var e$2 = class extends i$3 {
|
|
1153
1125
|
constructor(i) {
|
|
1154
1126
|
if (super(i), this.it = A, i.type !== t$2.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
1155
1127
|
}
|
|
@@ -1168,7 +1140,7 @@ var i$2 = class {
|
|
|
1168
1140
|
}
|
|
1169
1141
|
};
|
|
1170
1142
|
e$2.directiveName = "unsafeHTML", e$2.resultType = 1;
|
|
1171
|
-
const o = e$3(e$2);
|
|
1143
|
+
const o$1 = e$3(e$2);
|
|
1172
1144
|
//#endregion
|
|
1173
1145
|
//#region src/icons/registry.ts
|
|
1174
1146
|
const _registry = /* @__PURE__ */ new Map();
|
|
@@ -1188,7 +1160,7 @@ function svgToDataUri(svg) {
|
|
|
1188
1160
|
return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
|
1189
1161
|
}
|
|
1190
1162
|
//#endregion
|
|
1191
|
-
//#region \0@oxc-project+runtime@0.
|
|
1163
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/decorate.js
|
|
1192
1164
|
function __decorate(decorators, target, key, desc) {
|
|
1193
1165
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1194
1166
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1197,7 +1169,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
1197
1169
|
}
|
|
1198
1170
|
//#endregion
|
|
1199
1171
|
//#region src/icons/icon.ts
|
|
1200
|
-
let IxfxIconElement = class IxfxIconElement extends i$
|
|
1172
|
+
let IxfxIconElement = class IxfxIconElement extends i$4 {
|
|
1201
1173
|
constructor(..._args) {
|
|
1202
1174
|
super(..._args);
|
|
1203
1175
|
this.name = ``;
|
|
@@ -1226,7 +1198,7 @@ let IxfxIconElement = class IxfxIconElement extends i$3 {
|
|
|
1226
1198
|
class="icon-wrapper"
|
|
1227
1199
|
aria-hidden=${hasLabel ? A : `true`}
|
|
1228
1200
|
aria-label=${hasLabel ? this.label : A}
|
|
1229
|
-
>${o(svg)}</span>
|
|
1201
|
+
>${o$1(svg)}</span>
|
|
1230
1202
|
`;
|
|
1231
1203
|
}
|
|
1232
1204
|
updated(changed) {
|
|
@@ -1235,7 +1207,7 @@ let IxfxIconElement = class IxfxIconElement extends i$3 {
|
|
|
1235
1207
|
else this.style.removeProperty(`--rotate`);
|
|
1236
1208
|
}
|
|
1237
1209
|
static {
|
|
1238
|
-
this.styles = i$
|
|
1210
|
+
this.styles = i$7`
|
|
1239
1211
|
:host {
|
|
1240
1212
|
display: inline-flex;
|
|
1241
1213
|
align-items: center;
|
|
@@ -1282,14 +1254,14 @@ __decorate([n$2({
|
|
|
1282
1254
|
})], IxfxIconElement.prototype, "prominence", void 0);
|
|
1283
1255
|
__decorate([n$2({
|
|
1284
1256
|
type: String,
|
|
1285
|
-
attribute:
|
|
1257
|
+
attribute: `rotate`,
|
|
1286
1258
|
reflect: true
|
|
1287
1259
|
})], IxfxIconElement.prototype, "rotate", void 0);
|
|
1288
|
-
IxfxIconElement = __decorate([
|
|
1260
|
+
IxfxIconElement = __decorate([safeCustomElement(`ixfx-icon`)], IxfxIconElement);
|
|
1289
1261
|
//#endregion
|
|
1290
1262
|
//#region src/ac-text/ac-text.ts
|
|
1291
1263
|
const HIGHLIGHT_KEY$1 = `ac-text-highlight`;
|
|
1292
|
-
function makeLruCache(maxSize) {
|
|
1264
|
+
function makeLruCache$1(maxSize) {
|
|
1293
1265
|
const map = /* @__PURE__ */ new Map();
|
|
1294
1266
|
return {
|
|
1295
1267
|
get: (key) => map.get(key),
|
|
@@ -1302,7 +1274,7 @@ function makeLruCache(maxSize) {
|
|
|
1302
1274
|
clear: () => map.clear()
|
|
1303
1275
|
};
|
|
1304
1276
|
}
|
|
1305
|
-
let AcTextElement = class AcTextElement extends i$
|
|
1277
|
+
let AcTextElement = class AcTextElement extends i$4 {
|
|
1306
1278
|
#cache;
|
|
1307
1279
|
#debounceTimer;
|
|
1308
1280
|
#abortController;
|
|
@@ -1321,7 +1293,7 @@ let AcTextElement = class AcTextElement extends i$3 {
|
|
|
1321
1293
|
id: i,
|
|
1322
1294
|
enabled: true
|
|
1323
1295
|
})) });
|
|
1324
|
-
this.#cache = makeLruCache(20);
|
|
1296
|
+
this.#cache = makeLruCache$1(20);
|
|
1325
1297
|
this.#onFocus = () => {
|
|
1326
1298
|
this._isOpen = true;
|
|
1327
1299
|
if (this._query.trim()) this.#triggerQuery(this._query);
|
|
@@ -1396,7 +1368,7 @@ let AcTextElement = class AcTextElement extends i$3 {
|
|
|
1396
1368
|
e.preventDefault();
|
|
1397
1369
|
this.#selectItem(item);
|
|
1398
1370
|
};
|
|
1399
|
-
this.#cache = makeLruCache(this.cacheSize);
|
|
1371
|
+
this.#cache = makeLruCache$1(this.cacheSize);
|
|
1400
1372
|
}
|
|
1401
1373
|
disconnectedCallback() {
|
|
1402
1374
|
super.disconnectedCallback();
|
|
@@ -1405,7 +1377,7 @@ let AcTextElement = class AcTextElement extends i$3 {
|
|
|
1405
1377
|
}
|
|
1406
1378
|
updated(changedProps) {
|
|
1407
1379
|
if (changedProps.has(`completionProvider`)) this.#cache.clear();
|
|
1408
|
-
if (changedProps.has(`cacheSize`)) this.#cache = makeLruCache(this.cacheSize);
|
|
1380
|
+
if (changedProps.has(`cacheSize`)) this.#cache = makeLruCache$1(this.cacheSize);
|
|
1409
1381
|
if (changedProps.has(`value`)) {
|
|
1410
1382
|
const input = this.shadowRoot?.querySelector(`input`);
|
|
1411
1383
|
if (!input || document.activeElement !== input) this._query = this.value;
|
|
@@ -1600,7 +1572,7 @@ let AcTextElement = class AcTextElement extends i$3 {
|
|
|
1600
1572
|
`;
|
|
1601
1573
|
}
|
|
1602
1574
|
static {
|
|
1603
|
-
this.styles = [tickledStyles, i$
|
|
1575
|
+
this.styles = [tickledStyles, i$7`
|
|
1604
1576
|
:host {
|
|
1605
1577
|
display: block;
|
|
1606
1578
|
position: relative;
|
|
@@ -1760,7 +1732,935 @@ __decorate([r$1()], AcTextElement.prototype, "_query", void 0);
|
|
|
1760
1732
|
__decorate([r$1()], AcTextElement.prototype, "_results", void 0);
|
|
1761
1733
|
__decorate([r$1()], AcTextElement.prototype, "_isOpen", void 0);
|
|
1762
1734
|
__decorate([r$1()], AcTextElement.prototype, "_isLoading", void 0);
|
|
1763
|
-
AcTextElement = __decorate([
|
|
1735
|
+
AcTextElement = __decorate([safeCustomElement(`ixfx-ac-text`)], AcTextElement);
|
|
1736
|
+
//#endregion
|
|
1737
|
+
//#region src/incr-search/fuzzy.ts
|
|
1738
|
+
function defaultSelector(item) {
|
|
1739
|
+
if (typeof item === `string`) return item;
|
|
1740
|
+
const r = item;
|
|
1741
|
+
if (typeof r.label === `string`) return r.label;
|
|
1742
|
+
if (typeof r.key === `string`) return r.key;
|
|
1743
|
+
if (typeof r.value === `string`) return r.value;
|
|
1744
|
+
return String(item);
|
|
1745
|
+
}
|
|
1746
|
+
function createFuzzySearch(items, options = {}) {
|
|
1747
|
+
const fzf = new Fzf(items, {
|
|
1748
|
+
selector: options.selector ?? defaultSelector,
|
|
1749
|
+
...options.fzf ?? {}
|
|
1750
|
+
});
|
|
1751
|
+
const find = (query) => {
|
|
1752
|
+
if (!query.trim()) return items.map((item) => ({
|
|
1753
|
+
item,
|
|
1754
|
+
positions: /* @__PURE__ */ new Set(),
|
|
1755
|
+
score: 0
|
|
1756
|
+
}));
|
|
1757
|
+
return fzf.find(query).map((r) => ({
|
|
1758
|
+
item: r.item,
|
|
1759
|
+
positions: r.positions,
|
|
1760
|
+
score: r.score
|
|
1761
|
+
}));
|
|
1762
|
+
};
|
|
1763
|
+
return {
|
|
1764
|
+
find,
|
|
1765
|
+
items
|
|
1766
|
+
};
|
|
1767
|
+
}
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region src/incr-search/ac-adapter.ts
|
|
1770
|
+
/**
|
|
1771
|
+
* Creates an ixfx-ac-text-compatible `completionProvider` function from a
|
|
1772
|
+
* static item list. Uses synchronous fuzzy search wrapped in a Promise so it
|
|
1773
|
+
* fits the async provider signature.
|
|
1774
|
+
*
|
|
1775
|
+
* Each returned item has `positions` populated with matched character indices,
|
|
1776
|
+
* which `ixfx-ac-text` uses to render CSS Custom Highlights on the label.
|
|
1777
|
+
*
|
|
1778
|
+
* Empty query returns all items in original order (no positions).
|
|
1779
|
+
* A cancelled signal causes the returned promise to reject with an AbortError.
|
|
1780
|
+
*/
|
|
1781
|
+
function createAcCompletionProvider(items, options = {}) {
|
|
1782
|
+
const fuzzy = createFuzzySearch(items, { selector: options.selector ?? ((item) => item.label) });
|
|
1783
|
+
return (query, signal) => new Promise((resolve, reject) => {
|
|
1784
|
+
if (signal.aborted) {
|
|
1785
|
+
reject(new DOMException(`Aborted`, `AbortError`));
|
|
1786
|
+
return;
|
|
1787
|
+
}
|
|
1788
|
+
const results = fuzzy.find(query).map((r) => ({
|
|
1789
|
+
...r.item,
|
|
1790
|
+
positions: r.positions
|
|
1791
|
+
}));
|
|
1792
|
+
if (signal.aborted) {
|
|
1793
|
+
reject(new DOMException(`Aborted`, `AbortError`));
|
|
1794
|
+
return;
|
|
1795
|
+
}
|
|
1796
|
+
resolve(results);
|
|
1797
|
+
});
|
|
1798
|
+
}
|
|
1799
|
+
//#endregion
|
|
1800
|
+
//#region src/incr-search/incr-search.ts
|
|
1801
|
+
function buildState(results, query) {
|
|
1802
|
+
const positionsByItem = /* @__PURE__ */ new Map();
|
|
1803
|
+
for (const r of results) positionsByItem.set(r.item, r.positions);
|
|
1804
|
+
return Object.freeze({
|
|
1805
|
+
query,
|
|
1806
|
+
results: Object.freeze([...results]),
|
|
1807
|
+
positionsByItem
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
function createIncrSearch(options = {}) {
|
|
1811
|
+
let items = options.items ?? [];
|
|
1812
|
+
let query = ``;
|
|
1813
|
+
let fuzzy = createFuzzySearch(items, {
|
|
1814
|
+
selector: options.selector,
|
|
1815
|
+
fzf: options.fzf
|
|
1816
|
+
});
|
|
1817
|
+
let state = buildState(fuzzy.find(query), query);
|
|
1818
|
+
let disposed = false;
|
|
1819
|
+
const observers = /* @__PURE__ */ new Set();
|
|
1820
|
+
if (options.onChange) observers.add(options.onChange);
|
|
1821
|
+
const notify = (s) => {
|
|
1822
|
+
for (const cb of observers) cb(s);
|
|
1823
|
+
};
|
|
1824
|
+
const run = async (q, signal) => {
|
|
1825
|
+
await Promise.resolve();
|
|
1826
|
+
if (signal?.aborted || disposed) return state;
|
|
1827
|
+
const results = fuzzy.find(q);
|
|
1828
|
+
if (signal?.aborted || disposed) return state;
|
|
1829
|
+
state = buildState(results, q);
|
|
1830
|
+
notify(state);
|
|
1831
|
+
return state;
|
|
1832
|
+
};
|
|
1833
|
+
return {
|
|
1834
|
+
get state() {
|
|
1835
|
+
return state;
|
|
1836
|
+
},
|
|
1837
|
+
async setItems(newItems, signal) {
|
|
1838
|
+
items = newItems;
|
|
1839
|
+
fuzzy = createFuzzySearch(items, {
|
|
1840
|
+
selector: options.selector,
|
|
1841
|
+
fzf: options.fzf
|
|
1842
|
+
});
|
|
1843
|
+
await run(query, signal);
|
|
1844
|
+
},
|
|
1845
|
+
async setQuery(q, signal) {
|
|
1846
|
+
query = q;
|
|
1847
|
+
return run(q, signal);
|
|
1848
|
+
},
|
|
1849
|
+
async clearQuery() {
|
|
1850
|
+
query = ``;
|
|
1851
|
+
await run(``, void 0);
|
|
1852
|
+
},
|
|
1853
|
+
onChange(cb) {
|
|
1854
|
+
observers.add(cb);
|
|
1855
|
+
cb(state);
|
|
1856
|
+
return () => {
|
|
1857
|
+
observers.delete(cb);
|
|
1858
|
+
};
|
|
1859
|
+
},
|
|
1860
|
+
dispose() {
|
|
1861
|
+
disposed = true;
|
|
1862
|
+
observers.clear();
|
|
1863
|
+
items = [];
|
|
1864
|
+
}
|
|
1865
|
+
};
|
|
1866
|
+
}
|
|
1867
|
+
//#endregion
|
|
1868
|
+
//#region src/incr-search/controller-tree.ts
|
|
1869
|
+
const DEFAULT_HIGHLIGHT_KEY = `incr-search-highlight`;
|
|
1870
|
+
/**
|
|
1871
|
+
* Incremental-search controller for any component implementing `TreeSearchHost`
|
|
1872
|
+
* (i.e. `ixfx-tree-list`, `ixfx-miller-list`, `ixfx-crumb-navigation`).
|
|
1873
|
+
*
|
|
1874
|
+
* Replaces the previous separate `IncrSearchTreeController` / `IncrSearchMillerController`
|
|
1875
|
+
* classes — the unified `TreeFilterPredicate` (with depth) means one implementation works
|
|
1876
|
+
* for all tree-like components.
|
|
1877
|
+
*
|
|
1878
|
+
* @example Using with ixfx-tree-list:
|
|
1879
|
+
* ```typescript
|
|
1880
|
+
* const ctrl = new IncrSearchTreeController(myTreeList, {
|
|
1881
|
+
* selector: item => item.node.item.label,
|
|
1882
|
+
* });
|
|
1883
|
+
* ctrl.connect();
|
|
1884
|
+
* ```
|
|
1885
|
+
*
|
|
1886
|
+
* @example Using with ixfx-miller-list (different label selector):
|
|
1887
|
+
* ```typescript
|
|
1888
|
+
* const ctrl = new IncrSearchTreeController(myMillerList, {
|
|
1889
|
+
* selector: item => item.node.item.label,
|
|
1890
|
+
* labelSelector: '.label',
|
|
1891
|
+
* });
|
|
1892
|
+
* ctrl.connect();
|
|
1893
|
+
* ```
|
|
1894
|
+
*/
|
|
1895
|
+
var IncrSearchTreeController = class {
|
|
1896
|
+
#el;
|
|
1897
|
+
#opts;
|
|
1898
|
+
#search;
|
|
1899
|
+
#unsub;
|
|
1900
|
+
#labelMap = /* @__PURE__ */ new Map();
|
|
1901
|
+
constructor(el, opts) {
|
|
1902
|
+
this.#el = el;
|
|
1903
|
+
this.#opts = opts;
|
|
1904
|
+
this.#search = createIncrSearch({
|
|
1905
|
+
selector: opts.selector,
|
|
1906
|
+
fzf: opts.fzf
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
connect() {
|
|
1910
|
+
this.disconnect();
|
|
1911
|
+
const items = this.#el.getNodes();
|
|
1912
|
+
for (const item of items) this.#labelMap.set(this.#opts.selector(item), item);
|
|
1913
|
+
this.#search.setItems(items);
|
|
1914
|
+
if (this.#opts.input) {
|
|
1915
|
+
this.#opts.input.addEventListener(`input`, this.#onInput);
|
|
1916
|
+
this.#opts.input.addEventListener(`keydown`, this.#onKeydown);
|
|
1917
|
+
}
|
|
1918
|
+
this.#unsub = this.#search.onChange((state) => this.#onStateChange(state));
|
|
1919
|
+
}
|
|
1920
|
+
disconnect() {
|
|
1921
|
+
if (this.#unsub) {
|
|
1922
|
+
this.#unsub();
|
|
1923
|
+
this.#unsub = void 0;
|
|
1924
|
+
}
|
|
1925
|
+
if (this.#opts.input) {
|
|
1926
|
+
this.#opts.input.removeEventListener(`input`, this.#onInput);
|
|
1927
|
+
this.#opts.input.removeEventListener(`keydown`, this.#onKeydown);
|
|
1928
|
+
}
|
|
1929
|
+
this.#el.filterPredicate = void 0;
|
|
1930
|
+
clearHighlights({ key: this.#opts.highlightKey ?? DEFAULT_HIGHLIGHT_KEY });
|
|
1931
|
+
this.#labelMap.clear();
|
|
1932
|
+
}
|
|
1933
|
+
async setQuery(query) {
|
|
1934
|
+
await this.#search.setQuery(query);
|
|
1935
|
+
}
|
|
1936
|
+
async clearQuery() {
|
|
1937
|
+
await this.#search.clearQuery();
|
|
1938
|
+
}
|
|
1939
|
+
#onInput = () => {
|
|
1940
|
+
const value = this.#opts.input?.value ?? ``;
|
|
1941
|
+
this.setQuery(value);
|
|
1942
|
+
};
|
|
1943
|
+
#onKeydown = (e) => {
|
|
1944
|
+
if (e.key === `Escape` && this.#opts.input) {
|
|
1945
|
+
this.#opts.input.value = ``;
|
|
1946
|
+
this.clearQuery();
|
|
1947
|
+
}
|
|
1948
|
+
};
|
|
1949
|
+
#onStateChange(state) {
|
|
1950
|
+
const matched = new Set(state.results.map((r) => r.item.node.item.key));
|
|
1951
|
+
const hasQuery = state.query.trim().length > 0;
|
|
1952
|
+
this.#el.filterPredicate = hasQuery && matched.size > 0 ? (node, _depth) => matched.has(node.item.key) : void 0;
|
|
1953
|
+
const key = this.#opts.highlightKey ?? DEFAULT_HIGHLIGHT_KEY;
|
|
1954
|
+
if (!this.#el.shadowRoot) return;
|
|
1955
|
+
if (!state.query.trim()) {
|
|
1956
|
+
clearHighlights({ key });
|
|
1957
|
+
return;
|
|
1958
|
+
}
|
|
1959
|
+
const labelSelector = this.#opts.labelSelector ?? `.tree-label`;
|
|
1960
|
+
applyHighlights(buildHighlightTargets(this.#el.shadowRoot, labelSelector, state.positionsByItem, (labelEl) => {
|
|
1961
|
+
const text = labelEl.textContent ?? ``;
|
|
1962
|
+
return this.#labelMap.get(text);
|
|
1963
|
+
}, (labelEl) => labelEl.textContent ?? ``), { key });
|
|
1964
|
+
}
|
|
1965
|
+
};
|
|
1966
|
+
//#endregion
|
|
1967
|
+
//#region src/incr-search/element-search.ts
|
|
1968
|
+
const defaultGetLabel = (el) => el.textContent?.trim() ?? ``;
|
|
1969
|
+
function defaultGetKey(el) {
|
|
1970
|
+
return el.getAttribute(`data-key`) ?? el.getAttribute(`data-value`) ?? el.textContent?.trim() ?? ``;
|
|
1971
|
+
}
|
|
1972
|
+
function createElementIncrSearch(opts) {
|
|
1973
|
+
const { container, itemSelector, getLabel = defaultGetLabel, getKey = defaultGetKey, labelSelector, highlightKey } = opts;
|
|
1974
|
+
let elementByKey = /* @__PURE__ */ new Map();
|
|
1975
|
+
const search = createIncrSearch({
|
|
1976
|
+
selector: (item) => item.label,
|
|
1977
|
+
fzf: opts.fzf
|
|
1978
|
+
});
|
|
1979
|
+
const updateVisibility = (state) => {
|
|
1980
|
+
const matchedKeys = new Set(state.results.map((r) => r.item.key));
|
|
1981
|
+
const hasQuery = state.query.trim().length > 0;
|
|
1982
|
+
for (const [key, el] of elementByKey) el.hidden = hasQuery ? !matchedKeys.has(key) : false;
|
|
1983
|
+
};
|
|
1984
|
+
const updateHighlights = (state) => {
|
|
1985
|
+
if (!state.query.trim()) {
|
|
1986
|
+
clearHighlights({ key: highlightKey });
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
applyHighlights(buildHighlightTargets(container, labelSelector ?? itemSelector, state.positionsByItem, (el) => {
|
|
1990
|
+
const key = getKey(el);
|
|
1991
|
+
return state.results.find((r) => r.item.key === key)?.item;
|
|
1992
|
+
}, (el) => getLabel(el)), { key: highlightKey });
|
|
1993
|
+
};
|
|
1994
|
+
const unsubscribeState = search.onChange((state) => {
|
|
1995
|
+
updateVisibility(state);
|
|
1996
|
+
updateHighlights(state);
|
|
1997
|
+
opts.onChange?.(state);
|
|
1998
|
+
});
|
|
1999
|
+
let refreshPending = false;
|
|
2000
|
+
const refresh = () => {
|
|
2001
|
+
if (refreshPending) return;
|
|
2002
|
+
refreshPending = true;
|
|
2003
|
+
Promise.resolve().then(() => {
|
|
2004
|
+
refreshPending = false;
|
|
2005
|
+
elementByKey = /* @__PURE__ */ new Map();
|
|
2006
|
+
const els = container.querySelectorAll(itemSelector);
|
|
2007
|
+
const items = [];
|
|
2008
|
+
for (const el of els) {
|
|
2009
|
+
const key = getKey(el);
|
|
2010
|
+
elementByKey.set(key, el);
|
|
2011
|
+
items.push({
|
|
2012
|
+
key,
|
|
2013
|
+
label: getLabel(el)
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
search.setItems(items);
|
|
2017
|
+
});
|
|
2018
|
+
};
|
|
2019
|
+
const observer = new MutationObserver(() => refresh());
|
|
2020
|
+
observer.observe(container, {
|
|
2021
|
+
childList: true,
|
|
2022
|
+
subtree: false
|
|
2023
|
+
});
|
|
2024
|
+
refresh();
|
|
2025
|
+
return {
|
|
2026
|
+
async setQuery(query, signal) {
|
|
2027
|
+
await search.setQuery(query, signal);
|
|
2028
|
+
},
|
|
2029
|
+
async clearQuery() {
|
|
2030
|
+
await search.clearQuery();
|
|
2031
|
+
},
|
|
2032
|
+
refresh,
|
|
2033
|
+
onChange(cb) {
|
|
2034
|
+
return search.onChange(cb);
|
|
2035
|
+
},
|
|
2036
|
+
dispose() {
|
|
2037
|
+
observer.disconnect();
|
|
2038
|
+
unsubscribeState();
|
|
2039
|
+
search.dispose();
|
|
2040
|
+
clearHighlights({ key: highlightKey });
|
|
2041
|
+
}
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
//#endregion
|
|
2045
|
+
//#region src/ac-token/ac-token.ts
|
|
2046
|
+
const DEFAULT_TOKENIZER = (text) => text.split(/[\s,;]+/);
|
|
2047
|
+
function makeLruCache(maxSize) {
|
|
2048
|
+
const map = /* @__PURE__ */ new Map();
|
|
2049
|
+
return {
|
|
2050
|
+
get: (k) => map.get(k),
|
|
2051
|
+
set: (k, v) => {
|
|
2052
|
+
if (map.has(k)) map.delete(k);
|
|
2053
|
+
map.set(k, v);
|
|
2054
|
+
if (map.size > maxSize) map.delete(map.keys().next().value);
|
|
2055
|
+
},
|
|
2056
|
+
has: (k) => map.has(k),
|
|
2057
|
+
clear: () => map.clear()
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
let AcTokenElement = class AcTokenElement extends i$4 {
|
|
2061
|
+
#cache;
|
|
2062
|
+
#debounceTimer;
|
|
2063
|
+
#abortController;
|
|
2064
|
+
#staticProvider;
|
|
2065
|
+
constructor() {
|
|
2066
|
+
super();
|
|
2067
|
+
this.placeholder = ``;
|
|
2068
|
+
this.cacheSize = 20;
|
|
2069
|
+
this.debounceMs = 150;
|
|
2070
|
+
this.strict = false;
|
|
2071
|
+
this._tokens = [];
|
|
2072
|
+
this._draft = ``;
|
|
2073
|
+
this._suggestions = [];
|
|
2074
|
+
this._isOpen = false;
|
|
2075
|
+
this._isLoading = false;
|
|
2076
|
+
this._tickled = new TickledController(this, { getItems: () => this._suggestions.map((_, i) => ({
|
|
2077
|
+
id: i,
|
|
2078
|
+
enabled: true
|
|
2079
|
+
})) });
|
|
2080
|
+
this.#cache = makeLruCache(20);
|
|
2081
|
+
this.#onWrapperClick = (e) => {
|
|
2082
|
+
if (!e.target.closest(`.token-chip`)) this.shadowRoot?.querySelector(`input.draft`)?.focus();
|
|
2083
|
+
};
|
|
2084
|
+
this.#onFocus = () => {
|
|
2085
|
+
this._selectedTokenIndex = void 0;
|
|
2086
|
+
this.#scheduleSuggestionFetch(this._draft);
|
|
2087
|
+
};
|
|
2088
|
+
this.#onBlur = () => {
|
|
2089
|
+
setTimeout(() => {
|
|
2090
|
+
this._isOpen = false;
|
|
2091
|
+
this._tickled.clearTickled();
|
|
2092
|
+
this._selectedTokenIndex = void 0;
|
|
2093
|
+
}, 120);
|
|
2094
|
+
};
|
|
2095
|
+
this.#onInput = (e) => {
|
|
2096
|
+
const value = e.target.value;
|
|
2097
|
+
this._selectedTokenIndex = void 0;
|
|
2098
|
+
const parts = (this.tokenizer ?? DEFAULT_TOKENIZER)(value);
|
|
2099
|
+
if (parts.length > 1) {
|
|
2100
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
2101
|
+
const label = parts[i].trim();
|
|
2102
|
+
if (label) this.#addToken({ label });
|
|
2103
|
+
}
|
|
2104
|
+
this._draft = parts[parts.length - 1] ?? ``;
|
|
2105
|
+
} else this._draft = value;
|
|
2106
|
+
this.#scheduleSuggestionFetch(this._draft);
|
|
2107
|
+
};
|
|
2108
|
+
this.#onKeyDown = (e) => {
|
|
2109
|
+
const input = e.target;
|
|
2110
|
+
if ((e.metaKey || e.ctrlKey) && e.key === `a`) {
|
|
2111
|
+
e.preventDefault();
|
|
2112
|
+
const parts = [...this._tokens.map((t) => t.label), this._draft.trim()].filter(Boolean);
|
|
2113
|
+
navigator.clipboard.writeText(parts.join(` `)).catch(() => {});
|
|
2114
|
+
return;
|
|
2115
|
+
}
|
|
2116
|
+
if (this._selectedTokenIndex !== void 0 && e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
2117
|
+
e.preventDefault();
|
|
2118
|
+
this.#startEditingSelectedToken(e.key);
|
|
2119
|
+
return;
|
|
2120
|
+
}
|
|
2121
|
+
this.#handleNavigationKey(e, input);
|
|
2122
|
+
};
|
|
2123
|
+
this.#onPaste = (e) => {
|
|
2124
|
+
e.preventDefault();
|
|
2125
|
+
const text = e.clipboardData?.getData(`text/plain`) ?? ``;
|
|
2126
|
+
if (!text) return;
|
|
2127
|
+
const parts = (this.tokenizer ?? DEFAULT_TOKENIZER)(this._draft + text).filter(Boolean);
|
|
2128
|
+
if (parts.length === 0) return;
|
|
2129
|
+
if (parts.length === 1) this._draft = parts[0];
|
|
2130
|
+
else {
|
|
2131
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
2132
|
+
const label = parts[i].trim();
|
|
2133
|
+
if (label) this.#addToken({ label });
|
|
2134
|
+
}
|
|
2135
|
+
this._draft = parts[parts.length - 1] ?? ``;
|
|
2136
|
+
}
|
|
2137
|
+
this.updateComplete.then(() => {
|
|
2138
|
+
this.shadowRoot?.querySelector(`input.draft`)?.setSelectionRange(this._draft.length, this._draft.length);
|
|
2139
|
+
});
|
|
2140
|
+
this.#scheduleSuggestionFetch(this._draft);
|
|
2141
|
+
};
|
|
2142
|
+
this.#onSuggestionPointerDown = (e, item) => {
|
|
2143
|
+
e.preventDefault();
|
|
2144
|
+
this.#selectSuggestion(item);
|
|
2145
|
+
};
|
|
2146
|
+
this.#onChipPointerDown = (e, index) => {
|
|
2147
|
+
if (e.button !== 0) return;
|
|
2148
|
+
e.preventDefault();
|
|
2149
|
+
const el = e.currentTarget;
|
|
2150
|
+
const startY = e.clientY;
|
|
2151
|
+
let dragged = false;
|
|
2152
|
+
el.setPointerCapture(e.pointerId);
|
|
2153
|
+
const cleanup = () => {
|
|
2154
|
+
el.removeEventListener(`pointermove`, onMove);
|
|
2155
|
+
el.removeEventListener(`pointerup`, onUp);
|
|
2156
|
+
};
|
|
2157
|
+
const onMove = (me) => {
|
|
2158
|
+
if (Math.abs(me.clientY - startY) > 28) {
|
|
2159
|
+
dragged = true;
|
|
2160
|
+
el.releasePointerCapture(me.pointerId);
|
|
2161
|
+
cleanup();
|
|
2162
|
+
this.#removeToken(index);
|
|
2163
|
+
this.shadowRoot?.querySelector(`input.draft`)?.focus();
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
const onUp = () => {
|
|
2167
|
+
cleanup();
|
|
2168
|
+
if (!dragged) {
|
|
2169
|
+
this._selectedTokenIndex = this._selectedTokenIndex === index ? void 0 : index;
|
|
2170
|
+
this.shadowRoot?.querySelector(`input.draft`)?.focus();
|
|
2171
|
+
}
|
|
2172
|
+
};
|
|
2173
|
+
el.addEventListener(`pointermove`, onMove);
|
|
2174
|
+
el.addEventListener(`pointerup`, onUp);
|
|
2175
|
+
};
|
|
2176
|
+
this.#cache = makeLruCache(this.cacheSize);
|
|
2177
|
+
}
|
|
2178
|
+
get tokens() {
|
|
2179
|
+
return this._tokens;
|
|
2180
|
+
}
|
|
2181
|
+
set tokens(value) {
|
|
2182
|
+
this._tokens = [...value];
|
|
2183
|
+
this.#emitChange();
|
|
2184
|
+
}
|
|
2185
|
+
/** All committed token labels joined with commas. */
|
|
2186
|
+
get value() {
|
|
2187
|
+
return this._tokens.map((t) => t.label).join(`, `);
|
|
2188
|
+
}
|
|
2189
|
+
connectedCallback() {
|
|
2190
|
+
super.connectedCallback();
|
|
2191
|
+
this.#buildStaticProvider();
|
|
2192
|
+
}
|
|
2193
|
+
disconnectedCallback() {
|
|
2194
|
+
super.disconnectedCallback();
|
|
2195
|
+
this.#cancelPending();
|
|
2196
|
+
}
|
|
2197
|
+
updated(changedProps) {
|
|
2198
|
+
if (changedProps.has(`completionProvider`) || changedProps.has(`cacheSize`)) this.#cache = makeLruCache(this.cacheSize);
|
|
2199
|
+
if (changedProps.has(`completionProvider`)) this.#buildStaticProvider();
|
|
2200
|
+
}
|
|
2201
|
+
#buildStaticProvider() {
|
|
2202
|
+
const raw = this.getAttribute(`data-tokens`);
|
|
2203
|
+
if (!raw || this.completionProvider) {
|
|
2204
|
+
this.#staticProvider = void 0;
|
|
2205
|
+
return;
|
|
2206
|
+
}
|
|
2207
|
+
const items = raw.trim().split(/[\s,;]+/).filter(Boolean).map((label) => ({ label }));
|
|
2208
|
+
this.#staticProvider = createAcCompletionProvider(items);
|
|
2209
|
+
}
|
|
2210
|
+
#onWrapperClick;
|
|
2211
|
+
#onFocus;
|
|
2212
|
+
#onBlur;
|
|
2213
|
+
#onInput;
|
|
2214
|
+
#onKeyDown;
|
|
2215
|
+
#handleNavigationKey(e, input) {
|
|
2216
|
+
switch (e.key) {
|
|
2217
|
+
case `ArrowLeft`:
|
|
2218
|
+
if (input.selectionStart === 0 && input.selectionEnd === 0) {
|
|
2219
|
+
e.preventDefault();
|
|
2220
|
+
if (this._selectedTokenIndex === void 0) {
|
|
2221
|
+
if (this._tokens.length > 0) this._selectedTokenIndex = this._tokens.length - 1;
|
|
2222
|
+
} else if (this._selectedTokenIndex > 0) this._selectedTokenIndex--;
|
|
2223
|
+
}
|
|
2224
|
+
break;
|
|
2225
|
+
case `ArrowRight`:
|
|
2226
|
+
if (this._selectedTokenIndex !== void 0) {
|
|
2227
|
+
e.preventDefault();
|
|
2228
|
+
if (this._selectedTokenIndex < this._tokens.length - 1) this._selectedTokenIndex++;
|
|
2229
|
+
else this._selectedTokenIndex = void 0;
|
|
2230
|
+
}
|
|
2231
|
+
break;
|
|
2232
|
+
case `Backspace`:
|
|
2233
|
+
if (input.selectionStart === 0 && input.selectionEnd === 0) {
|
|
2234
|
+
e.preventDefault();
|
|
2235
|
+
if (this._selectedTokenIndex !== void 0) this.#removeToken(this._selectedTokenIndex);
|
|
2236
|
+
else if (this._tokens.length > 0) this.#removeToken(this._tokens.length - 1);
|
|
2237
|
+
}
|
|
2238
|
+
break;
|
|
2239
|
+
case `Enter`: {
|
|
2240
|
+
const tickledIdx = this._tickled.tickledId;
|
|
2241
|
+
if (this._isOpen && tickledIdx !== void 0 && this._suggestions[tickledIdx]) {
|
|
2242
|
+
e.preventDefault();
|
|
2243
|
+
this.#selectSuggestion(this._suggestions[tickledIdx]);
|
|
2244
|
+
} else if (!this.strict && this._draft.trim()) {
|
|
2245
|
+
e.preventDefault();
|
|
2246
|
+
this.#addToken({ label: this._draft.trim() });
|
|
2247
|
+
this._draft = ``;
|
|
2248
|
+
this.#closePopup();
|
|
2249
|
+
}
|
|
2250
|
+
break;
|
|
2251
|
+
}
|
|
2252
|
+
case `ArrowDown`:
|
|
2253
|
+
if (!this._isOpen) return;
|
|
2254
|
+
e.preventDefault();
|
|
2255
|
+
this._tickled.handleKeyboardNavigation(`next`);
|
|
2256
|
+
this.#scrollSuggestionIntoView();
|
|
2257
|
+
break;
|
|
2258
|
+
case `ArrowUp`:
|
|
2259
|
+
if (!this._isOpen) return;
|
|
2260
|
+
e.preventDefault();
|
|
2261
|
+
this._tickled.handleKeyboardNavigation(`previous`);
|
|
2262
|
+
this.#scrollSuggestionIntoView();
|
|
2263
|
+
break;
|
|
2264
|
+
case `Escape`:
|
|
2265
|
+
e.preventDefault();
|
|
2266
|
+
this.#closePopup();
|
|
2267
|
+
this._selectedTokenIndex = void 0;
|
|
2268
|
+
break;
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
#onPaste;
|
|
2272
|
+
#onSuggestionPointerDown;
|
|
2273
|
+
#onChipPointerDown;
|
|
2274
|
+
#startEditingSelectedToken(key) {
|
|
2275
|
+
const idx = this._selectedTokenIndex;
|
|
2276
|
+
if (idx === void 0) return;
|
|
2277
|
+
const token = this._tokens[idx];
|
|
2278
|
+
if (!token) return;
|
|
2279
|
+
const newDraft = token.label + key;
|
|
2280
|
+
this.#removeToken(idx);
|
|
2281
|
+
this._selectedTokenIndex = void 0;
|
|
2282
|
+
this._draft = newDraft;
|
|
2283
|
+
this.updateComplete.then(() => {
|
|
2284
|
+
const inp = this.shadowRoot?.querySelector(`input.draft`);
|
|
2285
|
+
if (!inp) return;
|
|
2286
|
+
inp.setSelectionRange(inp.value.length, inp.value.length);
|
|
2287
|
+
});
|
|
2288
|
+
this.#scheduleSuggestionFetch(newDraft);
|
|
2289
|
+
}
|
|
2290
|
+
#addToken(item) {
|
|
2291
|
+
const index = this._tokens.length;
|
|
2292
|
+
this._tokens = [...this._tokens, item];
|
|
2293
|
+
this.dispatchEvent(new CustomEvent(`ac-token-add`, {
|
|
2294
|
+
detail: {
|
|
2295
|
+
item,
|
|
2296
|
+
index
|
|
2297
|
+
},
|
|
2298
|
+
bubbles: true,
|
|
2299
|
+
composed: true
|
|
2300
|
+
}));
|
|
2301
|
+
this.#emitChange();
|
|
2302
|
+
}
|
|
2303
|
+
#removeToken(index) {
|
|
2304
|
+
const item = this._tokens[index];
|
|
2305
|
+
if (!item) return;
|
|
2306
|
+
this._tokens = this._tokens.filter((_, i) => i !== index);
|
|
2307
|
+
if (this._selectedTokenIndex !== void 0) {
|
|
2308
|
+
if (this._selectedTokenIndex === index) this._selectedTokenIndex = void 0;
|
|
2309
|
+
else if (this._selectedTokenIndex > index) this._selectedTokenIndex--;
|
|
2310
|
+
}
|
|
2311
|
+
this.dispatchEvent(new CustomEvent(`ac-token-remove`, {
|
|
2312
|
+
detail: {
|
|
2313
|
+
item,
|
|
2314
|
+
index
|
|
2315
|
+
},
|
|
2316
|
+
bubbles: true,
|
|
2317
|
+
composed: true
|
|
2318
|
+
}));
|
|
2319
|
+
this.#emitChange();
|
|
2320
|
+
}
|
|
2321
|
+
#selectSuggestion(item) {
|
|
2322
|
+
this.#addToken(item);
|
|
2323
|
+
this._draft = ``;
|
|
2324
|
+
this.#closePopup();
|
|
2325
|
+
}
|
|
2326
|
+
#emitChange() {
|
|
2327
|
+
this.dispatchEvent(new CustomEvent(`ac-token-change`, {
|
|
2328
|
+
detail: { tokens: this._tokens },
|
|
2329
|
+
bubbles: true,
|
|
2330
|
+
composed: true
|
|
2331
|
+
}));
|
|
2332
|
+
}
|
|
2333
|
+
#closePopup() {
|
|
2334
|
+
this._isOpen = false;
|
|
2335
|
+
this._tickled.clearTickled();
|
|
2336
|
+
}
|
|
2337
|
+
#cancelPending() {
|
|
2338
|
+
if (this.#debounceTimer !== void 0) {
|
|
2339
|
+
clearTimeout(this.#debounceTimer);
|
|
2340
|
+
this.#debounceTimer = void 0;
|
|
2341
|
+
}
|
|
2342
|
+
this.#abortController?.abort();
|
|
2343
|
+
this.#abortController = void 0;
|
|
2344
|
+
this._isLoading = false;
|
|
2345
|
+
}
|
|
2346
|
+
#scheduleSuggestionFetch(query) {
|
|
2347
|
+
const provider = this.completionProvider ?? this.#staticProvider;
|
|
2348
|
+
if (!provider) {
|
|
2349
|
+
this._isOpen = false;
|
|
2350
|
+
return;
|
|
2351
|
+
}
|
|
2352
|
+
if (this.#debounceTimer !== void 0) clearTimeout(this.#debounceTimer);
|
|
2353
|
+
this._isOpen = true;
|
|
2354
|
+
this.#debounceTimer = setTimeout(() => {
|
|
2355
|
+
this.#fetchSuggestions(query, provider);
|
|
2356
|
+
}, this.debounceMs);
|
|
2357
|
+
}
|
|
2358
|
+
#fetchSuggestions(query, provider) {
|
|
2359
|
+
const cached = this.#cache.get(query);
|
|
2360
|
+
if (cached !== void 0) {
|
|
2361
|
+
this._suggestions = cached;
|
|
2362
|
+
this._tickled.clearTickled();
|
|
2363
|
+
this._isLoading = false;
|
|
2364
|
+
return;
|
|
2365
|
+
}
|
|
2366
|
+
this.#abortController?.abort();
|
|
2367
|
+
this.#abortController = new AbortController();
|
|
2368
|
+
const { signal } = this.#abortController;
|
|
2369
|
+
this._isLoading = true;
|
|
2370
|
+
Promise.resolve(provider(query, signal)).then((results) => {
|
|
2371
|
+
if (signal.aborted) return;
|
|
2372
|
+
this.#cache.set(query, results);
|
|
2373
|
+
this._suggestions = results;
|
|
2374
|
+
this._tickled.clearTickled();
|
|
2375
|
+
this._isLoading = false;
|
|
2376
|
+
}).catch((err) => {
|
|
2377
|
+
if (signal.aborted) return;
|
|
2378
|
+
console.error(`[ixfx-ac-token] completionProvider error:`, err);
|
|
2379
|
+
this._suggestions = [];
|
|
2380
|
+
this._isLoading = false;
|
|
2381
|
+
});
|
|
2382
|
+
}
|
|
2383
|
+
#scrollSuggestionIntoView() {
|
|
2384
|
+
this.updateComplete.then(() => {
|
|
2385
|
+
this.shadowRoot?.querySelector(`.suggestion.tickled`)?.scrollIntoView({ block: `nearest` });
|
|
2386
|
+
});
|
|
2387
|
+
}
|
|
2388
|
+
#renderChip(item, index) {
|
|
2389
|
+
return b`
|
|
2390
|
+
<span
|
|
2391
|
+
class="token-chip ${this._selectedTokenIndex === index ? `selected` : ``}"
|
|
2392
|
+
title=${item.subLabel ?? A}
|
|
2393
|
+
@pointerdown=${(e) => this.#onChipPointerDown(e, index)}
|
|
2394
|
+
>
|
|
2395
|
+
${item.icon ? b`<ixfx-icon class="chip-icon" name=${item.icon}></ixfx-icon>` : A}
|
|
2396
|
+
<span class="chip-label">${item.label}</span>
|
|
2397
|
+
</span>
|
|
2398
|
+
`;
|
|
2399
|
+
}
|
|
2400
|
+
#renderSuggestion(item, index) {
|
|
2401
|
+
const isTickled = this._tickled.isTickled(index);
|
|
2402
|
+
return b`
|
|
2403
|
+
<div
|
|
2404
|
+
class="suggestion ${isTickled ? `tickled` : ``}"
|
|
2405
|
+
role="option"
|
|
2406
|
+
id="ac-token-sugg-${index}"
|
|
2407
|
+
aria-selected=${isTickled}
|
|
2408
|
+
@pointerenter=${() => this._tickled.handlePointerEnter(index)}
|
|
2409
|
+
@pointerdown=${(e) => this.#onSuggestionPointerDown(e, item)}
|
|
2410
|
+
>
|
|
2411
|
+
${item.icon ? b`<ixfx-icon class="sugg-icon" name=${item.icon}></ixfx-icon>` : A}
|
|
2412
|
+
<span class="sugg-label">${item.label}</span>
|
|
2413
|
+
${item.subLabel ? b`<span class="sugg-sublabel">${item.subLabel}</span>` : A}
|
|
2414
|
+
</div>
|
|
2415
|
+
`;
|
|
2416
|
+
}
|
|
2417
|
+
#renderPopup() {
|
|
2418
|
+
const showEmpty = !this._isLoading && this._suggestions.length === 0;
|
|
2419
|
+
return b`
|
|
2420
|
+
<div
|
|
2421
|
+
class="popup"
|
|
2422
|
+
role="listbox"
|
|
2423
|
+
aria-label="Suggestions"
|
|
2424
|
+
data-input-mode=${this._tickled.inputMode}
|
|
2425
|
+
@pointerleave=${(e) => this._tickled.handlePointerLeave(e)}
|
|
2426
|
+
>
|
|
2427
|
+
${showEmpty ? b`<div class="no-results">No matching results</div>` : this._suggestions.map((item, i) => this.#renderSuggestion(item, i))}
|
|
2428
|
+
</div>
|
|
2429
|
+
`;
|
|
2430
|
+
}
|
|
2431
|
+
render() {
|
|
2432
|
+
const tickledIdx = this._tickled.tickledId ?? -1;
|
|
2433
|
+
const activeDescendant = tickledIdx >= 0 ? `ac-token-sugg-${tickledIdx}` : void 0;
|
|
2434
|
+
const showPlaceholder = this._tokens.length === 0 ? this.placeholder || A : A;
|
|
2435
|
+
return b`
|
|
2436
|
+
<div class="wrapper" @click=${this.#onWrapperClick}>
|
|
2437
|
+
${this._tokens.map((t, i) => this.#renderChip(t, i))}
|
|
2438
|
+
<input
|
|
2439
|
+
type="text"
|
|
2440
|
+
class="draft"
|
|
2441
|
+
.value=${this._draft}
|
|
2442
|
+
placeholder=${showPlaceholder}
|
|
2443
|
+
autocomplete="off"
|
|
2444
|
+
spellcheck="false"
|
|
2445
|
+
role="combobox"
|
|
2446
|
+
aria-autocomplete="list"
|
|
2447
|
+
aria-expanded=${this._isOpen}
|
|
2448
|
+
aria-activedescendant=${activeDescendant ?? A}
|
|
2449
|
+
@input=${this.#onInput}
|
|
2450
|
+
@keydown=${this.#onKeyDown}
|
|
2451
|
+
@focus=${this.#onFocus}
|
|
2452
|
+
@blur=${this.#onBlur}
|
|
2453
|
+
@paste=${this.#onPaste}
|
|
2454
|
+
>
|
|
2455
|
+
${this._isLoading ? b`<span class="spinner" aria-hidden="true"></span>` : A}
|
|
2456
|
+
</div>
|
|
2457
|
+
${this._isOpen ? this.#renderPopup() : A}
|
|
2458
|
+
`;
|
|
2459
|
+
}
|
|
2460
|
+
static {
|
|
2461
|
+
this.styles = [tickledStyles, i$7`
|
|
2462
|
+
:host {
|
|
2463
|
+
display: block;
|
|
2464
|
+
position: relative;
|
|
2465
|
+
font-family: var(--font-family, system-ui, sans-serif);
|
|
2466
|
+
font-size: var(--text-m, 12px);
|
|
2467
|
+
color: var(--surface-2-text);
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
/* ---- Wrapper (looks like a text input) ---- */
|
|
2471
|
+
|
|
2472
|
+
.wrapper {
|
|
2473
|
+
display: flex;
|
|
2474
|
+
flex-wrap: wrap;
|
|
2475
|
+
align-items: center;
|
|
2476
|
+
gap: var(--ac-token-chip-gap, var(--space-xs, 3px));
|
|
2477
|
+
padding: var(--ac-token-input-padding, var(--space-xs, 3px) var(--space-m, 8px));
|
|
2478
|
+
background: var(--ac-token-input-background, var(--surface-3, var(--surface-2)));
|
|
2479
|
+
color: var(--surface-2-text);
|
|
2480
|
+
border: var(--ac-token-input-border, var(--border));
|
|
2481
|
+
border-radius: var(--ac-token-input-border-radius, var(--radius-m, 4px));
|
|
2482
|
+
cursor: text;
|
|
2483
|
+
min-height: 32px;
|
|
2484
|
+
box-sizing: border-box;
|
|
2485
|
+
transition: border-color var(--transition, 0.15s ease-out);
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
.wrapper:focus-within {
|
|
2489
|
+
border-color: var(--accent);
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
/* ---- Token chips ---- */
|
|
2493
|
+
|
|
2494
|
+
.token-chip {
|
|
2495
|
+
display: inline-flex;
|
|
2496
|
+
align-items: center;
|
|
2497
|
+
gap: var(--space-xs, 3px);
|
|
2498
|
+
padding: 1px var(--space-m, 8px);
|
|
2499
|
+
background: var(--ac-token-chip-background, var(--surface-4));
|
|
2500
|
+
border: var(--ac-token-chip-border, var(--border));
|
|
2501
|
+
border-radius: var(--ac-token-chip-border-radius, var(--radius-s, 3px));
|
|
2502
|
+
user-select: none;
|
|
2503
|
+
cursor: default;
|
|
2504
|
+
font-size: var(--text-s, 11px);
|
|
2505
|
+
white-space: nowrap;
|
|
2506
|
+
touch-action: none;
|
|
2507
|
+
transition:
|
|
2508
|
+
background var(--transition, 0.1s ease-out),
|
|
2509
|
+
border-color var(--transition, 0.1s ease-out),
|
|
2510
|
+
color var(--transition, 0.1s ease-out);
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
.token-chip.selected {
|
|
2514
|
+
background: var(--ac-token-chip-selected-background, var(--accent));
|
|
2515
|
+
color: var(--ac-token-chip-selected-color, var(--accent-text, #fff));
|
|
2516
|
+
border-color: var(--accent);
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
.chip-icon {
|
|
2520
|
+
flex-shrink: 0;
|
|
2521
|
+
width: 1em;
|
|
2522
|
+
height: 1em;
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
/* ---- Draft input ---- */
|
|
2526
|
+
|
|
2527
|
+
input.draft {
|
|
2528
|
+
flex: 1;
|
|
2529
|
+
min-width: 60px;
|
|
2530
|
+
border: none;
|
|
2531
|
+
background: transparent;
|
|
2532
|
+
color: inherit;
|
|
2533
|
+
font: inherit;
|
|
2534
|
+
outline: none;
|
|
2535
|
+
caret-color: var(--accent);
|
|
2536
|
+
padding: 1px 0;
|
|
2537
|
+
anchor-name: --ac-token-draft;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
input.draft::placeholder {
|
|
2541
|
+
color: var(--surface-muted-text);
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
/* ---- Spinner ---- */
|
|
2545
|
+
|
|
2546
|
+
.spinner {
|
|
2547
|
+
width: 12px;
|
|
2548
|
+
height: 12px;
|
|
2549
|
+
border: 2px solid var(--surface-5);
|
|
2550
|
+
border-top-color: var(--accent);
|
|
2551
|
+
border-radius: 50%;
|
|
2552
|
+
animation: ac-token-spin 0.7s linear infinite;
|
|
2553
|
+
flex-shrink: 0;
|
|
2554
|
+
pointer-events: none;
|
|
2555
|
+
margin-left: var(--space-xs, 3px);
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
@keyframes ac-token-spin {
|
|
2559
|
+
to { transform: rotate(360deg); }
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
/* ---- Popup ---- */
|
|
2563
|
+
|
|
2564
|
+
.popup {
|
|
2565
|
+
position: fixed;
|
|
2566
|
+
position-anchor: --ac-token-draft;
|
|
2567
|
+
top: anchor(bottom);
|
|
2568
|
+
left: anchor(left);
|
|
2569
|
+
margin-top: 2px;
|
|
2570
|
+
position-try-fallbacks: --ac-token-popup-above;
|
|
2571
|
+
z-index: 200;
|
|
2572
|
+
background: var(--surface-3, var(--surface-2));
|
|
2573
|
+
border: var(--border);
|
|
2574
|
+
border-radius: var(--radius-m, 4px);
|
|
2575
|
+
box-shadow: var(--shadow-l, 0 4px 24px rgba(0, 0, 0, 0.5));
|
|
2576
|
+
padding: var(--space-xs, 3px) 0;
|
|
2577
|
+
max-height: 260px;
|
|
2578
|
+
min-width: 160px;
|
|
2579
|
+
overflow-y: auto;
|
|
2580
|
+
font-size: var(--ac-token-popup-font-size, var(--text-s, 11px));
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
@position-try --ac-token-popup-above {
|
|
2584
|
+
top: auto;
|
|
2585
|
+
bottom: anchor(top);
|
|
2586
|
+
left: anchor(left);
|
|
2587
|
+
margin-top: 0;
|
|
2588
|
+
margin-bottom: 2px;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
/* ---- Suggestion items ---- */
|
|
2592
|
+
|
|
2593
|
+
.suggestion {
|
|
2594
|
+
display: flex;
|
|
2595
|
+
align-items: center;
|
|
2596
|
+
gap: var(--space-m, 8px);
|
|
2597
|
+
padding: var(--space-xs, 3px) var(--space-l, 12px);
|
|
2598
|
+
cursor: pointer;
|
|
2599
|
+
border-radius: var(--radius-s, 3px);
|
|
2600
|
+
margin: 0 var(--space-xs, 3px);
|
|
2601
|
+
transition: background var(--transition, 0.1s ease-out);
|
|
2602
|
+
user-select: none;
|
|
2603
|
+
white-space: nowrap;
|
|
2604
|
+
min-height: 28px;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
.suggestion.tickled {
|
|
2608
|
+
background: var(--_item-focused-bg, var(--accent));
|
|
2609
|
+
color: var(--accent-text, #fff);
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
.suggestion.tickled .sugg-sublabel {
|
|
2613
|
+
color: color-mix(in srgb, var(--accent-text, #fff) 70%, transparent);
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
.sugg-icon {
|
|
2617
|
+
flex-shrink: 0;
|
|
2618
|
+
width: 1em;
|
|
2619
|
+
height: 1em;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
.sugg-label {
|
|
2623
|
+
flex: 1;
|
|
2624
|
+
overflow: hidden;
|
|
2625
|
+
text-overflow: ellipsis;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
.sugg-sublabel {
|
|
2629
|
+
flex-shrink: 0;
|
|
2630
|
+
margin-left: auto;
|
|
2631
|
+
color: var(--surface-muted-text);
|
|
2632
|
+
font-size: var(--text-s, 11px);
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
/* ---- Empty state ---- */
|
|
2636
|
+
|
|
2637
|
+
.no-results {
|
|
2638
|
+
padding: var(--space-m, 8px) var(--space-l, 12px);
|
|
2639
|
+
color: var(--surface-muted-text);
|
|
2640
|
+
font-style: italic;
|
|
2641
|
+
}
|
|
2642
|
+
`];
|
|
2643
|
+
}
|
|
2644
|
+
};
|
|
2645
|
+
__decorate([n$2({ type: Object })], AcTokenElement.prototype, "completionProvider", void 0);
|
|
2646
|
+
__decorate([n$2({ type: Object })], AcTokenElement.prototype, "tokenizer", void 0);
|
|
2647
|
+
__decorate([n$2({ type: String })], AcTokenElement.prototype, "placeholder", void 0);
|
|
2648
|
+
__decorate([n$2({
|
|
2649
|
+
type: Number,
|
|
2650
|
+
attribute: `cache-size`
|
|
2651
|
+
})], AcTokenElement.prototype, "cacheSize", void 0);
|
|
2652
|
+
__decorate([n$2({
|
|
2653
|
+
type: Number,
|
|
2654
|
+
attribute: `debounce-ms`
|
|
2655
|
+
})], AcTokenElement.prototype, "debounceMs", void 0);
|
|
2656
|
+
__decorate([n$2({ type: Boolean })], AcTokenElement.prototype, "strict", void 0);
|
|
2657
|
+
__decorate([r$1()], AcTokenElement.prototype, "_tokens", void 0);
|
|
2658
|
+
__decorate([r$1()], AcTokenElement.prototype, "_draft", void 0);
|
|
2659
|
+
__decorate([r$1()], AcTokenElement.prototype, "_selectedTokenIndex", void 0);
|
|
2660
|
+
__decorate([r$1()], AcTokenElement.prototype, "_suggestions", void 0);
|
|
2661
|
+
__decorate([r$1()], AcTokenElement.prototype, "_isOpen", void 0);
|
|
2662
|
+
__decorate([r$1()], AcTokenElement.prototype, "_isLoading", void 0);
|
|
2663
|
+
AcTokenElement = __decorate([safeCustomElement(`ixfx-ac-token`)], AcTokenElement);
|
|
1764
2664
|
//#endregion
|
|
1765
2665
|
//#region src/icons/defaults.ts
|
|
1766
2666
|
/**
|
|
@@ -1856,7 +2756,7 @@ registerDefaults();
|
|
|
1856
2756
|
* - Transition uses `--transition` from the theme (default `0.15s ease-out`).
|
|
1857
2757
|
* - When disabled, `pointer-events: none` is set and cannot be overridden per-instance.
|
|
1858
2758
|
*/
|
|
1859
|
-
const prominenceStyles = i$
|
|
2759
|
+
const prominenceStyles = i$7`
|
|
1860
2760
|
:host {
|
|
1861
2761
|
--prominence-idle-opacity: 0.6;
|
|
1862
2762
|
--prominence-idle-saturate: 0.4;
|
|
@@ -1894,7 +2794,7 @@ const prominenceStyles = i$6`
|
|
|
1894
2794
|
`;
|
|
1895
2795
|
//#endregion
|
|
1896
2796
|
//#region src/button/button-styles.ts
|
|
1897
|
-
const buttonStyles = i$
|
|
2797
|
+
const buttonStyles = i$7`
|
|
1898
2798
|
:host {
|
|
1899
2799
|
display: inline-flex;
|
|
1900
2800
|
max-width: 100%;
|
|
@@ -1969,7 +2869,7 @@ const buttonStyles = i$6`
|
|
|
1969
2869
|
`;
|
|
1970
2870
|
//#endregion
|
|
1971
2871
|
//#region src/button/button.ts
|
|
1972
|
-
let ButtonElement = class ButtonElement extends i$
|
|
2872
|
+
let ButtonElement = class ButtonElement extends i$4 {
|
|
1973
2873
|
constructor(..._args) {
|
|
1974
2874
|
super(..._args);
|
|
1975
2875
|
this.disabled = false;
|
|
@@ -1978,7 +2878,7 @@ let ButtonElement = class ButtonElement extends i$3 {
|
|
|
1978
2878
|
}
|
|
1979
2879
|
_renderIcon() {
|
|
1980
2880
|
if (this.hideIcon || !this.icon) return A;
|
|
1981
|
-
if (this.icon.startsWith(`<svg`)) return b`<span class="button-icon">${o(this.icon)}</span>`;
|
|
2881
|
+
if (this.icon.startsWith(`<svg`)) return b`<span class="button-icon">${o$1(this.icon)}</span>`;
|
|
1982
2882
|
if (!getIcon(this.icon)) return A;
|
|
1983
2883
|
return b`<ixfx-icon class="button-icon" name="${this.icon}"></ixfx-icon>`;
|
|
1984
2884
|
}
|
|
@@ -2002,10 +2902,10 @@ __decorate([n$2({
|
|
|
2002
2902
|
attribute: `hide-label`,
|
|
2003
2903
|
reflect: true
|
|
2004
2904
|
})], ButtonElement.prototype, "hideLabel", void 0);
|
|
2005
|
-
ButtonElement = __decorate([
|
|
2905
|
+
ButtonElement = __decorate([safeCustomElement(`ixfx-button`)], ButtonElement);
|
|
2006
2906
|
//#endregion
|
|
2007
2907
|
//#region src/button/radio-group.ts
|
|
2008
|
-
let RadioGroup = class RadioGroup extends i$
|
|
2908
|
+
let RadioGroup = class RadioGroup extends i$4 {
|
|
2009
2909
|
constructor(..._args) {
|
|
2010
2910
|
super(..._args);
|
|
2011
2911
|
this.value = ``;
|
|
@@ -2106,7 +3006,7 @@ let RadioGroup = class RadioGroup extends i$3 {
|
|
|
2106
3006
|
if (iconName) return b`<ixfx-icon class="radio-icon" name="${iconName}"></ixfx-icon>`;
|
|
2107
3007
|
const iconHtml = this._icons.get(item.value);
|
|
2108
3008
|
if (!iconHtml) return null;
|
|
2109
|
-
return b`<span class="radio-icon">${o(iconHtml)}</span>`;
|
|
3009
|
+
return b`<span class="radio-icon">${o$1(iconHtml)}</span>`;
|
|
2110
3010
|
}
|
|
2111
3011
|
render() {
|
|
2112
3012
|
if (this._isSingleToggle) {
|
|
@@ -2153,7 +3053,7 @@ let RadioGroup = class RadioGroup extends i$3 {
|
|
|
2153
3053
|
`;
|
|
2154
3054
|
}
|
|
2155
3055
|
static {
|
|
2156
|
-
this.styles = [prominenceStyles, i$
|
|
3056
|
+
this.styles = [prominenceStyles, i$7`
|
|
2157
3057
|
:host {
|
|
2158
3058
|
display: inline-flex;
|
|
2159
3059
|
min-width: min-content;
|
|
@@ -2330,7 +3230,7 @@ __decorate([n$2({
|
|
|
2330
3230
|
__decorate([r$1()], RadioGroup.prototype, "_computedItems", void 0);
|
|
2331
3231
|
__decorate([r$1()], RadioGroup.prototype, "_icons", void 0);
|
|
2332
3232
|
__decorate([e$4(`slot`)], RadioGroup.prototype, "_slot", void 0);
|
|
2333
|
-
RadioGroup = __decorate([
|
|
3233
|
+
RadioGroup = __decorate([safeCustomElement(`ixfx-radio-group`)], RadioGroup);
|
|
2334
3234
|
//#endregion
|
|
2335
3235
|
//#region src/styles/popup.ts
|
|
2336
3236
|
/**
|
|
@@ -2342,7 +3242,7 @@ RadioGroup = __decorate([t$4(`ixfx-radio-group`)], RadioGroup);
|
|
|
2342
3242
|
* Intentionally omitted (remain per-component): positioning, padding,
|
|
2343
3243
|
* dimensions, z-index, and open/close animations.
|
|
2344
3244
|
*/
|
|
2345
|
-
const popupSurfaceStyles = i$
|
|
3245
|
+
const popupSurfaceStyles = i$7`
|
|
2346
3246
|
.popup-surface {
|
|
2347
3247
|
background: var(--surface-5);
|
|
2348
3248
|
border: 1px solid var(--surface-6);
|
|
@@ -2353,14 +3253,14 @@ const popupSurfaceStyles = i$6`
|
|
|
2353
3253
|
`;
|
|
2354
3254
|
//#endregion
|
|
2355
3255
|
//#region src/menu/menu-container.ts
|
|
2356
|
-
let MenuContainer = class MenuContainer extends i$
|
|
3256
|
+
let MenuContainer = class MenuContainer extends i$4 {
|
|
2357
3257
|
constructor(..._args) {
|
|
2358
3258
|
super(..._args);
|
|
2359
3259
|
this.tickled = new TickledController(this, {
|
|
2360
3260
|
getItems: () => {
|
|
2361
3261
|
return this._getMenuItems().map((item, i) => ({
|
|
2362
3262
|
id: i,
|
|
2363
|
-
enabled: !item.hasAttribute(
|
|
3263
|
+
enabled: !item.hasAttribute(`disabled`)
|
|
2364
3264
|
}));
|
|
2365
3265
|
},
|
|
2366
3266
|
onTickle: (index) => {
|
|
@@ -2423,7 +3323,7 @@ let MenuContainer = class MenuContainer extends i$3 {
|
|
|
2423
3323
|
this.styles = [
|
|
2424
3324
|
popupSurfaceStyles,
|
|
2425
3325
|
tickledStyles,
|
|
2426
|
-
i$
|
|
3326
|
+
i$7`
|
|
2427
3327
|
:host {
|
|
2428
3328
|
display: block;
|
|
2429
3329
|
}
|
|
@@ -2494,7 +3394,7 @@ let MenuContainer = class MenuContainer extends i$3 {
|
|
|
2494
3394
|
*/
|
|
2495
3395
|
willUpdate(changed) {
|
|
2496
3396
|
super.willUpdate(changed);
|
|
2497
|
-
this.setAttribute(
|
|
3397
|
+
this.setAttribute(`data-input-mode`, this.tickled.inputMode);
|
|
2498
3398
|
}
|
|
2499
3399
|
render() {
|
|
2500
3400
|
return b`
|
|
@@ -2552,14 +3452,14 @@ let MenuContainer = class MenuContainer extends i$3 {
|
|
|
2552
3452
|
}
|
|
2553
3453
|
}
|
|
2554
3454
|
});
|
|
2555
|
-
if (this.tickled.inputMode ===
|
|
3455
|
+
if (this.tickled.inputMode === `keyboard` && this.tickled.tickledId !== void 0) items[this.tickled.tickledId]?.focus();
|
|
2556
3456
|
}
|
|
2557
3457
|
focusFirst() {
|
|
2558
|
-
this.tickled.handleKeyboardNavigation(
|
|
3458
|
+
this.tickled.handleKeyboardNavigation(`first`);
|
|
2559
3459
|
}
|
|
2560
3460
|
_focusNext(items, direction) {
|
|
2561
3461
|
if (items.length === 0) return;
|
|
2562
|
-
this.tickled.handleKeyboardNavigation(direction > 0 ?
|
|
3462
|
+
this.tickled.handleKeyboardNavigation(direction > 0 ? `next` : `previous`);
|
|
2563
3463
|
}
|
|
2564
3464
|
_focusItem(items, index) {
|
|
2565
3465
|
if (items.length === 0) return;
|
|
@@ -2613,11 +3513,11 @@ __decorate([n$2({
|
|
|
2613
3513
|
__decorate([n$2({ attribute: false })], MenuContainer.prototype, "registry", void 0);
|
|
2614
3514
|
__decorate([n$2({ attribute: false })], MenuContainer.prototype, "keyboardManager", void 0);
|
|
2615
3515
|
__decorate([e$4(`.popover`)], MenuContainer.prototype, "_popover", void 0);
|
|
2616
|
-
MenuContainer = __decorate([
|
|
3516
|
+
MenuContainer = __decorate([safeCustomElement(`ixfx-menu-container`)], MenuContainer);
|
|
2617
3517
|
//#endregion
|
|
2618
3518
|
//#region src/menu/menu-trigger.ts
|
|
2619
3519
|
var _MenuTrigger;
|
|
2620
|
-
let MenuTrigger = class MenuTrigger extends i$
|
|
3520
|
+
let MenuTrigger = class MenuTrigger extends i$4 {
|
|
2621
3521
|
static {
|
|
2622
3522
|
_MenuTrigger = this;
|
|
2623
3523
|
}
|
|
@@ -2811,7 +3711,7 @@ let MenuTrigger = class MenuTrigger extends i$3 {
|
|
|
2811
3711
|
} catch {}
|
|
2812
3712
|
}
|
|
2813
3713
|
static {
|
|
2814
|
-
this.styles = [popupSurfaceStyles, i$
|
|
3714
|
+
this.styles = [popupSurfaceStyles, i$7`
|
|
2815
3715
|
:host {
|
|
2816
3716
|
display: inline-block;
|
|
2817
3717
|
position: relative;
|
|
@@ -2905,10 +3805,10 @@ __decorate([r$1()], MenuTrigger.prototype, "_hasMenu", void 0);
|
|
|
2905
3805
|
__decorate([r$1()], MenuTrigger.prototype, "_hasTriggerSlot", void 0);
|
|
2906
3806
|
__decorate([e$4(`.trigger-btn`)], MenuTrigger.prototype, "_triggerBtn", void 0);
|
|
2907
3807
|
__decorate([e$4(`.popup`)], MenuTrigger.prototype, "_popup", void 0);
|
|
2908
|
-
MenuTrigger = _MenuTrigger = __decorate([
|
|
3808
|
+
MenuTrigger = _MenuTrigger = __decorate([safeCustomElement(`ixfx-menu-trigger`)], MenuTrigger);
|
|
2909
3809
|
//#endregion
|
|
2910
3810
|
//#region src/menu/menu-item.ts
|
|
2911
|
-
let MenuItem = class MenuItem extends i$
|
|
3811
|
+
let MenuItem = class MenuItem extends i$4 {
|
|
2912
3812
|
constructor(..._args) {
|
|
2913
3813
|
super(..._args);
|
|
2914
3814
|
this.command = ``;
|
|
@@ -3001,7 +3901,7 @@ let MenuItem = class MenuItem extends i$3 {
|
|
|
3001
3901
|
return [...mods, key].join(``);
|
|
3002
3902
|
}
|
|
3003
3903
|
static {
|
|
3004
|
-
this.styles = [tickledItemStyles, i$
|
|
3904
|
+
this.styles = [tickledItemStyles, i$7`
|
|
3005
3905
|
:host {
|
|
3006
3906
|
display: block;
|
|
3007
3907
|
}
|
|
@@ -3106,7 +4006,7 @@ __decorate([n$2({ attribute: false })], MenuItem.prototype, "keyboardManager", v
|
|
|
3106
4006
|
__decorate([n$2({ attribute: false })], MenuItem.prototype, "submenuPopover", void 0);
|
|
3107
4007
|
__decorate([r$1()], MenuItem.prototype, "_hasChildren", void 0);
|
|
3108
4008
|
__decorate([e$4(`slot`)], MenuItem.prototype, "_slot", void 0);
|
|
3109
|
-
MenuItem = __decorate([
|
|
4009
|
+
MenuItem = __decorate([safeCustomElement(`ixfx-menu-item`)], MenuItem);
|
|
3110
4010
|
//#endregion
|
|
3111
4011
|
//#region src/button/split-button.ts
|
|
3112
4012
|
let SplitButton = class SplitButton extends ButtonElement {
|
|
@@ -3360,7 +4260,7 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
3360
4260
|
this.styles = [
|
|
3361
4261
|
prominenceStyles,
|
|
3362
4262
|
buttonStyles,
|
|
3363
|
-
i$
|
|
4263
|
+
i$7`
|
|
3364
4264
|
:host {
|
|
3365
4265
|
display: inline-flex;
|
|
3366
4266
|
max-width: 100%;
|
|
@@ -3495,7 +4395,7 @@ __decorate([r$1()], SplitButton.prototype, "_switcherItems", void 0);
|
|
|
3495
4395
|
__decorate([r$1()], SplitButton.prototype, "_dynamicItems", void 0);
|
|
3496
4396
|
__decorate([r$1()], SplitButton.prototype, "_loadingItems", void 0);
|
|
3497
4397
|
__decorate([r$1()], SplitButton.prototype, "_menuHasItems", void 0);
|
|
3498
|
-
SplitButton = __decorate([
|
|
4398
|
+
SplitButton = __decorate([safeCustomElement(`ixfx-split-button`)], SplitButton);
|
|
3499
4399
|
//#endregion
|
|
3500
4400
|
//#region src/checkbox.ts
|
|
3501
4401
|
/**
|
|
@@ -3533,7 +4433,7 @@ SplitButton = __decorate([t$4(`ixfx-split-button`)], SplitButton);
|
|
|
3533
4433
|
* --label-opacity-unchecked – label opacity when unchecked (default: uses --label-opacity)
|
|
3534
4434
|
* --transition-duration – animation duration (default: 0.2s)
|
|
3535
4435
|
*/
|
|
3536
|
-
let Checkbox = class Checkbox extends i$
|
|
4436
|
+
let Checkbox = class Checkbox extends i$4 {
|
|
3537
4437
|
constructor(..._args) {
|
|
3538
4438
|
super(..._args);
|
|
3539
4439
|
this.checked = false;
|
|
@@ -3553,7 +4453,7 @@ let Checkbox = class Checkbox extends i$3 {
|
|
|
3553
4453
|
};
|
|
3554
4454
|
}
|
|
3555
4455
|
static {
|
|
3556
|
-
this.styles = i$
|
|
4456
|
+
this.styles = i$7`
|
|
3557
4457
|
:host {
|
|
3558
4458
|
/* Box */
|
|
3559
4459
|
--box-size: 18px;
|
|
@@ -3740,7 +4640,7 @@ __decorate([n$2({ type: Boolean })], Checkbox.prototype, "indeterminate", void 0
|
|
|
3740
4640
|
__decorate([n$2({ type: String })], Checkbox.prototype, "label", void 0);
|
|
3741
4641
|
__decorate([n$2({ type: String })], Checkbox.prototype, "name", void 0);
|
|
3742
4642
|
__decorate([n$2({ type: String })], Checkbox.prototype, "value", void 0);
|
|
3743
|
-
Checkbox = __decorate([
|
|
4643
|
+
Checkbox = __decorate([safeCustomElement(`ixfx-checkbox`)], Checkbox);
|
|
3744
4644
|
//#endregion
|
|
3745
4645
|
//#region node_modules/.pnpm/@ixfx+visual@0.56.12/node_modules/@ixfx/visual/dist/chunk-pbuEa-1d.js
|
|
3746
4646
|
var __defProp$5 = Object.defineProperty;
|
|
@@ -17866,7 +18766,7 @@ function applyValue(el, value) {
|
|
|
17866
18766
|
}
|
|
17867
18767
|
//#endregion
|
|
17868
18768
|
//#region src/mixins/labelled-input-base.ts
|
|
17869
|
-
var LabelledInputBase = class extends i$
|
|
18769
|
+
var LabelledInputBase = class extends i$4 {
|
|
17870
18770
|
constructor(..._args) {
|
|
17871
18771
|
super(..._args);
|
|
17872
18772
|
this.label = ``;
|
|
@@ -18042,7 +18942,7 @@ let LabelledRangeInput = class LabelledRangeInput extends LabelledInputBase {
|
|
|
18042
18942
|
`;
|
|
18043
18943
|
}
|
|
18044
18944
|
static {
|
|
18045
|
-
this.styles = i$
|
|
18945
|
+
this.styles = i$7`
|
|
18046
18946
|
:host {
|
|
18047
18947
|
display: block;
|
|
18048
18948
|
container-type: size;
|
|
@@ -18131,10 +19031,10 @@ __decorate([n$2({
|
|
|
18131
19031
|
type: Number,
|
|
18132
19032
|
attribute: `switch-height`
|
|
18133
19033
|
})], LabelledRangeInput.prototype, "switchHeight", void 0);
|
|
18134
|
-
LabelledRangeInput = __decorate([
|
|
19034
|
+
LabelledRangeInput = __decorate([safeCustomElement(`ixfx-labelled-range-input`)], LabelledRangeInput);
|
|
18135
19035
|
//#endregion
|
|
18136
19036
|
//#region src/colour-picker/colour-picker.ts
|
|
18137
|
-
let ColourPicker = class ColourPicker extends i$
|
|
19037
|
+
let ColourPicker = class ColourPicker extends i$4 {
|
|
18138
19038
|
constructor(..._args) {
|
|
18139
19039
|
super(..._args);
|
|
18140
19040
|
this.l = .7;
|
|
@@ -18450,7 +19350,7 @@ let ColourPicker = class ColourPicker extends i$3 {
|
|
|
18450
19350
|
}));
|
|
18451
19351
|
}
|
|
18452
19352
|
static {
|
|
18453
|
-
this.styles = i$
|
|
19353
|
+
this.styles = i$7`
|
|
18454
19354
|
/*
|
|
18455
19355
|
* Default intrinsic size — not determined by label text.
|
|
18456
19356
|
* Override via CSS: ixfx-colour-picker { width: 100%; height: 200px; }
|
|
@@ -18650,7 +19550,7 @@ __decorate([e$4(`#slider-c`)], ColourPicker.prototype, "_sliderC", void 0);
|
|
|
18650
19550
|
__decorate([e$4(`#slider-h`)], ColourPicker.prototype, "_sliderH", void 0);
|
|
18651
19551
|
__decorate([e$4(`#slider-a`)], ColourPicker.prototype, "_sliderA", void 0);
|
|
18652
19552
|
__decorate([e$4(`.preview`)], ColourPicker.prototype, "_previewEl", void 0);
|
|
18653
|
-
ColourPicker = __decorate([
|
|
19553
|
+
ColourPicker = __decorate([safeCustomElement(`ixfx-colour-picker`)], ColourPicker);
|
|
18654
19554
|
//#endregion
|
|
18655
19555
|
//#region src/colour-picker/colour-picker-popup.ts
|
|
18656
19556
|
let _instanceCounter = 0;
|
|
@@ -18682,7 +19582,7 @@ function swatchBackground(l, c, h, a) {
|
|
|
18682
19582
|
`;
|
|
18683
19583
|
return oklchToCss(l, c, h);
|
|
18684
19584
|
}
|
|
18685
|
-
let ColourPickerPopup = class ColourPickerPopup extends i$
|
|
19585
|
+
let ColourPickerPopup = class ColourPickerPopup extends i$4 {
|
|
18686
19586
|
constructor() {
|
|
18687
19587
|
super();
|
|
18688
19588
|
this.mode = `fluid`;
|
|
@@ -18878,7 +19778,7 @@ let ColourPickerPopup = class ColourPickerPopup extends i$3 {
|
|
|
18878
19778
|
></ixfx-colour-picker>
|
|
18879
19779
|
${this.mode === `confirm` ? b`
|
|
18880
19780
|
<button class="confirm-btn" @click=${this._onConfirm} aria-label="Confirm colour" title="Confirm colour">
|
|
18881
|
-
${o(ICON_CHECK)}
|
|
19781
|
+
${o$1(ICON_CHECK)}
|
|
18882
19782
|
</button>
|
|
18883
19783
|
` : A}
|
|
18884
19784
|
` : A}
|
|
@@ -18886,7 +19786,7 @@ let ColourPickerPopup = class ColourPickerPopup extends i$3 {
|
|
|
18886
19786
|
`;
|
|
18887
19787
|
}
|
|
18888
19788
|
static {
|
|
18889
|
-
this.styles = [popupSurfaceStyles, i$
|
|
19789
|
+
this.styles = [popupSurfaceStyles, i$7`
|
|
18890
19790
|
:host {
|
|
18891
19791
|
display: inline-block;
|
|
18892
19792
|
}
|
|
@@ -19022,7 +19922,7 @@ __decorate([r$1()], ColourPickerPopup.prototype, "_isOpen", void 0);
|
|
|
19022
19922
|
__decorate([r$1()], ColourPickerPopup.prototype, "_everOpened", void 0);
|
|
19023
19923
|
__decorate([e$4(`.popup`)], ColourPickerPopup.prototype, "_popupEl", void 0);
|
|
19024
19924
|
__decorate([e$4(`ixfx-colour-picker`)], ColourPickerPopup.prototype, "_pickerEl", void 0);
|
|
19025
|
-
ColourPickerPopup = __decorate([
|
|
19925
|
+
ColourPickerPopup = __decorate([safeCustomElement(`ixfx-colour-picker-popup`)], ColourPickerPopup);
|
|
19026
19926
|
//#endregion
|
|
19027
19927
|
//#region src/common/tree-data-model.ts
|
|
19028
19928
|
function findNode(root, key) {
|
|
@@ -19109,7 +20009,7 @@ var TreeDataModel = class {
|
|
|
19109
20009
|
this.#root = root;
|
|
19110
20010
|
this.#cache.clear();
|
|
19111
20011
|
this.#notify({
|
|
19112
|
-
type:
|
|
20012
|
+
type: `root`,
|
|
19113
20013
|
root
|
|
19114
20014
|
});
|
|
19115
20015
|
}
|
|
@@ -19137,7 +20037,7 @@ var TreeDataModel = class {
|
|
|
19137
20037
|
invalidate(key) {
|
|
19138
20038
|
this.#cache.delete(key);
|
|
19139
20039
|
this.#notify({
|
|
19140
|
-
type:
|
|
20040
|
+
type: `invalidate`,
|
|
19141
20041
|
key
|
|
19142
20042
|
});
|
|
19143
20043
|
}
|
|
@@ -19148,7 +20048,7 @@ var TreeDataModel = class {
|
|
|
19148
20048
|
addNode(parentKey, node) {
|
|
19149
20049
|
this.#root = addChildTo(this.#root, parentKey, node);
|
|
19150
20050
|
this.#notify({
|
|
19151
|
-
type:
|
|
20051
|
+
type: `root`,
|
|
19152
20052
|
root: this.#root
|
|
19153
20053
|
});
|
|
19154
20054
|
return this.#root;
|
|
@@ -19161,7 +20061,7 @@ var TreeDataModel = class {
|
|
|
19161
20061
|
this.#cache.delete(key);
|
|
19162
20062
|
this.#root = removeNodeFrom(this.#root, key);
|
|
19163
20063
|
this.#notify({
|
|
19164
|
-
type:
|
|
20064
|
+
type: `root`,
|
|
19165
20065
|
root: this.#root
|
|
19166
20066
|
});
|
|
19167
20067
|
return this.#root;
|
|
@@ -19179,7 +20079,7 @@ var TreeDataModel = class {
|
|
|
19179
20079
|
children: n.children
|
|
19180
20080
|
}));
|
|
19181
20081
|
this.#notify({
|
|
19182
|
-
type:
|
|
20082
|
+
type: `root`,
|
|
19183
20083
|
root: this.#root
|
|
19184
20084
|
});
|
|
19185
20085
|
return this.#root;
|
|
@@ -19191,7 +20091,7 @@ var TreeDataModel = class {
|
|
|
19191
20091
|
moveNode(key, newParentKey) {
|
|
19192
20092
|
this.#root = moveNodeTo(this.#root, key, newParentKey);
|
|
19193
20093
|
this.#notify({
|
|
19194
|
-
type:
|
|
20094
|
+
type: `root`,
|
|
19195
20095
|
root: this.#root
|
|
19196
20096
|
});
|
|
19197
20097
|
return this.#root;
|
|
@@ -19211,315 +20111,9 @@ var TreeDataModel = class {
|
|
|
19211
20111
|
}
|
|
19212
20112
|
};
|
|
19213
20113
|
//#endregion
|
|
19214
|
-
//#region src/incr-search/fuzzy.ts
|
|
19215
|
-
const defaultSelector = (item) => {
|
|
19216
|
-
if (typeof item === `string`) return item;
|
|
19217
|
-
const r = item;
|
|
19218
|
-
if (typeof r[`label`] === `string`) return r[`label`];
|
|
19219
|
-
if (typeof r[`key`] === `string`) return r[`key`];
|
|
19220
|
-
if (typeof r[`value`] === `string`) return r[`value`];
|
|
19221
|
-
return String(item);
|
|
19222
|
-
};
|
|
19223
|
-
function createFuzzySearch(items, options = {}) {
|
|
19224
|
-
const fzf = new Fzf(items, {
|
|
19225
|
-
selector: options.selector ?? defaultSelector,
|
|
19226
|
-
...options.fzf ?? {}
|
|
19227
|
-
});
|
|
19228
|
-
const find = (query) => {
|
|
19229
|
-
if (!query.trim()) return items.map((item) => ({
|
|
19230
|
-
item,
|
|
19231
|
-
positions: /* @__PURE__ */ new Set(),
|
|
19232
|
-
score: 0
|
|
19233
|
-
}));
|
|
19234
|
-
return fzf.find(query).map((r) => ({
|
|
19235
|
-
item: r.item,
|
|
19236
|
-
positions: r.positions,
|
|
19237
|
-
score: r.score
|
|
19238
|
-
}));
|
|
19239
|
-
};
|
|
19240
|
-
return {
|
|
19241
|
-
find,
|
|
19242
|
-
items
|
|
19243
|
-
};
|
|
19244
|
-
}
|
|
19245
|
-
//#endregion
|
|
19246
|
-
//#region src/incr-search/incr-search.ts
|
|
19247
|
-
const buildState = (results, query) => {
|
|
19248
|
-
const positionsByItem = /* @__PURE__ */ new Map();
|
|
19249
|
-
for (const r of results) positionsByItem.set(r.item, r.positions);
|
|
19250
|
-
return Object.freeze({
|
|
19251
|
-
query,
|
|
19252
|
-
results: Object.freeze([...results]),
|
|
19253
|
-
positionsByItem
|
|
19254
|
-
});
|
|
19255
|
-
};
|
|
19256
|
-
function createIncrSearch(options = {}) {
|
|
19257
|
-
let items = options.items ?? [];
|
|
19258
|
-
let query = ``;
|
|
19259
|
-
let fuzzy = createFuzzySearch(items, {
|
|
19260
|
-
selector: options.selector,
|
|
19261
|
-
fzf: options.fzf
|
|
19262
|
-
});
|
|
19263
|
-
let state = buildState(fuzzy.find(query), query);
|
|
19264
|
-
let disposed = false;
|
|
19265
|
-
const observers = /* @__PURE__ */ new Set();
|
|
19266
|
-
if (options.onChange) observers.add(options.onChange);
|
|
19267
|
-
const notify = (s) => {
|
|
19268
|
-
for (const cb of observers) cb(s);
|
|
19269
|
-
};
|
|
19270
|
-
const run = async (q, signal) => {
|
|
19271
|
-
await Promise.resolve();
|
|
19272
|
-
if (signal?.aborted || disposed) return state;
|
|
19273
|
-
const results = fuzzy.find(q);
|
|
19274
|
-
if (signal?.aborted || disposed) return state;
|
|
19275
|
-
state = buildState(results, q);
|
|
19276
|
-
notify(state);
|
|
19277
|
-
return state;
|
|
19278
|
-
};
|
|
19279
|
-
return {
|
|
19280
|
-
get state() {
|
|
19281
|
-
return state;
|
|
19282
|
-
},
|
|
19283
|
-
async setItems(newItems, signal) {
|
|
19284
|
-
items = newItems;
|
|
19285
|
-
fuzzy = createFuzzySearch(items, {
|
|
19286
|
-
selector: options.selector,
|
|
19287
|
-
fzf: options.fzf
|
|
19288
|
-
});
|
|
19289
|
-
await run(query, signal);
|
|
19290
|
-
},
|
|
19291
|
-
async setQuery(q, signal) {
|
|
19292
|
-
query = q;
|
|
19293
|
-
return run(q, signal);
|
|
19294
|
-
},
|
|
19295
|
-
async clearQuery() {
|
|
19296
|
-
query = ``;
|
|
19297
|
-
await run(``, void 0);
|
|
19298
|
-
},
|
|
19299
|
-
onChange(cb) {
|
|
19300
|
-
observers.add(cb);
|
|
19301
|
-
cb(state);
|
|
19302
|
-
return () => {
|
|
19303
|
-
observers.delete(cb);
|
|
19304
|
-
};
|
|
19305
|
-
},
|
|
19306
|
-
dispose() {
|
|
19307
|
-
disposed = true;
|
|
19308
|
-
observers.clear();
|
|
19309
|
-
items = [];
|
|
19310
|
-
}
|
|
19311
|
-
};
|
|
19312
|
-
}
|
|
19313
|
-
//#endregion
|
|
19314
|
-
//#region src/incr-search/element-search.ts
|
|
19315
|
-
const defaultGetLabel = (el) => el.textContent?.trim() ?? ``;
|
|
19316
|
-
const defaultGetKey = (el) => el.getAttribute(`data-key`) ?? el.getAttribute(`data-value`) ?? el.textContent?.trim() ?? ``;
|
|
19317
|
-
function createElementIncrSearch(opts) {
|
|
19318
|
-
const { container, itemSelector, getLabel = defaultGetLabel, getKey = defaultGetKey, labelSelector, highlightKey } = opts;
|
|
19319
|
-
let elementByKey = /* @__PURE__ */ new Map();
|
|
19320
|
-
const search = createIncrSearch({
|
|
19321
|
-
selector: (item) => item.label,
|
|
19322
|
-
fzf: opts.fzf
|
|
19323
|
-
});
|
|
19324
|
-
const updateVisibility = (state) => {
|
|
19325
|
-
const matchedKeys = new Set(state.results.map((r) => r.item.key));
|
|
19326
|
-
const hasQuery = state.query.trim().length > 0;
|
|
19327
|
-
for (const [key, el] of elementByKey) el.hidden = hasQuery ? !matchedKeys.has(key) : false;
|
|
19328
|
-
};
|
|
19329
|
-
const updateHighlights = (state) => {
|
|
19330
|
-
if (!state.query.trim()) {
|
|
19331
|
-
clearHighlights({ key: highlightKey });
|
|
19332
|
-
return;
|
|
19333
|
-
}
|
|
19334
|
-
applyHighlights(buildHighlightTargets(container, labelSelector ?? itemSelector, state.positionsByItem, (el) => {
|
|
19335
|
-
const key = getKey(el);
|
|
19336
|
-
return state.results.find((r) => r.item.key === key)?.item;
|
|
19337
|
-
}, (el) => getLabel(el)), { key: highlightKey });
|
|
19338
|
-
};
|
|
19339
|
-
const unsubscribeState = search.onChange((state) => {
|
|
19340
|
-
updateVisibility(state);
|
|
19341
|
-
updateHighlights(state);
|
|
19342
|
-
opts.onChange?.(state);
|
|
19343
|
-
});
|
|
19344
|
-
let refreshPending = false;
|
|
19345
|
-
const refresh = () => {
|
|
19346
|
-
if (refreshPending) return;
|
|
19347
|
-
refreshPending = true;
|
|
19348
|
-
Promise.resolve().then(() => {
|
|
19349
|
-
refreshPending = false;
|
|
19350
|
-
elementByKey = /* @__PURE__ */ new Map();
|
|
19351
|
-
const els = container.querySelectorAll(itemSelector);
|
|
19352
|
-
const items = [];
|
|
19353
|
-
for (const el of els) {
|
|
19354
|
-
const key = getKey(el);
|
|
19355
|
-
elementByKey.set(key, el);
|
|
19356
|
-
items.push({
|
|
19357
|
-
key,
|
|
19358
|
-
label: getLabel(el)
|
|
19359
|
-
});
|
|
19360
|
-
}
|
|
19361
|
-
search.setItems(items);
|
|
19362
|
-
});
|
|
19363
|
-
};
|
|
19364
|
-
const observer = new MutationObserver(() => refresh());
|
|
19365
|
-
observer.observe(container, {
|
|
19366
|
-
childList: true,
|
|
19367
|
-
subtree: false
|
|
19368
|
-
});
|
|
19369
|
-
refresh();
|
|
19370
|
-
return {
|
|
19371
|
-
async setQuery(query, signal) {
|
|
19372
|
-
await search.setQuery(query, signal);
|
|
19373
|
-
},
|
|
19374
|
-
async clearQuery() {
|
|
19375
|
-
await search.clearQuery();
|
|
19376
|
-
},
|
|
19377
|
-
refresh,
|
|
19378
|
-
onChange(cb) {
|
|
19379
|
-
return search.onChange(cb);
|
|
19380
|
-
},
|
|
19381
|
-
dispose() {
|
|
19382
|
-
observer.disconnect();
|
|
19383
|
-
unsubscribeState();
|
|
19384
|
-
search.dispose();
|
|
19385
|
-
clearHighlights({ key: highlightKey });
|
|
19386
|
-
}
|
|
19387
|
-
};
|
|
19388
|
-
}
|
|
19389
|
-
//#endregion
|
|
19390
|
-
//#region src/incr-search/ac-adapter.ts
|
|
19391
|
-
/**
|
|
19392
|
-
* Creates an ixfx-ac-text-compatible `completionProvider` function from a
|
|
19393
|
-
* static item list. Uses synchronous fuzzy search wrapped in a Promise so it
|
|
19394
|
-
* fits the async provider signature.
|
|
19395
|
-
*
|
|
19396
|
-
* Each returned item has `positions` populated with matched character indices,
|
|
19397
|
-
* which `ixfx-ac-text` uses to render CSS Custom Highlights on the label.
|
|
19398
|
-
*
|
|
19399
|
-
* Empty query returns all items in original order (no positions).
|
|
19400
|
-
* A cancelled signal causes the returned promise to reject with an AbortError.
|
|
19401
|
-
*/
|
|
19402
|
-
function createAcCompletionProvider(items, options = {}) {
|
|
19403
|
-
const fuzzy = createFuzzySearch(items, { selector: options.selector ?? ((item) => item.label) });
|
|
19404
|
-
return (query, signal) => new Promise((resolve, reject) => {
|
|
19405
|
-
if (signal.aborted) {
|
|
19406
|
-
reject(new DOMException(`Aborted`, `AbortError`));
|
|
19407
|
-
return;
|
|
19408
|
-
}
|
|
19409
|
-
const results = fuzzy.find(query).map((r) => ({
|
|
19410
|
-
...r.item,
|
|
19411
|
-
positions: r.positions
|
|
19412
|
-
}));
|
|
19413
|
-
if (signal.aborted) {
|
|
19414
|
-
reject(new DOMException(`Aborted`, `AbortError`));
|
|
19415
|
-
return;
|
|
19416
|
-
}
|
|
19417
|
-
resolve(results);
|
|
19418
|
-
});
|
|
19419
|
-
}
|
|
19420
|
-
//#endregion
|
|
19421
|
-
//#region src/incr-search/controller-tree.ts
|
|
19422
|
-
const DEFAULT_HIGHLIGHT_KEY = `incr-search-highlight`;
|
|
19423
|
-
/**
|
|
19424
|
-
* Incremental-search controller for any component implementing `TreeSearchHost`
|
|
19425
|
-
* (i.e. `ixfx-tree-list`, `ixfx-miller-list`, `ixfx-crumb-navigation`).
|
|
19426
|
-
*
|
|
19427
|
-
* Replaces the previous separate `IncrSearchTreeController` / `IncrSearchMillerController`
|
|
19428
|
-
* classes — the unified `TreeFilterPredicate` (with depth) means one implementation works
|
|
19429
|
-
* for all tree-like components.
|
|
19430
|
-
*
|
|
19431
|
-
* @example Using with ixfx-tree-list:
|
|
19432
|
-
* ```typescript
|
|
19433
|
-
* const ctrl = new IncrSearchTreeController(myTreeList, {
|
|
19434
|
-
* selector: item => item.node.item.label,
|
|
19435
|
-
* });
|
|
19436
|
-
* ctrl.connect();
|
|
19437
|
-
* ```
|
|
19438
|
-
*
|
|
19439
|
-
* @example Using with ixfx-miller-list (different label selector):
|
|
19440
|
-
* ```typescript
|
|
19441
|
-
* const ctrl = new IncrSearchTreeController(myMillerList, {
|
|
19442
|
-
* selector: item => item.node.item.label,
|
|
19443
|
-
* labelSelector: '.label',
|
|
19444
|
-
* });
|
|
19445
|
-
* ctrl.connect();
|
|
19446
|
-
* ```
|
|
19447
|
-
*/
|
|
19448
|
-
var IncrSearchTreeController = class {
|
|
19449
|
-
#el;
|
|
19450
|
-
#opts;
|
|
19451
|
-
#search;
|
|
19452
|
-
#unsub;
|
|
19453
|
-
#labelMap = /* @__PURE__ */ new Map();
|
|
19454
|
-
constructor(el, opts) {
|
|
19455
|
-
this.#el = el;
|
|
19456
|
-
this.#opts = opts;
|
|
19457
|
-
this.#search = createIncrSearch({
|
|
19458
|
-
selector: opts.selector,
|
|
19459
|
-
fzf: opts.fzf
|
|
19460
|
-
});
|
|
19461
|
-
}
|
|
19462
|
-
connect() {
|
|
19463
|
-
this.disconnect();
|
|
19464
|
-
const items = this.#el.getNodes();
|
|
19465
|
-
for (const item of items) this.#labelMap.set(this.#opts.selector(item), item);
|
|
19466
|
-
this.#search.setItems(items);
|
|
19467
|
-
if (this.#opts.input) {
|
|
19468
|
-
this.#opts.input.addEventListener(`input`, this.#onInput);
|
|
19469
|
-
this.#opts.input.addEventListener(`keydown`, this.#onKeydown);
|
|
19470
|
-
}
|
|
19471
|
-
this.#unsub = this.#search.onChange((state) => this.#onStateChange(state));
|
|
19472
|
-
}
|
|
19473
|
-
disconnect() {
|
|
19474
|
-
if (this.#unsub) {
|
|
19475
|
-
this.#unsub();
|
|
19476
|
-
this.#unsub = void 0;
|
|
19477
|
-
}
|
|
19478
|
-
if (this.#opts.input) {
|
|
19479
|
-
this.#opts.input.removeEventListener(`input`, this.#onInput);
|
|
19480
|
-
this.#opts.input.removeEventListener(`keydown`, this.#onKeydown);
|
|
19481
|
-
}
|
|
19482
|
-
this.#el.filterPredicate = void 0;
|
|
19483
|
-
clearHighlights({ key: this.#opts.highlightKey ?? DEFAULT_HIGHLIGHT_KEY });
|
|
19484
|
-
this.#labelMap.clear();
|
|
19485
|
-
}
|
|
19486
|
-
async setQuery(query) {
|
|
19487
|
-
await this.#search.setQuery(query);
|
|
19488
|
-
}
|
|
19489
|
-
async clearQuery() {
|
|
19490
|
-
await this.#search.clearQuery();
|
|
19491
|
-
}
|
|
19492
|
-
#onInput = () => {
|
|
19493
|
-
const value = this.#opts.input?.value ?? ``;
|
|
19494
|
-
this.setQuery(value);
|
|
19495
|
-
};
|
|
19496
|
-
#onKeydown = (e) => {
|
|
19497
|
-
if (e.key === `Escape` && this.#opts.input) {
|
|
19498
|
-
this.#opts.input.value = ``;
|
|
19499
|
-
this.clearQuery();
|
|
19500
|
-
}
|
|
19501
|
-
};
|
|
19502
|
-
#onStateChange(state) {
|
|
19503
|
-
const matched = new Set(state.results.map((r) => r.item.node.item.key));
|
|
19504
|
-
const hasQuery = state.query.trim().length > 0;
|
|
19505
|
-
this.#el.filterPredicate = hasQuery && matched.size > 0 ? (node, _depth) => matched.has(node.item.key) : void 0;
|
|
19506
|
-
const key = this.#opts.highlightKey ?? DEFAULT_HIGHLIGHT_KEY;
|
|
19507
|
-
if (!this.#el.shadowRoot) return;
|
|
19508
|
-
if (!state.query.trim()) {
|
|
19509
|
-
clearHighlights({ key });
|
|
19510
|
-
return;
|
|
19511
|
-
}
|
|
19512
|
-
const labelSelector = this.#opts.labelSelector ?? `.tree-label`;
|
|
19513
|
-
applyHighlights(buildHighlightTargets(this.#el.shadowRoot, labelSelector, state.positionsByItem, (labelEl) => {
|
|
19514
|
-
const text = labelEl.textContent ?? ``;
|
|
19515
|
-
return this.#labelMap.get(text);
|
|
19516
|
-
}, (labelEl) => labelEl.textContent ?? ``), { key });
|
|
19517
|
-
}
|
|
19518
|
-
};
|
|
19519
|
-
//#endregion
|
|
19520
20114
|
//#region src/narrowed-text/narrowed-text.ts
|
|
19521
20115
|
const HIGHLIGHT_KEY = `narrowed-text-highlight`;
|
|
19522
|
-
let NarrowedTextElement = class NarrowedTextElement extends i$
|
|
20116
|
+
let NarrowedTextElement = class NarrowedTextElement extends i$4 {
|
|
19523
20117
|
constructor(..._args) {
|
|
19524
20118
|
super(..._args);
|
|
19525
20119
|
this.selectionMode = `single`;
|
|
@@ -19896,7 +20490,7 @@ let NarrowedTextElement = class NarrowedTextElement extends i$3 {
|
|
|
19896
20490
|
this.styles = [
|
|
19897
20491
|
tickledStyles,
|
|
19898
20492
|
tickledItemStyles,
|
|
19899
|
-
i$
|
|
20493
|
+
i$7`
|
|
19900
20494
|
:host {
|
|
19901
20495
|
display: inline-block;
|
|
19902
20496
|
position: relative;
|
|
@@ -20076,20 +20670,20 @@ __decorate([r$1()], NarrowedTextElement.prototype, "_computedItems", void 0);
|
|
|
20076
20670
|
__decorate([r$1()], NarrowedTextElement.prototype, "_filteredItems", void 0);
|
|
20077
20671
|
__decorate([r$1()], NarrowedTextElement.prototype, "_isFocused", void 0);
|
|
20078
20672
|
__decorate([e$4(`slot`)], NarrowedTextElement.prototype, "_slot", void 0);
|
|
20079
|
-
NarrowedTextElement = __decorate([
|
|
20673
|
+
NarrowedTextElement = __decorate([safeCustomElement(`ixfx-narrowed-text`)], NarrowedTextElement);
|
|
20080
20674
|
//#endregion
|
|
20081
20675
|
//#region src/crumbs/crumb-navigation.ts
|
|
20082
|
-
let CrumbNavigationElement = class CrumbNavigationElement extends i$
|
|
20676
|
+
let CrumbNavigationElement = class CrumbNavigationElement extends i$4 {
|
|
20083
20677
|
constructor(..._args) {
|
|
20084
20678
|
super(..._args);
|
|
20085
20679
|
this._selectedNodes = /* @__PURE__ */ new Set();
|
|
20086
|
-
this.exclusivity =
|
|
20087
|
-
this.selectionFilter =
|
|
20680
|
+
this.exclusivity = `none`;
|
|
20681
|
+
this.selectionFilter = `leaf`;
|
|
20088
20682
|
this._openIdx = -1;
|
|
20089
20683
|
this._isFocused = false;
|
|
20090
20684
|
this._menuOpen = false;
|
|
20091
20685
|
this._focusOnNarrowedText = false;
|
|
20092
|
-
this.inputMode =
|
|
20686
|
+
this.inputMode = ``;
|
|
20093
20687
|
this.#previousSelectionKey = ``;
|
|
20094
20688
|
this.#menuOpenedByKeyboard = false;
|
|
20095
20689
|
this.#currentOpenTrigger = null;
|
|
@@ -20354,7 +20948,7 @@ let CrumbNavigationElement = class CrumbNavigationElement extends i$3 {
|
|
|
20354
20948
|
if (model) {
|
|
20355
20949
|
this.root = model.root;
|
|
20356
20950
|
this.#modelUnsubscribe = model._subscribe((event) => {
|
|
20357
|
-
if (event.type ===
|
|
20951
|
+
if (event.type === `root`) {
|
|
20358
20952
|
this.root = event.root;
|
|
20359
20953
|
this.requestUpdate();
|
|
20360
20954
|
}
|
|
@@ -20678,7 +21272,7 @@ let CrumbNavigationElement = class CrumbNavigationElement extends i$3 {
|
|
|
20678
21272
|
this.styles = [
|
|
20679
21273
|
tickledStyles,
|
|
20680
21274
|
tickledItemStyles,
|
|
20681
|
-
i$
|
|
21275
|
+
i$7`
|
|
20682
21276
|
:host {
|
|
20683
21277
|
--text-highlight: var(--accent);
|
|
20684
21278
|
--separator: var(--surface-muted-text);
|
|
@@ -20841,11 +21435,11 @@ __decorate([n$2({ attribute: false })], CrumbNavigationElement.prototype, "loadC
|
|
|
20841
21435
|
__decorate([n$2({ attribute: false })], CrumbNavigationElement.prototype, "filterPredicate", void 0);
|
|
20842
21436
|
__decorate([n$2({
|
|
20843
21437
|
reflect: true,
|
|
20844
|
-
attribute:
|
|
21438
|
+
attribute: `exclusivity`
|
|
20845
21439
|
})], CrumbNavigationElement.prototype, "exclusivity", void 0);
|
|
20846
21440
|
__decorate([n$2({
|
|
20847
21441
|
reflect: true,
|
|
20848
|
-
attribute:
|
|
21442
|
+
attribute: `selection-filter`
|
|
20849
21443
|
})], CrumbNavigationElement.prototype, "selectionFilter", void 0);
|
|
20850
21444
|
__decorate([r$1()], CrumbNavigationElement.prototype, "_openIdx", void 0);
|
|
20851
21445
|
__decorate([r$1()], CrumbNavigationElement.prototype, "_isFocused", void 0);
|
|
@@ -20853,9 +21447,9 @@ __decorate([r$1()], CrumbNavigationElement.prototype, "_menuOpen", void 0);
|
|
|
20853
21447
|
__decorate([r$1()], CrumbNavigationElement.prototype, "_focusOnNarrowedText", void 0);
|
|
20854
21448
|
__decorate([n$2({
|
|
20855
21449
|
reflect: true,
|
|
20856
|
-
attribute:
|
|
21450
|
+
attribute: `input-mode`
|
|
20857
21451
|
})], CrumbNavigationElement.prototype, "inputMode", void 0);
|
|
20858
|
-
CrumbNavigationElement = __decorate([
|
|
21452
|
+
CrumbNavigationElement = __decorate([safeCustomElement(`ixfx-crumb-navigation`)], CrumbNavigationElement);
|
|
20859
21453
|
//#endregion
|
|
20860
21454
|
//#region src/crumbs/crumb-path-controller.ts
|
|
20861
21455
|
var CrumbPathController = class {
|
|
@@ -20922,7 +21516,7 @@ var CrumbPathController = class {
|
|
|
20922
21516
|
//#endregion
|
|
20923
21517
|
//#region src/crumbs/crumb-path.ts
|
|
20924
21518
|
const INVALID_ANCHOR_CHARS_RE = /[^\w-]/g;
|
|
20925
|
-
let CrumbPathElement = class CrumbPathElement extends i$
|
|
21519
|
+
let CrumbPathElement = class CrumbPathElement extends i$4 {
|
|
20926
21520
|
constructor(..._args) {
|
|
20927
21521
|
super(..._args);
|
|
20928
21522
|
this.path = ``;
|
|
@@ -21011,7 +21605,7 @@ let CrumbPathElement = class CrumbPathElement extends i$3 {
|
|
|
21011
21605
|
updated(changedProperties) {
|
|
21012
21606
|
if (this._editing) {
|
|
21013
21607
|
const el = this.shadowRoot?.querySelector(`ixfx-ac-text`);
|
|
21014
|
-
if (el instanceof i$
|
|
21608
|
+
if (el instanceof i$4) {
|
|
21015
21609
|
const editValue = this.path;
|
|
21016
21610
|
if (this._editStartIndex !== null) {
|
|
21017
21611
|
const segmentLabel = this.#getSegments()[this._editStartIndex];
|
|
@@ -21350,7 +21944,7 @@ let CrumbPathElement = class CrumbPathElement extends i$3 {
|
|
|
21350
21944
|
`;
|
|
21351
21945
|
}
|
|
21352
21946
|
static {
|
|
21353
|
-
this.styles = [popupSurfaceStyles, i$
|
|
21947
|
+
this.styles = [popupSurfaceStyles, i$7`
|
|
21354
21948
|
:host {
|
|
21355
21949
|
--text-highlight: var(--accent);
|
|
21356
21950
|
--separator: var(--surface-muted-text);
|
|
@@ -21540,16 +22134,16 @@ __decorate([r$1()], CrumbPathElement.prototype, "_dropdownActiveIndex", void 0);
|
|
|
21540
22134
|
__decorate([r$1()], CrumbPathElement.prototype, "_editingCancelled", void 0);
|
|
21541
22135
|
__decorate([r$1()], CrumbPathElement.prototype, "_editStartIndex", void 0);
|
|
21542
22136
|
__decorate([r$1()], CrumbPathElement.prototype, "_openCumPath", void 0);
|
|
21543
|
-
CrumbPathElement = __decorate([
|
|
22137
|
+
CrumbPathElement = __decorate([safeCustomElement(`ixfx-crumb-path`)], CrumbPathElement);
|
|
21544
22138
|
//#endregion
|
|
21545
22139
|
//#region src/data-display.ts
|
|
21546
22140
|
var _DataDisplayComponent;
|
|
21547
|
-
let DataDisplayComponent = class DataDisplayComponent extends i$
|
|
22141
|
+
let DataDisplayComponent = class DataDisplayComponent extends i$4 {
|
|
21548
22142
|
static {
|
|
21549
22143
|
_DataDisplayComponent = this;
|
|
21550
22144
|
}
|
|
21551
22145
|
static {
|
|
21552
|
-
this.styles = i$
|
|
22146
|
+
this.styles = i$7`
|
|
21553
22147
|
:host {
|
|
21554
22148
|
display: block;
|
|
21555
22149
|
}
|
|
@@ -21633,10 +22227,10 @@ let DataDisplayComponent = class DataDisplayComponent extends i$3 {
|
|
|
21633
22227
|
this.previousValue = value;
|
|
21634
22228
|
}
|
|
21635
22229
|
};
|
|
21636
|
-
DataDisplayComponent = _DataDisplayComponent = __decorate([
|
|
22230
|
+
DataDisplayComponent = _DataDisplayComponent = __decorate([safeCustomElement(`ixfx-data-display`)], DataDisplayComponent);
|
|
21637
22231
|
//#endregion
|
|
21638
22232
|
//#region src/editable-label/editable-label.ts
|
|
21639
|
-
let EditableLabel = class EditableLabel extends i$
|
|
22233
|
+
let EditableLabel = class EditableLabel extends i$4 {
|
|
21640
22234
|
constructor(..._args) {
|
|
21641
22235
|
super(..._args);
|
|
21642
22236
|
this.mode = `label`;
|
|
@@ -21667,6 +22261,9 @@ let EditableLabel = class EditableLabel extends i$3 {
|
|
|
21667
22261
|
this._hovering = false;
|
|
21668
22262
|
this._startTransientRevertTimer();
|
|
21669
22263
|
};
|
|
22264
|
+
this._handleClick = () => {
|
|
22265
|
+
if (this.mode === `label` && !this.disabled && !this._editing) this._beginEdit();
|
|
22266
|
+
};
|
|
21670
22267
|
this._handleFocus = () => {
|
|
21671
22268
|
if (this.mode === `editor` && !this.disabled && !this._editing) this._beginEdit();
|
|
21672
22269
|
};
|
|
@@ -21702,6 +22299,17 @@ let EditableLabel = class EditableLabel extends i$3 {
|
|
|
21702
22299
|
get _contentEl() {
|
|
21703
22300
|
return this.renderRoot?.querySelector(`.content`) ?? void 0;
|
|
21704
22301
|
}
|
|
22302
|
+
connectedCallback() {
|
|
22303
|
+
super.connectedCallback();
|
|
22304
|
+
this.addEventListener(`mouseenter`, this._onMouseEnter);
|
|
22305
|
+
this.addEventListener(`mouseleave`, this._onMouseLeave);
|
|
22306
|
+
}
|
|
22307
|
+
disconnectedCallback() {
|
|
22308
|
+
super.disconnectedCallback();
|
|
22309
|
+
this.removeEventListener(`mouseenter`, this._onMouseEnter);
|
|
22310
|
+
this.removeEventListener(`mouseleave`, this._onMouseLeave);
|
|
22311
|
+
this._clearTransientTimer();
|
|
22312
|
+
}
|
|
21705
22313
|
_clearTransientTimer() {
|
|
21706
22314
|
if (this._transientTimer !== void 0) {
|
|
21707
22315
|
clearTimeout(this._transientTimer);
|
|
@@ -21795,8 +22403,34 @@ let EditableLabel = class EditableLabel extends i$3 {
|
|
|
21795
22403
|
default: return true;
|
|
21796
22404
|
}
|
|
21797
22405
|
}
|
|
22406
|
+
render() {
|
|
22407
|
+
const isEditor = this.mode === `editor`;
|
|
22408
|
+
return b`<div
|
|
22409
|
+
class="content"
|
|
22410
|
+
contenteditable=${this._editing ? `plaintext-only` : `false`}
|
|
22411
|
+
data-placeholder=${this.placeholder}
|
|
22412
|
+
tabindex=${isEditor && !this._editing ? `0` : A}
|
|
22413
|
+
@click=${this._handleClick}
|
|
22414
|
+
@focus=${this._handleFocus}
|
|
22415
|
+
@blur=${this._handleBlur}
|
|
22416
|
+
@keydown=${this._handleKeydown}
|
|
22417
|
+
@beforeinput=${this._handleBeforeInput}
|
|
22418
|
+
@input=${this._handleInput}
|
|
22419
|
+
>${this._editing ? A : this._getDisplayText()}</div>`;
|
|
22420
|
+
}
|
|
22421
|
+
updated(changed) {
|
|
22422
|
+
super.updated(changed);
|
|
22423
|
+
if (changed.has(`_editing`) && this._editing) {
|
|
22424
|
+
const el = this._contentEl;
|
|
22425
|
+
if (el) {
|
|
22426
|
+
el.textContent = this.value;
|
|
22427
|
+
el.focus();
|
|
22428
|
+
_selectAll(el);
|
|
22429
|
+
}
|
|
22430
|
+
}
|
|
22431
|
+
}
|
|
21798
22432
|
static {
|
|
21799
|
-
this.styles = [i$
|
|
22433
|
+
this.styles = [i$7`
|
|
21800
22434
|
:host {
|
|
21801
22435
|
display: inline-flex;
|
|
21802
22436
|
align-items: center;
|
|
@@ -21906,7 +22540,14 @@ __decorate([n$2({
|
|
|
21906
22540
|
__decorate([n$2({ attribute: false })], EditableLabel.prototype, "validator", void 0);
|
|
21907
22541
|
__decorate([n$2({ attribute: false })], EditableLabel.prototype, "formatter", void 0);
|
|
21908
22542
|
__decorate([r$1()], EditableLabel.prototype, "_editing", void 0);
|
|
21909
|
-
EditableLabel = __decorate([
|
|
22543
|
+
EditableLabel = __decorate([safeCustomElement(`ixfx-editable-label`)], EditableLabel);
|
|
22544
|
+
function _selectAll(el) {
|
|
22545
|
+
const range = document.createRange();
|
|
22546
|
+
range.selectNodeContents(el);
|
|
22547
|
+
const sel = window.getSelection();
|
|
22548
|
+
sel?.removeAllRanges();
|
|
22549
|
+
sel?.addRange(range);
|
|
22550
|
+
}
|
|
21910
22551
|
//#endregion
|
|
21911
22552
|
//#region src/keyboard.ts
|
|
21912
22553
|
/**
|
|
@@ -22326,7 +22967,7 @@ let EditableNumber = class EditableNumber extends EditableLabel {
|
|
|
22326
22967
|
this.styles = [
|
|
22327
22968
|
prominenceStyles,
|
|
22328
22969
|
...EditableLabel.styles,
|
|
22329
|
-
i$
|
|
22970
|
+
i$7`
|
|
22330
22971
|
:host {
|
|
22331
22972
|
font-size: var(--text-s,11px);
|
|
22332
22973
|
--value: 0;
|
|
@@ -22501,14 +23142,14 @@ __decorate([n$2({
|
|
|
22501
23142
|
attribute: `no-drag`
|
|
22502
23143
|
})], EditableNumber.prototype, "noDrag", void 0);
|
|
22503
23144
|
__decorate([n$2({ type: Number })], EditableNumber.prototype, "precision", void 0);
|
|
22504
|
-
EditableNumber = __decorate([
|
|
23145
|
+
EditableNumber = __decorate([safeCustomElement(`ixfx-editable-number`)], EditableNumber);
|
|
22505
23146
|
//#endregion
|
|
22506
|
-
//#region node_modules/.pnpm/lit-html@3.3.
|
|
23147
|
+
//#region node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive-helpers.js
|
|
22507
23148
|
/**
|
|
22508
23149
|
* @license
|
|
22509
23150
|
* Copyright 2020 Google LLC
|
|
22510
23151
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22511
|
-
*/ const { I: t$1 } = j$1, i = (o) => o, s = () => document.createComment(""), v = (o, n, e) => {
|
|
23152
|
+
*/ const { I: t$1 } = j$1, i$2 = (o) => o, s = () => document.createComment(""), v = (o, n, e) => {
|
|
22512
23153
|
const l = o._$AA.parentNode, d = void 0 === n ? o._$AB : n._$AA;
|
|
22513
23154
|
if (void 0 === e) e = new t$1(l.insertBefore(s(), d), l.insertBefore(s(), d), o, o.options);
|
|
22514
23155
|
else {
|
|
@@ -22520,8 +23161,8 @@ EditableNumber = __decorate([t$4(`ixfx-editable-number`)], EditableNumber);
|
|
|
22520
23161
|
if (t !== d || c) {
|
|
22521
23162
|
let o = e._$AA;
|
|
22522
23163
|
for (; o !== t;) {
|
|
22523
|
-
const t = i(o).nextSibling;
|
|
22524
|
-
i(l).insertBefore(o, d), o = t;
|
|
23164
|
+
const t = i$2(o).nextSibling;
|
|
23165
|
+
i$2(l).insertBefore(o, d), o = t;
|
|
22525
23166
|
}
|
|
22526
23167
|
}
|
|
22527
23168
|
}
|
|
@@ -22530,7 +23171,7 @@ EditableNumber = __decorate([t$4(`ixfx-editable-number`)], EditableNumber);
|
|
|
22530
23171
|
o._$AR(), o._$AA.remove();
|
|
22531
23172
|
};
|
|
22532
23173
|
//#endregion
|
|
22533
|
-
//#region node_modules/.pnpm/lit-html@3.3.
|
|
23174
|
+
//#region node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/repeat.js
|
|
22534
23175
|
/**
|
|
22535
23176
|
* @license
|
|
22536
23177
|
* Copyright 2017 Google LLC
|
|
@@ -22540,7 +23181,7 @@ const u = (e, s, t) => {
|
|
|
22540
23181
|
const r = /* @__PURE__ */ new Map();
|
|
22541
23182
|
for (let l = s; l <= t; l++) r.set(e[l], l);
|
|
22542
23183
|
return r;
|
|
22543
|
-
}, c = e$3(class extends i$
|
|
23184
|
+
}, c = e$3(class extends i$3 {
|
|
22544
23185
|
constructor(e) {
|
|
22545
23186
|
if (super(e), e.type !== t$2.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
22546
23187
|
}
|
|
@@ -22590,6 +23231,37 @@ const u = (e, s, t) => {
|
|
|
22590
23231
|
}
|
|
22591
23232
|
});
|
|
22592
23233
|
//#endregion
|
|
23234
|
+
//#region node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/style-map.js
|
|
23235
|
+
/**
|
|
23236
|
+
* @license
|
|
23237
|
+
* Copyright 2018 Google LLC
|
|
23238
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23239
|
+
*/ const n = "important", i$1 = " !" + n, o = e$3(class extends i$3 {
|
|
23240
|
+
constructor(t) {
|
|
23241
|
+
if (super(t), t.type !== t$2.ATTRIBUTE || "style" !== t.name || t.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
23242
|
+
}
|
|
23243
|
+
render(t) {
|
|
23244
|
+
return Object.keys(t).reduce((e, r) => {
|
|
23245
|
+
const s = t[r];
|
|
23246
|
+
return null == s ? e : e + `${r = r.includes("-") ? r : r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
|
|
23247
|
+
}, "");
|
|
23248
|
+
}
|
|
23249
|
+
update(e, [r]) {
|
|
23250
|
+
const { style: s } = e.element;
|
|
23251
|
+
if (void 0 === this.ft) return this.ft = new Set(Object.keys(r)), this.render(r);
|
|
23252
|
+
for (const t of this.ft) r[t] ?? (this.ft.delete(t), t.includes("-") ? s.removeProperty(t) : s[t] = null);
|
|
23253
|
+
for (const t in r) {
|
|
23254
|
+
const e = r[t];
|
|
23255
|
+
if (null != e) {
|
|
23256
|
+
this.ft.add(t);
|
|
23257
|
+
const r = "string" == typeof e && e.endsWith(i$1);
|
|
23258
|
+
t.includes("-") || r ? s.setProperty(t, r ? e.slice(0, -11) : e, r ? n : "") : s[t] = e;
|
|
23259
|
+
}
|
|
23260
|
+
}
|
|
23261
|
+
return E;
|
|
23262
|
+
}
|
|
23263
|
+
});
|
|
23264
|
+
//#endregion
|
|
22593
23265
|
//#region src/hex/colour.ts
|
|
22594
23266
|
const WHITESPACE_BYTES = new Set([
|
|
22595
23267
|
9,
|
|
@@ -22599,45 +23271,45 @@ const WHITESPACE_BYTES = new Set([
|
|
|
22599
23271
|
13,
|
|
22600
23272
|
32
|
|
22601
23273
|
]);
|
|
22602
|
-
|
|
23274
|
+
function isControlByte(byte) {
|
|
22603
23275
|
return byte < 32 && byte !== 9 && byte !== 10 && byte !== 11 && byte !== 12 && byte !== 13;
|
|
22604
|
-
}
|
|
22605
|
-
|
|
23276
|
+
}
|
|
23277
|
+
function isPrintableAscii(byte) {
|
|
22606
23278
|
return byte >= 32 && byte <= 126;
|
|
22607
|
-
}
|
|
22608
|
-
|
|
22609
|
-
if (byte === 0) return
|
|
22610
|
-
if (WHITESPACE_BYTES.has(byte)) return
|
|
22611
|
-
if (isControlByte(byte)) return
|
|
22612
|
-
if (isPrintableAscii(byte)) return
|
|
22613
|
-
return
|
|
22614
|
-
}
|
|
22615
|
-
|
|
23279
|
+
}
|
|
23280
|
+
function getAsciiClass(byte) {
|
|
23281
|
+
if (byte === 0) return `byte-null`;
|
|
23282
|
+
if (WHITESPACE_BYTES.has(byte)) return `byte-whitespace`;
|
|
23283
|
+
if (isControlByte(byte)) return `byte-control`;
|
|
23284
|
+
if (isPrintableAscii(byte)) return `byte-printable`;
|
|
23285
|
+
return `byte-other`;
|
|
23286
|
+
}
|
|
23287
|
+
function createShadeMap(nullColour, maxColour, stepStart, stepEnd) {
|
|
22616
23288
|
const cssSteps = colour_exports.createSteps(stepStart, stepEnd, { steps: 16 }).map(colour_exports.toCssColour);
|
|
22617
23289
|
return { forByte: (byte) => {
|
|
22618
23290
|
if (byte === 0) return nullColour;
|
|
22619
23291
|
if (byte === 255) return maxColour;
|
|
22620
23292
|
return cssSteps[byte >> 4];
|
|
22621
23293
|
} };
|
|
22622
|
-
}
|
|
23294
|
+
}
|
|
22623
23295
|
//#endregion
|
|
22624
23296
|
//#region src/hex/data.ts
|
|
22625
|
-
|
|
23297
|
+
function createHexStore(data) {
|
|
22626
23298
|
return {
|
|
22627
23299
|
data: new Uint8Array(data),
|
|
22628
23300
|
changeset: /* @__PURE__ */ new Set()
|
|
22629
23301
|
};
|
|
22630
|
-
}
|
|
22631
|
-
|
|
23302
|
+
}
|
|
23303
|
+
function readByte(store, pos) {
|
|
22632
23304
|
return store.data[pos] ?? 0;
|
|
22633
|
-
}
|
|
22634
|
-
|
|
23305
|
+
}
|
|
23306
|
+
function length(store) {
|
|
22635
23307
|
return store.data.length;
|
|
22636
|
-
}
|
|
22637
|
-
|
|
23308
|
+
}
|
|
23309
|
+
function clamp$1(value) {
|
|
22638
23310
|
return Math.max(0, Math.min(255, value));
|
|
22639
|
-
}
|
|
22640
|
-
|
|
23311
|
+
}
|
|
23312
|
+
function writeByte(store, pos, value) {
|
|
22641
23313
|
const clampedValue = clamp$1(value);
|
|
22642
23314
|
const before = store.data[pos];
|
|
22643
23315
|
const diff = new Map([[pos, {
|
|
@@ -22647,8 +23319,8 @@ const writeByte = (store, pos, value) => {
|
|
|
22647
23319
|
store.data[pos] = clampedValue;
|
|
22648
23320
|
store.changeset.add(pos);
|
|
22649
23321
|
return diff;
|
|
22650
|
-
}
|
|
22651
|
-
|
|
23322
|
+
}
|
|
23323
|
+
function writeBytes(store, entries) {
|
|
22652
23324
|
const diff = /* @__PURE__ */ new Map();
|
|
22653
23325
|
entries.forEach((value, pos) => {
|
|
22654
23326
|
const clampedValue = clamp$1(value);
|
|
@@ -22661,8 +23333,8 @@ const writeBytes = (store, entries) => {
|
|
|
22661
23333
|
store.changeset.add(pos);
|
|
22662
23334
|
});
|
|
22663
23335
|
return diff;
|
|
22664
|
-
}
|
|
22665
|
-
|
|
23336
|
+
}
|
|
23337
|
+
function applyDiff(store, diff) {
|
|
22666
23338
|
const reverse = /* @__PURE__ */ new Map();
|
|
22667
23339
|
diff.forEach((entry, pos) => {
|
|
22668
23340
|
const before = store.data[pos];
|
|
@@ -22674,8 +23346,8 @@ const applyDiff = (store, diff) => {
|
|
|
22674
23346
|
store.changeset.add(pos);
|
|
22675
23347
|
});
|
|
22676
23348
|
return reverse;
|
|
22677
|
-
}
|
|
22678
|
-
|
|
23349
|
+
}
|
|
23350
|
+
function reverseDiff(diff) {
|
|
22679
23351
|
const reversed = /* @__PURE__ */ new Map();
|
|
22680
23352
|
diff.forEach((entry, pos) => {
|
|
22681
23353
|
reversed.set(pos, {
|
|
@@ -22684,52 +23356,52 @@ const reverseDiff = (diff) => {
|
|
|
22684
23356
|
});
|
|
22685
23357
|
});
|
|
22686
23358
|
return reversed;
|
|
22687
|
-
}
|
|
22688
|
-
|
|
23359
|
+
}
|
|
23360
|
+
function getChangeset(store) {
|
|
22689
23361
|
return store.changeset;
|
|
22690
|
-
}
|
|
23362
|
+
}
|
|
22691
23363
|
//#endregion
|
|
22692
23364
|
//#region src/hex/diff.ts
|
|
22693
|
-
|
|
23365
|
+
function createUndoRedoStack() {
|
|
22694
23366
|
return {
|
|
22695
23367
|
undos: [],
|
|
22696
23368
|
redos: []
|
|
22697
23369
|
};
|
|
22698
|
-
}
|
|
22699
|
-
|
|
23370
|
+
}
|
|
23371
|
+
function push(stack, diff) {
|
|
22700
23372
|
stack.undos.push(diff);
|
|
22701
23373
|
stack.redos = [];
|
|
22702
|
-
}
|
|
22703
|
-
|
|
23374
|
+
}
|
|
23375
|
+
function undo(stack) {
|
|
22704
23376
|
const diff = stack.undos.pop();
|
|
22705
23377
|
if (diff) stack.redos.push(diff);
|
|
22706
23378
|
return diff;
|
|
22707
|
-
}
|
|
22708
|
-
|
|
23379
|
+
}
|
|
23380
|
+
function redo(stack) {
|
|
22709
23381
|
const diff = stack.redos.pop();
|
|
22710
23382
|
if (diff) stack.undos.push(diff);
|
|
22711
23383
|
return diff;
|
|
22712
|
-
}
|
|
23384
|
+
}
|
|
22713
23385
|
//#endregion
|
|
22714
23386
|
//#region src/hex/selection.ts
|
|
22715
23387
|
const bytesPerRow = (columns) => columns * 4;
|
|
22716
23388
|
const min = (a, b) => a < b ? a : b;
|
|
22717
23389
|
const max = (a, b) => a > b ? a : b;
|
|
22718
|
-
|
|
23390
|
+
function clampPos(pos, dataLength) {
|
|
22719
23391
|
return Math.max(0, Math.min(pos, dataLength - 1));
|
|
22720
|
-
}
|
|
22721
|
-
|
|
23392
|
+
}
|
|
23393
|
+
function getSelectedPositions(sel, columns) {
|
|
22722
23394
|
if (!sel) return [];
|
|
22723
23395
|
const bpr = bytesPerRow(columns);
|
|
22724
|
-
if (sel.kind ===
|
|
22725
|
-
if (sel.kind ===
|
|
23396
|
+
if (sel.kind === `single`) return [sel.pos];
|
|
23397
|
+
if (sel.kind === `contiguous`) {
|
|
22726
23398
|
const start = min(sel.start, sel.end);
|
|
22727
23399
|
const end = max(sel.start, sel.end);
|
|
22728
23400
|
const positions = [];
|
|
22729
23401
|
for (let i = start; i <= end; i++) positions.push(i);
|
|
22730
23402
|
return positions;
|
|
22731
23403
|
}
|
|
22732
|
-
if (sel.kind ===
|
|
23404
|
+
if (sel.kind === `rectangular`) {
|
|
22733
23405
|
const positions = [];
|
|
22734
23406
|
for (let row = 0; row < sel.height; row++) for (let col = 0; col < sel.width; col++) {
|
|
22735
23407
|
const y = sel.y + row;
|
|
@@ -22740,17 +23412,17 @@ const getSelectedPositions = (sel, columns) => {
|
|
|
22740
23412
|
return positions;
|
|
22741
23413
|
}
|
|
22742
23414
|
return [];
|
|
22743
|
-
}
|
|
22744
|
-
|
|
23415
|
+
}
|
|
23416
|
+
function selectionContains(sel, pos, columns) {
|
|
22745
23417
|
if (!sel) return false;
|
|
22746
23418
|
const bpr = bytesPerRow(columns);
|
|
22747
|
-
if (sel.kind ===
|
|
22748
|
-
if (sel.kind ===
|
|
23419
|
+
if (sel.kind === `single`) return pos === sel.pos;
|
|
23420
|
+
if (sel.kind === `contiguous`) {
|
|
22749
23421
|
const start = min(sel.start, sel.end);
|
|
22750
23422
|
const end = max(sel.start, sel.end);
|
|
22751
23423
|
return pos >= start && pos <= end;
|
|
22752
23424
|
}
|
|
22753
|
-
if (sel.kind ===
|
|
23425
|
+
if (sel.kind === `rectangular`) {
|
|
22754
23426
|
const row = Math.floor(pos / bpr);
|
|
22755
23427
|
const col = pos % bpr;
|
|
22756
23428
|
const x = sel.x;
|
|
@@ -22760,59 +23432,59 @@ const selectionContains = (sel, pos, columns) => {
|
|
|
22760
23432
|
return row >= y && row < y + height && col >= x && col < x + width;
|
|
22761
23433
|
}
|
|
22762
23434
|
return false;
|
|
22763
|
-
}
|
|
22764
|
-
|
|
23435
|
+
}
|
|
23436
|
+
function getCursorPos(sel, dir, columns, dataLength) {
|
|
22765
23437
|
let currentPos;
|
|
22766
23438
|
if (!sel) currentPos = 0;
|
|
22767
|
-
else if (sel.kind ===
|
|
22768
|
-
else if (sel.kind ===
|
|
22769
|
-
else if (sel.kind ===
|
|
23439
|
+
else if (sel.kind === `single`) currentPos = sel.pos;
|
|
23440
|
+
else if (sel.kind === `contiguous`) currentPos = max(sel.start, sel.end);
|
|
23441
|
+
else if (sel.kind === `rectangular`) currentPos = sel.y * bytesPerRow(columns) + sel.x + sel.width - 1;
|
|
22770
23442
|
else currentPos = 0;
|
|
22771
23443
|
const bpr = bytesPerRow(columns);
|
|
22772
23444
|
let newPos;
|
|
22773
23445
|
switch (dir) {
|
|
22774
|
-
case
|
|
23446
|
+
case `left`:
|
|
22775
23447
|
newPos = currentPos - 1;
|
|
22776
23448
|
break;
|
|
22777
|
-
case
|
|
23449
|
+
case `right`:
|
|
22778
23450
|
newPos = currentPos + 1;
|
|
22779
23451
|
break;
|
|
22780
|
-
case
|
|
23452
|
+
case `up`:
|
|
22781
23453
|
newPos = currentPos - bpr;
|
|
22782
23454
|
break;
|
|
22783
|
-
case
|
|
23455
|
+
case `down`:
|
|
22784
23456
|
newPos = currentPos + bpr;
|
|
22785
23457
|
break;
|
|
22786
23458
|
default: newPos = currentPos;
|
|
22787
23459
|
}
|
|
22788
23460
|
return clampPos(newPos, dataLength);
|
|
22789
|
-
}
|
|
22790
|
-
|
|
23461
|
+
}
|
|
23462
|
+
function moveSelection(sel, dir, columns, dataLength) {
|
|
22791
23463
|
return {
|
|
22792
|
-
kind:
|
|
23464
|
+
kind: `single`,
|
|
22793
23465
|
pos: getCursorPos(sel, dir, columns, dataLength)
|
|
22794
23466
|
};
|
|
22795
|
-
}
|
|
22796
|
-
|
|
23467
|
+
}
|
|
23468
|
+
function extendRectangular(sel, dir, columns, _dataLength, anchorX = 0, anchorY = 0) {
|
|
22797
23469
|
const bpr = bytesPerRow(columns);
|
|
22798
23470
|
let x;
|
|
22799
23471
|
let y;
|
|
22800
23472
|
let width;
|
|
22801
23473
|
let height;
|
|
22802
|
-
if (!sel || sel.kind ===
|
|
22803
|
-
const pos = sel?.kind ===
|
|
23474
|
+
if (!sel || sel.kind === `single`) {
|
|
23475
|
+
const pos = sel?.kind === `single` ? sel.pos : 0;
|
|
22804
23476
|
x = pos % bpr;
|
|
22805
23477
|
y = Math.floor(pos / bpr);
|
|
22806
23478
|
width = 1;
|
|
22807
23479
|
height = 1;
|
|
22808
|
-
} else if (sel.kind ===
|
|
23480
|
+
} else if (sel.kind === `contiguous`) {
|
|
22809
23481
|
const start = min(sel.start, sel.end);
|
|
22810
23482
|
const end = max(sel.start, sel.end);
|
|
22811
23483
|
x = start % bpr;
|
|
22812
23484
|
y = Math.floor(start / bpr);
|
|
22813
23485
|
width = end - start + 1;
|
|
22814
23486
|
height = 1;
|
|
22815
|
-
} else if (sel.kind ===
|
|
23487
|
+
} else if (sel.kind === `rectangular`) {
|
|
22816
23488
|
x = sel.x;
|
|
22817
23489
|
y = sel.y;
|
|
22818
23490
|
width = sel.width;
|
|
@@ -22823,10 +23495,10 @@ const extendRectangular = (sel, dir, columns, _dataLength, anchorX = 0, anchorY
|
|
|
22823
23495
|
width = 1;
|
|
22824
23496
|
height = 1;
|
|
22825
23497
|
}
|
|
22826
|
-
const effectiveAnchorX = anchorX > 0 || sel?.kind ===
|
|
22827
|
-
const effectiveAnchorY = anchorY > 0 || sel?.kind ===
|
|
23498
|
+
const effectiveAnchorX = anchorX > 0 || sel?.kind === `rectangular` ? anchorX : x;
|
|
23499
|
+
const effectiveAnchorY = anchorY > 0 || sel?.kind === `rectangular` ? anchorY : y;
|
|
22828
23500
|
switch (dir) {
|
|
22829
|
-
case
|
|
23501
|
+
case `left`:
|
|
22830
23502
|
if (x > effectiveAnchorX) width -= 1;
|
|
22831
23503
|
else if (x === effectiveAnchorX && width > 1) {
|
|
22832
23504
|
x -= 1;
|
|
@@ -22836,10 +23508,10 @@ const extendRectangular = (sel, dir, columns, _dataLength, anchorX = 0, anchorY
|
|
|
22836
23508
|
width += 1;
|
|
22837
23509
|
}
|
|
22838
23510
|
break;
|
|
22839
|
-
case
|
|
23511
|
+
case `right`:
|
|
22840
23512
|
if (x + width < bpr) width += 1;
|
|
22841
23513
|
break;
|
|
22842
|
-
case
|
|
23514
|
+
case `up`:
|
|
22843
23515
|
if (y > effectiveAnchorY) height -= 1;
|
|
22844
23516
|
else if (y === effectiveAnchorY && height > 1) {
|
|
22845
23517
|
y -= 1;
|
|
@@ -22849,22 +23521,22 @@ const extendRectangular = (sel, dir, columns, _dataLength, anchorX = 0, anchorY
|
|
|
22849
23521
|
height += 1;
|
|
22850
23522
|
}
|
|
22851
23523
|
break;
|
|
22852
|
-
case
|
|
23524
|
+
case `down`:
|
|
22853
23525
|
height += 1;
|
|
22854
23526
|
break;
|
|
22855
23527
|
}
|
|
22856
23528
|
return {
|
|
22857
|
-
kind:
|
|
23529
|
+
kind: `rectangular`,
|
|
22858
23530
|
x,
|
|
22859
23531
|
y,
|
|
22860
23532
|
width,
|
|
22861
23533
|
height
|
|
22862
23534
|
};
|
|
22863
|
-
}
|
|
22864
|
-
|
|
23535
|
+
}
|
|
23536
|
+
function selectionFromPointerRange(start, end, mode, columns) {
|
|
22865
23537
|
const bpr = bytesPerRow(columns);
|
|
22866
|
-
if (mode ===
|
|
22867
|
-
kind:
|
|
23538
|
+
if (mode === `contiguous`) return {
|
|
23539
|
+
kind: `contiguous`,
|
|
22868
23540
|
start: min(start, end),
|
|
22869
23541
|
end: max(start, end)
|
|
22870
23542
|
};
|
|
@@ -22873,16 +23545,16 @@ const selectionFromPointerRange = (start, end, mode, columns) => {
|
|
|
22873
23545
|
const endX = end % bpr;
|
|
22874
23546
|
const endY = Math.floor(end / bpr);
|
|
22875
23547
|
return {
|
|
22876
|
-
kind:
|
|
23548
|
+
kind: `rectangular`,
|
|
22877
23549
|
x: min(startX, endX),
|
|
22878
23550
|
y: min(startY, endY),
|
|
22879
23551
|
width: Math.abs(endX - startX) + 1,
|
|
22880
23552
|
height: Math.abs(endY - startY) + 1
|
|
22881
23553
|
};
|
|
22882
|
-
}
|
|
23554
|
+
}
|
|
22883
23555
|
//#endregion
|
|
22884
23556
|
//#region src/hex/hex-editor.ts
|
|
22885
|
-
let IxfxHexEditorElement = class IxfxHexEditorElement extends i$
|
|
23557
|
+
let IxfxHexEditorElement = class IxfxHexEditorElement extends i$4 {
|
|
22886
23558
|
constructor(..._args) {
|
|
22887
23559
|
super(..._args);
|
|
22888
23560
|
this.columns = 4;
|
|
@@ -23041,7 +23713,7 @@ let IxfxHexEditorElement = class IxfxHexEditorElement extends i$3 {
|
|
|
23041
23713
|
};
|
|
23042
23714
|
}
|
|
23043
23715
|
static {
|
|
23044
|
-
this.styles = i$
|
|
23716
|
+
this.styles = i$7`
|
|
23045
23717
|
:host {
|
|
23046
23718
|
--hex-row-height: 24px;
|
|
23047
23719
|
--hex-offset-width: 8ch;
|
|
@@ -23674,7 +24346,7 @@ let IxfxHexEditorElement = class IxfxHexEditorElement extends i$3 {
|
|
|
23674
24346
|
return b`
|
|
23675
24347
|
<span
|
|
23676
24348
|
class=${classes.join(` `)}
|
|
23677
|
-
style=${o
|
|
24349
|
+
style=${o(colourStyle || {})}
|
|
23678
24350
|
@pointerdown=${(e) => this._onPointerDown(pos, `hex`, e)}
|
|
23679
24351
|
@pointerup=${(e) => this._onPointerUp(pos, `hex`, e)}
|
|
23680
24352
|
@pointermove=${(e) => this._onPointerMove(pos, `hex`, e)}
|
|
@@ -23697,7 +24369,7 @@ let IxfxHexEditorElement = class IxfxHexEditorElement extends i$3 {
|
|
|
23697
24369
|
return b`
|
|
23698
24370
|
<span
|
|
23699
24371
|
class=${classes.join(` `)}
|
|
23700
|
-
style=${o
|
|
24372
|
+
style=${o(colourStyle || {})}
|
|
23701
24373
|
@pointerdown=${(e) => this._onPointerDown(pos, `text`, e)}
|
|
23702
24374
|
@pointerup=${(e) => this._onPointerUp(pos, `text`, e)}
|
|
23703
24375
|
@pointermove=${(e) => this._onPointerMove(pos, `text`, e)}
|
|
@@ -23726,7 +24398,7 @@ __decorate([r$1()], IxfxHexEditorElement.prototype, "_editState", void 0);
|
|
|
23726
24398
|
__decorate([r$1()], IxfxHexEditorElement.prototype, "_containerH", void 0);
|
|
23727
24399
|
__decorate([r$1()], IxfxHexEditorElement.prototype, "_shadeMap", void 0);
|
|
23728
24400
|
__decorate([r$1()], IxfxHexEditorElement.prototype, "_focusSide", void 0);
|
|
23729
|
-
IxfxHexEditorElement = __decorate([
|
|
24401
|
+
IxfxHexEditorElement = __decorate([safeCustomElement(`ixfx-hex-editor`)], IxfxHexEditorElement);
|
|
23730
24402
|
//#endregion
|
|
23731
24403
|
//#region src/radial-input/svg-utils.ts
|
|
23732
24404
|
const PI2 = Math.PI * 2;
|
|
@@ -23773,10 +24445,10 @@ function getFlattenedCircleAngles(flatten) {
|
|
|
23773
24445
|
function valueToAngle(relativeValue, valueMode, flatten) {
|
|
23774
24446
|
const { startAngle, endAngle, totalArc } = getFlattenedCircleAngles(flatten);
|
|
23775
24447
|
switch (valueMode) {
|
|
23776
|
-
case
|
|
23777
|
-
case
|
|
24448
|
+
case `range`: return startAngle + relativeValue * totalArc;
|
|
24449
|
+
case `bipolar`: if (relativeValue <= .5) return startAngle + relativeValue / .5 * (MIDPOINT_ANGLE - startAngle);
|
|
23778
24450
|
else return MIDPOINT_ANGLE + (relativeValue - .5) / .5 * (endAngle - MIDPOINT_ANGLE);
|
|
23779
|
-
case
|
|
24451
|
+
case `unipolar`: return MIDPOINT_ANGLE;
|
|
23780
24452
|
default: return startAngle;
|
|
23781
24453
|
}
|
|
23782
24454
|
}
|
|
@@ -23790,11 +24462,11 @@ function valueToAngle(relativeValue, valueMode, flatten) {
|
|
|
23790
24462
|
function getValueArcAngles(relativeValue, valueMode, flatten) {
|
|
23791
24463
|
const { startAngle, endAngle, totalArc } = getFlattenedCircleAngles(flatten);
|
|
23792
24464
|
switch (valueMode) {
|
|
23793
|
-
case
|
|
24465
|
+
case `range`: return {
|
|
23794
24466
|
startAngle,
|
|
23795
24467
|
endAngle: startAngle + relativeValue * totalArc
|
|
23796
24468
|
};
|
|
23797
|
-
case
|
|
24469
|
+
case `bipolar`: if (relativeValue < .5) return {
|
|
23798
24470
|
startAngle: startAngle + relativeValue / .5 * (MIDPOINT_ANGLE - startAngle),
|
|
23799
24471
|
endAngle: MIDPOINT_ANGLE
|
|
23800
24472
|
};
|
|
@@ -23806,7 +24478,7 @@ function getValueArcAngles(relativeValue, valueMode, flatten) {
|
|
|
23806
24478
|
startAngle: MIDPOINT_ANGLE,
|
|
23807
24479
|
endAngle: MIDPOINT_ANGLE
|
|
23808
24480
|
};
|
|
23809
|
-
case
|
|
24481
|
+
case `unipolar`: {
|
|
23810
24482
|
const spreadAmount = relativeValue * totalArc / 2;
|
|
23811
24483
|
return {
|
|
23812
24484
|
startAngle: MIDPOINT_ANGLE - spreadAmount,
|
|
@@ -23857,7 +24529,7 @@ function generateArcPath(startAngle, endAngle, radius, center = {
|
|
|
23857
24529
|
x: 50,
|
|
23858
24530
|
y: 50
|
|
23859
24531
|
}) {
|
|
23860
|
-
if (startAngle === endAngle) return
|
|
24532
|
+
if (startAngle === endAngle) return ``;
|
|
23861
24533
|
let arcLength = endAngle - startAngle;
|
|
23862
24534
|
if (arcLength < 0) arcLength += PI2;
|
|
23863
24535
|
if (arcLength >= PI2 - .001) {
|
|
@@ -23898,7 +24570,7 @@ function generateWedgePath(startAngle, endAngle, radius, center = {
|
|
|
23898
24570
|
x: 50,
|
|
23899
24571
|
y: 50
|
|
23900
24572
|
}, clockwise = true) {
|
|
23901
|
-
if (startAngle === endAngle) return
|
|
24573
|
+
if (startAngle === endAngle) return ``;
|
|
23902
24574
|
let arcLength = endAngle - startAngle;
|
|
23903
24575
|
if (arcLength < 0) arcLength += PI2;
|
|
23904
24576
|
if (arcLength >= PI2 - .001) {
|
|
@@ -23934,12 +24606,12 @@ function getWedgeAngles(relativeValue, valueMode, flatten) {
|
|
|
23934
24606
|
const { startAngle, endAngle, totalArc } = getFlattenedCircleAngles(flatten);
|
|
23935
24607
|
const valueAngle = valueToAngle(relativeValue, valueMode, flatten);
|
|
23936
24608
|
switch (valueMode) {
|
|
23937
|
-
case
|
|
24609
|
+
case `range`: return {
|
|
23938
24610
|
startAngle,
|
|
23939
24611
|
endAngle: valueAngle,
|
|
23940
24612
|
clockwise: true
|
|
23941
24613
|
};
|
|
23942
|
-
case
|
|
24614
|
+
case `bipolar`: if (relativeValue < .5) return {
|
|
23943
24615
|
startAngle: MIDPOINT_ANGLE,
|
|
23944
24616
|
endAngle: valueAngle,
|
|
23945
24617
|
clockwise: false
|
|
@@ -23949,7 +24621,7 @@ function getWedgeAngles(relativeValue, valueMode, flatten) {
|
|
|
23949
24621
|
endAngle: valueAngle,
|
|
23950
24622
|
clockwise: true
|
|
23951
24623
|
};
|
|
23952
|
-
case
|
|
24624
|
+
case `unipolar`: {
|
|
23953
24625
|
const halfSpread = relativeValue * totalArc / 2;
|
|
23954
24626
|
return {
|
|
23955
24627
|
startAngle: MIDPOINT_ANGLE - halfSpread,
|
|
@@ -24016,7 +24688,7 @@ const CENTER = {
|
|
|
24016
24688
|
x: 50,
|
|
24017
24689
|
y: 50
|
|
24018
24690
|
};
|
|
24019
|
-
let RadialInputElement = class RadialInputElement extends i$
|
|
24691
|
+
let RadialInputElement = class RadialInputElement extends i$4 {
|
|
24020
24692
|
#_radius;
|
|
24021
24693
|
get radius() {
|
|
24022
24694
|
return this.#_radius;
|
|
@@ -24427,7 +25099,7 @@ let RadialInputElement = class RadialInputElement extends i$3 {
|
|
|
24427
25099
|
if (svg) svg.setAttribute(`viewBox`, `0 0 100 ${viewBoxHeight}`);
|
|
24428
25100
|
}
|
|
24429
25101
|
static {
|
|
24430
|
-
this.styles = [prominenceStyles, i$
|
|
25102
|
+
this.styles = [prominenceStyles, i$7`
|
|
24431
25103
|
:host {
|
|
24432
25104
|
display: inline-block;
|
|
24433
25105
|
width: 100px;
|
|
@@ -24567,7 +25239,7 @@ __decorate([n$2({
|
|
|
24567
25239
|
type: Boolean,
|
|
24568
25240
|
reflect: true
|
|
24569
25241
|
})], RadialInputElement.prototype, "disabled", void 0);
|
|
24570
|
-
RadialInputElement = __decorate([
|
|
25242
|
+
RadialInputElement = __decorate([safeCustomElement(`ixfx-radial-input`)], RadialInputElement);
|
|
24571
25243
|
//#endregion
|
|
24572
25244
|
//#region src/labelled-radial-input/labelled-radial-input.ts
|
|
24573
25245
|
let LabelledRadialInput = class LabelledRadialInput extends LabelledInputBase {
|
|
@@ -24655,7 +25327,7 @@ let LabelledRadialInput = class LabelledRadialInput extends LabelledInputBase {
|
|
|
24655
25327
|
return numValue.toFixed(2);
|
|
24656
25328
|
}
|
|
24657
25329
|
static {
|
|
24658
|
-
this.styles = i$
|
|
25330
|
+
this.styles = i$7`
|
|
24659
25331
|
:host {
|
|
24660
25332
|
display: block;
|
|
24661
25333
|
min-height: var(--min-height, 60px);
|
|
@@ -24747,10 +25419,10 @@ __decorate([n$2({
|
|
|
24747
25419
|
attribute: `aspect-ratio-threshold`
|
|
24748
25420
|
})], LabelledRadialInput.prototype, "aspectRatioThreshold", void 0);
|
|
24749
25421
|
__decorate([r$1()], LabelledRadialInput.prototype, "_isWide", void 0);
|
|
24750
|
-
LabelledRadialInput = __decorate([
|
|
25422
|
+
LabelledRadialInput = __decorate([safeCustomElement(`ixfx-labelled-radial-input`)], LabelledRadialInput);
|
|
24751
25423
|
//#endregion
|
|
24752
25424
|
//#region src/led.ts
|
|
24753
|
-
let LedElement = class LedElement extends i$
|
|
25425
|
+
let LedElement = class LedElement extends i$4 {
|
|
24754
25426
|
constructor(..._args) {
|
|
24755
25427
|
super(..._args);
|
|
24756
25428
|
this.value = 0;
|
|
@@ -24796,7 +25468,7 @@ let LedElement = class LedElement extends i$3 {
|
|
|
24796
25468
|
return b`<div part="circle"></div>`;
|
|
24797
25469
|
}
|
|
24798
25470
|
static {
|
|
24799
|
-
this.styles = i$
|
|
25471
|
+
this.styles = i$7`
|
|
24800
25472
|
:host {
|
|
24801
25473
|
--_size: var(--size, 1ex);
|
|
24802
25474
|
display: inline-block;
|
|
@@ -24833,10 +25505,10 @@ __decorate([n$2({
|
|
|
24833
25505
|
type: Number,
|
|
24834
25506
|
attribute: `rate`
|
|
24835
25507
|
})], LedElement.prototype, "rate", void 0);
|
|
24836
|
-
LedElement = __decorate([
|
|
25508
|
+
LedElement = __decorate([safeCustomElement(`ixfx-led`)], LedElement);
|
|
24837
25509
|
//#endregion
|
|
24838
25510
|
//#region src/menu/menu-bar.ts
|
|
24839
|
-
let MenuBar = class MenuBar extends i$
|
|
25511
|
+
let MenuBar = class MenuBar extends i$4 {
|
|
24840
25512
|
constructor(..._args) {
|
|
24841
25513
|
super(..._args);
|
|
24842
25514
|
this._openTrigger = null;
|
|
@@ -24899,7 +25571,7 @@ let MenuBar = class MenuBar extends i$3 {
|
|
|
24899
25571
|
return [...this.children].filter((el) => el.tagName === `IXFX-MENU-TRIGGER`);
|
|
24900
25572
|
}
|
|
24901
25573
|
static {
|
|
24902
|
-
this.styles = i$
|
|
25574
|
+
this.styles = i$7`
|
|
24903
25575
|
:host {
|
|
24904
25576
|
display: flex;
|
|
24905
25577
|
align-items: center;
|
|
@@ -24916,10 +25588,10 @@ let MenuBar = class MenuBar extends i$3 {
|
|
|
24916
25588
|
return b`<slot role="menubar"></slot>`;
|
|
24917
25589
|
}
|
|
24918
25590
|
};
|
|
24919
|
-
MenuBar = __decorate([
|
|
25591
|
+
MenuBar = __decorate([safeCustomElement(`ixfx-menu-bar`)], MenuBar);
|
|
24920
25592
|
//#endregion
|
|
24921
25593
|
//#region src/menu/menu-check-item.ts
|
|
24922
|
-
let MenuCheckItem = class MenuCheckItem extends i$
|
|
25594
|
+
let MenuCheckItem = class MenuCheckItem extends i$4 {
|
|
24923
25595
|
constructor(..._args) {
|
|
24924
25596
|
super(..._args);
|
|
24925
25597
|
this.command = ``;
|
|
@@ -24975,7 +25647,7 @@ let MenuCheckItem = class MenuCheckItem extends i$3 {
|
|
|
24975
25647
|
return [...mods, key].join(``);
|
|
24976
25648
|
}
|
|
24977
25649
|
static {
|
|
24978
|
-
this.styles = [tickledItemStyles, i$
|
|
25650
|
+
this.styles = [tickledItemStyles, i$7`
|
|
24979
25651
|
:host {
|
|
24980
25652
|
display: block;
|
|
24981
25653
|
}
|
|
@@ -25066,7 +25738,7 @@ __decorate([n$2({
|
|
|
25066
25738
|
})], MenuCheckItem.prototype, "iconName", void 0);
|
|
25067
25739
|
__decorate([n$2({ attribute: false })], MenuCheckItem.prototype, "registry", void 0);
|
|
25068
25740
|
__decorate([n$2({ attribute: false })], MenuCheckItem.prototype, "keyboardManager", void 0);
|
|
25069
|
-
MenuCheckItem = __decorate([
|
|
25741
|
+
MenuCheckItem = __decorate([safeCustomElement(`ixfx-menu-check-item`)], MenuCheckItem);
|
|
25070
25742
|
//#endregion
|
|
25071
25743
|
//#region src/menu/menu-command-controller.ts
|
|
25072
25744
|
var MenuCommandController = class {
|
|
@@ -25090,35 +25762,9 @@ var MenuCommandController = class {
|
|
|
25090
25762
|
}
|
|
25091
25763
|
};
|
|
25092
25764
|
//#endregion
|
|
25093
|
-
//#region src/menu/menu-header.ts
|
|
25094
|
-
let MenuHeader = class MenuHeader extends i$3 {
|
|
25095
|
-
constructor(..._args) {
|
|
25096
|
-
super(..._args);
|
|
25097
|
-
this.label = ``;
|
|
25098
|
-
}
|
|
25099
|
-
static {
|
|
25100
|
-
this.styles = i$6`
|
|
25101
|
-
:host {
|
|
25102
|
-
display: block;
|
|
25103
|
-
padding: 6px var(--space-m) var(--space-xs);
|
|
25104
|
-
font-size: var(--text-s);
|
|
25105
|
-
font-weight: var(--font-weight-bold);
|
|
25106
|
-
text-transform: uppercase;
|
|
25107
|
-
color: var(--surface-muted-text);
|
|
25108
|
-
letter-spacing: 0.5px;
|
|
25109
|
-
}
|
|
25110
|
-
`;
|
|
25111
|
-
}
|
|
25112
|
-
render() {
|
|
25113
|
-
return b`<div>${this.label}</div>`;
|
|
25114
|
-
}
|
|
25115
|
-
};
|
|
25116
|
-
__decorate([n$2({ type: String })], MenuHeader.prototype, "label", void 0);
|
|
25117
|
-
MenuHeader = __decorate([t$4(`ixfx-menu-header`)], MenuHeader);
|
|
25118
|
-
//#endregion
|
|
25119
25765
|
//#region src/menu/menu-sub-trigger.ts
|
|
25120
25766
|
var _MenuSubTrigger;
|
|
25121
|
-
let MenuSubTrigger = class MenuSubTrigger extends i$
|
|
25767
|
+
let MenuSubTrigger = class MenuSubTrigger extends i$4 {
|
|
25122
25768
|
static {
|
|
25123
25769
|
_MenuSubTrigger = this;
|
|
25124
25770
|
}
|
|
@@ -25261,7 +25907,7 @@ let MenuSubTrigger = class MenuSubTrigger extends i$3 {
|
|
|
25261
25907
|
}
|
|
25262
25908
|
}
|
|
25263
25909
|
static {
|
|
25264
|
-
this.styles = [tickledItemStyles, i$
|
|
25910
|
+
this.styles = [tickledItemStyles, i$7`
|
|
25265
25911
|
:host {
|
|
25266
25912
|
display: block;
|
|
25267
25913
|
}
|
|
@@ -25371,12 +26017,12 @@ __decorate([r$1()], MenuSubTrigger.prototype, "_hasSubmenu", void 0);
|
|
|
25371
26017
|
__decorate([e$4(`slot[name="submenu"]`)], MenuSubTrigger.prototype, "_slot", void 0);
|
|
25372
26018
|
__decorate([e$4(`.submenu-popover`)], MenuSubTrigger.prototype, "_submenuPopover", void 0);
|
|
25373
26019
|
__decorate([e$4(`.item`)], MenuSubTrigger.prototype, "_itemEl", void 0);
|
|
25374
|
-
MenuSubTrigger = _MenuSubTrigger = __decorate([
|
|
26020
|
+
MenuSubTrigger = _MenuSubTrigger = __decorate([safeCustomElement(`ixfx-menu-sub-trigger`)], MenuSubTrigger);
|
|
25375
26021
|
//#endregion
|
|
25376
26022
|
//#region src/menu/menu-separator.ts
|
|
25377
|
-
let MenuSeparator = class MenuSeparator extends i$
|
|
26023
|
+
let MenuSeparator = class MenuSeparator extends i$4 {
|
|
25378
26024
|
static {
|
|
25379
|
-
this.styles = i$
|
|
26025
|
+
this.styles = i$7`
|
|
25380
26026
|
:host {
|
|
25381
26027
|
display: block;
|
|
25382
26028
|
margin: var(--space-xs) 0;
|
|
@@ -25392,7 +26038,33 @@ let MenuSeparator = class MenuSeparator extends i$3 {
|
|
|
25392
26038
|
return b`<div class="separator"></div>`;
|
|
25393
26039
|
}
|
|
25394
26040
|
};
|
|
25395
|
-
MenuSeparator = __decorate([
|
|
26041
|
+
MenuSeparator = __decorate([safeCustomElement(`ixfx-menu-separator`)], MenuSeparator);
|
|
26042
|
+
//#endregion
|
|
26043
|
+
//#region src/menu/menu-header.ts
|
|
26044
|
+
let MenuHeader = class MenuHeader extends i$4 {
|
|
26045
|
+
constructor(..._args) {
|
|
26046
|
+
super(..._args);
|
|
26047
|
+
this.label = ``;
|
|
26048
|
+
}
|
|
26049
|
+
static {
|
|
26050
|
+
this.styles = i$7`
|
|
26051
|
+
:host {
|
|
26052
|
+
display: block;
|
|
26053
|
+
padding: 6px var(--space-m) var(--space-xs);
|
|
26054
|
+
font-size: var(--text-s);
|
|
26055
|
+
font-weight: var(--font-weight-bold);
|
|
26056
|
+
text-transform: uppercase;
|
|
26057
|
+
color: var(--surface-muted-text);
|
|
26058
|
+
letter-spacing: 0.5px;
|
|
26059
|
+
}
|
|
26060
|
+
`;
|
|
26061
|
+
}
|
|
26062
|
+
render() {
|
|
26063
|
+
return b`<div>${this.label}</div>`;
|
|
26064
|
+
}
|
|
26065
|
+
};
|
|
26066
|
+
__decorate([n$2({ type: String })], MenuHeader.prototype, "label", void 0);
|
|
26067
|
+
MenuHeader = __decorate([safeCustomElement(`ixfx-menu-header`)], MenuHeader);
|
|
25396
26068
|
//#endregion
|
|
25397
26069
|
//#region src/menu/menu-from-tree.ts
|
|
25398
26070
|
function isLeaf(node) {
|
|
@@ -25402,8 +26074,8 @@ function menuFromTree(nodes, options = {}) {
|
|
|
25402
26074
|
const { onCommand, registry, keyboardManager } = options;
|
|
25403
26075
|
return b`${nodes.map((node) => {
|
|
25404
26076
|
const label = node.item.label;
|
|
25405
|
-
if (label ===
|
|
25406
|
-
if (label.startsWith(
|
|
26077
|
+
if (label === `-`) return b`<ixfx-menu-separator></ixfx-menu-separator>`;
|
|
26078
|
+
if (label.startsWith(`# `)) return b`<ixfx-menu-header label="${label.slice(2)}"></ixfx-menu-header>`;
|
|
25407
26079
|
if (!isLeaf(node)) {
|
|
25408
26080
|
const submenu = menuFromTree(node.children, options);
|
|
25409
26081
|
return b`
|
|
@@ -25429,30 +26101,30 @@ function menuFromTree(nodes, options = {}) {
|
|
|
25429
26101
|
function buildMenuItemEl(node, options) {
|
|
25430
26102
|
const { onCommand, registry } = options;
|
|
25431
26103
|
const label = node.item.label;
|
|
25432
|
-
const el = document.createElement(
|
|
25433
|
-
el.setAttribute(
|
|
25434
|
-
el.setAttribute(
|
|
25435
|
-
if (node.item.icon) el.setAttribute(
|
|
25436
|
-
if (onCommand) el.addEventListener(
|
|
26104
|
+
const el = document.createElement(`ixfx-menu-item`);
|
|
26105
|
+
el.setAttribute(`command`, node.item.key);
|
|
26106
|
+
el.setAttribute(`label`, label);
|
|
26107
|
+
if (node.item.icon) el.setAttribute(`icon-name`, node.item.icon);
|
|
26108
|
+
if (onCommand) el.addEventListener(`command`, (e) => onCommand(e.detail));
|
|
25437
26109
|
if (registry) el.registry = registry;
|
|
25438
26110
|
return el;
|
|
25439
26111
|
}
|
|
25440
26112
|
function buildMenuSeparatorEl() {
|
|
25441
|
-
return document.createElement(
|
|
26113
|
+
return document.createElement(`ixfx-menu-separator`);
|
|
25442
26114
|
}
|
|
25443
26115
|
function buildMenuHeaderEl(label) {
|
|
25444
|
-
const el = document.createElement(
|
|
25445
|
-
el.setAttribute(
|
|
26116
|
+
const el = document.createElement(`ixfx-menu-header`);
|
|
26117
|
+
el.setAttribute(`label`, label);
|
|
25446
26118
|
return el;
|
|
25447
26119
|
}
|
|
25448
26120
|
function buildMenuSubTriggerEl(node, options) {
|
|
25449
26121
|
const { onCommand, registry, keyboardManager } = options;
|
|
25450
|
-
const el = document.createElement(
|
|
25451
|
-
el.setAttribute(
|
|
26122
|
+
const el = document.createElement(`ixfx-menu-sub-trigger`);
|
|
26123
|
+
el.setAttribute(`label`, node.item.label);
|
|
25452
26124
|
if (registry) el.registry = registry;
|
|
25453
26125
|
if (keyboardManager) el.keyboardManager = keyboardManager;
|
|
25454
|
-
const container = document.createElement(
|
|
25455
|
-
container.setAttribute(
|
|
26126
|
+
const container = document.createElement(`ixfx-menu-container`);
|
|
26127
|
+
container.setAttribute(`slot`, `submenu`);
|
|
25456
26128
|
if (registry) container.registry = registry;
|
|
25457
26129
|
if (keyboardManager) container.keyboardManager = keyboardManager;
|
|
25458
26130
|
const childEls = menuFromTreeToElements(node.children, options);
|
|
@@ -25463,15 +26135,15 @@ function buildMenuSubTriggerEl(node, options) {
|
|
|
25463
26135
|
function menuFromTreeToElements(nodes, options = {}) {
|
|
25464
26136
|
return nodes.map((node) => {
|
|
25465
26137
|
const label = node.item.label;
|
|
25466
|
-
if (label ===
|
|
25467
|
-
if (label.startsWith(
|
|
26138
|
+
if (label === `-`) return buildMenuSeparatorEl();
|
|
26139
|
+
if (label.startsWith(`# `)) return buildMenuHeaderEl(label.slice(2));
|
|
25468
26140
|
if (!isLeaf(node)) return buildMenuSubTriggerEl(node, options);
|
|
25469
26141
|
return buildMenuItemEl(node, options);
|
|
25470
26142
|
});
|
|
25471
26143
|
}
|
|
25472
26144
|
//#endregion
|
|
25473
26145
|
//#region src/menu/menu-radio-item.ts
|
|
25474
|
-
let MenuRadioItem = class MenuRadioItem extends i$
|
|
26146
|
+
let MenuRadioItem = class MenuRadioItem extends i$4 {
|
|
25475
26147
|
constructor(..._args) {
|
|
25476
26148
|
super(..._args);
|
|
25477
26149
|
this.value = ``;
|
|
@@ -25489,7 +26161,7 @@ let MenuRadioItem = class MenuRadioItem extends i$3 {
|
|
|
25489
26161
|
}));
|
|
25490
26162
|
}
|
|
25491
26163
|
static {
|
|
25492
|
-
this.styles = [tickledItemStyles, i$
|
|
26164
|
+
this.styles = [tickledItemStyles, i$7`
|
|
25493
26165
|
:host {
|
|
25494
26166
|
display: block;
|
|
25495
26167
|
}
|
|
@@ -25566,10 +26238,10 @@ __decorate([n$2({
|
|
|
25566
26238
|
type: String,
|
|
25567
26239
|
attribute: `icon-name`
|
|
25568
26240
|
})], MenuRadioItem.prototype, "iconName", void 0);
|
|
25569
|
-
MenuRadioItem = __decorate([
|
|
26241
|
+
MenuRadioItem = __decorate([safeCustomElement(`ixfx-menu-radio-item`)], MenuRadioItem);
|
|
25570
26242
|
//#endregion
|
|
25571
26243
|
//#region src/menu/menu-radio-group.ts
|
|
25572
|
-
let MenuRadioGroup = class MenuRadioGroup extends i$
|
|
26244
|
+
let MenuRadioGroup = class MenuRadioGroup extends i$4 {
|
|
25573
26245
|
constructor(..._args) {
|
|
25574
26246
|
super(..._args);
|
|
25575
26247
|
this.name = ``;
|
|
@@ -25599,7 +26271,7 @@ let MenuRadioGroup = class MenuRadioGroup extends i$3 {
|
|
|
25599
26271
|
if (changedProperties.has(`value`)) this.updateSlottedValues();
|
|
25600
26272
|
}
|
|
25601
26273
|
static {
|
|
25602
|
-
this.styles = i$
|
|
26274
|
+
this.styles = i$7`
|
|
25603
26275
|
:host {
|
|
25604
26276
|
display: block;
|
|
25605
26277
|
}
|
|
@@ -25618,7 +26290,7 @@ let MenuRadioGroup = class MenuRadioGroup extends i$3 {
|
|
|
25618
26290
|
__decorate([n$2({ type: String })], MenuRadioGroup.prototype, "name", void 0);
|
|
25619
26291
|
__decorate([n$2({ type: String })], MenuRadioGroup.prototype, "value", void 0);
|
|
25620
26292
|
__decorate([r$1()], MenuRadioGroup.prototype, "slottedElements", void 0);
|
|
25621
|
-
MenuRadioGroup = __decorate([
|
|
26293
|
+
MenuRadioGroup = __decorate([safeCustomElement(`ixfx-menu-radio-group`)], MenuRadioGroup);
|
|
25622
26294
|
//#endregion
|
|
25623
26295
|
//#region src/menu/index.ts
|
|
25624
26296
|
var menu_exports = /* @__PURE__ */ __exportAll$5({
|
|
@@ -25639,13 +26311,13 @@ var menu_exports = /* @__PURE__ */ __exportAll$5({
|
|
|
25639
26311
|
//#endregion
|
|
25640
26312
|
//#region src/miller/miller-base.ts
|
|
25641
26313
|
const EXPAND_DEBOUNCE_MS = 150;
|
|
25642
|
-
let MillerBaseElement = class MillerBaseElement extends i$
|
|
26314
|
+
let MillerBaseElement = class MillerBaseElement extends i$4 {
|
|
25643
26315
|
constructor(..._args) {
|
|
25644
26316
|
super(..._args);
|
|
25645
26317
|
this.headers = false;
|
|
25646
26318
|
this.interactionMode = `standard`;
|
|
25647
|
-
this.selectionFilter =
|
|
25648
|
-
this.exclusivity =
|
|
26319
|
+
this.selectionFilter = `leaf`;
|
|
26320
|
+
this.exclusivity = `none`;
|
|
25649
26321
|
this._columns = [];
|
|
25650
26322
|
this._selectedByDepth = /* @__PURE__ */ new Map();
|
|
25651
26323
|
this._selectedKeys = /* @__PURE__ */ new Set();
|
|
@@ -25875,7 +26547,7 @@ let MillerBaseElement = class MillerBaseElement extends i$3 {
|
|
|
25875
26547
|
#getTickledDepth() {
|
|
25876
26548
|
const id = this.tickled.tickledId;
|
|
25877
26549
|
if (!id) return void 0;
|
|
25878
|
-
const colonIndex = id.indexOf(
|
|
26550
|
+
const colonIndex = id.indexOf(`:`);
|
|
25879
26551
|
if (colonIndex < 0) return void 0;
|
|
25880
26552
|
return Number(id.substring(0, colonIndex));
|
|
25881
26553
|
}
|
|
@@ -25897,10 +26569,10 @@ let MillerBaseElement = class MillerBaseElement extends i$3 {
|
|
|
25897
26569
|
if (model) {
|
|
25898
26570
|
this.root = model.root;
|
|
25899
26571
|
this.#modelUnsubscribe = model._subscribe((event) => {
|
|
25900
|
-
if (event.type ===
|
|
26572
|
+
if (event.type === `root`) {
|
|
25901
26573
|
this.root = event.root;
|
|
25902
26574
|
this.requestUpdate();
|
|
25903
|
-
} else if (event.type ===
|
|
26575
|
+
} else if (event.type === `invalidate`) {
|
|
25904
26576
|
for (let depth = 0; depth < this._columns.length - 1; depth++) if (this._columns[depth]?.some((n) => n.item.key === event.key)) {
|
|
25905
26577
|
this._columns = this._columns.slice(0, depth + 1);
|
|
25906
26578
|
this.requestUpdate();
|
|
@@ -26180,9 +26852,9 @@ let MillerBaseElement = class MillerBaseElement extends i$3 {
|
|
|
26180
26852
|
};
|
|
26181
26853
|
}
|
|
26182
26854
|
#canSelect(node) {
|
|
26183
|
-
if (this.selectionFilter ===
|
|
26184
|
-
if (this.selectionFilter ===
|
|
26185
|
-
if (this.selectionFilter ===
|
|
26855
|
+
if (this.selectionFilter === `none`) return false;
|
|
26856
|
+
if (this.selectionFilter === `leaf`) return node.item.isLeaf !== false;
|
|
26857
|
+
if (this.selectionFilter === `branch`) return node.item.isLeaf === false || node.children !== void 0 && node.children.length > 0;
|
|
26186
26858
|
return true;
|
|
26187
26859
|
}
|
|
26188
26860
|
#dispatchSelectEvent(previous) {
|
|
@@ -26419,7 +27091,7 @@ let MillerBaseElement = class MillerBaseElement extends i$3 {
|
|
|
26419
27091
|
#getTickledNodeAndDepth() {
|
|
26420
27092
|
const id = this.tickled.tickledId;
|
|
26421
27093
|
if (!id) return void 0;
|
|
26422
|
-
const colonIndex = id.indexOf(
|
|
27094
|
+
const colonIndex = id.indexOf(`:`);
|
|
26423
27095
|
if (colonIndex < 0) return void 0;
|
|
26424
27096
|
const depth = Number(id.substring(0, colonIndex));
|
|
26425
27097
|
const key = id.substring(colonIndex + 1);
|
|
@@ -26552,10 +27224,10 @@ let MillerBaseElement = class MillerBaseElement extends i$3 {
|
|
|
26552
27224
|
* Called by subclasses when pointer leaves the column container.
|
|
26553
27225
|
*/
|
|
26554
27226
|
_handleColumnPointerLeave() {
|
|
26555
|
-
this.tickled.handlePointerLeave(new PointerEvent(
|
|
27227
|
+
this.tickled.handlePointerLeave(new PointerEvent(`pointerleave`));
|
|
26556
27228
|
}
|
|
26557
27229
|
static {
|
|
26558
|
-
this.styles = [tickledStyles, i$
|
|
27230
|
+
this.styles = [tickledStyles, i$7`
|
|
26559
27231
|
:host {
|
|
26560
27232
|
--column-bg: var(--surface-3);
|
|
26561
27233
|
--column-header-bg: var(--surface-2);
|
|
@@ -26674,18 +27346,18 @@ __decorate([n$2({ type: Boolean })], MillerBaseElement.prototype, "headers", voi
|
|
|
26674
27346
|
__decorate([n$2({ type: String })], MillerBaseElement.prototype, "interactionMode", void 0);
|
|
26675
27347
|
__decorate([n$2({
|
|
26676
27348
|
reflect: true,
|
|
26677
|
-
attribute:
|
|
27349
|
+
attribute: `selection-filter`
|
|
26678
27350
|
})], MillerBaseElement.prototype, "selectionFilter", void 0);
|
|
26679
27351
|
__decorate([n$2({
|
|
26680
27352
|
reflect: true,
|
|
26681
|
-
attribute:
|
|
27353
|
+
attribute: `exclusivity`
|
|
26682
27354
|
})], MillerBaseElement.prototype, "exclusivity", void 0);
|
|
26683
27355
|
__decorate([n$2({ type: Object })], MillerBaseElement.prototype, "loadChildren", void 0);
|
|
26684
27356
|
__decorate([n$2({ attribute: false })], MillerBaseElement.prototype, "filterPredicate", void 0);
|
|
26685
27357
|
__decorate([r$1()], MillerBaseElement.prototype, "_columns", void 0);
|
|
26686
27358
|
__decorate([r$1()], MillerBaseElement.prototype, "_loadingDepth", void 0);
|
|
26687
27359
|
__decorate([r$1()], MillerBaseElement.prototype, "_selectedNodes", void 0);
|
|
26688
|
-
MillerBaseElement = __decorate([
|
|
27360
|
+
MillerBaseElement = __decorate([safeCustomElement(`ixfx-miller-base`)], MillerBaseElement);
|
|
26689
27361
|
//#endregion
|
|
26690
27362
|
//#region src/miller/miller-list.ts
|
|
26691
27363
|
/**
|
|
@@ -26765,7 +27437,7 @@ let MillerListElement = class MillerListElement extends MillerBaseElement {
|
|
|
26765
27437
|
this.styles = [
|
|
26766
27438
|
...MillerBaseElement.styles,
|
|
26767
27439
|
tickledItemStyles,
|
|
26768
|
-
i$
|
|
27440
|
+
i$7`
|
|
26769
27441
|
.item-list {
|
|
26770
27442
|
list-style: none;
|
|
26771
27443
|
margin: 0;
|
|
@@ -26846,7 +27518,7 @@ let MillerListElement = class MillerListElement extends MillerBaseElement {
|
|
|
26846
27518
|
];
|
|
26847
27519
|
}
|
|
26848
27520
|
};
|
|
26849
|
-
MillerListElement = __decorate([
|
|
27521
|
+
MillerListElement = __decorate([safeCustomElement(`ixfx-miller-list`)], MillerListElement);
|
|
26850
27522
|
//#endregion
|
|
26851
27523
|
//#region src/miller/miller-tree-controller.ts
|
|
26852
27524
|
/**
|
|
@@ -26973,7 +27645,7 @@ var MillerTreeController = class {
|
|
|
26973
27645
|
};
|
|
26974
27646
|
//#endregion
|
|
26975
27647
|
//#region src/panel/panel-group.ts
|
|
26976
|
-
let PanelGroupElement = class PanelGroupElement extends i$
|
|
27648
|
+
let PanelGroupElement = class PanelGroupElement extends i$4 {
|
|
26977
27649
|
constructor(..._args) {
|
|
26978
27650
|
super(..._args);
|
|
26979
27651
|
this.orientation = `horizontal`;
|
|
@@ -27015,7 +27687,7 @@ let PanelGroupElement = class PanelGroupElement extends i$3 {
|
|
|
27015
27687
|
`;
|
|
27016
27688
|
}
|
|
27017
27689
|
static {
|
|
27018
|
-
this.styles = i$
|
|
27690
|
+
this.styles = i$7`
|
|
27019
27691
|
:host {
|
|
27020
27692
|
display: flex;
|
|
27021
27693
|
flex-direction: column;
|
|
@@ -27058,10 +27730,10 @@ __decorate([n$2({
|
|
|
27058
27730
|
})], PanelGroupElement.prototype, "allowMultiple", void 0);
|
|
27059
27731
|
__decorate([n$2()], PanelGroupElement.prototype, "gap", void 0);
|
|
27060
27732
|
__decorate([o$2({ slot: `` })], PanelGroupElement.prototype, "_panels", void 0);
|
|
27061
|
-
PanelGroupElement = __decorate([
|
|
27733
|
+
PanelGroupElement = __decorate([safeCustomElement(`ixfx-panel-group`)], PanelGroupElement);
|
|
27062
27734
|
//#endregion
|
|
27063
27735
|
//#region src/panel/panel.ts
|
|
27064
|
-
let PanelElement = class PanelElement extends i$
|
|
27736
|
+
let PanelElement = class PanelElement extends i$4 {
|
|
27065
27737
|
constructor(..._args) {
|
|
27066
27738
|
super(..._args);
|
|
27067
27739
|
this.collapsed = false;
|
|
@@ -27144,7 +27816,7 @@ let PanelElement = class PanelElement extends i$3 {
|
|
|
27144
27816
|
`;
|
|
27145
27817
|
}
|
|
27146
27818
|
static {
|
|
27147
|
-
this.styles = i$
|
|
27819
|
+
this.styles = i$7`
|
|
27148
27820
|
:host {
|
|
27149
27821
|
display: flex;
|
|
27150
27822
|
flex-direction: column;
|
|
@@ -27459,7 +28131,7 @@ __decorate([n$2({
|
|
|
27459
28131
|
reflect: true
|
|
27460
28132
|
})], PanelElement.prototype, "variant", void 0);
|
|
27461
28133
|
__decorate([r$1()], PanelElement.prototype, "_isVertical", void 0);
|
|
27462
|
-
PanelElement = __decorate([
|
|
28134
|
+
PanelElement = __decorate([safeCustomElement(`ixfx-panel`)], PanelElement);
|
|
27463
28135
|
//#endregion
|
|
27464
28136
|
//#region node_modules/.pnpm/@ixfx+modulation@0.56.12/node_modules/@ixfx/modulation/dist/chunk-pbuEa-1d.js
|
|
27465
28137
|
var __defProp = Object.defineProperty;
|
|
@@ -28233,7 +28905,7 @@ function renderHistMiddle(points, crs, barW, mid, ageStyle) {
|
|
|
28233
28905
|
/>`;
|
|
28234
28906
|
});
|
|
28235
28907
|
}
|
|
28236
|
-
let PlotSingleAxis = class PlotSingleAxis extends i$
|
|
28908
|
+
let PlotSingleAxis = class PlotSingleAxis extends i$4 {
|
|
28237
28909
|
constructor(..._args) {
|
|
28238
28910
|
super(..._args);
|
|
28239
28911
|
this.drawStyle = `line-sharp`;
|
|
@@ -28246,7 +28918,7 @@ let PlotSingleAxis = class PlotSingleAxis extends i$3 {
|
|
|
28246
28918
|
this.paused = false;
|
|
28247
28919
|
this.clickPauses = false;
|
|
28248
28920
|
this.shaded = false;
|
|
28249
|
-
this.areaColor =
|
|
28921
|
+
this.areaColor = ``;
|
|
28250
28922
|
this.colorMode = `fixed`;
|
|
28251
28923
|
this.colorEasing = ``;
|
|
28252
28924
|
this.colorScale = ``;
|
|
@@ -28289,7 +28961,7 @@ let PlotSingleAxis = class PlotSingleAxis extends i$3 {
|
|
|
28289
28961
|
#hasProgrammaticData;
|
|
28290
28962
|
#parseDeclarativeData(text) {
|
|
28291
28963
|
if (!text) return [];
|
|
28292
|
-
return text.trim().split(/[,\s;]+/).map((t) => parseFloat(t)).filter((n) => !isNaN(n));
|
|
28964
|
+
return text.trim().split(/[,\s;]+/).map((t) => Number.parseFloat(t)).filter((n) => !isNaN(n));
|
|
28293
28965
|
}
|
|
28294
28966
|
#lastClientX;
|
|
28295
28967
|
#lastClientY;
|
|
@@ -28320,7 +28992,7 @@ let PlotSingleAxis = class PlotSingleAxis extends i$3 {
|
|
|
28320
28992
|
this._height = e.contentRect.height;
|
|
28321
28993
|
}).observe(this);
|
|
28322
28994
|
if (!this.#hasProgrammaticData) {
|
|
28323
|
-
const data = this.#parseDeclarativeData(this.textContent ??
|
|
28995
|
+
const data = this.#parseDeclarativeData(this.textContent ?? ``);
|
|
28324
28996
|
if (data.length > 0) this.#series.set(data);
|
|
28325
28997
|
}
|
|
28326
28998
|
}
|
|
@@ -28458,7 +29130,7 @@ let PlotSingleAxis = class PlotSingleAxis extends i$3 {
|
|
|
28458
29130
|
`;
|
|
28459
29131
|
}
|
|
28460
29132
|
static {
|
|
28461
|
-
this.styles = i$
|
|
29133
|
+
this.styles = i$7`
|
|
28462
29134
|
:host {
|
|
28463
29135
|
display: inline-block;
|
|
28464
29136
|
width: 100%;
|
|
@@ -28502,18 +29174,18 @@ __decorate([n$2({
|
|
|
28502
29174
|
})], PlotSingleAxis.prototype, "clickPauses", void 0);
|
|
28503
29175
|
__decorate([n$2({
|
|
28504
29176
|
type: Boolean,
|
|
28505
|
-
attribute:
|
|
29177
|
+
attribute: `shaded`
|
|
28506
29178
|
})], PlotSingleAxis.prototype, "shaded", void 0);
|
|
28507
|
-
__decorate([n$2({ attribute:
|
|
29179
|
+
__decorate([n$2({ attribute: `area-color` })], PlotSingleAxis.prototype, "areaColor", void 0);
|
|
28508
29180
|
__decorate([n$2({ attribute: `color-mode` })], PlotSingleAxis.prototype, "colorMode", void 0);
|
|
28509
29181
|
__decorate([n$2({ attribute: `color-easing` })], PlotSingleAxis.prototype, "colorEasing", void 0);
|
|
28510
29182
|
__decorate([n$2({ attribute: `color-scale` })], PlotSingleAxis.prototype, "colorScale", void 0);
|
|
28511
29183
|
__decorate([r$1()], PlotSingleAxis.prototype, "_width", void 0);
|
|
28512
29184
|
__decorate([r$1()], PlotSingleAxis.prototype, "_height", void 0);
|
|
28513
|
-
PlotSingleAxis = __decorate([
|
|
29185
|
+
PlotSingleAxis = __decorate([safeCustomElement(`ixfx-plot-single-axis`)], PlotSingleAxis);
|
|
28514
29186
|
//#endregion
|
|
28515
29187
|
//#region src/plots/xy-axis.ts
|
|
28516
|
-
let PlotXyAxis = class PlotXyAxis extends i$
|
|
29188
|
+
let PlotXyAxis = class PlotXyAxis extends i$4 {
|
|
28517
29189
|
constructor(..._args) {
|
|
28518
29190
|
super(..._args);
|
|
28519
29191
|
this.drawStyle = `circles`;
|
|
@@ -28734,7 +29406,7 @@ let PlotXyAxis = class PlotXyAxis extends i$3 {
|
|
|
28734
29406
|
`;
|
|
28735
29407
|
}
|
|
28736
29408
|
static {
|
|
28737
|
-
this.styles = i$
|
|
29409
|
+
this.styles = i$7`
|
|
28738
29410
|
:host {
|
|
28739
29411
|
display: block;
|
|
28740
29412
|
width: 100%;
|
|
@@ -28780,7 +29452,7 @@ __decorate([n$2({ attribute: `color-easing` })], PlotXyAxis.prototype, "colorEas
|
|
|
28780
29452
|
__decorate([n$2({ attribute: `color-scale` })], PlotXyAxis.prototype, "colorScale", void 0);
|
|
28781
29453
|
__decorate([r$1()], PlotXyAxis.prototype, "_width", void 0);
|
|
28782
29454
|
__decorate([r$1()], PlotXyAxis.prototype, "_height", void 0);
|
|
28783
|
-
PlotXyAxis = __decorate([
|
|
29455
|
+
PlotXyAxis = __decorate([safeCustomElement(`ixfx-plot-xy-axis`)], PlotXyAxis);
|
|
28784
29456
|
//#endregion
|
|
28785
29457
|
//#region src/polar-pad/polar-pad.ts
|
|
28786
29458
|
/**
|
|
@@ -28914,7 +29586,7 @@ function quantiseRadius(radius, stops) {
|
|
|
28914
29586
|
const step = 1 / stops;
|
|
28915
29587
|
return Math.round(radius / step) * step;
|
|
28916
29588
|
}
|
|
28917
|
-
let PolarPad = class PolarPad extends i$
|
|
29589
|
+
let PolarPad = class PolarPad extends i$4 {
|
|
28918
29590
|
constructor(..._args) {
|
|
28919
29591
|
super(..._args);
|
|
28920
29592
|
this.angle = 0;
|
|
@@ -29022,7 +29694,7 @@ let PolarPad = class PolarPad extends i$3 {
|
|
|
29022
29694
|
this._uid = Math.random().toString(36).slice(2, 8);
|
|
29023
29695
|
}
|
|
29024
29696
|
static {
|
|
29025
|
-
this.styles = i$
|
|
29697
|
+
this.styles = i$7`
|
|
29026
29698
|
:host {
|
|
29027
29699
|
display: block;
|
|
29028
29700
|
width: 200px;
|
|
@@ -29311,10 +29983,10 @@ __decorate([n$2({
|
|
|
29311
29983
|
type: Number,
|
|
29312
29984
|
attribute: `stops-radius`
|
|
29313
29985
|
})], PolarPad.prototype, "stopsRadius", void 0);
|
|
29314
|
-
PolarPad = __decorate([
|
|
29986
|
+
PolarPad = __decorate([safeCustomElement(`ixfx-polar-pad`)], PolarPad);
|
|
29315
29987
|
//#endregion
|
|
29316
29988
|
//#region src/styles/tooltip.ts
|
|
29317
|
-
const tooltipValueStyles = i$
|
|
29989
|
+
const tooltipValueStyles = i$7`
|
|
29318
29990
|
|
|
29319
29991
|
output.tooltip {
|
|
29320
29992
|
user-select: none;
|
|
@@ -29417,7 +30089,7 @@ const tooltipValueStyles = i$6`
|
|
|
29417
30089
|
function normalize(value, min, max) {
|
|
29418
30090
|
return max === min ? 0 : (value - min) / (max - min);
|
|
29419
30091
|
}
|
|
29420
|
-
let RangeInput = class RangeInput extends i$
|
|
30092
|
+
let RangeInput = class RangeInput extends i$4 {
|
|
29421
30093
|
constructor(..._args) {
|
|
29422
30094
|
super(..._args);
|
|
29423
30095
|
this.min = 0;
|
|
@@ -29560,7 +30232,7 @@ let RangeInput = class RangeInput extends i$3 {
|
|
|
29560
30232
|
`;
|
|
29561
30233
|
}
|
|
29562
30234
|
static {
|
|
29563
|
-
this.styles = [tooltipValueStyles, i$
|
|
30235
|
+
this.styles = [tooltipValueStyles, i$7`
|
|
29564
30236
|
:host {
|
|
29565
30237
|
display: block;
|
|
29566
30238
|
container-type: size;
|
|
@@ -29863,7 +30535,7 @@ __decorate([n$2({
|
|
|
29863
30535
|
__decorate([n$2({ attribute: false })], RangeInput.prototype, "labelFormatter", void 0);
|
|
29864
30536
|
__decorate([e$4(`input`)], RangeInput.prototype, "_inputEl", void 0);
|
|
29865
30537
|
__decorate([e$4(`ixfx-tooltip`)], RangeInput.prototype, "_tooltipEl", void 0);
|
|
29866
|
-
RangeInput = __decorate([
|
|
30538
|
+
RangeInput = __decorate([safeCustomElement(`ixfx-range-input`)], RangeInput);
|
|
29867
30539
|
//#endregion
|
|
29868
30540
|
//#region src/util/drag.ts
|
|
29869
30541
|
function getCoordinates(event) {
|
|
@@ -29900,7 +30572,7 @@ function near(target, range) {
|
|
|
29900
30572
|
}
|
|
29901
30573
|
//#endregion
|
|
29902
30574
|
//#region src/range/range-multi.ts
|
|
29903
|
-
let RangeMultiElement = class RangeMultiElement extends i$
|
|
30575
|
+
let RangeMultiElement = class RangeMultiElement extends i$4 {
|
|
29904
30576
|
constructor(..._args) {
|
|
29905
30577
|
super(..._args);
|
|
29906
30578
|
this.tooltip = true;
|
|
@@ -30206,7 +30878,7 @@ let RangeMultiElement = class RangeMultiElement extends i$3 {
|
|
|
30206
30878
|
this.styles = [
|
|
30207
30879
|
tooltipValueStyles,
|
|
30208
30880
|
prominenceStyles,
|
|
30209
|
-
i$
|
|
30881
|
+
i$7`
|
|
30210
30882
|
:host {
|
|
30211
30883
|
display: grid;
|
|
30212
30884
|
--value-label-color: unset;
|
|
@@ -30376,10 +31048,10 @@ __decorate([n$2({ type: Number })], RangeMultiElement.prototype, "max", null);
|
|
|
30376
31048
|
__decorate([n$2({ type: Number })], RangeMultiElement.prototype, "min", null);
|
|
30377
31049
|
__decorate([t$3({ capture: true })], RangeMultiElement.prototype, "_onInput", null);
|
|
30378
31050
|
__decorate([t$3({ capture: true })], RangeMultiElement.prototype, "_onPointerDown", null);
|
|
30379
|
-
RangeMultiElement = __decorate([
|
|
31051
|
+
RangeMultiElement = __decorate([safeCustomElement(`ixfx-range-multi`)], RangeMultiElement);
|
|
30380
31052
|
//#endregion
|
|
30381
31053
|
//#region src/range/range.ts
|
|
30382
|
-
let RangeElement = class RangeElement extends i$
|
|
31054
|
+
let RangeElement = class RangeElement extends i$4 {
|
|
30383
31055
|
constructor(..._args) {
|
|
30384
31056
|
super(..._args);
|
|
30385
31057
|
this.tooltip = true;
|
|
@@ -30424,7 +31096,7 @@ let RangeElement = class RangeElement extends i$3 {
|
|
|
30424
31096
|
this.styles = [
|
|
30425
31097
|
prominenceStyles,
|
|
30426
31098
|
tooltipValueStyles,
|
|
30427
|
-
i$
|
|
31099
|
+
i$7`
|
|
30428
31100
|
:host {
|
|
30429
31101
|
display: inline-block;
|
|
30430
31102
|
--value-label-color: unset;
|
|
@@ -30504,10 +31176,10 @@ __decorate([n$2({ type: Number })], RangeElement.prototype, "min", void 0);
|
|
|
30504
31176
|
__decorate([n$2({ type: Number })], RangeElement.prototype, "max", void 0);
|
|
30505
31177
|
__decorate([n$2({ type: Number })], RangeElement.prototype, "value", null);
|
|
30506
31178
|
__decorate([n$2({ type: Number })], RangeElement.prototype, "step", void 0);
|
|
30507
|
-
RangeElement = __decorate([
|
|
31179
|
+
RangeElement = __decorate([safeCustomElement(`ixfx-range`)], RangeElement);
|
|
30508
31180
|
//#endregion
|
|
30509
31181
|
//#region src/selecthorizontal.ts
|
|
30510
|
-
let SelectHorizontalElement = class SelectHorizontalElement extends i$
|
|
31182
|
+
let SelectHorizontalElement = class SelectHorizontalElement extends i$4 {
|
|
30511
31183
|
constructor(..._args) {
|
|
30512
31184
|
super(..._args);
|
|
30513
31185
|
this.editMode = false;
|
|
@@ -30521,7 +31193,7 @@ let SelectHorizontalElement = class SelectHorizontalElement extends i$3 {
|
|
|
30521
31193
|
`;
|
|
30522
31194
|
}
|
|
30523
31195
|
static {
|
|
30524
|
-
this.styles = i$
|
|
31196
|
+
this.styles = i$7`
|
|
30525
31197
|
:host {
|
|
30526
31198
|
display: flex;
|
|
30527
31199
|
overflow: scroll;
|
|
@@ -30540,10 +31212,10 @@ let SelectHorizontalElement = class SelectHorizontalElement extends i$3 {
|
|
|
30540
31212
|
}
|
|
30541
31213
|
};
|
|
30542
31214
|
__decorate([n$2({ type: Boolean })], SelectHorizontalElement.prototype, "editMode", void 0);
|
|
30543
|
-
SelectHorizontalElement = __decorate([
|
|
31215
|
+
SelectHorizontalElement = __decorate([safeCustomElement(`ixfx-selecthorizontal-element`)], SelectHorizontalElement);
|
|
30544
31216
|
//#endregion
|
|
30545
31217
|
//#region src/snap-container/snap-container.ts
|
|
30546
|
-
let SnapContainer = class SnapContainer extends i$
|
|
31218
|
+
let SnapContainer = class SnapContainer extends i$4 {
|
|
30547
31219
|
constructor(..._args) {
|
|
30548
31220
|
super(..._args);
|
|
30549
31221
|
this.orientation = `horizontal`;
|
|
@@ -30659,7 +31331,7 @@ let SnapContainer = class SnapContainer extends i$3 {
|
|
|
30659
31331
|
};
|
|
30660
31332
|
}
|
|
30661
31333
|
static {
|
|
30662
|
-
this.styles = i$
|
|
31334
|
+
this.styles = i$7`
|
|
30663
31335
|
:host {
|
|
30664
31336
|
display: block;
|
|
30665
31337
|
position: relative;
|
|
@@ -30831,10 +31503,10 @@ __decorate([n$2({
|
|
|
30831
31503
|
})], SnapContainer.prototype, "clickSnap", void 0);
|
|
30832
31504
|
__decorate([n$2({ type: Number })], SnapContainer.prototype, "snap", void 0);
|
|
30833
31505
|
__decorate([r$1()], SnapContainer.prototype, "_dragging", void 0);
|
|
30834
|
-
SnapContainer = __decorate([
|
|
31506
|
+
SnapContainer = __decorate([safeCustomElement(`ixfx-snap-container`)], SnapContainer);
|
|
30835
31507
|
//#endregion
|
|
30836
31508
|
//#region src/split-layout/split-layout.ts
|
|
30837
|
-
let SplitLayoutElement = class SplitLayoutElement extends i$
|
|
31509
|
+
let SplitLayoutElement = class SplitLayoutElement extends i$4 {
|
|
30838
31510
|
constructor(..._args) {
|
|
30839
31511
|
super(..._args);
|
|
30840
31512
|
this.layout = `vertical`;
|
|
@@ -31004,7 +31676,7 @@ let SplitLayoutElement = class SplitLayoutElement extends i$3 {
|
|
|
31004
31676
|
const cursorZoneLocalY = event.clientY - zoneBounds.top;
|
|
31005
31677
|
if (this.layout === `vertical` && nestedSplit.layout === `horizontal`) {
|
|
31006
31678
|
let newOuterFraction = cursorZoneLocalX / outerBounds.width;
|
|
31007
|
-
|
|
31679
|
+
const newNestedFraction = cursorZoneLocalY / outerBounds.height;
|
|
31008
31680
|
const { sizeA: constrainedA, sizeB: constrainedB } = this.#applyConstraints(`${newOuterFraction * 100}%`, `${(1 - newOuterFraction) * 100}%`, outerBounds.width);
|
|
31009
31681
|
newOuterFraction = this.#parseSizeAsFraction(constrainedA, outerBounds.width);
|
|
31010
31682
|
this.sizeA = constrainedA;
|
|
@@ -31020,7 +31692,7 @@ let SplitLayoutElement = class SplitLayoutElement extends i$3 {
|
|
|
31020
31692
|
cornerZone.style.top = `${cursorZoneLocalY - 6}px`;
|
|
31021
31693
|
}
|
|
31022
31694
|
} else if (this.layout === `horizontal` && nestedSplit.layout === `vertical`) {
|
|
31023
|
-
|
|
31695
|
+
const newNestedFraction = cursorZoneLocalX / outerBounds.width;
|
|
31024
31696
|
let newOuterFraction = cursorZoneLocalY / outerBounds.height;
|
|
31025
31697
|
const { sizeA: constrainedA, sizeB: constrainedB } = this.#applyConstraints(`${newOuterFraction * 100}%`, `${(1 - newOuterFraction) * 100}%`, outerBounds.height);
|
|
31026
31698
|
newOuterFraction = this.#parseSizeAsFraction(constrainedA, outerBounds.height);
|
|
@@ -31265,7 +31937,7 @@ let SplitLayoutElement = class SplitLayoutElement extends i$3 {
|
|
|
31265
31937
|
</div>`;
|
|
31266
31938
|
}
|
|
31267
31939
|
static {
|
|
31268
|
-
this.styles = i$
|
|
31940
|
+
this.styles = i$7`
|
|
31269
31941
|
:host {
|
|
31270
31942
|
--handle-size: 2px;
|
|
31271
31943
|
--handle-colour: var(--surface-5);
|
|
@@ -31369,10 +32041,10 @@ __decorate([n$2({ type: String })], SplitLayoutElement.prototype, "maxSizeA", vo
|
|
|
31369
32041
|
__decorate([n$2({ type: String })], SplitLayoutElement.prototype, "minSizeB", void 0);
|
|
31370
32042
|
__decorate([n$2({ type: String })], SplitLayoutElement.prototype, "maxSizeB", void 0);
|
|
31371
32043
|
__decorate([r$1()], SplitLayoutElement.prototype, "_hasCorner", void 0);
|
|
31372
|
-
SplitLayoutElement = __decorate([
|
|
32044
|
+
SplitLayoutElement = __decorate([safeCustomElement(`ixfx-split-layout`)], SplitLayoutElement);
|
|
31373
32045
|
//#endregion
|
|
31374
32046
|
//#region src/swipe/swipe.ts
|
|
31375
|
-
let SwipeElement = class SwipeElement extends i$
|
|
32047
|
+
let SwipeElement = class SwipeElement extends i$4 {
|
|
31376
32048
|
constructor(..._args) {
|
|
31377
32049
|
super(..._args);
|
|
31378
32050
|
this.barSpacing = 20;
|
|
@@ -31520,7 +32192,7 @@ let SwipeElement = class SwipeElement extends i$3 {
|
|
|
31520
32192
|
})}`;
|
|
31521
32193
|
}
|
|
31522
32194
|
static {
|
|
31523
|
-
this.styles = [prominenceStyles, i$
|
|
32195
|
+
this.styles = [prominenceStyles, i$7`
|
|
31524
32196
|
:host {
|
|
31525
32197
|
display: block;
|
|
31526
32198
|
user-select: none;
|
|
@@ -31566,10 +32238,10 @@ __decorate([n$2({ type: Number })], SwipeElement.prototype, "barSpacing", void 0
|
|
|
31566
32238
|
__decorate([n$2({ type: Number })], SwipeElement.prototype, "barWidth", void 0);
|
|
31567
32239
|
__decorate([n$2({ type: Number })], SwipeElement.prototype, "debounceMs", void 0);
|
|
31568
32240
|
__decorate([n$2({ type: Number })], SwipeElement.prototype, "retractDurationMs", void 0);
|
|
31569
|
-
SwipeElement = __decorate([
|
|
32241
|
+
SwipeElement = __decorate([safeCustomElement(`ixfx-swipe`)], SwipeElement);
|
|
31570
32242
|
//#endregion
|
|
31571
32243
|
//#region src/tabs/tab-list-item.ts
|
|
31572
|
-
let TabListItemElement = class TabListItemElement extends i$
|
|
32244
|
+
let TabListItemElement = class TabListItemElement extends i$4 {
|
|
31573
32245
|
constructor(..._args) {
|
|
31574
32246
|
super(..._args);
|
|
31575
32247
|
this.closeable = false;
|
|
@@ -31642,7 +32314,7 @@ let TabListItemElement = class TabListItemElement extends i$3 {
|
|
|
31642
32314
|
this.remove();
|
|
31643
32315
|
}
|
|
31644
32316
|
static {
|
|
31645
|
-
this.styles = [prominenceStyles, i$
|
|
32317
|
+
this.styles = [prominenceStyles, i$7`
|
|
31646
32318
|
:host {
|
|
31647
32319
|
--selected-colour: var(--accent);
|
|
31648
32320
|
--selected-border-width: 1px;
|
|
@@ -31728,10 +32400,10 @@ __decorate([n$2({
|
|
|
31728
32400
|
})], TabListItemElement.prototype, "commandActive", void 0);
|
|
31729
32401
|
__decorate([n$2({ attribute: false })], TabListItemElement.prototype, "registry", void 0);
|
|
31730
32402
|
__decorate([r$1()], TabListItemElement.prototype, "_compact", void 0);
|
|
31731
|
-
TabListItemElement = __decorate([
|
|
32403
|
+
TabListItemElement = __decorate([safeCustomElement(`ixfx-tab-list-item`)], TabListItemElement);
|
|
31732
32404
|
//#endregion
|
|
31733
32405
|
//#region src/tabs/tab-list.ts
|
|
31734
|
-
let TabListElement = class TabListElement extends i$
|
|
32406
|
+
let TabListElement = class TabListElement extends i$4 {
|
|
31735
32407
|
constructor(..._args) {
|
|
31736
32408
|
super(..._args);
|
|
31737
32409
|
this.orientation = `horizontal`;
|
|
@@ -31797,7 +32469,7 @@ let TabListElement = class TabListElement extends i$3 {
|
|
|
31797
32469
|
}
|
|
31798
32470
|
updated(changedProperties) {
|
|
31799
32471
|
super.updated(changedProperties);
|
|
31800
|
-
this.classList.toggle(
|
|
32472
|
+
this.classList.toggle(`scrollable`, this.scrollable);
|
|
31801
32473
|
}
|
|
31802
32474
|
#syncIndicatorColors() {
|
|
31803
32475
|
for (const item of this.#items) {
|
|
@@ -31851,7 +32523,7 @@ let TabListElement = class TabListElement extends i$3 {
|
|
|
31851
32523
|
}
|
|
31852
32524
|
#onSlotClick;
|
|
31853
32525
|
static {
|
|
31854
|
-
this.styles = i$
|
|
32526
|
+
this.styles = i$7`
|
|
31855
32527
|
:host {
|
|
31856
32528
|
display: inline-block;
|
|
31857
32529
|
--activated-colour: var(--accent);
|
|
@@ -31925,15 +32597,15 @@ let TabListElement = class TabListElement extends i$3 {
|
|
|
31925
32597
|
__decorate([n$2({ type: String })], TabListElement.prototype, "orientation", void 0);
|
|
31926
32598
|
__decorate([n$2({ type: Boolean })], TabListElement.prototype, "flip", void 0);
|
|
31927
32599
|
__decorate([n$2({ type: Boolean })], TabListElement.prototype, "scrollable", void 0);
|
|
31928
|
-
TabListElement = __decorate([
|
|
32600
|
+
TabListElement = __decorate([safeCustomElement(`ixfx-tab-list`)], TabListElement);
|
|
31929
32601
|
//#endregion
|
|
31930
32602
|
//#region src/tabs/tab-panel.ts
|
|
31931
|
-
let TabPanelElement = class TabPanelElement extends i$
|
|
32603
|
+
let TabPanelElement = class TabPanelElement extends i$4 {
|
|
31932
32604
|
render() {
|
|
31933
32605
|
return b`<slot></slot>`;
|
|
31934
32606
|
}
|
|
31935
32607
|
static {
|
|
31936
|
-
this.styles = i$
|
|
32608
|
+
this.styles = i$7`
|
|
31937
32609
|
:host {
|
|
31938
32610
|
display:none;
|
|
31939
32611
|
height:100%;
|
|
@@ -31947,10 +32619,10 @@ let TabPanelElement = class TabPanelElement extends i$3 {
|
|
|
31947
32619
|
`;
|
|
31948
32620
|
}
|
|
31949
32621
|
};
|
|
31950
|
-
TabPanelElement = __decorate([
|
|
32622
|
+
TabPanelElement = __decorate([safeCustomElement(`ixfx-tab-panel`)], TabPanelElement);
|
|
31951
32623
|
//#endregion
|
|
31952
32624
|
//#region src/tabs/tab-panels.ts
|
|
31953
|
-
let TabPanelsElement = class TabPanelsElement extends i$
|
|
32625
|
+
let TabPanelsElement = class TabPanelsElement extends i$4 {
|
|
31954
32626
|
render() {
|
|
31955
32627
|
return b`<slot></slot>`;
|
|
31956
32628
|
}
|
|
@@ -31993,7 +32665,7 @@ let TabPanelsElement = class TabPanelsElement extends i$3 {
|
|
|
31993
32665
|
return found;
|
|
31994
32666
|
}
|
|
31995
32667
|
static {
|
|
31996
|
-
this.styles = i$
|
|
32668
|
+
this.styles = i$7`
|
|
31997
32669
|
:host {
|
|
31998
32670
|
display: block;
|
|
31999
32671
|
}
|
|
@@ -32002,7 +32674,71 @@ let TabPanelsElement = class TabPanelsElement extends i$3 {
|
|
|
32002
32674
|
}
|
|
32003
32675
|
};
|
|
32004
32676
|
__decorate([o$2()], TabPanelsElement.prototype, "_listItems", void 0);
|
|
32005
|
-
TabPanelsElement = __decorate([
|
|
32677
|
+
TabPanelsElement = __decorate([safeCustomElement(`ixfx-tab-panels`)], TabPanelsElement);
|
|
32678
|
+
//#endregion
|
|
32679
|
+
//#region src/timeline/timeline-controller.ts
|
|
32680
|
+
/**
|
|
32681
|
+
* External adapter class that can configure a timeline element
|
|
32682
|
+
* with musical time, custom label formatting, etc.
|
|
32683
|
+
*
|
|
32684
|
+
* The controller has no import of any timeline element type.
|
|
32685
|
+
* Users create a controller, pass it the component instance,
|
|
32686
|
+
* and the controller calls the component's public API.
|
|
32687
|
+
*/
|
|
32688
|
+
var TimelineController = class {
|
|
32689
|
+
#host;
|
|
32690
|
+
#config;
|
|
32691
|
+
#bpm = 120;
|
|
32692
|
+
#timeSignatureNumerator = 4;
|
|
32693
|
+
#timeSignatureDenominator = 4;
|
|
32694
|
+
constructor(timeline, config) {
|
|
32695
|
+
this.#host = timeline;
|
|
32696
|
+
this.#config = config;
|
|
32697
|
+
timeline.min = config.logicalMin;
|
|
32698
|
+
timeline.max = config.logicalMax;
|
|
32699
|
+
if (config.labelFormatter) timeline.formatLabel = config.labelFormatter;
|
|
32700
|
+
timeline.addEventListener(`track-select`, this.#onTrackSelect);
|
|
32701
|
+
}
|
|
32702
|
+
/** Update the tempo (BPM) for musical time calculations. */
|
|
32703
|
+
setTempo(bpm) {
|
|
32704
|
+
this.#bpm = bpm;
|
|
32705
|
+
this.#updateFormatLabel();
|
|
32706
|
+
}
|
|
32707
|
+
/** Update the time signature for musical time calculations. */
|
|
32708
|
+
setTimeSignature(numerator, denominator) {
|
|
32709
|
+
this.#timeSignatureNumerator = numerator;
|
|
32710
|
+
this.#timeSignatureDenominator = denominator;
|
|
32711
|
+
this.#updateFormatLabel();
|
|
32712
|
+
}
|
|
32713
|
+
/** Set the visible view range on the timeline. */
|
|
32714
|
+
setViewRange(range) {
|
|
32715
|
+
this.#host.setViewRange(range);
|
|
32716
|
+
}
|
|
32717
|
+
/** Clean up any resources held by the controller. */
|
|
32718
|
+
dispose() {
|
|
32719
|
+
this.#host.removeEventListener(`track-select`, this.#onTrackSelect);
|
|
32720
|
+
}
|
|
32721
|
+
#onTrackSelect = (e) => {
|
|
32722
|
+
const detail = e.detail;
|
|
32723
|
+
const trackEventIds = this.#host.getTrackEvents(detail.trackKey).map((e) => e.id);
|
|
32724
|
+
if (detail.shiftKey) {
|
|
32725
|
+
const current = new Set(this.#host.selectedIds);
|
|
32726
|
+
for (const id of trackEventIds) if (current.has(id)) current.delete(id);
|
|
32727
|
+
else current.add(id);
|
|
32728
|
+
this.#host.selectedIds = [...current];
|
|
32729
|
+
} else this.#host.selectedIds = trackEventIds;
|
|
32730
|
+
};
|
|
32731
|
+
#updateFormatLabel() {
|
|
32732
|
+
if (this.#config.labelFormatter) return;
|
|
32733
|
+
this.#bpm;
|
|
32734
|
+
const num = this.#timeSignatureNumerator;
|
|
32735
|
+
this.#host.formatLabel = (v) => {
|
|
32736
|
+
const beatsPerBar = num;
|
|
32737
|
+
const totalBeats = v;
|
|
32738
|
+
return `${Math.floor(totalBeats / beatsPerBar) + 1}.${Math.floor(totalBeats % beatsPerBar) + 1}`;
|
|
32739
|
+
};
|
|
32740
|
+
}
|
|
32741
|
+
};
|
|
32006
32742
|
//#endregion
|
|
32007
32743
|
//#region src/timeline/timeline-draw.ts
|
|
32008
32744
|
const NICE_STEPS = [
|
|
@@ -32014,15 +32750,15 @@ const NICE_STEPS = [
|
|
|
32014
32750
|
/**
|
|
32015
32751
|
* Dispatch to adaptive or fixed grid mode.
|
|
32016
32752
|
*/
|
|
32017
|
-
|
|
32753
|
+
function resolveGrid(viewRange, userScale, viewportWidth, mode = `adaptive`, fixedMinorStep, ppu) {
|
|
32018
32754
|
if (mode === `fixed` && fixedMinorStep !== void 0 && ppu !== void 0) return resolveFixedGrid(fixedMinorStep, ppu);
|
|
32019
32755
|
return resolveAdaptiveGrid(viewRange, userScale, viewportWidth);
|
|
32020
|
-
}
|
|
32756
|
+
}
|
|
32021
32757
|
/**
|
|
32022
32758
|
* Compute a nice major/minor grid resolution for the current view.
|
|
32023
32759
|
* Uses a 1-2-5-10 "nice number" algorithm.
|
|
32024
32760
|
*/
|
|
32025
|
-
|
|
32761
|
+
function resolveAdaptiveGrid(viewRange, userScale, viewportWidth) {
|
|
32026
32762
|
const span = viewRange.max - viewRange.min;
|
|
32027
32763
|
if (span <= 0 || viewportWidth <= 0) return {
|
|
32028
32764
|
majorStep: 100,
|
|
@@ -32031,7 +32767,7 @@ const resolveAdaptiveGrid = (viewRange, userScale, viewportWidth) => {
|
|
|
32031
32767
|
};
|
|
32032
32768
|
const targetPx = 80 * scaleMultiplier(userScale);
|
|
32033
32769
|
const rawStep = span / Math.max(2, Math.floor(viewportWidth / targetPx));
|
|
32034
|
-
const magnitude =
|
|
32770
|
+
const magnitude = 10 ** Math.floor(Math.log10(rawStep));
|
|
32035
32771
|
let bestStep = magnitude;
|
|
32036
32772
|
for (const n of NICE_STEPS) {
|
|
32037
32773
|
const candidate = n * magnitude;
|
|
@@ -32048,14 +32784,14 @@ const resolveAdaptiveGrid = (viewRange, userScale, viewportWidth) => {
|
|
|
32048
32784
|
minorDivisions,
|
|
32049
32785
|
minorStep
|
|
32050
32786
|
};
|
|
32051
|
-
}
|
|
32787
|
+
}
|
|
32052
32788
|
/**
|
|
32053
32789
|
* Fixed grid: user specifies a base minor step in logical units.
|
|
32054
32790
|
* If the minor step at current zoom would produce lines < 5px apart,
|
|
32055
32791
|
* double the effective step until they're >= 5px.
|
|
32056
32792
|
* Major = 4× effective minor.
|
|
32057
32793
|
*/
|
|
32058
|
-
|
|
32794
|
+
function resolveFixedGrid(baseMinorStep, ppu) {
|
|
32059
32795
|
const MIN_PX_BETWEEN = 5;
|
|
32060
32796
|
let effectiveMinor = baseMinorStep;
|
|
32061
32797
|
while (effectiveMinor * ppu < MIN_PX_BETWEEN && effectiveMinor < 0xe8d4a51000) effectiveMinor *= 2;
|
|
@@ -32065,8 +32801,8 @@ const resolveFixedGrid = (baseMinorStep, ppu) => {
|
|
|
32065
32801
|
minorDivisions,
|
|
32066
32802
|
minorStep: effectiveMinor
|
|
32067
32803
|
};
|
|
32068
|
-
}
|
|
32069
|
-
|
|
32804
|
+
}
|
|
32805
|
+
function scaleMultiplier(scale) {
|
|
32070
32806
|
switch (scale) {
|
|
32071
32807
|
case `x-wide`: return 2;
|
|
32072
32808
|
case `wide`: return 1.5;
|
|
@@ -32075,8 +32811,8 @@ const scaleMultiplier = (scale) => {
|
|
|
32075
32811
|
case `x-slim`: return .5;
|
|
32076
32812
|
default: return 1;
|
|
32077
32813
|
}
|
|
32078
|
-
}
|
|
32079
|
-
|
|
32814
|
+
}
|
|
32815
|
+
function drawMajorMinorGrid(ctx, region, resolution, altMajorBg, vars, ppu) {
|
|
32080
32816
|
const { majorStep, minorStep } = resolution;
|
|
32081
32817
|
if (majorStep <= 0) return;
|
|
32082
32818
|
const regionEnd = region.x + region.width;
|
|
@@ -32090,7 +32826,7 @@ const drawMajorMinorGrid = (ctx, region, resolution, altMajorBg, vars, ppu) => {
|
|
|
32090
32826
|
}
|
|
32091
32827
|
if (minorStep > 0) {
|
|
32092
32828
|
ctx.strokeStyle = vars[`--timeline-grid-minor-color`] ?? `rgba(255,255,255,0.05)`;
|
|
32093
|
-
ctx.lineWidth = parseFloat(vars[`--timeline-grid-minor-width`] ?? `0.5`);
|
|
32829
|
+
ctx.lineWidth = Number.parseFloat(vars[`--timeline-grid-minor-width`] ?? `0.5`);
|
|
32094
32830
|
ctx.beginPath();
|
|
32095
32831
|
const firstMinor = Math.floor(region.x / minorStep) * minorStep;
|
|
32096
32832
|
for (let val = firstMinor; val < regionEnd; val += minorStep) {
|
|
@@ -32102,7 +32838,7 @@ const drawMajorMinorGrid = (ctx, region, resolution, altMajorBg, vars, ppu) => {
|
|
|
32102
32838
|
ctx.stroke();
|
|
32103
32839
|
}
|
|
32104
32840
|
ctx.strokeStyle = vars[`--timeline-grid-major-color`] ?? `rgba(255,255,255,0.12)`;
|
|
32105
|
-
ctx.lineWidth = parseFloat(vars[`--timeline-grid-major-width`] ?? `1`);
|
|
32841
|
+
ctx.lineWidth = Number.parseFloat(vars[`--timeline-grid-major-width`] ?? `1`);
|
|
32106
32842
|
ctx.beginPath();
|
|
32107
32843
|
const firstMajor = Math.floor(region.x / majorStep) * majorStep;
|
|
32108
32844
|
for (let val = firstMajor; val < regionEnd; val += majorStep) {
|
|
@@ -32111,13 +32847,13 @@ const drawMajorMinorGrid = (ctx, region, resolution, altMajorBg, vars, ppu) => {
|
|
|
32111
32847
|
ctx.lineTo(px, region.y + region.height);
|
|
32112
32848
|
}
|
|
32113
32849
|
ctx.stroke();
|
|
32114
|
-
}
|
|
32850
|
+
}
|
|
32115
32851
|
/**
|
|
32116
32852
|
* Draw the axis header band. With 2D virtualization the axis is "sticky" —
|
|
32117
32853
|
* it is always drawn at the current vertical scroll position (`scrollTop`)
|
|
32118
32854
|
* so it appears fixed at the viewport top.
|
|
32119
32855
|
*/
|
|
32120
|
-
|
|
32856
|
+
function drawAxis(ctx, region, resolution, axisHeight, formatLabel, vars, ppu, scrollTop = 0) {
|
|
32121
32857
|
const { majorStep } = resolution;
|
|
32122
32858
|
if (majorStep <= 0 || axisHeight <= 0) return;
|
|
32123
32859
|
const axisTop = scrollTop;
|
|
@@ -32129,7 +32865,7 @@ const drawAxis = (ctx, region, resolution, axisHeight, formatLabel, vars, ppu, s
|
|
|
32129
32865
|
const bgLeft = region.x * ppu;
|
|
32130
32866
|
ctx.fillRect(bgLeft, axisTop, region.width * ppu, bgHeight);
|
|
32131
32867
|
ctx.strokeStyle = vars[`--timeline-grid-major-color`] ?? `rgba(255,255,255,0.12)`;
|
|
32132
|
-
ctx.lineWidth = parseFloat(vars[`--timeline-grid-major-width`] ?? `1`);
|
|
32868
|
+
ctx.lineWidth = Number.parseFloat(vars[`--timeline-grid-major-width`] ?? `1`);
|
|
32133
32869
|
ctx.beginPath();
|
|
32134
32870
|
const firstMajor = Math.ceil(region.x / majorStep) * majorStep;
|
|
32135
32871
|
for (let val = firstMajor; val < regionEnd; val += majorStep) {
|
|
@@ -32154,8 +32890,8 @@ const drawAxis = (ctx, region, resolution, axisHeight, formatLabel, vars, ppu, s
|
|
|
32154
32890
|
ctx.fillText(formatLabel(val), px + labelPadding, axisTop + bgHeight / 2);
|
|
32155
32891
|
}
|
|
32156
32892
|
ctx.textAlign = `start`;
|
|
32157
|
-
}
|
|
32158
|
-
|
|
32893
|
+
}
|
|
32894
|
+
function drawTrackBackgrounds(ctx, region, trackLayout, tracks, vars, ppu) {
|
|
32159
32895
|
const bgDefault = vars[`--timeline-track-bg`] ?? `#1a1a1a`;
|
|
32160
32896
|
const bgAlt = vars[`--timeline-track-bg-alt`] ?? `#1e1e1e`;
|
|
32161
32897
|
for (let i = 0; i < trackLayout.length; i++) {
|
|
@@ -32163,7 +32899,7 @@ const drawTrackBackgrounds = (ctx, region, trackLayout, tracks, vars, ppu) => {
|
|
|
32163
32899
|
if (layout.y + layout.height < region.y) continue;
|
|
32164
32900
|
if (layout.y > region.y + region.height) break;
|
|
32165
32901
|
const track = tracks.find((t) => t.key === layout.trackKey);
|
|
32166
|
-
ctx.fillStyle = track?.color ? track.color
|
|
32902
|
+
ctx.fillStyle = track?.color ? `${track.color}22` : i % 2 === 0 ? bgDefault : bgAlt;
|
|
32167
32903
|
ctx.fillRect(region.x * ppu, layout.y, region.width * ppu, layout.height);
|
|
32168
32904
|
ctx.strokeStyle = vars[`--timeline-grid-major-color`] ?? `rgba(255,255,255,0.12)`;
|
|
32169
32905
|
ctx.lineWidth = .5;
|
|
@@ -32172,13 +32908,13 @@ const drawTrackBackgrounds = (ctx, region, trackLayout, tracks, vars, ppu) => {
|
|
|
32172
32908
|
ctx.lineTo((region.x + region.width) * ppu, layout.y + layout.height);
|
|
32173
32909
|
ctx.stroke();
|
|
32174
32910
|
}
|
|
32175
|
-
}
|
|
32176
|
-
|
|
32911
|
+
}
|
|
32912
|
+
function drawEventRects(ctx, region, events, trackLayout, selectedIds, tickledId, drag, vars, ppu) {
|
|
32177
32913
|
const eventBg = vars[`--timeline-event-bg`] ?? `#3498db`;
|
|
32178
32914
|
const eventSelectedBg = vars[`--timeline-event-selected-bg`] ?? `#5dade2`;
|
|
32179
32915
|
const eventTickledBg = vars[`--timeline-event-tickled-bg`] ?? `#444`;
|
|
32180
32916
|
const eventLabelColor = vars[`--timeline-event-label-color`] ?? `#fff`;
|
|
32181
|
-
const radius = parseFloat(vars[`--timeline-event-radius`] ?? `4`);
|
|
32917
|
+
const radius = Number.parseFloat(vars[`--timeline-event-radius`] ?? `4`);
|
|
32182
32918
|
const regionEnd = region.x + region.width;
|
|
32183
32919
|
const padding = 3;
|
|
32184
32920
|
for (const evt of events) {
|
|
@@ -32232,8 +32968,8 @@ const drawEventRects = (ctx, region, events, trackLayout, selectedIds, tickledId
|
|
|
32232
32968
|
ctx.restore();
|
|
32233
32969
|
}
|
|
32234
32970
|
}
|
|
32235
|
-
}
|
|
32236
|
-
|
|
32971
|
+
}
|
|
32972
|
+
function drawMarquee(ctx, drag, ppu) {
|
|
32237
32973
|
if (drag.kind !== `marquee`) return;
|
|
32238
32974
|
const x1 = Math.min(drag.startLogicalX, drag.currentLogicalX) * ppu;
|
|
32239
32975
|
const x2 = Math.max(drag.startLogicalX, drag.currentLogicalX) * ppu;
|
|
@@ -32244,8 +32980,8 @@ const drawMarquee = (ctx, drag, ppu) => {
|
|
|
32244
32980
|
ctx.strokeStyle = `rgba(100, 150, 255, 0.6)`;
|
|
32245
32981
|
ctx.lineWidth = 1;
|
|
32246
32982
|
ctx.strokeRect(x1, y1, x2 - x1, y2 - y1);
|
|
32247
|
-
}
|
|
32248
|
-
|
|
32983
|
+
}
|
|
32984
|
+
function drawRoundRect(ctx, x, y, w, h, r) {
|
|
32249
32985
|
r = Math.max(0, r);
|
|
32250
32986
|
ctx.moveTo(x + r, y);
|
|
32251
32987
|
ctx.arcTo(x + w, y, x + w, y + h, r);
|
|
@@ -32253,7 +32989,7 @@ const drawRoundRect = (ctx, x, y, w, h, r) => {
|
|
|
32253
32989
|
ctx.arcTo(x, y + h, x, y, r);
|
|
32254
32990
|
ctx.arcTo(x, y, x + w, y, r);
|
|
32255
32991
|
ctx.closePath();
|
|
32256
|
-
}
|
|
32992
|
+
}
|
|
32257
32993
|
const TIMELINE_CSS_VARS = [
|
|
32258
32994
|
`--timeline-bg`,
|
|
32259
32995
|
`--timeline-track-bg`,
|
|
@@ -32270,12 +33006,12 @@ const TIMELINE_CSS_VARS = [
|
|
|
32270
33006
|
`--timeline-event-radius`,
|
|
32271
33007
|
`--timeline-axis-label-color`
|
|
32272
33008
|
];
|
|
32273
|
-
|
|
33009
|
+
function resolveCssVars(host) {
|
|
32274
33010
|
const computed = getComputedStyle(host);
|
|
32275
33011
|
const vars = {};
|
|
32276
33012
|
for (const v of TIMELINE_CSS_VARS) vars[v] = computed.getPropertyValue(v).trim();
|
|
32277
33013
|
return vars;
|
|
32278
|
-
}
|
|
33014
|
+
}
|
|
32279
33015
|
//#endregion
|
|
32280
33016
|
//#region src/timeline/timeline-interactions.ts
|
|
32281
33017
|
/** Hit zone near the edge of an event (px in screen space) */
|
|
@@ -32284,13 +33020,17 @@ const EDGE_HIT_PX = 8;
|
|
|
32284
33020
|
* Convert a vcanvas logical (pixel) coordinate to timeline logical units.
|
|
32285
33021
|
* vcanvas pixel coordinates are in the 1:1 pixel space; divide by ppu then add min.
|
|
32286
33022
|
*/
|
|
32287
|
-
|
|
33023
|
+
function canvasToTimeline(canvasX, ppu, min) {
|
|
33024
|
+
return canvasX / ppu + min;
|
|
33025
|
+
}
|
|
32288
33026
|
/**
|
|
32289
33027
|
* Convert screen-space pixel distance to timeline logical units.
|
|
32290
33028
|
* Used for edge hit threshold: how many logical units does EDGE_HIT_PX correspond to.
|
|
32291
33029
|
*/
|
|
32292
|
-
|
|
32293
|
-
|
|
33030
|
+
function pxToLogicalUnits(ppu) {
|
|
33031
|
+
return ppu > 0 ? 1 / ppu : 1;
|
|
33032
|
+
}
|
|
33033
|
+
function hitTest(logicalX, y, events, trackLayout, ppu) {
|
|
32294
33034
|
const track = trackLayout.find((tl) => y >= tl.y && y < tl.y + tl.height);
|
|
32295
33035
|
if (!track) return {
|
|
32296
33036
|
kind: `empty`,
|
|
@@ -32323,17 +33063,19 @@ const hitTest = (logicalX, y, events, trackLayout, ppu) => {
|
|
|
32323
33063
|
y,
|
|
32324
33064
|
trackKey: track.trackKey
|
|
32325
33065
|
};
|
|
32326
|
-
}
|
|
32327
|
-
|
|
33066
|
+
}
|
|
33067
|
+
function trackAtY(y, trackLayout) {
|
|
32328
33068
|
return trackLayout.find((tl) => y >= tl.y && y < tl.y + tl.height)?.trackKey;
|
|
32329
|
-
}
|
|
33069
|
+
}
|
|
32330
33070
|
/** Sensitivity: how many pixels of vertical drag = 1 e-fold of zoom */
|
|
32331
33071
|
const ZOOM_SENSITIVITY_PX = 100;
|
|
32332
33072
|
/**
|
|
32333
33073
|
* Subtract a deadzone from a value.
|
|
32334
33074
|
* Returns 0 if |value| <= deadzone, otherwise value shifted toward zero by deadzone.
|
|
32335
33075
|
*/
|
|
32336
|
-
|
|
33076
|
+
function applyDeadzone(value, deadzone) {
|
|
33077
|
+
return Math.abs(value) > deadzone ? value - Math.sign(value) * deadzone : 0;
|
|
33078
|
+
}
|
|
32337
33079
|
/**
|
|
32338
33080
|
* Compute new ppu + viewMin from an axis-zoom drag.
|
|
32339
33081
|
* Vertical delta (dy) controls zoom (up = zoom in, down = zoom out), anchored at `anchorUnit`.
|
|
@@ -32341,7 +33083,7 @@ const applyDeadzone = (value, deadzone) => Math.abs(value) > deadzone ? value -
|
|
|
32341
33083
|
*
|
|
32342
33084
|
* Returns { ppu, viewMin } — the caller uses host.setZoomPan() to apply.
|
|
32343
33085
|
*/
|
|
32344
|
-
|
|
33086
|
+
function computeAxisZoom(startViewMin, startPpu, anchorUnit, dx, dy) {
|
|
32345
33087
|
const newPpu = startPpu * Math.exp(-dy / ZOOM_SENSITIVITY_PX);
|
|
32346
33088
|
let newMin = anchorUnit - (anchorUnit - startViewMin) * startPpu / newPpu;
|
|
32347
33089
|
if (newPpu > 0) newMin += -dx / newPpu;
|
|
@@ -32349,7 +33091,7 @@ const computeAxisZoom = (startViewMin, startPpu, anchorUnit, dx, dy) => {
|
|
|
32349
33091
|
ppu: newPpu,
|
|
32350
33092
|
viewMin: newMin
|
|
32351
33093
|
};
|
|
32352
|
-
}
|
|
33094
|
+
}
|
|
32353
33095
|
/**
|
|
32354
33096
|
* Compute new vertical view range from a v-axis-zoom drag.
|
|
32355
33097
|
* Horizontal delta (dx) controls zoom (right = zoom in, left = zoom out),
|
|
@@ -32358,7 +33100,7 @@ const computeAxisZoom = (startViewMin, startPpu, anchorUnit, dx, dy) => {
|
|
|
32358
33100
|
*
|
|
32359
33101
|
* Returns { vMin, vMax } — the caller uses host.setVerticalZoomPan() to apply.
|
|
32360
33102
|
*/
|
|
32361
|
-
|
|
33103
|
+
function computeVerticalAxisZoom(startVMin, startVMax, startVScale, anchorBaseY, dx, dy) {
|
|
32362
33104
|
const startSpan = startVMax - startVMin;
|
|
32363
33105
|
const newSpan = startSpan * Math.exp(-dx / ZOOM_SENSITIVITY_PX);
|
|
32364
33106
|
let newMin = anchorBaseY - (startSpan > 0 ? (anchorBaseY - startVMin) / startSpan : .5) * newSpan;
|
|
@@ -32367,12 +33109,12 @@ const computeVerticalAxisZoom = (startVMin, startVMax, startVScale, anchorBaseY,
|
|
|
32367
33109
|
vMin: newMin,
|
|
32368
33110
|
vMax: newMin + newSpan
|
|
32369
33111
|
};
|
|
32370
|
-
}
|
|
33112
|
+
}
|
|
32371
33113
|
/**
|
|
32372
33114
|
* Attaches pointer and keyboard interaction handlers to the timeline.
|
|
32373
33115
|
* Returns a cleanup function.
|
|
32374
33116
|
*/
|
|
32375
|
-
|
|
33117
|
+
function attachTimelineInteractions(host, vcanvasEl) {
|
|
32376
33118
|
const ac = new AbortController();
|
|
32377
33119
|
const signal = ac.signal;
|
|
32378
33120
|
vcanvasEl.addEventListener(`pointerdown`, (e) => {
|
|
@@ -32433,7 +33175,6 @@ const attachTimelineInteractions = (host, vcanvasEl) => {
|
|
|
32433
33175
|
currentLogicalX: lx,
|
|
32434
33176
|
currentY: ly
|
|
32435
33177
|
};
|
|
32436
|
-
return;
|
|
32437
33178
|
}
|
|
32438
33179
|
}, { signal });
|
|
32439
33180
|
vcanvasEl.addEventListener(`pointermove`, (e) => {
|
|
@@ -32506,7 +33247,6 @@ const attachTimelineInteractions = (host, vcanvasEl) => {
|
|
|
32506
33247
|
end: newEnd
|
|
32507
33248
|
} : ev);
|
|
32508
33249
|
vcanvasEl.invalidateAll();
|
|
32509
|
-
return;
|
|
32510
33250
|
}
|
|
32511
33251
|
}, { signal });
|
|
32512
33252
|
vcanvasEl.addEventListener(`pointerup`, (e) => {
|
|
@@ -32579,8 +33319,8 @@ const attachTimelineInteractions = (host, vcanvasEl) => {
|
|
|
32579
33319
|
}
|
|
32580
33320
|
}, { signal });
|
|
32581
33321
|
return () => ac.abort();
|
|
32582
|
-
}
|
|
32583
|
-
|
|
33322
|
+
}
|
|
33323
|
+
function handleHover(host, vcanvasEl, e) {
|
|
32584
33324
|
const ppu = host.pxPerUnit;
|
|
32585
33325
|
const canvasCoord = vcanvasEl.convertFromViewportToCanvas(e.offsetX, e.offsetY);
|
|
32586
33326
|
const lx = canvasToTimeline(canvasCoord.x, ppu, host.min);
|
|
@@ -32604,25 +33344,25 @@ const handleHover = (host, vcanvasEl, e) => {
|
|
|
32604
33344
|
host._tickledId = newTickledId;
|
|
32605
33345
|
vcanvasEl.invalidateAll();
|
|
32606
33346
|
}
|
|
32607
|
-
}
|
|
32608
|
-
|
|
33347
|
+
}
|
|
33348
|
+
function toggleSelection(host, eventId) {
|
|
32609
33349
|
const next = new Set(host._selectedIds);
|
|
32610
33350
|
if (next.has(eventId)) next.delete(eventId);
|
|
32611
33351
|
else next.add(eventId);
|
|
32612
33352
|
host._selectedIds = next;
|
|
32613
33353
|
fireSelectionChange(host);
|
|
32614
33354
|
host.getVCanvas()?.invalidateAll();
|
|
32615
|
-
}
|
|
32616
|
-
|
|
33355
|
+
}
|
|
33356
|
+
function fireSelectionChange(host) {
|
|
32617
33357
|
host.dispatchEvent(new CustomEvent(`selection-change`, {
|
|
32618
33358
|
detail: { selectedIds: [...host._selectedIds] },
|
|
32619
33359
|
bubbles: true,
|
|
32620
33360
|
composed: true
|
|
32621
33361
|
}));
|
|
32622
|
-
}
|
|
33362
|
+
}
|
|
32623
33363
|
//#endregion
|
|
32624
33364
|
//#region src/timeline/timeline-styles.ts
|
|
32625
|
-
const timelineStyles = i$
|
|
33365
|
+
const timelineStyles = i$7`
|
|
32626
33366
|
:host {
|
|
32627
33367
|
/* Layout */
|
|
32628
33368
|
--timeline-axis-height: 24px;
|
|
@@ -32779,7 +33519,7 @@ const timelineStyles = i$6`
|
|
|
32779
33519
|
const MIN_TRACK_HEIGHT = 24;
|
|
32780
33520
|
/** How close to the bottom edge the pointer must be (px) to trigger resize */
|
|
32781
33521
|
const EDGE_ZONE_PX = 6;
|
|
32782
|
-
let TimelineTrackTabElement = class TimelineTrackTabElement extends i$
|
|
33522
|
+
let TimelineTrackTabElement = class TimelineTrackTabElement extends i$4 {
|
|
32783
33523
|
constructor(..._args) {
|
|
32784
33524
|
super(..._args);
|
|
32785
33525
|
this.label = ``;
|
|
@@ -32824,7 +33564,7 @@ let TimelineTrackTabElement = class TimelineTrackTabElement extends i$3 {
|
|
|
32824
33564
|
};
|
|
32825
33565
|
}
|
|
32826
33566
|
static {
|
|
32827
|
-
this.styles = i$
|
|
33567
|
+
this.styles = i$7`
|
|
32828
33568
|
:host {
|
|
32829
33569
|
display: flex;
|
|
32830
33570
|
align-items: center;
|
|
@@ -32943,14 +33683,14 @@ __decorate([n$2({
|
|
|
32943
33683
|
type: Boolean,
|
|
32944
33684
|
reflect: true
|
|
32945
33685
|
})], TimelineTrackTabElement.prototype, "resizable", void 0);
|
|
32946
|
-
TimelineTrackTabElement = __decorate([
|
|
33686
|
+
TimelineTrackTabElement = __decorate([safeCustomElement(`ixfx-timeline-track-tab`)], TimelineTrackTabElement);
|
|
32947
33687
|
//#endregion
|
|
32948
33688
|
//#region src/timeline/timeline-element.ts
|
|
32949
33689
|
/** Reasonable maximum ppu to prevent infinite zoom-in */
|
|
32950
33690
|
const MAX_PPU = 1e4;
|
|
32951
33691
|
/** Minimum rendered track height (~1.5em) at max zoom-out */
|
|
32952
33692
|
const MIN_TRACK_RENDER_HEIGHT = 24;
|
|
32953
|
-
let IxfxTimelineElement = class IxfxTimelineElement extends i$
|
|
33693
|
+
let IxfxTimelineElement = class IxfxTimelineElement extends i$4 {
|
|
32954
33694
|
constructor(..._args) {
|
|
32955
33695
|
super(..._args);
|
|
32956
33696
|
this.tracks = [];
|
|
@@ -33679,74 +34419,269 @@ __decorate([r$1()], IxfxTimelineElement.prototype, "_trackHeightOverrides", void
|
|
|
33679
34419
|
__decorate([r$1()], IxfxTimelineElement.prototype, "_trackLayout", void 0);
|
|
33680
34420
|
__decorate([r$1()], IxfxTimelineElement.prototype, "_internalEvents", void 0);
|
|
33681
34421
|
__decorate([r$1()], IxfxTimelineElement.prototype, "_internalTracks", void 0);
|
|
33682
|
-
IxfxTimelineElement = __decorate([
|
|
34422
|
+
IxfxTimelineElement = __decorate([safeCustomElement(`ixfx-timeline`)], IxfxTimelineElement);
|
|
33683
34423
|
//#endregion
|
|
33684
|
-
//#region
|
|
34424
|
+
//#region node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/keyed.js
|
|
33685
34425
|
/**
|
|
33686
|
-
*
|
|
33687
|
-
*
|
|
33688
|
-
*
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
*/
|
|
33693
|
-
var TimelineController = class {
|
|
33694
|
-
#host;
|
|
33695
|
-
#config;
|
|
33696
|
-
#bpm = 120;
|
|
33697
|
-
#timeSignatureNumerator = 4;
|
|
33698
|
-
#timeSignatureDenominator = 4;
|
|
33699
|
-
constructor(timeline, config) {
|
|
33700
|
-
this.#host = timeline;
|
|
33701
|
-
this.#config = config;
|
|
33702
|
-
timeline.min = config.logicalMin;
|
|
33703
|
-
timeline.max = config.logicalMax;
|
|
33704
|
-
if (config.labelFormatter) timeline.formatLabel = config.labelFormatter;
|
|
33705
|
-
timeline.addEventListener(`track-select`, this.#onTrackSelect);
|
|
34426
|
+
* @license
|
|
34427
|
+
* Copyright 2021 Google LLC
|
|
34428
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
34429
|
+
*/ const i = e$3(class extends i$3 {
|
|
34430
|
+
constructor() {
|
|
34431
|
+
super(...arguments), this.key = A;
|
|
33706
34432
|
}
|
|
33707
|
-
|
|
33708
|
-
|
|
33709
|
-
this.#bpm = bpm;
|
|
33710
|
-
this.#updateFormatLabel();
|
|
34433
|
+
render(r, t) {
|
|
34434
|
+
return this.key = r, t;
|
|
33711
34435
|
}
|
|
33712
|
-
|
|
33713
|
-
|
|
33714
|
-
this.#timeSignatureNumerator = numerator;
|
|
33715
|
-
this.#timeSignatureDenominator = denominator;
|
|
33716
|
-
this.#updateFormatLabel();
|
|
34436
|
+
update(r, [t, e]) {
|
|
34437
|
+
return t !== this.key && (p(r), this.key = t), e;
|
|
33717
34438
|
}
|
|
33718
|
-
|
|
33719
|
-
|
|
33720
|
-
|
|
34439
|
+
});
|
|
34440
|
+
//#endregion
|
|
34441
|
+
//#region src/transitory-label/transitory-label.ts
|
|
34442
|
+
let TransitoryLabelElement = class TransitoryLabelElement extends i$4 {
|
|
34443
|
+
constructor(..._args) {
|
|
34444
|
+
super(..._args);
|
|
34445
|
+
this.text = ``;
|
|
34446
|
+
this.effect = `fade`;
|
|
34447
|
+
this.duration = 300;
|
|
34448
|
+
this.easing = `ease`;
|
|
34449
|
+
this._currentText = ``;
|
|
34450
|
+
this._outgoingText = ``;
|
|
34451
|
+
this._transitionId = 0;
|
|
34452
|
+
this._queue = [];
|
|
34453
|
+
this.#onOutgoingEnd = () => {
|
|
34454
|
+
this._onTransitionEnd();
|
|
34455
|
+
};
|
|
34456
|
+
this.#onLastCharOut = () => {
|
|
34457
|
+
this._onTransitionEnd();
|
|
34458
|
+
};
|
|
33721
34459
|
}
|
|
33722
|
-
|
|
33723
|
-
|
|
33724
|
-
this
|
|
34460
|
+
setText(msg, effect) {
|
|
34461
|
+
this._pendingEffect = effect;
|
|
34462
|
+
this.text = msg;
|
|
33725
34463
|
}
|
|
33726
|
-
|
|
33727
|
-
|
|
33728
|
-
|
|
33729
|
-
|
|
33730
|
-
|
|
33731
|
-
|
|
33732
|
-
|
|
33733
|
-
|
|
33734
|
-
|
|
33735
|
-
|
|
33736
|
-
|
|
33737
|
-
|
|
33738
|
-
this
|
|
33739
|
-
|
|
33740
|
-
this
|
|
33741
|
-
|
|
33742
|
-
|
|
33743
|
-
|
|
33744
|
-
}
|
|
34464
|
+
updated(changed) {
|
|
34465
|
+
if (changed.has(`text`) && this.text !== this._currentText) {
|
|
34466
|
+
const effect = this._pendingEffect ?? this.effect;
|
|
34467
|
+
this._pendingEffect = void 0;
|
|
34468
|
+
if (this._activeEffect !== void 0) this._queue.push({
|
|
34469
|
+
text: this.text,
|
|
34470
|
+
effect
|
|
34471
|
+
});
|
|
34472
|
+
else this._startTransition(this.text, effect);
|
|
34473
|
+
}
|
|
34474
|
+
}
|
|
34475
|
+
_startTransition(newText, effect) {
|
|
34476
|
+
const prevText = this._currentText;
|
|
34477
|
+
this._currentText = newText;
|
|
34478
|
+
this._outgoingText = prevText;
|
|
34479
|
+
if (prevText !== ``) {
|
|
34480
|
+
this._transitionId++;
|
|
34481
|
+
this._activeEffect = effect;
|
|
34482
|
+
}
|
|
34483
|
+
}
|
|
34484
|
+
_onTransitionEnd() {
|
|
34485
|
+
this._outgoingText = ``;
|
|
34486
|
+
this._activeEffect = void 0;
|
|
34487
|
+
if (this._queue.length > 0) {
|
|
34488
|
+
const next = this._queue.shift();
|
|
34489
|
+
this._startTransition(next.text, next.effect);
|
|
34490
|
+
}
|
|
34491
|
+
}
|
|
34492
|
+
#onOutgoingEnd;
|
|
34493
|
+
#onLastCharOut;
|
|
34494
|
+
#renderCharSwap() {
|
|
34495
|
+
const charDuration = Math.round(this.duration * .3);
|
|
34496
|
+
const charStagger = Math.round(this.duration * .1);
|
|
34497
|
+
const currentChars = this._currentText.split(``);
|
|
34498
|
+
const outgoingChars = this._outgoingText.split(``);
|
|
34499
|
+
const lastIdx = outgoingChars.length - 1;
|
|
34500
|
+
const charStyle = (i) => `animation-duration:${charDuration}ms;animation-delay:${i * charStagger}ms;animation-timing-function:${this.easing}`;
|
|
34501
|
+
return b`
|
|
34502
|
+
${i(`cc${this._transitionId}`, b`
|
|
34503
|
+
<span class="layer current char-swap">
|
|
34504
|
+
${currentChars.map((ch, i) => b`<span class="char in" style=${charStyle(i)}>${ch}</span>`)}
|
|
34505
|
+
</span>
|
|
34506
|
+
`)}
|
|
34507
|
+
${this._outgoingText ? i(this._transitionId, b`
|
|
34508
|
+
<span class="layer outgoing char-swap">
|
|
34509
|
+
${outgoingChars.map((ch, i) => b`<span
|
|
34510
|
+
class="char out"
|
|
34511
|
+
style=${charStyle(i)}
|
|
34512
|
+
@animationend=${i === lastIdx ? this.#onLastCharOut : void 0}
|
|
34513
|
+
>${ch}</span>`)}
|
|
34514
|
+
</span>
|
|
34515
|
+
`) : A}
|
|
34516
|
+
`;
|
|
34517
|
+
}
|
|
34518
|
+
render() {
|
|
34519
|
+
if (this._activeEffect === `character-swap`) return b`<span class="container">${this.#renderCharSwap()}</span>`;
|
|
34520
|
+
const effect = this._activeEffect ?? ``;
|
|
34521
|
+
const durStyle = this._activeEffect ? `animation-duration:${this.duration}ms;animation-timing-function:${this.easing}` : ``;
|
|
34522
|
+
return b`
|
|
34523
|
+
<span class="container">
|
|
34524
|
+
${this._outgoingText ? i(this._transitionId, b`
|
|
34525
|
+
<span class="layer outgoing ${effect}" style=${durStyle} @animationend=${this.#onOutgoingEnd}>
|
|
34526
|
+
${this._outgoingText}
|
|
34527
|
+
</span>
|
|
34528
|
+
`) : A}
|
|
34529
|
+
${i(`c${this._transitionId}`, b`
|
|
34530
|
+
<span class="layer current ${effect}" style=${durStyle}>
|
|
34531
|
+
${this._currentText}
|
|
34532
|
+
</span>
|
|
34533
|
+
`)}
|
|
34534
|
+
</span>
|
|
34535
|
+
`;
|
|
34536
|
+
}
|
|
34537
|
+
static {
|
|
34538
|
+
this.styles = i$7`
|
|
34539
|
+
:host {
|
|
34540
|
+
display: inline-block;
|
|
34541
|
+
--transitory-label-easing: ease;
|
|
34542
|
+
}
|
|
34543
|
+
|
|
34544
|
+
.container {
|
|
34545
|
+
display: inline-grid;
|
|
34546
|
+
overflow: hidden;
|
|
34547
|
+
}
|
|
34548
|
+
|
|
34549
|
+
.layer {
|
|
34550
|
+
grid-area: 1 / 1;
|
|
34551
|
+
white-space: nowrap;
|
|
34552
|
+
}
|
|
34553
|
+
|
|
34554
|
+
.layer.outgoing {
|
|
34555
|
+
pointer-events: none;
|
|
34556
|
+
}
|
|
34557
|
+
|
|
34558
|
+
/* slide-right */
|
|
34559
|
+
.layer.current.slide-right {
|
|
34560
|
+
transform: translateX(-100%);
|
|
34561
|
+
animation: tl-slide-in-left var(--transitory-label-easing) forwards;
|
|
34562
|
+
}
|
|
34563
|
+
.layer.outgoing.slide-right {
|
|
34564
|
+
animation: tl-slide-out-right var(--transitory-label-easing) forwards;
|
|
34565
|
+
}
|
|
34566
|
+
|
|
34567
|
+
@keyframes tl-slide-in-left {
|
|
34568
|
+
from { transform: translateX(-100%); }
|
|
34569
|
+
to { transform: translateX(0); }
|
|
34570
|
+
}
|
|
34571
|
+
@keyframes tl-slide-out-right {
|
|
34572
|
+
from { transform: translateX(0); }
|
|
34573
|
+
to { transform: translateX(100%); }
|
|
34574
|
+
}
|
|
34575
|
+
|
|
34576
|
+
/* slide-left */
|
|
34577
|
+
.layer.current.slide-left {
|
|
34578
|
+
transform: translateX(100%);
|
|
34579
|
+
animation: tl-slide-in-right var(--transitory-label-easing) forwards;
|
|
34580
|
+
}
|
|
34581
|
+
.layer.outgoing.slide-left {
|
|
34582
|
+
animation: tl-slide-out-left var(--transitory-label-easing) forwards;
|
|
34583
|
+
}
|
|
34584
|
+
|
|
34585
|
+
@keyframes tl-slide-in-right {
|
|
34586
|
+
from { transform: translateX(100%); }
|
|
34587
|
+
to { transform: translateX(0); }
|
|
34588
|
+
}
|
|
34589
|
+
@keyframes tl-slide-out-left {
|
|
34590
|
+
from { transform: translateX(0); }
|
|
34591
|
+
to { transform: translateX(-100%); }
|
|
34592
|
+
}
|
|
34593
|
+
|
|
34594
|
+
/* slide-up */
|
|
34595
|
+
.layer.current.slide-up {
|
|
34596
|
+
transform: translateY(100%);
|
|
34597
|
+
animation: tl-slide-in-bottom var(--transitory-label-easing) forwards;
|
|
34598
|
+
}
|
|
34599
|
+
.layer.outgoing.slide-up {
|
|
34600
|
+
animation: tl-slide-out-top var(--transitory-label-easing) forwards;
|
|
34601
|
+
}
|
|
34602
|
+
|
|
34603
|
+
@keyframes tl-slide-in-bottom {
|
|
34604
|
+
from { transform: translateY(100%); }
|
|
34605
|
+
to { transform: translateY(0); }
|
|
34606
|
+
}
|
|
34607
|
+
@keyframes tl-slide-out-top {
|
|
34608
|
+
from { transform: translateY(0); }
|
|
34609
|
+
to { transform: translateY(-100%); }
|
|
34610
|
+
}
|
|
34611
|
+
|
|
34612
|
+
/* slide-down */
|
|
34613
|
+
.layer.current.slide-down {
|
|
34614
|
+
transform: translateY(-100%);
|
|
34615
|
+
animation: tl-slide-in-top var(--transitory-label-easing) forwards;
|
|
34616
|
+
}
|
|
34617
|
+
.layer.outgoing.slide-down {
|
|
34618
|
+
animation: tl-slide-out-bottom var(--transitory-label-easing) forwards;
|
|
34619
|
+
}
|
|
34620
|
+
|
|
34621
|
+
@keyframes tl-slide-in-top {
|
|
34622
|
+
from { transform: translateY(-100%); }
|
|
34623
|
+
to { transform: translateY(0); }
|
|
34624
|
+
}
|
|
34625
|
+
@keyframes tl-slide-out-bottom {
|
|
34626
|
+
from { transform: translateY(0); }
|
|
34627
|
+
to { transform: translateY(100%); }
|
|
34628
|
+
}
|
|
34629
|
+
|
|
34630
|
+
/* fade */
|
|
34631
|
+
.layer.current.fade {
|
|
34632
|
+
opacity: 0;
|
|
34633
|
+
animation: tl-fade-in var(--transitory-label-easing) forwards;
|
|
34634
|
+
}
|
|
34635
|
+
.layer.outgoing.fade {
|
|
34636
|
+
animation: tl-fade-out var(--transitory-label-easing) forwards;
|
|
34637
|
+
}
|
|
34638
|
+
|
|
34639
|
+
@keyframes tl-fade-in {
|
|
34640
|
+
from { opacity: 0; }
|
|
34641
|
+
to { opacity: 1; }
|
|
34642
|
+
}
|
|
34643
|
+
@keyframes tl-fade-out {
|
|
34644
|
+
from { opacity: 1; }
|
|
34645
|
+
to { opacity: 0; }
|
|
34646
|
+
}
|
|
34647
|
+
|
|
34648
|
+
/* character-swap */
|
|
34649
|
+
.char {
|
|
34650
|
+
display: inline-block;
|
|
34651
|
+
}
|
|
34652
|
+
|
|
34653
|
+
.char.in {
|
|
34654
|
+
opacity: 0;
|
|
34655
|
+
animation: tl-char-in var(--transitory-label-easing) forwards;
|
|
34656
|
+
}
|
|
34657
|
+
|
|
34658
|
+
.char.out {
|
|
34659
|
+
animation: tl-char-out var(--transitory-label-easing) forwards;
|
|
34660
|
+
}
|
|
34661
|
+
|
|
34662
|
+
@keyframes tl-char-in {
|
|
34663
|
+
from { opacity: 0; transform: translateY(-0.3em) scale(0.8); }
|
|
34664
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
34665
|
+
}
|
|
34666
|
+
@keyframes tl-char-out {
|
|
34667
|
+
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
34668
|
+
to { opacity: 0; transform: translateY(0.3em) scale(0.8); }
|
|
34669
|
+
}
|
|
34670
|
+
`;
|
|
33745
34671
|
}
|
|
33746
34672
|
};
|
|
34673
|
+
__decorate([n$2({ type: String })], TransitoryLabelElement.prototype, "text", void 0);
|
|
34674
|
+
__decorate([n$2({ type: String })], TransitoryLabelElement.prototype, "effect", void 0);
|
|
34675
|
+
__decorate([n$2({ type: Number })], TransitoryLabelElement.prototype, "duration", void 0);
|
|
34676
|
+
__decorate([n$2({ type: String })], TransitoryLabelElement.prototype, "easing", void 0);
|
|
34677
|
+
__decorate([r$1()], TransitoryLabelElement.prototype, "_currentText", void 0);
|
|
34678
|
+
__decorate([r$1()], TransitoryLabelElement.prototype, "_outgoingText", void 0);
|
|
34679
|
+
__decorate([r$1()], TransitoryLabelElement.prototype, "_activeEffect", void 0);
|
|
34680
|
+
__decorate([r$1()], TransitoryLabelElement.prototype, "_transitionId", void 0);
|
|
34681
|
+
TransitoryLabelElement = __decorate([safeCustomElement(`ixfx-transitory-label`)], TransitoryLabelElement);
|
|
33747
34682
|
//#endregion
|
|
33748
34683
|
//#region src/tree/tree-base.ts
|
|
33749
|
-
let TreeBaseElement = class TreeBaseElement extends i$
|
|
34684
|
+
let TreeBaseElement = class TreeBaseElement extends i$4 {
|
|
33750
34685
|
constructor(..._args) {
|
|
33751
34686
|
super(..._args);
|
|
33752
34687
|
this.exclusivity = `none`;
|
|
@@ -33855,7 +34790,7 @@ let TreeBaseElement = class TreeBaseElement extends i$3 {
|
|
|
33855
34790
|
event.preventDefault();
|
|
33856
34791
|
const current = nodes[currentIdx];
|
|
33857
34792
|
if (!current) break;
|
|
33858
|
-
if (this.interactionMode === `checked`) this._handleCheckboxClick(new MouseEvent(
|
|
34793
|
+
if (this.interactionMode === `checked`) this._handleCheckboxClick(new MouseEvent(`click`), current.node, current.depth);
|
|
33859
34794
|
else if (this.interactionMode === `standard` || this.interactionMode === `vscode` || this.interactionMode === `manual`) this.#toggleSelection(current.node, current.depth);
|
|
33860
34795
|
break;
|
|
33861
34796
|
}
|
|
@@ -34511,7 +35446,7 @@ let TreeBaseElement = class TreeBaseElement extends i$3 {
|
|
|
34511
35446
|
this.styles = [
|
|
34512
35447
|
tickledStyles,
|
|
34513
35448
|
tickledItemStyles,
|
|
34514
|
-
i$
|
|
35449
|
+
i$7`
|
|
34515
35450
|
:host {
|
|
34516
35451
|
--tree-bg: var(--surface-3);
|
|
34517
35452
|
--tree-text: var(--surface-3-text);
|
|
@@ -34639,7 +35574,7 @@ __decorate([n$2({
|
|
|
34639
35574
|
})], TreeBaseElement.prototype, "disableKeyboardNavigation", void 0);
|
|
34640
35575
|
__decorate([r$1()], TreeBaseElement.prototype, "_expandedKeys", void 0);
|
|
34641
35576
|
__decorate([r$1()], TreeBaseElement.prototype, "_focusedDepth", void 0);
|
|
34642
|
-
TreeBaseElement = __decorate([
|
|
35577
|
+
TreeBaseElement = __decorate([safeCustomElement(`ixfx-tree-base`)], TreeBaseElement);
|
|
34643
35578
|
//#endregion
|
|
34644
35579
|
//#region src/tree/tree-controller.ts
|
|
34645
35580
|
var TreeController = class {
|
|
@@ -34808,7 +35743,7 @@ let TreeListElement = class TreeListElement extends TreeBaseElement {
|
|
|
34808
35743
|
`;
|
|
34809
35744
|
}
|
|
34810
35745
|
static {
|
|
34811
|
-
this.styles = [...TreeBaseElement.styles, i$
|
|
35746
|
+
this.styles = [...TreeBaseElement.styles, i$7`
|
|
34812
35747
|
.tree-caret {
|
|
34813
35748
|
display: inline-flex;
|
|
34814
35749
|
align-items: center;
|
|
@@ -34878,7 +35813,7 @@ let TreeListElement = class TreeListElement extends TreeBaseElement {
|
|
|
34878
35813
|
`];
|
|
34879
35814
|
}
|
|
34880
35815
|
};
|
|
34881
|
-
TreeListElement = __decorate([
|
|
35816
|
+
TreeListElement = __decorate([safeCustomElement(`ixfx-tree-list`)], TreeListElement);
|
|
34882
35817
|
//#endregion
|
|
34883
35818
|
//#region src/util/checkbox.ts
|
|
34884
35819
|
function isCheckboxLike(el) {
|
|
@@ -34932,12 +35867,12 @@ function monitorIndeterminate(targetElOrQuery, watchedElsOrQueries) {
|
|
|
34932
35867
|
};
|
|
34933
35868
|
}
|
|
34934
35869
|
//#endregion
|
|
34935
|
-
//#region node_modules/.pnpm/lit-html@3.3.
|
|
35870
|
+
//#region node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/class-map.js
|
|
34936
35871
|
/**
|
|
34937
35872
|
* @license
|
|
34938
35873
|
* Copyright 2018 Google LLC
|
|
34939
35874
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34940
|
-
*/ const e = e$3(class extends i$
|
|
35875
|
+
*/ const e = e$3(class extends i$3 {
|
|
34941
35876
|
constructor(t) {
|
|
34942
35877
|
if (super(t), t.type !== t$2.ATTRIBUTE || "class" !== t.name || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
34943
35878
|
}
|
|
@@ -34970,7 +35905,7 @@ function isNumeric(str) {
|
|
|
34970
35905
|
//#endregion
|
|
34971
35906
|
//#region src/util/tooltip.ts
|
|
34972
35907
|
var _TooltipElement;
|
|
34973
|
-
let TooltipElement = class TooltipElement extends i$
|
|
35908
|
+
let TooltipElement = class TooltipElement extends i$4 {
|
|
34974
35909
|
static {
|
|
34975
35910
|
_TooltipElement = this;
|
|
34976
35911
|
}
|
|
@@ -34994,7 +35929,7 @@ let TooltipElement = class TooltipElement extends i$3 {
|
|
|
34994
35929
|
}
|
|
34995
35930
|
#renderIcon() {
|
|
34996
35931
|
if (!this.icon) return A;
|
|
34997
|
-
if (this.icon.startsWith(`<svg`)) return b`<span class="tooltip-icon" style="display:inline-flex;align-items:center;margin-right:0.25em">${o(this.icon)}</span>`;
|
|
35932
|
+
if (this.icon.startsWith(`<svg`)) return b`<span class="tooltip-icon" style="display:inline-flex;align-items:center;margin-right:0.25em">${o$1(this.icon)}</span>`;
|
|
34998
35933
|
if (!getIcon(this.icon)) return A;
|
|
34999
35934
|
return b`<ixfx-icon class="tooltip-icon" style="margin-right:0.25em" name="${this.icon}"></ixfx-icon>`;
|
|
35000
35935
|
}
|
|
@@ -35033,7 +35968,576 @@ __decorate([n$2({ type: String })], TooltipElement.prototype, "orientation", voi
|
|
|
35033
35968
|
__decorate([n$2({ type: String })], TooltipElement.prototype, "anchor", void 0);
|
|
35034
35969
|
__decorate([n$2()], TooltipElement.prototype, "value", void 0);
|
|
35035
35970
|
__decorate([n$2({ type: String })], TooltipElement.prototype, "icon", void 0);
|
|
35036
|
-
TooltipElement = _TooltipElement = __decorate([
|
|
35971
|
+
TooltipElement = _TooltipElement = __decorate([safeCustomElement(`ixfx-tooltip`)], TooltipElement);
|
|
35972
|
+
//#endregion
|
|
35973
|
+
//#region src/vertical-list/vertical-list.ts
|
|
35974
|
+
const ITEM_SELECTOR = `li, [data-list-item]`;
|
|
35975
|
+
function isMultiMode(mode) {
|
|
35976
|
+
return mode === `checked` || mode === `vscode` || mode === `standard`;
|
|
35977
|
+
}
|
|
35978
|
+
let VerticalListElement = class VerticalListElement extends i$4 {
|
|
35979
|
+
constructor(..._args) {
|
|
35980
|
+
super(..._args);
|
|
35981
|
+
this.selectionMode = `single`;
|
|
35982
|
+
this.interactionMode = `standard`;
|
|
35983
|
+
this._selectedItems = /* @__PURE__ */ new Set();
|
|
35984
|
+
this._searchVisible = false;
|
|
35985
|
+
this._searchQuery = ``;
|
|
35986
|
+
this.tickled = new TickledController(this, {
|
|
35987
|
+
getItems: () => this._getVisibleItems().map((el) => ({
|
|
35988
|
+
id: el,
|
|
35989
|
+
enabled: true
|
|
35990
|
+
})),
|
|
35991
|
+
onTickle: (id) => {
|
|
35992
|
+
if (id !== void 0) this._dispatch(`list-tickle`, { item: id });
|
|
35993
|
+
},
|
|
35994
|
+
onStateChange: () => this._syncItemStates()
|
|
35995
|
+
});
|
|
35996
|
+
this._onPointerOver = (e) => {
|
|
35997
|
+
const item = this._findListItem(e.composedPath());
|
|
35998
|
+
if (item) this.tickled.handlePointerEnter(item);
|
|
35999
|
+
};
|
|
36000
|
+
this._onPointerLeave = (e) => {
|
|
36001
|
+
this.tickled.handlePointerLeave(e);
|
|
36002
|
+
};
|
|
36003
|
+
this._onKeyDown = (e) => {
|
|
36004
|
+
if ((e.ctrlKey || e.metaKey) && e.key === `f`) {
|
|
36005
|
+
e.preventDefault();
|
|
36006
|
+
this._openSearch();
|
|
36007
|
+
return;
|
|
36008
|
+
}
|
|
36009
|
+
if ((e.ctrlKey || e.metaKey) && e.key === `a`) {
|
|
36010
|
+
if ((this.selectionMode === `multiple` || isMultiMode(this.interactionMode)) && this.selectionMode !== `none`) {
|
|
36011
|
+
e.preventDefault();
|
|
36012
|
+
this._selectAll();
|
|
36013
|
+
}
|
|
36014
|
+
return;
|
|
36015
|
+
}
|
|
36016
|
+
if (this._searchVisible) return;
|
|
36017
|
+
switch (e.key) {
|
|
36018
|
+
case `ArrowDown`:
|
|
36019
|
+
e.preventDefault();
|
|
36020
|
+
this.tickled.handleKeyboardNavigation(`next`);
|
|
36021
|
+
if (e.shiftKey && this.interactionMode === `vscode`) {
|
|
36022
|
+
const cur = this.tickled.tickledId;
|
|
36023
|
+
if (cur) this._rangeSelectTo(cur);
|
|
36024
|
+
}
|
|
36025
|
+
break;
|
|
36026
|
+
case `ArrowUp`:
|
|
36027
|
+
e.preventDefault();
|
|
36028
|
+
this.tickled.handleKeyboardNavigation(`previous`);
|
|
36029
|
+
if (e.shiftKey && this.interactionMode === `vscode`) {
|
|
36030
|
+
const cur = this.tickled.tickledId;
|
|
36031
|
+
if (cur) this._rangeSelectTo(cur);
|
|
36032
|
+
}
|
|
36033
|
+
break;
|
|
36034
|
+
case `Enter`: {
|
|
36035
|
+
const id = this.tickled.tickledId;
|
|
36036
|
+
if (id) {
|
|
36037
|
+
e.preventDefault();
|
|
36038
|
+
this._dispatch(`list-item-click`, { item: id });
|
|
36039
|
+
this._activateItem(id);
|
|
36040
|
+
}
|
|
36041
|
+
break;
|
|
36042
|
+
}
|
|
36043
|
+
case ` `: {
|
|
36044
|
+
const id = this.tickled.tickledId;
|
|
36045
|
+
if (id) {
|
|
36046
|
+
e.preventDefault();
|
|
36047
|
+
this._handleSpaceKey(id);
|
|
36048
|
+
}
|
|
36049
|
+
break;
|
|
36050
|
+
}
|
|
36051
|
+
case `Escape`:
|
|
36052
|
+
this._clearSelection();
|
|
36053
|
+
break;
|
|
36054
|
+
}
|
|
36055
|
+
};
|
|
36056
|
+
this._onClick = (e) => {
|
|
36057
|
+
const item = this._findListItem(e.composedPath());
|
|
36058
|
+
if (!item) return;
|
|
36059
|
+
this._dispatch(`list-item-click`, { item });
|
|
36060
|
+
this._handleClickSelection(item, e);
|
|
36061
|
+
};
|
|
36062
|
+
this._onDblClick = (e) => {
|
|
36063
|
+
const item = this._findListItem(e.composedPath());
|
|
36064
|
+
if (item) this._activateItem(item);
|
|
36065
|
+
};
|
|
36066
|
+
this._onSearchInput = (e) => {
|
|
36067
|
+
const input = e.target;
|
|
36068
|
+
this._searchQuery = input.value;
|
|
36069
|
+
this.#search?.setQuery(this._searchQuery);
|
|
36070
|
+
};
|
|
36071
|
+
this._onSearchKeydown = (e) => {
|
|
36072
|
+
if (e.key === `Escape`) {
|
|
36073
|
+
e.stopPropagation();
|
|
36074
|
+
this._closeSearch();
|
|
36075
|
+
} else if (e.key === `ArrowDown`) {
|
|
36076
|
+
e.preventDefault();
|
|
36077
|
+
this.tickled.handleKeyboardNavigation(`next`);
|
|
36078
|
+
} else if (e.key === `ArrowUp`) {
|
|
36079
|
+
e.preventDefault();
|
|
36080
|
+
this.tickled.handleKeyboardNavigation(`previous`);
|
|
36081
|
+
} else if (e.key === `Enter`) {
|
|
36082
|
+
e.preventDefault();
|
|
36083
|
+
e.stopPropagation();
|
|
36084
|
+
const id = this.tickled.tickledId ?? this._getVisibleItems()[0];
|
|
36085
|
+
if (id) {
|
|
36086
|
+
this._dispatch(`list-item-click`, { item: id });
|
|
36087
|
+
this._activateItem(id);
|
|
36088
|
+
this._closeSearch();
|
|
36089
|
+
}
|
|
36090
|
+
}
|
|
36091
|
+
};
|
|
36092
|
+
}
|
|
36093
|
+
#search;
|
|
36094
|
+
#selectionAnchor;
|
|
36095
|
+
connectedCallback() {
|
|
36096
|
+
super.connectedCallback();
|
|
36097
|
+
if (!this.hasAttribute(`tabindex`)) this.tabIndex = 0;
|
|
36098
|
+
this.addEventListener(`pointerover`, this._onPointerOver);
|
|
36099
|
+
this.addEventListener(`pointerleave`, this._onPointerLeave);
|
|
36100
|
+
this.addEventListener(`keydown`, this._onKeyDown);
|
|
36101
|
+
this.addEventListener(`click`, this._onClick);
|
|
36102
|
+
this.addEventListener(`dblclick`, this._onDblClick);
|
|
36103
|
+
}
|
|
36104
|
+
disconnectedCallback() {
|
|
36105
|
+
super.disconnectedCallback();
|
|
36106
|
+
this.removeEventListener(`pointerover`, this._onPointerOver);
|
|
36107
|
+
this.removeEventListener(`pointerleave`, this._onPointerLeave);
|
|
36108
|
+
this.removeEventListener(`keydown`, this._onKeyDown);
|
|
36109
|
+
this.removeEventListener(`click`, this._onClick);
|
|
36110
|
+
this.removeEventListener(`dblclick`, this._onDblClick);
|
|
36111
|
+
this.#search?.dispose();
|
|
36112
|
+
this.#search = void 0;
|
|
36113
|
+
}
|
|
36114
|
+
firstUpdated() {
|
|
36115
|
+
this.#search = createElementIncrSearch({
|
|
36116
|
+
container: this,
|
|
36117
|
+
itemSelector: ITEM_SELECTOR,
|
|
36118
|
+
getLabel: (el) => el.getAttribute(`data-search-label`) ?? el.textContent?.trim() ?? ``,
|
|
36119
|
+
getKey: (el) => el.getAttribute(`data-key`) ?? el.getAttribute(`data-search-label`) ?? el.textContent?.trim() ?? ``,
|
|
36120
|
+
highlightKey: `vertical-list-search`
|
|
36121
|
+
});
|
|
36122
|
+
}
|
|
36123
|
+
updated(changed) {
|
|
36124
|
+
super.updated(changed);
|
|
36125
|
+
if (changed.has(`interactionMode`)) {
|
|
36126
|
+
this.#selectionAnchor = void 0;
|
|
36127
|
+
this._clearSelection();
|
|
36128
|
+
}
|
|
36129
|
+
}
|
|
36130
|
+
/** The most recently selected item, or `undefined` if nothing is selected. */
|
|
36131
|
+
get selectedItem() {
|
|
36132
|
+
return [...this._selectedItems].at(-1);
|
|
36133
|
+
}
|
|
36134
|
+
/** The full current selection set (read-only). */
|
|
36135
|
+
get selectedItems() {
|
|
36136
|
+
return this._selectedItems;
|
|
36137
|
+
}
|
|
36138
|
+
addItem(item) {
|
|
36139
|
+
if (typeof item === `string`) {
|
|
36140
|
+
const li = document.createElement(`li`);
|
|
36141
|
+
li.textContent = item;
|
|
36142
|
+
this.appendChild(li);
|
|
36143
|
+
} else this.appendChild(item);
|
|
36144
|
+
if (this.interactionMode === `checked`) this._syncCheckboxes();
|
|
36145
|
+
}
|
|
36146
|
+
removeItem(item) {
|
|
36147
|
+
item.remove();
|
|
36148
|
+
}
|
|
36149
|
+
clearItems() {
|
|
36150
|
+
this.replaceChildren();
|
|
36151
|
+
this.#selectionAnchor = void 0;
|
|
36152
|
+
this._selectedItems = /* @__PURE__ */ new Set();
|
|
36153
|
+
this._syncItemStates();
|
|
36154
|
+
}
|
|
36155
|
+
select(item) {
|
|
36156
|
+
this._replaceSelection(item);
|
|
36157
|
+
}
|
|
36158
|
+
selectMany(items) {
|
|
36159
|
+
if (this.selectionMode !== `multiple`) throw new Error(`selectMany requires selectionMode="multiple" (current: "${this.selectionMode}")`);
|
|
36160
|
+
const previous = this._selectedItems;
|
|
36161
|
+
const next = new Set(items);
|
|
36162
|
+
if (next.size === 0) return;
|
|
36163
|
+
this._selectedItems = next;
|
|
36164
|
+
this.#selectionAnchor = [...next].at(-1);
|
|
36165
|
+
this._syncItemStates();
|
|
36166
|
+
this._dispatch(`list-select`, {
|
|
36167
|
+
selected: next,
|
|
36168
|
+
previous
|
|
36169
|
+
});
|
|
36170
|
+
}
|
|
36171
|
+
deselect(item) {
|
|
36172
|
+
if (!this._selectedItems.has(item)) return;
|
|
36173
|
+
const previous = this._selectedItems;
|
|
36174
|
+
const next = new Set(this._selectedItems);
|
|
36175
|
+
next.delete(item);
|
|
36176
|
+
this._selectedItems = next;
|
|
36177
|
+
this._syncItemStates();
|
|
36178
|
+
this._dispatch(`list-select`, {
|
|
36179
|
+
selected: next,
|
|
36180
|
+
previous
|
|
36181
|
+
});
|
|
36182
|
+
}
|
|
36183
|
+
clearSelection() {
|
|
36184
|
+
this._clearSelection();
|
|
36185
|
+
}
|
|
36186
|
+
selectAll() {
|
|
36187
|
+
if ((this.selectionMode === `multiple` || isMultiMode(this.interactionMode)) && this.selectionMode !== `none`) this._selectAll();
|
|
36188
|
+
}
|
|
36189
|
+
_replaceSelection(item) {
|
|
36190
|
+
if (this.selectionMode === `none`) return;
|
|
36191
|
+
const previous = this._selectedItems;
|
|
36192
|
+
const next = new Set([item]);
|
|
36193
|
+
this._selectedItems = next;
|
|
36194
|
+
this.#selectionAnchor = item;
|
|
36195
|
+
this._syncItemStates();
|
|
36196
|
+
this._dispatch(`list-select`, {
|
|
36197
|
+
selected: next,
|
|
36198
|
+
previous
|
|
36199
|
+
});
|
|
36200
|
+
}
|
|
36201
|
+
_toggleItem(item) {
|
|
36202
|
+
const effectiveMultiple = this.selectionMode === `multiple` || isMultiMode(this.interactionMode);
|
|
36203
|
+
if (this.selectionMode === `none` && this.interactionMode !== `checked`) return;
|
|
36204
|
+
const previous = this._selectedItems;
|
|
36205
|
+
const next = new Set(this._selectedItems);
|
|
36206
|
+
if (next.has(item)) next.delete(item);
|
|
36207
|
+
else {
|
|
36208
|
+
if (!effectiveMultiple) next.clear();
|
|
36209
|
+
next.add(item);
|
|
36210
|
+
}
|
|
36211
|
+
this._selectedItems = next;
|
|
36212
|
+
this._syncItemStates();
|
|
36213
|
+
this._dispatch(`list-select`, {
|
|
36214
|
+
selected: next,
|
|
36215
|
+
previous
|
|
36216
|
+
});
|
|
36217
|
+
}
|
|
36218
|
+
_rangeSelectTo(item) {
|
|
36219
|
+
if (this.selectionMode === `none`) return;
|
|
36220
|
+
if (!this.#selectionAnchor) {
|
|
36221
|
+
this._replaceSelection(item);
|
|
36222
|
+
return;
|
|
36223
|
+
}
|
|
36224
|
+
const visible = this._getVisibleItems();
|
|
36225
|
+
const anchorIdx = visible.indexOf(this.#selectionAnchor);
|
|
36226
|
+
const targetIdx = visible.indexOf(item);
|
|
36227
|
+
if (anchorIdx === -1 || targetIdx === -1) {
|
|
36228
|
+
this._replaceSelection(item);
|
|
36229
|
+
return;
|
|
36230
|
+
}
|
|
36231
|
+
const start = Math.min(anchorIdx, targetIdx);
|
|
36232
|
+
const end = Math.max(anchorIdx, targetIdx);
|
|
36233
|
+
const previous = this._selectedItems;
|
|
36234
|
+
const next = new Set(visible.slice(start, end + 1));
|
|
36235
|
+
this._selectedItems = next;
|
|
36236
|
+
this._syncItemStates();
|
|
36237
|
+
this._dispatch(`list-select`, {
|
|
36238
|
+
selected: next,
|
|
36239
|
+
previous
|
|
36240
|
+
});
|
|
36241
|
+
}
|
|
36242
|
+
_clearSelection() {
|
|
36243
|
+
if (this._selectedItems.size === 0) return;
|
|
36244
|
+
const previous = this._selectedItems;
|
|
36245
|
+
this._selectedItems = /* @__PURE__ */ new Set();
|
|
36246
|
+
this._syncItemStates();
|
|
36247
|
+
this._dispatch(`list-select`, {
|
|
36248
|
+
selected: /* @__PURE__ */ new Set(),
|
|
36249
|
+
previous
|
|
36250
|
+
});
|
|
36251
|
+
}
|
|
36252
|
+
_selectAll() {
|
|
36253
|
+
const visible = this._getVisibleItems();
|
|
36254
|
+
if (visible.length === 0) return;
|
|
36255
|
+
const previous = this._selectedItems;
|
|
36256
|
+
const next = new Set(visible);
|
|
36257
|
+
this._selectedItems = next;
|
|
36258
|
+
this._syncItemStates();
|
|
36259
|
+
this._dispatch(`list-select`, {
|
|
36260
|
+
selected: next,
|
|
36261
|
+
previous
|
|
36262
|
+
});
|
|
36263
|
+
}
|
|
36264
|
+
_handleClickSelection(item, e) {
|
|
36265
|
+
const mode = this.interactionMode;
|
|
36266
|
+
if (mode === `manual`) return;
|
|
36267
|
+
if (this.selectionMode === `none` && mode !== `checked`) return;
|
|
36268
|
+
switch (mode) {
|
|
36269
|
+
case `implicit`:
|
|
36270
|
+
this._replaceSelection(item);
|
|
36271
|
+
break;
|
|
36272
|
+
case `standard`:
|
|
36273
|
+
case `vscode`:
|
|
36274
|
+
if (e.ctrlKey || e.metaKey) {
|
|
36275
|
+
if (this.selectionMode === `multiple` || mode === `vscode`) this._toggleItem(item);
|
|
36276
|
+
} else if (e.shiftKey && (this.selectionMode === `multiple` || mode === `vscode`)) this._rangeSelectTo(item);
|
|
36277
|
+
else this._replaceSelection(item);
|
|
36278
|
+
break;
|
|
36279
|
+
case `checked`: break;
|
|
36280
|
+
}
|
|
36281
|
+
}
|
|
36282
|
+
_handleSpaceKey(item) {
|
|
36283
|
+
const mode = this.interactionMode;
|
|
36284
|
+
if (mode === `manual`) return;
|
|
36285
|
+
if (mode === `implicit`) this._replaceSelection(item);
|
|
36286
|
+
else this._toggleItem(item);
|
|
36287
|
+
}
|
|
36288
|
+
_getVisibleItems() {
|
|
36289
|
+
return Array.from(this.querySelectorAll(ITEM_SELECTOR)).filter((el) => {
|
|
36290
|
+
if (el.hidden) return false;
|
|
36291
|
+
if (this.filterPredicate && !this.filterPredicate(el)) return false;
|
|
36292
|
+
return true;
|
|
36293
|
+
});
|
|
36294
|
+
}
|
|
36295
|
+
_syncItemStates() {
|
|
36296
|
+
for (const el of this.querySelectorAll(ITEM_SELECTOR)) {
|
|
36297
|
+
el.toggleAttribute(`data-tickled`, this.tickled.isTickled(el));
|
|
36298
|
+
el.toggleAttribute(`data-selected`, this._selectedItems.has(el));
|
|
36299
|
+
if (this.interactionMode === `checked`) el.toggleAttribute(`data-checked`, this._selectedItems.has(el));
|
|
36300
|
+
else el.removeAttribute(`data-checked`);
|
|
36301
|
+
}
|
|
36302
|
+
this.dataset.inputMode = this.tickled.inputMode;
|
|
36303
|
+
this._syncCheckboxes();
|
|
36304
|
+
}
|
|
36305
|
+
_syncCheckboxes() {
|
|
36306
|
+
const inCheckedMode = this.interactionMode === `checked`;
|
|
36307
|
+
for (const el of this.querySelectorAll(`li`)) {
|
|
36308
|
+
let cb = el.querySelector(`input.ixfx-list-checkbox`);
|
|
36309
|
+
if (inCheckedMode) {
|
|
36310
|
+
if (!cb) {
|
|
36311
|
+
cb = document.createElement(`input`);
|
|
36312
|
+
cb.type = `checkbox`;
|
|
36313
|
+
cb.className = `ixfx-list-checkbox`;
|
|
36314
|
+
cb.style.cssText = `flex-shrink:0;margin:0 6px 0 0;cursor:pointer;accent-color:var(--accent,#60a5fa);pointer-events:auto`;
|
|
36315
|
+
cb.tabIndex = -1;
|
|
36316
|
+
cb.addEventListener(`click`, (e) => {
|
|
36317
|
+
e.stopPropagation();
|
|
36318
|
+
this._toggleItem(el);
|
|
36319
|
+
});
|
|
36320
|
+
el.prepend(cb);
|
|
36321
|
+
}
|
|
36322
|
+
cb.checked = this._selectedItems.has(el);
|
|
36323
|
+
} else if (cb) cb.remove();
|
|
36324
|
+
}
|
|
36325
|
+
}
|
|
36326
|
+
_findListItem(path) {
|
|
36327
|
+
for (const target of path) {
|
|
36328
|
+
if (!(target instanceof Element)) continue;
|
|
36329
|
+
if (target === this) break;
|
|
36330
|
+
if (target.parentElement === this && target.matches(ITEM_SELECTOR)) return target;
|
|
36331
|
+
}
|
|
36332
|
+
}
|
|
36333
|
+
_dispatch(name, detail) {
|
|
36334
|
+
this.dispatchEvent(new CustomEvent(name, {
|
|
36335
|
+
detail,
|
|
36336
|
+
bubbles: true,
|
|
36337
|
+
composed: true
|
|
36338
|
+
}));
|
|
36339
|
+
}
|
|
36340
|
+
_openSearch() {
|
|
36341
|
+
this._searchVisible = true;
|
|
36342
|
+
this.updateComplete.then(() => this._searchInputEl?.focus());
|
|
36343
|
+
}
|
|
36344
|
+
_closeSearch() {
|
|
36345
|
+
this._searchVisible = false;
|
|
36346
|
+
this._searchQuery = ``;
|
|
36347
|
+
this.#search?.clearQuery();
|
|
36348
|
+
this.focus();
|
|
36349
|
+
}
|
|
36350
|
+
_activateItem(item) {
|
|
36351
|
+
if (this.interactionMode !== `manual`) this._replaceSelection(item);
|
|
36352
|
+
this._dispatch(`list-activate`, { item });
|
|
36353
|
+
}
|
|
36354
|
+
static {
|
|
36355
|
+
this.styles = i$7`
|
|
36356
|
+
:host {
|
|
36357
|
+
display: block;
|
|
36358
|
+
position: relative;
|
|
36359
|
+
background: var(--list-bg, var(--surface-3));
|
|
36360
|
+
color: var(--list-text, var(--surface-3-text));
|
|
36361
|
+
border-radius: var(--list-radius, var(--radius-s));
|
|
36362
|
+
border: 1px solid var(--list-border, var(--border));
|
|
36363
|
+
width: 100%;
|
|
36364
|
+
height: 100%;
|
|
36365
|
+
overflow: hidden;
|
|
36366
|
+
box-sizing: border-box;
|
|
36367
|
+
outline: none;
|
|
36368
|
+
}
|
|
36369
|
+
|
|
36370
|
+
:host(:focus-visible) {
|
|
36371
|
+
outline: 2px solid var(--accent);
|
|
36372
|
+
outline-offset: 2px;
|
|
36373
|
+
}
|
|
36374
|
+
|
|
36375
|
+
.container {
|
|
36376
|
+
position: relative;
|
|
36377
|
+
width: 100%;
|
|
36378
|
+
height: 100%;
|
|
36379
|
+
}
|
|
36380
|
+
|
|
36381
|
+
ul {
|
|
36382
|
+
list-style: none;
|
|
36383
|
+
margin: 0;
|
|
36384
|
+
padding: 0;
|
|
36385
|
+
width: 100%;
|
|
36386
|
+
height: 100%;
|
|
36387
|
+
overflow-y: auto;
|
|
36388
|
+
box-sizing: border-box;
|
|
36389
|
+
}
|
|
36390
|
+
|
|
36391
|
+
::slotted([hidden]) {
|
|
36392
|
+
display: none !important;
|
|
36393
|
+
}
|
|
36394
|
+
|
|
36395
|
+
::slotted(li) {
|
|
36396
|
+
display: flex;
|
|
36397
|
+
align-items: center;
|
|
36398
|
+
padding: var(--list-item-padding, 4px var(--space-m, 8px));
|
|
36399
|
+
min-height: var(--list-item-height, 28px);
|
|
36400
|
+
cursor: pointer;
|
|
36401
|
+
user-select: none;
|
|
36402
|
+
transition: background var(--transition, 0.1s ease-out),
|
|
36403
|
+
outline-color var(--transition, 0.1s ease-out);
|
|
36404
|
+
box-sizing: border-box;
|
|
36405
|
+
outline: 1px solid transparent;
|
|
36406
|
+
}
|
|
36407
|
+
|
|
36408
|
+
/* Custom shadow-DOM components handle their own internal layout/padding */
|
|
36409
|
+
::slotted([data-list-item]) {
|
|
36410
|
+
display: block;
|
|
36411
|
+
cursor: pointer;
|
|
36412
|
+
user-select: none;
|
|
36413
|
+
transition: background var(--transition, 0.1s ease-out),
|
|
36414
|
+
outline-color var(--transition, 0.1s ease-out);
|
|
36415
|
+
outline: 1px solid transparent;
|
|
36416
|
+
}
|
|
36417
|
+
|
|
36418
|
+
::slotted([data-tickled]) {
|
|
36419
|
+
background: var(--item-bg-tickled, rgba(0, 0, 0, 0.06));
|
|
36420
|
+
outline: 1px solid var(--accent, #60a5fa);
|
|
36421
|
+
}
|
|
36422
|
+
|
|
36423
|
+
::slotted([data-selected]) {
|
|
36424
|
+
background: var(--item-bg-selected, rgba(25, 118, 210, 1));
|
|
36425
|
+
color: var(--item-text-selected, #fff);
|
|
36426
|
+
outline: 1px solid transparent;
|
|
36427
|
+
}
|
|
36428
|
+
|
|
36429
|
+
::slotted([data-selected][data-tickled]) {
|
|
36430
|
+
background: var(--item-bg-selected-tickled, rgba(21, 101, 192, 1));
|
|
36431
|
+
outline: 2px dashed var(--surface-3, #1e1e1e);
|
|
36432
|
+
outline-offset: -2px;
|
|
36433
|
+
}
|
|
36434
|
+
|
|
36435
|
+
/* checked mode: checkbox (injected into li) communicates selection — suppress bg highlight */
|
|
36436
|
+
:host([interaction-mode="checked"]) ::slotted([data-selected]) {
|
|
36437
|
+
background: transparent;
|
|
36438
|
+
color: inherit;
|
|
36439
|
+
outline: 1px solid transparent;
|
|
36440
|
+
}
|
|
36441
|
+
|
|
36442
|
+
:host([interaction-mode="checked"]) ::slotted([data-selected][data-tickled]) {
|
|
36443
|
+
background: var(--item-bg-tickled, rgba(0, 0, 0, 0.06));
|
|
36444
|
+
color: inherit;
|
|
36445
|
+
outline: 1px solid var(--accent, #60a5fa);
|
|
36446
|
+
}
|
|
36447
|
+
|
|
36448
|
+
/* checked mode: left-border indicator for custom shadow-DOM items (no checkbox injection possible) */
|
|
36449
|
+
:host([interaction-mode="checked"]) ::slotted([data-list-item]) {
|
|
36450
|
+
border-left: 3px solid transparent;
|
|
36451
|
+
transition: background var(--transition, 0.1s ease-out),
|
|
36452
|
+
border-color var(--transition, 0.1s ease-out);
|
|
36453
|
+
}
|
|
36454
|
+
|
|
36455
|
+
:host([interaction-mode="checked"]) ::slotted([data-list-item][data-checked]) {
|
|
36456
|
+
border-left: 3px solid var(--accent, #60a5fa);
|
|
36457
|
+
}
|
|
36458
|
+
|
|
36459
|
+
.search-overlay {
|
|
36460
|
+
position: absolute;
|
|
36461
|
+
top: 8px;
|
|
36462
|
+
right: 8px;
|
|
36463
|
+
z-index: 10;
|
|
36464
|
+
display: flex;
|
|
36465
|
+
align-items: center;
|
|
36466
|
+
gap: 4px;
|
|
36467
|
+
background: var(--surface-4, #2a2a2a);
|
|
36468
|
+
border: 1px solid var(--border, #444);
|
|
36469
|
+
border-radius: var(--radius-m, 4px);
|
|
36470
|
+
padding: 4px 6px;
|
|
36471
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
36472
|
+
}
|
|
36473
|
+
|
|
36474
|
+
.search-overlay[hidden] {
|
|
36475
|
+
display: none;
|
|
36476
|
+
}
|
|
36477
|
+
|
|
36478
|
+
.search-input {
|
|
36479
|
+
background: transparent;
|
|
36480
|
+
border: none;
|
|
36481
|
+
outline: none;
|
|
36482
|
+
color: inherit;
|
|
36483
|
+
font-size: var(--text-m, 0.875em);
|
|
36484
|
+
min-width: 140px;
|
|
36485
|
+
}
|
|
36486
|
+
|
|
36487
|
+
.search-close {
|
|
36488
|
+
background: transparent;
|
|
36489
|
+
border: none;
|
|
36490
|
+
color: var(--surface-muted-text, #888);
|
|
36491
|
+
cursor: pointer;
|
|
36492
|
+
font-size: 1.1em;
|
|
36493
|
+
line-height: 1;
|
|
36494
|
+
padding: 0 2px;
|
|
36495
|
+
}
|
|
36496
|
+
|
|
36497
|
+
.search-close:hover {
|
|
36498
|
+
color: inherit;
|
|
36499
|
+
}
|
|
36500
|
+
`;
|
|
36501
|
+
}
|
|
36502
|
+
render() {
|
|
36503
|
+
return b`
|
|
36504
|
+
<div class="container">
|
|
36505
|
+
<ul part="list">
|
|
36506
|
+
<slot></slot>
|
|
36507
|
+
</ul>
|
|
36508
|
+
<div
|
|
36509
|
+
class="search-overlay"
|
|
36510
|
+
part="search-overlay"
|
|
36511
|
+
?hidden=${!this._searchVisible}
|
|
36512
|
+
>
|
|
36513
|
+
<input
|
|
36514
|
+
type="text"
|
|
36515
|
+
class="search-input"
|
|
36516
|
+
placeholder="Search…"
|
|
36517
|
+
.value=${this._searchQuery}
|
|
36518
|
+
@input=${this._onSearchInput}
|
|
36519
|
+
@keydown=${this._onSearchKeydown}
|
|
36520
|
+
/>
|
|
36521
|
+
<button class="search-close" @click=${this._closeSearch} title="Close search (Esc)">×</button>
|
|
36522
|
+
</div>
|
|
36523
|
+
</div>
|
|
36524
|
+
`;
|
|
36525
|
+
}
|
|
36526
|
+
};
|
|
36527
|
+
__decorate([n$2({
|
|
36528
|
+
type: String,
|
|
36529
|
+
attribute: `selection-mode`
|
|
36530
|
+
})], VerticalListElement.prototype, "selectionMode", void 0);
|
|
36531
|
+
__decorate([n$2({
|
|
36532
|
+
type: String,
|
|
36533
|
+
attribute: `interaction-mode`
|
|
36534
|
+
})], VerticalListElement.prototype, "interactionMode", void 0);
|
|
36535
|
+
__decorate([n$2({ attribute: false })], VerticalListElement.prototype, "filterPredicate", void 0);
|
|
36536
|
+
__decorate([r$1()], VerticalListElement.prototype, "_selectedItems", void 0);
|
|
36537
|
+
__decorate([r$1()], VerticalListElement.prototype, "_searchVisible", void 0);
|
|
36538
|
+
__decorate([r$1()], VerticalListElement.prototype, "_searchQuery", void 0);
|
|
36539
|
+
__decorate([e$4(`.search-input`)], VerticalListElement.prototype, "_searchInputEl", void 0);
|
|
36540
|
+
VerticalListElement = __decorate([safeCustomElement(`ixfx-vertical-list`)], VerticalListElement);
|
|
35037
36541
|
//#endregion
|
|
35038
36542
|
//#region src/xy-pad.ts
|
|
35039
36543
|
/**
|
|
@@ -35089,7 +36593,7 @@ function quantise(value, min, max, stops) {
|
|
|
35089
36593
|
const step = (max - min) / stops;
|
|
35090
36594
|
return Math.round((value - min) / step) * step + min;
|
|
35091
36595
|
}
|
|
35092
|
-
let XyPad = class XyPad extends i$
|
|
36596
|
+
let XyPad = class XyPad extends i$4 {
|
|
35093
36597
|
constructor(..._args) {
|
|
35094
36598
|
super(..._args);
|
|
35095
36599
|
this.xMin = 1;
|
|
@@ -35208,7 +36712,7 @@ let XyPad = class XyPad extends i$3 {
|
|
|
35208
36712
|
};
|
|
35209
36713
|
}
|
|
35210
36714
|
static {
|
|
35211
|
-
this.styles = [prominenceStyles, i$
|
|
36715
|
+
this.styles = [prominenceStyles, i$7`
|
|
35212
36716
|
:host {
|
|
35213
36717
|
display: block;
|
|
35214
36718
|
width: 200px;
|
|
@@ -35460,13 +36964,13 @@ __decorate([n$2({
|
|
|
35460
36964
|
type: Number,
|
|
35461
36965
|
attribute: `stops-y`
|
|
35462
36966
|
})], XyPad.prototype, "stopsY", void 0);
|
|
35463
|
-
XyPad = __decorate([
|
|
36967
|
+
XyPad = __decorate([safeCustomElement(`ixfx-xy-pad`)], XyPad);
|
|
35464
36968
|
//#endregion
|
|
35465
36969
|
//#region src/index.ts
|
|
35466
36970
|
function init() {
|
|
35467
36971
|
console.log(`Init`);
|
|
35468
36972
|
}
|
|
35469
36973
|
//#endregion
|
|
35470
|
-
export { AcTextElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataDisplayComponent, EditableLabel, EditableNumber, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
|
|
36974
|
+
export { AcTextElement, AcTokenElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataDisplayComponent, EditableLabel, EditableNumber, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TransitoryLabelElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, VerticalListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
|
|
35471
36975
|
|
|
35472
36976
|
//# sourceMappingURL=index.js.map
|