@agentscope-ai/design 1.0.7 → 1.0.8

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.
@@ -0,0 +1 @@
1
+ 这个文件夹里是spark design预置的主题
@@ -6,5 +6,5 @@ export default function generateThemeByToken(
6
6
  * @returns ConfigProviderProps
7
7
  */
8
8
  token: {
9
- [key: string]: string | number;
9
+ [key: string]: string | number | boolean;
10
10
  }, darkMode?: boolean): Partial<ConfigProviderProps>;
@@ -35,7 +35,7 @@ var SparkBreadcrumb = function SparkBreadcrumb(_ref) {
35
35
  contentParts.push( /*#__PURE__*/_jsxs("span", {
36
36
  className: "".concat(sparkPrefix, "-breadcrumb-dropdown-title"),
37
37
  children: [item.title, /*#__PURE__*/_jsx(SparkDownLine, {
38
- size: "small"
38
+ size: 16
39
39
  })]
40
40
  }, "title"));
41
41
  } else {
@@ -1,17 +1,26 @@
1
1
  export declare function getIndexStyleData(params: any): {
2
2
  [x: string]: {
3
- [x: string]: {
3
+ [x: string]: string | {
4
+ cursor: string;
5
+ color?: undefined;
6
+ height?: undefined;
7
+ '&:hover'?: undefined;
8
+ display?: undefined;
9
+ alignItems?: undefined;
10
+ gap?: undefined;
11
+ justifyContent?: undefined;
12
+ } | {
4
13
  [x: string]: {
5
14
  color: string;
6
15
  display: string;
7
16
  alignItems: string;
8
17
  };
18
+ cursor?: undefined;
9
19
  color?: undefined;
10
20
  height?: undefined;
11
21
  '&:hover'?: undefined;
12
22
  display?: undefined;
13
23
  alignItems?: undefined;
14
- cursor?: undefined;
15
24
  gap?: undefined;
16
25
  justifyContent?: undefined;
17
26
  } | {
@@ -20,27 +29,27 @@ export declare function getIndexStyleData(params: any): {
20
29
  '&:hover': {
21
30
  backgroundColor: string;
22
31
  };
32
+ cursor?: undefined;
23
33
  display?: undefined;
24
34
  alignItems?: undefined;
25
- cursor?: undefined;
26
35
  gap?: undefined;
27
36
  justifyContent?: undefined;
28
37
  } | {
29
38
  color: string;
39
+ cursor?: undefined;
30
40
  height?: undefined;
31
41
  '&:hover'?: undefined;
32
42
  display?: undefined;
33
43
  alignItems?: undefined;
34
- cursor?: undefined;
35
44
  gap?: undefined;
36
45
  justifyContent?: undefined;
37
46
  } | {
38
47
  display: string;
39
48
  alignItems: string;
49
+ cursor?: undefined;
40
50
  color?: undefined;
41
51
  height?: undefined;
42
52
  '&:hover'?: undefined;
43
- cursor?: undefined;
44
53
  gap?: undefined;
45
54
  justifyContent?: undefined;
46
55
  } | {
@@ -60,10 +69,10 @@ export declare function getIndexStyleData(params: any): {
60
69
  display: string;
61
70
  alignItems: string;
62
71
  gap: number;
72
+ cursor?: undefined;
63
73
  color?: undefined;
64
74
  height?: undefined;
65
75
  '&:hover'?: undefined;
66
- cursor?: undefined;
67
76
  justifyContent?: undefined;
68
77
  } | {
69
78
  [x: string]: string | number | {
@@ -73,20 +82,21 @@ export declare function getIndexStyleData(params: any): {
73
82
  alignItems: string;
74
83
  gap: number;
75
84
  height: string;
85
+ cursor?: undefined;
76
86
  color?: undefined;
77
87
  '&:hover'?: undefined;
78
- cursor?: undefined;
79
88
  justifyContent?: undefined;
80
89
  } | {
81
90
  display: string;
82
91
  justifyContent: string;
92
+ cursor?: undefined;
83
93
  color?: undefined;
84
94
  height?: undefined;
85
95
  '&:hover'?: undefined;
86
96
  alignItems?: undefined;
87
- cursor?: undefined;
88
97
  gap?: undefined;
89
98
  };
99
+ cursor: string;
90
100
  'li:last-child': {
91
101
  [x: string]: {
92
102
  color: string;
@@ -9,20 +9,21 @@ import createStyle from "../../../libs/createStyle";
9
9
  export function getIndexStyleData(params) {
10
10
  var antPrefix = params.antPrefix,
11
11
  sparkPrefix = params.sparkPrefix;
12
- return _defineProperty({}, ".".concat(sparkPrefix, "-breadcrumb"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
13
- 'li:last-child': _defineProperty({}, ".".concat(antPrefix, "-breadcrumb-link"), {
14
- color: "var(--".concat(antPrefix, "-color-text)"),
15
- display: 'flex',
16
- alignItems: 'center'
17
- }),
18
- a: {
19
- color: "var(--".concat(antPrefix, "-color-text-secondary)"),
20
- height: 'auto',
21
- '&:hover': {
22
- backgroundColor: 'transparent'
23
- }
12
+ return _defineProperty({}, ".".concat(sparkPrefix, "-breadcrumb"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
13
+ cursor: 'default'
14
+ }, ".".concat(antPrefix, "-breadcrumb-link"), {
15
+ cursor: 'pointer'
16
+ }), 'li:last-child', _defineProperty({}, ".".concat(antPrefix, "-breadcrumb-link"), {
17
+ color: "var(--".concat(antPrefix, "-color-text)"),
18
+ display: 'flex',
19
+ alignItems: 'center'
20
+ })), "a", {
21
+ color: "var(--".concat(antPrefix, "-color-text-secondary)"),
22
+ height: 'auto',
23
+ '&:hover': {
24
+ backgroundColor: 'transparent'
24
25
  }
25
- }, ".".concat(antPrefix, "-breadcrumb-separator"), {
26
+ }), ".".concat(antPrefix, "-breadcrumb-separator"), {
26
27
  color: "var(--".concat(antPrefix, "-color-text)")
27
28
  }), ".".concat(antPrefix, "-breadcrumb-overlay-link"), {
28
29
  display: 'flex',
@@ -1,4 +1,4 @@
1
- var _excluded = ["iconSize"];
1
+ var _excluded = ["iconSize", "loading"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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; }
@@ -7,9 +7,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
7
7
  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); }
8
8
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+ import { SparkLoadingLine } from '@agentscope-ai/icons';
10
11
  import { Button as AntdButton, ConfigProvider, theme } from 'antd';
11
12
  import classNames from 'classnames';
12
- import React, { forwardRef } from 'react';
13
+ import React, { forwardRef, useMemo } from 'react';
13
14
  import IconFont from "../IconFont";
14
15
  import Popover from "../Popover";
15
16
 
@@ -18,6 +19,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
18
19
  var Button = /*#__PURE__*/forwardRef(function (props, ref) {
19
20
  var token = theme.useToken();
20
21
  var iconSize = props.iconSize,
22
+ loading = props.loading,
21
23
  restProps = _objectWithoutProperties(props, _excluded);
22
24
  var buttonType = React.useMemo(function () {
23
25
  // @ts-ignore
@@ -26,10 +28,29 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
26
28
  if (restProps.type === 'textCompact') return 'link';
27
29
  return restProps.type;
28
30
  }, [restProps.type]);
31
+ var mergedLoading = useMemo(function () {
32
+ // 更改默认 loading icon 为 SparkLoadingLine
33
+ if (loading) {
34
+ if (typeof loading === 'boolean') {
35
+ return {
36
+ icon: /*#__PURE__*/_jsx(SparkLoadingLine, {
37
+ spin: true
38
+ })
39
+ };
40
+ }
41
+ if (_typeof(loading) === 'object') {
42
+ return _objectSpread({
43
+ icon: /*#__PURE__*/_jsx(SparkLoadingLine, {
44
+ spin: true
45
+ })
46
+ }, loading);
47
+ }
48
+ }
49
+ return loading;
50
+ }, [loading]);
29
51
  var icon = React.useMemo(function () {
30
- if (restProps.loading && _typeof(restProps.loading) === 'object' && restProps.loading.icon) {
31
- var _restProps$loading;
32
- return (_restProps$loading = restProps.loading) === null || _restProps$loading === void 0 ? void 0 : _restProps$loading.icon;
52
+ if (loading && _typeof(loading) === 'object' && loading.icon) {
53
+ return loading === null || loading === void 0 ? void 0 : loading.icon;
33
54
  }
34
55
  if (restProps.iconType) return /*#__PURE__*/_jsx(IconFont, {
35
56
  type: restProps.iconType,
@@ -41,6 +62,7 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
41
62
  return null;
42
63
  }, [restProps.iconType, restProps.icon]);
43
64
  var button = /*#__PURE__*/_jsx(AntdButton, _objectSpread(_objectSpread({}, restProps), {}, {
65
+ loading: mergedLoading,
44
66
  ref: ref,
45
67
  type: buttonType,
46
68
  icon: icon,
@@ -18,6 +18,7 @@ import { html } from '@codemirror/lang-html';
18
18
  import { java } from '@codemirror/lang-java';
19
19
  import { javascript } from '@codemirror/lang-javascript';
20
20
  import { json, jsonParseLinter } from '@codemirror/lang-json';
21
+ import { markdown } from '@codemirror/lang-markdown';
21
22
  import { php } from '@codemirror/lang-php';
22
23
  import { python } from '@codemirror/lang-python';
23
24
  import { yaml } from '@codemirror/lang-yaml';
@@ -42,7 +43,8 @@ export var langExtensionsMap = {
42
43
  csharp: [cpp()],
43
44
  css: [css()],
44
45
  html: [html()],
45
- curl: []
46
+ curl: [],
47
+ markdown: [markdown()]
46
48
  };
47
49
  var lintExtensionsMap = {
48
50
  javascript: [lintGutter()],
@@ -37,13 +37,13 @@ export default function Illustrate(props) {
37
37
  }
38
38
  }, []);
39
39
  useEffect(function () {
40
- if (svgContainer && cssVar.key) {
40
+ if (svgContainer && cssVar !== null && cssVar !== void 0 && cssVar.key) {
41
41
  svgContainer.classList.forEach(function (key) {
42
42
  return svgContainer.classList.remove(key);
43
43
  });
44
44
  svgContainer.classList.add(cssVar.key);
45
45
  }
46
- }, [cssVar.key]);
46
+ }, [cssVar === null || cssVar === void 0 ? void 0 : cssVar.key]);
47
47
  useEffect(function () {
48
48
  if (!isSvg) {
49
49
  return;
@@ -0,0 +1,6 @@
1
+ import { DecorationSet, ViewPlugin, ViewUpdate } from '@codemirror/view';
2
+ declare const _default: ViewPlugin<{
3
+ placeholders: DecorationSet;
4
+ update(update: ViewUpdate): void;
5
+ }>[];
6
+ export default _default;
@@ -0,0 +1,84 @@
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
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+ 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
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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';
16
+
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 匹配器
50
+ var placeholderMatcher = new MatchDecorator({
51
+ regexp: /\$\{(\w+)\}/g,
52
+ decoration: function decoration(match) {
53
+ return Decoration.replace({
54
+ widget: new PlaceholderWidget(match[1])
55
+ });
56
+ }
57
+ });
58
+
59
+ // Placeholder 插件
60
+ var placeholders = ViewPlugin.fromClass( /*#__PURE__*/function () {
61
+ function _class2(view) {
62
+ _classCallCheck(this, _class2);
63
+ _defineProperty(this, "placeholders", void 0);
64
+ this.placeholders = placeholderMatcher.createDeco(view);
65
+ }
66
+ _createClass(_class2, [{
67
+ key: "update",
68
+ value: function update(_update) {
69
+ this.placeholders = placeholderMatcher.updateDeco(_update, this.placeholders);
70
+ }
71
+ }]);
72
+ return _class2;
73
+ }(), {
74
+ decorations: function decorations(instance) {
75
+ return instance.placeholders;
76
+ },
77
+ provide: function provide(plugin) {
78
+ return EditorView.atomicRanges.of(function (view) {
79
+ var _view$plugin;
80
+ return ((_view$plugin = view.plugin(plugin)) === null || _view$plugin === void 0 ? void 0 : _view$plugin.placeholders) || Decoration.none;
81
+ });
82
+ }
83
+ });
84
+ export default [placeholders];
@@ -0,0 +1,6 @@
1
+ import { Completion } from '@codemirror/autocomplete';
2
+ import { Extension } from '@codemirror/state';
3
+ export default function (data: Completion[], config: {
4
+ onCreate?: () => void;
5
+ createBtnText?: string;
6
+ }): Extension;
@@ -0,0 +1,60 @@
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
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
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
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; }
13
+ import { autocompletion } from '@codemirror/autocomplete';
14
+ export default function () {
15
+ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
16
+ var config = arguments.length > 1 ? arguments[1] : undefined;
17
+ var onCreate = config.onCreate,
18
+ createBtnText = config.createBtnText;
19
+ return autocompletion({
20
+ override: [function (context) {
21
+ var word = context.matchBefore(/\/(\w+)?/);
22
+ if (!word) return null;
23
+ if (word && word.from == word.to && !context.explicit) {
24
+ return null;
25
+ }
26
+ return {
27
+ from: word === null || word === void 0 ? void 0 : word.from,
28
+ options: (onCreate ? [].concat(_toConsumableArray(data), [{
29
+ label: '/NEW_VAR',
30
+ boost: -99
31
+ }]) : data).map(function (item) {
32
+ return _objectSpread(_objectSpread({}, item), {}, {
33
+ displayLabel: item.label === '/NEW_VAR' ? createBtnText : item.label.slice(1),
34
+ apply: function apply(view, completion, from, to) {
35
+ if (completion.label === '/NEW_VAR') {
36
+ view.dispatch({
37
+ changes: {
38
+ from: from,
39
+ to: to,
40
+ insert: ''
41
+ }
42
+ });
43
+ return onCreate === null || onCreate === void 0 ? void 0 : onCreate();
44
+ }
45
+ var variableName = completion.label.slice(1);
46
+ var variableText = "${".concat(variableName, "}");
47
+ view.dispatch({
48
+ changes: {
49
+ from: from,
50
+ to: to,
51
+ insert: variableText
52
+ }
53
+ });
54
+ }
55
+ });
56
+ })
57
+ };
58
+ }]
59
+ });
60
+ }
@@ -0,0 +1 @@
1
+ export default function Basic(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { PromptsEditor } from "../../../..";
8
+ import { useState } from 'react';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export default function Basic() {
11
+ var _useState = useState("# \u89D2\u8272\n\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684Prompt\u7F16\u5199\u5DE5\u7A0B\u5E08\uFF0C\u64C5\u957F\u7F16\u5199\u5404\u79CD\u7C7B\u578B\u7684Prompt\u3002\n\n# \u6280\u80FD\n1. \u4F60\u64C5\u957F\u7F16\u5199\u5404\u79CD\u7C7B\u578B\u7684Prompt\u3002\n2. \u4F60\u64C5\u957F\u7F16\u5199\u5404\u79CD\u7C7B\u578B\u7684Prompt\u3002\n3. \u4F60\u64C5\u957F\u7F16\u5199\u5404\u79CD\u7C7B\u578B\u7684Prompt\u3002\n\n\n# \u4EFB\u52A1\n\u6839\u636E\u8F93\u5165\u7684Prompt\u6A21\u677F\uFF0C\u751F\u6210\u7B26\u5408\u8981\u6C42\u7684Prompt\u3002\n\n# \u8F93\u5165\n- Prompt\u6A21\u677F\uFF1A\u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684Prompt\u7F16\u5199\u5DE5\u7A0B\u5E08\uFF0C\u64C5\u957F\u7F16\u5199\u5404\u79CD\u7C7B\u578B\u7684Prompt\u3002\n\n# \u8F93\u51FA\n- Prompt\uFF1A\u7B26\u5408\u8981\u6C42\u7684Prompt\u3002"),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ value = _useState2[0],
14
+ setValue = _useState2[1];
15
+ return /*#__PURE__*/_jsx(PromptsEditor, {
16
+ onCreate: function onCreate() {
17
+ return alert(1);
18
+ },
19
+ value: value,
20
+ onChange: setValue,
21
+ maxLength: 5000,
22
+ variables: [{
23
+ code: 'city'
24
+ }, {
25
+ code: 'foo'
26
+ }, {
27
+ code: 'user'
28
+ }]
29
+ });
30
+ }
@@ -0,0 +1,42 @@
1
+ export interface PromptsEditorProps {
2
+ /**
3
+ * @description 可以输入内容的最大长度
4
+ * @descriptionEn Maximum length of input content
5
+ */
6
+ maxLength?: number;
7
+ /**
8
+ * @description 输入的内容
9
+ * @descriptionEn Input content value
10
+ */
11
+ value: string;
12
+ /**
13
+ * @description 输入内容的类名
14
+ * @descriptionEn CSS class name for the input content
15
+ */
16
+ className?: string;
17
+ /**
18
+ * @description 输入内容的回调
19
+ * @descriptionEn Callback function when input value changes
20
+ */
21
+ onChange?: (value: string) => void;
22
+ /**
23
+ * @description 可以插入的变量列表
24
+ * @descriptionEn Available variables for insertion
25
+ */
26
+ variables?: Array<{
27
+ code: string;
28
+ }>;
29
+ /**
30
+ * @description 新增变量的触发回调
31
+ * @descriptionEn Callback function to create new variable
32
+ */
33
+ onCreate?: () => void;
34
+ /**
35
+ * @description 新增变量的按钮文本
36
+ * @descriptionEn Text of the create variable button
37
+ */
38
+ createBtnText?: string;
39
+ }
40
+ export declare const langExtensionsMap: Record<string, any[]>;
41
+ declare const CodeMirrorWrapper: (props: PromptsEditorProps) => import("react/jsx-runtime").JSX.Element;
42
+ export default CodeMirrorWrapper;
@@ -0,0 +1,134 @@
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
+ 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
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
+ 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); }
6
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
+ 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
+ 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
+ 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
+ // @ts-nocheck
18
+ import { SparkEnterLine } from '@agentscope-ai/icons';
19
+ import { markdown } from '@codemirror/lang-markdown';
20
+ import { vscodeDark, vscodeLight } from '@uiw/codemirror-theme-vscode';
21
+ import CodeMirror from '@uiw/react-codemirror';
22
+ import { ConfigProvider, theme } from 'antd';
23
+ import { createStyles } from 'antd-style';
24
+ import classNames from 'classnames';
25
+ import React, { useEffect, useMemo, useState } from 'react';
26
+ import VarRender from "./VarRender";
27
+ import VarSelectInput from "./VarSelectInput";
28
+ import { jsx as _jsx } from "react/jsx-runtime";
29
+ 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 .\u037C2 .cm-tooltip li:last-of-type,\n .\u037C3 .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 .\u037C2 .cm-tooltip ul,\n .\u037C3 .cm-tooltip ul {\n margin-bottom: 40px !important;\n }\n\n .\u037C2 .cm-tooltip li:first-of-type,\n .\u037C3 .cm-tooltip li:first-of-type {\n border-top: none !important;\n }\n "])), token.colorBorderSecondary, token.colorBgContainer),
35
+ cm: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .\u037Cs \u037Cy,\n .\u037Cs,\n .\u037Cy {\n color: ", " !important;\n }\n\n .\u037Co {\n color: ", " !important;\n }\n\n .\u037C16 {\n background-color: transparent !important;\n }\n\n .cm-editor {\n position: absolute !important;\n top: 0;\n left: 8px;\n right: 0;\n bottom: 30px;\n }\n .cm-focused {\n outline: none;\n }\n\n .\u037C1 .cm-content {\n width: 100%;\n padding: 8px 0;\n white-space: break-spaces;\n }\n\n .cm-line {\n line-height: 24px;\n }\n\n .cm-prompt-var {\n font-size: inherit;\n color: ", ";\n background-color: ", ";\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 .\u037C2 .cm-tooltip,\n .\u037C3 .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 .\u037C2 .cm-tooltip ul,\n .\u037C3 .cm-tooltip ul {\n max-height: 17em !important;\n display: flex;\n flex-direction: column;\n }\n\n .\u037C2 .cm-tooltip li,\n .\u037C3 .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 .\u037C2 .cm-tooltip-autocomplete ul li[aria-selected],\n .\u037C3 .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 .\u037C1 .cm-completionIcon {\n display: none;\n }\n "])), token.colorBlue, token.colorTextSecondary, 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
+ export var langExtensionsMap = {
68
+ markdown: [markdown()]
69
+ };
70
+ var empty = [];
71
+ var CodeMirrorWrapper = function CodeMirrorWrapper(props) {
72
+ var _useStyles = useStyles(),
73
+ styles = _useStyles.styles;
74
+ var variables = props.variables || empty;
75
+ var _useState = useState(false),
76
+ _useState2 = _slicedToArray(_useState, 2),
77
+ ready = _useState2[0],
78
+ setReady = _useState2[1];
79
+ var onCreate = props.onCreate;
80
+ var context = React.useContext(ConfigProvider.ConfigContext);
81
+ var isDarkMode = context.theme.algorithm === theme.darkAlgorithm;
82
+ var createBtnText = props.createBtnText || '+ 新增变量';
83
+ var getTheme = useMemo(function () {
84
+ if (isDarkMode) {
85
+ return vscodeDark;
86
+ }
87
+ return vscodeLight;
88
+ }, [isDarkMode]);
89
+ var extensions = useMemo(function () {
90
+ return [].concat(_toConsumableArray(langExtensionsMap['markdown']), _toConsumableArray(VarRender), [VarSelectInput(_toConsumableArray(variables).map(function (item) {
91
+ return {
92
+ label: "/".concat(item.code),
93
+ info: item.label
94
+ };
95
+ }) || [], {
96
+ onCreate: onCreate,
97
+ createBtnText: createBtnText
98
+ })]);
99
+ }, [variables]);
100
+ useEffect(function () {
101
+ setReady(true);
102
+ return function () {
103
+ setReady(false);
104
+ };
105
+ }, []);
106
+ if (!ready) return null;
107
+ return /*#__PURE__*/_jsxs("div", {
108
+ className: styles.root,
109
+ children: [/*#__PURE__*/_jsx(CodeMirror, {
110
+ className: classNames(styles.cm, _defineProperty({}, styles.onCreate, onCreate)),
111
+ extensions: extensions,
112
+ value: props.value,
113
+ theme: getTheme,
114
+ lang: "markdown",
115
+ onChange: props.onChange,
116
+ basicSetup: {
117
+ lineNumbers: false,
118
+ foldGutter: false,
119
+ highlightActiveLine: false
120
+ }
121
+ }, getTheme), /*#__PURE__*/_jsxs("div", {
122
+ className: styles.footer,
123
+ children: [/*#__PURE__*/_jsxs("div", {
124
+ className: styles.tips,
125
+ children: ["\u8F93\u5165\"/\"\u5F15\u7528\u53D8\u91CF\uFF0C\u652F\u6301 ", /*#__PURE__*/_jsx(SparkEnterLine, {
126
+ size: 16
127
+ }), " \u56DE\u8F66\u65B0\u589E"]
128
+ }), props.maxLength ? /*#__PURE__*/_jsxs("div", {
129
+ children: [props.value.length, "/", props.maxLength]
130
+ }) : null]
131
+ })]
132
+ });
133
+ };
134
+ export default CodeMirrorWrapper;
@@ -3,7 +3,6 @@ import { SparkEffciencyLine } from '@agentscope-ai/icons';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export default (function () {
5
5
  return /*#__PURE__*/_jsx(Tag, {
6
- color: "mauve",
7
6
  icon: /*#__PURE__*/_jsx(SparkEffciencyLine, {
8
7
  style: {
9
8
  fontSize: '20px'
@@ -9,7 +9,6 @@ export default (function () {
9
9
  align: "center",
10
10
  gap: 16,
11
11
  children: [/*#__PURE__*/_jsx(Tag, {
12
- color: "mauve",
13
12
  closeIcon: /*#__PURE__*/_jsx(SparkFalseLine, {
14
13
  style: {
15
14
  fontSize: '20px'
@@ -17,7 +16,6 @@ export default (function () {
17
16
  }),
18
17
  children: "Tag MD"
19
18
  }), /*#__PURE__*/_jsx(Tag, {
20
- color: "mauve",
21
19
  icon: /*#__PURE__*/_jsx(SparkEffciencyLine, {
22
20
  style: {
23
21
  fontSize: '20px'
@@ -19,7 +19,7 @@ var SparkTag = /*#__PURE__*/forwardRef(function (props, ref) {
19
19
  _props$bordered = props.bordered,
20
20
  bordered = _props$bordered === void 0 ? false : _props$bordered,
21
21
  _props$color = props.color,
22
- color = _props$color === void 0 ? 'purple' : _props$color,
22
+ color = _props$color === void 0 ? 'mauve' : _props$color,
23
23
  _props$size = props.size,
24
24
  size = _props$size === void 0 ? 'middle' : _props$size,
25
25
  restProps = _objectWithoutProperties(props, _excluded);
@@ -32,9 +32,6 @@ var SparkTooltip = /*#__PURE__*/forwardRef(function (props, ref) {
32
32
  getPopupContainer: getPopupContainer || function (triggerNode) {
33
33
  return findClosestBySelector(triggerNode, ".".concat(antPrefix, "-app")); // 默认放到App组件下,获取自定义css变量
34
34
  },
35
- align: align || {
36
- offset: [0, -12]
37
- },
38
35
  ref: ref
39
36
  }));
40
37
  });
package/lib/index.d.ts CHANGED
@@ -30,6 +30,7 @@ export { default as notification } from './components/commonComponents/Notificat
30
30
  export { default as Pagination, type SparkPaginationProps as PaginationProps, } from './components/commonComponents/Pagination';
31
31
  export { default as Popconfirm, type SparkPopconfirmProps as PopconfirmProps, } from './components/commonComponents/Popconfirm';
32
32
  export { default as Popover } from './components/commonComponents/Popover';
33
+ export { default as PromptsEditor, type PromptsEditorProps, } from './components/commonComponents/PromptsEditor';
33
34
  export { default as RadioButton, type SparkRadioButtonProps as RadioButtonProps, } from './components/commonComponents/RadioButton';
34
35
  export { default as Result, type SparkResultProps, } from './components/commonComponents/Result';
35
36
  export { default as Steps } from './components/commonComponents/Steps';
package/lib/index.js CHANGED
@@ -1,3 +1,7 @@
1
+ import bailianDarkThemeJson from "./antd/themes/bailianDarkTheme.json";
2
+ import bailianThemeJson from "./antd/themes/bailianTheme.json";
3
+ import carbonDarkThemeJson from "./antd/themes/carbonDarkTheme.json";
4
+ import carbonThemeJson from "./antd/themes/carbonTheme.json";
1
5
  import generateThemeByToken from "./antd/themes/generateThemeByToken";
2
6
 
3
7
  /**
@@ -31,6 +35,7 @@ export { default as notification } from "./components/commonComponents/Notificat
31
35
  export { default as Pagination } from "./components/commonComponents/Pagination";
32
36
  export { default as Popconfirm } from "./components/commonComponents/Popconfirm";
33
37
  export { default as Popover } from "./components/commonComponents/Popover";
38
+ export { default as PromptsEditor } from "./components/commonComponents/PromptsEditor";
34
39
  export { default as RadioButton } from "./components/commonComponents/RadioButton";
35
40
  export { default as Result } from "./components/commonComponents/Result";
36
41
  export { default as Steps } from "./components/commonComponents/Steps";
@@ -75,9 +80,9 @@ export { base64Decoder, base64Encoder, parseJsonSafely } from "./libs/string";
75
80
  /**
76
81
  * 主题
77
82
  */
78
- var bailianTheme = generateThemeByToken(require("./antd/themes/bailianTheme.json"));
79
- var bailianDarkTheme = generateThemeByToken(require("./antd/themes/bailianDarkTheme.json"), true);
80
- var carbonTheme = generateThemeByToken(require("./antd/themes/carbonTheme.json"));
81
- var carbonDarkTheme = generateThemeByToken(require("./antd/themes/carbonDarkTheme.json"), true);
83
+ var bailianTheme = generateThemeByToken(bailianThemeJson);
84
+ var bailianDarkTheme = generateThemeByToken(bailianDarkThemeJson, true);
85
+ var carbonTheme = generateThemeByToken(carbonThemeJson);
86
+ var carbonDarkTheme = generateThemeByToken(carbonDarkThemeJson, true);
82
87
  export { FileCard, default as FileIcon } from "./components/commonComponents/FileIcon";
83
88
  export { bailianDarkTheme, bailianTheme, carbonDarkTheme, carbonTheme, generateThemeByToken, bailianDarkTheme as purpleDarkTheme, bailianTheme as purpleTheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/design",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Basic components for the best experience of LLM",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -33,7 +33,7 @@
33
33
  "lint:css": "stylelint --fix \"{src,test}/**/*.{css,less}\"",
34
34
  "lint:es": "eslint --fix \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
35
35
  "prepare": "husky install && dumi setup",
36
- "prepublishOnly": "father doctor && npm run build",
36
+ "prepublishOnly": "npm run build",
37
37
  "prettier": "prettier --write src/",
38
38
  "start": "npm run dev",
39
39
  "test": "vitest"
@@ -61,7 +61,8 @@
61
61
  ]
62
62
  },
63
63
  "dependencies": {
64
- "@agentscope-ai/icons": "^1.0.17",
64
+ "@agentscope-ai/icons": "^1.0.19",
65
+ "@codemirror/autocomplete": "^6.18.7",
65
66
  "@codemirror/lang-cpp": "^6.0.2",
66
67
  "@codemirror/lang-css": "^6.3.1",
67
68
  "@codemirror/lang-go": "^6.0.1",
@@ -69,15 +70,18 @@
69
70
  "@codemirror/lang-java": "^6.0.1",
70
71
  "@codemirror/lang-javascript": "^6.2.3",
71
72
  "@codemirror/lang-json": "^6.0.1",
73
+ "@codemirror/lang-markdown": "^6.3.4",
72
74
  "@codemirror/lang-php": "^6.0.1",
73
75
  "@codemirror/lang-python": "^6.1.7",
74
76
  "@codemirror/lang-yaml": "^6.1.2",
75
77
  "@codemirror/lint": "^6.8.4",
76
78
  "@emotion/react": "^11.14.0",
77
79
  "@agentscope-ai/icons-override-antd": "6.0.0",
80
+ "@uiw/codemirror-extensions-mentions": "^4.25.1",
78
81
  "@uiw/codemirror-theme-vscode": "^4.23.7",
79
82
  "@uiw/react-codemirror": "4.20.2",
80
83
  "ahooks": "^3.7.8",
84
+ "antd-style": "^3.7.1",
81
85
  "dayjs": "^1.11.7",
82
86
  "dompurify": "^2.3.8",
83
87
  "js-cookie": "^3.0.5",
@@ -92,11 +96,9 @@
92
96
  "@ali/alimefe-yuque": "^0.2.4",
93
97
  "@ali/dumi-plugin-api-parser": "^1.0.3",
94
98
  "@ali/dumi-plugin-llms": "1.0.3",
95
- "@ali/dumi-theme-spark": "^0.0.82",
96
- "@modelcontextprotocol/sdk": "1.17.3",
97
- "zod": "^3.24.2",
98
99
  "@commitlint/cli": "^17.1.2",
99
100
  "@commitlint/config-conventional": "^17.1.0",
101
+ "@modelcontextprotocol/sdk": "1.17.3",
100
102
  "@rc-component/util": "1.2.1",
101
103
  "@react-spring/web": "^9.7.5",
102
104
  "@tailwindcss/postcss": "^4.0.6",
@@ -145,7 +147,8 @@
145
147
  "ts-node": "^10.9.2",
146
148
  "typescript": "^5.6.3",
147
149
  "vitest": "^2.1.4",
148
- "yargs-parser": "^21.1.1"
150
+ "yargs-parser": "^21.1.1",
151
+ "zod": "^3.24.2"
149
152
  },
150
153
  "peerDependencies": {
151
154
  "@rc-component/util": "1.2.1",