@filipgutica/ui 1.14.0 → 1.15.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/dist/site.js CHANGED
@@ -1,30 +1,30 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./use-active-section-DCS_wyYq.js";
2
- import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, mergeModels as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, ref as C, renderList as w, renderSlot as T, shallowRef as E, toDisplayString as D, unref as O, useId as k, useModel as A, useSlots as j, useTemplateRef as M, watch as N, withCtx as P } from "vue";
3
- import { tryOnMounted as F, usePreferredDark as I, useStorage as L } from "@vueuse/core";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./use-active-section-DMbpGE2f.js";
2
+ import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, onUnmounted as S, openBlock as C, ref as w, renderList as T, renderSlot as E, shallowRef as D, toDisplayString as O, unref as k, useId as A, useModel as j, useSlots as M, useTemplateRef as N, watch as P, withCtx as F } from "vue";
3
+ import { tryOnMounted as I, usePreferredDark as L, useStorage as R } from "@vueuse/core";
4
4
  //#region src/site/appearance.ts
5
- var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "dark", ee = `(function () {
5
+ var z = "tool-site-theme", B = (e) => e === "system" || e === "light" || e === "dark", ee = `(function () {
6
6
  var root = document.documentElement, choice;
7
- try { choice = localStorage.getItem('${R}'); } catch (error) {}
7
+ try { choice = localStorage.getItem('${z}'); } catch (error) {}
8
8
  var dark = choice === 'dark';
9
9
  if (choice !== 'light' && choice !== 'dark') {
10
10
  try { dark = matchMedia('(prefers-color-scheme: dark)').matches; } catch (error) {}
11
11
  }
12
12
  root.classList.toggle('dark', dark);
13
13
  if (choice === 'light' || choice === 'dark') root.dataset.theme = choice;
14
- })();`, B = ({ root: e, choice: t, appearance: n }) => {
14
+ })();`, V = ({ root: e, choice: t, appearance: n }) => {
15
15
  e.classList.toggle("dark", n === "dark"), t === "system" ? delete e.dataset.theme : e.dataset.theme = t;
16
- }, V = ({ applyToRoot: e = !0 } = {}) => {
17
- let t = L(R, "system", void 0, {
16
+ }, H = ({ applyToRoot: e = !0 } = {}) => {
17
+ let t = R(z, "system", void 0, {
18
18
  initOnMounted: !0,
19
19
  writeDefaults: !1,
20
20
  onError: () => {},
21
21
  serializer: {
22
- read: (e) => z(e) ? e : "system",
22
+ read: (e) => B(e) ? e : "system",
23
23
  write: (e) => e
24
24
  }
25
- }), n = I(), r = s(() => t.value), i = s(() => t.value === "system" ? n.value ? "dark" : "light" : t.value);
26
- return e && F(() => {
27
- N([r, i], () => B({
25
+ }), n = L(), r = c(() => t.value), i = c(() => t.value === "system" ? n.value ? "dark" : "light" : t.value);
26
+ return e && I(() => {
27
+ P([r, i], () => V({
28
28
  root: document.documentElement,
29
29
  choice: r.value,
30
30
  appearance: i.value
@@ -33,10 +33,10 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
33
33
  choice: r,
34
34
  appearance: i,
35
35
  chooseAppearance: (e) => {
36
- z(e) && (t.value = e);
36
+ B(e) && (t.value = e);
37
37
  }
38
38
  };
39
- }, H = [
39
+ }, U = [
40
40
  {
41
41
  id: "annoterm",
42
42
  label: "annoterm",
@@ -76,21 +76,11 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
76
76
  ], te = { class: "fg-site-header" }, ne = { class: "fg-site-header__inner" }, re = ["aria-label"], ie = {
77
77
  class: "fg-site-projects__menu fg-site-nav",
78
78
  "aria-label": "Projects"
79
- }, U = ["href", "aria-current"], W = { class: "fg-site-header__end" }, G = {
79
+ }, W = ["href", "aria-current"], G = { class: "fg-site-header__end" }, K = {
80
80
  key: 0,
81
81
  class: "fg-site-header__links",
82
82
  "aria-label": "Site links"
83
- }, K = ["href"], q = {
84
- key: 0,
85
- class: "fg-site-appearance",
86
- role: "group",
87
- "aria-label": "Color theme"
88
- }, J = [
89
- "aria-label",
90
- "title",
91
- "aria-pressed",
92
- "onClick"
93
- ], Y = {
83
+ }, q = ["href"], J = {
94
84
  viewBox: "0 0 24 24",
95
85
  width: "18",
96
86
  height: "18",
@@ -98,10 +88,10 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
98
88
  stroke: "currentColor",
99
89
  "stroke-width": "1.5",
100
90
  "aria-hidden": "true"
101
- }, ae = {
91
+ }, Y = {
102
92
  key: 2,
103
93
  d: "M20.5 13.5A9 9 0 0 1 10.5 3a9 9 0 1 0 10 10.5Z"
104
- }, oe = /* @__PURE__ */ m({
94
+ }, ae = /* @__PURE__ */ h({
105
95
  __name: "UiSiteHeader",
106
96
  props: {
107
97
  project: {},
@@ -111,39 +101,39 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
111
101
  let t = [
112
102
  {
113
103
  value: "system",
114
- label: "System"
104
+ label: "System theme"
115
105
  },
116
106
  {
117
107
  value: "light",
118
- label: "Light"
108
+ label: "Light theme"
119
109
  },
120
110
  {
121
111
  value: "dark",
122
- label: "Dark"
112
+ label: "Dark theme"
123
113
  }
124
- ], n = s(() => H.find(({ id: t }) => t === e.project)?.label ?? e.project), r = j().default ? void 0 : V(), i = C(!1), a = C(), c = C(), f = () => {
125
- a.value && (a.value.open = !1);
126
- }, p = (e) => {
127
- e.key !== "Escape" || !a.value?.open || (f(), c.value?.focus());
128
- }, m = (e) => {
129
- e.relatedTarget instanceof Node && !a.value?.contains(e.relatedTarget) && f();
114
+ ], n = c(() => U.find(({ id: t }) => t === e.project)?.label ?? e.project), r = M().default ? void 0 : H(), a = w(!1), o = w(), p = w(), m = () => {
115
+ o.value && (o.value.open = !1);
130
116
  }, h = (e) => {
131
- e.target instanceof Node && !a.value?.contains(e.target) && f();
117
+ e.key !== "Escape" || !o.value?.open || (m(), p.value?.focus());
118
+ }, g = (e) => {
119
+ e.relatedTarget instanceof Node && !o.value?.contains(e.relatedTarget) && m();
120
+ }, _ = (e) => {
121
+ e.target instanceof Node && !o.value?.contains(e.target) && m();
132
122
  };
133
- return b(() => {
134
- i.value = !0, document.addEventListener("pointerdown", h);
135
- }), y(() => document.removeEventListener("pointerdown", h)), (s, f) => (S(), u("header", te, [d("div", ne, [d("details", {
123
+ return x(() => {
124
+ a.value = !0, document.addEventListener("pointerdown", _);
125
+ }), b(() => document.removeEventListener("pointerdown", _)), (c, m) => (C(), d("header", te, [f("div", ne, [f("details", {
136
126
  ref_key: "menu",
137
- ref: a,
127
+ ref: o,
138
128
  class: "fg-site-projects",
139
- onKeydown: p,
140
- onFocusout: m
141
- }, [d("summary", {
129
+ onKeydown: h,
130
+ onFocusout: g
131
+ }, [f("summary", {
142
132
  ref_key: "trigger",
143
- ref: c,
133
+ ref: p,
144
134
  class: "fg-site-projects__trigger",
145
135
  "aria-label": `Project: ${n.value}`
146
- }, [d("span", null, D(n.value), 1), f[0] ||= d("svg", {
136
+ }, [f("span", null, O(n.value), 1), m[0] ||= f("svg", {
147
137
  class: "fg-site-projects__chevron",
148
138
  viewBox: "0 0 16 16",
149
139
  width: "16",
@@ -152,38 +142,42 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
152
142
  stroke: "currentColor",
153
143
  "stroke-width": "1.5",
154
144
  "aria-hidden": "true"
155
- }, [d("path", { d: "m4 6 4 4 4-4" })], -1)], 8, re), d("nav", ie, [(S(!0), u(o, null, w(O(H), (t) => (S(), u("a", {
145
+ }, [f("path", { d: "m4 6 4 4 4-4" })], -1)], 8, re), f("nav", ie, [(C(!0), d(s, null, T(k(U), (t) => (C(), d("a", {
156
146
  key: t.id,
157
147
  href: t.href,
158
148
  "aria-current": t.id === e.project ? "page" : void 0
159
- }, D(t.label), 9, U))), 128))])], 544), d("div", W, [e.links.length > 0 ? (S(), u("nav", G, [(S(!0), u(o, null, w(e.links, (e) => (S(), u("a", {
149
+ }, O(t.label), 9, W))), 128))])], 544), f("div", G, [e.links.length > 0 ? (C(), d("nav", K, [(C(!0), d(s, null, T(e.links, (e) => (C(), d("a", {
160
150
  key: e.href,
161
151
  href: e.href
162
- }, D(e.label), 9, K))), 128))])) : l("", !0), T(s.$slots, "default", {}, () => [i.value && O(r) ? (S(), u("div", q, [(S(), u(o, null, w(t, (e) => d("button", {
163
- key: e.value,
164
- type: "button",
165
- class: "fg-site-appearance__choice",
166
- "aria-label": `${e.label} theme`,
167
- title: `${e.label} theme`,
168
- "aria-pressed": O(r).choice.value === e.value,
169
- onClick: (t) => O(r).chooseAppearance(e.value)
170
- }, [(S(), u("svg", Y, [e.value === "system" ? (S(), u(o, { key: 0 }, [f[1] ||= d("rect", {
171
- x: "3",
172
- y: "4",
173
- width: "18",
174
- height: "13",
175
- rx: "2"
176
- }, null, -1), f[2] ||= d("path", { d: "M8 21h8m-4-4v4" }, null, -1)], 64)) : e.value === "light" ? (S(), u(o, { key: 1 }, [f[3] ||= d("circle", {
177
- cx: "12",
178
- cy: "12",
179
- r: "4"
180
- }, null, -1), f[4] ||= d("path", { d: "M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5" }, null, -1)], 64)) : (S(), u("path", ae))]))], 8, J)), 64))])) : l("", !0)])])])]));
152
+ }, O(e.label), 9, q))), 128))])) : u("", !0), E(c.$slots, "default", {}, () => [a.value && k(r) ? (C(), l(i, {
153
+ key: 0,
154
+ class: "fg-site-appearance",
155
+ label: "Color theme",
156
+ size: "lg",
157
+ "icon-only": "",
158
+ items: t,
159
+ "model-value": k(r).choice.value,
160
+ "onUpdate:modelValue": k(r).chooseAppearance
161
+ }, {
162
+ icon: F(({ item: e }) => [(C(), d("svg", J, [e.value === "system" ? (C(), d(s, { key: 0 }, [m[1] ||= f("rect", {
163
+ x: "3",
164
+ y: "4",
165
+ width: "18",
166
+ height: "13",
167
+ rx: "2"
168
+ }, null, -1), m[2] ||= f("path", { d: "M8 21h8m-4-4v4" }, null, -1)], 64)) : e.value === "light" ? (C(), d(s, { key: 1 }, [m[3] ||= f("circle", {
169
+ cx: "12",
170
+ cy: "12",
171
+ r: "4"
172
+ }, null, -1), m[4] ||= f("path", { d: "M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5" }, null, -1)], 64)) : (C(), d("path", Y))]))]),
173
+ _: 1
174
+ }, 8, ["model-value", "onUpdate:modelValue"])) : u("", !0)])])])]));
181
175
  }
182
- }), se = ["id"], ce = ["role", "aria-labelledby"], le = ["id"], ue = [
176
+ }), oe = ["id"], se = ["role", "aria-labelledby"], ce = ["id"], le = [
183
177
  "href",
184
178
  "aria-current",
185
179
  "onClick"
186
- ], de = { key: 0 }, X = /* @__PURE__ */ m({
180
+ ], ue = { key: 0 }, X = /* @__PURE__ */ h({
187
181
  __name: "SiteNavLinks",
188
182
  props: {
189
183
  contentId: {},
@@ -194,95 +188,95 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
194
188
  emits: ["navigate"],
195
189
  setup(e, { emit: t }) {
196
190
  let n = t, r = `${e.contentId}-label`, i = (t) => `${e.contentId}-group-${t}`, a = (t) => t.current ? "page" : e.activeId !== void 0 && t.href === `#${e.activeId}` ? "location" : void 0;
197
- return (t, s) => (S(), u("div", {
191
+ return (t, o) => (C(), d("div", {
198
192
  id: e.contentId,
199
193
  class: "fg-site-rail__content"
200
- }, [d("nav", {
194
+ }, [f("nav", {
201
195
  class: "fg-site-rail__nav fg-site-nav",
202
196
  "aria-labelledby": r
203
- }, [d("h2", {
197
+ }, [f("h2", {
204
198
  id: r,
205
199
  class: "fg-site-rail__label"
206
- }, D(e.label), 1), (S(!0), u(o, null, w(e.groups, (e, t) => (S(), u("div", {
200
+ }, O(e.label), 1), (C(!0), d(s, null, T(e.groups, (e, t) => (C(), d("div", {
207
201
  key: e.label ?? t,
208
202
  class: "fg-site-rail__group",
209
203
  role: e.label ? "group" : void 0,
210
204
  "aria-labelledby": e.label ? i(t) : void 0
211
- }, [e.label ? (S(), u("span", {
205
+ }, [e.label ? (C(), d("span", {
212
206
  key: 0,
213
207
  id: i(t),
214
208
  class: "fg-site-rail__group-label"
215
- }, D(e.label), 9, le)) : l("", !0), (S(!0), u(o, null, w(e.items, (e) => (S(), u("a", {
209
+ }, O(e.label), 9, ce)) : u("", !0), (C(!0), d(s, null, T(e.items, (e) => (C(), d("a", {
216
210
  key: e.href,
217
211
  href: e.href,
218
212
  "aria-current": a(e),
219
213
  onClick: (t) => n("navigate", e.href, t)
220
- }, [e.code ? (S(), u("code", de, D(e.label), 1)) : (S(), u(o, { key: 1 }, [f(D(e.label), 1)], 64))], 8, ue))), 128))], 8, ce))), 128))])], 8, se));
214
+ }, [e.code ? (C(), d("code", ue, O(e.label), 1)) : (C(), d(s, { key: 1 }, [p(O(e.label), 1)], 64))], 8, le))), 128))], 8, se))), 128))])], 8, oe));
221
215
  }
222
- }), fe = ["data-enhanced"], pe = ["open"], me = ["aria-controls"], he = "(max-width: 800px)", ge = /* @__PURE__ */ m({
216
+ }), de = ["data-enhanced"], fe = ["open"], pe = ["aria-controls"], me = "(max-width: 800px)", he = /* @__PURE__ */ h({
223
217
  __name: "UiSiteNav",
224
218
  props: {
225
219
  label: {},
226
220
  groups: {}
227
221
  },
228
222
  setup(e) {
229
- let t = k(), n = C(), o = C(!1), l = C(!1), m = C(!1), h = a({ targetIds: e.groups.flatMap((e) => e.items).flatMap(({ href: e }) => e.startsWith("#") && e.length > 1 ? [e.slice(1)] : []) }), _ = s(() => e.groups.flatMap((e) => e.items).find((e) => e.current)?.label), v = s(() => e.groups.flatMap((e) => e.items).find((e) => e.href === `#${h.value}`)?.label), y = s(() => {
230
- let t = _.value ?? v.value;
223
+ let n = A(), r = w(), i = w(!1), s = w(!1), u = w(!1), h = o({ targetIds: e.groups.flatMap((e) => e.items).flatMap(({ href: e }) => e.startsWith("#") && e.length > 1 ? [e.slice(1)] : []) }), g = c(() => e.groups.flatMap((e) => e.items).find((e) => e.current)?.label), v = c(() => e.groups.flatMap((e) => e.items).find((e) => e.href === `#${h.value}`)?.label), y = c(() => {
224
+ let t = g.value ?? v.value;
231
225
  return t ? `${e.label}: ${t}` : e.label;
232
- }), w, T = null, E = () => n.value?.querySelector("button.fg-site-rail__toggle"), A = () => {
233
- g(() => n.value?.querySelector(".fg-site-nav a")?.focus({ preventScroll: !0 }));
226
+ }), b, T = null, E = () => r.value?.querySelector("button.fg-site-rail__toggle"), D = () => {
227
+ _(() => r.value?.querySelector(".fg-site-nav a")?.focus({ preventScroll: !0 }));
234
228
  }, j = () => {
235
- let e = w?.matches && !l.value && n.value?.contains(document.activeElement), t = w?.matches === !1 && l.value && !m.value && E() === document.activeElement;
236
- l.value = w?.matches === !0, l.value || (m.value = !1), e ? g(() => E()?.focus({ preventScroll: !0 })) : t && A();
229
+ let e = b?.matches && !s.value && r.value?.contains(document.activeElement), t = b?.matches === !1 && s.value && !u.value && E() === document.activeElement;
230
+ s.value = b?.matches === !0, s.value || (u.value = !1), e ? _(() => E()?.focus({ preventScroll: !0 })) : t && D();
237
231
  }, M = (e, t) => {
238
- !m.value || t.button !== 0 || t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || (T = e.startsWith("#") ? document.getElementById(e.slice(1)) : null, m.value = !1);
232
+ !u.value || t.button !== 0 || t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || (T = e.startsWith("#") ? document.getElementById(e.slice(1)) : null, u.value = !1);
239
233
  }, N = (e) => {
240
- T ? (e.preventDefault(), T.tabIndex = -1, T.focus({ preventScroll: !0 }), T = null) : l.value || (e.preventDefault(), A());
234
+ T ? (e.preventDefault(), T.tabIndex = -1, T.focus({ preventScroll: !0 }), T = null) : s.value || (e.preventDefault(), D());
241
235
  };
242
- return b(() => {
243
- w = matchMedia(he), j(), o.value = !0, w.addEventListener("change", j);
244
- }), x(() => w?.removeEventListener("change", j)), (a, s) => (S(), u("div", {
236
+ return x(() => {
237
+ b = matchMedia(me), j(), i.value = !0, b.addEventListener("change", j);
238
+ }), S(() => b?.removeEventListener("change", j)), (o, c) => (C(), d("div", {
245
239
  ref_key: "root",
246
- ref: n,
240
+ ref: r,
247
241
  class: "fg-site-rail",
248
- "data-enhanced": o.value
249
- }, [!o.value || !l.value ? (S(), u("details", {
242
+ "data-enhanced": i.value
243
+ }, [!i.value || !s.value ? (C(), d("details", {
250
244
  key: 0,
251
245
  class: "fg-site-rail__menu",
252
- open: o.value && !l.value
253
- }, [d("summary", {
246
+ open: i.value && !s.value
247
+ }, [f("summary", {
254
248
  class: "fg-site-rail__summary",
255
- "aria-controls": O(t)
256
- }, D(y.value), 9, me), p(X, {
257
- "content-id": O(t),
249
+ "aria-controls": k(n)
250
+ }, O(y.value), 9, pe), m(X, {
251
+ "content-id": k(n),
258
252
  label: e.label,
259
253
  groups: e.groups,
260
- "active-id": O(h)
254
+ "active-id": k(h)
261
255
  }, null, 8, [
262
256
  "content-id",
263
257
  "label",
264
258
  "groups",
265
259
  "active-id"
266
- ])], 8, pe)) : (S(), c(i, {
260
+ ])], 8, fe)) : (C(), l(t, {
267
261
  key: 1,
268
- open: m.value,
269
- "onUpdate:open": s[0] ||= (e) => m.value = e,
262
+ open: u.value,
263
+ "onUpdate:open": c[0] ||= (e) => u.value = e,
270
264
  title: e.label,
271
265
  onCloseAutoFocus: N
272
266
  }, {
273
- trigger: P(() => [p(r, {
267
+ trigger: F(() => [m(a, {
274
268
  variant: "ghost",
275
269
  size: "lg",
276
270
  class: "fg-site-rail__toggle"
277
271
  }, {
278
- default: P(() => [f(D(y.value), 1)]),
272
+ default: F(() => [p(O(y.value), 1)]),
279
273
  _: 1
280
274
  })]),
281
- default: P(() => [p(X, {
282
- "content-id": O(t),
275
+ default: F(() => [m(X, {
276
+ "content-id": k(n),
283
277
  label: e.label,
284
278
  groups: e.groups,
285
- "active-id": O(h),
279
+ "active-id": k(h),
286
280
  onNavigate: M
287
281
  }, null, 8, [
288
282
  "content-id",
@@ -291,14 +285,14 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
291
285
  "active-id"
292
286
  ])]),
293
287
  _: 1
294
- }, 8, ["open", "title"]))], 8, fe));
288
+ }, 8, ["open", "title"]))], 8, de));
295
289
  }
296
- }), _e = [
290
+ }), ge = [
297
291
  "aria-label",
298
292
  "tabindex",
299
293
  "data-fit",
300
294
  "innerHTML"
301
- ], Z = .7, Q = /* @__PURE__ */ m({
295
+ ], Z = .7, Q = /* @__PURE__ */ h({
302
296
  __name: "CaptureScreen",
303
297
  props: {
304
298
  html: {},
@@ -306,7 +300,7 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
306
300
  fit: { type: Boolean }
307
301
  },
308
302
  setup(e) {
309
- let t = C(), n = C(1), r = C(), i = s(() => r.value !== void 0), a, o = () => {
303
+ let t = w(), n = w(1), r = w(), i = c(() => r.value !== void 0), a, o = () => {
310
304
  if (!e.fit) {
311
305
  r.value = void 0, n.value = 1;
312
306
  return;
@@ -316,9 +310,9 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
316
310
  let o = Math.min(1, i.clientWidth / a.offsetWidth);
317
311
  o >= Z && (i.scrollLeft = 0), n.value = o >= Z ? o : 1, r.value = o >= Z ? Math.ceil(a.offsetHeight * n.value) + i.offsetHeight - i.clientHeight : void 0;
318
312
  };
319
- return N(() => [e.fit, e.html], o, { flush: "post" }), b(() => {
313
+ return P(() => [e.fit, e.html], o, { flush: "post" }), x(() => {
320
314
  typeof ResizeObserver < "u" && (a = new ResizeObserver(o), t.value && a.observe(t.value)), o();
321
- }), x(() => a?.disconnect()), (a, o) => (S(), u("div", {
315
+ }), S(() => a?.disconnect()), (a, o) => (C(), d("div", {
322
316
  ref_key: "container",
323
317
  ref: t,
324
318
  class: "fg-capture__screen",
@@ -326,19 +320,19 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
326
320
  "aria-label": e.label,
327
321
  tabindex: i.value ? void 0 : 0,
328
322
  "data-fit": i.value || void 0,
329
- style: v({
323
+ style: y({
330
324
  height: r.value === void 0 ? void 0 : `${r.value}px`,
331
325
  "--capture-scale": n.value
332
326
  }),
333
327
  innerHTML: e.html
334
- }, null, 12, _e));
328
+ }, null, 12, ge));
335
329
  }
336
- }), ve = ["data-enhanced"], ye = ["aria-label"], be = ["id"], xe = { class: "fg-capture__preview" }, Se = ["title", "onClick"], Ce = {
330
+ }), _e = ["data-enhanced"], ve = ["aria-label"], ye = ["id"], be = { class: "fg-capture__preview" }, xe = ["title", "onClick"], Se = {
337
331
  key: 0,
338
332
  class: "fg-capture__caption"
339
- }, we = { key: 0 }, Te = /* @__PURE__ */ m({
333
+ }, Ce = { key: 0 }, we = /* @__PURE__ */ h({
340
334
  __name: "UiCapture",
341
- props: /*@__PURE__*/ h({
335
+ props: /*@__PURE__*/ g({
342
336
  items: {},
343
337
  label: {},
344
338
  idPrefix: { default: "frame-" }
@@ -347,14 +341,14 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
347
341
  modelModifiers: {}
348
342
  }),
349
343
  emits: ["update:modelValue"],
350
- setup(e) {
351
- let i = A(e, "modelValue"), a = C(!1), m = s(() => e.items.map(({ id: e, label: t }) => ({
344
+ setup(t) {
345
+ let r = j(t, "modelValue"), i = w(!1), o = c(() => t.items.map(({ id: e, label: t }) => ({
352
346
  value: e,
353
347
  label: t
354
- }))), h = s(() => i.value ?? e.items[0]?.id ?? ""), _ = s(() => e.items.find(({ id: e }) => e === h.value)), v = C(!1), y = E(), O = 0, k = 0, j = M("fullSizeButton"), N = (e) => {
348
+ }))), h = c(() => r.value ?? t.items[0]?.id ?? ""), g = c(() => t.items.find(({ id: e }) => e === h.value)), v = w(!1), y = D(), b = 0, k = 0, A = N("fullSizeButton"), M = (e) => {
355
349
  y.value = e, v.value = !0;
356
- }, F = (e) => {
357
- j.value?.isConnected && (e.preventDefault(), j.value.focus({ preventScroll: !0 }));
350
+ }, P = (e) => {
351
+ A.value?.isConnected && (e.preventDefault(), A.value.focus({ preventScroll: !0 }));
358
352
  }, I = () => {
359
353
  try {
360
354
  return document.getElementById(decodeURIComponent(location.hash.slice(1)));
@@ -362,121 +356,121 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
362
356
  return null;
363
357
  }
364
358
  }, L = async () => {
365
- await g(), cancelAnimationFrame(O), cancelAnimationFrame(k), O = requestAnimationFrame(() => {
359
+ await _(), cancelAnimationFrame(b), cancelAnimationFrame(k), b = requestAnimationFrame(() => {
366
360
  k = requestAnimationFrame(() => I()?.scrollIntoView({
367
361
  behavior: "instant",
368
362
  block: "start"
369
363
  }));
370
364
  });
371
365
  }, R = () => {
372
- let t = I();
373
- if (!t) return !1;
374
- let n = e.items.find(({ id: n }) => document.getElementById(`${e.idPrefix}${n}`)?.contains(t));
375
- return !n || h.value === n.id ? !1 : (i.value = n.id, !0);
366
+ let e = I();
367
+ if (!e) return !1;
368
+ let n = t.items.find(({ id: n }) => document.getElementById(`${t.idPrefix}${n}`)?.contains(e));
369
+ return !n || h.value === n.id ? !1 : (r.value = n.id, !0);
376
370
  }, z = () => {
377
371
  R() && L();
378
372
  };
379
- return b(() => {
380
- a.value = !0, R(), location.hash && L(), window.addEventListener("hashchange", z), window.addEventListener("popstate", z);
381
- }), x(() => {
382
- cancelAnimationFrame(O), cancelAnimationFrame(k), window.removeEventListener("hashchange", z), window.removeEventListener("popstate", z);
383
- }), (s, g) => (S(), u("div", {
373
+ return x(() => {
374
+ i.value = !0, R(), location.hash && L(), window.addEventListener("hashchange", z), window.addEventListener("popstate", z);
375
+ }), S(() => {
376
+ cancelAnimationFrame(b), cancelAnimationFrame(k), window.removeEventListener("hashchange", z), window.removeEventListener("popstate", z);
377
+ }), (c, _) => (C(), d("div", {
384
378
  class: "fg-capture",
385
- "data-enhanced": a.value
379
+ "data-enhanced": i.value
386
380
  }, [
387
- a.value && _.value ? (S(), u("button", {
381
+ i.value && g.value ? (C(), d("button", {
388
382
  key: 0,
389
383
  ref_key: "fullSizeButton",
390
- ref: j,
384
+ ref: A,
391
385
  type: "button",
392
386
  class: "fg-capture__full",
393
- "aria-label": `Expand ${_.value.label} capture at full size`,
387
+ "aria-label": `Expand ${g.value.label} capture at full size`,
394
388
  "aria-haspopup": "dialog",
395
- onClick: g[0] ||= (e) => N(_.value)
396
- }, [...g[4] ||= [d("svg", {
389
+ onClick: _[0] ||= (e) => M(g.value)
390
+ }, [..._[4] ||= [f("svg", {
397
391
  viewBox: "0 0 24 24",
398
392
  fill: "none",
399
393
  stroke: "currentColor",
400
394
  "stroke-width": "1.5",
401
395
  "aria-hidden": "true"
402
- }, [d("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" })], -1), d("span", { class: "fg-capture__full-label" }, "Full size", -1)]], 8, ye)) : l("", !0),
403
- p(n, {
396
+ }, [f("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" })], -1), f("span", { class: "fg-capture__full-label" }, "Full size", -1)]], 8, ve)) : u("", !0),
397
+ m(n, {
404
398
  "model-value": h.value,
405
- items: m.value,
406
- label: e.label,
407
- "onUpdate:modelValue": g[1] ||= (e) => i.value = e
399
+ items: o.value,
400
+ label: t.label,
401
+ "onUpdate:modelValue": _[1] ||= (e) => r.value = e
408
402
  }, {
409
- panel: P(({ value: t }) => [(S(!0), u(o, null, w(e.items, (n) => (S(), u(o, { key: n.id }, [n.id === t ? (S(), u("figure", {
403
+ panel: F(({ value: e }) => [(C(!0), d(s, null, T(t.items, (n) => (C(), d(s, { key: n.id }, [n.id === e ? (C(), d("figure", {
410
404
  key: 0,
411
- id: `${e.idPrefix}${n.id}`,
405
+ id: `${t.idPrefix}${n.id}`,
412
406
  class: "fg-capture__figure"
413
- }, [d("div", xe, [p(Q, {
407
+ }, [f("div", be, [m(Q, {
414
408
  html: n.html,
415
409
  label: `Terminal capture: ${n.label}`,
416
- fit: a.value
410
+ fit: i.value
417
411
  }, null, 8, [
418
412
  "html",
419
413
  "label",
420
414
  "fit"
421
- ]), a.value ? (S(), u("button", {
415
+ ]), i.value ? (C(), d("button", {
422
416
  key: 0,
423
417
  type: "button",
424
418
  class: "fg-capture__expand",
425
419
  tabindex: "-1",
426
420
  "aria-hidden": "true",
427
421
  title: `Open ${n.label} capture at full size`,
428
- onClick: (e) => N(n)
429
- }, null, 8, Se)) : l("", !0)]), n.command || s.$slots.caption ? (S(), u("figcaption", Ce, [n.command ? (S(), u("code", we, D(n.command), 1)) : l("", !0), T(s.$slots, "caption", { item: n })])) : l("", !0)], 8, be)) : l("", !0)], 64))), 128))]),
422
+ onClick: (e) => M(n)
423
+ }, null, 8, xe)) : u("", !0)]), n.command || c.$slots.caption ? (C(), d("figcaption", Se, [n.command ? (C(), d("code", Ce, O(n.command), 1)) : u("", !0), E(c.$slots, "caption", { item: n })])) : u("", !0)], 8, ye)) : u("", !0)], 64))), 128))]),
430
424
  _: 3
431
425
  }, 8, [
432
426
  "model-value",
433
427
  "items",
434
428
  "label"
435
429
  ]),
436
- p(t, {
430
+ m(e, {
437
431
  open: v.value,
438
- "onUpdate:open": g[3] ||= (e) => v.value = e,
432
+ "onUpdate:open": _[3] ||= (e) => v.value = e,
439
433
  title: `${y.value?.label ?? ""} capture`,
440
434
  description: "Scroll to read the full capture.",
441
435
  class: "fg-capture-viewer",
442
- onCloseAutoFocus: F
436
+ onCloseAutoFocus: P
443
437
  }, {
444
- footer: P(() => [p(r, {
438
+ footer: F(() => [m(a, {
445
439
  variant: "secondary",
446
440
  size: "lg",
447
- onClick: g[2] ||= (e) => v.value = !1
441
+ onClick: _[2] ||= (e) => v.value = !1
448
442
  }, {
449
- default: P(() => [...g[5] ||= [f(" Close capture ", -1)]]),
443
+ default: F(() => [..._[5] ||= [p(" Close capture ", -1)]]),
450
444
  _: 1
451
445
  })]),
452
- default: P(() => [y.value ? (S(), c(Q, {
446
+ default: F(() => [y.value ? (C(), l(Q, {
453
447
  key: 0,
454
448
  html: y.value.html,
455
449
  label: `${y.value.label} capture at full size`,
456
450
  fit: !1
457
- }, null, 8, ["html", "label"])) : l("", !0)]),
451
+ }, null, 8, ["html", "label"])) : u("", !0)]),
458
452
  _: 1
459
453
  }, 8, ["open", "title"])
460
- ], 8, ve));
454
+ ], 8, _e));
461
455
  }
462
- }), Ee = { class: "fg-command-list" }, De = { class: "fg-command-list__table" }, $ = { scope: "col" }, Oe = { scope: "col" }, ke = { key: 0 }, Ae = { class: "fg-command-list__command" }, je = { class: "fg-command-list__description" }, Me = {
456
+ }), Te = { class: "fg-command-list" }, Ee = { class: "fg-command-list__table" }, De = { scope: "col" }, $ = { scope: "col" }, Oe = { key: 0 }, ke = { class: "fg-command-list__command" }, Ae = { class: "fg-command-list__description" }, je = {
463
457
  key: 0,
464
458
  class: "fg-command-list__action"
465
- }, Ne = [
459
+ }, Me = [
466
460
  "disabled",
467
461
  "aria-label",
468
462
  "title",
469
463
  "onClick"
470
- ], Pe = {
464
+ ], Ne = {
471
465
  viewBox: "0 0 24 24",
472
466
  fill: "none",
473
467
  stroke: "currentColor",
474
468
  "stroke-width": "1.5",
475
469
  "aria-hidden": "true"
476
- }, Fe = {
470
+ }, Pe = {
477
471
  key: 0,
478
472
  d: "m5 12 4 4L19 6"
479
- }, Ie = /* @__PURE__ */ m({
473
+ }, Fe = /* @__PURE__ */ h({
480
474
  __name: "UiCommandList",
481
475
  props: {
482
476
  items: {},
@@ -487,42 +481,42 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
487
481
  commandHeader: { default: "Command" },
488
482
  descriptionHeader: { default: "What it does" }
489
483
  },
490
- setup(t) {
491
- let n = C(!1);
492
- b(() => {
493
- n.value = !0;
484
+ setup(e) {
485
+ let t = w(!1);
486
+ x(() => {
487
+ t.value = !0;
494
488
  });
495
- let { copied: r, pending: i, error: a, copy: c } = e({
489
+ let { copied: n, pending: i, error: a, copy: o } = r({
496
490
  unavailableMessage: "Clipboard unavailable. Select the command to copy it.",
497
491
  failureMessage: "Could not copy. Select the command to copy it."
498
- }), p = C(""), m = s(() => a.value || (r.value ? `${p.value} copied to clipboard.` : "")), h = (e) => (p.value = e, c(e));
499
- return (e, s) => (S(), u("div", Ee, [d("table", De, [d("thead", null, [d("tr", null, [
500
- d("th", $, D(t.commandHeader), 1),
501
- d("th", Oe, D(t.descriptionHeader), 1),
502
- t.copyable ? (S(), u("td", ke)) : l("", !0)
503
- ])]), d("tbody", null, [(S(!0), u(o, null, w(t.items, (c) => (S(), u("tr", { key: c.command }, [
504
- d("td", Ae, [T(e.$slots, "command", { item: c }, () => [d("code", null, D(c.command), 1)])]),
505
- d("td", je, [T(e.$slots, "description", { item: c }, () => [f(D(c.description), 1)])]),
506
- t.copyable ? (S(), u("td", Me, [n.value ? (S(), u("button", {
492
+ }), l = w(""), m = c(() => a.value || (n.value ? `${l.value} copied to clipboard.` : "")), h = (e) => (l.value = e, o(e));
493
+ return (r, o) => (C(), d("div", Te, [f("table", Ee, [f("thead", null, [f("tr", null, [
494
+ f("th", De, O(e.commandHeader), 1),
495
+ f("th", $, O(e.descriptionHeader), 1),
496
+ e.copyable ? (C(), d("td", Oe)) : u("", !0)
497
+ ])]), f("tbody", null, [(C(!0), d(s, null, T(e.items, (c) => (C(), d("tr", { key: c.command }, [
498
+ f("td", ke, [E(r.$slots, "command", { item: c }, () => [f("code", null, O(c.command), 1)])]),
499
+ f("td", Ae, [E(r.$slots, "description", { item: c }, () => [p(O(c.description), 1)])]),
500
+ e.copyable ? (C(), d("td", je, [t.value ? (C(), d("button", {
507
501
  key: 0,
508
502
  type: "button",
509
503
  class: "fg-command-list__copy",
510
- disabled: O(i),
504
+ disabled: k(i),
511
505
  "aria-label": `Copy ${c.command}`,
512
506
  title: `Copy ${c.command}`,
513
507
  onClick: (e) => h(c.command)
514
- }, [(S(), u("svg", Pe, [O(r) && !O(a) && p.value === c.command ? (S(), u("path", Fe)) : (S(), u(o, { key: 1 }, [s[0] ||= d("rect", {
508
+ }, [(C(), d("svg", Ne, [k(n) && !k(a) && l.value === c.command ? (C(), d("path", Pe)) : (C(), d(s, { key: 1 }, [o[0] ||= f("rect", {
515
509
  x: "8",
516
510
  y: "8",
517
511
  width: "12",
518
512
  height: "13",
519
513
  rx: "2"
520
- }, null, -1), s[1] ||= d("path", { d: "M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3" }, null, -1)], 64))]))], 8, Ne)) : l("", !0)])) : l("", !0)
521
- ]))), 128))])]), d("span", {
522
- class: _(["fg-command-list__status", { "fg-site-sr-only": !O(a) }]),
514
+ }, null, -1), o[1] ||= f("path", { d: "M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3" }, null, -1)], 64))]))], 8, Me)) : u("", !0)])) : u("", !0)
515
+ ]))), 128))])]), f("span", {
516
+ class: v(["fg-command-list__status", { "fg-site-sr-only": !k(a) }]),
523
517
  role: "status"
524
- }, D(m.value), 3)]));
518
+ }, O(m.value), 3)]));
525
519
  }
526
520
  });
527
521
  //#endregion
528
- export { R as SITE_APPEARANCE_KEY, H as SITE_PROJECTS, Te as UiCapture, Ie as UiCommandList, oe as UiSiteHeader, ge as UiSiteNav, B as applySiteAppearance, ee as siteThemeBootScript, V as useSiteAppearance };
522
+ export { z as SITE_APPEARANCE_KEY, U as SITE_PROJECTS, we as UiCapture, Fe as UiCommandList, ae as UiSiteHeader, he as UiSiteNav, V as applySiteAppearance, ee as siteThemeBootScript, H as useSiteAppearance };