@webround/editor 0.3.5 → 0.3.7
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/dist/check/index.d.ts +1 -0
- package/dist/check/index.js +1 -0
- package/dist/check/measured.d.ts +11 -0
- package/dist/check/measured.js +20 -0
- package/package.json +12 -2
package/dist/check/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
2
|
export { RULES, SITE_RULES, runRules, runSiteRules } from './rules.js';
|
|
3
3
|
export { checkPageFromDom, checkPageFromSerialized, serializeDom, type DomNode } from './producer-dom.js';
|
|
4
|
+
export { measuredIssues } from './measured.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/check/index.js
CHANGED
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
export * from './types.js';
|
|
3
3
|
export { RULES, SITE_RULES, runRules, runSiteRules } from './rules.js';
|
|
4
4
|
export { checkPageFromDom, checkPageFromSerialized, serializeDom } from './producer-dom.js';
|
|
5
|
+
export { measuredIssues } from './measured.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Issue } from './types.js';
|
|
2
|
+
import type { MeasureFinding } from '../measure.js';
|
|
3
|
+
/**
|
|
4
|
+
* The issues of the measured findings of a page. `page` is how the caller names it (the editor's page name, the tools' path: they list what they got under it) and `muted` the keys of the problems
|
|
5
|
+
* the person chose to leave (`checks.json`): a measured problem is silenced like a found one.
|
|
6
|
+
*/
|
|
7
|
+
export declare function measuredIssues(findings: readonly MeasureFinding[], { page, muted }: {
|
|
8
|
+
page: string;
|
|
9
|
+
muted?: readonly string[];
|
|
10
|
+
}): Issue[];
|
|
11
|
+
//# sourceMappingURL=measured.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { issueKey } from './types.js';
|
|
2
|
+
// What the page's drawing says is wrong (`measurePage`: contrast, size of what is pressed, size of text, spacing, reflow, the names of the navs) as issues of the page, like any other:
|
|
3
|
+
// the same shape, the same key, silenced the same way. ONE function makes them, so what the editor shows (from its preview) and what the container's tools say (from their headless browser) are the
|
|
4
|
+
// same list, never two. Nothing here touches a DOM: the findings are data.
|
|
5
|
+
/**
|
|
6
|
+
* The issues of the measured findings of a page. `page` is how the caller names it (the editor's page name, the tools' path: they list what they got under it) and `muted` the keys of the problems
|
|
7
|
+
* the person chose to leave (`checks.json`): a measured problem is silenced like a found one.
|
|
8
|
+
*/
|
|
9
|
+
export function measuredIssues(findings, { page, muted = [] }) {
|
|
10
|
+
const silenced = new Set(muted);
|
|
11
|
+
return findings.map((finding) => {
|
|
12
|
+
const key = issueKey({ rule: finding.rule, page, subject: finding.elementId || undefined });
|
|
13
|
+
return {
|
|
14
|
+
rule: finding.rule, severity: 'warning', page, message: finding.message, key,
|
|
15
|
+
...(finding.elementId ? { nodeId: finding.elementId, subject: finding.elementId } : {}),
|
|
16
|
+
...(silenced.has(key) ? { muted: true } : {}),
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=measured.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webround/editor",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -41,6 +41,16 @@
|
|
|
41
41
|
"types": "./dist/check/producer-code.d.ts",
|
|
42
42
|
"default": "./dist/check/producer-code.js"
|
|
43
43
|
},
|
|
44
|
+
"./check/project": {
|
|
45
|
+
"import": "./dist/check/project.js",
|
|
46
|
+
"types": "./dist/check/project.d.ts",
|
|
47
|
+
"default": "./dist/check/project.js"
|
|
48
|
+
},
|
|
49
|
+
"./measure": {
|
|
50
|
+
"import": "./dist/measure.js",
|
|
51
|
+
"types": "./dist/measure.d.ts",
|
|
52
|
+
"default": "./dist/measure.js"
|
|
53
|
+
},
|
|
44
54
|
"./operations": {
|
|
45
55
|
"import": "./dist/operations/index.js",
|
|
46
56
|
"types": "./dist/operations/index.d.ts",
|
|
@@ -65,7 +75,7 @@
|
|
|
65
75
|
"@lexical/selection": "^0.51.0",
|
|
66
76
|
"@lexical/utils": "^0.51.0",
|
|
67
77
|
"@monaco-editor/react": "^4.7.0",
|
|
68
|
-
"@webround/core": "^0.3.
|
|
78
|
+
"@webround/core": "^0.3.7",
|
|
69
79
|
"highlight.js": "^11.12.0",
|
|
70
80
|
"hls.js": "^1.5.0",
|
|
71
81
|
"lexical": "^0.51.0",
|