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