@cardenelabs/cdl 0.102.0 → 0.104.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 +44 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +1 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +1 -0
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -0
- package/src/visual-validate.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cardenelabs/cdl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.104.0",
|
|
4
4
|
"description": "CDL (Chainome Diagram Language). Mermaid-like declarative DSL that compiles to animated SVG diagrams. Built for blockchain / Solidity flows, generic enough for sequence / flow / state / ER / topology diagrams.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "cardene777",
|
package/src/index.ts
CHANGED
|
@@ -187,6 +187,11 @@ export {
|
|
|
187
187
|
// 出さない (出すと下流が式を組み直せてしまい、 SSOT から逸脱する余地ができる)。
|
|
188
188
|
rendersRows,
|
|
189
189
|
requiredRowsHeight,
|
|
190
|
+
// #943 追加 = 下流が「この図は自分で題を箱の上に描くか」 を engine と同じ判定で決められる
|
|
191
|
+
// ようにする。 見本帳は同じ題を頁の説明行にも出しており、判定が無いと同じ字が 2 か所に並ぶ。
|
|
192
|
+
// 位置と大きさ (`FIGURE_TITLE_GAP` 等) は出さない = 出すと下流が題の配置を組み直せてしまい、
|
|
193
|
+
// 同じ式が 2 か所に増える (`rendersRows` で同じ判断をしている)。
|
|
194
|
+
drawsFigureTitle,
|
|
190
195
|
} from "./layout/spec";
|
|
191
196
|
// #387 追加 = rows の内容から必要 width を出す。 下流が preset の固定 w を rows に合わせて
|
|
192
197
|
// 広げる際に、 engine と同じ式を使えるようにする。
|
package/src/visual-validate.ts
CHANGED
|
@@ -2363,9 +2363,15 @@ function runAxes(
|
|
|
2363
2363
|
// 判定 = viewBox 外に node bbox が飛ぶと clip されて視覚破綻。 node bbox (cx±w/2, cy±h/2) の
|
|
2364
2364
|
// いずれかの辺が viewBox 外なら error。 Axis 14 は edge-label 対象、 本 axis は node 対象で棲み分け。
|
|
2365
2365
|
// spacer node (id endsWith "-spacer" or /^s\d+-/) は layout 補助用の非表示 node なので判定対象外。
|
|
2366
|
+
//
|
|
2367
|
+
// **描かない node も対象外** (#945)。 板は `isRenderedNode` で描く node だけに寄せる
|
|
2368
|
+
// (`layout/viewbox.ts`) ので、隠れる node を判定に入れると板の外に在ると数える。
|
|
2369
|
+
// 0.93.0 (#924) で板が中身に寄るようになってから、`visibleIf: "0"` の置き石だけを持つ図
|
|
2370
|
+
// (読み取り盤の見本 17 枚) が全て誤りとして挙がっていた。 判定は板と同じ述語を引く。
|
|
2366
2371
|
// ───────────────────────────────────────────────────────────
|
|
2367
2372
|
for (const n of laid.nodes) {
|
|
2368
2373
|
if (n.id.endsWith("-spacer") || /^s\d+-/.test(n.id)) continue;
|
|
2374
|
+
if (!isRenderedNode(n)) continue;
|
|
2369
2375
|
const nodeLeft = n.cx - n.w / 2;
|
|
2370
2376
|
const nodeTop = n.cy - n.h / 2;
|
|
2371
2377
|
const nodeRight = n.cx + n.w / 2;
|