@vertexvis/viewer 0.23.3 → 0.23.4-canary.1

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.
Files changed (52) hide show
  1. package/dist/cjs/{config-ce05a8b9.js → config-7341c85a.js} +25 -2
  2. package/dist/cjs/config-7341c85a.js.map +1 -0
  3. package/dist/cjs/vertex-scene-tree.cjs.entry.js +2 -2
  4. package/dist/cjs/vertex-scene-tree.cjs.entry.js.map +1 -1
  5. package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +2 -2
  6. package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js.map +1 -1
  7. package/dist/cjs/vertex-viewer.cjs.entry.js +5 -5
  8. package/dist/cjs/vertex-viewer.cjs.entry.js.map +1 -1
  9. package/dist/collection/components/scene-tree/scene-tree.js +2 -2
  10. package/dist/collection/components/scene-tree/scene-tree.js.map +1 -1
  11. package/dist/collection/components/viewer/viewer.js +3 -3
  12. package/dist/collection/components/viewer/viewer.js.map +1 -1
  13. package/dist/collection/components/viewer-measurement-precise/viewer-measurement-precise.js +2 -2
  14. package/dist/collection/components/viewer-measurement-precise/viewer-measurement-precise.js.map +1 -1
  15. package/dist/collection/lib/config.js +23 -0
  16. package/dist/collection/lib/config.js.map +1 -1
  17. package/dist/collection/lib/stream/stream.js +3 -3
  18. package/dist/collection/lib/stream/stream.js.map +1 -1
  19. package/dist/components/config.js +24 -1
  20. package/dist/components/config.js.map +1 -1
  21. package/dist/components/vertex-scene-tree.js +2 -2
  22. package/dist/components/vertex-scene-tree.js.map +1 -1
  23. package/dist/components/vertex-viewer-measurement-precise.js +2 -2
  24. package/dist/components/vertex-viewer-measurement-precise.js.map +1 -1
  25. package/dist/components/vertex-viewer.js +5 -5
  26. package/dist/components/vertex-viewer.js.map +1 -1
  27. package/dist/esm/{config-976fdfa3.js → config-15ab779f.js} +25 -2
  28. package/dist/esm/config-15ab779f.js.map +1 -0
  29. package/dist/esm/vertex-scene-tree.entry.js +2 -2
  30. package/dist/esm/vertex-scene-tree.entry.js.map +1 -1
  31. package/dist/esm/vertex-viewer-measurement-precise.entry.js +2 -2
  32. package/dist/esm/vertex-viewer-measurement-precise.entry.js.map +1 -1
  33. package/dist/esm/vertex-viewer.entry.js +5 -5
  34. package/dist/esm/vertex-viewer.entry.js.map +1 -1
  35. package/dist/types/lib/config.d.ts +3 -0
  36. package/dist/viewer/p-7f12a2b5.js +5 -0
  37. package/dist/viewer/p-7f12a2b5.js.map +1 -0
  38. package/dist/viewer/{p-6f10fa0f.entry.js → p-b6ed2782.entry.js} +2 -2
  39. package/dist/viewer/p-b6ed2782.entry.js.map +1 -0
  40. package/dist/viewer/{p-f5017bcf.entry.js → p-c96d4307.entry.js} +2 -2
  41. package/dist/viewer/p-c96d4307.entry.js.map +1 -0
  42. package/dist/viewer/{p-ff28104f.entry.js → p-cc8b2821.entry.js} +2 -2
  43. package/dist/viewer/p-cc8b2821.entry.js.map +1 -0
  44. package/dist/viewer/viewer.esm.js +1 -1
  45. package/package.json +7 -7
  46. package/dist/cjs/config-ce05a8b9.js.map +0 -1
  47. package/dist/esm/config-976fdfa3.js.map +0 -1
  48. package/dist/viewer/p-2af36fde.js +0 -5
  49. package/dist/viewer/p-2af36fde.js.map +0 -1
  50. package/dist/viewer/p-6f10fa0f.entry.js.map +0 -1
  51. package/dist/viewer/p-f5017bcf.entry.js.map +0 -1
  52. package/dist/viewer/p-ff28104f.entry.js.map +0 -1
@@ -69,6 +69,10 @@ function getEnvironmentConfig(environment) {
69
69
  return config;
70
70
  }
71
71
  }
72
+ function parseAndValidateConfig(environment = 'platprod', config) {
73
+ const parsed = parseConfig(environment, config);
74
+ return validateConfig(sanitizeConfig(parsed));
75
+ }
72
76
  function parseConfig(environment = 'platprod', config) {
73
77
  if (typeof config === 'string') {
74
78
  config = JSON.parse(config);
@@ -81,7 +85,26 @@ function parseConfig(environment = 'platprod', config) {
81
85
  return browser_esm.objects.defaults(Object.assign({}, config), envConfig);
82
86
  }
83
87
  }
88
+ function sanitizeConfig(config) {
89
+ const sanitizedApiHost = config.network.apiHost.trim();
90
+ const sanitizedRenderingHost = config.network.renderingHost.trim();
91
+ const sanitizedSceneTreeHost = config.network.sceneTreeHost.trim();
92
+ const sanitizedSceneViewHost = config.network.sceneViewHost.trim();
93
+ return Object.assign(Object.assign({}, config), { network: Object.assign(Object.assign({}, config.network), { apiHost: sanitizedApiHost, renderingHost: sanitizedRenderingHost, sceneTreeHost: sanitizedSceneTreeHost, sceneViewHost: sanitizedSceneViewHost }) });
94
+ }
95
+ function validateConfig(config) {
96
+ validateUrlScheme(config.network, 'apiHost', 'https://');
97
+ validateUrlScheme(config.network, 'renderingHost', 'wss://');
98
+ validateUrlScheme(config.network, 'sceneTreeHost', 'https://');
99
+ validateUrlScheme(config.network, 'sceneViewHost', 'https://');
100
+ return config;
101
+ }
102
+ function validateUrlScheme(networkConfig, field, expectedScheme) {
103
+ if (!networkConfig[field].startsWith(expectedScheme)) {
104
+ throw new Error(`Invalid ${field} "${networkConfig[field]}" specified. The URL must start with the ${expectedScheme} scheme.`);
105
+ }
106
+ }
84
107
 
85
- exports.parseConfig = parseConfig;
108
+ exports.parseAndValidateConfig = parseAndValidateConfig;
86
109
 
87
- //# sourceMappingURL=config-ce05a8b9.js.map
110
+ //# sourceMappingURL=config-7341c85a.js.map
@@ -0,0 +1 @@
1
+ {"file":"config-7341c85a.js","mappings":";;;;;;;;;;AAAA,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAgBhC,MAAM,sBAAsB,GAAoB;EACrD,UAAU,EAAE,0BAA0B;CACvC;;AC2BM,MAAM,YAAY,GAAU;EACjC,qBAAqB,EAAE,IAAI;EAC3B,iBAAiB,EAAE,IAAI;EACvB,aAAa,EAAE,KAAK;EACpB,YAAY,EAAE,KAAK;EACnB,eAAe,EAAE,KAAK;EACtB,kCAAkC,EAAE,IAAI;CACzC;;ACPM,MAAM,wBAAwB,GAAsB;EACzD,oBAAoB,EAAE,CAAC;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C;EAE/D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CACxB,aAA4B,EAC5B,KAA0B,EAC1B,cAAsB;EAEtB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;IACpD,MAAM,IAAI,KAAK,CACb,WAAW,KAAK,KAAK,aAAa,CAAC,KAAK,CAAC,4CAA4C,cAAc,UAAU,CAC9G,CAAC;GACH;AACH;;;;","names":["Flags.defaultFlags","Events.defaultEventConfig","Animation.defaultAnimationConfig","Interactions.defaultInteractionConfig","Objects"],"sources":["./src/lib/types/animation.ts","./src/lib/types/flags.ts","./src/lib/types/interactions.ts","./src/lib/config.ts"],"sourcesContent":["const DEFAULT_ANIMATION_DURATION = 500;\n\nexport interface Animation {\n milliseconds: number;\n}\n\nexport function create(data: Partial<Animation> = {}): Animation {\n return {\n milliseconds: data.milliseconds || DEFAULT_ANIMATION_DURATION,\n };\n}\n\nexport interface AnimationConfig {\n durationMs: number;\n}\n\nexport const defaultAnimationConfig: AnimationConfig = {\n durationMs: DEFAULT_ANIMATION_DURATION,\n};\n","import { Objects } from '@vertexvis/utils';\n\ntype Flag =\n /**\n * Enables or disables a throttling of image delivery based on detected\n * network conditions.\n */\n | 'throttleFrameDelivery'\n\n /**\n * Enables or disables automatic quality adjustments of rendered frames to\n * improve the performance of delivering frames to the client.\n */\n | 'adaptiveRendering'\n\n /**\n * Enables or disables logging of WS message payloads.\n */\n | 'logWsMessages'\n\n /**\n * Toggles the logging of frame rates.\n */\n | 'logFrameRate'\n\n /**\n * Enables or disables the letterboxing of frames when the host dimensions\n * are larger than the supported maximum image size (1080p). By default\n * this option is disabled, and images will be scaled up to match the host.\n */\n | 'letterboxFrames'\n\n /**\n * Enables or disables the use of the `grpc.WebsocketTransport` for streaming\n * RPCs. By default this transport will be used, and streaming messages will\n * be sent over WebSocket.\n */\n | 'grpcUseStreamingWebSocketTransport';\n\n/**\n * A set of experimental features that can be enabled through the viewer's\n * config.\n */\nexport type Flags = { [K in Flag]: boolean };\n\nexport const defaultFlags: Flags = {\n throttleFrameDelivery: true,\n adaptiveRendering: true,\n logWsMessages: false,\n logFrameRate: false,\n letterboxFrames: false,\n grpcUseStreamingWebSocketTransport: true,\n};\n\nexport function createFlags(\n features: Partial<Flags>,\n fallbacks: Partial<Flags> = defaultFlags\n): Flags {\n return Objects.defaults(features, fallbacks, defaultFlags);\n}\n","export interface InteractionConfig {\n /**\n * The amount of movement required with a fine (mouse, trackpad, etc) pointer\n * input before an interaction is considered a movement that will update the\n * camera. This threshold is always scaled up based on the device's pixel ratio.\n */\n finePointerThreshold: number;\n\n /**\n * The amount of movement required with a coarse (touch, stylus, etc) pointer\n * input before an interaction is considered a movement that will update the\n * camera. This threshold is always scaled up based on the device's pixel ratio.\n */\n coarsePointerThreshold: number;\n\n /**\n * The amount of time before a movement is considered an interaction and will\n * update the camera.\n */\n interactionDelay: number;\n\n /**\n * Whether the `zoomCameraToPoint` interaction through the `InteractionApiPerspective`\n * will enforce a minimum distance when moving the camera. When set, the camera will be\n * able to move through geometry under the cursor, rather than being restricted by the\n * point under the cursor. Defaults to `true`.\n */\n useMinimumPerspectiveZoomDistance: boolean;\n\n /**\n * The amount of time before a wheel interaction is ended.\n *\n * This delay is used to support successive sets of mouse events, and not cause\n * abrupt and unexpected ending of mouse interactions during natural pauses in mouse\n * wheel usage.\n */\n mouseWheelInteractionEndDebounce: number;\n\n /**\n * Reverses which direction the mouse wheel considers positive or negative\n * for zoom interactions.\n */\n reverseMouseWheelDirection: boolean;\n}\n\nexport const defaultInteractionConfig: InteractionConfig = {\n finePointerThreshold: 1,\n coarsePointerThreshold: 3,\n interactionDelay: 75,\n useMinimumPerspectiveZoomDistance: true,\n mouseWheelInteractionEndDebounce: 350,\n reverseMouseWheelDirection: false,\n};\n","import { FrameDeliverySettings } from '@vertexvis/stream-api';\nimport {\n AdaptiveRenderingSettings,\n QualityOfServiceSettings,\n} from '@vertexvis/stream-api';\nimport { DeepPartial, Objects } from '@vertexvis/utils';\n\nimport { Environment } from './environment';\nimport { Animation, Events, Flags, Interactions } from './types';\n\ninterface NetworkConfig {\n apiHost: string;\n renderingHost: string;\n sceneTreeHost: string;\n sceneViewHost: string;\n}\n\nexport interface Config {\n network: NetworkConfig;\n flags: Flags.Flags;\n events: Events.EventConfig;\n animation: Animation.AnimationConfig;\n interactions: Interactions.InteractionConfig;\n EXPERIMENTAL_frameDelivery: Omit<\n FrameDeliverySettings,\n 'rateLimitingEnabled'\n >;\n EXPERIMENTAL_adaptiveRendering: Omit<AdaptiveRenderingSettings, 'enabled'>;\n EXPERIMENTAL_qualityOfService: QualityOfServiceSettings;\n EXPERIMENTAL_annotationPollingIntervalInMs: number | undefined;\n}\n\nexport type PartialConfig = DeepPartial<Config>;\n\nexport type ConfigProvider = () => Config;\n\nexport type InteractionConfigProvider = () => Interactions.InteractionConfig;\n\nconst config: Config = {\n network: {\n apiHost: 'https://platform.platprod.vertexvis.io',\n renderingHost: 'wss://stream.platprod.vertexvis.io',\n sceneTreeHost: 'https://scene-trees.platprod.vertexvis.io',\n sceneViewHost: 'https://scenes.platprod.vertexvis.io',\n },\n flags: Flags.defaultFlags,\n events: Events.defaultEventConfig,\n animation: Animation.defaultAnimationConfig,\n interactions: Interactions.defaultInteractionConfig,\n EXPERIMENTAL_frameDelivery: {},\n EXPERIMENTAL_adaptiveRendering: {},\n EXPERIMENTAL_qualityOfService: {},\n EXPERIMENTAL_annotationPollingIntervalInMs: undefined,\n};\n\nconst platdevConfig: Config = {\n ...config,\n network: {\n apiHost: 'https://platform.platdev.vertexvis.io',\n renderingHost: 'wss://stream.platdev.vertexvis.io',\n sceneTreeHost: 'https://scene-trees.platdev.vertexvis.io',\n sceneViewHost: 'https://scenes.platdev.vertexvis.io',\n },\n};\n\nconst platstagingConfig: Config = {\n ...config,\n network: {\n apiHost: 'https://platform.platstaging.vertexvis.io',\n renderingHost: 'wss://stream.platstaging.vertexvis.io',\n sceneTreeHost: 'https://scene-trees.platstaging.vertexvis.io',\n sceneViewHost: 'https://scenes.platstaging.vertexvis.io',\n },\n};\n\nfunction getEnvironmentConfig(environment: Environment): Config {\n switch (environment) {\n case 'platdev':\n return platdevConfig;\n case 'platstaging':\n return platstagingConfig;\n default:\n return config;\n }\n}\n\nexport function parseAndValidateConfig(\n environment: Environment = 'platprod',\n config?: string | PartialConfig\n): Config {\n const parsed = parseConfig(environment, config);\n\n return validateConfig(sanitizeConfig(parsed));\n}\n\nexport function parseConfig(\n environment: Environment = 'platprod',\n config?: string | PartialConfig\n): Config {\n if (typeof config === 'string') {\n config = JSON.parse(config) as PartialConfig;\n }\n\n const envConfig = getEnvironmentConfig(environment);\n\n if (config == null) {\n return envConfig;\n } else {\n return Objects.defaults({ ...config }, envConfig);\n }\n}\n\nexport function sanitizeConfig(config: Config): Config {\n const sanitizedApiHost = config.network.apiHost.trim();\n const sanitizedRenderingHost = config.network.renderingHost.trim();\n const sanitizedSceneTreeHost = config.network.sceneTreeHost.trim();\n const sanitizedSceneViewHost = config.network.sceneViewHost.trim();\n\n return {\n ...config,\n network: {\n ...config.network,\n apiHost: sanitizedApiHost,\n renderingHost: sanitizedRenderingHost,\n sceneTreeHost: sanitizedSceneTreeHost,\n sceneViewHost: sanitizedSceneViewHost,\n },\n };\n}\n\nexport function validateConfig(config: Config): Config {\n validateUrlScheme(config.network, 'apiHost', 'https://');\n validateUrlScheme(config.network, 'renderingHost', 'wss://');\n validateUrlScheme(config.network, 'sceneTreeHost', 'https://');\n validateUrlScheme(config.network, 'sceneViewHost', 'https://');\n\n return config;\n}\n\nfunction validateUrlScheme(\n networkConfig: NetworkConfig,\n field: keyof NetworkConfig,\n expectedScheme: string\n): void {\n if (!networkConfig[field].startsWith(expectedScheme)) {\n throw new Error(\n `Invalid ${field} \"${networkConfig[field]}\" specified. The URL must start with the ${expectedScheme} scheme.`\n );\n }\n}\n"],"version":3}
@@ -8,7 +8,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
8
8
  const index = require('./index-4ebe6acf.js');
9
9
  const bundle_esm = require('./bundle.esm-9f2927ac.js');
10
10
  const controller = require('./controller-6742e2f7.js');
11
- const config = require('./config-ce05a8b9.js');
11
+ const config = require('./config-7341c85a.js');
12
12
  const utils = require('./utils-3bf8e56b.js');
13
13
  const dom = require('./dom-ed5a5203.js');
14
14
  const row = require('./row-474ad32c.js');
@@ -736,7 +736,7 @@ const SceneTree = class {
736
736
  }
737
737
  }
738
738
  getConfig() {
739
- return config.parseConfig(this.configEnv, this.config);
739
+ return config.parseAndValidateConfig(this.configEnv, this.config);
740
740
  }
741
741
  ensureLayoutDefined() {
742
742
  let layout = this.el.querySelector('vertex-scene-tree-table-layout');
@@ -1 +1 @@
1
- {"file":"vertex-scene-tree.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,CAAC,mBAAmB;AAC1B,IAAI,MAAM,CAAC,mBAAmB;AAC9B,IAAI,SAAS,EAAE,EAAE;AACjB,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC/B,QAAQ,OAAO,UAAU,CAAC,WAAW;AACrC,YAAY,EAAE,CAAC;AACf,gBAAgB,UAAU,EAAE,KAAK;AACjC,gBAAgB,aAAa,EAAE,WAAW;AAC1C,oBAAoB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;AAClE,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS,EAAE,CAAC,CAAC,CAAC;AACd,KAAK,CAAC;AACN;AACA,MAAM,CAAC,kBAAkB;AACzB,IAAI,MAAM,CAAC,kBAAkB;AAC7B,IAAI,SAAS,EAAE,EAAE;AACjB,QAAQ,YAAY,CAAC,EAAE,CAAC,CAAC;AACzB,KAAK;;AClBL;AASO,MAAM,cAAc,GAA6C,CACtE,EAAE,OAAO,EAAE,EACX,QAAQ;E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;;;;;;;;;","names":["h","Fragment","forceUpdate","getSceneTreeContainsElement","isSceneTreeTableCellElement","SceneTreeAPIClient","webSocketSubscriptionTransportFactory","SceneTreeController","SceneTreeErrorDetails","SceneTreeErrorCode","Host","row","isLoadedRow","parseConfig","SCENE_ITEM_NAME_METADATA_KEY"],"sources":["../../node_modules/requestidlecallback-polyfill/index.js","./src/components/scene-tree/errors.tsx","./src/components/scene-tree/lib/viewer-ops.ts","./src/components/scene-tree/scene-tree.css?tag=vertex-scene-tree&encapsulation=shadow","./src/components/scene-tree/scene-tree.tsx"],"sourcesContent":["window.requestIdleCallback =\n window.requestIdleCallback ||\n function(cb) {\n var start = Date.now();\n return setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - start));\n },\n });\n }, 1);\n };\n\nwindow.cancelIdleCallback =\n window.cancelIdleCallback ||\n function(id) {\n clearTimeout(id);\n };\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Fragment, FunctionalComponent, h } from '@stencil/core';\n\nimport { SceneTreeErrorDetails } from './lib/errors';\n\ninterface SceneTreeErrorProps {\n details: SceneTreeErrorDetails;\n}\n\nexport const SceneTreeError: FunctionalComponent<SceneTreeErrorProps> = (\n { details },\n children\n) => {\n return (\n <div class=\"error\">\n <div class=\"error-section error-message\">\n <span>{details.message}</span>\n {details.link && (\n <Fragment>\n <span> See our </span>\n <a href={details.link} target=\"_blank\">\n documentation\n </a>{' '}\n <span> for more information.</span>\n </Fragment>\n )}\n </div>\n <div class=\"error-section\">{children}</div>\n </div>\n );\n};\n","export const DEFAULT_SCENE_TREE_OP_ANIMATION_MS = 500;\n\nexport interface ViewerItemOptions {\n suppliedCorrelationId?: string;\n}\nexport interface ViewerSelectItemOptions extends ViewerItemOptions {\n append?: boolean;\n range?: boolean;\n}\nexport interface ViewerIsolateItemOptions extends ViewerItemOptions {\n animationDurationMs?: number;\n}\n\nexport async function showItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => op.items.where((q) => q.withItemId(id)).show())\n .execute({ suppliedCorrelationId });\n}\n\nexport async function hideItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => op.items.where((q) => q.withItemId(id)).hide())\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function selectItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { append = false, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => [\n ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),\n op.items.where((q) => q.withItemId(id)).select(),\n ])\n .execute({ suppliedCorrelationId });\n}\n\nexport async function selectRangeInSceneTree(\n viewer: HTMLVertexViewerElement,\n start: number,\n end: number,\n { append = true, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => [\n ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),\n op.items.where((q) => q.withSceneTreeRange({ start, end })).select(),\n ])\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function selectFilterResults(\n viewer: HTMLVertexViewerElement,\n filter: string,\n keys: string[],\n exactMatch: boolean,\n removeHiddenResults: boolean,\n { append = false, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => [\n ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),\n op.items\n .where((q) =>\n q.withMetadata(filter, keys, exactMatch, removeHiddenResults)\n )\n .select(),\n ])\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function deselectItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => op.items.where((q) => q.withItemId(id)).deselect())\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function isolateItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId, animationDurationMs }: ViewerIsolateItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n await scene\n .elements((op) => [\n op.items.where((q) => q.all()).hide(),\n op.items.where((q) => q.withItemId(id)).show(),\n ])\n .execute({\n suppliedCorrelationId,\n });\n const renderResult = await scene\n .camera()\n .flyTo((q) => q.withItemId(id))\n .render({\n animation: {\n milliseconds: animationDurationMs ?? DEFAULT_SCENE_TREE_OP_ANIMATION_MS,\n },\n });\n await renderResult.onAnimationCompleted.once();\n}\n","@import url('../../css/button.css');\n\n:host {\n /**\n * @prop --scene-tree-toolbar-separator: A CSS border value that specifies the\n * border between scene tree toolbars.\n */\n --scene-tree-toolbar-separator: 1px solid var(--neutral-300);\n\n /**\n * @prop --scene-tree-default-font-family: The default font family to use for displaying\n * text within a <vertex-scene-tree>. Defaults to `unset`.\n */\n --scene-tree-default-font-family: unset;\n\n /**\n * @prop --scene-tree-default-font-size: The default font size to use for displaying\n * text within a <vertex-scene-tree>. Defaults to `unset`.\n */\n --scene-tree-default-font-size: unset;\n\n /**\n * @prop --scene-tree-default-font-color: The default font color to use for displaying\n * text within a <vertex-scene-tree>. Defaults to `unset`.\n */\n --scene-tree-default-font-color: unset;\n\n /**\n * @prop --scene-tree-selected-row-background-color: The background color to use when\n * displaying selected rows. This value always takes precedence if the row is selected.\n * Defaults to `unset`.\n */\n --scene-tree-selected-row-background-color: unset;\n\n /**\n * @prop --scene-tree-hovered-row-background-color: The background color to use when\n * displaying hovered rows. This value takes precedence only if the row is not selected.\n * Defaults to `unset`.\n */\n --scene-tree-hovered-row-background-color: unset;\n\n /**\n * @prop --scene-tree-row-background-color: The default background color to use for displaying\n * rows within a <vertex-scene-tree>. Defaults to `unset`, and will be overridden\n * by any depth specific background configuration.\n */\n --scene-tree-row-background-color: unset;\n\n /**\n * @prop --scene-tree-row-background-color-depth-n: The background color to use for n-depth\n * rows, where `n` is replaced with the desired depth. Defaults to `unset` for all\n * depths.\n *\n * @example\n * The following definition will cause all rows representing items at a depth of 1\n * to display with a red background, leaving all other depths unchanged.\n * \n * --scene-tree-row-background-color-depth-1: #ff0000\n */\n --scene-tree-row-background-color-depth-n: unset;\n\n width: 300px;\n height: 100%;\n user-select: none;\n -webkit-user-select: none;\n cursor: default;\n display: flex;\n flex-direction: column;\n}\n\n.rows-scroll {\n position: relative;\n height: var(--scene-tree-row-height, 0);\n flex-grow: 1;\n}\n\n.rows {\n position: relative;\n}\n\n.row {\n position: absolute;\n display: flex;\n align-items: center;\n width: 100%;\n height: var(--scene-tree-row-height);\n padding: var(--scene-tree-row-padding);\n box-sizing: border-box;\n}\n\n.row:hover {\n background-color: var(--scene-tree-row-hover-color);\n}\n\n.row.is-selected {\n background-color: var(--scene-tree-row-selected-color);\n}\n\n.expand-toggle {\n cursor: pointer;\n width: 16px;\n}\n\n.row-text {\n margin-left: 0.25rem;\n width: 100%;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.visibility-btn {\n display: flex;\n align-items: center;\n visibility: hidden;\n padding: 4px;\n}\n\n.visibility-btn.is-hidden {\n visibility: visible;\n}\n\n.row:hover .visibility-btn {\n visibility: visible;\n}\n\n.error,\n.empty-results {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: 0.875rem;\n width: 100%;\n height: 100%;\n padding: 1rem;\n box-sizing: border-box;\n justify-content: center;\n background-color: white;\n}\n\n.error-section {\n margin-top: 1rem;\n}\n\n.error-message {\n text-align: center;\n}\n\n.search-toolbar,\nslot[name='header']::slotted(*) {\n border-bottom: var(--scene-tree-toolbar-separator);\n}\n\nslot[name='footer']::slotted(:not(:last-child)) {\n border-top: var(--scene-tree-toolbar-separator);\n}\n\n.header {\n display: flex;\n flex-direction: column;\n}\n\n.footer {\n display: flex;\n flex-direction: column;\n}\n\n.loading {\n position: absolute;\n top: 150px;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n}\n","import 'requestidlecallback-polyfill';\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n forceUpdate,\n h,\n Host,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { ElementPool } from '@vertexvis/html-templates';\nimport { Node } from '@vertexvis/scene-tree-protos/scenetree/protos/domain_pb';\nimport { SceneTreeAPIClient } from '@vertexvis/scene-tree-protos/scenetree/protos/scene_tree_api_pb_service';\nimport { Disposable } from '@vertexvis/utils';\n\nimport { Config, parseConfig, PartialConfig } from '../../lib/config';\nimport { Environment } from '../../lib/environment';\nimport { isSceneTreeTableCellElement } from '../scene-tree-table-cell/utils';\nimport { SceneTreeError } from './errors';\nimport {\n FilterTreeOptions,\n SceneTreeController,\n SceneTreeState,\n} from './lib/controller';\nimport { getSceneTreeContainsElement } from './lib/dom';\nimport { SceneTreeErrorCode, SceneTreeErrorDetails } from './lib/errors';\nimport { webSocketSubscriptionTransportFactory } from './lib/grpc';\nimport { isLoadedRow, Row } from './lib/row';\nimport {\n deselectItem,\n hideItem,\n isolateItem,\n selectFilterResults,\n selectItem,\n selectRangeInSceneTree,\n showItem,\n} from './lib/viewer-ops';\nimport {\n FilterOptions,\n MetadataKey,\n RowArg,\n RowDataProvider,\n SCENE_ITEM_NAME_METADATA_KEY,\n SceneTreeOperationOptions,\n ScrollToOptions,\n SelectItemOptions,\n} from './types';\n\n/**\n * The minimum amount of time provided by requestIdleCallback to clear purged\n * data. A value too low may cause contention with browser rendering. A value\n * too high will cause too many items to be accumulated.\n */\nconst MIN_CLEAR_UNUSED_DATA_MS = 25;\n\ninterface StateMap {\n idleCallbackId?: number;\n resizeObserver?: ResizeObserver;\n componentLoaded: boolean;\n\n client?: SceneTreeAPIClient;\n jwt?: string;\n\n onStateChangeDisposable?: Disposable;\n subscribeDisposable?: Disposable;\n viewerDisposable?: Disposable;\n\n elementPool?: ElementPool;\n template?: HTMLTemplateElement;\n\n selectionPath?: string[];\n\n layoutEl?: HTMLVertexSceneTreeTableLayoutElement;\n}\n\ntype OperationHandler = (data: {\n viewer: HTMLVertexViewerElement;\n id: string;\n node: Node.AsObject;\n}) => void | Promise<void>;\n\n/**\n * @slot header - A slot that places content above the rows in the tree. By\n * default, a search toolbar will be placed in this slot. Elements can be\n * stacked by assigning multiple elements to this slot.\n * @slot footer - A slot that places content below the rows in the tree.\n * Elements can be stacked by assigning multiple elements to this slot.\n */\n@Component({\n tag: 'vertex-scene-tree',\n styleUrl: 'scene-tree.css',\n shadow: true,\n})\nexport class SceneTree {\n /**\n * The number of offscreen rows above and below the viewport to render. Having\n * a higher number reduces the chance of the browser not displaying a row\n * while scrolling.\n */\n @Prop()\n public overScanCount = 25;\n\n /**\n * A CSS selector that points to a `<vertex-viewer>` element. Either this\n * property or `viewer` must be set.\n */\n @Prop()\n public viewerSelector?: string;\n\n /**\n * An instance of a `<vertex-viewer>` element. Either this property or\n * `viewerSelector` must be set.\n */\n @Prop({ reflect: true, mutable: true })\n public viewer?: HTMLVertexViewerElement | null;\n\n /**\n * A callback that is invoked immediately before a row is about to rendered.\n * This callback can return additional data that can be bound to in a\n * template.\n *\n * @example\n *\n * ```html\n * <script>\n * const table = document.querySelector('vertex-scene-tree-table');\n * table.rowData = (row) => {\n * return { func: () => console.log('row', row.node.name) };\n * }\n * </script>\n *\n * <vertex-scene-tree>\n * <vertex-scene-tree-table>\n * <vertex-scene-tree-table-column>\n * <template>\n * <button event:click=\"{{row.data.func}}\">Hi</button>\n * </template>\n * </vertex-scene-tree-table-column>\n * </vertex-scene-tree-table>\n * </vertex-scene-tree>\n * ```\n */\n @Prop()\n public rowData?: RowDataProvider;\n\n /**\n * An object to configure the scene tree.\n */\n @Prop()\n public config?: PartialConfig | string;\n\n /**\n * Sets the default environment for the viewer. This setting is used for\n * auto-configuring network hosts.\n *\n * Use the `config` property for manually setting hosts.\n */\n @Prop()\n public configEnv: Environment = 'platprod';\n\n @Prop({ mutable: true })\n public controller?: SceneTreeController;\n\n /**\n * A set of options to configure scene tree searching behavior.\n */\n @Prop({ mutable: true })\n public searchOptions: FilterOptions = {};\n\n /**\n * @deprecated Use `searchOptions`\n * Indicates whether the metadata search should use an exact match.\n */\n @Prop({ mutable: true })\n public metadataSearchExactMatch = false;\n\n /**\n * @deprecated Use `searchOptions`\n * A list of the metadata keys that a scene tree search should be performed on.\n */\n @Prop({ mutable: true })\n public metadataSearchKeys: MetadataKey[] = [];\n\n /**\n * A list of part metadata keys that will be made available to each row. This\n * metadata can be used for data binding inside the scene tree's template.\n *\n * **Note:** for the values of these metadata keys to be evaluated for search,\n * they must be provided to the `metadataSearchKeys` specified in the `searchOptions`.\n * Otherwise the search will only be performed against the item name.\n */\n @Prop()\n public metadataKeys: MetadataKey[] = [];\n\n /**\n * The duration of operations with animations, in milliseconds, when a user performs\n * an action that results in an animation such as isolate. Defaults to 500ms.\n */\n @Prop()\n public operationAnimationDuration = 500;\n\n /**\n * An event that is emitted when this <vertex-scene-tree> encounters a connection\n * error.\n */\n @Event()\n public connectionError!: EventEmitter<SceneTreeErrorDetails>;\n\n /**\n * An event that is emitted when the first row of this <vertex-scene-tree> has\n * been rendered.\n */\n @Event()\n public firstRowRendered!: EventEmitter<void>;\n\n @State()\n private rows: Row[] = [];\n\n @State()\n private totalRows = 0;\n\n @State()\n private showLoader = false;\n\n @State()\n private showEmptyResults = false;\n\n /**\n * This stores internal state that you want to preserve across live-reloads,\n * but shouldn't trigger a refresh if the data changes. Marking this with\n * @State to allow to preserve state across live-reloads.\n */\n @State()\n private stateMap: StateMap = {\n componentLoaded: false,\n };\n\n @State()\n private errorDetails: SceneTreeErrorDetails | undefined;\n\n @State()\n private attemptingRetry = false;\n\n @Element()\n private el!: HTMLElement;\n\n private lastSelectedItemId?: string;\n private firstCellRendered = false;\n\n /**\n * Schedules a render of the rows in the scene tree. Useful if any custom\n * data in your scene tree has changed, and you want to update the row's\n * contents.\n *\n * **Note:** This is an asynchronous operation. The update may happen on the\n * next frame.\n */\n @Method()\n public async invalidateRows(): Promise<void> {\n forceUpdate(this.getLayoutElement());\n }\n\n /**\n * Scrolls the tree to the given row index.\n *\n * @param index An index of the row to scroll to.\n * @param options A set of options to configure the scrolling behavior.\n */\n @Method()\n public async scrollToIndex(\n index: number,\n options: ScrollToOptions = {}\n ): Promise<void> {\n const { animate, position = 'middle' } = options;\n const i = Math.max(0, Math.min(index, this.totalRows));\n\n const top = this.getScrollToPosition(i, position);\n\n this.getLayoutElement().scrollToPosition(top, {\n behavior: animate ? 'smooth' : undefined,\n });\n }\n\n /**\n * Scrolls the tree to an item with the given ID. If the node for the item is\n * not expanded, the tree will expand each of its parent nodes.\n *\n * @param itemId An ID of an item to scroll to.\n * @param options A set of options to configure the scrolling behavior.\n * @returns A promise that resolves when the operation is finished.\n */\n @Method()\n public async scrollToItem(\n itemId: string,\n options: ScrollToOptions = {}\n ): Promise<void> {\n const rowsBeforeExpand = this.totalRows;\n const index = await this.controller?.expandParentNodes(itemId);\n\n if (index != null && rowsBeforeExpand !== this.totalRows) {\n return new Promise((resolve) => {\n const layoutEl = this.getLayoutElement();\n const handleLayoutRendered = async (): Promise<void> => {\n layoutEl.removeEventListener('layoutRendered', handleLayoutRendered);\n await this.scrollToIndex(index, options);\n resolve();\n };\n\n layoutEl.addEventListener('layoutRendered', handleLayoutRendered);\n });\n } else if (index != null) {\n await this.scrollToIndex(index, options);\n }\n }\n\n /**\n * Performs an API call to expand all nodes in the tree.\n */\n @Method()\n public async expandAll(): Promise<void> {\n await this.controller?.expandAll();\n }\n\n /**\n * Performs an API call to collapse all nodes in the tree.\n */\n @Method()\n public async collapseAll(): Promise<void> {\n await this.controller?.collapseAll();\n }\n\n /**\n * Performs an API call that will expand the node associated to the specified\n * row or row index.\n *\n * @param row A row, row index, or node to expand.\n */\n @Method()\n public async expandItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ id, node }) => {\n if (!node.expanded) {\n await this.controller?.expandNode(id);\n }\n });\n }\n\n /**\n * Performs an API call that will collapse the node associated to the\n * specified row or row index.\n *\n * @param row A row, row index, or node to collapse.\n */\n @Method()\n public async collapseItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ id, node }) => {\n if (node.expanded) {\n await this.controller?.collapseNode(id);\n }\n });\n }\n\n /**\n * Performs an API call that will either expand or collapse the node\n * associated to the given row or row index.\n *\n * @param row The row, row index, or node to collapse or expand.\n */\n @Method()\n public async toggleExpandItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ node }) => {\n if (node.expanded) {\n await this.collapseItem(node);\n } else {\n await this.expandItem(node);\n }\n });\n }\n\n /**\n * Performs an API call that will either hide or show the item associated to\n * the given row or row index.\n *\n * @param row The row, row index, or node to toggle visibility.\n */\n @Method()\n public async toggleItemVisibility(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.visible || node.partiallyVisible) {\n await hideItem(viewer, id);\n } else {\n await showItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will hide the item associated to the given row\n * or row index.\n *\n * @param row The row, row index, or node to hide.\n */\n @Method()\n public async hideItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.visible) {\n await hideItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will show the item associated to the given row\n * or row index.\n *\n * @param row The row, row index, or node to show.\n */\n @Method()\n public async showItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (!node.visible) {\n await showItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will select the item associated to the given row\n * or row index.\n *\n * This method supports a `recurseParent` option that allows for recursively\n * selecting the next unselected parent node. This behavior is considered\n * stateful. Each call to `selectItem` will track the ancestry of the passed\n * in `rowArg`. If calling `selectItem` with a row not belonging to the\n * ancestry of a previous selection, then this method will perform a standard\n * selection.\n *\n * @param row The row, row index or node to select.\n * @param options A set of options to configure selection behavior.\n */\n @Method()\n public async selectItem(\n row: RowArg,\n { recurseParent, ...options }: SelectItemOptions = {}\n ): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id }) => {\n const ancestors = (await this.controller?.fetchNodeAncestors(id)) || [];\n const isInPath = this.stateMap.selectionPath?.includes(id);\n\n if (recurseParent && isInPath) {\n const nextNode = ancestors.find(({ selected }) => !selected);\n if (nextNode != null) {\n await this.selectItem(nextNode, options);\n this.lastSelectedItemId = id;\n }\n } else if (options.range && this.lastSelectedItemId != null) {\n const currentRowIndex = await this.controller?.expandParentNodes(id);\n const previouslySelectedIndex =\n await this.controller?.expandParentNodes(this.lastSelectedItemId);\n\n if (previouslySelectedIndex && currentRowIndex) {\n const start = Math.min(previouslySelectedIndex, currentRowIndex);\n const end = Math.max(previouslySelectedIndex, currentRowIndex);\n await selectRangeInSceneTree(viewer, start, end, options);\n }\n } else {\n await selectItem(viewer, id, options);\n this.lastSelectedItemId = id;\n }\n\n this.stateMap.selectionPath = [\n ...ancestors.map(({ id }) => id?.hex || ''),\n id,\n ];\n });\n }\n\n /**\n * Performs an API call that will deselect the item associated to the given\n * row or row index.\n *\n * @param row The row, row index, or node to deselect.\n */\n @Method()\n public async deselectItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.selected) {\n this.lastSelectedItemId = undefined;\n await deselectItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will show only the item associated to\n * the given row or row index and fit the camera to the item's bounding box.\n *\n * @param row The row, row index, or node to isolate.\n */\n @Method()\n public async isolateItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id }) => {\n await isolateItem(viewer, id, {\n animationDurationMs: this.operationAnimationDuration,\n });\n });\n }\n\n /**\n * Returns a row at the given index. If the row data has not been loaded,\n * returns `undefined`.\n *\n * @param index The index of the row.\n * @returns A row, or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public async getRowAtIndex(index: number): Promise<Row> {\n return this.rows[index];\n }\n\n /**\n * Returns the row data from the given mouse or pointer event. The event must\n * originate from a `vertex-scene-tree-table-cell` contained by this element,\n * otherwise `undefined` is returned.\n *\n * @param event A mouse or pointer event that originated from this component.\n * @returns A row, or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public async getRowForEvent(event: MouseEvent | PointerEvent): Promise<Row> {\n const { clientY, target } = event;\n\n if (\n target != null &&\n this.errorDetails == null &&\n getSceneTreeContainsElement(this.el, target as HTMLElement) &&\n isSceneTreeTableCellElement(target)\n ) {\n return this.getRowAtClientY(clientY);\n } else {\n return undefined;\n }\n }\n\n /**\n * Returns the row data from the given vertical client position.\n *\n * @param clientY The vertical client position.\n * @returns A row or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public getRowAtClientY(clientY: number): Promise<Row> {\n const layoutEl = this.getLayoutElement();\n const top = layoutEl.layoutOffset;\n const index = Math.floor(\n (clientY - top + layoutEl.scrollOffset) / layoutEl.rowHeight\n );\n return this.getRowAtIndex(index);\n }\n\n /**\n * Performs an async request that will filter the displayed items in the tree\n * that match the given term and options.\n *\n * @param term The filter term.\n * @param options The options to apply to the filter.\n * @returns A promise that completes when the request has completed. Note,\n * items are displayed asynchronously. So the displayed items may not reflect\n * the result of this filter when the promise completes.\n */\n @Method()\n public async filterItems(\n term: string,\n options: FilterTreeOptions = {}\n ): Promise<void> {\n const optionsAsFilterOptions: FilterOptions = {\n ...options,\n metadataSearchKeys: options.columns,\n };\n const columnsToSearch = this.getMetadataSearchKeys(optionsAsFilterOptions);\n\n return this.controller?.filter(term, {\n ...options,\n columns: columnsToSearch,\n });\n }\n\n /**\n * Performs an async request that will select the filtered items in the tree\n * that match the given term.\n *\n * @param term The filter term.\n * @returns A promise that completes when the request has completed.\n */\n @Method()\n public async selectFilteredItems(\n term: string,\n options?: SceneTreeOperationOptions\n ): Promise<void> {\n if (this.viewer != null) {\n const metadataSearchKeys =\n this.searchOptions?.metadataSearchKeys ?? this.metadataSearchKeys;\n const definedMetadataKeys =\n metadataSearchKeys.length > 0 ? metadataSearchKeys : this.metadataKeys;\n\n const columnsToSearch =\n definedMetadataKeys.length > 0\n ? definedMetadataKeys\n : ['VERTEX_SCENE_ITEM_NAME'];\n\n const shouldSearchExactMatch =\n this.searchOptions?.exactMatch ?? this.metadataSearchExactMatch;\n const shouldSearchRemoveHiddenItems =\n this.searchOptions?.removeHiddenItems ?? false;\n\n await selectFilterResults(\n this.viewer,\n term,\n columnsToSearch,\n shouldSearchExactMatch,\n shouldSearchRemoveHiddenItems,\n {\n append: false,\n ...options,\n }\n );\n }\n }\n\n /**\n * Fetches the metadata keys that are available to the scene tree. Metadata\n * keys can be assigned to the scene tree using the `metadataKeys` property.\n * The scene tree will fetch this metadata and make these values available\n * for data binding.\n *\n * @returns A promise that resolves with the names of available keys.\n */\n @Method()\n public async fetchMetadataKeys(): Promise<MetadataKey[]> {\n return this.controller?.fetchMetadataKeys() ?? [];\n }\n\n /**\n * @ignore\n */\n protected disconnectedCallback(): void {\n this.stateMap.viewerDisposable?.dispose();\n this.controller?.cancel();\n }\n\n /**\n * @ignore\n */\n protected connectedCallback(): void {\n this.connectToViewer();\n }\n\n /**\n * @ignore\n */\n protected componentWillLoad(): void {\n if (this.controller == null) {\n const { sceneTreeHost } = this.getConfig().network;\n const client = new SceneTreeAPIClient(\n sceneTreeHost,\n this.getConfig().flags.grpcUseStreamingWebSocketTransport\n ? {\n transport: webSocketSubscriptionTransportFactory,\n }\n : undefined\n );\n this.controller = new SceneTreeController(client, 100);\n this.controller?.setMetadataKeys(this.metadataKeys);\n }\n\n this.stateMap.onStateChangeDisposable = this.controller.onStateChange.on(\n (state) => this.handleControllerStateChange(state)\n );\n\n this.connectToViewer();\n }\n\n /**\n * @ignore\n */\n protected async componentDidLoad(): Promise<void> {\n this.ensureLayoutDefined();\n this.updateLayoutElement();\n\n const layoutEl = this.getLayoutElement();\n const resizeObserver = new ResizeObserver(() => {\n this.invalidateRows();\n });\n resizeObserver.observe(layoutEl);\n this.stateMap.resizeObserver = resizeObserver;\n\n this.stateMap.componentLoaded = true;\n\n this.controller?.setMetadataKeys(this.metadataKeys);\n\n if (this.viewer == null) {\n this.errorDetails = new SceneTreeErrorDetails(\n 'MISSING_VIEWER',\n SceneTreeErrorCode.MISSING_VIEWER\n );\n }\n }\n\n public componentWillRender(): void {\n // The controller can load data prior to the first render\n // ensure that this renders any time the state changes.\n this.updateLayoutElement();\n }\n\n /**\n * @ignore\n */\n protected render(): h.JSX.IntrinsicElements {\n return (\n <Host>\n <div class=\"header\">\n <slot name=\"header\">\n <vertex-scene-tree-toolbar class=\"search-toolbar\">\n <vertex-scene-tree-search controller={this.controller} />\n </vertex-scene-tree-toolbar>\n </slot>\n </div>\n\n {this.errorDetails != null && this.renderError(this.errorDetails)}\n\n {this.errorDetails == null && (\n <div class=\"rows-scroll\">\n {this.showLoader && (\n <slot name=\"loading\">\n <vertex-viewer-spinner class=\"loading\" size=\"md\" />\n </slot>\n )}\n <slot />\n {this.showEmptyResults && (\n <slot name=\"empty-results\">\n <div class=\"empty-results\">No Results Found.</div>\n </slot>\n )}\n </div>\n )}\n\n <div class=\"footer\">\n <slot name=\"footer\" />\n </div>\n </Host>\n );\n }\n\n private renderError(details: SceneTreeErrorDetails): h.JSX.IntrinsicElements {\n if (details.code !== SceneTreeErrorCode.SCENE_TREE_DISABLED) {\n return (\n <SceneTreeError details={details}>\n <button\n class=\"button button-secondary\"\n onClick={() => this.retryConnectToViewer()}\n disabled={this.attemptingRetry}\n >\n Retry\n </button>\n </SceneTreeError>\n );\n } else {\n return <SceneTreeError details={details} />;\n }\n }\n\n /**\n * @ignore\n */\n @Watch('viewer')\n protected handleViewerChanged(\n newViewer: HTMLVertexViewerElement | undefined,\n oldViewer: HTMLVertexViewerElement | undefined\n ): void {\n // StencilJS will invoke this callback even before the component has been\n // loaded. According to their docs, this shouldn't happen. Return if the\n // component hasn't been loaded.\n // See https://stenciljs.com/docs/reactive-data#watch-decorator\n if (!this.stateMap.componentLoaded) {\n return;\n }\n\n this.connectToViewer();\n }\n\n /**\n * @ignore\n */\n @Watch('controller')\n protected handleControllerChanged(newController: SceneTreeController): void {\n // StencilJS will invoke this callback even before the component has been\n // loaded. According to their docs, this shouldn't happen. Return if the\n // component hasn't been loaded.\n // See https://stenciljs.com/docs/reactive-data#watch-decorator\n if (!this.stateMap.componentLoaded) {\n return;\n }\n\n this.stateMap.onStateChangeDisposable?.dispose();\n\n this.stateMap.onStateChangeDisposable = newController.onStateChange.on(\n (state) => this.handleControllerStateChange(state)\n );\n\n newController.setMetadataKeys(this.metadataKeys);\n }\n\n /**\n * @ignore\n */\n @Watch('metadataKeys')\n protected handleMetadataKeysChanged(): void {\n this.controller?.setMetadataKeys(this.metadataKeys);\n }\n\n private retryConnectToViewer(): void {\n this.attemptingRetry = true;\n this.errorDetails = undefined;\n this.connectToViewer();\n }\n\n private connectToViewer(): void {\n this.stateMap.viewerDisposable?.dispose();\n\n if (this.viewer == null && this.viewerSelector != null) {\n this.viewer = document.querySelector(this.viewerSelector) as\n | HTMLVertexViewerElement\n | undefined;\n }\n\n if (this.viewer != null) {\n this.stateMap.viewerDisposable = this.controller?.connectToViewer(\n this.viewer\n );\n } else {\n this.attemptingRetry = false;\n }\n }\n\n private scheduleClearUnusedData(): void {\n if (this.stateMap.idleCallbackId != null) {\n window.cancelIdleCallback(this.stateMap.idleCallbackId);\n }\n\n this.stateMap.idleCallbackId = window.requestIdleCallback((foo) => {\n const remaining = foo.timeRemaining?.();\n\n if (remaining == null || remaining >= MIN_CLEAR_UNUSED_DATA_MS) {\n const layoutEl = this.getLayoutElement();\n const startIndex = layoutEl.viewportStartIndex;\n const endIndex = layoutEl.viewportEndIndex;\n const [start, end] =\n this.controller?.getPageIndexesForRange(startIndex, endIndex) || [];\n\n if (start != null && end != null) {\n this.controller?.invalidatePagesOutsideRange(start, end, 50);\n }\n } else {\n this.scheduleClearUnusedData();\n }\n });\n }\n\n private handleControllerStateChange(state: SceneTreeState): void {\n this.showLoader = !!state.shouldShowLoading;\n this.showEmptyResults = !!state.shouldShowEmptyResults;\n this.rows = state.rows;\n this.totalRows = state.totalRows;\n\n if (state.connection.type === 'failure') {\n this.errorDetails = state.connection.details;\n this.connectionError.emit(state.connection.details);\n } else if (state.connection.type === 'disconnected') {\n this.errorDetails = new SceneTreeErrorDetails(\n 'DISCONNECTED',\n SceneTreeErrorCode.DISCONNECTED\n );\n } else {\n this.errorDetails = undefined;\n }\n\n if (\n state.connection.type === 'connected' ||\n state.connection.type === 'failure'\n ) {\n this.attemptingRetry = false;\n }\n }\n\n private async performRowOperation(\n rowOrIndex: number | Row | Node.AsObject,\n op: OperationHandler\n ): Promise<void> {\n const row =\n typeof rowOrIndex === 'number' ? this.rows[rowOrIndex] : rowOrIndex;\n\n if (row == null) {\n throw new Error(`Cannot perform scene tree operation. Row not found.`);\n }\n\n const node = isLoadedRow(row) ? row.node : row;\n\n if (node.id == null) {\n throw new Error(`Cannot perform scene tree operation. ID is undefined.`);\n }\n\n if (this.viewer == null) {\n throw new Error(\n `Cannot perform scene tree operation. Cannot get reference to viewer.`\n );\n }\n\n await op({ viewer: this.viewer, id: node.id.hex, node });\n }\n\n @Listen('search')\n protected async handleSearch(event: CustomEvent<string>): Promise<void> {\n const columnsToSearch = this.getMetadataSearchKeys(this.searchOptions);\n\n const shouldSearchExactMatch =\n this.searchOptions?.exactMatch ?? this.metadataSearchExactMatch;\n const shouldSearchRemoveHiddenItems =\n this.searchOptions?.removeHiddenItems ?? false;\n\n try {\n await this.filterItems(event.detail, {\n columns: columnsToSearch,\n exactMatch: shouldSearchExactMatch,\n removeHiddenItems: shouldSearchRemoveHiddenItems,\n });\n } catch (e) {\n console.error('Failed to filter tree with exception: ', e);\n }\n }\n\n @Listen('cellLoaded')\n protected async handleCellLoaded(): Promise<void> {\n if (!this.firstCellRendered && this.rows.length > 0) {\n this.firstCellRendered = true;\n this.firstRowRendered.emit();\n }\n }\n\n private getScrollToPosition(\n index: number,\n position: ScrollToOptions['position']\n ): number {\n const layoutEl = this.getLayoutElement();\n const constrainedIndex = Math.max(0, Math.min(index, this.totalRows - 1));\n const viewportHeight = layoutEl.layoutHeight ?? 0;\n const rowHeight = layoutEl.rowHeight;\n\n if (position === 'start') {\n return constrainedIndex * rowHeight;\n } else if (position === 'middle') {\n const rowCenterY = constrainedIndex * rowHeight + rowHeight / 2;\n return rowCenterY - viewportHeight / 2;\n } else {\n const rowBottomY = constrainedIndex * rowHeight + rowHeight;\n return rowBottomY - viewportHeight;\n }\n }\n\n private getConfig(): Config {\n return parseConfig(this.configEnv, this.config);\n }\n\n private ensureLayoutDefined(): void {\n let layout = this.el.querySelector('vertex-scene-tree-table-layout');\n if (layout == null) {\n layout = document.createElement('vertex-scene-tree-table-layout');\n layout.innerHTML = `\n <vertex-scene-tree-table-column>\n <template>\n <vertex-scene-tree-table-cell prop:value=\"{{row.node.name}}\" expand-toggle isolate-button visibility-toggle></vertex-scene-tree-table-cell>\n </template>\n </vertex-scene-tree-table-column>\n `;\n\n this.el.appendChild(layout);\n }\n this.stateMap.layoutEl = layout;\n }\n\n private updateLayoutElement(): void {\n const layout = this.stateMap.layoutEl;\n if (layout != null) {\n layout.rows = this.rows;\n layout.tree = this.el as HTMLVertexSceneTreeElement;\n layout.totalRows = this.totalRows;\n layout.controller = this.controller;\n layout.rowData = this.rowData;\n } else if (!this.stateMap.componentLoaded && this.totalRows > 0) {\n console.debug(\n 'Scene tree has rows, but the component has not yet rendered'\n );\n }\n }\n\n private getLayoutElement(): HTMLVertexSceneTreeTableLayoutElement {\n if (this.stateMap.layoutEl != null) {\n return this.stateMap.layoutEl;\n } else {\n throw new Error('Layout element is undefined');\n }\n }\n\n private getMetadataSearchKeys(options: FilterOptions): string[] | undefined {\n const metadataSearchKeys =\n options?.metadataSearchKeys ?? this.metadataSearchKeys;\n const shouldSearchExactMatch =\n options?.exactMatch ?? this.metadataSearchExactMatch;\n\n if (shouldSearchExactMatch) {\n // If we're performing an exact match search, we want to include the searched\n // metadata keys if provided. In the case that none have been provided, simply\n // fall back the item name.\n const definedMetadataKeys =\n metadataSearchKeys.length > 0\n ? metadataSearchKeys\n : [SCENE_ITEM_NAME_METADATA_KEY];\n\n return definedMetadataKeys;\n } else if (metadataSearchKeys.length > 0) {\n // If we're not performing an exact match search, and a set of metadata keys\n // to search against have been provided, we want to include those in the request.\n return metadataSearchKeys;\n }\n\n // If we're not performing an exact match search, and we have no provided metadata\n // search keys, we can perform a name-only search, and omit the array of keys.\n return undefined;\n }\n}\n"],"version":3}
1
+ {"file":"vertex-scene-tree.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,CAAC,mBAAmB;AAC1B,IAAI,MAAM,CAAC,mBAAmB;AAC9B,IAAI,SAAS,EAAE,EAAE;AACjB,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC/B,QAAQ,OAAO,UAAU,CAAC,WAAW;AACrC,YAAY,EAAE,CAAC;AACf,gBAAgB,UAAU,EAAE,KAAK;AACjC,gBAAgB,aAAa,EAAE,WAAW;AAC1C,oBAAoB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;AAClE,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS,EAAE,CAAC,CAAC,CAAC;AACd,KAAK,CAAC;AACN;AACA,MAAM,CAAC,kBAAkB;AACzB,IAAI,MAAM,CAAC,kBAAkB;AAC7B,IAAI,SAAS,EAAE,EAAE;AACjB,QAAQ,YAAY,CAAC,EAAE,CAAC,CAAC;AACzB,KAAK;;AClBL;AASO,MAAM,cAAc,GAA6C,CACtE,EAAE,OAAO,EAAE,EACX,QAAQ;EAER,QACEA,iBAAK,KAAK,EAAC,OAAO;IAChBA,iBAAK,KAAK,EAAC,6BAA6B;MACtCA,sBAAO,OAAO,CAAC,OAAO,CAAQ;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;MACxB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,EAAgC,CAAC;MACpD,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;MAClC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;MACpC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;KAC/B;SAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE;MAC/D,OAAO,CAAC,KAAK,CACX,6DAA6D,CAC9D,CAAC;KACH;GACF;EAEO,gBAAgB;IACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,EAAE;MAClC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;KAC/B;SAAM;MACL,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;GACF;EAEO,qBAAqB,CAAC,OAAsB;;IAClD,MAAM,kBAAkB,GACtB,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,mCAAI,IAAI,CAAC,kBAAkB,CAAC;IACzD,MAAM,sBAAsB,GAC1B,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,mCAAI,IAAI,CAAC,wBAAwB,CAAC;IAEvD,IAAI,sBAAsB,EAAE;;;;MAI1B,MAAM,mBAAmB,GACvB,kBAAkB,CAAC,MAAM,GAAG,CAAC;UACzB,kBAAkB;UAClB,CAACC,kCAA4B,CAAC,CAAC;MAErC,OAAO,mBAAmB,CAAC;KAC5B;SAAM,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;;;MAGxC,OAAO,kBAAkB,CAAC;KAC3B;;;IAID,OAAO,SAAS,CAAC;GAClB;;;;;;;;;;;;","names":["h","Fragment","forceUpdate","getSceneTreeContainsElement","isSceneTreeTableCellElement","SceneTreeAPIClient","webSocketSubscriptionTransportFactory","SceneTreeController","SceneTreeErrorDetails","SceneTreeErrorCode","Host","row","isLoadedRow","parseAndValidateConfig","SCENE_ITEM_NAME_METADATA_KEY"],"sources":["../../node_modules/requestidlecallback-polyfill/index.js","./src/components/scene-tree/errors.tsx","./src/components/scene-tree/lib/viewer-ops.ts","./src/components/scene-tree/scene-tree.css?tag=vertex-scene-tree&encapsulation=shadow","./src/components/scene-tree/scene-tree.tsx"],"sourcesContent":["window.requestIdleCallback =\n window.requestIdleCallback ||\n function(cb) {\n var start = Date.now();\n return setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - start));\n },\n });\n }, 1);\n };\n\nwindow.cancelIdleCallback =\n window.cancelIdleCallback ||\n function(id) {\n clearTimeout(id);\n };\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Fragment, FunctionalComponent, h } from '@stencil/core';\n\nimport { SceneTreeErrorDetails } from './lib/errors';\n\ninterface SceneTreeErrorProps {\n details: SceneTreeErrorDetails;\n}\n\nexport const SceneTreeError: FunctionalComponent<SceneTreeErrorProps> = (\n { details },\n children\n) => {\n return (\n <div class=\"error\">\n <div class=\"error-section error-message\">\n <span>{details.message}</span>\n {details.link && (\n <Fragment>\n <span> See our </span>\n <a href={details.link} target=\"_blank\">\n documentation\n </a>{' '}\n <span> for more information.</span>\n </Fragment>\n )}\n </div>\n <div class=\"error-section\">{children}</div>\n </div>\n );\n};\n","export const DEFAULT_SCENE_TREE_OP_ANIMATION_MS = 500;\n\nexport interface ViewerItemOptions {\n suppliedCorrelationId?: string;\n}\nexport interface ViewerSelectItemOptions extends ViewerItemOptions {\n append?: boolean;\n range?: boolean;\n}\nexport interface ViewerIsolateItemOptions extends ViewerItemOptions {\n animationDurationMs?: number;\n}\n\nexport async function showItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => op.items.where((q) => q.withItemId(id)).show())\n .execute({ suppliedCorrelationId });\n}\n\nexport async function hideItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => op.items.where((q) => q.withItemId(id)).hide())\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function selectItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { append = false, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => [\n ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),\n op.items.where((q) => q.withItemId(id)).select(),\n ])\n .execute({ suppliedCorrelationId });\n}\n\nexport async function selectRangeInSceneTree(\n viewer: HTMLVertexViewerElement,\n start: number,\n end: number,\n { append = true, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => [\n ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),\n op.items.where((q) => q.withSceneTreeRange({ start, end })).select(),\n ])\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function selectFilterResults(\n viewer: HTMLVertexViewerElement,\n filter: string,\n keys: string[],\n exactMatch: boolean,\n removeHiddenResults: boolean,\n { append = false, suppliedCorrelationId }: ViewerSelectItemOptions\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => [\n ...(append ? [] : [op.items.where((q) => q.all()).deselect()]),\n op.items\n .where((q) =>\n q.withMetadata(filter, keys, exactMatch, removeHiddenResults)\n )\n .select(),\n ])\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function deselectItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId }: ViewerItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n return scene\n .elements((op) => op.items.where((q) => q.withItemId(id)).deselect())\n .execute({\n suppliedCorrelationId,\n });\n}\n\nexport async function isolateItem(\n viewer: HTMLVertexViewerElement,\n id: string,\n { suppliedCorrelationId, animationDurationMs }: ViewerIsolateItemOptions = {}\n): Promise<void> {\n const scene = await viewer.scene();\n await scene\n .elements((op) => [\n op.items.where((q) => q.all()).hide(),\n op.items.where((q) => q.withItemId(id)).show(),\n ])\n .execute({\n suppliedCorrelationId,\n });\n const renderResult = await scene\n .camera()\n .flyTo((q) => q.withItemId(id))\n .render({\n animation: {\n milliseconds: animationDurationMs ?? DEFAULT_SCENE_TREE_OP_ANIMATION_MS,\n },\n });\n await renderResult.onAnimationCompleted.once();\n}\n","@import url('../../css/button.css');\n\n:host {\n /**\n * @prop --scene-tree-toolbar-separator: A CSS border value that specifies the\n * border between scene tree toolbars.\n */\n --scene-tree-toolbar-separator: 1px solid var(--neutral-300);\n\n /**\n * @prop --scene-tree-default-font-family: The default font family to use for displaying\n * text within a <vertex-scene-tree>. Defaults to `unset`.\n */\n --scene-tree-default-font-family: unset;\n\n /**\n * @prop --scene-tree-default-font-size: The default font size to use for displaying\n * text within a <vertex-scene-tree>. Defaults to `unset`.\n */\n --scene-tree-default-font-size: unset;\n\n /**\n * @prop --scene-tree-default-font-color: The default font color to use for displaying\n * text within a <vertex-scene-tree>. Defaults to `unset`.\n */\n --scene-tree-default-font-color: unset;\n\n /**\n * @prop --scene-tree-selected-row-background-color: The background color to use when\n * displaying selected rows. This value always takes precedence if the row is selected.\n * Defaults to `unset`.\n */\n --scene-tree-selected-row-background-color: unset;\n\n /**\n * @prop --scene-tree-hovered-row-background-color: The background color to use when\n * displaying hovered rows. This value takes precedence only if the row is not selected.\n * Defaults to `unset`.\n */\n --scene-tree-hovered-row-background-color: unset;\n\n /**\n * @prop --scene-tree-row-background-color: The default background color to use for displaying\n * rows within a <vertex-scene-tree>. Defaults to `unset`, and will be overridden\n * by any depth specific background configuration.\n */\n --scene-tree-row-background-color: unset;\n\n /**\n * @prop --scene-tree-row-background-color-depth-n: The background color to use for n-depth\n * rows, where `n` is replaced with the desired depth. Defaults to `unset` for all\n * depths.\n *\n * @example\n * The following definition will cause all rows representing items at a depth of 1\n * to display with a red background, leaving all other depths unchanged.\n * \n * --scene-tree-row-background-color-depth-1: #ff0000\n */\n --scene-tree-row-background-color-depth-n: unset;\n\n width: 300px;\n height: 100%;\n user-select: none;\n -webkit-user-select: none;\n cursor: default;\n display: flex;\n flex-direction: column;\n}\n\n.rows-scroll {\n position: relative;\n height: var(--scene-tree-row-height, 0);\n flex-grow: 1;\n}\n\n.rows {\n position: relative;\n}\n\n.row {\n position: absolute;\n display: flex;\n align-items: center;\n width: 100%;\n height: var(--scene-tree-row-height);\n padding: var(--scene-tree-row-padding);\n box-sizing: border-box;\n}\n\n.row:hover {\n background-color: var(--scene-tree-row-hover-color);\n}\n\n.row.is-selected {\n background-color: var(--scene-tree-row-selected-color);\n}\n\n.expand-toggle {\n cursor: pointer;\n width: 16px;\n}\n\n.row-text {\n margin-left: 0.25rem;\n width: 100%;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.visibility-btn {\n display: flex;\n align-items: center;\n visibility: hidden;\n padding: 4px;\n}\n\n.visibility-btn.is-hidden {\n visibility: visible;\n}\n\n.row:hover .visibility-btn {\n visibility: visible;\n}\n\n.error,\n.empty-results {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: 0.875rem;\n width: 100%;\n height: 100%;\n padding: 1rem;\n box-sizing: border-box;\n justify-content: center;\n background-color: white;\n}\n\n.error-section {\n margin-top: 1rem;\n}\n\n.error-message {\n text-align: center;\n}\n\n.search-toolbar,\nslot[name='header']::slotted(*) {\n border-bottom: var(--scene-tree-toolbar-separator);\n}\n\nslot[name='footer']::slotted(:not(:last-child)) {\n border-top: var(--scene-tree-toolbar-separator);\n}\n\n.header {\n display: flex;\n flex-direction: column;\n}\n\n.footer {\n display: flex;\n flex-direction: column;\n}\n\n.loading {\n position: absolute;\n top: 150px;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n}\n","import 'requestidlecallback-polyfill';\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n forceUpdate,\n h,\n Host,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { ElementPool } from '@vertexvis/html-templates';\nimport { Node } from '@vertexvis/scene-tree-protos/scenetree/protos/domain_pb';\nimport { SceneTreeAPIClient } from '@vertexvis/scene-tree-protos/scenetree/protos/scene_tree_api_pb_service';\nimport { Disposable } from '@vertexvis/utils';\n\nimport {\n Config,\n parseAndValidateConfig,\n PartialConfig,\n} from '../../lib/config';\nimport { Environment } from '../../lib/environment';\nimport { isSceneTreeTableCellElement } from '../scene-tree-table-cell/utils';\nimport { SceneTreeError } from './errors';\nimport {\n FilterTreeOptions,\n SceneTreeController,\n SceneTreeState,\n} from './lib/controller';\nimport { getSceneTreeContainsElement } from './lib/dom';\nimport { SceneTreeErrorCode, SceneTreeErrorDetails } from './lib/errors';\nimport { webSocketSubscriptionTransportFactory } from './lib/grpc';\nimport { isLoadedRow, Row } from './lib/row';\nimport {\n deselectItem,\n hideItem,\n isolateItem,\n selectFilterResults,\n selectItem,\n selectRangeInSceneTree,\n showItem,\n} from './lib/viewer-ops';\nimport {\n FilterOptions,\n MetadataKey,\n RowArg,\n RowDataProvider,\n SCENE_ITEM_NAME_METADATA_KEY,\n SceneTreeOperationOptions,\n ScrollToOptions,\n SelectItemOptions,\n} from './types';\n\n/**\n * The minimum amount of time provided by requestIdleCallback to clear purged\n * data. A value too low may cause contention with browser rendering. A value\n * too high will cause too many items to be accumulated.\n */\nconst MIN_CLEAR_UNUSED_DATA_MS = 25;\n\ninterface StateMap {\n idleCallbackId?: number;\n resizeObserver?: ResizeObserver;\n componentLoaded: boolean;\n\n client?: SceneTreeAPIClient;\n jwt?: string;\n\n onStateChangeDisposable?: Disposable;\n subscribeDisposable?: Disposable;\n viewerDisposable?: Disposable;\n\n elementPool?: ElementPool;\n template?: HTMLTemplateElement;\n\n selectionPath?: string[];\n\n layoutEl?: HTMLVertexSceneTreeTableLayoutElement;\n}\n\ntype OperationHandler = (data: {\n viewer: HTMLVertexViewerElement;\n id: string;\n node: Node.AsObject;\n}) => void | Promise<void>;\n\n/**\n * @slot header - A slot that places content above the rows in the tree. By\n * default, a search toolbar will be placed in this slot. Elements can be\n * stacked by assigning multiple elements to this slot.\n * @slot footer - A slot that places content below the rows in the tree.\n * Elements can be stacked by assigning multiple elements to this slot.\n */\n@Component({\n tag: 'vertex-scene-tree',\n styleUrl: 'scene-tree.css',\n shadow: true,\n})\nexport class SceneTree {\n /**\n * The number of offscreen rows above and below the viewport to render. Having\n * a higher number reduces the chance of the browser not displaying a row\n * while scrolling.\n */\n @Prop()\n public overScanCount = 25;\n\n /**\n * A CSS selector that points to a `<vertex-viewer>` element. Either this\n * property or `viewer` must be set.\n */\n @Prop()\n public viewerSelector?: string;\n\n /**\n * An instance of a `<vertex-viewer>` element. Either this property or\n * `viewerSelector` must be set.\n */\n @Prop({ reflect: true, mutable: true })\n public viewer?: HTMLVertexViewerElement | null;\n\n /**\n * A callback that is invoked immediately before a row is about to rendered.\n * This callback can return additional data that can be bound to in a\n * template.\n *\n * @example\n *\n * ```html\n * <script>\n * const table = document.querySelector('vertex-scene-tree-table');\n * table.rowData = (row) => {\n * return { func: () => console.log('row', row.node.name) };\n * }\n * </script>\n *\n * <vertex-scene-tree>\n * <vertex-scene-tree-table>\n * <vertex-scene-tree-table-column>\n * <template>\n * <button event:click=\"{{row.data.func}}\">Hi</button>\n * </template>\n * </vertex-scene-tree-table-column>\n * </vertex-scene-tree-table>\n * </vertex-scene-tree>\n * ```\n */\n @Prop()\n public rowData?: RowDataProvider;\n\n /**\n * An object to configure the scene tree.\n */\n @Prop()\n public config?: PartialConfig | string;\n\n /**\n * Sets the default environment for the viewer. This setting is used for\n * auto-configuring network hosts.\n *\n * Use the `config` property for manually setting hosts.\n */\n @Prop()\n public configEnv: Environment = 'platprod';\n\n @Prop({ mutable: true })\n public controller?: SceneTreeController;\n\n /**\n * A set of options to configure scene tree searching behavior.\n */\n @Prop({ mutable: true })\n public searchOptions: FilterOptions = {};\n\n /**\n * @deprecated Use `searchOptions`\n * Indicates whether the metadata search should use an exact match.\n */\n @Prop({ mutable: true })\n public metadataSearchExactMatch = false;\n\n /**\n * @deprecated Use `searchOptions`\n * A list of the metadata keys that a scene tree search should be performed on.\n */\n @Prop({ mutable: true })\n public metadataSearchKeys: MetadataKey[] = [];\n\n /**\n * A list of part metadata keys that will be made available to each row. This\n * metadata can be used for data binding inside the scene tree's template.\n *\n * **Note:** for the values of these metadata keys to be evaluated for search,\n * they must be provided to the `metadataSearchKeys` specified in the `searchOptions`.\n * Otherwise the search will only be performed against the item name.\n */\n @Prop()\n public metadataKeys: MetadataKey[] = [];\n\n /**\n * The duration of operations with animations, in milliseconds, when a user performs\n * an action that results in an animation such as isolate. Defaults to 500ms.\n */\n @Prop()\n public operationAnimationDuration = 500;\n\n /**\n * An event that is emitted when this <vertex-scene-tree> encounters a connection\n * error.\n */\n @Event()\n public connectionError!: EventEmitter<SceneTreeErrorDetails>;\n\n /**\n * An event that is emitted when the first row of this <vertex-scene-tree> has\n * been rendered.\n */\n @Event()\n public firstRowRendered!: EventEmitter<void>;\n\n @State()\n private rows: Row[] = [];\n\n @State()\n private totalRows = 0;\n\n @State()\n private showLoader = false;\n\n @State()\n private showEmptyResults = false;\n\n /**\n * This stores internal state that you want to preserve across live-reloads,\n * but shouldn't trigger a refresh if the data changes. Marking this with\n * @State to allow to preserve state across live-reloads.\n */\n @State()\n private stateMap: StateMap = {\n componentLoaded: false,\n };\n\n @State()\n private errorDetails: SceneTreeErrorDetails | undefined;\n\n @State()\n private attemptingRetry = false;\n\n @Element()\n private el!: HTMLElement;\n\n private lastSelectedItemId?: string;\n private firstCellRendered = false;\n\n /**\n * Schedules a render of the rows in the scene tree. Useful if any custom\n * data in your scene tree has changed, and you want to update the row's\n * contents.\n *\n * **Note:** This is an asynchronous operation. The update may happen on the\n * next frame.\n */\n @Method()\n public async invalidateRows(): Promise<void> {\n forceUpdate(this.getLayoutElement());\n }\n\n /**\n * Scrolls the tree to the given row index.\n *\n * @param index An index of the row to scroll to.\n * @param options A set of options to configure the scrolling behavior.\n */\n @Method()\n public async scrollToIndex(\n index: number,\n options: ScrollToOptions = {}\n ): Promise<void> {\n const { animate, position = 'middle' } = options;\n const i = Math.max(0, Math.min(index, this.totalRows));\n\n const top = this.getScrollToPosition(i, position);\n\n this.getLayoutElement().scrollToPosition(top, {\n behavior: animate ? 'smooth' : undefined,\n });\n }\n\n /**\n * Scrolls the tree to an item with the given ID. If the node for the item is\n * not expanded, the tree will expand each of its parent nodes.\n *\n * @param itemId An ID of an item to scroll to.\n * @param options A set of options to configure the scrolling behavior.\n * @returns A promise that resolves when the operation is finished.\n */\n @Method()\n public async scrollToItem(\n itemId: string,\n options: ScrollToOptions = {}\n ): Promise<void> {\n const rowsBeforeExpand = this.totalRows;\n const index = await this.controller?.expandParentNodes(itemId);\n\n if (index != null && rowsBeforeExpand !== this.totalRows) {\n return new Promise((resolve) => {\n const layoutEl = this.getLayoutElement();\n const handleLayoutRendered = async (): Promise<void> => {\n layoutEl.removeEventListener('layoutRendered', handleLayoutRendered);\n await this.scrollToIndex(index, options);\n resolve();\n };\n\n layoutEl.addEventListener('layoutRendered', handleLayoutRendered);\n });\n } else if (index != null) {\n await this.scrollToIndex(index, options);\n }\n }\n\n /**\n * Performs an API call to expand all nodes in the tree.\n */\n @Method()\n public async expandAll(): Promise<void> {\n await this.controller?.expandAll();\n }\n\n /**\n * Performs an API call to collapse all nodes in the tree.\n */\n @Method()\n public async collapseAll(): Promise<void> {\n await this.controller?.collapseAll();\n }\n\n /**\n * Performs an API call that will expand the node associated to the specified\n * row or row index.\n *\n * @param row A row, row index, or node to expand.\n */\n @Method()\n public async expandItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ id, node }) => {\n if (!node.expanded) {\n await this.controller?.expandNode(id);\n }\n });\n }\n\n /**\n * Performs an API call that will collapse the node associated to the\n * specified row or row index.\n *\n * @param row A row, row index, or node to collapse.\n */\n @Method()\n public async collapseItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ id, node }) => {\n if (node.expanded) {\n await this.controller?.collapseNode(id);\n }\n });\n }\n\n /**\n * Performs an API call that will either expand or collapse the node\n * associated to the given row or row index.\n *\n * @param row The row, row index, or node to collapse or expand.\n */\n @Method()\n public async toggleExpandItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ node }) => {\n if (node.expanded) {\n await this.collapseItem(node);\n } else {\n await this.expandItem(node);\n }\n });\n }\n\n /**\n * Performs an API call that will either hide or show the item associated to\n * the given row or row index.\n *\n * @param row The row, row index, or node to toggle visibility.\n */\n @Method()\n public async toggleItemVisibility(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.visible || node.partiallyVisible) {\n await hideItem(viewer, id);\n } else {\n await showItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will hide the item associated to the given row\n * or row index.\n *\n * @param row The row, row index, or node to hide.\n */\n @Method()\n public async hideItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.visible) {\n await hideItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will show the item associated to the given row\n * or row index.\n *\n * @param row The row, row index, or node to show.\n */\n @Method()\n public async showItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (!node.visible) {\n await showItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will select the item associated to the given row\n * or row index.\n *\n * This method supports a `recurseParent` option that allows for recursively\n * selecting the next unselected parent node. This behavior is considered\n * stateful. Each call to `selectItem` will track the ancestry of the passed\n * in `rowArg`. If calling `selectItem` with a row not belonging to the\n * ancestry of a previous selection, then this method will perform a standard\n * selection.\n *\n * @param row The row, row index or node to select.\n * @param options A set of options to configure selection behavior.\n */\n @Method()\n public async selectItem(\n row: RowArg,\n { recurseParent, ...options }: SelectItemOptions = {}\n ): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id }) => {\n const ancestors = (await this.controller?.fetchNodeAncestors(id)) || [];\n const isInPath = this.stateMap.selectionPath?.includes(id);\n\n if (recurseParent && isInPath) {\n const nextNode = ancestors.find(({ selected }) => !selected);\n if (nextNode != null) {\n await this.selectItem(nextNode, options);\n this.lastSelectedItemId = id;\n }\n } else if (options.range && this.lastSelectedItemId != null) {\n const currentRowIndex = await this.controller?.expandParentNodes(id);\n const previouslySelectedIndex =\n await this.controller?.expandParentNodes(this.lastSelectedItemId);\n\n if (previouslySelectedIndex && currentRowIndex) {\n const start = Math.min(previouslySelectedIndex, currentRowIndex);\n const end = Math.max(previouslySelectedIndex, currentRowIndex);\n await selectRangeInSceneTree(viewer, start, end, options);\n }\n } else {\n await selectItem(viewer, id, options);\n this.lastSelectedItemId = id;\n }\n\n this.stateMap.selectionPath = [\n ...ancestors.map(({ id }) => id?.hex || ''),\n id,\n ];\n });\n }\n\n /**\n * Performs an API call that will deselect the item associated to the given\n * row or row index.\n *\n * @param row The row, row index, or node to deselect.\n */\n @Method()\n public async deselectItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id, node }) => {\n if (node.selected) {\n this.lastSelectedItemId = undefined;\n await deselectItem(viewer, id);\n }\n });\n }\n\n /**\n * Performs an API call that will show only the item associated to\n * the given row or row index and fit the camera to the item's bounding box.\n *\n * @param row The row, row index, or node to isolate.\n */\n @Method()\n public async isolateItem(row: RowArg): Promise<void> {\n await this.performRowOperation(row, async ({ viewer, id }) => {\n await isolateItem(viewer, id, {\n animationDurationMs: this.operationAnimationDuration,\n });\n });\n }\n\n /**\n * Returns a row at the given index. If the row data has not been loaded,\n * returns `undefined`.\n *\n * @param index The index of the row.\n * @returns A row, or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public async getRowAtIndex(index: number): Promise<Row> {\n return this.rows[index];\n }\n\n /**\n * Returns the row data from the given mouse or pointer event. The event must\n * originate from a `vertex-scene-tree-table-cell` contained by this element,\n * otherwise `undefined` is returned.\n *\n * @param event A mouse or pointer event that originated from this component.\n * @returns A row, or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public async getRowForEvent(event: MouseEvent | PointerEvent): Promise<Row> {\n const { clientY, target } = event;\n\n if (\n target != null &&\n this.errorDetails == null &&\n getSceneTreeContainsElement(this.el, target as HTMLElement) &&\n isSceneTreeTableCellElement(target)\n ) {\n return this.getRowAtClientY(clientY);\n } else {\n return undefined;\n }\n }\n\n /**\n * Returns the row data from the given vertical client position.\n *\n * @param clientY The vertical client position.\n * @returns A row or `undefined` if the row hasn't been loaded.\n */\n @Method()\n public getRowAtClientY(clientY: number): Promise<Row> {\n const layoutEl = this.getLayoutElement();\n const top = layoutEl.layoutOffset;\n const index = Math.floor(\n (clientY - top + layoutEl.scrollOffset) / layoutEl.rowHeight\n );\n return this.getRowAtIndex(index);\n }\n\n /**\n * Performs an async request that will filter the displayed items in the tree\n * that match the given term and options.\n *\n * @param term The filter term.\n * @param options The options to apply to the filter.\n * @returns A promise that completes when the request has completed. Note,\n * items are displayed asynchronously. So the displayed items may not reflect\n * the result of this filter when the promise completes.\n */\n @Method()\n public async filterItems(\n term: string,\n options: FilterTreeOptions = {}\n ): Promise<void> {\n const optionsAsFilterOptions: FilterOptions = {\n ...options,\n metadataSearchKeys: options.columns,\n };\n const columnsToSearch = this.getMetadataSearchKeys(optionsAsFilterOptions);\n\n return this.controller?.filter(term, {\n ...options,\n columns: columnsToSearch,\n });\n }\n\n /**\n * Performs an async request that will select the filtered items in the tree\n * that match the given term.\n *\n * @param term The filter term.\n * @returns A promise that completes when the request has completed.\n */\n @Method()\n public async selectFilteredItems(\n term: string,\n options?: SceneTreeOperationOptions\n ): Promise<void> {\n if (this.viewer != null) {\n const metadataSearchKeys =\n this.searchOptions?.metadataSearchKeys ?? this.metadataSearchKeys;\n const definedMetadataKeys =\n metadataSearchKeys.length > 0 ? metadataSearchKeys : this.metadataKeys;\n\n const columnsToSearch =\n definedMetadataKeys.length > 0\n ? definedMetadataKeys\n : ['VERTEX_SCENE_ITEM_NAME'];\n\n const shouldSearchExactMatch =\n this.searchOptions?.exactMatch ?? this.metadataSearchExactMatch;\n const shouldSearchRemoveHiddenItems =\n this.searchOptions?.removeHiddenItems ?? false;\n\n await selectFilterResults(\n this.viewer,\n term,\n columnsToSearch,\n shouldSearchExactMatch,\n shouldSearchRemoveHiddenItems,\n {\n append: false,\n ...options,\n }\n );\n }\n }\n\n /**\n * Fetches the metadata keys that are available to the scene tree. Metadata\n * keys can be assigned to the scene tree using the `metadataKeys` property.\n * The scene tree will fetch this metadata and make these values available\n * for data binding.\n *\n * @returns A promise that resolves with the names of available keys.\n */\n @Method()\n public async fetchMetadataKeys(): Promise<MetadataKey[]> {\n return this.controller?.fetchMetadataKeys() ?? [];\n }\n\n /**\n * @ignore\n */\n protected disconnectedCallback(): void {\n this.stateMap.viewerDisposable?.dispose();\n this.controller?.cancel();\n }\n\n /**\n * @ignore\n */\n protected connectedCallback(): void {\n this.connectToViewer();\n }\n\n /**\n * @ignore\n */\n protected componentWillLoad(): void {\n if (this.controller == null) {\n const { sceneTreeHost } = this.getConfig().network;\n const client = new SceneTreeAPIClient(\n sceneTreeHost,\n this.getConfig().flags.grpcUseStreamingWebSocketTransport\n ? {\n transport: webSocketSubscriptionTransportFactory,\n }\n : undefined\n );\n this.controller = new SceneTreeController(client, 100);\n this.controller?.setMetadataKeys(this.metadataKeys);\n }\n\n this.stateMap.onStateChangeDisposable = this.controller.onStateChange.on(\n (state) => this.handleControllerStateChange(state)\n );\n\n this.connectToViewer();\n }\n\n /**\n * @ignore\n */\n protected async componentDidLoad(): Promise<void> {\n this.ensureLayoutDefined();\n this.updateLayoutElement();\n\n const layoutEl = this.getLayoutElement();\n const resizeObserver = new ResizeObserver(() => {\n this.invalidateRows();\n });\n resizeObserver.observe(layoutEl);\n this.stateMap.resizeObserver = resizeObserver;\n\n this.stateMap.componentLoaded = true;\n\n this.controller?.setMetadataKeys(this.metadataKeys);\n\n if (this.viewer == null) {\n this.errorDetails = new SceneTreeErrorDetails(\n 'MISSING_VIEWER',\n SceneTreeErrorCode.MISSING_VIEWER\n );\n }\n }\n\n public componentWillRender(): void {\n // The controller can load data prior to the first render\n // ensure that this renders any time the state changes.\n this.updateLayoutElement();\n }\n\n /**\n * @ignore\n */\n protected render(): h.JSX.IntrinsicElements {\n return (\n <Host>\n <div class=\"header\">\n <slot name=\"header\">\n <vertex-scene-tree-toolbar class=\"search-toolbar\">\n <vertex-scene-tree-search controller={this.controller} />\n </vertex-scene-tree-toolbar>\n </slot>\n </div>\n\n {this.errorDetails != null && this.renderError(this.errorDetails)}\n\n {this.errorDetails == null && (\n <div class=\"rows-scroll\">\n {this.showLoader && (\n <slot name=\"loading\">\n <vertex-viewer-spinner class=\"loading\" size=\"md\" />\n </slot>\n )}\n <slot />\n {this.showEmptyResults && (\n <slot name=\"empty-results\">\n <div class=\"empty-results\">No Results Found.</div>\n </slot>\n )}\n </div>\n )}\n\n <div class=\"footer\">\n <slot name=\"footer\" />\n </div>\n </Host>\n );\n }\n\n private renderError(details: SceneTreeErrorDetails): h.JSX.IntrinsicElements {\n if (details.code !== SceneTreeErrorCode.SCENE_TREE_DISABLED) {\n return (\n <SceneTreeError details={details}>\n <button\n class=\"button button-secondary\"\n onClick={() => this.retryConnectToViewer()}\n disabled={this.attemptingRetry}\n >\n Retry\n </button>\n </SceneTreeError>\n );\n } else {\n return <SceneTreeError details={details} />;\n }\n }\n\n /**\n * @ignore\n */\n @Watch('viewer')\n protected handleViewerChanged(\n newViewer: HTMLVertexViewerElement | undefined,\n oldViewer: HTMLVertexViewerElement | undefined\n ): void {\n // StencilJS will invoke this callback even before the component has been\n // loaded. According to their docs, this shouldn't happen. Return if the\n // component hasn't been loaded.\n // See https://stenciljs.com/docs/reactive-data#watch-decorator\n if (!this.stateMap.componentLoaded) {\n return;\n }\n\n this.connectToViewer();\n }\n\n /**\n * @ignore\n */\n @Watch('controller')\n protected handleControllerChanged(newController: SceneTreeController): void {\n // StencilJS will invoke this callback even before the component has been\n // loaded. According to their docs, this shouldn't happen. Return if the\n // component hasn't been loaded.\n // See https://stenciljs.com/docs/reactive-data#watch-decorator\n if (!this.stateMap.componentLoaded) {\n return;\n }\n\n this.stateMap.onStateChangeDisposable?.dispose();\n\n this.stateMap.onStateChangeDisposable = newController.onStateChange.on(\n (state) => this.handleControllerStateChange(state)\n );\n\n newController.setMetadataKeys(this.metadataKeys);\n }\n\n /**\n * @ignore\n */\n @Watch('metadataKeys')\n protected handleMetadataKeysChanged(): void {\n this.controller?.setMetadataKeys(this.metadataKeys);\n }\n\n private retryConnectToViewer(): void {\n this.attemptingRetry = true;\n this.errorDetails = undefined;\n this.connectToViewer();\n }\n\n private connectToViewer(): void {\n this.stateMap.viewerDisposable?.dispose();\n\n if (this.viewer == null && this.viewerSelector != null) {\n this.viewer = document.querySelector(this.viewerSelector) as\n | HTMLVertexViewerElement\n | undefined;\n }\n\n if (this.viewer != null) {\n this.stateMap.viewerDisposable = this.controller?.connectToViewer(\n this.viewer\n );\n } else {\n this.attemptingRetry = false;\n }\n }\n\n private scheduleClearUnusedData(): void {\n if (this.stateMap.idleCallbackId != null) {\n window.cancelIdleCallback(this.stateMap.idleCallbackId);\n }\n\n this.stateMap.idleCallbackId = window.requestIdleCallback((foo) => {\n const remaining = foo.timeRemaining?.();\n\n if (remaining == null || remaining >= MIN_CLEAR_UNUSED_DATA_MS) {\n const layoutEl = this.getLayoutElement();\n const startIndex = layoutEl.viewportStartIndex;\n const endIndex = layoutEl.viewportEndIndex;\n const [start, end] =\n this.controller?.getPageIndexesForRange(startIndex, endIndex) || [];\n\n if (start != null && end != null) {\n this.controller?.invalidatePagesOutsideRange(start, end, 50);\n }\n } else {\n this.scheduleClearUnusedData();\n }\n });\n }\n\n private handleControllerStateChange(state: SceneTreeState): void {\n this.showLoader = !!state.shouldShowLoading;\n this.showEmptyResults = !!state.shouldShowEmptyResults;\n this.rows = state.rows;\n this.totalRows = state.totalRows;\n\n if (state.connection.type === 'failure') {\n this.errorDetails = state.connection.details;\n this.connectionError.emit(state.connection.details);\n } else if (state.connection.type === 'disconnected') {\n this.errorDetails = new SceneTreeErrorDetails(\n 'DISCONNECTED',\n SceneTreeErrorCode.DISCONNECTED\n );\n } else {\n this.errorDetails = undefined;\n }\n\n if (\n state.connection.type === 'connected' ||\n state.connection.type === 'failure'\n ) {\n this.attemptingRetry = false;\n }\n }\n\n private async performRowOperation(\n rowOrIndex: number | Row | Node.AsObject,\n op: OperationHandler\n ): Promise<void> {\n const row =\n typeof rowOrIndex === 'number' ? this.rows[rowOrIndex] : rowOrIndex;\n\n if (row == null) {\n throw new Error(`Cannot perform scene tree operation. Row not found.`);\n }\n\n const node = isLoadedRow(row) ? row.node : row;\n\n if (node.id == null) {\n throw new Error(`Cannot perform scene tree operation. ID is undefined.`);\n }\n\n if (this.viewer == null) {\n throw new Error(\n `Cannot perform scene tree operation. Cannot get reference to viewer.`\n );\n }\n\n await op({ viewer: this.viewer, id: node.id.hex, node });\n }\n\n @Listen('search')\n protected async handleSearch(event: CustomEvent<string>): Promise<void> {\n const columnsToSearch = this.getMetadataSearchKeys(this.searchOptions);\n\n const shouldSearchExactMatch =\n this.searchOptions?.exactMatch ?? this.metadataSearchExactMatch;\n const shouldSearchRemoveHiddenItems =\n this.searchOptions?.removeHiddenItems ?? false;\n\n try {\n await this.filterItems(event.detail, {\n columns: columnsToSearch,\n exactMatch: shouldSearchExactMatch,\n removeHiddenItems: shouldSearchRemoveHiddenItems,\n });\n } catch (e) {\n console.error('Failed to filter tree with exception: ', e);\n }\n }\n\n @Listen('cellLoaded')\n protected async handleCellLoaded(): Promise<void> {\n if (!this.firstCellRendered && this.rows.length > 0) {\n this.firstCellRendered = true;\n this.firstRowRendered.emit();\n }\n }\n\n private getScrollToPosition(\n index: number,\n position: ScrollToOptions['position']\n ): number {\n const layoutEl = this.getLayoutElement();\n const constrainedIndex = Math.max(0, Math.min(index, this.totalRows - 1));\n const viewportHeight = layoutEl.layoutHeight ?? 0;\n const rowHeight = layoutEl.rowHeight;\n\n if (position === 'start') {\n return constrainedIndex * rowHeight;\n } else if (position === 'middle') {\n const rowCenterY = constrainedIndex * rowHeight + rowHeight / 2;\n return rowCenterY - viewportHeight / 2;\n } else {\n const rowBottomY = constrainedIndex * rowHeight + rowHeight;\n return rowBottomY - viewportHeight;\n }\n }\n\n private getConfig(): Config {\n return parseAndValidateConfig(this.configEnv, this.config);\n }\n\n private ensureLayoutDefined(): void {\n let layout = this.el.querySelector('vertex-scene-tree-table-layout');\n if (layout == null) {\n layout = document.createElement('vertex-scene-tree-table-layout');\n layout.innerHTML = `\n <vertex-scene-tree-table-column>\n <template>\n <vertex-scene-tree-table-cell prop:value=\"{{row.node.name}}\" expand-toggle isolate-button visibility-toggle></vertex-scene-tree-table-cell>\n </template>\n </vertex-scene-tree-table-column>\n `;\n\n this.el.appendChild(layout);\n }\n this.stateMap.layoutEl = layout;\n }\n\n private updateLayoutElement(): void {\n const layout = this.stateMap.layoutEl;\n if (layout != null) {\n layout.rows = this.rows;\n layout.tree = this.el as HTMLVertexSceneTreeElement;\n layout.totalRows = this.totalRows;\n layout.controller = this.controller;\n layout.rowData = this.rowData;\n } else if (!this.stateMap.componentLoaded && this.totalRows > 0) {\n console.debug(\n 'Scene tree has rows, but the component has not yet rendered'\n );\n }\n }\n\n private getLayoutElement(): HTMLVertexSceneTreeTableLayoutElement {\n if (this.stateMap.layoutEl != null) {\n return this.stateMap.layoutEl;\n } else {\n throw new Error('Layout element is undefined');\n }\n }\n\n private getMetadataSearchKeys(options: FilterOptions): string[] | undefined {\n const metadataSearchKeys =\n options?.metadataSearchKeys ?? this.metadataSearchKeys;\n const shouldSearchExactMatch =\n options?.exactMatch ?? this.metadataSearchExactMatch;\n\n if (shouldSearchExactMatch) {\n // If we're performing an exact match search, we want to include the searched\n // metadata keys if provided. In the case that none have been provided, simply\n // fall back the item name.\n const definedMetadataKeys =\n metadataSearchKeys.length > 0\n ? metadataSearchKeys\n : [SCENE_ITEM_NAME_METADATA_KEY];\n\n return definedMetadataKeys;\n } else if (metadataSearchKeys.length > 0) {\n // If we're not performing an exact match search, and a set of metadata keys\n // to search against have been provided, we want to include those in the request.\n return metadataSearchKeys;\n }\n\n // If we're not performing an exact match search, and we have no provided metadata\n // search keys, we can perform a name-only search, and omit the array of keys.\n return undefined;\n }\n}\n"],"version":3}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-4ebe6acf.js');
9
9
  const scene_view_api_pb_service = require('./scene_view_api_pb_service-e2953a1d.js');
10
- const config = require('./config-ce05a8b9.js');
10
+ const config = require('./config-7341c85a.js');
11
11
  const entities = require('./entities-fa92c13e.js');
12
12
  require('./streamAttributes-cc511afd.js');
13
13
  require('./scene_view_api_pb-6a03d7c1.js');
@@ -206,7 +206,7 @@ const ViewerMeasurementPrecise = class {
206
206
  }
207
207
  setupController() {
208
208
  var _a;
209
- const config$1 = config.parseConfig(this.configEnv, this.config);
209
+ const config$1 = config.parseAndValidateConfig(this.configEnv, this.config);
210
210
  const client = new scene_view_api_pb_service.SceneViewAPIClient_1(config$1.network.sceneViewHost);
211
211
  this.measurementController = new entities.MeasurementController(this.measurementModel, client, () => { var _a; return (_a = this.viewer) === null || _a === void 0 ? void 0 : _a.token; }, (_a = this.viewer) === null || _a === void 0 ? void 0 : _a.deviceId);
212
212
  }
@@ -1 +1 @@
1
- {"file":"vertex-viewer-measurement-precise.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;MAWa,6BAA6B;EAexC,YACE,UAAiC,EACjC,qBAAmC;IAP7B,iBAAY,GAAG,IAAIA,uCAAmB,EAAE,CAAC;IA4CzC,sBAAiB,GAAG,OAAO,KAAmB;MACpD,IAAI,MAAM,IAAI,CAAC,8BAA8B,CAAC,KAAK,CAAC,EAAE;QACpD,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI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AAE,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,4BAA4B,GAAG,SAAS,CAAC;GAC/C;EAEO,uBAAuB;;IAC7B,IAAI,CAAC,uBAAuB,EAAE,CAAC;IAE/B,IAAI,IAAI,CAAC,qBAAqB,IAAI,IAAI,EAAE;MACtC,IAAI,CAAC,4BAA4B;QAC/B,MAAA,IAAI,CAAC,MAAM,0CAAE,0BAA0B,CACrC,IAAI,6BAA6B,CAC/B,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,qBAAqB,CAC3B,CACF,CAAC;KACL;GACF;;;;;;;;;;;;","names":["ElementRectObserver","measurementWithArrowCursor","getMouseClientPosition","MeasurementEntity","Point","MeasurementModel","MeasurementOverlayManager","EntityType","h","Host","config","parseConfig","SceneViewAPIClient","MeasurementController"],"sources":["./src/lib/measurement/interactions.ts","./src/components/viewer-measurement-precise/viewer-measurement-precise.css?tag=vertex-viewer-measurement-precise&encapsulation=shadow","./src/components/viewer-measurement-precise/viewer-measurement-precise.tsx"],"sourcesContent":["import { Point } from '@vertexvis/geometry';\nimport { Disposable } from '@vertexvis/utils';\n\nimport { Cursor, measurementWithArrowCursor } from '../cursors';\nimport { getMouseClientPosition } from '../dom';\nimport { ElementRectObserver } from '../elementRectObserver';\nimport { InteractionApi, InteractionHandler } from '../interactions';\nimport { EntityType } from '../types';\nimport { MeasurementController } from './controller';\nimport { MeasurementEntity } from './entities';\n\nexport class MeasurementInteractionHandler implements InteractionHandler {\n private controller: MeasurementController;\n private measurableEntityTypes: EntityType[];\n\n private element?: HTMLElement;\n private api?: InteractionApi;\n\n private cursor?: Disposable;\n private measurementInteraction?: InteractionHandler;\n\n private rectObserver = new ElementRectObserver();\n private get elementRect(): DOMRect | undefined {\n return this.rectObserver.rect;\n }\n\n public constructor(\n controller: MeasurementController,\n measurableEntityTypes: EntityType[]\n ) {\n this.controller = controller;\n this.measurableEntityTypes = measurableEntityTypes;\n }\n\n public initialize(element: HTMLElement, api: InteractionApi): void {\n this.element = element;\n this.api = api;\n\n this.rectObserver.observe(element);\n\n element.addEventListener('pointermove', this.handlePointerMove);\n element.addEventListener('pointerdown', this.handlePointerDown);\n }\n\n public dispose(): void {\n this.rectObserver.disconnect();\n this.measurementInteraction?.dispose();\n this.clearCursor();\n\n this.element?.removeEventListener('pointermove', this.handlePointerMove);\n this.element?.removeEventListener('pointerdown', this.handlePointerDown);\n\n this.element = undefined;\n this.api = undefined;\n }\n\n private addCursor(cursor: Cursor): void {\n this.cursor = this.ifInitialized(({ api }) => api.addCursor(cursor));\n }\n\n private clearCursor(): void {\n this.cursor?.dispose();\n this.cursor = undefined;\n }\n\n private handlePointerMove = async (event: PointerEvent): Promise<void> => {\n if (await this.isMeasurableEntityUnderPointer(event)) {\n this.clearCursor();\n this.addCursor(measurementWithArrowCursor);\n } else {\n this.clearCursor();\n }\n };\n\n private handlePointerDown = (event: PointerEvent): void => {\n this.ifNoInteraction(event, async () => {\n if (await this.isMeasurableEntityUnderPointer(event)) {\n this.measureEntityUnderPointer(event);\n } else {\n this.controller.clearEntities();\n }\n });\n };\n\n private async isMeasurableEntityUnderPointer(\n event: PointerEvent\n ): Promise<boolean> {\n const pt = getMouseClientPosition(event, this.elementRect);\n const type = await this.api?.getEntityTypeAtPoint(pt);\n return type != null && this.measurableEntityTypes.includes(type);\n }\n\n private measureEntityUnderPointer(event: PointerEvent): void {\n this.ifInitialized(async ({ api }) => {\n const pt = getMouseClientPosition(event, this.elementRect);\n const [hit] = await api.hitItems(pt);\n\n if (hit != null) {\n this.controller.addEntity(MeasurementEntity.fromHit(hit));\n } else {\n this.controller.clearEntities();\n }\n });\n }\n\n protected ifInitialized<R>(\n f: (data: { element: HTMLElement; api: InteractionApi }) => R\n ): R {\n if (this.element != null && this.api != null) {\n return f({ element: this.element, api: this.api });\n } else {\n throw new Error('Measurement interaction handler not initialized.');\n }\n }\n\n protected ifNoInteraction(\n event: PointerEvent,\n f: () => void | Promise<void>\n ): void {\n const startPos = Point.create(event.clientX, event.clientY);\n let didInteract = false;\n\n const handleMouseMove = (event: PointerEvent): void => {\n const pos = Point.create(event.clientX, event.clientY);\n const dis = Point.distance(startPos, pos);\n didInteract = dis > 2;\n };\n\n const handleMouseUp = (): void => {\n window.removeEventListener('pointermove', handleMouseMove);\n window.removeEventListener('pointerup', handleMouseUp);\n\n if (!didInteract) {\n f();\n }\n };\n\n window.addEventListener('pointermove', handleMouseMove);\n window.addEventListener('pointerup', handleMouseUp);\n }\n}\n",":host {\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n pointer-events: none;\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { SceneViewAPIClient } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb_service';\nimport { Disposable } from '@vertexvis/utils';\n\nimport { parseConfig, PartialConfig } from '../../lib/config';\nimport { Environment } from '../../lib/environment';\nimport {\n MeasurementController,\n MeasurementModel,\n MeasurementOverlayManager,\n} from '../../lib/measurement';\nimport { MeasurementInteractionHandler } from '../../lib/measurement/interactions';\nimport { EntityType } from '../../lib/types';\n\n@Component({\n tag: 'vertex-viewer-measurement-precise',\n styleUrl: 'viewer-measurement-precise.css',\n shadow: true,\n})\nexport class ViewerMeasurementPrecise {\n /**\n * The model that contains the entities and outcomes from performing precise\n * measurements.\n */\n @Prop()\n public measurementModel: MeasurementModel = new MeasurementModel();\n\n /**\n * The manager that is responsible for measurement overlays to present by this\n * component.\n */\n @Prop()\n public measurementOverlays: MeasurementOverlayManager = new MeasurementOverlayManager();\n\n /**\n * The controller that is responsible for performing measurements and updating\n * the model.\n */\n @Prop({ mutable: true })\n public measurementController?: MeasurementController;\n\n /**\n * @internal\n *\n * An internal property that can be used to opt-in to performing measurements\n * on other types of entities.\n */\n @Prop()\n public measurableEntityTypes: EntityType[] = [\n EntityType.PRECISE_SURFACE,\n EntityType.IMPRECISE_SURFACE,\n ];\n\n /**\n * The viewer that this component is bound to. This is automatically assigned\n * if added to the light-dom of a parent viewer element.\n */\n @Prop()\n public viewer?: HTMLVertexViewerElement;\n\n /**\n * The environment that will be used to request measurement results.\n */\n @Prop()\n public configEnv: Environment = 'platprod';\n\n /**\n * An optional configuration to setup network configuration of measurement\n * endpoints.\n */\n @Prop()\n public config?: PartialConfig | string;\n\n private registeredInteractionHandler?: Promise<Disposable>;\n\n /**\n * @ignore\n */\n protected connectedCallback(): void {\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n protected componentWillLoad(): void {\n this.setupController();\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n protected disconnectedCallback(): void {\n this.clearInteractionHandler();\n }\n\n /**\n * @ignore\n */\n @Watch('measurableEntityTypes')\n protected handleMeasurableEntityTypesChanged(): void {\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n @Watch('measurementController')\n protected handleMeasurementControllerChanged(): void {\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n @Watch('measurementModel')\n protected handleMeasurementModelChanged(): void {\n this.setupController();\n }\n\n /**\n * @ignore\n */\n @Watch('viewer')\n protected handleViewerChanged(): void {\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n protected render(): JSX.Element {\n return (\n <Host>\n <vertex-viewer-measurement-overlays\n viewer={this.viewer}\n measurementOverlays={this.measurementOverlays}\n />\n </Host>\n );\n }\n\n private setupController(): void {\n const config = parseConfig(this.configEnv, this.config);\n const client = new SceneViewAPIClient(config.network.sceneViewHost);\n this.measurementController = new MeasurementController(\n this.measurementModel,\n client,\n () => this.viewer?.token,\n this.viewer?.deviceId\n );\n }\n\n private clearInteractionHandler(): void {\n this.registeredInteractionHandler?.then((handler) => handler.dispose());\n this.registeredInteractionHandler = undefined;\n }\n\n private setupInteractionHandler(): void {\n this.clearInteractionHandler();\n\n if (this.measurementController != null) {\n this.registeredInteractionHandler =\n this.viewer?.registerInteractionHandler(\n new MeasurementInteractionHandler(\n this.measurementController,\n this.measurableEntityTypes\n )\n );\n }\n }\n}\n"],"version":3}
1
+ {"file":"vertex-viewer-measurement-precise.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;MAWa,6BAA6B;EAexC,YACE,UAAiC,EACjC,qBAAmC;IAP7B,iBAAY,GAAG,IAAIA,uCAAmB,EAAE,CAAC;IA4CzC,sBAAiB,GAAG,OAAO,KAAmB;MACpD,IAAI,MAAM,IAAI,CAAC,8BAA8B,CAAC,KAAK,CAAC,EAAE;QACpD,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,SAAS,CAACC,kCAA0B,CAAC,CAAC;OAC5C;WAAM;QACL,IAAI,CAAC,WAAW,EAAE,CAAC;OACpB;KACF,CAAC;IAEM,sBAAiB,GAAG,CAAC,KAAmB;MAC9C,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;QAC1B,IAAI,MAAM,IAAI,CAAC,8BAA8B,CAAC,KAAK,CAAC,EAAE;UACpD,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;SACvC;aAAM;UACL,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;SACjC;OACF,CAAC,CAAC;KACJ,CAAC;IApDA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC7B,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;GACpD;EAVD,IAAY,WAAW;IACrB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;GAC/B;EAUM,UAAU,CAAC,OAAoB,EAAE,GAAmB;IACzD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IAEf,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC,OAAO,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IA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,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,IAAIC,8CAAkB,CAACF,QAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACpE,IAAI,CAAC,qBAAqB,GAAG,IAAIG,8BAAqB,CACpD,IAAI,CAAC,gBAAgB,EACrB,MAAM,EACN,gBAAM,OAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,KAAK,CAAA,EAAA,EACxB,MAAA,IAAI,CAAC,MAAM,0CAAE,QAAQ,CACtB,CAAC;GACH;EAEO,uBAAuB;;IAC7B,MAAA,IAAI,CAAC,4BAA4B,0CAAE,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,4BAA4B,GAAG,SAAS,CAAC;GAC/C;EAEO,uBAAuB;;IAC7B,IAAI,CAAC,uBAAuB,EAAE,CAAC;IAE/B,IAAI,IAAI,CAAC,qBAAqB,IAAI,IAAI,EAAE;MACtC,IAAI,CAAC,4BAA4B;QAC/B,MAAA,IAAI,CAAC,MAAM,0CAAE,0BAA0B,CACrC,IAAI,6BAA6B,CAC/B,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,qBAAqB,CAC3B,CACF,CAAC;KACL;GACF;;;;;;;;;;;;","names":["ElementRectObserver","measurementWithArrowCursor","getMouseClientPosition","MeasurementEntity","Point","MeasurementModel","MeasurementOverlayManager","EntityType","h","Host","config","parseAndValidateConfig","SceneViewAPIClient","MeasurementController"],"sources":["./src/lib/measurement/interactions.ts","./src/components/viewer-measurement-precise/viewer-measurement-precise.css?tag=vertex-viewer-measurement-precise&encapsulation=shadow","./src/components/viewer-measurement-precise/viewer-measurement-precise.tsx"],"sourcesContent":["import { Point } from '@vertexvis/geometry';\nimport { Disposable } from '@vertexvis/utils';\n\nimport { Cursor, measurementWithArrowCursor } from '../cursors';\nimport { getMouseClientPosition } from '../dom';\nimport { ElementRectObserver } from '../elementRectObserver';\nimport { InteractionApi, InteractionHandler } from '../interactions';\nimport { EntityType } from '../types';\nimport { MeasurementController } from './controller';\nimport { MeasurementEntity } from './entities';\n\nexport class MeasurementInteractionHandler implements InteractionHandler {\n private controller: MeasurementController;\n private measurableEntityTypes: EntityType[];\n\n private element?: HTMLElement;\n private api?: InteractionApi;\n\n private cursor?: Disposable;\n private measurementInteraction?: InteractionHandler;\n\n private rectObserver = new ElementRectObserver();\n private get elementRect(): DOMRect | undefined {\n return this.rectObserver.rect;\n }\n\n public constructor(\n controller: MeasurementController,\n measurableEntityTypes: EntityType[]\n ) {\n this.controller = controller;\n this.measurableEntityTypes = measurableEntityTypes;\n }\n\n public initialize(element: HTMLElement, api: InteractionApi): void {\n this.element = element;\n this.api = api;\n\n this.rectObserver.observe(element);\n\n element.addEventListener('pointermove', this.handlePointerMove);\n element.addEventListener('pointerdown', this.handlePointerDown);\n }\n\n public dispose(): void {\n this.rectObserver.disconnect();\n this.measurementInteraction?.dispose();\n this.clearCursor();\n\n this.element?.removeEventListener('pointermove', this.handlePointerMove);\n this.element?.removeEventListener('pointerdown', this.handlePointerDown);\n\n this.element = undefined;\n this.api = undefined;\n }\n\n private addCursor(cursor: Cursor): void {\n this.cursor = this.ifInitialized(({ api }) => api.addCursor(cursor));\n }\n\n private clearCursor(): void {\n this.cursor?.dispose();\n this.cursor = undefined;\n }\n\n private handlePointerMove = async (event: PointerEvent): Promise<void> => {\n if (await this.isMeasurableEntityUnderPointer(event)) {\n this.clearCursor();\n this.addCursor(measurementWithArrowCursor);\n } else {\n this.clearCursor();\n }\n };\n\n private handlePointerDown = (event: PointerEvent): void => {\n this.ifNoInteraction(event, async () => {\n if (await this.isMeasurableEntityUnderPointer(event)) {\n this.measureEntityUnderPointer(event);\n } else {\n this.controller.clearEntities();\n }\n });\n };\n\n private async isMeasurableEntityUnderPointer(\n event: PointerEvent\n ): Promise<boolean> {\n const pt = getMouseClientPosition(event, this.elementRect);\n const type = await this.api?.getEntityTypeAtPoint(pt);\n return type != null && this.measurableEntityTypes.includes(type);\n }\n\n private measureEntityUnderPointer(event: PointerEvent): void {\n this.ifInitialized(async ({ api }) => {\n const pt = getMouseClientPosition(event, this.elementRect);\n const [hit] = await api.hitItems(pt);\n\n if (hit != null) {\n this.controller.addEntity(MeasurementEntity.fromHit(hit));\n } else {\n this.controller.clearEntities();\n }\n });\n }\n\n protected ifInitialized<R>(\n f: (data: { element: HTMLElement; api: InteractionApi }) => R\n ): R {\n if (this.element != null && this.api != null) {\n return f({ element: this.element, api: this.api });\n } else {\n throw new Error('Measurement interaction handler not initialized.');\n }\n }\n\n protected ifNoInteraction(\n event: PointerEvent,\n f: () => void | Promise<void>\n ): void {\n const startPos = Point.create(event.clientX, event.clientY);\n let didInteract = false;\n\n const handleMouseMove = (event: PointerEvent): void => {\n const pos = Point.create(event.clientX, event.clientY);\n const dis = Point.distance(startPos, pos);\n didInteract = dis > 2;\n };\n\n const handleMouseUp = (): void => {\n window.removeEventListener('pointermove', handleMouseMove);\n window.removeEventListener('pointerup', handleMouseUp);\n\n if (!didInteract) {\n f();\n }\n };\n\n window.addEventListener('pointermove', handleMouseMove);\n window.addEventListener('pointerup', handleMouseUp);\n }\n}\n",":host {\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n pointer-events: none;\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Component, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { SceneViewAPIClient } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb_service';\nimport { Disposable } from '@vertexvis/utils';\n\nimport { parseAndValidateConfig, PartialConfig } from '../../lib/config';\nimport { Environment } from '../../lib/environment';\nimport {\n MeasurementController,\n MeasurementModel,\n MeasurementOverlayManager,\n} from '../../lib/measurement';\nimport { MeasurementInteractionHandler } from '../../lib/measurement/interactions';\nimport { EntityType } from '../../lib/types';\n\n@Component({\n tag: 'vertex-viewer-measurement-precise',\n styleUrl: 'viewer-measurement-precise.css',\n shadow: true,\n})\nexport class ViewerMeasurementPrecise {\n /**\n * The model that contains the entities and outcomes from performing precise\n * measurements.\n */\n @Prop()\n public measurementModel: MeasurementModel = new MeasurementModel();\n\n /**\n * The manager that is responsible for measurement overlays to present by this\n * component.\n */\n @Prop()\n public measurementOverlays: MeasurementOverlayManager = new MeasurementOverlayManager();\n\n /**\n * The controller that is responsible for performing measurements and updating\n * the model.\n */\n @Prop({ mutable: true })\n public measurementController?: MeasurementController;\n\n /**\n * @internal\n *\n * An internal property that can be used to opt-in to performing measurements\n * on other types of entities.\n */\n @Prop()\n public measurableEntityTypes: EntityType[] = [\n EntityType.PRECISE_SURFACE,\n EntityType.IMPRECISE_SURFACE,\n ];\n\n /**\n * The viewer that this component is bound to. This is automatically assigned\n * if added to the light-dom of a parent viewer element.\n */\n @Prop()\n public viewer?: HTMLVertexViewerElement;\n\n /**\n * The environment that will be used to request measurement results.\n */\n @Prop()\n public configEnv: Environment = 'platprod';\n\n /**\n * An optional configuration to setup network configuration of measurement\n * endpoints.\n */\n @Prop()\n public config?: PartialConfig | string;\n\n private registeredInteractionHandler?: Promise<Disposable>;\n\n /**\n * @ignore\n */\n protected connectedCallback(): void {\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n protected componentWillLoad(): void {\n this.setupController();\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n protected disconnectedCallback(): void {\n this.clearInteractionHandler();\n }\n\n /**\n * @ignore\n */\n @Watch('measurableEntityTypes')\n protected handleMeasurableEntityTypesChanged(): void {\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n @Watch('measurementController')\n protected handleMeasurementControllerChanged(): void {\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n @Watch('measurementModel')\n protected handleMeasurementModelChanged(): void {\n this.setupController();\n }\n\n /**\n * @ignore\n */\n @Watch('viewer')\n protected handleViewerChanged(): void {\n this.setupInteractionHandler();\n }\n\n /**\n * @ignore\n */\n protected render(): JSX.Element {\n return (\n <Host>\n <vertex-viewer-measurement-overlays\n viewer={this.viewer}\n measurementOverlays={this.measurementOverlays}\n />\n </Host>\n );\n }\n\n private setupController(): void {\n const config = parseAndValidateConfig(this.configEnv, this.config);\n const client = new SceneViewAPIClient(config.network.sceneViewHost);\n this.measurementController = new MeasurementController(\n this.measurementModel,\n client,\n () => this.viewer?.token,\n this.viewer?.deviceId\n );\n }\n\n private clearInteractionHandler(): void {\n this.registeredInteractionHandler?.then((handler) => handler.dispose());\n this.registeredInteractionHandler = undefined;\n }\n\n private setupInteractionHandler(): void {\n this.clearInteractionHandler();\n\n if (this.measurementController != null) {\n this.registeredInteractionHandler =\n this.viewer?.registerInteractionHandler(\n new MeasurementInteractionHandler(\n this.measurementController,\n this.measurableEntityTypes\n )\n );\n }\n }\n}\n"],"version":3}
@@ -15,7 +15,7 @@ const errors = require('./errors-2a423841.js');
15
15
  const scene_view_api_pb = require('./scene_view_api_pb-6a03d7c1.js');
16
16
  const grpc = require('./grpc-0f95652f.js');
17
17
  const streamAttributes = require('./streamAttributes-cc511afd.js');
18
- const config = require('./config-ce05a8b9.js');
18
+ const config = require('./config-7341c85a.js');
19
19
  const cursors = require('./cursors-1f5d9d93.js');
20
20
  const dom = require('./dom-540a2f1f.js');
21
21
  const entities = require('./entities-3033992d.js');
@@ -2300,7 +2300,7 @@ class ViewerStream extends bundle_esm$1.StreamApi {
2300
2300
  this.streamAttributes = {};
2301
2301
  this.enableTemporalRefinement = (_a = opts.enableTemporalRefinement) !== null && _a !== void 0 ? _a : true;
2302
2302
  this.frameBgColor = browser_esm.color.create(255, 255, 255);
2303
- this.config = config.parseConfig('platprod');
2303
+ this.config = config.parseAndValidateConfig('platprod');
2304
2304
  this.options = {
2305
2305
  tokenRefreshOffsetInSeconds: (_b = opts.tokenRefreshOffsetInSeconds) !== null && _b !== void 0 ? _b : 30,
2306
2306
  offlineThresholdInSeconds: (_c = opts.offlineThresholdInSeconds) !== null && _c !== void 0 ? _c : 30,
@@ -2319,7 +2319,7 @@ class ViewerStream extends bundle_esm$1.StreamApi {
2319
2319
  this.updateState({ type: 'disconnected' });
2320
2320
  }
2321
2321
  }
2322
- async load(urn, clientId, deviceId, config$1 = config.parseConfig('platprod'), cameraType) {
2322
+ async load(urn, clientId, deviceId, config$1 = config.parseAndValidateConfig('platprod'), cameraType) {
2323
2323
  this.clientId = clientId;
2324
2324
  this.deviceId = deviceId;
2325
2325
  this.config = config$1;
@@ -3092,7 +3092,7 @@ const Viewer = class {
3092
3092
  this.calculateComponentDimensions();
3093
3093
  this.stream.update({
3094
3094
  streamAttributes: this.getStreamAttributes(),
3095
- config: config.parseConfig(this.configEnv, this.config),
3095
+ config: config.parseAndValidateConfig(this.configEnv, this.config),
3096
3096
  dimensions: this.dimensions,
3097
3097
  frameBgColor: this.getBackgroundColor(),
3098
3098
  });
@@ -3554,7 +3554,7 @@ const Viewer = class {
3554
3554
  return depthBuffer;
3555
3555
  }
3556
3556
  updateResolvedConfig() {
3557
- this.resolvedConfig = config.parseConfig(this.configEnv, this.config);
3557
+ this.resolvedConfig = config.parseAndValidateConfig(this.configEnv, this.config);
3558
3558
  }
3559
3559
  getResolvedConfig() {
3560
3560
  return getRequiredProp('Resolved config is undefined', () => this.resolvedConfig);