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