@brucesantos/design-space 0.13.0 → 0.14.1
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/CHANGELOG.md +57 -0
- package/README.md +47 -14
- package/bin/design-space-pr.mjs +231 -0
- package/dist/index-BobUYxei.js +95 -0
- package/dist/index-BobUYxei.js.map +1 -0
- package/dist/index-CaxlsfFr.js +423 -0
- package/dist/index-CaxlsfFr.js.map +1 -0
- package/dist/index.js +1138 -1776
- package/dist/index.js.map +1 -1
- package/dist/labels-BlpcrSph.js +520 -0
- package/dist/labels-BlpcrSph.js.map +1 -0
- package/dist/pr/index.d.ts +64 -0
- package/dist/pr.js +132 -0
- package/dist/pr.js.map +1 -0
- package/dist/shell/Panel.d.ts +0 -5
- package/dist/shell/labels.d.ts +43 -12
- package/dist/testing.js +14 -13
- package/dist/testing.js.map +1 -1
- package/dist/types/index.d.ts +5 -5
- package/package.json +9 -1
- package/dist/index-CLox5DuH.js +0 -515
- package/dist/index-CLox5DuH.js.map +0 -1
- package/dist/shell/prMarkdown.d.ts +0 -43
package/dist/index.js
CHANGED
|
@@ -1,356 +1,178 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!g) continue;
|
|
12
|
-
const C = g.definition.path;
|
|
13
|
-
u.set(d.id, C);
|
|
14
|
-
const E = p.get(C) ?? [];
|
|
15
|
-
E.push(d), p.set(C, E);
|
|
16
|
-
}
|
|
17
|
-
const i = /* @__PURE__ */ new Set(), f = [];
|
|
18
|
-
for (const d of n) {
|
|
19
|
-
if (i.has(d.path)) continue;
|
|
20
|
-
i.add(d.path);
|
|
21
|
-
const g = p.get(d.path) ?? [];
|
|
22
|
-
f.push({
|
|
23
|
-
id: d.path,
|
|
24
|
-
name: d.name?.trim() || g[0]?.title || d.path,
|
|
25
|
-
description: d.description,
|
|
26
|
-
route: d,
|
|
27
|
-
href: yt(d.path, d.params),
|
|
28
|
-
variations: g,
|
|
29
|
-
group: d.group?.trim() || void 0,
|
|
30
|
-
controls: Array.isArray(d.controls) ? d.controls : []
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
const S = new Map(f.map((d) => [d.id, d])), N = (d) => d ? s.get(d) : void 0, $ = (d) => d ? c.get(d) : void 0, _ = $(e.defaultPersona)?.id, v = (d, g) => {
|
|
34
|
-
if (!(!d || !g))
|
|
35
|
-
return a.get(d)?.fixtures?.find((C) => C.id === g);
|
|
36
|
-
}, L = (d = {}) => t.filter((g) => re(d.handoff, g.id)), b = (d) => {
|
|
37
|
-
const g = Ne(n, d);
|
|
38
|
-
return g ? S.get(g.definition.path) : void 0;
|
|
39
|
-
}, m = (d = {}) => {
|
|
40
|
-
const { handoff: g } = d;
|
|
41
|
-
return g ? f.map((C) => ({
|
|
42
|
-
...C,
|
|
43
|
-
variations: C.variations.filter((E) => re(g, E.id))
|
|
44
|
-
})).filter(
|
|
45
|
-
(C) => C.variations.length > 0 || (g.routes ?? []).length > 0 && Ge(g, C.href)
|
|
46
|
-
) : f;
|
|
47
|
-
}, w = (d) => d ? d.permissions ? d.permissions : $(d.persona ?? _)?.permissions ?? [] : [], k = (d = {}) => Xe(m(d)), x = (d, g) => {
|
|
48
|
-
const C = new Set(d?.route.components ?? []), E = g ? [g] : d?.variations ?? [];
|
|
49
|
-
for (const F of E)
|
|
50
|
-
for (const O of F.components ?? []) C.add(O);
|
|
51
|
-
return [...C];
|
|
52
|
-
}, T = (d) => r.filter((g) => be(d, g.id));
|
|
53
|
-
return {
|
|
54
|
-
product: e,
|
|
55
|
-
screens: f,
|
|
56
|
-
issues: xt(e),
|
|
57
|
-
defaultPersona: _,
|
|
58
|
-
scenario: N,
|
|
59
|
-
component: (d) => d ? a.get(d) : void 0,
|
|
60
|
-
componentFixture: v,
|
|
61
|
-
resolveComponentFixture: (d, g) => {
|
|
62
|
-
const C = d ? a.get(d) : void 0, E = v(d, g), F = v(d, C?.defaultFixture) ?? C?.fixtures?.[0];
|
|
63
|
-
return {
|
|
64
|
-
fixture: E ?? F,
|
|
65
|
-
requestedId: g,
|
|
66
|
-
didFallback: !!(g && !E)
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
persona: $,
|
|
70
|
-
fixture: (d) => d ? l.get(d) : void 0,
|
|
71
|
-
rule: (d) => d ? h.get(d) : void 0,
|
|
72
|
-
screen: (d) => d ? S.get(d) : void 0,
|
|
73
|
-
screenForPath: b,
|
|
74
|
-
screenOf: (d) => {
|
|
75
|
-
const g = d ? u.get(d.id) : void 0;
|
|
76
|
-
return g ? S.get(g) : void 0;
|
|
77
|
-
},
|
|
78
|
-
screensFor: m,
|
|
79
|
-
flows: k,
|
|
80
|
-
flowOf: (d, g) => {
|
|
81
|
-
if (d)
|
|
82
|
-
return k(g).find((C) => C.name === d.group);
|
|
83
|
-
},
|
|
84
|
-
controlsOf: (d) => (d?.controls ?? []).flatMap((g) => g.controls ?? []),
|
|
85
|
-
resolveControls: (d, g = {}) => It(d?.controls ?? [], g),
|
|
86
|
-
rulesOf: (d) => (d?.rules ?? []).map((g) => h.get(g)).filter((g) => !!g),
|
|
87
|
-
permissionsOf: w,
|
|
88
|
-
scenariosForRoute: (d, g) => {
|
|
89
|
-
const C = b(d);
|
|
90
|
-
return C ? C.variations.filter((E) => re(g?.handoff, E.id)) : [];
|
|
91
|
-
},
|
|
92
|
-
activeScenarios: L,
|
|
93
|
-
search: (d, g) => {
|
|
94
|
-
const C = X(d), E = L(g);
|
|
95
|
-
return C ? E.filter(
|
|
96
|
-
(F) => X(
|
|
97
|
-
[
|
|
98
|
-
F.title,
|
|
99
|
-
F.id,
|
|
100
|
-
F.intent ?? "",
|
|
101
|
-
F.route,
|
|
102
|
-
$(F.persona)?.name ?? "",
|
|
103
|
-
(F.tags ?? []).join(" "),
|
|
104
|
-
(F.expected ?? []).join(" ")
|
|
105
|
-
].join(" ")
|
|
106
|
-
).includes(C)
|
|
107
|
-
) : E;
|
|
108
|
-
},
|
|
109
|
-
searchScreens: (d, g) => {
|
|
110
|
-
const C = X(d), E = m(g);
|
|
111
|
-
return C ? E.filter(
|
|
112
|
-
(F) => X(
|
|
113
|
-
[
|
|
114
|
-
F.name,
|
|
115
|
-
F.description ?? "",
|
|
116
|
-
F.id,
|
|
117
|
-
F.group ?? "",
|
|
118
|
-
...F.variations.flatMap((O) => [
|
|
119
|
-
O.title,
|
|
120
|
-
O.id,
|
|
121
|
-
(O.tags ?? []).join(" ")
|
|
122
|
-
])
|
|
123
|
-
].join(" ")
|
|
124
|
-
).includes(C)
|
|
125
|
-
) : E;
|
|
126
|
-
},
|
|
127
|
-
searchComponents: (d, g) => {
|
|
128
|
-
const C = X(d), E = T(g);
|
|
129
|
-
return C ? E.filter(
|
|
130
|
-
(F) => X(
|
|
131
|
-
[
|
|
132
|
-
F.name,
|
|
133
|
-
F.description ?? "",
|
|
134
|
-
F.group ?? "",
|
|
135
|
-
F.id,
|
|
136
|
-
F.source ?? ""
|
|
137
|
-
].join(" ")
|
|
138
|
-
).includes(C)
|
|
139
|
-
) : E;
|
|
140
|
-
},
|
|
141
|
-
componentsFor: T,
|
|
142
|
-
componentsOfScreen: (d, g) => x(d, g).map((C) => a.get(C)).filter((C) => !!C),
|
|
143
|
-
usagesOf: (d, g) => d ? m(g).filter(
|
|
144
|
-
(C) => C.route.components?.includes(d) || C.variations.some((E) => E.components?.includes(d))
|
|
145
|
-
) : []
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function X(e) {
|
|
149
|
-
return e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g, "").trim();
|
|
150
|
-
}
|
|
151
|
-
function Xe(e) {
|
|
152
|
-
const t = [], n = /* @__PURE__ */ new Map();
|
|
153
|
-
for (const s of e) {
|
|
154
|
-
if (!s.group) {
|
|
155
|
-
t.push(s);
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
const a = n.get(s.group) ?? [];
|
|
159
|
-
a.push(s), n.set(s.group, a);
|
|
160
|
-
}
|
|
161
|
-
const r = [...n].map(([s, a]) => ({ name: s, screens: a }));
|
|
162
|
-
return t.length > 0 ? [{ name: void 0, screens: t }, ...r] : r;
|
|
163
|
-
}
|
|
164
|
-
function Se(e) {
|
|
165
|
-
const t = e.options ?? [];
|
|
166
|
-
return e.default !== void 0 && t.some((n) => n.value === e.default) ? e.default : t[0]?.value ?? "";
|
|
167
|
-
}
|
|
168
|
-
function It(e, t = {}) {
|
|
169
|
-
const n = {}, r = [], s = /* @__PURE__ */ new Set(), a = t.requested ?? {};
|
|
170
|
-
for (const c of e)
|
|
171
|
-
for (const l of c.controls ?? []) {
|
|
172
|
-
if (s.has(l.id)) continue;
|
|
173
|
-
s.add(l.id);
|
|
174
|
-
const h = (f) => f !== void 0 && (l.options ?? []).some((S) => S.value === f);
|
|
175
|
-
let p = Se(l);
|
|
176
|
-
const u = t.scenario?.controls?.[l.id];
|
|
177
|
-
h(u) && (p = u);
|
|
178
|
-
const i = a[l.id];
|
|
179
|
-
i !== void 0 && (h(i) ? p = i : r.push({ id: l.id, value: i, reason: "invalid-value", fallback: p })), n[l.id] = p;
|
|
180
|
-
}
|
|
181
|
-
for (const [c, l] of Object.entries(a))
|
|
182
|
-
s.has(c) || r.push({ id: c, value: l, reason: "unknown-control" });
|
|
183
|
-
return { values: n, invalid: r };
|
|
184
|
-
}
|
|
185
|
-
function Ut(e, t) {
|
|
186
|
-
return e ? Object.entries(e.controls ?? {}).every(([n, r]) => t?.[n] === r) : !1;
|
|
187
|
-
}
|
|
188
|
-
const Vt = [
|
|
1
|
+
import { jsx as n, jsxs as b, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useRef as j, useCallback as W, useEffect as I, useMemo as $, useLayoutEffect as Ie } from "react";
|
|
3
|
+
import { u as X, g as ht, n as fe, s as ut, c as We, a as mt, r as ft, L as pt } from "./labels-BlpcrSph.js";
|
|
4
|
+
import { D as On, E as $n, N as zn } from "./labels-BlpcrSph.js";
|
|
5
|
+
import { p as wt, P as y, h as Se, a as Ne, r as Ue, C as me, b as Ce, N as He, i as xe, d as bt, c as gt, e as vt, g as kt } from "./index-CaxlsfFr.js";
|
|
6
|
+
import { H as Kn, f as In, j as Wn, k as Un, l as Hn, m as qn, n as Bn, o as jn, s as Vn, q as Gn, v as Zn, t as Yn } from "./index-CaxlsfFr.js";
|
|
7
|
+
import { p as ne, t as re, f as ce, a as qe, F as yt, b as _e, c as St, C as de, i as Nt, m as Ct, s as xt } from "./index-BobUYxei.js";
|
|
8
|
+
import { createPortal as Mt } from "react-dom";
|
|
9
|
+
import { r as Et, i as Lt, s as _t } from "./hook-CeXcli-1.js";
|
|
10
|
+
const Tt = [
|
|
189
11
|
{ id: "mobile", label: "Celular", width: 375, height: 812 },
|
|
190
12
|
{ id: "tablet", label: "Tablet", width: 768, height: 1024 },
|
|
191
13
|
{ id: "desktop", label: "Desktop", width: 1280, height: 800 },
|
|
192
14
|
{ id: "fit", label: "Ajustar" },
|
|
193
15
|
{ id: "custom", label: "Personalizado" }
|
|
194
|
-
],
|
|
195
|
-
function
|
|
196
|
-
const r =
|
|
16
|
+
], Me = 25, Ee = 150, he = 100;
|
|
17
|
+
function Be(e, t, o) {
|
|
18
|
+
const r = o !== void 0 ? e.screenForPath(o) : e.screenOf(t), s = t && r && e.screenOf(t)?.id === r.id ? t : void 0;
|
|
197
19
|
return { screen: r, scenario: s };
|
|
198
20
|
}
|
|
199
|
-
function
|
|
200
|
-
const r = new URLSearchParams(e), s =
|
|
201
|
-
scenario:
|
|
202
|
-
requested:
|
|
21
|
+
function ge(e, t, o) {
|
|
22
|
+
const r = new URLSearchParams(e), s = wt(r), a = r.get(y.component) ?? void 0, i = Se(s, a) ? t.component(a) : void 0, d = r.get(y.scenario) ?? void 0, l = i || !Ne(s, d) ? void 0 : t.scenario(d), c = r.get(y.fixture) ?? void 0, h = i ? c ?? t.componentFixture(i.id, i.defaultFixture)?.id ?? i.fixtures?.[0]?.id : void 0, u = r.get(y.network), p = i ? void 0 : Be(t, l, o), S = p?.screen && p.screen.controls.length > 0 ? t.resolveControls(p.screen, {
|
|
23
|
+
scenario: p.scenario,
|
|
24
|
+
requested: Ue(r)
|
|
203
25
|
}).values : void 0;
|
|
204
26
|
return {
|
|
205
|
-
scenario:
|
|
27
|
+
scenario: l?.id,
|
|
206
28
|
handoff: s,
|
|
207
|
-
component:
|
|
29
|
+
component: i?.id,
|
|
208
30
|
// Precedência: URL, cenário, padrão do produto. O preview de componente não
|
|
209
31
|
// tem persona, então o padrão não se aplica a ele.
|
|
210
|
-
persona: r.get(
|
|
211
|
-
fixture:
|
|
212
|
-
network:
|
|
213
|
-
viewport: r.get(
|
|
214
|
-
customWidth:
|
|
215
|
-
themeMode: r.get(
|
|
216
|
-
locale: r.get(
|
|
217
|
-
dataSource: r.get(
|
|
32
|
+
persona: r.get(y.persona) ?? l?.persona ?? (i ? void 0 : t.defaultPersona),
|
|
33
|
+
fixture: i ? h : c ?? l?.fixture,
|
|
34
|
+
network: Ot(u) ? u : l?.network ?? "success",
|
|
35
|
+
viewport: r.get(y.viewport) ?? "fit",
|
|
36
|
+
customWidth: Dt(r.get(y.customWidth)),
|
|
37
|
+
themeMode: r.get(y.themeMode) ?? t.product.theme?.modes?.[0],
|
|
38
|
+
locale: r.get(y.locale) ?? t.product.theme?.locales?.[0],
|
|
39
|
+
dataSource: r.get(y.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
|
|
218
40
|
// Sem parâmetro, o tema do chrome fica em aberto: o shell resolve pela
|
|
219
41
|
// última escolha da pessoa e, na falta dela, pelo sistema.
|
|
220
|
-
chromeTheme:
|
|
42
|
+
chromeTheme: $t(r.get(y.chromeTheme)) ? r.get(y.chromeTheme) : void 0,
|
|
221
43
|
// Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
|
|
222
44
|
// de tela, então precisa ser explícito para não sumir sem pedido.
|
|
223
|
-
chrome: r.get(
|
|
224
|
-
inspector: r.get(
|
|
225
|
-
panelTab:
|
|
226
|
-
zoom:
|
|
227
|
-
rotated: r.get(
|
|
228
|
-
highlight: r.get(
|
|
45
|
+
chrome: r.get(y.chrome) !== "0",
|
|
46
|
+
inspector: r.get(y.inspector) !== "0",
|
|
47
|
+
panelTab: zt(r.get(y.panelTab)) ? r.get(y.panelTab) : "variations",
|
|
48
|
+
zoom: Ge(r.get(y.zoom)),
|
|
49
|
+
rotated: r.get(y.rotated) === "1",
|
|
50
|
+
highlight: r.get(y.highlight) === "1",
|
|
229
51
|
screenControls: S
|
|
230
52
|
};
|
|
231
53
|
}
|
|
232
|
-
function
|
|
54
|
+
function oe(e, t, o) {
|
|
233
55
|
const r = new URLSearchParams(), s = t.scenario(e.scenario);
|
|
234
|
-
if (e.component ? r.set(
|
|
235
|
-
const
|
|
236
|
-
for (const S of
|
|
237
|
-
const
|
|
238
|
-
|
|
56
|
+
if (e.component ? r.set(y.component, e.component) : e.scenario && r.set(y.scenario, e.scenario), e.persona && e.persona !== (s?.persona ?? t.defaultPersona) && r.set(y.persona, e.persona), e.component && e.fixture ? r.set(y.fixture, e.fixture) : e.fixture && e.fixture !== s?.fixture && r.set(y.fixture, e.fixture), e.network !== (s?.network ?? "success") && r.set(y.network, e.network), e.screenControls && !e.component) {
|
|
57
|
+
const h = Be(t, s, o), u = h.screen ? t.resolveControls(h.screen, { scenario: h.scenario }).values : {}, p = h.screen ? t.controlsOf(h.screen).map((S) => S.id) : Object.keys(e.screenControls);
|
|
58
|
+
for (const S of p) {
|
|
59
|
+
const C = e.screenControls[S];
|
|
60
|
+
C !== void 0 && C !== u[S] && r.set(`${me}${S}`, C);
|
|
239
61
|
}
|
|
240
62
|
}
|
|
241
|
-
e.viewport !== "fit" && r.set(
|
|
63
|
+
e.viewport !== "fit" && r.set(y.viewport, e.viewport), e.viewport === "custom" && e.customWidth && r.set(y.customWidth, String(e.customWidth));
|
|
242
64
|
const a = t.product.theme?.modes?.[0];
|
|
243
|
-
e.themeMode && e.themeMode !== a && r.set(
|
|
244
|
-
const
|
|
245
|
-
e.locale && e.locale !==
|
|
246
|
-
const
|
|
247
|
-
e.dataSource && e.dataSource !==
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
return
|
|
252
|
-
}
|
|
253
|
-
function
|
|
254
|
-
const
|
|
65
|
+
e.themeMode && e.themeMode !== a && r.set(y.themeMode, e.themeMode);
|
|
66
|
+
const i = t.product.theme?.locales?.[0];
|
|
67
|
+
e.locale && e.locale !== i && r.set(y.locale, e.locale);
|
|
68
|
+
const d = t.product.dataSources?.default ?? "fixtures";
|
|
69
|
+
e.dataSource && e.dataSource !== d && r.set(y.dataSource, e.dataSource), e.chromeTheme && r.set(y.chromeTheme, e.chromeTheme), e.chrome || r.set(y.chrome, "0"), e.inspector || r.set(y.inspector, "0"), e.panelTab === "info" && r.set(y.panelTab, "info");
|
|
70
|
+
const l = Ge(e.zoom === void 0 ? null : String(e.zoom));
|
|
71
|
+
l !== he && r.set(y.zoom, String(l)), e.rotated && r.set(y.rotated, "1"), e.highlight && r.set(y.highlight, "1"), Ce(r, e.handoff);
|
|
72
|
+
const c = r.toString();
|
|
73
|
+
return c ? `?${c}` : "";
|
|
74
|
+
}
|
|
75
|
+
function je(e, t = {}) {
|
|
76
|
+
const o = !!t.frame, [r, s] = z(() => pe()), a = j(r), i = W((m) => {
|
|
255
77
|
a.current = m, s(m);
|
|
256
|
-
}, []),
|
|
257
|
-
|
|
78
|
+
}, []), d = j(!1), l = W((m) => {
|
|
79
|
+
d.current = !0;
|
|
258
80
|
try {
|
|
259
81
|
window.history.replaceState(null, "", m);
|
|
260
82
|
} finally {
|
|
261
|
-
|
|
83
|
+
d.current = !1;
|
|
262
84
|
}
|
|
263
85
|
}, []);
|
|
264
|
-
|
|
265
|
-
const m = () =>
|
|
86
|
+
I(() => {
|
|
87
|
+
const m = () => i(pe());
|
|
266
88
|
return window.addEventListener("popstate", m), () => window.removeEventListener("popstate", m);
|
|
267
|
-
}, [
|
|
268
|
-
if (!
|
|
269
|
-
const m = window.history, { pushState: w, replaceState:
|
|
270
|
-
const
|
|
271
|
-
if (window.location.pathname !==
|
|
272
|
-
const
|
|
273
|
-
if (`${window.location.pathname}${window.location.search}` !==
|
|
274
|
-
const
|
|
275
|
-
return a.current =
|
|
276
|
-
a.current ===
|
|
89
|
+
}, [i]), I(() => {
|
|
90
|
+
if (!o) return;
|
|
91
|
+
const m = window.history, { pushState: w, replaceState: g } = m, N = (T) => {
|
|
92
|
+
const L = a.current;
|
|
93
|
+
if (window.location.pathname !== L.path) return !1;
|
|
94
|
+
const P = Te(L.search, ce(window.location.href).search), A = re(L.path, P);
|
|
95
|
+
if (`${window.location.pathname}${window.location.search}` !== A && g.call(m, m.state, "", `${A}${window.location.hash}`), P === L.search) return !0;
|
|
96
|
+
const G = { path: L.path, search: P };
|
|
97
|
+
return a.current = G, queueMicrotask(() => {
|
|
98
|
+
a.current === G && (s(G), ne(
|
|
277
99
|
window.parent === window ? void 0 : window.parent,
|
|
278
|
-
{ ds: 1, type: "navigate", url:
|
|
100
|
+
{ ds: 1, type: "navigate", url: A, replace: T },
|
|
279
101
|
window.location.origin
|
|
280
102
|
));
|
|
281
103
|
}), !0;
|
|
282
104
|
};
|
|
283
|
-
return m.replaceState = function(T,
|
|
284
|
-
|
|
285
|
-
}, m.pushState = function(T,
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
},
|
|
289
|
-
m.pushState = w, m.replaceState =
|
|
105
|
+
return m.replaceState = function(T, L, P) {
|
|
106
|
+
g.call(m, T, L, P), d.current || N(!0);
|
|
107
|
+
}, m.pushState = function(T, L, P) {
|
|
108
|
+
const A = `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
109
|
+
g.call(m, T, L, P), !N(!1) && (g.call(m, m.state, "", A), w.call(m, T, L, P));
|
|
110
|
+
}, N(!0), () => {
|
|
111
|
+
m.pushState = w, m.replaceState = g;
|
|
290
112
|
};
|
|
291
|
-
}, [
|
|
292
|
-
if (!
|
|
293
|
-
const m = window.location.origin, w = (
|
|
294
|
-
const T =
|
|
113
|
+
}, [o]), I(() => {
|
|
114
|
+
if (!o || window.parent === window) return;
|
|
115
|
+
const m = window.location.origin, w = (N) => {
|
|
116
|
+
const T = qe(N, { origin: m, source: window.parent });
|
|
295
117
|
if (T?.type !== "location") return;
|
|
296
|
-
const { path:
|
|
297
|
-
|
|
118
|
+
const { path: L, search: P } = ce(T.url);
|
|
119
|
+
l(re(L, P)), i({ path: L, search: P });
|
|
298
120
|
};
|
|
299
121
|
window.addEventListener("message", w);
|
|
300
|
-
const
|
|
301
|
-
return
|
|
122
|
+
const g = pe();
|
|
123
|
+
return ne(
|
|
302
124
|
window.parent,
|
|
303
|
-
{ ds: 1, type: "ready", url:
|
|
125
|
+
{ ds: 1, type: "ready", url: re(g.path, g.search) },
|
|
304
126
|
m
|
|
305
127
|
), () => window.removeEventListener("message", w);
|
|
306
|
-
}, [
|
|
307
|
-
const
|
|
308
|
-
() =>
|
|
128
|
+
}, [o, i, l]);
|
|
129
|
+
const c = $(
|
|
130
|
+
() => ge(r.search, e, r.path),
|
|
309
131
|
[r.path, r.search, e]
|
|
310
|
-
),
|
|
311
|
-
(m, w,
|
|
312
|
-
if (
|
|
313
|
-
const T =
|
|
314
|
-
|
|
132
|
+
), h = W(
|
|
133
|
+
(m, w, g = !1) => {
|
|
134
|
+
if (o) {
|
|
135
|
+
const T = re(m, w), L = ce(T);
|
|
136
|
+
l(T), i(L), ne(
|
|
315
137
|
window.parent === window ? void 0 : window.parent,
|
|
316
|
-
{ ds: 1, type: "navigate", url: T, replace:
|
|
138
|
+
{ ds: 1, type: "navigate", url: T, replace: g },
|
|
317
139
|
window.location.origin
|
|
318
140
|
);
|
|
319
141
|
return;
|
|
320
142
|
}
|
|
321
|
-
const
|
|
322
|
-
|
|
143
|
+
const N = `${m}${w}`;
|
|
144
|
+
g ? window.history.replaceState(null, "", N) : window.history.pushState(null, "", N), i({ path: m, search: w });
|
|
323
145
|
},
|
|
324
|
-
[
|
|
325
|
-
),
|
|
146
|
+
[o, i, l]
|
|
147
|
+
), u = W(() => {
|
|
326
148
|
const m = a.current;
|
|
327
|
-
return m === r ?
|
|
328
|
-
}, [
|
|
149
|
+
return m === r ? c : ge(m.search, e, m.path);
|
|
150
|
+
}, [c, r, e]), p = W(
|
|
329
151
|
(m) => {
|
|
330
|
-
const w = a.current,
|
|
331
|
-
|
|
152
|
+
const w = a.current, g = { ...u(), ...m }, N = Te(oe(g, e, w.path), w.search);
|
|
153
|
+
N !== w.search && h(w.path, N, !0);
|
|
332
154
|
},
|
|
333
|
-
[
|
|
334
|
-
), S =
|
|
155
|
+
[u, h, e]
|
|
156
|
+
), S = W(
|
|
335
157
|
(m) => {
|
|
336
|
-
const w =
|
|
337
|
-
Object.entries(m).some(([
|
|
158
|
+
const w = u().screenControls ?? {};
|
|
159
|
+
Object.entries(m).some(([N, T]) => w[N] !== T) && p({ screenControls: { ...w, ...m } });
|
|
338
160
|
},
|
|
339
|
-
[
|
|
340
|
-
),
|
|
161
|
+
[u, p]
|
|
162
|
+
), C = W(
|
|
341
163
|
(m, w) => {
|
|
342
|
-
const
|
|
164
|
+
const g = Rt(m, a.current, e, {
|
|
343
165
|
controls: w?.controls
|
|
344
166
|
});
|
|
345
|
-
|
|
167
|
+
h(g.path, g.search, w?.replace ?? !1);
|
|
346
168
|
},
|
|
347
|
-
[
|
|
348
|
-
),
|
|
169
|
+
[h, e]
|
|
170
|
+
), k = W(
|
|
349
171
|
(m) => {
|
|
350
172
|
const w = e.scenario(m);
|
|
351
|
-
if (!w || !
|
|
352
|
-
const
|
|
353
|
-
...
|
|
173
|
+
if (!w || !Ne(c.handoff, m)) return;
|
|
174
|
+
const g = {
|
|
175
|
+
...c,
|
|
354
176
|
scenario: w.id,
|
|
355
177
|
component: void 0,
|
|
356
178
|
persona: w.persona,
|
|
@@ -359,45 +181,45 @@ function et(e, t = {}) {
|
|
|
359
181
|
// Os controles voltam ao que o cenário fixa, sobre os padrões da tela.
|
|
360
182
|
screenControls: void 0
|
|
361
183
|
};
|
|
362
|
-
|
|
184
|
+
h(w.route, oe(g, e, w.route), !1);
|
|
363
185
|
},
|
|
364
|
-
[
|
|
365
|
-
),
|
|
186
|
+
[c, h, e]
|
|
187
|
+
), E = W(
|
|
366
188
|
(m, w) => {
|
|
367
|
-
const
|
|
368
|
-
if (!
|
|
369
|
-
const
|
|
370
|
-
...
|
|
189
|
+
const g = e.component(m);
|
|
190
|
+
if (!g || !Se(c.handoff, m)) return;
|
|
191
|
+
const N = {
|
|
192
|
+
...c,
|
|
371
193
|
scenario: void 0,
|
|
372
|
-
component:
|
|
194
|
+
component: g.id,
|
|
373
195
|
persona: void 0,
|
|
374
196
|
fixture: void 0,
|
|
375
197
|
network: "success",
|
|
376
198
|
screenControls: void 0
|
|
377
199
|
};
|
|
378
|
-
|
|
200
|
+
N.fixture = e.componentFixture(g.id, g.defaultFixture)?.id ?? g.fixtures?.[0]?.id, h("/", oe(N, e), w?.replace ?? !1);
|
|
379
201
|
},
|
|
380
|
-
[
|
|
381
|
-
), v =
|
|
202
|
+
[c, h, e]
|
|
203
|
+
), v = W(
|
|
382
204
|
(m, w) => {
|
|
383
|
-
const
|
|
384
|
-
if (!
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
const
|
|
388
|
-
...
|
|
389
|
-
scenario:
|
|
205
|
+
const g = e.screensFor({ handoff: c.handoff }).find((L) => L.id === m);
|
|
206
|
+
if (!g) return;
|
|
207
|
+
const N = g.variations[0];
|
|
208
|
+
if (N) {
|
|
209
|
+
const L = {
|
|
210
|
+
...c,
|
|
211
|
+
scenario: N.id,
|
|
390
212
|
component: void 0,
|
|
391
|
-
persona:
|
|
392
|
-
fixture:
|
|
393
|
-
network:
|
|
213
|
+
persona: N.persona,
|
|
214
|
+
fixture: N.fixture,
|
|
215
|
+
network: N.network ?? "success",
|
|
394
216
|
screenControls: void 0
|
|
395
217
|
};
|
|
396
|
-
|
|
218
|
+
h(N.route, oe(L, e, N.route), w?.replace ?? !1);
|
|
397
219
|
return;
|
|
398
220
|
}
|
|
399
221
|
const T = {
|
|
400
|
-
...
|
|
222
|
+
...c,
|
|
401
223
|
scenario: void 0,
|
|
402
224
|
component: void 0,
|
|
403
225
|
persona: void 0,
|
|
@@ -405,161 +227,161 @@ function et(e, t = {}) {
|
|
|
405
227
|
network: "success",
|
|
406
228
|
screenControls: void 0
|
|
407
229
|
};
|
|
408
|
-
|
|
230
|
+
h(g.href, oe(T, e, g.href), w?.replace ?? !1);
|
|
409
231
|
},
|
|
410
|
-
[
|
|
411
|
-
),
|
|
412
|
-
(m, w,
|
|
413
|
-
[
|
|
414
|
-
),
|
|
232
|
+
[c, h, e]
|
|
233
|
+
), _ = W(
|
|
234
|
+
(m, w, g) => h(m || "/", w, g?.replace ?? !1),
|
|
235
|
+
[h]
|
|
236
|
+
), f = $(() => At(c), [c]);
|
|
415
237
|
return {
|
|
416
238
|
location: r,
|
|
417
|
-
controls:
|
|
418
|
-
viewport:
|
|
419
|
-
setControls:
|
|
239
|
+
controls: c,
|
|
240
|
+
viewport: f,
|
|
241
|
+
setControls: p,
|
|
420
242
|
setScreenControls: S,
|
|
421
|
-
navigate:
|
|
422
|
-
openScenario:
|
|
423
|
-
openComponent:
|
|
243
|
+
navigate: C,
|
|
244
|
+
openScenario: k,
|
|
245
|
+
openComponent: E,
|
|
424
246
|
openScreen: v,
|
|
425
|
-
go:
|
|
247
|
+
go: _
|
|
426
248
|
};
|
|
427
249
|
}
|
|
428
|
-
function
|
|
429
|
-
const s = e.split("#")[0] ?? e, a = s.indexOf("?"),
|
|
430
|
-
let
|
|
431
|
-
if (
|
|
432
|
-
|
|
250
|
+
function Rt(e, t, o, r = {}) {
|
|
251
|
+
const s = e.split("#")[0] ?? e, a = s.indexOf("?"), i = (a === -1 ? s : s.slice(0, a)) || "/", d = a === -1 ? void 0 : s.slice(a + 1), l = new URLSearchParams(t.search), c = ge(t.search, o, t.path), h = !Pt(o, i, t.path);
|
|
252
|
+
let u;
|
|
253
|
+
if (d === void 0 && r.controls === void 0)
|
|
254
|
+
u = new URLSearchParams(t.search), h && (bt(u), Ve(u));
|
|
433
255
|
else {
|
|
434
|
-
const S = new URLSearchParams(
|
|
435
|
-
|
|
436
|
-
for (const [
|
|
437
|
-
!
|
|
438
|
-
|
|
439
|
-
for (const [
|
|
256
|
+
const S = new URLSearchParams(d ?? "");
|
|
257
|
+
u = new URLSearchParams();
|
|
258
|
+
for (const [C, k] of l)
|
|
259
|
+
!Ft(C) || S.has(C) || h && !xe(C) || u.append(C, k);
|
|
260
|
+
c.scenario && !S.has(y.scenario) && c.persona && c.persona !== o.defaultPersona && !u.has(y.persona) && !S.has(y.persona) && u.set(y.persona, c.persona);
|
|
261
|
+
for (const [C, k] of S) u.append(C, k);
|
|
440
262
|
if (r.controls) {
|
|
441
|
-
const
|
|
442
|
-
for (const [
|
|
443
|
-
const m = `${
|
|
444
|
-
v[
|
|
263
|
+
const C = o.screenForPath(i), k = o.scenario(u.get(y.scenario) ?? void 0), E = k && C && o.screenOf(k)?.id === C.id ? k : void 0, v = C ? o.resolveControls(C, { scenario: E }).values : {};
|
|
264
|
+
for (const [_, f] of Object.entries(r.controls)) {
|
|
265
|
+
const m = `${me}${_}`;
|
|
266
|
+
v[_] === f ? u.delete(m) : u.set(m, f);
|
|
445
267
|
}
|
|
446
268
|
}
|
|
447
269
|
}
|
|
448
|
-
|
|
449
|
-
const
|
|
450
|
-
return { path:
|
|
270
|
+
c.handoff && Ce(u, c.handoff);
|
|
271
|
+
const p = u.toString();
|
|
272
|
+
return { path: i, search: p ? `?${p}` : "" };
|
|
451
273
|
}
|
|
452
|
-
function
|
|
453
|
-
const
|
|
454
|
-
|
|
274
|
+
function Te(e, t) {
|
|
275
|
+
const o = new URLSearchParams(e);
|
|
276
|
+
Ve(o);
|
|
455
277
|
for (const [s, a] of new URLSearchParams(t))
|
|
456
|
-
s ===
|
|
457
|
-
const r =
|
|
278
|
+
s === yt || xe(s) || o.append(s, a);
|
|
279
|
+
const r = o.toString();
|
|
458
280
|
return r ? `?${r}` : "";
|
|
459
281
|
}
|
|
460
|
-
function
|
|
282
|
+
function Ve(e) {
|
|
461
283
|
for (const t of [...e.keys()])
|
|
462
|
-
|
|
284
|
+
xe(t) || e.delete(t);
|
|
463
285
|
}
|
|
464
|
-
function
|
|
465
|
-
const r = e.screenForPath(t)?.id, s = e.screenForPath(
|
|
466
|
-
return r === void 0 && s === void 0 ? t ===
|
|
286
|
+
function Pt(e, t, o) {
|
|
287
|
+
const r = e.screenForPath(t)?.id, s = e.screenForPath(o)?.id;
|
|
288
|
+
return r === void 0 && s === void 0 ? t === o : r === s;
|
|
467
289
|
}
|
|
468
|
-
function
|
|
469
|
-
return e.startsWith(
|
|
290
|
+
function Ft(e) {
|
|
291
|
+
return e.startsWith(me) ? !1 : e !== y.scenario && e !== y.fixture && e !== y.component;
|
|
470
292
|
}
|
|
471
|
-
function
|
|
293
|
+
function At(e) {
|
|
472
294
|
if (e.viewport === "custom")
|
|
473
295
|
return { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 };
|
|
474
|
-
const t =
|
|
296
|
+
const t = Tt.find((o) => o.id === e.viewport) ?? {
|
|
475
297
|
id: "fit",
|
|
476
298
|
label: "Ajustar"
|
|
477
299
|
};
|
|
478
300
|
return e.rotated && t.width && t.height ? { ...t, width: t.height, height: t.width } : { ...t };
|
|
479
301
|
}
|
|
480
|
-
function
|
|
481
|
-
if (e === null) return
|
|
302
|
+
function Ge(e) {
|
|
303
|
+
if (e === null) return he;
|
|
482
304
|
const t = Number.parseInt(e, 10);
|
|
483
|
-
return Number.isFinite(t) ? Math.min(
|
|
305
|
+
return Number.isFinite(t) ? Math.min(Ee, Math.max(Me, t)) : he;
|
|
484
306
|
}
|
|
485
|
-
function
|
|
307
|
+
function pe() {
|
|
486
308
|
return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
|
|
487
309
|
}
|
|
488
|
-
function
|
|
489
|
-
return e !== null &&
|
|
310
|
+
function Ot(e) {
|
|
311
|
+
return e !== null && He.includes(e);
|
|
490
312
|
}
|
|
491
|
-
function
|
|
313
|
+
function $t(e) {
|
|
492
314
|
return e === "dark" || e === "light";
|
|
493
315
|
}
|
|
494
|
-
function
|
|
316
|
+
function zt(e) {
|
|
495
317
|
return e === "variations" || e === "info";
|
|
496
318
|
}
|
|
497
|
-
function
|
|
319
|
+
function Dt(e) {
|
|
498
320
|
if (!e) return;
|
|
499
321
|
const t = Number.parseInt(e, 10);
|
|
500
322
|
return Number.isFinite(t) && t > 0 ? t : void 0;
|
|
501
323
|
}
|
|
502
|
-
const
|
|
503
|
-
mobile: /* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */
|
|
324
|
+
const Kt = "@brucesantos/design-space", Re = "0.14.1", It = {
|
|
325
|
+
mobile: /* @__PURE__ */ b(V, { children: [
|
|
326
|
+
/* @__PURE__ */ n("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
|
|
327
|
+
/* @__PURE__ */ n("path", { d: "M11 18.5h2" })
|
|
506
328
|
] }),
|
|
507
|
-
tablet: /* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
329
|
+
tablet: /* @__PURE__ */ b(V, { children: [
|
|
330
|
+
/* @__PURE__ */ n("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
|
|
331
|
+
/* @__PURE__ */ n("path", { d: "M11 18.5h2" })
|
|
510
332
|
] }),
|
|
511
|
-
desktop: /* @__PURE__ */
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
/* @__PURE__ */
|
|
333
|
+
desktop: /* @__PURE__ */ b(V, { children: [
|
|
334
|
+
/* @__PURE__ */ n("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
|
|
335
|
+
/* @__PURE__ */ n("path", { d: "M8.5 20.5h7M12 16.5v4" })
|
|
514
336
|
] }),
|
|
515
|
-
fit: /* @__PURE__ */
|
|
516
|
-
rotate: /* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
337
|
+
fit: /* @__PURE__ */ n("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
|
|
338
|
+
rotate: /* @__PURE__ */ b(V, { children: [
|
|
339
|
+
/* @__PURE__ */ n("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
|
|
340
|
+
/* @__PURE__ */ n("path", { d: "M20 4v4.5h-4.5" })
|
|
519
341
|
] }),
|
|
520
|
-
minus: /* @__PURE__ */
|
|
521
|
-
plus: /* @__PURE__ */
|
|
522
|
-
"arrow-up-right": /* @__PURE__ */
|
|
523
|
-
link: /* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
342
|
+
minus: /* @__PURE__ */ n("path", { d: "M5 12h14" }),
|
|
343
|
+
plus: /* @__PURE__ */ n("path", { d: "M5 12h14M12 5v14" }),
|
|
344
|
+
"arrow-up-right": /* @__PURE__ */ n("path", { d: "M7 17 17 7M8 7h9v9" }),
|
|
345
|
+
link: /* @__PURE__ */ b(V, { children: [
|
|
346
|
+
/* @__PURE__ */ n("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
|
|
347
|
+
/* @__PURE__ */ n("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
|
|
526
348
|
] }),
|
|
527
|
-
check: /* @__PURE__ */
|
|
528
|
-
fullscreen: /* @__PURE__ */
|
|
529
|
-
components: /* @__PURE__ */
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */
|
|
349
|
+
check: /* @__PURE__ */ n("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
|
|
350
|
+
fullscreen: /* @__PURE__ */ n("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
|
|
351
|
+
components: /* @__PURE__ */ b(V, { children: [
|
|
352
|
+
/* @__PURE__ */ n("rect", { x: "4", y: "4", width: "7", height: "7", rx: "1" }),
|
|
353
|
+
/* @__PURE__ */ n("rect", { x: "13", y: "13", width: "7", height: "7", rx: "1" }),
|
|
354
|
+
/* @__PURE__ */ n("path", { d: "M13 4h7v7M4 13v7h7", strokeDasharray: "2 2" })
|
|
533
355
|
] }),
|
|
534
|
-
external: /* @__PURE__ */
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
-
/* @__PURE__ */
|
|
356
|
+
external: /* @__PURE__ */ b(V, { children: [
|
|
357
|
+
/* @__PURE__ */ n("path", { d: "M14 4h6v6M20 4l-8.5 8.5" }),
|
|
358
|
+
/* @__PURE__ */ n("path", { d: "M18 14v4.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 4 18.5v-11A1.5 1.5 0 0 1 5.5 6H10" })
|
|
537
359
|
] }),
|
|
538
|
-
sun: /* @__PURE__ */
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
360
|
+
sun: /* @__PURE__ */ b(V, { children: [
|
|
361
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
|
|
362
|
+
/* @__PURE__ */ n("path", { d: "M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4" })
|
|
541
363
|
] }),
|
|
542
|
-
moon: /* @__PURE__ */
|
|
543
|
-
panel: /* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
364
|
+
moon: /* @__PURE__ */ n("path", { d: "M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" }),
|
|
365
|
+
panel: /* @__PURE__ */ b(V, { children: [
|
|
366
|
+
/* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
367
|
+
/* @__PURE__ */ n("path", { d: "M15 4v16" })
|
|
546
368
|
] }),
|
|
547
|
-
alert: /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
/* @__PURE__ */
|
|
369
|
+
alert: /* @__PURE__ */ b(V, { children: [
|
|
370
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
|
|
371
|
+
/* @__PURE__ */ n("path", { d: "M12 7.5v5.5M12 16.2v.3" })
|
|
550
372
|
] }),
|
|
551
|
-
chevron: /* @__PURE__ */
|
|
552
|
-
search: /* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
373
|
+
chevron: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6" }),
|
|
374
|
+
search: /* @__PURE__ */ b(V, { children: [
|
|
375
|
+
/* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "6.5" }),
|
|
376
|
+
/* @__PURE__ */ n("path", { d: "M20 20l-4.2-4.2" })
|
|
555
377
|
] }),
|
|
556
|
-
copy: /* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
378
|
+
copy: /* @__PURE__ */ b(V, { children: [
|
|
379
|
+
/* @__PURE__ */ n("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
|
|
380
|
+
/* @__PURE__ */ n("path", { d: "M15.5 8.5V5.5a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3" })
|
|
559
381
|
] })
|
|
560
382
|
};
|
|
561
383
|
function H({ name: e, size: t = 16 }) {
|
|
562
|
-
return /* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ n(
|
|
563
385
|
"svg",
|
|
564
386
|
{
|
|
565
387
|
className: "ds-icon",
|
|
@@ -573,384 +395,78 @@ function H({ name: e, size: t = 16 }) {
|
|
|
573
395
|
strokeLinejoin: "round",
|
|
574
396
|
"aria-hidden": "true",
|
|
575
397
|
focusable: "false",
|
|
576
|
-
children:
|
|
398
|
+
children: It[e]
|
|
577
399
|
}
|
|
578
400
|
);
|
|
579
401
|
}
|
|
580
|
-
const
|
|
581
|
-
network: {
|
|
582
|
-
success: "Sucesso",
|
|
583
|
-
loading: "Carregando",
|
|
584
|
-
empty: "Vazio",
|
|
585
|
-
error: "Erro",
|
|
586
|
-
slow: "Lento"
|
|
587
|
-
},
|
|
588
|
-
viewport: {
|
|
589
|
-
fit: "Ajustar",
|
|
590
|
-
mobile: "Celular",
|
|
591
|
-
tablet: "Tablet",
|
|
592
|
-
desktop: "Desktop",
|
|
593
|
-
custom: "Personalizado"
|
|
594
|
-
},
|
|
595
|
-
topbar: {
|
|
596
|
-
region: "Barra do Design Space",
|
|
597
|
-
viewportGroup: "Viewport",
|
|
598
|
-
rotate: "Girar",
|
|
599
|
-
zoomOut: "Diminuir zoom",
|
|
600
|
-
zoomIn: "Aumentar zoom",
|
|
601
|
-
zoomReset: "Voltar o zoom para 100%",
|
|
602
|
-
zoomValue: (e) => `${e}%`,
|
|
603
|
-
copyLink: "Copiar link",
|
|
604
|
-
copied: "Link copiado",
|
|
605
|
-
copyPrompt: "Copie o link:",
|
|
606
|
-
cleanReview: "Revisão limpa (Shift+C)",
|
|
607
|
-
highlight: "Destacar componentes",
|
|
608
|
-
openFrame: "Abrir em nova janela",
|
|
609
|
-
lightMode: "Tema claro",
|
|
610
|
-
darkMode: "Tema escuro",
|
|
611
|
-
engineVersion: (e) => `Design Space ${e}`,
|
|
612
|
-
diagnostics: (e, t) => `Diagnóstico: ${e} ${e === 1 ? "erro" : "erros"}, ${t} ${t === 1 ? "aviso" : "avisos"}`,
|
|
613
|
-
branchTitle: (e) => `Branch: ${e}`,
|
|
614
|
-
commitTitle: (e) => `Commit: ${e}`,
|
|
615
|
-
envTitle: (e) => `Ambiente: ${e}`
|
|
616
|
-
},
|
|
617
|
-
highlight: {
|
|
618
|
-
notInCatalog: (e) => `${e} · fora do catálogo`
|
|
619
|
-
},
|
|
620
|
-
sidebar: {
|
|
621
|
-
region: "Navegação",
|
|
622
|
-
tabs: "Telas e componentes",
|
|
623
|
-
screensTab: "Telas",
|
|
624
|
-
componentsTab: "Componentes",
|
|
625
|
-
searchPlaceholder: "Buscar",
|
|
626
|
-
searchLabel: "Buscar telas e componentes",
|
|
627
|
-
searchShortcut: "⌘K",
|
|
628
|
-
noMatch: (e) => `Nada encontrado para "${e}".`,
|
|
629
|
-
emptyScreens: "Nenhuma tela neste branch. Telas de feature entram por PR, enquanto estão em desenho.",
|
|
630
|
-
emptyComponents: "O produto ainda não registrou componentes.",
|
|
631
|
-
ungrouped: "Outros",
|
|
632
|
-
toggleGroup: (e) => `Mostrar ou ocultar ${e}`,
|
|
633
|
-
resize: "Redimensionar a navegação"
|
|
634
|
-
},
|
|
635
|
-
panel: {
|
|
636
|
-
region: "Painel",
|
|
637
|
-
searchPlaceholder: "Filtrar",
|
|
638
|
-
searchLabel: "Filtrar variações e informações",
|
|
639
|
-
searchShortcut: "⌘F",
|
|
640
|
-
noMatch: (e) => `Nada neste painel para "${e}".`,
|
|
641
|
-
tabs: "Variações e informações",
|
|
642
|
-
variationsTab: "Variações",
|
|
643
|
-
infoTab: "Informações",
|
|
644
|
-
resize: "Redimensionar o painel",
|
|
645
|
-
variationsList: "Variações da tela",
|
|
646
|
-
componentVariations: "Variações do componente",
|
|
647
|
-
defaultVariation: "Padrão",
|
|
648
|
-
defaultVariationHint: "A tela sem cenário declarado, sem fixture.",
|
|
649
|
-
noVariations: "Esta tela não tem variações.",
|
|
650
|
-
noComponentVariations: "Este componente não declara variações de dados.",
|
|
651
|
-
nothingSelected: "Escolha uma tela ou um componente na navegação.",
|
|
652
|
-
persona: "Persona",
|
|
653
|
-
network: "Estado de rede",
|
|
654
|
-
theme: "Tema",
|
|
655
|
-
locale: "Idioma",
|
|
656
|
-
dataSource: "Fonte de dados",
|
|
657
|
-
fixturesOption: "Fixtures",
|
|
658
|
-
none: "—",
|
|
659
|
-
fixtureFallback: (e, t) => `A variação \`${e}\` não existe neste componente. Exibindo \`${t}\`.`,
|
|
660
|
-
context: "Contexto",
|
|
661
|
-
shortcuts: "Atalhos",
|
|
662
|
-
toggleGroup: (e) => `Mostrar ou ocultar ${e}`,
|
|
663
|
-
openComponent: (e) => `Abrir ${e} no catálogo`
|
|
664
|
-
},
|
|
665
|
-
info: {
|
|
666
|
-
screen: "Tela",
|
|
667
|
-
variation: "Variação",
|
|
668
|
-
component: "Componente",
|
|
669
|
-
name: "Nome",
|
|
670
|
-
id: "Id",
|
|
671
|
-
group: "Grupo",
|
|
672
|
-
description: "Descrição",
|
|
673
|
-
source: "Origem",
|
|
674
|
-
usedIn: "Usado em",
|
|
675
|
-
notUsed: "Nenhuma tela declara este componente.",
|
|
676
|
-
route: "Rota",
|
|
677
|
-
persona: "Persona",
|
|
678
|
-
permissions: "Permissões",
|
|
679
|
-
intent: "Intenção",
|
|
680
|
-
preconditions: "Pré-condições",
|
|
681
|
-
actions: "Ações",
|
|
682
|
-
expected: "Comportamento esperado",
|
|
683
|
-
rules: "Regras",
|
|
684
|
-
components: "Componentes usados",
|
|
685
|
-
ticket: "Ticket",
|
|
686
|
-
flow: "Fluxo",
|
|
687
|
-
controls: "Controles",
|
|
688
|
-
copyForPr: "Copiar para o PR",
|
|
689
|
-
copiedForPr: "Copiado",
|
|
690
|
-
copyPrompt: "Copie o texto para o PR:"
|
|
691
|
-
},
|
|
692
|
-
diagnostics: {
|
|
693
|
-
title: "Diagnóstico",
|
|
694
|
-
noIssues: "Nenhum problema encontrado.",
|
|
695
|
-
error: "Erro",
|
|
696
|
-
warning: "Aviso",
|
|
697
|
-
close: "Fechar diagnóstico",
|
|
698
|
-
invalidControl: (e, t, n) => `O controle \`${e}\` não tem a opção \`${t}\`. Exibindo \`${n}\`.`,
|
|
699
|
-
unknownControl: (e, t) => `A tela não tem o controle \`${e}\` (pedido \`${t}\` na URL). O parâmetro foi ignorado.`
|
|
700
|
-
},
|
|
701
|
-
pr: {
|
|
702
|
-
variations: "Variações",
|
|
703
|
-
components: "Componentes",
|
|
704
|
-
component: "Componente",
|
|
705
|
-
source: "Origem",
|
|
706
|
-
expected: "Comportamento esperado",
|
|
707
|
-
commit: (e) => `Commit \`${e}\``,
|
|
708
|
-
immutableLink: "link deste deployment",
|
|
709
|
-
noExpected: "Sem comportamento esperado declarado.",
|
|
710
|
-
empty: "—",
|
|
711
|
-
open: "Abrir a tela",
|
|
712
|
-
controls: "Controles",
|
|
713
|
-
shortcuts: "Atalhos",
|
|
714
|
-
defaultOption: "padrão"
|
|
715
|
-
},
|
|
716
|
-
shell: {
|
|
717
|
-
restoreChrome: "Mostrar o chrome (Shift+C)",
|
|
718
|
-
frameTitle: (e) => `Pré-visualização de ${e}`,
|
|
719
|
-
noRoute: "Nenhuma rota para este endereço",
|
|
720
|
-
noRouteHint: "não casa com nenhuma rota declarada. Escolha uma tela na navegação.",
|
|
721
|
-
outsideHandoff: "Fora do escopo deste handoff",
|
|
722
|
-
outsideHandoffHint: "Este link permite revisar somente os cenários, rotas e componentes listados no handoff. Escolha um item disponível na navegação.",
|
|
723
|
-
empty: "Nada para mostrar ainda",
|
|
724
|
-
emptyHint: "O produto ainda não registrou telas nem componentes."
|
|
725
|
-
}
|
|
726
|
-
}, Vn = {
|
|
727
|
-
network: {
|
|
728
|
-
success: "Success",
|
|
729
|
-
loading: "Loading",
|
|
730
|
-
empty: "Empty",
|
|
731
|
-
error: "Error",
|
|
732
|
-
slow: "Slow"
|
|
733
|
-
},
|
|
734
|
-
viewport: {
|
|
735
|
-
fit: "Fit",
|
|
736
|
-
mobile: "Mobile",
|
|
737
|
-
tablet: "Tablet",
|
|
738
|
-
desktop: "Desktop",
|
|
739
|
-
custom: "Custom"
|
|
740
|
-
},
|
|
741
|
-
topbar: {
|
|
742
|
-
region: "Design Space bar",
|
|
743
|
-
viewportGroup: "Viewport",
|
|
744
|
-
rotate: "Rotate",
|
|
745
|
-
zoomOut: "Zoom out",
|
|
746
|
-
zoomIn: "Zoom in",
|
|
747
|
-
zoomReset: "Reset zoom to 100%",
|
|
748
|
-
zoomValue: (e) => `${e}%`,
|
|
749
|
-
copyLink: "Copy link",
|
|
750
|
-
copied: "Link copied",
|
|
751
|
-
copyPrompt: "Copy the link:",
|
|
752
|
-
cleanReview: "Clean review (Shift+C)",
|
|
753
|
-
highlight: "Highlight components",
|
|
754
|
-
openFrame: "Open in new window",
|
|
755
|
-
lightMode: "Light theme",
|
|
756
|
-
darkMode: "Dark theme",
|
|
757
|
-
engineVersion: (e) => `Design Space ${e}`,
|
|
758
|
-
diagnostics: (e, t) => `Diagnostics: ${e} ${e === 1 ? "error" : "errors"}, ${t} ${t === 1 ? "warning" : "warnings"}`,
|
|
759
|
-
branchTitle: (e) => `Branch: ${e}`,
|
|
760
|
-
commitTitle: (e) => `Commit: ${e}`,
|
|
761
|
-
envTitle: (e) => `Environment: ${e}`
|
|
762
|
-
},
|
|
763
|
-
highlight: {
|
|
764
|
-
notInCatalog: (e) => `${e} · not in catalog`
|
|
765
|
-
},
|
|
766
|
-
sidebar: {
|
|
767
|
-
region: "Navigation",
|
|
768
|
-
tabs: "Screens and components",
|
|
769
|
-
screensTab: "Screens",
|
|
770
|
-
componentsTab: "Components",
|
|
771
|
-
searchPlaceholder: "Search",
|
|
772
|
-
searchLabel: "Search screens and components",
|
|
773
|
-
searchShortcut: "⌘K",
|
|
774
|
-
noMatch: (e) => `Nothing found for "${e}".`,
|
|
775
|
-
emptyScreens: "No screens on this branch. Feature screens come in through a pull request while they are being designed.",
|
|
776
|
-
emptyComponents: "The product has not registered any components yet.",
|
|
777
|
-
ungrouped: "Other",
|
|
778
|
-
toggleGroup: (e) => `Show or hide ${e}`,
|
|
779
|
-
resize: "Resize navigation"
|
|
780
|
-
},
|
|
781
|
-
panel: {
|
|
782
|
-
region: "Panel",
|
|
783
|
-
searchPlaceholder: "Filter",
|
|
784
|
-
searchLabel: "Filter variations and details",
|
|
785
|
-
searchShortcut: "⌘F",
|
|
786
|
-
noMatch: (e) => `Nothing in this panel for "${e}".`,
|
|
787
|
-
tabs: "Variations and information",
|
|
788
|
-
variationsTab: "Variations",
|
|
789
|
-
infoTab: "Information",
|
|
790
|
-
resize: "Resize panel",
|
|
791
|
-
variationsList: "Screen variations",
|
|
792
|
-
componentVariations: "Component variations",
|
|
793
|
-
defaultVariation: "Default",
|
|
794
|
-
defaultVariationHint: "The screen without a declared scenario or fixture.",
|
|
795
|
-
noVariations: "This screen has no variations.",
|
|
796
|
-
noComponentVariations: "This component does not declare data variations.",
|
|
797
|
-
nothingSelected: "Choose a screen or a component in the navigation.",
|
|
798
|
-
persona: "Persona",
|
|
799
|
-
network: "Network state",
|
|
800
|
-
theme: "Theme",
|
|
801
|
-
locale: "Language",
|
|
802
|
-
dataSource: "Data source",
|
|
803
|
-
fixturesOption: "Fixtures",
|
|
804
|
-
none: "—",
|
|
805
|
-
fixtureFallback: (e, t) => `Variation \`${e}\` does not exist for this component. Showing \`${t}\`.`,
|
|
806
|
-
context: "Context",
|
|
807
|
-
shortcuts: "Shortcuts",
|
|
808
|
-
toggleGroup: (e) => `Show or hide ${e}`,
|
|
809
|
-
openComponent: (e) => `Open ${e} in the catalog`
|
|
810
|
-
},
|
|
811
|
-
info: {
|
|
812
|
-
screen: "Screen",
|
|
813
|
-
variation: "Variation",
|
|
814
|
-
component: "Component",
|
|
815
|
-
name: "Name",
|
|
816
|
-
id: "ID",
|
|
817
|
-
group: "Group",
|
|
818
|
-
description: "Description",
|
|
819
|
-
source: "Source",
|
|
820
|
-
usedIn: "Used in",
|
|
821
|
-
notUsed: "No screen declares this component.",
|
|
822
|
-
route: "Route",
|
|
823
|
-
persona: "Persona",
|
|
824
|
-
permissions: "Permissions",
|
|
825
|
-
intent: "Intent",
|
|
826
|
-
preconditions: "Preconditions",
|
|
827
|
-
actions: "Actions",
|
|
828
|
-
expected: "Expected behavior",
|
|
829
|
-
rules: "Rules",
|
|
830
|
-
components: "Components used",
|
|
831
|
-
ticket: "Ticket",
|
|
832
|
-
flow: "Flow",
|
|
833
|
-
controls: "Controls",
|
|
834
|
-
copyForPr: "Copy for PR",
|
|
835
|
-
copiedForPr: "Copied",
|
|
836
|
-
copyPrompt: "Copy the text for the PR:"
|
|
837
|
-
},
|
|
838
|
-
diagnostics: {
|
|
839
|
-
title: "Diagnostics",
|
|
840
|
-
noIssues: "No issues found.",
|
|
841
|
-
error: "Error",
|
|
842
|
-
warning: "Warning",
|
|
843
|
-
close: "Close diagnostics",
|
|
844
|
-
invalidControl: (e, t, n) => `Control \`${e}\` has no option \`${t}\`. Showing \`${n}\`.`,
|
|
845
|
-
unknownControl: (e, t) => `This screen has no control \`${e}\` (\`${t}\` requested in the URL). The parameter was ignored.`
|
|
846
|
-
},
|
|
847
|
-
pr: {
|
|
848
|
-
variations: "Variations",
|
|
849
|
-
components: "Components",
|
|
850
|
-
component: "Component",
|
|
851
|
-
source: "Source",
|
|
852
|
-
expected: "Expected behavior",
|
|
853
|
-
commit: (e) => `Commit \`${e}\``,
|
|
854
|
-
immutableLink: "this deployment",
|
|
855
|
-
noExpected: "No expected behavior declared.",
|
|
856
|
-
empty: "—",
|
|
857
|
-
open: "Open the screen",
|
|
858
|
-
controls: "Controls",
|
|
859
|
-
shortcuts: "Shortcuts",
|
|
860
|
-
defaultOption: "default"
|
|
861
|
-
},
|
|
862
|
-
shell: {
|
|
863
|
-
restoreChrome: "Show chrome (Shift+C)",
|
|
864
|
-
frameTitle: (e) => `${e} preview`,
|
|
865
|
-
noRoute: "No route for this address",
|
|
866
|
-
noRouteHint: "does not match any declared route. Choose a screen from the navigation.",
|
|
867
|
-
outsideHandoff: "Outside this handoff scope",
|
|
868
|
-
outsideHandoffHint: "This link only allows review of the scenarios, routes, and components listed in the handoff. Choose an available item from the navigation.",
|
|
869
|
-
empty: "Nothing to show yet",
|
|
870
|
-
emptyHint: "The product has not registered any screens or components yet."
|
|
871
|
-
}
|
|
872
|
-
};
|
|
873
|
-
function Xt(e) {
|
|
874
|
-
if (!e) return oe;
|
|
875
|
-
const t = { ...oe };
|
|
876
|
-
for (const n of Object.keys(oe)) {
|
|
877
|
-
const r = e[n];
|
|
878
|
-
r && (t[n] = { ...oe[n], ...r });
|
|
879
|
-
}
|
|
880
|
-
return t;
|
|
881
|
-
}
|
|
882
|
-
const ot = Ct(oe);
|
|
883
|
-
function J() {
|
|
884
|
-
return St(ot);
|
|
885
|
-
}
|
|
886
|
-
const Kn = oe.network, Jt = [
|
|
402
|
+
const Wt = [
|
|
887
403
|
{ id: "mobile", icon: "mobile" },
|
|
888
404
|
{ id: "tablet", icon: "tablet" },
|
|
889
405
|
{ id: "desktop", icon: "desktop" },
|
|
890
406
|
{ id: "fit", icon: "fit" }
|
|
891
|
-
],
|
|
892
|
-
function
|
|
893
|
-
return t > 0 ?
|
|
407
|
+
], Pe = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
|
|
408
|
+
function Fe(e, t) {
|
|
409
|
+
return t > 0 ? Pe.find((o) => o > e) ?? Ee : [...Pe].reverse().find((o) => o < e) ?? Me;
|
|
894
410
|
}
|
|
895
|
-
function
|
|
411
|
+
function Ut({
|
|
896
412
|
productName: e,
|
|
897
413
|
viewportId: t,
|
|
898
|
-
viewport:
|
|
414
|
+
viewport: o,
|
|
899
415
|
zoom: r,
|
|
900
416
|
rotated: s,
|
|
901
417
|
highlight: a,
|
|
902
|
-
theme:
|
|
903
|
-
issues:
|
|
904
|
-
linkUrl:
|
|
905
|
-
onViewport:
|
|
906
|
-
onRotate:
|
|
907
|
-
onZoom:
|
|
908
|
-
onHighlight:
|
|
418
|
+
theme: i,
|
|
419
|
+
issues: d,
|
|
420
|
+
linkUrl: l,
|
|
421
|
+
onViewport: c,
|
|
422
|
+
onRotate: h,
|
|
423
|
+
onZoom: u,
|
|
424
|
+
onHighlight: p,
|
|
909
425
|
onCleanReview: S,
|
|
910
|
-
onOpenFrame:
|
|
911
|
-
onToggleTheme:
|
|
426
|
+
onOpenFrame: C,
|
|
427
|
+
onToggleTheme: k
|
|
912
428
|
}) {
|
|
913
|
-
const
|
|
429
|
+
const E = X(), v = E.topbar, [_, f] = z(!1), m = (t === "mobile" || t === "tablet") && !!(o.width && o.height), w = async () => {
|
|
914
430
|
try {
|
|
915
|
-
await navigator.clipboard.writeText(
|
|
431
|
+
await navigator.clipboard.writeText(l);
|
|
916
432
|
} catch {
|
|
917
|
-
window.prompt(v.copyPrompt,
|
|
433
|
+
window.prompt(v.copyPrompt, l);
|
|
918
434
|
}
|
|
919
|
-
|
|
435
|
+
f(!0), window.setTimeout(() => f(!1), 1600);
|
|
920
436
|
};
|
|
921
|
-
return /* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
437
|
+
return /* @__PURE__ */ b("header", { className: "ds-topbar", "aria-label": v.region, children: [
|
|
438
|
+
/* @__PURE__ */ b("div", { className: "ds-topbar__product", children: [
|
|
439
|
+
/* @__PURE__ */ n("span", { className: "ds-topbar__name", children: e }),
|
|
440
|
+
/* @__PURE__ */ n(
|
|
925
441
|
"a",
|
|
926
442
|
{
|
|
927
443
|
className: "ds-topbar__version",
|
|
928
|
-
href: `https://www.npmjs.com/package/${
|
|
444
|
+
href: `https://www.npmjs.com/package/${Kt}/v/${Re}`,
|
|
929
445
|
target: "_blank",
|
|
930
446
|
rel: "noreferrer",
|
|
931
|
-
children: v.engineVersion(
|
|
447
|
+
children: v.engineVersion(Re)
|
|
932
448
|
}
|
|
933
449
|
)
|
|
934
450
|
] }),
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
-
|
|
938
|
-
const
|
|
939
|
-
return /* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ b("div", { className: "ds-topbar__view", children: [
|
|
452
|
+
/* @__PURE__ */ b("div", { className: "ds-group", role: "group", "aria-label": v.viewportGroup, children: [
|
|
453
|
+
Wt.map((g) => {
|
|
454
|
+
const N = E.viewport[g.id] ?? g.id;
|
|
455
|
+
return /* @__PURE__ */ n(
|
|
940
456
|
"button",
|
|
941
457
|
{
|
|
942
458
|
type: "button",
|
|
943
459
|
className: "ds-btn ds-btn--icon",
|
|
944
|
-
"aria-pressed": t ===
|
|
945
|
-
"aria-label":
|
|
946
|
-
title:
|
|
947
|
-
onClick: () =>
|
|
948
|
-
children: /* @__PURE__ */
|
|
460
|
+
"aria-pressed": t === g.id,
|
|
461
|
+
"aria-label": N,
|
|
462
|
+
title: N,
|
|
463
|
+
onClick: () => c(g.id),
|
|
464
|
+
children: /* @__PURE__ */ n(H, { name: g.icon })
|
|
949
465
|
},
|
|
950
|
-
|
|
466
|
+
g.id
|
|
951
467
|
);
|
|
952
468
|
}),
|
|
953
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ n(
|
|
954
470
|
"button",
|
|
955
471
|
{
|
|
956
472
|
type: "button",
|
|
@@ -959,49 +475,49 @@ function en({
|
|
|
959
475
|
"aria-label": v.rotate,
|
|
960
476
|
title: v.rotate,
|
|
961
477
|
disabled: !m,
|
|
962
|
-
onClick:
|
|
963
|
-
children: /* @__PURE__ */
|
|
478
|
+
onClick: h,
|
|
479
|
+
children: /* @__PURE__ */ n(H, { name: "rotate" })
|
|
964
480
|
}
|
|
965
481
|
)
|
|
966
482
|
] }),
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ b("div", { className: "ds-group", role: "group", children: [
|
|
484
|
+
/* @__PURE__ */ n(
|
|
969
485
|
"button",
|
|
970
486
|
{
|
|
971
487
|
type: "button",
|
|
972
488
|
className: "ds-btn ds-btn--icon",
|
|
973
489
|
"aria-label": v.zoomOut,
|
|
974
490
|
title: v.zoomOut,
|
|
975
|
-
disabled: r <=
|
|
976
|
-
onClick: () =>
|
|
977
|
-
children: /* @__PURE__ */
|
|
491
|
+
disabled: r <= Me,
|
|
492
|
+
onClick: () => u(Fe(r, -1)),
|
|
493
|
+
children: /* @__PURE__ */ n(H, { name: "minus" })
|
|
978
494
|
}
|
|
979
495
|
),
|
|
980
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ n(
|
|
981
497
|
"button",
|
|
982
498
|
{
|
|
983
499
|
type: "button",
|
|
984
500
|
className: "ds-btn ds-btn--zoom",
|
|
985
501
|
"aria-label": v.zoomReset,
|
|
986
502
|
title: v.zoomReset,
|
|
987
|
-
onClick: () =>
|
|
503
|
+
onClick: () => u(he),
|
|
988
504
|
children: v.zoomValue(r)
|
|
989
505
|
}
|
|
990
506
|
),
|
|
991
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ n(
|
|
992
508
|
"button",
|
|
993
509
|
{
|
|
994
510
|
type: "button",
|
|
995
511
|
className: "ds-btn ds-btn--icon",
|
|
996
512
|
"aria-label": v.zoomIn,
|
|
997
513
|
title: v.zoomIn,
|
|
998
|
-
disabled: r >=
|
|
999
|
-
onClick: () =>
|
|
1000
|
-
children: /* @__PURE__ */
|
|
514
|
+
disabled: r >= Ee,
|
|
515
|
+
onClick: () => u(Fe(r, 1)),
|
|
516
|
+
children: /* @__PURE__ */ n(H, { name: "plus" })
|
|
1001
517
|
}
|
|
1002
518
|
)
|
|
1003
519
|
] }),
|
|
1004
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ n(
|
|
1005
521
|
"button",
|
|
1006
522
|
{
|
|
1007
523
|
type: "button",
|
|
@@ -1009,11 +525,11 @@ function en({
|
|
|
1009
525
|
"aria-pressed": a,
|
|
1010
526
|
"aria-label": v.highlight,
|
|
1011
527
|
title: v.highlight,
|
|
1012
|
-
onClick:
|
|
1013
|
-
children: /* @__PURE__ */
|
|
528
|
+
onClick: p,
|
|
529
|
+
children: /* @__PURE__ */ n(H, { name: "components" })
|
|
1014
530
|
}
|
|
1015
531
|
),
|
|
1016
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ n(
|
|
1017
533
|
"button",
|
|
1018
534
|
{
|
|
1019
535
|
type: "button",
|
|
@@ -1021,107 +537,107 @@ function en({
|
|
|
1021
537
|
"aria-label": v.cleanReview,
|
|
1022
538
|
title: v.cleanReview,
|
|
1023
539
|
onClick: S,
|
|
1024
|
-
children: /* @__PURE__ */
|
|
540
|
+
children: /* @__PURE__ */ n(H, { name: "fullscreen" })
|
|
1025
541
|
}
|
|
1026
542
|
),
|
|
1027
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ n(
|
|
1028
544
|
"button",
|
|
1029
545
|
{
|
|
1030
546
|
type: "button",
|
|
1031
547
|
className: "ds-btn ds-btn--icon",
|
|
1032
548
|
"aria-label": v.openFrame,
|
|
1033
549
|
title: v.openFrame,
|
|
1034
|
-
onClick:
|
|
1035
|
-
children: /* @__PURE__ */
|
|
550
|
+
onClick: C,
|
|
551
|
+
children: /* @__PURE__ */ n(H, { name: "external" })
|
|
1036
552
|
}
|
|
1037
553
|
)
|
|
1038
554
|
] }),
|
|
1039
|
-
/* @__PURE__ */
|
|
1040
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ b("div", { className: "ds-topbar__tools", children: [
|
|
556
|
+
/* @__PURE__ */ n(
|
|
1041
557
|
"button",
|
|
1042
558
|
{
|
|
1043
559
|
type: "button",
|
|
1044
560
|
className: "ds-btn ds-btn--icon",
|
|
1045
|
-
"aria-label":
|
|
1046
|
-
title:
|
|
561
|
+
"aria-label": _ ? v.copied : v.copyLink,
|
|
562
|
+
title: _ ? v.copied : v.copyLink,
|
|
1047
563
|
onClick: w,
|
|
1048
|
-
children: /* @__PURE__ */
|
|
564
|
+
children: /* @__PURE__ */ n(H, { name: _ ? "check" : "link" })
|
|
1049
565
|
}
|
|
1050
566
|
),
|
|
1051
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ n(
|
|
1052
568
|
"button",
|
|
1053
569
|
{
|
|
1054
570
|
type: "button",
|
|
1055
571
|
className: "ds-btn ds-btn--icon",
|
|
1056
|
-
"aria-label":
|
|
1057
|
-
title:
|
|
1058
|
-
onClick:
|
|
1059
|
-
children: /* @__PURE__ */
|
|
572
|
+
"aria-label": i === "dark" ? v.lightMode : v.darkMode,
|
|
573
|
+
title: i === "dark" ? v.lightMode : v.darkMode,
|
|
574
|
+
onClick: k,
|
|
575
|
+
children: /* @__PURE__ */ n(H, { name: i === "dark" ? "sun" : "moon" })
|
|
1060
576
|
}
|
|
1061
577
|
),
|
|
1062
|
-
|
|
578
|
+
d.length > 0 && /* @__PURE__ */ n(Ht, { issues: d })
|
|
1063
579
|
] })
|
|
1064
580
|
] });
|
|
1065
581
|
}
|
|
1066
|
-
function
|
|
1067
|
-
const t =
|
|
1068
|
-
return
|
|
1069
|
-
if (!
|
|
1070
|
-
const
|
|
1071
|
-
s.current?.contains(
|
|
1072
|
-
},
|
|
1073
|
-
|
|
582
|
+
function Ht({ issues: e }) {
|
|
583
|
+
const t = X(), [o, r] = z(!1), s = j(null), a = e.filter((l) => l.level === "error").length, i = e.length - a, d = t.topbar.diagnostics(a, i);
|
|
584
|
+
return I(() => {
|
|
585
|
+
if (!o) return;
|
|
586
|
+
const l = (h) => {
|
|
587
|
+
s.current?.contains(h.target) || r(!1);
|
|
588
|
+
}, c = (h) => {
|
|
589
|
+
h.key === "Escape" && r(!1);
|
|
1074
590
|
};
|
|
1075
|
-
return window.addEventListener("pointerdown",
|
|
1076
|
-
window.removeEventListener("pointerdown",
|
|
591
|
+
return window.addEventListener("pointerdown", l), window.addEventListener("keydown", c), () => {
|
|
592
|
+
window.removeEventListener("pointerdown", l), window.removeEventListener("keydown", c);
|
|
1077
593
|
};
|
|
1078
|
-
}, [
|
|
1079
|
-
/* @__PURE__ */
|
|
594
|
+
}, [o]), /* @__PURE__ */ b("div", { className: "ds-diagnostics", ref: s, children: [
|
|
595
|
+
/* @__PURE__ */ b(
|
|
1080
596
|
"button",
|
|
1081
597
|
{
|
|
1082
598
|
type: "button",
|
|
1083
599
|
className: "ds-btn ds-diagnostics__trigger",
|
|
1084
600
|
"data-level": a > 0 ? "error" : "warning",
|
|
1085
|
-
"aria-expanded":
|
|
1086
|
-
"aria-label":
|
|
1087
|
-
title:
|
|
1088
|
-
onClick: () => r((
|
|
601
|
+
"aria-expanded": o,
|
|
602
|
+
"aria-label": d,
|
|
603
|
+
title: d,
|
|
604
|
+
onClick: () => r((l) => !l),
|
|
1089
605
|
children: [
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ n(H, { name: "alert" }),
|
|
607
|
+
/* @__PURE__ */ n("span", { children: a > 0 ? a : i })
|
|
1092
608
|
]
|
|
1093
609
|
}
|
|
1094
610
|
),
|
|
1095
|
-
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
/* @__PURE__ */
|
|
611
|
+
o && /* @__PURE__ */ b("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
|
|
612
|
+
/* @__PURE__ */ b("div", { className: "ds-diagnostics__head", children: [
|
|
613
|
+
/* @__PURE__ */ n("strong", { children: t.diagnostics.title }),
|
|
614
|
+
/* @__PURE__ */ n("span", { className: "ds-muted", children: d })
|
|
1099
615
|
] }),
|
|
1100
|
-
/* @__PURE__ */
|
|
1101
|
-
/* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
] }, `${
|
|
616
|
+
/* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((l, c) => /* @__PURE__ */ b("li", { className: "ds-diagnostics__item", "data-level": l.level, children: [
|
|
617
|
+
/* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children: l.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
|
|
618
|
+
/* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children: l.where }),
|
|
619
|
+
/* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children: l.message })
|
|
620
|
+
] }, `${l.where}-${c}`)) })
|
|
1105
621
|
] })
|
|
1106
622
|
] });
|
|
1107
623
|
}
|
|
1108
|
-
const
|
|
1109
|
-
function
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1112
|
-
|
|
624
|
+
const qt = 16;
|
|
625
|
+
function Ze({ side: e, label: t, value: o, onChange: r, onStart: s, onEnd: a }) {
|
|
626
|
+
const i = j(void 0), d = e === "left" ? 1 : -1, l = (p) => {
|
|
627
|
+
if (p.button === 0) {
|
|
628
|
+
p.preventDefault(), i.current = { x: p.clientX, width: o };
|
|
1113
629
|
try {
|
|
1114
|
-
|
|
630
|
+
p.currentTarget.setPointerCapture(p.pointerId);
|
|
1115
631
|
} catch {
|
|
1116
632
|
}
|
|
1117
633
|
s?.();
|
|
1118
634
|
}
|
|
1119
|
-
},
|
|
1120
|
-
|
|
1121
|
-
},
|
|
1122
|
-
|
|
635
|
+
}, c = (p) => {
|
|
636
|
+
i.current && r(i.current.width + (p.clientX - i.current.x) * d);
|
|
637
|
+
}, h = () => {
|
|
638
|
+
i.current && (i.current = void 0, a?.());
|
|
1123
639
|
};
|
|
1124
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ n(
|
|
1125
641
|
"div",
|
|
1126
642
|
{
|
|
1127
643
|
className: "ds-resizer",
|
|
@@ -1129,177 +645,177 @@ function rt({ side: e, label: t, value: n, onChange: r, onStart: s, onEnd: a })
|
|
|
1129
645
|
role: "separator",
|
|
1130
646
|
"aria-orientation": "vertical",
|
|
1131
647
|
"aria-label": t,
|
|
1132
|
-
"aria-valuenow":
|
|
648
|
+
"aria-valuenow": o,
|
|
1133
649
|
tabIndex: 0,
|
|
1134
|
-
onPointerDown:
|
|
1135
|
-
onPointerMove:
|
|
1136
|
-
onPointerUp:
|
|
1137
|
-
onPointerCancel:
|
|
1138
|
-
onLostPointerCapture:
|
|
1139
|
-
onKeyDown: (
|
|
1140
|
-
if (
|
|
1141
|
-
|
|
1142
|
-
const S =
|
|
1143
|
-
r(
|
|
650
|
+
onPointerDown: l,
|
|
651
|
+
onPointerMove: c,
|
|
652
|
+
onPointerUp: h,
|
|
653
|
+
onPointerCancel: h,
|
|
654
|
+
onLostPointerCapture: h,
|
|
655
|
+
onKeyDown: (p) => {
|
|
656
|
+
if (p.key !== "ArrowLeft" && p.key !== "ArrowRight") return;
|
|
657
|
+
p.preventDefault();
|
|
658
|
+
const S = p.key === "ArrowRight" ? 1 : -1;
|
|
659
|
+
r(o + S * d * qt);
|
|
1144
660
|
}
|
|
1145
661
|
}
|
|
1146
662
|
);
|
|
1147
663
|
}
|
|
1148
|
-
function
|
|
664
|
+
function Bt({
|
|
1149
665
|
registry: e,
|
|
1150
666
|
handoff: t,
|
|
1151
|
-
activeScreen:
|
|
667
|
+
activeScreen: o,
|
|
1152
668
|
activeComponent: r,
|
|
1153
669
|
onOpenScreen: s,
|
|
1154
670
|
onOpenComponent: a,
|
|
1155
|
-
width:
|
|
1156
|
-
onResize:
|
|
1157
|
-
onResizeStart:
|
|
1158
|
-
onResizeEnd:
|
|
671
|
+
width: i,
|
|
672
|
+
onResize: d,
|
|
673
|
+
onResizeStart: l,
|
|
674
|
+
onResizeEnd: c
|
|
1159
675
|
}) {
|
|
1160
|
-
const
|
|
1161
|
-
() => r || !
|
|
676
|
+
const u = X().sidebar, [p, S] = z(""), [C, k] = z(() => /* @__PURE__ */ new Set()), E = j(null), v = e.screensFor({ handoff: t }), _ = e.componentsFor(t), f = v.length > 0, m = _.length > 0, [w, g] = z(
|
|
677
|
+
() => r || !f ? "components" : "screens"
|
|
1162
678
|
);
|
|
1163
|
-
|
|
1164
|
-
r && m ?
|
|
1165
|
-
}, [r,
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1168
|
-
const
|
|
1169
|
-
|
|
679
|
+
I(() => {
|
|
680
|
+
r && m ? g("components") : o && f && g("screens");
|
|
681
|
+
}, [r, o, m, f]);
|
|
682
|
+
const N = w;
|
|
683
|
+
I(() => {
|
|
684
|
+
const F = (D) => {
|
|
685
|
+
Gt(D) && (D.preventDefault(), E.current?.focus(), E.current?.select());
|
|
1170
686
|
};
|
|
1171
|
-
return window.addEventListener("keydown",
|
|
687
|
+
return window.addEventListener("keydown", F), () => window.removeEventListener("keydown", F);
|
|
1172
688
|
}, []);
|
|
1173
|
-
const T =
|
|
1174
|
-
() => e.searchScreens(
|
|
1175
|
-
[t,
|
|
1176
|
-
),
|
|
1177
|
-
() => e.searchComponents(
|
|
1178
|
-
[t,
|
|
1179
|
-
),
|
|
1180
|
-
const
|
|
1181
|
-
return
|
|
689
|
+
const T = $(
|
|
690
|
+
() => e.searchScreens(p, { handoff: t }),
|
|
691
|
+
[t, p, e]
|
|
692
|
+
), L = $(
|
|
693
|
+
() => e.searchComponents(p, t),
|
|
694
|
+
[t, p, e]
|
|
695
|
+
), P = $(() => Vt(L, u.ungrouped), [L, u.ungrouped]), A = $(() => ht(T), [T]), O = p.trim().length > 0, G = (F) => k((D) => {
|
|
696
|
+
const x = new Set(D);
|
|
697
|
+
return x.has(F) ? x.delete(F) : x.add(F), x;
|
|
1182
698
|
});
|
|
1183
|
-
return /* @__PURE__ */
|
|
1184
|
-
/* @__PURE__ */
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */
|
|
699
|
+
return /* @__PURE__ */ b("nav", { className: "ds-sidebar", "aria-label": u.region, style: { width: i }, children: [
|
|
700
|
+
/* @__PURE__ */ b("div", { className: "ds-search", children: [
|
|
701
|
+
/* @__PURE__ */ n(H, { name: "search", size: 14 }),
|
|
702
|
+
/* @__PURE__ */ n(
|
|
1187
703
|
"input",
|
|
1188
704
|
{
|
|
1189
|
-
ref:
|
|
705
|
+
ref: E,
|
|
1190
706
|
className: "ds-input ds-search__input",
|
|
1191
707
|
type: "search",
|
|
1192
|
-
value:
|
|
1193
|
-
placeholder:
|
|
1194
|
-
"aria-label":
|
|
1195
|
-
onChange: (
|
|
1196
|
-
onKeyDown: (
|
|
1197
|
-
|
|
708
|
+
value: p,
|
|
709
|
+
placeholder: u.searchPlaceholder,
|
|
710
|
+
"aria-label": u.searchLabel,
|
|
711
|
+
onChange: (F) => S(F.target.value),
|
|
712
|
+
onKeyDown: (F) => {
|
|
713
|
+
F.key === "Escape" && S("");
|
|
1198
714
|
}
|
|
1199
715
|
}
|
|
1200
716
|
),
|
|
1201
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: u.searchShortcut })
|
|
1202
718
|
] }),
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
/* @__PURE__ */
|
|
1205
|
-
|
|
719
|
+
/* @__PURE__ */ b("div", { className: "ds-tabs", role: "tablist", "aria-label": u.tabs, children: [
|
|
720
|
+
/* @__PURE__ */ n(
|
|
721
|
+
Ae,
|
|
1206
722
|
{
|
|
1207
|
-
selected:
|
|
1208
|
-
label:
|
|
1209
|
-
count:
|
|
1210
|
-
onSelect: () =>
|
|
723
|
+
selected: N === "screens",
|
|
724
|
+
label: u.screensTab,
|
|
725
|
+
count: O ? T.length : void 0,
|
|
726
|
+
onSelect: () => g("screens")
|
|
1211
727
|
}
|
|
1212
728
|
),
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
|
|
729
|
+
/* @__PURE__ */ n(
|
|
730
|
+
Ae,
|
|
1215
731
|
{
|
|
1216
|
-
selected:
|
|
1217
|
-
label:
|
|
1218
|
-
count:
|
|
1219
|
-
onSelect: () =>
|
|
732
|
+
selected: N === "components",
|
|
733
|
+
label: u.componentsTab,
|
|
734
|
+
count: O ? L.length : void 0,
|
|
735
|
+
onSelect: () => g("components")
|
|
1220
736
|
}
|
|
1221
737
|
)
|
|
1222
738
|
] }),
|
|
1223
|
-
/* @__PURE__ */
|
|
1224
|
-
const
|
|
1225
|
-
|
|
739
|
+
/* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: N === "screens" ? f ? T.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noMatch(p) }) : A.map((F) => {
|
|
740
|
+
const D = /* @__PURE__ */ n("ul", { className: "ds-items", children: F.screens.map((K) => /* @__PURE__ */ n(
|
|
741
|
+
jt,
|
|
1226
742
|
{
|
|
1227
|
-
screen:
|
|
1228
|
-
active:
|
|
743
|
+
screen: K,
|
|
744
|
+
active: K.id === o && !r,
|
|
1229
745
|
onOpen: s
|
|
1230
746
|
},
|
|
1231
|
-
|
|
747
|
+
K.id
|
|
1232
748
|
)) });
|
|
1233
|
-
if (
|
|
1234
|
-
const
|
|
1235
|
-
return /* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
749
|
+
if (F.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: D }, "");
|
|
750
|
+
const x = `screens:${F.name}`, R = C.has(x) && !O;
|
|
751
|
+
return /* @__PURE__ */ b("section", { className: "ds-group-section", children: [
|
|
752
|
+
/* @__PURE__ */ b(
|
|
1237
753
|
"button",
|
|
1238
754
|
{
|
|
1239
755
|
type: "button",
|
|
1240
756
|
className: "ds-group-section__head",
|
|
1241
|
-
"aria-expanded": !
|
|
1242
|
-
"aria-label":
|
|
1243
|
-
onClick: () =>
|
|
757
|
+
"aria-expanded": !R,
|
|
758
|
+
"aria-label": u.toggleGroup(F.name),
|
|
759
|
+
onClick: () => G(x),
|
|
1244
760
|
children: [
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
|
|
762
|
+
/* @__PURE__ */ n("span", { children: F.name }),
|
|
763
|
+
/* @__PURE__ */ n("span", { className: "ds-count", children: F.screens.length })
|
|
1248
764
|
]
|
|
1249
765
|
}
|
|
1250
766
|
),
|
|
1251
|
-
!
|
|
1252
|
-
] },
|
|
1253
|
-
}) : /* @__PURE__ */
|
|
1254
|
-
const
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
/* @__PURE__ */
|
|
767
|
+
!R && D
|
|
768
|
+
] }, x);
|
|
769
|
+
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children: u.emptyScreens }) : m ? L.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noMatch(p) }) : P.map(({ group: F, items: D }) => {
|
|
770
|
+
const x = C.has(F) && !O;
|
|
771
|
+
return /* @__PURE__ */ b("section", { className: "ds-group-section", children: [
|
|
772
|
+
/* @__PURE__ */ b(
|
|
1257
773
|
"button",
|
|
1258
774
|
{
|
|
1259
775
|
type: "button",
|
|
1260
776
|
className: "ds-group-section__head",
|
|
1261
|
-
"aria-expanded": !
|
|
1262
|
-
"aria-label":
|
|
1263
|
-
onClick: () => F
|
|
777
|
+
"aria-expanded": !x,
|
|
778
|
+
"aria-label": u.toggleGroup(F),
|
|
779
|
+
onClick: () => G(F),
|
|
1264
780
|
children: [
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
|
|
782
|
+
/* @__PURE__ */ n("span", { children: F }),
|
|
783
|
+
/* @__PURE__ */ n("span", { className: "ds-count", children: D.length })
|
|
1268
784
|
]
|
|
1269
785
|
}
|
|
1270
786
|
),
|
|
1271
|
-
!
|
|
787
|
+
!x && /* @__PURE__ */ n("ul", { className: "ds-items", children: D.map((R) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
1272
788
|
"button",
|
|
1273
789
|
{
|
|
1274
790
|
type: "button",
|
|
1275
791
|
className: "ds-item",
|
|
1276
|
-
"aria-current":
|
|
1277
|
-
onClick: () => a(
|
|
1278
|
-
children: /* @__PURE__ */
|
|
792
|
+
"aria-current": R.id === r ? "true" : void 0,
|
|
793
|
+
onClick: () => a(R.id),
|
|
794
|
+
children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: R.name })
|
|
1279
795
|
}
|
|
1280
|
-
) },
|
|
1281
|
-
] },
|
|
1282
|
-
}) : /* @__PURE__ */
|
|
1283
|
-
/* @__PURE__ */
|
|
1284
|
-
|
|
796
|
+
) }, R.id)) })
|
|
797
|
+
] }, F);
|
|
798
|
+
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children: u.emptyComponents }) }),
|
|
799
|
+
/* @__PURE__ */ n(
|
|
800
|
+
Ze,
|
|
1285
801
|
{
|
|
1286
802
|
side: "left",
|
|
1287
|
-
label:
|
|
1288
|
-
value:
|
|
1289
|
-
onChange:
|
|
1290
|
-
onStart:
|
|
1291
|
-
onEnd:
|
|
803
|
+
label: u.resize,
|
|
804
|
+
value: i,
|
|
805
|
+
onChange: d,
|
|
806
|
+
onStart: l,
|
|
807
|
+
onEnd: c
|
|
1292
808
|
}
|
|
1293
809
|
)
|
|
1294
810
|
] });
|
|
1295
811
|
}
|
|
1296
|
-
function
|
|
812
|
+
function Ae({
|
|
1297
813
|
selected: e,
|
|
1298
814
|
label: t,
|
|
1299
|
-
count:
|
|
815
|
+
count: o,
|
|
1300
816
|
onSelect: r
|
|
1301
817
|
}) {
|
|
1302
|
-
return /* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ b(
|
|
1303
819
|
"button",
|
|
1304
820
|
{
|
|
1305
821
|
type: "button",
|
|
@@ -1309,211 +825,87 @@ function Ve({
|
|
|
1309
825
|
tabIndex: e ? 0 : -1,
|
|
1310
826
|
onClick: r,
|
|
1311
827
|
children: [
|
|
1312
|
-
/* @__PURE__ */
|
|
1313
|
-
|
|
828
|
+
/* @__PURE__ */ n("span", { children: t }),
|
|
829
|
+
o !== void 0 && /* @__PURE__ */ n("span", { className: "ds-count", children: o })
|
|
1314
830
|
]
|
|
1315
831
|
}
|
|
1316
832
|
);
|
|
1317
833
|
}
|
|
1318
|
-
function
|
|
834
|
+
function jt({
|
|
1319
835
|
screen: e,
|
|
1320
836
|
active: t,
|
|
1321
|
-
onOpen:
|
|
837
|
+
onOpen: o
|
|
1322
838
|
}) {
|
|
1323
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ b(
|
|
1324
840
|
"button",
|
|
1325
841
|
{
|
|
1326
842
|
type: "button",
|
|
1327
843
|
className: "ds-item",
|
|
1328
844
|
"aria-current": t ? "true" : void 0,
|
|
1329
|
-
onClick: () =>
|
|
845
|
+
onClick: () => o(e.id),
|
|
1330
846
|
children: [
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
e.variations.length > 1 && /* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ n("span", { className: "ds-item__title", children: e.name }),
|
|
848
|
+
e.variations.length > 1 && /* @__PURE__ */ n("span", { className: "ds-count", children: e.variations.length })
|
|
1333
849
|
]
|
|
1334
850
|
}
|
|
1335
851
|
) });
|
|
1336
852
|
}
|
|
1337
|
-
function
|
|
1338
|
-
const
|
|
853
|
+
function Vt(e, t) {
|
|
854
|
+
const o = /* @__PURE__ */ new Map();
|
|
1339
855
|
for (const r of e) {
|
|
1340
|
-
const s = r.group?.trim() || t, a =
|
|
1341
|
-
a.push(r),
|
|
856
|
+
const s = r.group?.trim() || t, a = o.get(s) ?? [];
|
|
857
|
+
a.push(r), o.set(s, a);
|
|
1342
858
|
}
|
|
1343
|
-
return [...
|
|
859
|
+
return [...o].map(([r, s]) => ({ group: r, items: s }));
|
|
1344
860
|
}
|
|
1345
|
-
function
|
|
861
|
+
function Gt(e) {
|
|
1346
862
|
return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "k";
|
|
1347
863
|
}
|
|
1348
|
-
function
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
const c = s.pr, l = [`## ${e.name}`, ""];
|
|
1357
|
-
e.description && l.push(e.description, ""), l.push(`\`${e.route.path}\``, "");
|
|
1358
|
-
const h = r.deploymentUrl ? `https://${r.deploymentUrl}` : void 0, p = r.shortCommit ? c.commit(r.shortCommit) : void 0;
|
|
1359
|
-
if (l.push(`### ${c.variations}`, ""), t.length === 0) {
|
|
1360
|
-
const u = new URL(e.href, r.origin);
|
|
1361
|
-
$e(u.searchParams, a), l.push(`- [${s.panel.defaultVariation}](${u.toString()})`);
|
|
1362
|
-
}
|
|
1363
|
-
for (const u of t) {
|
|
1364
|
-
const i = me(u, { origin: r.origin, overrides: a });
|
|
1365
|
-
let f = `- [${st(u.title)}](${i})`;
|
|
1366
|
-
if (h) {
|
|
1367
|
-
const S = me(u, { origin: h, overrides: a });
|
|
1368
|
-
f += ` · [${p ?? c.immutableLink}](${S})`;
|
|
1369
|
-
} else p && (f += ` · ${p}`);
|
|
1370
|
-
l.push(f);
|
|
1371
|
-
}
|
|
1372
|
-
if (l.push(""), n.length > 0) {
|
|
1373
|
-
l.push(`### ${c.components}`, ""), l.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
|
|
1374
|
-
for (const u of n) {
|
|
1375
|
-
const i = u.source ? `\`${ge(u.source)}\`` : c.empty;
|
|
1376
|
-
l.push(`| ${ge(u.name)} (\`${u.id}\`) | ${i} |`);
|
|
1377
|
-
}
|
|
1378
|
-
l.push("");
|
|
1379
|
-
}
|
|
1380
|
-
l.push(`### ${c.expected}`, ""), t.length === 0 && l.push(`**${s.panel.defaultVariation}**`, "", c.noExpected, "");
|
|
1381
|
-
for (const u of t) {
|
|
1382
|
-
if (l.push(`**${u.title}**`, ""), u.expected?.length)
|
|
1383
|
-
for (const i of u.expected) l.push(`- ${i}`);
|
|
1384
|
-
else
|
|
1385
|
-
l.push(c.noExpected);
|
|
1386
|
-
l.push("");
|
|
1387
|
-
}
|
|
1388
|
-
return `${l.join(`
|
|
1389
|
-
`).trimEnd()}
|
|
1390
|
-
`;
|
|
1391
|
-
}
|
|
1392
|
-
function ge(e) {
|
|
1393
|
-
return e.replace(/\|/g, "\\|").replace(/\n/g, " ");
|
|
1394
|
-
}
|
|
1395
|
-
function st(e) {
|
|
1396
|
-
return e.replace(/([[\]])/g, "\\$1");
|
|
1397
|
-
}
|
|
1398
|
-
function ln({
|
|
1399
|
-
flow: e,
|
|
1400
|
-
registry: t,
|
|
1401
|
-
open: n,
|
|
1402
|
-
deploy: r,
|
|
1403
|
-
labels: s,
|
|
1404
|
-
overrides: a
|
|
1405
|
-
}) {
|
|
1406
|
-
const c = s.pr, l = [`## ${e.name}`, ""], h = r.deploymentUrl ? `https://${r.deploymentUrl}` : void 0, p = r.shortCommit ? c.commit(r.shortCommit) : void 0, u = (i, f) => {
|
|
1407
|
-
if (n && n.screen.id === i.id) {
|
|
1408
|
-
const $ = new URL(n.location.path || "/", f), _ = new URLSearchParams(n.location.search);
|
|
1409
|
-
for (const v of Et) _.delete(v);
|
|
1410
|
-
for (const [v, L] of _) $.searchParams.append(v, L);
|
|
1411
|
-
return $e($.searchParams, a), $.toString();
|
|
1412
|
-
}
|
|
1413
|
-
const S = i.variations[0];
|
|
1414
|
-
if (S) return me(S, { origin: f, overrides: a });
|
|
1415
|
-
const N = new URL(i.href, f);
|
|
1416
|
-
return $e(N.searchParams, a), N.toString();
|
|
1417
|
-
};
|
|
1418
|
-
for (const i of e.screens) {
|
|
1419
|
-
l.push(`### ${i.name}`, ""), i.description && l.push(i.description, "");
|
|
1420
|
-
let f = `\`${i.route.path}\` · [${c.open}](${u(i, r.origin)})`;
|
|
1421
|
-
if (h ? f += ` · [${p ?? c.immutableLink}](${u(i, h)})` : p && (f += ` · ${p}`), l.push(f, ""), i.controls.length > 0) {
|
|
1422
|
-
l.push(`**${c.controls}**`, "");
|
|
1423
|
-
for (const v of i.controls) {
|
|
1424
|
-
l.push(`- ${le(v.title)} (\`${v.id}\`)`);
|
|
1425
|
-
for (const L of v.controls) {
|
|
1426
|
-
const b = Se(L), m = L.options.map(
|
|
1427
|
-
(w) => w.value === b ? `${le(w.label)} (\`${w.value}\`, ${c.defaultOption})` : `${le(w.label)} (\`${w.value}\`)`
|
|
1428
|
-
).join(" · ");
|
|
1429
|
-
l.push(` - ${le(L.label)} (\`c.${L.id}\`): ${m}`);
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
l.push("");
|
|
1433
|
-
}
|
|
1434
|
-
if (i.variations.length > 0) {
|
|
1435
|
-
l.push(`**${c.shortcuts}**`, "");
|
|
1436
|
-
for (const v of i.variations)
|
|
1437
|
-
l.push(
|
|
1438
|
-
`- [${st(v.title)}](${me(v, { origin: r.origin, overrides: a })})`
|
|
1439
|
-
);
|
|
1440
|
-
l.push("");
|
|
1441
|
-
}
|
|
1442
|
-
l.push(`**${c.expected}**`, "");
|
|
1443
|
-
const S = n?.screen.id === i.id ? n.variation : void 0, N = S?.expected?.length ? S.expected : i.route.expected, $ = i.variations.filter(
|
|
1444
|
-
(v) => v.expected?.length && v.id !== S?.id
|
|
1445
|
-
);
|
|
1446
|
-
if (!N?.length && $.length === 0 && l.push(c.noExpected, ""), N?.length) {
|
|
1447
|
-
for (const v of N) l.push(`- ${v}`);
|
|
1448
|
-
l.push("");
|
|
1449
|
-
}
|
|
1450
|
-
for (const v of $) {
|
|
1451
|
-
l.push(`*${v.title}*`, "");
|
|
1452
|
-
for (const L of v.expected ?? []) l.push(`- ${L}`);
|
|
1453
|
-
l.push("");
|
|
1454
|
-
}
|
|
1455
|
-
const _ = t.componentsOfScreen(i);
|
|
1456
|
-
if (_.length > 0) {
|
|
1457
|
-
l.push(`**${c.components}**`, ""), l.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
|
|
1458
|
-
for (const v of _) {
|
|
1459
|
-
const L = v.source ? `\`${ge(v.source)}\`` : c.empty;
|
|
1460
|
-
l.push(`| ${ge(v.name)} (\`${v.id}\`) | ${L} |`);
|
|
1461
|
-
}
|
|
1462
|
-
l.push("");
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1465
|
-
return `${l.join(`
|
|
1466
|
-
`).trimEnd()}
|
|
1467
|
-
`;
|
|
1468
|
-
}
|
|
1469
|
-
function le(e) {
|
|
1470
|
-
return e.replace(/([*_[\]`])/g, "\\$1");
|
|
1471
|
-
}
|
|
1472
|
-
function dn(e) {
|
|
1473
|
-
const { tab: t, onTab: n, width: r, onResize: s, onResizeStart: a, onResizeEnd: c } = e, l = J().panel, [h, p] = D(""), u = q(null), i = q(null), [f, S] = D(!1), [N, $] = D(() => /* @__PURE__ */ new Set()), _ = (L) => $((b) => {
|
|
1474
|
-
const m = new Set(b);
|
|
1475
|
-
return m.has(L) ? m.delete(L) : m.add(L), m;
|
|
1476
|
-
}), v = h.trim().length > 0;
|
|
1477
|
-
return V(() => {
|
|
1478
|
-
const L = (b) => {
|
|
1479
|
-
pn(b) && (b.preventDefault(), u.current?.focus(), u.current?.select());
|
|
864
|
+
function Zt(e) {
|
|
865
|
+
const { tab: t, onTab: o, width: r, onResize: s, onResizeStart: a, onResizeEnd: i } = e, d = X().panel, [l, c] = z(""), h = j(null), u = j(null), [p, S] = z(!1), [C, k] = z(() => /* @__PURE__ */ new Set()), E = (_) => k((f) => {
|
|
866
|
+
const m = new Set(f);
|
|
867
|
+
return m.has(_) ? m.delete(_) : m.add(_), m;
|
|
868
|
+
}), v = l.trim().length > 0;
|
|
869
|
+
return I(() => {
|
|
870
|
+
const _ = (f) => {
|
|
871
|
+
Xt(f) && (f.preventDefault(), h.current?.focus(), h.current?.select());
|
|
1480
872
|
};
|
|
1481
|
-
return window.addEventListener("keydown",
|
|
1482
|
-
}, []),
|
|
1483
|
-
S(
|
|
1484
|
-
}), /* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
|
|
873
|
+
return window.addEventListener("keydown", _), () => window.removeEventListener("keydown", _);
|
|
874
|
+
}, []), Ie(() => {
|
|
875
|
+
S(Jt(u.current, l));
|
|
876
|
+
}), /* @__PURE__ */ b("aside", { className: "ds-panel", "aria-label": d.region, style: { width: r }, children: [
|
|
877
|
+
/* @__PURE__ */ n(
|
|
878
|
+
Ze,
|
|
1487
879
|
{
|
|
1488
880
|
side: "right",
|
|
1489
|
-
label:
|
|
881
|
+
label: d.resize,
|
|
1490
882
|
value: r,
|
|
1491
883
|
onChange: s,
|
|
1492
884
|
onStart: a,
|
|
1493
|
-
onEnd:
|
|
885
|
+
onEnd: i
|
|
1494
886
|
}
|
|
1495
887
|
),
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
/* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ b("div", { className: "ds-search", children: [
|
|
889
|
+
/* @__PURE__ */ n(H, { name: "search", size: 14 }),
|
|
890
|
+
/* @__PURE__ */ n(
|
|
1499
891
|
"input",
|
|
1500
892
|
{
|
|
1501
|
-
ref:
|
|
893
|
+
ref: h,
|
|
1502
894
|
className: "ds-input ds-search__input",
|
|
1503
895
|
type: "search",
|
|
1504
|
-
value:
|
|
1505
|
-
placeholder:
|
|
1506
|
-
"aria-label":
|
|
1507
|
-
onChange: (
|
|
1508
|
-
onKeyDown: (
|
|
1509
|
-
|
|
896
|
+
value: l,
|
|
897
|
+
placeholder: d.searchPlaceholder,
|
|
898
|
+
"aria-label": d.searchLabel,
|
|
899
|
+
onChange: (_) => c(_.target.value),
|
|
900
|
+
onKeyDown: (_) => {
|
|
901
|
+
_.key === "Escape" && c("");
|
|
1510
902
|
}
|
|
1511
903
|
}
|
|
1512
904
|
),
|
|
1513
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: d.searchShortcut })
|
|
1514
906
|
] }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1516
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ b("div", { className: "ds-tabs", role: "tablist", "aria-label": d.tabs, children: [
|
|
908
|
+
/* @__PURE__ */ n(
|
|
1517
909
|
"button",
|
|
1518
910
|
{
|
|
1519
911
|
type: "button",
|
|
@@ -1521,11 +913,11 @@ function dn(e) {
|
|
|
1521
913
|
className: "ds-tab",
|
|
1522
914
|
"aria-selected": t === "variations",
|
|
1523
915
|
tabIndex: t === "variations" ? 0 : -1,
|
|
1524
|
-
onClick: () =>
|
|
1525
|
-
children:
|
|
916
|
+
onClick: () => o("variations"),
|
|
917
|
+
children: d.variationsTab
|
|
1526
918
|
}
|
|
1527
919
|
),
|
|
1528
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ n(
|
|
1529
921
|
"button",
|
|
1530
922
|
{
|
|
1531
923
|
type: "button",
|
|
@@ -1533,399 +925,371 @@ function dn(e) {
|
|
|
1533
925
|
className: "ds-tab",
|
|
1534
926
|
"aria-selected": t === "info",
|
|
1535
927
|
tabIndex: t === "info" ? 0 : -1,
|
|
1536
|
-
onClick: () =>
|
|
1537
|
-
children:
|
|
928
|
+
onClick: () => o("info"),
|
|
929
|
+
children: d.infoTab
|
|
1538
930
|
}
|
|
1539
931
|
)
|
|
1540
932
|
] }),
|
|
1541
|
-
/* @__PURE__ */
|
|
1542
|
-
t === "variations" ? /* @__PURE__ */
|
|
1543
|
-
|
|
933
|
+
/* @__PURE__ */ b("div", { className: "ds-panel__body", role: "tabpanel", ref: u, children: [
|
|
934
|
+
t === "variations" ? /* @__PURE__ */ n(Yt, { ...e, collapsed: C, onToggle: E, filtering: v }) : /* @__PURE__ */ n(Qt, { ...e }),
|
|
935
|
+
p && /* @__PURE__ */ n("p", { className: "ds-empty", children: d.noMatch(l) })
|
|
1544
936
|
] })
|
|
1545
937
|
] });
|
|
1546
938
|
}
|
|
1547
|
-
function
|
|
939
|
+
function Yt({
|
|
1548
940
|
registry: e,
|
|
1549
941
|
controls: t,
|
|
1550
|
-
screen:
|
|
942
|
+
screen: o,
|
|
1551
943
|
variation: r,
|
|
1552
944
|
component: s,
|
|
1553
945
|
componentFixture: a,
|
|
1554
|
-
onOpenScenario:
|
|
1555
|
-
onOpenComponent:
|
|
1556
|
-
onChange:
|
|
946
|
+
onOpenScenario: i,
|
|
947
|
+
onOpenComponent: d,
|
|
948
|
+
onChange: l
|
|
1557
949
|
}) {
|
|
1558
|
-
const
|
|
950
|
+
const c = X(), h = c.panel;
|
|
1559
951
|
if (s) {
|
|
1560
|
-
const
|
|
1561
|
-
if (
|
|
952
|
+
const f = s.fixtures ?? [];
|
|
953
|
+
if (f.length === 0) return /* @__PURE__ */ n("p", { className: "ds-empty", children: h.noComponentVariations });
|
|
1562
954
|
const m = a.fixture;
|
|
1563
|
-
return /* @__PURE__ */
|
|
1564
|
-
a.didFallback && a.requestedId && m && /* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
|
|
955
|
+
return /* @__PURE__ */ b("div", { className: "ds-vcards", children: [
|
|
956
|
+
a.didFallback && a.requestedId && m && /* @__PURE__ */ n("p", { className: "ds-notice", children: h.fixtureFallback(a.requestedId, m.id) }),
|
|
957
|
+
/* @__PURE__ */ n(ae, { title: s.name, hint: m?.description, children: /* @__PURE__ */ n(
|
|
958
|
+
J,
|
|
1567
959
|
{
|
|
1568
|
-
label:
|
|
960
|
+
label: h.componentVariations,
|
|
1569
961
|
value: m?.id ?? "",
|
|
1570
|
-
options:
|
|
1571
|
-
onChange: (w) =>
|
|
962
|
+
options: f.map((w) => ({ value: w.id, label: w.label })),
|
|
963
|
+
onChange: (w) => l({ fixture: w })
|
|
1572
964
|
}
|
|
1573
965
|
) })
|
|
1574
966
|
] });
|
|
1575
967
|
}
|
|
1576
|
-
if (!
|
|
1577
|
-
const
|
|
1578
|
-
return /* @__PURE__ */
|
|
1579
|
-
/* @__PURE__ */
|
|
1580
|
-
/* @__PURE__ */
|
|
1581
|
-
|
|
968
|
+
if (!o) return /* @__PURE__ */ n("p", { className: "ds-empty", children: h.nothingSelected });
|
|
969
|
+
const u = o.variations, p = e.product, S = p.theme?.modes ?? [], C = p.theme?.locales ?? [], k = p.dataSources?.adapters ?? [], E = t.screenControls ?? {}, v = r && ut(r, E) ? r : void 0, _ = (f, m) => l({ screenControls: { ...E, [f]: m } });
|
|
970
|
+
return /* @__PURE__ */ b("div", { className: "ds-vcards", children: [
|
|
971
|
+
/* @__PURE__ */ b(ae, { title: h.context, children: [
|
|
972
|
+
/* @__PURE__ */ n(
|
|
973
|
+
J,
|
|
1582
974
|
{
|
|
1583
|
-
label:
|
|
975
|
+
label: h.persona,
|
|
1584
976
|
value: t.persona ?? "",
|
|
1585
977
|
options: [
|
|
1586
978
|
// Com persona padrão, "nenhuma" não é uma situação possível.
|
|
1587
|
-
...e.defaultPersona ? [] : [{ value: "", label:
|
|
1588
|
-
...
|
|
979
|
+
...e.defaultPersona ? [] : [{ value: "", label: h.none }],
|
|
980
|
+
...p.personas.map((f) => ({ value: f.id, label: f.name }))
|
|
1589
981
|
],
|
|
1590
|
-
onChange: (
|
|
982
|
+
onChange: (f) => l({ persona: f || void 0 })
|
|
1591
983
|
}
|
|
1592
984
|
),
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
|
|
985
|
+
/* @__PURE__ */ n(
|
|
986
|
+
J,
|
|
1595
987
|
{
|
|
1596
|
-
label:
|
|
988
|
+
label: h.network,
|
|
1597
989
|
value: t.network,
|
|
1598
|
-
options:
|
|
1599
|
-
onChange: (
|
|
990
|
+
options: He.map((f) => ({ value: f, label: c.network[f] })),
|
|
991
|
+
onChange: (f) => l({ network: f })
|
|
1600
992
|
}
|
|
1601
993
|
),
|
|
1602
|
-
S.length > 1 && /* @__PURE__ */
|
|
1603
|
-
|
|
994
|
+
S.length > 1 && /* @__PURE__ */ n(
|
|
995
|
+
J,
|
|
1604
996
|
{
|
|
1605
|
-
label:
|
|
997
|
+
label: h.theme,
|
|
1606
998
|
value: t.themeMode ?? S[0],
|
|
1607
|
-
options: S.map((
|
|
1608
|
-
onChange: (
|
|
999
|
+
options: S.map((f) => ({ value: f, label: f })),
|
|
1000
|
+
onChange: (f) => l({ themeMode: f })
|
|
1609
1001
|
}
|
|
1610
1002
|
),
|
|
1611
|
-
|
|
1612
|
-
|
|
1003
|
+
C.length > 1 && /* @__PURE__ */ n(
|
|
1004
|
+
J,
|
|
1613
1005
|
{
|
|
1614
|
-
label:
|
|
1615
|
-
value: t.locale ??
|
|
1616
|
-
options:
|
|
1617
|
-
onChange: (
|
|
1006
|
+
label: h.locale,
|
|
1007
|
+
value: t.locale ?? C[0],
|
|
1008
|
+
options: C.map((f) => ({ value: f, label: f })),
|
|
1009
|
+
onChange: (f) => l({ locale: f })
|
|
1618
1010
|
}
|
|
1619
1011
|
),
|
|
1620
|
-
|
|
1621
|
-
|
|
1012
|
+
k.length > 0 && /* @__PURE__ */ n(
|
|
1013
|
+
J,
|
|
1622
1014
|
{
|
|
1623
|
-
label:
|
|
1015
|
+
label: h.dataSource,
|
|
1624
1016
|
value: t.dataSource ?? "fixtures",
|
|
1625
1017
|
options: [
|
|
1626
|
-
{ value: "fixtures", label:
|
|
1627
|
-
|
|
1018
|
+
{ value: "fixtures", label: h.fixturesOption },
|
|
1019
|
+
...k.map((f) => ({ value: f.id, label: f.label }))
|
|
1628
1020
|
],
|
|
1629
|
-
onChange: (
|
|
1021
|
+
onChange: (f) => l({ dataSource: f })
|
|
1630
1022
|
}
|
|
1631
1023
|
)
|
|
1632
1024
|
] }),
|
|
1633
|
-
|
|
1634
|
-
const m = e.component(
|
|
1635
|
-
return /* @__PURE__ */
|
|
1636
|
-
|
|
1025
|
+
o.controls.map((f) => {
|
|
1026
|
+
const m = e.component(f.component);
|
|
1027
|
+
return /* @__PURE__ */ n(
|
|
1028
|
+
ae,
|
|
1637
1029
|
{
|
|
1638
|
-
title:
|
|
1639
|
-
hint:
|
|
1640
|
-
link: m ? { label:
|
|
1641
|
-
children:
|
|
1642
|
-
|
|
1030
|
+
title: f.title,
|
|
1031
|
+
hint: f.note,
|
|
1032
|
+
link: m ? { label: h.openComponent(m.name), onOpen: () => d(m.id) } : void 0,
|
|
1033
|
+
children: f.controls.map((w) => /* @__PURE__ */ n(
|
|
1034
|
+
J,
|
|
1643
1035
|
{
|
|
1644
1036
|
label: w.label,
|
|
1645
1037
|
hint: w.description,
|
|
1646
|
-
value:
|
|
1038
|
+
value: E[w.id] ?? We(w),
|
|
1647
1039
|
options: w.options ?? [],
|
|
1648
|
-
onChange: (
|
|
1040
|
+
onChange: (g) => _(w.id, g)
|
|
1649
1041
|
},
|
|
1650
1042
|
w.id
|
|
1651
1043
|
))
|
|
1652
1044
|
},
|
|
1653
|
-
|
|
1045
|
+
f.id
|
|
1654
1046
|
);
|
|
1655
1047
|
}),
|
|
1656
|
-
|
|
1048
|
+
u.length > 0 && /* @__PURE__ */ n(ae, { title: h.shortcuts, children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": h.variationsList, children: u.map((f) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
|
|
1657
1049
|
"button",
|
|
1658
1050
|
{
|
|
1659
1051
|
type: "button",
|
|
1660
1052
|
className: "ds-item",
|
|
1661
|
-
title:
|
|
1662
|
-
"aria-current": v?.id ===
|
|
1663
|
-
onClick: () =>
|
|
1664
|
-
children: /* @__PURE__ */
|
|
1053
|
+
title: f.intent,
|
|
1054
|
+
"aria-current": v?.id === f.id ? "true" : void 0,
|
|
1055
|
+
onClick: () => i(f.id),
|
|
1056
|
+
children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: f.title })
|
|
1665
1057
|
}
|
|
1666
|
-
) },
|
|
1058
|
+
) }, f.id)) }) })
|
|
1667
1059
|
] });
|
|
1668
1060
|
}
|
|
1669
|
-
function
|
|
1061
|
+
function ae({
|
|
1670
1062
|
title: e,
|
|
1671
1063
|
hint: t,
|
|
1672
|
-
link:
|
|
1064
|
+
link: o,
|
|
1673
1065
|
children: r
|
|
1674
1066
|
}) {
|
|
1675
|
-
return /* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
|
|
1067
|
+
return /* @__PURE__ */ b("section", { className: "ds-vcard", "data-ds-filter-group": !0, children: [
|
|
1068
|
+
/* @__PURE__ */ b("header", { className: "ds-vcard__head", title: t ? `${e} — ${t}` : e, children: [
|
|
1069
|
+
/* @__PURE__ */ n("h3", { className: "ds-vcard__title ds-section__title", "data-ds-filter-title": !0, children: e }),
|
|
1070
|
+
o && /* @__PURE__ */ n(
|
|
1679
1071
|
"button",
|
|
1680
1072
|
{
|
|
1681
1073
|
type: "button",
|
|
1682
1074
|
className: "ds-btn ds-btn--icon ds-vcard__link",
|
|
1683
|
-
"aria-label":
|
|
1684
|
-
title:
|
|
1685
|
-
onClick:
|
|
1686
|
-
children: /* @__PURE__ */
|
|
1075
|
+
"aria-label": o.label,
|
|
1076
|
+
title: o.label,
|
|
1077
|
+
onClick: o.onOpen,
|
|
1078
|
+
children: /* @__PURE__ */ n(H, { name: "arrow-up-right", size: 14 })
|
|
1687
1079
|
}
|
|
1688
1080
|
)
|
|
1689
1081
|
] }),
|
|
1690
|
-
/* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ n("div", { className: "ds-vcard__body", children: r })
|
|
1691
1083
|
] });
|
|
1692
1084
|
}
|
|
1693
|
-
function
|
|
1085
|
+
function J({
|
|
1694
1086
|
label: e,
|
|
1695
1087
|
hint: t,
|
|
1696
|
-
value:
|
|
1088
|
+
value: o,
|
|
1697
1089
|
options: r,
|
|
1698
1090
|
onChange: s
|
|
1699
1091
|
}) {
|
|
1700
|
-
return /* @__PURE__ */
|
|
1701
|
-
/* @__PURE__ */
|
|
1702
|
-
/* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ b("label", { className: "ds-vcard__field", "data-ds-filter": !0, title: t ? `${e} — ${t}` : e, children: [
|
|
1093
|
+
/* @__PURE__ */ n("span", { className: "ds-visually-hidden", children: e }),
|
|
1094
|
+
/* @__PURE__ */ n("select", { className: "ds-select", value: o, onChange: (a) => s(a.target.value), children: r.map((a) => /* @__PURE__ */ n("option", { value: a.value, children: a.label }, a.value)) })
|
|
1703
1095
|
] });
|
|
1704
1096
|
}
|
|
1705
|
-
function
|
|
1097
|
+
function Qt({
|
|
1706
1098
|
registry: e,
|
|
1707
1099
|
controls: t,
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
onOpenComponent: h,
|
|
1715
|
-
onOpenScreen: p
|
|
1100
|
+
screen: o,
|
|
1101
|
+
variation: r,
|
|
1102
|
+
component: s,
|
|
1103
|
+
onOpenScenario: a,
|
|
1104
|
+
onOpenComponent: i,
|
|
1105
|
+
onOpenScreen: d
|
|
1716
1106
|
}) {
|
|
1717
|
-
const
|
|
1718
|
-
if (
|
|
1719
|
-
const
|
|
1720
|
-
return /* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
/* @__PURE__ */
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1107
|
+
const l = X(), c = l.info;
|
|
1108
|
+
if (s) {
|
|
1109
|
+
const k = e.usagesOf(s.id, { handoff: t.handoff });
|
|
1110
|
+
return /* @__PURE__ */ b("div", { className: "ds-info", children: [
|
|
1111
|
+
/* @__PURE__ */ b(te, { title: c.component, children: [
|
|
1112
|
+
/* @__PURE__ */ n(U, { term: c.name, children: s.name }),
|
|
1113
|
+
/* @__PURE__ */ n(U, { term: c.id, children: /* @__PURE__ */ n("code", { children: s.id }) }),
|
|
1114
|
+
s.group && /* @__PURE__ */ n(U, { term: c.group, children: s.group }),
|
|
1115
|
+
s.description && /* @__PURE__ */ n(U, { term: c.description, children: s.description }),
|
|
1116
|
+
s.source && /* @__PURE__ */ n(U, { term: c.source, children: /* @__PURE__ */ n("code", { children: s.source }) })
|
|
1727
1117
|
] }),
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
const
|
|
1730
|
-
return /* @__PURE__ */
|
|
1731
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ n(te, { title: c.usedIn, children: k.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: c.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: k.map((E) => {
|
|
1119
|
+
const v = E.variations.find((_) => _.components?.includes(s.id)) ?? E.variations[0];
|
|
1120
|
+
return /* @__PURE__ */ b("li", { "data-ds-filter": !0, children: [
|
|
1121
|
+
/* @__PURE__ */ n(
|
|
1732
1122
|
"button",
|
|
1733
1123
|
{
|
|
1734
1124
|
type: "button",
|
|
1735
1125
|
className: "ds-link",
|
|
1736
|
-
onClick: () =>
|
|
1737
|
-
children:
|
|
1126
|
+
onClick: () => v ? a(v.id) : d?.(E.id),
|
|
1127
|
+
children: E.name
|
|
1738
1128
|
}
|
|
1739
1129
|
),
|
|
1740
|
-
/* @__PURE__ */
|
|
1741
|
-
] },
|
|
1130
|
+
/* @__PURE__ */ n("code", { className: "ds-muted", children: E.id })
|
|
1131
|
+
] }, E.id);
|
|
1742
1132
|
}) }) })
|
|
1743
1133
|
] });
|
|
1744
1134
|
}
|
|
1745
|
-
if (!
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
}) : cn({
|
|
1755
|
-
screen: s,
|
|
1756
|
-
variations: s.variations,
|
|
1757
|
-
components: e.componentsOfScreen(s),
|
|
1758
|
-
deploy: n,
|
|
1759
|
-
labels: u,
|
|
1760
|
-
overrides: b
|
|
1761
|
-
});
|
|
1762
|
-
try {
|
|
1763
|
-
await navigator.clipboard.writeText(k);
|
|
1764
|
-
} catch {
|
|
1765
|
-
window.prompt(i.copyPrompt, k);
|
|
1766
|
-
}
|
|
1767
|
-
S(!0), window.setTimeout(() => S(!1), 1600);
|
|
1768
|
-
};
|
|
1769
|
-
return /* @__PURE__ */ y("div", { className: "ds-info", children: [
|
|
1770
|
-
/* @__PURE__ */ y(ne, { title: i.screen, children: [
|
|
1771
|
-
/* @__PURE__ */ o(W, { term: i.name, children: s.name }),
|
|
1772
|
-
/* @__PURE__ */ o(W, { term: i.route, children: /* @__PURE__ */ o("code", { children: s.route.path }) }),
|
|
1773
|
-
s.group && /* @__PURE__ */ o(W, { term: i.flow, children: s.group }),
|
|
1774
|
-
s.description && /* @__PURE__ */ o(W, { term: i.description, children: s.description }),
|
|
1775
|
-
/* @__PURE__ */ o(ue, { term: i.expected, items: L })
|
|
1135
|
+
if (!o) return /* @__PURE__ */ n("p", { className: "ds-empty", children: l.panel.nothingSelected });
|
|
1136
|
+
const h = r ? e.componentsOfScreen(o, r) : e.componentsOfScreen(o), u = e.persona(t.persona ?? r?.persona), p = e.rulesOf(r), S = t.screenControls ?? {}, C = r?.expected?.length ? r.expected : o.route.expected;
|
|
1137
|
+
return /* @__PURE__ */ b("div", { className: "ds-info", children: [
|
|
1138
|
+
/* @__PURE__ */ b(te, { title: c.screen, children: [
|
|
1139
|
+
/* @__PURE__ */ n(U, { term: c.name, children: o.name }),
|
|
1140
|
+
/* @__PURE__ */ n(U, { term: c.route, children: /* @__PURE__ */ n("code", { children: o.route.path }) }),
|
|
1141
|
+
o.group && /* @__PURE__ */ n(U, { term: c.flow, children: o.group }),
|
|
1142
|
+
o.description && /* @__PURE__ */ n(U, { term: c.description, children: o.description }),
|
|
1143
|
+
/* @__PURE__ */ n(ie, { term: c.expected, items: C })
|
|
1776
1144
|
] }),
|
|
1777
|
-
|
|
1778
|
-
(
|
|
1779
|
-
const
|
|
1780
|
-
return /* @__PURE__ */
|
|
1781
|
-
|
|
1145
|
+
o.controls.length > 0 && /* @__PURE__ */ n(te, { title: c.controls, children: o.controls.flatMap(
|
|
1146
|
+
(k) => k.controls.map((E) => {
|
|
1147
|
+
const v = S[E.id] ?? We(E), _ = E.options.find((f) => f.value === v);
|
|
1148
|
+
return /* @__PURE__ */ b(U, { term: E.label, children: [
|
|
1149
|
+
_?.label ?? v,
|
|
1782
1150
|
" ",
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
] }, `${
|
|
1151
|
+
/* @__PURE__ */ n("code", { children: `c.${E.id}=${v}` })
|
|
1152
|
+
] }, `${k.id}/${E.id}`);
|
|
1785
1153
|
})
|
|
1786
1154
|
) }),
|
|
1787
|
-
|
|
1788
|
-
/* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
/* @__PURE__ */
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1795
|
-
|
|
1155
|
+
r && /* @__PURE__ */ b(te, { title: c.variation, children: [
|
|
1156
|
+
/* @__PURE__ */ n(U, { term: c.name, children: r.title }),
|
|
1157
|
+
/* @__PURE__ */ n(U, { term: c.id, children: /* @__PURE__ */ n("code", { children: r.id }) }),
|
|
1158
|
+
u && /* @__PURE__ */ n(U, { term: c.persona, children: u.name }),
|
|
1159
|
+
r.intent && /* @__PURE__ */ n(U, { term: c.intent, children: r.intent }),
|
|
1160
|
+
/* @__PURE__ */ n(ie, { term: c.preconditions, items: r.preconditions }),
|
|
1161
|
+
/* @__PURE__ */ n(ie, { term: c.actions, items: r.actions }),
|
|
1162
|
+
/* @__PURE__ */ n(ie, { term: c.rules, items: p.map((k) => k.statement) }),
|
|
1163
|
+
r.ticket && /* @__PURE__ */ n(U, { term: c.ticket, children: /* @__PURE__ */ n("code", { children: r.ticket }) })
|
|
1796
1164
|
] }),
|
|
1797
|
-
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
|
|
1800
|
-
] },
|
|
1801
|
-
/* @__PURE__ */ y("button", { type: "button", className: "ds-btn ds-btn--block", onClick: m, children: [
|
|
1802
|
-
/* @__PURE__ */ o(H, { name: f ? "check" : "copy", size: 14 }),
|
|
1803
|
-
/* @__PURE__ */ o("span", { children: f ? i.copiedForPr : i.copyForPr })
|
|
1804
|
-
] })
|
|
1165
|
+
h.length > 0 && /* @__PURE__ */ n(te, { title: c.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: h.map((k) => /* @__PURE__ */ b("li", { "data-ds-filter": !0, children: [
|
|
1166
|
+
/* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => i(k.id), children: k.name }),
|
|
1167
|
+
k.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: k.source })
|
|
1168
|
+
] }, k.id)) }) })
|
|
1805
1169
|
] });
|
|
1806
1170
|
}
|
|
1807
|
-
function
|
|
1808
|
-
return /* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1171
|
+
function te({ title: e, children: t }) {
|
|
1172
|
+
return /* @__PURE__ */ b("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
|
|
1173
|
+
/* @__PURE__ */ n("h2", { className: "ds-section__title", children: e }),
|
|
1174
|
+
/* @__PURE__ */ n("div", { className: "ds-defs", children: t })
|
|
1811
1175
|
] });
|
|
1812
1176
|
}
|
|
1813
|
-
function
|
|
1814
|
-
return /* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1177
|
+
function U({ term: e, children: t }) {
|
|
1178
|
+
return /* @__PURE__ */ b("dl", { className: "ds-def", "data-ds-filter": !0, children: [
|
|
1179
|
+
/* @__PURE__ */ n("dt", { children: e }),
|
|
1180
|
+
/* @__PURE__ */ n("dd", { children: t })
|
|
1817
1181
|
] });
|
|
1818
1182
|
}
|
|
1819
|
-
function
|
|
1820
|
-
return t?.length ? /* @__PURE__ */
|
|
1821
|
-
/* @__PURE__ */
|
|
1822
|
-
/* @__PURE__ */
|
|
1183
|
+
function ie({ term: e, items: t }) {
|
|
1184
|
+
return t?.length ? /* @__PURE__ */ b("dl", { className: "ds-def", "data-ds-filter": !0, children: [
|
|
1185
|
+
/* @__PURE__ */ n("dt", { children: e }),
|
|
1186
|
+
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("ul", { className: "ds-list", children: t.map((o) => /* @__PURE__ */ n("li", { children: o }, o)) }) })
|
|
1823
1187
|
] }) : null;
|
|
1824
1188
|
}
|
|
1825
|
-
function
|
|
1189
|
+
function Xt(e) {
|
|
1826
1190
|
return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f";
|
|
1827
1191
|
}
|
|
1828
|
-
function
|
|
1192
|
+
function Jt(e, t) {
|
|
1829
1193
|
if (!e) return !1;
|
|
1830
|
-
const
|
|
1194
|
+
const o = fe(t), r = [...e.querySelectorAll("[data-ds-filter]")];
|
|
1831
1195
|
for (const s of r)
|
|
1832
|
-
s.hidden =
|
|
1196
|
+
s.hidden = o.length > 0 && !fe(s.textContent ?? "").includes(o);
|
|
1833
1197
|
for (const s of e.querySelectorAll("[data-ds-filter-group]")) {
|
|
1834
|
-
const a = [...s.querySelectorAll("[data-ds-filter]")],
|
|
1198
|
+
const a = [...s.querySelectorAll("[data-ds-filter]")], i = fe(
|
|
1835
1199
|
s.querySelector("[data-ds-filter-title], .ds-section__title")?.textContent ?? ""
|
|
1836
1200
|
);
|
|
1837
|
-
if (
|
|
1201
|
+
if (o.length > 0 && i.includes(o)) {
|
|
1838
1202
|
s.hidden = !1;
|
|
1839
|
-
for (const
|
|
1203
|
+
for (const d of a) d.hidden = !1;
|
|
1840
1204
|
continue;
|
|
1841
1205
|
}
|
|
1842
|
-
s.hidden =
|
|
1206
|
+
s.hidden = o.length > 0 && a.every((d) => d.hidden);
|
|
1843
1207
|
}
|
|
1844
|
-
return
|
|
1208
|
+
return o.length > 0 && r.length > 0 && r.every((s) => s.hidden);
|
|
1845
1209
|
}
|
|
1846
|
-
const
|
|
1847
|
-
function
|
|
1210
|
+
const en = 24;
|
|
1211
|
+
function tn({
|
|
1848
1212
|
location: e,
|
|
1849
1213
|
viewport: t,
|
|
1850
|
-
zoom:
|
|
1214
|
+
zoom: o,
|
|
1851
1215
|
title: r,
|
|
1852
1216
|
resizing: s,
|
|
1853
1217
|
onFrameNavigate: a,
|
|
1854
|
-
onShortcut:
|
|
1855
|
-
onEffectiveZoom:
|
|
1856
|
-
frameRef:
|
|
1218
|
+
onShortcut: i,
|
|
1219
|
+
onEffectiveZoom: d,
|
|
1220
|
+
frameRef: l
|
|
1857
1221
|
}) {
|
|
1858
|
-
const
|
|
1859
|
-
(
|
|
1860
|
-
|
|
1861
|
-
const
|
|
1222
|
+
const c = j(null), h = nn(c), u = re(e.path, e.search), [p] = z(u), S = j(u), C = j(u), k = typeof window > "u" ? "" : window.location.origin, E = W(
|
|
1223
|
+
(P) => {
|
|
1224
|
+
C.current = P;
|
|
1225
|
+
const A = l.current?.contentWindow;
|
|
1862
1226
|
try {
|
|
1863
|
-
|
|
1227
|
+
A?.location.replace(new URL(P, k).toString());
|
|
1864
1228
|
} catch {
|
|
1865
|
-
|
|
1229
|
+
l.current && (l.current.src = P);
|
|
1866
1230
|
}
|
|
1867
1231
|
},
|
|
1868
|
-
[
|
|
1232
|
+
[l, k]
|
|
1869
1233
|
);
|
|
1870
|
-
|
|
1871
|
-
if (
|
|
1872
|
-
const
|
|
1873
|
-
S.current =
|
|
1874
|
-
}, [
|
|
1875
|
-
const
|
|
1876
|
-
const
|
|
1877
|
-
origin:
|
|
1878
|
-
source:
|
|
1234
|
+
I(() => {
|
|
1235
|
+
if (u === S.current) return;
|
|
1236
|
+
const P = S.current;
|
|
1237
|
+
S.current = u, _e(P) !== _e(u) ? E(u) : ne(l.current?.contentWindow, { ds: 1, type: "location", url: u }, k);
|
|
1238
|
+
}, [u, l, E, k]), I(() => {
|
|
1239
|
+
const P = (A) => {
|
|
1240
|
+
const O = qe(A, {
|
|
1241
|
+
origin: k,
|
|
1242
|
+
source: l.current?.contentWindow
|
|
1879
1243
|
});
|
|
1880
|
-
if (
|
|
1881
|
-
switch (
|
|
1244
|
+
if (O)
|
|
1245
|
+
switch (O.type) {
|
|
1882
1246
|
case "ready": {
|
|
1883
|
-
if (
|
|
1884
|
-
if (
|
|
1885
|
-
|
|
1886
|
-
|
|
1247
|
+
if (O.url === S.current) return;
|
|
1248
|
+
if (O.url === C.current) {
|
|
1249
|
+
ne(
|
|
1250
|
+
l.current?.contentWindow,
|
|
1887
1251
|
{ ds: 1, type: "location", url: S.current },
|
|
1888
|
-
|
|
1252
|
+
k
|
|
1889
1253
|
);
|
|
1890
1254
|
return;
|
|
1891
1255
|
}
|
|
1892
|
-
S.current =
|
|
1256
|
+
S.current = O.url, C.current = O.url, a(O.url, !0);
|
|
1893
1257
|
return;
|
|
1894
1258
|
}
|
|
1895
1259
|
case "navigate":
|
|
1896
|
-
S.current =
|
|
1260
|
+
S.current = O.url, a(O.url, O.replace);
|
|
1897
1261
|
return;
|
|
1898
1262
|
case "shortcut":
|
|
1899
|
-
|
|
1263
|
+
i(O.key);
|
|
1900
1264
|
return;
|
|
1901
1265
|
default:
|
|
1902
1266
|
return;
|
|
1903
1267
|
}
|
|
1904
1268
|
};
|
|
1905
|
-
return window.addEventListener("message",
|
|
1906
|
-
}, [
|
|
1907
|
-
const v = !!t.width,
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
}, [
|
|
1911
|
-
const T = t.width ??
|
|
1912
|
-
return /* @__PURE__ */
|
|
1269
|
+
return window.addEventListener("message", P), () => window.removeEventListener("message", P);
|
|
1270
|
+
}, [l, a, i, k]);
|
|
1271
|
+
const v = !!t.width, _ = v ? en : 0, f = Math.max(0, h.width - _ * 2), m = Math.max(0, h.height - _ * 2), w = !t.width || f === 0 || t.width <= f, g = o === 100 && !w ? Math.max(10, Math.floor(f / t.width * 100)) : o, N = g / 100;
|
|
1272
|
+
I(() => {
|
|
1273
|
+
d?.(g);
|
|
1274
|
+
}, [g, d]);
|
|
1275
|
+
const T = t.width ?? f / N, L = t.height ?? m / N;
|
|
1276
|
+
return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: c, "data-fit": v ? void 0 : "true", children: /* @__PURE__ */ n(
|
|
1913
1277
|
"div",
|
|
1914
1278
|
{
|
|
1915
1279
|
className: "ds-canvas__box",
|
|
1916
|
-
style: { width: Math.floor(T *
|
|
1917
|
-
children: /* @__PURE__ */
|
|
1280
|
+
style: { width: Math.floor(T * N), height: Math.floor(L * N) },
|
|
1281
|
+
children: /* @__PURE__ */ n(
|
|
1918
1282
|
"iframe",
|
|
1919
1283
|
{
|
|
1920
|
-
ref:
|
|
1921
|
-
[
|
|
1284
|
+
ref: l,
|
|
1285
|
+
[St]: "",
|
|
1922
1286
|
className: "ds-frame",
|
|
1923
|
-
src:
|
|
1287
|
+
src: p,
|
|
1924
1288
|
title: r,
|
|
1925
1289
|
style: {
|
|
1926
1290
|
width: Math.floor(T),
|
|
1927
|
-
height: Math.floor(
|
|
1928
|
-
transform:
|
|
1291
|
+
height: Math.floor(L),
|
|
1292
|
+
transform: N === 1 ? void 0 : `scale(${N})`,
|
|
1929
1293
|
pointerEvents: s ? "none" : void 0
|
|
1930
1294
|
}
|
|
1931
1295
|
}
|
|
@@ -1933,15 +1297,15 @@ function wn({
|
|
|
1933
1297
|
}
|
|
1934
1298
|
) });
|
|
1935
1299
|
}
|
|
1936
|
-
function
|
|
1937
|
-
const [t,
|
|
1938
|
-
return
|
|
1300
|
+
function nn(e) {
|
|
1301
|
+
const [t, o] = z({ width: 0, height: 0 });
|
|
1302
|
+
return Ie(() => {
|
|
1939
1303
|
const r = e.current;
|
|
1940
1304
|
if (!r) return;
|
|
1941
1305
|
const s = () => {
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
(
|
|
1306
|
+
const i = r.clientWidth, d = r.clientHeight;
|
|
1307
|
+
o(
|
|
1308
|
+
(l) => l.width === i && l.height === d ? l : { width: i, height: d }
|
|
1945
1309
|
);
|
|
1946
1310
|
};
|
|
1947
1311
|
if (s(), typeof ResizeObserver > "u")
|
|
@@ -1950,260 +1314,260 @@ function gn(e) {
|
|
|
1950
1314
|
return a.observe(r), () => a.disconnect();
|
|
1951
1315
|
}, [e]), t;
|
|
1952
1316
|
}
|
|
1953
|
-
const
|
|
1954
|
-
class
|
|
1317
|
+
const Ye = 2500;
|
|
1318
|
+
class Qe extends Error {
|
|
1955
1319
|
constructor(t) {
|
|
1956
1320
|
super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
|
|
1957
1321
|
}
|
|
1958
1322
|
}
|
|
1959
|
-
function
|
|
1323
|
+
function ve(e) {
|
|
1960
1324
|
if (e)
|
|
1961
1325
|
return typeof e.data == "function" ? e.data() : e.data;
|
|
1962
1326
|
}
|
|
1963
|
-
const
|
|
1327
|
+
const ke = {
|
|
1964
1328
|
id: "fixtures",
|
|
1965
1329
|
label: "Fixtures",
|
|
1966
|
-
load: async ({ scenario: e, fixture: t, network:
|
|
1967
|
-
switch (
|
|
1330
|
+
load: async ({ scenario: e, fixture: t, network: o }) => {
|
|
1331
|
+
switch (o) {
|
|
1968
1332
|
case "empty":
|
|
1969
1333
|
return null;
|
|
1970
1334
|
case "error":
|
|
1971
|
-
throw new
|
|
1335
|
+
throw new Qe(e.id);
|
|
1972
1336
|
case "loading":
|
|
1973
1337
|
return new Promise(() => {
|
|
1974
1338
|
});
|
|
1975
1339
|
case "slow":
|
|
1976
|
-
return await
|
|
1340
|
+
return await on(Ye), ve(t);
|
|
1977
1341
|
default:
|
|
1978
|
-
return
|
|
1342
|
+
return ve(t);
|
|
1979
1343
|
}
|
|
1980
1344
|
}
|
|
1981
1345
|
};
|
|
1982
|
-
function
|
|
1983
|
-
const { id: t, label:
|
|
1346
|
+
function _n(e) {
|
|
1347
|
+
const { id: t, label: o, baseUrl: r, path: s, init: a, fallbackToFixture: i = !0 } = e;
|
|
1984
1348
|
return {
|
|
1985
1349
|
id: t,
|
|
1986
|
-
label:
|
|
1987
|
-
load: async (
|
|
1988
|
-
const
|
|
1350
|
+
label: o,
|
|
1351
|
+
load: async (d) => {
|
|
1352
|
+
const l = new URL(s ? s(d) : d.scenario.route, r);
|
|
1989
1353
|
try {
|
|
1990
|
-
const
|
|
1991
|
-
if (!
|
|
1992
|
-
return await
|
|
1993
|
-
} catch (
|
|
1994
|
-
if (
|
|
1995
|
-
throw new Error(`Adapter "${t}" falhou em ${
|
|
1354
|
+
const c = await fetch(l, a);
|
|
1355
|
+
if (!c.ok) throw new Error(`${c.status} ${c.statusText}`);
|
|
1356
|
+
return await c.json();
|
|
1357
|
+
} catch (c) {
|
|
1358
|
+
if (i) return ve(d.fixture);
|
|
1359
|
+
throw new Error(`Adapter "${t}" falhou em ${l.toString()}`, { cause: c });
|
|
1996
1360
|
}
|
|
1997
1361
|
}
|
|
1998
1362
|
};
|
|
1999
1363
|
}
|
|
2000
|
-
function
|
|
1364
|
+
function on(e) {
|
|
2001
1365
|
return new Promise((t) => setTimeout(t, e));
|
|
2002
1366
|
}
|
|
2003
|
-
function
|
|
2004
|
-
const { scenario: t, fixture:
|
|
1367
|
+
function rn(e) {
|
|
1368
|
+
const { scenario: t, fixture: o, network: r, adapter: s } = e, [a, i] = z({
|
|
2005
1369
|
data: void 0,
|
|
2006
1370
|
isLoading: !!t || r === "loading" || r === "slow",
|
|
2007
1371
|
error: void 0
|
|
2008
1372
|
});
|
|
2009
|
-
return
|
|
1373
|
+
return I(() => {
|
|
2010
1374
|
if (!t)
|
|
2011
1375
|
switch (r) {
|
|
2012
1376
|
case "loading":
|
|
2013
|
-
|
|
1377
|
+
i({ data: void 0, isLoading: !0, error: void 0 });
|
|
2014
1378
|
return;
|
|
2015
1379
|
case "empty":
|
|
2016
|
-
|
|
1380
|
+
i({ data: null, isLoading: !1, error: void 0 });
|
|
2017
1381
|
return;
|
|
2018
1382
|
case "error":
|
|
2019
|
-
|
|
1383
|
+
i({
|
|
2020
1384
|
data: void 0,
|
|
2021
1385
|
isLoading: !1,
|
|
2022
|
-
error: new
|
|
1386
|
+
error: new Qe(e.screen ?? "—")
|
|
2023
1387
|
});
|
|
2024
1388
|
return;
|
|
2025
1389
|
case "slow": {
|
|
2026
|
-
|
|
2027
|
-
const
|
|
2028
|
-
() =>
|
|
2029
|
-
|
|
1390
|
+
i({ data: void 0, isLoading: !0, error: void 0 });
|
|
1391
|
+
const c = setTimeout(
|
|
1392
|
+
() => i({ data: void 0, isLoading: !1, error: void 0 }),
|
|
1393
|
+
Ye
|
|
2030
1394
|
);
|
|
2031
|
-
return () => clearTimeout(
|
|
1395
|
+
return () => clearTimeout(c);
|
|
2032
1396
|
}
|
|
2033
1397
|
default:
|
|
2034
|
-
|
|
1398
|
+
i({ data: void 0, isLoading: !1, error: void 0 });
|
|
2035
1399
|
return;
|
|
2036
1400
|
}
|
|
2037
|
-
let
|
|
2038
|
-
|
|
2039
|
-
const
|
|
2040
|
-
return Promise.resolve(
|
|
2041
|
-
|
|
2042
|
-
}).catch((
|
|
2043
|
-
|
|
1401
|
+
let d = !0;
|
|
1402
|
+
i({ data: void 0, isLoading: !0, error: void 0 });
|
|
1403
|
+
const l = s ?? ke;
|
|
1404
|
+
return Promise.resolve(l.load({ scenario: t, fixture: o, network: r })).then((c) => {
|
|
1405
|
+
d && i({ data: c, isLoading: !1, error: void 0 });
|
|
1406
|
+
}).catch((c) => {
|
|
1407
|
+
d && i({
|
|
2044
1408
|
data: void 0,
|
|
2045
1409
|
isLoading: !1,
|
|
2046
|
-
error:
|
|
1410
|
+
error: c instanceof Error ? c : new Error(String(c))
|
|
2047
1411
|
});
|
|
2048
1412
|
}), () => {
|
|
2049
|
-
|
|
1413
|
+
d = !1;
|
|
2050
1414
|
};
|
|
2051
|
-
}, [t,
|
|
1415
|
+
}, [t, o, r, s, e.screen]), a;
|
|
2052
1416
|
}
|
|
2053
|
-
function
|
|
2054
|
-
return /* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
1417
|
+
function Oe({ title: e, children: t }) {
|
|
1418
|
+
return /* @__PURE__ */ b("div", { className: "ds-stage-empty", children: [
|
|
1419
|
+
/* @__PURE__ */ n("h2", { className: "ds-stage-empty__title", children: e }),
|
|
2056
1420
|
t
|
|
2057
1421
|
] });
|
|
2058
1422
|
}
|
|
2059
|
-
const
|
|
2060
|
-
class
|
|
1423
|
+
const sn = /* @__PURE__ */ Symbol.for("react.memo"), an = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
1424
|
+
class Xe extends Error {
|
|
2061
1425
|
}
|
|
2062
|
-
function
|
|
1426
|
+
function Je(e) {
|
|
2063
1427
|
const t = [];
|
|
2064
|
-
let
|
|
2065
|
-
for (;
|
|
2066
|
-
t.push(
|
|
2067
|
-
const r =
|
|
2068
|
-
if (r ===
|
|
2069
|
-
else if (r ===
|
|
1428
|
+
let o = e;
|
|
1429
|
+
for (; o && (typeof o == "function" || typeof o == "object") && !t.includes(o); ) {
|
|
1430
|
+
t.push(o);
|
|
1431
|
+
const r = o.$$typeof;
|
|
1432
|
+
if (r === sn) o = o.type;
|
|
1433
|
+
else if (r === an) o = o.render;
|
|
2070
1434
|
else break;
|
|
2071
1435
|
}
|
|
2072
1436
|
return t;
|
|
2073
1437
|
}
|
|
2074
|
-
function
|
|
1438
|
+
function cn(e) {
|
|
2075
1439
|
const t = /* @__PURE__ */ new Map();
|
|
2076
|
-
for (const
|
|
2077
|
-
const r = Array.isArray(
|
|
1440
|
+
for (const o of e) {
|
|
1441
|
+
const r = Array.isArray(o.implementation) ? o.implementation : o.implementation === void 0 ? [] : [o.implementation];
|
|
2078
1442
|
for (const s of r)
|
|
2079
|
-
for (const a of
|
|
2080
|
-
const
|
|
2081
|
-
|
|
1443
|
+
for (const a of Je(s)) {
|
|
1444
|
+
const i = t.get(a) ?? [];
|
|
1445
|
+
i.includes(o.id) || i.push(o.id), t.set(a, i);
|
|
2082
1446
|
}
|
|
2083
1447
|
}
|
|
2084
1448
|
return t;
|
|
2085
1449
|
}
|
|
2086
|
-
function
|
|
2087
|
-
const
|
|
1450
|
+
function ln(e, t) {
|
|
1451
|
+
const o = [];
|
|
2088
1452
|
for (const r of [e.type, e.elementType])
|
|
2089
|
-
for (const s of
|
|
2090
|
-
for (const a of t.get(s) ?? [])
|
|
2091
|
-
return
|
|
1453
|
+
for (const s of Je(r))
|
|
1454
|
+
for (const a of t.get(s) ?? []) o.includes(a) || o.push(a);
|
|
1455
|
+
return o;
|
|
2092
1456
|
}
|
|
2093
|
-
function
|
|
1457
|
+
function dn(e) {
|
|
2094
1458
|
return !!e && e.nodeType === 1;
|
|
2095
1459
|
}
|
|
2096
|
-
function
|
|
2097
|
-
return typeof e.type == "string" &&
|
|
1460
|
+
function et(e) {
|
|
1461
|
+
return typeof e.type == "string" && dn(e.stateNode);
|
|
2098
1462
|
}
|
|
2099
|
-
function
|
|
1463
|
+
function ye(e) {
|
|
2100
1464
|
if (!e || typeof e != "object" || !("child" in e) || !("sibling" in e) || !("stateNode" in e))
|
|
2101
|
-
throw new
|
|
1465
|
+
throw new Xe("fiber sem child, sibling ou stateNode");
|
|
2102
1466
|
}
|
|
2103
|
-
function
|
|
2104
|
-
for (let
|
|
2105
|
-
|
|
1467
|
+
function tt(e, t) {
|
|
1468
|
+
for (let o = e.child; o; o = o.sibling)
|
|
1469
|
+
ye(o), et(o) ? t.push(o.stateNode) : tt(o, t);
|
|
2106
1470
|
}
|
|
2107
|
-
function
|
|
2108
|
-
const
|
|
2109
|
-
if (t.size === 0) return
|
|
1471
|
+
function hn(e, t) {
|
|
1472
|
+
const o = [];
|
|
1473
|
+
if (t.size === 0) return o;
|
|
2110
1474
|
for (const r of e) {
|
|
2111
1475
|
const s = r?.current;
|
|
2112
|
-
if (
|
|
1476
|
+
if (ye(s), s.stateNode !== r) throw new Xe("raiz sem `current.stateNode` de volta");
|
|
2113
1477
|
const a = s.child ? [s.child] : [];
|
|
2114
1478
|
for (; a.length > 0; ) {
|
|
2115
|
-
const
|
|
2116
|
-
if (
|
|
2117
|
-
const
|
|
2118
|
-
if (
|
|
2119
|
-
const
|
|
2120
|
-
|
|
1479
|
+
const i = a.pop();
|
|
1480
|
+
if (ye(i), i.sibling && a.push(i.sibling), i.child && a.push(i.child), et(i)) continue;
|
|
1481
|
+
const d = ln(i, t);
|
|
1482
|
+
if (d.length === 0) continue;
|
|
1483
|
+
const l = [];
|
|
1484
|
+
tt(i, l), l.length > 0 && o.push({ ids: d, elements: l });
|
|
2121
1485
|
}
|
|
2122
1486
|
}
|
|
2123
|
-
return
|
|
1487
|
+
return o;
|
|
2124
1488
|
}
|
|
2125
|
-
let
|
|
2126
|
-
function
|
|
2127
|
-
|
|
1489
|
+
let $e = !1;
|
|
1490
|
+
function ze(e) {
|
|
1491
|
+
$e || ($e = !0, console.warn(`[design-space] ${e}`));
|
|
2128
1492
|
}
|
|
2129
|
-
function
|
|
1493
|
+
function un(e, t) {
|
|
2130
1494
|
if (e.size === 0) return [];
|
|
2131
|
-
const
|
|
2132
|
-
if (!
|
|
2133
|
-
return
|
|
2134
|
-
`Destacar componentes: o React carregou antes do gancho do DevTools, então só a marcação \`${
|
|
1495
|
+
const o = Et(t);
|
|
1496
|
+
if (!o)
|
|
1497
|
+
return ze(
|
|
1498
|
+
`Destacar componentes: o React carregou antes do gancho do DevTools, então só a marcação \`${de}\` é contornada. Importe "@brucesantos/design-space/devtools-hook" na primeira linha do ponto de entrada, antes de qualquer import de React.`
|
|
2135
1499
|
), [];
|
|
2136
1500
|
try {
|
|
2137
|
-
return
|
|
1501
|
+
return hn(o, e);
|
|
2138
1502
|
} catch (r) {
|
|
2139
|
-
return
|
|
2140
|
-
"Destacar componentes: a árvore do React não tem a forma esperada, então só a marcação " + `\`${
|
|
1503
|
+
return ze(
|
|
1504
|
+
"Destacar componentes: a árvore do React não tem a forma esperada, então só a marcação " + `\`${de}\` é contornada. ${r instanceof Error ? r.message : ""}`.trim()
|
|
2141
1505
|
), [];
|
|
2142
1506
|
}
|
|
2143
1507
|
}
|
|
2144
|
-
function
|
|
2145
|
-
const
|
|
2146
|
-
e.querySelectorAll(`[${
|
|
2147
|
-
r.push({ ids: [
|
|
1508
|
+
function mn(e, t = /* @__PURE__ */ new Map()) {
|
|
1509
|
+
const o = e.defaultView ?? window, r = un(t, o);
|
|
1510
|
+
e.querySelectorAll(`[${de}]`).forEach((d) => {
|
|
1511
|
+
r.push({ ids: [d.getAttribute(de) ?? ""], elements: [d] });
|
|
2148
1512
|
});
|
|
2149
1513
|
const s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
2150
|
-
for (const
|
|
2151
|
-
const
|
|
2152
|
-
if (
|
|
2153
|
-
const
|
|
2154
|
-
for (const
|
|
2155
|
-
a.set(
|
|
1514
|
+
for (const d of r) {
|
|
1515
|
+
const l = d.elements.filter((u) => u.isConnected && !u.closest(".ds-highlight"));
|
|
1516
|
+
if (l.length === 0) continue;
|
|
1517
|
+
const c = l.map((u) => (s.has(u) || s.set(u, s.size), s.get(u))).join(","), h = a.get(c) ?? { ids: [], elements: l };
|
|
1518
|
+
for (const u of d.ids) h.ids.includes(u) || h.ids.push(u);
|
|
1519
|
+
a.set(c, h);
|
|
2156
1520
|
}
|
|
2157
|
-
const
|
|
2158
|
-
for (const [
|
|
2159
|
-
let
|
|
2160
|
-
for (const
|
|
2161
|
-
const
|
|
2162
|
-
|
|
1521
|
+
const i = [];
|
|
1522
|
+
for (const [d, { ids: l, elements: c }] of a) {
|
|
1523
|
+
let h = 1 / 0, u = 1 / 0, p = -1 / 0, S = -1 / 0;
|
|
1524
|
+
for (const C of c) {
|
|
1525
|
+
const k = C.getBoundingClientRect();
|
|
1526
|
+
k.width === 0 && k.height === 0 || (h = Math.min(h, k.top), u = Math.min(u, k.left), p = Math.max(p, k.right), S = Math.max(S, k.bottom));
|
|
2163
1527
|
}
|
|
2164
|
-
|
|
1528
|
+
h !== 1 / 0 && i.push({ key: d, ids: l, top: h, left: u, width: p - u, height: S - h });
|
|
2165
1529
|
}
|
|
2166
|
-
return
|
|
1530
|
+
return i;
|
|
2167
1531
|
}
|
|
2168
|
-
function
|
|
2169
|
-
return e.length === t.length && e.every((
|
|
1532
|
+
function fn(e, t) {
|
|
1533
|
+
return e.length === t.length && e.every((o, r) => {
|
|
2170
1534
|
const s = t[r];
|
|
2171
|
-
return
|
|
1535
|
+
return o.key === s.key && o.top === s.top && o.left === s.left && o.width === s.width && o.height === s.height && o.ids.join(`
|
|
2172
1536
|
`) === s.ids.join(`
|
|
2173
1537
|
`);
|
|
2174
1538
|
});
|
|
2175
1539
|
}
|
|
2176
|
-
const
|
|
2177
|
-
function
|
|
2178
|
-
const t =
|
|
2179
|
-
return
|
|
2180
|
-
|
|
1540
|
+
const pn = 16;
|
|
1541
|
+
function wn({ registry: e }) {
|
|
1542
|
+
const t = X(), o = $(() => cn(e.componentsFor()), [e]), [r, s] = z([]);
|
|
1543
|
+
return I(() => {
|
|
1544
|
+
Lt(window);
|
|
2181
1545
|
let a = 0;
|
|
2182
|
-
const
|
|
1546
|
+
const i = () => {
|
|
2183
1547
|
a || (a = window.requestAnimationFrame(() => {
|
|
2184
1548
|
a = 0;
|
|
2185
|
-
const
|
|
2186
|
-
s((
|
|
1549
|
+
const c = mn(document, o);
|
|
1550
|
+
s((h) => fn(h, c) ? h : c);
|
|
2187
1551
|
}));
|
|
2188
|
-
},
|
|
2189
|
-
|
|
1552
|
+
}, d = new MutationObserver((c) => {
|
|
1553
|
+
c.some((u) => !(u.target instanceof Element ? u.target : u.target.parentElement)?.closest(".ds-highlight")) && i();
|
|
2190
1554
|
});
|
|
2191
|
-
|
|
2192
|
-
const
|
|
2193
|
-
return
|
|
2194
|
-
a && window.cancelAnimationFrame(a),
|
|
1555
|
+
d.observe(document.body, { subtree: !0, childList: !0, attributes: !0, characterData: !0 }), window.addEventListener("scroll", i, !0), window.addEventListener("resize", i), document.addEventListener("transitionend", i, !0), document.addEventListener("animationend", i, !0);
|
|
1556
|
+
const l = _t(i, window);
|
|
1557
|
+
return i(), () => {
|
|
1558
|
+
a && window.cancelAnimationFrame(a), d.disconnect(), window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i), document.removeEventListener("transitionend", i, !0), document.removeEventListener("animationend", i, !0), l();
|
|
2195
1559
|
};
|
|
2196
|
-
}, [
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
const
|
|
2199
|
-
return /* @__PURE__ */
|
|
1560
|
+
}, [o]), Mt(
|
|
1561
|
+
/* @__PURE__ */ n("div", { className: "ds-highlight", "aria-hidden": "true", children: r.map((a) => {
|
|
1562
|
+
const i = a.ids.map((d) => ({ id: d, known: e.component(d) }));
|
|
1563
|
+
return /* @__PURE__ */ n(
|
|
2200
1564
|
"div",
|
|
2201
1565
|
{
|
|
2202
1566
|
className: "ds-highlight__box",
|
|
2203
|
-
"data-known":
|
|
2204
|
-
"data-label": a.top <
|
|
1567
|
+
"data-known": i.every((d) => d.known) ? "true" : "false",
|
|
1568
|
+
"data-label": a.top < pn ? "inside" : "above",
|
|
2205
1569
|
style: { top: a.top, left: a.left, width: a.width, height: a.height },
|
|
2206
|
-
children: /* @__PURE__ */
|
|
1570
|
+
children: /* @__PURE__ */ n("span", { className: "ds-highlight__label", children: i.map((d) => d.known ? d.known.name : t.highlight.notInCatalog(d.id)).join(" · ") })
|
|
2207
1571
|
},
|
|
2208
1572
|
a.key
|
|
2209
1573
|
);
|
|
@@ -2211,109 +1575,109 @@ function Tn({ registry: e }) {
|
|
|
2211
1575
|
document.body
|
|
2212
1576
|
);
|
|
2213
1577
|
}
|
|
2214
|
-
function
|
|
2215
|
-
const
|
|
1578
|
+
function bn({ product: e, registry: t }) {
|
|
1579
|
+
const o = X(), { location: r, controls: s, viewport: a, navigate: i, openScenario: d, setScreenControls: l } = je(
|
|
2216
1580
|
t,
|
|
2217
1581
|
{ frame: !0 }
|
|
2218
|
-
),
|
|
2219
|
-
|
|
2220
|
-
const
|
|
2221
|
-
if (
|
|
2222
|
-
const
|
|
2223
|
-
if (!(
|
|
2224
|
-
const Z =
|
|
1582
|
+
), c = j(null);
|
|
1583
|
+
I(() => {
|
|
1584
|
+
const x = (R) => {
|
|
1585
|
+
if (R.defaultPrevented || R.button !== 0 || R.metaKey || R.ctrlKey || R.shiftKey || R.altKey) return;
|
|
1586
|
+
const K = R.target?.closest?.("a[href]");
|
|
1587
|
+
if (!(K instanceof HTMLAnchorElement) || K.target && K.target !== "_self" || K.hasAttribute("download")) return;
|
|
1588
|
+
const Z = K.getAttribute("href") ?? "";
|
|
2225
1589
|
if (Z.startsWith("#")) return;
|
|
2226
|
-
let
|
|
1590
|
+
let q;
|
|
2227
1591
|
try {
|
|
2228
|
-
|
|
1592
|
+
q = new URL(Z, window.location.href);
|
|
2229
1593
|
} catch {
|
|
2230
1594
|
return;
|
|
2231
1595
|
}
|
|
2232
|
-
|
|
1596
|
+
q.origin === window.location.origin && (R.preventDefault(), i(`${q.pathname}${q.search}`));
|
|
2233
1597
|
};
|
|
2234
|
-
return document.addEventListener("click",
|
|
2235
|
-
}, [
|
|
2236
|
-
const
|
|
1598
|
+
return document.addEventListener("click", x), () => document.removeEventListener("click", x);
|
|
1599
|
+
}, [i]), I(() => {
|
|
1600
|
+
const x = (R) => {
|
|
2237
1601
|
if (window.parent === window) return;
|
|
2238
|
-
const
|
|
2239
|
-
if (!
|
|
2240
|
-
const Z =
|
|
2241
|
-
|
|
1602
|
+
const K = gn(R);
|
|
1603
|
+
if (!K) return;
|
|
1604
|
+
const Z = R.target;
|
|
1605
|
+
K === "C" && Z?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (R.preventDefault(), ne(window.parent, { ds: 1, type: "shortcut", key: K }, window.location.origin));
|
|
2242
1606
|
};
|
|
2243
|
-
return window.addEventListener("keydown",
|
|
2244
|
-
}, []),
|
|
2245
|
-
const
|
|
2246
|
-
if (!
|
|
2247
|
-
const
|
|
2248
|
-
for (const Z of
|
|
2249
|
-
const
|
|
2250
|
-
if (!
|
|
1607
|
+
return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
|
|
1608
|
+
}, []), I(() => {
|
|
1609
|
+
const x = c.current;
|
|
1610
|
+
if (!x || !s.handoff) return;
|
|
1611
|
+
const R = () => {
|
|
1612
|
+
for (const Z of x.querySelectorAll("a[href]")) {
|
|
1613
|
+
const q = Z.getAttribute("href");
|
|
1614
|
+
if (!q || q.startsWith("#")) continue;
|
|
2251
1615
|
let Y;
|
|
2252
1616
|
try {
|
|
2253
|
-
Y = new URL(
|
|
1617
|
+
Y = new URL(q, window.location.href);
|
|
2254
1618
|
} catch {
|
|
2255
1619
|
continue;
|
|
2256
1620
|
}
|
|
2257
1621
|
if (Y.origin !== window.location.origin) continue;
|
|
2258
|
-
|
|
2259
|
-
const
|
|
2260
|
-
|
|
1622
|
+
Ce(Y.searchParams, s.handoff);
|
|
1623
|
+
const se = `${Y.pathname}${Y.search}${Y.hash}`;
|
|
1624
|
+
q !== se && Z.setAttribute("href", se);
|
|
2261
1625
|
}
|
|
2262
1626
|
};
|
|
2263
|
-
|
|
2264
|
-
const
|
|
2265
|
-
return
|
|
1627
|
+
R();
|
|
1628
|
+
const K = new MutationObserver(R);
|
|
1629
|
+
return K.observe(x, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => K.disconnect();
|
|
2266
1630
|
}, [s.handoff]);
|
|
2267
|
-
const
|
|
2268
|
-
const
|
|
1631
|
+
const h = t.scenario(s.scenario), u = t.component(s.component), p = $(() => {
|
|
1632
|
+
const x = new URLSearchParams(r.search);
|
|
2269
1633
|
return {
|
|
2270
|
-
scenario:
|
|
2271
|
-
component:
|
|
1634
|
+
scenario: x.get(y.scenario) ?? void 0,
|
|
1635
|
+
component: x.get(y.component) ?? void 0
|
|
2272
1636
|
};
|
|
2273
|
-
}, [r.search]), S = !!(s.handoff && (
|
|
2274
|
-
() => t.resolveComponentFixture(
|
|
2275
|
-
[
|
|
2276
|
-
),
|
|
2277
|
-
const
|
|
2278
|
-
return typeof
|
|
2279
|
-
}, [
|
|
2280
|
-
const
|
|
2281
|
-
return
|
|
2282
|
-
}, [s.dataSource, e.dataSources?.adapters]), { data:
|
|
2283
|
-
scenario:
|
|
1637
|
+
}, [r.search]), S = !!(s.handoff && (p.scenario && !Ne(s.handoff, p.scenario) || p.component && !Se(s.handoff, p.component) || !p.component && !gt(s.handoff, r.path, e.scenarios))), C = $(
|
|
1638
|
+
() => t.resolveComponentFixture(u?.id, u ? s.fixture : void 0),
|
|
1639
|
+
[u, s.fixture, t]
|
|
1640
|
+
), k = $(() => {
|
|
1641
|
+
const x = C.fixture?.data;
|
|
1642
|
+
return typeof x == "function" ? x() : x;
|
|
1643
|
+
}, [C.fixture]), E = t.persona(s.persona ?? h?.persona), v = t.fixture(s.fixture ?? h?.fixture), _ = $(() => {
|
|
1644
|
+
const x = s.dataSource ?? "fixtures";
|
|
1645
|
+
return x === "fixtures" ? ke : e.dataSources?.adapters?.find((R) => R.id === x) ?? ke;
|
|
1646
|
+
}, [s.dataSource, e.dataSources?.adapters]), { data: f, isLoading: m, error: w } = rn({
|
|
1647
|
+
scenario: h,
|
|
2284
1648
|
fixture: v,
|
|
2285
1649
|
network: s.network,
|
|
2286
|
-
adapter:
|
|
1650
|
+
adapter: _,
|
|
2287
1651
|
screen: r.path
|
|
2288
|
-
}),
|
|
2289
|
-
(
|
|
2290
|
-
[
|
|
2291
|
-
),
|
|
1652
|
+
}), g = $(() => h ? s.persona && s.persona !== (h.persona ?? t.defaultPersona) ? t.persona(s.persona)?.permissions ?? [] : t.permissionsOf(h) : t.persona(s.persona)?.permissions ?? [], [s.persona, t, h]), N = s.screenControls, T = $(() => N ?? {}, [N]), L = W(
|
|
1653
|
+
(x, R) => l({ [x]: R }),
|
|
1654
|
+
[l]
|
|
1655
|
+
), P = $(
|
|
2292
1656
|
() => ({
|
|
2293
|
-
scenario:
|
|
2294
|
-
persona:
|
|
2295
|
-
permissions:
|
|
2296
|
-
can: (
|
|
2297
|
-
data:
|
|
1657
|
+
scenario: h,
|
|
1658
|
+
persona: E,
|
|
1659
|
+
permissions: g,
|
|
1660
|
+
can: (x) => g.includes(x),
|
|
1661
|
+
data: f,
|
|
2298
1662
|
fixture: v,
|
|
2299
1663
|
network: s.network,
|
|
2300
1664
|
isLoading: m,
|
|
2301
1665
|
error: w,
|
|
2302
|
-
rules: t.rulesOf(
|
|
1666
|
+
rules: t.rulesOf(h),
|
|
2303
1667
|
viewport: a,
|
|
2304
1668
|
themeMode: s.themeMode,
|
|
2305
1669
|
locale: s.locale,
|
|
2306
|
-
navigate:
|
|
2307
|
-
openScenario:
|
|
1670
|
+
navigate: i,
|
|
1671
|
+
openScenario: d,
|
|
2308
1672
|
controls: T,
|
|
2309
|
-
setControl:
|
|
2310
|
-
setControls:
|
|
1673
|
+
setControl: L,
|
|
1674
|
+
setControls: l
|
|
2311
1675
|
}),
|
|
2312
1676
|
[
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
1677
|
+
h,
|
|
1678
|
+
E,
|
|
1679
|
+
g,
|
|
1680
|
+
f,
|
|
2317
1681
|
v,
|
|
2318
1682
|
s.network,
|
|
2319
1683
|
s.themeMode,
|
|
@@ -2322,36 +1686,36 @@ function Pn({ product: e, registry: t }) {
|
|
|
2322
1686
|
w,
|
|
2323
1687
|
t,
|
|
2324
1688
|
a,
|
|
2325
|
-
|
|
2326
|
-
l,
|
|
2327
|
-
T,
|
|
1689
|
+
i,
|
|
2328
1690
|
d,
|
|
2329
|
-
|
|
1691
|
+
T,
|
|
1692
|
+
L,
|
|
1693
|
+
l
|
|
2330
1694
|
]
|
|
2331
|
-
),
|
|
2332
|
-
|
|
1695
|
+
), A = vt(e.routes ?? [], r.path), O = e.wrapper, G = e.notFound, F = u?.preview, D = S ? /* @__PURE__ */ n(Oe, { title: o.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: o.shell.outsideHandoffHint }) }) : F ? /* @__PURE__ */ n(
|
|
1696
|
+
F,
|
|
2333
1697
|
{
|
|
2334
|
-
fixture:
|
|
2335
|
-
data:
|
|
1698
|
+
fixture: C.fixture,
|
|
1699
|
+
data: k,
|
|
2336
1700
|
viewport: a,
|
|
2337
1701
|
themeMode: s.themeMode ?? "default",
|
|
2338
1702
|
locale: s.locale ?? "default"
|
|
2339
1703
|
}
|
|
2340
|
-
) :
|
|
2341
|
-
/* @__PURE__ */
|
|
1704
|
+
) : A ? /* @__PURE__ */ n(A.definition.screen, { params: A.params, context: P }) : G ? /* @__PURE__ */ n(G, { path: r.path }) : /* @__PURE__ */ n(Oe, { title: o.shell.noRoute, children: /* @__PURE__ */ b("p", { children: [
|
|
1705
|
+
/* @__PURE__ */ n("code", { children: r.path }),
|
|
2342
1706
|
" ",
|
|
2343
|
-
|
|
1707
|
+
o.shell.noRouteHint
|
|
2344
1708
|
] }) });
|
|
2345
1709
|
return (
|
|
2346
1710
|
// `display: contents` deixa o layout do produto como se este nó não
|
|
2347
1711
|
// existisse: ele só serve de raiz para observar os links.
|
|
2348
|
-
/* @__PURE__ */
|
|
2349
|
-
|
|
2350
|
-
s.highlight && !S && /* @__PURE__ */
|
|
1712
|
+
/* @__PURE__ */ b("div", { ref: c, style: { display: "contents" }, children: [
|
|
1713
|
+
O && !S ? /* @__PURE__ */ n(O, { context: P, children: D }) : D,
|
|
1714
|
+
s.highlight && !S && /* @__PURE__ */ n(wn, { registry: t })
|
|
2351
1715
|
] })
|
|
2352
1716
|
);
|
|
2353
1717
|
}
|
|
2354
|
-
function
|
|
1718
|
+
function gn(e) {
|
|
2355
1719
|
if (!e.altKey) {
|
|
2356
1720
|
if (e.shiftKey && !e.metaKey && !e.ctrlKey && e.key === "C") return "C";
|
|
2357
1721
|
if ((e.metaKey || e.ctrlKey) && !e.shiftKey) {
|
|
@@ -2361,49 +1725,49 @@ function Rn(e) {
|
|
|
2361
1725
|
}
|
|
2362
1726
|
}
|
|
2363
1727
|
}
|
|
2364
|
-
const
|
|
1728
|
+
const le = {
|
|
2365
1729
|
leftWidth: "ds:left-width",
|
|
2366
1730
|
rightWidth: "ds:right-width",
|
|
2367
1731
|
appearance: "ds:appearance"
|
|
2368
1732
|
};
|
|
2369
|
-
function
|
|
1733
|
+
function nt(e) {
|
|
2370
1734
|
try {
|
|
2371
1735
|
return window.localStorage.getItem(e) ?? void 0;
|
|
2372
1736
|
} catch {
|
|
2373
1737
|
return;
|
|
2374
1738
|
}
|
|
2375
1739
|
}
|
|
2376
|
-
function
|
|
1740
|
+
function ot(e, t) {
|
|
2377
1741
|
try {
|
|
2378
1742
|
window.localStorage.setItem(e, t);
|
|
2379
1743
|
} catch {
|
|
2380
1744
|
}
|
|
2381
1745
|
}
|
|
2382
|
-
function
|
|
2383
|
-
return Math.round(Math.min(
|
|
2384
|
-
}
|
|
2385
|
-
function
|
|
2386
|
-
const [s, a] =
|
|
2387
|
-
const
|
|
2388
|
-
return Number.isFinite(
|
|
2389
|
-
}),
|
|
2390
|
-
(
|
|
2391
|
-
const
|
|
2392
|
-
a(
|
|
1746
|
+
function De(e, t, o) {
|
|
1747
|
+
return Math.round(Math.min(o, Math.max(t, e)));
|
|
1748
|
+
}
|
|
1749
|
+
function Ke(e, t, o, r) {
|
|
1750
|
+
const [s, a] = z(() => {
|
|
1751
|
+
const d = Number.parseInt(nt(e) ?? "", 10);
|
|
1752
|
+
return Number.isFinite(d) ? De(d, o, r) : t;
|
|
1753
|
+
}), i = W(
|
|
1754
|
+
(d) => {
|
|
1755
|
+
const l = De(d, o, r);
|
|
1756
|
+
a(l), ot(e, String(l));
|
|
2393
1757
|
},
|
|
2394
|
-
[e, r,
|
|
1758
|
+
[e, r, o]
|
|
2395
1759
|
);
|
|
2396
|
-
return [s,
|
|
1760
|
+
return [s, i];
|
|
2397
1761
|
}
|
|
2398
|
-
function
|
|
1762
|
+
function vn() {
|
|
2399
1763
|
const e = "(prefers-color-scheme: dark)", t = () => {
|
|
2400
1764
|
try {
|
|
2401
1765
|
return window.matchMedia(e).matches ? "dark" : "light";
|
|
2402
1766
|
} catch {
|
|
2403
1767
|
return "light";
|
|
2404
1768
|
}
|
|
2405
|
-
}, [
|
|
2406
|
-
return
|
|
1769
|
+
}, [o, r] = z(t);
|
|
1770
|
+
return I(() => {
|
|
2407
1771
|
let s;
|
|
2408
1772
|
try {
|
|
2409
1773
|
s = window.matchMedia(e);
|
|
@@ -2412,256 +1776,254 @@ function _n() {
|
|
|
2412
1776
|
}
|
|
2413
1777
|
const a = () => r(s?.matches ? "dark" : "light");
|
|
2414
1778
|
return s.addEventListener?.("change", a), () => s?.removeEventListener?.("change", a);
|
|
2415
|
-
}, []),
|
|
1779
|
+
}, []), o;
|
|
2416
1780
|
}
|
|
2417
|
-
function
|
|
2418
|
-
const e =
|
|
1781
|
+
function kn() {
|
|
1782
|
+
const e = nt(le.appearance);
|
|
2419
1783
|
return e === "dark" || e === "light" ? e : void 0;
|
|
2420
1784
|
}
|
|
2421
|
-
function
|
|
2422
|
-
const t =
|
|
2423
|
-
return /* @__PURE__ */
|
|
2424
|
-
}
|
|
2425
|
-
const
|
|
2426
|
-
function
|
|
2427
|
-
const
|
|
2428
|
-
|
|
2429
|
-
const S =
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
), [m, w] =
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
), [
|
|
2440
|
-
() => t.resolveComponentFixture(
|
|
2441
|
-
[
|
|
2442
|
-
),
|
|
2443
|
-
if (!
|
|
2444
|
-
const { invalid:
|
|
2445
|
-
scenario:
|
|
2446
|
-
requested:
|
|
1785
|
+
function Tn({ product: e }) {
|
|
1786
|
+
const t = $(() => mt(e), [e]), o = $(() => ft(e.theme?.labels), [e.theme?.labels]), [r] = z(() => Nt());
|
|
1787
|
+
return /* @__PURE__ */ n(pt.Provider, { value: o, children: r ? /* @__PURE__ */ n(bn, { product: e, registry: t }) : /* @__PURE__ */ n(yn, { product: e, registry: t }) });
|
|
1788
|
+
}
|
|
1789
|
+
const we = { initial: 290, min: 200, max: 480 }, be = { initial: 320, min: 260, max: 560 };
|
|
1790
|
+
function yn({ product: e, registry: t }) {
|
|
1791
|
+
const o = X(), r = $(() => kt(e.deploy), [e.deploy]), { location: s, controls: a, viewport: i, setControls: d, openScenario: l, openComponent: c, openScreen: h, go: u } = je(t), p = j(s);
|
|
1792
|
+
p.current = s;
|
|
1793
|
+
const S = j(null), C = vn(), [k, E] = z(() => kn()), v = a.chromeTheme ?? k ?? C, [_, f] = Ke(
|
|
1794
|
+
le.leftWidth,
|
|
1795
|
+
we.initial,
|
|
1796
|
+
we.min,
|
|
1797
|
+
we.max
|
|
1798
|
+
), [m, w] = Ke(
|
|
1799
|
+
le.rightWidth,
|
|
1800
|
+
be.initial,
|
|
1801
|
+
be.min,
|
|
1802
|
+
be.max
|
|
1803
|
+
), [g, N] = z(!1), T = a.handoff, L = t.component(a.component), P = t.scenario(a.scenario), A = L ? void 0 : t.screensFor({ handoff: T }).find((M) => M.id === t.screenForPath(s.path)?.id), O = A && P && A.variations.some((M) => M.id === P.id) ? P : void 0, G = $(
|
|
1804
|
+
() => t.resolveComponentFixture(L?.id, L ? a.fixture : void 0),
|
|
1805
|
+
[L, a.fixture, t]
|
|
1806
|
+
), F = $(() => {
|
|
1807
|
+
if (!A || A.controls.length === 0) return t.issues;
|
|
1808
|
+
const { invalid: M } = t.resolveControls(A, {
|
|
1809
|
+
scenario: O,
|
|
1810
|
+
requested: Ue(s.search)
|
|
2447
1811
|
});
|
|
2448
|
-
return
|
|
1812
|
+
return M.length === 0 ? t.issues : [...M.map((Q) => ({
|
|
2449
1813
|
level: "warning",
|
|
2450
|
-
where: `url:${
|
|
2451
|
-
message: Q.reason === "invalid-value" ?
|
|
1814
|
+
where: `url:${me}${Q.id}`,
|
|
1815
|
+
message: Q.reason === "invalid-value" ? o.diagnostics.invalidControl(Q.id, Q.value, Q.fallback ?? "") : o.diagnostics.unknownControl(Q.id, Q.value)
|
|
2452
1816
|
})), ...t.issues];
|
|
2453
|
-
}, [
|
|
2454
|
-
const
|
|
2455
|
-
return
|
|
2456
|
-
}, [s.search]), Z = s.path === "/" && !
|
|
2457
|
-
|
|
2458
|
-
Z && (
|
|
2459
|
-
}, [
|
|
2460
|
-
const
|
|
2461
|
-
() =>
|
|
2462
|
-
[a.chrome,
|
|
2463
|
-
), Y =
|
|
2464
|
-
(
|
|
2465
|
-
if (
|
|
2466
|
-
|
|
1817
|
+
}, [o, s.search, t, A, O]), D = t.screensFor({ handoff: T })[0], x = t.componentsFor(T)[0], R = !D && !x, K = $(() => {
|
|
1818
|
+
const M = new URLSearchParams(s.search);
|
|
1819
|
+
return M.has(y.scenario) || M.has(y.component);
|
|
1820
|
+
}, [s.search]), Z = s.path === "/" && !K && !t.screenForPath("/") && !R;
|
|
1821
|
+
I(() => {
|
|
1822
|
+
Z && (D ? h(D.id, { replace: !0 }) : x && c(x.id, { replace: !0 }));
|
|
1823
|
+
}, [x, D, c, h, Z]);
|
|
1824
|
+
const q = W(
|
|
1825
|
+
() => d({ chrome: !a.chrome }),
|
|
1826
|
+
[a.chrome, d]
|
|
1827
|
+
), Y = W(
|
|
1828
|
+
(M) => {
|
|
1829
|
+
if (M === "C") {
|
|
1830
|
+
q();
|
|
2467
1831
|
return;
|
|
2468
1832
|
}
|
|
2469
|
-
window.dispatchEvent(new KeyboardEvent("keydown", { key:
|
|
1833
|
+
window.dispatchEvent(new KeyboardEvent("keydown", { key: M.toLowerCase(), metaKey: !0 }));
|
|
2470
1834
|
},
|
|
2471
|
-
[
|
|
1835
|
+
[q]
|
|
2472
1836
|
);
|
|
2473
|
-
|
|
2474
|
-
const
|
|
2475
|
-
!
|
|
1837
|
+
I(() => {
|
|
1838
|
+
const M = (B) => {
|
|
1839
|
+
!B.shiftKey || B.metaKey || B.ctrlKey || B.altKey || B.key !== "C" || B.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (B.preventDefault(), Y(B.key));
|
|
2476
1840
|
};
|
|
2477
|
-
return window.addEventListener("keydown",
|
|
1841
|
+
return window.addEventListener("keydown", M), () => window.removeEventListener("keydown", M);
|
|
2478
1842
|
}, [Y]);
|
|
2479
|
-
const
|
|
2480
|
-
(
|
|
2481
|
-
const { path: Q, search:
|
|
2482
|
-
|
|
1843
|
+
const se = W(
|
|
1844
|
+
(M, B) => {
|
|
1845
|
+
const { path: Q, search: dt } = ce(M);
|
|
1846
|
+
u(Q, Ct(dt, p.current.search), { replace: B });
|
|
2483
1847
|
},
|
|
2484
|
-
[
|
|
2485
|
-
),
|
|
2486
|
-
let
|
|
1848
|
+
[u]
|
|
1849
|
+
), rt = () => {
|
|
1850
|
+
let M;
|
|
2487
1851
|
try {
|
|
2488
|
-
|
|
1852
|
+
M = S.current?.contentWindow?.location.href;
|
|
2489
1853
|
} catch {
|
|
2490
1854
|
}
|
|
2491
|
-
const
|
|
2492
|
-
window.open(
|
|
2493
|
-
},
|
|
2494
|
-
const
|
|
2495
|
-
|
|
2496
|
-
},
|
|
2497
|
-
return /* @__PURE__ */
|
|
1855
|
+
const B = xt(M, window.location.origin, p.current);
|
|
1856
|
+
window.open(B, "_blank", "noopener");
|
|
1857
|
+
}, st = () => {
|
|
1858
|
+
const M = v === "dark" ? "light" : "dark";
|
|
1859
|
+
ot(le.appearance, M), E(M), d({ chromeTheme: M });
|
|
1860
|
+
}, ee = (M) => d(M), at = `${r.origin}${s.path}${s.search}`, it = a.panelTab ?? "variations", Le = a.zoom ?? 100, [ct, lt] = z(Le);
|
|
1861
|
+
return /* @__PURE__ */ b(
|
|
2498
1862
|
"div",
|
|
2499
1863
|
{
|
|
2500
1864
|
className: "ds-root",
|
|
2501
1865
|
"data-appearance": v,
|
|
2502
1866
|
"data-chrome": a.chrome ? "visible" : "hidden",
|
|
2503
|
-
"data-resizing":
|
|
2504
|
-
"data-viewport":
|
|
1867
|
+
"data-resizing": g ? "true" : void 0,
|
|
1868
|
+
"data-viewport": i.id,
|
|
2505
1869
|
children: [
|
|
2506
|
-
a.chrome && /* @__PURE__ */
|
|
2507
|
-
|
|
1870
|
+
a.chrome && /* @__PURE__ */ n(
|
|
1871
|
+
Ut,
|
|
2508
1872
|
{
|
|
2509
1873
|
productName: e.name,
|
|
2510
1874
|
deploy: r,
|
|
2511
1875
|
viewportId: a.viewport,
|
|
2512
|
-
viewport:
|
|
2513
|
-
zoom:
|
|
1876
|
+
viewport: i,
|
|
1877
|
+
zoom: ct,
|
|
2514
1878
|
rotated: !!a.rotated,
|
|
2515
1879
|
highlight: !!a.highlight,
|
|
2516
1880
|
theme: v,
|
|
2517
|
-
issues:
|
|
2518
|
-
linkUrl:
|
|
2519
|
-
onViewport: (
|
|
2520
|
-
onRotate: () =>
|
|
2521
|
-
onHighlight: () =>
|
|
2522
|
-
onZoom: (
|
|
2523
|
-
onCleanReview:
|
|
2524
|
-
onOpenFrame:
|
|
2525
|
-
onToggleTheme:
|
|
1881
|
+
issues: F,
|
|
1882
|
+
linkUrl: at,
|
|
1883
|
+
onViewport: (M) => ee({ viewport: M }),
|
|
1884
|
+
onRotate: () => ee({ rotated: !a.rotated }),
|
|
1885
|
+
onHighlight: () => ee({ highlight: !a.highlight }),
|
|
1886
|
+
onZoom: (M) => ee({ zoom: M }),
|
|
1887
|
+
onCleanReview: q,
|
|
1888
|
+
onOpenFrame: rt,
|
|
1889
|
+
onToggleTheme: st
|
|
2526
1890
|
}
|
|
2527
1891
|
),
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
a.chrome && /* @__PURE__ */
|
|
2530
|
-
|
|
1892
|
+
/* @__PURE__ */ b("div", { className: "ds-body", children: [
|
|
1893
|
+
a.chrome && /* @__PURE__ */ n(
|
|
1894
|
+
Bt,
|
|
2531
1895
|
{
|
|
2532
1896
|
registry: t,
|
|
2533
1897
|
handoff: T,
|
|
2534
|
-
activeScreen:
|
|
2535
|
-
activeComponent:
|
|
2536
|
-
onOpenScreen: (
|
|
2537
|
-
onOpenComponent: (
|
|
2538
|
-
width:
|
|
2539
|
-
onResize:
|
|
2540
|
-
onResizeStart: () =>
|
|
2541
|
-
onResizeEnd: () =>
|
|
1898
|
+
activeScreen: A?.id,
|
|
1899
|
+
activeComponent: L?.id,
|
|
1900
|
+
onOpenScreen: (M) => h(M),
|
|
1901
|
+
onOpenComponent: (M) => c(M),
|
|
1902
|
+
width: _,
|
|
1903
|
+
onResize: f,
|
|
1904
|
+
onResizeStart: () => N(!0),
|
|
1905
|
+
onResizeEnd: () => N(!1)
|
|
2542
1906
|
}
|
|
2543
1907
|
),
|
|
2544
|
-
/* @__PURE__ */
|
|
2545
|
-
/* @__PURE__ */
|
|
2546
|
-
/* @__PURE__ */
|
|
2547
|
-
] }) : Z ? null : /* @__PURE__ */
|
|
2548
|
-
|
|
1908
|
+
/* @__PURE__ */ n("main", { className: "ds-main", children: R ? /* @__PURE__ */ b("div", { className: "ds-chrome-empty", children: [
|
|
1909
|
+
/* @__PURE__ */ n("h1", { className: "ds-chrome-empty__title", children: o.shell.empty }),
|
|
1910
|
+
/* @__PURE__ */ n("p", { className: "ds-muted", children: o.shell.emptyHint })
|
|
1911
|
+
] }) : Z ? null : /* @__PURE__ */ n(
|
|
1912
|
+
tn,
|
|
2549
1913
|
{
|
|
2550
1914
|
location: s,
|
|
2551
|
-
viewport:
|
|
2552
|
-
zoom:
|
|
2553
|
-
onEffectiveZoom:
|
|
2554
|
-
title:
|
|
2555
|
-
resizing:
|
|
2556
|
-
onFrameNavigate:
|
|
1915
|
+
viewport: i,
|
|
1916
|
+
zoom: Le,
|
|
1917
|
+
onEffectiveZoom: lt,
|
|
1918
|
+
title: o.shell.frameTitle(e.name),
|
|
1919
|
+
resizing: g,
|
|
1920
|
+
onFrameNavigate: se,
|
|
2557
1921
|
onShortcut: Y,
|
|
2558
1922
|
frameRef: S
|
|
2559
1923
|
}
|
|
2560
1924
|
) }),
|
|
2561
|
-
a.chrome && /* @__PURE__ */
|
|
2562
|
-
|
|
1925
|
+
a.chrome && /* @__PURE__ */ n(
|
|
1926
|
+
Zt,
|
|
2563
1927
|
{
|
|
2564
1928
|
registry: t,
|
|
2565
1929
|
controls: a,
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
onOpenScreen: (R) => u(R),
|
|
2577
|
-
onChange: te,
|
|
1930
|
+
screen: A,
|
|
1931
|
+
variation: O,
|
|
1932
|
+
component: L,
|
|
1933
|
+
componentFixture: G,
|
|
1934
|
+
tab: it,
|
|
1935
|
+
onTab: (M) => ee({ panelTab: M }),
|
|
1936
|
+
onOpenScenario: l,
|
|
1937
|
+
onOpenComponent: (M) => c(M),
|
|
1938
|
+
onOpenScreen: (M) => h(M),
|
|
1939
|
+
onChange: ee,
|
|
2578
1940
|
width: m,
|
|
2579
1941
|
onResize: w,
|
|
2580
|
-
onResizeStart: () =>
|
|
2581
|
-
onResizeEnd: () =>
|
|
1942
|
+
onResizeStart: () => N(!0),
|
|
1943
|
+
onResizeEnd: () => N(!1)
|
|
2582
1944
|
}
|
|
2583
1945
|
)
|
|
2584
1946
|
] }),
|
|
2585
|
-
!a.chrome && /* @__PURE__ */
|
|
1947
|
+
!a.chrome && /* @__PURE__ */ n(
|
|
2586
1948
|
"button",
|
|
2587
1949
|
{
|
|
2588
1950
|
type: "button",
|
|
2589
1951
|
className: "ds-restore",
|
|
2590
|
-
"aria-label":
|
|
2591
|
-
title:
|
|
2592
|
-
onClick:
|
|
2593
|
-
children: /* @__PURE__ */
|
|
1952
|
+
"aria-label": o.shell.restoreChrome,
|
|
1953
|
+
title: o.shell.restoreChrome,
|
|
1954
|
+
onClick: q,
|
|
1955
|
+
children: /* @__PURE__ */ n("span", { className: "ds-restore__dot", "aria-hidden": "true" })
|
|
2594
1956
|
}
|
|
2595
1957
|
)
|
|
2596
1958
|
]
|
|
2597
1959
|
}
|
|
2598
1960
|
);
|
|
2599
1961
|
}
|
|
2600
|
-
function
|
|
1962
|
+
function ue(e) {
|
|
2601
1963
|
return new Date(e.length === 10 ? `${e}T00:00:00` : e);
|
|
2602
1964
|
}
|
|
2603
|
-
function
|
|
2604
|
-
const
|
|
2605
|
-
let s = r.getFullYear() -
|
|
2606
|
-
const a = r.getMonth() -
|
|
2607
|
-
return (a < 0 || a === 0 && r.getDate() <
|
|
1965
|
+
function Rn(e, t) {
|
|
1966
|
+
const o = ue(e), r = ue(t);
|
|
1967
|
+
let s = r.getFullYear() - o.getFullYear();
|
|
1968
|
+
const a = r.getMonth() - o.getMonth();
|
|
1969
|
+
return (a < 0 || a === 0 && r.getDate() < o.getDate()) && (s -= 1), s;
|
|
2608
1970
|
}
|
|
2609
|
-
function
|
|
2610
|
-
const
|
|
2611
|
-
return Math.floor((r.getTime() -
|
|
1971
|
+
function Pn(e, t) {
|
|
1972
|
+
const o = ue(e), r = ue(t);
|
|
1973
|
+
return Math.floor((r.getTime() - o.getTime()) / 864e5);
|
|
2612
1974
|
}
|
|
2613
1975
|
export {
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
1976
|
+
de as COMPONENT_ATTRIBUTE,
|
|
1977
|
+
me as CONTROL_PARAM_PREFIX,
|
|
1978
|
+
On as DEFAULT_LABELS,
|
|
1979
|
+
Tn as DesignSpace,
|
|
1980
|
+
$n as EN_US_LABELS,
|
|
1981
|
+
St as FRAME_ATTRIBUTE,
|
|
1982
|
+
yt as FRAME_PARAM,
|
|
1983
|
+
Kn as HANDOFF_PARAM,
|
|
1984
|
+
zn as NETWORK_LABELS,
|
|
1985
|
+
He as NETWORK_STATES,
|
|
1986
|
+
y as PARAM,
|
|
1987
|
+
Ye as SLOW_NETWORK_DELAY_MS,
|
|
1988
|
+
Qe as SimulatedNetworkError,
|
|
1989
|
+
Oe as StageEmpty,
|
|
1990
|
+
Tt as VIEWPORTS,
|
|
1991
|
+
he as ZOOM_DEFAULT,
|
|
1992
|
+
Ee as ZOOM_MAX,
|
|
1993
|
+
Me as ZOOM_MIN,
|
|
1994
|
+
Rn as ageInYears,
|
|
1995
|
+
Ce as applyHandoffScope,
|
|
1996
|
+
In as applyOverrides,
|
|
1997
|
+
Ge as clampZoom,
|
|
1998
|
+
Wn as commitUrl,
|
|
1999
|
+
Un as componentUrl,
|
|
2000
|
+
_n as createHttpAdapter,
|
|
2001
|
+
mt as createRegistry,
|
|
2002
|
+
Pn as daysBetween,
|
|
2003
|
+
ke as fixtureAdapter,
|
|
2004
|
+
Hn as formatIssues,
|
|
2005
|
+
kt as getDeployContext,
|
|
2006
|
+
Se as handoffAllowsComponent,
|
|
2007
|
+
gt as handoffAllowsPath,
|
|
2008
|
+
Ne as handoffAllowsScenario,
|
|
2009
|
+
qn as hasErrors,
|
|
2010
|
+
Bn as matchPath,
|
|
2011
|
+
jn as normalizeHandoffScope,
|
|
2012
|
+
fe as normalizeSearch,
|
|
2013
|
+
ge as parseControls,
|
|
2014
|
+
wt as parseHandoffScope,
|
|
2015
|
+
ue as parseIsoDate,
|
|
2016
|
+
ve as resolveFixture,
|
|
2017
|
+
ft as resolveLabels,
|
|
2018
|
+
vt as resolveRoute,
|
|
2019
|
+
At as resolveViewport,
|
|
2020
|
+
Vn as scenarioUrl,
|
|
2021
|
+
oe as serializeControls,
|
|
2022
|
+
Gn as serializeValue,
|
|
2023
|
+
je as useDesignSpaceState,
|
|
2024
|
+
X as useLabels,
|
|
2025
|
+
rn as useScenarioData,
|
|
2026
|
+
Zn as validateProduct,
|
|
2027
|
+
Yn as validateScenario
|
|
2666
2028
|
};
|
|
2667
2029
|
//# sourceMappingURL=index.js.map
|