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