yootd 0.0.67 → 0.0.69

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 (63) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +43 -43
  3. package/dist/Preview/components/preview/phone.scss +8 -8
  4. package/dist/Preview/index.scss +35 -35
  5. package/dist/Preview/types/type.d.ts +22 -22
  6. package/dist/anchor/index.scss +23 -23
  7. package/dist/approval-process/index.scss +95 -95
  8. package/dist/areas/index.scss +21 -21
  9. package/dist/areas/types/types.d.ts +40 -40
  10. package/dist/areas-treeSelect/index.scss +6 -6
  11. package/dist/areas-treeSelect/types/type.d.ts +39 -39
  12. package/dist/aside/components/SortableItem.scss +111 -111
  13. package/dist/aside/index.scss +46 -46
  14. package/dist/badge/index.scss +5 -5
  15. package/dist/buildings/types/types.d.ts +21 -21
  16. package/dist/button/index.scss +30 -30
  17. package/dist/cascader/index.scss +5 -5
  18. package/dist/courses/types/types.d.ts +18 -18
  19. package/dist/department/index.scss +6 -6
  20. package/dist/department/types/types.d.ts +23 -23
  21. package/dist/dictionary/types/types.d.ts +14 -14
  22. package/dist/drawer-modal/index.scss +42 -42
  23. package/dist/drawer-modal/types/types.d.ts +3 -3
  24. package/dist/dropdown/assets/arrow-down.svg +5 -5
  25. package/dist/dropdown-select/index.scss +6 -6
  26. package/dist/dropdown-select/types/type.d.ts +18 -18
  27. package/dist/empty/index.scss +15 -15
  28. package/dist/export/index.scss +6 -6
  29. package/dist/go-back/components/index.scss +5 -5
  30. package/dist/go-back/index.scss +24 -24
  31. package/dist/group-title/index.scss +31 -31
  32. package/dist/hooks/useBem.js +10 -10
  33. package/dist/image/index.scss +26 -26
  34. package/dist/input/index.scss +5 -5
  35. package/dist/job-title/types/types.d.ts +17 -17
  36. package/dist/modal/index.scss +76 -76
  37. package/dist/pagination/index.scss +47 -47
  38. package/dist/role/types/types.d.ts +22 -22
  39. package/dist/school/index.scss +21 -21
  40. package/dist/school/types/types.d.ts +85 -85
  41. package/dist/state/index.scss +89 -89
  42. package/dist/steps/index.scss +32 -32
  43. package/dist/student-dropdown/types/types.d.ts +44 -44
  44. package/dist/table/components/primary-header-row/index.js +10 -3
  45. package/dist/table/components/primary-header-row/index.scss +65 -58
  46. package/dist/table/components/primary-tbody-row/index.scss +5 -5
  47. package/dist/table/index.d.ts +2 -0
  48. package/dist/table/index.js +4 -2
  49. package/dist/table/index.scss +33 -33
  50. package/dist/tabs/index.scss +86 -86
  51. package/dist/tag/index.scss +4 -4
  52. package/dist/teacher/types/types.d.ts +33 -33
  53. package/dist/tree/index.scss +25 -25
  54. package/dist/upload/index.scss +115 -115
  55. package/dist/user-dropdown/types/types.d.ts +45 -45
  56. package/dist/video-player/index.d.ts +7 -0
  57. package/dist/video-player/index.js +31 -11
  58. package/dist/video-player/index.scss +310 -310
  59. package/dist/year-term/index.scss +21 -21
  60. package/dist/zones/index.module.scss +23 -23
  61. package/dist/zones/types/types.d.ts +26 -26
  62. package/package.json +1 -1
  63. package/dist/table/index.module.scss +0 -9
@@ -1,25 +1,25 @@
1
- .yot-tree {
2
- .ant-tree-node-content-wrapper.ant-tree-node-selected {
3
- background-color: var(--ant-color-primary-bg);
4
- .ant-tree-title {
5
- color: var(--ant-color-primary);
6
- }
7
- }
8
- .ant-tree-node-content-wrapper {
9
- .ant-tree-title {
10
- color: var(--ant-color-text-secondary);
11
- }
12
- }
13
- &__icon {
14
- margin-top: 2px;
15
- &.yot-is-selected {
16
- .path-1 {
17
- stroke: var(--ant-color-primary);
18
- }
19
- .path-2,
20
- .rect-1 {
21
- fill: var(--ant-color-primary);
22
- }
23
- }
24
- }
25
- }
1
+ .yot-tree {
2
+ .ant-tree-node-content-wrapper.ant-tree-node-selected {
3
+ background-color: var(--ant-color-primary-bg);
4
+ .ant-tree-title {
5
+ color: var(--ant-color-primary);
6
+ }
7
+ }
8
+ .ant-tree-node-content-wrapper {
9
+ .ant-tree-title {
10
+ color: var(--ant-color-text-secondary);
11
+ }
12
+ }
13
+ &__icon {
14
+ margin-top: 2px;
15
+ &.yot-is-selected {
16
+ .path-1 {
17
+ stroke: var(--ant-color-primary);
18
+ }
19
+ .path-2,
20
+ .rect-1 {
21
+ fill: var(--ant-color-primary);
22
+ }
23
+ }
24
+ }
25
+ }
@@ -1,115 +1,115 @@
1
- .yot-upload {
2
- .ant-upload-list-item {
3
- padding: 0;
4
- }
5
- .ant-upload-list-item.ant-upload-list-item-done {
6
- .ant-upload-icon {
7
- .anticon.anticon-paper-clip {
8
- color: var(--ant-color-primary);
9
- }
10
- }
11
- }
12
- .ant-upload-list-item-name {
13
- display: flex;
14
- align-items: center;
15
- }
16
-
17
- &-file {
18
- &-btn {
19
- &__icon {
20
- width: 16px;
21
- height: 16px;
22
- }
23
- &:hover &{
24
- &__icon {
25
- .path-1 {
26
- fill: var(--ant-color-primary);
27
- width: 20px;
28
- }
29
- }
30
- }
31
- }
32
- }
33
- &__icon {
34
- &--success {
35
- width: 16px;
36
- height: 16px;
37
- position: absolute;
38
- top: 0px;
39
- right: 24px;
40
- }
41
- &--again {
42
- width: 16px;
43
- height: 16px;
44
- position: absolute;
45
- top: 0px;
46
- right: 24px;
47
- }
48
- &--delete {
49
- width: 16px;
50
- height: 16px;
51
- position: absolute;
52
- top: 0px;
53
- right: 2px;
54
- }
55
- }
56
-
57
- &-image {
58
- &-btn {
59
- width: 100px;
60
- height: 100px;
61
- border-radius: 8px;
62
- background-color: var(--ant-color-border-secondary);
63
- display: flex;
64
- align-items: center;
65
- justify-content: center;
66
- flex-direction: column;
67
- &__text {
68
- font-size: 12px;
69
- color: var(--ant-color-text-quaternary);
70
- margin-top: 8px;
71
- }
72
- }
73
- }
74
- &-video {
75
- &-content {
76
- position: relative;
77
- width: 102px;
78
- height: 102px;
79
- border-radius: 4px;
80
- cursor: pointer;
81
- padding: 8px;
82
- box-sizing: border-box;
83
- border: 1px solid var(--ant-color-border-secondary);
84
- &__video {
85
- width: 100%;
86
- height: 100%;
87
- }
88
- &:hover &{
89
- &-icon {
90
- z-index: 10;
91
- transition: all;
92
- box-sizing: border-box;
93
- position: absolute;
94
- top: 8px;
95
- left: 8px;
96
- height: 86px;
97
- width: 86px;
98
- /* 这里的背景色根据需求设置 */
99
- background: rgba(0, 0, 0, 0.6) !important;
100
- background-color: #000;
101
- filter: Alpha(Opacity=60);
102
- opacity: 0.6;
103
- &--delete {
104
- width: 16px;
105
- height: 16px;
106
- position: absolute;
107
- top: 36px;
108
- left: 40%;
109
- cursor: pointer;
110
- }
111
- }
112
- }
113
- }
114
- }
115
- }
1
+ .yot-upload {
2
+ .ant-upload-list-item {
3
+ padding: 0;
4
+ }
5
+ .ant-upload-list-item.ant-upload-list-item-done {
6
+ .ant-upload-icon {
7
+ .anticon.anticon-paper-clip {
8
+ color: var(--ant-color-primary);
9
+ }
10
+ }
11
+ }
12
+ .ant-upload-list-item-name {
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ &-file {
18
+ &-btn {
19
+ &__icon {
20
+ width: 16px;
21
+ height: 16px;
22
+ }
23
+ &:hover &{
24
+ &__icon {
25
+ .path-1 {
26
+ fill: var(--ant-color-primary);
27
+ width: 20px;
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+ &__icon {
34
+ &--success {
35
+ width: 16px;
36
+ height: 16px;
37
+ position: absolute;
38
+ top: 0px;
39
+ right: 24px;
40
+ }
41
+ &--again {
42
+ width: 16px;
43
+ height: 16px;
44
+ position: absolute;
45
+ top: 0px;
46
+ right: 24px;
47
+ }
48
+ &--delete {
49
+ width: 16px;
50
+ height: 16px;
51
+ position: absolute;
52
+ top: 0px;
53
+ right: 2px;
54
+ }
55
+ }
56
+
57
+ &-image {
58
+ &-btn {
59
+ width: 100px;
60
+ height: 100px;
61
+ border-radius: 8px;
62
+ background-color: var(--ant-color-border-secondary);
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ flex-direction: column;
67
+ &__text {
68
+ font-size: 12px;
69
+ color: var(--ant-color-text-quaternary);
70
+ margin-top: 8px;
71
+ }
72
+ }
73
+ }
74
+ &-video {
75
+ &-content {
76
+ position: relative;
77
+ width: 102px;
78
+ height: 102px;
79
+ border-radius: 4px;
80
+ cursor: pointer;
81
+ padding: 8px;
82
+ box-sizing: border-box;
83
+ border: 1px solid var(--ant-color-border-secondary);
84
+ &__video {
85
+ width: 100%;
86
+ height: 100%;
87
+ }
88
+ &:hover &{
89
+ &-icon {
90
+ z-index: 10;
91
+ transition: all;
92
+ box-sizing: border-box;
93
+ position: absolute;
94
+ top: 8px;
95
+ left: 8px;
96
+ height: 86px;
97
+ width: 86px;
98
+ /* 这里的背景色根据需求设置 */
99
+ background: rgba(0, 0, 0, 0.6) !important;
100
+ background-color: #000;
101
+ filter: Alpha(Opacity=60);
102
+ opacity: 0.6;
103
+ &--delete {
104
+ width: 16px;
105
+ height: 16px;
106
+ position: absolute;
107
+ top: 36px;
108
+ left: 40%;
109
+ cursor: pointer;
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
@@ -1,45 +1,45 @@
1
- import { SelectProps } from 'yootd';
2
-
3
- export interface PageData<T> {
4
- content: T[];
5
- page: {
6
- number: number;
7
- size: number;
8
- totalElements: number;
9
- totalPages: number;
10
- };
11
- }
12
- type LabelOptions =
13
- | 'uniqueNumber'
14
- | 'personalName'
15
- | 'majorName'
16
- | 'collegeMajorName'
17
- | 'className'
18
- | 'gradeName'
19
- | 'genderName'
20
- | 'deptName'
21
- | 'credentialsNo'
22
- | 'personalMobile';
23
- export type UserDropdownProps = SelectProps & {
24
- type?: number; // 1:学生2:教师3:职工
25
- label?: LabelOptions[];
26
- connectors?: string;
27
- teacher_id?: number;
28
- };
29
- export interface IuserItem {
30
- userId: string; // ID
31
- uniqueNumber?: string; // 学号/工号
32
- personalName: string; // 姓名
33
- personalPhoto?: string; // 照片
34
- userFaceType?: number; // 人脸类型(1白名单2黑名单3红名单)
35
- majorName?: string; // 专业名称
36
- collegeMajorName?: string; // 院系名称
37
- className?: string; // 班级名称
38
- gradeName?: string; // 年级名称
39
- genderName?: string; // 性别
40
- deptId?: number; // 部门ID
41
- deptName?: string; // 部门名称
42
- gender?: number; // 性别
43
- credentialsNo?: string; // 证件号
44
- personalMobile?: string; // 手机号
45
- }
1
+ import { SelectProps } from 'yootd';
2
+
3
+ export interface PageData<T> {
4
+ content: T[];
5
+ page: {
6
+ number: number;
7
+ size: number;
8
+ totalElements: number;
9
+ totalPages: number;
10
+ };
11
+ }
12
+ type LabelOptions =
13
+ | 'uniqueNumber'
14
+ | 'personalName'
15
+ | 'majorName'
16
+ | 'collegeMajorName'
17
+ | 'className'
18
+ | 'gradeName'
19
+ | 'genderName'
20
+ | 'deptName'
21
+ | 'credentialsNo'
22
+ | 'personalMobile';
23
+ export type UserDropdownProps = SelectProps & {
24
+ type?: number; // 1:学生2:教师3:职工
25
+ label?: LabelOptions[];
26
+ connectors?: string;
27
+ teacher_id?: number;
28
+ };
29
+ export interface IuserItem {
30
+ userId: string; // ID
31
+ uniqueNumber?: string; // 学号/工号
32
+ personalName: string; // 姓名
33
+ personalPhoto?: string; // 照片
34
+ userFaceType?: number; // 人脸类型(1白名单2黑名单3红名单)
35
+ majorName?: string; // 专业名称
36
+ collegeMajorName?: string; // 院系名称
37
+ className?: string; // 班级名称
38
+ gradeName?: string; // 年级名称
39
+ genderName?: string; // 性别
40
+ deptId?: number; // 部门ID
41
+ deptName?: string; // 部门名称
42
+ gender?: number; // 性别
43
+ credentialsNo?: string; // 证件号
44
+ personalMobile?: string; // 手机号
45
+ }
@@ -3,6 +3,8 @@ import './index.scss';
3
3
  export interface VideoPlayerRef {
4
4
  play: () => void;
5
5
  pause: () => void;
6
+ setVideoCurrentTime: (time: number) => void;
7
+ useFaceExpression: (type: 'emotion' | 'character' | 'anchor' | 'pose', use: boolean) => void;
6
8
  }
7
9
  export interface VideoPlayerProps {
8
10
  /**
@@ -70,5 +72,10 @@ export interface VideoPlayerProps {
70
72
  * @param isPlaying
71
73
  */
72
74
  onPlayStateChange?: (isPlaying: boolean) => void;
75
+ /**
76
+ * 播放时间变化回调
77
+ * @param currentTime
78
+ */
79
+ onCurrentTimeChange?: (currentTime: number) => void;
73
80
  }
74
81
  export declare const VideoPlayer: React.ForwardRefExoticComponent<VideoPlayerProps & React.RefAttributes<VideoPlayerRef>>;
@@ -1,13 +1,13 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  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; }
3
3
  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) { _defineProperty(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; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
4
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
8
5
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
9
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
10
7
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
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
13
  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); }
@@ -17,6 +17,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
17
  import * as faceapi from '@vladmandic/face-api';
18
18
  import * as posedetection from '@tensorflow-models/pose-detection';
19
19
  import * as tf from '@tensorflow/tfjs';
20
+ console.log("Hello, World!");
20
21
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
21
22
  import { EndPoint } from 'yootd-webrtc-sdk';
22
23
  import { useBem } from "../hooks/useBem";
@@ -51,7 +52,8 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
51
52
  _ref$miniProgram = _ref.miniProgram,
52
53
  miniProgram = _ref$miniProgram === void 0 ? false : _ref$miniProgram,
53
54
  onPlayStateChange = _ref.onPlayStateChange,
54
- onCapture = _ref.onCapture;
55
+ onCapture = _ref.onCapture,
56
+ onCurrentTimeChange = _ref.onCurrentTimeChange;
55
57
  var containerRef = useRef(null);
56
58
  var videoRef = useRef(null);
57
59
  var canvasRef = useRef(null);
@@ -153,6 +155,23 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
153
155
  pause: function pause() {
154
156
  var _videoRef$current2;
155
157
  (_videoRef$current2 = videoRef.current) === null || _videoRef$current2 === void 0 || _videoRef$current2.pause();
158
+ },
159
+ // 设置播放时间
160
+ setVideoCurrentTime: function setVideoCurrentTime(time) {
161
+ if (videoRef.current) {
162
+ videoRef.current.currentTime = time;
163
+ }
164
+ },
165
+ // 使用启用面部表情/角色/锚点/姿态
166
+ useFaceExpression: function useFaceExpression(type, use) {
167
+ setAIFeature(function () {
168
+ return _defineProperty({
169
+ emotion: false,
170
+ character: false,
171
+ anchor: false,
172
+ pose: false
173
+ }, type, use);
174
+ });
156
175
  }
157
176
  };
158
177
  });
@@ -221,12 +240,13 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
221
240
  setDuration(ele.duration);
222
241
  };
223
242
  var handleOnTimeUpdate = function handleOnTimeUpdate(e) {
224
- var _ele$currentTime;
243
+ var _ele$currentTime, _ele$currentTime2;
225
244
  if (isLive) {
226
245
  return;
227
246
  }
228
247
  var ele = e.target;
229
248
  setCurrentTime((_ele$currentTime = ele.currentTime) !== null && _ele$currentTime !== void 0 ? _ele$currentTime : 0);
249
+ onCurrentTimeChange === null || onCurrentTimeChange === void 0 || onCurrentTimeChange((_ele$currentTime2 = ele.currentTime) !== null && _ele$currentTime2 !== void 0 ? _ele$currentTime2 : 0);
230
250
  if (ele.buffered != null) {
231
251
  try {
232
252
  setBuffered(ele.buffered.end(0));
@@ -530,10 +550,10 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
530
550
  // 绘制骨架
531
551
  var drawSkeleton = function drawSkeleton(keypoints, ctx) {
532
552
  var adjacentPairs = posedetection.util.getAdjacentPairs(posedetection.SupportedModels.MoveNet);
533
- adjacentPairs.forEach(function (_ref4) {
534
- var _ref5 = _slicedToArray(_ref4, 2),
535
- i = _ref5[0],
536
- j = _ref5[1];
553
+ adjacentPairs.forEach(function (_ref5) {
554
+ var _ref6 = _slicedToArray(_ref5, 2),
555
+ i = _ref6[0],
556
+ j = _ref6[1];
537
557
  var kp1 = keypoints[i];
538
558
  var kp2 = keypoints[j];
539
559
  if (kp1.score && kp2.score && kp1.score > 0.3 && kp2.score > 0.3) {
@@ -564,7 +584,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
564
584
  var video = videoRef.current;
565
585
  var canvas = poseCanvasRef.current;
566
586
  var detect = /*#__PURE__*/function () {
567
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
587
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
568
588
  var pose;
569
589
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
570
590
  while (1) switch (_context3.prev = _context3.next) {
@@ -591,7 +611,7 @@ export var VideoPlayer = /*#__PURE__*/forwardRef(function (_ref, ref) {
591
611
  }, _callee3, null, [[0, 7]]);
592
612
  }));
593
613
  return function detect() {
594
- return _ref6.apply(this, arguments);
614
+ return _ref7.apply(this, arguments);
595
615
  };
596
616
  }();
597
617
  detect();