@cloud-app-dev/vidc 4.0.14 → 4.0.15

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.
package/.prettierrc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  pluginSearchDirs: false,
3
3
  plugins: [require.resolve('prettier-plugin-organize-imports'), require.resolve('prettier-plugin-packagejson')],
4
- printWidth: 180,
4
+ printWidth: 200,
5
5
  proseWrap: 'never',
6
6
  singleQuote: true,
7
7
  trailingComma: 'all',
@@ -79,6 +79,7 @@ export default function App() {
79
79
  });
80
80
  },
81
81
  width: 844,
82
+ destroyOnClose: true,
82
83
  children: /*#__PURE__*/_jsx("div", {
83
84
  style: {
84
85
  width: 800,
@@ -30,7 +30,7 @@ import FPSPlay from "./fps_play";
30
30
  import useLiveHeart from "./live_heart";
31
31
  import VideoMessage from "./message";
32
32
  import Timeline from "./timeline";
33
- import { getVideoType, playUnload } from "./util";
33
+ import { createProxy, getVideoType, playUnload } from "./util";
34
34
  import "./style/index.less";
35
35
  import { jsx as _jsx } from "react/jsx-runtime";
36
36
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -153,22 +153,14 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
153
153
  if (!api) {
154
154
  return undefined;
155
155
  }
156
- var map = _objectSpread({
156
+ var extmap = _objectSpread({
157
157
  reload: reload,
158
158
  unload: unload,
159
159
  toggleFit: toggle,
160
160
  openFpsPlay: openFpsPlay,
161
161
  closeFpsPlay: closeFpsPlay
162
162
  }, extActions);
163
- return new Proxy(api, {
164
- get: function get(target, key) {
165
- var _map$key;
166
- return (_map$key = map[key]) !== null && _map$key !== void 0 ? _map$key : target[key];
167
- },
168
- set: function set() {
169
- return true;
170
- }
171
- });
163
+ return createProxy(api, extmap);
172
164
  // eslint-disable-next-line react-hooks/exhaustive-deps
173
165
  }, [api]);
174
166
 
@@ -177,14 +169,7 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
177
169
  if (!event) {
178
170
  return undefined;
179
171
  }
180
- return new Proxy(event, {
181
- get: function get(target, key) {
182
- return target[key];
183
- },
184
- set: function set() {
185
- return true;
186
- }
187
- });
172
+ return createProxy(event);
188
173
  }, [event]);
189
174
 
190
175
  // ref暴露接口
@@ -46,11 +46,11 @@
46
46
  }
47
47
 
48
48
  @keyframes loading-animation-frames {
49
- form {
49
+ from {
50
50
  transform: rotate(0deg);
51
51
  }
52
52
 
53
- 100% {
53
+ to {
54
54
  transform: rotate(360deg);
55
55
  }
56
56
  }
@@ -40,3 +40,4 @@ export declare function timeStamp(second: number): string;
40
40
  export declare function getRandom(): string;
41
41
  export declare const FMT = "YYYY-MM-DD HH:mm:ss";
42
42
  export declare function getDomStyleValue(dom: HTMLElement, styleKey: string): string;
43
+ export declare function createProxy<T>(obj: T, getObj?: any): T;
package/es/Player/util.js CHANGED
@@ -161,7 +161,7 @@ export function timeStamp(second) {
161
161
  return "".concat(h < 10 ? '0' + h : h, ":").concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
162
162
  }
163
163
  export function getRandom() {
164
- return Math.random().toString(36).substr(2);
164
+ return Math.random().toString(36).substring(2);
165
165
  }
166
166
  export var FMT = 'YYYY-MM-DD HH:mm:ss';
167
167
  export function getDomStyleValue(dom, styleKey) {
@@ -169,4 +169,21 @@ export function getDomStyleValue(dom, styleKey) {
169
169
  return '';
170
170
  }
171
171
  return window.getComputedStyle(dom).getPropertyValue(styleKey);
172
+ }
173
+ export function createProxy(obj, getObj) {
174
+ var handler = {
175
+ get: function get(target, key, recevier) {
176
+ if (_typeof(target[key]) === 'object') {
177
+ createProxy(target[key]);
178
+ }
179
+ if (getObj && getObj[key]) {
180
+ return Reflect.get(getObj, key);
181
+ }
182
+ return Reflect.get(target, key, recevier);
183
+ },
184
+ set: function set(target, key, value) {
185
+ return Reflect.set(target, key, value);
186
+ }
187
+ };
188
+ return new Proxy(obj, handler);
172
189
  }
package/es/index.d.ts CHANGED
@@ -26,7 +26,6 @@ export { default as List } from './List';
26
26
  export { default as ListWithSizeAnimate } from './ListWithSizeAnimate';
27
27
  export { default as LoaderScript } from './LoaderScript';
28
28
  export { default as Map } from './Map';
29
- export { default as Map3D } from './Map3D';
30
29
  export { default as Picture } from './Picture';
31
30
  export { default as Player } from './Player';
32
31
  export { default as PlayerExt } from './PlayerExt';
package/es/index.js CHANGED
@@ -26,7 +26,6 @@ export { default as List } from "./List";
26
26
  export { default as ListWithSizeAnimate } from "./ListWithSizeAnimate";
27
27
  export { default as LoaderScript } from "./LoaderScript";
28
28
  export { default as Map } from "./Map";
29
- export { default as Map3D } from "./Map3D";
30
29
  export { default as Picture } from "./Picture";
31
30
  export { default as Player } from "./Player";
32
31
  export { default as PlayerExt } from "./PlayerExt";
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": "4.0.14",
5
+ "version": "4.0.15",
6
6
  "scripts": {
7
7
  "docs:deploy": "gh-pages -d docs-dist",
8
8
  "build": "npm run entry && father build",
@@ -17,6 +17,9 @@
17
17
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
18
18
  "stylelint": "stylelint --fix \"**/*.less\" --custom-syntax postcss-less"
19
19
  },
20
+ "publishConfig": {
21
+ "registry": "https://registry.npmjs.org/"
22
+ },
20
23
  "main": "es/index.js",
21
24
  "module": "es/index.js",
22
25
  "typings": "es/index.d.ts",
@@ -49,30 +52,31 @@
49
52
  "ahooks": "^3.7.2",
50
53
  "axios": "^1.2.1",
51
54
  "dayjs": "^1.11.6",
55
+ "db.js": "^0.15.0",
52
56
  "history": "^5.3.0",
53
- "hls.js": "^1.2.8",
57
+ "hls.js": "^1.4.0",
54
58
  "immer": "^9.0.16",
59
+ "js-cookie": "^2.2.1",
55
60
  "lodash-es": "^4.17.21",
56
61
  "react-error-boundary": "^3.1.4",
57
62
  "react-hotkeys-hook": "^4.0.4",
58
63
  "screenfull": "^6.0.2",
59
- "socket.io-client": "1.4.5",
60
- "js-cookie": "^2.2.1",
61
- "db.js": "^0.15.0"
64
+ "socket.io-client": "1.4.5"
62
65
  },
63
66
  "devDependencies": {
64
- "@types/socket.io-client": "^1.4.36",
65
67
  "@commitlint/cli": "^17.1.2",
66
68
  "@commitlint/config-conventional": "^17.1.0",
69
+ "@types/db.js": "^0.14.7",
67
70
  "@types/leaflet": "^1.9.0",
68
71
  "@types/lodash-es": "^4.17.6",
69
72
  "@types/node": "^18.11.11",
70
73
  "@types/react": "^18.0.26",
71
74
  "@types/react-dom": "^18.0.9",
75
+ "@types/socket.io-client": "^1.4.36",
72
76
  "@umijs/lint": "^4.0.52",
73
77
  "antd": "^5.2.2",
74
78
  "babel-plugin-import": "^1.13.5",
75
- "dumi": "^2.1.17",
79
+ "dumi": "^2.1.19",
76
80
  "eslint": "^8.28.0",
77
81
  "father": "^4.1.7",
78
82
  "gh-pages": "^4.0.0",
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare const App: () => JSX.Element;
3
- export default App;
package/es/Map3D/demo.js DELETED
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import Map3D from '.';
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- var App = function App() {
5
- return /*#__PURE__*/_jsx("div", {
6
- style: {
7
- width: 1000,
8
- height: 400
9
- },
10
- children: /*#__PURE__*/_jsx(Map3D, {})
11
- });
12
- };
13
- export default App;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- declare function withLoadMap(): JSX.Element;
4
- export default withLoadMap;
package/es/Map3D/index.js DELETED
@@ -1,84 +0,0 @@
1
- import React, { useEffect, useRef } from 'react';
2
- import LoaderScript from "../LoaderScript";
3
- import "./index.less";
4
-
5
- // const options: IOptionsLoader[] = [
6
- // { scripts: ['http://192.168.101.38:8888/twinmap/resources/TwinMap3D/lib/Cesium/Cesium.js'] },
7
- // { scripts: ['http://192.168.101.38:8888/twinmap/resources/TwinMap3D/TwinMap3D.js'] },
8
- // ];
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- var options = [{
11
- scripts: []
12
- }, {
13
- scripts: []
14
- }];
15
- var _this = window;
16
- function Map3D() {
17
- var ref = useRef(null);
18
- useEffect(function () {
19
- var viewer = new _this.Cesium.Viewer(ref.current, {
20
- infoBox: false,
21
- selectionIndicator: false,
22
- navigation: false,
23
- animation: false,
24
- shouldAnimate: false,
25
- timeline: false,
26
- baseLayerPicker: false,
27
- geocoder: false,
28
- homeButton: false,
29
- sceneModePicker: false,
30
- navigationHelpButton: false,
31
- fullscreenButton: !1
32
- });
33
- var url = 'http://192.168.101.38:8888/twinmap/twin3dMap/model/b3dms/tileset.json';
34
- var tileset = new _this.Cesium.Cesium3DTileset({
35
- url: url
36
- });
37
- viewer.scene.primitives.add(tileset).readyPromise.then(function (t) {
38
- console.log(t);
39
- viewer.zoomTo(t);
40
- tileset.maximumScreenSpaceError = 1;
41
- var plotDraw = new _this.TwinMap3D.Tools.GeoPlotDraw(viewer);
42
- plotDraw.activate('marker');
43
-
44
- // const params = {
45
- // tx: 116.044332, //模型中心X轴坐标(经度,单位:十进制度)
46
- // ty: 30.110653, //模型中心Y轴坐标(纬度,单位:十进制度)
47
- // tz: 0, //模型中心Z轴坐标(高程,单位:米)
48
- // rx: 0, //X轴(经度)方向旋转角度(单位:度)
49
- // ry: 0, //Y轴(纬度)方向旋转角度(单位:度)
50
- // rz: 0, //Z轴(高程)方向旋转角度(单位:度)
51
- // };
52
- //平移、贴地、旋转模型
53
- //旋转
54
- // const mx = _this.Cesium.Matrix3.fromRotationX(_this.Cesium.Math.toRadians(params.rx));
55
- // const my = _this.Cesium.Matrix3.fromRotationY(_this.Cesium.Math.toRadians(params.ry));
56
- // const mz = _this.Cesium.Matrix3.fromRotationZ(_this.Cesium.Math.toRadians(params.rz));
57
- // const rotationX = _this.Cesium.Matrix4.fromRotationTranslation(mx);
58
- // const rotationY = _this.Cesium.Matrix4.fromRotationTranslation(my);
59
- // const rotationZ = _this.Cesium.Matrix4.fromRotationTranslation(mz);
60
- //平移
61
- // const position = _this.Cesium.Cartesian3.fromDegrees(params.tx, params.ty, params.tz);
62
- // const m = _this.Cesium.Transforms.eastNorthUpToFixedFrame(position);
63
- //旋转、平移矩阵相乘
64
- // _this.Cesium.Matrix4.multiply(m, rotationX, m);
65
- // _this.Cesium.Matrix4.multiply(m, rotationY, m);
66
- // _this.Cesium.Matrix4.multiply(m, rotationZ, m);
67
- //赋值给tileset
68
- // tileset._root.transform = m;
69
- }).otherwise(function (e) {
70
- console.log(e);
71
- });
72
- }, []);
73
- return /*#__PURE__*/_jsx("div", {
74
- className: "map-3d-container",
75
- ref: ref
76
- });
77
- }
78
- function withLoadMap() {
79
- return /*#__PURE__*/_jsx(LoaderScript, {
80
- options: options,
81
- children: /*#__PURE__*/_jsx(Map3D, {})
82
- });
83
- }
84
- export default withLoadMap;
@@ -1,4 +0,0 @@
1
- .map-3d-container {
2
- width: 100%;
3
- height: 100%;
4
- }