@cardenelabs/cdl 0.25.0 → 0.27.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 +66 -1
- package/dist/index.cjs +18 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +13 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +13 -2
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/storage.tsx +14 -0
- package/src/layout/nodes.ts +8 -4
- package/src/layout/spec.ts +31 -3
- package/src/presets.ts +16 -1
package/dist/react.js
CHANGED
|
@@ -669,6 +669,7 @@ function rowGlyphDepth(kind) {
|
|
|
669
669
|
return Math.ceil(font * ROW_GLYPH_DEPTH_RATIO);
|
|
670
670
|
}
|
|
671
671
|
var ROW_LAYOUT_BOTTOM_PAD = 20;
|
|
672
|
+
var ROW_STRIPE_BOTTOM_PAD = 24;
|
|
672
673
|
function requiredRowsHeight(kind, rowCount) {
|
|
673
674
|
if (rowCount <= 0) return null;
|
|
674
675
|
const lastBaseline = rowBaselineY(kind, rowCount - 1);
|
|
@@ -676,6 +677,12 @@ function requiredRowsHeight(kind, rowCount) {
|
|
|
676
677
|
const pitch = ROW_PITCH_STORAGE ;
|
|
677
678
|
return lastBaseline + pitch + ROW_LAYOUT_BOTTOM_PAD;
|
|
678
679
|
}
|
|
680
|
+
function requiredMarkedRowsHeight(kind, rowCount) {
|
|
681
|
+
if (rowCount <= 0) return null;
|
|
682
|
+
const lastBand = rowStripeBand(kind, rowCount - 1, 0);
|
|
683
|
+
if (lastBand === null) return null;
|
|
684
|
+
return lastBand.y + lastBand.h + ROW_STRIPE_BOTTOM_PAD;
|
|
685
|
+
}
|
|
679
686
|
function isRenderedNode(n) {
|
|
680
687
|
if (n.visibleIf === void 0 || n.visibleIf === "") return true;
|
|
681
688
|
if (n.visibleIf.includes("{")) return true;
|
|
@@ -8685,7 +8692,10 @@ function autoStorageHeight(n, defaultH) {
|
|
|
8685
8692
|
const \u7E70\u308A\u4E0A\u3052 = n.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("storage");
|
|
8686
8693
|
if (!n.rows || n.rows.length === 0) return 115 + \u547C\u3073\u540D\u306E\u5206 - \u7E70\u308A\u4E0A\u3052;
|
|
8687
8694
|
const \u5FC5\u8981 = requiredRowsHeight("storage", n.rows.length) ?? defaultH;
|
|
8688
|
-
if (\u5370\u3042\u308A)
|
|
8695
|
+
if (\u5370\u3042\u308A) {
|
|
8696
|
+
const \u5E2F\u304B\u3089\u5FC5\u8981 = requiredMarkedRowsHeight("storage", n.rows.length) ?? defaultH;
|
|
8697
|
+
return \u5E2F\u304B\u3089\u5FC5\u8981 + \u547C\u3073\u540D\u306E\u5206;
|
|
8698
|
+
}
|
|
8689
8699
|
return Math.max(defaultH, \u5FC5\u8981);
|
|
8690
8700
|
}
|
|
8691
8701
|
function autoRowsWidth(n, defaultW) {
|
|
@@ -10267,6 +10277,7 @@ var ROW_GLYPH_CX = ROW_PAD_X_PX + ROW_GLYPH_HALF + 1;
|
|
|
10267
10277
|
var ROW_GLYPH_LEAD = 40;
|
|
10268
10278
|
var ROW_TYPE_FONT = 22;
|
|
10269
10279
|
var SUBTITLE_BASELINE = 118;
|
|
10280
|
+
var STRIPE_MIN_ROWS = 2;
|
|
10270
10281
|
var SUBTITLE_FONT = 20;
|
|
10271
10282
|
var UNDERLINE_DROP = 7;
|
|
10272
10283
|
function RowGlyph({ mark, x, y, color }) {
|
|
@@ -10324,7 +10335,7 @@ function StorageNode({
|
|
|
10324
10335
|
strokeWidth: active ? 3 : 1.25
|
|
10325
10336
|
}
|
|
10326
10337
|
),
|
|
10327
|
-
node.rowStripe && rows.map((_, idx) => {
|
|
10338
|
+
node.rowStripe && rows.length >= STRIPE_MIN_ROWS && rows.map((_, idx) => {
|
|
10328
10339
|
if (idx % 2 !== 0) return null;
|
|
10329
10340
|
const \u5E2F = rowStripeBand("storage", idx, \u884C\u306E\u4E0B\u3052);
|
|
10330
10341
|
if (!\u5E2F) return null;
|