@cardenelabs/cdl 0.76.0 → 0.77.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/dist/react.js CHANGED
@@ -362,7 +362,14 @@ function resolveLang(value) {
362
362
  }
363
363
  var en = {
364
364
  /** `shape-terminal` の 2 行目 (命令の出力) */
365
- "terminal.output": "\u2192 12 chunks in 1.8s",
365
+ /*
366
+ * `shape-terminal` の出力の行。
367
+ *
368
+ * **いちばん長い行が絵の倍率を決める** (#891)。 端末の中身は自分の座標で組んでから箱へ
369
+ * 収めるので、この行が長いほど全部の字が小さくなる。 120x110 の箱では 20 字の版で
370
+ * 7.71 world まで落ちていた。
371
+ */
372
+ "terminal.output": "\u2192 12 chunks",
366
373
  /** `shape-code-block` の札の file 名 */
367
374
  "codeBlock.fileName": "utils.ts",
368
375
  /** `shape-kanban-card` の課題の番号 */
@@ -589,7 +596,7 @@ var en = {
589
596
  "readout.trafficLight.green": "green"
590
597
  };
591
598
  var ja = {
592
- "terminal.output": "\u2192 1.8 \u79D2\u3067\u5B8C\u4E86",
599
+ "terminal.output": "\u2192 12 \u500B\u3092\u7D50\u5408",
593
600
  "codeBlock.fileName": "\u5171\u901A.ts",
594
601
  "kanbanCard.id": "#1111",
595
602
  "kanbanCard.status": "\u9032\u884C\u4E2D",
@@ -2876,6 +2883,7 @@ function textWidth(s, size, \u5B57\u9001\u308A = 0) {
2876
2883
  }
2877
2884
  return \u5E45 * size + \u5B57\u9001\u308A * \u5B57\u6570;
2878
2885
  }
2886
+ var \u7E2E\u3093\u3060\u7D75\u306E\u5B57\u306E\u4E0B\u9650 = 8;
2879
2887
 
2880
2888
  // src/kinds/row-align.ts
2881
2889
  var GENERIC_ROW_LEFT_SIZE_PX = 18;
@@ -12720,6 +12728,11 @@ function \u5272\u5408\u8868\u8A18(frac) {
12720
12728
  const v = Math.round(frac * 1e3) / 10;
12721
12729
  return `${Number.isInteger(v) ? v : v.toFixed(1)}%`;
12722
12730
  }
12731
+ var \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
12732
+ function \u4E2D\u592E\u306E\u5B57(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7A74\u306E\u534A\u5F84, \u6587) {
12733
+ const \u5165\u308B\u5927\u304D\u3055 = \u7A74\u306E\u534A\u5F84 * 2 * \u7A74\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / Math.max(textWidth(\u6587, 1), 1e-6);
12734
+ return Math.min(Math.max(\u6BD4\u4F8B\u3057\u305F\u5927\u304D\u3055, \u7E2E\u3093\u3060\u7D75\u306E\u5B57\u306E\u4E0B\u9650), \u5165\u308B\u5927\u304D\u3055);
12735
+ }
12723
12736
  function ChartPieNode({
12724
12737
  node,
12725
12738
  active,
@@ -12777,6 +12790,11 @@ function ChartPieNode({
12777
12790
  const cx = node.w / 2;
12778
12791
  const cy = PAD_TOP2 + chartAreaH / 2;
12779
12792
  const \u524D\u306Eslices = \u524D\u3042\u308A ? \u8F2A\u3092\u7D44\u3080(data, cx, cy, \u524D\u306E\u5916\u534A\u5F84, \u524D\u306E\u5185\u534A\u5F84, \u524D\u306E\u5272\u5408) : [];
12793
+ const \u7A74 = \u524D\u3042\u308A ? \u524D\u306E\u5185\u534A\u5F84 : \u5916\u306E\u5185\u534A\u5F84;
12794
+ const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total));
12795
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.26), \u7A74, \u5408\u8A08\u306E\u6587);
12796
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(radius * 0.12), \u7A74, "\u5408\u8A08");
12797
+ const \u5408\u8A08\u306E\u4E0B = Math.max(Math.round(radius * 0.2), \u5408\u8A08\u306E\u5B57 * 0.25 + \u898B\u51FA\u3057\u306E\u5B572 * 0.8);
12780
12798
  const slices = \u8F2A\u3092\u7D44\u3080(data, cx, cy, radius, \u5916\u306E\u5185\u534A\u5F84, \u4ECA\u306E\u5272\u5408);
12781
12799
  const \u958B\u304D = \u9032\u307F\u3092\u7573\u3080(drawing, progress);
12782
12800
  const \u5207\u308A\u629C\u304Did = `cdl-pie-draw-${instanceId}`;
@@ -12855,19 +12873,19 @@ function ChartPieNode({
12855
12873
  x: cx,
12856
12874
  y: cy - 2,
12857
12875
  textAnchor: "middle",
12858
- fontSize: Math.round(radius * 0.26),
12876
+ fontSize: \u5408\u8A08\u306E\u5B57,
12859
12877
  fontWeight: 600,
12860
12878
  fill: "var(--cdl-text, #1a1f2a)",
12861
- children: \u5B9F\u5024\u8868\u8A18(Math.round(\u524D\u3042\u308A ? \u4ECA\u306E\u5408\u8A08 : total))
12879
+ children: \u5408\u8A08\u306E\u6587
12862
12880
  }
12863
12881
  ),
12864
12882
  /* @__PURE__ */ jsx(
12865
12883
  "text",
12866
12884
  {
12867
12885
  x: cx,
12868
- y: cy + Math.round(radius * 0.2),
12886
+ y: cy + \u5408\u8A08\u306E\u4E0B,
12869
12887
  textAnchor: "middle",
12870
- fontSize: Math.round(radius * 0.12),
12888
+ fontSize: \u898B\u51FA\u3057\u306E\u5B572,
12871
12889
  fill: "var(--cdl-text-dim, #5a6270)",
12872
12890
  children: "\u5408\u8A08"
12873
12891
  }
@@ -13070,6 +13088,10 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
13070
13088
  const \u5185\u534A\u5F84 = R * 0.58;
13071
13089
  const cx = PAD + R;
13072
13090
  const cy = node.h / 2;
13091
+ const \u5408\u8A08\u306E\u6587 = \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)));
13092
+ const \u5408\u8A08\u306E\u5B57 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.26), \u5185\u534A\u5F84, \u5408\u8A08\u306E\u6587);
13093
+ const \u898B\u51FA\u3057\u306E\u5B572 = \u4E2D\u592E\u306E\u5B57(Math.round(R * 0.12), \u5185\u534A\u5F84, "\u5408\u8A08");
13094
+ const \u5408\u8A08\u306E\u4E0B = Math.max(Math.round(R * 0.2), \u5408\u8A08\u306E\u5B57 * 0.25 + \u898B\u51FA\u3057\u306E\u5B572 * 0.8);
13073
13095
  const \u8868\u5DE6 = node.w - PAD - \u8868\u5E45;
13074
13096
  const \u53F3\u7AEF = node.w - PAD;
13075
13097
  const \u5272\u5408\u53F3 = \u53F3\u7AEF - \u5B9F\u6570\u5E45 - 24;
@@ -13111,19 +13133,19 @@ function \u8868\u306E\u5F62({ node, active, data, \u5272\u5408, x0, y0, drawing,
13111
13133
  x: cx,
13112
13134
  y: cy - 2,
13113
13135
  textAnchor: "middle",
13114
- fontSize: Math.round(R * 0.26),
13136
+ fontSize: \u5408\u8A08\u306E\u5B57,
13115
13137
  fontWeight: 600,
13116
13138
  fill: "var(--cdl-text, #1a1f2a)",
13117
- children: \u5B9F\u5024\u8868\u8A18(Math.round(data.reduce((acc, d) => acc + d.value, 0)))
13139
+ children: \u5408\u8A08\u306E\u6587
13118
13140
  }
13119
13141
  ),
13120
13142
  /* @__PURE__ */ jsx(
13121
13143
  "text",
13122
13144
  {
13123
13145
  x: cx,
13124
- y: cy + Math.round(R * 0.2),
13146
+ y: cy + \u5408\u8A08\u306E\u4E0B,
13125
13147
  textAnchor: "middle",
13126
- fontSize: Math.round(R * 0.12),
13148
+ fontSize: \u898B\u51FA\u3057\u306E\u5B572,
13127
13149
  fill: "var(--cdl-text-dim, #5a6270)",
13128
13150
  children: "\u5408\u8A08"
13129
13151
  }
@@ -15900,6 +15922,7 @@ function ShapeTerminalNode({ node, active, lang }) {
15900
15922
  const lineFont = "ui-monospace, SFMono-Regular, Menlo, monospace";
15901
15923
  const \u4F59\u767D = 16;
15902
15924
  const \u5E2F = 28;
15925
+ const \u5E2F\u306E\u5B57 = 12.5;
15903
15926
  const \u89D2 = 10;
15904
15927
  const \u5148\u982D = 26;
15905
15928
  const \u884C\u9593 = 22;
@@ -15909,7 +15932,7 @@ function ShapeTerminalNode({ node, active, lang }) {
15909
15932
  { \u5DE6: 16, \u5B57: 12.5, \u8272: "#7cd88f", \u6587: "$" },
15910
15933
  { \u5DE6: 30, \u5B57: 12.5, \u8272: "#e6edf3", \u6587: "pnpm build" }
15911
15934
  ],
15912
- [{ \u5DE6: 16, \u5B57: 12, \u8272: "#8b95a5", \u6587: \u5B57\u5F15("terminal.output") }],
15935
+ [{ \u5DE6: 16, \u5B57: 12.5, \u8272: "#8b95a5", \u6587: \u5B57\u5F15("terminal.output") }],
15913
15936
  [{ \u5DE6: 16, \u5B57: 12.5, \u8272: "#7cd88f", \u6587: "$" }]
15914
15937
  ];
15915
15938
  const \u81EA\u7136\u5E45 = Math.max(...\u884C.flat().map((c) => c.\u5DE6 + \u7B49\u5E45\u306E\u6841(c.\u6587) * MONO_ADVANCE * c.\u5B57)) + \u4F59\u767D;
@@ -15951,7 +15974,7 @@ function ShapeTerminalNode({ node, active, lang }) {
15951
15974
  {
15952
15975
  x: x + w / 2,
15953
15976
  y: y + barH / 2 + 4 * \u500D,
15954
- fontSize: 11 * \u500D,
15977
+ fontSize: \u5E2F\u306E\u5B57 * \u500D,
15955
15978
  fontFamily: lineFont,
15956
15979
  textAnchor: "middle",
15957
15980
  fill: "#7a8290",
@@ -16042,6 +16065,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
16042
16065
  const \u592A\u3055 = 9;
16043
16066
  const \u9699\u9593 = 6;
16044
16067
  const \u6301\u3061\u4E0A\u3052 = 8;
16068
+ const \u884C\u756A\u53F7\u306E\u5B57 = 11;
16045
16069
  const lines = [
16046
16070
  [
16047
16071
  { c: "#c678dd", w: 40 },
@@ -16064,14 +16088,13 @@ function ShapeCodeBlockNode({ node, active, lang }) {
16064
16088
  { c: "#e6edf3", w: 40 }
16065
16089
  ]
16066
16090
  ];
16067
- const \u6700\u9577 = Math.max(
16068
- ...lines.map(
16069
- (tokens) => tokens.reduce((sum, token) => sum + token.w, 0) + \u9699\u9593 * (tokens.length - 1)
16070
- )
16071
- );
16072
- const \u81EA\u7136\u5E45 = \u6E9D + \u5B57\u4E0B\u3052 + \u6700\u9577 + \u4F59\u767D;
16073
- const \u81EA\u7136\u9AD8 = \u30BF\u30D6\u9AD8 + \u884C\u982D + \u884C\u9593 * (lines.length - 1) + Math.max(\u592A\u3055 - \u6301\u3061\u4E0A\u3052, 10.5 * DESCENT3);
16074
- const \u500D = Math.min(1, w / \u81EA\u7136\u5E45, bodyH / \u81EA\u7136\u9AD8);
16091
+ const \u81EA\u7136\u9AD8 = \u30BF\u30D6\u9AD8 + \u884C\u982D + \u884C\u9593 * (lines.length - 1) + Math.max(\u592A\u3055 - \u6301\u3061\u4E0A\u3052, \u884C\u756A\u53F7\u306E\u5B57 * DESCENT3);
16092
+ const \u500D = Math.min(1, bodyH / \u81EA\u7136\u9AD8);
16093
+ const \u6253\u3061\u6D88\u3059\u5B57\u3089 = [
16094
+ { text: \u5B57\u5F15("codeBlock.fileName"), size: 11, \u5E2F: { \u5E45: \u30BF\u30D6\u5E45, \u9AD8\u3055: \u30BF\u30D6\u9AD8 } },
16095
+ { text: "1", size: \u884C\u756A\u53F7\u306E\u5B57, \u5E2F: { \u5E45: \u6E9D - \u6301\u3061\u4E0A\u3052, \u9AD8\u3055: \u884C\u9593 } }
16096
+ ];
16097
+ const \u500D\u8FD4\u3057 = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D, \u6253\u3061\u6D88\u3059\u5B57\u3089);
16075
16098
  const tabW = \u30BF\u30D6\u5E45 * \u500D;
16076
16099
  const tabH = \u30BF\u30D6\u9AD8 * \u500D;
16077
16100
  const \u4E38 = \u89D2 * \u500D;
@@ -16107,9 +16130,10 @@ function ShapeCodeBlockNode({ node, active, lang }) {
16107
16130
  /* @__PURE__ */ jsx(
16108
16131
  "text",
16109
16132
  {
16133
+ "data-cdl-counter-scaled": "1",
16110
16134
  x: x + tabW / 2,
16111
16135
  y: y + tabH / 2 + 4 * \u500D,
16112
- fontSize: 11 * \u500D,
16136
+ fontSize: 11 * \u500D * \u500D\u8FD4\u3057,
16113
16137
  fontFamily: lineFont,
16114
16138
  textAnchor: "middle",
16115
16139
  fill: "#e6edf3",
@@ -16131,9 +16155,10 @@ function ShapeCodeBlockNode({ node, active, lang }) {
16131
16155
  /* @__PURE__ */ jsx(
16132
16156
  "text",
16133
16157
  {
16158
+ "data-cdl-counter-scaled": "1",
16134
16159
  x: x + gutterW - \u6301\u3061\u4E0A\u3052 * \u500D,
16135
16160
  y: codeY0 + i * lineH,
16136
- fontSize: 10.5 * \u500D,
16161
+ fontSize: \u884C\u756A\u53F7\u306E\u5B57 * \u500D * \u500D\u8FD4\u3057,
16137
16162
  fontFamily: lineFont,
16138
16163
  textAnchor: "end",
16139
16164
  fill: "#4a5266",
@@ -16141,12 +16166,13 @@ function ShapeCodeBlockNode({ node, active, lang }) {
16141
16166
  }
16142
16167
  ),
16143
16168
  toks.map((t, j) => {
16144
- const rect = /* @__PURE__ */ jsx(
16169
+ const \u63CF\u304F\u5E45 = Math.min(t.w * \u500D, x + w - \u4F59\u767D * \u500D - cursor);
16170
+ const rect = \u63CF\u304F\u5E45 > 0 ? /* @__PURE__ */ jsx(
16145
16171
  "rect",
16146
16172
  {
16147
16173
  x: cursor,
16148
16174
  y: codeY0 + i * lineH - \u6301\u3061\u4E0A\u3052 * \u500D,
16149
- width: t.w * \u500D,
16175
+ width: \u63CF\u304F\u5E45,
16150
16176
  height: \u592A\u3055 * \u500D,
16151
16177
  rx: 2 * \u500D,
16152
16178
  fill: t.c,
@@ -16154,7 +16180,7 @@ function ShapeCodeBlockNode({ node, active, lang }) {
16154
16180
  stroke: "none"
16155
16181
  },
16156
16182
  j
16157
- );
16183
+ ) : null;
16158
16184
  cursor += (t.w + \u9699\u9593) * \u500D;
16159
16185
  return rect;
16160
16186
  })
@@ -16199,21 +16225,23 @@ function ShapeKanbanCardNode({ node, active, lang }) {
16199
16225
  const w = Math.max(0, node.w - \u7DDA * 2 - \u5F71);
16200
16226
  const h = Math.max(0, node.h - \u7DDA * 2 - \u5F71);
16201
16227
  const \u5E2F\u9593\u4F59\u767D = 4;
16202
- const \u5DE6\u53F3\u4F59\u767D = 14;
16203
- const \u4E0A\u6BB5\u9699\u9593 = 8;
16228
+ const \u5DE6\u53F3\u4F59\u767D = 12;
16229
+ const \u4E0A\u6BB5\u9699\u9593 = 6;
16204
16230
  const \u512A\u5148\u5E2F\u9AD8 = 10;
16205
16231
  const ID\u6587 = \u5B57\u5F15("kanbanCard.id");
16206
16232
  const ID\u57FA\u6E96 = 30;
16207
16233
  const ID\u5B57 = 11;
16208
16234
  const ID\u5B57\u9593 = 1;
16209
16235
  const PILL\u4E0A = 20;
16210
- const PILL\u5E45 = 70;
16236
+ const PILL\u5E45 = 62;
16211
16237
  const PILL\u9AD8 = 16;
16212
16238
  const PILL\u5B57 = 11;
16239
+ const PILL\u5B57\u9593 = 0;
16213
16240
  const FOOTER\u4E0B = 22;
16214
16241
  const AVATAR\u4E2D\u5FC3Y = 4;
16215
16242
  const AVATAR\u534A\u5F84 = 9;
16216
16243
  const AVATAR\u67A0 = 1.5;
16244
+ const AVATAR\u5B57 = 11;
16217
16245
  const \u540D\u524D\u5B57 = 17;
16218
16246
  const \u8AAC\u660E\u57FA\u6E96\u6BD4 = 20 / 17;
16219
16247
  const \u8AAC\u660E\u5B57\u6BD4 = 12 / 17;
@@ -16296,7 +16324,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
16296
16324
  y: pillY + 12 * \u500D,
16297
16325
  fontSize: PILL\u5B57 * \u500D,
16298
16326
  fontWeight: 700,
16299
- letterSpacing: 1 * \u500D,
16327
+ letterSpacing: PILL\u5B57\u9593 * \u500D,
16300
16328
  textAnchor: "middle",
16301
16329
  fill: "#5a4a1a",
16302
16330
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
@@ -16344,7 +16372,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
16344
16372
  {
16345
16373
  x: 9 * \u500D,
16346
16374
  y: 8 * \u500D,
16347
- fontSize: 10 * \u500D,
16375
+ fontSize: AVATAR\u5B57 * \u500D,
16348
16376
  fontWeight: 700,
16349
16377
  textAnchor: "middle",
16350
16378
  fill: "#ffffff",
@@ -16368,7 +16396,7 @@ function ShapeKanbanCardNode({ node, active, lang }) {
16368
16396
  {
16369
16397
  x: 23 * \u500D,
16370
16398
  y: 8 * \u500D,
16371
- fontSize: 10 * \u500D,
16399
+ fontSize: AVATAR\u5B57 * \u500D,
16372
16400
  fontWeight: 700,
16373
16401
  textAnchor: "middle",
16374
16402
  fill: "#ffffff",