@agentscope-ai/design 1.0.8 → 1.0.10
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.
- package/lib/antd/styles/alert.style.d.ts +2 -10
- package/lib/antd/styles/alert.style.js +11 -12
- package/lib/antd/styles/breadcrumb.style.d.ts +2 -18
- package/lib/antd/styles/breadcrumb.style.js +13 -15
- package/lib/antd/styles/button.style.d.ts +2 -80
- package/lib/antd/styles/button.style.js +63 -47
- package/lib/antd/styles/dropdown.style.d.ts +2 -15
- package/lib/antd/styles/dropdown.style.js +27 -16
- package/lib/antd/styles/floatButton.style.d.ts +2 -8
- package/lib/antd/styles/floatButton.style.js +13 -12
- package/lib/antd/styles/index.style.d.ts +4 -18
- package/lib/antd/styles/index.style.js +52 -53
- package/lib/antd/styles/inputNumber.style.d.ts +2 -18
- package/lib/antd/styles/inputNumber.style.js +23 -17
- package/lib/antd/styles/message.style.d.ts +2 -5
- package/lib/antd/styles/message.style.js +9 -10
- package/lib/antd/styles/notification.style.d.ts +2 -46
- package/lib/antd/styles/notification.style.js +31 -29
- package/lib/antd/styles/popover.style.d.ts +2 -13
- package/lib/antd/styles/popover.style.js +15 -14
- package/lib/antd/styles/radio.style.d.ts +2 -24
- package/lib/antd/styles/radio.style.js +29 -18
- package/lib/antd/styles/segment.style.d.ts +2 -7
- package/lib/antd/styles/segment.style.js +11 -12
- package/lib/antd/styles/select.style.d.ts +2 -31
- package/lib/antd/styles/select.style.js +51 -28
- package/lib/antd/styles/slider.style.d.ts +2 -22
- package/lib/antd/styles/slider.style.js +19 -21
- package/lib/antd/styles/table.style.d.ts +2 -5
- package/lib/antd/styles/table.style.js +7 -10
- package/lib/antd/styles/tooltip.style.d.ts +2 -8
- package/lib/antd/styles/tooltip.style.js +13 -11
- package/lib/antd/themes/generateThemeByToken.js +8 -2
- package/lib/components/commonComponents/AlertDialog/demo/demo1.js +13 -79
- package/lib/components/commonComponents/AlertDialog/demo/demo2.js +44 -64
- package/lib/components/commonComponents/AlertDialog/index.d.ts +14 -1
- package/lib/components/commonComponents/AlertDialog/index.js +25 -17
- package/lib/components/commonComponents/AlertDialog/index.style.d.ts +1 -17
- package/lib/components/commonComponents/AlertDialog/index.style.js +16 -30
- package/lib/components/commonComponents/Anchor/demo/demo1.d.ts +0 -4
- package/lib/components/commonComponents/Anchor/demo/demo1.js +3 -4
- package/lib/components/commonComponents/Anchor/demo/demo2.d.ts +0 -4
- package/lib/components/commonComponents/Anchor/demo/demo2.js +3 -5
- package/lib/components/commonComponents/Anchor/index.js +7 -3
- package/lib/components/commonComponents/Anchor/index.style.d.ts +1 -14
- package/lib/components/commonComponents/Anchor/index.style.js +18 -23
- package/lib/components/commonComponents/Avatar/index.js +11 -7
- package/lib/components/commonComponents/Avatar/index.style.d.ts +1 -7
- package/lib/components/commonComponents/Avatar/index.style.js +6 -21
- package/lib/components/commonComponents/Breadcrumb/index.js +9 -6
- package/lib/components/commonComponents/Breadcrumb/index.style.d.ts +1 -117
- package/lib/components/commonComponents/Breadcrumb/index.style.js +32 -61
- package/lib/components/commonComponents/Button/index.d.ts +1 -1
- package/lib/components/commonComponents/Button/index.js +7 -7
- package/lib/components/commonComponents/Card/index.js +23 -20
- package/lib/components/commonComponents/Card/index.style.d.ts +1 -71
- package/lib/components/commonComponents/Card/index.style.js +24 -46
- package/lib/components/commonComponents/Checkbox/index.js +13 -10
- package/lib/components/commonComponents/Checkbox/index.style.d.ts +1 -34
- package/lib/components/commonComponents/Checkbox/index.style.js +50 -38
- package/lib/components/commonComponents/CodeBlock/index.js +15 -13
- package/lib/components/commonComponents/CodeBlock/index.style.d.ts +1 -354
- package/lib/components/commonComponents/CodeBlock/index.style.js +26 -72
- package/lib/components/commonComponents/Collapse/index.js +7 -3
- package/lib/components/commonComponents/Collapse/index.style.d.ts +1 -57
- package/lib/components/commonComponents/Collapse/index.style.js +34 -47
- package/lib/components/commonComponents/CollapsePanel/index.d.ts +10 -0
- package/lib/components/commonComponents/CollapsePanel/index.js +56 -44
- package/lib/components/commonComponents/CollapsePanel/index.style.d.ts +1 -287
- package/lib/components/commonComponents/CollapsePanel/index.style.js +42 -97
- package/lib/components/commonComponents/ConfigProvider/index.js +20 -14
- package/lib/components/commonComponents/DatePicker/index.js +45 -39
- package/lib/components/commonComponents/DatePicker/index.style.d.ts +1 -102
- package/lib/components/commonComponents/DatePicker/index.style.js +66 -61
- package/lib/components/commonComponents/Descriptions/index.js +14 -10
- package/lib/components/commonComponents/Descriptions/index.style.d.ts +1 -17
- package/lib/components/commonComponents/Descriptions/index.style.js +32 -29
- package/lib/components/commonComponents/Drawer/Confirm.d.ts +1 -1
- package/lib/components/commonComponents/Drawer/Confirm.js +26 -24
- package/lib/components/commonComponents/Drawer/index.js +15 -11
- package/lib/components/commonComponents/Drawer/index.style.d.ts +1 -84
- package/lib/components/commonComponents/Drawer/index.style.js +44 -54
- package/lib/components/commonComponents/Dropdown/index.d.ts +1 -2
- package/lib/components/commonComponents/Dropdown/index.js +15 -12
- package/lib/components/commonComponents/Dropdown/index.style.d.ts +1 -78
- package/lib/components/commonComponents/Dropdown/index.style.js +48 -40
- package/lib/components/commonComponents/EllipsisTip/index.js +14 -10
- package/lib/components/commonComponents/EllipsisTip/index.style.d.ts +1 -10
- package/lib/components/commonComponents/EllipsisTip/index.style.js +6 -24
- package/lib/components/commonComponents/Empty/index.js +46 -44
- package/lib/components/commonComponents/Empty/index.style.d.ts +1 -113
- package/lib/components/commonComponents/Empty/index.style.js +22 -51
- package/lib/components/commonComponents/FileIcon/index.js +27 -24
- package/lib/components/commonComponents/FileIcon/index.style.d.ts +1 -61
- package/lib/components/commonComponents/FileIcon/index.style.js +20 -42
- package/lib/components/commonComponents/FloatButton/demo/demo1.js +1 -1
- package/lib/components/commonComponents/FloatButton/demo/demo2.js +1 -1
- package/lib/components/commonComponents/Form/index.js +6 -5
- package/lib/components/commonComponents/Form/index.style.d.ts +1 -53
- package/lib/components/commonComponents/Form/index.style.js +26 -38
- package/lib/components/commonComponents/HelpIcon/index.js +25 -20
- package/lib/components/commonComponents/HelpIcon/index.style.d.ts +1 -16
- package/lib/components/commonComponents/HelpIcon/index.style.js +16 -29
- package/lib/components/commonComponents/IconButton/index.js +15 -11
- package/lib/components/commonComponents/IconButton/index.style.d.ts +1 -11
- package/lib/components/commonComponents/IconButton/index.style.js +10 -24
- package/lib/components/commonComponents/IconFont/index.d.ts +1 -2
- package/lib/components/commonComponents/IconFont/index.js +14 -9
- package/lib/components/commonComponents/IconFont/index.style.d.ts +1 -67
- package/lib/components/commonComponents/IconFont/index.style.js +14 -44
- package/lib/components/commonComponents/Image/index.js +8 -5
- package/lib/components/commonComponents/Image/index.style.d.ts +1 -22
- package/lib/components/commonComponents/Image/index.style.js +16 -30
- package/lib/components/commonComponents/Input/index.js +17 -11
- package/lib/components/commonComponents/Input/index.style.d.ts +1 -70
- package/lib/components/commonComponents/Input/index.style.js +46 -42
- package/lib/components/commonComponents/Modal/index.js +18 -16
- package/lib/components/commonComponents/Modal/index.style.d.ts +1 -111
- package/lib/components/commonComponents/Modal/index.style.js +54 -72
- package/lib/components/commonComponents/Pagination/index.d.ts +1 -1
- package/lib/components/commonComponents/Pagination/index.js +96 -36
- package/lib/components/commonComponents/Pagination/index.style.d.ts +1 -49
- package/lib/components/commonComponents/Pagination/index.style.js +26 -42
- package/lib/components/commonComponents/Popconfirm/demo/demo1.js +13 -0
- package/lib/components/commonComponents/Popconfirm/demo/demo2.d.ts +3 -0
- package/lib/components/commonComponents/Popconfirm/demo/demo2.js +49 -0
- package/lib/components/commonComponents/Popconfirm/index.d.ts +9 -2
- package/lib/components/commonComponents/Popconfirm/index.js +50 -8
- package/lib/components/commonComponents/PromptsEditor/demo/basic.js +5 -4
- package/lib/components/commonComponents/PromptsEditor/index.d.ts +8 -2
- package/lib/components/commonComponents/PromptsEditor/index.js +17 -11
- package/lib/components/commonComponents/RadioButton/index.js +9 -10
- package/lib/components/commonComponents/RadioButton/index.style.d.ts +1 -72
- package/lib/components/commonComponents/RadioButton/index.style.js +52 -63
- package/lib/components/commonComponents/Result/index.style.d.ts +1 -3
- package/lib/components/commonComponents/Result/index.style.js +4 -16
- package/lib/components/commonComponents/Select/demo/demo2.js +0 -1
- package/lib/components/commonComponents/SlateEditor/elements/Var.js +11 -8
- package/lib/components/commonComponents/SlateEditor/elements/index.style.d.ts +1 -14
- package/lib/components/commonComponents/SlateEditor/elements/index.style.js +4 -21
- package/lib/components/commonComponents/SlateEditor/index.js +34 -31
- package/lib/components/commonComponents/SlateEditor/index.style.d.ts +1 -28
- package/lib/components/commonComponents/SlateEditor/index.style.js +4 -36
- package/lib/components/commonComponents/Slider/{slider.input.d.ts → Input/index.d.ts} +1 -1
- package/lib/components/commonComponents/Slider/Input/index.js +93 -0
- package/lib/components/commonComponents/Slider/Input/index.style.d.ts +1 -0
- package/lib/components/commonComponents/Slider/Input/index.style.js +22 -0
- package/lib/components/commonComponents/Slider/demo/demo4.d.ts +3 -0
- package/lib/components/commonComponents/Slider/demo/demo4.js +33 -0
- package/lib/components/commonComponents/Slider/demo/demo5.d.ts +3 -0
- package/lib/components/commonComponents/Slider/demo/demo5.js +34 -0
- package/lib/components/commonComponents/Slider/index.d.ts +2 -2
- package/lib/components/commonComponents/Slider/index.js +11 -7
- package/lib/components/commonComponents/Slider/index.style.d.ts +1 -7
- package/lib/components/commonComponents/Slider/index.style.js +10 -22
- package/lib/components/commonComponents/SliderSelector/index.js +38 -35
- package/lib/components/commonComponents/SliderSelector/index.style.d.ts +1 -38
- package/lib/components/commonComponents/SliderSelector/index.style.js +20 -37
- package/lib/components/commonComponents/Spinner/index.d.ts +4 -4
- package/lib/components/commonComponents/Spinner/index.js +28 -24
- package/lib/components/commonComponents/Spinner/index.style.d.ts +1 -79
- package/lib/components/commonComponents/Spinner/index.style.js +30 -61
- package/lib/components/commonComponents/Statistic/index.js +7 -3
- package/lib/components/commonComponents/Statistic/index.style.d.ts +1 -15
- package/lib/components/commonComponents/Statistic/index.style.js +14 -26
- package/lib/components/commonComponents/Steps/index.js +10 -6
- package/lib/components/commonComponents/Steps/index.style.d.ts +1 -162
- package/lib/components/commonComponents/Steps/index.style.js +68 -78
- package/lib/components/commonComponents/Switch/index.js +14 -11
- package/lib/components/commonComponents/Switch/index.style.d.ts +1 -25
- package/lib/components/commonComponents/Switch/index.style.js +22 -33
- package/lib/components/commonComponents/Table/demo/demo1.js +1 -9
- package/lib/components/commonComponents/Table/demo/demo2.js +1 -9
- package/lib/components/commonComponents/Table/demo/demo3.js +1 -9
- package/lib/components/commonComponents/Table/demo/demo4.js +1 -9
- package/lib/components/commonComponents/Table/index.d.ts +1 -1
- package/lib/components/commonComponents/Table/index.js +11 -7
- package/lib/components/commonComponents/Table/index.style.d.ts +1 -52
- package/lib/components/commonComponents/Table/index.style.js +34 -32
- package/lib/components/commonComponents/Tabs/index.js +37 -29
- package/lib/components/commonComponents/Tabs/index.style.d.ts +1 -55
- package/lib/components/commonComponents/Tabs/index.style.js +38 -44
- package/lib/components/commonComponents/Tag/index.js +13 -9
- package/lib/components/commonComponents/Tag/index.style.d.ts +1 -56
- package/lib/components/commonComponents/Tag/index.style.js +54 -58
- package/lib/components/commonComponents/TimePicker/index.js +36 -30
- package/lib/components/commonComponents/TimePicker/index.style.d.ts +1 -71
- package/lib/components/commonComponents/TimePicker/index.style.js +54 -50
- package/lib/components/commonComponents/Tooltip/index.js +14 -10
- package/lib/components/commonComponents/Tooltip/index.style.d.ts +1 -24
- package/lib/components/commonComponents/Tooltip/index.style.js +26 -32
- package/lib/components/commonComponents/Upload/index.js +15 -9
- package/lib/components/commonComponents/Upload/index.style.d.ts +1 -125
- package/lib/components/commonComponents/Upload/index.style.js +80 -90
- package/lib/components/commonComponents/Video/Control.d.ts +19 -0
- package/lib/components/commonComponents/Video/Control.js +104 -0
- package/lib/components/commonComponents/Video/demo/demo1.d.ts +2 -0
- package/lib/components/commonComponents/Video/demo/demo1.js +12 -0
- package/lib/components/commonComponents/Video/index.d.ts +18 -0
- package/lib/components/commonComponents/Video/index.js +222 -0
- package/lib/components/commonComponents/Video/index.style.d.ts +1 -0
- package/lib/components/commonComponents/Video/index.style.js +40 -0
- package/lib/i18n/strings/en-US.json +3 -1
- package/lib/i18n/strings/zh-CN.json +3 -1
- package/lib/index.d.ts +5 -4
- package/lib/index.js +3 -2
- package/lib/libs/createStyle/index.d.ts +7 -1
- package/lib/libs/createStyle/index.js +24 -72
- package/lib/libs/env/index.js +1 -1
- package/lib/libs/generateCssVars/index.js +1 -1
- package/package.json +3 -3
- package/lib/components/commonComponents/Popconfirm/demo/demo.js +0 -155
- package/lib/components/commonComponents/Slider/slider.input.js +0 -76
- package/lib/components/commonComponents/spark.style.d.ts +0 -45
- package/lib/components/commonComponents/spark.style.js +0 -62
- package/llms/all.llms.txt +0 -4235
- package/llms/components/commonComponents/Alert/index.zh-CN.llms.txt +0 -74
- package/llms/components/commonComponents/Anchor/index.zh-CN.llms.txt +0 -71
- package/llms/components/commonComponents/Avatar/index.zh-CN.llms.txt +0 -61
- package/llms/components/commonComponents/Breadcrumb/index.zh-CN.llms.txt +0 -89
- package/llms/components/commonComponents/Button/index.zh-CN.llms.txt +0 -99
- package/llms/components/commonComponents/Card/index.zh-CN.llms.txt +0 -79
- package/llms/components/commonComponents/Checkbox/index.zh-CN.llms.txt +0 -88
- package/llms/components/commonComponents/CodeBlock/index.zh-CN.llms.txt +0 -34
- package/llms/components/commonComponents/Collapse/index.zh-CN.llms.txt +0 -76
- package/llms/components/commonComponents/CollapsePanel/index.zh-CN.llms.txt +0 -75
- package/llms/components/commonComponents/DatePicker/index.zh-CN.llms.txt +0 -227
- package/llms/components/commonComponents/Descriptions/index.zh-CN.llms.txt +0 -60
- package/llms/components/commonComponents/Drawer/index.zh-CN.llms.txt +0 -87
- package/llms/components/commonComponents/Dropdown/index.zh-CN.llms.txt +0 -87
- package/llms/components/commonComponents/Empty/index.zh-CN.llms.txt +0 -100
- package/llms/components/commonComponents/FloatButton/index.zh-CN.llms.txt +0 -70
- package/llms/components/commonComponents/Form/index.zh-CN.llms.txt +0 -383
- package/llms/components/commonComponents/IconButton/index.zh-CN.llms.txt +0 -68
- package/llms/components/commonComponents/Image/index.zh-CN.llms.txt +0 -118
- package/llms/components/commonComponents/Input/index.zh-CN.llms.txt +0 -168
- package/llms/components/commonComponents/InputNumber/index.zh-CN.llms.txt +0 -66
- package/llms/components/commonComponents/Message/index.zh-CN.llms.txt +0 -114
- package/llms/components/commonComponents/Modal/index.zh-CN.llms.txt +0 -154
- package/llms/components/commonComponents/Notification/index.zh-CN.llms.txt +0 -118
- package/llms/components/commonComponents/Pagination/index.zh-CN.llms.txt +0 -62
- package/llms/components/commonComponents/Popover/index.zh-CN.llms.txt +0 -56
- package/llms/components/commonComponents/Progress/index.zh-CN.llms.txt +0 -64
- package/llms/components/commonComponents/Radio/index.zh-CN.llms.txt +0 -75
- package/llms/components/commonComponents/RadioButton/index.zh-CN.llms.txt +0 -94
- package/llms/components/commonComponents/Result/index.zh-CN.llms.txt +0 -63
- package/llms/components/commonComponents/Select/index.zh-CN.llms.txt +0 -120
- package/llms/components/commonComponents/Skeleton/index.zh-CN.llms.txt +0 -71
- package/llms/components/commonComponents/Slider/index.zh-CN.llms.txt +0 -83
- package/llms/components/commonComponents/Spinner/index.zh-CN.llms.txt +0 -38
- package/llms/components/commonComponents/Statistic/index.zh-CN.llms.txt +0 -77
- package/llms/components/commonComponents/Steps/index.zh-CN.llms.txt +0 -82
- package/llms/components/commonComponents/Switch/index.zh-CN.llms.txt +0 -58
- package/llms/components/commonComponents/Table/index.zh-CN.llms.txt +0 -228
- package/llms/components/commonComponents/Tabs/index.zh-CN.llms.txt +0 -95
- package/llms/components/commonComponents/Tag/index.zh-CN.llms.txt +0 -57
- package/llms/components/commonComponents/TimePicker/index.zh-CN.llms.txt +0 -104
- package/llms/components/commonComponents/Tooltip/index.zh-CN.llms.txt +0 -63
- package/llms/components/commonComponents/Upload/index.zh-CN.llms.txt +0 -105
- package/llms/index.llms.txt +0 -45
- /package/lib/components/commonComponents/Popconfirm/demo/{demo.d.ts → demo1.d.ts} +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
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 = ["controls", "mouseEnterAutoPlay", "children", "className", "style"];
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
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."); }
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
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; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
import React, { forwardRef, useEffect, useState, useRef } from 'react';
|
|
17
|
+
import classNames from 'classnames';
|
|
18
|
+
import VideoPlayerController from "./Control";
|
|
19
|
+
import { useControllableValue } from 'ahooks';
|
|
20
|
+
import { getCommonConfig } from "../../../config";
|
|
21
|
+
import { useStyle } from "./index.style";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
|
+
var Video = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26
|
+
var controls = props.controls,
|
|
27
|
+
_props$mouseEnterAuto = props.mouseEnterAutoPlay,
|
|
28
|
+
mouseEnterAutoPlay = _props$mouseEnterAuto === void 0 ? false : _props$mouseEnterAuto,
|
|
29
|
+
children = props.children,
|
|
30
|
+
className = props.className,
|
|
31
|
+
style = props.style,
|
|
32
|
+
videoProps = _objectWithoutProperties(props, _excluded);
|
|
33
|
+
var commonConfig = getCommonConfig();
|
|
34
|
+
var sparkPrefix = commonConfig.sparkPrefix;
|
|
35
|
+
var Style = useStyle();
|
|
36
|
+
var _useState = useState(0),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
currentTime = _useState2[0],
|
|
39
|
+
setCurrentTime = _useState2[1];
|
|
40
|
+
var _useState3 = useState(0),
|
|
41
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
|
+
duration = _useState4[0],
|
|
43
|
+
setDuration = _useState4[1];
|
|
44
|
+
var _useState5 = useState(false),
|
|
45
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
46
|
+
isPlaying = _useState6[0],
|
|
47
|
+
setIsPlaying = _useState6[1];
|
|
48
|
+
var _useControllableValue = useControllableValue(props, {
|
|
49
|
+
valuePropName: 'muted',
|
|
50
|
+
trigger: 'onMutedChange',
|
|
51
|
+
defaultValue: true
|
|
52
|
+
}),
|
|
53
|
+
_useControllableValue2 = _slicedToArray(_useControllableValue, 2),
|
|
54
|
+
muted = _useControllableValue2[0],
|
|
55
|
+
setMuted = _useControllableValue2[1];
|
|
56
|
+
var _useState7 = useState(false),
|
|
57
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
58
|
+
enableAudio = _useState8[0],
|
|
59
|
+
setEnableAudio = _useState8[1];
|
|
60
|
+
var videoRef = useRef(null);
|
|
61
|
+
var lockMouseEnterAutoPlayRef = useRef(false);
|
|
62
|
+
|
|
63
|
+
// 合并refs
|
|
64
|
+
var combinedRef = function combinedRef(element) {
|
|
65
|
+
videoRef.current = element;
|
|
66
|
+
if (ref) {
|
|
67
|
+
if (typeof ref === 'function') {
|
|
68
|
+
ref(element);
|
|
69
|
+
} else {
|
|
70
|
+
ref.current = element;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// 监听isPlaying状态来控制定时器
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
var clock;
|
|
78
|
+
if (isPlaying) {
|
|
79
|
+
// 启动定时器
|
|
80
|
+
clock = setInterval(function () {
|
|
81
|
+
if (videoRef.current) {
|
|
82
|
+
setCurrentTime(videoRef.current.currentTime);
|
|
83
|
+
}
|
|
84
|
+
}, 16); // 每100ms更新一次,提供流畅的时间显示
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// 清理函数
|
|
88
|
+
return function () {
|
|
89
|
+
if (clock) {
|
|
90
|
+
clearInterval(clock);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}, [isPlaying]);
|
|
94
|
+
|
|
95
|
+
// 检测视频是否有音频通道
|
|
96
|
+
var checkAudioTracks = function checkAudioTracks() {
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
window.videoRef = videoRef.current;
|
|
99
|
+
if (videoRef.current) {
|
|
100
|
+
// 方法1: 检查mozHasAudio属性 (Firefox)
|
|
101
|
+
if ('mozHasAudio' in videoRef.current) {
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
setEnableAudio(videoRef.current.mozHasAudio);
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
// 方法2: 检查webkitAudioDecodedByteCount属性 (WebKit)
|
|
107
|
+
if ('webkitAudioDecodedByteCount' in videoRef.current) {
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
setEnableAudio(videoRef.current.webkitAudioDecodedByteCount > 0);
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
setEnableAudio(false);
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// 视频加载完成处理
|
|
119
|
+
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
120
|
+
if (videoRef.current) {
|
|
121
|
+
setDuration(videoRef.current.duration);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// 播放/暂停切换
|
|
126
|
+
var handlePlayPause = function handlePlayPause() {
|
|
127
|
+
if (videoRef.current) {
|
|
128
|
+
if (isPlaying) {
|
|
129
|
+
videoRef.current.pause();
|
|
130
|
+
} else {
|
|
131
|
+
videoRef.current.play();
|
|
132
|
+
}
|
|
133
|
+
setIsPlaying(!isPlaying);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// 处理播放事件
|
|
138
|
+
var handlePlay = function handlePlay() {
|
|
139
|
+
setIsPlaying(true);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// 处理暂停事件
|
|
143
|
+
var handlePause = function handlePause() {
|
|
144
|
+
setIsPlaying(false);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// 全屏切换
|
|
148
|
+
var handleFullscreen = function handleFullscreen() {
|
|
149
|
+
if (videoRef.current) {
|
|
150
|
+
if (videoRef.current.requestFullscreen) {
|
|
151
|
+
videoRef.current.requestFullscreen();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// 处理播放结束事件
|
|
157
|
+
var handleEnded = function handleEnded() {
|
|
158
|
+
var _videoRef$current;
|
|
159
|
+
setIsPlaying(false);
|
|
160
|
+
setCurrentTime((_videoRef$current = videoRef.current) === null || _videoRef$current === void 0 ? void 0 : _videoRef$current.duration);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// 处理鼠标进入事件
|
|
164
|
+
var handleMouseEnter = function handleMouseEnter() {
|
|
165
|
+
if (mouseEnterAutoPlay && !lockMouseEnterAutoPlayRef.current) {
|
|
166
|
+
if (!isPlaying) {
|
|
167
|
+
videoRef.current.play();
|
|
168
|
+
lockMouseEnterAutoPlayRef.current = true;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
var handleMouseLeave = function handleMouseLeave() {
|
|
173
|
+
if (mouseEnterAutoPlay && lockMouseEnterAutoPlayRef.current) {
|
|
174
|
+
lockMouseEnterAutoPlayRef.current = false;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// 处理进度条点击事件
|
|
179
|
+
var handleProgressClick = function handleProgressClick(time) {
|
|
180
|
+
if (videoRef.current) {
|
|
181
|
+
videoRef.current.currentTime = time;
|
|
182
|
+
setCurrentTime(time);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
186
|
+
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx("div", {
|
|
187
|
+
className: classNames("".concat(sparkPrefix, "-video-container"), className),
|
|
188
|
+
style: style,
|
|
189
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
190
|
+
className: "".concat(sparkPrefix, "-video-content"),
|
|
191
|
+
onMouseEnter: handleMouseEnter,
|
|
192
|
+
onMouseLeave: handleMouseLeave,
|
|
193
|
+
children: [/*#__PURE__*/_jsx("video", _objectSpread(_objectSpread({
|
|
194
|
+
ref: combinedRef
|
|
195
|
+
}, videoProps), {}, {
|
|
196
|
+
muted: muted,
|
|
197
|
+
className: "".concat(sparkPrefix, "-video-element"),
|
|
198
|
+
crossOrigin: "anonymous",
|
|
199
|
+
onLoadedMetadata: handleLoadedMetadata,
|
|
200
|
+
onCanPlayThrough: checkAudioTracks,
|
|
201
|
+
onPlay: handlePlay,
|
|
202
|
+
onPause: handlePause,
|
|
203
|
+
onEnded: handleEnded
|
|
204
|
+
})), controls && /*#__PURE__*/_jsx(VideoPlayerController, {
|
|
205
|
+
className: "".concat(sparkPrefix, "-video-controller-wrapper"),
|
|
206
|
+
isPlaying: isPlaying,
|
|
207
|
+
currentTime: currentTime,
|
|
208
|
+
duration: duration,
|
|
209
|
+
enableAudio: enableAudio,
|
|
210
|
+
muted: muted,
|
|
211
|
+
onMute: function onMute() {
|
|
212
|
+
return setMuted(!muted);
|
|
213
|
+
},
|
|
214
|
+
onPlayPause: handlePlayPause,
|
|
215
|
+
onFullscreen: handleFullscreen,
|
|
216
|
+
onProgressClick: handleProgressClick
|
|
217
|
+
}), children]
|
|
218
|
+
})
|
|
219
|
+
})]
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
export default Video;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyle: () => () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
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\n.", "-video-content {\n width: 100%;\n height: 100%;\n}\n\n.", "-video-element {\n display: block;\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\n// VideoPlayerController \u7EC4\u4EF6\u5185\u90E8\u6837\u5F0F\n.", "-video-player-controller {\n display: flex;\n padding: 8px;\n gap: 8px;\n align-items: center;\n width: 100%;\n height: 40px;\n overflow: hidden;\n}\n\n// \u65F6\u95F4\u6587\u672C\u6837\u5F0F\n.", "-video-time-text {\n flex-grow: 0;\n font-size: 12px;\n line-height: 20px;\n color: var(--", "-color-text-white);\n}\n\n// \u8FDB\u5EA6\u6761\u5BB9\u5668\u6837\u5F0F\n.", "-video-progress-container {\n flex-grow: 1;\n cursor: pointer;\n}\n\n// \u8FDB\u5EA6\u6761\u6837\u5F0F\n.", "-video-progress-bar {\n width: 100%;\n\n .", "-progress-inner {\n --", "-progress-remaining-color: var(--", "-color-fill);\n }\n \n .", "-progress-bg {\n background: var(--", "-color-text-white) !important;\n transition-duration: 0s;\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.sparkPrefix;
|
|
16
|
+
}, function (p) {
|
|
17
|
+
return p.sparkPrefix;
|
|
18
|
+
}, function (p) {
|
|
19
|
+
return p.sparkPrefix;
|
|
20
|
+
}, function (p) {
|
|
21
|
+
return p.sparkPrefix;
|
|
22
|
+
}, function (p) {
|
|
23
|
+
return p.sparkPrefix;
|
|
24
|
+
}, function (p) {
|
|
25
|
+
return p.antPrefix;
|
|
26
|
+
}, function (p) {
|
|
27
|
+
return p.sparkPrefix;
|
|
28
|
+
}, function (p) {
|
|
29
|
+
return p.sparkPrefix;
|
|
30
|
+
}, function (p) {
|
|
31
|
+
return p.antPrefix;
|
|
32
|
+
}, function (p) {
|
|
33
|
+
return p.antPrefix;
|
|
34
|
+
}, function (p) {
|
|
35
|
+
return p.antPrefix;
|
|
36
|
+
}, function (p) {
|
|
37
|
+
return p.antPrefix;
|
|
38
|
+
}, function (p) {
|
|
39
|
+
return p.antPrefix;
|
|
40
|
+
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"components.commonComponents.AlertDialog.Prompt": "Prompt",
|
|
3
3
|
"components.commonComponents.Pagination.PreviousPage": "Previous Page",
|
|
4
|
+
"components.commonComponents.Pagination.Items": "Items",
|
|
5
|
+
"components.commonComponents.Pagination.Page": "Page",
|
|
4
6
|
"components.commonComponents.Pagination.NextPage": "Next page",
|
|
5
7
|
"components.commonComponents.SlateEditor.TheNumberOfWordsCannot": "The number of words cannot exceed {wordLimit}.",
|
|
6
8
|
"components.commonComponents.SlateEditor.EnterHere": "Enter here",
|
|
@@ -11,4 +13,4 @@
|
|
|
11
13
|
"components.SlateEditor.utils.editor.WraptagnameCannotBeNestedIn": "[{wrapTagName}] cannot be nested in [{tagName}]]",
|
|
12
14
|
"components.SlateEditor.utils.withEditor.YouCanEnterAMaximum": "You can enter a maximum of {maxLen} characters.",
|
|
13
15
|
"components.commonComponents.Image.Preview": "Preview"
|
|
14
|
-
}
|
|
16
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"components.commonComponents.AlertDialog.Prompt": "提示",
|
|
3
3
|
"components.commonComponents.Pagination.PreviousPage": "上一页",
|
|
4
|
+
"components.commonComponents.Pagination.Items": "条",
|
|
5
|
+
"components.commonComponents.Pagination.Page": "页",
|
|
4
6
|
"components.commonComponents.Pagination.NextPage": "下一页",
|
|
5
7
|
"components.commonComponents.SlateEditor.TheNumberOfWordsCannot": "字数不能超过{wordLimit}字",
|
|
6
8
|
"components.commonComponents.SlateEditor.EnterHere": "在这里输入",
|
|
@@ -11,4 +13,4 @@
|
|
|
11
13
|
"components.SlateEditor.utils.editor.WraptagnameCannotBeNestedIn": "【{wrapTagName}】中不能嵌套【{tagName}】",
|
|
12
14
|
"components.SlateEditor.utils.withEditor.YouCanEnterAMaximum": "最多可输入{maxLen}字",
|
|
13
15
|
"components.commonComponents.Image.Preview": "预览"
|
|
14
|
-
}
|
|
16
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import generateThemeByToken from './antd/themes/generateThemeByToken';
|
|
|
2
2
|
/**
|
|
3
3
|
* 通用组件
|
|
4
4
|
*/
|
|
5
|
-
export { Alert, Badge, InputNumber, Progress, Radio, Select, Skeleton, type AlertProps, type BadgeProps, type CollapseProps, type DescriptionsProps, type InputNumberProps, type NotificationArgsProps, type PopoverProps, type ProgressProps, type RadioProps, type SelectProps, type SkeletonProps, type StatisticProps, type StepsProps, type TableProps, } from 'antd';
|
|
5
|
+
export { Alert, Badge, FloatButton, InputNumber, Progress, Radio, Select, Skeleton, type AlertProps, type BadgeProps, type CollapseProps, type DescriptionsProps, type FloatButtonProps, type InputNumberProps, type NotificationArgsProps, type PopoverProps, type ProgressProps, type RadioProps, type SelectProps, type SkeletonProps, type StatisticProps, type StepsProps, type TableProps, } from 'antd';
|
|
6
6
|
export { default as AlertDialog, type AlertDialogProps, } from './components/commonComponents/AlertDialog';
|
|
7
7
|
export { default as Anchor, type AnchorProps, } from './components/commonComponents/Anchor';
|
|
8
8
|
export { default as Avatar } from './components/commonComponents/Avatar';
|
|
@@ -30,13 +30,13 @@ 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
|
+
export { default as MdEditor, default as PromptsEditor, type PromptsEditorProps as MdEditorProps, type PromptsEditorProps, } from './components/commonComponents/PromptsEditor';
|
|
34
34
|
export { default as RadioButton, type SparkRadioButtonProps as RadioButtonProps, } from './components/commonComponents/RadioButton';
|
|
35
35
|
export { default as Result, type SparkResultProps, } from './components/commonComponents/Result';
|
|
36
36
|
export { default as Steps } from './components/commonComponents/Steps';
|
|
37
37
|
export { default as SlateEditor } from './components/commonComponents/SlateEditor';
|
|
38
38
|
export { default as Slider, type SliderInputProps, } from './components/commonComponents/Slider';
|
|
39
|
-
export { default as Spinner, type SparkSpinnerProps, } from './components/commonComponents/Spinner';
|
|
39
|
+
export { default as Spinner, type SparkSpinnerProps, type SparkSpinnerProps as SpinnerProps, } from './components/commonComponents/Spinner';
|
|
40
40
|
export { default as Descriptions } from './components/commonComponents/Descriptions';
|
|
41
41
|
export { default as SliderSelector } from './components/commonComponents/SliderSelector';
|
|
42
42
|
export { default as Statistic } from './components/commonComponents/Statistic';
|
|
@@ -47,6 +47,7 @@ export { default as Tag, type SparkTagProps as TagProps, } from './components/co
|
|
|
47
47
|
export { default as TimePicker } from './components/commonComponents/TimePicker';
|
|
48
48
|
export { default as Tooltip, type SparkTooltipProps as TooltipProps, } from './components/commonComponents/Tooltip';
|
|
49
49
|
export { default as Upload } from './components/commonComponents/Upload';
|
|
50
|
+
export { default as Video } from './components/commonComponents/Video';
|
|
50
51
|
export { default as staticRenderer } from './libs/staticRenderer';
|
|
51
52
|
/**
|
|
52
53
|
* hooks
|
|
@@ -57,7 +58,7 @@ export { default as useGlobalStyle } from './hooks/useGlobalStyle';
|
|
|
57
58
|
*/
|
|
58
59
|
export { default as delay } from './libs/delay';
|
|
59
60
|
export { safeHtml } from './libs/dom';
|
|
60
|
-
export { generateCssVars, generateCssVarsByMap, insertMetaCssVars, } from
|
|
61
|
+
export { generateCssVars, generateCssVarsByMap, insertMetaCssVars, } from "./libs/generateCssVars";
|
|
61
62
|
export { copy, renderTooltip } from './libs/utils';
|
|
62
63
|
export { waitForDom, waitForFunc } from './libs/waitFor';
|
|
63
64
|
export { getRegionName } from './libs/region';
|
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import generateThemeByToken from "./antd/themes/generateThemeByToken";
|
|
|
7
7
|
/**
|
|
8
8
|
* 通用组件
|
|
9
9
|
*/
|
|
10
|
-
export { Alert, Badge, InputNumber, Progress, Radio, Select, Skeleton } from 'antd';
|
|
10
|
+
export { Alert, Badge, FloatButton, InputNumber, Progress, Radio, Select, Skeleton } from 'antd';
|
|
11
11
|
export { default as AlertDialog } from "./components/commonComponents/AlertDialog";
|
|
12
12
|
export { default as Anchor } from "./components/commonComponents/Anchor";
|
|
13
13
|
export { default as Avatar } from "./components/commonComponents/Avatar";
|
|
@@ -35,7 +35,7 @@ export { default as notification } from "./components/commonComponents/Notificat
|
|
|
35
35
|
export { default as Pagination } from "./components/commonComponents/Pagination";
|
|
36
36
|
export { default as Popconfirm } from "./components/commonComponents/Popconfirm";
|
|
37
37
|
export { default as Popover } from "./components/commonComponents/Popover";
|
|
38
|
-
export { default as PromptsEditor } from "./components/commonComponents/PromptsEditor";
|
|
38
|
+
export { default as MdEditor, default as PromptsEditor } from "./components/commonComponents/PromptsEditor";
|
|
39
39
|
export { default as RadioButton } from "./components/commonComponents/RadioButton";
|
|
40
40
|
export { default as Result } from "./components/commonComponents/Result";
|
|
41
41
|
export { default as Steps } from "./components/commonComponents/Steps";
|
|
@@ -52,6 +52,7 @@ export { default as Tag } from "./components/commonComponents/Tag";
|
|
|
52
52
|
export { default as TimePicker } from "./components/commonComponents/TimePicker";
|
|
53
53
|
export { default as Tooltip } from "./components/commonComponents/Tooltip";
|
|
54
54
|
export { default as Upload } from "./components/commonComponents/Upload";
|
|
55
|
+
export { default as Video } from "./components/commonComponents/Video";
|
|
55
56
|
export { default as staticRenderer } from "./libs/staticRenderer";
|
|
56
57
|
|
|
57
58
|
/**
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { CSSStyle } from 'antd-style';
|
|
2
|
+
import { GlobalTheme } from 'antd-style/lib/factories/createGlobalStyle';
|
|
3
|
+
export default function createGlobalStyle(...styles: CSSStyle<GlobalTheme & {
|
|
4
|
+
sparkPrefix: string;
|
|
5
|
+
antPrefix: string;
|
|
6
|
+
blPrefix: string;
|
|
7
|
+
}>): () => () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,76 +1,28 @@
|
|
|
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
|
-
/**
|
|
8
|
-
* 参考资料
|
|
9
|
-
* https://ntsim.uk/posts/how-to-update-or-remove-global-styles-in-emotion
|
|
10
|
-
*/
|
|
11
|
-
import { css } from '@emotion/react';
|
|
12
|
-
import { useLayoutEffect, useMemo } from 'react';
|
|
13
|
-
import { compile, serialize, stringify } from 'stylis';
|
|
14
1
|
import { useCommonConfig } from "../../config";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
import { createGlobalStyle as originCreateGlobalStyle } from 'antd-style';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export default function createGlobalStyle() {
|
|
6
|
+
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7
|
+
styles[_key] = arguments[_key];
|
|
19
8
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
document.head.appendChild(dom);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function removeStyle(styleId) {
|
|
42
|
-
stylesMap.delete(styleId);
|
|
43
|
-
var dom = document.getElementById('bl-style-' + styleId);
|
|
44
|
-
if (dom) {
|
|
45
|
-
dom.remove();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
var cacheUseStyles = {};
|
|
49
|
-
export default function createStyle(func) {
|
|
50
|
-
var localProps = {};
|
|
51
|
-
return function useStyle() {
|
|
52
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : localProps;
|
|
53
|
-
var config = useCommonConfig();
|
|
54
|
-
var styles = useMemo(function () {
|
|
55
|
-
return func(_objectSpread(_objectSpread(_objectSpread({}, config), props), {}, {
|
|
56
|
-
css: css
|
|
57
|
-
}));
|
|
58
|
-
}, [config, props]);
|
|
59
|
-
applyStyle(styles.name, styles);
|
|
60
|
-
useLayoutEffect(function () {
|
|
61
|
-
var cacheName = styles.name;
|
|
62
|
-
cacheUseStyles[cacheName] = cacheUseStyles[cacheName] || 0;
|
|
63
|
-
cacheUseStyles[cacheName] += 1;
|
|
64
|
-
return function () {
|
|
65
|
-
cacheUseStyles[cacheName] -= 1;
|
|
66
|
-
setTimeout(function () {
|
|
67
|
-
// 渲染样式已不使用,删除掉对应样式
|
|
68
|
-
if (cacheUseStyles[cacheName] <= 0) {
|
|
69
|
-
removeStyle(cacheName);
|
|
70
|
-
}
|
|
71
|
-
}, 100);
|
|
72
|
-
};
|
|
73
|
-
}, [styles.name]);
|
|
74
|
-
return config;
|
|
9
|
+
return function () {
|
|
10
|
+
var _useCommonConfig = useCommonConfig(),
|
|
11
|
+
sparkPrefix = _useCommonConfig.sparkPrefix,
|
|
12
|
+
antPrefix = _useCommonConfig.antPrefix,
|
|
13
|
+
blPrefix = _useCommonConfig.blPrefix;
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
var Style = originCreateGlobalStyle.apply(void 0, styles);
|
|
16
|
+
var ref = useRef(function () {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
return /*#__PURE__*/_jsx(Style
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
, {
|
|
21
|
+
sparkPrefix: sparkPrefix,
|
|
22
|
+
antPrefix: antPrefix,
|
|
23
|
+
blPrefix: blPrefix
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
return ref.current;
|
|
75
27
|
};
|
|
76
28
|
}
|
package/lib/libs/env/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import Cookies from 'js-cookie';
|
|
6
6
|
export function getLang() {
|
|
7
7
|
// 优先级:cookie > 环境变量 > 默认值
|
|
8
|
-
if (location.host.includes('console.aliyun.com')) {
|
|
8
|
+
if (location.host.includes('bailian.console.aliyun.com')) {
|
|
9
9
|
return 'zh-CN';
|
|
10
10
|
}
|
|
11
11
|
if (Cookies.get('aliyun_lang')) {
|
|
@@ -31,7 +31,7 @@ export var insertMetaCssVars = function insertMetaCssVars(tokens) {
|
|
|
31
31
|
tokens.forEach(function (item, index) {
|
|
32
32
|
styleContent += " ".concat(item.name, ": ").concat(typeof item.value === 'string' ? item.value : "".concat(item.value, "px"), ";").concat(index < tokens.length - 1 ? '\n' : '');
|
|
33
33
|
});
|
|
34
|
-
styleContent = ":root{\n".concat(styleContent, "\n}");
|
|
34
|
+
styleContent = ":root{\n ".concat(styleContent, "\n }");
|
|
35
35
|
var styleEle = document.createElement('style');
|
|
36
36
|
styleEle.setAttribute('styleType', styleType);
|
|
37
37
|
styleEle.textContent = styleContent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentscope-ai/design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Basic components for the best experience of LLM",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"ci:install-deps": "tnpm i pnpm@9 -D && pnpm --version && pnpm install",
|
|
25
25
|
"copy-antd-docs": "node copy-antd-docs.js",
|
|
26
26
|
"dev": "dumi dev",
|
|
27
|
-
"docs:build": "dumi build",
|
|
27
|
+
"docs:build": "dumi build && node scripts/build-index-llms-txt.js",
|
|
28
28
|
"docs:preview": "dumi preview",
|
|
29
29
|
"docs:syncYuque": "node syncYuque.js",
|
|
30
30
|
"docsMD:build": "node docMD.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@agentscope-ai/icons": "^1.0.
|
|
64
|
+
"@agentscope-ai/icons": "^1.0.35",
|
|
65
65
|
"@codemirror/autocomplete": "^6.18.7",
|
|
66
66
|
"@codemirror/lang-cpp": "^6.0.2",
|
|
67
67
|
"@codemirror/lang-css": "^6.3.1",
|