@x-edu/live-player 0.0.40 → 0.0.41

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.
@@ -56580,7 +56580,7 @@ var MenuContext_excluded = ["children", "locked"];
56580
56580
  var MenuContext = /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createContext(null);
56581
56581
 
56582
56582
  function mergeProps(origin, target) {
56583
- var clone = _objectSpread2({}, origin);
56583
+ var clone = objectSpread2_objectSpread2({}, origin);
56584
56584
 
56585
56585
  Object.keys(target).forEach(function (key) {
56586
56586
  var value = target[key];
@@ -56595,7 +56595,7 @@ function mergeProps(origin, target) {
56595
56595
  function InheritableContextProvider(_ref) {
56596
56596
  var children = _ref.children,
56597
56597
  locked = _ref.locked,
56598
- restProps = _objectWithoutProperties(_ref, MenuContext_excluded);
56598
+ restProps = esm_objectWithoutProperties_objectWithoutProperties(_ref, MenuContext_excluded);
56599
56599
 
56600
56600
  var context = external_commonjs_react_commonjs2_react_root_React_namespaceObject.useContext(MenuContext);
56601
56601
  var inheritableContext = useMemo(function () {
@@ -56651,7 +56651,7 @@ var warnUtil_excluded = ["item"];
56651
56651
 
56652
56652
  function warnItemProp(_ref) {
56653
56653
  var item = _ref.item,
56654
- restInfo = _objectWithoutProperties(_ref, warnUtil_excluded);
56654
+ restInfo = esm_objectWithoutProperties_objectWithoutProperties(_ref, warnUtil_excluded);
56655
56655
 
56656
56656
  Object.defineProperty(restInfo, 'item', {
56657
56657
  get: function get() {
@@ -56671,7 +56671,7 @@ function es_Icon_Icon(_ref) {
56671
56671
  var iconNode;
56672
56672
 
56673
56673
  if (typeof icon === 'function') {
56674
- iconNode = /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement(icon, _objectSpread2({}, props));
56674
+ iconNode = /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement(icon, objectSpread2_objectSpread2({}, props));
56675
56675
  } else {
56676
56676
  // Compatible for origin definition
56677
56677
  iconNode = icon;
@@ -56712,7 +56712,7 @@ var PathTrackerContext = /*#__PURE__*/external_commonjs_react_commonjs2_react_ro
56712
56712
  function useFullPath(eventKey) {
56713
56713
  var parentKeyPath = external_commonjs_react_commonjs2_react_root_React_namespaceObject.useContext(PathTrackerContext);
56714
56714
  return external_commonjs_react_commonjs2_react_root_React_namespaceObject.useMemo(function () {
56715
- return eventKey !== undefined ? [].concat(_toConsumableArray(parentKeyPath), [eventKey]) : parentKeyPath;
56715
+ return eventKey !== undefined ? [].concat(toConsumableArray_toConsumableArray(parentKeyPath), [eventKey]) : parentKeyPath;
56716
56716
  }, [parentKeyPath, eventKey]);
56717
56717
  }
56718
56718
  var PathUserContext = /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createContext(null);
@@ -56974,7 +56974,7 @@ function parseChildren(children, keyPath) {
56974
56974
  var emptyKey = eventKey === null || eventKey === undefined;
56975
56975
 
56976
56976
  if (emptyKey) {
56977
- eventKey = "tmp_key-".concat([].concat(_toConsumableArray(keyPath), [index]).join('-'));
56977
+ eventKey = "tmp_key-".concat([].concat(toConsumableArray_toConsumableArray(keyPath), [index]).join('-'));
56978
56978
  }
56979
56979
 
56980
56980
  var cloneProps = {
@@ -57676,9 +57676,9 @@ function useAccessibility_getOffset(mode, isRootLevel, isRtl, which) {
57676
57676
  };
57677
57677
  }
57678
57678
 
57679
- var inline = (_inline = {}, _defineProperty(_inline, UP, prev), _defineProperty(_inline, DOWN, next), _inline);
57680
- var horizontal = (_horizontal = {}, _defineProperty(_horizontal, useAccessibility_LEFT, isRtl ? next : prev), _defineProperty(_horizontal, RIGHT, isRtl ? prev : next), _defineProperty(_horizontal, DOWN, children), _defineProperty(_horizontal, ENTER, children), _horizontal);
57681
- var vertical = (_vertical = {}, _defineProperty(_vertical, UP, prev), _defineProperty(_vertical, DOWN, next), _defineProperty(_vertical, ENTER, children), _defineProperty(_vertical, ESC, parent), _defineProperty(_vertical, useAccessibility_LEFT, isRtl ? children : parent), _defineProperty(_vertical, RIGHT, isRtl ? parent : children), _vertical);
57679
+ var inline = (_inline = {}, defineProperty_defineProperty(_inline, UP, prev), defineProperty_defineProperty(_inline, DOWN, next), _inline);
57680
+ var horizontal = (_horizontal = {}, defineProperty_defineProperty(_horizontal, useAccessibility_LEFT, isRtl ? next : prev), defineProperty_defineProperty(_horizontal, RIGHT, isRtl ? prev : next), defineProperty_defineProperty(_horizontal, DOWN, children), defineProperty_defineProperty(_horizontal, ENTER, children), _horizontal);
57681
+ var vertical = (_vertical = {}, defineProperty_defineProperty(_vertical, UP, prev), defineProperty_defineProperty(_vertical, DOWN, next), defineProperty_defineProperty(_vertical, ENTER, children), defineProperty_defineProperty(_vertical, ESC, parent), defineProperty_defineProperty(_vertical, useAccessibility_LEFT, isRtl ? children : parent), defineProperty_defineProperty(_vertical, RIGHT, isRtl ? parent : children), _vertical);
57682
57682
  var offsets = {
57683
57683
  inline: inline,
57684
57684
  horizontal: horizontal,
@@ -57944,7 +57944,7 @@ function useUUID(id) {
57944
57944
  var _useMergedState = useControlledState(id, {
57945
57945
  value: id
57946
57946
  }),
57947
- _useMergedState2 = slicedToArray_slicedToArray(_useMergedState, 2),
57947
+ _useMergedState2 = esm_slicedToArray_slicedToArray(_useMergedState, 2),
57948
57948
  uuid = _useMergedState2[0],
57949
57949
  setUUID = _useMergedState2[1];
57950
57950
 
@@ -57980,14 +57980,14 @@ var getPathKeys = function getPathKeys(keyPathStr) {
57980
57980
  var OVERFLOW_KEY = 'rc-menu-more';
57981
57981
  function useKeyRecords() {
57982
57982
  var _React$useState = external_commonjs_react_commonjs2_react_root_React_namespaceObject.useState({}),
57983
- _React$useState2 = slicedToArray_slicedToArray(_React$useState, 2),
57983
+ _React$useState2 = esm_slicedToArray_slicedToArray(_React$useState, 2),
57984
57984
  internalForceUpdate = _React$useState2[1];
57985
57985
 
57986
57986
  var key2pathRef = (0,external_commonjs_react_commonjs2_react_root_React_namespaceObject.useRef)(new Map());
57987
57987
  var path2keyRef = (0,external_commonjs_react_commonjs2_react_root_React_namespaceObject.useRef)(new Map());
57988
57988
 
57989
57989
  var _React$useState3 = external_commonjs_react_commonjs2_react_root_React_namespaceObject.useState([]),
57990
- _React$useState4 = slicedToArray_slicedToArray(_React$useState3, 2),
57990
+ _React$useState4 = esm_slicedToArray_slicedToArray(_React$useState3, 2),
57991
57991
  overflowKeys = _React$useState4[0],
57992
57992
  setOverflowKeys = _React$useState4[1];
57993
57993
 
@@ -58042,7 +58042,7 @@ function useKeyRecords() {
58042
58042
  }, [getKeyPath]);
58043
58043
 
58044
58044
  var getKeys = function getKeys() {
58045
- var keys = _toConsumableArray(key2pathRef.current.keys());
58045
+ var keys = toConsumableArray_toConsumableArray(key2pathRef.current.keys());
58046
58046
 
58047
58047
  if (overflowKeys.length) {
58048
58048
  keys.push(OVERFLOW_KEY);
@@ -58059,7 +58059,7 @@ function useKeyRecords() {
58059
58059
  var connectedPath = "".concat(key2pathRef.current.get(key)).concat(PATH_SPLIT);
58060
58060
  var pathKeys = new Set();
58061
58061
 
58062
- _toConsumableArray(path2keyRef.current.keys()).forEach(function (pathKey) {
58062
+ toConsumableArray_toConsumableArray(path2keyRef.current.keys()).forEach(function (pathKey) {
58063
58063
  if (pathKey.startsWith(connectedPath)) {
58064
58064
  pathKeys.add(path2keyRef.current.get(pathKey));
58065
58065
  }
@@ -58669,10 +58669,10 @@ function Dropdown(props, ref) {
58669
58669
  visible = props.visible,
58670
58670
  _props$trigger = props.trigger,
58671
58671
  trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
58672
- otherProps = _objectWithoutProperties(props, Dropdown_excluded);
58672
+ otherProps = esm_objectWithoutProperties_objectWithoutProperties(props, Dropdown_excluded);
58673
58673
 
58674
58674
  var _React$useState = external_commonjs_react_commonjs2_react_root_React_namespaceObject.useState(),
58675
- _React$useState2 = slicedToArray_slicedToArray(_React$useState, 2),
58675
+ _React$useState2 = esm_slicedToArray_slicedToArray(_React$useState, 2),
58676
58676
  triggerVisible = _React$useState2[0],
58677
58677
  setTriggerVisible = _React$useState2[1];
58678
58678
 
@@ -58780,12 +58780,12 @@ function Dropdown(props, ref) {
58780
58780
  triggerHideAction = ['click'];
58781
58781
  }
58782
58782
 
58783
- return /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement(rc_trigger_es, _objectSpread2(_objectSpread2({
58783
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_namespaceObject.createElement(rc_trigger_es, objectSpread2_objectSpread2(objectSpread2_objectSpread2({
58784
58784
  builtinPlacements: placements
58785
58785
  }, otherProps), {}, {
58786
58786
  prefixCls: prefixCls,
58787
58787
  ref: triggerRef,
58788
- popupClassName: classnames_default()(overlayClassName, _defineProperty({}, "".concat(prefixCls, "-show-arrow"), arrow)),
58788
+ popupClassName: classnames_default()(overlayClassName, defineProperty_defineProperty({}, "".concat(prefixCls, "-show-arrow"), arrow)),
58789
58789
  popupStyle: overlayStyle,
58790
58790
  action: trigger,
58791
58791
  showAction: showAction,
@@ -62124,21 +62124,37 @@ var TagName = {
62124
62124
  3: '直播中' // 实际是暂停
62125
62125
 
62126
62126
  };
62127
- function ListItem(_ref) {
62128
- var data = _ref.data,
62129
- isMobile = _ref.isMobile,
62130
- themeName = _ref.themeName,
62131
- subscription = _ref.subscription,
62132
- onDetailClick = _ref.onDetailClick,
62133
- handleLogin = _ref.handleLogin,
62134
- isLogin = _ref.isLogin,
62135
- onSubscribe = _ref.onSubscribe;
62127
+ var getLiveStatus = function getLiveStatus(item) {
62128
+ // 直播开始之前:预告;直播开始之后:直播中;直播结束之后:回放
62129
+ var _ref = item || {},
62130
+ startTime = _ref.begin_time,
62131
+ endTime = _ref.end_time;
62132
+
62133
+ if (startTime && dayjs_min_default()().isBefore(startTime)) {
62134
+ return 0; // 预告
62135
+ }
62136
+
62137
+ if (endTime && dayjs_min_default()().isAfter(endTime)) {
62138
+ return 2; // 回放
62139
+ }
62140
+
62141
+ return 1;
62142
+ };
62143
+ function ListItem(_ref2) {
62144
+ var data = _ref2.data,
62145
+ isMobile = _ref2.isMobile,
62146
+ themeName = _ref2.themeName,
62147
+ subscription = _ref2.subscription,
62148
+ onDetailClick = _ref2.onDetailClick,
62149
+ handleLogin = _ref2.handleLogin,
62150
+ isLogin = _ref2.isLogin,
62151
+ onSubscribe = _ref2.onSubscribe;
62136
62152
  var liveId = data.live_id,
62137
62153
  liveName = data.live_name,
62138
62154
  beginTime = data.begin_time,
62139
- coverUrl = data.cover_url,
62140
- status = data.status;
62141
- var timeLabel = status === 2 ? "".concat(dayjs_min_default()(beginTime).format('YYYY/MM/DD HH:mm')) : "".concat(dayjs_min_default()(beginTime).format('YYYY/MM/DD HH:mm'), " \u5F00\u59CB");
62155
+ coverUrl = data.cover_url;
62156
+ var liveStatus = getLiveStatus(data);
62157
+ var timeLabel = liveStatus === 2 ? "".concat(dayjs_min_default()(beginTime).format('YYYY/MM/DD HH:mm')) : "".concat(dayjs_min_default()(beginTime).format('YYYY/MM/DD HH:mm'), " \u5F00\u59CB");
62142
62158
 
62143
62159
  var _useState = (0,external_commonjs_react_commonjs2_react_root_React_namespaceObject.useState)({}),
62144
62160
  _useState2 = ListItem_slicedToArray(_useState, 2),
@@ -62146,7 +62162,7 @@ function ListItem(_ref) {
62146
62162
  setLiveExt = _useState2[1];
62147
62163
 
62148
62164
  var _useState3 = (0,external_commonjs_react_commonjs2_react_root_React_namespaceObject.useState)(function () {
62149
- if (status === 0) {
62165
+ if (liveStatus === 0) {
62150
62166
  // 开播前15分钟之外
62151
62167
  var subscriptionItem = (0,lodash.find)(subscription, {
62152
62168
  live_id: liveId
@@ -62191,7 +62207,7 @@ function ListItem(_ref) {
62191
62207
  }, []);
62192
62208
 
62193
62209
  var handleDetailClick = /*#__PURE__*/function () {
62194
- var _ref3 = ListItem_asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2() {
62210
+ var _ref4 = ListItem_asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2() {
62195
62211
  return regenerator_default().wrap(function _callee2$(_context2) {
62196
62212
  while (1) {
62197
62213
  switch (_context2.prev = _context2.next) {
@@ -62221,7 +62237,7 @@ function ListItem(_ref) {
62221
62237
  }));
62222
62238
 
62223
62239
  return function handleDetailClick() {
62224
- return _ref3.apply(this, arguments);
62240
+ return _ref4.apply(this, arguments);
62225
62241
  };
62226
62242
  }();
62227
62243
 
@@ -62238,11 +62254,11 @@ function ListItem(_ref) {
62238
62254
  errorImg: live,
62239
62255
  className: list_ListItem_index_module.mobileCover
62240
62256
  }), /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("div", {
62241
- className: classnames_default()(list_ListItem_index_module.mobileTag, list_ListItem_index_module["mobileTag".concat(status)])
62242
- }, status === 1 || status === 3 ? /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("img", {
62257
+ className: classnames_default()(list_ListItem_index_module.mobileTag, list_ListItem_index_module["mobileTag".concat(liveStatus)])
62258
+ }, liveStatus === 1 || liveStatus === 3 ? /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("img", {
62243
62259
  src: play,
62244
62260
  alt: ""
62245
- }) : null, TagName[status])), /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("div", {
62261
+ }) : null, TagName[liveStatus])), /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("div", {
62246
62262
  className: list_ListItem_index_module.mobileDescRow
62247
62263
  }, /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("div", {
62248
62264
  className: list_ListItem_index_module.mobileMeta
@@ -62286,7 +62302,7 @@ function ListItem(_ref) {
62286
62302
  }, liveName)), /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("div", {
62287
62303
  className: list_ListItem_index_module["right-bottom"]
62288
62304
  }, /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("div", {
62289
- className: "".concat(list_ListItem_index_module.time, " ").concat(status === 0 ? list_ListItem_index_module["foreshow-time"] : '', " time-box")
62305
+ className: "".concat(list_ListItem_index_module.time, " ").concat(liveStatus === 0 ? list_ListItem_index_module["foreshow-time"] : '', " time-box")
62290
62306
  }, isSubscribe ? /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement(component_Icon_Icon, {
62291
62307
  type: "web_icon_shijian_fill",
62292
62308
  className: "".concat(list_ListItem_index_module["time-icon"], " checked-icon")
@@ -62312,15 +62328,15 @@ function ListItem(_ref) {
62312
62328
  isLogin: isLogin,
62313
62329
  onSubscribe: onSubscribe,
62314
62330
  setIsSubscribe: setIsSubscribe,
62315
- status: status
62331
+ status: liveStatus
62316
62332
  }))), /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("div", {
62317
62333
  className: list_ListItem_index_module.left
62318
62334
  }, /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("div", {
62319
- className: classnames_default()(list_ListItem_index_module.tag, list_ListItem_index_module["tag".concat(status)])
62320
- }, status === 1 || status === 3 ? /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("img", {
62335
+ className: classnames_default()(list_ListItem_index_module.tag, list_ListItem_index_module["tag".concat(liveStatus)])
62336
+ }, liveStatus === 1 || liveStatus === 3 ? /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement("img", {
62321
62337
  src: play,
62322
62338
  alt: ""
62323
- }) : null, TagName[status]), /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement(component_Avatar, {
62339
+ }) : null, TagName[liveStatus]), /*#__PURE__*/external_commonjs_react_commonjs2_react_root_React_default().createElement(component_Avatar, {
62324
62340
  src: coverUrl || live,
62325
62341
  errorImg: live,
62326
62342
  className: list_ListItem_index_module.avatar
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "@x-edu/live-player",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "main": "dist/XEduLivePlayer.common.js",
5
5
  "files": [
6
6
  "dist/*"
7
7
  ],
8
8
  "scripts": {
9
9
  "start": "cross-env SDP_ENV=local gms dev",
10
- "start:test": "cross-env SDP_ENV=test gms dev",
11
- "start:pre": "cross-env SDP_ENV=preproduction gms dev",
12
- "start:ncet": "cross-env SDP_ENV=ncet-xedu gms dev",
13
- "start:ie11-ncet": "cross-env SDP_ENV=ncet-xedu BROWSERSLIST_ENV=production gms dev",
14
- "start:prod": "cross-env SDP_ENV=product gms dev",
15
10
  "build": "gms build --target=lib --excludeReact --formats=commonjs --name XEduLivePlayer",
16
11
  "cache:clean": "rimraf node_modules/.cache",
17
12
  "test": "gms test:unit",