@vertexvis/viewer 1.0.2-canary.21 → 1.0.2-canary.22

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.
@@ -3098,7 +3098,7 @@ function getElementPropertyValue(element, property) {
3098
3098
  return value !== '' ? value : undefined;
3099
3099
  }
3100
3100
 
3101
- const viewerCss = () => `:host{--image-background:var(--image-background);--viewer-background:var(--viewer-background);display:block;position:relative;width:300px;height:300px;min-width:1px;min-height:1px;user-select:none;-webkit-user-select:none}.canvas-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:relative}.enable-pointer-events{touch-action:none}.viewer-container{width:100%;height:100%;overflow:hidden}.error-message{position:absolute;top:50%;width:100%;transform:translateY(-50%);text-align:center}`;
3101
+ const viewerCss = () => `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{--image-background:var(--image-background);--viewer-background:var(--viewer-background);display:block;position:relative;width:300px;height:300px;min-width:1px;min-height:1px;user-select:none;-webkit-user-select:none}.canvas-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:relative}.enable-pointer-events{touch-action:none}.viewer-container{width:100%;height:100%;overflow:hidden}.error-message-wrapper{align-items:center;display:flex;flex-direction:column;gap:1rem;position:absolute;top:50%;width:100%;transform:translateY(-50%);text-align:center}.error-message{font-size:0.875rem}`;
3102
3102
 
3103
3103
  const Viewer = class {
3104
3104
  constructor(hostRef) {
@@ -3230,6 +3230,11 @@ const Viewer = class {
3230
3230
  }, streamAttributesUpdateThrottleInMilliseconds);
3231
3231
  }
3232
3232
  };
3233
+ this.handleRetry = () => {
3234
+ this.reload().catch((e) => {
3235
+ console.error('Error reloading scene', e);
3236
+ });
3237
+ };
3233
3238
  this.handleElementResize = this.handleElementResize.bind(this);
3234
3239
  this.handleVisibilityChange = this.handleVisibilityChange.bind(this);
3235
3240
  }
@@ -3307,12 +3312,12 @@ const Viewer = class {
3307
3312
  */
3308
3313
  render() {
3309
3314
  var _a;
3310
- return (h(Host, { key: 'cf89e8922ecbc6a4f024197ec20ff2d1a987953e' }, h("div", { key: '779eab813e3515178e51f729a952bd5b02978507', ref: (ref) => (this.viewerContainerElement = ref), class: "viewer-container", style: { cursor: cssCursor((_a = this.cursor) !== null && _a !== void 0 ? _a : '') }, onContextMenu: (event) => event.preventDefault() }, h("div", { key: '78f19335302d21fcb339e420779695ccd4045407', ref: (ref) => (this.canvasContainerElement = ref), class: classname('canvas-container', {
3315
+ return (h(Host, { key: '32586b76e959c2a93aac583691d2a88ab78f296e' }, h("div", { key: 'e5f461c1c610e189be5743bcfb898e228a9dd90a', ref: (ref) => (this.viewerContainerElement = ref), class: "viewer-container", style: { cursor: cssCursor((_a = this.cursor) !== null && _a !== void 0 ? _a : '') }, onContextMenu: (event) => event.preventDefault() }, h("div", { key: '6beff5f3ef84c05b8f4237378b50083af6dad971', ref: (ref) => (this.canvasContainerElement = ref), class: classname('canvas-container', {
3311
3316
  'enable-pointer-events ': window.PointerEvent != null,
3312
- }) }, h("canvas", { key: '6de64c9e82d6e1a9843bb3f263a27ccdd5614314', ref: (ref) => {
3317
+ }) }, h("canvas", { key: '47aedb0ef4e45a54af3d0749ad4f5542f3706e01', ref: (ref) => {
3313
3318
  this.canvasElement = ref;
3314
3319
  this.stateMap.interactionTarget = ref;
3315
- }, class: "canvas" }), this.errorMessage != null ? (h("div", { class: "error-message" }, this.errorMessage)) : null), h("slot", { key: '35e36b86ae1bba5b85695354506bb9dcc3375b3f' }))));
3320
+ }, class: "canvas" }), this.errorMessage != null ? (h("div", { class: "error-message-wrapper", role: "alert" }, h("span", { class: "error-message" }, this.errorMessage), h("slot", { name: "retry" }, h("button", { class: "button button-secondary", type: "button", onClick: this.handleRetry }, "Retry")))) : null), h("slot", { key: 'aeab63c7fd184e2ccb920011cee235d5c101446f' }))));
3316
3321
  }
3317
3322
  /**
3318
3323
  * @internal