@antdv-next/x 1.2.1-beta.1 → 1.2.2

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 (102) hide show
  1. package/dist/attachments/index.js +1 -2
  2. package/dist/code-highlighter/style/index.d.ts +51 -19
  3. package/dist/code-highlighter/style/index.js +44 -31
  4. package/dist/index.umd.js +133 -52
  5. package/dist/package.js +1 -1
  6. package/dist/sender/hooks/use-speech.js +1 -2
  7. package/dist/suggestion/Suggestion.js +37 -6
  8. package/dist/suggestion/useActive.d.ts +1 -1
  9. package/dist/suggestion/useActive.js +44 -2
  10. package/dist/theme/util/alias.js +5 -5
  11. package/dist/think/Think.js +2 -3
  12. package/dist/thought-chain/Node.js +2 -3
  13. package/dist/x-provider/index.js +2 -3
  14. package/es/{_basePickBy-CrbncDqR.js → _basePickBy-BL4DHvHb.js} +1 -1
  15. package/es/{_baseUniq-B-qU_Imh.js → _baseUniq-CyFYmJd-.js} +7 -7
  16. package/es/antdv-next-x.esm.js +374 -335
  17. package/es/architecture-PBZL5I3N-M9p1teRv.js +3 -0
  18. package/es/{architectureDiagram-2XIMDMQ5-OvuktNfv.js → architectureDiagram-2XIMDMQ5-zW5aGalx.js} +99 -89
  19. package/es/{blockDiagram-WCTKOSBZ-CS-kh74L.js → blockDiagram-WCTKOSBZ-0QujSG-h.js} +36 -33
  20. package/es/{c4Diagram-IC4MRINW-BZGIF4Dk.js → c4Diagram-IC4MRINW-B7y07WFn.js} +24 -16
  21. package/es/{channel-DrSSYyxp.js → channel-CxLj88Pg.js} +1 -1
  22. package/es/{chunk-4BX2VUAB-Rm8-te6i.js → chunk-4BX2VUAB-CprgMM4u.js} +1 -1
  23. package/es/{chunk-55IACEB6-Tre45n-8.js → chunk-55IACEB6-BpkEkHy8.js} +1 -1
  24. package/es/{chunk-7R4GIKGN-scch4dXY.js → chunk-7R4GIKGN-mKY502R8.js} +6 -4
  25. package/es/{chunk-FMBD7UC4-JmekSPZP.js → chunk-FMBD7UC4-B88neS61.js} +1 -1
  26. package/es/{chunk-GEFDOKGD-BEzc6NZw.js → chunk-GEFDOKGD-oBEpn5hN.js} +67 -27
  27. package/es/chunk-GLR3WWYH-B2D9kjtF.js +41 -0
  28. package/es/chunk-HHEYEP7N-DcZkCke2.js +9 -0
  29. package/es/{chunk-JSJVCQXG-_l_UVbaa.js → chunk-JSJVCQXG-BbVOaXjl.js} +3 -3
  30. package/es/{chunk-KX2RTZJC-BUWM8pJz.js → chunk-KX2RTZJC-Dw3D7Wrw.js} +2 -2
  31. package/es/{chunk-KYZI473N-BSgb_E0Q.js → chunk-KYZI473N-33-uii7Y.js} +10 -10
  32. package/es/{chunk-MX3YWQON-D602L8pU.js → chunk-MX3YWQON-D4cz36rq.js} +1 -1
  33. package/es/{chunk-NQ4KR5QH-BPQV0i93.js → chunk-NQ4KR5QH-CprADZhD.js} +44 -40
  34. package/es/{chunk-O4XLMI2P-BMqc3iYa.js → chunk-O4XLMI2P-DBAvycZ-.js} +13 -14
  35. package/es/{chunk-PQ6SQG4A-DcYrzB1X.js → chunk-PQ6SQG4A-BITIwHAS.js} +2 -2
  36. package/es/{chunk-PU5JKC2W-TuGY6X1n.js → chunk-PU5JKC2W-DIl8TkGX.js} +22 -26
  37. package/es/{chunk-QZHKN3VN-CKbD02cl.js → chunk-QZHKN3VN-Cg0ROtzE.js} +1 -1
  38. package/es/{chunk-WL4C6EOR-B31ErTFp.js → chunk-WL4C6EOR-Bhp_3T_o.js} +15 -15
  39. package/es/chunk-XPW4576I-255j2Rgd.js +1146 -0
  40. package/es/{chunk-XZSTWKYB-DYKLwCEy.js → chunk-XZSTWKYB-kjAdbx6i.js} +266 -321
  41. package/es/{chunk-YBOYWFTD-CRiKEIiS.js → chunk-YBOYWFTD-C2IdGsg8.js} +5 -5
  42. package/es/classDiagram-VBA2DB6C-BQonl2jX.js +29 -0
  43. package/es/classDiagram-v2-RAHNMMFH-C9U3lqTc.js +29 -0
  44. package/es/{clone-yzFtXY5G.js → clone-DIGEZsKS.js} +1 -1
  45. package/es/{cose-bilkent-S5V4N54A-BM90wTBk.js → cose-bilkent-S5V4N54A-Cyxewg9z.js} +36 -31
  46. package/es/{cytoscape.esm-B_-hKv4-.js → cytoscape.esm-DBPri10E.js} +197 -155
  47. package/es/{dagre-DCYVBij1.js → dagre-BHOjJWBG.js} +26 -24
  48. package/es/{dagre-KLK3FWXG-Ced70SgJ.js → dagre-KLK3FWXG-CnJPDj7X.js} +17 -18
  49. package/es/{defaultLocale-yzzuPw6P.js → defaultLocale-aSMWOJHq.js} +4 -1
  50. package/es/{diagram-E7M64L7V-xZCloH_i.js → diagram-E7M64L7V-CBOCgbMd.js} +22 -24
  51. package/es/{diagram-IFDJBPK2-BTmFZhvz.js → diagram-IFDJBPK2-BtubJp0H.js} +11 -11
  52. package/es/{diagram-P4PSJMXO-DX_3B0LB.js → diagram-P4PSJMXO-CI30BBYG.js} +10 -10
  53. package/es/{dist-h4ggShny.js → dist-BpM0Gz7z.js} +1 -1
  54. package/es/{erDiagram-INFDFZHY-MJ_HVY-7.js → erDiagram-INFDFZHY-C8hYuPxm.js} +21 -21
  55. package/es/{flowDiagram-PKNHOUZH-CQIRy1sx.js → flowDiagram-PKNHOUZH-D5vrDkks.js} +40 -33
  56. package/es/{ganttDiagram-A5KZAMGK-Dw9bjWjx.js → ganttDiagram-A5KZAMGK-BmIEQBGq.js} +33 -21
  57. package/es/gitGraph-HDMCJU4V-x8fnR2OX.js +3 -0
  58. package/es/{gitGraphDiagram-K3NZZRJ6-Gk6FiGbZ.js → gitGraphDiagram-K3NZZRJ6-PO0pMJD3.js} +7 -7
  59. package/es/{graphlib-BMvIh7N7.js → graphlib-DqWOhV4K.js} +2 -2
  60. package/es/info-3K5VOQVL-CRBCVSej.js +3 -0
  61. package/es/{infoDiagram-LFFYTUFH-CS64-uil.js → infoDiagram-LFFYTUFH-DOcKfbXf.js} +4 -4
  62. package/es/{init-sjaVZO3f.js → init-Co4dhKfe.js} +3 -1
  63. package/es/isEmpty-BJdINx-6.js +35 -0
  64. package/es/{ishikawaDiagram-PHBUUO56-C_Hw5UnV.js → ishikawaDiagram-PHBUUO56-DM1elxPS.js} +12 -12
  65. package/es/{journeyDiagram-4ABVD52K-CFFyM4Ar.js → journeyDiagram-4ABVD52K-BnYWOH1P.js} +11 -11
  66. package/es/{kanban-definition-K7BYSVSG-B_R-mA10.js → kanban-definition-K7BYSVSG-Ys7nAs7y.js} +27 -26
  67. package/es/{katex-C-qdUNlg.js → katex-olkKUfKs.js} +52 -62
  68. package/es/{line-D05MESIS.js → line-Cm2n2y9Z.js} +1 -1
  69. package/es/{linear-B8tPH2Pw.js → linear-D-yDc6KG.js} +6 -4
  70. package/es/{mermaid-parser.core-C_69nk7j.js → mermaid-parser.core-DFgQn74w.js} +8 -8
  71. package/es/mermaid.core-BzgA0NbC.js +680 -0
  72. package/es/{mindmap-definition-YRQLILUH-qgGUYYe3.js → mindmap-definition-YRQLILUH-Ca8psfLi.js} +26 -24
  73. package/es/{ordinal-CNQzPcrr.js → ordinal-95c16pGC.js} +1 -1
  74. package/es/packet-RMMSAZCW-CyE-elPF.js +3 -0
  75. package/es/pie-UPGHQEXC-EfdQ-_OF.js +3 -0
  76. package/es/{pieDiagram-SKSYHLDU-B8-AVOmP.js → pieDiagram-SKSYHLDU-DhQSMJCw.js} +11 -11
  77. package/es/{quadrantDiagram-337W2JSQ-C2Z0CN4Z.js → quadrantDiagram-337W2JSQ-jOtIC8r0.js} +9 -9
  78. package/es/radar-KQ55EAFF-B68vkNB4.js +3 -0
  79. package/es/{requirementDiagram-Z7DCOOCP-Cdj7PwWC.js → requirementDiagram-Z7DCOOCP-CNngzPE4.js} +18 -18
  80. package/es/{rolldown-runtime-CEY2VRuR.js → rolldown-runtime-Dv1pqm0U.js} +2 -2
  81. package/es/{sankeyDiagram-WA2Y5GQK-BNmU-dM1.js → sankeyDiagram-WA2Y5GQK-BgsyVNdD.js} +9 -9
  82. package/es/{sequenceDiagram-2WXFIKYE-pj0uPf22.js → sequenceDiagram-2WXFIKYE-BAc5PP9P.js} +46 -34
  83. package/es/{shiki-runtime-7QG17np_.js → shiki-runtime-BlKUZiZP.js} +41 -44
  84. package/es/{src-Dynw_Lub.js → src-3T61hYex.js} +1 -1
  85. package/es/{stateDiagram-RAJIS63D-BgCfMnGb.js → stateDiagram-RAJIS63D-153LjStx.js} +18 -18
  86. package/es/stateDiagram-v2-FVOUBMTO-BXEvy1YD.js +27 -0
  87. package/es/{timeline-definition-YZTLITO2-Bj5QKnBI.js → timeline-definition-YZTLITO2-BLhlkb_X.js} +8 -8
  88. package/es/treemap-KZPCXAKY-Dg_ShzRB.js +3 -0
  89. package/es/{vennDiagram-LZ73GAT5-lpWcIvN6.js → vennDiagram-LZ73GAT5-BTYWphmf.js} +13 -13
  90. package/es/{xychartDiagram-JWTSCODW-De1M-7Yz.js → xychartDiagram-JWTSCODW-B9Nlu6S_.js} +29 -25
  91. package/package.json +1 -1
  92. package/es/architecture-PBZL5I3N-BRGGaMu3.js +0 -3
  93. package/es/classDiagram-VBA2DB6C-BDqwxUdU.js +0 -29
  94. package/es/classDiagram-v2-RAHNMMFH-DdmOjeUb.js +0 -29
  95. package/es/gitGraph-HDMCJU4V-oForq_Vw.js +0 -3
  96. package/es/info-3K5VOQVL-0F-ZLEMx.js +0 -3
  97. package/es/mermaid.core-BVGVwWcu.js +0 -1914
  98. package/es/packet-RMMSAZCW-CeqtQQ_e.js +0 -3
  99. package/es/pie-UPGHQEXC-BI60FhK4.js +0 -3
  100. package/es/radar-KQ55EAFF-CRwOOFw0.js +0 -3
  101. package/es/stateDiagram-v2-FVOUBMTO-ByMhP6Xo.js +0 -27
  102. package/es/treemap-KZPCXAKY-BlOAFUbR.js +0 -3
@@ -205,10 +205,9 @@ var XAttachments = /* @__PURE__ */ defineComponent({
205
205
  }
206
206
  });
207
207
  const getPlaceholderNode = (type, options) => {
208
- const placeholderContent = typeof props.placeholder === "function" ? props.placeholder(type) : props.placeholder;
209
208
  return createVNode(PlaceholderUploader, {
210
209
  "type": type,
211
- "placeholder": placeholderContent,
210
+ "placeholder": typeof props.placeholder === "function" ? props.placeholder(type) : props.placeholder,
212
211
  "upload": uploadProps.value,
213
212
  "prefixCls": props.prefixCls,
214
213
  "class": mergedClasses.value.placeholder,
@@ -1,51 +1,83 @@
1
1
  import { FullToken, GetDefaultToken } from '../../theme/interface';
2
2
  export interface ComponentToken {
3
3
  /**
4
- * 代码字体
4
+ * @desc 标题背景颜色
5
+ * @descEN Title background color
5
6
  */
6
- codeFontFamily?: string;
7
+ colorBgTitle?: string;
7
8
  /**
8
- * 代码字体大小
9
+ * @desc 暗色主题下标题背景颜色
10
+ * @descEN Title background color in dark theme
9
11
  */
10
- codeFontSize?: number;
12
+ colorBgTitleDark?: string;
11
13
  /**
12
- * 亮色主题下的代码文字颜色,用于语言未命中高亮时的降级文本
14
+ * @desc 标题文本颜色
15
+ * @descEN Title text color
13
16
  */
14
- codeColor?: string;
17
+ colorTextTitle?: string;
15
18
  /**
16
- * 暗色主题下的代码文字颜色,用于语言未命中高亮时的降级文本
19
+ * @desc 暗色主题下标题文本颜色
20
+ * @descEN Title text color in dark theme
17
21
  */
18
- codeColorDark?: string;
22
+ colorTextTitleDark?: string;
23
+ /**
24
+ * @desc 代码块边框颜色
25
+ * @descEN Code block border color
26
+ */
27
+ colorBorderCode?: string;
28
+ /**
29
+ * @desc 暗色主题下代码块边框颜色
30
+ * @descEN Code block border color in dark theme
31
+ */
32
+ colorBorderCodeDark?: string;
19
33
  /**
20
- * 亮色主题下代码区与行号栏的背景色
34
+ * @desc 代码区与行号栏背景色
35
+ * @descEN Background of the code area and gutter
21
36
  */
22
37
  codeBg?: string;
23
38
  /**
24
- * 暗色主题下代码区与行号栏的背景色
39
+ * @desc 暗色主题下代码区与行号栏背景色
40
+ * @descEN Background of the code area and gutter in dark theme
25
41
  */
26
42
  codeBgDark?: string;
27
43
  /**
28
- * 暗色主题下头部区域的背景色
44
+ * @desc 代码文字颜色(语言未命中高亮时降级)
45
+ * @descEN Code text color (fallback when language is not highlighted)
29
46
  */
30
- codeHeaderBgDark?: string;
47
+ codeColor?: string;
31
48
  /**
32
- * 暗色主题下头部与行号栏的分隔线颜色
49
+ * @desc 暗色主题下代码文字颜色(语言未命中高亮时降级)
50
+ * @descEN Code text color in dark theme (fallback when language is not highlighted)
33
51
  */
34
- codeBorderColorDark?: string;
52
+ codeColorDark?: string;
35
53
  /**
36
- * 暗色主题下语言标签的文字颜色
54
+ * @desc 行号文字颜色
55
+ * @descEN Line number color
37
56
  */
38
- codeLangColorDark?: string;
57
+ codeLineNumberColor?: string;
39
58
  /**
40
- * 暗色主题下行号的文字颜色
59
+ * @desc 暗色主题下行号文字颜色
60
+ * @descEN Line number color in dark theme
41
61
  */
42
62
  codeLineNumberColorDark?: string;
43
63
  /**
44
- * 暗色主题下头部操作按钮的文字颜色
64
+ * @desc 操作按钮文字颜色
65
+ * @descEN Action button color
66
+ */
67
+ codeBtnColor?: string;
68
+ /**
69
+ * @desc 暗色主题下操作按钮文字颜色
70
+ * @descEN Action button color in dark theme
45
71
  */
46
72
  codeBtnColorDark?: string;
47
73
  /**
48
- * 暗色主题下头部操作按钮悬浮态的背景色
74
+ * @desc 操作按钮悬浮背景色
75
+ * @descEN Action button hover background
76
+ */
77
+ codeBtnHoverBg?: string;
78
+ /**
79
+ * @desc 暗色主题下操作按钮悬浮背景色
80
+ * @descEN Action button hover background in dark theme
49
81
  */
50
82
  codeBtnHoverBgDark?: string;
51
83
  }
@@ -1,6 +1,7 @@
1
1
  import { genStyleHooks } from "../../theme/genStyleUtils.js";
2
2
  import { unit } from "@antdv-next/cssinjs";
3
3
  import { mergeToken } from "@antdv-next/cssinjs/cssinjs-utils";
4
+ import { FastColor } from "@ant-design/fast-color";
4
5
  //#region components/code-highlighter/style/index.ts
5
6
  var genCodeHighlighterStyle = (token) => {
6
7
  const { componentCls } = token;
@@ -8,21 +9,20 @@ var genCodeHighlighterStyle = (token) => {
8
9
  position: "relative",
9
10
  borderRadius: token.borderRadiusLG,
10
11
  overflow: "hidden",
11
- fontFamily: token.fontFamily,
12
12
  fontSize: token.fontSize,
13
- border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`,
13
+ border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderCode}`,
14
14
  [`${componentCls}-header`]: {
15
15
  display: "flex",
16
16
  alignItems: "center",
17
17
  justifyContent: "space-between",
18
18
  paddingInline: unit(token.paddingSM),
19
19
  paddingBlock: 4,
20
- borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`,
21
- backgroundColor: token.colorFillSecondary
20
+ borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderCode}`,
21
+ backgroundColor: token.colorBgTitle
22
22
  },
23
23
  [`${componentCls}-lang`]: {
24
24
  fontSize: token.fontSizeSM,
25
- color: token.colorTextSecondary,
25
+ color: token.colorTextTitle,
26
26
  fontWeight: 500,
27
27
  textTransform: "capitalize"
28
28
  },
@@ -31,7 +31,13 @@ var genCodeHighlighterStyle = (token) => {
31
31
  alignItems: "center",
32
32
  gap: token.paddingXXS
33
33
  },
34
- [`${componentCls}-theme-btn, ${componentCls}-copy-btn`]: { color: token.colorTextSecondary },
34
+ [`${componentCls}-theme-btn, ${componentCls}-copy-btn`]: {
35
+ color: `${token.codeBtnColor} !important`,
36
+ "&:hover, &:focus": {
37
+ color: `${token.codeBtnColor} !important`,
38
+ backgroundColor: `${token.codeBtnHoverBg} !important`
39
+ }
40
+ },
35
41
  [`${componentCls}-content`]: {
36
42
  display: "flex",
37
43
  overflow: "auto",
@@ -43,18 +49,18 @@ var genCodeHighlighterStyle = (token) => {
43
49
  paddingInline: unit(token.paddingXS),
44
50
  textAlign: "right",
45
51
  backgroundColor: token.codeBg,
46
- borderRight: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`,
52
+ borderRight: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderCode}`,
47
53
  userSelect: "none",
48
54
  flexShrink: 0,
49
55
  minWidth: "3em",
50
56
  lineHeight: "1.5em"
51
57
  },
52
58
  [`${componentCls}-line-number`]: {
53
- fontFamily: token.codeFontFamily,
54
- fontSize: unit(token.codeFontSize ?? 13),
59
+ fontFamily: token.fontFamilyCode,
60
+ fontSize: unit(token.fontSize),
55
61
  lineHeight: "1.5em",
56
62
  height: "1.5em",
57
- color: token.colorTextQuaternary,
63
+ color: token.codeLineNumberColor,
58
64
  display: "flex",
59
65
  alignItems: "center",
60
66
  justifyContent: "flex-end",
@@ -68,8 +74,8 @@ var genCodeHighlighterStyle = (token) => {
68
74
  margin: 0,
69
75
  padding: unit(token.paddingSM),
70
76
  backgroundColor: "transparent !important",
71
- fontFamily: token.codeFontFamily,
72
- fontSize: unit(token.codeFontSize ?? 13),
77
+ fontFamily: token.fontFamilyCode,
78
+ fontSize: unit(token.fontSize),
73
79
  lineHeight: "1.5em",
74
80
  overflow: "visible"
75
81
  },
@@ -82,12 +88,12 @@ var genCodeHighlighterStyle = (token) => {
82
88
  }
83
89
  },
84
90
  [`&${componentCls}-dark`]: {
85
- borderColor: token.colorBorder,
91
+ borderColor: token.colorBorderCodeDark,
86
92
  [`${componentCls}-header`]: {
87
- backgroundColor: token.codeHeaderBgDark,
88
- borderBottomColor: token.codeBorderColorDark
93
+ backgroundColor: token.colorBgTitleDark,
94
+ borderBottomColor: token.colorBorderCodeDark
89
95
  },
90
- [`${componentCls}-lang`]: { color: token.codeLangColorDark },
96
+ [`${componentCls}-lang`]: { color: token.colorTextTitleDark },
91
97
  [`${componentCls}-theme-btn, ${componentCls}-copy-btn`]: {
92
98
  color: `${token.codeBtnColorDark} !important`,
93
99
  "&:hover, &:focus": {
@@ -98,27 +104,34 @@ var genCodeHighlighterStyle = (token) => {
98
104
  [`${componentCls}-content`]: { backgroundColor: token.codeBgDark },
99
105
  [`${componentCls}-line-numbers`]: {
100
106
  backgroundColor: token.codeBgDark,
101
- borderRightColor: token.codeBorderColorDark
107
+ borderRightColor: token.colorBorderCodeDark
102
108
  },
103
109
  [`${componentCls}-line-number`]: { color: token.codeLineNumberColorDark },
104
110
  [`${componentCls}-code`]: { color: token.codeColorDark }
105
111
  }
106
112
  } };
107
113
  };
108
- var prepareComponentToken = () => ({
109
- codeFontFamily: "'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace",
110
- codeFontSize: 14,
111
- codeColor: "#393a34",
112
- codeColorDark: "#dbd7caee",
113
- codeBg: "#fafafa",
114
- codeBgDark: "#1e1e1e",
115
- codeHeaderBgDark: "#252526",
116
- codeBorderColorDark: "#3e3e42",
117
- codeLangColorDark: "#cccccc",
118
- codeLineNumberColorDark: "#858585",
119
- codeBtnColorDark: "#ffffff",
120
- codeBtnHoverBgDark: "#3e3e42"
121
- });
114
+ var prepareComponentToken = (token) => {
115
+ const isDarkApp = new FastColor(token.colorBgContainer).isDark();
116
+ return {
117
+ colorBgTitle: isDarkApp ? "#f0f0f0" : token.colorFillContent,
118
+ colorTextTitle: isDarkApp ? "rgba(0, 0, 0, 0.65)" : token.colorText,
119
+ colorBorderCode: isDarkApp ? "#f0f0f0" : token.colorBorderSecondary,
120
+ codeColor: isDarkApp ? "#393a34" : token.colorText,
121
+ codeBg: isDarkApp ? "#fafafa" : token.colorBgLayout,
122
+ codeLineNumberColor: isDarkApp ? "rgba(0, 0, 0, 0.25)" : token.colorTextQuaternary,
123
+ codeBtnColor: isDarkApp ? "rgba(0, 0, 0, 0.65)" : token.colorTextSecondary,
124
+ codeBtnHoverBg: isDarkApp ? "rgba(0, 0, 0, 0.06)" : token.colorFillSecondary,
125
+ colorBgTitleDark: isDarkApp ? token.colorFillContent : "#252526",
126
+ colorTextTitleDark: isDarkApp ? token.colorText : "#cccccc",
127
+ colorBorderCodeDark: isDarkApp ? token.colorBorder : "#3e3e42",
128
+ codeColorDark: isDarkApp ? token.colorText : "#dbd7caee",
129
+ codeBgDark: isDarkApp ? token.colorBgElevated : "#1e1e1e",
130
+ codeLineNumberColorDark: isDarkApp ? token.colorTextQuaternary : "#858585",
131
+ codeBtnColorDark: isDarkApp ? token.colorText : "#ffffff",
132
+ codeBtnHoverBgDark: isDarkApp ? token.colorFillSecondary : "#3e3e42"
133
+ };
134
+ };
122
135
  var style_default = genStyleHooks("CodeHighlighter", (token) => {
123
136
  return [genCodeHighlighterStyle(mergeToken(token, {}))];
124
137
  }, prepareComponentToken);
package/dist/index.umd.js CHANGED
@@ -56,7 +56,7 @@
56
56
  }
57
57
  return to;
58
58
  };
59
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
59
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
60
60
  value: mod,
61
61
  enumerable: true
62
62
  }) : target, mod));
@@ -66,7 +66,7 @@
66
66
  shiki_dist_themes_vitesse_dark_mjs = __toESM(shiki_dist_themes_vitesse_dark_mjs, 1);
67
67
  shiki_dist_themes_vitesse_light_mjs = __toESM(shiki_dist_themes_vitesse_light_mjs, 1);
68
68
  //#region package.json
69
- var version = "1.2.1-beta.1";
69
+ var version = "1.2.2";
70
70
  //#endregion
71
71
  //#region components/x-provider/context.ts
72
72
  var XProviderContextKey = Symbol("antdv-next-x-provider-context");
@@ -3165,10 +3165,9 @@
3165
3165
  }
3166
3166
  });
3167
3167
  const getPlaceholderNode = (type, options) => {
3168
- const placeholderContent = typeof props.placeholder === "function" ? props.placeholder(type) : props.placeholder;
3169
3168
  return (0, vue.createVNode)(PlaceholderUploader, {
3170
3169
  "type": type,
3171
- "placeholder": placeholderContent,
3170
+ "placeholder": typeof props.placeholder === "function" ? props.placeholder(type) : props.placeholder,
3172
3171
  "upload": uploadProps.value,
3173
3172
  "prefixCls": props.prefixCls,
3174
3173
  "class": mergedClasses.value.placeholder,
@@ -4897,21 +4896,20 @@
4897
4896
  position: "relative",
4898
4897
  borderRadius: token.borderRadiusLG,
4899
4898
  overflow: "hidden",
4900
- fontFamily: token.fontFamily,
4901
4899
  fontSize: token.fontSize,
4902
- border: `${(0, _antdv_next_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`,
4900
+ border: `${(0, _antdv_next_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorderCode}`,
4903
4901
  [`${componentCls}-header`]: {
4904
4902
  display: "flex",
4905
4903
  alignItems: "center",
4906
4904
  justifyContent: "space-between",
4907
4905
  paddingInline: (0, _antdv_next_cssinjs.unit)(token.paddingSM),
4908
4906
  paddingBlock: 4,
4909
- borderBottom: `${(0, _antdv_next_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`,
4910
- backgroundColor: token.colorFillSecondary
4907
+ borderBottom: `${(0, _antdv_next_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorderCode}`,
4908
+ backgroundColor: token.colorBgTitle
4911
4909
  },
4912
4910
  [`${componentCls}-lang`]: {
4913
4911
  fontSize: token.fontSizeSM,
4914
- color: token.colorTextSecondary,
4912
+ color: token.colorTextTitle,
4915
4913
  fontWeight: 500,
4916
4914
  textTransform: "capitalize"
4917
4915
  },
@@ -4920,7 +4918,13 @@
4920
4918
  alignItems: "center",
4921
4919
  gap: token.paddingXXS
4922
4920
  },
4923
- [`${componentCls}-theme-btn, ${componentCls}-copy-btn`]: { color: token.colorTextSecondary },
4921
+ [`${componentCls}-theme-btn, ${componentCls}-copy-btn`]: {
4922
+ color: `${token.codeBtnColor} !important`,
4923
+ "&:hover, &:focus": {
4924
+ color: `${token.codeBtnColor} !important`,
4925
+ backgroundColor: `${token.codeBtnHoverBg} !important`
4926
+ }
4927
+ },
4924
4928
  [`${componentCls}-content`]: {
4925
4929
  display: "flex",
4926
4930
  overflow: "auto",
@@ -4932,18 +4936,18 @@
4932
4936
  paddingInline: (0, _antdv_next_cssinjs.unit)(token.paddingXS),
4933
4937
  textAlign: "right",
4934
4938
  backgroundColor: token.codeBg,
4935
- borderRight: `${(0, _antdv_next_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`,
4939
+ borderRight: `${(0, _antdv_next_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorderCode}`,
4936
4940
  userSelect: "none",
4937
4941
  flexShrink: 0,
4938
4942
  minWidth: "3em",
4939
4943
  lineHeight: "1.5em"
4940
4944
  },
4941
4945
  [`${componentCls}-line-number`]: {
4942
- fontFamily: token.codeFontFamily,
4943
- fontSize: (0, _antdv_next_cssinjs.unit)(token.codeFontSize ?? 13),
4946
+ fontFamily: token.fontFamilyCode,
4947
+ fontSize: (0, _antdv_next_cssinjs.unit)(token.fontSize),
4944
4948
  lineHeight: "1.5em",
4945
4949
  height: "1.5em",
4946
- color: token.colorTextQuaternary,
4950
+ color: token.codeLineNumberColor,
4947
4951
  display: "flex",
4948
4952
  alignItems: "center",
4949
4953
  justifyContent: "flex-end",
@@ -4957,8 +4961,8 @@
4957
4961
  margin: 0,
4958
4962
  padding: (0, _antdv_next_cssinjs.unit)(token.paddingSM),
4959
4963
  backgroundColor: "transparent !important",
4960
- fontFamily: token.codeFontFamily,
4961
- fontSize: (0, _antdv_next_cssinjs.unit)(token.codeFontSize ?? 13),
4964
+ fontFamily: token.fontFamilyCode,
4965
+ fontSize: (0, _antdv_next_cssinjs.unit)(token.fontSize),
4962
4966
  lineHeight: "1.5em",
4963
4967
  overflow: "visible"
4964
4968
  },
@@ -4971,12 +4975,12 @@
4971
4975
  }
4972
4976
  },
4973
4977
  [`&${componentCls}-dark`]: {
4974
- borderColor: token.colorBorder,
4978
+ borderColor: token.colorBorderCodeDark,
4975
4979
  [`${componentCls}-header`]: {
4976
- backgroundColor: token.codeHeaderBgDark,
4977
- borderBottomColor: token.codeBorderColorDark
4980
+ backgroundColor: token.colorBgTitleDark,
4981
+ borderBottomColor: token.colorBorderCodeDark
4978
4982
  },
4979
- [`${componentCls}-lang`]: { color: token.codeLangColorDark },
4983
+ [`${componentCls}-lang`]: { color: token.colorTextTitleDark },
4980
4984
  [`${componentCls}-theme-btn, ${componentCls}-copy-btn`]: {
4981
4985
  color: `${token.codeBtnColorDark} !important`,
4982
4986
  "&:hover, &:focus": {
@@ -4987,27 +4991,34 @@
4987
4991
  [`${componentCls}-content`]: { backgroundColor: token.codeBgDark },
4988
4992
  [`${componentCls}-line-numbers`]: {
4989
4993
  backgroundColor: token.codeBgDark,
4990
- borderRightColor: token.codeBorderColorDark
4994
+ borderRightColor: token.colorBorderCodeDark
4991
4995
  },
4992
4996
  [`${componentCls}-line-number`]: { color: token.codeLineNumberColorDark },
4993
4997
  [`${componentCls}-code`]: { color: token.codeColorDark }
4994
4998
  }
4995
4999
  } };
4996
5000
  };
4997
- var prepareComponentToken$10 = () => ({
4998
- codeFontFamily: "'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace",
4999
- codeFontSize: 14,
5000
- codeColor: "#393a34",
5001
- codeColorDark: "#dbd7caee",
5002
- codeBg: "#fafafa",
5003
- codeBgDark: "#1e1e1e",
5004
- codeHeaderBgDark: "#252526",
5005
- codeBorderColorDark: "#3e3e42",
5006
- codeLangColorDark: "#cccccc",
5007
- codeLineNumberColorDark: "#858585",
5008
- codeBtnColorDark: "#ffffff",
5009
- codeBtnHoverBgDark: "#3e3e42"
5010
- });
5001
+ var prepareComponentToken$10 = (token) => {
5002
+ const isDarkApp = new _ant_design_fast_color.FastColor(token.colorBgContainer).isDark();
5003
+ return {
5004
+ colorBgTitle: isDarkApp ? "#f0f0f0" : token.colorFillContent,
5005
+ colorTextTitle: isDarkApp ? "rgba(0, 0, 0, 0.65)" : token.colorText,
5006
+ colorBorderCode: isDarkApp ? "#f0f0f0" : token.colorBorderSecondary,
5007
+ codeColor: isDarkApp ? "#393a34" : token.colorText,
5008
+ codeBg: isDarkApp ? "#fafafa" : token.colorBgLayout,
5009
+ codeLineNumberColor: isDarkApp ? "rgba(0, 0, 0, 0.25)" : token.colorTextQuaternary,
5010
+ codeBtnColor: isDarkApp ? "rgba(0, 0, 0, 0.65)" : token.colorTextSecondary,
5011
+ codeBtnHoverBg: isDarkApp ? "rgba(0, 0, 0, 0.06)" : token.colorFillSecondary,
5012
+ colorBgTitleDark: isDarkApp ? token.colorFillContent : "#252526",
5013
+ colorTextTitleDark: isDarkApp ? token.colorText : "#cccccc",
5014
+ colorBorderCodeDark: isDarkApp ? token.colorBorder : "#3e3e42",
5015
+ codeColorDark: isDarkApp ? token.colorText : "#dbd7caee",
5016
+ codeBgDark: isDarkApp ? token.colorBgElevated : "#1e1e1e",
5017
+ codeLineNumberColorDark: isDarkApp ? token.colorTextQuaternary : "#858585",
5018
+ codeBtnColorDark: isDarkApp ? token.colorText : "#ffffff",
5019
+ codeBtnHoverBgDark: isDarkApp ? token.colorFillSecondary : "#3e3e42"
5020
+ };
5021
+ };
5011
5022
  var style_default$10 = genStyleHooks("CodeHighlighter", (token) => {
5012
5023
  return [genCodeHighlighterStyle((0, _antdv_next_cssinjs_cssinjs_utils.mergeToken)(token, {}))];
5013
5024
  }, prepareComponentToken$10);
@@ -10726,6 +10737,13 @@
10726
10737
  //#endregion
10727
10738
  //#region components/suggestion/useActive.ts
10728
10739
  /**
10740
+ * An Enter pressed with a modifier or while an IME is composing belongs to the trigger
10741
+ * (submit, newline, candidate confirmation), never to the suggestion list.
10742
+ */
10743
+ function isPlainEnter(event) {
10744
+ return !event.isComposing && !event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey;
10745
+ }
10746
+ /**
10729
10747
  * Cascader does not expose active item control, so we use `value` to mirror focus path.
10730
10748
  */
10731
10749
  function useActive(items, open, rtl, onCancel) {
@@ -10756,6 +10774,26 @@
10756
10774
  const firstItem = getItems(activePaths.value.length + 1)[0];
10757
10775
  if (firstItem) activePaths.value = [...activePaths.value, firstItem.value];
10758
10776
  };
10777
+ const getActiveItem = () => {
10778
+ let currentItems = items.value;
10779
+ let activeItem;
10780
+ for (const activePath of activePaths.value) {
10781
+ activeItem = currentItems.find((item) => item.value === activePath);
10782
+ if (!activeItem) return void 0;
10783
+ currentItems = activeItem.children || [];
10784
+ }
10785
+ return activeItem;
10786
+ };
10787
+ /**
10788
+ * Whether this Enter belongs to the popup: it needs an open popup, a plain Enter and a
10789
+ * leaf item to select. Anything else stays with the trigger, so the input can still
10790
+ * submit, insert a newline or confirm an IME candidate.
10791
+ */
10792
+ const shouldSelectOnEnter = (event) => {
10793
+ if (!open.value || !isPlainEnter(event)) return false;
10794
+ const activeItem = getActiveItem();
10795
+ return !!activeItem && !activeItem.children?.length;
10796
+ };
10759
10797
  const onKeyDown = (event) => {
10760
10798
  if (!open.value) return;
10761
10799
  switch (event.key) {
@@ -10781,18 +10819,33 @@
10781
10819
  event.preventDefault();
10782
10820
  event.stopPropagation();
10783
10821
  break;
10784
- case "Enter":
10822
+ case "Enter": {
10823
+ if (!isPlainEnter(event)) break;
10824
+ const activeItem = getActiveItem();
10825
+ if (!activeItem) break;
10785
10826
  event.preventDefault();
10827
+ if (activeItem.children?.length) {
10828
+ offsetNext();
10829
+ event.stopPropagation();
10830
+ }
10786
10831
  return false;
10832
+ }
10787
10833
  case "Escape":
10788
10834
  onCancel();
10789
10835
  event.preventDefault();
10836
+ event.stopPropagation();
10837
+ break;
10838
+ default: break;
10790
10839
  }
10791
10840
  };
10792
10841
  (0, vue.watch)([open, items], ([nextOpen, nextItems]) => {
10793
10842
  if (nextOpen && Array.isArray(nextItems) && nextItems.length > 0) activePaths.value = [nextItems[0].value];
10794
10843
  }, { immediate: true });
10795
- return [activePaths, onKeyDown];
10844
+ return [
10845
+ activePaths,
10846
+ onKeyDown,
10847
+ shouldSelectOnEnter
10848
+ ];
10796
10849
  }
10797
10850
  //#endregion
10798
10851
  //#region components/suggestion/index.tsx
@@ -10875,10 +10928,18 @@
10875
10928
  const innerOpen = (0, vue.ref)(false);
10876
10929
  const mergedOpen = (0, vue.computed)(() => props.open ?? innerOpen.value);
10877
10930
  const itemList = (0, vue.ref)([]);
10931
+ /**
10932
+ * What the last `onTrigger` asked for. A function `items` is usually an inline arrow,
10933
+ * so it gets a new identity on every parent render — without this the watcher below
10934
+ * would re-evaluate it with no info and drop the triggered list.
10935
+ */
10936
+ const triggerInfo = (0, vue.ref)();
10937
+ const resolveItems = (source, info) => {
10938
+ if (typeof source === "function") return source(info);
10939
+ return Array.isArray(source) ? source : [];
10940
+ };
10878
10941
  (0, vue.watch)(() => props.items, (nextItems) => {
10879
- if (Array.isArray(nextItems)) itemList.value = nextItems;
10880
- else if (typeof nextItems === "function") itemList.value = nextItems();
10881
- else itemList.value = [];
10942
+ itemList.value = resolveItems(nextItems, triggerInfo.value);
10882
10943
  }, { immediate: true });
10883
10944
  const triggerOpen = (nextOpen) => {
10884
10945
  if (props.open === void 0) innerOpen.value = nextOpen;
@@ -10893,7 +10954,8 @@
10893
10954
  triggerOpen(false);
10894
10955
  return;
10895
10956
  }
10896
- if (typeof props.items === "function") itemList.value = props.items(nextInfo);
10957
+ triggerInfo.value = nextInfo;
10958
+ if (typeof props.items === "function") itemList.value = resolveItems(props.items, nextInfo);
10897
10959
  triggerOpen(true);
10898
10960
  };
10899
10961
  const onInternalChange = (valuePath, selectedOptions) => {
@@ -10903,10 +10965,31 @@
10903
10965
  if (lastValue !== void 0) emit("select", String(lastValue), selected);
10904
10966
  triggerOpen(false);
10905
10967
  };
10906
- const [activePath, onKeyDown] = useActive(itemList, mergedOpen, isRtl, onClose);
10968
+ const [activePath, onKeyDown, shouldSelectOnEnter] = useActive(itemList, mergedOpen, isRtl, onClose);
10907
10969
  const onInternalOpenChange = (nextOpen) => {
10908
10970
  if (!nextOpen) onClose();
10909
10971
  };
10972
+ /**
10973
+ * Cascader renders our children as its raw input element, so every keydown from the
10974
+ * children bubbles into BaseSelect's keyboard model. That model is built for a
10975
+ * non-editable trigger and breaks typing inside an editable one such as Sender:
10976
+ *
10977
+ * - Space is always `preventDefault()`ed, so no space can be typed;
10978
+ * - Enter is always `preventDefault()`ed, even when there is nothing to select;
10979
+ * - Backspace makes the option list step back a level or close the popup.
10980
+ *
10981
+ * Keep exactly those inside the content wrapper. Every other key — Escape, arrows,
10982
+ * application shortcuts — must keep bubbling, otherwise the app around us stops
10983
+ * receiving keyboard events while the trigger has focus.
10984
+ */
10985
+ const onContentKeyDown = (event) => {
10986
+ const { key } = event;
10987
+ if (key === "Enter") {
10988
+ if (!shouldSelectOnEnter(event)) event.stopPropagation();
10989
+ return;
10990
+ }
10991
+ if (key === " " || key === "Backspace" && mergedOpen.value) event.stopPropagation();
10992
+ };
10910
10993
  const domAttrs = (0, vue.computed)(() => {
10911
10994
  const { class: _class, style: _style, ...rest } = attrs;
10912
10995
  return rest;
@@ -10980,7 +11063,8 @@
10980
11063
  contextConfig.value.classes?.content,
10981
11064
  mergedClasses.value.content
10982
11065
  ],
10983
- "style": [contextConfig.value.styles?.content, mergedStyles.value.content]
11066
+ "style": [contextConfig.value.styles?.content, mergedStyles.value.content],
11067
+ "onKeydown": onContentKeyDown
10984
11068
  }, [childNode])])] });
10985
11069
  };
10986
11070
  }
@@ -11203,15 +11287,14 @@
11203
11287
  });
11204
11288
  const prefixCls = (0, vue.computed)(() => props.prefixCls);
11205
11289
  function renderContent() {
11206
- const node = (0, vue.createVNode)("div", { "ref": contentRef }, [(0, vue.createVNode)("div", {
11290
+ return (0, vue.withDirectives)((0, vue.createVNode)("div", { "ref": contentRef }, [(0, vue.createVNode)("div", {
11207
11291
  "class": [
11208
11292
  `${prefixCls.value}-content`,
11209
11293
  contextConfig.value.classes?.content,
11210
11294
  props.classes?.content
11211
11295
  ],
11212
11296
  "style": [contextConfig.value.styles?.content, props.styles?.content]
11213
- }, [slots.default?.()])]);
11214
- return (0, vue.withDirectives)(node, [[vue.vShow, mergedExpanded.value]]);
11297
+ }, [slots.default?.()])]), [[vue.vShow, mergedExpanded.value]]);
11215
11298
  }
11216
11299
  expose({ get nativeElement() {
11217
11300
  return rootRef.value;
@@ -11775,11 +11858,10 @@
11775
11858
  const showContent = hasContent && (!collapsible || props.expanded);
11776
11859
  const destroyOnHidden = item.destroyOnHidden ?? true;
11777
11860
  const renderContent = () => {
11778
- const node = (0, vue.createVNode)("div", null, [(0, vue.createVNode)("div", {
11861
+ return (0, vue.withDirectives)((0, vue.createVNode)("div", null, [(0, vue.createVNode)("div", {
11779
11862
  "class": [`${cls}-content`, props.classes?.itemContent],
11780
11863
  "style": props.styles?.itemContent
11781
- }, [(0, vue.createVNode)("div", { "class": `${cls}-content-box` }, [contentNode])])]);
11782
- return (0, vue.withDirectives)(node, [[vue.vShow, showContent]]);
11864
+ }, [(0, vue.createVNode)("div", { "class": `${cls}-content-box` }, [contentNode])])]), [[vue.vShow, showContent]]);
11783
11865
  };
11784
11866
  return (0, vue.createVNode)("div", {
11785
11867
  "class": [`${cls}`, props.classes?.item],
@@ -12263,7 +12345,7 @@
12263
12345
  },
12264
12346
  setup(props, { slots }) {
12265
12347
  const attrs = (0, vue.useAttrs)();
12266
- const xProviderConfig = (0, vue.computed)(() => {
12348
+ (0, vue.provide)(XProviderContextKey, (0, vue.computed)(() => {
12267
12349
  return {
12268
12350
  attachments: props.attachments,
12269
12351
  actions: props.actions,
@@ -12280,8 +12362,7 @@
12280
12362
  thoughtChain: props.thoughtChain,
12281
12363
  welcome: props.welcome
12282
12364
  };
12283
- });
12284
- (0, vue.provide)(XProviderContextKey, xProviderConfig);
12365
+ }));
12285
12366
  return () => (0, vue.createVNode)(antdv_next.ConfigProvider, (0, vue.mergeProps)(attrs, {
12286
12367
  "theme": props.theme,
12287
12368
  "locale": props.locale,
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "1.2.1-beta.1";
2
+ var version = "1.2.2";
3
3
  //#endregion
4
4
  export { version };
@@ -21,8 +21,7 @@ function useSpeech(onSpeech, allowSpeech) {
21
21
  };
22
22
  permissionStatus = status;
23
23
  }).catch((error) => {
24
- const message = error instanceof Error ? error.message : String(error);
25
- warning(false, "Sender", `Browser does not support querying microphone permission. ${message}`);
24
+ warning(false, "Sender", `Browser does not support querying microphone permission. ${error instanceof Error ? error.message : String(error)}`);
26
25
  });
27
26
  });
28
27
  onBeforeUnmount(() => {