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