@vertexvis/viewer 0.17.4 → 0.17.5-testing.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cjs/{controller-029b37d6.js → controller-4e9ef328.js} +64 -33
  2. package/dist/cjs/controller-4e9ef328.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/vertex-scene-tree-search_3.cjs.entry.js +3 -1
  6. package/dist/cjs/vertex-scene-tree-search_3.cjs.entry.js.map +1 -1
  7. package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js +3 -1
  8. package/dist/cjs/vertex-scene-tree-table-cell.cjs.entry.js.map +1 -1
  9. package/dist/cjs/vertex-scene-tree.cjs.entry.js +7 -3
  10. package/dist/cjs/vertex-scene-tree.cjs.entry.js.map +1 -1
  11. package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +1 -1
  12. package/dist/cjs/viewer.cjs.js +1 -1
  13. package/dist/collection/components/scene-tree/lib/controller.js +63 -32
  14. package/dist/collection/components/scene-tree/lib/controller.js.map +1 -1
  15. package/dist/collection/components/scene-tree/scene-tree.css +2 -1
  16. package/dist/collection/components/scene-tree/scene-tree.js +7 -0
  17. package/dist/collection/components/scene-tree/scene-tree.js.map +1 -1
  18. package/dist/collection/components/scene-tree-table-cell/scene-tree-table-cell.js +3 -1
  19. package/dist/collection/components/scene-tree-table-cell/scene-tree-table-cell.js.map +1 -1
  20. package/dist/collection/components/scene-tree-table-layout/scene-tree-table-layout.js +3 -1
  21. package/dist/collection/components/scene-tree-table-layout/scene-tree-table-layout.js.map +1 -1
  22. package/dist/collection/testing/sceneTree.js +19 -2
  23. package/dist/collection/testing/sceneTree.js.map +1 -1
  24. package/dist/custom-elements/index.js +76 -37
  25. package/dist/custom-elements/index.js.map +1 -1
  26. package/dist/esm/{controller-6afbaeb0.js → controller-53f803d9.js} +64 -33
  27. package/dist/esm/controller-53f803d9.js.map +1 -0
  28. package/dist/esm/index.js +1 -1
  29. package/dist/esm/index.mjs +1 -1
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/esm/loader.mjs +1 -1
  32. package/dist/esm/vertex-scene-tree-search_3.entry.js +3 -1
  33. package/dist/esm/vertex-scene-tree-search_3.entry.js.map +1 -1
  34. package/dist/esm/vertex-scene-tree-table-cell.entry.js +3 -1
  35. package/dist/esm/vertex-scene-tree-table-cell.entry.js.map +1 -1
  36. package/dist/esm/vertex-scene-tree.entry.js +7 -3
  37. package/dist/esm/vertex-scene-tree.entry.js.map +1 -1
  38. package/dist/esm/vertex-viewer-pin-group.entry.js +1 -1
  39. package/dist/esm/viewer.js +1 -1
  40. package/dist/types/components/scene-tree/lib/controller.d.ts +5 -0
  41. package/dist/types/components/scene-tree/scene-tree.d.ts +1 -0
  42. package/dist/types/testing/sceneTree.d.ts +5 -2
  43. package/dist/viewer/index.esm.js +1 -1
  44. package/dist/viewer/{p-4348176f.entry.js → p-073d15e9.entry.js} +2 -2
  45. package/dist/viewer/p-073d15e9.entry.js.map +1 -0
  46. package/dist/viewer/{p-d3009499.entry.js → p-1815d19b.entry.js} +2 -2
  47. package/dist/viewer/{p-f40b8476.entry.js → p-59f38a92.entry.js} +2 -2
  48. package/dist/viewer/p-59f38a92.entry.js.map +1 -0
  49. package/dist/viewer/{p-32f18b4c.js → p-921ec41b.js} +2 -2
  50. package/dist/viewer/p-921ec41b.js.map +1 -0
  51. package/dist/viewer/p-9b8dae4a.entry.js +5 -0
  52. package/dist/viewer/p-9b8dae4a.entry.js.map +1 -0
  53. package/dist/viewer/viewer.esm.js +1 -1
  54. package/dist/viewer/viewer.esm.js.map +1 -1
  55. package/package.json +7 -7
  56. package/dist/cjs/controller-029b37d6.js.map +0 -1
  57. package/dist/esm/controller-6afbaeb0.js.map +0 -1
  58. package/dist/viewer/p-32f18b4c.js.map +0 -1
  59. package/dist/viewer/p-4348176f.entry.js.map +0 -1
  60. package/dist/viewer/p-a4d67e65.entry.js +0 -5
  61. package/dist/viewer/p-a4d67e65.entry.js.map +0 -1
  62. package/dist/viewer/p-f40b8476.entry.js.map +0 -1
  63. /package/dist/viewer/{p-d3009499.entry.js.map → p-1815d19b.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"sceneTree.js","sourceRoot":"","sources":["../../src/testing/sceneTree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,kDAAkD,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,yDAAyD,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,iEAAiE,CAAC;AAKlG,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,OAAO,kBAAkB;EAA/B;IACU,WAAM,GAAG,IAAI,eAAe,EAAK,CAAC;IAClC,aAAQ,GAAG,IAAI,eAAe,EAAU,CAAC;IACzC,UAAK,GAAG,IAAI,eAAe,EAAsB,CAAC;EA4B5D,CAAC;EA1BQ,MAAM;IACX,QAAQ;EACV,CAAC;EAEM,EAAE,CAAC,IAAY,EAAE,OAAY;IAClC,IAAI,IAAI,KAAK,MAAM,EAAE;MACnB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;KACzB;SAAM,IAAI,IAAI,KAAK,KAAK,EAAE;MACzB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;KACxB;SAAM;MACL,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;KAC3B;IACD,OAAO,IAAI,CAAC;EACd,CAAC;EAEM,YAAY,CAAC,GAAM;IACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;EACxB,CAAC;EAEM,WAA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AY,CAAC,KAAK,CAAC,CAAC;EACxB,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;EAEtB,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { OffsetCursor } from '@vertexvis/scene-tree-protos/core/protos/paging_pb';\nimport { Uuid } from '@vertexvis/scene-tree-protos/core/protos/uuid_pb';\nimport { Node } from '@vertexvis/scene-tree-protos/scenetree/protos/domain_pb';\nimport { GetTreeResponse } from '@vertexvis/scene-tree-protos/scenetree/protos/scene_tree_api_pb';\nimport type {\n ResponseStream,\n Status,\n} from '@vertexvis/scene-tree-protos/scenetree/protos/scene_tree_api_pb_service';\nimport { EventDispatcher } from '@vertexvis/utils';\n\nimport { random } from './random';\n\nexport class ResponseStreamMock<T> implements ResponseStream<T> {\n private onData = new EventDispatcher<T>();\n private onStatus = new EventDispatcher<Status>();\n private onEnd = new EventDispatcher<Status | undefined>();\n\n public cancel(): void {\n // no op\n }\n\n public on(type: string, handler: any): ResponseStream<T> {\n if (type === 'data') {\n this.onData.on(handler);\n } else if (type === 'end') {\n this.onEnd.on(handler);\n } else {\n this.onStatus.on(handler);\n }\n return this;\n }\n\n public invokeOnData(msg: T): void {\n this.onData.emit(msg);\n }\n\n public invokeOnEnd(status?: Status): void {\n this.onEnd.emit(status);\n }\n\n public invokeOnStatus(status: Status): void {\n this.onStatus.emit(status);\n }\n}\n\nexport function createGetTreeResponse(\n itemCount: number,\n totalCount: number | null,\n transform?: (node: Node) => void\n): GetTreeResponse {\n const nodes = Array.from({ length: itemCount }).map((_, i) => {\n const id = new Uuid();\n id.setHex(random.guid());\n const node = new Node();\n node.setId(id);\n node.setDepth(0);\n node.setExpanded(false);\n node.setIsLeaf(false);\n node.setName(random.string());\n node.setSelected(false);\n node.setVisible(false);\n transform?.(node);\n return node;\n });\n\n const cursor = new OffsetCursor();\n if (totalCount != null) {\n cursor.setTotal(totalCount);\n }\n\n const res = new GetTreeResponse();\n res.setItemsList(nodes);\n res.setCursor(cursor);\n\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,wBAAwB,CAAC,WAAmB;EAC1D,MAAM,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;EACjC,GAAG,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;EAEpC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAAsB;EAEtB,MAAM,GAAG,GAAG,IAAI,iBAAiB,EAAE,CAAC;EACpC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;EAEtB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAa;EAC5C,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;EACpC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;EACpC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;EAC3B,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;EAEjC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { OffsetCursor } from '@vertexvis/scene-tree-protos/core/protos/paging_pb';\nimport { Uuid } from '@vertexvis/scene-tree-protos/core/protos/uuid_pb';\nimport {\n ListChange,\n Node,\n TreeChangeType,\n} from '@vertexvis/scene-tree-protos/scenetree/protos/domain_pb';\nimport {\n FilterResponse,\n GetTreeResponse,\n SubscribeResponse,\n} from '@vertexvis/scene-tree-protos/scenetree/protos/scene_tree_api_pb';\nimport type {\n ResponseStream,\n Status,\n} from '@vertexvis/scene-tree-protos/scenetree/protos/scene_tree_api_pb_service';\nimport { EventDispatcher } from '@vertexvis/utils';\n\nimport { random } from './random';\n\nexport class ResponseStreamMock<T> implements ResponseStream<T> {\n private onData = new EventDispatcher<T>();\n private onStatus = new EventDispatcher<Status>();\n private onEnd = new EventDispatcher<Status | undefined>();\n\n public cancel(): void {\n // no op\n }\n\n public on(type: string, handler: any): ResponseStream<T> {\n if (type === 'data') {\n this.onData.on(handler);\n } else if (type === 'end') {\n this.onEnd.on(handler);\n } else {\n this.onStatus.on(handler);\n }\n return this;\n }\n\n public invokeOnData(msg: T): void {\n this.onData.emit(msg);\n }\n\n public invokeOnEnd(status?: Status): void {\n this.onEnd.emit(status);\n }\n\n public invokeOnStatus(status: Status): void {\n this.onStatus.emit(status);\n }\n}\n\nexport function createGetTreeResponse(\n itemCount: number,\n totalCount: number | null,\n transform?: (node: Node) => void\n): GetTreeResponse {\n const nodes = Array.from({ length: itemCount }).map((_, i) => {\n const id = new Uuid();\n id.setHex(random.guid());\n const node = new Node();\n node.setId(id);\n node.setDepth(0);\n node.setExpanded(false);\n node.setIsLeaf(false);\n node.setName(random.string());\n node.setSelected(false);\n node.setVisible(false);\n transform?.(node);\n return node;\n });\n\n const cursor = new OffsetCursor();\n if (totalCount != null) {\n cursor.setTotal(totalCount);\n }\n\n const res = new GetTreeResponse();\n res.setItemsList(nodes);\n res.setCursor(cursor);\n\n return res;\n}\n\nexport function createFilterTreeResponse(resultCount: number): FilterResponse {\n const res = new FilterResponse();\n res.setNumberOfResults(resultCount);\n\n return res;\n}\n\nexport function createSubscribeResponse(\n change: TreeChangeType\n): SubscribeResponse {\n const res = new SubscribeResponse();\n res.setChange(change);\n\n return res;\n}\n\nexport function createListChange(start: number): TreeChangeType {\n const change = new TreeChangeType();\n const listChange = new ListChange();\n listChange.setStart(start);\n change.setListChange(listChange);\n\n return change;\n}\n"]}
@@ -12267,7 +12267,8 @@ class SceneTreeController {
12267
12267
  connection.subscriptionStatusState.stream.cancel();
12268
12268
  this.clearHandshakeTimer();
12269
12269
  const stream = await this.subscribe();
12270
- this.invalidatePage(0);
12270
+ this.invalidateAfterOffset(0);
12271
+ this.fetchUnloadedPagesInActiveRows();
12271
12272
  this.updateState(Object.assign(Object.assign({}, this.state), { connection: Object.assign(Object.assign({}, connection), { type: 'connected', subscription: {
12272
12273
  dispose: () => stream.cancel(),
12273
12274
  }, subscriptionStatusState: {
@@ -12312,19 +12313,21 @@ class SceneTreeController {
12312
12313
  this.fetchPage(0),
12313
12314
  this.subscribe(),
12314
12315
  ]);
12315
- this.updateState(Object.assign(Object.assign({}, this.state), { connection: {
12316
- jwtProvider,
12317
- sceneViewId,
12318
- type: 'connected',
12319
- subscription: { dispose: () => stream.cancel() },
12320
- subscriptionStatusState: {
12321
- attempt: 0,
12322
- stream,
12323
- },
12324
- } }));
12325
- this.subscriptionHandshakeTimer = window.setTimeout(() => {
12326
- this.handleSubscriptionHandshakeTimeout(jwtProvider, sceneViewId);
12327
- }, this.connectOptions.subscriptionHandshakeGracePeriodInMs);
12316
+ if (this.state.connection.type !== 'cancelled') {
12317
+ this.updateState(Object.assign(Object.assign({}, this.state), { connection: {
12318
+ jwtProvider,
12319
+ sceneViewId,
12320
+ type: 'connected',
12321
+ subscription: { dispose: () => stream.cancel() },
12322
+ subscriptionStatusState: {
12323
+ attempt: 0,
12324
+ stream,
12325
+ },
12326
+ } }));
12327
+ this.subscriptionHandshakeTimer = window.setTimeout(() => {
12328
+ this.handleSubscriptionHandshakeTimeout(jwtProvider, sceneViewId);
12329
+ }, this.connectOptions.subscriptionHandshakeGracePeriodInMs);
12330
+ }
12328
12331
  }
12329
12332
  catch (e) {
12330
12333
  this.ifErrorIsFatal(e, () => {
@@ -12339,9 +12342,6 @@ class SceneTreeController {
12339
12342
  });
12340
12343
  }
12341
12344
  this.startIdleReconnectTimer();
12342
- if (this.metadataKeys.length > 0) {
12343
- this.setMetadataKeys(this.metadataKeys);
12344
- }
12345
12345
  }
12346
12346
  clearReconnectTimer() {
12347
12347
  if (this.reconnectTimer != null) {
@@ -12405,6 +12405,9 @@ class SceneTreeController {
12405
12405
  this.activeRowRange = [];
12406
12406
  }
12407
12407
  const { connection } = this.state;
12408
+ if (connection.type === 'connected') {
12409
+ connection.subscription.dispose();
12410
+ }
12408
12411
  this.updateState({
12409
12412
  connection: {
12410
12413
  type: 'disconnected',
@@ -12414,6 +12417,11 @@ class SceneTreeController {
12414
12417
  isSearching: false,
12415
12418
  totalRows: reset ? 0 : this.state.totalRows,
12416
12419
  rows: reset ? [] : this.state.rows,
12420
+ filterTerm: reset ? undefined : this.state.filterTerm,
12421
+ totalFilteredRows: reset ? undefined : this.state.totalFilteredRows,
12422
+ shouldShowEmptyResults: reset
12423
+ ? undefined
12424
+ : this.state.shouldShowEmptyResults,
12417
12425
  });
12418
12426
  }
12419
12427
  cancel() {
@@ -12588,7 +12596,7 @@ class SceneTreeController {
12588
12596
  */
12589
12597
  async filter(term, options = {}) {
12590
12598
  return this.ifConnectionHasJwt(async (jwt) => {
12591
- this.updateState(Object.assign(Object.assign({}, this.state), { isSearching: true }));
12599
+ this.updateState(Object.assign(Object.assign({}, this.state), { isSearching: true, filterTerm: term !== '' ? term : undefined }));
12592
12600
  try {
12593
12601
  const res = await this.requestUnary(jwt, (metadata, handler) => {
12594
12602
  var _a;
@@ -12689,6 +12697,7 @@ class SceneTreeController {
12689
12697
  */
12690
12698
  async updateActiveRowRange(start, end) {
12691
12699
  this.activeRowRange = this.constrainRowOffsets(start, end);
12700
+ this.tryClearLoadingTimer(this.state);
12692
12701
  await this.fetchUnloadedPagesInActiveRows();
12693
12702
  }
12694
12703
  /**
@@ -12750,7 +12759,9 @@ class SceneTreeController {
12750
12759
  });
12751
12760
  stream.on('end', () => {
12752
12761
  this.invalidateAfterOffset(0);
12753
- this.startConnectionLostReconnectTimer();
12762
+ if (this.state.connection.type === 'connected') {
12763
+ this.startConnectionLostReconnectTimer();
12764
+ }
12754
12765
  });
12755
12766
  return stream;
12756
12767
  });
@@ -12787,13 +12798,13 @@ class SceneTreeController {
12787
12798
  const fill = new Array(Math.max(0, totalRows - start.length - fetchedRows.length - end.length));
12788
12799
  const rows = [...start, ...fetchedRows, ...end, ...fill];
12789
12800
  if (this.isViewLoading(rows) && this.loadingTimer == null) {
12790
- this.loadingTimer = window.setTimeout(() => {
12791
- this.updateState(Object.assign(Object.assign({}, this.getState()), { shouldShowLoading: true }));
12792
- }, this.connectOptions.spinnerDelay);
12793
- this.updateState(Object.assign(Object.assign({}, this.state), { totalRows: totalRows, rows: rows }));
12801
+ this.restartLoadingTimer();
12802
+ this.updateState(Object.assign(Object.assign({}, this.state), { totalRows: totalRows, rows: rows, shouldShowEmptyResults: this.state.filterTerm != null &&
12803
+ (rows.length === 0 || this.state.totalFilteredRows === 0) }));
12794
12804
  }
12795
12805
  else {
12796
- this.updateState(Object.assign(Object.assign({}, this.state), { totalRows: totalRows, rows: rows }));
12806
+ this.updateState(Object.assign(Object.assign({}, this.state), { totalRows: totalRows, rows: rows, shouldShowEmptyResults: this.state.filterTerm != null &&
12807
+ (rows.length === 0 || this.state.totalFilteredRows === 0) }));
12797
12808
  }
12798
12809
  }
12799
12810
  }
@@ -12823,19 +12834,39 @@ class SceneTreeController {
12823
12834
  return this.state;
12824
12835
  }
12825
12836
  isViewLoading(rows) {
12826
- return (rows[this.activeRowRange[0]] == null &&
12837
+ return (this.state.filterTerm == null &&
12838
+ rows[this.activeRowRange[0]] == null &&
12827
12839
  rows[this.activeRowRange[1]] == null);
12828
12840
  }
12829
- updateState(newState) {
12830
- const updateLoadingTimer = this.loadingTimer && !this.isViewLoading(newState.rows);
12831
- if (updateLoadingTimer) {
12841
+ restartLoadingTimer() {
12842
+ if (this.loadingTimer != null) {
12843
+ this.clearLoadingTimer();
12844
+ }
12845
+ this.loadingTimer = window.setTimeout(() => {
12846
+ this.loadingTimer = undefined;
12847
+ this.updateState(Object.assign(Object.assign({}, this.getState()), { shouldShowLoading: true }));
12848
+ }, this.connectOptions.spinnerDelay);
12849
+ }
12850
+ clearLoadingTimer() {
12851
+ if (this.loadingTimer != null) {
12832
12852
  clearTimeout(this.loadingTimer);
12833
12853
  this.loadingTimer = undefined;
12834
- this.state = Object.assign(Object.assign({}, newState), { shouldShowLoading: false });
12835
12854
  }
12836
- else {
12837
- this.state = Object.assign({}, newState);
12855
+ }
12856
+ tryClearLoadingTimer(state) {
12857
+ const loadingShowingOrTimerStarted = this.state.shouldShowLoading || this.loadingTimer != null;
12858
+ const updateLoadingTimer = loadingShowingOrTimerStarted && !this.isViewLoading(state.rows);
12859
+ if (updateLoadingTimer) {
12860
+ this.clearLoadingTimer();
12861
+ return true;
12838
12862
  }
12863
+ return false;
12864
+ }
12865
+ updateState(newState) {
12866
+ const didClearLoadingTimer = this.tryClearLoadingTimer(newState);
12867
+ this.state = Object.assign(Object.assign({}, newState), { shouldShowLoading: didClearLoadingTimer
12868
+ ? false
12869
+ : newState.shouldShowLoading });
12839
12870
  this.onStateChange.emit(this.state);
12840
12871
  }
12841
12872
  getPageForOffset(offset) {
@@ -12949,7 +12980,7 @@ class SceneTreeController {
12949
12980
  return connection.type === 'connected';
12950
12981
  }
12951
12982
  }
12952
- SceneTreeController.IDLE_RECONNECT_IN_SECONDS = 4 * 60;
12983
+ SceneTreeController.IDLE_RECONNECT_IN_SECONDS = 4 * 1;
12953
12984
  SceneTreeController.LOST_CONNECTION_RECONNECT_IN_SECONDS = 2;
12954
12985
  SceneTreeController.MAX_SUBSCRIPTION_RETRY_COUNT = 2;
12955
12986
 
@@ -108632,7 +108663,7 @@ async function deselectItem(viewer, id, { suppliedCorrelationId } = {}) {
108632
108663
  });
108633
108664
  }
108634
108665
 
108635
- const sceneTreeCss = "button{border:none;background:transparent;cursor:pointer;margin:0;padding:0}.button{padding:0.5rem;border-radius:0.25rem}.button-secondary{color:var(--neutral-800);background-color:var(--neutral-300)}.button-secondary:hover{color:var(--neutral-900)}.button-secondary:hover:enabled{box-shadow:0 2px 2px rgb(0 0 0 / 20%)}.button-secondary:disabled{opacity:0.8}.button-secondary:hover:disabled{cursor:not-allowed}:host{--scene-tree-toolbar-separator:1px solid var(--neutral-300);width:300px;height:100%;user-select:none;-webkit-user-select:none;cursor:default;display:flex;flex-direction:column}.rows-scroll{position:relative;height:var(--scene-tree-row-height, 0);flex-grow:1}.rows{position:relative}.row{position:absolute;display:flex;align-items:center;width:100%;height:var(--scene-tree-row-height);padding:var(--scene-tree-row-padding);box-sizing:border-box}.row:hover{background-color:var(--scene-tree-row-hover-color)}.row.is-selected{background-color:var(--scene-tree-row-selected-color)}.expand-toggle{cursor:pointer;width:16px}.row-text{margin-left:0.25rem;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.visibility-btn{display:flex;align-items:center;visibility:hidden;padding:4px}.visibility-btn.is-hidden{visibility:visible}.row:hover .visibility-btn{visibility:visible}.error{display:flex;flex-direction:column;align-items:center;font-size:0.875rem;width:100%;height:100%;padding:1rem;box-sizing:border-box;justify-content:center}.error-section{margin-top:1rem}.error-message{text-align:center}.search-toolbar,slot[name='header']::slotted(*){border-bottom:var(--scene-tree-toolbar-separator)}slot[name='footer']::slotted(:not(:last-child)){border-top:var(--scene-tree-toolbar-separator)}.header{display:flex;flex-direction:column}.footer{display:flex;flex-direction:column}.loading{position:absolute;top:150px;left:50%;transform:translate(-50%, -50%);text-align:center}";
108666
+ const sceneTreeCss = "button{border:none;background:transparent;cursor:pointer;margin:0;padding:0}.button{padding:0.5rem;border-radius:0.25rem}.button-secondary{color:var(--neutral-800);background-color:var(--neutral-300)}.button-secondary:hover{color:var(--neutral-900)}.button-secondary:hover:enabled{box-shadow:0 2px 2px rgb(0 0 0 / 20%)}.button-secondary:disabled{opacity:0.8}.button-secondary:hover:disabled{cursor:not-allowed}:host{--scene-tree-toolbar-separator:1px solid var(--neutral-300);width:300px;height:100%;user-select:none;-webkit-user-select:none;cursor:default;display:flex;flex-direction:column}.rows-scroll{position:relative;height:var(--scene-tree-row-height, 0);flex-grow:1}.rows{position:relative}.row{position:absolute;display:flex;align-items:center;width:100%;height:var(--scene-tree-row-height);padding:var(--scene-tree-row-padding);box-sizing:border-box}.row:hover{background-color:var(--scene-tree-row-hover-color)}.row.is-selected{background-color:var(--scene-tree-row-selected-color)}.expand-toggle{cursor:pointer;width:16px}.row-text{margin-left:0.25rem;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.visibility-btn{display:flex;align-items:center;visibility:hidden;padding:4px}.visibility-btn.is-hidden{visibility:visible}.row:hover .visibility-btn{visibility:visible}.error,.empty-results{display:flex;flex-direction:column;align-items:center;font-size:0.875rem;width:100%;height:100%;padding:1rem;box-sizing:border-box;justify-content:center}.error-section{margin-top:1rem}.error-message{text-align:center}.search-toolbar,slot[name='header']::slotted(*){border-bottom:var(--scene-tree-toolbar-separator)}slot[name='footer']::slotted(:not(:last-child)){border-top:var(--scene-tree-toolbar-separator)}.header{display:flex;flex-direction:column}.footer{display:flex;flex-direction:column}.loading{position:absolute;top:150px;left:50%;transform:translate(-50%, -50%);text-align:center}";
108636
108667
 
108637
108668
  /**
108638
108669
  * The minimum amount of time provided by requestIdleCallback to clear purged
@@ -108676,6 +108707,7 @@ const SceneTree = class extends HTMLElement$1 {
108676
108707
  this.rows = [];
108677
108708
  this.totalRows = 0;
108678
108709
  this.showLoader = false;
108710
+ this.showEmptyResults = false;
108679
108711
  /**
108680
108712
  * This stores internal state that you want to preserve across live-reloads,
108681
108713
  * but shouldn't trigger a refresh if the data changes. Marking this with
@@ -109000,6 +109032,7 @@ const SceneTree = class extends HTMLElement$1 {
109000
109032
  * @ignore
109001
109033
  */
109002
109034
  componentWillLoad() {
109035
+ var _a;
109003
109036
  if (this.controller == null) {
109004
109037
  const { sceneTreeHost } = this.getConfig().network;
109005
109038
  const client = new SceneTreeAPIClient_1(sceneTreeHost, this.getConfig().flags.grpcUseStreamingWebSocketTransport
@@ -109008,6 +109041,7 @@ const SceneTree = class extends HTMLElement$1 {
109008
109041
  }
109009
109042
  : undefined);
109010
109043
  this.controller = new SceneTreeController(client, 100);
109044
+ (_a = this.controller) === null || _a === void 0 ? void 0 : _a.setMetadataKeys(this.metadataKeys);
109011
109045
  }
109012
109046
  this.stateMap.onStateChangeDisposable = this.controller.onStateChange.on((state) => this.handleControllerStateChange(state));
109013
109047
  this.connectToViewer();
@@ -109040,7 +109074,7 @@ const SceneTree = class extends HTMLElement$1 {
109040
109074
  * @ignore
109041
109075
  */
109042
109076
  render() {
109043
- return (h(Host, null, h("div", { class: "header" }, h("slot", { name: "header" }, h("vertex-scene-tree-toolbar", { class: "search-toolbar" }, h("vertex-scene-tree-search", { controller: this.controller })))), this.errorDetails != null && this.renderError(this.errorDetails), this.errorDetails == null && (h("div", { class: "rows-scroll" }, this.showLoader && (h("slot", { name: "loading" }, h("vertex-viewer-spinner", { class: "loading", size: "md" }))), h("slot", null))), h("div", { class: "footer" }, h("slot", { name: "footer" }))));
109077
+ return (h(Host, null, h("div", { class: "header" }, h("slot", { name: "header" }, h("vertex-scene-tree-toolbar", { class: "search-toolbar" }, h("vertex-scene-tree-search", { controller: this.controller })))), this.errorDetails != null && this.renderError(this.errorDetails), this.errorDetails == null && (h("div", { class: "rows-scroll" }, this.showLoader && (h("slot", { name: "loading" }, h("vertex-viewer-spinner", { class: "loading", size: "md" }))), this.showEmptyResults && (h("slot", { name: "empty-results" }, h("div", { class: "empty-results" }, "No Results Found."))), h("slot", null))), h("div", { class: "footer" }, h("slot", { name: "footer" }))));
109044
109078
  }
109045
109079
  renderError(details) {
109046
109080
  if (details.code !== SceneTreeErrorCode.SCENE_TREE_DISABLED) {
@@ -109127,6 +109161,7 @@ const SceneTree = class extends HTMLElement$1 {
109127
109161
  }
109128
109162
  handleControllerStateChange(state) {
109129
109163
  this.showLoader = !!state.shouldShowLoading;
109164
+ this.showEmptyResults = !!state.shouldShowEmptyResults;
109130
109165
  this.rows = state.rows;
109131
109166
  this.totalRows = state.totalRows;
109132
109167
  if (state.connection.type === 'failure') {
@@ -109544,7 +109579,9 @@ const SceneTreeTableCell = class extends HTMLElement$1 {
109544
109579
  }
109545
109580
  render() {
109546
109581
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
109547
- return (h(Host, { onPointerEnter: this.handleCellPointerEnter, onPointerLeave: this.handleCellPointerLeave, onPointerUp: this.handleCellPointerUp, onPointerDown: this.handleCellPointerDown }, h("div", { class: "wrapper" }, h("div", { class: "no-shrink" }, h("slot", { name: "left-gutter" })), this.expandToggle && (h("button", { class: "expand-btn no-shrink", "data-test-id": 'expand-' + ((_a = this.node) === null || _a === void 0 ? void 0 : _a.name), onPointerUp: (event) => {
109582
+ // Overrides the `.hydrated` visibility when we have nothing to display
109583
+ const hiddenStyle = this.node == null ? { visibility: 'hidden' } : undefined;
109584
+ return (h(Host, { onPointerEnter: this.handleCellPointerEnter, onPointerLeave: this.handleCellPointerLeave, onPointerUp: this.handleCellPointerUp, onPointerDown: this.handleCellPointerDown, style: hiddenStyle }, h("div", { class: "wrapper" }, h("div", { class: "no-shrink" }, h("slot", { name: "left-gutter" })), this.expandToggle && (h("button", { class: "expand-btn no-shrink", "data-test-id": 'expand-' + ((_a = this.node) === null || _a === void 0 ? void 0 : _a.name), onPointerUp: (event) => {
109548
109585
  event.preventDefault();
109549
109586
  this.toggleExpansion(event);
109550
109587
  } }, !((_b = this.node) === null || _b === void 0 ? void 0 : _b.isLeaf) && !((_c = this.node) === null || _c === void 0 ? void 0 : _c.endItem) && (h("div", { class: classnames('icon', {
@@ -110344,7 +110381,9 @@ const SceneTreeTableLayout = class extends HTMLElement$1 {
110344
110381
  async computeAndUpdateViewportRows() {
110345
110382
  var _a;
110346
110383
  this.computeViewportRows();
110347
- if ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.isConnected) {
110384
+ if (((_a = this.controller) === null || _a === void 0 ? void 0 : _a.isConnected) &&
110385
+ this.viewportStartIndex >= 0 &&
110386
+ this.viewportEndIndex >= 0) {
110348
110387
  await this.controller.updateActiveRowRange(this.viewportStartIndex, this.viewportEndIndex);
110349
110388
  }
110350
110389
  }
@@ -133018,7 +133057,7 @@ const ViewerViewCube = class extends HTMLElement$1 {
133018
133057
  };
133019
133058
 
133020
133059
  globalScripts();
133021
- const VertexSceneTree = /*@__PURE__*/proxyCustomElement(SceneTree, [1,"vertex-scene-tree",{"overScanCount":[2,"over-scan-count"],"viewerSelector":[1,"viewer-selector"],"viewer":[1040],"rowData":[16],"config":[1],"configEnv":[1,"config-env"],"controller":[1040],"metadataSearchExactMatch":[1028,"metadata-search-exact-match"],"metadataSearchKeys":[1040],"metadataKeys":[16],"rows":[32],"totalRows":[32],"showLoader":[32],"stateMap":[32],"errorDetails":[32],"attemptingRetry":[32]},[[0,"search","handleSearch"],[0,"cellLoaded","handleCellLoaded"]]]);
133060
+ const VertexSceneTree = /*@__PURE__*/proxyCustomElement(SceneTree, [1,"vertex-scene-tree",{"overScanCount":[2,"over-scan-count"],"viewerSelector":[1,"viewer-selector"],"viewer":[1040],"rowData":[16],"config":[1],"configEnv":[1,"config-env"],"controller":[1040],"metadataSearchExactMatch":[1028,"metadata-search-exact-match"],"metadataSearchKeys":[1040],"metadataKeys":[16],"rows":[32],"totalRows":[32],"showLoader":[32],"showEmptyResults":[32],"stateMap":[32],"errorDetails":[32],"attemptingRetry":[32]},[[0,"search","handleSearch"],[0,"cellLoaded","handleCellLoaded"]]]);
133022
133061
  const VertexSceneTreeSearch = /*@__PURE__*/proxyCustomElement(SceneTreeSearch, [1,"vertex-scene-tree-search",{"debounce":[2],"disabled":[4],"placeholder":[1],"controller":[16],"value":[1025],"focused":[32],"isSearching":[32]}]);
133023
133062
  const VertexSceneTreeTableCell = /*@__PURE__*/proxyCustomElement(SceneTreeTableCell, [1,"vertex-scene-tree-table-cell",{"node":[16],"tree":[16],"value":[1],"placeholder":[1],"hovered":[1028],"isScrolling":[4,"is-scrolling"],"expandToggle":[4,"expand-toggle"],"visibilityToggle":[4,"visibility-toggle"],"selectionHandler":[16],"visibilityHandler":[16],"expansionHandler":[16],"hoverController":[16]}]);
133024
133063
  const VertexSceneTreeTableColumn = /*@__PURE__*/proxyCustomElement(SceneTreeTableColumn, [1,"vertex-scene-tree-table-column",{"initialWidth":[2,"initial-width"],"minWidth":[2,"min-width"],"maxWidth":[2,"max-width"]}]);