@brucesantos/design-space 0.9.2 → 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 +77 -0
- package/README.md +40 -3
- package/dist/controls/params.d.ts +5 -0
- package/dist/controls/state.d.ts +12 -4
- package/dist/{index-Bj69Oe2X.js → index-BnTStnNk.js} +121 -114
- package/dist/{index-Bj69Oe2X.js.map → index-BnTStnNk.js.map} +1 -1
- package/dist/index.js +1115 -1068
- package/dist/index.js.map +1 -1
- package/dist/testing.js +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 {
|
|
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 k = new Map(
|
|
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:
|
|
56
|
-
scenario:
|
|
57
|
-
component: (
|
|
53
|
+
screens: g,
|
|
54
|
+
issues: mt(e),
|
|
55
|
+
defaultPersona: R,
|
|
56
|
+
scenario: b,
|
|
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(
|
|
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
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 k of
|
|
234
|
-
const
|
|
235
|
-
|
|
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(() => ke()), i =
|
|
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,130 +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
|
-
[
|
|
407
|
+
[h, u, e]
|
|
377
408
|
), P = U(
|
|
378
|
-
(
|
|
379
|
-
[
|
|
380
|
-
),
|
|
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:
|
|
414
|
+
controls: h,
|
|
415
|
+
viewport: v,
|
|
416
|
+
setControls: g,
|
|
417
|
+
setScreenControls: k,
|
|
418
|
+
navigate: b,
|
|
419
|
+
openScenario: $,
|
|
420
|
+
openComponent: R,
|
|
421
|
+
openScreen: N,
|
|
391
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
|
-
P
|
|
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}` : "" };
|
|
448
|
+
}
|
|
449
|
+
function Oe(e, t) {
|
|
450
|
+
const s = new URLSearchParams(e);
|
|
451
|
+
Qe(s);
|
|
452
|
+
for (const [r, i] of new URLSearchParams(t))
|
|
453
|
+
r === wt || Te(r) || s.append(r, i);
|
|
454
|
+
const o = s.toString();
|
|
455
|
+
return o ? `?${o}` : "";
|
|
456
|
+
}
|
|
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;
|
|
417
464
|
}
|
|
418
|
-
function
|
|
419
|
-
return e.startsWith(be) ? !1 : e !==
|
|
465
|
+
function Pt(e) {
|
|
466
|
+
return e.startsWith(be) ? !1 : e !== M.scenario && e !== M.fixture && e !== M.component;
|
|
420
467
|
}
|
|
421
|
-
function
|
|
468
|
+
function Tt(e) {
|
|
422
469
|
if (e.viewport === "custom")
|
|
423
470
|
return { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 };
|
|
424
|
-
const t =
|
|
471
|
+
const t = $t.find((s) => s.id === e.viewport) ?? {
|
|
425
472
|
id: "fit",
|
|
426
473
|
label: "Ajustar"
|
|
427
474
|
};
|
|
428
475
|
return e.rotated && t.width && t.height ? { ...t, width: t.height, height: t.width } : { ...t };
|
|
429
476
|
}
|
|
430
|
-
function
|
|
431
|
-
if (e === null) return
|
|
477
|
+
function Xe(e) {
|
|
478
|
+
if (e === null) return fe;
|
|
432
479
|
const t = Number.parseInt(e, 10);
|
|
433
|
-
return Number.isFinite(t) ? Math.min(
|
|
480
|
+
return Number.isFinite(t) ? Math.min(Re, Math.max(Ee, t)) : fe;
|
|
434
481
|
}
|
|
435
482
|
function ke() {
|
|
436
483
|
return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
|
|
437
484
|
}
|
|
438
|
-
function
|
|
439
|
-
return e !== null &&
|
|
485
|
+
function Et(e) {
|
|
486
|
+
return e !== null && je.includes(e);
|
|
440
487
|
}
|
|
441
|
-
function
|
|
488
|
+
function Rt(e) {
|
|
442
489
|
return e === "dark" || e === "light";
|
|
443
490
|
}
|
|
444
|
-
function
|
|
491
|
+
function _t(e) {
|
|
445
492
|
return e === "variations" || e === "info";
|
|
446
493
|
}
|
|
447
|
-
function
|
|
494
|
+
function Ft(e) {
|
|
448
495
|
if (!e) return;
|
|
449
496
|
const t = Number.parseInt(e, 10);
|
|
450
497
|
return Number.isFinite(t) && t > 0 ? t : void 0;
|
|
451
498
|
}
|
|
452
|
-
const
|
|
453
|
-
mobile: /* @__PURE__ */
|
|
499
|
+
const Ot = "@brucesantos/design-space", ze = "0.10.0", zt = {
|
|
500
|
+
mobile: /* @__PURE__ */ x(Y, { children: [
|
|
454
501
|
/* @__PURE__ */ n("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
|
|
455
502
|
/* @__PURE__ */ n("path", { d: "M11 18.5h2" })
|
|
456
503
|
] }),
|
|
457
|
-
tablet: /* @__PURE__ */
|
|
504
|
+
tablet: /* @__PURE__ */ x(Y, { children: [
|
|
458
505
|
/* @__PURE__ */ n("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
|
|
459
506
|
/* @__PURE__ */ n("path", { d: "M11 18.5h2" })
|
|
460
507
|
] }),
|
|
461
|
-
desktop: /* @__PURE__ */
|
|
508
|
+
desktop: /* @__PURE__ */ x(Y, { children: [
|
|
462
509
|
/* @__PURE__ */ n("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
|
|
463
510
|
/* @__PURE__ */ n("path", { d: "M8.5 20.5h7M12 16.5v4" })
|
|
464
511
|
] }),
|
|
465
512
|
fit: /* @__PURE__ */ n("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
|
|
466
|
-
rotate: /* @__PURE__ */
|
|
513
|
+
rotate: /* @__PURE__ */ x(Y, { children: [
|
|
467
514
|
/* @__PURE__ */ n("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
|
|
468
515
|
/* @__PURE__ */ n("path", { d: "M20 4v4.5h-4.5" })
|
|
469
516
|
] }),
|
|
470
517
|
minus: /* @__PURE__ */ n("path", { d: "M5 12h14" }),
|
|
471
518
|
plus: /* @__PURE__ */ n("path", { d: "M5 12h14M12 5v14" }),
|
|
472
519
|
"arrow-up-right": /* @__PURE__ */ n("path", { d: "M7 17 17 7M8 7h9v9" }),
|
|
473
|
-
link: /* @__PURE__ */
|
|
520
|
+
link: /* @__PURE__ */ x(Y, { children: [
|
|
474
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" }),
|
|
475
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" })
|
|
476
523
|
] }),
|
|
477
524
|
check: /* @__PURE__ */ n("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
|
|
478
525
|
fullscreen: /* @__PURE__ */ n("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
|
|
479
|
-
sun: /* @__PURE__ */
|
|
526
|
+
sun: /* @__PURE__ */ x(Y, { children: [
|
|
480
527
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
|
|
481
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" })
|
|
482
529
|
] }),
|
|
483
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" }),
|
|
484
|
-
panel: /* @__PURE__ */
|
|
531
|
+
panel: /* @__PURE__ */ x(Y, { children: [
|
|
485
532
|
/* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
486
533
|
/* @__PURE__ */ n("path", { d: "M15 4v16" })
|
|
487
534
|
] }),
|
|
488
|
-
alert: /* @__PURE__ */
|
|
535
|
+
alert: /* @__PURE__ */ x(Y, { children: [
|
|
489
536
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
|
|
490
537
|
/* @__PURE__ */ n("path", { d: "M12 7.5v5.5M12 16.2v.3" })
|
|
491
538
|
] }),
|
|
492
539
|
chevron: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6" }),
|
|
493
|
-
search: /* @__PURE__ */
|
|
540
|
+
search: /* @__PURE__ */ x(Y, { children: [
|
|
494
541
|
/* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "6.5" }),
|
|
495
542
|
/* @__PURE__ */ n("path", { d: "M20 20l-4.2-4.2" })
|
|
496
543
|
] }),
|
|
497
|
-
copy: /* @__PURE__ */
|
|
544
|
+
copy: /* @__PURE__ */ x(Y, { children: [
|
|
498
545
|
/* @__PURE__ */ n("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
|
|
499
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" })
|
|
500
547
|
] })
|
|
@@ -514,7 +561,7 @@ function H({ name: e, size: t = 16 }) {
|
|
|
514
561
|
strokeLinejoin: "round",
|
|
515
562
|
"aria-hidden": "true",
|
|
516
563
|
focusable: "false",
|
|
517
|
-
children:
|
|
564
|
+
children: zt[e]
|
|
518
565
|
}
|
|
519
566
|
);
|
|
520
567
|
}
|
|
@@ -659,7 +706,7 @@ const ne = {
|
|
|
659
706
|
empty: "Nada para mostrar ainda",
|
|
660
707
|
emptyHint: "O produto ainda não registrou telas nem componentes."
|
|
661
708
|
}
|
|
662
|
-
},
|
|
709
|
+
}, pn = {
|
|
663
710
|
network: {
|
|
664
711
|
success: "Success",
|
|
665
712
|
loading: "Loading",
|
|
@@ -801,7 +848,7 @@ const ne = {
|
|
|
801
848
|
emptyHint: "The product has not registered any screens or components yet."
|
|
802
849
|
}
|
|
803
850
|
};
|
|
804
|
-
function
|
|
851
|
+
function At(e) {
|
|
805
852
|
if (!e) return ne;
|
|
806
853
|
const t = { ...ne };
|
|
807
854
|
for (const s of Object.keys(ne)) {
|
|
@@ -810,72 +857,72 @@ function Rt(e) {
|
|
|
810
857
|
}
|
|
811
858
|
return t;
|
|
812
859
|
}
|
|
813
|
-
const
|
|
860
|
+
const Je = ht(ne);
|
|
814
861
|
function J() {
|
|
815
|
-
return
|
|
862
|
+
return ut(Je);
|
|
816
863
|
}
|
|
817
|
-
const
|
|
864
|
+
const mn = ne.network, Dt = [
|
|
818
865
|
{ id: "mobile", icon: "mobile" },
|
|
819
866
|
{ id: "tablet", icon: "tablet" },
|
|
820
867
|
{ id: "desktop", icon: "desktop" },
|
|
821
868
|
{ id: "fit", icon: "fit" }
|
|
822
|
-
],
|
|
823
|
-
function
|
|
824
|
-
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;
|
|
825
872
|
}
|
|
826
|
-
function
|
|
873
|
+
function Vt({
|
|
827
874
|
productName: e,
|
|
828
875
|
viewportId: t,
|
|
829
876
|
viewport: s,
|
|
830
877
|
zoom: o,
|
|
831
878
|
rotated: r,
|
|
832
879
|
theme: i,
|
|
833
|
-
issues:
|
|
834
|
-
linkUrl:
|
|
835
|
-
onViewport:
|
|
836
|
-
onRotate:
|
|
837
|
-
onZoom:
|
|
838
|
-
onCleanReview:
|
|
839
|
-
onToggleTheme:
|
|
880
|
+
issues: d,
|
|
881
|
+
linkUrl: l,
|
|
882
|
+
onViewport: w,
|
|
883
|
+
onRotate: h,
|
|
884
|
+
onZoom: u,
|
|
885
|
+
onCleanReview: c,
|
|
886
|
+
onToggleTheme: g
|
|
840
887
|
}) {
|
|
841
|
-
const k = J(),
|
|
888
|
+
const k = J(), b = k.topbar, [$, R] = V(!1), N = (t === "mobile" || t === "tablet") && !!(s.width && s.height), P = async () => {
|
|
842
889
|
try {
|
|
843
|
-
await navigator.clipboard.writeText(
|
|
890
|
+
await navigator.clipboard.writeText(l);
|
|
844
891
|
} catch {
|
|
845
|
-
window.prompt(
|
|
892
|
+
window.prompt(b.copyPrompt, l);
|
|
846
893
|
}
|
|
847
|
-
|
|
894
|
+
R(!0), window.setTimeout(() => R(!1), 1600);
|
|
848
895
|
};
|
|
849
|
-
return /* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ x("header", { className: "ds-topbar", "aria-label": b.region, children: [
|
|
897
|
+
/* @__PURE__ */ x("div", { className: "ds-topbar__product", children: [
|
|
851
898
|
/* @__PURE__ */ n("span", { className: "ds-topbar__name", children: e }),
|
|
852
899
|
/* @__PURE__ */ n(
|
|
853
900
|
"a",
|
|
854
901
|
{
|
|
855
902
|
className: "ds-topbar__version",
|
|
856
|
-
href: `https://www.npmjs.com/package/${
|
|
903
|
+
href: `https://www.npmjs.com/package/${Ot}/v/${ze}`,
|
|
857
904
|
target: "_blank",
|
|
858
905
|
rel: "noreferrer",
|
|
859
|
-
children:
|
|
906
|
+
children: b.engineVersion(ze)
|
|
860
907
|
}
|
|
861
908
|
)
|
|
862
909
|
] }),
|
|
863
|
-
/* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
|
|
866
|
-
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;
|
|
867
914
|
return /* @__PURE__ */ n(
|
|
868
915
|
"button",
|
|
869
916
|
{
|
|
870
917
|
type: "button",
|
|
871
918
|
className: "ds-btn ds-btn--icon",
|
|
872
|
-
"aria-pressed": t ===
|
|
873
|
-
"aria-label":
|
|
874
|
-
title:
|
|
875
|
-
onClick: () =>
|
|
876
|
-
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 })
|
|
877
924
|
},
|
|
878
|
-
|
|
925
|
+
v.id
|
|
879
926
|
);
|
|
880
927
|
}),
|
|
881
928
|
/* @__PURE__ */ n(
|
|
@@ -884,24 +931,24 @@ function Ft({
|
|
|
884
931
|
type: "button",
|
|
885
932
|
className: "ds-btn ds-btn--icon",
|
|
886
933
|
"aria-pressed": r,
|
|
887
|
-
"aria-label":
|
|
888
|
-
title:
|
|
934
|
+
"aria-label": b.rotate,
|
|
935
|
+
title: b.rotate,
|
|
889
936
|
disabled: !N,
|
|
890
|
-
onClick:
|
|
937
|
+
onClick: h,
|
|
891
938
|
children: /* @__PURE__ */ n(H, { name: "rotate" })
|
|
892
939
|
}
|
|
893
940
|
)
|
|
894
941
|
] }),
|
|
895
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ x("div", { className: "ds-group", role: "group", children: [
|
|
896
943
|
/* @__PURE__ */ n(
|
|
897
944
|
"button",
|
|
898
945
|
{
|
|
899
946
|
type: "button",
|
|
900
947
|
className: "ds-btn ds-btn--icon",
|
|
901
|
-
"aria-label":
|
|
902
|
-
title:
|
|
903
|
-
disabled: o <=
|
|
904
|
-
onClick: () =>
|
|
948
|
+
"aria-label": b.zoomOut,
|
|
949
|
+
title: b.zoomOut,
|
|
950
|
+
disabled: o <= Ee,
|
|
951
|
+
onClick: () => u(De(o, -1)),
|
|
905
952
|
children: /* @__PURE__ */ n(H, { name: "minus" })
|
|
906
953
|
}
|
|
907
954
|
),
|
|
@@ -910,10 +957,10 @@ function Ft({
|
|
|
910
957
|
{
|
|
911
958
|
type: "button",
|
|
912
959
|
className: "ds-btn ds-btn--zoom",
|
|
913
|
-
"aria-label":
|
|
914
|
-
title:
|
|
915
|
-
onClick: () =>
|
|
916
|
-
children:
|
|
960
|
+
"aria-label": b.zoomReset,
|
|
961
|
+
title: b.zoomReset,
|
|
962
|
+
onClick: () => u(fe),
|
|
963
|
+
children: b.zoomValue(o)
|
|
917
964
|
}
|
|
918
965
|
),
|
|
919
966
|
/* @__PURE__ */ n(
|
|
@@ -921,10 +968,10 @@ function Ft({
|
|
|
921
968
|
{
|
|
922
969
|
type: "button",
|
|
923
970
|
className: "ds-btn ds-btn--icon",
|
|
924
|
-
"aria-label":
|
|
925
|
-
title:
|
|
926
|
-
disabled: o >=
|
|
927
|
-
onClick: () =>
|
|
971
|
+
"aria-label": b.zoomIn,
|
|
972
|
+
title: b.zoomIn,
|
|
973
|
+
disabled: o >= Re,
|
|
974
|
+
onClick: () => u(De(o, 1)),
|
|
928
975
|
children: /* @__PURE__ */ n(H, { name: "plus" })
|
|
929
976
|
}
|
|
930
977
|
)
|
|
@@ -934,23 +981,23 @@ function Ft({
|
|
|
934
981
|
{
|
|
935
982
|
type: "button",
|
|
936
983
|
className: "ds-btn ds-btn--icon",
|
|
937
|
-
"aria-label":
|
|
938
|
-
title:
|
|
939
|
-
onClick:
|
|
984
|
+
"aria-label": b.cleanReview,
|
|
985
|
+
title: b.cleanReview,
|
|
986
|
+
onClick: c,
|
|
940
987
|
children: /* @__PURE__ */ n(H, { name: "fullscreen" })
|
|
941
988
|
}
|
|
942
989
|
)
|
|
943
990
|
] }),
|
|
944
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ x("div", { className: "ds-topbar__tools", children: [
|
|
945
992
|
/* @__PURE__ */ n(
|
|
946
993
|
"button",
|
|
947
994
|
{
|
|
948
995
|
type: "button",
|
|
949
996
|
className: "ds-btn ds-btn--icon",
|
|
950
|
-
"aria-label":
|
|
951
|
-
title:
|
|
952
|
-
onClick:
|
|
953
|
-
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" })
|
|
954
1001
|
}
|
|
955
1002
|
),
|
|
956
1003
|
/* @__PURE__ */ n(
|
|
@@ -958,73 +1005,73 @@ function Ft({
|
|
|
958
1005
|
{
|
|
959
1006
|
type: "button",
|
|
960
1007
|
className: "ds-btn ds-btn--icon",
|
|
961
|
-
"aria-label": i === "dark" ?
|
|
962
|
-
title: i === "dark" ?
|
|
963
|
-
onClick:
|
|
1008
|
+
"aria-label": i === "dark" ? b.lightMode : b.darkMode,
|
|
1009
|
+
title: i === "dark" ? b.lightMode : b.darkMode,
|
|
1010
|
+
onClick: g,
|
|
964
1011
|
children: /* @__PURE__ */ n(H, { name: i === "dark" ? "sun" : "moon" })
|
|
965
1012
|
}
|
|
966
1013
|
),
|
|
967
|
-
|
|
1014
|
+
d.length > 0 && /* @__PURE__ */ n(Kt, { issues: d })
|
|
968
1015
|
] })
|
|
969
1016
|
] });
|
|
970
1017
|
}
|
|
971
|
-
function
|
|
972
|
-
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);
|
|
973
1020
|
return I(() => {
|
|
974
1021
|
if (!s) return;
|
|
975
|
-
const
|
|
976
|
-
r.current?.contains(
|
|
977
|
-
},
|
|
978
|
-
|
|
1022
|
+
const w = (u) => {
|
|
1023
|
+
r.current?.contains(u.target) || o(!1);
|
|
1024
|
+
}, h = (u) => {
|
|
1025
|
+
u.key === "Escape" && o(!1);
|
|
979
1026
|
};
|
|
980
|
-
return window.addEventListener("pointerdown",
|
|
981
|
-
window.removeEventListener("pointerdown",
|
|
1027
|
+
return window.addEventListener("pointerdown", w), window.addEventListener("keydown", h), () => {
|
|
1028
|
+
window.removeEventListener("pointerdown", w), window.removeEventListener("keydown", h);
|
|
982
1029
|
};
|
|
983
|
-
}, [s]), /* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
1030
|
+
}, [s]), /* @__PURE__ */ x("div", { className: "ds-diagnostics", ref: r, children: [
|
|
1031
|
+
/* @__PURE__ */ x(
|
|
985
1032
|
"button",
|
|
986
1033
|
{
|
|
987
1034
|
type: "button",
|
|
988
1035
|
className: "ds-btn ds-diagnostics__trigger",
|
|
989
1036
|
"data-level": i > 0 ? "error" : "warning",
|
|
990
1037
|
"aria-expanded": s,
|
|
991
|
-
"aria-label":
|
|
992
|
-
title:
|
|
993
|
-
onClick: () => o((
|
|
1038
|
+
"aria-label": l,
|
|
1039
|
+
title: l,
|
|
1040
|
+
onClick: () => o((w) => !w),
|
|
994
1041
|
children: [
|
|
995
1042
|
/* @__PURE__ */ n(H, { name: "alert" }),
|
|
996
|
-
/* @__PURE__ */ n("span", { children: i > 0 ? i :
|
|
1043
|
+
/* @__PURE__ */ n("span", { children: i > 0 ? i : d })
|
|
997
1044
|
]
|
|
998
1045
|
}
|
|
999
1046
|
),
|
|
1000
|
-
s && /* @__PURE__ */
|
|
1001
|
-
/* @__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: [
|
|
1002
1049
|
/* @__PURE__ */ n("strong", { children: t.diagnostics.title }),
|
|
1003
|
-
/* @__PURE__ */ n("span", { className: "ds-muted", children:
|
|
1050
|
+
/* @__PURE__ */ n("span", { className: "ds-muted", children: l })
|
|
1004
1051
|
] }),
|
|
1005
|
-
/* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((
|
|
1006
|
-
/* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children:
|
|
1007
|
-
/* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children:
|
|
1008
|
-
/* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children:
|
|
1009
|
-
] }, `${
|
|
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}`)) })
|
|
1010
1057
|
] })
|
|
1011
1058
|
] });
|
|
1012
1059
|
}
|
|
1013
|
-
const
|
|
1014
|
-
function
|
|
1015
|
-
const
|
|
1016
|
-
if (
|
|
1017
|
-
|
|
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 };
|
|
1018
1065
|
try {
|
|
1019
|
-
|
|
1066
|
+
g.currentTarget.setPointerCapture(g.pointerId);
|
|
1020
1067
|
} catch {
|
|
1021
1068
|
}
|
|
1022
1069
|
r?.();
|
|
1023
1070
|
}
|
|
1024
|
-
},
|
|
1025
|
-
|
|
1026
|
-
},
|
|
1027
|
-
|
|
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?.());
|
|
1028
1075
|
};
|
|
1029
1076
|
return /* @__PURE__ */ n(
|
|
1030
1077
|
"div",
|
|
@@ -1036,98 +1083,98 @@ function Xe({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: i })
|
|
|
1036
1083
|
"aria-label": t,
|
|
1037
1084
|
"aria-valuenow": s,
|
|
1038
1085
|
tabIndex: 0,
|
|
1039
|
-
onPointerDown:
|
|
1040
|
-
onPointerMove:
|
|
1041
|
-
onPointerUp:
|
|
1042
|
-
onPointerCancel:
|
|
1043
|
-
onLostPointerCapture:
|
|
1044
|
-
onKeyDown: (
|
|
1045
|
-
if (
|
|
1046
|
-
|
|
1047
|
-
const k =
|
|
1048
|
-
o(s + k *
|
|
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);
|
|
1049
1096
|
}
|
|
1050
1097
|
}
|
|
1051
1098
|
);
|
|
1052
1099
|
}
|
|
1053
|
-
function
|
|
1100
|
+
function It({
|
|
1054
1101
|
registry: e,
|
|
1055
1102
|
handoff: t,
|
|
1056
1103
|
activeScreen: s,
|
|
1057
1104
|
activeComponent: o,
|
|
1058
1105
|
onOpenScreen: r,
|
|
1059
1106
|
onOpenComponent: i,
|
|
1060
|
-
width:
|
|
1061
|
-
onResize:
|
|
1062
|
-
onResizeStart:
|
|
1063
|
-
onResizeEnd:
|
|
1107
|
+
width: d,
|
|
1108
|
+
onResize: l,
|
|
1109
|
+
onResizeStart: w,
|
|
1110
|
+
onResizeEnd: h
|
|
1064
1111
|
}) {
|
|
1065
|
-
const
|
|
1066
|
-
() => 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"
|
|
1067
1114
|
);
|
|
1068
1115
|
I(() => {
|
|
1069
|
-
o &&
|
|
1070
|
-
}, [o, s,
|
|
1071
|
-
const
|
|
1116
|
+
o && p ? S("components") : s && v && S("screens");
|
|
1117
|
+
}, [o, s, p, v]);
|
|
1118
|
+
const y = f;
|
|
1072
1119
|
I(() => {
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1120
|
+
const _ = (K) => {
|
|
1121
|
+
Bt(K) && (K.preventDefault(), R.current?.focus(), R.current?.select());
|
|
1075
1122
|
};
|
|
1076
|
-
return window.addEventListener("keydown",
|
|
1123
|
+
return window.addEventListener("keydown", _), () => window.removeEventListener("keydown", _);
|
|
1077
1124
|
}, []);
|
|
1078
|
-
const
|
|
1079
|
-
() => e.searchScreens(
|
|
1080
|
-
[t,
|
|
1081
|
-
),
|
|
1082
|
-
() => e.searchComponents(
|
|
1083
|
-
[t,
|
|
1084
|
-
),
|
|
1085
|
-
const
|
|
1086
|
-
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;
|
|
1087
1134
|
});
|
|
1088
|
-
return /* @__PURE__ */
|
|
1089
|
-
/* @__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: [
|
|
1090
1137
|
/* @__PURE__ */ n(H, { name: "search", size: 14 }),
|
|
1091
1138
|
/* @__PURE__ */ n(
|
|
1092
1139
|
"input",
|
|
1093
1140
|
{
|
|
1094
|
-
ref:
|
|
1141
|
+
ref: R,
|
|
1095
1142
|
className: "ds-input ds-search__input",
|
|
1096
1143
|
type: "search",
|
|
1097
|
-
value:
|
|
1098
|
-
placeholder:
|
|
1099
|
-
"aria-label":
|
|
1100
|
-
onChange: (
|
|
1101
|
-
onKeyDown: (
|
|
1102
|
-
|
|
1144
|
+
value: g,
|
|
1145
|
+
placeholder: c.searchPlaceholder,
|
|
1146
|
+
"aria-label": c.searchLabel,
|
|
1147
|
+
onChange: (_) => k(_.target.value),
|
|
1148
|
+
onKeyDown: (_) => {
|
|
1149
|
+
_.key === "Escape" && k("");
|
|
1103
1150
|
}
|
|
1104
1151
|
}
|
|
1105
1152
|
),
|
|
1106
|
-
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children:
|
|
1153
|
+
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: c.searchShortcut })
|
|
1107
1154
|
] }),
|
|
1108
|
-
/* @__PURE__ */
|
|
1155
|
+
/* @__PURE__ */ x("div", { className: "ds-tabs", role: "tablist", "aria-label": c.tabs, children: [
|
|
1109
1156
|
/* @__PURE__ */ n(
|
|
1110
|
-
|
|
1157
|
+
Ve,
|
|
1111
1158
|
{
|
|
1112
|
-
selected:
|
|
1113
|
-
label:
|
|
1114
|
-
count:
|
|
1115
|
-
onSelect: () =>
|
|
1159
|
+
selected: y === "screens",
|
|
1160
|
+
label: c.screensTab,
|
|
1161
|
+
count: L ? T.length : void 0,
|
|
1162
|
+
onSelect: () => S("screens")
|
|
1116
1163
|
}
|
|
1117
1164
|
),
|
|
1118
1165
|
/* @__PURE__ */ n(
|
|
1119
|
-
|
|
1166
|
+
Ve,
|
|
1120
1167
|
{
|
|
1121
|
-
selected:
|
|
1122
|
-
label:
|
|
1123
|
-
count:
|
|
1124
|
-
onSelect: () =>
|
|
1168
|
+
selected: y === "components",
|
|
1169
|
+
label: c.componentsTab,
|
|
1170
|
+
count: L ? a.length : void 0,
|
|
1171
|
+
onSelect: () => S("components")
|
|
1125
1172
|
}
|
|
1126
1173
|
)
|
|
1127
1174
|
] }),
|
|
1128
|
-
/* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children:
|
|
1129
|
-
const K = /* @__PURE__ */ n("ul", { className: "ds-items", children:
|
|
1130
|
-
|
|
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,
|
|
1131
1178
|
{
|
|
1132
1179
|
screen: A,
|
|
1133
1180
|
active: A.id === s && !o,
|
|
@@ -1135,76 +1182,76 @@ function At({
|
|
|
1135
1182
|
},
|
|
1136
1183
|
A.id
|
|
1137
1184
|
)) });
|
|
1138
|
-
if (
|
|
1139
|
-
const
|
|
1140
|
-
return /* @__PURE__ */
|
|
1141
|
-
/* @__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(
|
|
1142
1189
|
"button",
|
|
1143
1190
|
{
|
|
1144
1191
|
type: "button",
|
|
1145
1192
|
className: "ds-group-section__head",
|
|
1146
|
-
"aria-expanded": !
|
|
1147
|
-
"aria-label":
|
|
1148
|
-
onClick: () =>
|
|
1193
|
+
"aria-expanded": !z,
|
|
1194
|
+
"aria-label": c.toggleGroup(_.name),
|
|
1195
|
+
onClick: () => O(E),
|
|
1149
1196
|
children: [
|
|
1150
1197
|
/* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
|
|
1151
|
-
/* @__PURE__ */ n("span", { children:
|
|
1152
|
-
/* @__PURE__ */ n("span", { className: "ds-count", children:
|
|
1198
|
+
/* @__PURE__ */ n("span", { children: _.name }),
|
|
1199
|
+
/* @__PURE__ */ n("span", { className: "ds-count", children: _.screens.length })
|
|
1153
1200
|
]
|
|
1154
1201
|
}
|
|
1155
1202
|
),
|
|
1156
|
-
!
|
|
1157
|
-
] },
|
|
1158
|
-
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children:
|
|
1159
|
-
const
|
|
1160
|
-
return /* @__PURE__ */
|
|
1161
|
-
/* @__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(
|
|
1162
1209
|
"button",
|
|
1163
1210
|
{
|
|
1164
1211
|
type: "button",
|
|
1165
1212
|
className: "ds-group-section__head",
|
|
1166
|
-
"aria-expanded": !
|
|
1167
|
-
"aria-label":
|
|
1168
|
-
onClick: () =>
|
|
1213
|
+
"aria-expanded": !E,
|
|
1214
|
+
"aria-label": c.toggleGroup(_),
|
|
1215
|
+
onClick: () => O(_),
|
|
1169
1216
|
children: [
|
|
1170
1217
|
/* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
|
|
1171
|
-
/* @__PURE__ */ n("span", { children:
|
|
1218
|
+
/* @__PURE__ */ n("span", { children: _ }),
|
|
1172
1219
|
/* @__PURE__ */ n("span", { className: "ds-count", children: K.length })
|
|
1173
1220
|
]
|
|
1174
1221
|
}
|
|
1175
1222
|
),
|
|
1176
|
-
!
|
|
1223
|
+
!E && /* @__PURE__ */ n("ul", { className: "ds-items", children: K.map((z) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
1177
1224
|
"button",
|
|
1178
1225
|
{
|
|
1179
1226
|
type: "button",
|
|
1180
1227
|
className: "ds-item",
|
|
1181
|
-
"aria-current":
|
|
1182
|
-
onClick: () => i(
|
|
1183
|
-
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 })
|
|
1184
1231
|
}
|
|
1185
|
-
) },
|
|
1186
|
-
] },
|
|
1187
|
-
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children:
|
|
1232
|
+
) }, z.id)) })
|
|
1233
|
+
] }, _);
|
|
1234
|
+
}) : /* @__PURE__ */ n("p", { className: "ds-empty", children: c.emptyComponents }) }),
|
|
1188
1235
|
/* @__PURE__ */ n(
|
|
1189
|
-
|
|
1236
|
+
et,
|
|
1190
1237
|
{
|
|
1191
1238
|
side: "left",
|
|
1192
|
-
label:
|
|
1193
|
-
value:
|
|
1194
|
-
onChange:
|
|
1195
|
-
onStart:
|
|
1196
|
-
onEnd:
|
|
1239
|
+
label: c.resize,
|
|
1240
|
+
value: d,
|
|
1241
|
+
onChange: l,
|
|
1242
|
+
onStart: w,
|
|
1243
|
+
onEnd: h
|
|
1197
1244
|
}
|
|
1198
1245
|
)
|
|
1199
1246
|
] });
|
|
1200
1247
|
}
|
|
1201
|
-
function
|
|
1248
|
+
function Ve({
|
|
1202
1249
|
selected: e,
|
|
1203
1250
|
label: t,
|
|
1204
1251
|
count: s,
|
|
1205
1252
|
onSelect: o
|
|
1206
1253
|
}) {
|
|
1207
|
-
return /* @__PURE__ */
|
|
1254
|
+
return /* @__PURE__ */ x(
|
|
1208
1255
|
"button",
|
|
1209
1256
|
{
|
|
1210
1257
|
type: "button",
|
|
@@ -1220,12 +1267,12 @@ function Ae({
|
|
|
1220
1267
|
}
|
|
1221
1268
|
);
|
|
1222
1269
|
}
|
|
1223
|
-
function
|
|
1270
|
+
function Wt({
|
|
1224
1271
|
screen: e,
|
|
1225
1272
|
active: t,
|
|
1226
1273
|
onOpen: s
|
|
1227
1274
|
}) {
|
|
1228
|
-
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ x(
|
|
1229
1276
|
"button",
|
|
1230
1277
|
{
|
|
1231
1278
|
type: "button",
|
|
@@ -1239,7 +1286,7 @@ function Dt({
|
|
|
1239
1286
|
}
|
|
1240
1287
|
) });
|
|
1241
1288
|
}
|
|
1242
|
-
function
|
|
1289
|
+
function Ht(e, t) {
|
|
1243
1290
|
const s = /* @__PURE__ */ new Map();
|
|
1244
1291
|
for (const o of e) {
|
|
1245
1292
|
const r = o.group?.trim() || t, i = s.get(r) ?? [];
|
|
@@ -1247,10 +1294,10 @@ function Vt(e, t) {
|
|
|
1247
1294
|
}
|
|
1248
1295
|
return [...s].map(([o, r]) => ({ group: o, items: r }));
|
|
1249
1296
|
}
|
|
1250
|
-
function
|
|
1297
|
+
function Bt(e) {
|
|
1251
1298
|
return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "k";
|
|
1252
1299
|
}
|
|
1253
|
-
function
|
|
1300
|
+
function jt({
|
|
1254
1301
|
screen: e,
|
|
1255
1302
|
variations: t,
|
|
1256
1303
|
components: s,
|
|
@@ -1258,49 +1305,49 @@ function Ut({
|
|
|
1258
1305
|
labels: r,
|
|
1259
1306
|
overrides: i
|
|
1260
1307
|
}) {
|
|
1261
|
-
const
|
|
1262
|
-
e.description &&
|
|
1263
|
-
const
|
|
1264
|
-
if (
|
|
1265
|
-
const
|
|
1266
|
-
|
|
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()})`);
|
|
1267
1314
|
}
|
|
1268
|
-
for (const
|
|
1269
|
-
const
|
|
1270
|
-
let
|
|
1271
|
-
if (
|
|
1272
|
-
const k =
|
|
1273
|
-
|
|
1274
|
-
} else
|
|
1275
|
-
|
|
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);
|
|
1276
1323
|
}
|
|
1277
|
-
if (
|
|
1278
|
-
|
|
1279
|
-
for (const
|
|
1280
|
-
const
|
|
1281
|
-
|
|
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} |`);
|
|
1282
1329
|
}
|
|
1283
|
-
|
|
1330
|
+
l.push("");
|
|
1284
1331
|
}
|
|
1285
|
-
|
|
1286
|
-
for (const
|
|
1287
|
-
if (
|
|
1288
|
-
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}`);
|
|
1289
1336
|
else
|
|
1290
|
-
|
|
1291
|
-
|
|
1337
|
+
l.push(d.noExpected);
|
|
1338
|
+
l.push("");
|
|
1292
1339
|
}
|
|
1293
|
-
return `${
|
|
1340
|
+
return `${l.join(`
|
|
1294
1341
|
`).trimEnd()}
|
|
1295
1342
|
`;
|
|
1296
1343
|
}
|
|
1297
|
-
function
|
|
1344
|
+
function we(e) {
|
|
1298
1345
|
return e.replace(/\|/g, "\\|").replace(/\n/g, " ");
|
|
1299
1346
|
}
|
|
1300
|
-
function
|
|
1347
|
+
function tt(e) {
|
|
1301
1348
|
return e.replace(/([[\]])/g, "\\$1");
|
|
1302
1349
|
}
|
|
1303
|
-
function
|
|
1350
|
+
function qt({
|
|
1304
1351
|
flow: e,
|
|
1305
1352
|
registry: t,
|
|
1306
1353
|
open: s,
|
|
@@ -1308,116 +1355,116 @@ function It({
|
|
|
1308
1355
|
labels: r,
|
|
1309
1356
|
overrides: i
|
|
1310
1357
|
}) {
|
|
1311
|
-
const
|
|
1312
|
-
if (s && s.screen.id ===
|
|
1313
|
-
const
|
|
1314
|
-
for (const N of
|
|
1315
|
-
for (const [N,
|
|
1316
|
-
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();
|
|
1317
1364
|
}
|
|
1318
|
-
const k =
|
|
1319
|
-
if (k) return
|
|
1320
|
-
const
|
|
1321
|
-
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();
|
|
1322
1369
|
};
|
|
1323
|
-
for (const
|
|
1324
|
-
|
|
1325
|
-
let
|
|
1326
|
-
if (
|
|
1327
|
-
|
|
1328
|
-
for (const N of
|
|
1329
|
-
|
|
1330
|
-
for (const
|
|
1331
|
-
const
|
|
1332
|
-
(
|
|
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}\`)`
|
|
1333
1380
|
).join(" · ");
|
|
1334
|
-
|
|
1381
|
+
l.push(` - ${le(P.label)} (\`c.${P.id}\`): ${p}`);
|
|
1335
1382
|
}
|
|
1336
1383
|
}
|
|
1337
|
-
|
|
1384
|
+
l.push("");
|
|
1338
1385
|
}
|
|
1339
|
-
if (
|
|
1340
|
-
|
|
1341
|
-
for (const N of
|
|
1342
|
-
|
|
1343
|
-
`- [${
|
|
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 })})`
|
|
1344
1391
|
);
|
|
1345
|
-
|
|
1392
|
+
l.push("");
|
|
1346
1393
|
}
|
|
1347
|
-
|
|
1348
|
-
const k = s?.screen.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(
|
|
1349
1396
|
(N) => N.expected?.length && N.id !== k?.id
|
|
1350
1397
|
);
|
|
1351
|
-
if (!
|
|
1352
|
-
for (const N of
|
|
1353
|
-
|
|
1398
|
+
if (!b?.length && $.length === 0 && l.push(d.noExpected, ""), b?.length) {
|
|
1399
|
+
for (const N of b) l.push(`- ${N}`);
|
|
1400
|
+
l.push("");
|
|
1354
1401
|
}
|
|
1355
|
-
for (const N of
|
|
1356
|
-
|
|
1357
|
-
for (const
|
|
1358
|
-
|
|
1402
|
+
for (const N of $) {
|
|
1403
|
+
l.push(`*${N.title}*`, "");
|
|
1404
|
+
for (const P of N.expected ?? []) l.push(`- ${P}`);
|
|
1405
|
+
l.push("");
|
|
1359
1406
|
}
|
|
1360
|
-
const
|
|
1361
|
-
if (
|
|
1362
|
-
|
|
1363
|
-
for (const N of
|
|
1364
|
-
const
|
|
1365
|
-
|
|
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} |`);
|
|
1366
1413
|
}
|
|
1367
|
-
|
|
1414
|
+
l.push("");
|
|
1368
1415
|
}
|
|
1369
1416
|
}
|
|
1370
|
-
return `${
|
|
1417
|
+
return `${l.join(`
|
|
1371
1418
|
`).trimEnd()}
|
|
1372
1419
|
`;
|
|
1373
1420
|
}
|
|
1374
|
-
function
|
|
1421
|
+
function le(e) {
|
|
1375
1422
|
return e.replace(/([*_[\]`])/g, "\\$1");
|
|
1376
1423
|
}
|
|
1377
|
-
function
|
|
1378
|
-
const { tab: t, onTab: s, width: o, onResize: r, onResizeStart: i, onResizeEnd:
|
|
1379
|
-
const
|
|
1380
|
-
return
|
|
1381
|
-
}), 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;
|
|
1382
1429
|
return I(() => {
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1430
|
+
const P = (v) => {
|
|
1431
|
+
Qt(v) && (v.preventDefault(), u.current?.focus(), u.current?.select());
|
|
1385
1432
|
};
|
|
1386
|
-
return window.addEventListener("keydown",
|
|
1387
|
-
}, []),
|
|
1388
|
-
k(
|
|
1389
|
-
}), /* @__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: [
|
|
1390
1437
|
/* @__PURE__ */ n(
|
|
1391
|
-
|
|
1438
|
+
et,
|
|
1392
1439
|
{
|
|
1393
1440
|
side: "right",
|
|
1394
|
-
label:
|
|
1441
|
+
label: l.resize,
|
|
1395
1442
|
value: o,
|
|
1396
1443
|
onChange: r,
|
|
1397
1444
|
onStart: i,
|
|
1398
|
-
onEnd:
|
|
1445
|
+
onEnd: d
|
|
1399
1446
|
}
|
|
1400
1447
|
),
|
|
1401
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ x("div", { className: "ds-search", children: [
|
|
1402
1449
|
/* @__PURE__ */ n(H, { name: "search", size: 14 }),
|
|
1403
1450
|
/* @__PURE__ */ n(
|
|
1404
1451
|
"input",
|
|
1405
1452
|
{
|
|
1406
|
-
ref:
|
|
1453
|
+
ref: u,
|
|
1407
1454
|
className: "ds-input ds-search__input",
|
|
1408
1455
|
type: "search",
|
|
1409
|
-
value:
|
|
1410
|
-
placeholder:
|
|
1411
|
-
"aria-label":
|
|
1412
|
-
onChange: (
|
|
1413
|
-
onKeyDown: (
|
|
1414
|
-
|
|
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("");
|
|
1415
1462
|
}
|
|
1416
1463
|
}
|
|
1417
1464
|
),
|
|
1418
|
-
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children:
|
|
1465
|
+
/* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: l.searchShortcut })
|
|
1419
1466
|
] }),
|
|
1420
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ x("div", { className: "ds-tabs", role: "tablist", "aria-label": l.tabs, children: [
|
|
1421
1468
|
/* @__PURE__ */ n(
|
|
1422
1469
|
"button",
|
|
1423
1470
|
{
|
|
@@ -1427,7 +1474,7 @@ function Wt(e) {
|
|
|
1427
1474
|
"aria-selected": t === "variations",
|
|
1428
1475
|
tabIndex: t === "variations" ? 0 : -1,
|
|
1429
1476
|
onClick: () => s("variations"),
|
|
1430
|
-
children:
|
|
1477
|
+
children: l.variationsTab
|
|
1431
1478
|
}
|
|
1432
1479
|
),
|
|
1433
1480
|
/* @__PURE__ */ n(
|
|
@@ -1439,146 +1486,146 @@ function Wt(e) {
|
|
|
1439
1486
|
"aria-selected": t === "info",
|
|
1440
1487
|
tabIndex: t === "info" ? 0 : -1,
|
|
1441
1488
|
onClick: () => s("info"),
|
|
1442
|
-
children:
|
|
1489
|
+
children: l.infoTab
|
|
1443
1490
|
}
|
|
1444
1491
|
)
|
|
1445
1492
|
] }),
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
-
t === "variations" ? /* @__PURE__ */ n(
|
|
1448
|
-
|
|
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) })
|
|
1449
1496
|
] })
|
|
1450
1497
|
] });
|
|
1451
1498
|
}
|
|
1452
|
-
function
|
|
1499
|
+
function Zt({
|
|
1453
1500
|
registry: e,
|
|
1454
1501
|
controls: t,
|
|
1455
1502
|
screen: s,
|
|
1456
1503
|
variation: o,
|
|
1457
1504
|
component: r,
|
|
1458
1505
|
componentFixture: i,
|
|
1459
|
-
onOpenScenario:
|
|
1460
|
-
onOpenComponent:
|
|
1461
|
-
onChange:
|
|
1506
|
+
onOpenScenario: d,
|
|
1507
|
+
onOpenComponent: l,
|
|
1508
|
+
onChange: w
|
|
1462
1509
|
}) {
|
|
1463
|
-
const
|
|
1510
|
+
const h = J(), u = h.panel;
|
|
1464
1511
|
if (r) {
|
|
1465
|
-
const
|
|
1466
|
-
if (
|
|
1467
|
-
const
|
|
1468
|
-
return /* @__PURE__ */
|
|
1469
|
-
i.didFallback && i.requestedId &&
|
|
1470
|
-
/* @__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(
|
|
1471
1518
|
ee,
|
|
1472
1519
|
{
|
|
1473
|
-
label:
|
|
1474
|
-
value:
|
|
1475
|
-
options:
|
|
1476
|
-
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 })
|
|
1477
1524
|
}
|
|
1478
1525
|
) })
|
|
1479
1526
|
] });
|
|
1480
1527
|
}
|
|
1481
|
-
if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children:
|
|
1482
|
-
const
|
|
1483
|
-
return /* @__PURE__ */
|
|
1484
|
-
/* @__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: [
|
|
1485
1532
|
/* @__PURE__ */ n(
|
|
1486
1533
|
ee,
|
|
1487
1534
|
{
|
|
1488
|
-
label:
|
|
1535
|
+
label: u.persona,
|
|
1489
1536
|
value: t.persona ?? "",
|
|
1490
1537
|
options: [
|
|
1491
1538
|
// Com persona padrão, "nenhuma" não é uma situação possível.
|
|
1492
|
-
...e.defaultPersona ? [] : [{ value: "", label:
|
|
1493
|
-
...
|
|
1539
|
+
...e.defaultPersona ? [] : [{ value: "", label: u.none }],
|
|
1540
|
+
...g.personas.map((v) => ({ value: v.id, label: v.name }))
|
|
1494
1541
|
],
|
|
1495
|
-
onChange: (
|
|
1542
|
+
onChange: (v) => w({ persona: v || void 0 })
|
|
1496
1543
|
}
|
|
1497
1544
|
),
|
|
1498
1545
|
/* @__PURE__ */ n(
|
|
1499
1546
|
ee,
|
|
1500
1547
|
{
|
|
1501
|
-
label:
|
|
1548
|
+
label: u.network,
|
|
1502
1549
|
value: t.network,
|
|
1503
|
-
options:
|
|
1504
|
-
onChange: (
|
|
1550
|
+
options: je.map((v) => ({ value: v, label: h.network[v] })),
|
|
1551
|
+
onChange: (v) => w({ network: v })
|
|
1505
1552
|
}
|
|
1506
1553
|
),
|
|
1507
1554
|
k.length > 1 && /* @__PURE__ */ n(
|
|
1508
1555
|
ee,
|
|
1509
1556
|
{
|
|
1510
|
-
label:
|
|
1557
|
+
label: u.theme,
|
|
1511
1558
|
value: t.themeMode ?? k[0],
|
|
1512
|
-
options: k.map((
|
|
1513
|
-
onChange: (
|
|
1559
|
+
options: k.map((v) => ({ value: v, label: v })),
|
|
1560
|
+
onChange: (v) => w({ themeMode: v })
|
|
1514
1561
|
}
|
|
1515
1562
|
),
|
|
1516
|
-
|
|
1563
|
+
b.length > 1 && /* @__PURE__ */ n(
|
|
1517
1564
|
ee,
|
|
1518
1565
|
{
|
|
1519
|
-
label:
|
|
1520
|
-
value: t.locale ??
|
|
1521
|
-
options:
|
|
1522
|
-
onChange: (
|
|
1566
|
+
label: u.locale,
|
|
1567
|
+
value: t.locale ?? b[0],
|
|
1568
|
+
options: b.map((v) => ({ value: v, label: v })),
|
|
1569
|
+
onChange: (v) => w({ locale: v })
|
|
1523
1570
|
}
|
|
1524
1571
|
),
|
|
1525
|
-
|
|
1572
|
+
$.length > 0 && /* @__PURE__ */ n(
|
|
1526
1573
|
ee,
|
|
1527
1574
|
{
|
|
1528
|
-
label:
|
|
1575
|
+
label: u.dataSource,
|
|
1529
1576
|
value: t.dataSource ?? "fixtures",
|
|
1530
1577
|
options: [
|
|
1531
|
-
{ value: "fixtures", label:
|
|
1532
|
-
|
|
1578
|
+
{ value: "fixtures", label: u.fixturesOption },
|
|
1579
|
+
...$.map((v) => ({ value: v.id, label: v.label }))
|
|
1533
1580
|
],
|
|
1534
|
-
onChange: (
|
|
1581
|
+
onChange: (v) => w({ dataSource: v })
|
|
1535
1582
|
}
|
|
1536
1583
|
)
|
|
1537
1584
|
] }),
|
|
1538
|
-
s.controls.map((
|
|
1539
|
-
const
|
|
1585
|
+
s.controls.map((v) => {
|
|
1586
|
+
const p = e.component(v.component);
|
|
1540
1587
|
return /* @__PURE__ */ n(
|
|
1541
|
-
|
|
1588
|
+
de,
|
|
1542
1589
|
{
|
|
1543
|
-
title:
|
|
1544
|
-
hint:
|
|
1545
|
-
link:
|
|
1546
|
-
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(
|
|
1547
1594
|
ee,
|
|
1548
1595
|
{
|
|
1549
|
-
label:
|
|
1550
|
-
hint:
|
|
1551
|
-
value:
|
|
1552
|
-
options:
|
|
1553
|
-
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)
|
|
1554
1601
|
},
|
|
1555
|
-
|
|
1602
|
+
f.id
|
|
1556
1603
|
))
|
|
1557
1604
|
},
|
|
1558
|
-
|
|
1605
|
+
v.id
|
|
1559
1606
|
);
|
|
1560
1607
|
}),
|
|
1561
|
-
|
|
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(
|
|
1562
1609
|
"button",
|
|
1563
1610
|
{
|
|
1564
1611
|
type: "button",
|
|
1565
1612
|
className: "ds-item",
|
|
1566
|
-
title:
|
|
1567
|
-
"aria-current": N?.id ===
|
|
1568
|
-
onClick: () =>
|
|
1569
|
-
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 })
|
|
1570
1617
|
}
|
|
1571
|
-
) },
|
|
1618
|
+
) }, v.id)) }) })
|
|
1572
1619
|
] });
|
|
1573
1620
|
}
|
|
1574
|
-
function
|
|
1621
|
+
function de({
|
|
1575
1622
|
title: e,
|
|
1576
1623
|
hint: t,
|
|
1577
1624
|
link: s,
|
|
1578
1625
|
children: o
|
|
1579
1626
|
}) {
|
|
1580
|
-
return /* @__PURE__ */
|
|
1581
|
-
/* @__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: [
|
|
1582
1629
|
/* @__PURE__ */ n("h3", { className: "ds-vcard__title ds-section__title", "data-ds-filter-title": !0, children: e }),
|
|
1583
1630
|
s && /* @__PURE__ */ n(
|
|
1584
1631
|
"button",
|
|
@@ -1602,234 +1649,234 @@ function ee({
|
|
|
1602
1649
|
options: o,
|
|
1603
1650
|
onChange: r
|
|
1604
1651
|
}) {
|
|
1605
|
-
return /* @__PURE__ */
|
|
1652
|
+
return /* @__PURE__ */ x("label", { className: "ds-vcard__field", "data-ds-filter": !0, title: t ? `${e} — ${t}` : e, children: [
|
|
1606
1653
|
/* @__PURE__ */ n("span", { className: "ds-visually-hidden", children: e }),
|
|
1607
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)) })
|
|
1608
1655
|
] });
|
|
1609
1656
|
}
|
|
1610
|
-
function
|
|
1657
|
+
function Yt({
|
|
1611
1658
|
registry: e,
|
|
1612
1659
|
controls: t,
|
|
1613
1660
|
deploy: s,
|
|
1614
1661
|
location: o,
|
|
1615
1662
|
screen: r,
|
|
1616
1663
|
variation: i,
|
|
1617
|
-
component:
|
|
1618
|
-
onOpenScenario:
|
|
1619
|
-
onOpenComponent:
|
|
1620
|
-
onOpenScreen:
|
|
1664
|
+
component: d,
|
|
1665
|
+
onOpenScenario: l,
|
|
1666
|
+
onOpenComponent: w,
|
|
1667
|
+
onOpenScreen: h
|
|
1621
1668
|
}) {
|
|
1622
|
-
const
|
|
1623
|
-
if (
|
|
1624
|
-
const
|
|
1625
|
-
return /* @__PURE__ */
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */ n(W, { term:
|
|
1628
|
-
/* @__PURE__ */ n(W, { term:
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
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 }) })
|
|
1632
1679
|
] }),
|
|
1633
|
-
/* @__PURE__ */ n(te, { title:
|
|
1634
|
-
const
|
|
1635
|
-
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: [
|
|
1636
1683
|
/* @__PURE__ */ n(
|
|
1637
1684
|
"button",
|
|
1638
1685
|
{
|
|
1639
1686
|
type: "button",
|
|
1640
1687
|
className: "ds-link",
|
|
1641
|
-
onClick: () =>
|
|
1642
|
-
children:
|
|
1688
|
+
onClick: () => y ? l(y.id) : h?.(S.id),
|
|
1689
|
+
children: S.name
|
|
1643
1690
|
}
|
|
1644
1691
|
),
|
|
1645
|
-
/* @__PURE__ */ n("code", { className: "ds-muted", children:
|
|
1646
|
-
] },
|
|
1692
|
+
/* @__PURE__ */ n("code", { className: "ds-muted", children: S.id })
|
|
1693
|
+
] }, S.id);
|
|
1647
1694
|
}) }) })
|
|
1648
1695
|
] });
|
|
1649
1696
|
}
|
|
1650
|
-
if (!r) return /* @__PURE__ */ n("p", { className: "ds-empty", children:
|
|
1651
|
-
const
|
|
1652
|
-
const
|
|
1653
|
-
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 },
|
|
1654
1701
|
registry: e,
|
|
1655
1702
|
open: { screen: r, location: o, variation: i },
|
|
1656
1703
|
deploy: s,
|
|
1657
|
-
labels:
|
|
1658
|
-
overrides:
|
|
1659
|
-
}) :
|
|
1704
|
+
labels: u,
|
|
1705
|
+
overrides: v
|
|
1706
|
+
}) : jt({
|
|
1660
1707
|
screen: r,
|
|
1661
1708
|
variations: r.variations,
|
|
1662
1709
|
components: e.componentsOfScreen(r),
|
|
1663
1710
|
deploy: s,
|
|
1664
|
-
labels:
|
|
1665
|
-
overrides:
|
|
1711
|
+
labels: u,
|
|
1712
|
+
overrides: v
|
|
1666
1713
|
});
|
|
1667
1714
|
try {
|
|
1668
|
-
await navigator.clipboard.writeText(
|
|
1715
|
+
await navigator.clipboard.writeText(S);
|
|
1669
1716
|
} catch {
|
|
1670
|
-
window.prompt(
|
|
1717
|
+
window.prompt(c.copyPrompt, S);
|
|
1671
1718
|
}
|
|
1672
1719
|
k(!0), window.setTimeout(() => k(!1), 1600);
|
|
1673
1720
|
};
|
|
1674
|
-
return /* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */ n(W, { term:
|
|
1677
|
-
/* @__PURE__ */ n(W, { term:
|
|
1678
|
-
r.group && /* @__PURE__ */ n(W, { term:
|
|
1679
|
-
r.description && /* @__PURE__ */ n(W, { term:
|
|
1680
|
-
/* @__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 })
|
|
1681
1728
|
] }),
|
|
1682
|
-
r.controls.length > 0 && /* @__PURE__ */ n(te, { title:
|
|
1683
|
-
(
|
|
1684
|
-
const
|
|
1685
|
-
return /* @__PURE__ */
|
|
1686
|
-
|
|
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,
|
|
1687
1734
|
" ",
|
|
1688
|
-
/* @__PURE__ */ n("code", { children: `c.${
|
|
1689
|
-
] }, `${
|
|
1735
|
+
/* @__PURE__ */ n("code", { children: `c.${S.id}=${y}` })
|
|
1736
|
+
] }, `${f.id}/${S.id}`);
|
|
1690
1737
|
})
|
|
1691
1738
|
) }),
|
|
1692
|
-
i && /* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */ n(W, { term:
|
|
1694
|
-
/* @__PURE__ */ n(W, { term:
|
|
1695
|
-
|
|
1696
|
-
i.intent && /* @__PURE__ */ n(W, { term:
|
|
1697
|
-
/* @__PURE__ */ n(
|
|
1698
|
-
/* @__PURE__ */ n(
|
|
1699
|
-
/* @__PURE__ */ n(
|
|
1700
|
-
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 }) })
|
|
1701
1748
|
] }),
|
|
1702
|
-
|
|
1703
|
-
/* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () =>
|
|
1704
|
-
|
|
1705
|
-
] },
|
|
1706
|
-
/* @__PURE__ */
|
|
1707
|
-
/* @__PURE__ */ n(H, { name:
|
|
1708
|
-
/* @__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 })
|
|
1709
1756
|
] })
|
|
1710
1757
|
] });
|
|
1711
1758
|
}
|
|
1712
1759
|
function te({ title: e, children: t }) {
|
|
1713
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ x("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
|
|
1714
1761
|
/* @__PURE__ */ n("h2", { className: "ds-section__title", children: e }),
|
|
1715
1762
|
/* @__PURE__ */ n("div", { className: "ds-defs", children: t })
|
|
1716
1763
|
] });
|
|
1717
1764
|
}
|
|
1718
1765
|
function W({ term: e, children: t }) {
|
|
1719
|
-
return /* @__PURE__ */
|
|
1766
|
+
return /* @__PURE__ */ x("dl", { className: "ds-def", "data-ds-filter": !0, children: [
|
|
1720
1767
|
/* @__PURE__ */ n("dt", { children: e }),
|
|
1721
1768
|
/* @__PURE__ */ n("dd", { children: t })
|
|
1722
1769
|
] });
|
|
1723
1770
|
}
|
|
1724
|
-
function
|
|
1725
|
-
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: [
|
|
1726
1773
|
/* @__PURE__ */ n("dt", { children: e }),
|
|
1727
1774
|
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("ul", { className: "ds-list", children: t.map((s) => /* @__PURE__ */ n("li", { children: s }, s)) }) })
|
|
1728
1775
|
] }) : null;
|
|
1729
1776
|
}
|
|
1730
|
-
function
|
|
1777
|
+
function Qt(e) {
|
|
1731
1778
|
return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f";
|
|
1732
1779
|
}
|
|
1733
|
-
function
|
|
1780
|
+
function Xt(e, t) {
|
|
1734
1781
|
if (!e) return !1;
|
|
1735
|
-
const s =
|
|
1782
|
+
const s = Q(t), o = [...e.querySelectorAll("[data-ds-filter]")];
|
|
1736
1783
|
for (const r of o)
|
|
1737
|
-
r.hidden = s.length > 0 && !
|
|
1784
|
+
r.hidden = s.length > 0 && !Q(r.textContent ?? "").includes(s);
|
|
1738
1785
|
for (const r of e.querySelectorAll("[data-ds-filter-group]")) {
|
|
1739
|
-
const i = [...r.querySelectorAll("[data-ds-filter]")],
|
|
1786
|
+
const i = [...r.querySelectorAll("[data-ds-filter]")], d = Q(
|
|
1740
1787
|
r.querySelector("[data-ds-filter-title], .ds-section__title")?.textContent ?? ""
|
|
1741
1788
|
);
|
|
1742
|
-
if (s.length > 0 &&
|
|
1789
|
+
if (s.length > 0 && d.includes(s)) {
|
|
1743
1790
|
r.hidden = !1;
|
|
1744
|
-
for (const
|
|
1791
|
+
for (const l of i) l.hidden = !1;
|
|
1745
1792
|
continue;
|
|
1746
1793
|
}
|
|
1747
|
-
r.hidden = s.length > 0 && i.every((
|
|
1794
|
+
r.hidden = s.length > 0 && i.every((l) => l.hidden);
|
|
1748
1795
|
}
|
|
1749
1796
|
return s.length > 0 && o.length > 0 && o.every((r) => r.hidden);
|
|
1750
1797
|
}
|
|
1751
|
-
const
|
|
1752
|
-
function
|
|
1798
|
+
const Jt = 24;
|
|
1799
|
+
function en({
|
|
1753
1800
|
location: e,
|
|
1754
1801
|
viewport: t,
|
|
1755
1802
|
zoom: s,
|
|
1756
1803
|
title: o,
|
|
1757
1804
|
resizing: r,
|
|
1758
1805
|
onFrameNavigate: i,
|
|
1759
|
-
onShortcut:
|
|
1760
|
-
onEffectiveZoom:
|
|
1806
|
+
onShortcut: d,
|
|
1807
|
+
onEffectiveZoom: l
|
|
1761
1808
|
}) {
|
|
1762
|
-
const
|
|
1763
|
-
(
|
|
1764
|
-
|
|
1765
|
-
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;
|
|
1766
1813
|
try {
|
|
1767
|
-
|
|
1814
|
+
C?.location.replace(new URL(m, $).toString());
|
|
1768
1815
|
} catch {
|
|
1769
|
-
|
|
1816
|
+
h.current && (h.current.src = m);
|
|
1770
1817
|
}
|
|
1771
1818
|
},
|
|
1772
|
-
[
|
|
1819
|
+
[$]
|
|
1773
1820
|
);
|
|
1774
1821
|
I(() => {
|
|
1775
|
-
if (
|
|
1776
|
-
const
|
|
1777
|
-
k.current =
|
|
1778
|
-
}, [
|
|
1779
|
-
const
|
|
1780
|
-
const
|
|
1781
|
-
origin:
|
|
1782
|
-
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
|
|
1783
1830
|
});
|
|
1784
|
-
if (
|
|
1785
|
-
switch (
|
|
1831
|
+
if (L)
|
|
1832
|
+
switch (L.type) {
|
|
1786
1833
|
case "ready": {
|
|
1787
|
-
if (
|
|
1788
|
-
if (
|
|
1789
|
-
|
|
1790
|
-
|
|
1834
|
+
if (L.url === k.current) return;
|
|
1835
|
+
if (L.url === b.current) {
|
|
1836
|
+
re(
|
|
1837
|
+
h.current?.contentWindow,
|
|
1791
1838
|
{ ds: 1, type: "location", url: k.current },
|
|
1792
|
-
|
|
1839
|
+
$
|
|
1793
1840
|
);
|
|
1794
1841
|
return;
|
|
1795
1842
|
}
|
|
1796
|
-
k.current =
|
|
1843
|
+
k.current = L.url, b.current = L.url, i(L.url, !0);
|
|
1797
1844
|
return;
|
|
1798
1845
|
}
|
|
1799
1846
|
case "navigate":
|
|
1800
|
-
k.current =
|
|
1847
|
+
k.current = L.url, i(L.url, L.replace);
|
|
1801
1848
|
return;
|
|
1802
1849
|
case "shortcut":
|
|
1803
|
-
|
|
1850
|
+
d(L.key);
|
|
1804
1851
|
return;
|
|
1805
1852
|
default:
|
|
1806
1853
|
return;
|
|
1807
1854
|
}
|
|
1808
1855
|
};
|
|
1809
|
-
return window.addEventListener("message",
|
|
1810
|
-
}, [i,
|
|
1811
|
-
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;
|
|
1812
1859
|
I(() => {
|
|
1813
|
-
|
|
1814
|
-
}, [
|
|
1815
|
-
const
|
|
1816
|
-
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(
|
|
1817
1864
|
"div",
|
|
1818
1865
|
{
|
|
1819
1866
|
className: "ds-canvas__box",
|
|
1820
|
-
style: { width: Math.floor(
|
|
1867
|
+
style: { width: Math.floor(T * y), height: Math.floor(a * y) },
|
|
1821
1868
|
children: /* @__PURE__ */ n(
|
|
1822
1869
|
"iframe",
|
|
1823
1870
|
{
|
|
1824
|
-
ref:
|
|
1825
|
-
[
|
|
1871
|
+
ref: h,
|
|
1872
|
+
[bt]: "",
|
|
1826
1873
|
className: "ds-frame",
|
|
1827
|
-
src:
|
|
1874
|
+
src: g,
|
|
1828
1875
|
title: o,
|
|
1829
1876
|
style: {
|
|
1830
|
-
width: Math.floor(
|
|
1831
|
-
height: Math.floor(
|
|
1832
|
-
transform:
|
|
1877
|
+
width: Math.floor(T),
|
|
1878
|
+
height: Math.floor(a),
|
|
1879
|
+
transform: y === 1 ? void 0 : `scale(${y})`,
|
|
1833
1880
|
pointerEvents: r ? "none" : void 0
|
|
1834
1881
|
}
|
|
1835
1882
|
}
|
|
@@ -1837,15 +1884,15 @@ function Zt({
|
|
|
1837
1884
|
}
|
|
1838
1885
|
) });
|
|
1839
1886
|
}
|
|
1840
|
-
function
|
|
1887
|
+
function tn(e) {
|
|
1841
1888
|
const [t, s] = V({ width: 0, height: 0 });
|
|
1842
|
-
return
|
|
1889
|
+
return We(() => {
|
|
1843
1890
|
const o = e.current;
|
|
1844
1891
|
if (!o) return;
|
|
1845
1892
|
const r = () => {
|
|
1846
|
-
const
|
|
1893
|
+
const d = o.clientWidth, l = o.clientHeight;
|
|
1847
1894
|
s(
|
|
1848
|
-
(
|
|
1895
|
+
(w) => w.width === d && w.height === l ? w : { width: d, height: l }
|
|
1849
1896
|
);
|
|
1850
1897
|
};
|
|
1851
1898
|
if (r(), typeof ResizeObserver > "u")
|
|
@@ -1854,8 +1901,8 @@ function Yt(e) {
|
|
|
1854
1901
|
return i.observe(o), () => i.disconnect();
|
|
1855
1902
|
}, [e]), t;
|
|
1856
1903
|
}
|
|
1857
|
-
const
|
|
1858
|
-
class
|
|
1904
|
+
const nt = 2500;
|
|
1905
|
+
class ot extends Error {
|
|
1859
1906
|
constructor(t) {
|
|
1860
1907
|
super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
|
|
1861
1908
|
}
|
|
@@ -1872,40 +1919,40 @@ const Le = {
|
|
|
1872
1919
|
case "empty":
|
|
1873
1920
|
return null;
|
|
1874
1921
|
case "error":
|
|
1875
|
-
throw new
|
|
1922
|
+
throw new ot(e.id);
|
|
1876
1923
|
case "loading":
|
|
1877
1924
|
return new Promise(() => {
|
|
1878
1925
|
});
|
|
1879
1926
|
case "slow":
|
|
1880
|
-
return await
|
|
1927
|
+
return await nn(nt), Me(t);
|
|
1881
1928
|
default:
|
|
1882
1929
|
return Me(t);
|
|
1883
1930
|
}
|
|
1884
1931
|
}
|
|
1885
1932
|
};
|
|
1886
|
-
function
|
|
1887
|
-
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;
|
|
1888
1935
|
return {
|
|
1889
1936
|
id: t,
|
|
1890
1937
|
label: s,
|
|
1891
|
-
load: async (
|
|
1892
|
-
const
|
|
1938
|
+
load: async (l) => {
|
|
1939
|
+
const w = new URL(r ? r(l) : l.scenario.route, o);
|
|
1893
1940
|
try {
|
|
1894
|
-
const
|
|
1895
|
-
if (!
|
|
1896
|
-
return await
|
|
1897
|
-
} catch (
|
|
1898
|
-
if (
|
|
1899
|
-
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 });
|
|
1900
1947
|
}
|
|
1901
1948
|
}
|
|
1902
1949
|
};
|
|
1903
1950
|
}
|
|
1904
|
-
function
|
|
1951
|
+
function nn(e) {
|
|
1905
1952
|
return new Promise((t) => setTimeout(t, e));
|
|
1906
1953
|
}
|
|
1907
|
-
function
|
|
1908
|
-
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({
|
|
1909
1956
|
data: void 0,
|
|
1910
1957
|
isLoading: !!t || o === "loading" || o === "slow",
|
|
1911
1958
|
error: void 0
|
|
@@ -1914,179 +1961,179 @@ function Qt(e) {
|
|
|
1914
1961
|
if (!t)
|
|
1915
1962
|
switch (o) {
|
|
1916
1963
|
case "loading":
|
|
1917
|
-
|
|
1964
|
+
d({ data: void 0, isLoading: !0, error: void 0 });
|
|
1918
1965
|
return;
|
|
1919
1966
|
case "empty":
|
|
1920
|
-
|
|
1967
|
+
d({ data: null, isLoading: !1, error: void 0 });
|
|
1921
1968
|
return;
|
|
1922
1969
|
case "error":
|
|
1923
|
-
|
|
1970
|
+
d({
|
|
1924
1971
|
data: void 0,
|
|
1925
1972
|
isLoading: !1,
|
|
1926
|
-
error: new
|
|
1973
|
+
error: new ot(e.screen ?? "—")
|
|
1927
1974
|
});
|
|
1928
1975
|
return;
|
|
1929
1976
|
case "slow": {
|
|
1930
|
-
|
|
1931
|
-
const
|
|
1932
|
-
() =>
|
|
1933
|
-
|
|
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
|
|
1934
1981
|
);
|
|
1935
|
-
return () => clearTimeout(
|
|
1982
|
+
return () => clearTimeout(h);
|
|
1936
1983
|
}
|
|
1937
1984
|
default:
|
|
1938
|
-
|
|
1985
|
+
d({ data: void 0, isLoading: !1, error: void 0 });
|
|
1939
1986
|
return;
|
|
1940
1987
|
}
|
|
1941
|
-
let
|
|
1942
|
-
|
|
1943
|
-
const
|
|
1944
|
-
return Promise.resolve(
|
|
1945
|
-
|
|
1946
|
-
}).catch((
|
|
1947
|
-
|
|
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({
|
|
1948
1995
|
data: void 0,
|
|
1949
1996
|
isLoading: !1,
|
|
1950
|
-
error:
|
|
1997
|
+
error: h instanceof Error ? h : new Error(String(h))
|
|
1951
1998
|
});
|
|
1952
1999
|
}), () => {
|
|
1953
|
-
|
|
2000
|
+
l = !1;
|
|
1954
2001
|
};
|
|
1955
2002
|
}, [t, s, o, r, e.screen]), i;
|
|
1956
2003
|
}
|
|
1957
|
-
function
|
|
1958
|
-
return /* @__PURE__ */
|
|
2004
|
+
function Ke({ title: e, children: t }) {
|
|
2005
|
+
return /* @__PURE__ */ x("div", { className: "ds-stage-empty", children: [
|
|
1959
2006
|
/* @__PURE__ */ n("h2", { className: "ds-stage-empty__title", children: e }),
|
|
1960
2007
|
t
|
|
1961
2008
|
] });
|
|
1962
2009
|
}
|
|
1963
|
-
function
|
|
1964
|
-
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(
|
|
1965
2012
|
t,
|
|
1966
2013
|
{ frame: !0 }
|
|
1967
|
-
),
|
|
2014
|
+
), h = j(null);
|
|
1968
2015
|
I(() => {
|
|
1969
|
-
const
|
|
1970
|
-
if (
|
|
1971
|
-
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]");
|
|
1972
2019
|
if (!(A instanceof HTMLAnchorElement) || A.target && A.target !== "_self" || A.hasAttribute("download")) return;
|
|
1973
|
-
const
|
|
1974
|
-
if (
|
|
2020
|
+
const q = A.getAttribute("href") ?? "";
|
|
2021
|
+
if (q.startsWith("#")) return;
|
|
1975
2022
|
let B;
|
|
1976
2023
|
try {
|
|
1977
|
-
B = new URL(
|
|
2024
|
+
B = new URL(q, window.location.href);
|
|
1978
2025
|
} catch {
|
|
1979
2026
|
return;
|
|
1980
2027
|
}
|
|
1981
|
-
B.origin === window.location.origin && (
|
|
2028
|
+
B.origin === window.location.origin && (z.preventDefault(), d(`${B.pathname}${B.search}`));
|
|
1982
2029
|
};
|
|
1983
|
-
return document.addEventListener("click",
|
|
1984
|
-
}, [
|
|
1985
|
-
const
|
|
2030
|
+
return document.addEventListener("click", E), () => document.removeEventListener("click", E);
|
|
2031
|
+
}, [d]), I(() => {
|
|
2032
|
+
const E = (z) => {
|
|
1986
2033
|
if (window.parent === window) return;
|
|
1987
|
-
const A =
|
|
2034
|
+
const A = sn(z);
|
|
1988
2035
|
if (!A) return;
|
|
1989
|
-
const
|
|
1990
|
-
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));
|
|
1991
2038
|
};
|
|
1992
|
-
return window.addEventListener("keydown",
|
|
2039
|
+
return window.addEventListener("keydown", E), () => window.removeEventListener("keydown", E);
|
|
1993
2040
|
}, []), I(() => {
|
|
1994
|
-
const
|
|
1995
|
-
if (!
|
|
1996
|
-
const
|
|
1997
|
-
for (const
|
|
1998
|
-
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");
|
|
1999
2046
|
if (!B || B.startsWith("#")) continue;
|
|
2000
|
-
let
|
|
2047
|
+
let X;
|
|
2001
2048
|
try {
|
|
2002
|
-
|
|
2049
|
+
X = new URL(B, window.location.href);
|
|
2003
2050
|
} catch {
|
|
2004
2051
|
continue;
|
|
2005
2052
|
}
|
|
2006
|
-
if (
|
|
2007
|
-
|
|
2008
|
-
const
|
|
2009
|
-
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);
|
|
2010
2057
|
}
|
|
2011
2058
|
};
|
|
2012
|
-
|
|
2013
|
-
const A = new MutationObserver(
|
|
2014
|
-
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();
|
|
2015
2062
|
}, [r.handoff]);
|
|
2016
|
-
const
|
|
2017
|
-
const
|
|
2063
|
+
const u = t.scenario(r.scenario), c = t.component(r.component), g = D(() => {
|
|
2064
|
+
const E = new URLSearchParams(o.search);
|
|
2018
2065
|
return {
|
|
2019
|
-
scenario:
|
|
2020
|
-
component:
|
|
2066
|
+
scenario: E.get(M.scenario) ?? void 0,
|
|
2067
|
+
component: E.get(M.component) ?? void 0
|
|
2021
2068
|
};
|
|
2022
|
-
}, [o.search]), k = !!(r.handoff && (
|
|
2023
|
-
() => t.resolveComponentFixture(
|
|
2024
|
-
[
|
|
2025
|
-
),
|
|
2026
|
-
const
|
|
2027
|
-
return typeof
|
|
2028
|
-
}, [
|
|
2029
|
-
const
|
|
2030
|
-
return
|
|
2031
|
-
}, [r.dataSource, e.dataSources?.adapters]), { data:
|
|
2032
|
-
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,
|
|
2033
2080
|
fixture: N,
|
|
2034
2081
|
network: r.network,
|
|
2035
|
-
adapter:
|
|
2082
|
+
adapter: P,
|
|
2036
2083
|
screen: o.path
|
|
2037
|
-
}),
|
|
2038
|
-
(
|
|
2039
|
-
[
|
|
2040
|
-
),
|
|
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(
|
|
2041
2088
|
() => ({
|
|
2042
|
-
scenario:
|
|
2043
|
-
persona:
|
|
2044
|
-
permissions:
|
|
2045
|
-
can: (
|
|
2046
|
-
data:
|
|
2089
|
+
scenario: u,
|
|
2090
|
+
persona: R,
|
|
2091
|
+
permissions: S,
|
|
2092
|
+
can: (E) => S.includes(E),
|
|
2093
|
+
data: v,
|
|
2047
2094
|
fixture: N,
|
|
2048
2095
|
network: r.network,
|
|
2049
|
-
isLoading:
|
|
2050
|
-
error:
|
|
2051
|
-
rules: t.rulesOf(
|
|
2096
|
+
isLoading: p,
|
|
2097
|
+
error: f,
|
|
2098
|
+
rules: t.rulesOf(u),
|
|
2052
2099
|
viewport: i,
|
|
2053
2100
|
themeMode: r.themeMode,
|
|
2054
2101
|
locale: r.locale,
|
|
2055
|
-
navigate:
|
|
2056
|
-
openScenario:
|
|
2057
|
-
controls:
|
|
2058
|
-
setControl:
|
|
2059
|
-
setControls:
|
|
2102
|
+
navigate: d,
|
|
2103
|
+
openScenario: l,
|
|
2104
|
+
controls: T,
|
|
2105
|
+
setControl: a,
|
|
2106
|
+
setControls: w
|
|
2060
2107
|
}),
|
|
2061
2108
|
[
|
|
2062
|
-
h,
|
|
2063
|
-
P,
|
|
2064
|
-
y,
|
|
2065
2109
|
u,
|
|
2110
|
+
R,
|
|
2111
|
+
S,
|
|
2112
|
+
v,
|
|
2066
2113
|
N,
|
|
2067
2114
|
r.network,
|
|
2068
2115
|
r.themeMode,
|
|
2069
2116
|
r.locale,
|
|
2070
|
-
|
|
2071
|
-
|
|
2117
|
+
p,
|
|
2118
|
+
f,
|
|
2072
2119
|
t,
|
|
2073
2120
|
i,
|
|
2121
|
+
d,
|
|
2074
2122
|
l,
|
|
2123
|
+
T,
|
|
2075
2124
|
a,
|
|
2076
|
-
|
|
2077
|
-
c,
|
|
2078
|
-
p
|
|
2125
|
+
w
|
|
2079
2126
|
]
|
|
2080
|
-
),
|
|
2081
|
-
|
|
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
|
+
_,
|
|
2082
2129
|
{
|
|
2083
|
-
fixture:
|
|
2084
|
-
data:
|
|
2130
|
+
fixture: b.fixture,
|
|
2131
|
+
data: $,
|
|
2085
2132
|
viewport: i,
|
|
2086
2133
|
themeMode: r.themeMode ?? "default",
|
|
2087
2134
|
locale: r.locale ?? "default"
|
|
2088
2135
|
}
|
|
2089
|
-
) :
|
|
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: [
|
|
2090
2137
|
/* @__PURE__ */ n("code", { children: o.path }),
|
|
2091
2138
|
" ",
|
|
2092
2139
|
s.shell.noRouteHint
|
|
@@ -2094,10 +2141,10 @@ function Jt({ product: e, registry: t }) {
|
|
|
2094
2141
|
return (
|
|
2095
2142
|
// `display: contents` deixa o layout do produto como se este nó não
|
|
2096
2143
|
// existisse: ele só serve de raiz para observar os links.
|
|
2097
|
-
/* @__PURE__ */ n("div", { ref:
|
|
2144
|
+
/* @__PURE__ */ n("div", { ref: h, style: { display: "contents" }, children: L && !k ? /* @__PURE__ */ n(L, { context: m, children: K }) : K })
|
|
2098
2145
|
);
|
|
2099
2146
|
}
|
|
2100
|
-
function
|
|
2147
|
+
function sn(e) {
|
|
2101
2148
|
if (!e.altKey) {
|
|
2102
2149
|
if (e.shiftKey && !e.metaKey && !e.ctrlKey && e.key === "C") return "C";
|
|
2103
2150
|
if ((e.metaKey || e.ctrlKey) && !e.shiftKey) {
|
|
@@ -2107,41 +2154,41 @@ function en(e) {
|
|
|
2107
2154
|
}
|
|
2108
2155
|
}
|
|
2109
2156
|
}
|
|
2110
|
-
const
|
|
2157
|
+
const pe = {
|
|
2111
2158
|
leftWidth: "ds:left-width",
|
|
2112
2159
|
rightWidth: "ds:right-width",
|
|
2113
2160
|
appearance: "ds:appearance"
|
|
2114
2161
|
};
|
|
2115
|
-
function
|
|
2162
|
+
function rt(e) {
|
|
2116
2163
|
try {
|
|
2117
2164
|
return window.localStorage.getItem(e) ?? void 0;
|
|
2118
2165
|
} catch {
|
|
2119
2166
|
return;
|
|
2120
2167
|
}
|
|
2121
2168
|
}
|
|
2122
|
-
function
|
|
2169
|
+
function st(e, t) {
|
|
2123
2170
|
try {
|
|
2124
2171
|
window.localStorage.setItem(e, t);
|
|
2125
2172
|
} catch {
|
|
2126
2173
|
}
|
|
2127
2174
|
}
|
|
2128
|
-
function
|
|
2175
|
+
function Ue(e, t, s) {
|
|
2129
2176
|
return Math.round(Math.min(s, Math.max(t, e)));
|
|
2130
2177
|
}
|
|
2131
|
-
function
|
|
2178
|
+
function Ie(e, t, s, o) {
|
|
2132
2179
|
const [r, i] = V(() => {
|
|
2133
|
-
const
|
|
2134
|
-
return Number.isFinite(
|
|
2135
|
-
}),
|
|
2136
|
-
(
|
|
2137
|
-
const
|
|
2138
|
-
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));
|
|
2139
2186
|
},
|
|
2140
2187
|
[e, o, s]
|
|
2141
2188
|
);
|
|
2142
|
-
return [r,
|
|
2189
|
+
return [r, d];
|
|
2143
2190
|
}
|
|
2144
|
-
function
|
|
2191
|
+
function an() {
|
|
2145
2192
|
const e = "(prefers-color-scheme: dark)", t = () => {
|
|
2146
2193
|
try {
|
|
2147
2194
|
return window.matchMedia(e).matches ? "dark" : "light";
|
|
@@ -2160,159 +2207,159 @@ function tn() {
|
|
|
2160
2207
|
return r.addEventListener?.("change", i), () => r?.removeEventListener?.("change", i);
|
|
2161
2208
|
}, []), s;
|
|
2162
2209
|
}
|
|
2163
|
-
function
|
|
2164
|
-
const e =
|
|
2210
|
+
function cn() {
|
|
2211
|
+
const e = rt(pe.appearance);
|
|
2165
2212
|
return e === "dark" || e === "light" ? e : void 0;
|
|
2166
2213
|
}
|
|
2167
|
-
function
|
|
2168
|
-
const t = D(() =>
|
|
2169
|
-
return /* @__PURE__ */ n(
|
|
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 }) });
|
|
2170
2217
|
}
|
|
2171
|
-
const Ce = { initial: 290, min: 200, max: 480 },
|
|
2172
|
-
function
|
|
2173
|
-
const s = J(), o = D(() =>
|
|
2174
|
-
|
|
2175
|
-
const k =
|
|
2176
|
-
|
|
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,
|
|
2177
2224
|
Ce.initial,
|
|
2178
2225
|
Ce.min,
|
|
2179
2226
|
Ce.max
|
|
2180
|
-
), [
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
), [
|
|
2186
|
-
() => t.resolveComponentFixture(
|
|
2187
|
-
[
|
|
2188
|
-
),
|
|
2189
|
-
if (!
|
|
2190
|
-
const { invalid:
|
|
2191
|
-
scenario:
|
|
2192
|
-
requested:
|
|
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)
|
|
2193
2240
|
});
|
|
2194
|
-
return
|
|
2241
|
+
return F.length === 0 ? t.issues : [...F.map((Z) => ({
|
|
2195
2242
|
level: "warning",
|
|
2196
2243
|
where: `url:${be}${Z.id}`,
|
|
2197
2244
|
message: Z.reason === "invalid-value" ? s.diagnostics.invalidControl(Z.id, Z.value, Z.fallback ?? "") : s.diagnostics.unknownControl(Z.id, Z.value)
|
|
2198
2245
|
})), ...t.issues];
|
|
2199
|
-
}, [s, r.search, t,
|
|
2200
|
-
const
|
|
2201
|
-
return
|
|
2202
|
-
}, [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;
|
|
2203
2250
|
I(() => {
|
|
2204
|
-
A && (
|
|
2205
|
-
}, [K,
|
|
2206
|
-
const
|
|
2207
|
-
() =>
|
|
2208
|
-
[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]
|
|
2209
2256
|
), B = U(
|
|
2210
|
-
(
|
|
2211
|
-
if (
|
|
2212
|
-
|
|
2257
|
+
(F) => {
|
|
2258
|
+
if (F === "C") {
|
|
2259
|
+
q();
|
|
2213
2260
|
return;
|
|
2214
2261
|
}
|
|
2215
|
-
window.dispatchEvent(new KeyboardEvent("keydown", { key:
|
|
2262
|
+
window.dispatchEvent(new KeyboardEvent("keydown", { key: F.toLowerCase(), metaKey: !0 }));
|
|
2216
2263
|
},
|
|
2217
|
-
[
|
|
2264
|
+
[q]
|
|
2218
2265
|
);
|
|
2219
2266
|
I(() => {
|
|
2220
|
-
const
|
|
2267
|
+
const F = (G) => {
|
|
2221
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));
|
|
2222
2269
|
};
|
|
2223
|
-
return window.addEventListener("keydown",
|
|
2270
|
+
return window.addEventListener("keydown", F), () => window.removeEventListener("keydown", F);
|
|
2224
2271
|
}, [B]);
|
|
2225
|
-
const
|
|
2226
|
-
(
|
|
2227
|
-
const { path: Z, search:
|
|
2228
|
-
|
|
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 });
|
|
2229
2276
|
},
|
|
2230
|
-
[
|
|
2231
|
-
),
|
|
2232
|
-
const
|
|
2233
|
-
|
|
2234
|
-
},
|
|
2235
|
-
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(
|
|
2236
2283
|
"div",
|
|
2237
2284
|
{
|
|
2238
2285
|
className: "ds-root",
|
|
2239
|
-
"data-appearance":
|
|
2286
|
+
"data-appearance": R,
|
|
2240
2287
|
"data-chrome": i.chrome ? "visible" : "hidden",
|
|
2241
|
-
"data-resizing":
|
|
2242
|
-
"data-viewport":
|
|
2288
|
+
"data-resizing": f ? "true" : void 0,
|
|
2289
|
+
"data-viewport": d.id,
|
|
2243
2290
|
children: [
|
|
2244
2291
|
i.chrome && /* @__PURE__ */ n(
|
|
2245
|
-
|
|
2292
|
+
Vt,
|
|
2246
2293
|
{
|
|
2247
2294
|
productName: e.name,
|
|
2248
2295
|
deploy: o,
|
|
2249
2296
|
viewportId: i.viewport,
|
|
2250
|
-
viewport:
|
|
2251
|
-
zoom:
|
|
2297
|
+
viewport: d,
|
|
2298
|
+
zoom: ct,
|
|
2252
2299
|
rotated: !!i.rotated,
|
|
2253
|
-
theme:
|
|
2254
|
-
issues:
|
|
2255
|
-
linkUrl:
|
|
2256
|
-
onViewport: (
|
|
2257
|
-
onRotate: () =>
|
|
2258
|
-
onZoom: (
|
|
2259
|
-
onCleanReview:
|
|
2260
|
-
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
|
|
2261
2308
|
}
|
|
2262
2309
|
),
|
|
2263
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ x("div", { className: "ds-body", children: [
|
|
2264
2311
|
i.chrome && /* @__PURE__ */ n(
|
|
2265
|
-
|
|
2312
|
+
It,
|
|
2266
2313
|
{
|
|
2267
2314
|
registry: t,
|
|
2268
|
-
handoff:
|
|
2269
|
-
activeScreen:
|
|
2270
|
-
activeComponent:
|
|
2271
|
-
onOpenScreen: (
|
|
2272
|
-
onOpenComponent: (
|
|
2315
|
+
handoff: y,
|
|
2316
|
+
activeScreen: m?.id,
|
|
2317
|
+
activeComponent: T?.id,
|
|
2318
|
+
onOpenScreen: (F) => u(F),
|
|
2319
|
+
onOpenComponent: (F) => h(F),
|
|
2273
2320
|
width: N,
|
|
2274
|
-
onResize:
|
|
2275
|
-
onResizeStart: () =>
|
|
2276
|
-
onResizeEnd: () =>
|
|
2321
|
+
onResize: P,
|
|
2322
|
+
onResizeStart: () => S(!0),
|
|
2323
|
+
onResizeEnd: () => S(!1)
|
|
2277
2324
|
}
|
|
2278
2325
|
),
|
|
2279
|
-
/* @__PURE__ */ n("main", { className: "ds-main", children:
|
|
2326
|
+
/* @__PURE__ */ n("main", { className: "ds-main", children: E ? /* @__PURE__ */ x("div", { className: "ds-chrome-empty", children: [
|
|
2280
2327
|
/* @__PURE__ */ n("h1", { className: "ds-chrome-empty__title", children: s.shell.empty }),
|
|
2281
2328
|
/* @__PURE__ */ n("p", { className: "ds-muted", children: s.shell.emptyHint })
|
|
2282
2329
|
] }) : A ? null : /* @__PURE__ */ n(
|
|
2283
|
-
|
|
2330
|
+
en,
|
|
2284
2331
|
{
|
|
2285
2332
|
location: r,
|
|
2286
|
-
viewport:
|
|
2287
|
-
zoom:
|
|
2288
|
-
onEffectiveZoom:
|
|
2333
|
+
viewport: d,
|
|
2334
|
+
zoom: _e,
|
|
2335
|
+
onEffectiveZoom: lt,
|
|
2289
2336
|
title: s.shell.frameTitle(e.name),
|
|
2290
|
-
resizing:
|
|
2291
|
-
onFrameNavigate:
|
|
2337
|
+
resizing: f,
|
|
2338
|
+
onFrameNavigate: X,
|
|
2292
2339
|
onShortcut: B
|
|
2293
2340
|
}
|
|
2294
2341
|
) }),
|
|
2295
2342
|
i.chrome && /* @__PURE__ */ n(
|
|
2296
|
-
|
|
2343
|
+
Gt,
|
|
2297
2344
|
{
|
|
2298
2345
|
registry: t,
|
|
2299
2346
|
controls: i,
|
|
2300
2347
|
deploy: o,
|
|
2301
2348
|
location: r,
|
|
2302
|
-
screen:
|
|
2303
|
-
variation:
|
|
2304
|
-
component:
|
|
2305
|
-
componentFixture:
|
|
2306
|
-
tab:
|
|
2307
|
-
onTab: (
|
|
2308
|
-
onOpenScenario:
|
|
2309
|
-
onOpenComponent: (
|
|
2310
|
-
onOpenScreen: (
|
|
2311
|
-
onChange:
|
|
2312
|
-
width:
|
|
2313
|
-
onResize:
|
|
2314
|
-
onResizeStart: () =>
|
|
2315
|
-
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)
|
|
2316
2363
|
}
|
|
2317
2364
|
)
|
|
2318
2365
|
] }),
|
|
@@ -2323,7 +2370,7 @@ function on({ product: e, registry: t }) {
|
|
|
2323
2370
|
className: "ds-restore",
|
|
2324
2371
|
"aria-label": s.shell.restoreChrome,
|
|
2325
2372
|
title: s.shell.restoreChrome,
|
|
2326
|
-
onClick:
|
|
2373
|
+
onClick: q,
|
|
2327
2374
|
children: /* @__PURE__ */ n("span", { className: "ds-restore__dot", "aria-hidden": "true" })
|
|
2328
2375
|
}
|
|
2329
2376
|
)
|
|
@@ -2331,70 +2378,70 @@ function on({ product: e, registry: t }) {
|
|
|
2331
2378
|
}
|
|
2332
2379
|
);
|
|
2333
2380
|
}
|
|
2334
|
-
function
|
|
2381
|
+
function ve(e) {
|
|
2335
2382
|
return new Date(e.length === 10 ? `${e}T00:00:00` : e);
|
|
2336
2383
|
}
|
|
2337
|
-
function
|
|
2338
|
-
const s =
|
|
2384
|
+
function vn(e, t) {
|
|
2385
|
+
const s = ve(e), o = ve(t);
|
|
2339
2386
|
let r = o.getFullYear() - s.getFullYear();
|
|
2340
2387
|
const i = o.getMonth() - s.getMonth();
|
|
2341
2388
|
return (i < 0 || i === 0 && o.getDate() < s.getDate()) && (r -= 1), r;
|
|
2342
2389
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const s =
|
|
2390
|
+
function gn(e, t) {
|
|
2391
|
+
const s = ve(e), o = ve(t);
|
|
2345
2392
|
return Math.floor((o.getTime() - s.getTime()) / 864e5);
|
|
2346
2393
|
}
|
|
2347
2394
|
export {
|
|
2348
2395
|
be as CONTROL_PARAM_PREFIX,
|
|
2349
2396
|
ne as DEFAULT_LABELS,
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
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,
|
|
2413
|
+
Pe as applyHandoffScope,
|
|
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,
|
|
2374
2421
|
Le as fixtureAdapter,
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2422
|
+
yn as formatIssues,
|
|
2423
|
+
kt as getDeployContext,
|
|
2424
|
+
ge as handoffAllowsComponent,
|
|
2425
|
+
He as handoffAllowsPath,
|
|
2379
2426
|
oe as handoffAllowsScenario,
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2427
|
+
Nn as hasErrors,
|
|
2428
|
+
$n as matchPath,
|
|
2429
|
+
Mn as normalizeHandoffScope,
|
|
2430
|
+
Q as normalizeSearch,
|
|
2384
2431
|
$e as parseControls,
|
|
2385
|
-
|
|
2386
|
-
|
|
2432
|
+
ft as parseHandoffScope,
|
|
2433
|
+
ve as parseIsoDate,
|
|
2387
2434
|
Me as resolveFixture,
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
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,
|
|
2395
2442
|
J as useLabels,
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2443
|
+
on as useScenarioData,
|
|
2444
|
+
mt as validateProduct,
|
|
2445
|
+
Pn as validateScenario
|
|
2399
2446
|
};
|
|
2400
2447
|
//# sourceMappingURL=index.js.map
|