@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/README.md +7 -5
- package/dist/components/UiSegmentedControl.vue.d.ts +41 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +177 -177
- package/dist/site.js +179 -185
- package/dist/{use-active-section-DCS_wyYq.js → use-active-section-DMbpGE2f.js} +60 -8
- package/package.json +1 -1
- package/src/components.css +50 -2
- package/src/site.css +4 -39
package/dist/site.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i,
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { tryOnMounted as
|
|
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
|
|
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('${
|
|
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
|
-
})();`,
|
|
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
|
-
},
|
|
17
|
-
let t =
|
|
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) =>
|
|
22
|
+
read: (e) => B(e) ? e : "system",
|
|
23
23
|
write: (e) => e
|
|
24
24
|
}
|
|
25
|
-
}), n =
|
|
26
|
-
return e &&
|
|
27
|
-
|
|
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
|
-
|
|
36
|
+
B(e) && (t.value = e);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
125
|
-
|
|
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.
|
|
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
|
|
134
|
-
|
|
135
|
-
}),
|
|
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:
|
|
127
|
+
ref: o,
|
|
138
128
|
class: "fg-site-projects",
|
|
139
|
-
onKeydown:
|
|
140
|
-
onFocusout:
|
|
141
|
-
}, [
|
|
129
|
+
onKeydown: h,
|
|
130
|
+
onFocusout: g
|
|
131
|
+
}, [f("summary", {
|
|
142
132
|
ref_key: "trigger",
|
|
143
|
-
ref:
|
|
133
|
+
ref: p,
|
|
144
134
|
class: "fg-site-projects__trigger",
|
|
145
135
|
"aria-label": `Project: ${n.value}`
|
|
146
|
-
}, [
|
|
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
|
-
}, [
|
|
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
|
-
},
|
|
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
|
-
},
|
|
163
|
-
key:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
}),
|
|
176
|
+
}), oe = ["id"], se = ["role", "aria-labelledby"], ce = ["id"], le = [
|
|
183
177
|
"href",
|
|
184
178
|
"aria-current",
|
|
185
179
|
"onClick"
|
|
186
|
-
],
|
|
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,
|
|
191
|
+
return (t, o) => (C(), d("div", {
|
|
198
192
|
id: e.contentId,
|
|
199
193
|
class: "fg-site-rail__content"
|
|
200
|
-
}, [
|
|
194
|
+
}, [f("nav", {
|
|
201
195
|
class: "fg-site-rail__nav fg-site-nav",
|
|
202
196
|
"aria-labelledby": r
|
|
203
|
-
}, [
|
|
197
|
+
}, [f("h2", {
|
|
204
198
|
id: r,
|
|
205
199
|
class: "fg-site-rail__label"
|
|
206
|
-
},
|
|
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 ? (
|
|
205
|
+
}, [e.label ? (C(), d("span", {
|
|
212
206
|
key: 0,
|
|
213
207
|
id: i(t),
|
|
214
208
|
class: "fg-site-rail__group-label"
|
|
215
|
-
},
|
|
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 ? (
|
|
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
|
-
}),
|
|
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
|
|
230
|
-
let t =
|
|
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
|
-
}),
|
|
233
|
-
|
|
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 =
|
|
236
|
-
|
|
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
|
-
!
|
|
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) :
|
|
234
|
+
T ? (e.preventDefault(), T.tabIndex = -1, T.focus({ preventScroll: !0 }), T = null) : s.value || (e.preventDefault(), D());
|
|
241
235
|
};
|
|
242
|
-
return
|
|
243
|
-
|
|
244
|
-
}),
|
|
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:
|
|
240
|
+
ref: r,
|
|
247
241
|
class: "fg-site-rail",
|
|
248
|
-
"data-enhanced":
|
|
249
|
-
}, [!
|
|
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:
|
|
253
|
-
}, [
|
|
246
|
+
open: i.value && !s.value
|
|
247
|
+
}, [f("summary", {
|
|
254
248
|
class: "fg-site-rail__summary",
|
|
255
|
-
"aria-controls":
|
|
256
|
-
},
|
|
257
|
-
"content-id":
|
|
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":
|
|
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,
|
|
260
|
+
])], 8, fe)) : (C(), l(t, {
|
|
267
261
|
key: 1,
|
|
268
|
-
open:
|
|
269
|
-
"onUpdate:open":
|
|
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:
|
|
267
|
+
trigger: F(() => [m(a, {
|
|
274
268
|
variant: "ghost",
|
|
275
269
|
size: "lg",
|
|
276
270
|
class: "fg-site-rail__toggle"
|
|
277
271
|
}, {
|
|
278
|
-
default:
|
|
272
|
+
default: F(() => [p(O(y.value), 1)]),
|
|
279
273
|
_: 1
|
|
280
274
|
})]),
|
|
281
|
-
default:
|
|
282
|
-
"content-id":
|
|
275
|
+
default: F(() => [m(X, {
|
|
276
|
+
"content-id": k(n),
|
|
283
277
|
label: e.label,
|
|
284
278
|
groups: e.groups,
|
|
285
|
-
"active-id":
|
|
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,
|
|
288
|
+
}, 8, ["open", "title"]))], 8, de));
|
|
295
289
|
}
|
|
296
|
-
}),
|
|
290
|
+
}), ge = [
|
|
297
291
|
"aria-label",
|
|
298
292
|
"tabindex",
|
|
299
293
|
"data-fit",
|
|
300
294
|
"innerHTML"
|
|
301
|
-
], Z = .7, Q = /* @__PURE__ */
|
|
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 =
|
|
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
|
|
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
|
-
}),
|
|
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:
|
|
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,
|
|
328
|
+
}, null, 12, ge));
|
|
335
329
|
}
|
|
336
|
-
}),
|
|
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
|
-
},
|
|
333
|
+
}, Ce = { key: 0 }, we = /* @__PURE__ */ h({
|
|
340
334
|
__name: "UiCapture",
|
|
341
|
-
props: /*@__PURE__*/
|
|
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(
|
|
351
|
-
let
|
|
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 =
|
|
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
|
-
},
|
|
357
|
-
|
|
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
|
|
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
|
|
373
|
-
if (!
|
|
374
|
-
let n =
|
|
375
|
-
return !n || h.value === n.id ? !1 : (
|
|
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
|
|
380
|
-
|
|
381
|
-
}),
|
|
382
|
-
cancelAnimationFrame(
|
|
383
|
-
}), (
|
|
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":
|
|
379
|
+
"data-enhanced": i.value
|
|
386
380
|
}, [
|
|
387
|
-
|
|
381
|
+
i.value && g.value ? (C(), d("button", {
|
|
388
382
|
key: 0,
|
|
389
383
|
ref_key: "fullSizeButton",
|
|
390
|
-
ref:
|
|
384
|
+
ref: A,
|
|
391
385
|
type: "button",
|
|
392
386
|
class: "fg-capture__full",
|
|
393
|
-
"aria-label": `Expand ${
|
|
387
|
+
"aria-label": `Expand ${g.value.label} capture at full size`,
|
|
394
388
|
"aria-haspopup": "dialog",
|
|
395
|
-
onClick:
|
|
396
|
-
}, [...
|
|
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
|
-
}, [
|
|
403
|
-
|
|
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:
|
|
406
|
-
label:
|
|
407
|
-
"onUpdate:modelValue":
|
|
399
|
+
items: o.value,
|
|
400
|
+
label: t.label,
|
|
401
|
+
"onUpdate:modelValue": _[1] ||= (e) => r.value = e
|
|
408
402
|
}, {
|
|
409
|
-
panel:
|
|
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: `${
|
|
405
|
+
id: `${t.idPrefix}${n.id}`,
|
|
412
406
|
class: "fg-capture__figure"
|
|
413
|
-
}, [
|
|
407
|
+
}, [f("div", be, [m(Q, {
|
|
414
408
|
html: n.html,
|
|
415
409
|
label: `Terminal capture: ${n.label}`,
|
|
416
|
-
fit:
|
|
410
|
+
fit: i.value
|
|
417
411
|
}, null, 8, [
|
|
418
412
|
"html",
|
|
419
413
|
"label",
|
|
420
414
|
"fit"
|
|
421
|
-
]),
|
|
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) =>
|
|
429
|
-
}, null, 8,
|
|
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
|
-
|
|
430
|
+
m(e, {
|
|
437
431
|
open: v.value,
|
|
438
|
-
"onUpdate:open":
|
|
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:
|
|
436
|
+
onCloseAutoFocus: P
|
|
443
437
|
}, {
|
|
444
|
-
footer:
|
|
438
|
+
footer: F(() => [m(a, {
|
|
445
439
|
variant: "secondary",
|
|
446
440
|
size: "lg",
|
|
447
|
-
onClick:
|
|
441
|
+
onClick: _[2] ||= (e) => v.value = !1
|
|
448
442
|
}, {
|
|
449
|
-
default:
|
|
443
|
+
default: F(() => [..._[5] ||= [p(" Close capture ", -1)]]),
|
|
450
444
|
_: 1
|
|
451
445
|
})]),
|
|
452
|
-
default:
|
|
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"])) :
|
|
451
|
+
}, null, 8, ["html", "label"])) : u("", !0)]),
|
|
458
452
|
_: 1
|
|
459
453
|
}, 8, ["open", "title"])
|
|
460
|
-
], 8,
|
|
454
|
+
], 8, _e));
|
|
461
455
|
}
|
|
462
|
-
}),
|
|
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
|
-
},
|
|
459
|
+
}, Me = [
|
|
466
460
|
"disabled",
|
|
467
461
|
"aria-label",
|
|
468
462
|
"title",
|
|
469
463
|
"onClick"
|
|
470
|
-
],
|
|
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
|
-
},
|
|
470
|
+
}, Pe = {
|
|
477
471
|
key: 0,
|
|
478
472
|
d: "m5 12 4 4L19 6"
|
|
479
|
-
},
|
|
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(
|
|
491
|
-
let
|
|
492
|
-
|
|
493
|
-
|
|
484
|
+
setup(e) {
|
|
485
|
+
let t = w(!1);
|
|
486
|
+
x(() => {
|
|
487
|
+
t.value = !0;
|
|
494
488
|
});
|
|
495
|
-
let { copied:
|
|
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
|
-
}),
|
|
499
|
-
return (
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
])]),
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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:
|
|
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
|
-
}, [(
|
|
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),
|
|
521
|
-
]))), 128))])]),
|
|
522
|
-
class:
|
|
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
|
-
},
|
|
518
|
+
}, O(m.value), 3)]));
|
|
525
519
|
}
|
|
526
520
|
});
|
|
527
521
|
//#endregion
|
|
528
|
-
export {
|
|
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 };
|