@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.js
CHANGED
|
@@ -6131,12 +6131,12 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes, \u5
|
|
|
6131
6131
|
if (!isRenderedNode(n)) continue;
|
|
6132
6132
|
const titleTrimmed = n.title?.trim() ?? "";
|
|
6133
6133
|
if (!titleTrimmed) continue;
|
|
6134
|
-
const
|
|
6135
|
-
const expectedW = titleLen * titleFontSize(n.kind) + (drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING);
|
|
6134
|
+
const expectedW = measureTextWidth(titleTrimmed, { fontSize: titleFontSize(n.kind) }) + (drawsTitleOutsideBox(n.kind) ? 0 : TITLE_BOX_PADDING);
|
|
6136
6135
|
if (expectedW > n.w + 8) {
|
|
6137
6136
|
push(
|
|
6138
6137
|
"text-readability",
|
|
6139
|
-
|
|
6138
|
+
// 字ごとの実幅は小数になるので、読む人に出す時だけ丸める (判定は丸めない)
|
|
6139
|
+
`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)`,
|
|
6140
6140
|
"warn"
|
|
6141
6141
|
);
|
|
6142
6142
|
}
|