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