@plitzi/sdk-dev-tools 0.38.2 → 0.38.4
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 +329 -0
- package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +20 -18
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +35 -33
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/components/ElementDetails/ElementDetails.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.d.ts +6 -0
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.mjs +21 -0
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaToolbar.d.ts +4 -1
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaToolbar.mjs +27 -19
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaViewer.d.ts +4 -3
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaViewer.mjs +21 -12
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaXray.d.ts +6 -0
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaXray.mjs +17 -0
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaXrayBoxesRow.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaXrayBoxesRow.mjs +24 -0
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaXrayRow.d.ts +7 -0
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaXrayRow.mjs +40 -0
- package/dist/qa/QaContext.d.ts +4 -0
- package/dist/qa/QaContext.mjs +44 -38
- package/dist/qa/QaLayer.mjs +99 -47
- package/dist/qa/overlays/QaXrayTags.d.ts +12 -0
- package/dist/qa/overlays/QaXrayTags.mjs +58 -0
- package/dist/qa/qaCss.mjs +19 -18
- package/dist/qa/qaSettings.d.ts +11 -3
- package/dist/qa/qaSettings.mjs +4 -2
- package/dist/qa/xray.d.ts +22 -0
- package/dist/qa/xray.mjs +54 -0
- package/package.json +29 -5
package/dist/qa/qaCss.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { QA_CHECKS as e, QA_FINDING_ATTRIBUTE as t, QA_PAGE_ATTRIBUTE as n } from "./qaSettings.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { XRAY as r, XRAY_ATTRIBUTE as i, XRAY_MARKS as a } from "./xray.mjs";
|
|
3
|
+
import { CHECKS as o } from "./checks/index.mjs";
|
|
3
4
|
//#region src/qa/qaCss.ts
|
|
4
|
-
var
|
|
5
|
-
${
|
|
6
|
-
${
|
|
7
|
-
${
|
|
8
|
-
${
|
|
5
|
+
var s = `[${n}]`, c = ":is([data-type=\"heading\"], [data-type=\"text\"], [data-type=\"paragraph\"], [data-type=\"button\"], [data-type=\"link\"])", l = `
|
|
6
|
+
${s} [data-plitzi-el] { outline: 1px dashed rgba(124, 92, 255, 0.5); outline-offset: -1px; }
|
|
7
|
+
${s} [data-plitzi-el]:hover { outline: 1.5px solid #7c5cff; outline-offset: -1.5px; }
|
|
8
|
+
${s} ${c}[data-plitzi-el]:hover { position: relative; }
|
|
9
|
+
${s} ${c}[data-plitzi-el]:hover::after {
|
|
9
10
|
content: attr(data-type) ' · ' attr(data-plitzi-el);
|
|
10
11
|
position: absolute;
|
|
11
12
|
left: -1px;
|
|
@@ -20,26 +21,26 @@ ${i} ${a}[data-plitzi-el]:hover::after {
|
|
|
20
21
|
text-transform: none;
|
|
21
22
|
white-space: nowrap;
|
|
22
23
|
pointer-events: none;
|
|
23
|
-
}`,
|
|
24
|
+
}`, u = (e) => [l, ...a.filter((t) => e === "all" || e === t).reverse().map((e) => `${s} [${i}~="${e}"] { outline: 1.5px solid ${r[e].colour}; outline-offset: -1.5px; }`)].join("\n"), d = `${s}, ${s} * { cursor: crosshair !important; }`, f = `${s} *, ${s} ::before, ${s} ::after { animation-play-state: paused !important; }`, p = (e) => e.map((e) => `${s} [${t}~="${e}"] { outline: 2px solid ${o[e].colour} !important; outline-offset: 1px !important; box-shadow: 0 0 0 4px color-mix(in srgb, ${o[e].colour} 22%, transparent) !important; }`).join("\n"), m = (e) => `plitzi-qa-${e}`, h = {
|
|
24
25
|
none: "none",
|
|
25
26
|
grayscale: "grayscale(1)",
|
|
26
|
-
protanopia: `url(#${
|
|
27
|
-
deuteranopia: `url(#${
|
|
28
|
-
tritanopia: `url(#${
|
|
27
|
+
protanopia: `url(#${m("protanopia")})`,
|
|
28
|
+
deuteranopia: `url(#${m("deuteranopia")})`,
|
|
29
|
+
tritanopia: `url(#${m("tritanopia")})`,
|
|
29
30
|
blurred: "blur(2px)"
|
|
30
|
-
},
|
|
31
|
+
}, g = {
|
|
31
32
|
protanopia: "0.567 0.433 0 0 0 0.558 0.442 0 0 0 0 0.242 0.758 0 0 0 0 0 1 0",
|
|
32
33
|
deuteranopia: "0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0",
|
|
33
34
|
tritanopia: "0.95 0.05 0 0 0 0 0.433 0.567 0 0 0 0.475 0.525 0 0 0 0 0 1 0"
|
|
34
|
-
},
|
|
35
|
+
}, _ = (t) => {
|
|
35
36
|
let n = e.filter((e) => t.checks[e]);
|
|
36
37
|
return [
|
|
37
|
-
t.inspect ?
|
|
38
|
-
t.
|
|
39
|
-
t.paused ?
|
|
40
|
-
t.vision === "none" ? "" : `${
|
|
41
|
-
|
|
38
|
+
t.inspect ? d : "",
|
|
39
|
+
t.xray ? u(t.xrayFilter) : "",
|
|
40
|
+
t.paused ? f : "",
|
|
41
|
+
t.vision === "none" ? "" : `${s} { filter: ${h[t.vision]}; }`,
|
|
42
|
+
p(n)
|
|
42
43
|
].filter(Boolean).join("\n");
|
|
43
44
|
};
|
|
44
45
|
//#endregion
|
|
45
|
-
export {
|
|
46
|
+
export { h as VISION_FILTER, g as VISION_MATRIX, _ as qaCss, m as visionFilterId };
|
package/dist/qa/qaSettings.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { XrayFilter } from './xray';
|
|
1
2
|
/**
|
|
2
3
|
* What the QA tab can turn on over a running page — for whoever checks a build before it ships: a designer lining
|
|
3
4
|
* things up, a tester looking for what breaks. Kept in this browser, and only ever offered where the dev tools are,
|
|
@@ -12,14 +13,21 @@ export interface QaSettings {
|
|
|
12
13
|
inspect: boolean;
|
|
13
14
|
/** The columns the page is laid out on (`@plitzi/sdk-shared/style`'s layout grid), over it. */
|
|
14
15
|
grid: boolean;
|
|
15
|
-
/**
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Every element's box, its type and id when pointed at — and what the document wires to each, a condition, a flow,
|
|
18
|
+
* motion, a flag, marked and named on it.
|
|
19
|
+
*/
|
|
20
|
+
xray: boolean;
|
|
21
|
+
/** The wiring the x-ray marks: every kind, one, or none — the boxes alone. */
|
|
22
|
+
xrayFilter: XrayFilter;
|
|
17
23
|
/** The order the Tab key walks the page's controls in, numbered on them. */
|
|
18
24
|
tabOrder: boolean;
|
|
19
25
|
/** The viewport's size and the breakpoint whose rules show. */
|
|
20
26
|
viewport: boolean;
|
|
21
27
|
/** Every animation held where it is, to look at a moment of it. */
|
|
22
28
|
paused: boolean;
|
|
29
|
+
/** Every animation at a quarter of its speed, to see how it moves rather than that it did. */
|
|
30
|
+
slowMotion: boolean;
|
|
23
31
|
/** The page as a visitor who asked for less motion gets it — the SDK's own rule, by class. */
|
|
24
32
|
reducedMotion: boolean;
|
|
25
33
|
vision: VisionMode;
|
|
@@ -27,7 +35,7 @@ export interface QaSettings {
|
|
|
27
35
|
}
|
|
28
36
|
export declare const QA_DEFAULTS: QaSettings;
|
|
29
37
|
/** The tools that are simply on or off. */
|
|
30
|
-
export type QaSwitch = 'inspect' | 'grid' | '
|
|
38
|
+
export type QaSwitch = 'inspect' | 'grid' | 'xray' | 'tabOrder' | 'viewport' | 'paused' | 'slowMotion' | 'reducedMotion';
|
|
31
39
|
/** Whether any of it is on: the page is marked only while something is. */
|
|
32
40
|
export declare const isQaActive: (settings: QaSettings) => boolean;
|
|
33
41
|
/** The class the SDK's stylesheet stills every animation under, as its `prefers-reduced-motion` rule does. */
|
package/dist/qa/qaSettings.mjs
CHANGED
|
@@ -9,10 +9,12 @@ var e = [
|
|
|
9
9
|
], t = {
|
|
10
10
|
inspect: !1,
|
|
11
11
|
grid: !1,
|
|
12
|
-
|
|
12
|
+
xray: !1,
|
|
13
|
+
xrayFilter: "all",
|
|
13
14
|
tabOrder: !1,
|
|
14
15
|
viewport: !1,
|
|
15
16
|
paused: !1,
|
|
17
|
+
slowMotion: !1,
|
|
16
18
|
reducedMotion: !1,
|
|
17
19
|
vision: "none",
|
|
18
20
|
checks: {
|
|
@@ -23,6 +25,6 @@ var e = [
|
|
|
23
25
|
images: !1,
|
|
24
26
|
headings: !1
|
|
25
27
|
}
|
|
26
|
-
}, n = (e) => e.inspect || e.grid || e.
|
|
28
|
+
}, n = (e) => e.inspect || e.grid || e.xray || e.tabOrder || e.viewport || e.paused || e.slowMotion || e.reducedMotion || e.vision !== "none" || Object.values(e.checks).some(Boolean), r = "plitzi-reduced-motion", i = "data-plitzi-qa-page", a = "data-plitzi-qa-finding";
|
|
27
29
|
//#endregion
|
|
28
30
|
export { e as QA_CHECKS, t as QA_DEFAULTS, a as QA_FINDING_ATTRIBUTE, i as QA_PAGE_ATTRIBUTE, r as REDUCED_MOTION_CLASS, n as isQaActive };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElementDefinition } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* What the document wires to an element that its box does not show: where its values come from, what it does when
|
|
4
|
+
* used, whether it may be hidden, how it moves and the flag it exists under. The x-ray draws every element's box — its
|
|
5
|
+
* type and id when pointed at — and marks each kind of wiring on it, which is what a tester needs to know before
|
|
6
|
+
* asking why something shows, moves or does what it does.
|
|
7
|
+
*/
|
|
8
|
+
export declare const XRAY_MARKS: readonly ["data", "visibility", "flows", "motion", "flag"];
|
|
9
|
+
export type XrayMark = (typeof XRAY_MARKS)[number];
|
|
10
|
+
/** The wiring the x-ray colours: every kind, one, or none — the boxes alone. */
|
|
11
|
+
export type XrayFilter = XrayMark | 'all' | 'none';
|
|
12
|
+
/** The attribute the x-ray marks an element with, its value the marks it carries. */
|
|
13
|
+
export declare const XRAY_ATTRIBUTE = "data-plitzi-qa-xray";
|
|
14
|
+
export declare const XRAY: Record<XrayMark, {
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
colour: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type XrayCounts = Record<XrayMark, number>;
|
|
20
|
+
export declare const NO_XRAY_COUNTS: XrayCounts;
|
|
21
|
+
/** The marks an element's definition earns, in the order of {@link XRAY_MARKS}. */
|
|
22
|
+
export declare const xrayMarksOf: (definition: ElementDefinition) => XrayMark[];
|
package/dist/qa/xray.mjs
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//#region src/qa/xray.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"data",
|
|
4
|
+
"visibility",
|
|
5
|
+
"flows",
|
|
6
|
+
"motion",
|
|
7
|
+
"flag"
|
|
8
|
+
], t = "data-plitzi-qa-xray", n = {
|
|
9
|
+
data: {
|
|
10
|
+
label: "Bound to data",
|
|
11
|
+
description: "A value of it — a text, a style, a state — is read from a binding",
|
|
12
|
+
colour: "#0ea5e9"
|
|
13
|
+
},
|
|
14
|
+
visibility: {
|
|
15
|
+
label: "Shown on a condition",
|
|
16
|
+
description: "Whether it shows is bound, or it starts hidden",
|
|
17
|
+
colour: "#f59e0b"
|
|
18
|
+
},
|
|
19
|
+
flows: {
|
|
20
|
+
label: "Runs a flow",
|
|
21
|
+
description: "Something done to it starts an interaction",
|
|
22
|
+
colour: "#ec4899"
|
|
23
|
+
},
|
|
24
|
+
motion: {
|
|
25
|
+
label: "Moves",
|
|
26
|
+
description: "It arrives, or keeps moving, by its declared motion",
|
|
27
|
+
colour: "#10b981"
|
|
28
|
+
},
|
|
29
|
+
flag: {
|
|
30
|
+
label: "Behind a flag",
|
|
31
|
+
description: "It exists only while a feature flag says so",
|
|
32
|
+
colour: "#8b5cf6"
|
|
33
|
+
}
|
|
34
|
+
}, r = {
|
|
35
|
+
data: 0,
|
|
36
|
+
visibility: 0,
|
|
37
|
+
flows: 0,
|
|
38
|
+
motion: 0,
|
|
39
|
+
flag: 0
|
|
40
|
+
}, i = (e) => e === "visibility", a = (t) => {
|
|
41
|
+
let n = Object.entries(t.bindings ?? {}).flatMap(([e, t]) => t.filter((e) => e.enabled !== !1).map((t) => ({
|
|
42
|
+
category: e,
|
|
43
|
+
to: t.to
|
|
44
|
+
}))), r = n.some(({ category: e, to: t }) => e === "initialState" && i(t)), a = {
|
|
45
|
+
data: n.some(({ category: e, to: t }) => !(e === "initialState" && i(t))),
|
|
46
|
+
visibility: r || t.initialState?.visibility === !1,
|
|
47
|
+
flows: Object.values(t.interactions ?? {}).some((e) => e.enabled),
|
|
48
|
+
motion: t.motion?.enter !== void 0 || t.motion?.loop !== void 0,
|
|
49
|
+
flag: t.flag !== void 0
|
|
50
|
+
};
|
|
51
|
+
return e.filter((e) => a[e]);
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { r as NO_XRAY_COUNTS, n as XRAY, t as XRAY_ATTRIBUTE, e as XRAY_MARKS, a as xrayMarksOf };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-dev-tools",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.4",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -674,6 +674,10 @@
|
|
|
674
674
|
"types": "./dist/components/DevToolsPanel/tabs/QaViewer/QaProperty.d.ts",
|
|
675
675
|
"import": "./dist/components/DevToolsPanel/tabs/QaViewer/QaProperty.mjs"
|
|
676
676
|
},
|
|
677
|
+
"./components/DevToolsPanel/tabs/QaViewer/QaReplayButton": {
|
|
678
|
+
"types": "./dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.d.ts",
|
|
679
|
+
"import": "./dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.mjs"
|
|
680
|
+
},
|
|
677
681
|
"./components/DevToolsPanel/tabs/QaViewer/QaRescanButton": {
|
|
678
682
|
"types": "./dist/components/DevToolsPanel/tabs/QaViewer/QaRescanButton.d.ts",
|
|
679
683
|
"import": "./dist/components/DevToolsPanel/tabs/QaViewer/QaRescanButton.mjs"
|
|
@@ -698,6 +702,18 @@
|
|
|
698
702
|
"types": "./dist/components/DevToolsPanel/tabs/QaViewer/QaVisionSelect.d.ts",
|
|
699
703
|
"import": "./dist/components/DevToolsPanel/tabs/QaViewer/QaVisionSelect.mjs"
|
|
700
704
|
},
|
|
705
|
+
"./components/DevToolsPanel/tabs/QaViewer/QaXray": {
|
|
706
|
+
"types": "./dist/components/DevToolsPanel/tabs/QaViewer/QaXray.d.ts",
|
|
707
|
+
"import": "./dist/components/DevToolsPanel/tabs/QaViewer/QaXray.mjs"
|
|
708
|
+
},
|
|
709
|
+
"./components/DevToolsPanel/tabs/QaViewer/QaXrayBoxesRow": {
|
|
710
|
+
"types": "./dist/components/DevToolsPanel/tabs/QaViewer/QaXrayBoxesRow.d.ts",
|
|
711
|
+
"import": "./dist/components/DevToolsPanel/tabs/QaViewer/QaXrayBoxesRow.mjs"
|
|
712
|
+
},
|
|
713
|
+
"./components/DevToolsPanel/tabs/QaViewer/QaXrayRow": {
|
|
714
|
+
"types": "./dist/components/DevToolsPanel/tabs/QaViewer/QaXrayRow.d.ts",
|
|
715
|
+
"import": "./dist/components/DevToolsPanel/tabs/QaViewer/QaXrayRow.mjs"
|
|
716
|
+
},
|
|
701
717
|
"./components/DevToolsPanel/tabs/QaViewer/index": {
|
|
702
718
|
"types": "./dist/components/DevToolsPanel/tabs/QaViewer/index.d.ts",
|
|
703
719
|
"import": "./dist/components/DevToolsPanel/tabs/QaViewer/index.mjs"
|
|
@@ -1110,6 +1126,10 @@
|
|
|
1110
1126
|
"types": "./dist/qa/overlays/QaViewport.d.ts",
|
|
1111
1127
|
"import": "./dist/qa/overlays/QaViewport.mjs"
|
|
1112
1128
|
},
|
|
1129
|
+
"./qa/overlays/QaXrayTags": {
|
|
1130
|
+
"types": "./dist/qa/overlays/QaXrayTags.d.ts",
|
|
1131
|
+
"import": "./dist/qa/overlays/QaXrayTags.mjs"
|
|
1132
|
+
},
|
|
1113
1133
|
"./qa/qaCss": {
|
|
1114
1134
|
"types": "./dist/qa/qaCss.d.ts",
|
|
1115
1135
|
"import": "./dist/qa/qaCss.mjs"
|
|
@@ -1126,6 +1146,10 @@
|
|
|
1126
1146
|
"types": "./dist/qa/usePageBox.d.ts",
|
|
1127
1147
|
"import": "./dist/qa/usePageBox.mjs"
|
|
1128
1148
|
},
|
|
1149
|
+
"./qa/xray": {
|
|
1150
|
+
"types": "./dist/qa/xray.d.ts",
|
|
1151
|
+
"import": "./dist/qa/xray.mjs"
|
|
1152
|
+
},
|
|
1129
1153
|
"./scope/helpers": {
|
|
1130
1154
|
"types": "./dist/scope/helpers.d.ts",
|
|
1131
1155
|
"import": "./dist/scope/helpers.mjs"
|
|
@@ -1187,10 +1211,10 @@
|
|
|
1187
1211
|
"dependencies": {
|
|
1188
1212
|
"@plitzi/nexus": "^1.4.0",
|
|
1189
1213
|
"@plitzi/plitzi-ui": "^1.6.29",
|
|
1190
|
-
"@plitzi/sdk-navigation": "0.38.
|
|
1191
|
-
"@plitzi/sdk-schema": "0.38.
|
|
1192
|
-
"@plitzi/sdk-shared": "0.38.
|
|
1193
|
-
"@plitzi/sdk-style": "0.38.
|
|
1214
|
+
"@plitzi/sdk-navigation": "0.38.4",
|
|
1215
|
+
"@plitzi/sdk-schema": "0.38.4",
|
|
1216
|
+
"@plitzi/sdk-shared": "0.38.4",
|
|
1217
|
+
"@plitzi/sdk-style": "0.38.4",
|
|
1194
1218
|
"@uiw/react-json-view": "^2.0.0-alpha.43",
|
|
1195
1219
|
"clsx": "^2.1.1"
|
|
1196
1220
|
}
|