json-canvas-viewer 3.1.1 → 3.2.0
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/README.md +46 -368
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/types/baseModule.d.ts +12 -0
- package/dist/types/canvasViewer.d.ts +21 -14
- package/dist/types/controller.d.ts +33 -0
- package/dist/types/{extensions/controls → controls}/index.d.ts +12 -6
- package/dist/types/dataManager.d.ts +42 -22
- package/dist/types/debugPanel/index.d.ts +9 -0
- package/dist/types/declarations.d.ts +79 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/interactionHandler.d.ts +26 -9
- package/dist/types/{extensions/minimap → minimap}/index.d.ts +13 -7
- package/dist/types/mistouchPreventer/index.d.ts +22 -0
- package/dist/types/overlayManager.d.ts +22 -8
- package/dist/types/renderer.d.ts +5 -4
- package/dist/types/shared.d.ts +13 -0
- package/dist/types/utilities.d.ts +15 -12
- package/package.json +32 -67
- package/dist/cjs/controls.js +0 -1
- package/dist/cjs/debugPanel.js +0 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/minimap.js +0 -1
- package/dist/cjs/mistouchPreventer.js +0 -1
- package/dist/es/controls.js +0 -1
- package/dist/es/debugPanel.js +0 -1
- package/dist/es/index.js +0 -1
- package/dist/es/minimap.js +0 -1
- package/dist/es/mistouchPreventer.js +0 -1
- package/dist/types/extensions/debugPanel/index.d.ts +0 -8
- package/dist/types/extensions/mistouchPreventer/index.d.ts +0 -14
- package/dist/types/interactor.d.ts +0 -30
- package/dist/utilities-9mYNj6lG.js +0 -1
- package/dist/utilities-C1DbXNeO.cjs +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default class mistouchPreventer {
|
|
2
|
-
private _preventionContainer;
|
|
3
|
-
private preventMt;
|
|
4
|
-
private preventMistouch;
|
|
5
|
-
private data;
|
|
6
|
-
private get preventionContainer();
|
|
7
|
-
constructor(data: runtimeData, registry: registry);
|
|
8
|
-
private onPointerDown;
|
|
9
|
-
private onPointerMove;
|
|
10
|
-
private onPointerUp;
|
|
11
|
-
private startPrevention;
|
|
12
|
-
private endPrevention;
|
|
13
|
-
private dispose;
|
|
14
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export default class interactor extends EventTarget {
|
|
2
|
-
private monitoringElement;
|
|
3
|
-
private pointers;
|
|
4
|
-
private pinchZoomState;
|
|
5
|
-
private proControlSchema;
|
|
6
|
-
private zoomFactor;
|
|
7
|
-
private preventDefault;
|
|
8
|
-
private lockControlSchema;
|
|
9
|
-
private ctrlZoomFactor;
|
|
10
|
-
constructor(monitoringElement: HTMLElement, options?: {
|
|
11
|
-
preventDefault?: boolean;
|
|
12
|
-
proControlSchema?: boolean;
|
|
13
|
-
zoomFactor?: number;
|
|
14
|
-
lockControlSchema?: boolean;
|
|
15
|
-
});
|
|
16
|
-
private getNthValue;
|
|
17
|
-
private getPointerDistance;
|
|
18
|
-
private getPointerMidpoint;
|
|
19
|
-
private S2C;
|
|
20
|
-
private onPointerDown;
|
|
21
|
-
private onPointerMove;
|
|
22
|
-
private onPointerUp;
|
|
23
|
-
private onWheel;
|
|
24
|
-
private dispatchPanEvent;
|
|
25
|
-
private dispatchZoomEvent;
|
|
26
|
-
private preventDefaultFunction;
|
|
27
|
-
stop: () => void;
|
|
28
|
-
start: () => void;
|
|
29
|
-
dispose: () => void;
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=new Error("This error is unexpected, probably caused by canvas file corruption. If you assure the error is not by accident, please contact the developer and show how to reproduce."),t=new Error("Resource hasn't been set up or has been disposed.");function r(e,t,r,o,n,a){e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+o-a,r),e.quadraticCurveTo(t+o,r,t+o,r+a),e.lineTo(t+o,r+n-a),e.quadraticCurveTo(t+o,r+n,t+o-a,r+n),e.lineTo(t+a,r+n),e.quadraticCurveTo(t,r+n,t,r+n-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath()}function o(e,t){const r=e.x+e.width/2,o=e.y+e.height/2;switch(t){case"top":return[r,e.y];case"bottom":return[r,e.y+e.height];case"left":return[e.x,o];case"right":return[e.x+e.width,o];default:return[r,o]}}function n(e="0"){let t=null;if(1===e.length)switch(e){case"1":t="rgba(255, 120, 129, ?)";break;case"2":t="rgba(251, 187, 131, ?)";break;case"3":t="rgba(255, 232, 139, ?)";break;case"4":t="rgba(124, 211, 124, ?)";break;case"5":t="rgba(134, 223, 226, ?)";break;case"6":t="rgba(203, 158, 255, ?)";break;default:t="rgba(140, 140, 140, ?)"}else{const r=function(e){const t=e.replace("#","");return{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16)}}(e);t=`rgba(${r.r}, ${r.g}, ${r.b}, ?)`}return{border:t.replace("?","0.75"),background:t.replace("?","0.1"),active:t.replace("?","1")}}function a(t,r,o){const n=window.devicePixelRatio||1,a=t.getContext("2d");if(!a)throw e;t.width=Math.round(r*n),t.height=Math.round(o*n),a.setTransform(1,0,0,1,0,0),a.scale(n,n)}function c(e,t,r=!1){function o(e){return null!==e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)}if(null===e||"object"!=typeof e)throw new Error("Main must be a non-null object");if(null===t||"object"!=typeof t)throw new Error("Nothing to merge");const n=Object.keys(t);for(const a of n){const n=t[a];if(a in e){const t=e[a];o(t)&&o(n)?c(t,n,r):r||(e[a]=n)}else e[a]=n}}function s(e,t){const r=10**t;return Math.round(e*r)/r}export{a,r as b,o as c,t as d,c as e,n as g,s as r,e as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=new Error("This error is unexpected, probably caused by canvas file corruption. If you assure the error is not by accident, please contact the developer and show how to reproduce."),r=new Error("Resource hasn't been set up or has been disposed.");exports.deepMerge=function e(r,t,o=!1){function n(e){return null!==e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)}if(null===r||"object"!=typeof r)throw new Error("Main must be a non-null object");if(null===t||"object"!=typeof t)throw new Error("Nothing to merge");const a=Object.keys(t);for(const s of a){const a=t[s];if(s in r){const t=r[s];n(t)&&n(a)?e(t,a,o):o||(r[s]=a)}else r[s]=a}},exports.destroyError=r,exports.drawRoundRect=function(e,r,t,o,n,a){e.beginPath(),e.moveTo(r+a,t),e.lineTo(r+o-a,t),e.quadraticCurveTo(r+o,t,r+o,t+a),e.lineTo(r+o,t+n-a),e.quadraticCurveTo(r+o,t+n,r+o-a,t+n),e.lineTo(r+a,t+n),e.quadraticCurveTo(r,t+n,r,t+n-a),e.lineTo(r,t+a),e.quadraticCurveTo(r,t,r+a,t),e.closePath()},exports.getAnchorCoord=function(e,r){const t=e.x+e.width/2,o=e.y+e.height/2;switch(r){case"top":return[t,e.y];case"bottom":return[t,e.y+e.height];case"left":return[e.x,o];case"right":return[e.x+e.width,o];default:return[t,o]}},exports.getColor=function(e="0"){let r=null;if(1===e.length)switch(e){case"1":r="rgba(255, 120, 129, ?)";break;case"2":r="rgba(251, 187, 131, ?)";break;case"3":r="rgba(255, 232, 139, ?)";break;case"4":r="rgba(124, 211, 124, ?)";break;case"5":r="rgba(134, 223, 226, ?)";break;case"6":r="rgba(203, 158, 255, ?)";break;default:r="rgba(140, 140, 140, ?)"}else{const t=function(e){const r=e.replace("#","");return{r:parseInt(r.substring(0,2),16),g:parseInt(r.substring(2,4),16),b:parseInt(r.substring(4,6),16)}}(e);r=`rgba(${t.r}, ${t.g}, ${t.b}, ?)`}return{border:r.replace("?","0.75"),background:r.replace("?","0.1"),active:r.replace("?","1")}},exports.resizeCanvasForDPR=function(r,t,o){const n=window.devicePixelRatio||1,a=r.getContext("2d");if(!a)throw e;r.width=Math.round(t*n),r.height=Math.round(o*n),a.setTransform(1,0,0,1,0,0),a.scale(n,n)},exports.round=function(e,r){const t=10**r;return Math.round(e*t)/t},exports.unexpectedError=e;
|