@agentscope-ai/design 1.0.10 → 1.0.12

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 (63) hide show
  1. package/README.md +241 -71
  2. package/lib/antd/styles/select.style.js +7 -1
  3. package/lib/antd/themes/bailianDarkTheme.json +7 -0
  4. package/lib/antd/themes/bailianTheme.json +7 -0
  5. package/lib/antd/themes/carbonDarkTheme.json +7 -0
  6. package/lib/antd/themes/carbonTheme.json +3 -0
  7. package/lib/antd/themes/generateTheme.d.ts +132 -0
  8. package/lib/antd/themes/generateTheme.js +328 -0
  9. package/lib/components/commonComponents/AlertDialog/index.d.ts +325 -37
  10. package/lib/components/commonComponents/AlertDialog/index.js +3 -153
  11. package/lib/components/commonComponents/AlertDialog/index.style.js +14 -2
  12. package/lib/components/commonComponents/AlertDialog/mobile.d.ts +38 -0
  13. package/lib/components/commonComponents/AlertDialog/mobile.js +188 -0
  14. package/lib/components/commonComponents/AlertDialog/pc.d.ts +38 -0
  15. package/lib/components/commonComponents/AlertDialog/pc.js +152 -0
  16. package/lib/components/commonComponents/Anchor/index.js +1 -1
  17. package/lib/components/commonComponents/Button/index.js +5 -3
  18. package/lib/components/commonComponents/CodeBlock/index.js +1 -2
  19. package/lib/components/commonComponents/CollapsePanel/index.js +1 -2
  20. package/lib/components/commonComponents/Drawer/index.style.js +42 -2
  21. package/lib/components/commonComponents/EllipsisTip/demo/demo2-1.d.ts +3 -0
  22. package/lib/components/commonComponents/EllipsisTip/demo/demo2-1.js +21 -0
  23. package/lib/components/commonComponents/InputNumber/demo/demo1.js +0 -3
  24. package/lib/components/commonComponents/Modal/index.d.ts +2 -16
  25. package/lib/components/commonComponents/Modal/index.js +3 -71
  26. package/lib/components/commonComponents/Modal/index.style.js +62 -2
  27. package/lib/components/commonComponents/Modal/mobile.d.ts +28 -0
  28. package/lib/components/commonComponents/Modal/mobile.js +97 -0
  29. package/lib/components/commonComponents/Modal/pc.d.ts +28 -0
  30. package/lib/components/commonComponents/Modal/pc.js +72 -0
  31. package/lib/components/commonComponents/Pagination/index.js +4 -2
  32. package/lib/components/commonComponents/Pagination/index.style.js +11 -3
  33. package/lib/components/commonComponents/PromptsEditor/VarRender.js +6 -1
  34. package/lib/components/commonComponents/PromptsEditor/VarSelectInput.js +3 -2
  35. package/lib/components/commonComponents/PromptsEditor/demo/basic.js +2 -0
  36. package/lib/components/commonComponents/PromptsEditor/index.js +1 -1
  37. package/lib/components/commonComponents/RadioButton/index.js +1 -5
  38. package/lib/components/commonComponents/Table/demo/demo1.js +13 -23
  39. package/lib/components/commonComponents/Table/index.js +3 -1
  40. package/lib/components/commonComponents/Table/index.style.js +1 -3
  41. package/lib/components/commonComponents/Tag/index.d.ts +10 -1
  42. package/lib/components/commonComponents/Tag/index.js +13 -1
  43. package/lib/components/commonComponents/Tooltip/index.js +1 -2
  44. package/lib/components/commonComponents/Video/Control.js +3 -3
  45. package/lib/config.d.ts +2 -0
  46. package/lib/i18n/index.js +3 -0
  47. package/lib/i18n/strings/index.d.ts +2 -0
  48. package/lib/index.d.ts +2 -4
  49. package/lib/index.js +2 -4
  50. package/lib/libs/env/index.d.ts +1 -1
  51. package/lib/libs/staticRenderer/index.js +12 -3
  52. package/lib/libs/utils/index.d.ts +1 -0
  53. package/lib/libs/utils/index.js +4 -0
  54. package/lib/typings.d.ts +2 -0
  55. package/package.json +18 -59
  56. package/lib/antd/styles/_readme.txt +0 -1
  57. package/lib/antd/themes/_readme.txt +0 -1
  58. package/lib/libs/generateCssVars/index.d.ts +0 -19
  59. package/lib/libs/generateCssVars/index.js +0 -39
  60. package/lib/libs/region/constant.d.ts +0 -6
  61. package/lib/libs/region/constant.js +0 -154
  62. package/lib/libs/region/index.d.ts +0 -2
  63. package/lib/libs/region/index.js +0 -18
@@ -0,0 +1,188 @@
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 _excluded = ["children", "type", "danger", "title", "width", "className"];
3
+ 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; }
4
+ 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; }
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
+ 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 _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
+ 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 $i18n from "../../../i18n";
11
+ import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, InfoCircleOutlined } from "@agentscope-ai/icons-override-antd";
12
+ import { Flex, Modal } from 'antd';
13
+ import classNames from 'classnames';
14
+ import { useEffect } from 'react';
15
+ import { getCommonConfig } from "../../../config";
16
+ import { useStyle } from "./index.style";
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { Fragment as _Fragment } from "react/jsx-runtime";
20
+ var lockBodyScroll = function lockBodyScroll() {
21
+ var originalStyle = window.getComputedStyle(document.body).overflow;
22
+ var originalPosition = window.getComputedStyle(document.body).position;
23
+ var scrollY = window.scrollY;
24
+ document.body.style.overflow = 'hidden';
25
+ document.body.style.position = 'fixed';
26
+ document.body.style.width = '100%';
27
+ document.body.style.top = "-".concat(scrollY, "px");
28
+
29
+ // 返回解锁函数
30
+ return function () {
31
+ document.body.style.overflow = originalStyle;
32
+ document.body.style.position = originalPosition;
33
+ document.body.style.width = '';
34
+ document.body.style.top = '';
35
+ window.scrollTo(0, scrollY);
36
+ };
37
+ };
38
+ var getCommonProps = function getCommonProps(props) {
39
+ var renderTitle = function renderTitle(_ref) {
40
+ var type = _ref.type,
41
+ title = _ref.title;
42
+ var _getCommonConfig = getCommonConfig(),
43
+ antPrefix = _getCommonConfig.antPrefix;
44
+ switch (type) {
45
+ case 'success':
46
+ return /*#__PURE__*/_jsxs(Flex, {
47
+ align: "center",
48
+ gap: 8,
49
+ className: "leading-[28px]",
50
+ children: [/*#__PURE__*/_jsx(CheckCircleOutlined, {
51
+ style: {
52
+ color: "var(--".concat(antPrefix, "-color-success)"),
53
+ fontSize: 18,
54
+ margin: '0 3px'
55
+ }
56
+ }), title]
57
+ });
58
+ case 'warning':
59
+ case 'confirm':
60
+ return /*#__PURE__*/_jsxs(Flex, {
61
+ align: "center",
62
+ gap: 8,
63
+ className: "leading-[28px]",
64
+ children: [/*#__PURE__*/_jsx(ExclamationCircleOutlined, {
65
+ style: {
66
+ color: "var(--".concat(antPrefix, "-color-warning)"),
67
+ fontSize: 18,
68
+ margin: '0 3px'
69
+ }
70
+ }), title]
71
+ });
72
+ case 'info':
73
+ return /*#__PURE__*/_jsxs(Flex, {
74
+ align: "center",
75
+ gap: 8,
76
+ className: "leading-[28px]",
77
+ children: [/*#__PURE__*/_jsx(InfoCircleOutlined, {
78
+ style: {
79
+ color: "var(--".concat(antPrefix, "-color-info)"),
80
+ fontSize: 18,
81
+ margin: '0 3px'
82
+ }
83
+ }), title]
84
+ });
85
+ case 'error':
86
+ return /*#__PURE__*/_jsxs(Flex, {
87
+ align: "center",
88
+ gap: 8,
89
+ className: "leading-[28px]",
90
+ children: [/*#__PURE__*/_jsx(CloseCircleOutlined, {
91
+ style: {
92
+ color: "var(--".concat(antPrefix, "-color-error)"),
93
+ fontSize: 18,
94
+ margin: '0 3px'
95
+ }
96
+ }), title]
97
+ });
98
+ default:
99
+ return $i18n.get({
100
+ id: 'components.commonComponents.AlertDialog.Prompt',
101
+ dm: '提示'
102
+ });
103
+ }
104
+ };
105
+ var children = props.children,
106
+ _props$type = props.type,
107
+ type = _props$type === void 0 ? 'info' : _props$type,
108
+ _props$danger = props.danger,
109
+ danger = _props$danger === void 0 ? false : _props$danger,
110
+ title = props.title,
111
+ _props$width = props.width,
112
+ width = _props$width === void 0 ? 'auto' : _props$width,
113
+ _props$className = props.className,
114
+ className = _props$className === void 0 ? '' : _props$className,
115
+ restProps = _objectWithoutProperties(props, _excluded);
116
+ return {
117
+ width: width,
118
+ transitionName: '',
119
+ restProps: restProps,
120
+ closeIcon: null,
121
+ title: renderTitle({
122
+ type: type,
123
+ title: title
124
+ }),
125
+ okButtonProps: {
126
+ danger: type === 'error' || type === 'warning' || danger
127
+ },
128
+ destroyOnClose: true,
129
+ className: classNames(className, 'animate-in', "".concat(getCommonConfig().sparkPrefix, "-alert-dialog")),
130
+ content: props.content || children,
131
+ children: children
132
+ };
133
+ };
134
+ var AlertDialog = function AlertDialog(props) {
135
+ var commonProps = getCommonProps(props);
136
+ var Style = useStyle();
137
+
138
+ // 移动端:禁止 body 滚动
139
+ useEffect(function () {
140
+ if (props.open) {
141
+ var unlock = lockBodyScroll();
142
+ return unlock;
143
+ }
144
+ }, [props.open]);
145
+ return /*#__PURE__*/_jsxs(_Fragment, {
146
+ children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({
147
+ width: commonProps.width,
148
+ transitionName: ""
149
+ }, commonProps.restProps), {}, {
150
+ closeIcon: null,
151
+ title: commonProps.title,
152
+ okButtonProps: commonProps.okButtonProps || {},
153
+ destroyOnClose: commonProps.destroyOnClose,
154
+ className: commonProps.className,
155
+ children: commonProps.content || commonProps.children
156
+ }))]
157
+ });
158
+ };
159
+ var staticFns = ['success', 'info', 'warning', 'error', 'confirm'];
160
+ staticFns.forEach(function (type) {
161
+ AlertDialog[type] = function (props) {
162
+ var commonProps = getCommonProps(_objectSpread(_objectSpread({}, props), {}, {
163
+ type: type
164
+ }));
165
+ var unlock = lockBodyScroll();
166
+ function Content() {
167
+ var Style = useStyle();
168
+ return /*#__PURE__*/_jsxs(_Fragment, {
169
+ children: [/*#__PURE__*/_jsx(Style, {}), commonProps.content]
170
+ });
171
+ }
172
+
173
+ // @ts-ignore
174
+ return Modal.confirm(_objectSpread(_objectSpread(_objectSpread({}, commonProps), commonProps.restProps), {}, {
175
+ content: /*#__PURE__*/_jsx(Content, {}),
176
+ icon: null,
177
+ afterClose: function afterClose() {
178
+ var _commonProps$restProp;
179
+ unlock();
180
+ if ((_commonProps$restProp = commonProps.restProps) !== null && _commonProps$restProp !== void 0 && _commonProps$restProp.afterClose) {
181
+ var _commonProps$restProp2;
182
+ (_commonProps$restProp2 = commonProps.restProps).afterClose.apply(_commonProps$restProp2, arguments);
183
+ }
184
+ }
185
+ }));
186
+ };
187
+ });
188
+ export default AlertDialog;
@@ -0,0 +1,38 @@
1
+ import { ModalProps } from "../../../index";
2
+ import { SyntheticEvent } from 'react';
3
+ export interface AlertDialogProps extends ModalProps {
4
+ /**
5
+ * @description 类型
6
+ * @descriptionEn type
7
+ * @default info
8
+ */
9
+ type?: 'success' | 'info' | 'warning' | 'error' | 'confirm';
10
+ /**
11
+ * @description 确认按钮是否带有danger属性
12
+ * @descriptionEn whether the confirm button has a danger property
13
+ * @default false
14
+ */
15
+ danger?: boolean;
16
+ /**
17
+ * @description 内容
18
+ * @descriptionEn content
19
+ * @default -
20
+ */
21
+ content?: React.ReactNode;
22
+ /**
23
+ * @description 关闭时触发的回调函数
24
+ * @descriptionEn callback function triggered when closed
25
+ * @default -
26
+ */
27
+ onClose?: (e: SyntheticEvent<Element, Event>) => any;
28
+ }
29
+ type AlertDialogStaticProps = Omit<AlertDialogProps, 'type' | 'open'>;
30
+ declare const _default: {
31
+ (props: AlertDialogProps): JSX.Element;
32
+ success: (props?: AlertDialogStaticProps) => void;
33
+ info: (props?: AlertDialogStaticProps) => void;
34
+ warning: (props?: AlertDialogStaticProps) => void;
35
+ error: (props?: AlertDialogStaticProps) => void;
36
+ confirm: (props?: AlertDialogStaticProps) => void;
37
+ };
38
+ export default _default;
@@ -0,0 +1,152 @@
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 _excluded = ["children", "type", "danger", "title", "width", "className"];
3
+ 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; }
4
+ 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; }
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
+ 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 _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
+ 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 $i18n from "../../../i18n";
11
+ import { CheckCircleOutlined, CloseCircleOutlined, ExclamationCircleOutlined, InfoCircleOutlined } from "@agentscope-ai/icons-override-antd";
12
+ import { Flex, Modal } from 'antd';
13
+ import classNames from 'classnames';
14
+ import { getCommonConfig } from "../../../config";
15
+ import { useStyle } from "./index.style";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { Fragment as _Fragment } from "react/jsx-runtime";
19
+ var getCommonProps = function getCommonProps(props) {
20
+ var renderTitle = function renderTitle(_ref) {
21
+ var type = _ref.type,
22
+ title = _ref.title;
23
+ var _getCommonConfig = getCommonConfig(),
24
+ antPrefix = _getCommonConfig.antPrefix;
25
+ switch (type) {
26
+ case 'success':
27
+ return /*#__PURE__*/_jsxs(Flex, {
28
+ align: "center",
29
+ gap: 8,
30
+ className: "leading-[28px]",
31
+ children: [/*#__PURE__*/_jsx(CheckCircleOutlined, {
32
+ style: {
33
+ color: "var(--".concat(antPrefix, "-color-success)"),
34
+ fontSize: 18,
35
+ margin: '0 3px'
36
+ }
37
+ }), title]
38
+ });
39
+ case 'warning':
40
+ case 'confirm':
41
+ return /*#__PURE__*/_jsxs(Flex, {
42
+ align: "center",
43
+ gap: 8,
44
+ className: "leading-[28px]",
45
+ children: [/*#__PURE__*/_jsx(ExclamationCircleOutlined, {
46
+ style: {
47
+ color: "var(--".concat(antPrefix, "-color-warning)"),
48
+ fontSize: 18,
49
+ margin: '0 3px'
50
+ }
51
+ }), title]
52
+ });
53
+ case 'info':
54
+ return /*#__PURE__*/_jsxs(Flex, {
55
+ align: "center",
56
+ gap: 8,
57
+ className: "leading-[28px]",
58
+ children: [/*#__PURE__*/_jsx(InfoCircleOutlined, {
59
+ style: {
60
+ color: "var(--".concat(antPrefix, "-color-info)"),
61
+ fontSize: 18,
62
+ margin: '0 3px'
63
+ }
64
+ }), title]
65
+ });
66
+ case 'error':
67
+ return /*#__PURE__*/_jsxs(Flex, {
68
+ align: "center",
69
+ gap: 8,
70
+ className: "leading-[28px]",
71
+ children: [/*#__PURE__*/_jsx(CloseCircleOutlined, {
72
+ style: {
73
+ color: "var(--".concat(antPrefix, "-color-error)"),
74
+ fontSize: 18,
75
+ margin: '0 3px'
76
+ }
77
+ }), title]
78
+ });
79
+ default:
80
+ return $i18n.get({
81
+ id: 'components.commonComponents.AlertDialog.Prompt',
82
+ dm: '提示'
83
+ });
84
+ }
85
+ };
86
+ var children = props.children,
87
+ _props$type = props.type,
88
+ type = _props$type === void 0 ? 'info' : _props$type,
89
+ _props$danger = props.danger,
90
+ danger = _props$danger === void 0 ? false : _props$danger,
91
+ title = props.title,
92
+ _props$width = props.width,
93
+ width = _props$width === void 0 ? '400px' : _props$width,
94
+ _props$className = props.className,
95
+ className = _props$className === void 0 ? '' : _props$className,
96
+ restProps = _objectWithoutProperties(props, _excluded);
97
+ return {
98
+ width: width,
99
+ transitionName: '',
100
+ restProps: restProps,
101
+ closeIcon: null,
102
+ title: renderTitle({
103
+ type: type,
104
+ title: title
105
+ }),
106
+ okButtonProps: {
107
+ danger: type === 'error' || type === 'warning' || danger
108
+ },
109
+ destroyOnClose: true,
110
+ className: classNames(className, 'animate-in', "".concat(getCommonConfig().sparkPrefix, "-alert-dialog")),
111
+ content: props.content || children,
112
+ children: children
113
+ };
114
+ };
115
+ var AlertDialog = function AlertDialog(props) {
116
+ var commonProps = getCommonProps(props);
117
+ var Style = useStyle();
118
+ return /*#__PURE__*/_jsxs(_Fragment, {
119
+ children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({
120
+ width: commonProps.width,
121
+ transitionName: ""
122
+ }, commonProps.restProps), {}, {
123
+ closeIcon: null,
124
+ title: commonProps.title,
125
+ okButtonProps: commonProps.okButtonProps || {},
126
+ destroyOnClose: commonProps.destroyOnClose,
127
+ className: commonProps.className,
128
+ children: commonProps.content || commonProps.children
129
+ }))]
130
+ });
131
+ };
132
+ var staticFns = ['success', 'info', 'warning', 'error', 'confirm'];
133
+ staticFns.forEach(function (type) {
134
+ AlertDialog[type] = function (props) {
135
+ var commonProps = getCommonProps(_objectSpread(_objectSpread({}, props), {}, {
136
+ type: type
137
+ }));
138
+ function Content() {
139
+ var Style = useStyle();
140
+ return /*#__PURE__*/_jsxs(_Fragment, {
141
+ children: [/*#__PURE__*/_jsx(Style, {}), commonProps.content]
142
+ });
143
+ }
144
+
145
+ // @ts-ignore
146
+ return Modal.confirm(_objectSpread(_objectSpread(_objectSpread({}, commonProps), commonProps.restProps), {}, {
147
+ content: /*#__PURE__*/_jsx(Content, {}),
148
+ icon: null
149
+ }));
150
+ };
151
+ });
152
+ export default AlertDialog;
@@ -10,7 +10,7 @@ import { useStyle } from "./index.style";
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { Fragment as _Fragment } from "react/jsx-runtime";
12
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
- var SparkAnchor = /*#__PURE__*/forwardRef(function (props, ref) {
13
+ var SparkAnchor = /*#__PURE__*/forwardRef(function (props) {
14
14
  var Style = useStyle();
15
15
  return /*#__PURE__*/_jsxs(_Fragment, {
16
16
  children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Anchor, _objectSpread({}, props))]
@@ -7,12 +7,12 @@ 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 { Tooltip } from "../../..";
10
11
  import { SparkLoadingLine } from '@agentscope-ai/icons';
11
12
  import { Button as AntdButton, ConfigProvider, theme } from 'antd';
12
13
  import classNames from 'classnames';
13
14
  import React, { forwardRef, useMemo } from 'react';
14
15
  import IconFont from "../IconFont";
15
- import { Tooltip } from "../../..";
16
16
 
17
17
  // @ts-ignore
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -78,8 +78,10 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
78
78
  return /*#__PURE__*/_jsx(ConfigProvider, {
79
79
  theme: {
80
80
  token: {
81
- colorPrimary: token.token.colorText,
82
- colorPrimaryHover: token.token.colorTextSecondary,
81
+ // @ts-ignore
82
+ colorPrimary: token.token.colorSlate,
83
+ // @ts-ignore
84
+ colorPrimaryHover: token.token.colorSlateHover,
83
85
  colorPrimaryActive: token.token.colorTextBase
84
86
  }
85
87
  },
@@ -67,8 +67,7 @@ var CodeMirrorWrapper = function CodeMirrorWrapper(props) {
67
67
  var commonConfig = getCommonConfig();
68
68
  var context = React.useContext(ConfigProvider.ConfigContext);
69
69
  var isDarkMode = ((_context$theme = context.theme) === null || _context$theme === void 0 ? void 0 : _context$theme.algorithm) === theme.darkAlgorithm;
70
- var sparkPrefix = commonConfig.sparkPrefix,
71
- antPrefix = commonConfig.antPrefix;
70
+ var sparkPrefix = commonConfig.sparkPrefix;
72
71
  var Style = useStyle();
73
72
  var getTheme = useMemo(function () {
74
73
  if (props.theme === undefined) {
@@ -42,8 +42,7 @@ var CollapsePanel = function CollapsePanel(props) {
42
42
  setContentHeight = _useState6[1];
43
43
  var contentRef = useRef(null);
44
44
  var commonConfig = getCommonConfig();
45
- var sparkPrefix = commonConfig.sparkPrefix,
46
- antPrefix = commonConfig.antPrefix;
45
+ var sparkPrefix = commonConfig.sparkPrefix;
47
46
  var Style = useStyle();
48
47
  useEffect(function () {
49
48
  if (contentRef.current) {
@@ -1,7 +1,47 @@
1
- var _templateObject;
1
+ var _templateObject, _templateObject2;
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.", "-drawer {\n .", "-drawer-header {\n padding: 16px 20px;\n border-bottom: none;\n \n .", "-drawer-header-title {\n display: flex;\n flex-direction: row-reverse;\n \n .", "-drawer-title {\n font-size: 16px;\n font-weight: 500;\n line-height: 28px;\n color: var(--", "-color-text);\n }\n \n .", "-drawer-close {\n width: 32px;\n height: 32px;\n }\n }\n }\n \n .", "-drawer-body {\n --", "-padding-lg: 20px;\n }\n \n .", "-drawer-footer {\n padding: 16px 20px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: none;\n \n .", "-drawer-footer-info {\n font-size: 14px;\n line-height: 24px;\n color: var(--", "-color-text-tertiary);\n }\n \n .", "-drawer-footer-buttons {\n display: flex;\n gap: 12px;\n }\n }\n \n .", "-drawer-close {\n color: var(--", "-color-text);\n margin: 0;\n }\n}\n\n.", "-drawer.", "-show-divider {\n .", "-drawer-header {\n border-bottom: 1px solid var(--", "-color-border-secondary);\n }\n \n .", "-drawer-footer {\n border-top: 1px solid var(--", "-color-border-secondary);\n }\n}\n"])), function (p) {
4
+ export var useStyle = MOBILE ? createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-drawer {\n .", "-drawer-header {\n padding: 12px 20px;\n border-bottom: none;\n \n .", "-drawer-header-title {\n display: flex;\n flex-direction: row;\n \n .", "-drawer-title {\n font-size: 16px;\n font-weight: 500;\n line-height: 28px;\n color: var(--", "-color-text);\n display: flex;\n justify-content: center;\n padding-right: 32px;\n }\n \n .", "-drawer-close {\n width: 32px;\n height: 32px;\n }\n }\n }\n \n .", "-drawer-body {\n --", "-padding-lg: 20px;\n }\n \n .", "-drawer-footer {\n padding: 16px 20px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: none;\n \n .", "-drawer-footer-info {\n font-size: 14px;\n line-height: 24px;\n color: var(--", "-color-text-tertiary);\n }\n \n .", "-drawer-footer-buttons {\n display: flex;\n gap: 12px;\n }\n }\n \n .", "-drawer-close {\n color: var(--", "-color-text);\n margin: 0;\n }\n}\n\n.", "-drawer.", "-show-divider {\n .", "-drawer-header {\n border-bottom: 1px solid var(--", "-color-border-secondary);\n }\n \n .", "-drawer-footer {\n border-top: 1px solid var(--", "-color-border-secondary);\n }\n}\n"])), function (p) {
5
+ return p.sparkPrefix;
6
+ }, function (p) {
7
+ return p.antPrefix;
8
+ }, function (p) {
9
+ return p.antPrefix;
10
+ }, function (p) {
11
+ return p.antPrefix;
12
+ }, function (p) {
13
+ return p.antPrefix;
14
+ }, function (p) {
15
+ return p.antPrefix;
16
+ }, function (p) {
17
+ return p.antPrefix;
18
+ }, function (p) {
19
+ return p.antPrefix;
20
+ }, function (p) {
21
+ return p.antPrefix;
22
+ }, function (p) {
23
+ return p.antPrefix;
24
+ }, function (p) {
25
+ return p.antPrefix;
26
+ }, function (p) {
27
+ return p.antPrefix;
28
+ }, function (p) {
29
+ return p.antPrefix;
30
+ }, function (p) {
31
+ return p.antPrefix;
32
+ }, function (p) {
33
+ return p.sparkPrefix;
34
+ }, function (p) {
35
+ return p.antPrefix;
36
+ }, function (p) {
37
+ return p.antPrefix;
38
+ }, function (p) {
39
+ return p.antPrefix;
40
+ }, function (p) {
41
+ return p.antPrefix;
42
+ }, function (p) {
43
+ return p.antPrefix;
44
+ }) : createGlobalStyle(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n.", "-drawer {\n .", "-drawer-header {\n padding: 16px 20px;\n border-bottom: none;\n \n .", "-drawer-header-title {\n display: flex;\n flex-direction: row-reverse;\n \n .", "-drawer-title {\n font-size: 16px;\n font-weight: 500;\n line-height: 28px;\n color: var(--", "-color-text);\n }\n \n .", "-drawer-close {\n width: 32px;\n height: 32px;\n }\n }\n }\n \n .", "-drawer-body {\n --", "-padding-lg: 20px;\n }\n \n .", "-drawer-footer {\n padding: 16px 20px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: none;\n \n .", "-drawer-footer-info {\n font-size: 14px;\n line-height: 24px;\n color: var(--", "-color-text-tertiary);\n }\n \n .", "-drawer-footer-buttons {\n display: flex;\n gap: 12px;\n }\n }\n \n .", "-drawer-close {\n color: var(--", "-color-text);\n margin: 0;\n }\n}\n\n.", "-drawer.", "-show-divider {\n .", "-drawer-header {\n border-bottom: 1px solid var(--", "-color-border-secondary);\n }\n \n .", "-drawer-footer {\n border-top: 1px solid var(--", "-color-border-secondary);\n }\n}\n"])), function (p) {
5
45
  return p.sparkPrefix;
6
46
  }, function (p) {
7
47
  return p.antPrefix;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const App: React.FC;
3
+ export default App;
@@ -0,0 +1,21 @@
1
+ import { EllipsisTip } from "../../../..";
2
+ import React from 'react';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { Fragment as _Fragment } from "react/jsx-runtime";
5
+ var App = function App() {
6
+ var tags = ['短标签', '超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容超长标签内容'];
7
+ return /*#__PURE__*/_jsx(_Fragment, {
8
+ children: tags.map(function (tag) {
9
+ return /*#__PURE__*/_jsx("div", {
10
+ style: {
11
+ marginBottom: '12px'
12
+ },
13
+ children: /*#__PURE__*/_jsx(EllipsisTip, {
14
+ tooltip: tag,
15
+ children: tag
16
+ })
17
+ }, tag);
18
+ })
19
+ });
20
+ };
21
+ export default App;
@@ -6,9 +6,6 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
6
6
  var onChange = function onChange(value) {
7
7
  console.log('changed', value);
8
8
  };
9
- var onChange1 = function onChange1(value) {
10
- console.log('changed', value);
11
- };
12
9
  var App = function App() {
13
10
  return /*#__PURE__*/_jsxs(Flex, {
14
11
  vertical: true,
@@ -1,20 +1,5 @@
1
- /// <reference types="react" />
2
- import { ModalProps } from 'antd';
3
- export interface SparkModalProps extends ModalProps {
4
- /**
5
- * @description 底部额外内容
6
- * @descriptionEn footer extra content
7
- */
8
- info?: string | React.ReactNode;
9
- /**
10
- * @description 是否显示分割线
11
- * @descriptionEn whether to show divider
12
- * @default true
13
- */
14
- showDivider?: boolean;
15
- }
16
1
  declare const SparkModal: {
17
- (props: SparkModalProps): import("react/jsx-runtime").JSX.Element;
2
+ (props: import("./mobile").SparkModalProps): import("react/jsx-runtime").JSX.Element;
18
3
  useModal: typeof import("antd/es/modal/useModal").default;
19
4
  success: import("antd/es/modal/confirm").ModalFunc;
20
5
  error: import("antd/es/modal/confirm").ModalFunc;
@@ -26,3 +11,4 @@ declare const SparkModal: {
26
11
  LARGE_WIDTH: number;
27
12
  };
28
13
  export default SparkModal;
14
+ export type { SparkModalProps } from './pc';
@@ -1,72 +1,4 @@
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 _excluded = ["showDivider", "closable"];
3
- 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; }
4
- 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; }
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
- 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 _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
- 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 { getCommonConfig } from "../../../config";
11
- import { CloseOutlined } from '@agentscope-ai/icons-override-antd';
12
- import { Modal } from 'antd';
13
- import classNames from 'classnames';
14
- import { useStyle } from "./index.style";
15
- import { jsx as _jsx } from "react/jsx-runtime";
16
- import { jsxs as _jsxs } from "react/jsx-runtime";
17
- import { Fragment as _Fragment } from "react/jsx-runtime";
18
- var SparkModal = function SparkModal(props) {
19
- var Style = useStyle();
20
- var _getCommonConfig = getCommonConfig(),
21
- sparkPrefix = _getCommonConfig.sparkPrefix;
22
- var _props$showDivider = props.showDivider,
23
- showDivider = _props$showDivider === void 0 ? true : _props$showDivider,
24
- _props$closable = props.closable,
25
- closable = _props$closable === void 0 ? true : _props$closable,
26
- restProps = _objectWithoutProperties(props, _excluded);
27
- var renderFooter = function renderFooter(originNode) {
28
- return props.info ? /*#__PURE__*/_jsxs("div", {
29
- className: "".concat(sparkPrefix, "-modal-footer-wrapper"),
30
- children: [/*#__PURE__*/_jsx("span", {
31
- className: "".concat(sparkPrefix, "-modal-footer-info"),
32
- children: props.info
33
- }), /*#__PURE__*/_jsx("div", {
34
- className: "".concat(sparkPrefix, "-modal-footer-origin-node"),
35
- children: originNode
36
- })]
37
- }) : originNode;
38
- };
39
- var mergedCloseIcon = closable ? props.closeIcon || /*#__PURE__*/_jsx(CloseOutlined, {
40
- className: "".concat(sparkPrefix, "-modal-title-close"),
41
- onClick: function onClick(e) {
42
- var _props$onCancel;
43
- (_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 || _props$onCancel.call(props, e);
44
- }
45
- }) : null;
46
- var mergedFooter = props.footer === undefined ? renderFooter : props.footer;
47
- return /*#__PURE__*/_jsxs(_Fragment, {
48
- children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({}, restProps), {}, {
49
- closeIcon: null,
50
- title: /*#__PURE__*/_jsxs("div", {
51
- className: "".concat(sparkPrefix, "-modal-title-wrapper"),
52
- children: [/*#__PURE__*/_jsx("div", {
53
- className: "".concat(sparkPrefix, "-modal-title"),
54
- children: props.title
55
- }), mergedCloseIcon]
56
- }),
57
- wrapClassName: classNames("".concat(sparkPrefix, "-modal"), _defineProperty({}, "".concat(sparkPrefix, "-show-divider"), showDivider), props.wrapClassName, 'animate-in'),
58
- footer: mergedFooter,
59
- transitionName: ""
60
- }))]
61
- });
62
- };
63
- SparkModal.useModal = Modal.useModal;
64
- SparkModal.success = Modal.success;
65
- SparkModal.error = Modal.error;
66
- SparkModal.warning = Modal.warning;
67
- SparkModal.info = Modal.info;
68
- SparkModal.confirm = Modal.confirm;
69
- SparkModal.SMALL_WIDTH = 640;
70
- SparkModal.MEDIUM_WIDTH = 800;
71
- SparkModal.LARGE_WIDTH = 960;
1
+ import PCModal from "./pc";
2
+ import MobileModal from "./mobile";
3
+ var SparkModal = MOBILE ? MobileModal : PCModal;
72
4
  export default SparkModal;