@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.js
CHANGED
|
@@ -4528,7 +4528,6 @@ function emptyCounts() {
|
|
|
4528
4528
|
"row-content-typing": 0,
|
|
4529
4529
|
"terminal-safe-text": 0,
|
|
4530
4530
|
"gpu-layer-efficiency": 0,
|
|
4531
|
-
"memory-budget": 0,
|
|
4532
4531
|
"svg-injection-safety": 0,
|
|
4533
4532
|
"seo-metadata-quality": 0,
|
|
4534
4533
|
"bidi-hyphenation": 0,
|
|
@@ -6163,7 +6162,9 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
6163
6162
|
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;
|
|
6164
6163
|
for (const n of diag.nodes) {
|
|
6165
6164
|
if (!n.rows) continue;
|
|
6166
|
-
for (
|
|
6165
|
+
for (let i = 0; i < n.rows.length; i++) {
|
|
6166
|
+
const row = n.rows[i];
|
|
6167
|
+
if (n.rowMarks?.[i] != null) continue;
|
|
6167
6168
|
const m = row.match(/^([^:]+):\s*(.+)$/);
|
|
6168
6169
|
if (!m) continue;
|
|
6169
6170
|
const [, key, value] = m;
|
|
@@ -6232,24 +6233,6 @@ function runAxes(laid, diag, violations, counts, push, profile, skippedAxes) {
|
|
|
6232
6233
|
"warn"
|
|
6233
6234
|
);
|
|
6234
6235
|
}
|
|
6235
|
-
const MEMORY_BUDGET = 1e6;
|
|
6236
|
-
let nodeMemUnit = 0;
|
|
6237
|
-
for (const n of laid.nodes) nodeMemUnit += n.w * n.h;
|
|
6238
|
-
let edgeMemUnit = 0;
|
|
6239
|
-
for (const e of laid.edges) {
|
|
6240
|
-
const segs = extractPathSegments(e.d);
|
|
6241
|
-
edgeMemUnit += segs.length * 100;
|
|
6242
|
-
}
|
|
6243
|
-
let phaseMemUnit = 0;
|
|
6244
|
-
for (const p of diag.phases) phaseMemUnit += (p.tweens.length + p.sets.length) * 50;
|
|
6245
|
-
const totalMemUnit = nodeMemUnit + edgeMemUnit + phaseMemUnit;
|
|
6246
|
-
if (totalMemUnit > MEMORY_BUDGET) {
|
|
6247
|
-
push(
|
|
6248
|
-
"memory-budget",
|
|
6249
|
-
`diagram memory unit \u63A8\u5B9A ${totalMemUnit.toFixed(0)} > budget ${MEMORY_BUDGET} (nodes=${nodeMemUnit.toFixed(0)} edges=${edgeMemUnit.toFixed(0)} phases=${phaseMemUnit.toFixed(0)})`,
|
|
6250
|
-
"warn"
|
|
6251
|
-
);
|
|
6252
|
-
}
|
|
6253
6236
|
const XSS_PATTERNS = [
|
|
6254
6237
|
{ re: /<script\b/i, label: "<script> tag" },
|
|
6255
6238
|
{ re: /javascript:/i, label: "javascript: URI" },
|