@pactor-app/ui 1.22.0 → 1.24.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.
@@ -8146,7 +8146,7 @@ function ChatMessage({
8146
8146
 
8147
8147
  // src/components/chat/ChatPage/index.tsx
8148
8148
  import { useRenderer as useRenderer18 } from "@pactor-app/runtime";
8149
- import { isValidElement as isValidElement2, useState as useState44 } from "react";
8149
+ import { isValidElement as isValidElement2, useEffect as useEffect36, useState as useState44 } from "react";
8150
8150
 
8151
8151
  // src/components/chat/Composer/index.tsx
8152
8152
  import {
@@ -8984,6 +8984,10 @@ function ChatPage({
8984
8984
  conversationTitle,
8985
8985
  conversationHeaderAction,
8986
8986
  onConversationHeaderAction,
8987
+ conversationRailItems = [],
8988
+ hideArtifactRailItem = false,
8989
+ activeConversationRailKey,
8990
+ onConversationRailChange,
8987
8991
  messages = [],
8988
8992
  sending,
8989
8993
  composerPlaceholder,
@@ -9024,6 +9028,51 @@ function ChatPage({
9024
9028
  if (!controlled) setInnerOpen(next);
9025
9029
  onArtifactOpenChange?.(next);
9026
9030
  };
9031
+ const railControlled = activeConversationRailKey !== void 0;
9032
+ const [activeRailInner, setActiveRailInner] = useState44(null);
9033
+ const activeRailKey = railControlled ? activeConversationRailKey : activeRailInner;
9034
+ const setActiveRailKey = (next) => {
9035
+ if (!railControlled) setActiveRailInner(next);
9036
+ onConversationRailChange?.(next);
9037
+ };
9038
+ const visibleRailItems = conversationRailItems.filter((item) => item.hidden !== true);
9039
+ const activeRailItem = visibleRailItems.find(
9040
+ (item) => item.key === activeRailKey
9041
+ );
9042
+ const activePanelItem = activeRailItem?.display === "panel" && activeRailItem.content !== void 0 ? activeRailItem : void 0;
9043
+ const activePopoverItem = activeRailItem !== void 0 && activeRailItem.display !== "panel" && activeRailItem.content !== void 0 ? activeRailItem : void 0;
9044
+ const toggleRailItem = (item) => {
9045
+ const next = activeRailKey === item.key ? null : item.key;
9046
+ if (next !== null && item.display === "panel") {
9047
+ setOpen(false);
9048
+ }
9049
+ setActiveRailKey(next);
9050
+ };
9051
+ const toggleArtifact = () => {
9052
+ if (!open && activePanelItem) {
9053
+ setActiveRailKey(null);
9054
+ }
9055
+ setOpen(!open);
9056
+ };
9057
+ useEffect36(() => {
9058
+ if (!activePopoverItem) return;
9059
+ const onKeyDown = (event) => {
9060
+ if (event.key === "Escape") setActiveRailKey(null);
9061
+ };
9062
+ const onPointerDown = (event) => {
9063
+ const target = event.target;
9064
+ if (target.closest("[data-slot=chat-page-rail-popover]") || target.closest("[data-slot=chat-page-conv-rail]")) {
9065
+ return;
9066
+ }
9067
+ setActiveRailKey(null);
9068
+ };
9069
+ document.addEventListener("keydown", onKeyDown);
9070
+ document.addEventListener("mousedown", onPointerDown);
9071
+ return () => {
9072
+ document.removeEventListener("keydown", onKeyDown);
9073
+ document.removeEventListener("mousedown", onPointerDown);
9074
+ };
9075
+ });
9027
9076
  const { renderChildren } = useRenderer18();
9028
9077
  const renderSlot = (slot) => isValidElement2(slot) || typeof slot !== "object" || slot === null ? slot : renderChildren([slot]);
9029
9078
  const convCollControlled = conversationSectionCollapsed !== void 0;
@@ -9055,10 +9104,58 @@ function ChatPage({
9055
9104
  onClick: () => onMenuSelect?.(item.key)
9056
9105
  }
9057
9106
  ) }, item.key);
9107
+ const convRailButton = (item, active, onClick) => {
9108
+ const button = /* @__PURE__ */ jsx127(
9109
+ Button2,
9110
+ {
9111
+ icon: item.icon,
9112
+ variant: "text",
9113
+ className: cn(active ? "bg-accent text-accent-foreground" : void 0, "px-2"),
9114
+ onClick
9115
+ }
9116
+ );
9117
+ return item.label !== void 0 ? /* @__PURE__ */ jsx127(Tooltip2, { content: item.label, side: "left", children: button }, item.key) : /* @__PURE__ */ jsx127("span", { children: button }, item.key);
9118
+ };
9119
+ const convRailVisible = !hideArtifactRailItem || visibleRailItems.length > 0;
9120
+ const convRail = convRailVisible ? /* @__PURE__ */ jsxs90(
9121
+ "div",
9122
+ {
9123
+ "data-slot": "chat-page-conv-rail",
9124
+ className: "relative flex w-(--pactor-chat-rail-width) shrink-0 flex-col items-center gap-1 px-1 py-2",
9125
+ children: [
9126
+ !hideArtifactRailItem ? convRailButton(
9127
+ {
9128
+ key: "artifact",
9129
+ icon: open ? "panel-right-close" : "package",
9130
+ label: open ? "\u6536\u8D77\u4EA7\u7269\u533A" : artifactTitle
9131
+ },
9132
+ open,
9133
+ toggleArtifact
9134
+ ) : null,
9135
+ visibleRailItems.map(
9136
+ (item) => convRailButton(item, activeRailKey === item.key, () => toggleRailItem(item))
9137
+ ),
9138
+ activePopoverItem ? /* @__PURE__ */ jsx127(
9139
+ "div",
9140
+ {
9141
+ "data-slot": "chat-page-rail-popover",
9142
+ className: "absolute right-full top-0 z-10 mr-2 overflow-auto rounded-lg border border-border bg-popover shadow-md",
9143
+ style: {
9144
+ width: "var(--pactor-chat-rail-popover-width)",
9145
+ maxWidth: "calc(100cqw - 2rem)",
9146
+ maxHeight: "calc(100% - 1rem)"
9147
+ },
9148
+ children: renderSlot(activePopoverItem.content)
9149
+ }
9150
+ ) : null
9151
+ ]
9152
+ }
9153
+ ) : null;
9058
9154
  const chatArea = /* @__PURE__ */ jsxs90("div", { "data-slot": "chat-page-conversation", className: "flex h-full min-w-0 flex-1 flex-col", children: [
9059
9155
  /* @__PURE__ */ jsxs90(
9060
9156
  "div",
9061
9157
  {
9158
+ "data-slot": "chat-page-conversation-header",
9062
9159
  className: "flex shrink-0 items-center justify-between border-b border-border px-4 py-2.5",
9063
9160
  children: [
9064
9161
  /* @__PURE__ */ jsx127(Text, { text: conversationTitle, strong: true }),
@@ -9070,66 +9167,62 @@ function ChatPage({
9070
9167
  variant: "text",
9071
9168
  onClick: () => onConversationHeaderAction?.()
9072
9169
  }
9073
- ) }) : /* @__PURE__ */ jsx127(Tooltip2, { content: open ? "\u6536\u8D77\u4EA7\u7269\u533A" : artifactTitle, side: "bottom", children: /* @__PURE__ */ jsx127(
9074
- Button2,
9075
- {
9076
- icon: open ? "panel-right-close" : "panel-right-open",
9077
- variant: "text",
9078
- onClick: () => setOpen(!open)
9079
- }
9080
- ) })
9170
+ ) }) : null
9081
9171
  ]
9082
9172
  }
9083
9173
  ),
9084
- /* @__PURE__ */ jsxs90(
9085
- "div",
9086
- {
9087
- "data-slot": "chat-page-conversation-body",
9088
- className: "mx-auto flex min-h-0 w-[61.8cqw] max-w-full flex-1 flex-col",
9089
- children: [
9090
- messages.length === 0 ? /* @__PURE__ */ jsx127(
9091
- Welcome,
9092
- {
9093
- title: welcome?.title,
9094
- description: welcome?.description,
9095
- prompts: welcome?.prompts,
9096
- style: { flex: 1 },
9097
- onSelect: (value) => onSend?.(value)
9098
- }
9099
- ) : /* @__PURE__ */ jsx127(
9100
- MessageList,
9101
- {
9102
- messages,
9103
- className: "scrollbar-subtle",
9104
- style: { flex: 1, minHeight: 0, padding: 16 },
9105
- onAction: onMessageAction,
9106
- onOpenArtifacts: () => setOpen(true)
9107
- }
9108
- ),
9109
- /* @__PURE__ */ jsx127(
9110
- Composer,
9111
- {
9112
- placeholder: composerPlaceholder,
9113
- loading: sending,
9114
- models,
9115
- model,
9116
- contexts,
9117
- contextItems,
9118
- attachments,
9119
- footer: composerFooter,
9120
- style: { padding: 16, paddingBottom: composerBottom ? 8 : 16, flexShrink: 0 },
9121
- onModelChange,
9122
- onContextItemsChange,
9123
- onAttachFiles,
9124
- onRemoveAttachment,
9125
- onRetryAttachment,
9126
- onSubmit: (text) => onSend?.(text)
9127
- }
9128
- ),
9129
- composerBottom ? /* @__PURE__ */ jsx127("div", { "data-slot": "chat-page-composer-bottom", className: "shrink-0 px-4 pb-2 text-center", children: renderSlot(composerBottom) }) : null
9130
- ]
9131
- }
9132
- )
9174
+ /* @__PURE__ */ jsxs90("div", { className: "flex min-h-0 flex-1", children: [
9175
+ /* @__PURE__ */ jsxs90(
9176
+ "div",
9177
+ {
9178
+ "data-slot": "chat-page-conversation-body",
9179
+ className: "mx-auto flex min-h-0 w-[61.8cqw] max-w-full flex-col",
9180
+ children: [
9181
+ messages.length === 0 ? /* @__PURE__ */ jsx127(
9182
+ Welcome,
9183
+ {
9184
+ title: welcome?.title,
9185
+ description: welcome?.description,
9186
+ prompts: welcome?.prompts,
9187
+ style: { flex: 1 },
9188
+ onSelect: (value) => onSend?.(value)
9189
+ }
9190
+ ) : /* @__PURE__ */ jsx127(
9191
+ MessageList,
9192
+ {
9193
+ messages,
9194
+ className: "scrollbar-subtle",
9195
+ style: { flex: 1, minHeight: 0, padding: 16 },
9196
+ onAction: onMessageAction,
9197
+ onOpenArtifacts: () => setOpen(true)
9198
+ }
9199
+ ),
9200
+ /* @__PURE__ */ jsx127(
9201
+ Composer,
9202
+ {
9203
+ placeholder: composerPlaceholder,
9204
+ loading: sending,
9205
+ models,
9206
+ model,
9207
+ contexts,
9208
+ contextItems,
9209
+ attachments,
9210
+ footer: composerFooter,
9211
+ style: { padding: 16, paddingBottom: composerBottom ? 8 : 16, flexShrink: 0 },
9212
+ onModelChange,
9213
+ onContextItemsChange,
9214
+ onAttachFiles,
9215
+ onRemoveAttachment,
9216
+ onRetryAttachment,
9217
+ onSubmit: (text) => onSend?.(text)
9218
+ }
9219
+ ),
9220
+ composerBottom ? /* @__PURE__ */ jsx127("div", { "data-slot": "chat-page-composer-bottom", className: "shrink-0 px-4 pb-2 text-center", children: renderSlot(composerBottom) }) : null
9221
+ ]
9222
+ }
9223
+ ),
9224
+ convRail
9225
+ ] })
9133
9226
  ] });
9134
9227
  const activeArtifact = artifacts.find((item) => item.id === activeArtifactId) ?? (activeArtifactId === void 0 || activeArtifactId === "" ? artifacts[artifacts.length - 1] : void 0);
9135
9228
  const artifactPanel = /* @__PURE__ */ jsx127(
@@ -9261,10 +9354,17 @@ function ChatPage({
9261
9354
  ]
9262
9355
  }
9263
9356
  ),
9264
- /* @__PURE__ */ jsx127("div", { className: "@container h-full min-w-0 flex-1", children: open ? /* @__PURE__ */ jsxs90(PanelGroup, { orientation: "horizontal", style: { width: "100%", height: "100%" }, children: [
9357
+ /* @__PURE__ */ jsx127("div", { className: "@container h-full min-w-0 flex-1", children: open || activePanelItem ? /* @__PURE__ */ jsxs90(PanelGroup, { orientation: "horizontal", style: { width: "100%", height: "100%" }, children: [
9265
9358
  /* @__PURE__ */ jsx127(Panel, { defaultSize: "62%", children: chatArea }),
9266
9359
  /* @__PURE__ */ jsx127(ResizableHandle, { withHandle: true }),
9267
- /* @__PURE__ */ jsx127(Panel, { defaultSize: "38%", minSize: "380px", maxSize: "760px", children: artifactPanel })
9360
+ /* @__PURE__ */ jsx127(Panel, { defaultSize: "38%", minSize: "380px", maxSize: "760px", children: activePanelItem ? /* @__PURE__ */ jsx127(
9361
+ "div",
9362
+ {
9363
+ "data-slot": "chat-page-rail-panel",
9364
+ className: "flex h-full min-w-0 flex-col border-l border-border bg-muted",
9365
+ children: renderSlot(activePanelItem.content)
9366
+ }
9367
+ ) : artifactPanel })
9268
9368
  ] }) : chatArea })
9269
9369
  ]
9270
9370
  }
@@ -9340,7 +9440,7 @@ function Suggestion({ items = [], justify = "start", onSelect, className, style
9340
9440
  }
9341
9441
 
9342
9442
  // src/components/chart/EChartBase/index.tsx
9343
- import { useEffect as useEffect36, useRef as useRef11, useState as useState45 } from "react";
9443
+ import { useEffect as useEffect37, useRef as useRef11, useState as useState45 } from "react";
9344
9444
 
9345
9445
  // src/components/chart/echarts-modules.ts
9346
9446
  import * as echarts from "echarts/core";
@@ -9406,7 +9506,7 @@ function EChartBase({
9406
9506
  const onSelectRef = useRef11(onSelect);
9407
9507
  onSelectRef.current = onSelect;
9408
9508
  const [failed, setFailed] = useState45(false);
9409
- useEffect36(() => {
9509
+ useEffect37(() => {
9410
9510
  const host = hostRef.current;
9411
9511
  if (!host) return;
9412
9512
  let chart = null;
@@ -9425,15 +9525,15 @@ function EChartBase({
9425
9525
  dataIndex: params.dataIndex
9426
9526
  });
9427
9527
  });
9428
- const observer = new ResizeObserver(() => chart?.resize());
9429
- observer.observe(host);
9528
+ const observer2 = new ResizeObserver(() => chart?.resize());
9529
+ observer2.observe(host);
9430
9530
  return () => {
9431
- observer.disconnect();
9531
+ observer2.disconnect();
9432
9532
  chart?.dispose();
9433
9533
  chartRef.current = null;
9434
9534
  };
9435
9535
  }, []);
9436
- useEffect36(() => {
9536
+ useEffect37(() => {
9437
9537
  try {
9438
9538
  chartRef.current?.setOption(option, { notMerge: true });
9439
9539
  } catch {
@@ -9889,6 +9989,9 @@ function buildComposedOption(input, theme) {
9889
9989
  };
9890
9990
  }
9891
9991
 
9992
+ // src/components/chart/lib/use-chart-theme.ts
9993
+ import { useSyncExternalStore } from "react";
9994
+
9892
9995
  // src/components/chart/lib/color.ts
9893
9996
  var LPAREN = String.fromCharCode(40);
9894
9997
  var RPAREN = String.fromCharCode(41);
@@ -9985,6 +10088,64 @@ function getChartTheme() {
9985
10088
  return FALLBACK_THEME;
9986
10089
  }
9987
10090
  }
10091
+ function resetChartTheme() {
10092
+ cached = null;
10093
+ }
10094
+ var CHART_SKIN_CHANGE_EVENT = "pactor:skin-change";
10095
+ var listeners = /* @__PURE__ */ new Set();
10096
+ var observer = null;
10097
+ var scheduled = false;
10098
+ function scheduleNotify() {
10099
+ if (scheduled) return;
10100
+ scheduled = true;
10101
+ const enqueue = typeof requestAnimationFrame === "function" ? requestAnimationFrame : (cb) => setTimeout(cb, 0);
10102
+ enqueue(() => {
10103
+ scheduled = false;
10104
+ resetChartTheme();
10105
+ for (const listener of [...listeners]) {
10106
+ listener();
10107
+ }
10108
+ });
10109
+ }
10110
+ function handleResourceLoad(event) {
10111
+ const target = event.target;
10112
+ if (target instanceof HTMLLinkElement || target instanceof HTMLStyleElement) {
10113
+ scheduleNotify();
10114
+ }
10115
+ }
10116
+ function subscribeChartTheme(listener) {
10117
+ if (typeof document === "undefined" || typeof MutationObserver === "undefined") {
10118
+ return () => {
10119
+ };
10120
+ }
10121
+ listeners.add(listener);
10122
+ if (!observer) {
10123
+ observer = new MutationObserver(scheduleNotify);
10124
+ observer.observe(document.documentElement, { attributes: true });
10125
+ observer.observe(document.head, {
10126
+ attributes: true,
10127
+ childList: true,
10128
+ characterData: true,
10129
+ subtree: true
10130
+ });
10131
+ document.addEventListener("load", handleResourceLoad, true);
10132
+ window.addEventListener(CHART_SKIN_CHANGE_EVENT, scheduleNotify);
10133
+ }
10134
+ return () => {
10135
+ listeners.delete(listener);
10136
+ if (listeners.size === 0 && observer) {
10137
+ observer.disconnect();
10138
+ observer = null;
10139
+ document.removeEventListener("load", handleResourceLoad, true);
10140
+ window.removeEventListener(CHART_SKIN_CHANGE_EVENT, scheduleNotify);
10141
+ }
10142
+ };
10143
+ }
10144
+
10145
+ // src/components/chart/lib/use-chart-theme.ts
10146
+ function useChartTheme() {
10147
+ return useSyncExternalStore(subscribeChartTheme, getChartTheme, getChartTheme);
10148
+ }
9988
10149
 
9989
10150
  // src/components/chart/AreaChart/index.tsx
9990
10151
  import { jsx as jsx131 } from "react/jsx-runtime";
@@ -10003,7 +10164,7 @@ function AreaChart({
10003
10164
  }) {
10004
10165
  const option = buildAreaOption(
10005
10166
  { data, xKey, yKeys, stacked, fillOpacity, colors, title },
10006
- getChartTheme()
10167
+ useChartTheme()
10007
10168
  );
10008
10169
  return /* @__PURE__ */ jsx131(
10009
10170
  EChartBase,
@@ -10034,7 +10195,7 @@ function BarChart2({
10034
10195
  }) {
10035
10196
  const option = buildBarOption(
10036
10197
  { data, yKey, yKeys: xKeys, stacked, colors, title },
10037
- getChartTheme()
10198
+ useChartTheme()
10038
10199
  );
10039
10200
  return /* @__PURE__ */ jsx132(
10040
10201
  EChartBase,
@@ -10066,7 +10227,7 @@ function BubbleChart({
10066
10227
  }) {
10067
10228
  const option = buildBubbleOption(
10068
10229
  { data, xKey, yKey, sizeKey, seriesKey, colors, title },
10069
- getChartTheme()
10230
+ useChartTheme()
10070
10231
  );
10071
10232
  return /* @__PURE__ */ jsx133(
10072
10233
  EChartBase,
@@ -10097,7 +10258,7 @@ function ColumnChart({
10097
10258
  }) {
10098
10259
  const option = buildColumnOption(
10099
10260
  { data, xKey, yKeys, stacked, colors, title },
10100
- getChartTheme()
10261
+ useChartTheme()
10101
10262
  );
10102
10263
  return /* @__PURE__ */ jsx134(
10103
10264
  EChartBase,
@@ -10127,7 +10288,7 @@ function ComposedChart({
10127
10288
  }) {
10128
10289
  const option = buildComposedOption(
10129
10290
  { data, xKey, series, colors, title },
10130
- getChartTheme()
10291
+ useChartTheme()
10131
10292
  );
10132
10293
  return /* @__PURE__ */ jsx135(
10133
10294
  EChartBase,
@@ -10173,7 +10334,7 @@ function DonutChart({
10173
10334
  colors,
10174
10335
  title
10175
10336
  },
10176
- getChartTheme()
10337
+ useChartTheme()
10177
10338
  );
10178
10339
  return /* @__PURE__ */ jsx136(
10179
10340
  EChartBase,
@@ -10204,7 +10365,7 @@ function FunnelChart2({
10204
10365
  }) {
10205
10366
  const option = buildFunnelOption(
10206
10367
  { data, nameKey, valueKey, sort, colors, title },
10207
- getChartTheme()
10368
+ useChartTheme()
10208
10369
  );
10209
10370
  return /* @__PURE__ */ jsx137(
10210
10371
  EChartBase,
@@ -10235,7 +10396,7 @@ function GaugeChart2({
10235
10396
  }) {
10236
10397
  const option = buildGaugeOption(
10237
10398
  { value, min, max, thresholds, unit, title },
10238
- getChartTheme()
10399
+ useChartTheme()
10239
10400
  );
10240
10401
  return /* @__PURE__ */ jsx138(
10241
10402
  EChartBase,
@@ -10265,7 +10426,7 @@ function Heatmap({
10265
10426
  }) {
10266
10427
  const option = buildHeatmapOption(
10267
10428
  { data, xKey, yKey, valueKey, title },
10268
- getChartTheme()
10429
+ useChartTheme()
10269
10430
  );
10270
10431
  return /* @__PURE__ */ jsx139(
10271
10432
  EChartBase,
@@ -10298,7 +10459,7 @@ function LineChart2({
10298
10459
  }) {
10299
10460
  const option = buildLineOption(
10300
10461
  { data, xKey, yKeys, smooth, showArea, stacked, colors, title },
10301
- getChartTheme()
10462
+ useChartTheme()
10302
10463
  );
10303
10464
  return /* @__PURE__ */ jsx140(
10304
10465
  EChartBase,
@@ -10314,7 +10475,7 @@ function LineChart2({
10314
10475
  }
10315
10476
 
10316
10477
  // src/components/chart/MapChart/index.tsx
10317
- import { useEffect as useEffect37, useState as useState46 } from "react";
10478
+ import { useEffect as useEffect38, useState as useState46 } from "react";
10318
10479
  import { jsx as jsx141 } from "react/jsx-runtime";
10319
10480
  var fetchedMaps = /* @__PURE__ */ new Set();
10320
10481
  function hasRegisteredMap(mapName) {
@@ -10337,6 +10498,7 @@ function MapChart2({
10337
10498
  className,
10338
10499
  style
10339
10500
  }) {
10501
+ const theme = useChartTheme();
10340
10502
  const [loadState, setLoadState] = useState46(
10341
10503
  () => geoJson || !geoJsonUrl || hasRegisteredMap(mapName) ? "idle" : "loading"
10342
10504
  );
@@ -10346,7 +10508,7 @@ function MapChart2({
10346
10508
  } catch {
10347
10509
  }
10348
10510
  }
10349
- useEffect37(() => {
10511
+ useEffect38(() => {
10350
10512
  if (geoJson || !geoJsonUrl || hasRegisteredMap(mapName) || fetchedMaps.has(mapName)) {
10351
10513
  setLoadState("idle");
10352
10514
  return;
@@ -10403,7 +10565,7 @@ function MapChart2({
10403
10565
  }
10404
10566
  );
10405
10567
  }
10406
- const option = buildMapOption({ mapName, data, nameKey, valueKey, title }, getChartTheme());
10568
+ const option = buildMapOption({ mapName, data, nameKey, valueKey, title }, theme);
10407
10569
  return /* @__PURE__ */ jsx141(
10408
10570
  EChartBase,
10409
10571
  {
@@ -10490,7 +10652,7 @@ function PieChart2({
10490
10652
  }) {
10491
10653
  const option = buildPieOption(
10492
10654
  { data, nameKey, valueKey, showLabel, colors, title },
10493
- getChartTheme()
10655
+ useChartTheme()
10494
10656
  );
10495
10657
  return /* @__PURE__ */ jsx143(
10496
10658
  EChartBase,
@@ -10520,7 +10682,7 @@ function RadarChart2({
10520
10682
  }) {
10521
10683
  const option = buildRadarOption(
10522
10684
  { data, indicatorKey, yKeys, colors, title },
10523
- getChartTheme()
10685
+ useChartTheme()
10524
10686
  );
10525
10687
  return /* @__PURE__ */ jsx144(
10526
10688
  EChartBase,
@@ -10546,7 +10708,7 @@ function SankeyChart2({
10546
10708
  className,
10547
10709
  style
10548
10710
  }) {
10549
- const option = buildSankeyOption({ nodes, links, title }, getChartTheme());
10711
+ const option = buildSankeyOption({ nodes, links, title }, useChartTheme());
10550
10712
  return /* @__PURE__ */ jsx145(
10551
10713
  EChartBase,
10552
10714
  {
@@ -10576,7 +10738,7 @@ function ScatterChart2({
10576
10738
  }) {
10577
10739
  const option = buildScatterOption(
10578
10740
  { data, xKey, yKey, seriesKey, colors, title },
10579
- getChartTheme()
10741
+ useChartTheme()
10580
10742
  );
10581
10743
  return /* @__PURE__ */ jsx146(
10582
10744
  EChartBase,
@@ -10606,7 +10768,7 @@ function TreeChart2({
10606
10768
  }) {
10607
10769
  const option = buildTreeOption(
10608
10770
  { data, title, orient, edgeShape, initialTreeDepth },
10609
- getChartTheme()
10771
+ useChartTheme()
10610
10772
  );
10611
10773
  return /* @__PURE__ */ jsx147(
10612
10774
  EChartBase,