@cloud-app-dev/vidc 3.2.33 → 3.2.35

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.
@@ -13,8 +13,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
 
15
15
  import React from 'react';
16
- import useFullscreen from "../useFullscreen";
17
16
  import IconFont from "../IconFont";
17
+ import useFullscreen from "../useFullscreen";
18
18
  import "./index.less";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -39,9 +39,9 @@ export default function App() {
39
39
  onClickRect: console.log,
40
40
  onMenuClick: console.log,
41
41
  menus: [{
42
- title: "菜单1",
43
- pathname: "/",
44
- icon: ""
42
+ title: '菜单1',
43
+ pathname: '/',
44
+ icon: ''
45
45
  }],
46
46
  imagePath: "http://192.168.100.246:1443/image/v1/100005251/objects/63882cf105f5f58310107e95/1669910400.jpg?signature=ad407ae3019acb29b14b4ed2817ad12f&watermark=m_61646D696E0A323032323132303154313332373434&expires=1669910400",
47
47
  isOpenSelect: state.open,
@@ -62,7 +62,7 @@ export default function App() {
62
62
  rect: [240.0, 468.0, 41.0, 36.0],
63
63
  needExpand: true
64
64
  }],
65
- children: function children(options) {
65
+ children: function children() {
66
66
  return /*#__PURE__*/_jsx(_Button, {
67
67
  onClick: function onClick() {
68
68
  updateState({
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { IPictureProps } from './interface';
3
2
  import './index.less';
3
+ import type { IPictureProps } from './interface';
4
4
  declare function Picture({ className, width, height, minHeight, disabledDrag, imagePath, rects, isOpenSelect, disabledDrawMenu, menus, hasTool, fullScreenEle, ...props }: IPictureProps): JSX.Element;
5
5
  declare namespace Picture {
6
6
  var defaultProps: {
@@ -40,10 +40,10 @@ import DrawRect from "./component/DrawRect";
40
40
  import Tools from "./component/Tools";
41
41
  import WheelScale from "./component/WheelScale";
42
42
  import { computedBound } from "./dragBound";
43
+ import "./index.less";
43
44
  import { getRectImagePath } from "./loadCaptureRectImage";
44
45
  import useDraw from "./useDraw";
45
46
  import { computedRectScale, customContextMenu } from "./utils";
46
- import "./index.less";
47
47
  import { jsx as _jsx } from "react/jsx-runtime";
48
48
  import { jsxs as _jsxs } from "react/jsx-runtime";
49
49
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -97,7 +97,6 @@ function Picture(_ref) {
97
97
  return undefined;
98
98
  }
99
99
 
100
- console.log(imagePath);
101
100
  var localUrl;
102
101
  fetch(imagePath).then(function (res) {
103
102
  return res.blob();
@@ -106,6 +105,8 @@ function Picture(_ref) {
106
105
  updateState({
107
106
  localUrl: localUrl
108
107
  });
108
+ }).catch(function (e) {
109
+ console.error(e);
109
110
  });
110
111
  return function () {
111
112
  return URL.revokeObjectURL(localUrl);
@@ -286,16 +287,7 @@ function Picture(_ref) {
286
287
 
287
288
 
288
289
  var getRectImage = _useMemoizedFn(function (rect) {
289
- var scale = state.scale,
290
- rotate = state.rotate,
291
- x = state.x,
292
- y = state.y;
293
- return getRectImagePath(domImgRef.current, rect, {
294
- scale: scale,
295
- rotate: rotate,
296
- x: x,
297
- y: y
298
- });
290
+ return getRectImagePath(domImgRef.current, rect);
299
291
  });
300
292
 
301
293
  useEffect(function () {
@@ -1,8 +1,3 @@
1
1
  import { ImageType } from './interface';
2
2
  export declare function loadCaptureRectImage(image: HTMLImageElement, rect: number[], imageType: ImageType): Promise<string>;
3
- export declare function getRectImagePath(image: HTMLImageElement, rect: number[], options?: {
4
- scale: number;
5
- rotate: number;
6
- x: number;
7
- y: number;
8
- }): string;
3
+ export declare function getRectImagePath(image: HTMLImageElement, rect: number[]): string;
@@ -68,15 +68,6 @@ function _loadCaptureRectImage() {
68
68
  }
69
69
 
70
70
  export function getRectImagePath(image, rect) {
71
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
72
- scale: 1,
73
- rotate: 0,
74
- x: 0,
75
- y: 0
76
- };
77
- var scale = options.scale,
78
- rotate = options.rotate;
79
-
80
71
  var _rect = _slicedToArray(rect, 4),
81
72
  x = _rect[0],
82
73
  y = _rect[1],
@@ -104,7 +95,6 @@ export function getRectImagePath(image, rect) {
104
95
  // document.body.appendChild(fullCanvas);
105
96
 
106
97
  fullCtx.translate(naturalWidth / 2, naturalHeight / 2);
107
- fullCtx.rotate(rotate * Math.PI / 180);
108
98
  fullCtx.drawImage(image, -naturalWidth / 2, -naturalHeight / 2, naturalWidth, naturalHeight);
109
99
  fullCtx.restore();
110
100
  var imageData = fullCtx.getImageData(area[0], area[1], area[2], area[3]);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import './index.less';
3
2
  import type { IRecordPlayerProps } from './interface';
3
+ import './index.less';
4
4
  /**
5
5
  * @desc 录像设计的时间全部需要到毫秒
6
6
  * @param param0
@@ -35,12 +35,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
35
35
  import { cloneDeep } from 'lodash-es';
36
36
  import React, { useEffect, useMemo, useRef, useState } from 'react';
37
37
  import DisableMark from "../DisableMark";
38
- import "./index.less";
39
38
  import { FrontendPlayerWithExt, SegmentPlayerWithExt } from "./PlayerWithExt";
40
39
  import RecordTools from "./RecordTools";
41
40
  import SegmentTimeLine from "./SegmentTimeLine";
42
41
  import useVideoFit from "./useVideoFit";
43
42
  import { mergeFill, ScreenType, sleep } from "./utils";
43
+ import "./index.less";
44
44
  import { createElement as _createElement } from "react";
45
45
  import { jsx as _jsx } from "react/jsx-runtime";
46
46
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -492,7 +492,7 @@ function RecordPlayer(_ref) {
492
492
  toggleFit: toggleFit,
493
493
  getPlayerItem: getPlayerItem,
494
494
  screenNum: screenNum,
495
- mode: state.modes[state.selectIndex],
495
+ mode: segmentItem !== null && segmentItem !== void 0 && segmentItem.cid ? state.modes["".concat(segmentItem.cid, "-").concat(segmentItem.date)] : segmentItem === null || segmentItem === void 0 ? void 0 : segmentItem.mode,
496
496
  containerRef: domRef,
497
497
  updateState: updateState,
498
498
  onTimeChange: onTimeChange,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "name": "@cloud-app-dev/vidc",
4
4
  "description": "Video Image Data Componennts",
5
- "version": "3.2.33",
5
+ "version": "3.2.35",
6
6
  "scripts": {
7
7
  "docs:deploy": "gh-pages -d docs-dist",
8
8
  "build": "npm run entry && father build",
@@ -66,7 +66,7 @@
66
66
  "@types/react-dom": "^18.0.6",
67
67
  "antd": "^4.22.6",
68
68
  "babel-plugin-import": "^1.13.5",
69
- "dumi": "^2.0.9",
69
+ "dumi": "^2.0.10",
70
70
  "gh-pages": "^4.0.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",