@cardenelabs/cdl 0.40.11 → 0.41.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 +51 -1
- package/dist/index.cjs +4 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -23
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +3 -20
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +3 -20
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/visual-validate.ts +22 -33
package/dist/react.cjs
CHANGED
|
@@ -4530,7 +4530,6 @@ function emptyCounts() {
|
|
|
4530
4530
|
"row-content-typing": 0,
|
|
4531
4531
|
"terminal-safe-text": 0,
|
|
4532
4532
|
"gpu-layer-efficiency": 0,
|
|
4533
|
-
"memory-budget": 0,
|
|
4534
4533
|
"svg-injection-safety": 0,
|
|
4535
4534
|
"seo-metadata-quality": 0,
|
|
4536
4535
|
"bidi-hyphenation": 0,
|
|
@@ -6165,7 +6164,9 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
6165
6164
|
const SCHEMA_KEYWORDS = /^(string|number|boolean|text|enum|timestamp|date|datetime|json|blob|PK|FK|UUID|BIGINT|INT|FLOAT|VARCHAR|TEXT|DATETIME)$|^enum\(|^varchar\(/i;
|
|
6166
6165
|
for (const n of diag.nodes) {
|
|
6167
6166
|
if (!n.rows) continue;
|
|
6168
|
-
for (
|
|
6167
|
+
for (let i = 0; i < n.rows.length; i++) {
|
|
6168
|
+
const row = n.rows[i];
|
|
6169
|
+
if (n.rowMarks?.[i] != null) continue;
|
|
6169
6170
|
const m = row.match(/^([^:]+):\s*(.+)$/);
|
|
6170
6171
|
if (!m) continue;
|
|
6171
6172
|
const [, key, value] = m;
|
|
@@ -6234,24 +6235,6 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
6234
6235
|
"warn"
|
|
6235
6236
|
);
|
|
6236
6237
|
}
|
|
6237
|
-
const MEMORY_BUDGET = 1e6;
|
|
6238
|
-
let nodeMemUnit = 0;
|
|
6239
|
-
for (const n of laid.nodes) nodeMemUnit += n.w * n.h;
|
|
6240
|
-
let edgeMemUnit = 0;
|
|
6241
|
-
for (const e of laid.edges) {
|
|
6242
|
-
const segs = extractPathSegments(e.d);
|
|
6243
|
-
edgeMemUnit += segs.length * 100;
|
|
6244
|
-
}
|
|
6245
|
-
let phaseMemUnit = 0;
|
|
6246
|
-
for (const p of diag.phases) phaseMemUnit += (p.tweens.length + p.sets.length) * 50;
|
|
6247
|
-
const totalMemUnit = nodeMemUnit + edgeMemUnit + phaseMemUnit;
|
|
6248
|
-
if (totalMemUnit > MEMORY_BUDGET) {
|
|
6249
|
-
push(
|
|
6250
|
-
"memory-budget",
|
|
6251
|
-
`diagram memory unit \u63A8\u5B9A ${totalMemUnit.toFixed(0)} > budget ${MEMORY_BUDGET} (nodes=${nodeMemUnit.toFixed(0)} edges=${edgeMemUnit.toFixed(0)} phases=${phaseMemUnit.toFixed(0)})`,
|
|
6252
|
-
"warn"
|
|
6253
|
-
);
|
|
6254
|
-
}
|
|
6255
6238
|
const XSS_PATTERNS = [
|
|
6256
6239
|
{ re: /<script\b/i, label: "<script> tag" },
|
|
6257
6240
|
{ re: /javascript:/i, label: "javascript: URI" },
|