@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.js CHANGED
@@ -9542,6 +9542,22 @@ function displayWidth(text) {
9542
9542
  }
9543
9543
  return w;
9544
9544
  }
9545
+ function \u6841\u3067\u5272\u308B(text, \u6841) {
9546
+ let w = 0;
9547
+ let \u53D6\u3063\u305F = "";
9548
+ for (const ch of text) {
9549
+ const code = ch.codePointAt(0) ?? 0;
9550
+ const \u5B57\u306E\u6841 = code >= 32 && code <= 126 ? 1 : 2;
9551
+ if (w + \u5B57\u306E\u6841 > \u6841) break;
9552
+ w += \u5B57\u306E\u6841;
9553
+ \u53D6\u3063\u305F += ch;
9554
+ }
9555
+ return [\u53D6\u3063\u305F, text.slice(\u53D6\u3063\u305F.length)];
9556
+ }
9557
+ function \u6841\u3067\u7701\u304F(text, \u4E0A\u9650) {
9558
+ if (displayWidth(text) <= \u4E0A\u9650) return text;
9559
+ return `${\u6841\u3067\u5272\u308B(text, \u4E0A\u9650 - 1)[0]}\u2026`;
9560
+ }
9545
9561
  function requiredRowsWidth(rows, kind) {
9546
9562
  if (!rows || rows.length === 0) return 0;
9547
9563
  const splits = rows.map(splitRow);
@@ -26163,7 +26179,7 @@ function KanbanBoardReadout({
26163
26179
  style: { userSelect: "none" },
26164
26180
  children: [
26165
26181
  /* @__PURE__ */ jsx("title", { children: task.title }),
26166
- task.title.length > 18 ? `${task.title.slice(0, 17)}\u2026` : task.title
26182
+ \u6841\u3067\u7701\u304F(task.title, 18)
26167
26183
  ]
26168
26184
  }
26169
26185
  )
@@ -26300,7 +26316,7 @@ function TimelineVerticalReadout({
26300
26316
  style: { userSelect: "none" },
26301
26317
  children: [
26302
26318
  /* @__PURE__ */ jsx("title", { children: ev.title }),
26303
- ev.title.length > 38 ? `${ev.title.slice(0, 37)}\u2026` : ev.title
26319
+ \u6841\u3067\u7701\u304F(ev.title, 38)
26304
26320
  ]
26305
26321
  }
26306
26322
  ),
@@ -26314,7 +26330,7 @@ function TimelineVerticalReadout({
26314
26330
  style: { userSelect: "none" },
26315
26331
  children: [
26316
26332
  /* @__PURE__ */ jsx("title", { children: ev.description }),
26317
- ev.description.length > 44 ? `${ev.description.slice(0, 43)}\u2026` : ev.description
26333
+ \u6841\u3067\u7701\u304F(ev.description, 44)
26318
26334
  ]
26319
26335
  }
26320
26336
  ) : null
@@ -26657,7 +26673,7 @@ function StepProgressReadout({
26657
26673
  style: { userSelect: "none" },
26658
26674
  children: [
26659
26675
  /* @__PURE__ */ jsx("title", { children: s }),
26660
- s.length > 10 ? `${s.slice(0, 9)}\u2026` : s
26676
+ \u6841\u3067\u7701\u304F(s, 10)
26661
26677
  ]
26662
26678
  }
26663
26679
  )
@@ -26718,7 +26734,7 @@ function UserPresenceReadout({
26718
26734
  fontWeight: 500,
26719
26735
  fill: "#0f172a",
26720
26736
  style: { userSelect: "none" },
26721
- children: u.name.length > 24 ? `${u.name.slice(0, 23)}\u2026` : u.name
26737
+ children: \u6841\u3067\u7701\u304F(u.name, 24)
26722
26738
  }
26723
26739
  ),
26724
26740
  /* @__PURE__ */ jsx(
@@ -26880,7 +26896,7 @@ function OrgChartMiniReadout({
26880
26896
  style: { userSelect: "none" },
26881
26897
  children: [
26882
26898
  /* @__PURE__ */ jsx("title", { children: n.name }),
26883
- n.name.length > 10 ? `${n.name.slice(0, 9)}\u2026` : n.name
26899
+ \u6841\u3067\u7701\u304F(n.name, 10)
26884
26900
  ]
26885
26901
  }
26886
26902
  ),
@@ -27460,7 +27476,7 @@ function FileDropzoneReadout({
27460
27476
  ),
27461
27477
  /* @__PURE__ */ jsxs("text", { x: 54, y: 34, fontSize: 12, fontWeight: 600, fill: "#0f172a", style: { userSelect: "none" }, children: [
27462
27478
  /* @__PURE__ */ jsx("title", { children: filename }),
27463
- filename.length > 26 ? `${filename.slice(0, 25)}\u2026` : filename
27479
+ \u6841\u3067\u7701\u304F(filename, 26)
27464
27480
  ] }),
27465
27481
  /* @__PURE__ */ jsx("text", { x: 54, y: 50, fontSize: 10, fill: "#64748b", style: { userSelect: "none" }, children: /* @__PURE__ */ jsx(\u5B57, { k: "readout.dropzone.uploaded" }) })
27466
27482
  ] }) : /* @__PURE__ */ jsxs("g", { "data-cdl-dropzone-empty": "1", children: [
@@ -27539,7 +27555,7 @@ function LogStreamReadout({
27539
27555
  /* @__PURE__ */ jsx("rect", { x: 0, y: 0, width, height, fill: "#0f172a", rx: 4 }),
27540
27556
  shown.map((r, i) => {
27541
27557
  const y = 4 + i * rowH;
27542
- const displayMsg = r.msg.length > 24 ? `${r.msg.slice(0, 23)}\u2026` : r.msg;
27558
+ const displayMsg = \u6841\u3067\u7701\u304F(r.msg, 24);
27543
27559
  return /* @__PURE__ */ jsxs("g", { "data-cdl-log-row": i, children: [
27544
27560
  /* @__PURE__ */ jsx("text", { x: 6, y: y + 12, fontSize: 9, fill: "#94a3b8", fontFamily: "monospace", style: { userSelect: "none" }, children: r.ts }),
27545
27561
  /* @__PURE__ */ jsx("rect", { x: 62, y: y + 3, width: 26, height: 12, fill: levelColors[r.level] ?? "#94a3b8", rx: 2 }),
@@ -27639,7 +27655,7 @@ function AlertBannerReadout({
27639
27655
  style: { userSelect: "none" },
27640
27656
  children: [
27641
27657
  /* @__PURE__ */ jsx("title", { children: message }),
27642
- message.length > 32 ? `${message.slice(0, 31)}\u2026` : message
27658
+ \u6841\u3067\u7701\u304F(message, 32)
27643
27659
  ]
27644
27660
  }
27645
27661
  )
@@ -27709,7 +27725,7 @@ function ServiceHealthReadout({
27709
27725
  style: { userSelect: "none" },
27710
27726
  children: [
27711
27727
  /* @__PURE__ */ jsx("title", { children: s.name }),
27712
- s.name.length > 10 ? `${s.name.slice(0, 9)}\u2026` : s.name
27728
+ \u6841\u3067\u7701\u304F(s.name, 10)
27713
27729
  ]
27714
27730
  }
27715
27731
  )
@@ -27888,7 +27904,7 @@ function PricingTierReadout({
27888
27904
  ),
27889
27905
  features.slice(0, 3).map((f, i) => {
27890
27906
  const y = 96 + i * 18;
27891
- const displayF = f.length > 24 ? `${f.slice(0, 23)}\u2026` : f;
27907
+ const displayF = \u6841\u3067\u7701\u304F(f, 24);
27892
27908
  return /* @__PURE__ */ jsxs("g", { "data-cdl-tier-feature": i, children: [
27893
27909
  /* @__PURE__ */ jsx("text", { x: 16, y, fontSize: 11, fill: colorAccent, style: { userSelect: "none" }, children: "\u2713" }),
27894
27910
  /* @__PURE__ */ jsxs("text", { x: 30, y, fontSize: 11, fill: "#0f172a", style: { userSelect: "none" }, children: [
@@ -28039,6 +28055,7 @@ function ArticlePreviewReadout({
28039
28055
  const width = 300;
28040
28056
  const height = 116;
28041
28057
  const thumbW = 80;
28058
+ const [\u629C\u7C8B\u306E\u4E00\u884C\u76EE, \u629C\u7C8B\u306E\u6B8B\u308A] = \u6841\u3067\u5272\u308B(excerpt, 28);
28042
28059
  return /* @__PURE__ */ jsxs("div", { className: "cdl-ip-item cdl-ip-readout-article-preview", "data-cdl-readout": id, children: [
28043
28060
  /* @__PURE__ */ jsx("span", { className: "cdl-ip-label", children: label }),
28044
28061
  /* @__PURE__ */ jsxs(
@@ -28075,15 +28092,15 @@ function ArticlePreviewReadout({
28075
28092
  style: { userSelect: "none" },
28076
28093
  children: [
28077
28094
  /* @__PURE__ */ jsx("title", { children: title }),
28078
- title.length > 26 ? `${title.slice(0, 25)}\u2026` : title
28095
+ \u6841\u3067\u7701\u304F(title, 26)
28079
28096
  ]
28080
28097
  }
28081
28098
  ),
28082
28099
  /* @__PURE__ */ jsxs("text", { x: thumbW + 20, y: 44, fontSize: 10, fill: "#334155", style: { userSelect: "none" }, children: [
28083
28100
  /* @__PURE__ */ jsx("title", { children: excerpt }),
28084
- excerpt.length > 28 ? `${excerpt.slice(0, 27)}\u2026` : excerpt
28101
+ \u629C\u7C8B\u306E\u4E00\u884C\u76EE
28085
28102
  ] }),
28086
- /* @__PURE__ */ 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) }),
28103
+ /* @__PURE__ */ 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) }),
28087
28104
  /* @__PURE__ */ jsx("text", { x: thumbW + 20, y: height - 14, fontSize: 10, fontWeight: 600, fill: "#64748b", style: { userSelect: "none" }, children: /* @__PURE__ */ jsx(\u5B57, { k: "readout.article.by", v: { author } }) }),
28088
28105
  /* @__PURE__ */ jsx("text", { x: width - 8, y: height - 14, fontSize: 10, textAnchor: "end", fill: "#94a3b8", style: { userSelect: "none" }, children: timeAgo })
28089
28106
  ]
@@ -28135,7 +28152,7 @@ function TocNavReadout({
28135
28152
  shown.map((it, i) => {
28136
28153
  const y = 4 + i * rowH;
28137
28154
  const indent = 12 + it.level * 16;
28138
- const displayT = it.title.length > 30 ? `${it.title.slice(0, 29)}\u2026` : it.title;
28155
+ const displayT = \u6841\u3067\u7701\u304F(it.title, 30);
28139
28156
  return /* @__PURE__ */ jsxs("g", { "data-cdl-toc-item": i, children: [
28140
28157
  it.active ? /* @__PURE__ */ jsx("rect", { x: 4, y, width: 3, height: rowH - 4, fill: colorActive, rx: 1 }) : null,
28141
28158
  /* @__PURE__ */ jsxs(