@brucesantos/design-space 0.9.3 → 0.10.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 +50 -0
- package/README.md +32 -15
- package/dist/controls/state.d.ts +6 -6
- package/dist/index.js +1104 -1064
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useState as V, useRef as
|
|
3
|
-
import { r as
|
|
4
|
-
import { H as
|
|
5
|
-
function
|
|
6
|
-
const t = e.scenarios ?? [], s = e.routes ?? [], o = e.components ?? [], r = new Map(t.map((
|
|
7
|
-
for (const
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
1
|
+
import { jsx as n, jsxs as x, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V, useRef as j, useCallback as U, useEffect as I, useMemo as D, useContext as ut, createContext as ht, useLayoutEffect as We } from "react";
|
|
3
|
+
import { r as ye, s as pt, h as oe, v as mt, a as ge, b as He, p as ft, P as M, c as Be, C as be, d as Pe, e as re, t as ie, f as he, N as je, g as qe, F as wt, i as Te, j as vt, k as me, l as Ne, m as gt, n as Fe, o as bt, q as St, u as kt, w as Ct } from "./index-BnTStnNk.js";
|
|
4
|
+
import { H as kn, x as Cn, y as xn, z as yn, A as Nn, B as $n, D as Mn, E as Ln, G as Pn } from "./index-BnTStnNk.js";
|
|
5
|
+
function xt(e) {
|
|
6
|
+
const t = e.scenarios ?? [], s = e.routes ?? [], o = e.components ?? [], r = new Map(t.map((a) => [a.id, a])), i = new Map(o.map((a) => [a.id, a])), d = new Map((e.personas ?? []).map((a) => [a.id, a])), l = new Map((e.fixtures ?? []).map((a) => [a.id, a])), w = new Map((e.rules ?? []).map((a) => [a.id, a])), h = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
7
|
+
for (const a of t) {
|
|
8
|
+
const m = ye(s, a.route ?? "");
|
|
9
|
+
if (!m) continue;
|
|
10
|
+
const C = m.definition.path;
|
|
11
|
+
u.set(a.id, C);
|
|
12
|
+
const L = h.get(C) ?? [];
|
|
13
|
+
L.push(a), h.set(C, L);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
for (const
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
id:
|
|
22
|
-
name:
|
|
23
|
-
description:
|
|
24
|
-
route:
|
|
25
|
-
href:
|
|
26
|
-
variations:
|
|
27
|
-
group:
|
|
28
|
-
controls: Array.isArray(
|
|
15
|
+
const c = /* @__PURE__ */ new Set(), g = [];
|
|
16
|
+
for (const a of s) {
|
|
17
|
+
if (c.has(a.path)) continue;
|
|
18
|
+
c.add(a.path);
|
|
19
|
+
const m = h.get(a.path) ?? [];
|
|
20
|
+
g.push({
|
|
21
|
+
id: a.path,
|
|
22
|
+
name: a.name?.trim() || m[0]?.title || a.path,
|
|
23
|
+
description: a.description,
|
|
24
|
+
route: a,
|
|
25
|
+
href: pt(a.path, a.params),
|
|
26
|
+
variations: m,
|
|
27
|
+
group: a.group?.trim() || void 0,
|
|
28
|
+
controls: Array.isArray(a.controls) ? a.controls : []
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
if (!(!
|
|
33
|
-
return i.get(
|
|
34
|
-
},
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
const { handoff:
|
|
39
|
-
return
|
|
40
|
-
...
|
|
41
|
-
variations:
|
|
31
|
+
const k = new Map(g.map((a) => [a.id, a])), b = (a) => a ? r.get(a) : void 0, $ = (a) => a ? d.get(a) : void 0, R = $(e.defaultPersona)?.id, N = (a, m) => {
|
|
32
|
+
if (!(!a || !m))
|
|
33
|
+
return i.get(a)?.fixtures?.find((C) => C.id === m);
|
|
34
|
+
}, P = (a = {}) => t.filter((m) => oe(a.handoff, m.id)), v = (a) => {
|
|
35
|
+
const m = ye(s, a);
|
|
36
|
+
return m ? k.get(m.definition.path) : void 0;
|
|
37
|
+
}, p = (a = {}) => {
|
|
38
|
+
const { handoff: m } = a;
|
|
39
|
+
return m ? g.map((C) => ({
|
|
40
|
+
...C,
|
|
41
|
+
variations: C.variations.filter((L) => oe(m, L.id))
|
|
42
42
|
})).filter(
|
|
43
|
-
(
|
|
44
|
-
) :
|
|
45
|
-
},
|
|
46
|
-
const
|
|
47
|
-
for (const
|
|
48
|
-
for (const
|
|
49
|
-
return [...
|
|
50
|
-
},
|
|
43
|
+
(C) => C.variations.length > 0 || (m.routes ?? []).length > 0 && He(m, C.href)
|
|
44
|
+
) : g;
|
|
45
|
+
}, f = (a) => a ? a.permissions ? a.permissions : $(a.persona ?? R)?.permissions ?? [] : [], S = (a = {}) => Ge(p(a)), y = (a, m) => {
|
|
46
|
+
const C = new Set(a?.route.components ?? []), L = m ? [m] : a?.variations ?? [];
|
|
47
|
+
for (const O of L)
|
|
48
|
+
for (const _ of O.components ?? []) C.add(_);
|
|
49
|
+
return [...C];
|
|
50
|
+
}, T = (a) => o.filter((m) => ge(a, m.id));
|
|
51
51
|
return {
|
|
52
52
|
product: e,
|
|
53
|
-
screens:
|
|
54
|
-
issues:
|
|
55
|
-
defaultPersona:
|
|
53
|
+
screens: g,
|
|
54
|
+
issues: mt(e),
|
|
55
|
+
defaultPersona: R,
|
|
56
56
|
scenario: b,
|
|
57
|
-
component: (
|
|
57
|
+
component: (a) => a ? i.get(a) : void 0,
|
|
58
58
|
componentFixture: N,
|
|
59
|
-
resolveComponentFixture: (
|
|
60
|
-
const
|
|
59
|
+
resolveComponentFixture: (a, m) => {
|
|
60
|
+
const C = a ? i.get(a) : void 0, L = N(a, m), O = N(a, C?.defaultFixture) ?? C?.fixtures?.[0];
|
|
61
61
|
return {
|
|
62
|
-
fixture:
|
|
63
|
-
requestedId:
|
|
64
|
-
didFallback: !!(
|
|
62
|
+
fixture: L ?? O,
|
|
63
|
+
requestedId: m,
|
|
64
|
+
didFallback: !!(m && !L)
|
|
65
65
|
};
|
|
66
66
|
},
|
|
67
|
-
persona:
|
|
68
|
-
fixture: (
|
|
69
|
-
rule: (
|
|
70
|
-
screen: (
|
|
71
|
-
screenForPath:
|
|
72
|
-
screenOf: (
|
|
73
|
-
const
|
|
74
|
-
return
|
|
67
|
+
persona: $,
|
|
68
|
+
fixture: (a) => a ? l.get(a) : void 0,
|
|
69
|
+
rule: (a) => a ? w.get(a) : void 0,
|
|
70
|
+
screen: (a) => a ? k.get(a) : void 0,
|
|
71
|
+
screenForPath: v,
|
|
72
|
+
screenOf: (a) => {
|
|
73
|
+
const m = a ? u.get(a.id) : void 0;
|
|
74
|
+
return m ? k.get(m) : void 0;
|
|
75
75
|
},
|
|
76
|
-
screensFor:
|
|
77
|
-
flows:
|
|
78
|
-
flowOf: (
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
76
|
+
screensFor: p,
|
|
77
|
+
flows: S,
|
|
78
|
+
flowOf: (a, m) => {
|
|
79
|
+
if (a)
|
|
80
|
+
return S(m).find((C) => C.name === a.group);
|
|
81
81
|
},
|
|
82
|
-
controlsOf: (
|
|
83
|
-
resolveControls: (
|
|
84
|
-
rulesOf: (
|
|
85
|
-
permissionsOf:
|
|
86
|
-
scenariosForRoute: (
|
|
87
|
-
const
|
|
88
|
-
return
|
|
82
|
+
controlsOf: (a) => (a?.controls ?? []).flatMap((m) => m.controls ?? []),
|
|
83
|
+
resolveControls: (a, m = {}) => yt(a?.controls ?? [], m),
|
|
84
|
+
rulesOf: (a) => (a?.rules ?? []).map((m) => w.get(m)).filter((m) => !!m),
|
|
85
|
+
permissionsOf: f,
|
|
86
|
+
scenariosForRoute: (a, m) => {
|
|
87
|
+
const C = v(a);
|
|
88
|
+
return C ? C.variations.filter((L) => oe(m?.handoff, L.id)) : [];
|
|
89
89
|
},
|
|
90
|
-
activeScenarios:
|
|
91
|
-
search: (
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
(
|
|
90
|
+
activeScenarios: P,
|
|
91
|
+
search: (a, m) => {
|
|
92
|
+
const C = Q(a), L = P(m);
|
|
93
|
+
return C ? L.filter(
|
|
94
|
+
(O) => Q(
|
|
95
95
|
[
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
(
|
|
102
|
-
(
|
|
96
|
+
O.title,
|
|
97
|
+
O.id,
|
|
98
|
+
O.intent ?? "",
|
|
99
|
+
O.route,
|
|
100
|
+
$(O.persona)?.name ?? "",
|
|
101
|
+
(O.tags ?? []).join(" "),
|
|
102
|
+
(O.expected ?? []).join(" ")
|
|
103
103
|
].join(" ")
|
|
104
|
-
).includes(
|
|
105
|
-
) :
|
|
104
|
+
).includes(C)
|
|
105
|
+
) : L;
|
|
106
106
|
},
|
|
107
|
-
searchScreens: (
|
|
108
|
-
const
|
|
109
|
-
return
|
|
110
|
-
(
|
|
107
|
+
searchScreens: (a, m) => {
|
|
108
|
+
const C = Q(a), L = p(m);
|
|
109
|
+
return C ? L.filter(
|
|
110
|
+
(O) => Q(
|
|
111
111
|
[
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
...
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
(
|
|
112
|
+
O.name,
|
|
113
|
+
O.description ?? "",
|
|
114
|
+
O.id,
|
|
115
|
+
O.group ?? "",
|
|
116
|
+
...O.variations.flatMap((_) => [
|
|
117
|
+
_.title,
|
|
118
|
+
_.id,
|
|
119
|
+
(_.tags ?? []).join(" ")
|
|
120
120
|
])
|
|
121
121
|
].join(" ")
|
|
122
|
-
).includes(
|
|
123
|
-
) :
|
|
122
|
+
).includes(C)
|
|
123
|
+
) : L;
|
|
124
124
|
},
|
|
125
|
-
searchComponents: (
|
|
126
|
-
const
|
|
127
|
-
return
|
|
128
|
-
(
|
|
125
|
+
searchComponents: (a, m) => {
|
|
126
|
+
const C = Q(a), L = T(m);
|
|
127
|
+
return C ? L.filter(
|
|
128
|
+
(O) => Q(
|
|
129
129
|
[
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
O.name,
|
|
131
|
+
O.description ?? "",
|
|
132
|
+
O.group ?? "",
|
|
133
|
+
O.id,
|
|
134
|
+
O.source ?? ""
|
|
135
135
|
].join(" ")
|
|
136
|
-
).includes(
|
|
137
|
-
) :
|
|
136
|
+
).includes(C)
|
|
137
|
+
) : L;
|
|
138
138
|
},
|
|
139
|
-
componentsFor:
|
|
140
|
-
componentsOfScreen: (
|
|
141
|
-
usagesOf: (
|
|
142
|
-
(
|
|
139
|
+
componentsFor: T,
|
|
140
|
+
componentsOfScreen: (a, m) => y(a, m).map((C) => i.get(C)).filter((C) => !!C),
|
|
141
|
+
usagesOf: (a, m) => a ? p(m).filter(
|
|
142
|
+
(C) => C.route.components?.includes(a) || C.variations.some((L) => L.components?.includes(a))
|
|
143
143
|
) : []
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Q(e) {
|
|
147
147
|
return e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g, "").trim();
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function Ge(e) {
|
|
150
150
|
const t = [], s = /* @__PURE__ */ new Map();
|
|
151
151
|
for (const r of e) {
|
|
152
152
|
if (!r.group) {
|
|
@@ -159,211 +159,242 @@ function je(e) {
|
|
|
159
159
|
const o = [...s].map(([r, i]) => ({ name: r, screens: i }));
|
|
160
160
|
return t.length > 0 ? [{ name: void 0, screens: t }, ...o] : o;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Se(e) {
|
|
163
163
|
const t = e.options ?? [];
|
|
164
164
|
return e.default !== void 0 && t.some((s) => s.value === e.default) ? e.default : t[0]?.value ?? "";
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function yt(e, t = {}) {
|
|
167
167
|
const s = {}, o = [], r = /* @__PURE__ */ new Set(), i = t.requested ?? {};
|
|
168
|
-
for (const
|
|
169
|
-
for (const
|
|
170
|
-
if (r.has(
|
|
171
|
-
r.add(
|
|
172
|
-
const
|
|
173
|
-
let
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
|
|
168
|
+
for (const d of e)
|
|
169
|
+
for (const l of d.controls ?? []) {
|
|
170
|
+
if (r.has(l.id)) continue;
|
|
171
|
+
r.add(l.id);
|
|
172
|
+
const w = (g) => g !== void 0 && (l.options ?? []).some((k) => k.value === g);
|
|
173
|
+
let h = Se(l);
|
|
174
|
+
const u = t.scenario?.controls?.[l.id];
|
|
175
|
+
w(u) && (h = u);
|
|
176
|
+
const c = i[l.id];
|
|
177
|
+
c !== void 0 && (w(c) ? h = c : o.push({ id: l.id, value: c, reason: "invalid-value", fallback: h })), s[l.id] = h;
|
|
178
178
|
}
|
|
179
|
-
for (const [
|
|
180
|
-
r.has(
|
|
179
|
+
for (const [d, l] of Object.entries(i))
|
|
180
|
+
r.has(d) || o.push({ id: d, value: l, reason: "unknown-control" });
|
|
181
181
|
return { values: s, invalid: o };
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Nt(e, t) {
|
|
184
184
|
return e ? Object.entries(e.controls ?? {}).every(([s, o]) => t?.[s] === o) : !1;
|
|
185
185
|
}
|
|
186
|
-
const
|
|
186
|
+
const $t = [
|
|
187
187
|
{ id: "mobile", label: "Celular", width: 375, height: 812 },
|
|
188
188
|
{ id: "tablet", label: "Tablet", width: 768, height: 1024 },
|
|
189
189
|
{ id: "desktop", label: "Desktop", width: 1280, height: 800 },
|
|
190
190
|
{ id: "fit", label: "Ajustar" },
|
|
191
191
|
{ id: "custom", label: "Personalizado" }
|
|
192
|
-
],
|
|
193
|
-
function
|
|
192
|
+
], Ee = 25, Re = 150, fe = 100;
|
|
193
|
+
function Ze(e, t, s) {
|
|
194
194
|
const o = s !== void 0 ? e.screenForPath(s) : e.screenOf(t), r = t && o && e.screenOf(t)?.id === o.id ? t : void 0;
|
|
195
195
|
return { screen: o, scenario: r };
|
|
196
196
|
}
|
|
197
197
|
function $e(e, t, s) {
|
|
198
|
-
const o = new URLSearchParams(e), r =
|
|
199
|
-
scenario:
|
|
200
|
-
requested:
|
|
198
|
+
const o = new URLSearchParams(e), r = ft(o), i = o.get(M.component) ?? void 0, d = ge(r, i) ? t.component(i) : void 0, l = o.get(M.scenario) ?? void 0, w = d || !oe(r, l) ? void 0 : t.scenario(l), h = o.get(M.fixture) ?? void 0, u = d ? h ?? t.componentFixture(d.id, d.defaultFixture)?.id ?? d.fixtures?.[0]?.id : void 0, c = o.get(M.network), g = d ? void 0 : Ze(t, w, s), k = g?.screen && g.screen.controls.length > 0 ? t.resolveControls(g.screen, {
|
|
199
|
+
scenario: g.scenario,
|
|
200
|
+
requested: Be(o)
|
|
201
201
|
}).values : void 0;
|
|
202
202
|
return {
|
|
203
|
-
scenario:
|
|
203
|
+
scenario: w?.id,
|
|
204
204
|
handoff: r,
|
|
205
|
-
component:
|
|
205
|
+
component: d?.id,
|
|
206
206
|
// Precedência: URL, cenário, padrão do produto. O preview de componente não
|
|
207
207
|
// tem persona, então o padrão não se aplica a ele.
|
|
208
|
-
persona: o.get(
|
|
209
|
-
fixture:
|
|
210
|
-
network:
|
|
211
|
-
viewport: o.get(
|
|
212
|
-
customWidth:
|
|
213
|
-
themeMode: o.get(
|
|
214
|
-
locale: o.get(
|
|
215
|
-
dataSource: o.get(
|
|
208
|
+
persona: o.get(M.persona) ?? w?.persona ?? (d ? void 0 : t.defaultPersona),
|
|
209
|
+
fixture: d ? u : h ?? w?.fixture,
|
|
210
|
+
network: Et(c) ? c : w?.network ?? "success",
|
|
211
|
+
viewport: o.get(M.viewport) ?? "fit",
|
|
212
|
+
customWidth: Ft(o.get(M.customWidth)),
|
|
213
|
+
themeMode: o.get(M.themeMode) ?? t.product.theme?.modes?.[0],
|
|
214
|
+
locale: o.get(M.locale) ?? t.product.theme?.locales?.[0],
|
|
215
|
+
dataSource: o.get(M.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
|
|
216
216
|
// Sem parâmetro, o tema do chrome fica em aberto: o shell resolve pela
|
|
217
217
|
// última escolha da pessoa e, na falta dela, pelo sistema.
|
|
218
|
-
chromeTheme:
|
|
218
|
+
chromeTheme: Rt(o.get(M.chromeTheme)) ? o.get(M.chromeTheme) : void 0,
|
|
219
219
|
// Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
|
|
220
220
|
// de tela, então precisa ser explícito para não sumir sem pedido.
|
|
221
|
-
chrome: o.get(
|
|
222
|
-
inspector: o.get(
|
|
223
|
-
panelTab:
|
|
224
|
-
zoom:
|
|
225
|
-
rotated: o.get(
|
|
226
|
-
screenControls:
|
|
221
|
+
chrome: o.get(M.chrome) !== "0",
|
|
222
|
+
inspector: o.get(M.inspector) !== "0",
|
|
223
|
+
panelTab: _t(o.get(M.panelTab)) ? o.get(M.panelTab) : "variations",
|
|
224
|
+
zoom: Xe(o.get(M.zoom)),
|
|
225
|
+
rotated: o.get(M.rotated) === "1",
|
|
226
|
+
screenControls: k
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function ae(e, t, s) {
|
|
230
230
|
const o = new URLSearchParams(), r = t.scenario(e.scenario);
|
|
231
|
-
if (e.component ? o.set(
|
|
232
|
-
const
|
|
233
|
-
for (const
|
|
234
|
-
const b = e.screenControls[
|
|
235
|
-
b !== void 0 && b !==
|
|
231
|
+
if (e.component ? o.set(M.component, e.component) : e.scenario && o.set(M.scenario, e.scenario), e.persona && e.persona !== (r?.persona ?? t.defaultPersona) && o.set(M.persona, e.persona), e.component && e.fixture ? o.set(M.fixture, e.fixture) : e.fixture && e.fixture !== r?.fixture && o.set(M.fixture, e.fixture), e.network !== (r?.network ?? "success") && o.set(M.network, e.network), e.screenControls && !e.component) {
|
|
232
|
+
const u = Ze(t, r, s), c = u.screen ? t.resolveControls(u.screen, { scenario: u.scenario }).values : {}, g = u.screen ? t.controlsOf(u.screen).map((k) => k.id) : Object.keys(e.screenControls);
|
|
233
|
+
for (const k of g) {
|
|
234
|
+
const b = e.screenControls[k];
|
|
235
|
+
b !== void 0 && b !== c[k] && o.set(`${be}${k}`, b);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
e.viewport !== "fit" && o.set(
|
|
238
|
+
e.viewport !== "fit" && o.set(M.viewport, e.viewport), e.viewport === "custom" && e.customWidth && o.set(M.customWidth, String(e.customWidth));
|
|
239
239
|
const i = t.product.theme?.modes?.[0];
|
|
240
|
-
e.themeMode && e.themeMode !== i && o.set(
|
|
241
|
-
const
|
|
242
|
-
e.locale && e.locale !==
|
|
243
|
-
const
|
|
244
|
-
e.dataSource && e.dataSource !==
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
return
|
|
249
|
-
}
|
|
250
|
-
function
|
|
251
|
-
const s = !!t.frame, [o, r] = V(() =>
|
|
252
|
-
i.current =
|
|
240
|
+
e.themeMode && e.themeMode !== i && o.set(M.themeMode, e.themeMode);
|
|
241
|
+
const d = t.product.theme?.locales?.[0];
|
|
242
|
+
e.locale && e.locale !== d && o.set(M.locale, e.locale);
|
|
243
|
+
const l = t.product.dataSources?.default ?? "fixtures";
|
|
244
|
+
e.dataSource && e.dataSource !== l && o.set(M.dataSource, e.dataSource), e.chromeTheme && o.set(M.chromeTheme, e.chromeTheme), e.chrome || o.set(M.chrome, "0"), e.inspector || o.set(M.inspector, "0"), e.panelTab === "info" && o.set(M.panelTab, "info");
|
|
245
|
+
const w = Xe(e.zoom === void 0 ? null : String(e.zoom));
|
|
246
|
+
w !== fe && o.set(M.zoom, String(w)), e.rotated && o.set(M.rotated, "1"), Pe(o, e.handoff);
|
|
247
|
+
const h = o.toString();
|
|
248
|
+
return h ? `?${h}` : "";
|
|
249
|
+
}
|
|
250
|
+
function Ye(e, t = {}) {
|
|
251
|
+
const s = !!t.frame, [o, r] = V(() => ke()), i = j(o), d = U((p) => {
|
|
252
|
+
i.current = p, r(p);
|
|
253
|
+
}, []), l = j(!1), w = U((p) => {
|
|
254
|
+
l.current = !0;
|
|
255
|
+
try {
|
|
256
|
+
window.history.replaceState(null, "", p);
|
|
257
|
+
} finally {
|
|
258
|
+
l.current = !1;
|
|
259
|
+
}
|
|
253
260
|
}, []);
|
|
254
261
|
I(() => {
|
|
255
|
-
const
|
|
256
|
-
return window.addEventListener("popstate",
|
|
257
|
-
}, [
|
|
262
|
+
const p = () => d(ke());
|
|
263
|
+
return window.addEventListener("popstate", p), () => window.removeEventListener("popstate", p);
|
|
264
|
+
}, [d]), I(() => {
|
|
265
|
+
if (!s) return;
|
|
266
|
+
const p = window.history, { pushState: f, replaceState: S } = p, y = (T) => {
|
|
267
|
+
const a = i.current;
|
|
268
|
+
if (window.location.pathname !== a.path) return !1;
|
|
269
|
+
const m = Oe(a.search, he(window.location.href).search), C = ie(a.path, m);
|
|
270
|
+
if (`${window.location.pathname}${window.location.search}` !== C && S.call(p, p.state, "", `${C}${window.location.hash}`), m === a.search) return !0;
|
|
271
|
+
const O = { path: a.path, search: m };
|
|
272
|
+
return i.current = O, queueMicrotask(() => {
|
|
273
|
+
i.current === O && (r(O), re(
|
|
274
|
+
window.parent === window ? void 0 : window.parent,
|
|
275
|
+
{ ds: 1, type: "navigate", url: C, replace: T },
|
|
276
|
+
window.location.origin
|
|
277
|
+
));
|
|
278
|
+
}), !0;
|
|
279
|
+
};
|
|
280
|
+
return p.replaceState = function(T, a, m) {
|
|
281
|
+
S.call(p, T, a, m), l.current || y(!0);
|
|
282
|
+
}, p.pushState = function(T, a, m) {
|
|
283
|
+
const C = `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
284
|
+
S.call(p, T, a, m), !y(!1) && (S.call(p, p.state, "", C), f.call(p, T, a, m));
|
|
285
|
+
}, y(!0), () => {
|
|
286
|
+
p.pushState = f, p.replaceState = S;
|
|
287
|
+
};
|
|
288
|
+
}, [s]), I(() => {
|
|
258
289
|
if (!s || window.parent === window) return;
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
if (
|
|
262
|
-
const { path:
|
|
263
|
-
|
|
290
|
+
const p = window.location.origin, f = (y) => {
|
|
291
|
+
const T = qe(y, { origin: p, source: window.parent });
|
|
292
|
+
if (T?.type !== "location") return;
|
|
293
|
+
const { path: a, search: m } = he(T.url);
|
|
294
|
+
w(ie(a, m)), d({ path: a, search: m });
|
|
264
295
|
};
|
|
265
|
-
window.addEventListener("message",
|
|
266
|
-
const
|
|
267
|
-
return
|
|
296
|
+
window.addEventListener("message", f);
|
|
297
|
+
const S = ke();
|
|
298
|
+
return re(
|
|
268
299
|
window.parent,
|
|
269
|
-
{ ds: 1, type: "ready", url:
|
|
270
|
-
|
|
271
|
-
), () => window.removeEventListener("message",
|
|
272
|
-
}, [s,
|
|
273
|
-
const
|
|
300
|
+
{ ds: 1, type: "ready", url: ie(S.path, S.search) },
|
|
301
|
+
p
|
|
302
|
+
), () => window.removeEventListener("message", f);
|
|
303
|
+
}, [s, d, w]);
|
|
304
|
+
const h = D(
|
|
274
305
|
() => $e(o.search, e, o.path),
|
|
275
306
|
[o.path, o.search, e]
|
|
276
|
-
),
|
|
277
|
-
(
|
|
307
|
+
), u = U(
|
|
308
|
+
(p, f, S = !1) => {
|
|
278
309
|
if (s) {
|
|
279
|
-
const
|
|
280
|
-
|
|
310
|
+
const T = ie(p, f), a = he(T);
|
|
311
|
+
w(T), d(a), re(
|
|
281
312
|
window.parent === window ? void 0 : window.parent,
|
|
282
|
-
{ ds: 1, type: "navigate", url:
|
|
313
|
+
{ ds: 1, type: "navigate", url: T, replace: S },
|
|
283
314
|
window.location.origin
|
|
284
315
|
);
|
|
285
316
|
return;
|
|
286
317
|
}
|
|
287
|
-
const
|
|
288
|
-
|
|
318
|
+
const y = `${p}${f}`;
|
|
319
|
+
S ? window.history.replaceState(null, "", y) : window.history.pushState(null, "", y), d({ path: p, search: f });
|
|
289
320
|
},
|
|
290
|
-
[s,
|
|
291
|
-
),
|
|
292
|
-
const
|
|
293
|
-
return
|
|
294
|
-
}, [
|
|
295
|
-
(
|
|
296
|
-
const
|
|
297
|
-
|
|
321
|
+
[s, d, w]
|
|
322
|
+
), c = U(() => {
|
|
323
|
+
const p = i.current;
|
|
324
|
+
return p === o ? h : $e(p.search, e, p.path);
|
|
325
|
+
}, [h, o, e]), g = U(
|
|
326
|
+
(p) => {
|
|
327
|
+
const f = i.current, S = { ...c(), ...p }, y = Oe(ae(S, e, f.path), f.search);
|
|
328
|
+
y !== f.search && u(f.path, y, !0);
|
|
298
329
|
},
|
|
299
|
-
[
|
|
300
|
-
),
|
|
301
|
-
(
|
|
302
|
-
const
|
|
303
|
-
Object.entries(
|
|
330
|
+
[c, u, e]
|
|
331
|
+
), k = U(
|
|
332
|
+
(p) => {
|
|
333
|
+
const f = c().screenControls ?? {};
|
|
334
|
+
Object.entries(p).some(([y, T]) => f[y] !== T) && g({ screenControls: { ...f, ...p } });
|
|
304
335
|
},
|
|
305
|
-
[
|
|
306
|
-
),
|
|
307
|
-
(
|
|
308
|
-
const
|
|
309
|
-
controls:
|
|
336
|
+
[c, g]
|
|
337
|
+
), b = U(
|
|
338
|
+
(p, f) => {
|
|
339
|
+
const S = Mt(p, i.current, e, {
|
|
340
|
+
controls: f?.controls
|
|
310
341
|
});
|
|
311
|
-
|
|
342
|
+
u(S.path, S.search, f?.replace ?? !1);
|
|
312
343
|
},
|
|
313
|
-
[
|
|
314
|
-
),
|
|
315
|
-
(
|
|
316
|
-
const
|
|
317
|
-
if (!
|
|
318
|
-
const
|
|
319
|
-
...
|
|
320
|
-
scenario:
|
|
344
|
+
[u, e]
|
|
345
|
+
), $ = U(
|
|
346
|
+
(p) => {
|
|
347
|
+
const f = e.scenario(p);
|
|
348
|
+
if (!f || !oe(h.handoff, p)) return;
|
|
349
|
+
const S = {
|
|
350
|
+
...h,
|
|
351
|
+
scenario: f.id,
|
|
321
352
|
component: void 0,
|
|
322
|
-
persona:
|
|
323
|
-
fixture:
|
|
324
|
-
network:
|
|
353
|
+
persona: f.persona,
|
|
354
|
+
fixture: f.fixture,
|
|
355
|
+
network: f.network ?? "success",
|
|
325
356
|
// Os controles voltam ao que o cenário fixa, sobre os padrões da tela.
|
|
326
357
|
screenControls: void 0
|
|
327
358
|
};
|
|
328
|
-
|
|
359
|
+
u(f.route, ae(S, e, f.route), !1);
|
|
329
360
|
},
|
|
330
|
-
[
|
|
331
|
-
),
|
|
332
|
-
(
|
|
333
|
-
const
|
|
334
|
-
if (!
|
|
335
|
-
const
|
|
336
|
-
...
|
|
361
|
+
[h, u, e]
|
|
362
|
+
), R = U(
|
|
363
|
+
(p, f) => {
|
|
364
|
+
const S = e.component(p);
|
|
365
|
+
if (!S || !ge(h.handoff, p)) return;
|
|
366
|
+
const y = {
|
|
367
|
+
...h,
|
|
337
368
|
scenario: void 0,
|
|
338
|
-
component:
|
|
369
|
+
component: S.id,
|
|
339
370
|
persona: void 0,
|
|
340
371
|
fixture: void 0,
|
|
341
372
|
network: "success",
|
|
342
373
|
screenControls: void 0
|
|
343
374
|
};
|
|
344
|
-
|
|
375
|
+
y.fixture = e.componentFixture(S.id, S.defaultFixture)?.id ?? S.fixtures?.[0]?.id, u("/", ae(y, e), f?.replace ?? !1);
|
|
345
376
|
},
|
|
346
|
-
[
|
|
347
|
-
),
|
|
348
|
-
(
|
|
349
|
-
const
|
|
350
|
-
if (!
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
const
|
|
354
|
-
...
|
|
355
|
-
scenario:
|
|
377
|
+
[h, u, e]
|
|
378
|
+
), N = U(
|
|
379
|
+
(p, f) => {
|
|
380
|
+
const S = e.screensFor({ handoff: h.handoff }).find((a) => a.id === p);
|
|
381
|
+
if (!S) return;
|
|
382
|
+
const y = S.variations[0];
|
|
383
|
+
if (y) {
|
|
384
|
+
const a = {
|
|
385
|
+
...h,
|
|
386
|
+
scenario: y.id,
|
|
356
387
|
component: void 0,
|
|
357
|
-
persona:
|
|
358
|
-
fixture:
|
|
359
|
-
network:
|
|
388
|
+
persona: y.persona,
|
|
389
|
+
fixture: y.fixture,
|
|
390
|
+
network: y.network ?? "success",
|
|
360
391
|
screenControls: void 0
|
|
361
392
|
};
|
|
362
|
-
|
|
393
|
+
u(y.route, ae(a, e, y.route), f?.replace ?? !1);
|
|
363
394
|
return;
|
|
364
395
|
}
|
|
365
|
-
const
|
|
366
|
-
...
|
|
396
|
+
const T = {
|
|
397
|
+
...h,
|
|
367
398
|
scenario: void 0,
|
|
368
399
|
component: void 0,
|
|
369
400
|
persona: void 0,
|
|
@@ -371,137 +402,146 @@ function Ge(e, t = {}) {
|
|
|
371
402
|
network: "success",
|
|
372
403
|
screenControls: void 0
|
|
373
404
|
};
|
|
374
|
-
|
|
405
|
+
u(S.href, ae(T, e, S.href), f?.replace ?? !1);
|
|
375
406
|
},
|
|
376
|
-
[
|
|
377
|
-
),
|
|
378
|
-
(
|
|
379
|
-
[
|
|
380
|
-
),
|
|
407
|
+
[h, u, e]
|
|
408
|
+
), P = U(
|
|
409
|
+
(p, f, S) => u(p || "/", f, S?.replace ?? !1),
|
|
410
|
+
[u]
|
|
411
|
+
), v = D(() => Tt(h), [h]);
|
|
381
412
|
return {
|
|
382
413
|
location: o,
|
|
383
|
-
controls:
|
|
384
|
-
viewport:
|
|
385
|
-
setControls:
|
|
386
|
-
setScreenControls:
|
|
387
|
-
navigate:
|
|
388
|
-
openScenario:
|
|
389
|
-
openComponent:
|
|
390
|
-
openScreen:
|
|
391
|
-
go:
|
|
414
|
+
controls: h,
|
|
415
|
+
viewport: v,
|
|
416
|
+
setControls: g,
|
|
417
|
+
setScreenControls: k,
|
|
418
|
+
navigate: b,
|
|
419
|
+
openScenario: $,
|
|
420
|
+
openComponent: R,
|
|
421
|
+
openScreen: N,
|
|
422
|
+
go: P
|
|
392
423
|
};
|
|
393
424
|
}
|
|
394
|
-
function
|
|
395
|
-
const r = e.split("#")[0] ?? e, i = r.indexOf("?"),
|
|
396
|
-
let
|
|
397
|
-
if (
|
|
398
|
-
|
|
425
|
+
function Mt(e, t, s, o = {}) {
|
|
426
|
+
const r = e.split("#")[0] ?? e, i = r.indexOf("?"), d = (i === -1 ? r : r.slice(0, i)) || "/", l = i === -1 ? void 0 : r.slice(i + 1), w = new URLSearchParams(t.search), h = $e(t.search, s, t.path), u = !Lt(s, d, t.path);
|
|
427
|
+
let c;
|
|
428
|
+
if (l === void 0 && o.controls === void 0)
|
|
429
|
+
c = new URLSearchParams(t.search), u && (vt(c), Qe(c));
|
|
399
430
|
else {
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
for (const [
|
|
403
|
-
!
|
|
404
|
-
|
|
405
|
-
for (const [
|
|
431
|
+
const k = new URLSearchParams(l ?? "");
|
|
432
|
+
c = new URLSearchParams();
|
|
433
|
+
for (const [b, $] of w)
|
|
434
|
+
!Pt(b) || k.has(b) || u && !Te(b) || c.append(b, $);
|
|
435
|
+
h.scenario && !k.has(M.scenario) && h.persona && h.persona !== s.defaultPersona && !c.has(M.persona) && !k.has(M.persona) && c.set(M.persona, h.persona);
|
|
436
|
+
for (const [b, $] of k) c.append(b, $);
|
|
406
437
|
if (o.controls) {
|
|
407
|
-
const
|
|
408
|
-
for (const [
|
|
409
|
-
const
|
|
410
|
-
|
|
438
|
+
const b = s.screenForPath(d), $ = s.scenario(c.get(M.scenario) ?? void 0), R = $ && b && s.screenOf($)?.id === b.id ? $ : void 0, N = b ? s.resolveControls(b, { scenario: R }).values : {};
|
|
439
|
+
for (const [P, v] of Object.entries(o.controls)) {
|
|
440
|
+
const p = `${be}${P}`;
|
|
441
|
+
N[P] === v ? c.delete(p) : c.set(p, v);
|
|
411
442
|
}
|
|
412
443
|
}
|
|
413
444
|
}
|
|
414
|
-
|
|
415
|
-
const
|
|
416
|
-
return { path:
|
|
445
|
+
h.handoff && Pe(c, h.handoff);
|
|
446
|
+
const g = c.toString();
|
|
447
|
+
return { path: d, search: g ? `?${g}` : "" };
|
|
417
448
|
}
|
|
418
|
-
function
|
|
449
|
+
function Oe(e, t) {
|
|
419
450
|
const s = new URLSearchParams(e);
|
|
451
|
+
Qe(s);
|
|
420
452
|
for (const [r, i] of new URLSearchParams(t))
|
|
421
|
-
r ===
|
|
453
|
+
r === wt || Te(r) || s.append(r, i);
|
|
422
454
|
const o = s.toString();
|
|
423
455
|
return o ? `?${o}` : "";
|
|
424
456
|
}
|
|
425
|
-
function
|
|
426
|
-
|
|
457
|
+
function Qe(e) {
|
|
458
|
+
for (const t of [...e.keys()])
|
|
459
|
+
Te(t) || e.delete(t);
|
|
460
|
+
}
|
|
461
|
+
function Lt(e, t, s) {
|
|
462
|
+
const o = e.screenForPath(t)?.id, r = e.screenForPath(s)?.id;
|
|
463
|
+
return o === void 0 && r === void 0 ? t === s : o === r;
|
|
464
|
+
}
|
|
465
|
+
function Pt(e) {
|
|
466
|
+
return e.startsWith(be) ? !1 : e !== M.scenario && e !== M.fixture && e !== M.component;
|
|
427
467
|
}
|
|
428
|
-
function
|
|
468
|
+
function Tt(e) {
|
|
429
469
|
if (e.viewport === "custom")
|
|
430
470
|
return { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 };
|
|
431
|
-
const t =
|
|
471
|
+
const t = $t.find((s) => s.id === e.viewport) ?? {
|
|
432
472
|
id: "fit",
|
|
433
473
|
label: "Ajustar"
|
|
434
474
|
};
|
|
435
475
|
return e.rotated && t.width && t.height ? { ...t, width: t.height, height: t.width } : { ...t };
|
|
436
476
|
}
|
|
437
|
-
function
|
|
438
|
-
if (e === null) return
|
|
477
|
+
function Xe(e) {
|
|
478
|
+
if (e === null) return fe;
|
|
439
479
|
const t = Number.parseInt(e, 10);
|
|
440
|
-
return Number.isFinite(t) ? Math.min(
|
|
480
|
+
return Number.isFinite(t) ? Math.min(Re, Math.max(Ee, t)) : fe;
|
|
441
481
|
}
|
|
442
|
-
function
|
|
482
|
+
function ke() {
|
|
443
483
|
return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
|
|
444
484
|
}
|
|
445
|
-
function
|
|
446
|
-
return e !== null &&
|
|
485
|
+
function Et(e) {
|
|
486
|
+
return e !== null && je.includes(e);
|
|
447
487
|
}
|
|
448
|
-
function
|
|
488
|
+
function Rt(e) {
|
|
449
489
|
return e === "dark" || e === "light";
|
|
450
490
|
}
|
|
451
|
-
function
|
|
491
|
+
function _t(e) {
|
|
452
492
|
return e === "variations" || e === "info";
|
|
453
493
|
}
|
|
454
|
-
function
|
|
494
|
+
function Ft(e) {
|
|
455
495
|
if (!e) return;
|
|
456
496
|
const t = Number.parseInt(e, 10);
|
|
457
497
|
return Number.isFinite(t) && t > 0 ? t : void 0;
|
|
458
498
|
}
|
|
459
|
-
const
|
|
460
|
-
mobile: /* @__PURE__ */
|
|
499
|
+
const Ot = "@brucesantos/design-space", ze = "0.10.0", zt = {
|
|
500
|
+
mobile: /* @__PURE__ */ x(Y, { children: [
|
|
461
501
|
/* @__PURE__ */ n("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
|
|
462
502
|
/* @__PURE__ */ n("path", { d: "M11 18.5h2" })
|
|
463
503
|
] }),
|
|
464
|
-
tablet: /* @__PURE__ */
|
|
504
|
+
tablet: /* @__PURE__ */ x(Y, { children: [
|
|
465
505
|
/* @__PURE__ */ n("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
|
|
466
506
|
/* @__PURE__ */ n("path", { d: "M11 18.5h2" })
|
|
467
507
|
] }),
|
|
468
|
-
desktop: /* @__PURE__ */
|
|
508
|
+
desktop: /* @__PURE__ */ x(Y, { children: [
|
|
469
509
|
/* @__PURE__ */ n("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
|
|
470
510
|
/* @__PURE__ */ n("path", { d: "M8.5 20.5h7M12 16.5v4" })
|
|
471
511
|
] }),
|
|
472
512
|
fit: /* @__PURE__ */ n("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
|
|
473
|
-
rotate: /* @__PURE__ */
|
|
513
|
+
rotate: /* @__PURE__ */ x(Y, { children: [
|
|
474
514
|
/* @__PURE__ */ n("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
|
|
475
515
|
/* @__PURE__ */ n("path", { d: "M20 4v4.5h-4.5" })
|
|
476
516
|
] }),
|
|
477
517
|
minus: /* @__PURE__ */ n("path", { d: "M5 12h14" }),
|
|
478
518
|
plus: /* @__PURE__ */ n("path", { d: "M5 12h14M12 5v14" }),
|
|
479
519
|
"arrow-up-right": /* @__PURE__ */ n("path", { d: "M7 17 17 7M8 7h9v9" }),
|
|
480
|
-
link: /* @__PURE__ */
|
|
520
|
+
link: /* @__PURE__ */ x(Y, { children: [
|
|
481
521
|
/* @__PURE__ */ n("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
|
|
482
522
|
/* @__PURE__ */ n("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
|
|
483
523
|
] }),
|
|
484
524
|
check: /* @__PURE__ */ n("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
|
|
485
525
|
fullscreen: /* @__PURE__ */ n("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
|
|
486
|
-
sun: /* @__PURE__ */
|
|
526
|
+
sun: /* @__PURE__ */ x(Y, { children: [
|
|
487
527
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
|
|
488
528
|
/* @__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" })
|
|
489
529
|
] }),
|
|
490
530
|
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" }),
|
|
491
|
-
panel: /* @__PURE__ */
|
|
531
|
+
panel: /* @__PURE__ */ x(Y, { children: [
|
|
492
532
|
/* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
493
533
|
/* @__PURE__ */ n("path", { d: "M15 4v16" })
|
|
494
534
|
] }),
|
|
495
|
-
alert: /* @__PURE__ */
|
|
535
|
+
alert: /* @__PURE__ */ x(Y, { children: [
|
|
496
536
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
|
|
497
537
|
/* @__PURE__ */ n("path", { d: "M12 7.5v5.5M12 16.2v.3" })
|
|
498
538
|
] }),
|
|
499
539
|
chevron: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6" }),
|
|
500
|
-
search: /* @__PURE__ */
|
|
540
|
+
search: /* @__PURE__ */ x(Y, { children: [
|
|
501
541
|
/* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "6.5" }),
|
|
502
542
|
/* @__PURE__ */ n("path", { d: "M20 20l-4.2-4.2" })
|
|
503
543
|
] }),
|
|
504
|
-
copy: /* @__PURE__ */
|
|
544
|
+
copy: /* @__PURE__ */ x(Y, { children: [
|
|
505
545
|
/* @__PURE__ */ n("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
|
|
506
546
|
/* @__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" })
|
|
507
547
|
] })
|
|
@@ -521,7 +561,7 @@ function H({ name: e, size: t = 16 }) {
|
|
|
521
561
|
strokeLinejoin: "round",
|
|
522
562
|
"aria-hidden": "true",
|
|
523
563
|
focusable: "false",
|
|
524
|
-
children:
|
|
564
|
+
children: zt[e]
|
|
525
565
|
}
|
|
526
566
|
);
|
|
527
567
|
}
|
|
@@ -666,7 +706,7 @@ const ne = {
|
|
|
666
706
|
empty: "Nada para mostrar ainda",
|
|
667
707
|
emptyHint: "O produto ainda não registrou telas nem componentes."
|
|
668
708
|
}
|
|
669
|
-
},
|
|
709
|
+
}, pn = {
|
|
670
710
|
network: {
|
|
671
711
|
success: "Success",
|
|
672
712
|
loading: "Loading",
|
|
@@ -808,7 +848,7 @@ const ne = {
|
|
|
808
848
|
emptyHint: "The product has not registered any screens or components yet."
|
|
809
849
|
}
|
|
810
850
|
};
|
|
811
|
-
function
|
|
851
|
+
function At(e) {
|
|
812
852
|
if (!e) return ne;
|
|
813
853
|
const t = { ...ne };
|
|
814
854
|
for (const s of Object.keys(ne)) {
|
|
@@ -817,72 +857,72 @@ function Ot(e) {
|
|
|
817
857
|
}
|
|
818
858
|
return t;
|
|
819
859
|
}
|
|
820
|
-
const
|
|
860
|
+
const Je = ht(ne);
|
|
821
861
|
function J() {
|
|
822
|
-
return
|
|
862
|
+
return ut(Je);
|
|
823
863
|
}
|
|
824
|
-
const
|
|
864
|
+
const mn = ne.network, Dt = [
|
|
825
865
|
{ id: "mobile", icon: "mobile" },
|
|
826
866
|
{ id: "tablet", icon: "tablet" },
|
|
827
867
|
{ id: "desktop", icon: "desktop" },
|
|
828
868
|
{ id: "fit", icon: "fit" }
|
|
829
|
-
],
|
|
830
|
-
function
|
|
831
|
-
return t > 0 ?
|
|
869
|
+
], Ae = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
|
|
870
|
+
function De(e, t) {
|
|
871
|
+
return t > 0 ? Ae.find((s) => s > e) ?? Re : [...Ae].reverse().find((s) => s < e) ?? Ee;
|
|
832
872
|
}
|
|
833
|
-
function
|
|
873
|
+
function Vt({
|
|
834
874
|
productName: e,
|
|
835
875
|
viewportId: t,
|
|
836
876
|
viewport: s,
|
|
837
877
|
zoom: o,
|
|
838
878
|
rotated: r,
|
|
839
879
|
theme: i,
|
|
840
|
-
issues:
|
|
841
|
-
linkUrl:
|
|
842
|
-
onViewport:
|
|
843
|
-
onRotate:
|
|
844
|
-
onZoom:
|
|
845
|
-
onCleanReview:
|
|
846
|
-
onToggleTheme:
|
|
880
|
+
issues: d,
|
|
881
|
+
linkUrl: l,
|
|
882
|
+
onViewport: w,
|
|
883
|
+
onRotate: h,
|
|
884
|
+
onZoom: u,
|
|
885
|
+
onCleanReview: c,
|
|
886
|
+
onToggleTheme: g
|
|
847
887
|
}) {
|
|
848
|
-
const
|
|
888
|
+
const k = J(), b = k.topbar, [$, R] = V(!1), N = (t === "mobile" || t === "tablet") && !!(s.width && s.height), P = async () => {
|
|
849
889
|
try {
|
|
850
|
-
await navigator.clipboard.writeText(
|
|
890
|
+
await navigator.clipboard.writeText(l);
|
|
851
891
|
} catch {
|
|
852
|
-
window.prompt(b.copyPrompt,
|
|
892
|
+
window.prompt(b.copyPrompt, l);
|
|
853
893
|
}
|
|
854
|
-
|
|
894
|
+
R(!0), window.setTimeout(() => R(!1), 1600);
|
|
855
895
|
};
|
|
856
|
-
return /* @__PURE__ */
|
|
857
|
-
/* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ x("header", { className: "ds-topbar", "aria-label": b.region, children: [
|
|
897
|
+
/* @__PURE__ */ x("div", { className: "ds-topbar__product", children: [
|
|
858
898
|
/* @__PURE__ */ n("span", { className: "ds-topbar__name", children: e }),
|
|
859
899
|
/* @__PURE__ */ n(
|
|
860
900
|
"a",
|
|
861
901
|
{
|
|
862
902
|
className: "ds-topbar__version",
|
|
863
|
-
href: `https://www.npmjs.com/package/${
|
|
903
|
+
href: `https://www.npmjs.com/package/${Ot}/v/${ze}`,
|
|
864
904
|
target: "_blank",
|
|
865
905
|
rel: "noreferrer",
|
|
866
|
-
children: b.engineVersion(
|
|
906
|
+
children: b.engineVersion(ze)
|
|
867
907
|
}
|
|
868
908
|
)
|
|
869
909
|
] }),
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
|
|
873
|
-
const
|
|
910
|
+
/* @__PURE__ */ x("div", { className: "ds-topbar__view", children: [
|
|
911
|
+
/* @__PURE__ */ x("div", { className: "ds-group", role: "group", "aria-label": b.viewportGroup, children: [
|
|
912
|
+
Dt.map((v) => {
|
|
913
|
+
const p = k.viewport[v.id] ?? v.id;
|
|
874
914
|
return /* @__PURE__ */ n(
|
|
875
915
|
"button",
|
|
876
916
|
{
|
|
877
917
|
type: "button",
|
|
878
918
|
className: "ds-btn ds-btn--icon",
|
|
879
|
-
"aria-pressed": t ===
|
|
880
|
-
"aria-label":
|
|
881
|
-
title:
|
|
882
|
-
onClick: () =>
|
|
883
|
-
children: /* @__PURE__ */ n(H, { name:
|
|
919
|
+
"aria-pressed": t === v.id,
|
|
920
|
+
"aria-label": p,
|
|
921
|
+
title: p,
|
|
922
|
+
onClick: () => w(v.id),
|
|
923
|
+
children: /* @__PURE__ */ n(H, { name: v.icon })
|
|
884
924
|
},
|
|
885
|
-
|
|
925
|
+
v.id
|
|
886
926
|
);
|
|
887
927
|
}),
|
|
888
928
|
/* @__PURE__ */ n(
|
|
@@ -894,12 +934,12 @@ function At({
|
|
|
894
934
|
"aria-label": b.rotate,
|
|
895
935
|
title: b.rotate,
|
|
896
936
|
disabled: !N,
|
|
897
|
-
onClick:
|
|
937
|
+
onClick: h,
|
|
898
938
|
children: /* @__PURE__ */ n(H, { name: "rotate" })
|
|
899
939
|
}
|
|
900
940
|
)
|
|
901
941
|
] }),
|
|
902
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ x("div", { className: "ds-group", role: "group", children: [
|
|
903
943
|
/* @__PURE__ */ n(
|
|
904
944
|
"button",
|
|
905
945
|
{
|
|
@@ -907,8 +947,8 @@ function At({
|
|
|
907
947
|
className: "ds-btn ds-btn--icon",
|
|
908
948
|
"aria-label": b.zoomOut,
|
|
909
949
|
title: b.zoomOut,
|
|
910
|
-
disabled: o <=
|
|
911
|
-
onClick: () =>
|
|
950
|
+
disabled: o <= Ee,
|
|
951
|
+
onClick: () => u(De(o, -1)),
|
|
912
952
|
children: /* @__PURE__ */ n(H, { name: "minus" })
|
|
913
953
|
}
|
|
914
954
|
),
|
|
@@ -919,7 +959,7 @@ function At({
|
|
|
919
959
|
className: "ds-btn ds-btn--zoom",
|
|
920
960
|
"aria-label": b.zoomReset,
|
|
921
961
|
title: b.zoomReset,
|
|
922
|
-
onClick: () =>
|
|
962
|
+
onClick: () => u(fe),
|
|
923
963
|
children: b.zoomValue(o)
|
|
924
964
|
}
|
|
925
965
|
),
|
|
@@ -930,8 +970,8 @@ function At({
|
|
|
930
970
|
className: "ds-btn ds-btn--icon",
|
|
931
971
|
"aria-label": b.zoomIn,
|
|
932
972
|
title: b.zoomIn,
|
|
933
|
-
disabled: o >=
|
|
934
|
-
onClick: () =>
|
|
973
|
+
disabled: o >= Re,
|
|
974
|
+
onClick: () => u(De(o, 1)),
|
|
935
975
|
children: /* @__PURE__ */ n(H, { name: "plus" })
|
|
936
976
|
}
|
|
937
977
|
)
|
|
@@ -943,21 +983,21 @@ function At({
|
|
|
943
983
|
className: "ds-btn ds-btn--icon",
|
|
944
984
|
"aria-label": b.cleanReview,
|
|
945
985
|
title: b.cleanReview,
|
|
946
|
-
onClick:
|
|
986
|
+
onClick: c,
|
|
947
987
|
children: /* @__PURE__ */ n(H, { name: "fullscreen" })
|
|
948
988
|
}
|
|
949
989
|
)
|
|
950
990
|
] }),
|
|
951
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ x("div", { className: "ds-topbar__tools", children: [
|
|
952
992
|
/* @__PURE__ */ n(
|
|
953
993
|
"button",
|
|
954
994
|
{
|
|
955
995
|
type: "button",
|
|
956
996
|
className: "ds-btn ds-btn--icon",
|
|
957
|
-
"aria-label":
|
|
958
|
-
title:
|
|
959
|
-
onClick:
|
|
960
|
-
children: /* @__PURE__ */ n(H, { name:
|
|
997
|
+
"aria-label": $ ? b.copied : b.copyLink,
|
|
998
|
+
title: $ ? b.copied : b.copyLink,
|
|
999
|
+
onClick: P,
|
|
1000
|
+
children: /* @__PURE__ */ n(H, { name: $ ? "check" : "link" })
|
|
961
1001
|
}
|
|
962
1002
|
),
|
|
963
1003
|
/* @__PURE__ */ n(
|
|
@@ -967,71 +1007,71 @@ function At({
|
|
|
967
1007
|
className: "ds-btn ds-btn--icon",
|
|
968
1008
|
"aria-label": i === "dark" ? b.lightMode : b.darkMode,
|
|
969
1009
|
title: i === "dark" ? b.lightMode : b.darkMode,
|
|
970
|
-
onClick:
|
|
1010
|
+
onClick: g,
|
|
971
1011
|
children: /* @__PURE__ */ n(H, { name: i === "dark" ? "sun" : "moon" })
|
|
972
1012
|
}
|
|
973
1013
|
),
|
|
974
|
-
|
|
1014
|
+
d.length > 0 && /* @__PURE__ */ n(Kt, { issues: d })
|
|
975
1015
|
] })
|
|
976
1016
|
] });
|
|
977
1017
|
}
|
|
978
|
-
function
|
|
979
|
-
const t = J(), [s, o] = V(!1), r =
|
|
1018
|
+
function Kt({ issues: e }) {
|
|
1019
|
+
const t = J(), [s, o] = V(!1), r = j(null), i = e.filter((w) => w.level === "error").length, d = e.length - i, l = t.topbar.diagnostics(i, d);
|
|
980
1020
|
return I(() => {
|
|
981
1021
|
if (!s) return;
|
|
982
|
-
const
|
|
983
|
-
r.current?.contains(
|
|
984
|
-
},
|
|
985
|
-
|
|
1022
|
+
const w = (u) => {
|
|
1023
|
+
r.current?.contains(u.target) || o(!1);
|
|
1024
|
+
}, h = (u) => {
|
|
1025
|
+
u.key === "Escape" && o(!1);
|
|
986
1026
|
};
|
|
987
|
-
return window.addEventListener("pointerdown",
|
|
988
|
-
window.removeEventListener("pointerdown",
|
|
1027
|
+
return window.addEventListener("pointerdown", w), window.addEventListener("keydown", h), () => {
|
|
1028
|
+
window.removeEventListener("pointerdown", w), window.removeEventListener("keydown", h);
|
|
989
1029
|
};
|
|
990
|
-
}, [s]), /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
1030
|
+
}, [s]), /* @__PURE__ */ x("div", { className: "ds-diagnostics", ref: r, children: [
|
|
1031
|
+
/* @__PURE__ */ x(
|
|
992
1032
|
"button",
|
|
993
1033
|
{
|
|
994
1034
|
type: "button",
|
|
995
1035
|
className: "ds-btn ds-diagnostics__trigger",
|
|
996
1036
|
"data-level": i > 0 ? "error" : "warning",
|
|
997
1037
|
"aria-expanded": s,
|
|
998
|
-
"aria-label":
|
|
999
|
-
title:
|
|
1000
|
-
onClick: () => o((
|
|
1038
|
+
"aria-label": l,
|
|
1039
|
+
title: l,
|
|
1040
|
+
onClick: () => o((w) => !w),
|
|
1001
1041
|
children: [
|
|
1002
1042
|
/* @__PURE__ */ n(H, { name: "alert" }),
|
|
1003
|
-
/* @__PURE__ */ n("span", { children: i > 0 ? i :
|
|
1043
|
+
/* @__PURE__ */ n("span", { children: i > 0 ? i : d })
|
|
1004
1044
|
]
|
|
1005
1045
|
}
|
|
1006
1046
|
),
|
|
1007
|
-
s && /* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */
|
|
1047
|
+
s && /* @__PURE__ */ x("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
|
|
1048
|
+
/* @__PURE__ */ x("div", { className: "ds-diagnostics__head", children: [
|
|
1009
1049
|
/* @__PURE__ */ n("strong", { children: t.diagnostics.title }),
|
|
1010
|
-
/* @__PURE__ */ n("span", { className: "ds-muted", children:
|
|
1050
|
+
/* @__PURE__ */ n("span", { className: "ds-muted", children: l })
|
|
1011
1051
|
] }),
|
|
1012
|
-
/* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((
|
|
1013
|
-
/* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children:
|
|
1014
|
-
/* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children:
|
|
1015
|
-
/* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children:
|
|
1016
|
-
] }, `${
|
|
1052
|
+
/* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((w, h) => /* @__PURE__ */ x("li", { className: "ds-diagnostics__item", "data-level": w.level, children: [
|
|
1053
|
+
/* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children: w.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
|
|
1054
|
+
/* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children: w.where }),
|
|
1055
|
+
/* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children: w.message })
|
|
1056
|
+
] }, `${w.where}-${h}`)) })
|
|
1017
1057
|
] })
|
|
1018
1058
|
] });
|
|
1019
1059
|
}
|
|
1020
|
-
const
|
|
1021
|
-
function
|
|
1022
|
-
const
|
|
1023
|
-
if (
|
|
1024
|
-
|
|
1060
|
+
const Ut = 16;
|
|
1061
|
+
function et({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: i }) {
|
|
1062
|
+
const d = j(void 0), l = e === "left" ? 1 : -1, w = (g) => {
|
|
1063
|
+
if (g.button === 0) {
|
|
1064
|
+
g.preventDefault(), d.current = { x: g.clientX, width: s };
|
|
1025
1065
|
try {
|
|
1026
|
-
|
|
1066
|
+
g.currentTarget.setPointerCapture(g.pointerId);
|
|
1027
1067
|
} catch {
|
|
1028
1068
|
}
|
|
1029
1069
|
r?.();
|
|
1030
1070
|
}
|
|
1031
|
-
},
|
|
1032
|
-
|
|
1033
|
-
},
|
|
1034
|
-
|
|
1071
|
+
}, h = (g) => {
|
|
1072
|
+
d.current && o(d.current.width + (g.clientX - d.current.x) * l);
|
|
1073
|
+
}, u = () => {
|
|
1074
|
+
d.current && (d.current = void 0, i?.());
|
|
1035
1075
|
};
|
|
1036
1076
|
return /* @__PURE__ */ n(
|
|
1037
1077
|
"div",
|
|
@@ -1043,98 +1083,98 @@ function Xe({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: i })
|
|
|
1043
1083
|
"aria-label": t,
|
|
1044
1084
|
"aria-valuenow": s,
|
|
1045
1085
|
tabIndex: 0,
|
|
1046
|
-
onPointerDown:
|
|
1047
|
-
onPointerMove:
|
|
1048
|
-
onPointerUp:
|
|
1049
|
-
onPointerCancel:
|
|
1050
|
-
onLostPointerCapture:
|
|
1051
|
-
onKeyDown: (
|
|
1052
|
-
if (
|
|
1053
|
-
|
|
1054
|
-
const
|
|
1055
|
-
o(s +
|
|
1086
|
+
onPointerDown: w,
|
|
1087
|
+
onPointerMove: h,
|
|
1088
|
+
onPointerUp: u,
|
|
1089
|
+
onPointerCancel: u,
|
|
1090
|
+
onLostPointerCapture: u,
|
|
1091
|
+
onKeyDown: (g) => {
|
|
1092
|
+
if (g.key !== "ArrowLeft" && g.key !== "ArrowRight") return;
|
|
1093
|
+
g.preventDefault();
|
|
1094
|
+
const k = g.key === "ArrowRight" ? 1 : -1;
|
|
1095
|
+
o(s + k * l * Ut);
|
|
1056
1096
|
}
|
|
1057
1097
|
}
|
|
1058
1098
|
);
|
|
1059
1099
|
}
|
|
1060
|
-
function
|
|
1100
|
+
function It({
|
|
1061
1101
|
registry: e,
|
|
1062
1102
|
handoff: t,
|
|
1063
1103
|
activeScreen: s,
|
|
1064
1104
|
activeComponent: o,
|
|
1065
1105
|
onOpenScreen: r,
|
|
1066
1106
|
onOpenComponent: i,
|
|
1067
|
-
width:
|
|
1068
|
-
onResize:
|
|
1069
|
-
onResizeStart:
|
|
1070
|
-
onResizeEnd:
|
|
1107
|
+
width: d,
|
|
1108
|
+
onResize: l,
|
|
1109
|
+
onResizeStart: w,
|
|
1110
|
+
onResizeEnd: h
|
|
1071
1111
|
}) {
|
|
1072
|
-
const
|
|
1073
|
-
() => o || !
|
|
1112
|
+
const c = J().sidebar, [g, k] = V(""), [b, $] = V(() => /* @__PURE__ */ new Set()), R = j(null), N = e.screensFor({ handoff: t }), P = e.componentsFor(t), v = N.length > 0, p = P.length > 0, [f, S] = V(
|
|
1113
|
+
() => o || !v ? "components" : "screens"
|
|
1074
1114
|
);
|
|
1075
1115
|
I(() => {
|
|
1076
|
-
o &&
|
|
1077
|
-
}, [o, s,
|
|
1078
|
-
const
|
|
1116
|
+
o && p ? S("components") : s && v && S("screens");
|
|
1117
|
+
}, [o, s, p, v]);
|
|
1118
|
+
const y = f;
|
|
1079
1119
|
I(() => {
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1120
|
+
const _ = (K) => {
|
|
1121
|
+
Bt(K) && (K.preventDefault(), R.current?.focus(), R.current?.select());
|
|
1082
1122
|
};
|
|
1083
|
-
return window.addEventListener("keydown",
|
|
1123
|
+
return window.addEventListener("keydown", _), () => window.removeEventListener("keydown", _);
|
|
1084
1124
|
}, []);
|
|
1085
|
-
const
|
|
1086
|
-
() => e.searchScreens(
|
|
1087
|
-
[t,
|
|
1088
|
-
),
|
|
1089
|
-
() => e.searchComponents(
|
|
1090
|
-
[t,
|
|
1091
|
-
),
|
|
1092
|
-
const
|
|
1093
|
-
return
|
|
1125
|
+
const T = D(
|
|
1126
|
+
() => e.searchScreens(g, { handoff: t }),
|
|
1127
|
+
[t, g, e]
|
|
1128
|
+
), a = D(
|
|
1129
|
+
() => e.searchComponents(g, t),
|
|
1130
|
+
[t, g, e]
|
|
1131
|
+
), m = D(() => Ht(a, c.ungrouped), [a, c.ungrouped]), C = D(() => Ge(T), [T]), L = g.trim().length > 0, O = (_) => $((K) => {
|
|
1132
|
+
const E = new Set(K);
|
|
1133
|
+
return E.has(_) ? E.delete(_) : E.add(_), E;
|
|
1094
1134
|
});
|
|
1095
|
-
return /* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1135
|
+
return /* @__PURE__ */ x("nav", { className: "ds-sidebar", "aria-label": c.region, style: { width: d }, children: [
|
|
1136
|
+
/* @__PURE__ */ x("div", { className: "ds-search", children: [
|
|
1097
1137
|
/* @__PURE__ */ n(H, { name: "search", size: 14 }),
|
|
1098
1138
|
/* @__PURE__ */ n(
|
|
1099
1139
|
"input",
|
|
1100
1140
|
{
|
|
1101
|
-
ref:
|
|
1141
|
+
ref: R,
|
|
1102
1142
|
className: "ds-input ds-search__input",
|
|
1103
1143
|
type: "search",
|
|
1104
|
-
value:
|
|
1105
|
-
placeholder:
|
|
1106
|
-
"aria-label":
|
|
1107
|
-
onChange: (
|
|
1108
|
-
onKeyDown: (
|
|
1109
|
-
|
|
1144
|
+
value: g,
|
|
1145
|
+
placeholder: c.searchPlaceholder,
|
|
1146
|
+
"aria-label": c.searchLabel,
|
|
1147
|
+
onChange: (_) => k(_.target.value),
|
|
1148
|
+
onKeyDown: (_) => {
|
|
1149
|
+
_.key === "Escape" && k("");
|
|
1110
1150
|
}
|
|
1111
1151
|
}
|
|
1112
1152
|
),
|
|
1113
|
-
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children:
|
|
1153
|
+
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: c.searchShortcut })
|
|
1114
1154
|
] }),
|
|
1115
|
-
/* @__PURE__ */
|
|
1155
|
+
/* @__PURE__ */ x("div", { className: "ds-tabs", role: "tablist", "aria-label": c.tabs, children: [
|
|
1116
1156
|
/* @__PURE__ */ n(
|
|
1117
|
-
|
|
1157
|
+
Ve,
|
|
1118
1158
|
{
|
|
1119
|
-
selected:
|
|
1120
|
-
label:
|
|
1121
|
-
count:
|
|
1122
|
-
onSelect: () =>
|
|
1159
|
+
selected: y === "screens",
|
|
1160
|
+
label: c.screensTab,
|
|
1161
|
+
count: L ? T.length : void 0,
|
|
1162
|
+
onSelect: () => S("screens")
|
|
1123
1163
|
}
|
|
1124
1164
|
),
|
|
1125
1165
|
/* @__PURE__ */ n(
|
|
1126
|
-
|
|
1166
|
+
Ve,
|
|
1127
1167
|
{
|
|
1128
|
-
selected:
|
|
1129
|
-
label:
|
|
1130
|
-
count:
|
|
1131
|
-
onSelect: () =>
|
|
1168
|
+
selected: y === "components",
|
|
1169
|
+
label: c.componentsTab,
|
|
1170
|
+
count: L ? a.length : void 0,
|
|
1171
|
+
onSelect: () => S("components")
|
|
1132
1172
|
}
|
|
1133
1173
|
)
|
|
1134
1174
|
] }),
|
|
1135
|
-
/* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children:
|
|
1136
|
-
const K = /* @__PURE__ */ n("ul", { className: "ds-items", children:
|
|
1137
|
-
|
|
1175
|
+
/* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: y === "screens" ? v ? T.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: c.noMatch(g) }) : C.map((_) => {
|
|
1176
|
+
const K = /* @__PURE__ */ n("ul", { className: "ds-items", children: _.screens.map((A) => /* @__PURE__ */ n(
|
|
1177
|
+
Wt,
|
|
1138
1178
|
{
|
|
1139
1179
|
screen: A,
|
|
1140
1180
|
active: A.id === s && !o,
|
|
@@ -1142,76 +1182,76 @@ function Kt({
|
|
|
1142
1182
|
},
|
|
1143
1183
|
A.id
|
|
1144
1184
|
)) });
|
|
1145
|
-
if (
|
|
1146
|
-
const
|
|
1147
|
-
return /* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1185
|
+
if (_.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: K }, "");
|
|
1186
|
+
const E = `screens:${_.name}`, z = b.has(E) && !L;
|
|
1187
|
+
return /* @__PURE__ */ x("section", { className: "ds-group-section", children: [
|
|
1188
|
+
/* @__PURE__ */ x(
|
|
1149
1189
|
"button",
|
|
1150
1190
|
{
|
|
1151
1191
|
type: "button",
|
|
1152
1192
|
className: "ds-group-section__head",
|
|
1153
|
-
"aria-expanded": !
|
|
1154
|
-
"aria-label":
|
|
1155
|
-
onClick: () =>
|
|
1193
|
+
"aria-expanded": !z,
|
|
1194
|
+
"aria-label": c.toggleGroup(_.name),
|
|
1195
|
+
onClick: () => O(E),
|
|
1156
1196
|
children: [
|
|
1157
1197
|
/* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
|
|
1158
|
-
/* @__PURE__ */ n("span", { children:
|
|
1159
|
-
/* @__PURE__ */ n("span", { className: "ds-count", children:
|
|
1198
|
+
/* @__PURE__ */ n("span", { children: _.name }),
|
|
1199
|
+
/* @__PURE__ */ n("span", { className: "ds-count", children: _.screens.length })
|
|
1160
1200
|
]
|
|
1161
1201
|
}
|
|
1162
1202
|
),
|
|
1163
|
-
!
|
|
1164
|
-
] },
|
|
1165
|
-
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children:
|
|
1166
|
-
const
|
|
1167
|
-
return /* @__PURE__ */
|
|
1168
|
-
/* @__PURE__ */
|
|
1203
|
+
!z && K
|
|
1204
|
+
] }, E);
|
|
1205
|
+
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children: c.emptyScreens }) : p ? a.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: c.noMatch(g) }) : m.map(({ group: _, items: K }) => {
|
|
1206
|
+
const E = b.has(_) && !L;
|
|
1207
|
+
return /* @__PURE__ */ x("section", { className: "ds-group-section", children: [
|
|
1208
|
+
/* @__PURE__ */ x(
|
|
1169
1209
|
"button",
|
|
1170
1210
|
{
|
|
1171
1211
|
type: "button",
|
|
1172
1212
|
className: "ds-group-section__head",
|
|
1173
|
-
"aria-expanded": !
|
|
1174
|
-
"aria-label":
|
|
1175
|
-
onClick: () =>
|
|
1213
|
+
"aria-expanded": !E,
|
|
1214
|
+
"aria-label": c.toggleGroup(_),
|
|
1215
|
+
onClick: () => O(_),
|
|
1176
1216
|
children: [
|
|
1177
1217
|
/* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
|
|
1178
|
-
/* @__PURE__ */ n("span", { children:
|
|
1218
|
+
/* @__PURE__ */ n("span", { children: _ }),
|
|
1179
1219
|
/* @__PURE__ */ n("span", { className: "ds-count", children: K.length })
|
|
1180
1220
|
]
|
|
1181
1221
|
}
|
|
1182
1222
|
),
|
|
1183
|
-
!
|
|
1223
|
+
!E && /* @__PURE__ */ n("ul", { className: "ds-items", children: K.map((z) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
1184
1224
|
"button",
|
|
1185
1225
|
{
|
|
1186
1226
|
type: "button",
|
|
1187
1227
|
className: "ds-item",
|
|
1188
|
-
"aria-current":
|
|
1189
|
-
onClick: () => i(
|
|
1190
|
-
children: /* @__PURE__ */ n("span", { className: "ds-item__title", children:
|
|
1228
|
+
"aria-current": z.id === o ? "true" : void 0,
|
|
1229
|
+
onClick: () => i(z.id),
|
|
1230
|
+
children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: z.name })
|
|
1191
1231
|
}
|
|
1192
|
-
) },
|
|
1193
|
-
] },
|
|
1194
|
-
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children:
|
|
1232
|
+
) }, z.id)) })
|
|
1233
|
+
] }, _);
|
|
1234
|
+
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children: c.emptyComponents }) }),
|
|
1195
1235
|
/* @__PURE__ */ n(
|
|
1196
|
-
|
|
1236
|
+
et,
|
|
1197
1237
|
{
|
|
1198
1238
|
side: "left",
|
|
1199
|
-
label:
|
|
1200
|
-
value:
|
|
1201
|
-
onChange:
|
|
1202
|
-
onStart:
|
|
1203
|
-
onEnd:
|
|
1239
|
+
label: c.resize,
|
|
1240
|
+
value: d,
|
|
1241
|
+
onChange: l,
|
|
1242
|
+
onStart: w,
|
|
1243
|
+
onEnd: h
|
|
1204
1244
|
}
|
|
1205
1245
|
)
|
|
1206
1246
|
] });
|
|
1207
1247
|
}
|
|
1208
|
-
function
|
|
1248
|
+
function Ve({
|
|
1209
1249
|
selected: e,
|
|
1210
1250
|
label: t,
|
|
1211
1251
|
count: s,
|
|
1212
1252
|
onSelect: o
|
|
1213
1253
|
}) {
|
|
1214
|
-
return /* @__PURE__ */
|
|
1254
|
+
return /* @__PURE__ */ x(
|
|
1215
1255
|
"button",
|
|
1216
1256
|
{
|
|
1217
1257
|
type: "button",
|
|
@@ -1227,12 +1267,12 @@ function Ae({
|
|
|
1227
1267
|
}
|
|
1228
1268
|
);
|
|
1229
1269
|
}
|
|
1230
|
-
function
|
|
1270
|
+
function Wt({
|
|
1231
1271
|
screen: e,
|
|
1232
1272
|
active: t,
|
|
1233
1273
|
onOpen: s
|
|
1234
1274
|
}) {
|
|
1235
|
-
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ x(
|
|
1236
1276
|
"button",
|
|
1237
1277
|
{
|
|
1238
1278
|
type: "button",
|
|
@@ -1246,7 +1286,7 @@ function Ut({
|
|
|
1246
1286
|
}
|
|
1247
1287
|
) });
|
|
1248
1288
|
}
|
|
1249
|
-
function
|
|
1289
|
+
function Ht(e, t) {
|
|
1250
1290
|
const s = /* @__PURE__ */ new Map();
|
|
1251
1291
|
for (const o of e) {
|
|
1252
1292
|
const r = o.group?.trim() || t, i = s.get(r) ?? [];
|
|
@@ -1254,10 +1294,10 @@ function It(e, t) {
|
|
|
1254
1294
|
}
|
|
1255
1295
|
return [...s].map(([o, r]) => ({ group: o, items: r }));
|
|
1256
1296
|
}
|
|
1257
|
-
function
|
|
1297
|
+
function Bt(e) {
|
|
1258
1298
|
return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "k";
|
|
1259
1299
|
}
|
|
1260
|
-
function
|
|
1300
|
+
function jt({
|
|
1261
1301
|
screen: e,
|
|
1262
1302
|
variations: t,
|
|
1263
1303
|
components: s,
|
|
@@ -1265,49 +1305,49 @@ function Ht({
|
|
|
1265
1305
|
labels: r,
|
|
1266
1306
|
overrides: i
|
|
1267
1307
|
}) {
|
|
1268
|
-
const
|
|
1269
|
-
e.description &&
|
|
1270
|
-
const
|
|
1271
|
-
if (
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1308
|
+
const d = r.pr, l = [`## ${e.name}`, ""];
|
|
1309
|
+
e.description && l.push(e.description, ""), l.push(`\`${e.route.path}\``, "");
|
|
1310
|
+
const w = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, h = o.shortCommit ? d.commit(o.shortCommit) : void 0;
|
|
1311
|
+
if (l.push(`### ${d.variations}`, ""), t.length === 0) {
|
|
1312
|
+
const u = new URL(e.href, o.origin);
|
|
1313
|
+
Ne(u.searchParams, i), l.push(`- [${r.panel.defaultVariation}](${u.toString()})`);
|
|
1274
1314
|
}
|
|
1275
|
-
for (const
|
|
1276
|
-
const
|
|
1277
|
-
let
|
|
1278
|
-
if (
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
} else
|
|
1282
|
-
|
|
1315
|
+
for (const u of t) {
|
|
1316
|
+
const c = me(u, { origin: o.origin, overrides: i });
|
|
1317
|
+
let g = `- [${tt(u.title)}](${c})`;
|
|
1318
|
+
if (w) {
|
|
1319
|
+
const k = me(u, { origin: w, overrides: i });
|
|
1320
|
+
g += ` · [${h ?? d.immutableLink}](${k})`;
|
|
1321
|
+
} else h && (g += ` · ${h}`);
|
|
1322
|
+
l.push(g);
|
|
1283
1323
|
}
|
|
1284
|
-
if (
|
|
1285
|
-
|
|
1286
|
-
for (const
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1324
|
+
if (l.push(""), s.length > 0) {
|
|
1325
|
+
l.push(`### ${d.components}`, ""), l.push(`| ${d.component} | ${d.source} |`, "| --- | --- |");
|
|
1326
|
+
for (const u of s) {
|
|
1327
|
+
const c = u.source ? `\`${we(u.source)}\`` : d.empty;
|
|
1328
|
+
l.push(`| ${we(u.name)} (\`${u.id}\`) | ${c} |`);
|
|
1289
1329
|
}
|
|
1290
|
-
|
|
1330
|
+
l.push("");
|
|
1291
1331
|
}
|
|
1292
|
-
|
|
1293
|
-
for (const
|
|
1294
|
-
if (
|
|
1295
|
-
for (const
|
|
1332
|
+
l.push(`### ${d.expected}`, ""), t.length === 0 && l.push(`**${r.panel.defaultVariation}**`, "", d.noExpected, "");
|
|
1333
|
+
for (const u of t) {
|
|
1334
|
+
if (l.push(`**${u.title}**`, ""), u.expected?.length)
|
|
1335
|
+
for (const c of u.expected) l.push(`- ${c}`);
|
|
1296
1336
|
else
|
|
1297
|
-
|
|
1298
|
-
|
|
1337
|
+
l.push(d.noExpected);
|
|
1338
|
+
l.push("");
|
|
1299
1339
|
}
|
|
1300
|
-
return `${
|
|
1340
|
+
return `${l.join(`
|
|
1301
1341
|
`).trimEnd()}
|
|
1302
1342
|
`;
|
|
1303
1343
|
}
|
|
1304
|
-
function
|
|
1344
|
+
function we(e) {
|
|
1305
1345
|
return e.replace(/\|/g, "\\|").replace(/\n/g, " ");
|
|
1306
1346
|
}
|
|
1307
|
-
function
|
|
1347
|
+
function tt(e) {
|
|
1308
1348
|
return e.replace(/([[\]])/g, "\\$1");
|
|
1309
1349
|
}
|
|
1310
|
-
function
|
|
1350
|
+
function qt({
|
|
1311
1351
|
flow: e,
|
|
1312
1352
|
registry: t,
|
|
1313
1353
|
open: s,
|
|
@@ -1315,116 +1355,116 @@ function Bt({
|
|
|
1315
1355
|
labels: r,
|
|
1316
1356
|
overrides: i
|
|
1317
1357
|
}) {
|
|
1318
|
-
const
|
|
1319
|
-
if (s && s.screen.id ===
|
|
1320
|
-
const
|
|
1321
|
-
for (const N of
|
|
1322
|
-
for (const [N,
|
|
1323
|
-
return
|
|
1358
|
+
const d = r.pr, l = [`## ${e.name}`, ""], w = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, h = o.shortCommit ? d.commit(o.shortCommit) : void 0, u = (c, g) => {
|
|
1359
|
+
if (s && s.screen.id === c.id) {
|
|
1360
|
+
const $ = new URL(s.location.path || "/", g), R = new URLSearchParams(s.location.search);
|
|
1361
|
+
for (const N of gt) R.delete(N);
|
|
1362
|
+
for (const [N, P] of R) $.searchParams.append(N, P);
|
|
1363
|
+
return Ne($.searchParams, i), $.toString();
|
|
1324
1364
|
}
|
|
1325
|
-
const
|
|
1326
|
-
if (
|
|
1327
|
-
const b = new URL(
|
|
1328
|
-
return
|
|
1365
|
+
const k = c.variations[0];
|
|
1366
|
+
if (k) return me(k, { origin: g, overrides: i });
|
|
1367
|
+
const b = new URL(c.href, g);
|
|
1368
|
+
return Ne(b.searchParams, i), b.toString();
|
|
1329
1369
|
};
|
|
1330
|
-
for (const
|
|
1331
|
-
|
|
1332
|
-
let
|
|
1333
|
-
if (
|
|
1334
|
-
|
|
1335
|
-
for (const N of
|
|
1336
|
-
|
|
1337
|
-
for (const
|
|
1338
|
-
const
|
|
1339
|
-
(
|
|
1370
|
+
for (const c of e.screens) {
|
|
1371
|
+
l.push(`### ${c.name}`, ""), c.description && l.push(c.description, "");
|
|
1372
|
+
let g = `\`${c.route.path}\` · [${d.open}](${u(c, o.origin)})`;
|
|
1373
|
+
if (w ? g += ` · [${h ?? d.immutableLink}](${u(c, w)})` : h && (g += ` · ${h}`), l.push(g, ""), c.controls.length > 0) {
|
|
1374
|
+
l.push(`**${d.controls}**`, "");
|
|
1375
|
+
for (const N of c.controls) {
|
|
1376
|
+
l.push(`- ${le(N.title)} (\`${N.id}\`)`);
|
|
1377
|
+
for (const P of N.controls) {
|
|
1378
|
+
const v = Se(P), p = P.options.map(
|
|
1379
|
+
(f) => f.value === v ? `${le(f.label)} (\`${f.value}\`, ${d.defaultOption})` : `${le(f.label)} (\`${f.value}\`)`
|
|
1340
1380
|
).join(" · ");
|
|
1341
|
-
|
|
1381
|
+
l.push(` - ${le(P.label)} (\`c.${P.id}\`): ${p}`);
|
|
1342
1382
|
}
|
|
1343
1383
|
}
|
|
1344
|
-
|
|
1384
|
+
l.push("");
|
|
1345
1385
|
}
|
|
1346
|
-
if (
|
|
1347
|
-
|
|
1348
|
-
for (const N of
|
|
1349
|
-
|
|
1350
|
-
`- [${
|
|
1386
|
+
if (c.variations.length > 0) {
|
|
1387
|
+
l.push(`**${d.shortcuts}**`, "");
|
|
1388
|
+
for (const N of c.variations)
|
|
1389
|
+
l.push(
|
|
1390
|
+
`- [${tt(N.title)}](${me(N, { origin: o.origin, overrides: i })})`
|
|
1351
1391
|
);
|
|
1352
|
-
|
|
1392
|
+
l.push("");
|
|
1353
1393
|
}
|
|
1354
|
-
|
|
1355
|
-
const
|
|
1356
|
-
(N) => N.expected?.length && N.id !==
|
|
1394
|
+
l.push(`**${d.expected}**`, "");
|
|
1395
|
+
const k = s?.screen.id === c.id ? s.variation : void 0, b = k?.expected?.length ? k.expected : c.route.expected, $ = c.variations.filter(
|
|
1396
|
+
(N) => N.expected?.length && N.id !== k?.id
|
|
1357
1397
|
);
|
|
1358
|
-
if (!b?.length &&
|
|
1359
|
-
for (const N of b)
|
|
1360
|
-
|
|
1398
|
+
if (!b?.length && $.length === 0 && l.push(d.noExpected, ""), b?.length) {
|
|
1399
|
+
for (const N of b) l.push(`- ${N}`);
|
|
1400
|
+
l.push("");
|
|
1361
1401
|
}
|
|
1362
|
-
for (const N of
|
|
1363
|
-
|
|
1364
|
-
for (const
|
|
1365
|
-
|
|
1402
|
+
for (const N of $) {
|
|
1403
|
+
l.push(`*${N.title}*`, "");
|
|
1404
|
+
for (const P of N.expected ?? []) l.push(`- ${P}`);
|
|
1405
|
+
l.push("");
|
|
1366
1406
|
}
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1369
|
-
|
|
1370
|
-
for (const N of
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1407
|
+
const R = t.componentsOfScreen(c);
|
|
1408
|
+
if (R.length > 0) {
|
|
1409
|
+
l.push(`**${d.components}**`, ""), l.push(`| ${d.component} | ${d.source} |`, "| --- | --- |");
|
|
1410
|
+
for (const N of R) {
|
|
1411
|
+
const P = N.source ? `\`${we(N.source)}\`` : d.empty;
|
|
1412
|
+
l.push(`| ${we(N.name)} (\`${N.id}\`) | ${P} |`);
|
|
1373
1413
|
}
|
|
1374
|
-
|
|
1414
|
+
l.push("");
|
|
1375
1415
|
}
|
|
1376
1416
|
}
|
|
1377
|
-
return `${
|
|
1417
|
+
return `${l.join(`
|
|
1378
1418
|
`).trimEnd()}
|
|
1379
1419
|
`;
|
|
1380
1420
|
}
|
|
1381
|
-
function
|
|
1421
|
+
function le(e) {
|
|
1382
1422
|
return e.replace(/([*_[\]`])/g, "\\$1");
|
|
1383
1423
|
}
|
|
1384
|
-
function
|
|
1385
|
-
const { tab: t, onTab: s, width: o, onResize: r, onResizeStart: i, onResizeEnd:
|
|
1386
|
-
const
|
|
1387
|
-
return
|
|
1388
|
-
}), N =
|
|
1424
|
+
function Gt(e) {
|
|
1425
|
+
const { tab: t, onTab: s, width: o, onResize: r, onResizeStart: i, onResizeEnd: d } = e, l = J().panel, [w, h] = V(""), u = j(null), c = j(null), [g, k] = V(!1), [b, $] = V(() => /* @__PURE__ */ new Set()), R = (P) => $((v) => {
|
|
1426
|
+
const p = new Set(v);
|
|
1427
|
+
return p.has(P) ? p.delete(P) : p.add(P), p;
|
|
1428
|
+
}), N = w.trim().length > 0;
|
|
1389
1429
|
return I(() => {
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1430
|
+
const P = (v) => {
|
|
1431
|
+
Qt(v) && (v.preventDefault(), u.current?.focus(), u.current?.select());
|
|
1392
1432
|
};
|
|
1393
|
-
return window.addEventListener("keydown",
|
|
1394
|
-
}, []),
|
|
1395
|
-
|
|
1396
|
-
}), /* @__PURE__ */
|
|
1433
|
+
return window.addEventListener("keydown", P), () => window.removeEventListener("keydown", P);
|
|
1434
|
+
}, []), We(() => {
|
|
1435
|
+
k(Xt(c.current, w));
|
|
1436
|
+
}), /* @__PURE__ */ x("aside", { className: "ds-panel", "aria-label": l.region, style: { width: o }, children: [
|
|
1397
1437
|
/* @__PURE__ */ n(
|
|
1398
|
-
|
|
1438
|
+
et,
|
|
1399
1439
|
{
|
|
1400
1440
|
side: "right",
|
|
1401
|
-
label:
|
|
1441
|
+
label: l.resize,
|
|
1402
1442
|
value: o,
|
|
1403
1443
|
onChange: r,
|
|
1404
1444
|
onStart: i,
|
|
1405
|
-
onEnd:
|
|
1445
|
+
onEnd: d
|
|
1406
1446
|
}
|
|
1407
1447
|
),
|
|
1408
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ x("div", { className: "ds-search", children: [
|
|
1409
1449
|
/* @__PURE__ */ n(H, { name: "search", size: 14 }),
|
|
1410
1450
|
/* @__PURE__ */ n(
|
|
1411
1451
|
"input",
|
|
1412
1452
|
{
|
|
1413
|
-
ref:
|
|
1453
|
+
ref: u,
|
|
1414
1454
|
className: "ds-input ds-search__input",
|
|
1415
1455
|
type: "search",
|
|
1416
|
-
value:
|
|
1417
|
-
placeholder:
|
|
1418
|
-
"aria-label":
|
|
1419
|
-
onChange: (
|
|
1420
|
-
onKeyDown: (
|
|
1421
|
-
|
|
1456
|
+
value: w,
|
|
1457
|
+
placeholder: l.searchPlaceholder,
|
|
1458
|
+
"aria-label": l.searchLabel,
|
|
1459
|
+
onChange: (P) => h(P.target.value),
|
|
1460
|
+
onKeyDown: (P) => {
|
|
1461
|
+
P.key === "Escape" && h("");
|
|
1422
1462
|
}
|
|
1423
1463
|
}
|
|
1424
1464
|
),
|
|
1425
|
-
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children:
|
|
1465
|
+
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: l.searchShortcut })
|
|
1426
1466
|
] }),
|
|
1427
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ x("div", { className: "ds-tabs", role: "tablist", "aria-label": l.tabs, children: [
|
|
1428
1468
|
/* @__PURE__ */ n(
|
|
1429
1469
|
"button",
|
|
1430
1470
|
{
|
|
@@ -1434,7 +1474,7 @@ function jt(e) {
|
|
|
1434
1474
|
"aria-selected": t === "variations",
|
|
1435
1475
|
tabIndex: t === "variations" ? 0 : -1,
|
|
1436
1476
|
onClick: () => s("variations"),
|
|
1437
|
-
children:
|
|
1477
|
+
children: l.variationsTab
|
|
1438
1478
|
}
|
|
1439
1479
|
),
|
|
1440
1480
|
/* @__PURE__ */ n(
|
|
@@ -1446,146 +1486,146 @@ function jt(e) {
|
|
|
1446
1486
|
"aria-selected": t === "info",
|
|
1447
1487
|
tabIndex: t === "info" ? 0 : -1,
|
|
1448
1488
|
onClick: () => s("info"),
|
|
1449
|
-
children:
|
|
1489
|
+
children: l.infoTab
|
|
1450
1490
|
}
|
|
1451
1491
|
)
|
|
1452
1492
|
] }),
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
t === "variations" ? /* @__PURE__ */ n(
|
|
1455
|
-
|
|
1493
|
+
/* @__PURE__ */ x("div", { className: "ds-panel__body", role: "tabpanel", ref: c, children: [
|
|
1494
|
+
t === "variations" ? /* @__PURE__ */ n(Zt, { ...e, collapsed: b, onToggle: R, filtering: N }) : /* @__PURE__ */ n(Yt, { ...e }),
|
|
1495
|
+
g && /* @__PURE__ */ n("p", { className: "ds-empty", children: l.noMatch(w) })
|
|
1456
1496
|
] })
|
|
1457
1497
|
] });
|
|
1458
1498
|
}
|
|
1459
|
-
function
|
|
1499
|
+
function Zt({
|
|
1460
1500
|
registry: e,
|
|
1461
1501
|
controls: t,
|
|
1462
1502
|
screen: s,
|
|
1463
1503
|
variation: o,
|
|
1464
1504
|
component: r,
|
|
1465
1505
|
componentFixture: i,
|
|
1466
|
-
onOpenScenario:
|
|
1467
|
-
onOpenComponent:
|
|
1468
|
-
onChange:
|
|
1506
|
+
onOpenScenario: d,
|
|
1507
|
+
onOpenComponent: l,
|
|
1508
|
+
onChange: w
|
|
1469
1509
|
}) {
|
|
1470
|
-
const
|
|
1510
|
+
const h = J(), u = h.panel;
|
|
1471
1511
|
if (r) {
|
|
1472
|
-
const
|
|
1473
|
-
if (
|
|
1474
|
-
const
|
|
1475
|
-
return /* @__PURE__ */
|
|
1476
|
-
i.didFallback && i.requestedId &&
|
|
1477
|
-
/* @__PURE__ */ n(
|
|
1512
|
+
const v = r.fixtures ?? [];
|
|
1513
|
+
if (v.length === 0) return /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noComponentVariations });
|
|
1514
|
+
const p = i.fixture;
|
|
1515
|
+
return /* @__PURE__ */ x("div", { className: "ds-vcards", children: [
|
|
1516
|
+
i.didFallback && i.requestedId && p && /* @__PURE__ */ n("p", { className: "ds-notice", children: u.fixtureFallback(i.requestedId, p.id) }),
|
|
1517
|
+
/* @__PURE__ */ n(de, { title: r.name, hint: p?.description, children: /* @__PURE__ */ n(
|
|
1478
1518
|
ee,
|
|
1479
1519
|
{
|
|
1480
|
-
label:
|
|
1481
|
-
value:
|
|
1482
|
-
options:
|
|
1483
|
-
onChange: (
|
|
1520
|
+
label: u.componentVariations,
|
|
1521
|
+
value: p?.id ?? "",
|
|
1522
|
+
options: v.map((f) => ({ value: f.id, label: f.label })),
|
|
1523
|
+
onChange: (f) => w({ fixture: f })
|
|
1484
1524
|
}
|
|
1485
1525
|
) })
|
|
1486
1526
|
] });
|
|
1487
1527
|
}
|
|
1488
|
-
if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children:
|
|
1489
|
-
const
|
|
1490
|
-
return /* @__PURE__ */
|
|
1491
|
-
/* @__PURE__ */
|
|
1528
|
+
if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children: u.nothingSelected });
|
|
1529
|
+
const c = s.variations, g = e.product, k = g.theme?.modes ?? [], b = g.theme?.locales ?? [], $ = g.dataSources?.adapters ?? [], R = t.screenControls ?? {}, N = o && Nt(o, R) ? o : void 0, P = (v, p) => w({ screenControls: { ...R, [v]: p } });
|
|
1530
|
+
return /* @__PURE__ */ x("div", { className: "ds-vcards", children: [
|
|
1531
|
+
/* @__PURE__ */ x(de, { title: u.context, children: [
|
|
1492
1532
|
/* @__PURE__ */ n(
|
|
1493
1533
|
ee,
|
|
1494
1534
|
{
|
|
1495
|
-
label:
|
|
1535
|
+
label: u.persona,
|
|
1496
1536
|
value: t.persona ?? "",
|
|
1497
1537
|
options: [
|
|
1498
1538
|
// Com persona padrão, "nenhuma" não é uma situação possível.
|
|
1499
|
-
...e.defaultPersona ? [] : [{ value: "", label:
|
|
1500
|
-
...
|
|
1539
|
+
...e.defaultPersona ? [] : [{ value: "", label: u.none }],
|
|
1540
|
+
...g.personas.map((v) => ({ value: v.id, label: v.name }))
|
|
1501
1541
|
],
|
|
1502
|
-
onChange: (
|
|
1542
|
+
onChange: (v) => w({ persona: v || void 0 })
|
|
1503
1543
|
}
|
|
1504
1544
|
),
|
|
1505
1545
|
/* @__PURE__ */ n(
|
|
1506
1546
|
ee,
|
|
1507
1547
|
{
|
|
1508
|
-
label:
|
|
1548
|
+
label: u.network,
|
|
1509
1549
|
value: t.network,
|
|
1510
|
-
options:
|
|
1511
|
-
onChange: (
|
|
1550
|
+
options: je.map((v) => ({ value: v, label: h.network[v] })),
|
|
1551
|
+
onChange: (v) => w({ network: v })
|
|
1512
1552
|
}
|
|
1513
1553
|
),
|
|
1514
|
-
|
|
1554
|
+
k.length > 1 && /* @__PURE__ */ n(
|
|
1515
1555
|
ee,
|
|
1516
1556
|
{
|
|
1517
|
-
label:
|
|
1518
|
-
value: t.themeMode ??
|
|
1519
|
-
options:
|
|
1520
|
-
onChange: (
|
|
1557
|
+
label: u.theme,
|
|
1558
|
+
value: t.themeMode ?? k[0],
|
|
1559
|
+
options: k.map((v) => ({ value: v, label: v })),
|
|
1560
|
+
onChange: (v) => w({ themeMode: v })
|
|
1521
1561
|
}
|
|
1522
1562
|
),
|
|
1523
1563
|
b.length > 1 && /* @__PURE__ */ n(
|
|
1524
1564
|
ee,
|
|
1525
1565
|
{
|
|
1526
|
-
label:
|
|
1566
|
+
label: u.locale,
|
|
1527
1567
|
value: t.locale ?? b[0],
|
|
1528
|
-
options: b.map((
|
|
1529
|
-
onChange: (
|
|
1568
|
+
options: b.map((v) => ({ value: v, label: v })),
|
|
1569
|
+
onChange: (v) => w({ locale: v })
|
|
1530
1570
|
}
|
|
1531
1571
|
),
|
|
1532
|
-
|
|
1572
|
+
$.length > 0 && /* @__PURE__ */ n(
|
|
1533
1573
|
ee,
|
|
1534
1574
|
{
|
|
1535
|
-
label:
|
|
1575
|
+
label: u.dataSource,
|
|
1536
1576
|
value: t.dataSource ?? "fixtures",
|
|
1537
1577
|
options: [
|
|
1538
|
-
{ value: "fixtures", label:
|
|
1539
|
-
|
|
1578
|
+
{ value: "fixtures", label: u.fixturesOption },
|
|
1579
|
+
...$.map((v) => ({ value: v.id, label: v.label }))
|
|
1540
1580
|
],
|
|
1541
|
-
onChange: (
|
|
1581
|
+
onChange: (v) => w({ dataSource: v })
|
|
1542
1582
|
}
|
|
1543
1583
|
)
|
|
1544
1584
|
] }),
|
|
1545
|
-
s.controls.map((
|
|
1546
|
-
const
|
|
1585
|
+
s.controls.map((v) => {
|
|
1586
|
+
const p = e.component(v.component);
|
|
1547
1587
|
return /* @__PURE__ */ n(
|
|
1548
|
-
|
|
1588
|
+
de,
|
|
1549
1589
|
{
|
|
1550
|
-
title:
|
|
1551
|
-
hint:
|
|
1552
|
-
link:
|
|
1553
|
-
children:
|
|
1590
|
+
title: v.title,
|
|
1591
|
+
hint: v.note,
|
|
1592
|
+
link: p ? { label: u.openComponent(p.name), onOpen: () => l(p.id) } : void 0,
|
|
1593
|
+
children: v.controls.map((f) => /* @__PURE__ */ n(
|
|
1554
1594
|
ee,
|
|
1555
1595
|
{
|
|
1556
|
-
label:
|
|
1557
|
-
hint:
|
|
1558
|
-
value:
|
|
1559
|
-
options:
|
|
1560
|
-
onChange: (
|
|
1596
|
+
label: f.label,
|
|
1597
|
+
hint: f.description,
|
|
1598
|
+
value: R[f.id] ?? Se(f),
|
|
1599
|
+
options: f.options ?? [],
|
|
1600
|
+
onChange: (S) => P(f.id, S)
|
|
1561
1601
|
},
|
|
1562
|
-
|
|
1602
|
+
f.id
|
|
1563
1603
|
))
|
|
1564
1604
|
},
|
|
1565
|
-
|
|
1605
|
+
v.id
|
|
1566
1606
|
);
|
|
1567
1607
|
}),
|
|
1568
|
-
|
|
1608
|
+
c.length > 0 && /* @__PURE__ */ n(de, { title: u.shortcuts, children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": u.variationsList, children: c.map((v) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
|
|
1569
1609
|
"button",
|
|
1570
1610
|
{
|
|
1571
1611
|
type: "button",
|
|
1572
1612
|
className: "ds-item",
|
|
1573
|
-
title:
|
|
1574
|
-
"aria-current": N?.id ===
|
|
1575
|
-
onClick: () =>
|
|
1576
|
-
children: /* @__PURE__ */ n("span", { className: "ds-item__title", children:
|
|
1613
|
+
title: v.intent,
|
|
1614
|
+
"aria-current": N?.id === v.id ? "true" : void 0,
|
|
1615
|
+
onClick: () => d(v.id),
|
|
1616
|
+
children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: v.title })
|
|
1577
1617
|
}
|
|
1578
|
-
) },
|
|
1618
|
+
) }, v.id)) }) })
|
|
1579
1619
|
] });
|
|
1580
1620
|
}
|
|
1581
|
-
function
|
|
1621
|
+
function de({
|
|
1582
1622
|
title: e,
|
|
1583
1623
|
hint: t,
|
|
1584
1624
|
link: s,
|
|
1585
1625
|
children: o
|
|
1586
1626
|
}) {
|
|
1587
|
-
return /* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1627
|
+
return /* @__PURE__ */ x("section", { className: "ds-vcard", "data-ds-filter-group": !0, children: [
|
|
1628
|
+
/* @__PURE__ */ x("header", { className: "ds-vcard__head", title: t ? `${e} — ${t}` : e, children: [
|
|
1589
1629
|
/* @__PURE__ */ n("h3", { className: "ds-vcard__title ds-section__title", "data-ds-filter-title": !0, children: e }),
|
|
1590
1630
|
s && /* @__PURE__ */ n(
|
|
1591
1631
|
"button",
|
|
@@ -1609,234 +1649,234 @@ function ee({
|
|
|
1609
1649
|
options: o,
|
|
1610
1650
|
onChange: r
|
|
1611
1651
|
}) {
|
|
1612
|
-
return /* @__PURE__ */
|
|
1652
|
+
return /* @__PURE__ */ x("label", { className: "ds-vcard__field", "data-ds-filter": !0, title: t ? `${e} — ${t}` : e, children: [
|
|
1613
1653
|
/* @__PURE__ */ n("span", { className: "ds-visually-hidden", children: e }),
|
|
1614
1654
|
/* @__PURE__ */ n("select", { className: "ds-select", value: s, onChange: (i) => r(i.target.value), children: o.map((i) => /* @__PURE__ */ n("option", { value: i.value, children: i.label }, i.value)) })
|
|
1615
1655
|
] });
|
|
1616
1656
|
}
|
|
1617
|
-
function
|
|
1657
|
+
function Yt({
|
|
1618
1658
|
registry: e,
|
|
1619
1659
|
controls: t,
|
|
1620
1660
|
deploy: s,
|
|
1621
1661
|
location: o,
|
|
1622
1662
|
screen: r,
|
|
1623
1663
|
variation: i,
|
|
1624
|
-
component:
|
|
1625
|
-
onOpenScenario:
|
|
1626
|
-
onOpenComponent:
|
|
1627
|
-
onOpenScreen:
|
|
1664
|
+
component: d,
|
|
1665
|
+
onOpenScenario: l,
|
|
1666
|
+
onOpenComponent: w,
|
|
1667
|
+
onOpenScreen: h
|
|
1628
1668
|
}) {
|
|
1629
|
-
const
|
|
1630
|
-
if (
|
|
1631
|
-
const
|
|
1632
|
-
return /* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */ n(W, { term:
|
|
1635
|
-
/* @__PURE__ */ n(W, { term:
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1669
|
+
const u = J(), c = u.info, [g, k] = V(!1);
|
|
1670
|
+
if (d) {
|
|
1671
|
+
const f = e.usagesOf(d.id, { handoff: t.handoff });
|
|
1672
|
+
return /* @__PURE__ */ x("div", { className: "ds-info", children: [
|
|
1673
|
+
/* @__PURE__ */ x(te, { title: c.component, children: [
|
|
1674
|
+
/* @__PURE__ */ n(W, { term: c.name, children: d.name }),
|
|
1675
|
+
/* @__PURE__ */ n(W, { term: c.id, children: /* @__PURE__ */ n("code", { children: d.id }) }),
|
|
1676
|
+
d.group && /* @__PURE__ */ n(W, { term: c.group, children: d.group }),
|
|
1677
|
+
d.description && /* @__PURE__ */ n(W, { term: c.description, children: d.description }),
|
|
1678
|
+
d.source && /* @__PURE__ */ n(W, { term: c.source, children: /* @__PURE__ */ n("code", { children: d.source }) })
|
|
1639
1679
|
] }),
|
|
1640
|
-
/* @__PURE__ */ n(te, { title:
|
|
1641
|
-
const
|
|
1642
|
-
return /* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ n(te, { title: c.usedIn, children: f.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: c.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: f.map((S) => {
|
|
1681
|
+
const y = S.variations.find((T) => T.components?.includes(d.id)) ?? S.variations[0];
|
|
1682
|
+
return /* @__PURE__ */ x("li", { "data-ds-filter": !0, children: [
|
|
1643
1683
|
/* @__PURE__ */ n(
|
|
1644
1684
|
"button",
|
|
1645
1685
|
{
|
|
1646
1686
|
type: "button",
|
|
1647
1687
|
className: "ds-link",
|
|
1648
|
-
onClick: () =>
|
|
1649
|
-
children:
|
|
1688
|
+
onClick: () => y ? l(y.id) : h?.(S.id),
|
|
1689
|
+
children: S.name
|
|
1650
1690
|
}
|
|
1651
1691
|
),
|
|
1652
|
-
/* @__PURE__ */ n("code", { className: "ds-muted", children:
|
|
1653
|
-
] },
|
|
1692
|
+
/* @__PURE__ */ n("code", { className: "ds-muted", children: S.id })
|
|
1693
|
+
] }, S.id);
|
|
1654
1694
|
}) }) })
|
|
1655
1695
|
] });
|
|
1656
1696
|
}
|
|
1657
|
-
if (!r) return /* @__PURE__ */ n("p", { className: "ds-empty", children:
|
|
1658
|
-
const b = i ? e.componentsOfScreen(r, i) : e.componentsOfScreen(r),
|
|
1659
|
-
const
|
|
1660
|
-
flow: { name:
|
|
1697
|
+
if (!r) return /* @__PURE__ */ n("p", { className: "ds-empty", children: u.panel.nothingSelected });
|
|
1698
|
+
const b = i ? e.componentsOfScreen(r, i) : e.componentsOfScreen(r), $ = e.persona(t.persona ?? i?.persona), R = e.rulesOf(i), N = t.screenControls ?? {}, P = i?.expected?.length ? i.expected : r.route.expected, v = t.handoff ? { handoff: t.handoff } : void 0, p = async () => {
|
|
1699
|
+
const f = r.group ? e.flowOf(r, { handoff: t.handoff }) : void 0, S = f?.name ? qt({
|
|
1700
|
+
flow: { name: f.name, screens: f.screens },
|
|
1661
1701
|
registry: e,
|
|
1662
1702
|
open: { screen: r, location: o, variation: i },
|
|
1663
1703
|
deploy: s,
|
|
1664
|
-
labels:
|
|
1665
|
-
overrides:
|
|
1666
|
-
}) :
|
|
1704
|
+
labels: u,
|
|
1705
|
+
overrides: v
|
|
1706
|
+
}) : jt({
|
|
1667
1707
|
screen: r,
|
|
1668
1708
|
variations: r.variations,
|
|
1669
1709
|
components: e.componentsOfScreen(r),
|
|
1670
1710
|
deploy: s,
|
|
1671
|
-
labels:
|
|
1672
|
-
overrides:
|
|
1711
|
+
labels: u,
|
|
1712
|
+
overrides: v
|
|
1673
1713
|
});
|
|
1674
1714
|
try {
|
|
1675
|
-
await navigator.clipboard.writeText(
|
|
1715
|
+
await navigator.clipboard.writeText(S);
|
|
1676
1716
|
} catch {
|
|
1677
|
-
window.prompt(
|
|
1717
|
+
window.prompt(c.copyPrompt, S);
|
|
1678
1718
|
}
|
|
1679
|
-
|
|
1719
|
+
k(!0), window.setTimeout(() => k(!1), 1600);
|
|
1680
1720
|
};
|
|
1681
|
-
return /* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
/* @__PURE__ */ n(W, { term:
|
|
1684
|
-
/* @__PURE__ */ n(W, { term:
|
|
1685
|
-
r.group && /* @__PURE__ */ n(W, { term:
|
|
1686
|
-
r.description && /* @__PURE__ */ n(W, { term:
|
|
1687
|
-
/* @__PURE__ */ n(
|
|
1721
|
+
return /* @__PURE__ */ x("div", { className: "ds-info", children: [
|
|
1722
|
+
/* @__PURE__ */ x(te, { title: c.screen, children: [
|
|
1723
|
+
/* @__PURE__ */ n(W, { term: c.name, children: r.name }),
|
|
1724
|
+
/* @__PURE__ */ n(W, { term: c.route, children: /* @__PURE__ */ n("code", { children: r.route.path }) }),
|
|
1725
|
+
r.group && /* @__PURE__ */ n(W, { term: c.flow, children: r.group }),
|
|
1726
|
+
r.description && /* @__PURE__ */ n(W, { term: c.description, children: r.description }),
|
|
1727
|
+
/* @__PURE__ */ n(ue, { term: c.expected, items: P })
|
|
1688
1728
|
] }),
|
|
1689
|
-
r.controls.length > 0 && /* @__PURE__ */ n(te, { title:
|
|
1690
|
-
(
|
|
1691
|
-
const
|
|
1692
|
-
return /* @__PURE__ */
|
|
1693
|
-
|
|
1729
|
+
r.controls.length > 0 && /* @__PURE__ */ n(te, { title: c.controls, children: r.controls.flatMap(
|
|
1730
|
+
(f) => f.controls.map((S) => {
|
|
1731
|
+
const y = N[S.id] ?? Se(S), T = S.options.find((a) => a.value === y);
|
|
1732
|
+
return /* @__PURE__ */ x(W, { term: S.label, children: [
|
|
1733
|
+
T?.label ?? y,
|
|
1694
1734
|
" ",
|
|
1695
|
-
/* @__PURE__ */ n("code", { children: `c.${
|
|
1696
|
-
] }, `${
|
|
1735
|
+
/* @__PURE__ */ n("code", { children: `c.${S.id}=${y}` })
|
|
1736
|
+
] }, `${f.id}/${S.id}`);
|
|
1697
1737
|
})
|
|
1698
1738
|
) }),
|
|
1699
|
-
i && /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */ n(W, { term:
|
|
1701
|
-
/* @__PURE__ */ n(W, { term:
|
|
1702
|
-
|
|
1703
|
-
i.intent && /* @__PURE__ */ n(W, { term:
|
|
1704
|
-
/* @__PURE__ */ n(
|
|
1705
|
-
/* @__PURE__ */ n(
|
|
1706
|
-
/* @__PURE__ */ n(
|
|
1707
|
-
i.ticket && /* @__PURE__ */ n(W, { term:
|
|
1739
|
+
i && /* @__PURE__ */ x(te, { title: c.variation, children: [
|
|
1740
|
+
/* @__PURE__ */ n(W, { term: c.name, children: i.title }),
|
|
1741
|
+
/* @__PURE__ */ n(W, { term: c.id, children: /* @__PURE__ */ n("code", { children: i.id }) }),
|
|
1742
|
+
$ && /* @__PURE__ */ n(W, { term: c.persona, children: $.name }),
|
|
1743
|
+
i.intent && /* @__PURE__ */ n(W, { term: c.intent, children: i.intent }),
|
|
1744
|
+
/* @__PURE__ */ n(ue, { term: c.preconditions, items: i.preconditions }),
|
|
1745
|
+
/* @__PURE__ */ n(ue, { term: c.actions, items: i.actions }),
|
|
1746
|
+
/* @__PURE__ */ n(ue, { term: c.rules, items: R.map((f) => f.statement) }),
|
|
1747
|
+
i.ticket && /* @__PURE__ */ n(W, { term: c.ticket, children: /* @__PURE__ */ n("code", { children: i.ticket }) })
|
|
1708
1748
|
] }),
|
|
1709
|
-
b.length > 0 && /* @__PURE__ */ n(te, { title:
|
|
1710
|
-
/* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () =>
|
|
1711
|
-
|
|
1712
|
-
] },
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
/* @__PURE__ */ n(H, { name:
|
|
1715
|
-
/* @__PURE__ */ n("span", { children:
|
|
1749
|
+
b.length > 0 && /* @__PURE__ */ n(te, { title: c.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: b.map((f) => /* @__PURE__ */ x("li", { "data-ds-filter": !0, children: [
|
|
1750
|
+
/* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => w(f.id), children: f.name }),
|
|
1751
|
+
f.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: f.source })
|
|
1752
|
+
] }, f.id)) }) }),
|
|
1753
|
+
/* @__PURE__ */ x("button", { type: "button", className: "ds-btn ds-btn--block", onClick: p, children: [
|
|
1754
|
+
/* @__PURE__ */ n(H, { name: g ? "check" : "copy", size: 14 }),
|
|
1755
|
+
/* @__PURE__ */ n("span", { children: g ? c.copiedForPr : c.copyForPr })
|
|
1716
1756
|
] })
|
|
1717
1757
|
] });
|
|
1718
1758
|
}
|
|
1719
1759
|
function te({ title: e, children: t }) {
|
|
1720
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ x("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
|
|
1721
1761
|
/* @__PURE__ */ n("h2", { className: "ds-section__title", children: e }),
|
|
1722
1762
|
/* @__PURE__ */ n("div", { className: "ds-defs", children: t })
|
|
1723
1763
|
] });
|
|
1724
1764
|
}
|
|
1725
1765
|
function W({ term: e, children: t }) {
|
|
1726
|
-
return /* @__PURE__ */
|
|
1766
|
+
return /* @__PURE__ */ x("dl", { className: "ds-def", "data-ds-filter": !0, children: [
|
|
1727
1767
|
/* @__PURE__ */ n("dt", { children: e }),
|
|
1728
1768
|
/* @__PURE__ */ n("dd", { children: t })
|
|
1729
1769
|
] });
|
|
1730
1770
|
}
|
|
1731
|
-
function
|
|
1732
|
-
return t?.length ? /* @__PURE__ */
|
|
1771
|
+
function ue({ term: e, items: t }) {
|
|
1772
|
+
return t?.length ? /* @__PURE__ */ x("dl", { className: "ds-def", "data-ds-filter": !0, children: [
|
|
1733
1773
|
/* @__PURE__ */ n("dt", { children: e }),
|
|
1734
1774
|
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("ul", { className: "ds-list", children: t.map((s) => /* @__PURE__ */ n("li", { children: s }, s)) }) })
|
|
1735
1775
|
] }) : null;
|
|
1736
1776
|
}
|
|
1737
|
-
function
|
|
1777
|
+
function Qt(e) {
|
|
1738
1778
|
return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f";
|
|
1739
1779
|
}
|
|
1740
|
-
function
|
|
1780
|
+
function Xt(e, t) {
|
|
1741
1781
|
if (!e) return !1;
|
|
1742
|
-
const s =
|
|
1782
|
+
const s = Q(t), o = [...e.querySelectorAll("[data-ds-filter]")];
|
|
1743
1783
|
for (const r of o)
|
|
1744
|
-
r.hidden = s.length > 0 && !
|
|
1784
|
+
r.hidden = s.length > 0 && !Q(r.textContent ?? "").includes(s);
|
|
1745
1785
|
for (const r of e.querySelectorAll("[data-ds-filter-group]")) {
|
|
1746
|
-
const i = [...r.querySelectorAll("[data-ds-filter]")],
|
|
1786
|
+
const i = [...r.querySelectorAll("[data-ds-filter]")], d = Q(
|
|
1747
1787
|
r.querySelector("[data-ds-filter-title], .ds-section__title")?.textContent ?? ""
|
|
1748
1788
|
);
|
|
1749
|
-
if (s.length > 0 &&
|
|
1789
|
+
if (s.length > 0 && d.includes(s)) {
|
|
1750
1790
|
r.hidden = !1;
|
|
1751
|
-
for (const
|
|
1791
|
+
for (const l of i) l.hidden = !1;
|
|
1752
1792
|
continue;
|
|
1753
1793
|
}
|
|
1754
|
-
r.hidden = s.length > 0 && i.every((
|
|
1794
|
+
r.hidden = s.length > 0 && i.every((l) => l.hidden);
|
|
1755
1795
|
}
|
|
1756
1796
|
return s.length > 0 && o.length > 0 && o.every((r) => r.hidden);
|
|
1757
1797
|
}
|
|
1758
|
-
const
|
|
1759
|
-
function
|
|
1798
|
+
const Jt = 24;
|
|
1799
|
+
function en({
|
|
1760
1800
|
location: e,
|
|
1761
1801
|
viewport: t,
|
|
1762
1802
|
zoom: s,
|
|
1763
1803
|
title: o,
|
|
1764
1804
|
resizing: r,
|
|
1765
1805
|
onFrameNavigate: i,
|
|
1766
|
-
onShortcut:
|
|
1767
|
-
onEffectiveZoom:
|
|
1806
|
+
onShortcut: d,
|
|
1807
|
+
onEffectiveZoom: l
|
|
1768
1808
|
}) {
|
|
1769
|
-
const
|
|
1770
|
-
(
|
|
1771
|
-
b.current =
|
|
1772
|
-
const
|
|
1809
|
+
const w = j(null), h = j(null), u = tn(w), c = ie(e.path, e.search), [g] = V(c), k = j(c), b = j(c), $ = typeof window > "u" ? "" : window.location.origin, R = U(
|
|
1810
|
+
(m) => {
|
|
1811
|
+
b.current = m;
|
|
1812
|
+
const C = h.current?.contentWindow;
|
|
1773
1813
|
try {
|
|
1774
|
-
|
|
1814
|
+
C?.location.replace(new URL(m, $).toString());
|
|
1775
1815
|
} catch {
|
|
1776
|
-
|
|
1816
|
+
h.current && (h.current.src = m);
|
|
1777
1817
|
}
|
|
1778
1818
|
},
|
|
1779
|
-
[
|
|
1819
|
+
[$]
|
|
1780
1820
|
);
|
|
1781
1821
|
I(() => {
|
|
1782
|
-
if (
|
|
1783
|
-
const
|
|
1784
|
-
|
|
1785
|
-
}, [
|
|
1786
|
-
const
|
|
1787
|
-
const
|
|
1788
|
-
origin:
|
|
1789
|
-
source:
|
|
1822
|
+
if (c === k.current) return;
|
|
1823
|
+
const m = k.current;
|
|
1824
|
+
k.current = c, Fe(m) !== Fe(c) ? R(c) : re(h.current?.contentWindow, { ds: 1, type: "location", url: c }, $);
|
|
1825
|
+
}, [c, R, $]), I(() => {
|
|
1826
|
+
const m = (C) => {
|
|
1827
|
+
const L = qe(C, {
|
|
1828
|
+
origin: $,
|
|
1829
|
+
source: h.current?.contentWindow
|
|
1790
1830
|
});
|
|
1791
|
-
if (
|
|
1792
|
-
switch (
|
|
1831
|
+
if (L)
|
|
1832
|
+
switch (L.type) {
|
|
1793
1833
|
case "ready": {
|
|
1794
|
-
if (
|
|
1795
|
-
if (
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
{ ds: 1, type: "location", url:
|
|
1799
|
-
|
|
1834
|
+
if (L.url === k.current) return;
|
|
1835
|
+
if (L.url === b.current) {
|
|
1836
|
+
re(
|
|
1837
|
+
h.current?.contentWindow,
|
|
1838
|
+
{ ds: 1, type: "location", url: k.current },
|
|
1839
|
+
$
|
|
1800
1840
|
);
|
|
1801
1841
|
return;
|
|
1802
1842
|
}
|
|
1803
|
-
|
|
1843
|
+
k.current = L.url, b.current = L.url, i(L.url, !0);
|
|
1804
1844
|
return;
|
|
1805
1845
|
}
|
|
1806
1846
|
case "navigate":
|
|
1807
|
-
|
|
1847
|
+
k.current = L.url, i(L.url, L.replace);
|
|
1808
1848
|
return;
|
|
1809
1849
|
case "shortcut":
|
|
1810
|
-
|
|
1850
|
+
d(L.key);
|
|
1811
1851
|
return;
|
|
1812
1852
|
default:
|
|
1813
1853
|
return;
|
|
1814
1854
|
}
|
|
1815
1855
|
};
|
|
1816
|
-
return window.addEventListener("message",
|
|
1817
|
-
}, [i,
|
|
1818
|
-
const N = !!t.width,
|
|
1856
|
+
return window.addEventListener("message", m), () => window.removeEventListener("message", m);
|
|
1857
|
+
}, [i, d, $]);
|
|
1858
|
+
const N = !!t.width, P = N ? Jt : 0, v = Math.max(0, u.width - P * 2), p = Math.max(0, u.height - P * 2), f = !t.width || v === 0 || t.width <= v, S = s === 100 && !f ? Math.max(10, Math.floor(v / t.width * 100)) : s, y = S / 100;
|
|
1819
1859
|
I(() => {
|
|
1820
|
-
|
|
1821
|
-
}, [
|
|
1822
|
-
const
|
|
1823
|
-
return /* @__PURE__ */ n("div", { className: "ds-canvas", ref:
|
|
1860
|
+
l?.(S);
|
|
1861
|
+
}, [S, l]);
|
|
1862
|
+
const T = t.width ?? v / y, a = t.height ?? p / y;
|
|
1863
|
+
return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: w, "data-fit": N ? void 0 : "true", children: /* @__PURE__ */ n(
|
|
1824
1864
|
"div",
|
|
1825
1865
|
{
|
|
1826
1866
|
className: "ds-canvas__box",
|
|
1827
|
-
style: { width: Math.floor(
|
|
1867
|
+
style: { width: Math.floor(T * y), height: Math.floor(a * y) },
|
|
1828
1868
|
children: /* @__PURE__ */ n(
|
|
1829
1869
|
"iframe",
|
|
1830
1870
|
{
|
|
1831
|
-
ref:
|
|
1832
|
-
[
|
|
1871
|
+
ref: h,
|
|
1872
|
+
[bt]: "",
|
|
1833
1873
|
className: "ds-frame",
|
|
1834
|
-
src:
|
|
1874
|
+
src: g,
|
|
1835
1875
|
title: o,
|
|
1836
1876
|
style: {
|
|
1837
|
-
width: Math.floor(
|
|
1838
|
-
height: Math.floor(
|
|
1839
|
-
transform:
|
|
1877
|
+
width: Math.floor(T),
|
|
1878
|
+
height: Math.floor(a),
|
|
1879
|
+
transform: y === 1 ? void 0 : `scale(${y})`,
|
|
1840
1880
|
pointerEvents: r ? "none" : void 0
|
|
1841
1881
|
}
|
|
1842
1882
|
}
|
|
@@ -1844,15 +1884,15 @@ function Qt({
|
|
|
1844
1884
|
}
|
|
1845
1885
|
) });
|
|
1846
1886
|
}
|
|
1847
|
-
function
|
|
1887
|
+
function tn(e) {
|
|
1848
1888
|
const [t, s] = V({ width: 0, height: 0 });
|
|
1849
|
-
return
|
|
1889
|
+
return We(() => {
|
|
1850
1890
|
const o = e.current;
|
|
1851
1891
|
if (!o) return;
|
|
1852
1892
|
const r = () => {
|
|
1853
|
-
const
|
|
1893
|
+
const d = o.clientWidth, l = o.clientHeight;
|
|
1854
1894
|
s(
|
|
1855
|
-
(
|
|
1895
|
+
(w) => w.width === d && w.height === l ? w : { width: d, height: l }
|
|
1856
1896
|
);
|
|
1857
1897
|
};
|
|
1858
1898
|
if (r(), typeof ResizeObserver > "u")
|
|
@@ -1861,8 +1901,8 @@ function Jt(e) {
|
|
|
1861
1901
|
return i.observe(o), () => i.disconnect();
|
|
1862
1902
|
}, [e]), t;
|
|
1863
1903
|
}
|
|
1864
|
-
const
|
|
1865
|
-
class
|
|
1904
|
+
const nt = 2500;
|
|
1905
|
+
class ot extends Error {
|
|
1866
1906
|
constructor(t) {
|
|
1867
1907
|
super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
|
|
1868
1908
|
}
|
|
@@ -1879,40 +1919,40 @@ const Le = {
|
|
|
1879
1919
|
case "empty":
|
|
1880
1920
|
return null;
|
|
1881
1921
|
case "error":
|
|
1882
|
-
throw new
|
|
1922
|
+
throw new ot(e.id);
|
|
1883
1923
|
case "loading":
|
|
1884
1924
|
return new Promise(() => {
|
|
1885
1925
|
});
|
|
1886
1926
|
case "slow":
|
|
1887
|
-
return await
|
|
1927
|
+
return await nn(nt), Me(t);
|
|
1888
1928
|
default:
|
|
1889
1929
|
return Me(t);
|
|
1890
1930
|
}
|
|
1891
1931
|
}
|
|
1892
1932
|
};
|
|
1893
|
-
function
|
|
1894
|
-
const { id: t, label: s, baseUrl: o, path: r, init: i, fallbackToFixture:
|
|
1933
|
+
function fn(e) {
|
|
1934
|
+
const { id: t, label: s, baseUrl: o, path: r, init: i, fallbackToFixture: d = !0 } = e;
|
|
1895
1935
|
return {
|
|
1896
1936
|
id: t,
|
|
1897
1937
|
label: s,
|
|
1898
|
-
load: async (
|
|
1899
|
-
const
|
|
1938
|
+
load: async (l) => {
|
|
1939
|
+
const w = new URL(r ? r(l) : l.scenario.route, o);
|
|
1900
1940
|
try {
|
|
1901
|
-
const
|
|
1902
|
-
if (!
|
|
1903
|
-
return await
|
|
1904
|
-
} catch (
|
|
1905
|
-
if (
|
|
1906
|
-
throw new Error(`Adapter "${t}" falhou em ${
|
|
1941
|
+
const h = await fetch(w, i);
|
|
1942
|
+
if (!h.ok) throw new Error(`${h.status} ${h.statusText}`);
|
|
1943
|
+
return await h.json();
|
|
1944
|
+
} catch (h) {
|
|
1945
|
+
if (d) return Me(l.fixture);
|
|
1946
|
+
throw new Error(`Adapter "${t}" falhou em ${w.toString()}`, { cause: h });
|
|
1907
1947
|
}
|
|
1908
1948
|
}
|
|
1909
1949
|
};
|
|
1910
1950
|
}
|
|
1911
|
-
function
|
|
1951
|
+
function nn(e) {
|
|
1912
1952
|
return new Promise((t) => setTimeout(t, e));
|
|
1913
1953
|
}
|
|
1914
|
-
function
|
|
1915
|
-
const { scenario: t, fixture: s, network: o, adapter: r } = e, [i,
|
|
1954
|
+
function on(e) {
|
|
1955
|
+
const { scenario: t, fixture: s, network: o, adapter: r } = e, [i, d] = V({
|
|
1916
1956
|
data: void 0,
|
|
1917
1957
|
isLoading: !!t || o === "loading" || o === "slow",
|
|
1918
1958
|
error: void 0
|
|
@@ -1921,179 +1961,179 @@ function tn(e) {
|
|
|
1921
1961
|
if (!t)
|
|
1922
1962
|
switch (o) {
|
|
1923
1963
|
case "loading":
|
|
1924
|
-
|
|
1964
|
+
d({ data: void 0, isLoading: !0, error: void 0 });
|
|
1925
1965
|
return;
|
|
1926
1966
|
case "empty":
|
|
1927
|
-
|
|
1967
|
+
d({ data: null, isLoading: !1, error: void 0 });
|
|
1928
1968
|
return;
|
|
1929
1969
|
case "error":
|
|
1930
|
-
|
|
1970
|
+
d({
|
|
1931
1971
|
data: void 0,
|
|
1932
1972
|
isLoading: !1,
|
|
1933
|
-
error: new
|
|
1973
|
+
error: new ot(e.screen ?? "—")
|
|
1934
1974
|
});
|
|
1935
1975
|
return;
|
|
1936
1976
|
case "slow": {
|
|
1937
|
-
|
|
1938
|
-
const
|
|
1939
|
-
() =>
|
|
1940
|
-
|
|
1977
|
+
d({ data: void 0, isLoading: !0, error: void 0 });
|
|
1978
|
+
const h = setTimeout(
|
|
1979
|
+
() => d({ data: void 0, isLoading: !1, error: void 0 }),
|
|
1980
|
+
nt
|
|
1941
1981
|
);
|
|
1942
|
-
return () => clearTimeout(
|
|
1982
|
+
return () => clearTimeout(h);
|
|
1943
1983
|
}
|
|
1944
1984
|
default:
|
|
1945
|
-
|
|
1985
|
+
d({ data: void 0, isLoading: !1, error: void 0 });
|
|
1946
1986
|
return;
|
|
1947
1987
|
}
|
|
1948
|
-
let
|
|
1949
|
-
|
|
1950
|
-
const
|
|
1951
|
-
return Promise.resolve(
|
|
1952
|
-
|
|
1953
|
-
}).catch((
|
|
1954
|
-
|
|
1988
|
+
let l = !0;
|
|
1989
|
+
d({ data: void 0, isLoading: !0, error: void 0 });
|
|
1990
|
+
const w = r ?? Le;
|
|
1991
|
+
return Promise.resolve(w.load({ scenario: t, fixture: s, network: o })).then((h) => {
|
|
1992
|
+
l && d({ data: h, isLoading: !1, error: void 0 });
|
|
1993
|
+
}).catch((h) => {
|
|
1994
|
+
l && d({
|
|
1955
1995
|
data: void 0,
|
|
1956
1996
|
isLoading: !1,
|
|
1957
|
-
error:
|
|
1997
|
+
error: h instanceof Error ? h : new Error(String(h))
|
|
1958
1998
|
});
|
|
1959
1999
|
}), () => {
|
|
1960
|
-
|
|
2000
|
+
l = !1;
|
|
1961
2001
|
};
|
|
1962
2002
|
}, [t, s, o, r, e.screen]), i;
|
|
1963
2003
|
}
|
|
1964
|
-
function
|
|
1965
|
-
return /* @__PURE__ */
|
|
2004
|
+
function Ke({ title: e, children: t }) {
|
|
2005
|
+
return /* @__PURE__ */ x("div", { className: "ds-stage-empty", children: [
|
|
1966
2006
|
/* @__PURE__ */ n("h2", { className: "ds-stage-empty__title", children: e }),
|
|
1967
2007
|
t
|
|
1968
2008
|
] });
|
|
1969
2009
|
}
|
|
1970
|
-
function
|
|
1971
|
-
const s = J(), { location: o, controls: r, viewport: i, navigate:
|
|
2010
|
+
function rn({ product: e, registry: t }) {
|
|
2011
|
+
const s = J(), { location: o, controls: r, viewport: i, navigate: d, openScenario: l, setScreenControls: w } = Ye(
|
|
1972
2012
|
t,
|
|
1973
2013
|
{ frame: !0 }
|
|
1974
|
-
),
|
|
2014
|
+
), h = j(null);
|
|
1975
2015
|
I(() => {
|
|
1976
|
-
const
|
|
1977
|
-
if (
|
|
1978
|
-
const A =
|
|
2016
|
+
const E = (z) => {
|
|
2017
|
+
if (z.defaultPrevented || z.button !== 0 || z.metaKey || z.ctrlKey || z.shiftKey || z.altKey) return;
|
|
2018
|
+
const A = z.target?.closest?.("a[href]");
|
|
1979
2019
|
if (!(A instanceof HTMLAnchorElement) || A.target && A.target !== "_self" || A.hasAttribute("download")) return;
|
|
1980
|
-
const
|
|
1981
|
-
if (
|
|
2020
|
+
const q = A.getAttribute("href") ?? "";
|
|
2021
|
+
if (q.startsWith("#")) return;
|
|
1982
2022
|
let B;
|
|
1983
2023
|
try {
|
|
1984
|
-
B = new URL(
|
|
2024
|
+
B = new URL(q, window.location.href);
|
|
1985
2025
|
} catch {
|
|
1986
2026
|
return;
|
|
1987
2027
|
}
|
|
1988
|
-
B.origin === window.location.origin && (
|
|
2028
|
+
B.origin === window.location.origin && (z.preventDefault(), d(`${B.pathname}${B.search}`));
|
|
1989
2029
|
};
|
|
1990
|
-
return document.addEventListener("click",
|
|
1991
|
-
}, [
|
|
1992
|
-
const
|
|
2030
|
+
return document.addEventListener("click", E), () => document.removeEventListener("click", E);
|
|
2031
|
+
}, [d]), I(() => {
|
|
2032
|
+
const E = (z) => {
|
|
1993
2033
|
if (window.parent === window) return;
|
|
1994
|
-
const A =
|
|
2034
|
+
const A = sn(z);
|
|
1995
2035
|
if (!A) return;
|
|
1996
|
-
const
|
|
1997
|
-
A === "C" &&
|
|
2036
|
+
const q = z.target;
|
|
2037
|
+
A === "C" && q?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (z.preventDefault(), re(window.parent, { ds: 1, type: "shortcut", key: A }, window.location.origin));
|
|
1998
2038
|
};
|
|
1999
|
-
return window.addEventListener("keydown",
|
|
2039
|
+
return window.addEventListener("keydown", E), () => window.removeEventListener("keydown", E);
|
|
2000
2040
|
}, []), I(() => {
|
|
2001
|
-
const
|
|
2002
|
-
if (!
|
|
2003
|
-
const
|
|
2004
|
-
for (const
|
|
2005
|
-
const B =
|
|
2041
|
+
const E = h.current;
|
|
2042
|
+
if (!E || !r.handoff) return;
|
|
2043
|
+
const z = () => {
|
|
2044
|
+
for (const q of E.querySelectorAll("a[href]")) {
|
|
2045
|
+
const B = q.getAttribute("href");
|
|
2006
2046
|
if (!B || B.startsWith("#")) continue;
|
|
2007
|
-
let
|
|
2047
|
+
let X;
|
|
2008
2048
|
try {
|
|
2009
|
-
|
|
2049
|
+
X = new URL(B, window.location.href);
|
|
2010
2050
|
} catch {
|
|
2011
2051
|
continue;
|
|
2012
2052
|
}
|
|
2013
|
-
if (
|
|
2014
|
-
Pe(
|
|
2015
|
-
const
|
|
2016
|
-
B !==
|
|
2053
|
+
if (X.origin !== window.location.origin) continue;
|
|
2054
|
+
Pe(X.searchParams, r.handoff);
|
|
2055
|
+
const ce = `${X.pathname}${X.search}${X.hash}`;
|
|
2056
|
+
B !== ce && q.setAttribute("href", ce);
|
|
2017
2057
|
}
|
|
2018
2058
|
};
|
|
2019
|
-
|
|
2020
|
-
const A = new MutationObserver(
|
|
2021
|
-
return A.observe(
|
|
2059
|
+
z();
|
|
2060
|
+
const A = new MutationObserver(z);
|
|
2061
|
+
return A.observe(E, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => A.disconnect();
|
|
2022
2062
|
}, [r.handoff]);
|
|
2023
|
-
const
|
|
2024
|
-
const
|
|
2063
|
+
const u = t.scenario(r.scenario), c = t.component(r.component), g = D(() => {
|
|
2064
|
+
const E = new URLSearchParams(o.search);
|
|
2025
2065
|
return {
|
|
2026
|
-
scenario:
|
|
2027
|
-
component:
|
|
2066
|
+
scenario: E.get(M.scenario) ?? void 0,
|
|
2067
|
+
component: E.get(M.component) ?? void 0
|
|
2028
2068
|
};
|
|
2029
|
-
}, [o.search]),
|
|
2030
|
-
() => t.resolveComponentFixture(
|
|
2031
|
-
[
|
|
2032
|
-
),
|
|
2033
|
-
const
|
|
2034
|
-
return typeof
|
|
2035
|
-
}, [b.fixture]),
|
|
2036
|
-
const
|
|
2037
|
-
return
|
|
2038
|
-
}, [r.dataSource, e.dataSources?.adapters]), { data:
|
|
2039
|
-
scenario:
|
|
2069
|
+
}, [o.search]), k = !!(r.handoff && (g.scenario && !oe(r.handoff, g.scenario) || g.component && !ge(r.handoff, g.component) || !g.component && !He(r.handoff, o.path, e.scenarios))), b = D(
|
|
2070
|
+
() => t.resolveComponentFixture(c?.id, c ? r.fixture : void 0),
|
|
2071
|
+
[c, r.fixture, t]
|
|
2072
|
+
), $ = D(() => {
|
|
2073
|
+
const E = b.fixture?.data;
|
|
2074
|
+
return typeof E == "function" ? E() : E;
|
|
2075
|
+
}, [b.fixture]), R = t.persona(r.persona ?? u?.persona), N = t.fixture(r.fixture ?? u?.fixture), P = D(() => {
|
|
2076
|
+
const E = r.dataSource ?? "fixtures";
|
|
2077
|
+
return E === "fixtures" ? Le : e.dataSources?.adapters?.find((z) => z.id === E) ?? Le;
|
|
2078
|
+
}, [r.dataSource, e.dataSources?.adapters]), { data: v, isLoading: p, error: f } = on({
|
|
2079
|
+
scenario: u,
|
|
2040
2080
|
fixture: N,
|
|
2041
2081
|
network: r.network,
|
|
2042
|
-
adapter:
|
|
2082
|
+
adapter: P,
|
|
2043
2083
|
screen: o.path
|
|
2044
|
-
}),
|
|
2045
|
-
(
|
|
2046
|
-
[
|
|
2047
|
-
),
|
|
2084
|
+
}), S = D(() => u ? r.persona && r.persona !== (u.persona ?? t.defaultPersona) ? t.persona(r.persona)?.permissions ?? [] : t.permissionsOf(u) : t.persona(r.persona)?.permissions ?? [], [r.persona, t, u]), y = r.screenControls, T = D(() => y ?? {}, [y]), a = U(
|
|
2085
|
+
(E, z) => w({ [E]: z }),
|
|
2086
|
+
[w]
|
|
2087
|
+
), m = D(
|
|
2048
2088
|
() => ({
|
|
2049
|
-
scenario:
|
|
2050
|
-
persona:
|
|
2051
|
-
permissions:
|
|
2052
|
-
can: (
|
|
2053
|
-
data:
|
|
2089
|
+
scenario: u,
|
|
2090
|
+
persona: R,
|
|
2091
|
+
permissions: S,
|
|
2092
|
+
can: (E) => S.includes(E),
|
|
2093
|
+
data: v,
|
|
2054
2094
|
fixture: N,
|
|
2055
2095
|
network: r.network,
|
|
2056
|
-
isLoading:
|
|
2057
|
-
error:
|
|
2058
|
-
rules: t.rulesOf(
|
|
2096
|
+
isLoading: p,
|
|
2097
|
+
error: f,
|
|
2098
|
+
rules: t.rulesOf(u),
|
|
2059
2099
|
viewport: i,
|
|
2060
2100
|
themeMode: r.themeMode,
|
|
2061
2101
|
locale: r.locale,
|
|
2062
|
-
navigate:
|
|
2063
|
-
openScenario:
|
|
2064
|
-
controls:
|
|
2065
|
-
setControl:
|
|
2066
|
-
setControls:
|
|
2102
|
+
navigate: d,
|
|
2103
|
+
openScenario: l,
|
|
2104
|
+
controls: T,
|
|
2105
|
+
setControl: a,
|
|
2106
|
+
setControls: w
|
|
2067
2107
|
}),
|
|
2068
2108
|
[
|
|
2069
|
-
h,
|
|
2070
|
-
T,
|
|
2071
|
-
y,
|
|
2072
2109
|
u,
|
|
2110
|
+
R,
|
|
2111
|
+
S,
|
|
2112
|
+
v,
|
|
2073
2113
|
N,
|
|
2074
2114
|
r.network,
|
|
2075
2115
|
r.themeMode,
|
|
2076
2116
|
r.locale,
|
|
2077
|
-
|
|
2078
|
-
|
|
2117
|
+
p,
|
|
2118
|
+
f,
|
|
2079
2119
|
t,
|
|
2080
2120
|
i,
|
|
2121
|
+
d,
|
|
2081
2122
|
l,
|
|
2123
|
+
T,
|
|
2082
2124
|
a,
|
|
2083
|
-
|
|
2084
|
-
c,
|
|
2085
|
-
p
|
|
2125
|
+
w
|
|
2086
2126
|
]
|
|
2087
|
-
),
|
|
2088
|
-
|
|
2127
|
+
), C = ye(e.routes ?? [], o.path), L = e.wrapper, O = e.notFound, _ = c?.preview, K = k ? /* @__PURE__ */ n(Ke, { title: s.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: s.shell.outsideHandoffHint }) }) : _ ? /* @__PURE__ */ n(
|
|
2128
|
+
_,
|
|
2089
2129
|
{
|
|
2090
2130
|
fixture: b.fixture,
|
|
2091
|
-
data:
|
|
2131
|
+
data: $,
|
|
2092
2132
|
viewport: i,
|
|
2093
2133
|
themeMode: r.themeMode ?? "default",
|
|
2094
2134
|
locale: r.locale ?? "default"
|
|
2095
2135
|
}
|
|
2096
|
-
) :
|
|
2136
|
+
) : C ? /* @__PURE__ */ n(C.definition.screen, { params: C.params, context: m }) : O ? /* @__PURE__ */ n(O, { path: o.path }) : /* @__PURE__ */ n(Ke, { title: s.shell.noRoute, children: /* @__PURE__ */ x("p", { children: [
|
|
2097
2137
|
/* @__PURE__ */ n("code", { children: o.path }),
|
|
2098
2138
|
" ",
|
|
2099
2139
|
s.shell.noRouteHint
|
|
@@ -2101,10 +2141,10 @@ function nn({ product: e, registry: t }) {
|
|
|
2101
2141
|
return (
|
|
2102
2142
|
// `display: contents` deixa o layout do produto como se este nó não
|
|
2103
2143
|
// existisse: ele só serve de raiz para observar os links.
|
|
2104
|
-
/* @__PURE__ */ n("div", { ref:
|
|
2144
|
+
/* @__PURE__ */ n("div", { ref: h, style: { display: "contents" }, children: L && !k ? /* @__PURE__ */ n(L, { context: m, children: K }) : K })
|
|
2105
2145
|
);
|
|
2106
2146
|
}
|
|
2107
|
-
function
|
|
2147
|
+
function sn(e) {
|
|
2108
2148
|
if (!e.altKey) {
|
|
2109
2149
|
if (e.shiftKey && !e.metaKey && !e.ctrlKey && e.key === "C") return "C";
|
|
2110
2150
|
if ((e.metaKey || e.ctrlKey) && !e.shiftKey) {
|
|
@@ -2114,41 +2154,41 @@ function on(e) {
|
|
|
2114
2154
|
}
|
|
2115
2155
|
}
|
|
2116
2156
|
}
|
|
2117
|
-
const
|
|
2157
|
+
const pe = {
|
|
2118
2158
|
leftWidth: "ds:left-width",
|
|
2119
2159
|
rightWidth: "ds:right-width",
|
|
2120
2160
|
appearance: "ds:appearance"
|
|
2121
2161
|
};
|
|
2122
|
-
function
|
|
2162
|
+
function rt(e) {
|
|
2123
2163
|
try {
|
|
2124
2164
|
return window.localStorage.getItem(e) ?? void 0;
|
|
2125
2165
|
} catch {
|
|
2126
2166
|
return;
|
|
2127
2167
|
}
|
|
2128
2168
|
}
|
|
2129
|
-
function
|
|
2169
|
+
function st(e, t) {
|
|
2130
2170
|
try {
|
|
2131
2171
|
window.localStorage.setItem(e, t);
|
|
2132
2172
|
} catch {
|
|
2133
2173
|
}
|
|
2134
2174
|
}
|
|
2135
|
-
function
|
|
2175
|
+
function Ue(e, t, s) {
|
|
2136
2176
|
return Math.round(Math.min(s, Math.max(t, e)));
|
|
2137
2177
|
}
|
|
2138
|
-
function
|
|
2178
|
+
function Ie(e, t, s, o) {
|
|
2139
2179
|
const [r, i] = V(() => {
|
|
2140
|
-
const
|
|
2141
|
-
return Number.isFinite(
|
|
2142
|
-
}),
|
|
2143
|
-
(
|
|
2144
|
-
const
|
|
2145
|
-
i(
|
|
2180
|
+
const l = Number.parseInt(rt(e) ?? "", 10);
|
|
2181
|
+
return Number.isFinite(l) ? Ue(l, s, o) : t;
|
|
2182
|
+
}), d = U(
|
|
2183
|
+
(l) => {
|
|
2184
|
+
const w = Ue(l, s, o);
|
|
2185
|
+
i(w), st(e, String(w));
|
|
2146
2186
|
},
|
|
2147
2187
|
[e, o, s]
|
|
2148
2188
|
);
|
|
2149
|
-
return [r,
|
|
2189
|
+
return [r, d];
|
|
2150
2190
|
}
|
|
2151
|
-
function
|
|
2191
|
+
function an() {
|
|
2152
2192
|
const e = "(prefers-color-scheme: dark)", t = () => {
|
|
2153
2193
|
try {
|
|
2154
2194
|
return window.matchMedia(e).matches ? "dark" : "light";
|
|
@@ -2167,159 +2207,159 @@ function rn() {
|
|
|
2167
2207
|
return r.addEventListener?.("change", i), () => r?.removeEventListener?.("change", i);
|
|
2168
2208
|
}, []), s;
|
|
2169
2209
|
}
|
|
2170
|
-
function
|
|
2171
|
-
const e =
|
|
2210
|
+
function cn() {
|
|
2211
|
+
const e = rt(pe.appearance);
|
|
2172
2212
|
return e === "dark" || e === "light" ? e : void 0;
|
|
2173
2213
|
}
|
|
2174
|
-
function
|
|
2175
|
-
const t = D(() =>
|
|
2176
|
-
return /* @__PURE__ */ n(
|
|
2177
|
-
}
|
|
2178
|
-
const
|
|
2179
|
-
function
|
|
2180
|
-
const s = J(), o = D(() =>
|
|
2181
|
-
|
|
2182
|
-
const
|
|
2183
|
-
|
|
2184
|
-
ke.initial,
|
|
2185
|
-
ke.min,
|
|
2186
|
-
ke.max
|
|
2187
|
-
), [u, k] = Ke(
|
|
2188
|
-
he.rightWidth,
|
|
2214
|
+
function wn({ product: e }) {
|
|
2215
|
+
const t = D(() => xt(e), [e]), s = D(() => At(e.theme?.labels), [e.theme?.labels]), [o] = V(() => St());
|
|
2216
|
+
return /* @__PURE__ */ n(Je.Provider, { value: s, children: o ? /* @__PURE__ */ n(rn, { product: e, registry: t }) : /* @__PURE__ */ n(ln, { product: e, registry: t }) });
|
|
2217
|
+
}
|
|
2218
|
+
const Ce = { initial: 290, min: 200, max: 480 }, xe = { initial: 320, min: 260, max: 560 };
|
|
2219
|
+
function ln({ product: e, registry: t }) {
|
|
2220
|
+
const s = J(), o = D(() => kt(e.deploy), [e.deploy]), { location: r, controls: i, viewport: d, setControls: l, openScenario: w, openComponent: h, openScreen: u, go: c } = Ye(t), g = j(r);
|
|
2221
|
+
g.current = r;
|
|
2222
|
+
const k = an(), [b, $] = V(() => cn()), R = i.chromeTheme ?? b ?? k, [N, P] = Ie(
|
|
2223
|
+
pe.leftWidth,
|
|
2189
2224
|
Ce.initial,
|
|
2190
2225
|
Ce.min,
|
|
2191
2226
|
Ce.max
|
|
2192
|
-
), [
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2227
|
+
), [v, p] = Ie(
|
|
2228
|
+
pe.rightWidth,
|
|
2229
|
+
xe.initial,
|
|
2230
|
+
xe.min,
|
|
2231
|
+
xe.max
|
|
2232
|
+
), [f, S] = V(!1), y = i.handoff, T = t.component(i.component), a = t.scenario(i.scenario), m = T ? void 0 : t.screensFor({ handoff: y }).find((F) => F.id === t.screenForPath(r.path)?.id), C = m && a && m.variations.some((F) => F.id === a.id) ? a : void 0, L = D(
|
|
2233
|
+
() => t.resolveComponentFixture(T?.id, T ? i.fixture : void 0),
|
|
2234
|
+
[T, i.fixture, t]
|
|
2235
|
+
), O = D(() => {
|
|
2236
|
+
if (!m || m.controls.length === 0) return t.issues;
|
|
2237
|
+
const { invalid: F } = t.resolveControls(m, {
|
|
2238
|
+
scenario: C,
|
|
2239
|
+
requested: Be(r.search)
|
|
2200
2240
|
});
|
|
2201
|
-
return
|
|
2241
|
+
return F.length === 0 ? t.issues : [...F.map((Z) => ({
|
|
2202
2242
|
level: "warning",
|
|
2203
|
-
where: `url:${
|
|
2243
|
+
where: `url:${be}${Z.id}`,
|
|
2204
2244
|
message: Z.reason === "invalid-value" ? s.diagnostics.invalidControl(Z.id, Z.value, Z.fallback ?? "") : s.diagnostics.unknownControl(Z.id, Z.value)
|
|
2205
2245
|
})), ...t.issues];
|
|
2206
|
-
}, [s, r.search, t,
|
|
2207
|
-
const
|
|
2208
|
-
return
|
|
2209
|
-
}, [r.search]), A = r.path === "/" && !
|
|
2246
|
+
}, [s, r.search, t, m, C]), _ = t.screensFor({ handoff: y })[0], K = t.componentsFor(y)[0], E = !_ && !K, z = D(() => {
|
|
2247
|
+
const F = new URLSearchParams(r.search);
|
|
2248
|
+
return F.has(M.scenario) || F.has(M.component);
|
|
2249
|
+
}, [r.search]), A = r.path === "/" && !z && !t.screenForPath("/") && !E;
|
|
2210
2250
|
I(() => {
|
|
2211
|
-
A && (
|
|
2212
|
-
}, [K,
|
|
2213
|
-
const
|
|
2214
|
-
() =>
|
|
2215
|
-
[i.chrome,
|
|
2251
|
+
A && (_ ? u(_.id, { replace: !0 }) : K && h(K.id, { replace: !0 }));
|
|
2252
|
+
}, [K, _, h, u, A]);
|
|
2253
|
+
const q = U(
|
|
2254
|
+
() => l({ chrome: !i.chrome }),
|
|
2255
|
+
[i.chrome, l]
|
|
2216
2256
|
), B = U(
|
|
2217
|
-
(
|
|
2218
|
-
if (
|
|
2219
|
-
|
|
2257
|
+
(F) => {
|
|
2258
|
+
if (F === "C") {
|
|
2259
|
+
q();
|
|
2220
2260
|
return;
|
|
2221
2261
|
}
|
|
2222
|
-
window.dispatchEvent(new KeyboardEvent("keydown", { key:
|
|
2262
|
+
window.dispatchEvent(new KeyboardEvent("keydown", { key: F.toLowerCase(), metaKey: !0 }));
|
|
2223
2263
|
},
|
|
2224
|
-
[
|
|
2264
|
+
[q]
|
|
2225
2265
|
);
|
|
2226
2266
|
I(() => {
|
|
2227
|
-
const
|
|
2267
|
+
const F = (G) => {
|
|
2228
2268
|
!G.shiftKey || G.metaKey || G.ctrlKey || G.altKey || G.key !== "C" || G.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (G.preventDefault(), B(G.key));
|
|
2229
2269
|
};
|
|
2230
|
-
return window.addEventListener("keydown",
|
|
2270
|
+
return window.addEventListener("keydown", F), () => window.removeEventListener("keydown", F);
|
|
2231
2271
|
}, [B]);
|
|
2232
|
-
const
|
|
2233
|
-
(
|
|
2234
|
-
const { path: Z, search:
|
|
2235
|
-
|
|
2272
|
+
const X = U(
|
|
2273
|
+
(F, G) => {
|
|
2274
|
+
const { path: Z, search: dt } = he(F);
|
|
2275
|
+
c(Z, Ct(dt, g.current.search), { replace: G });
|
|
2236
2276
|
},
|
|
2237
|
-
[
|
|
2238
|
-
),
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2241
|
-
},
|
|
2242
|
-
return /* @__PURE__ */
|
|
2277
|
+
[c]
|
|
2278
|
+
), ce = () => {
|
|
2279
|
+
const F = R === "dark" ? "light" : "dark";
|
|
2280
|
+
st(pe.appearance, F), $(F), l({ chromeTheme: F });
|
|
2281
|
+
}, se = (F) => l(F), at = `${o.origin}${r.path}${r.search}`, it = i.panelTab ?? "variations", _e = i.zoom ?? 100, [ct, lt] = V(_e);
|
|
2282
|
+
return /* @__PURE__ */ x(
|
|
2243
2283
|
"div",
|
|
2244
2284
|
{
|
|
2245
2285
|
className: "ds-root",
|
|
2246
|
-
"data-appearance":
|
|
2286
|
+
"data-appearance": R,
|
|
2247
2287
|
"data-chrome": i.chrome ? "visible" : "hidden",
|
|
2248
|
-
"data-resizing":
|
|
2249
|
-
"data-viewport":
|
|
2288
|
+
"data-resizing": f ? "true" : void 0,
|
|
2289
|
+
"data-viewport": d.id,
|
|
2250
2290
|
children: [
|
|
2251
2291
|
i.chrome && /* @__PURE__ */ n(
|
|
2252
|
-
|
|
2292
|
+
Vt,
|
|
2253
2293
|
{
|
|
2254
2294
|
productName: e.name,
|
|
2255
2295
|
deploy: o,
|
|
2256
2296
|
viewportId: i.viewport,
|
|
2257
|
-
viewport:
|
|
2258
|
-
zoom:
|
|
2297
|
+
viewport: d,
|
|
2298
|
+
zoom: ct,
|
|
2259
2299
|
rotated: !!i.rotated,
|
|
2260
|
-
theme:
|
|
2261
|
-
issues:
|
|
2262
|
-
linkUrl:
|
|
2263
|
-
onViewport: (
|
|
2264
|
-
onRotate: () =>
|
|
2265
|
-
onZoom: (
|
|
2266
|
-
onCleanReview:
|
|
2267
|
-
onToggleTheme:
|
|
2300
|
+
theme: R,
|
|
2301
|
+
issues: O,
|
|
2302
|
+
linkUrl: at,
|
|
2303
|
+
onViewport: (F) => se({ viewport: F }),
|
|
2304
|
+
onRotate: () => se({ rotated: !i.rotated }),
|
|
2305
|
+
onZoom: (F) => se({ zoom: F }),
|
|
2306
|
+
onCleanReview: q,
|
|
2307
|
+
onToggleTheme: ce
|
|
2268
2308
|
}
|
|
2269
2309
|
),
|
|
2270
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ x("div", { className: "ds-body", children: [
|
|
2271
2311
|
i.chrome && /* @__PURE__ */ n(
|
|
2272
|
-
|
|
2312
|
+
It,
|
|
2273
2313
|
{
|
|
2274
2314
|
registry: t,
|
|
2275
|
-
handoff:
|
|
2276
|
-
activeScreen:
|
|
2277
|
-
activeComponent:
|
|
2278
|
-
onOpenScreen: (
|
|
2279
|
-
onOpenComponent: (
|
|
2315
|
+
handoff: y,
|
|
2316
|
+
activeScreen: m?.id,
|
|
2317
|
+
activeComponent: T?.id,
|
|
2318
|
+
onOpenScreen: (F) => u(F),
|
|
2319
|
+
onOpenComponent: (F) => h(F),
|
|
2280
2320
|
width: N,
|
|
2281
|
-
onResize:
|
|
2282
|
-
onResizeStart: () =>
|
|
2283
|
-
onResizeEnd: () =>
|
|
2321
|
+
onResize: P,
|
|
2322
|
+
onResizeStart: () => S(!0),
|
|
2323
|
+
onResizeEnd: () => S(!1)
|
|
2284
2324
|
}
|
|
2285
2325
|
),
|
|
2286
|
-
/* @__PURE__ */ n("main", { className: "ds-main", children:
|
|
2326
|
+
/* @__PURE__ */ n("main", { className: "ds-main", children: E ? /* @__PURE__ */ x("div", { className: "ds-chrome-empty", children: [
|
|
2287
2327
|
/* @__PURE__ */ n("h1", { className: "ds-chrome-empty__title", children: s.shell.empty }),
|
|
2288
2328
|
/* @__PURE__ */ n("p", { className: "ds-muted", children: s.shell.emptyHint })
|
|
2289
2329
|
] }) : A ? null : /* @__PURE__ */ n(
|
|
2290
|
-
|
|
2330
|
+
en,
|
|
2291
2331
|
{
|
|
2292
2332
|
location: r,
|
|
2293
|
-
viewport:
|
|
2294
|
-
zoom:
|
|
2295
|
-
onEffectiveZoom:
|
|
2333
|
+
viewport: d,
|
|
2334
|
+
zoom: _e,
|
|
2335
|
+
onEffectiveZoom: lt,
|
|
2296
2336
|
title: s.shell.frameTitle(e.name),
|
|
2297
|
-
resizing:
|
|
2298
|
-
onFrameNavigate:
|
|
2337
|
+
resizing: f,
|
|
2338
|
+
onFrameNavigate: X,
|
|
2299
2339
|
onShortcut: B
|
|
2300
2340
|
}
|
|
2301
2341
|
) }),
|
|
2302
2342
|
i.chrome && /* @__PURE__ */ n(
|
|
2303
|
-
|
|
2343
|
+
Gt,
|
|
2304
2344
|
{
|
|
2305
2345
|
registry: t,
|
|
2306
2346
|
controls: i,
|
|
2307
2347
|
deploy: o,
|
|
2308
2348
|
location: r,
|
|
2309
|
-
screen:
|
|
2310
|
-
variation:
|
|
2311
|
-
component:
|
|
2312
|
-
componentFixture:
|
|
2313
|
-
tab:
|
|
2314
|
-
onTab: (
|
|
2315
|
-
onOpenScenario:
|
|
2316
|
-
onOpenComponent: (
|
|
2317
|
-
onOpenScreen: (
|
|
2318
|
-
onChange:
|
|
2319
|
-
width:
|
|
2320
|
-
onResize:
|
|
2321
|
-
onResizeStart: () =>
|
|
2322
|
-
onResizeEnd: () =>
|
|
2349
|
+
screen: m,
|
|
2350
|
+
variation: C,
|
|
2351
|
+
component: T,
|
|
2352
|
+
componentFixture: L,
|
|
2353
|
+
tab: it,
|
|
2354
|
+
onTab: (F) => se({ panelTab: F }),
|
|
2355
|
+
onOpenScenario: w,
|
|
2356
|
+
onOpenComponent: (F) => h(F),
|
|
2357
|
+
onOpenScreen: (F) => u(F),
|
|
2358
|
+
onChange: se,
|
|
2359
|
+
width: v,
|
|
2360
|
+
onResize: p,
|
|
2361
|
+
onResizeStart: () => S(!0),
|
|
2362
|
+
onResizeEnd: () => S(!1)
|
|
2323
2363
|
}
|
|
2324
2364
|
)
|
|
2325
2365
|
] }),
|
|
@@ -2330,7 +2370,7 @@ function an({ product: e, registry: t }) {
|
|
|
2330
2370
|
className: "ds-restore",
|
|
2331
2371
|
"aria-label": s.shell.restoreChrome,
|
|
2332
2372
|
title: s.shell.restoreChrome,
|
|
2333
|
-
onClick:
|
|
2373
|
+
onClick: q,
|
|
2334
2374
|
children: /* @__PURE__ */ n("span", { className: "ds-restore__dot", "aria-hidden": "true" })
|
|
2335
2375
|
}
|
|
2336
2376
|
)
|
|
@@ -2338,70 +2378,70 @@ function an({ product: e, registry: t }) {
|
|
|
2338
2378
|
}
|
|
2339
2379
|
);
|
|
2340
2380
|
}
|
|
2341
|
-
function
|
|
2381
|
+
function ve(e) {
|
|
2342
2382
|
return new Date(e.length === 10 ? `${e}T00:00:00` : e);
|
|
2343
2383
|
}
|
|
2344
|
-
function
|
|
2345
|
-
const s =
|
|
2384
|
+
function vn(e, t) {
|
|
2385
|
+
const s = ve(e), o = ve(t);
|
|
2346
2386
|
let r = o.getFullYear() - s.getFullYear();
|
|
2347
2387
|
const i = o.getMonth() - s.getMonth();
|
|
2348
2388
|
return (i < 0 || i === 0 && o.getDate() < s.getDate()) && (r -= 1), r;
|
|
2349
2389
|
}
|
|
2350
|
-
function
|
|
2351
|
-
const s =
|
|
2390
|
+
function gn(e, t) {
|
|
2391
|
+
const s = ve(e), o = ve(t);
|
|
2352
2392
|
return Math.floor((o.getTime() - s.getTime()) / 864e5);
|
|
2353
2393
|
}
|
|
2354
2394
|
export {
|
|
2355
|
-
|
|
2395
|
+
be as CONTROL_PARAM_PREFIX,
|
|
2356
2396
|
ne as DEFAULT_LABELS,
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2397
|
+
wn as DesignSpace,
|
|
2398
|
+
pn as EN_US_LABELS,
|
|
2399
|
+
bt as FRAME_ATTRIBUTE,
|
|
2400
|
+
wt as FRAME_PARAM,
|
|
2401
|
+
kn as HANDOFF_PARAM,
|
|
2402
|
+
mn as NETWORK_LABELS,
|
|
2403
|
+
je as NETWORK_STATES,
|
|
2404
|
+
M as PARAM,
|
|
2405
|
+
nt as SLOW_NETWORK_DELAY_MS,
|
|
2406
|
+
ot as SimulatedNetworkError,
|
|
2407
|
+
Ke as StageEmpty,
|
|
2408
|
+
$t as VIEWPORTS,
|
|
2409
|
+
fe as ZOOM_DEFAULT,
|
|
2410
|
+
Re as ZOOM_MAX,
|
|
2411
|
+
Ee as ZOOM_MIN,
|
|
2412
|
+
vn as ageInYears,
|
|
2373
2413
|
Pe as applyHandoffScope,
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2414
|
+
Ne as applyOverrides,
|
|
2415
|
+
Xe as clampZoom,
|
|
2416
|
+
Cn as commitUrl,
|
|
2417
|
+
xn as componentUrl,
|
|
2418
|
+
fn as createHttpAdapter,
|
|
2419
|
+
xt as createRegistry,
|
|
2420
|
+
gn as daysBetween,
|
|
2381
2421
|
Le as fixtureAdapter,
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2422
|
+
yn as formatIssues,
|
|
2423
|
+
kt as getDeployContext,
|
|
2424
|
+
ge as handoffAllowsComponent,
|
|
2425
|
+
He as handoffAllowsPath,
|
|
2386
2426
|
oe as handoffAllowsScenario,
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2427
|
+
Nn as hasErrors,
|
|
2428
|
+
$n as matchPath,
|
|
2429
|
+
Mn as normalizeHandoffScope,
|
|
2430
|
+
Q as normalizeSearch,
|
|
2391
2431
|
$e as parseControls,
|
|
2392
|
-
|
|
2393
|
-
|
|
2432
|
+
ft as parseHandoffScope,
|
|
2433
|
+
ve as parseIsoDate,
|
|
2394
2434
|
Me as resolveFixture,
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2435
|
+
At as resolveLabels,
|
|
2436
|
+
ye as resolveRoute,
|
|
2437
|
+
Tt as resolveViewport,
|
|
2438
|
+
me as scenarioUrl,
|
|
2439
|
+
ae as serializeControls,
|
|
2440
|
+
Ln as serializeValue,
|
|
2441
|
+
Ye as useDesignSpaceState,
|
|
2402
2442
|
J as useLabels,
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2443
|
+
on as useScenarioData,
|
|
2444
|
+
mt as validateProduct,
|
|
2445
|
+
Pn as validateScenario
|
|
2406
2446
|
};
|
|
2407
2447
|
//# sourceMappingURL=index.js.map
|