@cardenelabs/cdl 0.105.0 → 0.106.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 +24 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +3 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +3 -3
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/visual-validate.ts +9 -4
package/dist/react.cjs
CHANGED
|
@@ -6133,12 +6133,12 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6133
6133
|
if (!isRenderedNode(n)) continue;
|
|
6134
6134
|
const titleTrimmed = n.title?.trim() ?? "";
|
|
6135
6135
|
if (!titleTrimmed) continue;
|
|
6136
|
-
const
|
|
6137
|
-
const expectedW = titleLen * titleFontSize(n.kind) + (drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING);
|
|
6136
|
+
const expectedW = measureTextWidth(titleTrimmed, { fontSize: titleFontSize(n.kind) }) + (drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING);
|
|
6138
6137
|
if (expectedW > n.w + 8) {
|
|
6139
6138
|
push(
|
|
6140
6139
|
"text-readability",
|
|
6141
|
-
|
|
6140
|
+
// 字ごとの実幅は小数になるので、読む人に出す時だけ丸める (判定は丸めない)
|
|
6141
|
+
`node "${n.id}" title "${n.title}" \u304C node \u5E45 ${n.w}px \u3092\u8D85\u904E\u3059\u308B\u53EF\u80FD\u6027 (\u671F\u5F85 ${Math.round(expectedW)}px)`,
|
|
6142
6142
|
"warn"
|
|
6143
6143
|
);
|
|
6144
6144
|
}
|