@cardenelabs/cdl 0.59.0 → 0.59.1

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
@@ -9544,6 +9544,22 @@ function displayWidth(text) {
9544
9544
  }
9545
9545
  return w;
9546
9546
  }
9547
+ function \u6841\u3067\u5272\u308B(text, \u6841) {
9548
+ let w = 0;
9549
+ let \u53D6\u3063\u305F = "";
9550
+ for (const ch of text) {
9551
+ const code = ch.codePointAt(0) ?? 0;
9552
+ const \u5B57\u306E\u6841 = code >= 32 && code <= 126 ? 1 : 2;
9553
+ if (w + \u5B57\u306E\u6841 > \u6841) break;
9554
+ w += \u5B57\u306E\u6841;
9555
+ \u53D6\u3063\u305F += ch;
9556
+ }
9557
+ return [\u53D6\u3063\u305F, text.slice(\u53D6\u3063\u305F.length)];
9558
+ }
9559
+ function \u6841\u3067\u7701\u304F(text, \u4E0A\u9650) {
9560
+ if (displayWidth(text) <= \u4E0A\u9650) return text;
9561
+ return `${\u6841\u3067\u5272\u308B(text, \u4E0A\u9650 - 1)[0]}\u2026`;
9562
+ }
9547
9563
  function requiredRowsWidth(rows, kind) {
9548
9564
  if (!rows || rows.length === 0) return 0;
9549
9565
  const splits = rows.map(splitRow);
@@ -26165,7 +26181,7 @@ function KanbanBoardReadout({
26165
26181
  style: { userSelect: "none" },
26166
26182
  children: [
26167
26183
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: task.title }),
26168
- task.title.length > 18 ? `${task.title.slice(0, 17)}\u2026` : task.title
26184
+ \u6841\u3067\u7701\u304F(task.title, 18)
26169
26185
  ]
26170
26186
  }
26171
26187
  )
@@ -26302,7 +26318,7 @@ function TimelineVerticalReadout({
26302
26318
  style: { userSelect: "none" },
26303
26319
  children: [
26304
26320
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: ev.title }),
26305
- ev.title.length > 38 ? `${ev.title.slice(0, 37)}\u2026` : ev.title
26321
+ \u6841\u3067\u7701\u304F(ev.title, 38)
26306
26322
  ]
26307
26323
  }
26308
26324
  ),
@@ -26316,7 +26332,7 @@ function TimelineVerticalReadout({
26316
26332
  style: { userSelect: "none" },
26317
26333
  children: [
26318
26334
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: ev.description }),
26319
- ev.description.length > 44 ? `${ev.description.slice(0, 43)}\u2026` : ev.description
26335
+ \u6841\u3067\u7701\u304F(ev.description, 44)
26320
26336
  ]
26321
26337
  }
26322
26338
  ) : null
@@ -26659,7 +26675,7 @@ function StepProgressReadout({
26659
26675
  style: { userSelect: "none" },
26660
26676
  children: [
26661
26677
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: s }),
26662
- s.length > 10 ? `${s.slice(0, 9)}\u2026` : s
26678
+ \u6841\u3067\u7701\u304F(s, 10)
26663
26679
  ]
26664
26680
  }
26665
26681
  )
@@ -26720,7 +26736,7 @@ function UserPresenceReadout({
26720
26736
  fontWeight: 500,
26721
26737
  fill: "#0f172a",
26722
26738
  style: { userSelect: "none" },
26723
- children: u.name.length > 24 ? `${u.name.slice(0, 23)}\u2026` : u.name
26739
+ children: \u6841\u3067\u7701\u304F(u.name, 24)
26724
26740
  }
26725
26741
  ),
26726
26742
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -26882,7 +26898,7 @@ function OrgChartMiniReadout({
26882
26898
  style: { userSelect: "none" },
26883
26899
  children: [
26884
26900
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: n.name }),
26885
- n.name.length > 10 ? `${n.name.slice(0, 9)}\u2026` : n.name
26901
+ \u6841\u3067\u7701\u304F(n.name, 10)
26886
26902
  ]
26887
26903
  }
26888
26904
  ),
@@ -27462,7 +27478,7 @@ function FileDropzoneReadout({
27462
27478
  ),
27463
27479
  /* @__PURE__ */ jsxRuntime.jsxs("text", { x: 54, y: 34, fontSize: 12, fontWeight: 600, fill: "#0f172a", style: { userSelect: "none" }, children: [
27464
27480
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: filename }),
27465
- filename.length > 26 ? `${filename.slice(0, 25)}\u2026` : filename
27481
+ \u6841\u3067\u7701\u304F(filename, 26)
27466
27482
  ] }),
27467
27483
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: 54, y: 50, fontSize: 10, fill: "#64748b", style: { userSelect: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx(\u5B57, { k: "readout.dropzone.uploaded" }) })
27468
27484
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-dropzone-empty": "1", children: [
@@ -27541,7 +27557,7 @@ function LogStreamReadout({
27541
27557
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width, height, fill: "#0f172a", rx: 4 }),
27542
27558
  shown.map((r, i) => {
27543
27559
  const y = 4 + i * rowH;
27544
- const displayMsg = r.msg.length > 24 ? `${r.msg.slice(0, 23)}\u2026` : r.msg;
27560
+ const displayMsg = \u6841\u3067\u7701\u304F(r.msg, 24);
27545
27561
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-log-row": i, children: [
27546
27562
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: 6, y: y + 12, fontSize: 9, fill: "#94a3b8", fontFamily: "monospace", style: { userSelect: "none" }, children: r.ts }),
27547
27563
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 62, y: y + 3, width: 26, height: 12, fill: levelColors[r.level] ?? "#94a3b8", rx: 2 }),
@@ -27641,7 +27657,7 @@ function AlertBannerReadout({
27641
27657
  style: { userSelect: "none" },
27642
27658
  children: [
27643
27659
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: message }),
27644
- message.length > 32 ? `${message.slice(0, 31)}\u2026` : message
27660
+ \u6841\u3067\u7701\u304F(message, 32)
27645
27661
  ]
27646
27662
  }
27647
27663
  )
@@ -27711,7 +27727,7 @@ function ServiceHealthReadout({
27711
27727
  style: { userSelect: "none" },
27712
27728
  children: [
27713
27729
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: s.name }),
27714
- s.name.length > 10 ? `${s.name.slice(0, 9)}\u2026` : s.name
27730
+ \u6841\u3067\u7701\u304F(s.name, 10)
27715
27731
  ]
27716
27732
  }
27717
27733
  )
@@ -27890,7 +27906,7 @@ function PricingTierReadout({
27890
27906
  ),
27891
27907
  features.slice(0, 3).map((f, i) => {
27892
27908
  const y = 96 + i * 18;
27893
- const displayF = f.length > 24 ? `${f.slice(0, 23)}\u2026` : f;
27909
+ const displayF = \u6841\u3067\u7701\u304F(f, 24);
27894
27910
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-tier-feature": i, children: [
27895
27911
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: 16, y, fontSize: 11, fill: colorAccent, style: { userSelect: "none" }, children: "\u2713" }),
27896
27912
  /* @__PURE__ */ jsxRuntime.jsxs("text", { x: 30, y, fontSize: 11, fill: "#0f172a", style: { userSelect: "none" }, children: [
@@ -28041,6 +28057,7 @@ function ArticlePreviewReadout({
28041
28057
  const width = 300;
28042
28058
  const height = 116;
28043
28059
  const thumbW = 80;
28060
+ const [\u629C\u7C8B\u306E\u4E00\u884C\u76EE, \u629C\u7C8B\u306E\u6B8B\u308A] = \u6841\u3067\u5272\u308B(excerpt, 28);
28044
28061
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cdl-ip-item cdl-ip-readout-article-preview", "data-cdl-readout": id, children: [
28045
28062
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cdl-ip-label", children: label }),
28046
28063
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -28077,15 +28094,15 @@ function ArticlePreviewReadout({
28077
28094
  style: { userSelect: "none" },
28078
28095
  children: [
28079
28096
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: title }),
28080
- title.length > 26 ? `${title.slice(0, 25)}\u2026` : title
28097
+ \u6841\u3067\u7701\u304F(title, 26)
28081
28098
  ]
28082
28099
  }
28083
28100
  ),
28084
28101
  /* @__PURE__ */ jsxRuntime.jsxs("text", { x: thumbW + 20, y: 44, fontSize: 10, fill: "#334155", style: { userSelect: "none" }, children: [
28085
28102
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: excerpt }),
28086
- excerpt.length > 28 ? `${excerpt.slice(0, 27)}\u2026` : excerpt
28103
+ \u629C\u7C8B\u306E\u4E00\u884C\u76EE
28087
28104
  ] }),
28088
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: thumbW + 20, y: 60, fontSize: 10, fill: "#334155", style: { userSelect: "none" }, children: excerpt.length > 56 ? `${excerpt.slice(28, 55)}\u2026` : excerpt.slice(28, 56) }),
28105
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: thumbW + 20, y: 60, fontSize: 10, fill: "#334155", style: { userSelect: "none" }, children: \u6841\u3067\u7701\u304F(\u629C\u7C8B\u306E\u6B8B\u308A, 28) }),
28089
28106
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: thumbW + 20, y: height - 14, fontSize: 10, fontWeight: 600, fill: "#64748b", style: { userSelect: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx(\u5B57, { k: "readout.article.by", v: { author } }) }),
28090
28107
  /* @__PURE__ */ jsxRuntime.jsx("text", { x: width - 8, y: height - 14, fontSize: 10, textAnchor: "end", fill: "#94a3b8", style: { userSelect: "none" }, children: timeAgo })
28091
28108
  ]
@@ -28137,7 +28154,7 @@ function TocNavReadout({
28137
28154
  shown.map((it, i) => {
28138
28155
  const y = 4 + i * rowH;
28139
28156
  const indent = 12 + it.level * 16;
28140
- const displayT = it.title.length > 30 ? `${it.title.slice(0, 29)}\u2026` : it.title;
28157
+ const displayT = \u6841\u3067\u7701\u304F(it.title, 30);
28141
28158
  return /* @__PURE__ */ jsxRuntime.jsxs("g", { "data-cdl-toc-item": i, children: [
28142
28159
  it.active ? /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 4, y, width: 3, height: rowH - 4, fill: colorActive, rx: 1 }) : null,
28143
28160
  /* @__PURE__ */ jsxRuntime.jsxs(