@cronn/element-snapshot 0.23.0 → 0.25.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/README.md +2 -4
- package/dist/browser-lib.iife.js +10 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +6 -4
- package/package.json +7 -7
package/README.md
CHANGED
package/dist/browser-lib.iife.js
CHANGED
|
@@ -133,16 +133,19 @@
|
|
|
133
133
|
"complementary",
|
|
134
134
|
"contentinfo",
|
|
135
135
|
"definition",
|
|
136
|
+
"deletion",
|
|
136
137
|
"descriptionlist",
|
|
137
138
|
"emphasis",
|
|
138
139
|
"form",
|
|
139
140
|
"grid",
|
|
141
|
+
"insertion",
|
|
140
142
|
"label",
|
|
141
143
|
"list",
|
|
142
144
|
"listbox",
|
|
143
145
|
"listitem",
|
|
144
146
|
"log",
|
|
145
147
|
"main",
|
|
148
|
+
"mark",
|
|
146
149
|
"menu",
|
|
147
150
|
"navigation",
|
|
148
151
|
"note",
|
|
@@ -152,6 +155,8 @@
|
|
|
152
155
|
"search",
|
|
153
156
|
"status",
|
|
154
157
|
"strong",
|
|
158
|
+
"subscript",
|
|
159
|
+
"superscript",
|
|
155
160
|
"table",
|
|
156
161
|
"tablist",
|
|
157
162
|
"tabpanel",
|
|
@@ -199,6 +204,7 @@
|
|
|
199
204
|
button: "button",
|
|
200
205
|
code: "code",
|
|
201
206
|
dd: "definition",
|
|
207
|
+
del: "deletion",
|
|
202
208
|
dl: "descriptionlist",
|
|
203
209
|
dt: "term",
|
|
204
210
|
em: "emphasis",
|
|
@@ -215,10 +221,12 @@
|
|
|
215
221
|
hr: "separator",
|
|
216
222
|
img: "img",
|
|
217
223
|
input: resolveInputRole,
|
|
224
|
+
ins: "insertion",
|
|
218
225
|
label: "label",
|
|
219
226
|
legend: "label",
|
|
220
227
|
li: "listitem",
|
|
221
228
|
main: "main",
|
|
229
|
+
mark: "mark",
|
|
222
230
|
nav: "navigation",
|
|
223
231
|
ol: "list",
|
|
224
232
|
option: "option",
|
|
@@ -229,6 +237,8 @@
|
|
|
229
237
|
section: "region",
|
|
230
238
|
select: "combobox",
|
|
231
239
|
strong: "strong",
|
|
240
|
+
sub: "subscript",
|
|
241
|
+
sup: "superscript",
|
|
232
242
|
table: "table",
|
|
233
243
|
tbody: "rowgroup",
|
|
234
244
|
textarea: "textbox",
|
package/dist/index.d.mts
CHANGED
|
@@ -42,7 +42,7 @@ type PressedValue = true | "mixed";
|
|
|
42
42
|
type SetValues<TSet> = TSet extends Set<infer TValue> ? TValue : never;
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/types/elements/container.d.ts
|
|
45
|
-
declare const CONTAINER_ROLES: Set<"alert" | "article" | "banner" | "blockquote" | "code" | "complementary" | "contentinfo" | "definition" | "descriptionlist" | "emphasis" | "form" | "grid" | "label" | "list" | "listbox" | "listitem" | "log" | "main" | "menu" | "navigation" | "note" | "paragraph" | "row" | "rowgroup" | "search" | "status" | "strong" | "table" | "tablist" | "tabpanel" | "term">;
|
|
45
|
+
declare const CONTAINER_ROLES: Set<"alert" | "article" | "banner" | "blockquote" | "code" | "complementary" | "contentinfo" | "definition" | "deletion" | "descriptionlist" | "emphasis" | "form" | "grid" | "insertion" | "label" | "list" | "listbox" | "listitem" | "log" | "main" | "mark" | "menu" | "navigation" | "note" | "paragraph" | "row" | "rowgroup" | "search" | "status" | "strong" | "subscript" | "superscript" | "table" | "tablist" | "tabpanel" | "term">;
|
|
46
46
|
interface ContainerSnapshot extends GenericElementSnapshot<ContainerRole> {}
|
|
47
47
|
type ContainerRole = SetValues<typeof CONTAINER_ROLES>;
|
|
48
48
|
interface RegionSnapshot extends GenericElementSnapshot<"region"> {}
|
package/dist/index.mjs
CHANGED
|
@@ -140,8 +140,7 @@ var SemanticSnapshotTransformer = class {
|
|
|
140
140
|
return this.transformedSnapshot(role, children.length === 1 ? children.at(0) : children);
|
|
141
141
|
}
|
|
142
142
|
const { role, name, attributes, children } = normalizedSnapshot;
|
|
143
|
-
return this.transformedSnapshot(role, {
|
|
144
|
-
name: name.length === 0 ? void 0 : name,
|
|
143
|
+
return this.transformedSnapshot(role, name, {
|
|
145
144
|
...attributes,
|
|
146
145
|
children: children.length === 0 ? void 0 : children
|
|
147
146
|
});
|
|
@@ -185,8 +184,11 @@ var SemanticSnapshotTransformer = class {
|
|
|
185
184
|
}
|
|
186
185
|
return attributes[name];
|
|
187
186
|
}
|
|
188
|
-
transformedSnapshot(role,
|
|
189
|
-
return {
|
|
187
|
+
transformedSnapshot(role, nameOrContent, additionalProperties) {
|
|
188
|
+
return {
|
|
189
|
+
[role]: nameOrContent,
|
|
190
|
+
...additionalProperties
|
|
191
|
+
};
|
|
190
192
|
}
|
|
191
193
|
};
|
|
192
194
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronn/element-snapshot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Element snapshots for Playwright",
|
|
5
5
|
"homepage": "https://cronn.github.io/file-snapshots/playwright/element-snapshots/",
|
|
6
6
|
"bugs": {
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"@vitest/coverage-v8": "4.1.10",
|
|
38
38
|
"eslint": "10.7.0",
|
|
39
39
|
"eslint-config-prettier": "10.1.8",
|
|
40
|
-
"eslint-plugin-check-file": "3.3.
|
|
40
|
+
"eslint-plugin-check-file": "3.3.2",
|
|
41
41
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
42
42
|
"publint": "0.3.21",
|
|
43
43
|
"rimraf": "6.1.3",
|
|
44
|
-
"tsdown": "0.22.
|
|
44
|
+
"tsdown": "0.22.12",
|
|
45
45
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
46
|
-
"typescript-eslint": "8.
|
|
46
|
+
"typescript-eslint": "8.64.0",
|
|
47
47
|
"vitest": "4.1.10",
|
|
48
48
|
"node": "runtime:24.18.0",
|
|
49
|
+
"@cronn/shared-configs": "0.0.0",
|
|
49
50
|
"@cronn/test-utils": "0.0.0",
|
|
50
|
-
"@cronn/vitest-file-snapshots": "2.1.2"
|
|
51
|
-
"@cronn/shared-configs": "0.0.0"
|
|
51
|
+
"@cronn/vitest-file-snapshots": "2.1.2"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@playwright/test": "^1.55"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"devEngines": {
|
|
57
57
|
"packageManager": {
|
|
58
58
|
"name": "pnpm",
|
|
59
|
-
"version": "11.
|
|
59
|
+
"version": "11.17.0",
|
|
60
60
|
"onFail": "download"
|
|
61
61
|
},
|
|
62
62
|
"runtime": {
|