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