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