@vertexvis/viewer 0.15.2-testing.3 → 0.15.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/_commonjsHelpers-dcc4cf71.js +1 -1
- package/dist/cjs/app-globals-2035678d.js +1 -1
- package/dist/cjs/browser.esm-5d246754.js +1 -1
- package/dist/cjs/bundle.esm-22b6f2d6.js +1 -1
- package/dist/cjs/bundle.esm-b43c197a.js +38280 -0
- package/dist/cjs/{config-6e330a82.js → config-3fc1c093.js} +2 -2
- package/dist/cjs/{cursors-85d403e9.js → cursors-02a06ec9.js} +7 -1
- package/dist/cjs/dom-8d90bfaf.js +1 -1
- package/dist/cjs/dom-92728e58.js +1 -1
- package/dist/cjs/dom-d1bbd67c.js +1 -1
- package/dist/cjs/dom-d57d3c3b.js +1 -1
- package/dist/cjs/elementRectObserver-9b28f182.js +1 -1
- package/dist/cjs/entities-9eb7e608.js +1 -1
- package/dist/cjs/{entities-7b2e8c03.js → entities-c1c3c6a3.js} +3 -3
- package/dist/cjs/errors-1b37642b.js +97 -0
- package/dist/cjs/grpc-web-client.umd-2af20c1b.js +1 -1
- package/dist/cjs/index-70db349e.js +1 -1
- package/dist/cjs/index-b9d13137.js +1 -1
- package/dist/cjs/index.cjs.js +9 -6
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{mapper-0f2294a6.js → mapper-d4145b72.js} +2 -2
- package/dist/cjs/markup-4a2fc281.js +1 -1
- package/dist/cjs/{model-b61f4d20.js → model-19fb560a.js} +27 -6
- package/dist/cjs/model-20a70d27.js +1 -1
- package/dist/cjs/overlays-b03ec80b.js +1 -1
- package/dist/cjs/png-decoder-ef097f37.js +1 -1
- package/dist/cjs/results-178e89a3.js +1 -1
- package/dist/cjs/{scene-56438693.js → scene-a94e6fa5.js} +293 -215
- package/dist/cjs/shadow-css-6b9daa41.js +1 -1
- package/dist/cjs/stencil-fc92b387.js +1 -1
- package/dist/cjs/{streamAttributes-c64aee75.js → streamAttributes-cf0c513d.js} +8424 -41995
- package/dist/cjs/templates-e57b3741.js +1 -1
- package/dist/cjs/utils-2c8e2aa3.js +1 -1
- package/dist/cjs/utils-ea359796.js +1 -1
- package/dist/cjs/vertex-scene-tree-search_3.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree-table-column.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree-table-header.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree-table-resize-divider.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree-toolbar-group.cjs.entry.js +1 -1
- package/dist/cjs/vertex-scene-tree.cjs.entry.js +158 -37
- package/dist/cjs/vertex-viewer-box-query-tool.cjs.entry.js +425 -0
- package/dist/cjs/vertex-viewer-button_3.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-default-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-dom-element_2.cjs.entry.js +3 -2
- package/dist/cjs/vertex-viewer-dom-group.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-icon.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-layer.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-markup-arrow_3.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-markup-tool.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-markup.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-measurement-details.cjs.entry.js +3 -2
- package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +5 -4
- package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +4 -3
- package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +7 -6
- package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +10 -5
- package/dist/cjs/vertex-viewer-pin-label_2.cjs.entry.js +15 -13
- package/dist/cjs/vertex-viewer-pin-tool.cjs.entry.js +20 -9
- package/dist/cjs/vertex-viewer-spinner.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-transform-widget.cjs.entry.js +6 -4
- package/dist/cjs/vertex-viewer-view-cube.cjs.entry.js +5 -4
- package/dist/cjs/vertex-viewer.cjs.entry.js +80 -53
- package/dist/cjs/viewer.cjs.js +2 -2
- package/dist/cjs/viewport-5ca619f7.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/scene-tree/lib/controller.js +108 -28
- package/dist/collection/components/scene-tree/lib/errors.js +35 -2
- package/dist/collection/components/scene-tree/scene-tree.js +12 -5
- package/dist/collection/components/viewer/viewer.js +17 -15
- package/dist/collection/components/viewer-box-query-tool/viewer-box-query-tool.css +79 -0
- package/dist/collection/components/viewer-box-query-tool/viewer-box-query-tool.js +278 -0
- package/dist/collection/components/viewer-pin-group/viewer-pin-group.js +5 -1
- package/dist/collection/components/viewer-pin-label/viewer-pin-label.css +1 -1
- package/dist/collection/components/viewer-pin-label/viewer-pin-label.js +14 -12
- package/dist/collection/components/viewer-pin-tool/utils.js +25 -4
- package/dist/collection/components/viewer-pin-tool/viewer-pin-tool.css +12 -0
- package/dist/collection/components/viewer-pin-tool/viewer-pin-tool.js +9 -2
- package/dist/collection/components/viewer-transform-widget/viewer-transform-widget.js +3 -2
- package/dist/collection/components/viewer-view-cube/viewer-view-cube.js +5 -5
- package/dist/collection/lib/cursors.js +6 -1
- package/dist/collection/lib/interactions/baseInteractionHandler.js +12 -2
- package/dist/collection/lib/interactions/mouseInteractions.js +5 -4
- package/dist/collection/lib/mappers/frameStreaming.js +11 -11
- package/dist/collection/lib/pins/interactions.js +9 -5
- package/dist/collection/lib/pins/model.js +2 -2
- package/dist/collection/lib/rendering/matrices.js +2 -4
- package/dist/collection/lib/scenes/camera.js +4 -2
- package/dist/collection/lib/scenes/mapper.js +103 -30
- package/dist/collection/lib/scenes/queries.js +101 -46
- package/dist/collection/lib/scenes/scene.js +15 -7
- package/dist/collection/lib/stream/stream.js +24 -12
- package/dist/collection/lib/transforms/drawable.js +2 -2
- package/dist/collection/lib/types/frame.js +4 -3
- package/dist/collection/lib/types/frameCamera.js +6 -1
- package/dist/collection/lib/types/index.js +3 -2
- package/dist/collection/lib/types/loadableResource.js +24 -4
- package/dist/collection/lib/types/sceneViewStateIdentifier.js +7 -0
- package/dist/collection/lib/volume-intersection/controller.js +104 -0
- package/dist/collection/lib/volume-intersection/interactions.js +82 -0
- package/dist/collection/lib/volume-intersection/model.js +84 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +23825 -18358
- package/dist/custom-elements/png-decoder.js +1 -1
- package/dist/esm/_commonjsHelpers-11ca3be1.js +1 -1
- package/dist/esm/app-globals-40df99a0.js +1 -1
- package/dist/esm/{browser.esm-ae4ca1f1.js → browser.esm-07e7db8f.js} +2 -2
- package/dist/esm/bundle.esm-91404853.js +38273 -0
- package/dist/esm/{bundle.esm-ce2c7ad3.js → bundle.esm-92e615bf.js} +2 -2
- package/dist/esm/{config-49688db8.js → config-25384fe6.js} +3 -3
- package/dist/esm/{cursors-a8d4b3f4.js → cursors-127a3bb7.js} +8 -3
- package/dist/esm/dom-0440435d.js +1 -1
- package/dist/esm/dom-be140992.js +1 -1
- package/dist/esm/dom-e19ee80b.js +1 -1
- package/dist/esm/{dom-5b164305.js → dom-e436f0c0.js} +2 -2
- package/dist/esm/elementRectObserver-39cf7b95.js +1 -1
- package/dist/esm/{entities-a5bfef48.js → entities-0e325765.js} +4 -4
- package/dist/esm/entities-ce81dd7f.js +1 -1
- package/dist/esm/errors-a4cc9caa.js +85 -0
- package/dist/esm/grpc-web-client.umd-5409853c.js +1 -1
- package/dist/esm/index-26dfb2d0.js +1 -1
- package/dist/esm/index-e841d91b.js +1 -1
- package/dist/esm/index.js +15 -13
- package/dist/esm/index.mjs +15 -13
- package/dist/esm/loader.js +2 -2
- package/dist/esm/loader.mjs +2 -2
- package/dist/esm/{mapper-5894c2a4.js → mapper-dd937684.js} +3 -3
- package/dist/esm/{markup-3c2900f3.js → markup-2dde1f10.js} +3 -3
- package/dist/esm/{model-fa9af61a.js → model-3cd8cd47.js} +2 -2
- package/dist/esm/{model-40bd1711.js → model-bfe1c4d8.js} +29 -8
- package/dist/esm/{overlays-cc3efc30.js → overlays-8f195eb3.js} +3 -3
- package/dist/esm/{png-decoder-d4b65417.js → png-decoder-45f38ea3.js} +2 -2
- package/dist/esm/{results-3b4df2cf.js → results-38baef59.js} +2 -2
- package/dist/esm/{scene-5b919078.js → scene-2543b3bd.js} +254 -168
- package/dist/esm/shadow-css-51dd7708.js +1 -1
- package/dist/esm/stencil-bfbf099f.js +1 -1
- package/dist/esm/{streamAttributes-7e8565be.js → streamAttributes-23270e27.js} +8429 -41994
- package/dist/esm/templates-022199c1.js +1 -1
- package/dist/esm/{utils-81347571.js → utils-2306c744.js} +2 -2
- package/dist/esm/{utils-559e1632.js → utils-f03802ef.js} +2 -2
- package/dist/esm/vertex-scene-tree-search_3.entry.js +3 -3
- package/dist/esm/vertex-scene-tree-table-cell.entry.js +1 -1
- package/dist/esm/vertex-scene-tree-table-column.entry.js +1 -1
- package/dist/esm/vertex-scene-tree-table-header.entry.js +1 -1
- package/dist/esm/vertex-scene-tree-table-resize-divider.entry.js +1 -1
- package/dist/esm/vertex-scene-tree-toolbar-group.entry.js +1 -1
- package/dist/esm/vertex-scene-tree.entry.js +160 -39
- package/dist/esm/vertex-viewer-box-query-tool.entry.js +421 -0
- package/dist/esm/vertex-viewer-button_3.entry.js +1 -1
- package/dist/esm/vertex-viewer-default-toolbar.entry.js +1 -1
- package/dist/esm/vertex-viewer-dom-element_2.entry.js +6 -5
- package/dist/esm/vertex-viewer-dom-group.entry.js +3 -3
- package/dist/esm/vertex-viewer-icon.entry.js +1 -1
- package/dist/esm/vertex-viewer-layer.entry.js +1 -1
- package/dist/esm/vertex-viewer-markup-arrow_3.entry.js +4 -4
- package/dist/esm/vertex-viewer-markup-tool.entry.js +5 -5
- package/dist/esm/vertex-viewer-markup.entry.js +5 -5
- package/dist/esm/vertex-viewer-measurement-details.entry.js +5 -4
- package/dist/esm/vertex-viewer-measurement-distance.entry.js +13 -12
- package/dist/esm/vertex-viewer-measurement-line_2.entry.js +8 -7
- package/dist/esm/vertex-viewer-measurement-precise.entry.js +12 -11
- package/dist/esm/vertex-viewer-pin-group.entry.js +13 -8
- package/dist/esm/vertex-viewer-pin-label_2.entry.js +18 -16
- package/dist/esm/vertex-viewer-pin-tool.entry.js +23 -12
- package/dist/esm/vertex-viewer-spinner.entry.js +1 -1
- package/dist/esm/vertex-viewer-transform-widget.entry.js +9 -7
- package/dist/esm/vertex-viewer-view-cube.entry.js +7 -6
- package/dist/esm/vertex-viewer.entry.js +65 -38
- package/dist/esm/viewer.js +2 -2
- package/dist/esm/{viewport-e39e2eba.js → viewport-f19fc583.js} +2 -2
- package/dist/types/components/scene-tree/lib/controller.d.ts +18 -3
- package/dist/types/components/scene-tree/lib/errors.d.ts +17 -2
- package/dist/types/components/viewer/viewer.d.ts +2 -0
- package/dist/types/components/viewer-box-query-tool/viewer-box-query-tool.d.ts +94 -0
- package/dist/types/components/viewer-pin-tool/utils.d.ts +1 -1
- package/dist/types/components.d.ts +56 -0
- package/dist/types/lib/cursors.d.ts +5 -0
- package/dist/types/lib/interactions/baseInteractionHandler.d.ts +1 -0
- package/dist/types/lib/interactions/mouseInteractions.d.ts +2 -1
- package/dist/types/lib/pins/interactions.d.ts +4 -2
- package/dist/types/lib/pins/model.d.ts +1 -1
- package/dist/types/lib/scenes/camera.d.ts +1 -1
- package/dist/types/lib/scenes/mapper.d.ts +5 -1
- package/dist/types/lib/scenes/queries.d.ts +55 -28
- package/dist/types/lib/scenes/scene.d.ts +10 -1
- package/dist/types/lib/types/frame.d.ts +1 -1
- package/dist/types/lib/types/index.d.ts +2 -1
- package/dist/types/lib/types/loadableResource.d.ts +8 -2
- package/dist/types/lib/types/sceneViewStateIdentifier.d.ts +15 -0
- package/dist/types/lib/volume-intersection/controller.d.ts +45 -0
- package/dist/types/lib/volume-intersection/interactions.d.ts +24 -0
- package/dist/types/lib/volume-intersection/model.d.ts +33 -0
- package/dist/viewer/index.esm.js +2 -2
- package/dist/viewer/{p-ad09c92e.entry.js → p-029fba92.entry.js} +1 -1
- package/dist/viewer/p-07aeee89.js +1 -1
- package/dist/viewer/{p-29986489.js → p-0a017be7.js} +2 -2
- package/dist/viewer/p-0c583cad.entry.js +4 -0
- package/dist/viewer/p-0d494d01.js +4 -0
- package/dist/viewer/p-0fdad1a5.js +1 -1
- package/dist/viewer/{p-3ca4a7c1.js → p-1812c82d.js} +2 -2
- package/dist/viewer/{p-7663a603.entry.js → p-191156ad.entry.js} +1 -1
- package/dist/viewer/{p-a57dc6e4.entry.js → p-1998284a.entry.js} +2 -2
- package/dist/viewer/p-27f715f8.entry.js +4 -0
- package/dist/viewer/{p-7f6251da.js → p-283aeac4.js} +2 -2
- package/dist/viewer/p-298b63c2.entry.js +4 -0
- package/dist/viewer/p-2ace066b.entry.js +4 -0
- package/dist/viewer/{p-927b528b.js → p-2b60a8b0.js} +2 -2
- package/dist/viewer/{p-050f912b.entry.js → p-2fd123c8.entry.js} +1 -1
- package/dist/viewer/p-305a8be6.entry.js +4 -0
- package/dist/viewer/p-31724d24.js +4 -0
- package/dist/viewer/p-32cc2209.js +4 -0
- package/dist/viewer/p-3829dd99.entry.js +4 -0
- package/dist/viewer/{p-6da8a28f.entry.js → p-3aae4bf1.entry.js} +2 -2
- package/dist/viewer/{p-99352cf0.js → p-42760392.js} +2 -2
- package/dist/viewer/p-440c8174.js +4 -0
- package/dist/viewer/{p-e422deaf.entry.js → p-4f25e367.entry.js} +2 -2
- package/dist/viewer/{p-d64c1e14.entry.js → p-507b5aeb.entry.js} +3 -3
- package/dist/viewer/{p-1fc24ec6.js → p-51401063.js} +2 -2
- package/dist/viewer/{p-426970b3.entry.js → p-533b1c63.entry.js} +1 -1
- package/dist/viewer/{p-dcb9804c.entry.js → p-569ed94a.entry.js} +2 -2
- package/dist/viewer/p-5809b400.js +1 -1
- package/dist/viewer/p-6072cf84.js +4 -0
- package/dist/viewer/{p-e4a26a32.entry.js → p-6406a70a.entry.js} +1 -1
- package/dist/viewer/p-6bf0594b.entry.js +4 -0
- package/dist/viewer/p-72c59115.entry.js +4 -0
- package/dist/viewer/{p-d71652b0.entry.js → p-8ac7290a.entry.js} +1 -1
- package/dist/viewer/{p-f184bcab.entry.js → p-8afcbd99.entry.js} +1 -1
- package/dist/viewer/p-92fe4417.js +1 -1
- package/dist/viewer/{p-5746931d.entry.js → p-952a217d.entry.js} +1 -1
- package/dist/viewer/p-98e6a50e.js +1 -1
- package/dist/viewer/{p-99fd27e0.entry.js → p-9cb99ea8.entry.js} +1 -1
- package/dist/viewer/p-a2e9e8a5.js +4 -0
- package/dist/viewer/p-a380f0c2.js +1 -1
- package/dist/viewer/{p-661b5234.js → p-acfc5c50.js} +2 -2
- package/dist/viewer/{p-82bd25e8.entry.js → p-b3540dce.entry.js} +1 -1
- package/dist/viewer/p-b5ca30cd.js +4 -0
- package/dist/viewer/p-b74242dc.js +1 -1
- package/dist/viewer/p-bc1160cf.entry.js +4 -0
- package/dist/viewer/{p-c5e67a1e.entry.js → p-bd5a302c.entry.js} +2 -2
- package/dist/viewer/p-c738296e.js +1 -1
- package/dist/viewer/p-c8c4343b.js +1 -1
- package/dist/viewer/p-cd9ccb9e.entry.js +4 -0
- package/dist/viewer/{p-40a9dd7d.js → p-cf689bbd.js} +2 -2
- package/dist/viewer/{p-70e5e8a8.js → p-d216a866.js} +2 -2
- package/dist/viewer/p-d4ed7b8d.js +4 -0
- package/dist/viewer/p-d6d5d5de.entry.js +4 -0
- package/dist/viewer/p-d6fce4c1.js +1 -1
- package/dist/viewer/p-df8fbe56.js +1 -1
- package/dist/viewer/p-dfe5a97d.js +1 -1
- package/dist/viewer/{p-00ce31a0.js → p-e1896ce4.js} +2 -2
- package/dist/viewer/p-e23af70c.js +4 -0
- package/dist/viewer/p-e4aa9cdb.js +1 -1
- package/dist/viewer/p-e929dd63.entry.js +4 -0
- package/dist/viewer/{p-65af7a89.js → p-fc7d8c03.js} +3 -3
- package/dist/viewer/viewer.esm.js +2 -2
- package/package.json +9 -9
- package/readme.md +4 -4
- package/dist/viewer/p-096e60bd.js +0 -4
- package/dist/viewer/p-0cf4f05d.entry.js +0 -4
- package/dist/viewer/p-0fcafbf9.js +0 -4
- package/dist/viewer/p-1abfe4bf.js +0 -4
- package/dist/viewer/p-1e0dd2e9.js +0 -4
- package/dist/viewer/p-22ae6785.entry.js +0 -4
- package/dist/viewer/p-27dbc865.js +0 -4
- package/dist/viewer/p-31b87b90.js +0 -4
- package/dist/viewer/p-3f6f2457.entry.js +0 -4
- package/dist/viewer/p-61e50e11.entry.js +0 -4
- package/dist/viewer/p-7579e2a1.entry.js +0 -4
- package/dist/viewer/p-920c9a88.entry.js +0 -4
- package/dist/viewer/p-990f98c2.js +0 -4
- package/dist/viewer/p-9dfe0b43.entry.js +0 -4
- package/dist/viewer/p-a6558bb2.entry.js +0 -4
- package/dist/viewer/p-b7e170ac.entry.js +0 -4
- package/dist/viewer/p-d34ad2b2.entry.js +0 -4
- package/dist/viewer/p-f3ea0c2b.entry.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2023 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ const index = require('./index-70db349e.js');
|
|
|
9
9
|
const bundle_esm = require('./bundle.esm-22b6f2d6.js');
|
|
10
10
|
const index$1 = require('./index-b9d13137.js');
|
|
11
11
|
const dom = require('./dom-8d90bfaf.js');
|
|
12
|
-
const model = require('./model-
|
|
12
|
+
const model = require('./model-19fb560a.js');
|
|
13
13
|
const stencil = require('./stencil-fc92b387.js');
|
|
14
14
|
require('./_commonjsHelpers-dcc4cf71.js');
|
|
15
15
|
require('./browser.esm-5d246754.js');
|
|
@@ -40,12 +40,15 @@ const VertexPinLabel = class {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
this.handleInputKeyDown = (event) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
if (event.key === 'Enter' &&
|
|
45
|
+
(event.ctrlKey || event.metaKey || event.shiftKey)) {
|
|
46
|
+
this.textareaRows += 1;
|
|
47
|
+
this.value += '\n';
|
|
46
48
|
}
|
|
47
49
|
else if (event.key === 'Enter') {
|
|
48
|
-
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
this.submit();
|
|
49
52
|
}
|
|
50
53
|
};
|
|
51
54
|
this.handlePointerDown = (event) => {
|
|
@@ -64,6 +67,8 @@ const VertexPinLabel = class {
|
|
|
64
67
|
if (this.elementBounds != null &&
|
|
65
68
|
this.relativePointerDownPosition &&
|
|
66
69
|
this.pinPointerDownPosition != null) {
|
|
70
|
+
// Prevent selection of any text while interacting with the label
|
|
71
|
+
event.preventDefault();
|
|
67
72
|
const point = dom.getMouseClientPosition(event, this.elementBounds);
|
|
68
73
|
const relative = model.translatePointToRelative(point, this.elementBounds);
|
|
69
74
|
const relativeDelta = bundle_esm.point.subtract(relative, this.relativePointerDownPosition);
|
|
@@ -108,12 +113,9 @@ const VertexPinLabel = class {
|
|
|
108
113
|
var _a, _b, _c;
|
|
109
114
|
// HTMLInputElement.focus() doesn't exist in tests.
|
|
110
115
|
if (typeof ((_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus) === 'function') {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
else {
|
|
115
|
-
(_c = this.inputEl) === null || _c === void 0 ? void 0 : _c.blur();
|
|
116
|
-
}
|
|
116
|
+
this.focused = true;
|
|
117
|
+
this.labelFocused.emit((_b = this.pin) === null || _b === void 0 ? void 0 : _b.id);
|
|
118
|
+
(_c = this.inputEl) === null || _c === void 0 ? void 0 : _c.focus();
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
watchFocusChange() {
|
|
@@ -190,7 +192,7 @@ const VertexPinLabel = class {
|
|
|
190
192
|
}
|
|
191
193
|
computeMinWidth() {
|
|
192
194
|
if (this.contentElBounds != null) {
|
|
193
|
-
const expected = `${this.contentElBounds.width +
|
|
195
|
+
const expected = `${this.contentElBounds.width + 8}px`;
|
|
194
196
|
return `min(${expected}, ${this.computeMaxWidth()})`;
|
|
195
197
|
}
|
|
196
198
|
else {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2023 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
const index = require('./index-70db349e.js');
|
|
9
|
-
const model = require('./model-
|
|
9
|
+
const model = require('./model-19fb560a.js');
|
|
10
10
|
const bundle_esm = require('./bundle.esm-22b6f2d6.js');
|
|
11
11
|
const browser_esm = require('./browser.esm-5d246754.js');
|
|
12
|
-
const cursors = require('./cursors-
|
|
12
|
+
const cursors = require('./cursors-02a06ec9.js');
|
|
13
13
|
const dom = require('./dom-8d90bfaf.js');
|
|
14
14
|
const elementRectObserver = require('./elementRectObserver-9b28f182.js');
|
|
15
15
|
const entities = require('./entities-9eb7e608.js');
|
|
16
16
|
const dom$1 = require('./dom-d1bbd67c.js');
|
|
17
17
|
|
|
18
18
|
class PinsInteractionHandler {
|
|
19
|
-
constructor(controller) {
|
|
19
|
+
constructor(controller, xOffset, yOffset) {
|
|
20
20
|
this.rectObserver = new elementRectObserver.ElementRectObserver();
|
|
21
21
|
this.droppableSurfaces = [
|
|
22
22
|
entities.EntityType.PRECISE_SURFACE,
|
|
@@ -32,7 +32,7 @@ class PinsInteractionHandler {
|
|
|
32
32
|
if (this.controller.getDraggable() == null &&
|
|
33
33
|
this.controller.getToolMode() === 'edit' &&
|
|
34
34
|
isDroppableSurface) {
|
|
35
|
-
this.addCursor(this.
|
|
35
|
+
this.addCursor(this.getCursorType());
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
38
|
this.clearCursor();
|
|
@@ -86,6 +86,8 @@ class PinsInteractionHandler {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
this.controller = controller;
|
|
89
|
+
this.xOffset = xOffset;
|
|
90
|
+
this.yOffset = yOffset;
|
|
89
91
|
}
|
|
90
92
|
get elementRect() {
|
|
91
93
|
return this.rectObserver.rect;
|
|
@@ -119,7 +121,6 @@ class PinsInteractionHandler {
|
|
|
119
121
|
var _a, _b, _c, _d, _e, _f;
|
|
120
122
|
const [hit] = await api.hitItems(pt);
|
|
121
123
|
if ((hit === null || hit === void 0 ? void 0 : hit.hitPoint) != null && this.elementRect != null) {
|
|
122
|
-
const relativePoint = model.translatePointToRelative(pt, this.elementRect);
|
|
123
124
|
if ((hit === null || hit === void 0 ? void 0 : hit.hitPoint) != null &&
|
|
124
125
|
(hit === null || hit === void 0 ? void 0 : hit.hitPoint.x) != null &&
|
|
125
126
|
(hit === null || hit === void 0 ? void 0 : hit.hitPoint.y) != null &&
|
|
@@ -145,6 +146,8 @@ class PinsInteractionHandler {
|
|
|
145
146
|
});
|
|
146
147
|
break;
|
|
147
148
|
case 'pin-text':
|
|
149
|
+
const isNewPin = existingPin == null;
|
|
150
|
+
const relativePoint = model.translatePointToRelative(pt, this.elementRect, isNewPin, this.xOffset, this.yOffset);
|
|
148
151
|
this.controller.setPin({
|
|
149
152
|
type: 'text',
|
|
150
153
|
id: pinId,
|
|
@@ -159,6 +162,7 @@ class PinsInteractionHandler {
|
|
|
159
162
|
},
|
|
160
163
|
attributes,
|
|
161
164
|
});
|
|
165
|
+
this.controller.setSelectedPinId(pinId);
|
|
162
166
|
break;
|
|
163
167
|
}
|
|
164
168
|
}
|
|
@@ -168,7 +172,7 @@ class PinsInteractionHandler {
|
|
|
168
172
|
}
|
|
169
173
|
});
|
|
170
174
|
}
|
|
171
|
-
|
|
175
|
+
getCursorType() {
|
|
172
176
|
switch (this.controller.getToolType()) {
|
|
173
177
|
case 'pin-icon':
|
|
174
178
|
return cursors.pinCursor;
|
|
@@ -201,7 +205,7 @@ class PinsInteractionHandler {
|
|
|
201
205
|
}
|
|
202
206
|
}
|
|
203
207
|
|
|
204
|
-
const viewerPinToolCss = ":host{position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;pointer-events:none}";
|
|
208
|
+
const viewerPinToolCss = ":host{position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;pointer-events:none;--viewer-pin-tool-initial-label-offset-x:20;--viewer-pin-tool-initial-label-offset-y:20}";
|
|
205
209
|
|
|
206
210
|
const ViewerPinTool = class {
|
|
207
211
|
constructor(hostRef) {
|
|
@@ -325,10 +329,17 @@ const ViewerPinTool = class {
|
|
|
325
329
|
}
|
|
326
330
|
setupInteractionHandler() {
|
|
327
331
|
var _a;
|
|
332
|
+
const hostStyles = window.getComputedStyle(this.hostEl);
|
|
333
|
+
const xOffset = hostStyles
|
|
334
|
+
.getPropertyValue('--viewer-pin-tool-initial-label-offset-x')
|
|
335
|
+
.trim();
|
|
336
|
+
const yOffset = hostStyles
|
|
337
|
+
.getPropertyValue('--viewer-pin-tool-initial-label-offset-y')
|
|
338
|
+
.trim();
|
|
328
339
|
this.clearInteractionHandler();
|
|
329
340
|
if (this.pinController != null) {
|
|
330
341
|
this.registeredInteractionHandler =
|
|
331
|
-
(_a = this.viewer) === null || _a === void 0 ? void 0 : _a.registerInteractionHandler(new PinsInteractionHandler(this.pinController));
|
|
342
|
+
(_a = this.viewer) === null || _a === void 0 ? void 0 : _a.registerInteractionHandler(new PinsInteractionHandler(this.pinController, parseInt(xOffset), parseInt(yOffset)));
|
|
332
343
|
}
|
|
333
344
|
}
|
|
334
345
|
clearModelListeners() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2023 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -11,9 +11,10 @@ const index$1 = require('./index-b9d13137.js');
|
|
|
11
11
|
const stencil = require('./stencil-fc92b387.js');
|
|
12
12
|
const browser_esm = require('./browser.esm-5d246754.js');
|
|
13
13
|
const _commonjsHelpers = require('./_commonjsHelpers-dcc4cf71.js');
|
|
14
|
-
require('./streamAttributes-
|
|
14
|
+
require('./streamAttributes-cf0c513d.js');
|
|
15
15
|
require('./entities-9eb7e608.js');
|
|
16
16
|
const viewport = require('./viewport-5ca619f7.js');
|
|
17
|
+
require('./bundle.esm-b43c197a.js');
|
|
17
18
|
|
|
18
19
|
class TransformController {
|
|
19
20
|
constructor(stream) {
|
|
@@ -12498,7 +12499,7 @@ function computeDrawable2dBounds(viewport, ...elements) {
|
|
|
12498
12499
|
let max = bundle_esm.point.create();
|
|
12499
12500
|
elements
|
|
12500
12501
|
.filter((m) => m.points.valid)
|
|
12501
|
-
.
|
|
12502
|
+
.forEach((m) => {
|
|
12502
12503
|
m.points
|
|
12503
12504
|
.toArray()
|
|
12504
12505
|
.map((pt) => viewport.transformNdcPointToViewport(pt))
|
|
@@ -13131,6 +13132,7 @@ const ViewerTransformWidget = class {
|
|
|
13131
13132
|
});
|
|
13132
13133
|
if (this.position != null) {
|
|
13133
13134
|
this.currentTransform = bundle_esm.matrix4.makeTranslation(this.position);
|
|
13135
|
+
this.startingTransform = this.currentTransform;
|
|
13134
13136
|
this.widget.updateTransform(this.currentTransform);
|
|
13135
13137
|
}
|
|
13136
13138
|
if (((_b = this.viewer) === null || _b === void 0 ? void 0 : _b.frame) != null) {
|
|
@@ -13235,7 +13237,7 @@ const ViewerTransformWidget = class {
|
|
|
13235
13237
|
var _a, _b;
|
|
13236
13238
|
this.currentTransform = this.getTransform(oldPosition, newPosition);
|
|
13237
13239
|
this.startingTransform = this.currentTransform;
|
|
13238
|
-
console.debug(`Updating widget position [previous=${JSON.stringify(
|
|
13240
|
+
console.debug(`Updating widget position [previous=${JSON.stringify(oldPosition)}, current=${JSON.stringify(newPosition)}]`);
|
|
13239
13241
|
(_a = this.widget) === null || _a === void 0 ? void 0 : _a.updateTransform(this.currentTransform);
|
|
13240
13242
|
if (newPosition == null) {
|
|
13241
13243
|
(_b = this.controller) === null || _b === void 0 ? void 0 : _b.clearTransform();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2023 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -8,9 +8,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
8
8
|
const index = require('./index-70db349e.js');
|
|
9
9
|
const bundle_esm = require('./bundle.esm-22b6f2d6.js');
|
|
10
10
|
const stencil = require('./stencil-fc92b387.js');
|
|
11
|
-
const streamAttributes = require('./streamAttributes-
|
|
11
|
+
const streamAttributes = require('./streamAttributes-cf0c513d.js');
|
|
12
12
|
require('./entities-9eb7e608.js');
|
|
13
13
|
const index$1 = require('./index-b9d13137.js');
|
|
14
|
+
require('./bundle.esm-b43c197a.js');
|
|
14
15
|
require('./browser.esm-5d246754.js');
|
|
15
16
|
require('./_commonjsHelpers-dcc4cf71.js');
|
|
16
17
|
|
|
@@ -105,11 +106,11 @@ const ViewerViewCube = class {
|
|
|
105
106
|
/**
|
|
106
107
|
* The label for the side of the cube on the positive x-axis.
|
|
107
108
|
*/
|
|
108
|
-
this.xPositiveLabel = '
|
|
109
|
+
this.xPositiveLabel = 'Right';
|
|
109
110
|
/**
|
|
110
111
|
* The label for the side of the cube on the negative x-axis.
|
|
111
112
|
*/
|
|
112
|
-
this.xNegativeLabel = '
|
|
113
|
+
this.xNegativeLabel = 'Left';
|
|
113
114
|
/**
|
|
114
115
|
* The label for the side of the cube on the positive y-axis.
|
|
115
116
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**!
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2023 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -7,15 +7,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
7
7
|
|
|
8
8
|
const index = require('./index-70db349e.js');
|
|
9
9
|
const bundle_esm = require('./bundle.esm-22b6f2d6.js');
|
|
10
|
-
const
|
|
10
|
+
const bundle_esm$1 = require('./bundle.esm-b43c197a.js');
|
|
11
11
|
const browser_esm = require('./browser.esm-5d246754.js');
|
|
12
12
|
const index$1 = require('./index-b9d13137.js');
|
|
13
|
-
const config = require('./config-
|
|
14
|
-
const cursors = require('./cursors-
|
|
13
|
+
const config = require('./config-3fc1c093.js');
|
|
14
|
+
const cursors = require('./cursors-02a06ec9.js');
|
|
15
15
|
const dom = require('./dom-8d90bfaf.js');
|
|
16
|
-
const
|
|
16
|
+
const errors = require('./errors-1b37642b.js');
|
|
17
|
+
const streamAttributes = require('./streamAttributes-cf0c513d.js');
|
|
17
18
|
const entities = require('./entities-9eb7e608.js');
|
|
18
19
|
const viewport = require('./viewport-5ca619f7.js');
|
|
20
|
+
const scene = require('./scene-a94e6fa5.js');
|
|
19
21
|
require('./_commonjsHelpers-dcc4cf71.js');
|
|
20
22
|
|
|
21
23
|
/**
|
|
@@ -264,7 +266,7 @@ class FlyToPartKeyInteraction {
|
|
|
264
266
|
await this.stream.flyTo({
|
|
265
267
|
itemId: hitResult.hitItems.hits[0].itemId,
|
|
266
268
|
animation: {
|
|
267
|
-
duration:
|
|
269
|
+
duration: bundle_esm$1.toProtoDuration(this.configProvider().animation.durationMs),
|
|
268
270
|
},
|
|
269
271
|
});
|
|
270
272
|
}
|
|
@@ -926,7 +928,7 @@ class FlyToPositionKeyInteraction {
|
|
|
926
928
|
})
|
|
927
929
|
.toFrameCamera()),
|
|
928
930
|
animation: {
|
|
929
|
-
duration:
|
|
931
|
+
duration: bundle_esm$1.toProtoDuration(this.configProvider().animation.durationMs),
|
|
930
932
|
},
|
|
931
933
|
});
|
|
932
934
|
}
|
|
@@ -1025,9 +1027,11 @@ class BaseInteractionHandler {
|
|
|
1025
1027
|
switch (type) {
|
|
1026
1028
|
case 'rotate':
|
|
1027
1029
|
this.primaryInteraction = this.rotateInteraction;
|
|
1030
|
+
this.lastPrimaryRotateInteraction = this.rotateInteraction;
|
|
1028
1031
|
break;
|
|
1029
1032
|
case 'rotate-point':
|
|
1030
1033
|
this.primaryInteraction = this.rotatePointInteraction;
|
|
1034
|
+
this.lastPrimaryRotateInteraction = this.rotatePointInteraction;
|
|
1031
1035
|
break;
|
|
1032
1036
|
case 'zoom':
|
|
1033
1037
|
this.primaryInteraction = this.zoomInteraction;
|
|
@@ -1102,9 +1106,13 @@ class BaseInteractionHandler {
|
|
|
1102
1106
|
}
|
|
1103
1107
|
}
|
|
1104
1108
|
beginDrag(event) {
|
|
1109
|
+
var _a;
|
|
1105
1110
|
if (this.keyboardControls && event.metaKey && event.shiftKey) {
|
|
1106
1111
|
this.currentInteraction = this.rotatePointInteraction;
|
|
1107
1112
|
}
|
|
1113
|
+
else if (this.keyboardControls && event.shiftKey && event.altKey) {
|
|
1114
|
+
this.currentInteraction = this.twistInteraction;
|
|
1115
|
+
}
|
|
1108
1116
|
else if (this.keyboardControls && event.shiftKey) {
|
|
1109
1117
|
this.currentInteraction = this.zoomInteraction;
|
|
1110
1118
|
}
|
|
@@ -1114,13 +1122,17 @@ class BaseInteractionHandler {
|
|
|
1114
1122
|
else if (this.keyboardControls && event.altKey) {
|
|
1115
1123
|
this.currentInteraction = this.rotateInteraction;
|
|
1116
1124
|
}
|
|
1117
|
-
if (event.buttons === 1
|
|
1125
|
+
if (event.buttons === 1) {
|
|
1118
1126
|
this.draggingInteraction =
|
|
1119
1127
|
this.currentInteraction || this.primaryInteraction;
|
|
1120
1128
|
}
|
|
1121
1129
|
else if (event.buttons === 2) {
|
|
1122
1130
|
this.draggingInteraction = this.panInteraction;
|
|
1123
1131
|
}
|
|
1132
|
+
else if (event.buttons === 4) {
|
|
1133
|
+
this.draggingInteraction =
|
|
1134
|
+
(_a = this.lastPrimaryRotateInteraction) !== null && _a !== void 0 ? _a : this.rotateInteraction;
|
|
1135
|
+
}
|
|
1124
1136
|
if (this.draggingInteraction != null &&
|
|
1125
1137
|
this.interactionApi != null &&
|
|
1126
1138
|
this.element != null) {
|
|
@@ -1389,12 +1401,13 @@ class TwistInteraction extends MouseInteraction {
|
|
|
1389
1401
|
super(...arguments);
|
|
1390
1402
|
this.type = 'twist';
|
|
1391
1403
|
}
|
|
1392
|
-
beginDrag(event, canvasPosition, api) {
|
|
1393
|
-
this.currentPosition = bundle_esm.point.create(event.
|
|
1404
|
+
beginDrag(event, canvasPosition, api, element) {
|
|
1405
|
+
this.currentPosition = bundle_esm.point.create(event.offsetX, event.offsetY);
|
|
1406
|
+
this.canvasRect = element.getBoundingClientRect();
|
|
1394
1407
|
api.beginInteraction();
|
|
1395
1408
|
}
|
|
1396
1409
|
drag(event, api) {
|
|
1397
|
-
const position =
|
|
1410
|
+
const position = dom.getMouseClientPosition(event, this.canvasRect);
|
|
1398
1411
|
this.currentPosition = position;
|
|
1399
1412
|
api.twistCamera(position);
|
|
1400
1413
|
}
|
|
@@ -1891,7 +1904,7 @@ function loadImageBytesAsImageElement(imageData) {
|
|
|
1891
1904
|
URL.revokeObjectURL(blobUrl);
|
|
1892
1905
|
});
|
|
1893
1906
|
image.addEventListener('error', () => {
|
|
1894
|
-
reject(new
|
|
1907
|
+
reject(new errors.ImageLoadError('Failed to load image data'));
|
|
1895
1908
|
URL.revokeObjectURL(blobUrl);
|
|
1896
1909
|
});
|
|
1897
1910
|
image.src = blobUrl;
|
|
@@ -2038,8 +2051,8 @@ function calculateSendToReceiveDuration(clockProvider) {
|
|
|
2038
2051
|
const clock = clockProvider();
|
|
2039
2052
|
if (clock != null) {
|
|
2040
2053
|
const receivedAt = clock.remoteTime(new Date(Date.now()));
|
|
2041
|
-
const duration =
|
|
2042
|
-
const durationInMs =
|
|
2054
|
+
const duration = bundle_esm$1.toProtoDuration(sentAt, receivedAt);
|
|
2055
|
+
const durationInMs = bundle_esm$1.protoToDate(duration).getTime();
|
|
2043
2056
|
if (durationInMs >= 0) {
|
|
2044
2057
|
return duration;
|
|
2045
2058
|
}
|
|
@@ -2064,7 +2077,7 @@ function calculateSendToReceiveDuration(clockProvider) {
|
|
|
2064
2077
|
function acknowledgeFrameRequests(api, clockProvider) {
|
|
2065
2078
|
const sendToReceiveDuration = calculateSendToReceiveDuration(clockProvider);
|
|
2066
2079
|
return ifRequestId((reqId) => ifDrawFrame((_) => (req) => {
|
|
2067
|
-
const sentAt =
|
|
2080
|
+
const sentAt = bundle_esm$1.protoToDate(req.sentAtTime);
|
|
2068
2081
|
if (sentAt != null) {
|
|
2069
2082
|
api.replyResult(reqId, {
|
|
2070
2083
|
drawFrame: {
|
|
@@ -2096,7 +2109,7 @@ function getStorageEntry(key, f, storage = window.localStorage) {
|
|
|
2096
2109
|
}
|
|
2097
2110
|
}
|
|
2098
2111
|
|
|
2099
|
-
class ViewerStream extends
|
|
2112
|
+
class ViewerStream extends bundle_esm$1.StreamApi {
|
|
2100
2113
|
constructor(ws, opts = {}) {
|
|
2101
2114
|
var _a, _b, _c;
|
|
2102
2115
|
super(ws, { loggingEnabled: opts.loggingEnabled });
|
|
@@ -2160,21 +2173,27 @@ class ViewerStream extends streamAttributes.StreamApi {
|
|
|
2160
2173
|
}
|
|
2161
2174
|
}
|
|
2162
2175
|
async loadIfConnectingOrConnected(urn, state) {
|
|
2163
|
-
|
|
2176
|
+
var _a;
|
|
2177
|
+
const { resource: pResource, subResource: pSubResource } = state.resource;
|
|
2164
2178
|
const resource = scene.fromUrn(urn);
|
|
2165
2179
|
const hasResourceChanged = !browser_esm.objects.isEqual(pResource, resource.resource);
|
|
2166
|
-
const
|
|
2167
|
-
const hasQuery = resource.queries[0] != null;
|
|
2180
|
+
const hasSubResourceChanged = !browser_esm.objects.isEqual(pSubResource, resource.subResource);
|
|
2168
2181
|
const isConnecting = state.type === 'connecting' || state.type === 'reconnecting';
|
|
2169
2182
|
const isConnected = state.type === 'connected';
|
|
2170
|
-
|
|
2183
|
+
const suppliedIdQuery = resource.queries.find((q) => q.type === 'supplied-id');
|
|
2184
|
+
if (hasResourceChanged || (isConnecting && hasSubResourceChanged)) {
|
|
2171
2185
|
this.disconnect();
|
|
2172
2186
|
return this.loadIfDisconnected(urn);
|
|
2173
2187
|
}
|
|
2174
|
-
else if (isConnected &&
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
}
|
|
2188
|
+
else if (isConnected &&
|
|
2189
|
+
hasSubResourceChanged &&
|
|
2190
|
+
((_a = resource.subResource) === null || _a === void 0 ? void 0 : _a.type) === 'scene-view-state') {
|
|
2191
|
+
const payload = Object.assign(Object.assign({}, (resource.subResource.id != null
|
|
2192
|
+
? { sceneViewStateId: { hex: resource.subResource.id } }
|
|
2193
|
+
: {})), (suppliedIdQuery != null
|
|
2194
|
+
? { sceneViewStateSuppliedId: { value: suppliedIdQuery.id } }
|
|
2195
|
+
: {}));
|
|
2196
|
+
await this.loadSceneViewState(payload);
|
|
2178
2197
|
this.updateState(Object.assign(Object.assign({}, state), { resource }));
|
|
2179
2198
|
}
|
|
2180
2199
|
}
|
|
@@ -2183,14 +2202,14 @@ class ViewerStream extends streamAttributes.StreamApi {
|
|
|
2183
2202
|
await this.connectWithNewStream(scene.fromUrn(urn));
|
|
2184
2203
|
}
|
|
2185
2204
|
catch (e) {
|
|
2186
|
-
if (e instanceof
|
|
2205
|
+
if (e instanceof errors.CustomError) {
|
|
2187
2206
|
this.updateState({
|
|
2188
2207
|
type: 'connection-failed',
|
|
2189
2208
|
message: `Cannot load scene. ${e.message}`,
|
|
2190
2209
|
error: e,
|
|
2191
2210
|
});
|
|
2192
2211
|
}
|
|
2193
|
-
else if (e instanceof
|
|
2212
|
+
else if (e instanceof bundle_esm$1.StreamRequestError) {
|
|
2194
2213
|
this.updateState({
|
|
2195
2214
|
type: 'connection-failed',
|
|
2196
2215
|
message: `Cannot load scene. Stream request failed to start stream.`,
|
|
@@ -2232,7 +2251,7 @@ class ViewerStream extends streamAttributes.StreamApi {
|
|
|
2232
2251
|
maxRetries,
|
|
2233
2252
|
delaysInMs: ViewerStream.WS_RECONNECT_DELAYS,
|
|
2234
2253
|
})).catch((e) => {
|
|
2235
|
-
throw new
|
|
2254
|
+
throw new errors.WebsocketConnectionError('Websocket connection failed.', e instanceof Error ? e : undefined);
|
|
2236
2255
|
});
|
|
2237
2256
|
if (!connection.aborted) {
|
|
2238
2257
|
return this.requestNewOrExistingStream(resource, connection.result, requestStream);
|
|
@@ -2285,14 +2304,20 @@ class ViewerStream extends streamAttributes.StreamApi {
|
|
|
2285
2304
|
});
|
|
2286
2305
|
}
|
|
2287
2306
|
async requestNewStream(resource) {
|
|
2288
|
-
var _a;
|
|
2307
|
+
var _a, _b;
|
|
2308
|
+
const suppliedIdQuery = resource.queries.find((q) => q.type === 'supplied-id');
|
|
2289
2309
|
const res = streamAttributes.fromPbStartStreamResponseOrThrow(await this.startStream({
|
|
2290
2310
|
streamKey: { value: resource.resource.id },
|
|
2291
2311
|
dimensions: this.dimensions,
|
|
2292
2312
|
frameBackgroundColor: toPbColorOrThrow(this.frameBgColor),
|
|
2293
2313
|
streamAttributes: toPbStreamAttributesOrThrow(this.streamAttributes),
|
|
2294
|
-
sceneViewStateId: ((_a = resource.
|
|
2295
|
-
|
|
2314
|
+
sceneViewStateId: ((_a = resource.subResource) === null || _a === void 0 ? void 0 : _a.type) === 'scene-view-state' &&
|
|
2315
|
+
resource.subResource.id != null
|
|
2316
|
+
? { hex: resource.subResource.id }
|
|
2317
|
+
: undefined,
|
|
2318
|
+
sceneViewStateSuppliedId: ((_b = resource.subResource) === null || _b === void 0 ? void 0 : _b.type) === 'scene-view-state' &&
|
|
2319
|
+
suppliedIdQuery != null
|
|
2320
|
+
? { value: suppliedIdQuery.id }
|
|
2296
2321
|
: undefined,
|
|
2297
2322
|
}));
|
|
2298
2323
|
return {
|
|
@@ -2317,7 +2342,7 @@ class ViewerStream extends streamAttributes.StreamApi {
|
|
|
2317
2342
|
}
|
|
2318
2343
|
async requestClock() {
|
|
2319
2344
|
const remoteTime = streamAttributes.fromPbSyncTimeResponseOrThrow(await this.syncTime({
|
|
2320
|
-
requestTime:
|
|
2345
|
+
requestTime: bundle_esm$1.currentDateAsProtoTimestamp(),
|
|
2321
2346
|
}));
|
|
2322
2347
|
return new scene.SynchronizedClock(remoteTime);
|
|
2323
2348
|
}
|
|
@@ -2411,7 +2436,7 @@ class ViewerStream extends streamAttributes.StreamApi {
|
|
|
2411
2436
|
}));
|
|
2412
2437
|
}
|
|
2413
2438
|
catch (e) {
|
|
2414
|
-
throw new
|
|
2439
|
+
throw new errors.SceneRenderError(`Frame timed out after ${timeoutInSeconds / 1000}s`, e instanceof Error ? e : undefined);
|
|
2415
2440
|
}
|
|
2416
2441
|
finally {
|
|
2417
2442
|
disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
|
|
@@ -2586,7 +2611,7 @@ const Viewer = class {
|
|
|
2586
2611
|
this.resizeObserver = new ResizeObserver(this.handleElementResize);
|
|
2587
2612
|
this.registerSlotChangeListeners();
|
|
2588
2613
|
this.stream =
|
|
2589
|
-
(_a = this.stream) !== null && _a !== void 0 ? _a : new ViewerStream(new
|
|
2614
|
+
(_a = this.stream) !== null && _a !== void 0 ? _a : new ViewerStream(new bundle_esm$1.WebSocketClientImpl(), {
|
|
2590
2615
|
loggingEnabled: this.getResolvedConfig().flags.logWsMessages,
|
|
2591
2616
|
});
|
|
2592
2617
|
this.addStreamListeners();
|
|
@@ -2603,13 +2628,9 @@ const Viewer = class {
|
|
|
2603
2628
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(this.containerElement);
|
|
2604
2629
|
}
|
|
2605
2630
|
if (this.src != null) {
|
|
2606
|
-
|
|
2607
|
-
this.load(this.src);
|
|
2608
|
-
}
|
|
2609
|
-
catch (e) {
|
|
2610
|
-
// Consumer cannot handle this error. Just log it.
|
|
2631
|
+
this.load(this.src).catch((e) => {
|
|
2611
2632
|
console.error('Error loading scene', e);
|
|
2612
|
-
}
|
|
2633
|
+
});
|
|
2613
2634
|
}
|
|
2614
2635
|
this.initializeDefaultInteractionHandlers();
|
|
2615
2636
|
this.injectViewerApi();
|
|
@@ -2886,7 +2907,7 @@ const Viewer = class {
|
|
|
2886
2907
|
this.sceneReady.emit();
|
|
2887
2908
|
}
|
|
2888
2909
|
else {
|
|
2889
|
-
throw new
|
|
2910
|
+
throw new errors.ViewerInitializationError('Cannot load scene. Viewer has not been initialized.');
|
|
2890
2911
|
}
|
|
2891
2912
|
}
|
|
2892
2913
|
/**
|
|
@@ -2929,7 +2950,7 @@ const Viewer = class {
|
|
|
2929
2950
|
this.connectionChange.emit(status);
|
|
2930
2951
|
}
|
|
2931
2952
|
handleElementResize(entries) {
|
|
2932
|
-
const dimensionsHaveChanged = entries.length
|
|
2953
|
+
const dimensionsHaveChanged = entries.length > 0 &&
|
|
2933
2954
|
this.dimensions != null &&
|
|
2934
2955
|
!bundle_esm.dimensions.isEqual(entries[0].contentRect, this.viewport);
|
|
2935
2956
|
if (dimensionsHaveChanged) {
|
|
@@ -2999,7 +3020,7 @@ const Viewer = class {
|
|
|
2999
3020
|
if (this.stateMap.streamState.type === 'connected') {
|
|
3000
3021
|
const payload = {
|
|
3001
3022
|
timings: timings.map((t) => ({
|
|
3002
|
-
receiveToPaintDuration:
|
|
3023
|
+
receiveToPaintDuration: bundle_esm$1.toProtoDuration(t.duration),
|
|
3003
3024
|
})),
|
|
3004
3025
|
};
|
|
3005
3026
|
this.getStream().recordPerformance(payload, false);
|
|
@@ -3108,6 +3129,7 @@ const Viewer = class {
|
|
|
3108
3129
|
async initializeDefaultInteractionHandlers() {
|
|
3109
3130
|
var _a;
|
|
3110
3131
|
await this.initializeDefaultCameraInteractionHandlers();
|
|
3132
|
+
await this.initializeDefaultTapInteractionHandler();
|
|
3111
3133
|
this.initializeDefaultKeyboardInteractionHandlers();
|
|
3112
3134
|
if (this.rotateAroundTapPoint) {
|
|
3113
3135
|
(_a = this.baseInteractionHandler) === null || _a === void 0 ? void 0 : _a.setPrimaryInteractionType('rotate-point');
|
|
@@ -3130,32 +3152,25 @@ const Viewer = class {
|
|
|
3130
3152
|
var _a, _b;
|
|
3131
3153
|
this.clearDefaultCameraInteractionHandlers();
|
|
3132
3154
|
if (this.cameraControls) {
|
|
3133
|
-
// default to pointer events if allowed by browser.
|
|
3134
3155
|
if (window.PointerEvent != null) {
|
|
3135
|
-
const tapInteractionHandler = new TapInteractionHandler('pointerdown', 'pointerup', 'pointermove', () => this.getResolvedConfig());
|
|
3136
3156
|
this.baseInteractionHandler =
|
|
3137
3157
|
(_a = this.baseInteractionHandler) !== null && _a !== void 0 ? _a : new PointerInteractionHandler(() => this.getResolvedConfig());
|
|
3138
3158
|
const baseDisposable = await this.registerInteractionHandler(this.baseInteractionHandler);
|
|
3139
3159
|
const multiPointerDisposable = await this.registerInteractionHandler(new MultiPointerInteractionHandler());
|
|
3140
|
-
const tapDisposable = await this.registerInteractionHandler(tapInteractionHandler);
|
|
3141
3160
|
this.defaultInteractionHandlerDisposables = [
|
|
3142
3161
|
baseDisposable,
|
|
3143
3162
|
multiPointerDisposable,
|
|
3144
|
-
tapDisposable,
|
|
3145
3163
|
];
|
|
3146
3164
|
}
|
|
3147
3165
|
else {
|
|
3148
|
-
const tapInteractionHandler = new TapInteractionHandler('mousedown', 'mouseup', 'mousemove', () => this.getResolvedConfig());
|
|
3149
3166
|
// fallback to touch events and mouse events as a default
|
|
3150
3167
|
this.baseInteractionHandler =
|
|
3151
3168
|
(_b = this.baseInteractionHandler) !== null && _b !== void 0 ? _b : new MouseInteractionHandler(() => this.getResolvedConfig());
|
|
3152
3169
|
const baseDisposable = await this.registerInteractionHandler(this.baseInteractionHandler);
|
|
3153
3170
|
const touchDisposable = await this.registerInteractionHandler(new TouchInteractionHandler());
|
|
3154
|
-
const tapDisposable = await this.registerInteractionHandler(tapInteractionHandler);
|
|
3155
3171
|
this.defaultInteractionHandlerDisposables = [
|
|
3156
3172
|
baseDisposable,
|
|
3157
3173
|
touchDisposable,
|
|
3158
|
-
tapDisposable,
|
|
3159
3174
|
];
|
|
3160
3175
|
}
|
|
3161
3176
|
}
|
|
@@ -3172,18 +3187,30 @@ const Viewer = class {
|
|
|
3172
3187
|
this.defaultTapKeyInteractions = [flyToPart, flyToPosition];
|
|
3173
3188
|
}
|
|
3174
3189
|
}
|
|
3190
|
+
async initializeDefaultTapInteractionHandler() {
|
|
3191
|
+
if (this.tapHandlerDisposable == null) {
|
|
3192
|
+
if (window.PointerEvent != null) {
|
|
3193
|
+
const tapInteractionHandler = new TapInteractionHandler('pointerdown', 'pointerup', 'pointermove', () => this.getResolvedConfig());
|
|
3194
|
+
this.tapHandlerDisposable = await this.registerInteractionHandler(tapInteractionHandler);
|
|
3195
|
+
}
|
|
3196
|
+
else {
|
|
3197
|
+
const tapInteractionHandler = new TapInteractionHandler('mousedown', 'mouseup', 'mousemove', () => this.getResolvedConfig());
|
|
3198
|
+
this.tapHandlerDisposable = await this.registerInteractionHandler(tapInteractionHandler);
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3175
3202
|
initializeInteractionHandler(handler) {
|
|
3176
3203
|
if (this.stateMap.interactionTarget == null) {
|
|
3177
|
-
throw new
|
|
3204
|
+
throw new errors.InteractionHandlerError('Cannot initialize interaction handler. Interaction target is undefined.');
|
|
3178
3205
|
}
|
|
3179
3206
|
if (this.interactionApi == null) {
|
|
3180
|
-
throw new
|
|
3207
|
+
throw new errors.InteractionHandlerError('Cannot initialize interaction handler. Interaction APi is undefined.');
|
|
3181
3208
|
}
|
|
3182
3209
|
handler.initialize(this.stateMap.interactionTarget, this.interactionApi);
|
|
3183
3210
|
}
|
|
3184
3211
|
createInteractionApi() {
|
|
3185
3212
|
if (this.stream == null) {
|
|
3186
|
-
throw new
|
|
3213
|
+
throw new errors.ComponentInitializationError('Cannot create interaction API. Component has not been initialized.');
|
|
3187
3214
|
}
|
|
3188
3215
|
return this.frame == null || this.frame.scene.camera.isPerspective()
|
|
3189
3216
|
? new InteractionApiPerspective(this.stream, this.stateMap.cursorManager, () => this.getResolvedConfig().interactions, () => this.createScene(), () => this.frame, () => this.viewport, this.tap, this.doubletap, this.longpress, this.interactionStarted, this.interactionFinished)
|
|
@@ -3196,7 +3223,7 @@ const Viewer = class {
|
|
|
3196
3223
|
}
|
|
3197
3224
|
createScene() {
|
|
3198
3225
|
if (this.stateMap.streamState.type !== 'connected') {
|
|
3199
|
-
throw new
|
|
3226
|
+
throw new errors.IllegalStateError('Cannot create scene. Viewer stream is not connected.');
|
|
3200
3227
|
}
|
|
3201
3228
|
const { frame, sceneId, sceneViewId, worldOrientation } = this.stateMap.streamState;
|
|
3202
3229
|
const selectionMaterial = typeof this.selectionMaterial === 'string'
|