@agentscope-ai/design 1.0.28 → 2.0.0-beta.1770111685133

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 (34) hide show
  1. package/lib/antd/styles/button.style.js +7 -1
  2. package/lib/antd/themes/generateThemeByToken.js +2 -0
  3. package/lib/components/commonComponents/Breadcrumb/index.style.js +3 -1
  4. package/lib/components/commonComponents/Collapse/index.style.js +5 -1
  5. package/lib/components/commonComponents/FileIcon/demo/demo.js +6 -4
  6. package/lib/components/commonComponents/Image/index.js +1 -0
  7. package/lib/components/commonComponents/MediaPreview/index.style.js +1 -1
  8. package/lib/components/commonComponents/Modal/index.style.js +1 -1
  9. package/lib/components/commonComponents/Pagination/index.style.js +1 -1
  10. package/lib/components/commonComponents/PromptsEditor/VarRender.js +8 -51
  11. package/lib/components/commonComponents/PromptsEditor/index.js +4 -42
  12. package/lib/components/commonComponents/PromptsEditor/index.style.d.ts +51 -0
  13. package/lib/components/commonComponents/PromptsEditor/index.style.js +60 -0
  14. package/lib/components/commonComponents/RadioButton/demo/demo4.js +1 -2
  15. package/lib/components/commonComponents/RadioButton/index.style.js +7 -1
  16. package/lib/components/commonComponents/Table/demo/demo1.js +1 -1
  17. package/lib/components/commonComponents/Tooltip/demo/demo3.js +3 -2
  18. package/lib/components/commonComponents/Tooltip/index.d.ts +2 -2
  19. package/lib/components/commonComponents/Tooltip/index.js +13 -9
  20. package/lib/components/commonComponents/Video/index.style.js +6 -2
  21. package/llms/all.llms.txt +28 -4696
  22. package/llms/components/commonComponents/CodeBlock/index.zh-CN.llms.txt +3 -2
  23. package/llms/components/commonComponents/FileIcon/index.zh-CN.llms.txt +28 -0
  24. package/llms/components/commonComponents/InputSearch/index.zh-CN.llms.txt +6 -0
  25. package/llms/components/commonComponents/MediaPreview/index.zh-CN.llms.txt +21 -0
  26. package/llms/components/commonComponents/PromptsEditor/index.zh-CN.llms.txt +2 -1
  27. package/llms/components/commonComponents/Tabs/index.zh-CN.llms.txt +1 -0
  28. package/llms/components/commonComponents/Tooltip/index.zh-CN.llms.txt +1 -1
  29. package/llms/docs/changelog/index.zh-CN.llms.txt +56 -0
  30. package/llms/docs/guide/tokens&variables.zh-CN.llms.txt +1 -1
  31. package/llms/docs/guide/vibe-coding.zh-CN.llms.txt +2 -3
  32. package/llms/docs/icons/iconLibrary.zh-CN.llms.txt +308 -0
  33. package/llms/index.llms.txt +3 -48
  34. package/package.json +4 -4
@@ -1,7 +1,13 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../libs/createStyle";
4
- export var useButtonStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* \u53D6\u6D88\u6240\u6709button\u7684boxShadow */\nbutton[type=\"button\"].", "-btn {\n font-weight: 500;\n padding-inline: 11px;\n \n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 20px;\n }\n \n &.", "-btn-sm {\n padding-inline: 7px;\n \n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 16px;\n }\n }\n \n &.", "-btn-lg {\n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 24px;\n }\n }\n}\n\n.", "-btn-default {\n border-color: var(--", "-color-border-secondary);\n}\n\n.", "-btn-textCompact:hover {\n color: var(--", "-color-text-tertiary) !important;\n}\n\n.", "-btn.", "-btn-default.", "-btn-dangerous:not(:disabled):not(.", "-btn-disabled) {\n border-color: transparent;\n background-color: var(--", "-color-error-bg);\n color: var(--", "-color-error);\n \n &:hover {\n background-color: var(--", "-color-error-bg-hover);\n border-color: transparent;\n color: var(--", "-color-error-hover);\n }\n}\n\n.", "-btn-color-dangerous.", "-btn-variant-solid:disabled,\n.", "-btn-color-dangerous.", "-btn-variant-solid.", "-btn-disabled {\n border-color: transparent;\n background-color: var(--", "-color-fill-disable);\n color: var(--", "-color-text-white);\n}\n\n.", "-btn-primary {\n color: var(--", "-color-text-on-primary);\n}\n.", "-btn-primary.", "-btn-variant-solid:not(:disabled):not(.", "-btn-background-ghost):not(.", "-btn-disabled):hover {\n color: var(--", "-color-text-on-primary);\n}\n\n.", "-btn-primary:disabled {\n background: var(--", "-color-fill-disable);\n color: var(--", "-color-text-white);\n border-color: transparent;\n}\n\n.", "-btn-default:disabled {\n background: var(--", "-color-bg-base);\n color: var(--", "-color-text-tertiary);\n border-color: var(--", "-color-border-secondary);\n}\n\n/* Keep white text color for primaryLess buttons */\n.spark-button-primaryLess.", "-btn-primary {\n color: var(--", "-color-text-white);\n}\n.spark-button-primaryLess.", "-btn-primary.", "-btn-variant-solid:not(:disabled):not(.", "-btn-disabled):hover {\n color: var(--", "-color-text-white);\n}\n"])), function (p) {
4
+ export var useButtonStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* \u53D6\u6D88\u6240\u6709button\u7684boxShadow */\nbutton[type=\"button\"].", "-btn {\n font-weight: 500;\n padding-inline: 11px;\n \n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 20px;\n }\n \n &.", "-btn-sm {\n padding-inline: 7px;\n \n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 16px;\n }\n }\n \n &.", "-btn-lg {\n span[data-spark-icon] {\n /* @agentscope-ai/icons\u7684\u7279\u6B8A\u903B\u8F91 */\n font-size: 24px;\n }\n }\n}\n\n.", "-btn-default {\n border-color: var(--", "-color-border-secondary);\n &.", "-btn:not(:disabled):not(.", "-btn-disabled):hover {\n color: var(--", "-color-text);\n }\n}\n\n.", "-btn-textCompact:hover {\n color: var(--", "-color-text-tertiary) !important;\n}\n\n.", "-btn.", "-btn-default.", "-btn-dangerous:not(:disabled):not(.", "-btn-disabled) {\n border-color: transparent;\n background-color: var(--", "-color-error-bg);\n color: var(--", "-color-error);\n \n &:hover {\n background-color: var(--", "-color-error-bg-hover);\n border-color: transparent;\n color: var(--", "-color-error-hover);\n }\n}\n\n.", "-btn-color-dangerous.", "-btn-variant-solid:disabled,\n.", "-btn-color-dangerous.", "-btn-variant-solid.", "-btn-disabled {\n border-color: transparent;\n background-color: var(--", "-color-fill-disable);\n color: var(--", "-color-text-white);\n}\n\n.", "-btn-primary {\n color: var(--", "-color-text-on-primary);\n}\n.", "-btn-primary.", "-btn-variant-solid:not(:disabled):not(.", "-btn-background-ghost):not(.", "-btn-disabled):hover {\n color: var(--", "-color-text-on-primary);\n}\n\n.", "-btn-primary:disabled {\n background: var(--", "-color-fill-disable);\n color: var(--", "-color-text-white);\n border-color: transparent;\n}\n\n.", "-btn-default:disabled {\n background: var(--", "-color-bg-base);\n color: var(--", "-color-text-tertiary);\n border-color: var(--", "-color-border-secondary);\n}\n\n/* Keep white text color for primaryLess buttons */\n.spark-button-primaryLess.", "-btn-primary {\n color: var(--", "-color-text-white);\n}\n.spark-button-primaryLess.", "-btn-primary.", "-btn-variant-solid:not(:disabled):not(.", "-btn-disabled):hover {\n color: var(--", "-color-text-white);\n}\n"])), function (p) {
5
+ return p.antPrefix;
6
+ }, function (p) {
7
+ return p.antPrefix;
8
+ }, function (p) {
9
+ return p.antPrefix;
10
+ }, function (p) {
5
11
  return p.antPrefix;
6
12
  }, function (p) {
7
13
  return p.antPrefix;
@@ -4,6 +4,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ // @ts-nocheck
8
+
7
9
  var INVISIBLE_COLOR = 'rgba(0,0,0,0)';
8
10
 
9
11
  // border
@@ -1,7 +1,7 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../../libs/createStyle";
4
- export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-breadcrumb {\n cursor: default;\n \n .", "-breadcrumb-link {\n cursor: pointer;\n }\n \n li:last-child {\n .", "-breadcrumb-link {\n color: var(--", "-color-text);\n display: flex;\n align-items: center;\n }\n }\n \n a {\n color: var(--", "-color-text-secondary);\n height: auto;\n \n &:hover {\n background-color: transparent;\n }\n }\n \n .", "-breadcrumb-separator {\n color: var(--", "-color-text);\n }\n \n .", "-breadcrumb-overlay-link {\n display: flex;\n align-items: center;\n }\n \n .", "-breadcrumb-dropdown {\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 8px;\n \n .", "-avatar > img {\n width: 20px;\n height: 20px;\n }\n }\n \n .", "-breadcrumb-item-content {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .", "-breadcrumb-dropdown-title {\n display: flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n \n .", "-breadcrumb-dropdown-icon {\n font-size: 16px !important;\n }\n }\n \n .", "-breadcrumb-dropdown-overlay {\n display: flex;\n justify-content: center;\n }\n}\n"])), function (p) {
4
+ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-breadcrumb {\n cursor: default;\n \n .", "-breadcrumb-link {\n cursor: pointer;\n }\n \n li:last-child {\n .", "-breadcrumb-link {\n color: var(--", "-color-text);\n display: flex;\n align-items: center;\n }\n }\n \n a {\n color: var(--", "-color-text-secondary);\n height: auto;\n \n &:hover {\n background-color: transparent;\n }\n }\n \n .", "-breadcrumb-separator {\n color: var(--", "-color-text);\n }\n \n .", "-breadcrumb-overlay-link {\n display: flex;\n align-items: center;\n }\n \n .", "-breadcrumb-dropdown,\n .", "-dropdown-trigger {\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 8px;\n \n .", "-avatar > img {\n width: 20px;\n height: 20px;\n }\n }\n \n .", "-breadcrumb-item-content {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .", "-breadcrumb-dropdown-title {\n display: flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n \n .", "-breadcrumb-dropdown-icon {\n font-size: 16px !important;\n }\n }\n \n .", "-breadcrumb-dropdown-overlay {\n display: flex;\n justify-content: center;\n }\n}\n"])), function (p) {
5
5
  return p.sparkPrefix;
6
6
  }, function (p) {
7
7
  return p.antPrefix;
@@ -21,6 +21,8 @@ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _t
21
21
  return p.sparkPrefix;
22
22
  }, function (p) {
23
23
  return p.antPrefix;
24
+ }, function (p) {
25
+ return p.antPrefix;
24
26
  }, function (p) {
25
27
  return p.sparkPrefix;
26
28
  }, function (p) {
@@ -1,7 +1,11 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../../libs/createStyle";
4
- export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-collapse {\n background-color: var(--", "-color-fill-tertiary);\n border: 1px solid var(--", "-color-border-secondary);\n border-radius: var(--", "-border-radius);\n \n .", "-collapse-content {\n color: var(--", "-color-text);\n background-color: var(--", "-color-bg-base);\n border-top: 1px solid var(--", "-color-border-secondary);\n }\n \n & > .", "-collapse-item {\n border-bottom: 1px solid var(--", "-color-border-secondary);\n \n & > .", "-collapse-header {\n color: var(--", "-color-text);\n font-weight: 500;\n line-height: 24px;\n align-items: center;\n \n .", "-collapse-expand-icon {\n width: 32px;\n height: 32px;\n padding: 0;\n justify-content: center;\n margin-right: 8px;\n }\n \n .", "-collapse-arrow {\n font-size: 15px;\n }\n \n .", "-collapse-extra {\n height: 32px;\n display: flex;\n align-items: center;\n margin-left: 8px;\n }\n }\n }\n}\n"])), function (p) {
4
+ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-collapse {\n background-color: var(--", "-color-fill-tertiary);\n border: 1px solid var(--", "-color-border-secondary);\n border-radius: var(--", "-border-radius);\n \n .", "-collapse-content {\n color: var(--", "-color-text);\n background-color: var(--", "-color-bg-base);\n border-top: 1px solid var(--", "-color-border-secondary);\n }\n \n & > .", "-collapse-item {\n border-bottom: 1px solid var(--", "-color-border-secondary);\n \n & > .", "-collapse-header {\n color: var(--", "-color-text);\n font-weight: 500;\n line-height: 24px;\n align-items: center;\n \n .", "-collapse-expand-icon {\n width: 32px;\n height: 32px;\n padding: 0;\n justify-content: center;\n margin-right: 8px;\n }\n \n .", "-collapse-arrow {\n font-size: 15px;\n }\n \n .", "-collapse-extra {\n height: 32px;\n display: flex;\n align-items: center;\n margin-left: 8px;\n }\n }\n & > .", "-collapse-panel {\n border-top: 1px solid var(--", "-color-border-secondary);\n }\n }\n}\n"])), function (p) {
5
+ return p.antPrefix;
6
+ }, function (p) {
7
+ return p.antPrefix;
8
+ }, function (p) {
5
9
  return p.antPrefix;
6
10
  }, function (p) {
7
11
  return p.antPrefix;
@@ -1,17 +1,19 @@
1
1
  import { Button, FileCard, FileIcon } from "../../../..";
2
- import { Space } from 'antd';
2
+ import { Flex, Space } from 'antd';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { jsxs as _jsxs } from "react/jsx-runtime";
5
5
  export default function () {
6
6
  var list = ['common', 'epub', 'excel', 'html', 'image', 'md', 'mobi', 'pdf', 'ppt', 'txt', 'web', 'word'];
7
- return /*#__PURE__*/_jsxs("div", {
7
+ return /*#__PURE__*/_jsxs(Flex, {
8
+ vertical: true,
9
+ gap: "16px",
8
10
  children: [/*#__PURE__*/_jsx(Space, {
9
11
  children: list.map(function (t) {
10
12
  return /*#__PURE__*/_jsx(FileIcon, {
11
13
  type: t
12
14
  }, t);
13
15
  })
14
- }), /*#__PURE__*/_jsx("div", {}), /*#__PURE__*/_jsx(Space, {
16
+ }), /*#__PURE__*/_jsx(Space, {
15
17
  wrap: true,
16
18
  children: list.map(function (t) {
17
19
  return /*#__PURE__*/_jsx(FileCard, {
@@ -20,7 +22,7 @@ export default function () {
20
22
  type: t
21
23
  }, t);
22
24
  })
23
- }), /*#__PURE__*/_jsx("div", {}), /*#__PURE__*/_jsx(FileCard, {
25
+ }), /*#__PURE__*/_jsx(FileCard, {
24
26
  name: 'pdf',
25
27
  size: 1000,
26
28
  type: 'pdf',
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ // @ts-nocheck
7
8
  import $18n from "../../../i18n";
8
9
  import { getCommonConfig } from "../../../config";
9
10
  import { SparkVisibleLine } from '@agentscope-ai/icons';
@@ -1,7 +1,7 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../../libs/createStyle";
4
- export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-media-preview-container {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: 9999;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--", "-color-bg-mask);\n}\n\n.", "-media-preview-main-content {\n border-radius: var(--", "-border-radius-lg);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n transition: transform 0.3s ease, opacity 0.15s ease;\n opacity: 1;\n\n &.transitioning {\n opacity: 0;\n }\n}\n\n.", "-media-preview-main-media {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.", "-media-preview-nav-left {\n position: absolute;\n left: 48px;\n top: 50%;\n transform: translateY(-50%);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.", "-media-preview-nav-right {\n position: absolute;\n right: 48px;\n top: 50%;\n transform: translateY(-50%);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.", "-media-preview-nav-icon {\n font-size: 48px;\n color: var(--", "-color-bg-base);\n}\n\n.", "-media-preview-toolbar {\n position: absolute;\n top: 36px;\n right: 36px;\n display: flex;\n flex-direction: row;\n gap: 16px;\n}\n\n.", "-media-preview-zoom-controls {\n display: flex;\n flex-direction: row;\n border-radius: 8px;\n background: var(--", "-color-bg-mask);\n}\n\n.", "-media-preview-close-button {\n display: flex;\n flex-direction: row;\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n border: none;\n}\n\n.", "-media-preview-tool-button {\n background: transparent;\n border: none;\n padding: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.", "-media-preview-tool-icon {\n font-size: 24px;\n color: var(--", "-color-bg-base);\n cursor: pointer;\n\n &:hover {\n opacity: 0.8;\n }\n}\n\n.", "-media-preview-thumbnail-carousel {\n position: absolute;\n bottom: 42px;\n left: 50%;\n transform: translateX(-50%);\n padding: 8px;\n border-radius: 8px;\n background: var(--", "-color-bg-mask);\n}\n\n.", "-media-preview-thumbnail-wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n}\n\n.", "-media-preview-thumbnail-nav-icon {\n font-size: 16px;\n color: var(--", "-color-bg-base);\n cursor: pointer;\n flex-shrink: 0;\n\n &:hover {\n color: var(--", "-color-bg-base) !important;\n opacity: 0.8;\n }\n}\n\n.", "-media-preview-thumbnail-list {\n display: flex;\n flex-direction: row;\n gap: 8px;\n overflow-x: auto;\n scroll-behavior: smooth;\n max-width: 720px;\n\n &::-webkit-scrollbar {\n display: none;\n }\n}\n\n.", "-media-preview-thumbnail-item {\n width: 56px;\n height: 56px;\n border-radius: 8px;\n overflow: hidden;\n cursor: pointer;\n flex-shrink: 0;\n border: 1px solid transparent;\n box-sizing: border-box;\n\n &.active {\n border-color: var(--", "-color-bg-base);\n }\n\n img,\n video {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n"])), function (p) {
4
+ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-media-preview-container {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: 9999;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--", "-color-bg-mask);\n}\n\n.", "-media-preview-main-content {\n border-radius: var(--", "-border-radius-lg);\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n transition: transform 0.3s ease, opacity 0.15s ease;\n opacity: 1;\n\n &.transitioning {\n opacity: 0;\n }\n}\n\n.", "-media-preview-main-media {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n\n.", "-media-preview-nav-left {\n position: absolute;\n left: 48px;\n top: 50%;\n transform: translateY(-50%);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.", "-media-preview-nav-right {\n position: absolute;\n right: 48px;\n top: 50%;\n transform: translateY(-50%);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.", "-media-preview-nav-icon {\n font-size: 48px;\n color: var(--", "-color-text-on-primary);\n}\n\n.", "-media-preview-toolbar {\n position: absolute;\n top: 36px;\n right: 36px;\n display: flex;\n flex-direction: row;\n gap: 16px;\n}\n\n.", "-media-preview-zoom-controls {\n display: flex;\n flex-direction: row;\n border-radius: 8px;\n background: var(--", "-color-bg-mask);\n}\n\n.", "-media-preview-close-button {\n display: flex;\n flex-direction: row;\n padding: 8px;\n border-radius: 8px;\n cursor: pointer;\n border: none;\n}\n\n.", "-media-preview-tool-button {\n background: transparent;\n border: none;\n padding: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.", "-media-preview-tool-icon {\n font-size: 24px;\n color: var(--", "-color-text-on-primary);\n cursor: pointer;\n\n &:hover {\n opacity: 0.8;\n }\n}\n\n.", "-media-preview-thumbnail-carousel {\n position: absolute;\n bottom: 42px;\n left: 50%;\n transform: translateX(-50%);\n padding: 8px;\n border-radius: 8px;\n background: var(--", "-color-bg-mask);\n}\n\n.", "-media-preview-thumbnail-wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n}\n\n.", "-media-preview-thumbnail-nav-icon {\n font-size: 16px;\n color: var(--", "-color-text-on-primary);\n cursor: pointer;\n flex-shrink: 0;\n\n &:hover {\n color: var(--", "-color-text-on-primary);\n opacity: 0.8;\n }\n}\n\n.", "-media-preview-thumbnail-list {\n display: flex;\n flex-direction: row;\n gap: 8px;\n overflow-x: auto;\n scroll-behavior: smooth;\n max-width: 720px;\n\n &::-webkit-scrollbar {\n display: none;\n }\n}\n\n.", "-media-preview-thumbnail-item {\n width: 56px;\n height: 56px;\n border-radius: 8px;\n overflow: hidden;\n cursor: pointer;\n flex-shrink: 0;\n border: 1px solid transparent;\n box-sizing: border-box;\n\n &.active {\n border-color: var(--", "-color-text-on-primary);\n }\n\n img,\n video {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n}\n"])), function (p) {
5
5
  return p.sparkPrefix;
6
6
  }, function (p) {
7
7
  return p.antPrefix;
@@ -1,7 +1,7 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../../libs/createStyle";
4
- export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-modal {\n .", "-modal-title {\n min-height: 24px;\n }\n \n .", "-modal-content {\n padding: 0;\n border: 1px solid var(--", "-color-border-secondary);\n \n .", "-modal-header {\n padding: 18px 20px;\n margin-bottom: 0;\n \n .", "-modal-title {\n line-height: 28px;\n \n .", "-modal-title-wrapper {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n \n .", "-modal-title {\n flex: 1;\n }\n \n .", "-modal-title-close {\n cursor: pointer;\n }\n }\n }\n }\n \n .", "-modal-body {\n padding: 20px;\n color: var(--", "-color-text-secondary);\n }\n \n .", "-modal-footer {\n padding: 16px 20px;\n margin-top: 0;\n \n .", "-modal-footer-wrapper {\n display: flex;\n justify-content: space-between;\n align-items: center;\n \n .", "-modal-footer-info {\n font-size: 14px;\n font-weight: normal;\n line-height: 24px;\n color: var(--", "-color-text-tertiary);\n }\n \n .", "-modal-footer-origin-node {\n display: flex;\n gap: 12px;\n }\n }\n }\n \n .", "-modal-close {\n width: 32px;\n height: 32px;\n top: 16px;\n right: 16px;\n \n .", "-modal-close-icon {\n color: var(--", "-color-text);\n }\n \n &:hover {\n background: none;\n }\n }\n }\n}\n\n.", "-show-divider {\n .", "-modal-content {\n .", "-modal-header {\n border-bottom: 1px solid var(--", "-color-border-secondary);\n }\n \n .", "-modal-footer {\n border-top: 1px solid var(--", "-color-border-secondary);\n }\n }\n}\n"])), function (p) {
4
+ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-modal {\n .", "-modal-title {\n min-height: 24px;\n }\n \n .", "-modal-container {\n padding: 0;\n border: 1px solid var(--", "-color-border-secondary);\n \n .", "-modal-header {\n padding: 18px 20px;\n margin-bottom: 0;\n \n .", "-modal-title {\n line-height: 28px;\n \n .", "-modal-title-wrapper {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n \n .", "-modal-title {\n flex: 1;\n }\n \n .", "-modal-title-close {\n cursor: pointer;\n }\n }\n }\n }\n \n .", "-modal-body {\n padding: 20px;\n color: var(--", "-color-text-secondary);\n }\n \n .", "-modal-footer {\n padding: 16px 20px;\n margin-top: 0;\n \n .", "-modal-footer-wrapper {\n display: flex;\n justify-content: space-between;\n align-items: center;\n \n .", "-modal-footer-info {\n font-size: 14px;\n font-weight: normal;\n line-height: 24px;\n color: var(--", "-color-text-tertiary);\n }\n \n .", "-modal-footer-origin-node {\n display: flex;\n gap: 12px;\n }\n }\n }\n \n .", "-modal-close {\n width: 32px;\n height: 32px;\n top: 16px;\n right: 16px;\n \n .", "-modal-close-icon {\n color: var(--", "-color-text);\n }\n \n &:hover {\n background: none;\n }\n }\n }\n}\n\n.", "-show-divider {\n .", "-modal-container {\n .", "-modal-header {\n border-bottom: 1px solid var(--", "-color-border-secondary);\n }\n \n .", "-modal-footer {\n border-top: 1px solid var(--", "-color-border-secondary);\n }\n }\n}\n"])), function (p) {
5
5
  return p.sparkPrefix;
6
6
  }, function (p) {
7
7
  return p.antPrefix;
@@ -1,7 +1,7 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../../libs/createStyle";
4
- export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-pagination {\n color: var(--", "-color-text) !important;\n font-weight: 500 !important;\n \n .", "-pagination-total-text {\n font-weight: 500;\n }\n \n .", "-select-selection-item {\n font-weight: 500;\n }\n \n .", "-pagination-item-active {\n border-color: var(--", "-color-border-secondary);\n border-radius: 8px;\n font-weight: \n \n a {\n color: var(--", "-color-text) !important;\n }\n }\n \n a {\n color: var(--", "-color-text) !important;\n font-weight: 500 !important;\n }\n \n .", "-pagination-jump-next {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .", "-pagination-jump-prev {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n\n.", "-pagination {\n .", "-pagination-prev,\n .", "-pagination-next,\n .", "-pagination-jump-prev,\n .", "-pagination-jump-next {\n font-family: Montserrat;\n display: inline-block !important;\n }\n}\n"])), function (p) {
4
+ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-pagination {\n color: var(--", "-color-text) !important;\n font-weight: 500 !important;\n \n .", "-pagination-total-text {\n font-weight: 500;\n }\n \n .", "-select-selection-item {\n font-weight: 500;\n }\n \n .", "-pagination-item-active {\n border-color: var(--", "-color-border-secondary);\n border-radius: 8px;\n font-weight: \n \n a {\n color: var(--", "-color-text) !important;\n }\n }\n \n a {\n color: var(--", "-color-text) !important;\n font-weight: 500 !important;\n }\n \n .", "-pagination-jump-next {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .", "-pagination-jump-prev {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n}\n\n.", "-pagination \n.", "-pagination-jump-next \n.", "-pagination-item-container \n.", "-pagination-item-ellipsis {\n color: var(--", "-color-text);\n left: -4px;\n font-family: serif;\n}\n"])), function (p) {
5
5
  return p.antPrefix;
6
6
  }, function (p) {
7
7
  return p.antPrefix;
@@ -1,52 +1,14 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
2
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
3
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
4
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
12
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
13
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
- import { Decoration, EditorView, MatchDecorator, ViewPlugin, WidgetType } from '@codemirror/view';
8
+ import { Decoration, MatchDecorator, ViewPlugin } from '@codemirror/view';
16
9
 
17
- // Placeholder Widget
18
- var PlaceholderWidget = /*#__PURE__*/function (_WidgetType) {
19
- _inherits(PlaceholderWidget, _WidgetType);
20
- var _super = _createSuper(PlaceholderWidget);
21
- function PlaceholderWidget(name) {
22
- var _this;
23
- _classCallCheck(this, PlaceholderWidget);
24
- _this = _super.call(this);
25
- _this.name = name;
26
- return _this;
27
- }
28
- _createClass(PlaceholderWidget, [{
29
- key: "eq",
30
- value: function eq(other) {
31
- return other.name === this.name;
32
- }
33
- }, {
34
- key: "toDOM",
35
- value: function toDOM() {
36
- var wrap = document.createElement('span');
37
- wrap.setAttribute('aria-hidden', 'true');
38
- wrap.className = 'cm-prompt-var';
39
- wrap.textContent = "${".concat(this.name, "}");
40
- return wrap;
41
- }
42
- }, {
43
- key: "ignoreEvent",
44
- value: function ignoreEvent() {
45
- return false;
46
- }
47
- }]);
48
- return PlaceholderWidget;
49
- }(WidgetType); // Placeholder 匹配器
10
+ // 使用 Mark Decoration 而不是 Replace Decoration
11
+ // 这样文本保持可编辑,只添加样式高亮
50
12
  var placeholderMatcher = new MatchDecorator({
51
13
  // 该正则用于匹配形如 ${变量名} 的占位符,变量名允许为中文、字母、数字、下划线
52
14
  // \${ 匹配字符 "${"
@@ -54,9 +16,9 @@ var placeholderMatcher = new MatchDecorator({
54
16
  // \} 匹配字符 "}"
55
17
  // g 全局匹配
56
18
  regexp: /\$\{([\w\u4e00-\u9fa5]+)\}/g,
57
- decoration: function decoration(match) {
58
- return Decoration.replace({
59
- widget: new PlaceholderWidget(match[1])
19
+ decoration: function decoration() {
20
+ return Decoration.mark({
21
+ class: 'cm-prompt-var'
60
22
  });
61
23
  }
62
24
  });
@@ -78,12 +40,7 @@ var placeholders = ViewPlugin.fromClass( /*#__PURE__*/function () {
78
40
  }(), {
79
41
  decorations: function decorations(instance) {
80
42
  return instance.placeholders;
81
- },
82
- provide: function provide(plugin) {
83
- return EditorView.atomicRanges.of(function (view) {
84
- var _view$plugin;
85
- return ((_view$plugin = view.plugin(plugin)) === null || _view$plugin === void 0 ? void 0 : _view$plugin.placeholders) || Decoration.none;
86
- });
87
43
  }
44
+ // 移除 atomicRanges,允许用户在变量内部编辑
88
45
  });
89
46
  export default [placeholders];
@@ -1,5 +1,4 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _templateObject, _templateObject2;
3
2
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -13,57 +12,19 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
12
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
13
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
17
15
  // @ts-nocheck
18
16
  import { SparkEnterLine } from '@agentscope-ai/icons';
19
17
  import { markdown } from '@codemirror/lang-markdown';
20
18
  import { vscodeDark, vscodeLight } from '@uiw/codemirror-theme-vscode';
21
19
  import CodeMirror from '@uiw/react-codemirror';
22
20
  import { ConfigProvider, theme } from 'antd';
23
- import { createStyles } from 'antd-style';
24
21
  import classNames from 'classnames';
25
22
  import React, { memo, useEffect, useMemo, useState } from 'react';
23
+ import { useStyles } from "./index.style";
26
24
  import VarRender from "./VarRender";
27
25
  import VarSelectInput from "./VarSelectInput";
28
26
  import { jsx as _jsx } from "react/jsx-runtime";
29
27
  import { jsxs as _jsxs } from "react/jsx-runtime";
30
- var useStyles = createStyles(function (_ref) {
31
- var css = _ref.css,
32
- token = _ref.token;
33
- return {
34
- onCreate: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .cm-tooltip li:last-of-type {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 40px;\n border-top: 1px solid ", ";\n border-radius: 0 !important;\n background-color: ", " !important;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 !important;\n }\n\n .cm-tooltip ul {\n margin-bottom: 40px !important;\n }\n\n .cm-tooltip li:first-of-type {\n border-top: none !important;\n }\n "])), token.colorBorderSecondary, token.colorBgContainer),
35
- cm: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .cm-line {\n color: ", ";\n }\n .cm-line span {\n color: ", ";\n }\n\n .cm-editor {\n position: absolute !important;\n background-color: transparent !important;\n\n top: 0;\n left: 8px;\n right: 0;\n bottom: 30px;\n }\n .cm-focused {\n outline: none;\n }\n\n .cm-content {\n width: 100%;\n padding: 8px 0;\n white-space: break-spaces;\n }\n\n .cm-line {\n line-height: 24px;\n height: auto !important;\n }\n\n .cm-prompt-var {\n font-size: inherit;\n color: ", " !important;\n background-color: ", " !important;\n line-height: 1.7;\n font-weight: 500;\n margin: 0 2px;\n height: 24px;\n display: inline-flex;\n padding: 0 4px;\n border-radius: 4px;\n }\n\n .cm-tooltip {\n position: relative;\n background-color: ", ";\n border: 0;\n border-radius: 4px;\n overflow: hidden;\n box-shadow: 0px 3px 12px 0px rgba(47, 49, 51, 0.12);\n }\n\n .cm-tooltip ul {\n max-height: 17em !important;\n display: flex;\n flex-direction: column;\n }\n\n .cm-tooltip li {\n margin: 4px 8px;\n height: 32px;\n padding: 0 12px !important;\n flex: 0 0 32px;\n display: flex;\n align-items: center;\n }\n\n .cm-tooltip-autocomplete ul li[aria-selected] {\n border-radius: 6px;\n font-weight: 600;\n color: ", ";\n background-color: ", ";\n }\n\n .cm-completionInfo-right {\n display: none;\n }\n\n .cm-completionIcon {\n display: none;\n }\n "])), token.colorTextSecondary, token.colorBlue, token.colorPurple, token.colorPurpleBg, token.colorBgContainer, token.colorText, token.colorFillSecondary),
36
- root: {
37
- position: 'relative',
38
- minHeight: 300,
39
- backgroundColor: token.colorBgBase,
40
- border: "1px solid ".concat(token.colorBorderSecondary),
41
- borderRadius: 6,
42
- overflow: 'hidden',
43
- padding: '4px 12px',
44
- resize: 'vertical'
45
- },
46
- footer: {
47
- position: 'absolute',
48
- bottom: 0,
49
- left: 0,
50
- right: 0,
51
- padding: '0 12px',
52
- height: 30,
53
- display: 'flex',
54
- alignItems: 'center',
55
- justifyContent: 'space-between',
56
- fontSize: 12,
57
- color: token.colorTextTertiary,
58
- backgroundColor: token.colorBgBase
59
- },
60
- tips: {
61
- display: 'flex',
62
- alignItems: 'center',
63
- gap: 4
64
- }
65
- };
66
- });
67
28
  export var langExtensionsMap = {
68
29
  markdown: [markdown()]
69
30
  };
@@ -119,7 +80,7 @@ var Editor = function Editor(props) {
119
80
  return /*#__PURE__*/_jsxs("div", {
120
81
  className: styles.root,
121
82
  children: [/*#__PURE__*/_jsx(CodeMirror, {
122
- className: classNames(styles.cm, _defineProperty({}, styles.onCreate, onCreate)),
83
+ className: classNames(props.className, styles.cm, _defineProperty({}, styles.onCreate, onCreate)),
123
84
  extensions: extensions,
124
85
  value: props.value,
125
86
  theme: getTheme,
@@ -130,7 +91,8 @@ var Editor = function Editor(props) {
130
91
  foldGutter: false,
131
92
  highlightActiveLine: false
132
93
  },
133
- readOnly: props.readOnly
94
+ readOnly: props.readOnly,
95
+ editable: !props.readOnly
134
96
  }, getTheme), /*#__PURE__*/_jsxs("div", {
135
97
  className: styles.footer,
136
98
  children: [tips, props.maxLength ? /*#__PURE__*/_jsxs("div", {
@@ -0,0 +1,51 @@
1
+ /**
2
+ * PromptsEditor 组件样式
3
+ */
4
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
5
+ /**
6
+ * 新增变量按钮相关样式
7
+ */
8
+ onCreate: import("antd-style").SerializedStyles;
9
+ /**
10
+ * CodeMirror 编辑器样式
11
+ */
12
+ cm: import("antd-style").SerializedStyles;
13
+ /**
14
+ * 根容器样式
15
+ */
16
+ root: {
17
+ position: "relative";
18
+ minHeight: number;
19
+ backgroundColor: any;
20
+ border: string;
21
+ borderRadius: number;
22
+ overflow: "hidden";
23
+ padding: string;
24
+ resize: "vertical";
25
+ };
26
+ /**
27
+ * 底部栏样式
28
+ */
29
+ footer: {
30
+ position: "absolute";
31
+ bottom: number;
32
+ left: number;
33
+ right: number;
34
+ padding: string;
35
+ height: number;
36
+ display: "flex";
37
+ alignItems: "center";
38
+ justifyContent: "space-between";
39
+ fontSize: number;
40
+ color: any;
41
+ backgroundColor: any;
42
+ };
43
+ /**
44
+ * 提示文本样式
45
+ */
46
+ tips: {
47
+ display: "flex";
48
+ alignItems: "center";
49
+ gap: number;
50
+ };
51
+ }>;
@@ -0,0 +1,60 @@
1
+ var _templateObject, _templateObject2;
2
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
+ // @ts-nocheck
4
+ import { createStyles } from 'antd-style';
5
+
6
+ /**
7
+ * PromptsEditor 组件样式
8
+ */
9
+ export var useStyles = createStyles(function (_ref) {
10
+ var css = _ref.css,
11
+ token = _ref.token;
12
+ return {
13
+ /**
14
+ * 新增变量按钮相关样式
15
+ */
16
+ onCreate: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .cm-tooltip li:last-of-type {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 40px;\n border-top: 1px solid ", ";\n border-radius: 0 !important;\n background-color: ", " !important;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 !important;\n }\n\n .cm-tooltip ul {\n margin-bottom: 40px !important;\n }\n\n .cm-tooltip li:first-of-type {\n border-top: none !important;\n }\n "])), token.colorBorderSecondary, token.colorBgContainer),
17
+ /**
18
+ * CodeMirror 编辑器样式
19
+ */
20
+ cm: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .cm-line {\n color: ", ";\n }\n .cm-line span {\n color: ", ";\n }\n\n .cm-editor {\n position: absolute !important;\n background-color: transparent !important;\n\n top: 0;\n left: 8px;\n right: 0;\n bottom: 30px;\n }\n .cm-focused {\n outline: none;\n }\n\n .cm-content {\n width: 100%;\n padding: 8px 0;\n white-space: break-spaces;\n }\n\n .cm-line {\n line-height: 24px;\n height: auto !important;\n }\n\n /* \u53D8\u91CF\u9AD8\u4EAE\u6837\u5F0F */\n .cm-prompt-var {\n font-size: inherit;\n color: ", " !important;\n background-color: ", " !important;\n line-height: 1.7;\n font-weight: 500;\n margin: 0 2px;\n height: 24px;\n display: inline-flex;\n padding: 0 4px;\n border-radius: 4px;\n }\n\n /* \u81EA\u52A8\u8865\u5168\u63D0\u793A\u6846\u6837\u5F0F */\n .cm-tooltip {\n position: relative;\n background-color: ", ";\n border: 0;\n border-radius: 4px;\n overflow: hidden;\n box-shadow: 0px 3px 12px 0px rgba(47, 49, 51, 0.12);\n }\n\n .cm-tooltip ul {\n max-height: 17em !important;\n display: flex;\n flex-direction: column;\n }\n\n .cm-tooltip li {\n margin: 4px 8px;\n height: 32px;\n padding: 0 12px !important;\n flex: 0 0 32px;\n display: flex;\n align-items: center;\n }\n\n .cm-tooltip-autocomplete ul li[aria-selected] {\n border-radius: 6px;\n font-weight: 600;\n color: ", ";\n background-color: ", ";\n }\n\n .cm-completionInfo-right {\n display: none;\n }\n\n .cm-completionIcon {\n display: none;\n }\n "])), token.colorTextSecondary, token.colorBlue, token.colorPurple, token.colorPurpleBg, token.colorBgContainer, token.colorText, token.colorFillSecondary),
21
+ /**
22
+ * 根容器样式
23
+ */
24
+ root: {
25
+ position: 'relative',
26
+ minHeight: 300,
27
+ backgroundColor: token.colorBgBase,
28
+ border: "1px solid ".concat(token.colorBorderSecondary),
29
+ borderRadius: 6,
30
+ overflow: 'hidden',
31
+ padding: '4px 12px',
32
+ resize: 'vertical'
33
+ },
34
+ /**
35
+ * 底部栏样式
36
+ */
37
+ footer: {
38
+ position: 'absolute',
39
+ bottom: 0,
40
+ left: 0,
41
+ right: 0,
42
+ padding: '0 12px',
43
+ height: 30,
44
+ display: 'flex',
45
+ alignItems: 'center',
46
+ justifyContent: 'space-between',
47
+ fontSize: 12,
48
+ color: token.colorTextTertiary,
49
+ backgroundColor: token.colorBgBase
50
+ },
51
+ /**
52
+ * 提示文本样式
53
+ */
54
+ tips: {
55
+ display: 'flex',
56
+ alignItems: 'center',
57
+ gap: 4
58
+ }
59
+ };
60
+ });
@@ -12,8 +12,7 @@ var App = function App() {
12
12
  children: /*#__PURE__*/_jsx(RadioButton, {
13
13
  onChange: onChange,
14
14
  defaultValue: "a",
15
- buttonStyle: "solid",
16
- ghost: false,
15
+ bordered: true,
17
16
  options: [{
18
17
  value: 'a',
19
18
  label: 'Qwen-Max'
@@ -1,7 +1,7 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../../libs/createStyle";
4
- export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-radio-button-wrapper {\n border: none;\n background-color: transparent;\n border-radius: 6px;\n \n &:first-child {\n border-inline-start: initial;\n }\n \n &::before {\n display: none !important;\n }\n \n &:not(:last-child) {\n margin-right: 12px;\n }\n}\n\n.", "-radio-group-ghost {\n .", "-radio-button-wrapper-checked {\n &:not(.", "-radio-button-wrapper-disabled) {\n color: var(--", "-color-primary);\n background-color: var(--", "-color-primary-bg);\n \n .", "-radio-button-wrapper-checked {\n background-color: var(--", "-color-primary-bg);\n }\n }\n \n &.", "-radio-button-wrapper-disabled {\n &:hover {\n background-color: var(--", "-color-fill-tertiary);\n }\n }\n }\n}\n\n.", "-radio-group-bordered {\n .", "-radio-button-wrapper {\n border: var(--", "-line-width) var(--", "-line-type) var(--", "-color-border);\n \n &:not(:first-child) {\n border-inline-start-width: 1px;\n }\n }\n}\n\n.", "-radio-button-wrapper-disabled {\n color: var(--", "-color-text-tertiary);\n background-color: transparent;\n \n &:hover {\n color: var(--", "-color-text-tertiary);\n background-color: transparent;\n }\n}\n\n.", "-radio-button-wrapper-checked.", "-radio-button-wrapper-disabled {\n color: var(--", "-color-text-tertiary);\n background-color: var(--", "-color-fill-tertiary);\n \n &:hover {\n color: var(--", "-color-text-tertiary);\n background-color: var(--", "-color-fill-tertiary);\n }\n}\n"])), function (p) {
4
+ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-radio-button-wrapper {\n border: none;\n background-color: transparent;\n border-radius: 6px;\n \n &:first-child {\n border-inline-start: initial;\n }\n \n &::before {\n display: none !important;\n }\n \n &:not(:last-child) {\n margin-right: 12px;\n }\n}\n\n.", "-radio-group-ghost {\n .", "-radio-button-wrapper-checked {\n &:not(.", "-radio-button-wrapper-disabled) {\n color: var(--", "-color-primary);\n background-color: var(--", "-color-primary-bg);\n \n .", "-radio-button-wrapper-checked {\n background-color: var(--", "-color-primary-bg);\n }\n }\n \n &.", "-radio-button-wrapper-disabled {\n &:hover {\n background-color: var(--", "-color-fill-tertiary);\n }\n }\n }\n}\n\n.", "-radio-group-bordered {\n .", "-radio-button-wrapper {\n border: var(--", "-line-width) var(--", "-line-type) var(--", "-color-border);\n \n &:not(:first-child) {\n border-inline-start-width: 1px;\n }\n }\n\n .", "-radio-button-wrapper-checked.", "-radio-button-wrapper {\n border-color: var(--", "-color-primary);\n }\n}\n\n.", "-radio-button-wrapper-disabled {\n color: var(--", "-color-text-tertiary);\n background-color: transparent;\n \n &:hover {\n color: var(--", "-color-text-tertiary);\n background-color: transparent;\n }\n}\n\n.", "-radio-button-wrapper-checked.", "-radio-button-wrapper-disabled {\n color: var(--", "-color-text-tertiary);\n background-color: var(--", "-color-fill-tertiary);\n \n &:hover {\n color: var(--", "-color-text-tertiary);\n background-color: var(--", "-color-fill-tertiary);\n }\n}\n"])), function (p) {
5
5
  return p.antPrefix;
6
6
  }, function (p) {
7
7
  return p.antPrefix;
@@ -49,4 +49,10 @@ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _t
49
49
  return p.antPrefix;
50
50
  }, function (p) {
51
51
  return p.antPrefix;
52
+ }, function (p) {
53
+ return p.antPrefix;
54
+ }, function (p) {
55
+ return p.antPrefix;
56
+ }, function (p) {
57
+ return p.antPrefix;
52
58
  });
@@ -94,7 +94,7 @@ var App = function App() {
94
94
  });
95
95
  }
96
96
  }];
97
- var data = new Array(3).fill(0).map(function (_, index) {
97
+ var data = new Array(100).fill(0).map(function (_, index) {
98
98
  return {
99
99
  key: index.toString(),
100
100
  title: "First Column Row ".concat(index + 1),
@@ -1,13 +1,14 @@
1
1
  import { Button, Tooltip } from "../../../..";
2
+ import { Flex } from 'antd';
2
3
  import React from 'react';
3
4
  import { jsx as _jsx } from "react/jsx-runtime";
4
- import { Fragment as _Fragment } from "react/jsx-runtime";
5
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
6
6
  var title = new Array(100).fill(1).map(function (_, index) {
7
7
  return "".concat(index + 1, " \u6D4B\u8BD5maxHeight\u5C5E\u6027\u7684\u573A\u666F");
8
8
  }).join('');
9
9
  var App = function App() {
10
- return /*#__PURE__*/_jsxs(_Fragment, {
10
+ return /*#__PURE__*/_jsxs(Flex, {
11
+ gap: "16px",
11
12
  children: [/*#__PURE__*/_jsx(Tooltip, {
12
13
  title: title,
13
14
  maxHeight: 400,
@@ -10,9 +10,9 @@ export interface SparkTooltipProps {
10
10
  /**
11
11
  * @description 最大高度
12
12
  * @descriptionEn max height
13
- * @default '90vh'
13
+ * @default '60vh'
14
14
  */
15
15
  maxHeight?: number | string;
16
16
  }
17
- declare const SparkTooltip: import("react").ForwardRefExoticComponent<(SparkTooltipProps & TooltipProps) & import("react").RefAttributes<any>>;
17
+ declare const SparkTooltip: import("react").ForwardRefExoticComponent<SparkTooltipProps & TooltipProps & import("react").RefAttributes<any>>;
18
18
  export default SparkTooltip;
@@ -21,9 +21,8 @@ var SparkTooltip = /*#__PURE__*/forwardRef(function (props, ref) {
21
21
  var _props$mode = props.mode,
22
22
  mode = _props$mode === void 0 ? 'dark' : _props$mode,
23
23
  _props$maxHeight = props.maxHeight,
24
- maxHeight = _props$maxHeight === void 0 ? '90vh' : _props$maxHeight,
25
- _props$styles = props.styles,
26
- styles = _props$styles === void 0 ? {} : _props$styles,
24
+ maxHeight = _props$maxHeight === void 0 ? '60vh' : _props$maxHeight,
25
+ styles = props.styles,
27
26
  arrow = props.arrow,
28
27
  overlayClassName = props.overlayClassName,
29
28
  getPopupContainer = props.getPopupContainer,
@@ -32,14 +31,19 @@ var SparkTooltip = /*#__PURE__*/forwardRef(function (props, ref) {
32
31
  var _getCommonConfig = getCommonConfig(),
33
32
  sparkPrefix = _getCommonConfig.sparkPrefix,
34
33
  antPrefix = _getCommonConfig.antPrefix;
34
+
35
+ // 处理 styles 可能是函数的情况
36
+ var stylesObj = typeof styles === 'function' ? {} : styles !== null && styles !== void 0 ? styles : {};
37
+ var mergedStyles = _objectSpread(_objectSpread({}, stylesObj), {}, {
38
+ container: _objectSpread(_objectSpread({
39
+ overflow: 'auto'
40
+ }, stylesObj.container), {}, {
41
+ maxHeight: maxHeight // maxHeight 放最后,确保优先级最高
42
+ })
43
+ });
35
44
  return /*#__PURE__*/_jsxs(_Fragment, {
36
45
  children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({}, restProps), {}, {
37
- styles: _objectSpread(_objectSpread({}, styles), {}, {
38
- body: _objectSpread({
39
- maxHeight: maxHeight,
40
- overflow: 'auto'
41
- }, styles.body)
42
- }),
46
+ styles: mergedStyles,
43
47
  arrow: arrow !== null && arrow !== void 0 ? arrow : false,
44
48
  overlayClassName: classNames(overlayClassName, mode === 'light' && "".concat(sparkPrefix, "-tooltip-light")),
45
49
  getPopupContainer: getPopupContainer || function (triggerNode) {
@@ -1,7 +1,7 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../../libs/createStyle";
4
- export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n// Video \u4E3B\u5BB9\u5668\u6837\u5F0F\n.", "-video-container {\n position: relative;\n width: 100%;\n height: 100%;\n background: #000;\n\n button {\n --", "-color-text-disabled: rgba(231, 231, 237, 0.25) !important;\n --", "-button-text-text-color: rgba(231, 231, 237, 0.88) !important;\n --", "-button-text-text-hover-color: rgba(231, 231, 237, 0.88) !important;\n --", "-button-text-hover-bg: rgba(231, 231, 237, 0.08) !important;\n }\n\n .", "-media-time-text {\n color: var(--", "-color-text-white);\n }\n\n // \u8FDB\u5EA6\u6761\u6837\u5F0F\n .", "-media-progress-bar {\n .", "-progress-inner {\n --", "-progress-remaining-color: var(--", "-color-fill);\n }\n \n .", "-progress-bg {\n background: var(--", "-color-text-white) !important;\n }\n }\n}\n\n.", "-video-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.", "-video-element {\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n}\n\n.", "-video-poster {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: contain;\n}\n\n.", "-video-controller-wrapper {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(0deg, #000000 2%, rgba(0, 0, 0, 0) 94%);\n transition: opacity 0.3s;\n}\n"])), function (p) {
4
+ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n// Video \u4E3B\u5BB9\u5668\u6837\u5F0F\n.", "-video-container {\n position: relative;\n width: 100%;\n height: 100%;\n background: #000;\n\n button {\n --", "-color-text-disabled: rgba(231, 231, 237, 0.25) !important;\n --", "-button-text-text-color: rgba(231, 231, 237, 0.88) !important;\n --", "-button-text-text-hover-color: rgba(231, 231, 237, 0.88) !important;\n --", "-button-text-hover-bg: rgba(231, 231, 237, 0.08) !important;\n }\n\n .", "-btn {\n color: var(--", "-button-text-text-color);\n }\n\n .", "-media-time-text {\n color: var(--", "-color-text-white);\n }\n\n // \u8FDB\u5EA6\u6761\u5BB9\u5668\u6837\u5F0F\n .", "-progress {\n .", "-progress-body {\n .", "-progress-rail {\n background: var(--", "-color-fill) !important;\n }\n .", "-progress-track {\n background: var(--", "-color-text-white) !important;\n }\n }\n }\n}\n\n.", "-video-content {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.", "-video-element {\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n}\n\n.", "-video-poster {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: contain;\n}\n\n.", "-video-controller-wrapper {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(0deg, #000000 2%, rgba(0, 0, 0, 0) 94%);\n transition: opacity 0.3s;\n}\n"])), function (p) {
5
5
  return p.sparkPrefix;
6
6
  }, function (p) {
7
7
  return p.antPrefix;
@@ -12,7 +12,7 @@ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _t
12
12
  }, function (p) {
13
13
  return p.antPrefix;
14
14
  }, function (p) {
15
- return p.sparkPrefix;
15
+ return p.antPrefix;
16
16
  }, function (p) {
17
17
  return p.antPrefix;
18
18
  }, function (p) {
@@ -27,6 +27,10 @@ export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _t
27
27
  return p.antPrefix;
28
28
  }, function (p) {
29
29
  return p.antPrefix;
30
+ }, function (p) {
31
+ return p.antPrefix;
32
+ }, function (p) {
33
+ return p.antPrefix;
30
34
  }, function (p) {
31
35
  return p.sparkPrefix;
32
36
  }, function (p) {