@fses/workbench-app 0.3.1 → 0.3.3

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.
Files changed (26) hide show
  1. package/WORKBENCH-CLOSURE.json +12 -12
  2. package/dist/{WorkbenchCardCenterDrawer-CNSq1coL.js → WorkbenchCardCenterDrawer-DMo5dpdg.js} +2 -2
  3. package/dist/{WorkbenchDiagnosticsFooter-DlRWlL9q.js → WorkbenchDiagnosticsFooter-DsZcWn7r.js} +1 -1
  4. package/dist/{WorkbenchDiagnosticsPage-CeXZkp9k.js → WorkbenchDiagnosticsPage-o-S-VCI4.js} +1 -1
  5. package/dist/{Workspace-562qQHC3.js → Workspace-D9n6dCC6.js} +8975 -8966
  6. package/dist/{customCardCatalog-DhntP1Sk.js → customCardCatalog-CSmqz_Lg.js} +1 -1
  7. package/dist/fses-workbench-app.js +2 -2
  8. package/dist/{index-p9gr-rM0.js → index-B_FhbxRB.js} +5 -5
  9. package/dist/internal/personal-workbench/components/workbench/WorkbenchStudio.vue.d.ts +4 -2
  10. package/dist/internal/personal-workbench/lib/deepAgentApi.d.ts +1 -0
  11. package/dist/internal/personal-workbench/lib/deepAgentQueueState.d.ts +8 -0
  12. package/dist/internal/personal-workbench/vue-types/workbenchRuntime.d.ts +2 -1
  13. package/dist/runtime/conversation/workbenchChatStop.d.ts +37 -0
  14. package/dist/runtime/index.js +1 -1
  15. package/dist/style.css +1 -1
  16. package/dist/{useWorkbenchRuntime-DJujrl4a.js → useWorkbenchRuntime-BDVKnPln.js} +7546 -7419
  17. package/dist/version.d.ts +1 -1
  18. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +4632 -4540
  19. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +19 -16
  20. package/node_modules/@fses/ai-chat/dist/style.css +1 -1
  21. package/node_modules/@fses/ai-chat/package.json +3 -3
  22. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +3082 -3055
  23. package/node_modules/@fses/workbench-card/package.json +1 -1
  24. package/node_modules/@fses/workbench-card/src/renderers/chart/useEchart.ts +44 -5
  25. package/node_modules/@fses/workbench-card/src/renderers/useWorkbenchBlockRendererBindings.ts +9 -0
  26. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fses/workbench-card",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -580,13 +580,14 @@ function recoverMissingCartesianCategoryAxis(option: EChartsOption, data: Displa
580
580
  /**
581
581
  * 判断 series 是否不依赖 ECharts 外部坐标系。
582
582
  * @param series - ECharts series 配置。
583
- * @returns 饼图、雷达图、漏斗图和仪表盘返回 true。
583
+ * @returns 饼图、雷达图、漏斗图、仪表盘和树图返回 true。
584
584
  */
585
585
  function isCoordinateFreeRuntimeSeries(series: Record<string, unknown>): boolean {
586
586
  return series.type === 'pie'
587
587
  || series.type === 'radar'
588
588
  || series.type === 'funnel'
589
- || series.type === 'gauge';
589
+ || series.type === 'gauge'
590
+ || series.type === 'tree';
590
591
  }
591
592
 
592
593
  /**
@@ -654,6 +655,42 @@ function sanitizeCoordinateFreeRuntimeOption(option: EChartsOption): EChartsOpti
654
655
  return next as EChartsOption;
655
656
  }
656
657
 
658
+ /**
659
+ * 将刷新链路产生的多个无子级树节点重新收敛为单根树。
660
+ * @param option - 候选 ECharts option。
661
+ * @returns 满足 ECharts 树图单根布局约束的 option。
662
+ */
663
+ function normalizeRuntimeTreeRoots(option: EChartsOption): EChartsOption {
664
+ const rawSeries = objectValue(option, 'series');
665
+ const hasSeriesArray = Array.isArray(rawSeries);
666
+ const seriesItems = hasSeriesArray
667
+ ? rawSeries.filter(isRecord)
668
+ : isRecord(rawSeries)
669
+ ? [rawSeries]
670
+ : [];
671
+ let changed = false;
672
+ const normalizedSeries = seriesItems.map((series) => {
673
+ const rawNodes = Array.isArray(series.data) ? series.data : [];
674
+ const nodes = rawNodes.filter(isRecord);
675
+ const hasMultipleLeafRoots = series.type === 'tree'
676
+ && nodes.length > 1
677
+ && nodes.length === rawNodes.length
678
+ && nodes.every(node => !Array.isArray(node.children) || node.children.length === 0);
679
+ if (!hasMultipleLeafRoots) return series;
680
+ changed = true;
681
+ const rootName = typeof series.name === 'string' ? series.name.trim() : '';
682
+ return {
683
+ ...series,
684
+ data: [{ name: rootName, children: nodes }],
685
+ };
686
+ });
687
+ if (!changed) return option;
688
+ return {
689
+ ...option,
690
+ series: hasSeriesArray ? normalizedSeries : normalizedSeries[0],
691
+ } as EChartsOption;
692
+ }
693
+
657
694
  /**
658
695
  * 判断 ECharts option 是否使用极坐标系。
659
696
  * @param option - 候选 ECharts option。
@@ -899,9 +936,11 @@ function withRuntimeMetricRowContexts(option: EChartsOption, data: DisplayBlockD
899
936
  function normalizeRuntimeEchartsOption(option: EChartsOption, data: DisplayBlockData): EChartsOption {
900
937
  return normalizeSharedWorkbenchChartDisplayDefaults(withRuntimeMetricRowContexts(removeRuntimeEchartsChrome(
901
938
  normalizeEchartsOptionPieLegend(
902
- sanitizeCoordinateFreeRuntimeOption(
903
- sanitizePolarRuntimeOption(
904
- recoverMissingCartesianCategoryAxis(option, data),
939
+ normalizeRuntimeTreeRoots(
940
+ sanitizeCoordinateFreeRuntimeOption(
941
+ sanitizePolarRuntimeOption(
942
+ recoverMissingCartesianCategoryAxis(option, data),
943
+ ),
905
944
  ),
906
945
  ),
907
946
  ),
@@ -44,6 +44,8 @@ import type {
44
44
  } from '../types';
45
45
 
46
46
  type WorkbenchAntTableRow = Record<string, unknown> & { __rowKey: string };
47
+ const TABLE_ROWS_ITEMS_PER_PAGE_LOCALE_KEY = 'FWC.73d31788512273185';
48
+ const LEGACY_ITEMS_PER_PAGE_LOCALE_KEY = 'FWA.0b461787571579671';
47
49
 
48
50
  export interface WorkbenchBlockRendererProps {
49
51
  block: MaterializedBlock;
@@ -782,12 +784,19 @@ export function useWorkbenchBlockRendererBindings(
782
784
  */
783
785
  function tableRowsPaginationConfig(data: DisplayBlockData | undefined): false | TablePaginationConfig {
784
786
  if (!data || data.shape !== 'rows' || !data.pagination) return false;
787
+ const localizedItemsPerPage = getLocaleText(TABLE_ROWS_ITEMS_PER_PAGE_LOCALE_KEY);
785
788
  return {
786
789
  current: data.pagination.pageIndex,
787
790
  pageSize: data.pagination.pageSize,
788
791
  total: data.pagination.total,
789
792
  showSizeChanger: true,
790
793
  pageSizeOptions: ['10', '20', '50'],
794
+ locale: {
795
+ // 语言平台词条与卡片包可能分批发布,复用工作台已有词条避免短暂显示资源键。
796
+ items_per_page: localizedItemsPerPage === TABLE_ROWS_ITEMS_PER_PAGE_LOCALE_KEY
797
+ ? getLocaleText(LEGACY_ITEMS_PER_PAGE_LOCALE_KEY)
798
+ : localizedItemsPerPage,
799
+ },
791
800
  showLessItems: true,
792
801
  disabled: tableRowsPageLoading.value,
793
802
  position: ['bottomRight'],
package/package.json CHANGED
@@ -11,8 +11,8 @@
11
11
  "@byteluck-fe/workbench-template": "0.1.1",
12
12
  "@byteluck/agentic-protocol": "2.2.1",
13
13
  "@byteluck/workbench-skill-contracts": "0.1.0",
14
- "@fses/ai-chat": "2.0.1",
15
- "@fses/workbench-card": "0.4.1",
14
+ "@fses/ai-chat": "2.0.3",
15
+ "@fses/workbench-card": "0.4.3",
16
16
  "@microsoft/fetch-event-source": "2.0.1",
17
17
  "axios": "^1.15.0",
18
18
  "clsx": "^2.1.1",
@@ -151,5 +151,5 @@
151
151
  },
152
152
  "type": "module",
153
153
  "types": "./dist/index.d.ts",
154
- "version": "0.3.1"
154
+ "version": "0.3.3"
155
155
  }