@vertexvis/doc-viewer 1.0.2-canary.1 → 1.0.2-canary.3
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/dist/cjs/vertex-document-viewer.cjs.entry.js +1 -1
- package/dist/collection/lib/interactions/pan-interaction-handler.js +1 -1
- package/dist/components/vertex-document-viewer.js +1 -1
- package/dist/doc-viewer/doc-viewer.esm.js +1 -1
- package/dist/doc-viewer/{p-f5810a8d.entry.js → p-17d333ec.entry.js} +1 -1
- package/dist/esm/vertex-document-viewer.entry.js +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2026 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import{t,p as i,H as e,d as s,h as n,e as r}from"./p-jUMoJLks.js";function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var h=function(t,i){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},h(t,i)},a=function(){return a=Object.assign||function(t){for(var i,e=1,s=arguments.length;e<s;e++)for(var n in i=arguments[e])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t},a.apply(this,arguments)};function c(t,i,e){return(e=function(t){return Math.max(0,Math.min(1,t))}(e))*(i-t)+t}function l(t,i){return void 0===t&&(t=0),void 0===i&&(i=0),{x:t,y:i}}function u(t,i){return{x:t.x-i.x,y:t.y-i.y}}function d(t,i){return{x:t.x*i,y:t.y*i}}function f(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function p(t){var i=f(t);return 0===i?l(0,0):d(t,1/i)}function g(t,i){return p(u(i,t))}"function"==typeof SuppressedError&&SuppressedError;var m=Object.freeze({__proto__:null,add:function(t,i){return{x:t.x+i.x,y:t.y+i.y}},create:l,distance:function(t,i){var e=u(t,i);return Math.sqrt(e.x*e.x+e.y*e.y)},fromJson:function(t){var i=JSON.parse(t);return Array.isArray(i)?l(i[0],i[1]):l(i.x,i.y)},isEqual:function(t,i){return t.x===i.x&&t.y===i.y},lerp:function(t,i,e){return{x:c(t.x,i.x,e),y:c(t.y,i.y,e)}},magnitude:f,negate:function(t){return l(-t.x,-t.y)},normalDirectionVector:g,normalizeVector:p,orthogonalVector:function(t,i){var e=g(t,i);return 0===e.x||0===e.y?l(-1*e.y,e.x):p(Math.abs(e.x)>Math.abs(e.y)?l(1-Math.pow(e.x,2),-1*e.x*e.y):l(-1*e.x*e.y,1-Math.pow(e.y,2)))},polar:function(t,i){return l(Math.cos(i)*t,Math.sin(i)*t)},scale:function(t,i,e){return{x:t.x*i,y:t.y*e}},scaleProportional:d,subtract:u});function w(t,i){return function(t,i,e,s){return{x:t,y:i,width:e,height:s}}(t.x,t.y,i.width,i.height)}function A(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}var v=function(t,i){return{width:t,height:i}},b=function(t,i,e){return{width:e.width*t,height:e.height*i}},y=function(t,i){return b(t,t,i)},x=function(t){return{width:Math.floor(t.width),height:Math.floor(t.height)}},M=function(t){return{x:t.width/2,y:t.height/2}};function S(t,i){return void 0===i&&(i=l()),w(i,t)}var C,E=Object.freeze({__proto__:null,area:function(t){return t.width*t.height},aspectRatio:function(t){return t.width/t.height},center:M,containFit:function(t,i){var e=function(t,i){var e=y(Math.min(t.width/i.width,t.height/i.height),i);return w(u(A(t),M(e)),e)}(S(t),S(i));return{width:e.width,height:e.height}},create:v,cropFit:function(t,i){var e=function(t,i){var e=y(Math.max(t.width/i.width,t.height/i.height),i);return w(u(A(t),M(e)),e)}(S(t),S(i));return{width:e.width,height:e.height}},fitToRatio:function(t,i){return i.width>=i.height*t?v(i.height*t,i.height):v(i.width,i.width/t)},floor:x,isEqual:function(t,i){return t.width===i.width&&t.height===i.height},proportionalScale:y,round:function(t){return{width:Math.round(t.width),height:Math.round(t.height)}},scale:b,scaleFit:function(t,i){var e=function(t,i){var e=Math.min(Math.sqrt(t/function(t){return t.width*t.height}(i)),1),s=x(y(e,i));return w(u(A(i),M(s)),s)}(t,S(i));return{width:e.width,height:e.height}},square:function(t){return v(t,t)},toRectangle:S,trim:function(t,i){return{width:Math.min(t.width,i.width),height:Math.min(t.height,i.height)}}}),k={exports:{}},T=(C||(C=1,function(t){!function(){var i={}.hasOwnProperty;function e(){for(var t="",i=0;i<arguments.length;i++){var e=arguments[i];e&&(t=n(t,s(e)))}return t}function s(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return e.apply(null,t);if(t.toString!==Object.prototype.toString&&!(""+t.toString).includes("[native code]"))return""+t;var s="";for(var r in t)i.call(t,r)&&t[r]&&(s=n(s,r));return s}function n(t,i){return i?t?t+" "+i:t+i:t}t.exports?(e.default=e,t.exports=e):window.classNames=e}()}(k)),k.exports),P=o(T);class D{constructor(t){this.apiSupportsLayers=!1,function(t){return null!=t&&"function"==typeof t.getLayers&&"function"==typeof t.setLayerVisibility}(t)&&(this.apiSupportsLayers=!0,this.api=t)}get enabled(){return this.apiSupportsLayers}async getLayers(){return this.getApi().getLayers()}async setLayerVisibility(t,i){return this.getApi().setLayerVisibility(t,i)}getApi(){if(null==this.api)throw Error("The current document does not support layers.");return this.api}}function I(t){return Array.from(t.querySelectorAll("*"))}class R{constructor(t,i,e){this.element=t,this.hostElement=i,this.api=e,this.isDragging=!1,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleWheel=this.handleWheel.bind(this),this.element.addEventListener("pointerdown",this.handlePointerDown),this.element.addEventListener("wheel",this.handleWheel),this.hostElement.addEventListener("wheel",this.handleWheel)}dispose(){this.element.removeEventListener("pointerdown",this.handlePointerDown),this.element.removeEventListener("wheel",this.handleWheel),this.hostElement.removeEventListener("wheel",this.handleWheel),this.removeWindowListeners()}handleWheel(t){t.preventDefault();const i=-t.deltaX/2,e=-t.deltaY/2;0===i&&0===e||this.api.panByDelta(m.create(i,e))}handlePointerDown(t){
|
|
4
|
+
import{t,p as i,H as e,d as s,h as n,e as r}from"./p-jUMoJLks.js";function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var h=function(t,i){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},h(t,i)},a=function(){return a=Object.assign||function(t){for(var i,e=1,s=arguments.length;e<s;e++)for(var n in i=arguments[e])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t},a.apply(this,arguments)};function c(t,i,e){return(e=function(t){return Math.max(0,Math.min(1,t))}(e))*(i-t)+t}function l(t,i){return void 0===t&&(t=0),void 0===i&&(i=0),{x:t,y:i}}function u(t,i){return{x:t.x-i.x,y:t.y-i.y}}function d(t,i){return{x:t.x*i,y:t.y*i}}function f(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function p(t){var i=f(t);return 0===i?l(0,0):d(t,1/i)}function g(t,i){return p(u(i,t))}"function"==typeof SuppressedError&&SuppressedError;var m=Object.freeze({__proto__:null,add:function(t,i){return{x:t.x+i.x,y:t.y+i.y}},create:l,distance:function(t,i){var e=u(t,i);return Math.sqrt(e.x*e.x+e.y*e.y)},fromJson:function(t){var i=JSON.parse(t);return Array.isArray(i)?l(i[0],i[1]):l(i.x,i.y)},isEqual:function(t,i){return t.x===i.x&&t.y===i.y},lerp:function(t,i,e){return{x:c(t.x,i.x,e),y:c(t.y,i.y,e)}},magnitude:f,negate:function(t){return l(-t.x,-t.y)},normalDirectionVector:g,normalizeVector:p,orthogonalVector:function(t,i){var e=g(t,i);return 0===e.x||0===e.y?l(-1*e.y,e.x):p(Math.abs(e.x)>Math.abs(e.y)?l(1-Math.pow(e.x,2),-1*e.x*e.y):l(-1*e.x*e.y,1-Math.pow(e.y,2)))},polar:function(t,i){return l(Math.cos(i)*t,Math.sin(i)*t)},scale:function(t,i,e){return{x:t.x*i,y:t.y*e}},scaleProportional:d,subtract:u});function w(t,i){return function(t,i,e,s){return{x:t,y:i,width:e,height:s}}(t.x,t.y,i.width,i.height)}function A(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}var v=function(t,i){return{width:t,height:i}},b=function(t,i,e){return{width:e.width*t,height:e.height*i}},y=function(t,i){return b(t,t,i)},x=function(t){return{width:Math.floor(t.width),height:Math.floor(t.height)}},M=function(t){return{x:t.width/2,y:t.height/2}};function S(t,i){return void 0===i&&(i=l()),w(i,t)}var C,E=Object.freeze({__proto__:null,area:function(t){return t.width*t.height},aspectRatio:function(t){return t.width/t.height},center:M,containFit:function(t,i){var e=function(t,i){var e=y(Math.min(t.width/i.width,t.height/i.height),i);return w(u(A(t),M(e)),e)}(S(t),S(i));return{width:e.width,height:e.height}},create:v,cropFit:function(t,i){var e=function(t,i){var e=y(Math.max(t.width/i.width,t.height/i.height),i);return w(u(A(t),M(e)),e)}(S(t),S(i));return{width:e.width,height:e.height}},fitToRatio:function(t,i){return i.width>=i.height*t?v(i.height*t,i.height):v(i.width,i.width/t)},floor:x,isEqual:function(t,i){return t.width===i.width&&t.height===i.height},proportionalScale:y,round:function(t){return{width:Math.round(t.width),height:Math.round(t.height)}},scale:b,scaleFit:function(t,i){var e=function(t,i){var e=Math.min(Math.sqrt(t/function(t){return t.width*t.height}(i)),1),s=x(y(e,i));return w(u(A(i),M(s)),s)}(t,S(i));return{width:e.width,height:e.height}},square:function(t){return v(t,t)},toRectangle:S,trim:function(t,i){return{width:Math.min(t.width,i.width),height:Math.min(t.height,i.height)}}}),k={exports:{}},T=(C||(C=1,function(t){!function(){var i={}.hasOwnProperty;function e(){for(var t="",i=0;i<arguments.length;i++){var e=arguments[i];e&&(t=n(t,s(e)))}return t}function s(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return e.apply(null,t);if(t.toString!==Object.prototype.toString&&!(""+t.toString).includes("[native code]"))return""+t;var s="";for(var r in t)i.call(t,r)&&t[r]&&(s=n(s,r));return s}function n(t,i){return i?t?t+" "+i:t+i:t}t.exports?(e.default=e,t.exports=e):window.classNames=e}()}(k)),k.exports),P=o(T);class D{constructor(t){this.apiSupportsLayers=!1,function(t){return null!=t&&"function"==typeof t.getLayers&&"function"==typeof t.setLayerVisibility}(t)&&(this.apiSupportsLayers=!0,this.api=t)}get enabled(){return this.apiSupportsLayers}async getLayers(){return this.getApi().getLayers()}async setLayerVisibility(t,i){return this.getApi().setLayerVisibility(t,i)}getApi(){if(null==this.api)throw Error("The current document does not support layers.");return this.api}}function I(t){return Array.from(t.querySelectorAll("*"))}class R{constructor(t,i,e){this.element=t,this.hostElement=i,this.api=e,this.isDragging=!1,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleWheel=this.handleWheel.bind(this),this.element.addEventListener("pointerdown",this.handlePointerDown),this.element.addEventListener("wheel",this.handleWheel),this.hostElement.addEventListener("wheel",this.handleWheel)}dispose(){this.element.removeEventListener("pointerdown",this.handlePointerDown),this.element.removeEventListener("wheel",this.handleWheel),this.hostElement.removeEventListener("wheel",this.handleWheel),this.removeWindowListeners()}handleWheel(t){t.preventDefault();const i=-t.deltaX/2,e=-t.deltaY/2;0===i&&0===e||this.api.panByDelta(m.create(i,e))}handlePointerDown(t){2===t.button&&(t.preventDefault(),this.downPosition=m.create(t.clientX,t.clientY),this.lastPosition=this.downPosition,this.isDragging=!1,window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp))}handlePointerMove(t){if(null==this.lastPosition||null==this.downPosition)return;const i=m.create(t.clientX,t.clientY);if(!this.isDragging&&m.distance(i,this.downPosition)<2)return;this.isDragging=!0;const e=m.subtract(i,this.lastPosition);this.lastPosition=i,this.api.panByDelta(e)}handlePointerUp(){this.lastPosition=void 0,this.downPosition=void 0,this.isDragging=!1,this.removeWindowListeners()}removeWindowListeners(){window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp)}}
|
|
5
5
|
/**
|
|
6
6
|
* @licstart The following is the entire license notice for the
|
|
7
7
|
* JavaScript code in this page
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2026 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import{p as e,g as n,b as o}from"./p-Y59A72pl.js";export{s as setNonce}from"./p-Y59A72pl.js";(()=>{const n=import.meta.url,o={};return""!==n&&(o.resourcesUrl=new URL(".",n).href),e(o)})().then((async e=>(await n(),o([["p-
|
|
4
|
+
import{p as e,g as n,b as o}from"./p-Y59A72pl.js";export{s as setNonce}from"./p-Y59A72pl.js";(()=>{const n=import.meta.url,o={};return""!==n&&(o.resourcesUrl=new URL(".",n).href),e(o)})().then((async e=>(await n(),o([["p-17d333ec",[[257,"vertex-document-viewer",{src:[1],documentId:[513,"document-id"],provider:[1040],interactionMode:[1,"interaction-mode"],documentState:[1040],layers:[1040],config:[16],resizeDebounce:[2,"resize-debounce"],registerBasicInteractionHandler:[64],panByDelta:[64],zoomTo:[64],loadPage:[64]},null,{src:[{handleSrcChange:0}],config:[{handleConfigChange:0}],interactionMode:[{handleInteractionModeChange:0}]}]]]],e))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2026 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as e,h as i,H as s,a as n}from"./p-Y59A72pl.js";function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},o(t,e)},h=function(){return h=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},h.apply(this,arguments)};function a(t,e,i){return(i=Math.max(0,Math.min(1,i)))*(e-t)+t}function c(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),{x:t,y:e}}function l(t,e){return{x:t.x-e.x,y:t.y-e.y}}function u(t,e){return{x:t.x*e,y:t.y*e}}function d(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function f(t){var e=d(t);return 0===e?c(0,0):u(t,1/e)}function p(t,e){return f(l(e,t))}"function"==typeof SuppressedError&&SuppressedError;var g=Object.freeze({__proto__:null,add:function(t,e){return{x:t.x+e.x,y:t.y+e.y}},create:c,distance:function(t,e){var i=l(t,e);return Math.sqrt(i.x*i.x+i.y*i.y)},fromJson:function(t){var e=JSON.parse(t);return Array.isArray(e)?c(e[0],e[1]):c(e.x,e.y)},isEqual:function(t,e){return t.x===e.x&&t.y===e.y},lerp:function(t,e,i){return{x:a(t.x,e.x,i),y:a(t.y,e.y,i)}},magnitude:d,negate:function(t){return c(-t.x,-t.y)},normalDirectionVector:p,normalizeVector:f,orthogonalVector:function(t,e){var i=p(t,e);return 0===i.x||0===i.y?c(-1*i.y,i.x):Math.abs(i.x)>Math.abs(i.y)?f(c(1-Math.pow(i.x,2),-1*i.x*i.y)):f(c(-1*i.x*i.y,1-Math.pow(i.y,2)))},polar:function(t,e){return c(Math.cos(e)*t,Math.sin(e)*t)},scale:function(t,e,i){return{x:t.x*e,y:t.y*i}},scaleProportional:u,subtract:l});function m(t,e){return{x:t.x,y:t.y,width:e.width,height:e.height}}function w(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}var A=function(t,e){return{width:t,height:e}},v=function(t,e,i){return{width:i.width*t,height:i.height*e}},b=function(t,e){return v(t,t,e)},y=function(t){return{width:Math.floor(t.width),height:Math.floor(t.height)}},x=function(t){return{x:t.width/2,y:t.height/2}};function M(t,e){return void 0===e&&(e=c()),m(e,t)}var S,C,E=Object.freeze({__proto__:null,area:function(t){return t.width*t.height},aspectRatio:function(t){return t.width/t.height},center:x,containFit:function(t,e){var i=function(t,e){var i=Math.min(t.width/e.width,t.height/e.height),s=b(i,e);return m(l(w(t),x(s)),s)}(M(t),M(e));return{width:i.width,height:i.height}},create:A,cropFit:function(t,e){var i=function(t,e){var i=Math.max(t.width/e.width,t.height/e.height),s=b(i,e);return m(l(w(t),x(s)),s)}(M(t),M(e));return{width:i.width,height:i.height}},fitToRatio:function(t,e){return e.width>=e.height*t?A(e.height*t,e.height):A(e.width,e.width/t)},floor:y,isEqual:function(t,e){return t.width===e.width&&t.height===e.height},proportionalScale:b,round:function(t){return{width:Math.round(t.width),height:Math.round(t.height)}},scale:v,scaleFit:function(t,e){var i=function(t,e){var i=Math.min(Math.sqrt(t/function(t){return t.width*t.height}(e)),1),s=y(b(i,e));return m(l(w(e),x(s)),s)}(t,M(e));return{width:i.width,height:i.height}},square:function(t){return A(t,t)},toRectangle:M,trim:function(t,e){return{width:Math.min(t.width,e.width),height:Math.min(t.height,e.height)}}}),k={exports:{}},T=(S||(S=1,C=k,function(){var t={}.hasOwnProperty;function e(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=s(t,i(n)))}return t}function i(i){if("string"==typeof i||"number"==typeof i)return i;if("object"!=typeof i)return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var n="";for(var r in i)t.call(i,r)&&i[r]&&(n=s(n,r));return n}function s(t,e){return e?t?t+" "+e:t+e:t}C.exports?(e.default=e,C.exports=e):window.classNames=e}()),k.exports),P=r(T);class D{constructor(t){this.apiSupportsLayers=!1,function(t){return null!=t&&"function"==typeof t.getLayers&&"function"==typeof t.setLayerVisibility}(t)&&(this.apiSupportsLayers=!0,this.api=t)}get enabled(){return this.apiSupportsLayers}async getLayers(){return this.getApi().getLayers()}async setLayerVisibility(t,e){return this.getApi().setLayerVisibility(t,e)}getApi(){if(null==this.api)throw new Error("The current document does not support layers.");return this.api}}function I(t){return Array.from(t.querySelectorAll("*"))}class R{constructor(t,e,i){this.element=t,this.hostElement=e,this.api=i,this.isDragging=!1,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleWheel=this.handleWheel.bind(this),this.element.addEventListener("pointerdown",this.handlePointerDown),this.element.addEventListener("wheel",this.handleWheel),this.hostElement.addEventListener("wheel",this.handleWheel)}dispose(){this.element.removeEventListener("pointerdown",this.handlePointerDown),this.element.removeEventListener("wheel",this.handleWheel),this.hostElement.removeEventListener("wheel",this.handleWheel),this.removeWindowListeners()}handleWheel(t){t.preventDefault();const e=-t.deltaX/2,i=-t.deltaY/2;0===e&&0===i||this.api.panByDelta(g.create(e,i))}handlePointerDown(t){
|
|
4
|
+
import{r as t,c as e,h as i,H as s,a as n}from"./p-Y59A72pl.js";function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},o(t,e)},h=function(){return h=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},h.apply(this,arguments)};function a(t,e,i){return(i=Math.max(0,Math.min(1,i)))*(e-t)+t}function c(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),{x:t,y:e}}function l(t,e){return{x:t.x-e.x,y:t.y-e.y}}function u(t,e){return{x:t.x*e,y:t.y*e}}function d(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function f(t){var e=d(t);return 0===e?c(0,0):u(t,1/e)}function p(t,e){return f(l(e,t))}"function"==typeof SuppressedError&&SuppressedError;var g=Object.freeze({__proto__:null,add:function(t,e){return{x:t.x+e.x,y:t.y+e.y}},create:c,distance:function(t,e){var i=l(t,e);return Math.sqrt(i.x*i.x+i.y*i.y)},fromJson:function(t){var e=JSON.parse(t);return Array.isArray(e)?c(e[0],e[1]):c(e.x,e.y)},isEqual:function(t,e){return t.x===e.x&&t.y===e.y},lerp:function(t,e,i){return{x:a(t.x,e.x,i),y:a(t.y,e.y,i)}},magnitude:d,negate:function(t){return c(-t.x,-t.y)},normalDirectionVector:p,normalizeVector:f,orthogonalVector:function(t,e){var i=p(t,e);return 0===i.x||0===i.y?c(-1*i.y,i.x):Math.abs(i.x)>Math.abs(i.y)?f(c(1-Math.pow(i.x,2),-1*i.x*i.y)):f(c(-1*i.x*i.y,1-Math.pow(i.y,2)))},polar:function(t,e){return c(Math.cos(e)*t,Math.sin(e)*t)},scale:function(t,e,i){return{x:t.x*e,y:t.y*i}},scaleProportional:u,subtract:l});function m(t,e){return{x:t.x,y:t.y,width:e.width,height:e.height}}function w(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}var A=function(t,e){return{width:t,height:e}},v=function(t,e,i){return{width:i.width*t,height:i.height*e}},b=function(t,e){return v(t,t,e)},y=function(t){return{width:Math.floor(t.width),height:Math.floor(t.height)}},x=function(t){return{x:t.width/2,y:t.height/2}};function M(t,e){return void 0===e&&(e=c()),m(e,t)}var S,C,E=Object.freeze({__proto__:null,area:function(t){return t.width*t.height},aspectRatio:function(t){return t.width/t.height},center:x,containFit:function(t,e){var i=function(t,e){var i=Math.min(t.width/e.width,t.height/e.height),s=b(i,e);return m(l(w(t),x(s)),s)}(M(t),M(e));return{width:i.width,height:i.height}},create:A,cropFit:function(t,e){var i=function(t,e){var i=Math.max(t.width/e.width,t.height/e.height),s=b(i,e);return m(l(w(t),x(s)),s)}(M(t),M(e));return{width:i.width,height:i.height}},fitToRatio:function(t,e){return e.width>=e.height*t?A(e.height*t,e.height):A(e.width,e.width/t)},floor:y,isEqual:function(t,e){return t.width===e.width&&t.height===e.height},proportionalScale:b,round:function(t){return{width:Math.round(t.width),height:Math.round(t.height)}},scale:v,scaleFit:function(t,e){var i=function(t,e){var i=Math.min(Math.sqrt(t/function(t){return t.width*t.height}(e)),1),s=y(b(i,e));return m(l(w(e),x(s)),s)}(t,M(e));return{width:i.width,height:i.height}},square:function(t){return A(t,t)},toRectangle:M,trim:function(t,e){return{width:Math.min(t.width,e.width),height:Math.min(t.height,e.height)}}}),k={exports:{}},T=(S||(S=1,C=k,function(){var t={}.hasOwnProperty;function e(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=s(t,i(n)))}return t}function i(i){if("string"==typeof i||"number"==typeof i)return i;if("object"!=typeof i)return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var n="";for(var r in i)t.call(i,r)&&i[r]&&(n=s(n,r));return n}function s(t,e){return e?t?t+" "+e:t+e:t}C.exports?(e.default=e,C.exports=e):window.classNames=e}()),k.exports),P=r(T);class D{constructor(t){this.apiSupportsLayers=!1,function(t){return null!=t&&"function"==typeof t.getLayers&&"function"==typeof t.setLayerVisibility}(t)&&(this.apiSupportsLayers=!0,this.api=t)}get enabled(){return this.apiSupportsLayers}async getLayers(){return this.getApi().getLayers()}async setLayerVisibility(t,e){return this.getApi().setLayerVisibility(t,e)}getApi(){if(null==this.api)throw new Error("The current document does not support layers.");return this.api}}function I(t){return Array.from(t.querySelectorAll("*"))}class R{constructor(t,e,i){this.element=t,this.hostElement=e,this.api=i,this.isDragging=!1,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleWheel=this.handleWheel.bind(this),this.element.addEventListener("pointerdown",this.handlePointerDown),this.element.addEventListener("wheel",this.handleWheel),this.hostElement.addEventListener("wheel",this.handleWheel)}dispose(){this.element.removeEventListener("pointerdown",this.handlePointerDown),this.element.removeEventListener("wheel",this.handleWheel),this.hostElement.removeEventListener("wheel",this.handleWheel),this.removeWindowListeners()}handleWheel(t){t.preventDefault();const e=-t.deltaX/2,i=-t.deltaY/2;0===e&&0===i||this.api.panByDelta(g.create(e,i))}handlePointerDown(t){2===t.button&&(t.preventDefault(),this.downPosition=g.create(t.clientX,t.clientY),this.lastPosition=this.downPosition,this.isDragging=!1,window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp))}handlePointerMove(t){if(null==this.lastPosition||null==this.downPosition)return;const e=g.create(t.clientX,t.clientY);if(!this.isDragging&&g.distance(e,this.downPosition)<2)return;this.isDragging=!0;const i=g.subtract(e,this.lastPosition);this.lastPosition=e,this.api.panByDelta(i)}handlePointerUp(){this.lastPosition=void 0,this.downPosition=void 0,this.isDragging=!1,this.removeWindowListeners()}removeWindowListeners(){window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp)}}
|
|
5
5
|
/**
|
|
6
6
|
* @licstart The following is the entire license notice for the
|
|
7
7
|
* JavaScript code in this page
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertexvis/doc-viewer",
|
|
3
|
-
"version": "1.0.2-canary.
|
|
3
|
+
"version": "1.0.2-canary.3",
|
|
4
4
|
"description": "The Vertex SDK for viewing documents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
"typescript": "~5.9.3"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@vertexvis/geometry": "1.0.2-canary.
|
|
99
|
-
"@vertexvis/utils": "1.0.2-canary.
|
|
98
|
+
"@vertexvis/geometry": "1.0.2-canary.3",
|
|
99
|
+
"@vertexvis/utils": "1.0.2-canary.3",
|
|
100
100
|
"classnames": "^2.5.1",
|
|
101
101
|
"pdfjs-dist": "^5.5.207",
|
|
102
102
|
"resize-observer": "^1.0.4"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "7b1eeec6855c6f1255e6a6f5a29e234e6b792ad1"
|
|
105
105
|
}
|