box-content-preview 3.56.0 → 3.57.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![Mergify Status](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/box/box-content-preview&style=flat)](https://mergify.io)
3
3
  [![Styled With Prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
4
4
  [![build status](https://img.shields.io/travis/box/box-content-preview/master.svg?style=flat-square)](https://travis-ci.org/box/box-content-preview)
5
- [![version](https://img.shields.io/badge/version-v3.56.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
5
+ [![version](https://img.shields.io/badge/version-v3.57.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
6
6
  [![npm version](https://img.shields.io/npm/v/box-ui-elements.svg?style=flat-square)](https://www.npmjs.com/package/box-ui-elements)
7
7
 
8
8
  # [Box Content Preview](https://developer.box.com/docs/box-content-preview)
@@ -22,11 +22,11 @@ We encourage all users to update their applications to utilize modern browsers f
22
22
 
23
23
  ## Current Version
24
24
 
25
- - Version: v3.56.0
25
+ - Version: v3.57.0
26
26
  - Locale: en-US
27
27
 
28
- https://cdn01.boxcdn.net/platform/preview/3.56.0/en-US/preview.js
29
- https://cdn01.boxcdn.net/platform/preview/3.56.0/en-US/preview.css
28
+ https://cdn01.boxcdn.net/platform/preview/3.57.0/en-US/preview.js
29
+ https://cdn01.boxcdn.net/platform/preview/3.57.0/en-US/preview.css
30
30
 
31
31
  ## Supported Locales
32
32
 
@@ -52,10 +52,10 @@ You can self-host the Box Content Preview library or reference the versions avai
52
52
  <title>Box Content Preview Demo</title>
53
53
 
54
54
  <!-- Latest version of Preview SDK for your locale -->
55
- <script src="https://cdn01.boxcdn.net/platform/preview/3.56.0/en-US/preview.js"></script>
55
+ <script src="https://cdn01.boxcdn.net/platform/preview/3.57.0/en-US/preview.js"></script>
56
56
  <link
57
57
  rel="stylesheet"
58
- href="https://cdn01.boxcdn.net/platform/preview/3.56.0/en-US/preview.css"
58
+ href="https://cdn01.boxcdn.net/platform/preview/3.57.0/en-US/preview.css"
59
59
  />
60
60
  </head>
61
61
  <body>
@@ -76,7 +76,7 @@ To self-host the Box Content Preview library, follow these steps:
76
76
 
77
77
  1. Either fork the repo and check out the version you want to host or download the specific version as a zip:
78
78
 
79
- - Check out a specific version with `git checkout v3.56.0`
79
+ - Check out a specific version with `git checkout v3.57.0`
80
80
  - Download a specific version as a zip from https://github.com/box/box-content-preview/releases
81
81
 
82
82
  2. Install dependencies and build the library with `yarn install && yarn build:i18n && yarn build:prod`
package/dist/lib/index.js CHANGED
@@ -9340,7 +9340,7 @@ function util_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var
9340
9340
  const CLIENT_NAME = "box-content-preview"; // eslint-disable-line no-undef
9341
9341
  const CLIENT_NAME_KEY = 'box_client_name';
9342
9342
  const CLIENT_VERSION_KEY = 'box_client_version';
9343
- const CLIENT_VERSION = "3.56.0"; // eslint-disable-line no-undef
9343
+ const CLIENT_VERSION = "3.57.0"; // eslint-disable-line no-undef
9344
9344
  const HEADER_CLIENT_NAME = 'X-Box-Client-Name';
9345
9345
  const HEADER_CLIENT_VERSION = 'X-Box-Client-Version';
9346
9346
  const PROMISE_MAP = {};
@@ -11065,7 +11065,7 @@ class Browser {
11065
11065
  ;// ./src/lib/Logger.js
11066
11066
  /* eslint-disable no-undef */
11067
11067
  const Logger_CLIENT_NAME = "box-content-preview";
11068
- const Logger_CLIENT_VERSION = "3.56.0";
11068
+ const Logger_CLIENT_VERSION = "3.57.0";
11069
11069
  /* eslint-enable no-undef */
11070
11070
 
11071
11071
  class Logger {
@@ -30183,7 +30183,7 @@ class Video360Viewer extends media_DashViewer {
30183
30183
  /** @property {Video360Renderer} - Instance of the Video360Renderer */
30184
30184
  Video360Viewer_defineProperty(this, "renderer", void 0);
30185
30185
  /** @property {Video360Controls} - Instance of the Video360Controls */
30186
- Video360Viewer_defineProperty(this, "controls", void 0);
30186
+ Video360Viewer_defineProperty(this, "video360Controls", void 0);
30187
30187
  /** @property {Box3D.Texture2DAsset} - Asset for the skybox texture */
30188
30188
  Video360Viewer_defineProperty(this, "textureAsset", void 0);
30189
30189
  /** @property {Box3D.VideoAsset} - Asset for the video to apply to the texture */
@@ -30217,6 +30217,13 @@ class Video360Viewer extends media_DashViewer {
30217
30217
 
30218
30218
  /** @inheritdoc */
30219
30219
  destroy() {
30220
+ // Tear down 360 controls before super.destroy(), which destroys this.controls
30221
+ // (DashViewer's React ControlsRoot when createControls() has not run yet).
30222
+ if (this.video360Controls) {
30223
+ this.destroyControls();
30224
+ this.video360Controls = null;
30225
+ this.controls = null;
30226
+ }
30220
30227
  super.destroy();
30221
30228
  if (this.skybox) {
30222
30229
  this.skybox.setAttribute('skyboxTexture', null);
@@ -30230,10 +30237,6 @@ class Video360Viewer extends media_DashViewer {
30230
30237
  this.videoAsset.destroy();
30231
30238
  this.videoAsset = null;
30232
30239
  }
30233
- if (this.controls) {
30234
- this.destroyControls();
30235
- this.controls = null;
30236
- }
30237
30240
  if (this.renderer) {
30238
30241
  // Remove event listeners from box3d, if any on it
30239
30242
  this.renderer.getBox3D().off('mouseDown', this.onCanvasMouseDown);
@@ -30286,8 +30289,10 @@ class Video360Viewer extends media_DashViewer {
30286
30289
  * @return {void}
30287
30290
  */
30288
30291
  createControls() {
30289
- this.controls = new video360_Video360Controls(this.mediaContainerEl);
30290
- this.controls.on(EVENT_TOGGLE_VR, this.handleToggleVr);
30292
+ this.video360Controls = new video360_Video360Controls(this.mediaContainerEl);
30293
+ // Overwrite this.controls so DashViewer.renderUI() skips React controls.
30294
+ this.controls = this.video360Controls;
30295
+ this.video360Controls.on(EVENT_TOGGLE_VR, this.handleToggleVr);
30291
30296
 
30292
30297
  // Add listeners to hide and show controls
30293
30298
  if (!this.renderer || !this.renderer.getBox3D()) {
@@ -30312,8 +30317,11 @@ class Video360Viewer extends media_DashViewer {
30312
30317
  * @return {void}
30313
30318
  */
30314
30319
  destroyControls() {
30315
- this.controls.removeListener(EVENT_TOGGLE_VR, this.handleToggleVr);
30316
- this.controls.destroy();
30320
+ if (!this.video360Controls) {
30321
+ return;
30322
+ }
30323
+ this.video360Controls.removeListener(EVENT_TOGGLE_VR, this.handleToggleVr);
30324
+ this.video360Controls.destroy();
30317
30325
 
30318
30326
  // Remove listeners to hide and show controls
30319
30327
  if (!this.renderer || !this.renderer.getBox3D()) {
@@ -30392,7 +30400,9 @@ class Video360Viewer extends media_DashViewer {
30392
30400
  * @return {void}
30393
30401
  */
30394
30402
  handleShowVrButton() {
30395
- this.controls.showVrButton();
30403
+ if (this.video360Controls) {
30404
+ this.video360Controls.showVrButton();
30405
+ }
30396
30406
  }
30397
30407
 
30398
30408
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-content-preview",
3
- "version": "3.56.0",
3
+ "version": "3.57.0",
4
4
  "description": "Box Content Preview UI Element",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",