@cloud-app-dev/vidc 3.2.13 → 3.2.15

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 (162) hide show
  1. package/es/{List/DynamicGridList → DynamicGridList}/Demo.d.ts +0 -0
  2. package/es/{List/DynamicGridList → DynamicGridList}/Demo.js +7 -2
  3. package/es/{List/DynamicGridList → DynamicGridList}/index.d.ts +3 -3
  4. package/es/{List/DynamicGridList → DynamicGridList}/index.js +5 -5
  5. package/es/DynamicList/demo.d.ts +2 -0
  6. package/es/DynamicList/demo.js +60 -0
  7. package/es/{List/DynamicList → DynamicList}/index.d.ts +18 -1
  8. package/es/{List/DynamicList → DynamicList}/index.js +8 -7
  9. package/es/{List/DynamicList → DynamicList}/index.less +0 -0
  10. package/es/{List/DynamicList → DynamicList}/interface.d.ts +0 -0
  11. package/es/{List/DynamicList → DynamicList}/utils.d.ts +0 -0
  12. package/es/{List/DynamicList → DynamicList}/utils.js +0 -0
  13. package/es/{List/GridList → GridList}/Demo.d.ts +0 -0
  14. package/es/{List/GridList → GridList}/Demo.js +4 -3
  15. package/es/GridList/data.d.ts +16 -0
  16. package/es/GridList/data.js +609 -0
  17. package/es/{List/GridList → GridList}/hook.d.ts +0 -0
  18. package/es/{List/GridList → GridList}/hook.js +0 -0
  19. package/es/{List/GridList → GridList}/index.d.ts +0 -0
  20. package/es/{List/GridList → GridList}/index.js +0 -0
  21. package/es/{List/GridList → GridList}/index.less +0 -0
  22. package/es/{List/GridList → GridList}/interface.d.ts +0 -0
  23. package/es/{List/GridList → GridList}/utils.d.ts +0 -0
  24. package/es/{List/GridList → GridList}/utils.js +0 -0
  25. package/es/List/index.d.ts +28 -5
  26. package/es/List/index.js +6 -5
  27. package/es/ListWithSizeAnimate/demo.d.ts +2 -0
  28. package/es/ListWithSizeAnimate/demo.js +140 -0
  29. package/es/ListWithSizeAnimate/index.d.ts +14 -0
  30. package/es/ListWithSizeAnimate/index.js +112 -0
  31. package/es/ListWithSizeAnimate/index.less +14 -0
  32. package/es/Picture/interface.d.ts +0 -6
  33. package/es/Player/contraller_bar/volume.d.ts +1 -1
  34. package/es/PlayerExt/index.d.ts +1 -1
  35. package/es/PlayerExt/index.js +4 -5
  36. package/es/ScreenPlayer/Live.d.ts +1 -1
  37. package/es/ScreenPlayer/Live.js +24 -17
  38. package/es/ScreenPlayer/LiveTools.d.ts +2 -2
  39. package/es/ScreenPlayer/LiveTools.js +9 -6
  40. package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
  41. package/es/ScreenPlayer/PlayerWithExt.js +7 -5
  42. package/es/ScreenPlayer/Record.d.ts +1 -1
  43. package/es/ScreenPlayer/Record.js +30 -21
  44. package/es/ScreenPlayer/RecordTools.d.ts +2 -2
  45. package/es/ScreenPlayer/RecordTools.js +20 -12
  46. package/es/ScreenPlayer/ScreenSelect.js +5 -3
  47. package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -1
  48. package/es/ScreenPlayer/SegmentTimeLine.js +1 -1
  49. package/es/ScreenPlayer/TimeSelect.js +2 -2
  50. package/es/ScreenPlayer/demo2.js +1 -1
  51. package/es/ScreenPlayer/interface.d.ts +2 -2
  52. package/es/ScreenPlayer/useTimeSlider.d.ts +8 -8
  53. package/es/ScreenPlayer/useTimeSlider.js +23 -15
  54. package/es/ScreenPlayer/useVideoFit.d.ts +1 -1
  55. package/es/ScreenPlayer/utils.d.ts +1 -1
  56. package/es/ScreenPlayer/utils.js +4 -1
  57. package/es/ThemeAntd/style/button.less +1 -1
  58. package/es/ThemeAntd/style/pagination.less +1 -1
  59. package/es/{List/VList → VList}/index.d.ts +0 -0
  60. package/es/{List/VList → VList}/index.js +5 -4
  61. package/es/{List/VList → VList}/index.less +0 -0
  62. package/es/{List/VList → VList}/utils.d.ts +0 -0
  63. package/es/{List/VList → VList}/utils.js +0 -0
  64. package/es/index.d.ts +5 -0
  65. package/es/index.js +5 -0
  66. package/package.json +2 -7
  67. package/.dumi/tmp/core/EmptyRoute.tsx +0 -9
  68. package/.dumi/tmp/core/defineApp.ts +0 -16
  69. package/.dumi/tmp/core/history.ts +0 -61
  70. package/.dumi/tmp/core/plugin.ts +0 -42
  71. package/.dumi/tmp/core/pluginConfig.d.ts +0 -276
  72. package/.dumi/tmp/core/polyfill.ts +0 -202
  73. package/.dumi/tmp/core/route.tsx +0 -38
  74. package/.dumi/tmp/core/terminal.ts +0 -38
  75. package/.dumi/tmp/dumi/exports.ts +0 -5
  76. package/.dumi/tmp/dumi/locales/config.ts +0 -56
  77. package/.dumi/tmp/dumi/locales/runtime.tsx +0 -38
  78. package/.dumi/tmp/dumi/meta/atoms.ts +0 -4
  79. package/.dumi/tmp/dumi/meta/index.ts +0 -186
  80. package/.dumi/tmp/dumi/meta/runtime.ts +0 -18
  81. package/.dumi/tmp/dumi/meta/tabs.ts +0 -8
  82. package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +0 -41
  83. package/.dumi/tmp/dumi/theme/builtins/API.ts +0 -4
  84. package/.dumi/tmp/dumi/theme/builtins/Badge.ts +0 -4
  85. package/.dumi/tmp/dumi/theme/builtins/Container.ts +0 -4
  86. package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +0 -4
  87. package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +0 -4
  88. package/.dumi/tmp/dumi/theme/builtins/Table.ts +0 -4
  89. package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +0 -4
  90. package/.dumi/tmp/dumi/theme/slots/Content.ts +0 -4
  91. package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +0 -4
  92. package/.dumi/tmp/dumi/theme/slots/Features.ts +0 -4
  93. package/.dumi/tmp/dumi/theme/slots/Footer.ts +0 -4
  94. package/.dumi/tmp/dumi/theme/slots/Header.ts +0 -4
  95. package/.dumi/tmp/dumi/theme/slots/Hero.ts +0 -4
  96. package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +0 -4
  97. package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +0 -4
  98. package/.dumi/tmp/dumi/theme/slots/Logo.ts +0 -4
  99. package/.dumi/tmp/dumi/theme/slots/Navbar.ts +0 -4
  100. package/.dumi/tmp/dumi/theme/slots/NotFound.ts +0 -4
  101. package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +0 -4
  102. package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +0 -4
  103. package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +0 -4
  104. package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +0 -4
  105. package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +0 -4
  106. package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +0 -4
  107. package/.dumi/tmp/dumi/theme/slots/Toc.ts +0 -4
  108. package/.dumi/tmp/exports.ts +0 -15
  109. package/.dumi/tmp/testBrowser.tsx +0 -82
  110. package/.dumi/tmp/tsconfig.json +0 -35
  111. package/.dumi/tmp/typings.d.ts +0 -136
  112. package/.dumi/tmp/umi.ts +0 -77
  113. package/.dumi/tmp-production/core/EmptyRoute.tsx +0 -9
  114. package/.dumi/tmp-production/core/defineApp.ts +0 -16
  115. package/.dumi/tmp-production/core/history.ts +0 -61
  116. package/.dumi/tmp-production/core/plugin.ts +0 -42
  117. package/.dumi/tmp-production/core/pluginConfig.d.ts +0 -276
  118. package/.dumi/tmp-production/core/polyfill.ts +0 -202
  119. package/.dumi/tmp-production/core/route.tsx +0 -38
  120. package/.dumi/tmp-production/core/terminal.ts +0 -38
  121. package/.dumi/tmp-production/dumi/exports.ts +0 -5
  122. package/.dumi/tmp-production/dumi/locales/config.ts +0 -56
  123. package/.dumi/tmp-production/dumi/locales/runtime.tsx +0 -38
  124. package/.dumi/tmp-production/dumi/meta/atoms.ts +0 -4
  125. package/.dumi/tmp-production/dumi/meta/index.ts +0 -178
  126. package/.dumi/tmp-production/dumi/meta/runtime.ts +0 -18
  127. package/.dumi/tmp-production/dumi/meta/tabs.ts +0 -5
  128. package/.dumi/tmp-production/dumi/theme/ContextWrapper.tsx +0 -41
  129. package/.dumi/tmp-production/dumi/theme/builtins/API.ts +0 -4
  130. package/.dumi/tmp-production/dumi/theme/builtins/Badge.ts +0 -4
  131. package/.dumi/tmp-production/dumi/theme/builtins/Container.ts +0 -4
  132. package/.dumi/tmp-production/dumi/theme/builtins/Previewer.ts +0 -4
  133. package/.dumi/tmp-production/dumi/theme/builtins/SourceCode.ts +0 -4
  134. package/.dumi/tmp-production/dumi/theme/builtins/Table.ts +0 -4
  135. package/.dumi/tmp-production/dumi/theme/layouts/DocLayout.ts +0 -4
  136. package/.dumi/tmp-production/dumi/theme/slots/Content.ts +0 -4
  137. package/.dumi/tmp-production/dumi/theme/slots/ContentTabs.ts +0 -4
  138. package/.dumi/tmp-production/dumi/theme/slots/Features.ts +0 -4
  139. package/.dumi/tmp-production/dumi/theme/slots/Footer.ts +0 -4
  140. package/.dumi/tmp-production/dumi/theme/slots/Header.ts +0 -4
  141. package/.dumi/tmp-production/dumi/theme/slots/Hero.ts +0 -4
  142. package/.dumi/tmp-production/dumi/theme/slots/HeroTitle.ts +0 -4
  143. package/.dumi/tmp-production/dumi/theme/slots/LangSwitch.ts +0 -4
  144. package/.dumi/tmp-production/dumi/theme/slots/Logo.ts +0 -4
  145. package/.dumi/tmp-production/dumi/theme/slots/Navbar.ts +0 -4
  146. package/.dumi/tmp-production/dumi/theme/slots/NotFound.ts +0 -4
  147. package/.dumi/tmp-production/dumi/theme/slots/PreviewerActions.ts +0 -4
  148. package/.dumi/tmp-production/dumi/theme/slots/PreviewerActionsExtra.ts +0 -4
  149. package/.dumi/tmp-production/dumi/theme/slots/RtlSwitch.ts +0 -4
  150. package/.dumi/tmp-production/dumi/theme/slots/SearchBar.ts +0 -4
  151. package/.dumi/tmp-production/dumi/theme/slots/SearchResult.ts +0 -4
  152. package/.dumi/tmp-production/dumi/theme/slots/Sidebar.ts +0 -4
  153. package/.dumi/tmp-production/dumi/theme/slots/Toc.ts +0 -4
  154. package/.dumi/tmp-production/exports.ts +0 -14
  155. package/.dumi/tmp-production/testBrowser.tsx +0 -82
  156. package/.dumi/tmp-production/tsconfig.json +0 -35
  157. package/.dumi/tmp-production/typings.d.ts +0 -136
  158. package/.dumi/tmp-production/umi.ts +0 -77
  159. package/.stylelintrc +0 -3
  160. package/clear-cache.sh +0 -4
  161. package/es/List/GridList/data.json +0 -710
  162. package/es/List/interface.d.ts +0 -29
@@ -1,6 +1,29 @@
1
1
  import React from 'react';
2
- import { ListProps } from './interface';
3
2
  import './index.less';
3
+ export interface ListProps<T> {
4
+ /**
5
+ * @description 列表数据
6
+ * @default []
7
+ */
8
+ list?: Array<T>;
9
+ /**
10
+ * @description 列表类名
11
+ * @default ''
12
+ */
13
+ className?: string;
14
+ /**
15
+ * @description 列表样式
16
+ * @default -
17
+ */
18
+ style?: React.CSSProperties;
19
+ /**
20
+ * @description 列表自定义渲染
21
+ * @default -
22
+ */
23
+ renderItem: (item: T, index: number) => JSX.Element;
24
+ rowHeight?: number;
25
+ renderHeaderExt?: () => JSX.Element;
26
+ }
4
27
  declare function List<T>(props: ListProps<T>): JSX.Element;
5
28
  declare namespace List {
6
29
  var defaultProps: {
@@ -10,9 +33,9 @@ declare namespace List {
10
33
  itemNameKey: string;
11
34
  renderHeaderExt: () => JSX.Element;
12
35
  };
13
- var VList: typeof import("./VList").default;
14
- var DynamicList: typeof import("./DynamicList").default;
15
- var GridList: React.ForwardRefExoticComponent<import("./GridList").GridListProps<unknown> & React.RefAttributes<HTMLDivElement>>;
16
- var DynamicGridList: typeof import("./DynamicGridList").default;
36
+ var VList: typeof import("../VList").default;
37
+ var DynamicList: typeof import("../DynamicList").default;
38
+ var GridList: React.ForwardRefExoticComponent<import("../GridList").GridListProps<unknown> & React.RefAttributes<HTMLDivElement>>;
39
+ var DynamicGridList: typeof import("../DynamicGridList").default;
17
40
  }
18
41
  export default List;
package/es/List/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import DynamicList from "./DynamicList";
3
- import GridList from "./GridList";
4
- import DynamicGridList from "./DynamicGridList";
5
- import VList from "./VList";
2
+ import DynamicGridList from "../DynamicGridList";
3
+ import DynamicList from "../DynamicList";
4
+ import GridList from "../GridList";
5
+ import VList from "../VList"; // style
6
+
6
7
  import "./index.less";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -20,7 +21,7 @@ function List(props) {
20
21
  style: style,
21
22
  children: [/*#__PURE__*/_jsx("div", {
22
23
  className: "lm-c-list-header",
23
- children: renderHeaderExt()
24
+ children: renderHeaderExt === null || renderHeaderExt === void 0 ? void 0 : renderHeaderExt()
24
25
  }), /*#__PURE__*/_jsx("div", {
25
26
  className: "lm-c-base-list-layout",
26
27
  children: /*#__PURE__*/_jsx(VList, {
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function App(): JSX.Element;
@@ -0,0 +1,140 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ 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."); }
4
+
5
+ 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); }
6
+
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+
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
+
13
+ /* eslint-disable @typescript-eslint/no-unused-expressions */
14
+ import React from 'react';
15
+ import ListWithSizeAnimate from "./index";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { jsxs as _jsxs } from "react/jsx-runtime";
18
+
19
+ function random(low, high) {
20
+ return Math.floor(Math.random() * high) + low;
21
+ }
22
+
23
+ var IMAGES = function IMAGES() {
24
+ return Array.from({
25
+ length: 20
26
+ }, function (_, index) {
27
+ var width = 300;
28
+ var height = random(200, 300);
29
+ return {
30
+ url: "https://picsum.photos/id/".concat(index + 1, "/").concat(width, "/").concat(height, ".jpg"),
31
+ width: width,
32
+ height: height
33
+ };
34
+ });
35
+ };
36
+
37
+ function loadPage(d) {
38
+ if (!d) {
39
+ // eslint-disable-next-line no-param-reassign
40
+ d = {};
41
+ }
42
+
43
+ var resultData = IMAGES();
44
+ d.page ? d.page++ : d.page = 1;
45
+ d.list ? d.list = [].concat(_toConsumableArray(d.list), _toConsumableArray(resultData)) : d.list = resultData;
46
+ return new Promise(function (resolve) {
47
+ console.log(d.page);
48
+ setTimeout(function () {
49
+ return resolve(d);
50
+ }, 10);
51
+ });
52
+ }
53
+
54
+ export default function App() {
55
+ return /*#__PURE__*/_jsx("div", {
56
+ style: {
57
+ width: '100%',
58
+ height: 800
59
+ },
60
+ children: /*#__PURE__*/_jsx(ListWithSizeAnimate, {
61
+ headerSize: 400,
62
+ header: /*#__PURE__*/_jsx("div", {
63
+ children: /*#__PURE__*/_jsxs("ul", {
64
+ children: [/*#__PURE__*/_jsx("li", {
65
+ children: "\u6761\u4EF61"
66
+ }), /*#__PURE__*/_jsx("li", {
67
+ children: "\u6761\u4EF62"
68
+ }), /*#__PURE__*/_jsx("li", {
69
+ children: "\u6761\u4EF63"
70
+ }), /*#__PURE__*/_jsx("li", {
71
+ children: "\u6761\u4EF63"
72
+ }), /*#__PURE__*/_jsx("li", {
73
+ children: "\u6761\u4EF63"
74
+ }), /*#__PURE__*/_jsx("li", {
75
+ children: "\u6761\u4EF63"
76
+ }), /*#__PURE__*/_jsx("li", {
77
+ children: "\u6761\u4EF63"
78
+ }), /*#__PURE__*/_jsx("li", {
79
+ children: "\u6761\u4EF63"
80
+ }), /*#__PURE__*/_jsx("li", {
81
+ children: "\u6761\u4EF63"
82
+ }), /*#__PURE__*/_jsx("li", {
83
+ children: "\u6761\u4EF63"
84
+ }), /*#__PURE__*/_jsx("li", {
85
+ children: "\u6761\u4EF63"
86
+ }), /*#__PURE__*/_jsx("li", {
87
+ children: "\u6761\u4EF63"
88
+ }), /*#__PURE__*/_jsx("li", {
89
+ children: "\u6761\u4EF63"
90
+ }), /*#__PURE__*/_jsx("li", {
91
+ children: "\u6761\u4EF63"
92
+ }), /*#__PURE__*/_jsx("li", {
93
+ children: "\u6761\u4EF63"
94
+ }), /*#__PURE__*/_jsx("li", {
95
+ children: "\u6761\u4EF63"
96
+ })]
97
+ })
98
+ }),
99
+ itemKey: "url",
100
+ itemHeight: 300,
101
+ itemWidth: 250,
102
+ renderItem: function renderItem(image) {
103
+ return /*#__PURE__*/_jsxs("div", {
104
+ style: {
105
+ border: '1px solid gray',
106
+ height: '100%',
107
+ display: 'flex',
108
+ flexDirection: 'column'
109
+ },
110
+ children: [/*#__PURE__*/_jsx("div", {
111
+ style: {
112
+ flex: 1,
113
+ overflow: 'hidden'
114
+ },
115
+ children: /*#__PURE__*/_jsx("img", {
116
+ src: image.url,
117
+ alt: "",
118
+ style: {
119
+ objectFit: 'cover',
120
+ display: 'block',
121
+ width: '100%',
122
+ height: '100%'
123
+ }
124
+ })
125
+ }), /*#__PURE__*/_jsx("p", {
126
+ children: "\u6807\u9898"
127
+ }), /*#__PURE__*/_jsx("p", {
128
+ children: "\u63CF\u8FF0"
129
+ })]
130
+ });
131
+ },
132
+ loadPage: loadPage,
133
+ children: /*#__PURE__*/_jsx("div", {
134
+ style: {
135
+ height: 800
136
+ }
137
+ })
138
+ })
139
+ });
140
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { IDynamicGridListProps } from '../DynamicGridList';
3
+ import './index.less';
4
+ interface IListWithSizeAnimateProps<T> extends IDynamicGridListProps<T> {
5
+ headerSize: number;
6
+ children?: React.ReactNode;
7
+ header?: React.ReactNode;
8
+ }
9
+ interface IListWithSizeAnimateRef {
10
+ open: () => void;
11
+ close: () => void;
12
+ }
13
+ declare const ListWithSizeAnimate: React.ForwardRefExoticComponent<IListWithSizeAnimateProps<unknown> & React.RefAttributes<IListWithSizeAnimateRef>>;
14
+ export default ListWithSizeAnimate;
@@ -0,0 +1,112 @@
1
+ import _useEventListener from "ahooks/es/useEventListener";
2
+ var _excluded = ["headerSize", "header"];
3
+
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+
8
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+
12
+ 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."); }
13
+
14
+ 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); }
15
+
16
+ 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; }
17
+
18
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
19
+
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+
22
+ 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; }
23
+
24
+ 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; }
25
+
26
+ import React, { useImperativeHandle, useMemo, useRef } from 'react';
27
+ import DynamicGridList from "../DynamicGridList";
28
+ import useSimpleState from "../useSimpleState";
29
+ import "./index.less";
30
+ import { jsx as _jsx } from "react/jsx-runtime";
31
+ import { jsxs as _jsxs } from "react/jsx-runtime";
32
+ var ListWithSizeAnimate = /*#__PURE__*/React.forwardRef(function ListWithSizeAnimate(_ref, forwardRef) {
33
+ var _ref$current;
34
+
35
+ var headerSize = _ref.headerSize,
36
+ header = _ref.header,
37
+ props = _objectWithoutProperties(_ref, _excluded);
38
+
39
+ var _useSimpleState = useSimpleState({
40
+ open: true
41
+ }),
42
+ _useSimpleState2 = _slicedToArray(_useSimpleState, 2),
43
+ state = _useSimpleState2[0],
44
+ updateState = _useSimpleState2[1];
45
+
46
+ var ref = useRef(null);
47
+ var headerHeight = useMemo(function () {
48
+ return state.open ? headerSize : 0;
49
+ }, [state.open]);
50
+ var contentHeight = useMemo(function () {
51
+ return "calc(100% - ".concat(headerHeight, "px)");
52
+ }, [headerHeight]);
53
+
54
+ _useEventListener('wheel', function (event) {
55
+ if (event.deltaY > 0 && state.open) {
56
+ updateState({
57
+ open: false
58
+ });
59
+ }
60
+ }, {
61
+ target: ref
62
+ });
63
+
64
+ _useEventListener('scroll', function (event) {
65
+ var _event$currentTarget;
66
+
67
+ if (((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.scrollTop) === 0) {
68
+ updateState({
69
+ open: true
70
+ });
71
+ }
72
+ }, {
73
+ target: (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector('.cloudapp-dynamic-grid-list')
74
+ });
75
+
76
+ useImperativeHandle(forwardRef, function () {
77
+ return {
78
+ open: function open() {
79
+ return updateState({
80
+ open: true
81
+ });
82
+ },
83
+ close: function close() {
84
+ return updateState({
85
+ open: false
86
+ });
87
+ }
88
+ };
89
+ }, []);
90
+ return /*#__PURE__*/_jsxs("div", {
91
+ className: "list-with-size-animate-layout",
92
+ ref: ref,
93
+ children: [/*#__PURE__*/_jsx("div", {
94
+ className: "list-animate-header",
95
+ style: {
96
+ height: headerHeight,
97
+ overflow: !state.open ? 'hidden' : undefined
98
+ },
99
+ children: /*#__PURE__*/_jsx("div", {
100
+ className: "list-animate-header-content",
101
+ children: header
102
+ })
103
+ }), /*#__PURE__*/_jsx("div", {
104
+ className: "list-animate-content",
105
+ style: {
106
+ height: contentHeight
107
+ },
108
+ children: /*#__PURE__*/_jsx(DynamicGridList, _objectSpread({}, props))
109
+ })]
110
+ });
111
+ });
112
+ export default ListWithSizeAnimate;
@@ -0,0 +1,14 @@
1
+ .list-with-size-animate-layout {
2
+ height: 100%;
3
+ width: 100%;
4
+ overflow: hidden;
5
+ .list-animate-header {
6
+ background-color: gray;
7
+ transition: height 0.3s;
8
+ }
9
+ .list-animate-content {
10
+ background-color: blue;
11
+ overflow: hidden;
12
+ transition: height 0.3s;
13
+ }
14
+ }
@@ -1,5 +1,3 @@
1
- import * as React from 'react';
2
-
3
1
  export type MenuRectType = {
4
2
  /**
5
3
  * 路由地址
@@ -21,7 +19,6 @@ export type MenuRectType = {
21
19
  */
22
20
  base64?: string;
23
21
  };
24
- export const MenuRectTypeDemo: React.FC<MenuRectType>;
25
22
 
26
23
  export type TagItemType = {
27
24
  /**
@@ -44,7 +41,6 @@ export type TagItemType = {
44
41
  */
45
42
  titleAttr?: string;
46
43
  };
47
- export const TagItemTypeDemo: React.FC<TagItemType>;
48
44
 
49
45
  export type ImageType = 'face' | 'body' | 'nonVehicle' | 'vehicle' | 'thing';
50
46
 
@@ -104,8 +100,6 @@ export type RectType = {
104
100
  base64?: string;
105
101
  };
106
102
 
107
- export const RectTypeDemo: React.FC<RectType>;
108
-
109
103
  export type PositionType = {
110
104
  x: number;
111
105
  y: number;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type Api from '../api';
3
3
  import '../style/volume.less';
4
4
  declare function Volume({ api, style }: {
5
- api: Api;
5
+ api?: Api;
6
6
  style?: React.CSSProperties;
7
7
  }): JSX.Element;
8
8
  declare const _default: React.MemoExoticComponent<typeof Volume>;
@@ -41,7 +41,7 @@ export declare function getLocalPort(): string;
41
41
  * @returns
42
42
  */
43
43
  export declare function getLocalPlayPath(url: string, params?: string): string;
44
- export declare function usePlugin(mode: PlayModeType, key: any): {
44
+ export declare function usePlugin(mode?: PlayModeType, key?: any): {
45
45
  needInstall: boolean;
46
46
  };
47
47
  export declare function ExtModel({ url, children, mode, pluginDownloadUrl, pluginParams, loading, segments }: IPluginProps): JSX.Element;
@@ -16,7 +16,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
16
 
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
- /* eslint-disable jsx-a11y/anchor-is-valid */
20
19
  import React, { useEffect, useMemo, useState } from 'react';
21
20
  import IconFont from "../Player/iconfont";
22
21
  import "./index.less";
@@ -46,7 +45,7 @@ export function getLocalPlayPath(url) {
46
45
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
47
46
  var URL_TEMPLATE = "http://127.0.0.1:<port>/video/v1/transcoding?uri=<pull_uri>";
48
47
  var port = getLocalPort();
49
- var pull_uri = window.btoa(url).replaceAll('=', '').replaceAll('/', '_').replaceAll('+', '-');
48
+ var pull_uri = window.btoa(url).replace(/=/g, '').replace(/\//, '_').replace('+', '-');
50
49
  return URL_TEMPLATE.replace('<port>', port).replace('<pull_uri>', pull_uri) + params;
51
50
  }
52
51
  export function usePlugin(mode, key) {
@@ -191,11 +190,11 @@ export function ExtModel(_ref2) {
191
190
  }, [url, mode]); // eslint-disable-next-line react-hooks/exhaustive-deps
192
191
 
193
192
  var playSegments = useMemo(function () {
194
- return mode === 2 && url ? segments.map(function (v) {
193
+ return mode === 2 && segments ? segments.map(function (v) {
195
194
  return _objectSpread(_objectSpread({}, v), {}, {
196
- url: getLocalPlayPath(v.url, pluginParams)
195
+ url: v.url ? getLocalPlayPath(v.url, pluginParams) : undefined
197
196
  });
198
- }) : url;
197
+ }) : segments;
199
198
  }, [segments, mode]);
200
199
 
201
200
  if (needInstall) {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { ILivePlayerProps } from './interface';
3
2
  import './index.less';
3
+ import type { ILivePlayerProps } from './interface';
4
4
  declare function LivePlayer({ list, children, oneWinExtTools, allWinExtTools, ...props }: ILivePlayerProps): JSX.Element;
5
5
  declare namespace LivePlayer {
6
6
  var defaultProps: {
@@ -25,12 +25,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
25
25
  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; }
26
26
 
27
27
  import React, { useEffect, useMemo, useRef, useState } from 'react';
28
- import { ScreenType, mergeFill } from "./utils";
29
- import { LivePlayerWithExt } from "./PlayerWithExt";
30
- import Tools from "./LiveTools";
31
- import useVideoFit from "./useVideoFit";
32
28
  import DisableMark from "../DisableMark";
33
29
  import "./index.less";
30
+ import Tools from "./LiveTools";
31
+ import { LivePlayerWithExt } from "./PlayerWithExt";
32
+ import useVideoFit from "./useVideoFit";
33
+ import { mergeFill, ScreenType } from "./utils";
34
34
  import { createElement as _createElement } from "react";
35
35
  import { jsx as _jsx } from "react/jsx-runtime";
36
36
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -77,10 +77,11 @@ function LivePlayer(_ref) {
77
77
  }, [list, screenNum]); // 获取选中player对象
78
78
 
79
79
  var getPlayerItem = function getPlayerItem() {
80
- var _playerRef$current, _playerRef$current$it;
80
+ var _playerRef$current, _playerRef$current$ci;
81
81
 
82
- var item = list[state.selectIndex];
83
- return (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : (_playerRef$current$it = _playerRef$current[item === null || item === void 0 ? void 0 : item.cid]) === null || _playerRef$current$it === void 0 ? void 0 : _playerRef$current$it.current;
82
+ var item = list ? list[state.selectIndex] : {};
83
+ var cid = item === null || item === void 0 ? void 0 : item.cid;
84
+ return cid ? (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : (_playerRef$current$ci = _playerRef$current[cid]) === null || _playerRef$current$ci === void 0 ? void 0 : _playerRef$current$ci.current : undefined;
84
85
  }; // 更新状态
85
86
 
86
87
 
@@ -98,18 +99,22 @@ function LivePlayer(_ref) {
98
99
  } // 修正选中索引
99
100
 
100
101
 
101
- if (newState.screenNum < state.selectIndex) {
102
+ if (newState.screenNum && newState.screenNum < state.selectIndex) {
102
103
  obj.selectIndex = 0;
103
104
  }
104
105
  }
105
106
 
106
107
  if (newState.hasOwnProperty('mode')) {
107
- var item = list[state.selectIndex];
108
+ var item = list === null || list === void 0 ? void 0 : list[state.selectIndex];
108
109
 
109
110
  var newModes = _objectSpread({}, state.modes);
110
111
 
111
- newModes[item.cid] = newState.mode;
112
- obj.modes = newModes;
112
+ var cid = item === null || item === void 0 ? void 0 : item.cid;
113
+
114
+ if (cid) {
115
+ newModes[cid] = newState.mode;
116
+ obj.modes = newModes;
117
+ }
113
118
  }
114
119
 
115
120
  setState(function (old) {
@@ -119,7 +124,7 @@ function LivePlayer(_ref) {
119
124
 
120
125
 
121
126
  var segmentItem = useMemo(function () {
122
- return list[state.selectIndex] || {};
127
+ return (list === null || list === void 0 ? void 0 : list[state.selectIndex]) || {};
123
128
  }, [state.selectIndex, list]);
124
129
  /**
125
130
  * 同步外部的selectIndex变化
@@ -196,13 +201,15 @@ function LivePlayer(_ref) {
196
201
  className: "player-layout",
197
202
  ref: domRef,
198
203
  children: screenList.map(function (item, index) {
199
- var _state$modes$item$cid, _item$url;
204
+ var _item$url;
200
205
 
201
206
  return /*#__PURE__*/_createElement(LivePlayerWithExt, _objectSpread(_objectSpread({}, item), {}, {
202
- mode: (_state$modes$item$cid = state.modes[item.cid]) !== null && _state$modes$item$cid !== void 0 ? _state$modes$item$cid : item.mode,
207
+ mode: item.cid ? state.modes[item.cid] : item.mode,
203
208
  key: (_item$url = item.url) !== null && _item$url !== void 0 ? _item$url : "".concat(index),
204
209
  updatePlayer: function updatePlayer(player) {
205
- return playerRef.current[item.cid] = player;
210
+ if (item.cid) {
211
+ playerRef.current[item.cid] = player;
212
+ }
206
213
  },
207
214
  className: state.selectIndex === index ? 'player-current-index' : '',
208
215
  onClick: index !== state.selectIndex ? function () {
@@ -213,8 +220,8 @@ function LivePlayer(_ref) {
213
220
  });
214
221
  } : undefined,
215
222
  style: {
216
- width: screenType.width,
217
- height: screenType.height
223
+ width: screenType === null || screenType === void 0 ? void 0 : screenType.width,
224
+ height: screenType === null || screenType === void 0 ? void 0 : screenType.height
218
225
  },
219
226
  pluginDownloadUrl: props.pluginDownloadUrl
220
227
  }));
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { ExportPlayerType } from '../Player/player';
3
3
  import { PlayModeType } from '../PlayerExt';
4
4
  interface IToolsProps {
5
- containerRef: React.MutableRefObject<HTMLDivElement>;
5
+ containerRef: React.RefObject<HTMLDivElement>;
6
6
  updateState: (state: {
7
7
  screenNum?: number;
8
8
  mode?: PlayModeType;
@@ -14,7 +14,7 @@ interface IToolsProps {
14
14
  toggleFit?: () => void;
15
15
  onClose?: () => void;
16
16
  onCloseAll?: () => void;
17
- snapshot?: (base64?: string) => void;
17
+ snapshot?: (base64: string) => void;
18
18
  /**
19
19
  * 单窗口拓展工具条,左侧
20
20
  */
@@ -19,10 +19,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
19
19
  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; }
20
20
 
21
21
  import React from 'react';
22
+ import Volume from "../Player/contraller_bar/volume";
22
23
  import IconFont from "../Player/iconfont";
23
- import ScreenSelect from "./ScreenSelect";
24
24
  import useFullscreen from "../useFullscreen";
25
- import Volume from "../Player/contraller_bar/volume";
25
+ import ScreenSelect from "./ScreenSelect";
26
26
  import { jsx as _jsx } from "react/jsx-runtime";
27
27
  import { jsxs as _jsxs } from "react/jsx-runtime";
28
28
 
@@ -59,11 +59,14 @@ function LiveTools(_ref) {
59
59
  };
60
60
 
61
61
  var snapshotaction = function snapshotaction() {
62
- var _props$snapshot;
63
-
64
62
  var player = props.getPlayerItem();
65
63
  var base64 = player === null || player === void 0 ? void 0 : player.api.snapshot();
66
- (_props$snapshot = props.snapshot) === null || _props$snapshot === void 0 ? void 0 : _props$snapshot.call(props, base64);
64
+
65
+ if (base64) {
66
+ var _props$snapshot;
67
+
68
+ (_props$snapshot = props.snapshot) === null || _props$snapshot === void 0 ? void 0 : _props$snapshot.call(props, base64);
69
+ }
67
70
  };
68
71
 
69
72
  var player = props.getPlayerItem();
@@ -110,7 +113,7 @@ function LiveTools(_ref) {
110
113
  className: "icon-chajian",
111
114
  style: mode === 2 ? {
112
115
  color: 'var(--primary)'
113
- } : null,
116
+ } : undefined,
114
117
  title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
115
118
  })
116
119
  }), /*#__PURE__*/_jsx("div", {
@@ -4,7 +4,7 @@ import type { PlayModeType } from '../PlayerExt';
4
4
  interface ILivePlayerWithExtProps extends ISinglePlayerProps {
5
5
  mode?: PlayModeType;
6
6
  style: React.CSSProperties;
7
- onClick: () => void;
7
+ onClick?: () => void;
8
8
  updatePlayer: (obj: React.MutableRefObject<ExportPlayerType>) => void;
9
9
  pluginDownloadUrl?: string;
10
10
  }
@@ -28,7 +28,7 @@ interface IFrontendPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url
28
28
  end: number;
29
29
  screenIndex: number;
30
30
  }) => Promise<string>;
31
- screenIndex?: number;
31
+ screenIndex: number;
32
32
  }
33
33
  export declare function FrontendPlayerWithExt({ mode, style, className, segments, pluginDownloadUrl, screenIndex, httpLoading, ...props }: IFrontendPlayerWithExtProps): JSX.Element;
34
34
  export {};
@@ -27,12 +27,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
27
27
 
28
28
  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; }
29
29
 
30
+ import moment from 'moment';
30
31
  import React, { useEffect, useRef, useState } from 'react';
31
- import LivePlayer from "../Player/single_player";
32
- import SegmentPlayer from "../Player/segment_player";
33
32
  import FrontendPlayer from "../Player/frontend_player";
33
+ import SegmentPlayer from "../Player/segment_player";
34
+ import LivePlayer from "../Player/single_player";
34
35
  import ExtModel from "../PlayerExt";
35
- import moment from 'moment';
36
36
  import useFullscreen from "../useFullscreen";
37
37
  import { jsx as _jsx } from "react/jsx-runtime";
38
38
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -114,7 +114,7 @@ export function SegmentPlayerWithExt(_ref2) {
114
114
  onClick: props.onClick,
115
115
  onDoubleClick: toggleFullscreen,
116
116
  children: /*#__PURE__*/_jsx(ExtModel, {
117
- mode: 1,
117
+ mode: mode,
118
118
  loading: httpLoading,
119
119
  segments: segments,
120
120
  children: /*#__PURE__*/_jsx(SegmentPlayer, _objectSpread(_objectSpread({}, props), {}, {
@@ -155,6 +155,8 @@ export function FrontendPlayerWithExt(_ref3) {
155
155
  var latestUrl = _useLatest(state.url);
156
156
 
157
157
  useEffect(function () {
158
+ var _segments$index$url, _segments$index;
159
+
158
160
  if (!(Array.isArray(segments) && segments.length > 0)) {
159
161
  return undefined;
160
162
  }
@@ -170,7 +172,7 @@ export function FrontendPlayerWithExt(_ref3) {
170
172
  var _ref4 = [segments[0].beginTime, segments[segments.length - 1].endTime],
171
173
  begin = _ref4[0],
172
174
  end = _ref4[1];
173
- var videoUrl = new URL(segments[index].url);
175
+ var videoUrl = new URL((_segments$index$url = (_segments$index = segments[index]) === null || _segments$index === void 0 ? void 0 : _segments$index.url) !== null && _segments$index$url !== void 0 ? _segments$index$url : '');
174
176
  var url;
175
177
 
176
178
  if (props.getLocalRecordUrl) {