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