yootd 0.2.29 → 0.2.31

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.
@@ -152,7 +152,7 @@
152
152
  right: 16px;
153
153
  height: 1px;
154
154
  background-color: #e5e5e5;
155
- z-index: 100;
155
+ z-index: 9;
156
156
  }
157
157
  &-content-no-bg::before {
158
158
  content: '';
@@ -162,7 +162,7 @@
162
162
  right: 16px;
163
163
  height: 1px;
164
164
  background-color: #e5e5e5;
165
- z-index: 100;
165
+ z-index: 9;
166
166
  }
167
167
  &__content-active {
168
168
  background-color: var(--ant-color-primary-border);
@@ -188,12 +188,12 @@ export var Aside = function Aside(_ref) {
188
188
  overflowY: overflow ? 'auto' : 'visible'
189
189
  })
190
190
  }, titleShow && /*#__PURE__*/React.createElement("div", {
191
- className: "".concat(mb.b('title'))
192
- }, /*#__PURE__*/React.createElement("span", {
193
- className: "".concat(mb.b('title').e('title-text')),
191
+ className: "".concat(mb.b('title')),
194
192
  style: {
195
193
  position: overflow ? 'sticky' : 'static'
196
194
  }
195
+ }, /*#__PURE__*/React.createElement("span", {
196
+ className: "".concat(mb.b('title').e('title-text'))
197
197
  }, title), customBtn != null ? customBtn : /*#__PURE__*/React.createElement("div", {
198
198
  className: "".concat(mb.b('title').e('add-btn-icon')),
199
199
  style: {
@@ -11,7 +11,7 @@
11
11
  justify-content: space-between;
12
12
  background-color: #fff;
13
13
  top: 0;
14
- z-index: 999;
14
+ z-index: 10;
15
15
  &__title-text {
16
16
  font-size: 18px;
17
17
  font-weight: bold;
@@ -4,6 +4,8 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
4
  import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
5
5
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
6
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
7
+ console.log('process.env', process.env.NODE_ENV);
8
+ var isDev = process.env.NODE_ENV === 'development';
7
9
  // import * as faceapi from '@vladmandic/face-api';
8
10
  //
9
11
  // import * as posedetection from '@tensorflow-models/pose-detection';
@@ -457,13 +459,13 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
457
459
  male: '男',
458
460
  female: '女'
459
461
  };
460
- /* neutral: 'calm',
461
- happy: 'happy',
462
- sad: 'depressed',
463
- angry: 'angry',
464
- fearful: 'dread',
465
- disgusted: 'detest',
466
- surprised: 'surprised',
462
+ /* neutral: 'calm',
463
+ happy: 'happy',
464
+ sad: 'depressed',
465
+ angry: 'angry',
466
+ fearful: 'dread',
467
+ disgusted: 'detest',
468
+ surprised: 'surprised',
467
469
  */
468
470
 
469
471
  var emotionMap = {
@@ -810,7 +812,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
810
812
  useEffect(function () {
811
813
  var loaded = true;
812
814
  _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
813
- var tf, faceapi, posedetection, detectorConfig, _poseDetector;
815
+ var tf, faceapi, poseDetection, detectorConfig, _poseDetector;
814
816
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
815
817
  while (1) switch (_context3.prev = _context3.next) {
816
818
  case 0:
@@ -822,100 +824,130 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
822
824
  case 2:
823
825
  _context3.prev = 2;
824
826
  if (!((aiFeature.anchor || aiFeature.emotion || aiFeature.character || aiFeature.pose) && !tfInitialized)) {
825
- _context3.next = 12;
827
+ _context3.next = 17;
826
828
  break;
827
829
  }
828
- _context3.next = 6;
830
+ if (!isDev) {
831
+ _context3.next = 10;
832
+ break;
833
+ }
834
+ _context3.next = 7;
829
835
  return import('@tensorflow/tfjs');
830
- case 6:
831
- tf = _context3.sent;
832
- _context3.next = 9;
833
- return tf.ready();
834
- case 9:
836
+ case 7:
837
+ _context3.t0 = _context3.sent;
835
838
  _context3.next = 11;
836
- return tf.setBackend('webgl');
837
- case 11:
838
- setTfInitialized(true);
839
- case 12:
840
- _context3.next = 17;
841
839
  break;
840
+ case 10:
841
+ _context3.t0 = window.tf;
842
+ case 11:
843
+ tf = _context3.t0;
844
+ _context3.next = 14;
845
+ return tf.setBackend('webgl');
842
846
  case 14:
843
- _context3.prev = 14;
844
- _context3.t0 = _context3["catch"](2);
845
- console.error('tensorflow 加载失败: ', _context3.t0);
847
+ _context3.next = 16;
848
+ return tf.ready();
849
+ case 16:
850
+ setTfInitialized(true);
846
851
  case 17:
847
- _context3.prev = 17;
852
+ _context3.next = 22;
853
+ break;
854
+ case 19:
855
+ _context3.prev = 19;
856
+ _context3.t1 = _context3["catch"](2);
857
+ console.error('tensorflow 加载失败: ', _context3.t1);
858
+ case 22:
859
+ _context3.prev = 22;
848
860
  if (!((aiFeature.anchor || aiFeature.emotion || aiFeature.character) && !faceApiInitialized)) {
849
- _context3.next = 35;
861
+ _context3.next = 45;
862
+ break;
863
+ }
864
+ if (!isDev) {
865
+ _context3.next = 30;
850
866
  break;
851
867
  }
852
- _context3.next = 21;
868
+ _context3.next = 27;
853
869
  return import('@vladmandic/face-api');
854
- case 21:
855
- faceapi = _context3.sent;
856
- _context3.next = 24;
870
+ case 27:
871
+ _context3.t2 = _context3.sent;
872
+ _context3.next = 31;
873
+ break;
874
+ case 30:
875
+ _context3.t2 = window.faceapi;
876
+ case 31:
877
+ faceapi = _context3.t2;
878
+ _context3.next = 34;
857
879
  return faceapi.nets.ssdMobilenetv1.load("".concat(OSS, "/model-zoo/face-api-models/model"));
858
- case 24:
859
- _context3.next = 26;
880
+ case 34:
881
+ _context3.next = 36;
860
882
  return faceapi.nets.ageGenderNet.load("".concat(OSS, "/face-api-models/model"));
861
- case 26:
862
- _context3.next = 28;
883
+ case 36:
884
+ _context3.next = 38;
863
885
  return faceapi.nets.faceLandmark68Net.load("".concat(OSS, "/model-zoo/face-api-models/model"));
864
- case 28:
865
- _context3.next = 30;
886
+ case 38:
887
+ _context3.next = 40;
866
888
  return faceapi.nets.faceRecognitionNet.load("".concat(OSS, "/model-zoo/face-api-models/model"));
867
- case 30:
868
- _context3.next = 32;
889
+ case 40:
890
+ _context3.next = 42;
869
891
  return faceapi.nets.faceExpressionNet.load("".concat(OSS, "/model-zoo/face-api-models/model"));
870
- case 32:
892
+ case 42:
871
893
  setOptions(new faceapi.SsdMobilenetv1Options({
872
894
  minConfidence: MIN_SCORE,
873
895
  maxResults: MAX_RESULTS
874
896
  }));
875
897
  detectAllFacesRef.current = faceapi.detectAllFaces;
876
898
  setFaceApiInitialized(true);
877
- case 35:
878
- _context3.next = 40;
899
+ case 45:
900
+ _context3.next = 50;
879
901
  break;
880
- case 37:
881
- _context3.prev = 37;
882
- _context3.t1 = _context3["catch"](17);
883
- console.error('faceapi 加载失败: ', _context3.t1);
884
- case 40:
885
- _context3.prev = 40;
902
+ case 47:
903
+ _context3.prev = 47;
904
+ _context3.t3 = _context3["catch"](22);
905
+ console.error('faceapi 加载失败: ', _context3.t3);
906
+ case 50:
907
+ _context3.prev = 50;
886
908
  if (!(aiFeature.pose && poseDetector == null)) {
887
- _context3.next = 51;
909
+ _context3.next = 66;
910
+ break;
911
+ }
912
+ if (!isDev) {
913
+ _context3.next = 58;
888
914
  break;
889
915
  }
890
- _context3.next = 44;
916
+ _context3.next = 55;
891
917
  return import('@tensorflow-models/pose-detection');
892
- case 44:
893
- posedetection = _context3.sent;
918
+ case 55:
919
+ _context3.t4 = _context3.sent;
920
+ _context3.next = 59;
921
+ break;
922
+ case 58:
923
+ _context3.t4 = window.poseDetection;
924
+ case 59:
925
+ poseDetection = _context3.t4;
894
926
  detectorConfig = {
895
- modelType: posedetection.movenet.modelType.MULTIPOSE_LIGHTNING,
927
+ modelType: poseDetection.movenet.modelType.MULTIPOSE_LIGHTNING,
896
928
  enableTracking: true,
897
- trackerType: posedetection.TrackerType.BoundingBox,
929
+ trackerType: poseDetection.TrackerType.BoundingBox,
898
930
  scoreThreshold: 0.3,
899
931
  modelUrl: "".concat(OSS, "/model-zoo/pose-detection-models/model.json")
900
932
  };
901
- _context3.next = 48;
902
- return posedetection.createDetector(posedetection.SupportedModels.MoveNet, detectorConfig);
903
- case 48:
933
+ _context3.next = 63;
934
+ return poseDetection.createDetector(window.poseDetection.SupportedModels.MoveNet, detectorConfig);
935
+ case 63:
904
936
  _poseDetector = _context3.sent;
905
- getAdjacentPairsRef.current = posedetection.util.getAdjacentPairs;
937
+ getAdjacentPairsRef.current = poseDetection.util.getAdjacentPairs;
906
938
  setPoseDetector(_poseDetector);
907
- case 51:
908
- _context3.next = 56;
939
+ case 66:
940
+ _context3.next = 71;
909
941
  break;
910
- case 53:
911
- _context3.prev = 53;
912
- _context3.t2 = _context3["catch"](40);
913
- console.error('pose detection 加载失败: ', _context3.t2);
914
- case 56:
942
+ case 68:
943
+ _context3.prev = 68;
944
+ _context3.t5 = _context3["catch"](50);
945
+ console.error('pose detection 加载失败: ', _context3.t5);
946
+ case 71:
915
947
  case "end":
916
948
  return _context3.stop();
917
949
  }
918
- }, _callee3, null, [[2, 14], [17, 37], [40, 53]]);
950
+ }, _callee3, null, [[2, 19], [22, 47], [50, 68]]);
919
951
  }))();
920
952
  return function () {
921
953
  loaded = false;
package/package.json CHANGED
@@ -1,91 +1,92 @@
1
- {
2
- "name": "yootd",
3
- "version": "0.2.29",
4
- "description": "基于 Antd 二次开发的组件库",
5
- "license": "MIT",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "scripts": {
12
- "build": "father build",
13
- "build:watch": "father dev",
14
- "dev": "dumi dev",
15
- "docs:build": "dumi build",
16
- "docs:preview": "dumi preview",
17
- "doctor": "father doctor",
18
- "lint": "npm run lint:es && npm run lint:css",
19
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
- "prepare": "husky install && dumi setup",
22
- "prepublishOnly": "father doctor && npm run build",
23
- "start": "npm run dev"
24
- },
25
- "commitlint": {
26
- "extends": [
27
- "@commitlint/config-conventional"
28
- ]
29
- },
30
- "lint-staged": {
31
- "*.{md,json}": [
32
- "prettier --write --no-error-on-unmatched-pattern"
33
- ],
34
- "*.{css,less}": [
35
- "stylelint --fix",
36
- "prettier --write"
37
- ],
38
- "*.{js,jsx}": [
39
- "eslint --fix",
40
- "prettier --write"
41
- ],
42
- "*.{ts,tsx}": [
43
- "eslint --fix",
44
- "prettier --parser=typescript --write"
45
- ]
46
- },
47
- "dependencies": {
48
- "@ant-design/icons": "^6.0.0",
49
- "@babel/runtime": "^7.26.9"
50
- },
51
- "devDependencies": {
52
- "@commitlint/cli": "^17.1.2",
53
- "@commitlint/config-conventional": "^17.1.0",
54
- "@types/lodash": "^4.17.12",
55
- "@types/react": "^18.0.0",
56
- "@types/react-dom": "^18.0.0",
57
- "@umijs/lint": "^4.0.0",
58
- "dumi": "^2.3.0",
59
- "dumi-theme-antd": "^0.4.2",
60
- "eslint": "^8.23.0",
61
- "father": "^4.1.0",
62
- "husky": "^8.0.1",
63
- "lint-staged": "^13.0.3",
64
- "prettier": "^2.7.1",
65
- "prettier-plugin-organize-imports": "^3.0.0",
66
- "prettier-plugin-packagejson": "^2.2.18",
67
- "sass": "^1.80.0",
68
- "stylelint": "^14.9.1"
69
- },
70
- "peerDependencies": {
71
- "@dnd-kit/core": ">=6.1.0",
72
- "@dnd-kit/modifiers": ">=7.0.0",
73
- "@dnd-kit/sortable": ">=8.0.0",
74
- "@dnd-kit/utilities": ">=3.2.2",
75
- "@tanstack/react-query": ">=5.59.15",
76
- "@tensorflow-models/pose-detection": ">=2.1.3",
77
- "@tensorflow/tfjs": ">=4.22.0",
78
- "@vladmandic/face-api": ">=1.7.14",
79
- "@xyflow/react": ">=12.3.3",
80
- "antd": ">=5.21.4",
81
- "axios": ">=1.7.7",
82
- "dayjs": ">=1.11.13",
83
- "lodash": ">=4.17.21",
84
- "react": ">=18.0.0",
85
- "react-dom": ">=18.0.0"
86
- },
87
- "publishConfig": {
88
- "access": "public"
89
- },
90
- "authors": []
91
- }
1
+ {
2
+ "name": "yootd",
3
+ "version": "0.2.31",
4
+ "description": "基于 Antd 二次开发的组件库",
5
+ "license": "MIT",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "father build",
13
+ "build:watch": "father dev",
14
+ "dev": "dumi dev",
15
+ "docs:build": "dumi build",
16
+ "docs:preview": "dumi preview",
17
+ "doctor": "father doctor",
18
+ "lint": "npm run lint:es && npm run lint:css",
19
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
+ "prepare": "husky install && dumi setup",
22
+ "prepublishOnly": "father doctor && npm run build",
23
+ "start": "npm run dev"
24
+ },
25
+ "commitlint": {
26
+ "extends": [
27
+ "@commitlint/config-conventional"
28
+ ]
29
+ },
30
+ "lint-staged": {
31
+ "*.{md,json}": [
32
+ "prettier --write --no-error-on-unmatched-pattern"
33
+ ],
34
+ "*.{css,less}": [
35
+ "stylelint --fix",
36
+ "prettier --write"
37
+ ],
38
+ "*.{js,jsx}": [
39
+ "eslint --fix",
40
+ "prettier --write"
41
+ ],
42
+ "*.{ts,tsx}": [
43
+ "eslint --fix",
44
+ "prettier --parser=typescript --write"
45
+ ]
46
+ },
47
+ "dependencies": {
48
+ "@ant-design/icons": "^6.0.0",
49
+ "@babel/runtime": "^7.26.9"
50
+ },
51
+ "devDependencies": {
52
+ "@commitlint/cli": "^17.1.2",
53
+ "@commitlint/config-conventional": "^17.1.0",
54
+ "@types/lodash": "^4.17.12",
55
+ "@types/react": "^18.0.0",
56
+ "@types/react-dom": "^18.0.0",
57
+ "@umijs/lint": "^4.0.0",
58
+ "cross-env": "^10.0.0",
59
+ "dumi": "^2.3.0",
60
+ "dumi-theme-antd": "^0.4.2",
61
+ "eslint": "^8.23.0",
62
+ "father": "^4.1.0",
63
+ "husky": "^8.0.1",
64
+ "lint-staged": "^13.0.3",
65
+ "prettier": "^2.7.1",
66
+ "prettier-plugin-organize-imports": "^3.0.0",
67
+ "prettier-plugin-packagejson": "^2.2.18",
68
+ "sass": "^1.80.0",
69
+ "stylelint": "^14.9.1"
70
+ },
71
+ "peerDependencies": {
72
+ "@dnd-kit/core": ">=6.1.0",
73
+ "@dnd-kit/modifiers": ">=7.0.0",
74
+ "@dnd-kit/sortable": ">=8.0.0",
75
+ "@dnd-kit/utilities": ">=3.2.2",
76
+ "@tanstack/react-query": ">=5.59.15",
77
+ "@tensorflow-models/pose-detection": ">=2.1.3",
78
+ "@tensorflow/tfjs": ">=4.22.0",
79
+ "@vladmandic/face-api": ">=1.7.14",
80
+ "@xyflow/react": ">=12.3.3",
81
+ "antd": ">=5.21.4",
82
+ "axios": ">=1.7.7",
83
+ "dayjs": ">=1.11.13",
84
+ "lodash": ">=4.17.21",
85
+ "react": ">=18.0.0",
86
+ "react-dom": ">=18.0.0"
87
+ },
88
+ "publishConfig": {
89
+ "access": "public"
90
+ },
91
+ "authors": []
92
+ }