agora-ui-foundation 3.4.2 → 3.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ .frc-notification-toast {
2
+ background: var(--fcr_mobile_ui_scene_color_popup_block3);
3
+ padding: 15px 16px;
4
+ border-radius: 12px;
5
+ display: inline-block;
6
+ font-size: 12px;
7
+ }
8
+ .frc-notification-toast-countdown {
9
+ color: var(--fcr_ui_scene_icontext2);
10
+ padding-left: 10px;
11
+ }
@@ -0,0 +1,7 @@
1
+ import './index.css';
2
+ export type NotificationContent = {
3
+ onClose?: () => void;
4
+ data?: string | JSX.Element;
5
+ };
6
+ declare const NotificationToast: ({ onClose, data }: NotificationContent) => import("react/jsx-runtime").JSX.Element;
7
+ export default NotificationToast;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+ require("core-js/modules/web.timers.js");
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _react = require("react");
12
+ require("./index.css");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ var NotificationToast = function NotificationToast(_ref) {
15
+ var onClose = _ref.onClose,
16
+ data = _ref.data;
17
+ var _useState = (0, _react.useState)(6),
18
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
19
+ time = _useState2[0],
20
+ setTime = _useState2[1];
21
+ var timer = (0, _react.useRef)();
22
+ (0, _react.useEffect)(function () {
23
+ timer.current = setInterval(function () {
24
+ setTime(function (prevState) {
25
+ if (prevState === 1) {
26
+ onClose && onClose();
27
+ clearInterval(timer.current);
28
+ }
29
+ return prevState - 1;
30
+ });
31
+ }, 1000);
32
+ return function () {
33
+ clearInterval(timer.current);
34
+ };
35
+ }, []);
36
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
37
+ className: "frc-notification-toast",
38
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
39
+ children: data
40
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
41
+ className: "frc-notification-toast-countdown",
42
+ children: "(".concat(time, "s)")
43
+ })]
44
+ });
45
+ };
46
+ var _default = exports["default"] = NotificationToast;
@@ -0,0 +1,15 @@
1
+ import './index.css';
2
+ import { ParticipantActionType, User } from './attendee';
3
+ export interface FcrMobileParticipantProps {
4
+ userList: User[];
5
+ header?: React.ReactNode;
6
+ footer?: React.ReactNode;
7
+ userRenderer?: (user: User) => React.ReactNode;
8
+ toggleParticipantAction?: (action: ParticipantActionType, userId: string) => void;
9
+ toggleRoomControlAction?: (action: string, userId?: string) => void;
10
+ onSearch: (value: string) => void;
11
+ searchText?: string;
12
+ onInvite?: () => void;
13
+ hasPinnedStream: boolean;
14
+ }
15
+ export declare const FcrMobileParticipants: (props: FcrMobileParticipantProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.symbol.js");
4
+ require("core-js/modules/es.array.filter.js");
5
+ require("core-js/modules/es.array.for-each.js");
6
+ require("core-js/modules/es.array.push.js");
7
+ require("core-js/modules/es.object.define-properties.js");
8
+ require("core-js/modules/es.object.define-property.js");
9
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
10
+ require("core-js/modules/es.object.get-own-property-descriptors.js");
11
+ require("core-js/modules/es.object.keys.js");
12
+ require("core-js/modules/es.object.to-string.js");
13
+ require("core-js/modules/esnext.async-iterator.filter.js");
14
+ require("core-js/modules/esnext.async-iterator.for-each.js");
15
+ require("core-js/modules/esnext.iterator.constructor.js");
16
+ require("core-js/modules/esnext.iterator.filter.js");
17
+ require("core-js/modules/esnext.iterator.for-each.js");
18
+ require("core-js/modules/web.dom-collections.for-each.js");
19
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
20
+ Object.defineProperty(exports, "__esModule", {
21
+ value: true
22
+ });
23
+ exports.FcrMobileParticipants = void 0;
24
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
25
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
26
+ var _reactVirtualized = require("react-virtualized");
27
+ var _input = require("../input");
28
+ require("./index.css");
29
+ var _attendee = require("./attendee");
30
+ var _type = require("../icon/type");
31
+ var _react = require("react");
32
+ var _i18n = require("../../i18n");
33
+ var _jsxRuntime = require("react/jsx-runtime");
34
+ 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; }
35
+ 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) { (0, _defineProperty2["default"])(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; }
36
+ var cache = new _reactVirtualized.CellMeasurerCache({
37
+ fixedWidth: true,
38
+ defaultHeight: 52
39
+ });
40
+ var userRowRenderer = function userRowRenderer(userList, userRenderer, hasPinnedStream, toggleParticipantAction) {
41
+ return function (renderProps) {
42
+ var key = renderProps.key,
43
+ parent = renderProps.parent,
44
+ index = renderProps.index,
45
+ style = renderProps.style;
46
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactVirtualized.CellMeasurer, {
47
+ cache: cache,
48
+ parent: parent,
49
+ columnIndex: 0,
50
+ rowIndex: index,
51
+ children: function children(_ref) {
52
+ var measure = _ref.measure;
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
54
+ style: _objectSpread(_objectSpread({}, style), {}, {
55
+ pointerEvents: 'all'
56
+ }),
57
+ onLoad: measure,
58
+ children: userRenderer ? userRenderer(userList[index]) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_attendee.FcrParticipant, {
59
+ hasPinnedStream: hasPinnedStream,
60
+ user: userList[index],
61
+ onParticipantsButtonClick: toggleParticipantAction
62
+ })
63
+ });
64
+ }
65
+ }, key);
66
+ };
67
+ };
68
+ var FcrMobileParticipants = exports.FcrMobileParticipants = function FcrMobileParticipants(props) {
69
+ var _props = _objectSpread({}, props),
70
+ searchText = _props.searchText,
71
+ onSearch = _props.onSearch,
72
+ userList = _props.userList,
73
+ userRenderer = _props.userRenderer,
74
+ onInvite = _props.onInvite,
75
+ hasPinnedStream = _props.hasPinnedStream,
76
+ toggleParticipantAction = _props.toggleParticipantAction,
77
+ toggleRoomControlAction = _props.toggleRoomControlAction,
78
+ footer = _props.footer,
79
+ header = _props.header;
80
+
81
+ // 使用 useMemo 初始化 value 状态
82
+ var _useState = (0, _react.useState)((0, _react.useMemo)(function () {
83
+ return searchText || '';
84
+ }, [searchText])),
85
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
86
+ value = _useState2[0],
87
+ setValue = _useState2[1];
88
+ var t = (0, _i18n.useI18n)();
89
+ var handleChange = function handleChange(val) {
90
+ setValue(val);
91
+ onSearch(val);
92
+ };
93
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
94
+ className: "fcr-participant",
95
+ children: [header, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
96
+ className: "fcr-participant__search-and-invite",
97
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_input.FcrInput, {
98
+ size: "small",
99
+ placeholder: t('fmt_attendies_button_serach'),
100
+ value: value,
101
+ shape: "rounded",
102
+ onChange: handleChange,
103
+ maxLength: 21,
104
+ style: {
105
+ background: 'var(--fcr_ui_scene_input2)'
106
+ }
107
+ // autoFocus
108
+ ,
109
+ iconPrefix: {
110
+ type: _type.FcrIconType.FCR_V2_SEARCH,
111
+ colors: {
112
+ iconPrimary: 'var(--fcr_ui_scene_icontext1)'
113
+ }
114
+ }
115
+ })
116
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
117
+ className: "fcr-participant__list",
118
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactVirtualized.AutoSizer, {
119
+ children: function children(_ref2) {
120
+ var height = _ref2.height,
121
+ width = _ref2.width;
122
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactVirtualized.List, {
123
+ width: width,
124
+ height: height,
125
+ rowCount: userList.length,
126
+ rowHeight: cache.rowHeight,
127
+ rowRenderer: userRowRenderer(userList, userRenderer, hasPinnedStream, toggleParticipantAction)
128
+ });
129
+ }
130
+ })
131
+ }), footer ? footer : null]
132
+ });
133
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-ui-foundation",
3
- "version": "3.4.2",
3
+ "version": "3.4.4",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "lib",
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@react-spring/web": "^9.7.3",
14
14
  "@use-gesture/react": "^10.3.1",
15
- "agora-foundation": "^3.4.2",
15
+ "agora-foundation": "^3.4.4",
16
16
  "classnames": "^2.5.1",
17
17
  "i18next": "^23.10.1",
18
18
  "normalize.css": "^8.0.1",
@@ -51,7 +51,7 @@
51
51
  "@types/react-virtualized": "^9.21.30",
52
52
  "@types/tinycolor2": "^1.4.6",
53
53
  "@types/webpack-env": "^1.18.4",
54
- "agora-toolchain": "^3.4.2",
54
+ "agora-toolchain": "^3.4.4",
55
55
  "core-js": "^3.33.3",
56
56
  "eslint": "^9.0.0",
57
57
  "node-html-parser": "^6.1.13",