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