@vertexvis/viewer 1.0.2-canary.1 → 1.0.2-canary.2
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/index.cjs.js +1 -1
- package/dist/cjs/{multiElementInteractionHandler-DCKBIy58.js → multiElementInteractionHandler-BHvRKVIp.js} +20 -21
- package/dist/cjs/multiElementInteractionHandler-BHvRKVIp.js.map +1 -0
- package/dist/cjs/{queries-XG1IeRYE.js → queries-Da9I-xMf.js} +12 -12
- package/dist/cjs/queries-Da9I-xMf.js.map +1 -0
- package/dist/cjs/vertex-viewer-dom-element_2.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-teleport-tool.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-teleport-tool.cjs.entry.js.map +1 -1
- package/dist/cjs/vertex-viewer.cjs.entry.js +27 -18
- package/dist/cjs/vertex-viewer.cjs.entry.js.map +1 -1
- package/dist/collection/lib/interactions/baseInteractionHandler.js +18 -19
- package/dist/collection/lib/interactions/baseInteractionHandler.js.map +1 -1
- package/dist/collection/lib/interactions/interactionApi.js +17 -8
- package/dist/collection/lib/interactions/interactionApi.js.map +1 -1
- package/dist/collection/lib/interactions/mouseInteractions.js +8 -8
- package/dist/collection/lib/interactions/mouseInteractions.js.map +1 -1
- package/dist/collection/lib/scenes/camera.js +10 -10
- package/dist/collection/lib/scenes/camera.js.map +1 -1
- package/dist/collection/lib/teleportation/interactions.js +1 -1
- package/dist/collection/lib/teleportation/interactions.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-BR7cFxzj.js → p-3DqRAYgO.js} +2 -2
- package/dist/components/p-3DqRAYgO.js.map +1 -0
- package/dist/components/{p-Bkhr6gno.js → p-BCOD9yfw.js} +2 -2
- package/dist/components/p-CAugdB_8.js +5 -0
- package/dist/components/p-CAugdB_8.js.map +1 -0
- package/dist/components/p-CGCJ5hbJ.js +5 -0
- package/dist/components/p-CGCJ5hbJ.js.map +1 -0
- package/dist/components/vertex-viewer-dom-renderer.js +1 -1
- package/dist/components/vertex-viewer-pin-tool.js +1 -1
- package/dist/components/vertex-viewer-teleport-tool.js +1 -1
- package/dist/components/vertex-viewer-view-cube.js +1 -1
- package/dist/components/vertex-viewer-walk-mode-tool.js +1 -1
- package/dist/components/vertex-viewer.js +1 -1
- package/dist/components/vertex-viewer.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{multiElementInteractionHandler-C3A6SPxu.js → multiElementInteractionHandler-DwjL-r55.js} +20 -21
- package/dist/esm/multiElementInteractionHandler-DwjL-r55.js.map +1 -0
- package/dist/esm/{queries-CsBLqW1v.js → queries-DEzCmbTD.js} +12 -12
- package/dist/esm/queries-DEzCmbTD.js.map +1 -0
- package/dist/esm/vertex-viewer-dom-element_2.entry.js +1 -1
- package/dist/esm/vertex-viewer-teleport-tool.entry.js +1 -1
- package/dist/esm/vertex-viewer-teleport-tool.entry.js.map +1 -1
- package/dist/esm/vertex-viewer.entry.js +27 -18
- package/dist/esm/vertex-viewer.entry.js.map +1 -1
- package/dist/types/lib/interactions/baseInteractionHandler.d.ts +1 -1
- package/dist/types/lib/interactions/interactionApi.d.ts +2 -2
- package/dist/types/lib/interactions/mouseInteractions.d.ts +2 -2
- package/dist/types/lib/scenes/camera.d.ts +1 -0
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/p-07b99ac9.entry.js +5 -0
- package/dist/viewer/p-07b99ac9.entry.js.map +1 -0
- package/dist/viewer/{p-5ced98d5.entry.js → p-29d14611.entry.js} +2 -2
- package/dist/viewer/{p-72a0588f.entry.js → p-89544066.entry.js} +2 -2
- package/dist/viewer/p-89544066.entry.js.map +1 -0
- package/dist/viewer/p-D6eJC1q4.js +5 -0
- package/dist/viewer/p-D6eJC1q4.js.map +1 -0
- package/dist/viewer/{p-5U-3M0jx.js → p-EsKoKfmx.js} +2 -2
- package/dist/viewer/p-EsKoKfmx.js.map +1 -0
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +7 -7
- package/dist/cjs/multiElementInteractionHandler-DCKBIy58.js.map +0 -1
- package/dist/cjs/queries-XG1IeRYE.js.map +0 -1
- package/dist/components/p-BQrJ-Yrs.js +0 -5
- package/dist/components/p-BQrJ-Yrs.js.map +0 -1
- package/dist/components/p-BR7cFxzj.js.map +0 -1
- package/dist/components/p-DizXmW54.js +0 -5
- package/dist/components/p-DizXmW54.js.map +0 -1
- package/dist/esm/multiElementInteractionHandler-C3A6SPxu.js.map +0 -1
- package/dist/esm/queries-CsBLqW1v.js.map +0 -1
- package/dist/viewer/p-5U-3M0jx.js.map +0 -1
- package/dist/viewer/p-72a0588f.entry.js.map +0 -1
- package/dist/viewer/p-77a0c7b7.entry.js +0 -5
- package/dist/viewer/p-77a0c7b7.entry.js.map +0 -1
- package/dist/viewer/p-CxLXWk2n.js +0 -5
- package/dist/viewer/p-CxLXWk2n.js.map +0 -1
- /package/dist/components/{p-Bkhr6gno.js.map → p-BCOD9yfw.js.map} +0 -0
- /package/dist/viewer/{p-5ced98d5.entry.js.map → p-29d14611.entry.js.map} +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2026 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
export { C as Camera, c as ColorMaterial, a as CrossSectioner, I as ItemOperationBuilder, l as LoadableResource, M as ModelViewController, P as PmiAnnotationOperationsBuilder, b as PmiAnnotationsQueryExecutor, k as PmiController, R as Raycaster, d as RootQuery, S as Scene, e as SceneElementQueryExecutor, f as SceneElementsOperationExecutor, g as SceneItemOperationsBuilder, h as SceneItemQueryExecutor, i as SceneItemsOperationExecutor, s as SceneViewStateIdentifier, j as SynchronizedClock } from './queries-
|
|
4
|
+
export { C as Camera, c as ColorMaterial, a as CrossSectioner, I as ItemOperationBuilder, l as LoadableResource, M as ModelViewController, P as PmiAnnotationOperationsBuilder, b as PmiAnnotationsQueryExecutor, k as PmiController, R as Raycaster, d as RootQuery, S as Scene, e as SceneElementQueryExecutor, f as SceneElementsOperationExecutor, g as SceneItemOperationsBuilder, h as SceneItemQueryExecutor, i as SceneItemsOperationExecutor, s as SceneViewStateIdentifier, j as SynchronizedClock } from './queries-DEzCmbTD.js';
|
|
5
5
|
export { S as SceneTreeController } from './controller-BMWGs-I6.js';
|
|
6
6
|
export { f as fromNodeProto, i as isLoadedRow } from './row-CiSHWNC4.js';
|
|
7
7
|
export { S as SCENE_ITEM_NAME_METADATA_KEY } from './types-BZwvQkyb.js';
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2026 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
export { C as Camera, c as ColorMaterial, a as CrossSectioner, I as ItemOperationBuilder, l as LoadableResource, M as ModelViewController, P as PmiAnnotationOperationsBuilder, b as PmiAnnotationsQueryExecutor, k as PmiController, R as Raycaster, d as RootQuery, S as Scene, e as SceneElementQueryExecutor, f as SceneElementsOperationExecutor, g as SceneItemOperationsBuilder, h as SceneItemQueryExecutor, i as SceneItemsOperationExecutor, s as SceneViewStateIdentifier, j as SynchronizedClock } from './queries-
|
|
4
|
+
export { C as Camera, c as ColorMaterial, a as CrossSectioner, I as ItemOperationBuilder, l as LoadableResource, M as ModelViewController, P as PmiAnnotationOperationsBuilder, b as PmiAnnotationsQueryExecutor, k as PmiController, R as Raycaster, d as RootQuery, S as Scene, e as SceneElementQueryExecutor, f as SceneElementsOperationExecutor, g as SceneItemOperationsBuilder, h as SceneItemQueryExecutor, i as SceneItemsOperationExecutor, s as SceneViewStateIdentifier, j as SynchronizedClock } from './queries-DEzCmbTD.js';
|
|
5
5
|
export { S as SceneTreeController } from './controller-BMWGs-I6.js';
|
|
6
6
|
export { f as fromNodeProto, i as isLoadedRow } from './row-CiSHWNC4.js';
|
|
7
7
|
export { S as SCENE_ITEM_NAME_METADATA_KEY } from './types-BZwvQkyb.js';
|
|
@@ -261,31 +261,30 @@ class BaseInteractionHandler {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
wheelDeltaToPixels(deltaY, deltaMode) {
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
// Cached values are an optimization we can use given mouseWheel
|
|
265
|
+
// events can happen dozen or hundreds of times per scroll, but body style
|
|
266
|
+
// is very unlikely to change frequently or while doing wheel movements.
|
|
267
|
+
if (this.bodyStyleCache == null) {
|
|
268
|
+
const bodyStyle = window.getComputedStyle(document.body);
|
|
269
|
+
this.bodyStyleCache = {
|
|
270
|
+
fontSize: parseFloat(bodyStyle.getPropertyValue('fontSize')) ||
|
|
271
|
+
DEFAULT_FONT_SIZE,
|
|
272
|
+
lineHeight: parseFloat(bodyStyle.getPropertyValue('lineHeight')) ||
|
|
273
|
+
DEFAULT_LINE_HEIGHT,
|
|
274
|
+
height: parseFloat(bodyStyle.getPropertyValue('height')) ||
|
|
275
|
+
window.innerHeight,
|
|
276
|
+
};
|
|
277
|
+
window.setTimeout(() => {
|
|
278
|
+
this.bodyStyleCache = undefined;
|
|
279
|
+
}, 4800); // For now hardcoded. Could be derived. eg mouseWheelInteractionEndDebounce * 12
|
|
266
280
|
}
|
|
267
|
-
const defaultLineHeight = this.computedBodyStyle.getPropertyValue('fontSize') != null &&
|
|
268
|
-
this.computedBodyStyle.getPropertyValue('fontSize') !== '' &&
|
|
269
|
-
!isNaN(parseFloat(this.computedBodyStyle.getPropertyValue('fontSize')))
|
|
270
|
-
? parseFloat(this.computedBodyStyle.getPropertyValue('fontSize')) *
|
|
271
|
-
DEFAULT_LINE_HEIGHT
|
|
272
|
-
: DEFAULT_FONT_SIZE * DEFAULT_LINE_HEIGHT;
|
|
273
281
|
if (deltaMode === 1) {
|
|
274
282
|
// deltaMode 1 corresponds to DOM_DELTA_LINE, which computes deltas in lines
|
|
275
|
-
return this.
|
|
276
|
-
this.computedBodyStyle.getPropertyValue('lineHeight') !== '' &&
|
|
277
|
-
!isNaN(parseFloat(this.computedBodyStyle.getPropertyValue('lineHeight')))
|
|
278
|
-
? deltaY *
|
|
279
|
-
parseFloat(this.computedBodyStyle.getPropertyValue('lineHeight'))
|
|
280
|
-
: deltaY * defaultLineHeight;
|
|
283
|
+
return (deltaY * (this.bodyStyleCache.fontSize * this.bodyStyleCache.lineHeight));
|
|
281
284
|
}
|
|
282
285
|
else if (deltaMode === 2) {
|
|
283
286
|
// deltaMode 2 corresponds to DOM_DELTA_PAGE, which computes deltas in pages
|
|
284
|
-
return this.
|
|
285
|
-
this.computedBodyStyle.getPropertyValue('height') !== '' &&
|
|
286
|
-
!isNaN(parseFloat(this.computedBodyStyle.getPropertyValue('height')))
|
|
287
|
-
? deltaY * parseFloat(this.computedBodyStyle.getPropertyValue('height'))
|
|
288
|
-
: deltaY * window.innerHeight;
|
|
287
|
+
return deltaY * this.bodyStyleCache.height;
|
|
289
288
|
}
|
|
290
289
|
// deltaMode 0 corresponds to DOM_DELTA_PIXEL, which computes deltas in pixels
|
|
291
290
|
return deltaY;
|
|
@@ -329,6 +328,6 @@ class MultiElementInteractionHandler extends BaseInteractionHandler {
|
|
|
329
328
|
}
|
|
330
329
|
|
|
331
330
|
export { BaseInteractionHandler as B, MultiElementInteractionHandler as M };
|
|
332
|
-
//# sourceMappingURL=multiElementInteractionHandler-
|
|
331
|
+
//# sourceMappingURL=multiElementInteractionHandler-DwjL-r55.js.map
|
|
333
332
|
|
|
334
|
-
//# sourceMappingURL=multiElementInteractionHandler-
|
|
333
|
+
//# sourceMappingURL=multiElementInteractionHandler-DwjL-r55.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiElementInteractionHandler-DwjL-r55.js","sources":["src/lib/interactions/baseInteractionHandler.ts","src/lib/interactions/multiElementInteractionHandler.ts"],"sourcesContent":["import { Point } from '@vertexvis/geometry';\nimport { Disposable, EventDispatcher, Listener } from '@vertexvis/utils';\n\nimport { ConfigProvider } from '../config';\nimport { getMouseClientPosition } from '../dom';\nimport { InteractionApi } from './interactionApi';\nimport { BaseEvent } from './interactionEvent';\nimport { InteractionHandler } from './interactionHandler';\nimport {\n MouseInteraction,\n PanInteraction,\n PivotInteraction,\n RotateInteraction,\n RotatePointInteraction,\n TwistInteraction,\n ZoomInteraction,\n} from './mouseInteractions';\n\nexport type InteractionType =\n | 'rotate'\n | 'zoom'\n | 'pan'\n | 'twist'\n | 'rotate-point'\n | 'pivot';\n\nconst DEFAULT_FONT_SIZE = 16;\nconst DEFAULT_LINE_HEIGHT = 1.2;\n\nexport abstract class BaseInteractionHandler implements InteractionHandler {\n protected interactionApi?: InteractionApi;\n protected element?: HTMLElement;\n protected downPosition?: Point.Point;\n private downPositionCanvas?: Point.Point;\n private primaryInteraction: MouseInteraction;\n private currentInteraction?: MouseInteraction;\n private draggingInteraction: MouseInteraction | undefined;\n private lastPrimaryRotateInteraction?: MouseInteraction;\n private isDragging = false;\n private lastMoveEvent?: BaseEvent;\n private interactionTimer?: number;\n private keyboardControls = false;\n\n protected disableIndividualInteractions = false;\n\n private bodyStyleCache?: {\n fontSize: number;\n lineHeight: number;\n height: number;\n };\n\n private primaryInteractionTypeChange = new EventDispatcher<void>();\n\n public constructor(\n protected downEvent: 'mousedown' | 'pointerdown',\n protected upEvent: 'mouseup' | 'pointerup',\n protected moveEvent: 'mousemove' | 'pointermove',\n private rotateInteraction: RotateInteraction,\n private rotatePointInteraction: RotatePointInteraction,\n private zoomInteraction: ZoomInteraction,\n private panInteraction: PanInteraction,\n private twistInteraction: TwistInteraction,\n private pivotInteraction: PivotInteraction,\n private getConfig: ConfigProvider\n ) {\n this.primaryInteraction = rotateInteraction;\n this.handleDownEvent = this.handleDownEvent.bind(this);\n this.handleMouseWheel = this.handleMouseWheel.bind(this);\n this.handleWindowMove = this.handleWindowMove.bind(this);\n this.handleWindowUp = this.handleWindowUp.bind(this);\n this.handleDoubleClick = this.handleDoubleClick.bind(this);\n }\n\n public initialize(element: HTMLElement, api: InteractionApi): void {\n this.element = element;\n this.interactionApi = api;\n element.addEventListener(this.downEvent, this.handleDownEvent);\n element.addEventListener('mousedown', this.handleDoubleClick);\n element.addEventListener('wheel', this.handleMouseWheel, {\n passive: false,\n });\n }\n\n public dispose(): void {\n this.element?.removeEventListener(this.downEvent, this.handleDownEvent);\n this.element?.removeEventListener('mousedown', this.handleDoubleClick);\n this.element?.removeEventListener('wheel', this.handleMouseWheel);\n this.element = undefined;\n }\n\n public onPrimaryInteractionTypeChange(listener: Listener<void>): Disposable {\n return this.primaryInteractionTypeChange.on(listener);\n }\n\n public setCurrentInteractionType(type?: InteractionType): void {\n switch (type) {\n case 'rotate':\n this.currentInteraction = this.rotateInteraction;\n break;\n case 'zoom':\n this.currentInteraction = this.zoomInteraction;\n break;\n case 'pan':\n this.currentInteraction = this.panInteraction;\n break;\n case 'twist':\n this.currentInteraction = this.twistInteraction;\n break;\n case 'rotate-point':\n this.currentInteraction = this.rotatePointInteraction;\n break;\n case 'pivot':\n this.currentInteraction = this.pivotInteraction;\n break;\n default:\n this.currentInteraction = undefined;\n }\n\n if (this.draggingInteraction) {\n const point = this.draggingInteraction.getPosition();\n this.draggingInteraction =\n this.currentInteraction || this.primaryInteraction;\n this.interactionApi?.resetLastAngle();\n this.draggingInteraction.setPosition(point);\n }\n }\n\n public getPrimaryInteractionType(): InteractionType {\n return this.primaryInteraction.getType();\n }\n\n public getCurrentInteractionType(): InteractionType {\n return (this.currentInteraction || this.primaryInteraction).getType();\n }\n\n public setPrimaryInteractionType(type: InteractionType): void {\n switch (type) {\n case 'rotate':\n this.primaryInteraction = this.rotateInteraction;\n this.lastPrimaryRotateInteraction = this.rotateInteraction;\n break;\n case 'rotate-point':\n this.primaryInteraction = this.rotatePointInteraction;\n this.lastPrimaryRotateInteraction = this.rotatePointInteraction;\n break;\n case 'zoom':\n this.primaryInteraction = this.zoomInteraction;\n break;\n case 'pan':\n this.primaryInteraction = this.panInteraction;\n break;\n case 'pivot':\n this.primaryInteraction = this.pivotInteraction;\n break;\n }\n this.primaryInteractionTypeChange.emit();\n }\n\n public setDefaultKeyboardControls(keyboardControls: boolean): void {\n this.keyboardControls = keyboardControls;\n }\n\n protected handleDownEvent(event: BaseEvent): void {\n // Prevent selection of any text while interacting with the model.\n event.preventDefault();\n\n this.interactionTimer = window.setTimeout(() => {\n this.downPosition = Point.create(event.screenX, event.screenY);\n this.downPositionCanvas = this.getCanvasPosition(event);\n this.interactionTimer = undefined;\n\n // Perform the current movement in the case that the interaction timer elapses\n if (this.lastMoveEvent != null) {\n this.handleWindowMove(this.lastMoveEvent);\n }\n }, this.getConfig().interactions.interactionDelay);\n\n window.addEventListener(this.moveEvent, this.handleWindowMove);\n window.addEventListener(this.upEvent, this.handleWindowUp);\n }\n\n protected handleWindowMove(event: BaseEvent): void {\n if (this.interactionTimer == null) {\n if (this.disableIndividualInteractions) {\n return;\n }\n\n const position = Point.create(event.screenX, event.screenY);\n const pixelThreshold =\n this.interactionApi != null\n ? this.interactionApi.pixelThreshold(this.isTouch(event))\n : 2;\n if (\n this.downPosition != null &&\n Point.distance(position, this.downPosition) >= pixelThreshold &&\n !this.isDragging\n ) {\n this.beginDrag(event);\n this.isDragging = true;\n }\n\n if (this.isDragging) {\n this.drag(event);\n }\n }\n\n this.lastMoveEvent = event;\n }\n\n protected async handleWindowUp(event: BaseEvent): Promise<void> {\n if (this.isDragging) {\n this.endDrag(event);\n this.isDragging = false;\n }\n\n if (this.interactionTimer != null) {\n window.clearTimeout(this.interactionTimer);\n this.interactionTimer = undefined;\n }\n\n window.removeEventListener(this.moveEvent, this.handleWindowMove);\n window.removeEventListener(this.upEvent, this.handleWindowUp);\n this.lastMoveEvent = undefined;\n }\n\n protected async handleDoubleClick(event: BaseEvent): Promise<void> {\n // event.detail is the number of clicks that have happened recently. If the number is 2, then the user double clicked.\n if (\n event.detail === 2 &&\n event.buttons === 4 &&\n this.interactionApi != null\n ) {\n await this.interactionApi.viewAll();\n }\n }\n\n protected beginDrag(event: BaseEvent): void {\n if (this.keyboardControls && event.metaKey && event.shiftKey) {\n this.currentInteraction = this.rotatePointInteraction;\n } else if (this.keyboardControls && event.shiftKey && event.altKey) {\n this.currentInteraction = this.twistInteraction;\n } else if (this.keyboardControls && event.shiftKey) {\n this.currentInteraction = this.zoomInteraction;\n } else if (this.keyboardControls && (event.metaKey || event.ctrlKey)) {\n this.currentInteraction = this.panInteraction;\n } else if (this.keyboardControls && event.altKey) {\n this.currentInteraction = this.rotateInteraction;\n }\n\n if (event.buttons === 1) {\n this.draggingInteraction =\n this.currentInteraction || this.primaryInteraction;\n } else if (event.buttons === 2) {\n this.draggingInteraction = this.panInteraction;\n } else if (event.buttons === 4) {\n this.draggingInteraction =\n this.lastPrimaryRotateInteraction ?? this.rotateInteraction;\n }\n\n if (\n this.draggingInteraction != null &&\n this.interactionApi != null &&\n this.element != null\n ) {\n // Ensure any scroll wheel interactions have been ended prior to beginning\n // another interaction to prevent the interaction from being ended early.\n this.zoomInteraction.endDrag(event, this.interactionApi);\n\n this.draggingInteraction.beginDrag(\n event,\n this.downPositionCanvas || Point.create(event.clientX, event.clientY),\n this.interactionApi,\n this.element\n );\n }\n }\n\n protected drag(event: BaseEvent): void {\n if (this.keyboardControls && event.altKey && event.shiftKey) {\n this.currentInteraction = this.twistInteraction;\n } else {\n this.currentInteraction = undefined;\n }\n this.draggingInteraction =\n this.currentInteraction ||\n this.draggingInteraction ||\n this.primaryInteraction;\n if (this.draggingInteraction != null && this.interactionApi != null) {\n this.draggingInteraction.drag(event, this.interactionApi);\n }\n }\n\n protected endDrag(event: BaseEvent): void {\n if (\n this.keyboardControls &&\n this.currentInteraction === this.twistInteraction\n ) {\n this.currentInteraction = undefined;\n }\n\n if (this.draggingInteraction != null && this.interactionApi != null) {\n this.draggingInteraction.endDrag(event, this.interactionApi);\n this.draggingInteraction = undefined;\n }\n }\n\n protected handleMouseWheel(event: WheelEvent): void {\n event.preventDefault();\n\n if (\n this.element != null &&\n this.interactionApi != null &&\n event.buttons !== 4\n ) {\n const delta =\n -this.wheelDeltaToPixels(event.deltaY, event.deltaMode) / 10;\n const rect = this.element.getBoundingClientRect();\n const point = getMouseClientPosition(event, rect);\n const scrollSize = Math.abs(event.deltaY);\n\n if (scrollSize < 12) {\n // For small wheel movements, send a single zoom event.\n void this.zoomInteraction.zoomToPoint(\n point,\n delta,\n this.interactionApi\n );\n } else {\n const divisions = Math.min(10, Math.ceil(scrollSize / 12));\n const zoomDelta = delta / divisions;\n // For larger wheel movements, divide the delta into multiple zoom events with increasing delay\n // which approximates a smooth zoom deceleration curve for the end user.\n for (let i = 1; i <= divisions; i++) {\n const delayMs = i * 5;\n window.setTimeout(() => {\n if (this.interactionApi != null) {\n this.zoomInteraction.zoomToPoint(\n point,\n zoomDelta,\n this.interactionApi,\n delayMs\n );\n }\n }, delayMs);\n }\n }\n }\n }\n\n protected wheelDeltaToPixels(deltaY: number, deltaMode: number): number {\n // Cached values are an optimization we can use given mouseWheel\n // events can happen dozen or hundreds of times per scroll, but body style\n // is very unlikely to change frequently or while doing wheel movements.\n if (this.bodyStyleCache == null) {\n const bodyStyle = window.getComputedStyle(document.body);\n this.bodyStyleCache = {\n fontSize:\n parseFloat(bodyStyle.getPropertyValue('fontSize')) ||\n DEFAULT_FONT_SIZE,\n lineHeight:\n parseFloat(bodyStyle.getPropertyValue('lineHeight')) ||\n DEFAULT_LINE_HEIGHT,\n height:\n parseFloat(bodyStyle.getPropertyValue('height')) ||\n window.innerHeight,\n };\n window.setTimeout(() => {\n this.bodyStyleCache = undefined;\n }, 4800); // For now hardcoded. Could be derived. eg mouseWheelInteractionEndDebounce * 12\n }\n\n if (deltaMode === 1) {\n // deltaMode 1 corresponds to DOM_DELTA_LINE, which computes deltas in lines\n return (\n deltaY * (this.bodyStyleCache.fontSize * this.bodyStyleCache.lineHeight)\n );\n } else if (deltaMode === 2) {\n // deltaMode 2 corresponds to DOM_DELTA_PAGE, which computes deltas in pages\n return deltaY * this.bodyStyleCache.height;\n }\n // deltaMode 0 corresponds to DOM_DELTA_PIXEL, which computes deltas in pixels\n return deltaY;\n }\n\n protected getCanvasPosition(event: BaseEvent): Point.Point | undefined {\n const canvasBounds = this.element?.getBoundingClientRect();\n const canvasOffset =\n canvasBounds != null\n ? Point.create(canvasBounds.left, canvasBounds.top)\n : undefined;\n\n return canvasOffset != null\n ? Point.subtract(Point.create(event.clientX, event.clientY), canvasOffset)\n : undefined;\n }\n\n protected isTouch(event: BaseEvent): boolean {\n return window.PointerEvent != null && event instanceof PointerEvent\n ? event.pointerType === 'touch'\n : false;\n }\n}\n","import { Disposable, UUID } from '@vertexvis/utils';\n\nimport { BaseInteractionHandler } from './baseInteractionHandler';\n\nexport abstract class MultiElementInteractionHandler extends BaseInteractionHandler {\n protected registeredExternalElements: Record<UUID.UUID, Disposable> = {};\n\n public registerAdditionalElement(external: HTMLElement): Disposable {\n const id = UUID.create();\n const disposable = this.addEventListenersToElement(external);\n\n this.registeredExternalElements[id] = disposable;\n return disposable;\n }\n\n public deregisterAdditionalElementById(id: UUID.UUID): void {\n const externalElement = this.registeredExternalElements[id];\n\n externalElement.dispose();\n\n this.registeredExternalElements = Object.fromEntries(\n Object.entries(this.registeredExternalElements).filter(\n ([key]) => key !== id\n )\n );\n }\n\n protected deregisterAllListeners(): void {\n Object.keys(this.registeredExternalElements).forEach((id) =>\n this.deregisterAdditionalElementById(id)\n );\n }\n\n public abstract addEventListenersToElement(element?: HTMLElement): Disposable;\n}\n"],"names":["Point","UUID"],"mappings":";;;;;;;AA0BA,MAAM,iBAAiB,GAAG,EAAE;AAC5B,MAAM,mBAAmB,GAAG,GAAG;MAET,sBAAsB,CAAA;AAwB1C,IAAA,WAAA,CACY,SAAsC,EACtC,OAAgC,EAChC,SAAsC,EACxC,iBAAoC,EACpC,sBAA8C,EAC9C,eAAgC,EAChC,cAA8B,EAC9B,gBAAkC,EAClC,gBAAkC,EAClC,SAAyB,EAAA;AATvB,QAAA,IAAA,CA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,QAAA,IAAI,CAAC,0BAA0B,GAAG,MAAM,CAAC,WAAW,CAClD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,MAAM,CACpD,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,EAAE,CACtB,CACF;;IAGO,sBAAsB,GAAA;QAC9B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,KACtD,IAAI,CAAC,+BAA+B,CAAC,EAAE,CAAC,CACzC;;AAIJ;;;;"}
|
|
@@ -1005,9 +1005,9 @@ class Camera {
|
|
|
1005
1005
|
* Queues the rendering for a new frame using this camera. The returned
|
|
1006
1006
|
* promise will resolve when a frame is received that contains this camera.
|
|
1007
1007
|
*/
|
|
1008
|
-
async render(renderOptions) {
|
|
1009
|
-
var _a, _b, _c;
|
|
1010
|
-
if (this.flyToOptions == null && renderOptions
|
|
1008
|
+
async render(renderOptions = {}) {
|
|
1009
|
+
var _a, _b, _c, _d;
|
|
1010
|
+
if (this.flyToOptions == null && renderOptions.animation) {
|
|
1011
1011
|
this.flyToOptions = {
|
|
1012
1012
|
flyTo: {
|
|
1013
1013
|
type: 'camera',
|
|
@@ -1016,24 +1016,24 @@ class Camera {
|
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
1018
|
try {
|
|
1019
|
-
|
|
1019
|
+
(_a = renderOptions.correlationId) !== null && _a !== void 0 ? _a : (renderOptions.correlationId = uuid.create());
|
|
1020
1020
|
if (this.flyToOptions != null) {
|
|
1021
|
-
const payload = buildFlyToOperation(
|
|
1021
|
+
const payload = buildFlyToOperation(renderOptions.correlationId, this.flyToOptions, renderOptions.animation, this.toFrameCamera());
|
|
1022
1022
|
const flyToResponse = await this.stream.flyTo(payload, true);
|
|
1023
1023
|
return new CameraRenderResult(this.stream, this.decodeFrame, {
|
|
1024
|
-
correlationId:
|
|
1025
|
-
animationId: ((
|
|
1026
|
-
}, ((
|
|
1024
|
+
correlationId: renderOptions.correlationId,
|
|
1025
|
+
animationId: ((_c = (_b = flyToResponse.flyTo) === null || _b === void 0 ? void 0 : _b.animationId) === null || _c === void 0 ? void 0 : _c.hex) || undefined,
|
|
1026
|
+
}, ((_d = renderOptions.animation) === null || _d === void 0 ? void 0 : _d.milliseconds) != null
|
|
1027
1027
|
? renderOptions.animation.milliseconds + DEFAULT_TIMEOUT_IN_MS
|
|
1028
1028
|
: undefined);
|
|
1029
1029
|
}
|
|
1030
1030
|
else {
|
|
1031
1031
|
this.stream.replaceCamera({
|
|
1032
1032
|
camera: toProtobuf(this.data),
|
|
1033
|
-
frameCorrelationId: { value:
|
|
1033
|
+
frameCorrelationId: { value: renderOptions.correlationId },
|
|
1034
1034
|
});
|
|
1035
1035
|
return new CameraRenderResult(this.stream, this.decodeFrame, {
|
|
1036
|
-
correlationId:
|
|
1036
|
+
correlationId: renderOptions.correlationId,
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
@@ -2999,6 +2999,6 @@ class SceneItemQueryExecutor {
|
|
|
2999
2999
|
}
|
|
3000
3000
|
|
|
3001
3001
|
export { Camera as C, ItemOperationBuilder as I, ModelViewController as M, PmiAnnotationOperationsBuilder as P, Raycaster as R, Scene as S, CrossSectioner as a, PmiAnnotationsQueryExecutor as b, colorMaterial as c, RootQuery as d, SceneElementQueryExecutor as e, SceneElementsOperationExecutor as f, SceneItemOperationsBuilder as g, SceneItemQueryExecutor as h, SceneItemsOperationExecutor as i, SynchronizedClock as j, PmiController as k, loadableResource as l, defaultColor as m, fromUrn as n, sceneViewStateIdentifier as s, toUuid2l as t };
|
|
3002
|
-
//# sourceMappingURL=queries-
|
|
3002
|
+
//# sourceMappingURL=queries-DEzCmbTD.js.map
|
|
3003
3003
|
|
|
3004
|
-
//# sourceMappingURL=queries-
|
|
3004
|
+
//# sourceMappingURL=queries-DEzCmbTD.js.map
|