@brucesantos/design-space 0.10.0 → 0.12.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 +61 -0
- package/README.md +18 -1
- package/dist/controls/params.d.ts +1 -0
- package/dist/design-space.css +1 -1
- package/dist/frame/index.d.ts +25 -0
- package/dist/{index-BnTStnNk.js → index-rWBjjVMg.js} +132 -118
- package/dist/index-rWBjjVMg.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1163 -1052
- package/dist/index.js.map +1 -1
- package/dist/shell/Canvas.d.ts +4 -1
- package/dist/shell/Highlight.d.ts +15 -0
- package/dist/shell/Topbar.d.ts +5 -1
- package/dist/shell/icons.d.ts +1 -1
- package/dist/shell/labels.d.ts +7 -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
|
@@ -5,29 +5,29 @@ const C = [
|
|
|
5
5
|
"error",
|
|
6
6
|
"slow"
|
|
7
7
|
];
|
|
8
|
-
function
|
|
8
|
+
function j(e, r) {
|
|
9
9
|
const o = e.split("/").filter(Boolean), t = M(r).split("/").filter(Boolean), a = {};
|
|
10
10
|
for (const [s, c] of o.entries()) {
|
|
11
11
|
if (c === "*")
|
|
12
12
|
return a["*"] = t.slice(s).join("/"), a;
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
13
|
+
const h = t[s];
|
|
14
|
+
if (h === void 0) return null;
|
|
15
15
|
if (c.startsWith(":")) {
|
|
16
|
-
a[c.slice(1)] =
|
|
16
|
+
a[c.slice(1)] = h;
|
|
17
17
|
continue;
|
|
18
18
|
}
|
|
19
|
-
if (c !==
|
|
19
|
+
if (c !== h) return null;
|
|
20
20
|
}
|
|
21
21
|
return o.length !== t.length ? null : a;
|
|
22
22
|
}
|
|
23
23
|
function P(e, r) {
|
|
24
|
-
const o = [...e].sort((t, a) =>
|
|
24
|
+
const o = [...e].sort((t, a) => I(a.path) - I(t.path));
|
|
25
25
|
for (const t of o) {
|
|
26
|
-
const a =
|
|
26
|
+
const a = j(t.path, r);
|
|
27
27
|
if (a) return { definition: t, params: a };
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function E(e, r = {}) {
|
|
31
31
|
const o = (a) => {
|
|
32
32
|
const s = r[a];
|
|
33
33
|
return typeof s == "string" && s.length > 0 ? s : void 0;
|
|
@@ -43,7 +43,7 @@ function z(e, r = {}) {
|
|
|
43
43
|
}
|
|
44
44
|
return `/${t.join("/")}`;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function I(e) {
|
|
47
47
|
const r = e.split("/").filter(Boolean);
|
|
48
48
|
let o = r.length;
|
|
49
49
|
for (const t of r)
|
|
@@ -58,11 +58,11 @@ function M(e) {
|
|
|
58
58
|
return r;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
const R = /^[a-z0-9]+([.\-][a-z0-9]+)*$/,
|
|
61
|
+
const R = /^[a-z0-9]+([.\-][a-z0-9]+)*$/, z = /^[A-Za-z0-9][A-Za-z0-9_.-]*$/;
|
|
62
62
|
function u(e) {
|
|
63
63
|
return typeof e == "string" && e.trim().length > 0;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function L(e, r) {
|
|
66
66
|
const o = [], t = u(e?.id) ? `scenario:${e.id}` : `scenario[${r ?? "?"}]`, a = (c) => o.push({ level: "error", where: t, message: c }), s = (c) => o.push({ level: "warning", where: t, message: c });
|
|
67
67
|
return u(e?.id) ? R.test(e.id) || a(
|
|
68
68
|
"`id` deve ser minúsculo, em kebab-case, com pontos opcionais: `requests.approve-blocked` ou `approve-blocked`."
|
|
@@ -81,14 +81,14 @@ function Q(e) {
|
|
|
81
81
|
"product",
|
|
82
82
|
"`modules` foi removido na 0.8.0 e é ignorado: cada rota é uma tela, e os cenários da rota são as variações dela."
|
|
83
83
|
);
|
|
84
|
-
const
|
|
84
|
+
const h = /* @__PURE__ */ new Set();
|
|
85
85
|
for (const [l, n] of (e.routes ?? []).entries()) {
|
|
86
86
|
const i = `route:${n?.path ?? l}`;
|
|
87
87
|
if (!u(n?.path)) {
|
|
88
88
|
o("error", i, "`path` é obrigatório.");
|
|
89
89
|
continue;
|
|
90
90
|
}
|
|
91
|
-
n.path.startsWith("/") || o("error", i, "`path` deve começar com `/`."),
|
|
91
|
+
n.path.startsWith("/") || o("error", i, "`path` deve começar com `/`."), h.has(n.path) && o("error", i, `\`path\` duplicado: ${n.path}. Cada rota é uma tela.`), h.add(n.path), typeof n.screen != "function" && typeof n.screen != "object" && o("error", i, "`screen` é obrigatório."), n.name !== void 0 && !u(n.name) && o("warning", i, "`name` vazio: a tela aparece com o título do primeiro cenário."), n.group !== void 0 && !u(n.group) && o("warning", i, "`group` vazio: a tela aparece fora de qualquer fluxo."), n.expected !== void 0 && !Array.isArray(n.expected) && o("error", i, "`expected`, quando informado, deve ser uma lista de frases."), n.components !== void 0 && !Array.isArray(n.components) && o("error", i, "`components`, quando informado, deve ser uma lista de ids de componente."), n.controls !== void 0 && (Array.isArray(n.controls) ? q(n.controls, i, o) : o("error", i, "`controls`, quando informado, deve ser uma lista de grupos de controles."));
|
|
92
92
|
}
|
|
93
93
|
const f = /* @__PURE__ */ new Set();
|
|
94
94
|
for (const [l, n] of (e.components ?? []).entries()) {
|
|
@@ -96,12 +96,12 @@ function Q(e) {
|
|
|
96
96
|
u(n?.id) ? R.test(n.id) ? f.has(n.id) ? o("error", i, `\`id\` duplicado: ${n.id}.`) : f.add(n.id) : o("error", i, "`id` deve ser minúsculo em kebab-case ou usar pontos para agrupamento.") : o("error", i, "`id` é obrigatório."), u(n?.name) || o("error", i, "`name` é obrigatório."), typeof n?.preview != "function" && typeof n?.preview != "object" && o("error", i, "`preview` é obrigatório."), n?.source !== void 0 && typeof n.source != "string" && o("error", i, "`source`, quando informado, é texto livre.");
|
|
97
97
|
const p = /* @__PURE__ */ new Set();
|
|
98
98
|
for (const [b, v] of (n?.fixtures ?? []).entries()) {
|
|
99
|
-
const
|
|
100
|
-
u(v?.id) ? R.test(v.id) ? p.has(v.id) ? o("error",
|
|
99
|
+
const g = `${i}/fixture:${v?.id ?? b}`;
|
|
100
|
+
u(v?.id) ? R.test(v.id) ? p.has(v.id) ? o("error", g, `Id de fixture do componente duplicado: \`${v.id}\`.`) : p.add(v.id) : o(
|
|
101
101
|
"error",
|
|
102
|
-
|
|
102
|
+
g,
|
|
103
103
|
`Id de fixture do componente inválido: \`${v.id}\`. Use minúsculas em kebab-case.`
|
|
104
|
-
) : o("error",
|
|
104
|
+
) : o("error", g, "`id` da fixture do componente é obrigatório."), u(v?.label) || o("error", g, "`label` da fixture do componente é obrigatório."), (!v || !("data" in v)) && o("error", g, "`data` da fixture do componente é obrigatório.");
|
|
105
105
|
}
|
|
106
106
|
n?.defaultFixture && !p.has(n.defaultFixture) && o(
|
|
107
107
|
"error",
|
|
@@ -127,7 +127,7 @@ function Q(e) {
|
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
for (const [l, n] of (e.scenarios ?? []).entries()) {
|
|
130
|
-
r.push(...
|
|
130
|
+
r.push(...L(n, l));
|
|
131
131
|
const i = `scenario:${n?.id ?? l}`;
|
|
132
132
|
n?.id && (c.has(n.id) && o("error", i, `\`id\` duplicado: ${n.id}.`), c.add(n.id)), n?.persona && !t.has(n.persona) && o("error", i, `Persona não registrada: \`${n.persona}\`.`), n?.fixture && !a.has(n.fixture) && o("error", i, `Fixture não registrada: \`${n.fixture}\`.`);
|
|
133
133
|
for (const p of n?.rules ?? [])
|
|
@@ -143,21 +143,21 @@ function Q(e) {
|
|
|
143
143
|
o("error", i, "`controls`, quando informado, é um objeto de id do controle → valor.");
|
|
144
144
|
else if (n.route) {
|
|
145
145
|
const p = P(e.routes ?? [], n.route.split("?")[0] ?? n.route), b = Array.isArray(p?.definition.controls) ? p.definition.controls : [], v = new Map(
|
|
146
|
-
b.flatMap((
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
b.flatMap((g) => Array.isArray(g?.controls) ? g.controls : []).map((g) => [
|
|
147
|
+
g?.id,
|
|
148
|
+
g
|
|
149
149
|
])
|
|
150
150
|
);
|
|
151
|
-
for (const [
|
|
152
|
-
const x = v.get(
|
|
153
|
-
x ? (x.options ?? []).some((A) => A?.value ===
|
|
151
|
+
for (const [g, O] of Object.entries(n.controls)) {
|
|
152
|
+
const x = v.get(g);
|
|
153
|
+
x ? (x.options ?? []).some((A) => A?.value === O) || o(
|
|
154
154
|
"error",
|
|
155
155
|
i,
|
|
156
|
-
`Valor \`${
|
|
156
|
+
`Valor \`${O}\` não é opção do controle \`${g}\`. Opções: ${(x.options ?? []).map((A) => `\`${A?.value}\``).join(", ")}.`
|
|
157
157
|
) : o(
|
|
158
158
|
"error",
|
|
159
159
|
i,
|
|
160
|
-
`Controle \`${
|
|
160
|
+
`Controle \`${g}\` não existe na tela \`${p?.definition.path ?? n.route}\`.`
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -175,17 +175,17 @@ function Q(e) {
|
|
|
175
175
|
"A fonte padrão não é `fixtures`. O padrão do ambiente é dado sintético e determinístico (D-05); API real entra como adapter opcional, com justificativa."
|
|
176
176
|
)), r;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function q(e, r, o) {
|
|
179
179
|
const t = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
180
180
|
for (const [s, c] of e.entries()) {
|
|
181
|
-
const
|
|
182
|
-
if (u(c?.id) ? t.has(c.id) ? o("error",
|
|
183
|
-
o("error",
|
|
181
|
+
const h = `${r}/group:${c?.id ?? s}`;
|
|
182
|
+
if (u(c?.id) ? t.has(c.id) ? o("error", h, `\`id\` de grupo duplicado na tela: \`${c.id}\`.`) : t.add(c.id) : o("error", h, "`id` do grupo de controles é obrigatório."), u(c?.title) || o("error", h, "`title` do grupo é obrigatório."), !Array.isArray(c?.controls)) {
|
|
183
|
+
o("error", h, "`controls` do grupo deve ser uma lista.");
|
|
184
184
|
continue;
|
|
185
185
|
}
|
|
186
186
|
for (const [f, d] of c.controls.entries()) {
|
|
187
|
-
const l = `${
|
|
188
|
-
u(d?.id) ?
|
|
187
|
+
const l = `${h}/control:${d?.id ?? f}`;
|
|
188
|
+
u(d?.id) ? z.test(d.id) ? a.has(d.id) ? o("error", l, `\`id\` de controle duplicado na tela: \`${d.id}\`.`) : a.add(d.id) : o(
|
|
189
189
|
"error",
|
|
190
190
|
l,
|
|
191
191
|
`Id de controle inválido: \`${d.id}\`. Use letras, números, \`-\`, \`_\` ou \`.\`, sem espaço: ele vira \`c.<id>\` na URL.`
|
|
@@ -215,19 +215,19 @@ function W(e, r, o, t) {
|
|
|
215
215
|
const c = s ?? {};
|
|
216
216
|
for (const [f, d] of Object.entries(c))
|
|
217
217
|
a.includes(f) ? u(d) || t("warning", o, `\`params.${f}\` vazio: a tela abre com \`:${f}\` literal.`) : t("warning", o, `\`params.${f}\` não é parâmetro de \`${r.path}\` e é ignorado.`);
|
|
218
|
-
const
|
|
219
|
-
if (
|
|
218
|
+
const h = a.filter((f) => f !== "*" && !u(c[f]));
|
|
219
|
+
if (h.length > 0) {
|
|
220
220
|
(e.scenarios ?? []).some(
|
|
221
221
|
(d) => u(d?.route) && P(e.routes ?? [], d.route.split("?")[0] ?? d.route)?.definition.path === r.path
|
|
222
222
|
) || t(
|
|
223
223
|
"warning",
|
|
224
224
|
o,
|
|
225
|
-
`Sem exemplo para ${
|
|
225
|
+
`Sem exemplo para ${h.map((d) => `\`:${d}\``).join(", ")} e sem cenário na rota: a tela abre no caminho literal \`${r.path}\`. Declare \`params: { ${h.map((d) => `${d}: "…"`).join(", ")} }\`.`
|
|
226
226
|
);
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
if (a.length > 0) {
|
|
230
|
-
const f =
|
|
230
|
+
const f = E(r.path, c), d = P(e.routes ?? [], f);
|
|
231
231
|
d && d.definition.path !== r.path && t(
|
|
232
232
|
"warning",
|
|
233
233
|
o,
|
|
@@ -258,28 +258,28 @@ function Y(e) {
|
|
|
258
258
|
${r.message}`).join(`
|
|
259
259
|
`);
|
|
260
260
|
}
|
|
261
|
-
const
|
|
261
|
+
const w = {
|
|
262
262
|
enabled: "handoff",
|
|
263
263
|
scenario: "allowScenario",
|
|
264
264
|
route: "allowRoute",
|
|
265
265
|
component: "allowComponent"
|
|
266
266
|
};
|
|
267
|
-
function
|
|
268
|
-
if (e.get(
|
|
267
|
+
function ee(e) {
|
|
268
|
+
if (e.get(w.enabled) === "1")
|
|
269
269
|
return k({
|
|
270
|
-
scenarios: e.getAll(
|
|
271
|
-
routes: e.getAll(
|
|
272
|
-
components: e.getAll(
|
|
270
|
+
scenarios: e.getAll(w.scenario),
|
|
271
|
+
routes: e.getAll(w.route),
|
|
272
|
+
components: e.getAll(w.component)
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
function N(e, r) {
|
|
276
|
-
for (const t of Object.values(
|
|
276
|
+
for (const t of Object.values(w)) e.delete(t);
|
|
277
277
|
if (!r) return;
|
|
278
|
-
e.set(
|
|
278
|
+
e.set(w.enabled, "1");
|
|
279
279
|
const o = k(r);
|
|
280
|
-
for (const t of o.scenarios ?? []) e.append(
|
|
281
|
-
for (const t of o.routes ?? []) e.append(
|
|
282
|
-
for (const t of o.components ?? []) e.append(
|
|
280
|
+
for (const t of o.scenarios ?? []) e.append(w.scenario, t);
|
|
281
|
+
for (const t of o.routes ?? []) e.append(w.route, t);
|
|
282
|
+
for (const t of o.components ?? []) e.append(w.component, t);
|
|
283
283
|
}
|
|
284
284
|
function k(e) {
|
|
285
285
|
const r = S(e.scenarios), o = S(e.routes), t = S(e.components);
|
|
@@ -292,19 +292,19 @@ function k(e) {
|
|
|
292
292
|
function D(e, r) {
|
|
293
293
|
return !e || !!(r && e.scenarios?.includes(r));
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function oe(e, r) {
|
|
296
296
|
return !e || !!(r && e.components?.includes(r));
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function re(e, r, o = []) {
|
|
299
299
|
return !e || r === "/" ? !0 : [
|
|
300
300
|
...e.routes ?? [],
|
|
301
301
|
...o.filter((a) => D(e, a.id)).map((a) => a.route)
|
|
302
|
-
].some((a) =>
|
|
302
|
+
].some((a) => j(a, r) !== null);
|
|
303
303
|
}
|
|
304
304
|
function S(e) {
|
|
305
305
|
return [...new Set((e ?? []).map((r) => r.trim()).filter(Boolean))].sort();
|
|
306
306
|
}
|
|
307
|
-
const
|
|
307
|
+
const m = {
|
|
308
308
|
scenario: "scenario",
|
|
309
309
|
component: "component",
|
|
310
310
|
persona: "persona",
|
|
@@ -320,26 +320,27 @@ const g = {
|
|
|
320
320
|
inspector: "panel",
|
|
321
321
|
panelTab: "tab",
|
|
322
322
|
zoom: "zoom",
|
|
323
|
-
rotated: "rotate"
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
...Object.values(
|
|
323
|
+
rotated: "rotate",
|
|
324
|
+
highlight: "highlight"
|
|
325
|
+
}, $ = "c.", H = /* @__PURE__ */ new Set([
|
|
326
|
+
...Object.values(m),
|
|
327
|
+
...Object.values(w)
|
|
327
328
|
]);
|
|
328
|
-
function re(e) {
|
|
329
|
-
return e.startsWith(w) || H.has(e);
|
|
330
|
-
}
|
|
331
329
|
function te(e) {
|
|
330
|
+
return e.startsWith($) || H.has(e);
|
|
331
|
+
}
|
|
332
|
+
function ne(e) {
|
|
332
333
|
const r = typeof e == "string" ? new URLSearchParams(e) : e, o = {};
|
|
333
334
|
for (const [t, a] of r) {
|
|
334
|
-
if (!t.startsWith(
|
|
335
|
-
const s = t.slice(
|
|
335
|
+
if (!t.startsWith($)) continue;
|
|
336
|
+
const s = t.slice($.length);
|
|
336
337
|
s && (o[s] = a);
|
|
337
338
|
}
|
|
338
339
|
return o;
|
|
339
340
|
}
|
|
340
|
-
function
|
|
341
|
+
function ae(e) {
|
|
341
342
|
for (const r of [...e.keys()])
|
|
342
|
-
r.startsWith(
|
|
343
|
+
r.startsWith($) && e.delete(r);
|
|
343
344
|
}
|
|
344
345
|
function G(e) {
|
|
345
346
|
return typeof e == "boolean" ? e ? "1" : "0" : String(e);
|
|
@@ -353,40 +354,51 @@ function F(e, r = {}) {
|
|
|
353
354
|
}
|
|
354
355
|
if (o === "screenControls") {
|
|
355
356
|
for (const [s, c] of Object.entries(t))
|
|
356
|
-
e.set(`${
|
|
357
|
+
e.set(`${$}${s}`, c);
|
|
357
358
|
continue;
|
|
358
359
|
}
|
|
359
|
-
const a =
|
|
360
|
+
const a = m[o];
|
|
360
361
|
a && e.set(a, G(t));
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
|
-
const y = "ds-frame", K = "data-ds-frame",
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
364
|
+
const y = "ds-frame", K = "data-ds-frame", ie = "data-ds-component", T = [
|
|
365
|
+
m.chromeTheme,
|
|
366
|
+
m.chrome,
|
|
367
|
+
m.inspector,
|
|
368
|
+
m.panelTab,
|
|
369
|
+
m.zoom,
|
|
370
|
+
m.rotated
|
|
370
371
|
];
|
|
371
|
-
function
|
|
372
|
+
function V(e, r) {
|
|
372
373
|
const o = new URLSearchParams(r);
|
|
373
|
-
for (const t of
|
|
374
|
+
for (const t of T) o.delete(t);
|
|
374
375
|
return o.delete(y), o.set(y, "1"), `${e || "/"}?${o.toString()}`;
|
|
375
376
|
}
|
|
376
|
-
function
|
|
377
|
+
function se(e, r, o) {
|
|
378
|
+
let { path: t, search: a } = o;
|
|
379
|
+
if (e)
|
|
380
|
+
try {
|
|
381
|
+
const c = new URL(e);
|
|
382
|
+
c.origin === r && ({ pathname: t, search: a } = c);
|
|
383
|
+
} catch {
|
|
384
|
+
}
|
|
385
|
+
const s = new URLSearchParams(a);
|
|
386
|
+
return s.delete(m.viewport), s.delete(m.customWidth), V(t, `?${s.toString()}`);
|
|
387
|
+
}
|
|
388
|
+
function ce(e) {
|
|
377
389
|
const r = new URL(e, "http://design-space.invalid");
|
|
378
390
|
r.searchParams.delete(y);
|
|
379
391
|
const o = r.searchParams.toString();
|
|
380
392
|
return { path: r.pathname || "/", search: o ? `?${o}` : "" };
|
|
381
393
|
}
|
|
382
|
-
function
|
|
394
|
+
function le(e) {
|
|
383
395
|
const r = new URL(e, "http://design-space.invalid");
|
|
384
|
-
return `${r.pathname}|${r.searchParams.get(
|
|
396
|
+
return `${r.pathname}|${r.searchParams.get(m.component) ?? ""}`;
|
|
385
397
|
}
|
|
386
|
-
function
|
|
398
|
+
function de(e, r) {
|
|
387
399
|
const o = new URLSearchParams(e), t = new URLSearchParams(r);
|
|
388
400
|
o.delete(y);
|
|
389
|
-
for (const s of
|
|
401
|
+
for (const s of T) {
|
|
390
402
|
o.delete(s);
|
|
391
403
|
const c = t.get(s);
|
|
392
404
|
c !== null && o.set(s, c);
|
|
@@ -394,7 +406,7 @@ function ce(e, r) {
|
|
|
394
406
|
const a = o.toString();
|
|
395
407
|
return a ? `?${a}` : "";
|
|
396
408
|
}
|
|
397
|
-
function
|
|
409
|
+
function Z(e) {
|
|
398
410
|
if (!e || typeof e != "object") return !1;
|
|
399
411
|
const r = e;
|
|
400
412
|
if (r.ds !== 1 || typeof r.type != "string") return !1;
|
|
@@ -410,17 +422,17 @@ function V(e) {
|
|
|
410
422
|
return !1;
|
|
411
423
|
}
|
|
412
424
|
}
|
|
413
|
-
function
|
|
425
|
+
function fe(e, r) {
|
|
414
426
|
if (e.origin === r.origin && !(!r.source || e.source !== r.source))
|
|
415
|
-
return
|
|
427
|
+
return Z(e.data) ? e.data : void 0;
|
|
416
428
|
}
|
|
417
|
-
function
|
|
429
|
+
function ue(e, r, o) {
|
|
418
430
|
try {
|
|
419
431
|
e?.postMessage(r, o);
|
|
420
432
|
} catch {
|
|
421
433
|
}
|
|
422
434
|
}
|
|
423
|
-
function
|
|
435
|
+
function pe(e = typeof window > "u" ? void 0 : window) {
|
|
424
436
|
if (!e) return !1;
|
|
425
437
|
if (new URLSearchParams(e.location.search).get(y) === "1") return !0;
|
|
426
438
|
try {
|
|
@@ -442,56 +454,58 @@ function U(e = {}) {
|
|
|
442
454
|
isDeployed: a === "preview" || a === "production"
|
|
443
455
|
};
|
|
444
456
|
}
|
|
445
|
-
function
|
|
457
|
+
function J(e, r = {}) {
|
|
446
458
|
const o = r.origin ?? U().origin, t = new URL(e.route, o);
|
|
447
|
-
return t.searchParams.set(
|
|
459
|
+
return t.searchParams.set(m.scenario, e.id), e.persona && t.searchParams.set(m.persona, e.persona), t.searchParams.set(m.fixture, e.fixture), e.network && e.network !== "success" && t.searchParams.set(m.network, e.network), F(t.searchParams, r.overrides), t.toString();
|
|
448
460
|
}
|
|
449
|
-
function
|
|
461
|
+
function me(e, r = {}) {
|
|
450
462
|
const o = r.origin ?? U().origin, t = new URL("/", o), a = r.fixture ?? e.fixtures?.find((s) => s.id === e.defaultFixture)?.id ?? e.fixtures?.[0]?.id;
|
|
451
|
-
return t.searchParams.set(
|
|
463
|
+
return t.searchParams.set(m.component, e.id), a && t.searchParams.set(m.fixture, a), F(t.searchParams, r.overrides), t.toString();
|
|
452
464
|
}
|
|
453
|
-
function
|
|
465
|
+
function he(e, r) {
|
|
454
466
|
const o = r.commit ?? U().commit;
|
|
455
467
|
if (!o) return;
|
|
456
468
|
const t = r.template.replaceAll("{shortCommit}", o.slice(0, 7)).replaceAll("{commit}", o);
|
|
457
|
-
return
|
|
469
|
+
return J(e, { origin: t });
|
|
458
470
|
}
|
|
459
471
|
export {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
472
|
+
me as A,
|
|
473
|
+
Y as B,
|
|
474
|
+
$ as C,
|
|
475
|
+
X as D,
|
|
476
|
+
j as E,
|
|
465
477
|
y as F,
|
|
466
|
-
|
|
467
|
-
|
|
478
|
+
k as G,
|
|
479
|
+
w as H,
|
|
480
|
+
G as I,
|
|
481
|
+
L as J,
|
|
468
482
|
C as N,
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
483
|
+
m as P,
|
|
484
|
+
oe as a,
|
|
485
|
+
re as b,
|
|
486
|
+
ne as c,
|
|
473
487
|
N as d,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
488
|
+
ue as e,
|
|
489
|
+
ce as f,
|
|
490
|
+
fe as g,
|
|
477
491
|
D as h,
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
492
|
+
te as i,
|
|
493
|
+
ae as j,
|
|
494
|
+
J as k,
|
|
481
495
|
F as l,
|
|
482
|
-
|
|
483
|
-
|
|
496
|
+
T as m,
|
|
497
|
+
le as n,
|
|
484
498
|
K as o,
|
|
485
|
-
|
|
486
|
-
|
|
499
|
+
ee as p,
|
|
500
|
+
ie as q,
|
|
487
501
|
P as r,
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
502
|
+
E as s,
|
|
503
|
+
V as t,
|
|
504
|
+
pe as u,
|
|
491
505
|
Q as v,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
506
|
+
U as w,
|
|
507
|
+
de as x,
|
|
508
|
+
se as y,
|
|
509
|
+
he as z
|
|
496
510
|
};
|
|
497
|
-
//# sourceMappingURL=index-
|
|
511
|
+
//# sourceMappingURL=index-rWBjjVMg.js.map
|