@chlp-tech/rpa-ui 0.0.1

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 (116) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -0
  3. package/dist/account-select/imgs/down.svg +24 -0
  4. package/dist/account-select/imgs/fb-disabled.svg +27 -0
  5. package/dist/account-select/imgs/fb.svg +20 -0
  6. package/dist/account-select/imgs/up.svg +20 -0
  7. package/dist/account-select/index.d.ts +39 -0
  8. package/dist/account-select/index.js +221 -0
  9. package/dist/account-select/index.module.less +58 -0
  10. package/dist/ai-empty/index.d.ts +3 -0
  11. package/dist/ai-empty/index.js +51 -0
  12. package/dist/ai-empty/index.module.less +60 -0
  13. package/dist/batch-label/index.d.ts +14 -0
  14. package/dist/batch-label/index.js +215 -0
  15. package/dist/batch-label/index.module.less +96 -0
  16. package/dist/card-scroll/index.d.ts +6 -0
  17. package/dist/card-scroll/index.js +75 -0
  18. package/dist/components/modal/index.d.ts +16 -0
  19. package/dist/components/modal/index.js +70 -0
  20. package/dist/cover-modal/boll.gif +0 -0
  21. package/dist/cover-modal/delete.svg +24 -0
  22. package/dist/cover-modal/index.d.ts +20 -0
  23. package/dist/cover-modal/index.js +410 -0
  24. package/dist/cover-modal/index.module.less +76 -0
  25. package/dist/cover-modal/question.svg +1 -0
  26. package/dist/cover-modal/upload.png +0 -0
  27. package/dist/custom.d.ts +10 -0
  28. package/dist/drawer-task/img/back.png +0 -0
  29. package/dist/drawer-task/img/close.svg +18 -0
  30. package/dist/drawer-task/img/icon.svg +20 -0
  31. package/dist/drawer-task/index.d.ts +24 -0
  32. package/dist/drawer-task/index.js +130 -0
  33. package/dist/drawer-task/index.module.less +85 -0
  34. package/dist/dynamic-form/index.d.ts +33 -0
  35. package/dist/dynamic-form/index.js +154 -0
  36. package/dist/excel-import/excel-import.module.less +32 -0
  37. package/dist/excel-import/index.d.ts +10 -0
  38. package/dist/excel-import/index.js +76 -0
  39. package/dist/form-item/index.d.ts +12 -0
  40. package/dist/form-item/index.js +34 -0
  41. package/dist/form-item/index.module.less +45 -0
  42. package/dist/index.d.ts +22 -0
  43. package/dist/index.js +22 -0
  44. package/dist/label-select/imgs/close.svg +24 -0
  45. package/dist/label-select/imgs/plus.svg +24 -0
  46. package/dist/label-select/index.d.ts +10 -0
  47. package/dist/label-select/index.js +173 -0
  48. package/dist/label-select/index.module.less +25 -0
  49. package/dist/layout/index.d.ts +3 -0
  50. package/dist/layout/index.js +10 -0
  51. package/dist/layout/index.module.less +6 -0
  52. package/dist/link-filter/index.d.ts +25 -0
  53. package/dist/link-filter/index.js +242 -0
  54. package/dist/link-filter/index.module.less +7 -0
  55. package/dist/media-play/close.svg +1 -0
  56. package/dist/media-play/index.d.ts +13 -0
  57. package/dist/media-play/index.js +245 -0
  58. package/dist/media-play/index.module.less +196 -0
  59. package/dist/media-play/play.svg +17 -0
  60. package/dist/modal-wrapper/index.d.ts +17 -0
  61. package/dist/modal-wrapper/index.js +66 -0
  62. package/dist/publish-account/imgs/close.svg +25 -0
  63. package/dist/publish-account/imgs/fb.svg +20 -0
  64. package/dist/publish-account/imgs/ins.svg +36 -0
  65. package/dist/publish-account/imgs/tk.svg +31 -0
  66. package/dist/publish-account/imgs/tt.svg +21 -0
  67. package/dist/publish-account/imgs/yt.svg +25 -0
  68. package/dist/publish-account/index.d.ts +31 -0
  69. package/dist/publish-account/index.js +118 -0
  70. package/dist/publish-account/index.module.less +70 -0
  71. package/dist/publish-status/imgs/fail.svg +22 -0
  72. package/dist/publish-status/imgs/process.svg +24 -0
  73. package/dist/publish-status/imgs/publish.svg +24 -0
  74. package/dist/publish-status/imgs/success.svg +22 -0
  75. package/dist/publish-status/imgs/wait.svg +22 -0
  76. package/dist/publish-status/index.d.ts +5 -0
  77. package/dist/publish-status/index.js +55 -0
  78. package/dist/publish-status/index.module.less +8 -0
  79. package/dist/release-manage/index.d.ts +6 -0
  80. package/dist/release-manage/index.js +5 -0
  81. package/dist/release-manage/release-title/index.d.ts +10 -0
  82. package/dist/release-manage/release-title/index.js +94 -0
  83. package/dist/release-manage/release-title/index.module.less +21 -0
  84. package/dist/release-manage/release-title/plus.svg +20 -0
  85. package/dist/release-video-card/imgs/detail.svg +21 -0
  86. package/dist/release-video-card/imgs/edit.svg +19 -0
  87. package/dist/release-video-card/imgs/fail.svg +22 -0
  88. package/dist/release-video-card/imgs/fb.svg +20 -0
  89. package/dist/release-video-card/imgs/ins.svg +34 -0
  90. package/dist/release-video-card/imgs/more.svg +18 -0
  91. package/dist/release-video-card/imgs/new.svg +22 -0
  92. package/dist/release-video-card/imgs/play.svg +17 -0
  93. package/dist/release-video-card/imgs/process.svg +24 -0
  94. package/dist/release-video-card/imgs/publish.svg +24 -0
  95. package/dist/release-video-card/imgs/success.svg +22 -0
  96. package/dist/release-video-card/imgs/tk.svg +29 -0
  97. package/dist/release-video-card/imgs/tw.svg +21 -0
  98. package/dist/release-video-card/imgs/wait.svg +22 -0
  99. package/dist/release-video-card/imgs/yt.svg +25 -0
  100. package/dist/release-video-card/imgs/ytb.svg +1 -0
  101. package/dist/release-video-card/index.d.ts +35 -0
  102. package/dist/release-video-card/index.js +221 -0
  103. package/dist/release-video-card/index.module.less +223 -0
  104. package/dist/sound-wave/index.d.ts +3 -0
  105. package/dist/sound-wave/index.js +22 -0
  106. package/dist/sound-wave/index.module.less +105 -0
  107. package/dist/text-ellipsis/index.d.ts +8 -0
  108. package/dist/text-ellipsis/index.js +57 -0
  109. package/dist/text-ellipsis/index.module.less +8 -0
  110. package/dist/utils/index.d.ts +8 -0
  111. package/dist/utils/index.js +101 -0
  112. package/dist/video-list/delete.svg +26 -0
  113. package/dist/video-list/index.d.ts +46 -0
  114. package/dist/video-list/index.js +219 -0
  115. package/dist/video-list/index.module.less +127 -0
  116. package/package.json +83 -0
@@ -0,0 +1,101 @@
1
+ export var call = function call(fn) {
2
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3
+ args[_key - 1] = arguments[_key];
4
+ }
5
+ if (Array.isArray(fn)) {
6
+ return fn.map(function (f) {
7
+ return f.apply(void 0, args);
8
+ });
9
+ }
10
+ if (fn) {
11
+ return fn.apply(void 0, args);
12
+ }
13
+ };
14
+ export var normalizeToArray = function normalizeToArray(value) {
15
+ if (Array.isArray(value)) {
16
+ return value;
17
+ }
18
+ return [value];
19
+ };
20
+ export function transformDataToTreeData(apiResponse) {
21
+ if (!(apiResponse !== null && apiResponse !== void 0 && apiResponse.data)) return [];
22
+ var accountTypes = [{
23
+ key: 'facebookAccounts',
24
+ title: 'Facebook'
25
+ }, {
26
+ key: 'insAccounts',
27
+ title: 'Instagram'
28
+ }, {
29
+ key: 'tiktokAccounts',
30
+ title: 'TikTok'
31
+ }, {
32
+ key: 'youtubeAccounts',
33
+ title: 'YouTube'
34
+ }, {
35
+ key: 'twAccounts',
36
+ title: 'Twitter'
37
+ }];
38
+ return accountTypes.map(function (type) {
39
+ var accounts = apiResponse.data[type.key];
40
+ if (!accounts) return null;
41
+ return {
42
+ title: type.title,
43
+ value: type.key,
44
+ children: accounts.map(function (account) {
45
+ return {
46
+ title: account['accountName'] || "Account ".concat(account.id),
47
+ value: account.id
48
+ };
49
+ })
50
+ };
51
+ }).filter(function (node) {
52
+ return node !== null;
53
+ });
54
+ }
55
+ var getMediaTypeString = function getMediaTypeString(mediaType) {
56
+ switch (mediaType) {
57
+ case 1:
58
+ return "fb";
59
+ case 2:
60
+ return "ins";
61
+ case 6:
62
+ return "tk";
63
+ case 5:
64
+ return "yt";
65
+ default:
66
+ return "fb";
67
+ }
68
+ };
69
+ export var mapToMockData = function mapToMockData(data) {
70
+ return data.map(function (item) {
71
+ var _item$title, _item$desc, _item$fileUrls$, _item$fileUrls, _item$thumbnailUrls, _item$mainTaskId, _ref, _item$fileUrls2, _item$postData$map, _item$postData, _item$viewCount, _item$likeCount, _item$commentCount, _item$publishTime;
72
+ return {
73
+ title: (_item$title = item.title) !== null && _item$title !== void 0 ? _item$title : "",
74
+ desc: (_item$desc = item.desc) !== null && _item$desc !== void 0 ? _item$desc : "",
75
+ fileUrl: (_item$fileUrls$ = (_item$fileUrls = item.fileUrls) === null || _item$fileUrls === void 0 ? void 0 : _item$fileUrls[0]) !== null && _item$fileUrls$ !== void 0 ? _item$fileUrls$ : "",
76
+ imgUrl: (_item$thumbnailUrls = item.thumbnailUrls) !== null && _item$thumbnailUrls !== void 0 ? _item$thumbnailUrls : "",
77
+ status: item.publishTaskStatus,
78
+ id: (_item$mainTaskId = item.mainTaskId) !== null && _item$mainTaskId !== void 0 ? _item$mainTaskId : 0,
79
+ mediaInfo: {
80
+ url: (_ref = [item.thumbnailUrls]) !== null && _ref !== void 0 ? _ref : [],
81
+ type: item.fileType === "VIDEO" ? "video" : "image",
82
+ previewUrl: (_item$fileUrls2 = item.fileUrls) !== null && _item$fileUrls2 !== void 0 ? _item$fileUrls2 : [],
83
+ onPlayClick: item.onPlayClick
84
+ },
85
+ mediaList: (_item$postData$map = (_item$postData = item.postData) === null || _item$postData === void 0 ? void 0 : _item$postData.map(function (post) {
86
+ var _post$mediaType, _post$postNum;
87
+ return {
88
+ media: getMediaTypeString((_post$mediaType = post.mediaType) !== null && _post$mediaType !== void 0 ? _post$mediaType : 0),
89
+ count: (_post$postNum = post.postNum) !== null && _post$postNum !== void 0 ? _post$postNum : 0
90
+ };
91
+ })) !== null && _item$postData$map !== void 0 ? _item$postData$map : [],
92
+ countData: {
93
+ views: (_item$viewCount = item.viewCount) !== null && _item$viewCount !== void 0 ? _item$viewCount : 0,
94
+ likes: (_item$likeCount = item.likeCount) !== null && _item$likeCount !== void 0 ? _item$likeCount : 0,
95
+ comments: (_item$commentCount = item.commentCount) !== null && _item$commentCount !== void 0 ? _item$commentCount : 0
96
+ },
97
+ createTime: (_item$publishTime = item.publishTime) !== null && _item$publishTime !== void 0 ? _item$publishTime : "",
98
+ isNew: !!item.isNew
99
+ };
100
+ });
101
+ };
@@ -0,0 +1,26 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 62 (91390) - https://sketch.com -->
4
+ <title>矩形</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="AI视频" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <g id="AI创作-视频混剪-视频生成-视频信息" transform="translate(-1073.000000, -172.000000)">
8
+ <g id="编组-7" transform="translate(244.000000, 80.000000)">
9
+ <g id="编组-17" transform="translate(616.000000, 80.000000)">
10
+ <g id="编组-7备份-5" transform="translate(209.000000, 8.000000)">
11
+ <g id="删除" transform="translate(12.000000, 12.000000) scale(-1, 1) translate(-12.000000, -12.000000) translate(4.000000, 4.000000)">
12
+ <rect id="矩形" stroke="#979797" opacity="0" x="0.5" y="0.5" width="15" height="15"></rect>
13
+ <g id="编组" transform="translate(1.000000, 1.000000)" stroke="#142A51" stroke-linejoin="round">
14
+ <path d="M1.66666667,2 L1.66666667,11.3333333 C1.66666667,12.4379028 2.56209717,13.3333333 3.66666667,13.3333333 L9.66666667,13.3333333 C10.7712362,13.3333333 11.6666667,12.4379028 11.6666667,11.3333333 L11.6666667,2 L11.6666667,2 L1.66666667,2 Z" id="路径"></path>
15
+ <line x1="5.33333333" y1="5.33333333" x2="5.33333333" y2="9.66666667" id="路径" stroke-linecap="round"></line>
16
+ <line x1="8" y1="5.33333333" x2="8" y2="9.66666667" id="路径" stroke-linecap="round"></line>
17
+ <line x1="0" y1="2" x2="13.3333333" y2="2" id="路径" stroke-linecap="round"></line>
18
+ <polygon id="路径" points="4 2 5.09633333 0 8.25903333 0 9.33333333 2"></polygon>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ </g>
24
+ </g>
25
+ </g>
26
+ </svg>
@@ -0,0 +1,46 @@
1
+ import React, { FC } from "react";
2
+ interface VideoItem {
3
+ id: number;
4
+ url: string;
5
+ previewUrl: string;
6
+ trackUrl?: string;
7
+ trackLabel?: string;
8
+ errorText?: React.ReactNode;
9
+ onPlayClick?: () => void;
10
+ desc?: {
11
+ lang?: string;
12
+ time?: string;
13
+ } | React.ReactNode;
14
+ headerContent?: React.ReactNode;
15
+ }
16
+ interface VideoListProps {
17
+ list: VideoItem[];
18
+ onDelete?: (id: number) => void;
19
+ onCheck?: (ids: number[]) => void;
20
+ gutter?: [number, number];
21
+ colSpan?: number;
22
+ height?: number;
23
+ responsiveColSpan?: {
24
+ xs?: number;
25
+ sm?: number;
26
+ md?: number;
27
+ lg?: number;
28
+ xl?: number;
29
+ xxl?: number;
30
+ };
31
+ popoverContent?: (item: VideoItem) => React.ReactNode;
32
+ footer?: (item: VideoItem) => React.ReactNode;
33
+ footerStyle?: React.CSSProperties;
34
+ leftAction?: (item: VideoItem) => React.ReactNode;
35
+ onStateChange?: (state: {
36
+ selectedIds: number[];
37
+ selectionStatus: SelectionStatus;
38
+ }) => void;
39
+ selectedIds?: number[];
40
+ style?: React.CSSProperties;
41
+ isLoading?: boolean;
42
+ handleRetry?: () => void;
43
+ }
44
+ type SelectionStatus = 'all' | 'none' | 'partially';
45
+ declare const VideoList: FC<VideoListProps>;
46
+ export default VideoList;
@@ -0,0 +1,219 @@
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ 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."); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ 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."); }
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 _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; }
11
+ 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; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { useImperativeHandle, useState, forwardRef, useEffect, useRef } from "react";
14
+ import { Row, Col, Checkbox, Popover, Empty, Tooltip } from "antd";
15
+ import { MediaPlay } from "./..";
16
+ import DeleteSvg from "./delete.svg";
17
+ import styles from "./index.module.less";
18
+ var VideoList = /*#__PURE__*/forwardRef(function (_ref, ref) {
19
+ var _ref$list = _ref.list,
20
+ list = _ref$list === void 0 ? [] : _ref$list,
21
+ onDelete = _ref.onDelete,
22
+ onCheck = _ref.onCheck,
23
+ _ref$gutter = _ref.gutter,
24
+ gutter = _ref$gutter === void 0 ? [16, 16] : _ref$gutter,
25
+ _ref$colSpan = _ref.colSpan,
26
+ colSpan = _ref$colSpan === void 0 ? 8 : _ref$colSpan,
27
+ _ref$height = _ref.height,
28
+ height = _ref$height === void 0 ? 322 : _ref$height,
29
+ _ref$responsiveColSpa = _ref.responsiveColSpan,
30
+ responsiveColSpan = _ref$responsiveColSpa === void 0 ? {
31
+ xs: 24,
32
+ sm: 8,
33
+ md: 8,
34
+ lg: 6,
35
+ xl: 6,
36
+ xxl: 6
37
+ } : _ref$responsiveColSpa,
38
+ popoverContent = _ref.popoverContent,
39
+ onStateChange = _ref.onStateChange,
40
+ footer = _ref.footer,
41
+ leftAction = _ref.leftAction,
42
+ style = _ref.style,
43
+ footerStyle = _ref.footerStyle,
44
+ selectedIds = _ref.selectedIds,
45
+ _ref$isLoading = _ref.isLoading,
46
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
47
+ var _useState = useState([]),
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ checkedIds = _useState2[0],
50
+ setCheckedIds = _useState2[1];
51
+ var _useState3 = useState(null),
52
+ _useState4 = _slicedToArray(_useState3, 2),
53
+ hoveredItem = _useState4[0],
54
+ setHoveredItem = _useState4[1];
55
+ var itemRef = useRef(null);
56
+ var _useState5 = useState(0),
57
+ _useState6 = _slicedToArray(_useState5, 2),
58
+ itemWidth = _useState6[0],
59
+ setItemWidth = _useState6[1];
60
+ var getSelectionStatus = function getSelectionStatus() {
61
+ if (checkedIds.length === 0) return 'none';
62
+ if (checkedIds.length === list.length) return 'all';
63
+ return 'partially';
64
+ };
65
+ useEffect(function () {
66
+ if (onStateChange) {
67
+ onStateChange({
68
+ selectedIds: checkedIds,
69
+ selectionStatus: getSelectionStatus()
70
+ });
71
+ }
72
+ }, [checkedIds]);
73
+
74
+ // useEffect(() => {
75
+ // if (selectedIds && selectedIds.join() !== checkedIds.join()) {
76
+ // setCheckedIds(selectedIds || []);
77
+ // }
78
+ // }, [selectedIds, checkedIds]);
79
+
80
+ useEffect(function () {
81
+ setCheckedIds(selectedIds || []);
82
+ }, [selectedIds]);
83
+ useEffect(function () {
84
+ if (itemRef.current) {
85
+ setItemWidth(itemRef.current.getBoundingClientRect().width);
86
+ }
87
+ }, [list.length]);
88
+ var handleCheck = function handleCheck(id, checked) {
89
+ var newCheckedIds = checked ? [].concat(_toConsumableArray(checkedIds), [id]) : checkedIds.filter(function (checkedId) {
90
+ return checkedId !== id;
91
+ });
92
+ setCheckedIds(newCheckedIds);
93
+ onCheck === null || onCheck === void 0 || onCheck(newCheckedIds);
94
+ };
95
+ var selectAll = function selectAll() {
96
+ var allIds = list.map(function (video) {
97
+ return video.id;
98
+ });
99
+ setCheckedIds(allIds);
100
+ onCheck === null || onCheck === void 0 || onCheck(allIds);
101
+ };
102
+ var cancelSelectAll = function cancelSelectAll() {
103
+ setCheckedIds([]);
104
+ onCheck === null || onCheck === void 0 || onCheck([]);
105
+ };
106
+ useImperativeHandle(ref, function () {
107
+ return {
108
+ selectAll: selectAll,
109
+ cancelSelectAll: cancelSelectAll,
110
+ getSelectionStatus: getSelectionStatus,
111
+ getItemWidth: function getItemWidth() {
112
+ return itemWidth;
113
+ },
114
+ itemWidth: itemWidth
115
+ };
116
+ });
117
+ return /*#__PURE__*/React.createElement(Row, {
118
+ gutter: gutter
119
+ }, isLoading ? Array.from({
120
+ length: 4
121
+ }).map(function (_, index) {
122
+ return /*#__PURE__*/React.createElement(Col, _extends({
123
+ key: index,
124
+ span: colSpan
125
+ }, responsiveColSpan), /*#__PURE__*/React.createElement("div", {
126
+ className: styles.skeletonWrap
127
+ }, /*#__PURE__*/React.createElement("div", {
128
+ className: styles.skeletonThumbnail
129
+ }), /*#__PURE__*/React.createElement("div", {
130
+ className: styles.skeletonText
131
+ })));
132
+ }) : list.length === 0 ? /*#__PURE__*/React.createElement(Col, {
133
+ span: 24
134
+ }, /*#__PURE__*/React.createElement(Empty, {
135
+ image: Empty.PRESENTED_IMAGE_SIMPLE
136
+ })) : list.map(function (video, index) {
137
+ var isFirstItem = index === 0;
138
+ return /*#__PURE__*/React.createElement(Col, _extends({
139
+ key: video.id,
140
+ span: colSpan
141
+ }, responsiveColSpan), /*#__PURE__*/React.createElement(Tooltip, {
142
+ title: video.errorText,
143
+ color: '#fff',
144
+ mouseLeaveDelay: 1
145
+ }, /*#__PURE__*/React.createElement(Popover, {
146
+ arrow: false,
147
+ content: hoveredItem === video ? popoverContent && (popoverContent === null || popoverContent === void 0 ? void 0 : popoverContent(video)) : null,
148
+ open: popoverContent && popoverContent !== null && popoverContent !== void 0 && popoverContent(video) ? hoveredItem === video : false,
149
+ placement: "right",
150
+ trigger: "hover",
151
+ onOpenChange: function onOpenChange(visible) {
152
+ if (visible) {
153
+ setHoveredItem(video);
154
+ } else {
155
+ setHoveredItem(null);
156
+ }
157
+ }
158
+ // @ts-ignore
159
+ ,
160
+ onMouseEnter: function onMouseEnter() {
161
+ return setHoveredItem(video);
162
+ },
163
+ onMouseLeave: function onMouseLeave() {
164
+ return setHoveredItem(null);
165
+ },
166
+ mouseEnterDelay: 0.1,
167
+ mouseLeaveDelay: 0.3
168
+ }, /*#__PURE__*/React.createElement("div", {
169
+ ref: isFirstItem ? itemRef : null,
170
+ className: "".concat(styles.video_wrap, " ").concat(checkedIds.includes(video.id) ? styles.selected : ""),
171
+ style: style
172
+ }, /*#__PURE__*/React.createElement("div", {
173
+ style: {
174
+ position: "relative",
175
+ height: height
176
+ }
177
+ }, /*#__PURE__*/React.createElement(MediaPlay, {
178
+ url: [video.url],
179
+ type: "video",
180
+ previewUrl: [video.previewUrl],
181
+ trackLabel: video.trackLabel,
182
+ trackUrl: video.trackUrl,
183
+ onPlayClick: video.onPlayClick
184
+ }), leftAction && hoveredItem === video && leftAction(video), video.headerContent && /*#__PURE__*/React.createElement("div", {
185
+ className: styles.video_wrap_header
186
+ }, video.headerContent), onCheck && /*#__PURE__*/React.createElement("div", {
187
+ className: styles.video_wrap_check
188
+ }, /*#__PURE__*/React.createElement(Checkbox, {
189
+ checked: checkedIds.includes(video.id),
190
+ onChange: function onChange(e) {
191
+ return handleCheck(video.id, e.target.checked);
192
+ }
193
+ })), onDelete && /*#__PURE__*/React.createElement("div", {
194
+ className: styles.video_wrap_delete,
195
+ onClick: function onClick() {
196
+ return onDelete(video.id);
197
+ }
198
+ }, /*#__PURE__*/React.createElement("img", {
199
+ src: DeleteSvg,
200
+ alt: "delete"
201
+ })), /*#__PURE__*/React.createElement("div", {
202
+ className: styles.video_wrap_desc
203
+ }, /*#__PURE__*/React.isValidElement(video.desc) ? video.desc : _typeof(video.desc) === "object" && video.desc !== null ? /*#__PURE__*/React.createElement(React.Fragment, null, "lang" in video.desc && video.desc.lang && /*#__PURE__*/React.createElement("div", {
204
+ className: styles.circle_block,
205
+ style: {
206
+ background: "linear-gradient(90deg, #F42E47 0%, #6E3EE1 100%)"
207
+ }
208
+ }, video.desc.lang), "time" in video.desc && video.desc.time && /*#__PURE__*/React.createElement("div", {
209
+ className: styles.circle_block,
210
+ style: {
211
+ background: "rgba(0, 0, 0, 0.5)"
212
+ }
213
+ }, video.desc.time)) : null)), footer && /*#__PURE__*/React.createElement("div", {
214
+ className: styles.footer,
215
+ style: footerStyle
216
+ }, footer(video))))));
217
+ }));
218
+ });
219
+ export default VideoList;
@@ -0,0 +1,127 @@
1
+ .video_wrap {
2
+ position: relative;
3
+ border: 2px solid transparent;
4
+ border-radius: 8px;
5
+ overflow: hidden;
6
+ cursor: pointer;
7
+ box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
8
+ transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
9
+ will-change: transform;
10
+
11
+ &:hover {
12
+ transform: translateY(-10px);
13
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
14
+ }
15
+
16
+ &_check, &_delete {
17
+ opacity: 0;
18
+ visibility: hidden;
19
+ transition: opacity 0.3s ease, visibility 0.3s ease;
20
+ }
21
+
22
+ &:hover &_check, &:hover &_delete {
23
+ opacity: 1;
24
+ visibility: visible;
25
+ }
26
+
27
+ &_check {
28
+ position: absolute;
29
+ top: 8px;
30
+ left: 8px;
31
+ width: 24px;
32
+ height: 24px;
33
+ background: #FFFFFF;
34
+ text-align: center;
35
+ border-radius: 4px;
36
+ }
37
+
38
+ &_delete {
39
+ position: absolute;
40
+ top: 8px;
41
+ right: 8px;
42
+ width: 24px;
43
+ text-align: center;
44
+ display: flex;
45
+ justify-content: center;
46
+ align-items: center;
47
+ height: 24px;
48
+ background: #FFFFFF;
49
+ border-radius: 4px;
50
+ cursor: pointer;
51
+ }
52
+
53
+ &_desc {
54
+ position: absolute;
55
+ bottom: 12px;
56
+ right: 8px;
57
+ display: flex;
58
+ align-items: center;
59
+ gap: 8px;
60
+ }
61
+
62
+ &_header {
63
+ position: absolute;
64
+ top: 8px;
65
+ padding: 0 8px;
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 8px;
69
+ }
70
+ }
71
+
72
+ .circle_block {
73
+ padding: 2px 8px;
74
+ background: linear-gradient(90deg, #F42E47 0%, #6E3EE1 100%);
75
+ border-radius: 8px;
76
+ text-align: center;
77
+ color: #FFFFFF;
78
+ }
79
+
80
+ .selected {
81
+ border-color: #1890ff;
82
+ }
83
+
84
+
85
+ .footer {
86
+ width: 100%;
87
+ padding: 16px 0;
88
+ background: #FFFFFF;
89
+ }
90
+
91
+ @keyframes loading {
92
+ 0% {
93
+ background-position: -200px 0;
94
+ }
95
+ 100% {
96
+ background-position: calc(200px + 100%) 0;
97
+ }
98
+ }
99
+
100
+ .skeletonWrap {
101
+ display: flex;
102
+ flex-direction: column;
103
+ gap: 10px;
104
+ background: #f0f0f0;
105
+ padding: 10px;
106
+ border-radius: 8px;
107
+ }
108
+
109
+ .skeletonThumbnail,
110
+ .skeletonText {
111
+ background-color: #e0e0e0;
112
+ background-image: linear-gradient(90deg, #e0e0e0 25%, #f3f3f3 50%, #e0e0e0 75%);
113
+ background-size: 200px 100%;
114
+ background-repeat: no-repeat;
115
+ animation: loading 1.5s infinite;
116
+ }
117
+
118
+ .skeletonThumbnail {
119
+ height: 200px;
120
+ border-radius: 4px;
121
+ }
122
+
123
+ .skeletonText {
124
+ height: 20px;
125
+ border-radius: 4px;
126
+ width: 60%;
127
+ }
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@chlp-tech/rpa-ui",
3
+ "version": "0.0.1",
4
+ "description": "rpa-ui",
5
+ "module": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "start": "npm run dev",
9
+ "dev": "dumi dev",
10
+ "build": "father build",
11
+ "build:watch": "father dev",
12
+ "docs:build": "dumi build",
13
+ "docs:preview": "dumi preview",
14
+ "prepare": "husky install && dumi setup",
15
+ "doctor": "father doctor",
16
+ "lint": "npm run lint:es && npm run lint:css",
17
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
18
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
19
+ "prepublishOnly": "father doctor && npm run build"
20
+ },
21
+ "authors": [],
22
+ "license": "MIT",
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "commitlint": {
27
+ "extends": [
28
+ "@commitlint/config-conventional"
29
+ ]
30
+ },
31
+ "lint-staged": {
32
+ "*.{md,json}": [
33
+ "prettier --write --no-error-on-unmatched-pattern"
34
+ ],
35
+ "*.{css,less}": [
36
+ "stylelint --fix",
37
+ "prettier --write"
38
+ ],
39
+ "*.{js,jsx}": [
40
+ "eslint --fix",
41
+ "prettier --write"
42
+ ],
43
+ "*.{ts,tsx}": [
44
+ "eslint --fix",
45
+ "prettier --parser=typescript --write"
46
+ ]
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "peerDependencies": {
52
+ "@ant-design/icons": ">=4.18.0",
53
+ "antd": ">=4.18.0",
54
+ "react": ">=16.9.0",
55
+ "react-dom": ">=16.9.0"
56
+ },
57
+ "devDependencies": {
58
+ "@ant-design/icons": "^5.5.2",
59
+ "@commitlint/cli": "^17.1.2",
60
+ "@commitlint/config-conventional": "^17.1.0",
61
+ "@types/react": "^18.0.0",
62
+ "@types/react-dom": "^18.0.0",
63
+ "@umijs/lint": "^4.0.0",
64
+ "dumi": "^2.3.0",
65
+ "eslint": "^8.23.0",
66
+ "father": "^4.1.0",
67
+ "husky": "^8.0.1",
68
+ "lint-staged": "^13.0.3",
69
+ "prettier": "^2.7.1",
70
+ "prettier-plugin-organize-imports": "^3.0.0",
71
+ "prettier-plugin-packagejson": "^2.2.18",
72
+ "react": "^18.0.0",
73
+ "react-dom": "^18.0.0",
74
+ "stylelint": "^14.9.1",
75
+ "terser": "^5.33.0"
76
+ },
77
+ "dependencies": {
78
+ "@webav/av-cliper": "^1.0.11",
79
+ "dayjs": "^1.11.13",
80
+ "js-md5": "^0.8.3",
81
+ "styled-components": "^6.1.12"
82
+ }
83
+ }