@cardenelabs/cdl 0.43.0 → 0.44.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 +40 -1
- package/dist/index.cjs +22 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -9
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +22 -9
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +22 -9
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/visual-validate.ts +54 -16
package/dist/index.js
CHANGED
|
@@ -16927,10 +16927,16 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
16927
16927
|
} catch {
|
|
16928
16928
|
}
|
|
16929
16929
|
}
|
|
16930
|
-
const
|
|
16930
|
+
const RESPONSIVE_REF_FRAME_W_PX = 1200;
|
|
16931
|
+
const RESPONSIVE_REF_FRAME_BORDER_PX = 1;
|
|
16932
|
+
const RESPONSIVE_REF_FRAME_PAD_PX = 24;
|
|
16933
|
+
const RESPONSIVE_REF_CONTAINER_W_PX = RESPONSIVE_REF_FRAME_W_PX - RESPONSIVE_REF_FRAME_BORDER_PX * 2 - RESPONSIVE_REF_FRAME_PAD_PX * 2;
|
|
16934
|
+
const RESPONSIVE_REF_VIEWPORT_H_PX = 900;
|
|
16935
|
+
const RESPONSIVE_REF_FRAME_H_RATIO = 0.9;
|
|
16936
|
+
const RESPONSIVE_REF_CHROME_H_PX = 180;
|
|
16937
|
+
const RESPONSIVE_REF_CONTAINER_H_PX = RESPONSIVE_REF_VIEWPORT_H_PX * RESPONSIVE_REF_FRAME_H_RATIO - RESPONSIVE_REF_CHROME_H_PX;
|
|
16931
16938
|
const RESPONSIVE_MIN_ON_SCREEN_FONT_PX = 12;
|
|
16932
16939
|
const RESPONSIVE_BASE_FONT_WORLD = 22;
|
|
16933
|
-
const RESPONSIVE_MAX_VIEWBOX_W = RESPONSIVE_BASE_FONT_WORLD * RESPONSIVE_REF_CONTAINER_PX / RESPONSIVE_MIN_ON_SCREEN_FONT_PX;
|
|
16934
16940
|
const vbResp = laid.viewBox;
|
|
16935
16941
|
if (!(vbResp.w > 0) || !(vbResp.h > 0) || !Number.isFinite(vbResp.w) || !Number.isFinite(vbResp.h)) {
|
|
16936
16942
|
push(
|
|
@@ -16938,13 +16944,20 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
16938
16944
|
`viewBox \u5BF8\u6CD5 ${vbResp.w}\xD7${vbResp.h} \u304C\u63CF\u753B\u4E0D\u80FD (\u6B63\u306E\u6709\u9650\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308B)`,
|
|
16939
16945
|
"warn"
|
|
16940
16946
|
);
|
|
16941
|
-
} else
|
|
16942
|
-
const \
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
|
|
16946
|
-
|
|
16947
|
-
|
|
16947
|
+
} else {
|
|
16948
|
+
const \u6A2A\u306E\u500D\u7387 = RESPONSIVE_REF_CONTAINER_W_PX / vbResp.w;
|
|
16949
|
+
const \u7E26\u306E\u500D\u7387 = RESPONSIVE_REF_CONTAINER_H_PX / vbResp.h;
|
|
16950
|
+
const \u500D\u7387 = Math.min(\u6A2A\u306E\u500D\u7387, \u7E26\u306E\u500D\u7387);
|
|
16951
|
+
const \u753B\u9762\u4E0A\u306E\u5B57 = RESPONSIVE_BASE_FONT_WORLD * \u500D\u7387;
|
|
16952
|
+
if (\u753B\u9762\u4E0A\u306E\u5B57 < RESPONSIVE_MIN_ON_SCREEN_FONT_PX) {
|
|
16953
|
+
const \u52B9\u304F\u8FBA = \u6A2A\u306E\u500D\u7387 <= \u7E26\u306E\u500D\u7387 ? "\u6A2A" : "\u7E26";
|
|
16954
|
+
const \u53CE\u307E\u308B\u5BF8\u6CD5 = \u52B9\u304F\u8FBA === "\u6A2A" ? `\u5E45 ${(RESPONSIVE_REF_CONTAINER_W_PX * RESPONSIVE_BASE_FONT_WORLD / RESPONSIVE_MIN_ON_SCREEN_FONT_PX).toFixed(0)} \u4EE5\u4E0B` : `\u9AD8\u3055 ${(RESPONSIVE_REF_CONTAINER_H_PX * RESPONSIVE_BASE_FONT_WORLD / RESPONSIVE_MIN_ON_SCREEN_FONT_PX).toFixed(0)} \u4EE5\u4E0B`;
|
|
16955
|
+
push(
|
|
16956
|
+
"responsive-viewport",
|
|
16957
|
+
`viewBox ${vbResp.w}\xD7${vbResp.h} \u306F\u5668 ${RESPONSIVE_REF_CONTAINER_W_PX}\xD7${RESPONSIVE_REF_CONTAINER_H_PX}px \u3067 ${\u500D\u7387.toFixed(3)} \u500D\u306B\u7E2E\u307F\u3001 \u7BB1\u306E\u984C\u304C ${\u753B\u9762\u4E0A\u306E\u5B57.toFixed(1)}px \u306B\u306A\u308B (\u4E0B\u9650 ${RESPONSIVE_MIN_ON_SCREEN_FONT_PX}px\u3001 \u500D\u7387\u3092\u6C7A\u3081\u305F\u306E\u306F ${\u52B9\u304F\u8FBA}\u3001 ${\u53CE\u307E\u308B\u5BF8\u6CD5}\u306B\u3059\u308B\u3068\u5C4A\u304F)`,
|
|
16958
|
+
"warn"
|
|
16959
|
+
);
|
|
16960
|
+
}
|
|
16948
16961
|
}
|
|
16949
16962
|
if (!(diag.topic?.trim() ?? "")) {
|
|
16950
16963
|
push(
|