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