yootd 0.0.90 → 0.0.92

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.
@@ -1,11 +1,10 @@
1
- import { BadgeProps } from 'antd';
1
+ import { Badge as AntBadge, BadgeProps } from 'antd';
2
2
  import React from 'react';
3
- import Ribbon from 'antd/es/badge/Ribbon';
4
3
  import './index.scss';
5
4
  export type { ScrollNumberProps } from 'antd/es/badge';
6
5
  export type { BadgeProps };
7
6
  type BadgeType = typeof BadgeComponent & {
8
- Ribbon: typeof Ribbon;
7
+ Ribbon: typeof AntBadge.Ribbon;
9
8
  };
10
9
  export declare const BadgeComponent: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
11
10
  export declare const Badge: BadgeType;
@@ -4,7 +4,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
4
4
  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; }
5
5
  import { Badge as AntBadge } from 'antd';
6
6
  import React, { forwardRef } from 'react';
7
- import Ribbon from 'antd/es/badge/Ribbon';
8
7
  import { useBem } from "../hooks/useBem";
9
8
  import "./index.scss";
10
9
  export var BadgeComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -18,4 +17,4 @@ export var BadgeComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
18
17
  });
19
18
  export var Badge = BadgeComponent;
20
19
  Badge.displayName = 'Badge';
21
- Badge.Ribbon = Ribbon;
20
+ Badge.Ribbon = AntBadge.Ribbon;
@@ -1,6 +1,6 @@
1
1
  import type { CascaderProps as AntCascaderProps } from 'antd';
2
2
  import { Cascader as AntCascader } from 'antd';
3
- import { CascaderRef, DefaultOptionType } from 'antd/es/cascader';
3
+ import type { CascaderRef, DefaultOptionType } from 'antd/es/cascader';
4
4
  import React from 'react';
5
5
  import './index.scss';
6
6
  export type CascaderProps<OptionType extends DefaultOptionType = DefaultOptionType, ValueField extends keyof OptionType = keyof OptionType, Multiple extends boolean = boolean> = AntCascaderProps<OptionType, ValueField, Multiple>;
@@ -1,6 +1,6 @@
1
1
  import type { CheckboxProps as AntCheckboxProps } from 'antd';
2
2
  import { Checkbox as AntCheckBox } from 'antd';
3
- import { CheckboxRef } from 'antd/es/checkbox';
3
+ import type { CheckboxRef } from 'antd/es/checkbox';
4
4
  import React from 'react';
5
5
  export type CheckboxProps = AntCheckboxProps;
6
6
  type AntCheckBoxType = typeof AntCheckBox;
@@ -1,4 +1,4 @@
1
- import { DatePickerProps as AntdDatePickerProps } from 'antd/es/date-picker';
1
+ import type { DatePickerProps as AntdDatePickerProps } from 'antd/es/date-picker';
2
2
  import dayjs from 'dayjs';
3
3
  import { FC } from 'react';
4
4
  type PickerType = 'time' | 'date' | 'week' | 'month' | 'quarter' | 'year';
@@ -1,4 +1,4 @@
1
- import { RangePickerProps } from 'antd/es/date-picker';
1
+ import type { RangePickerProps } from 'antd/es/date-picker';
2
2
  import dayjs from 'dayjs';
3
3
  import { FC } from 'react';
4
4
  type PickerType = 'time' | 'date' | 'week' | 'month' | 'quarter' | 'year';
package/dist/index.d.ts CHANGED
@@ -171,7 +171,6 @@ export { UserDropdown } from './user-dropdown';
171
171
  export type { UserDropdownProps } from './user-dropdown/types/types';
172
172
  export { ConfigProvider } from './config-provider';
173
173
  export type { ConfigProviderProps } from './config-provider';
174
- export { Zone } from './zones';
175
174
  export { GoBack } from './go-back';
176
175
  export type { GoBackProps } from './go-back';
177
176
  export { VideoPlayer } from './video-player';
package/dist/index.js CHANGED
@@ -92,6 +92,7 @@ export { DatePicker } from "./date-picker";
92
92
  export { Teacher } from "./teacher";
93
93
  export { UserDropdown } from "./user-dropdown";
94
94
  export { ConfigProvider } from "./config-provider";
95
- export { Zone } from "./zones";
95
+ // export { Zone } from './zones';
96
+
96
97
  export { GoBack } from "./go-back";
97
98
  export { VideoPlayer } from "./video-player";
@@ -1,5 +1,5 @@
1
1
  import { Modal as AntModal, ModalProps } from 'antd';
2
- import { ModalStaticFunctions } from 'antd/es/modal/confirm';
2
+ import type { ModalStaticFunctions } from 'antd/es/modal/confirm';
3
3
  import React from 'react';
4
4
  import './index.scss';
5
5
  export type { ModalFuncProps, ModalLocale } from 'antd/es/modal';
@@ -54,7 +54,7 @@ var ModalComponent = function ModalComponent(_ref) {
54
54
  var tcb = mb.b('title').b('content');
55
55
  useEffect(function () {
56
56
  var svg = createColorDefs(mb);
57
- console.log("create color defs");
57
+ console.log('create color defs');
58
58
  if (svg) {
59
59
  document.body.appendChild(svg);
60
60
  }
@@ -1,4 +1,3 @@
1
1
  import { Radio as AntRadio } from 'antd';
2
2
  export type { RadioChangeEvent, RadioChangeEventTarget, RadioGroupButtonStyle, RadioGroupContextProps, RadioGroupOptionType, RadioGroupProps, RadioProps, RadioRef, } from 'antd/es/radio';
3
- export { Button, Group } from 'antd/es/radio';
4
3
  export declare const Radio: typeof AntRadio;
@@ -1,3 +1,2 @@
1
1
  import { Radio as AntRadio } from 'antd';
2
- export { Button, Group } from 'antd/es/radio';
3
2
  export var Radio = AntRadio;
@@ -1,7 +1,7 @@
1
1
  import type { TableProps as AntTableProps } from 'antd';
2
2
  import { Table as AntTable } from 'antd';
3
- import { AnyObject } from 'antd/es/_util/type';
4
- import { ColumnType as AntColumnType } from 'antd/es/table';
3
+ import type { AnyObject } from 'antd/es/_util/type';
4
+ import type { ColumnType as AntColumnType } from 'antd/es/table';
5
5
  import React from 'react';
6
6
  import './index.scss';
7
7
  type AntTableType = typeof AntTable;
@@ -19,9 +19,6 @@ import React, { forwardRef, useEffect, useMemo, useState } from 'react';
19
19
  import { PrimaryHeaderRow } from "./components/primary-header-row";
20
20
  import { arrayMove } from "../utils/utils";
21
21
  import { PrimaryTBodyRow } from "./components/primary-tbody-row";
22
-
23
- // import { RefTable } from 'antd/es/table/interface';
24
-
25
22
  import "./index.scss";
26
23
  export var TableRowContext = /*#__PURE__*/React.createContext({});
27
24
  var InternalTable = function InternalTable(_ref, ref) {
@@ -1,7 +1,7 @@
1
1
  import type { UploadFile } from 'antd';
2
2
  import React from 'react';
3
3
  import '../index.scss';
4
- import { UploadRef } from 'antd/es/upload/Upload';
4
+ import type { UploadRef } from 'antd/es/upload/Upload';
5
5
  declare const FileUpload: React.ForwardRefExoticComponent<import("antd").UploadProps<any> & {
6
6
  maxCount?: number | undefined;
7
7
  accept?: string | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { UploadFile } from 'antd';
2
2
  import React from 'react';
3
3
  import '../index.scss';
4
- import { UploadRef } from 'antd/es/upload/Upload';
4
+ import type { UploadRef } from 'antd/es/upload/Upload';
5
5
  declare const ImageUpload: React.ForwardRefExoticComponent<import("antd").UploadProps<any> & {
6
6
  maxCount?: number | undefined;
7
7
  accept?: string | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { UploadProps as AntUploadProps, UploadFile } from 'antd';
2
2
  import React from 'react';
3
3
  import { Upload as AntUpload } from 'antd';
4
- import { UploadRef } from 'antd/es/upload/Upload';
4
+ import type { UploadRef } from 'antd/es/upload/Upload';
5
5
  export type { DraggerProps, RcFile, UploadChangeParam, UploadFile, UploadListProps, } from 'antd/es/upload';
6
6
  export type UploadProps = AntUploadProps & {
7
7
  maxCount?: number;
@@ -146,8 +146,8 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
146
146
  setOptions = _useState34[1];
147
147
  var _useState35 = useState(false),
148
148
  _useState36 = _slicedToArray(_useState35, 2),
149
- faceApiInited = _useState36[0],
150
- setFaceApiInited = _useState36[1];
149
+ faceApiInitialized = _useState36[0],
150
+ setFaceApiInitialized = _useState36[1];
151
151
  var _useState37 = useState({
152
152
  width: 0,
153
153
  height: 0
@@ -168,7 +168,6 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
168
168
  setIsSeeking = _useState42[1];
169
169
  var _useState43 = useState(false),
170
170
  _useState44 = _slicedToArray(_useState43, 2),
171
- isError = _useState44[0],
172
171
  setIsError = _useState44[1];
173
172
  var _useState45 = useState(),
174
173
  _useState46 = _slicedToArray(_useState45, 2),
@@ -449,9 +448,9 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
449
448
  }
450
449
  if (faceFeature.emotion) {
451
450
  var _emotionMap;
452
- ctx.fillText("\u8868\u60C5: ".concat(Math.round(100 * expression[0][1]), "% ").concat( // eslint-disable-next-line @typescript-eslint/ban-ts-comment
451
+ ctx.fillText("".concat( // eslint-disable-next-line @typescript-eslint/ban-ts-comment
453
452
  // @ts-expect-error
454
- (_emotionMap = emotionMap[expression[0][0]]) !== null && _emotionMap !== void 0 ? _emotionMap : ''), person.detection.box.x, person.detection.box.y - 20
453
+ (_emotionMap = emotionMap[expression[0][0]]) !== null && _emotionMap !== void 0 ? _emotionMap : '', " ").concat(Math.round(100 * expression[0][1]), "% "), person.detection.box.x, person.detection.box.y - 20
455
454
  // person.detection.box.y - 42
456
455
  );
457
456
  }
@@ -480,7 +479,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
480
479
  }, []);
481
480
  var detectFaces = useCallback(function () {
482
481
  return new Promise(function (resolve, reject) {
483
- if (videoRef.current != null && detectAllFacesRef.current != null && options != null && faceApiInited) {
482
+ if (videoRef.current != null && detectAllFacesRef.current != null && options != null && faceApiInitialized) {
484
483
  var t0 = performance.now();
485
484
  detectAllFacesRef.current(videoRef.current, options).withFaceLandmarks().withFaceExpressions().withAgeAndGender()
486
485
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -500,7 +499,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
500
499
  });
501
500
 
502
501
  // 肢体检测
503
- }, [drawFaces, faceApiInited, aiFeature, options]);
502
+ }, [drawFaces, faceApiInitialized, aiFeature, options]);
504
503
  var drawKeyPoints = function drawKeyPoints(keypoints, ctx) {
505
504
  keypoints.forEach(function (keypoint) {
506
505
  if (keypoint.score && keypoint.score > 0.3) {
@@ -619,6 +618,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
619
618
 
620
619
  // 获取具体的错误代码
621
620
  var error = video.error;
621
+ console.log('发生错误', error);
622
622
  setIsError(true);
623
623
  if (error) {
624
624
  switch (error.code) {
@@ -677,7 +677,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
677
677
  console.error('tensorflow 加载失败: ', _context2.t0);
678
678
  case 17:
679
679
  _context2.prev = 17;
680
- if (!((aiFeature.anchor || aiFeature.emotion || aiFeature.character) && !faceApiInited)) {
680
+ if (!((aiFeature.anchor || aiFeature.emotion || aiFeature.character) && !faceApiInitialized)) {
681
681
  _context2.next = 35;
682
682
  break;
683
683
  }
@@ -705,7 +705,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
705
705
  maxResults: MAX_RESULTS
706
706
  }));
707
707
  detectAllFacesRef.current = faceapi.detectAllFaces;
708
- setFaceApiInited(true);
708
+ setFaceApiInitialized(true);
709
709
  case 35:
710
710
  _context2.next = 40;
711
711
  break;
@@ -752,7 +752,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
752
752
  return function () {
753
753
  loaded = false;
754
754
  };
755
- }, [aiFeature, faceApiInited, poseDetector, tfInitialized]);
755
+ }, [aiFeature, faceApiInitialized, poseDetector, tfInitialized]);
756
756
  useEffect(function () {
757
757
  var player = null;
758
758
  if (isLive && videoRef.current != null) {
@@ -908,7 +908,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
908
908
  ,
909
909
  onSeeked: handleSeeked,
910
910
  onError: handleVideoError
911
- })), controls === true && show && !isError && /*#__PURE__*/React.createElement("div", {
911
+ })), controls === true && show && /*#__PURE__*/React.createElement("div", {
912
912
  className: "".concat(bem.b('container').e('controls'))
913
913
  }, /*#__PURE__*/React.createElement("div", {
914
914
  className: "".concat(bem.b('container').e('mask')),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yootd",
3
- "version": "0.0.90",
3
+ "version": "0.0.92",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",