box-content-preview 3.101.0 → 3.103.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.101.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
5
+ [![version](https://img.shields.io/badge/version-v3.103.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.101.0
25
+ - Version: v3.103.0
26
26
  - Locale: en-US
27
27
 
28
- https://cdn01.boxcdn.net/platform/preview/3.101.0/en-US/preview.js
29
- https://cdn01.boxcdn.net/platform/preview/3.101.0/en-US/preview.css
28
+ https://cdn01.boxcdn.net/platform/preview/3.103.0/en-US/preview.js
29
+ https://cdn01.boxcdn.net/platform/preview/3.103.0/en-US/preview.css
30
30
 
31
31
  ## Supported Locales
32
32
 
@@ -45,17 +45,17 @@ Box Content Preview supports 100+ file types, including most document and image
45
45
  You can self-host the Box Content Preview library or reference the versions available on Box's CDN.
46
46
 
47
47
  ```html
48
- <!DOCTYPE html>
48
+ <!doctype html>
49
49
  <html lang="en-US">
50
50
  <head>
51
51
  <meta charset="utf-8" />
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.101.0/en-US/preview.js"></script>
55
+ <script src="https://cdn01.boxcdn.net/platform/preview/3.103.0/en-US/preview.js"></script>
56
56
  <link
57
57
  rel="stylesheet"
58
- href="https://cdn01.boxcdn.net/platform/preview/3.101.0/en-US/preview.css"
58
+ href="https://cdn01.boxcdn.net/platform/preview/3.103.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.101.0`
79
+ - Check out a specific version with `git checkout v3.103.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`
@@ -221,14 +221,14 @@ The Preview library optionally takes a token generator function instead of a str
221
221
 
222
222
  ```javascript
223
223
  // Example token generator function that resolves to a single access token
224
- var singleTokenGenerator = function() {
225
- return someApi.getToken().then(function(data) {
224
+ var singleTokenGenerator = function () {
225
+ return someApi.getToken().then(function (data) {
226
226
  return data.token;
227
227
  });
228
228
  };
229
229
 
230
230
  // Example token generator function that resolves to a map of tokens
231
- var mapTokenGenerator = function() {
231
+ var mapTokenGenerator = function () {
232
232
  return Promise.resolve({
233
233
  file_1234: 'some_token_abcd',
234
234
  file_2345: 'some_token_bcde',
package/dist/lib/index.js CHANGED
@@ -1029,7 +1029,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
1029
1029
  const CLIENT_NAME = "box-content-preview"; // eslint-disable-line no-undef
1030
1030
  const CLIENT_NAME_KEY = 'box_client_name';
1031
1031
  const CLIENT_VERSION_KEY = 'box_client_version';
1032
- const CLIENT_VERSION = "3.101.0"; // eslint-disable-line no-undef
1032
+ const CLIENT_VERSION = "3.103.0"; // eslint-disable-line no-undef
1033
1033
  const HEADER_CLIENT_NAME = 'X-Box-Client-Name';
1034
1034
  const HEADER_CLIENT_VERSION = 'X-Box-Client-Version';
1035
1035
  const PROMISE_MAP = {};
@@ -5719,7 +5719,6 @@ function applyRegion(el, startSec, endSec, durationSec, viewport, collapsed) {
5719
5719
  el.style.width = `calc(${end} - ${start} + ${constants/* WAVEFORM_RANGE_HANDLE_LINE_PX */.h1}px)`;
5720
5720
  }
5721
5721
  const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(function WaveformRangeSelection({
5722
- cameraMode = 'desktop',
5723
5722
  currentTimeSec = 0,
5724
5723
  durationSec,
5725
5724
  getPlayheadSec,
@@ -5772,7 +5771,8 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5772
5771
  displayedRef.current = displayed;
5773
5772
  const isRangeOpen = displayed.startMs !== displayed.endMs && activeHandle == null;
5774
5773
  const showCommentButton = !readOnly && Boolean(onDragCreate) && isRangeOpen;
5775
- const showClearOnly = cameraMode === 'tape' && readOnly && onRangeClear != null && isRangeOpen;
5774
+ const showClearControl = onRangeClear != null && isRangeOpen;
5775
+ const showClearOnly = readOnly && showClearControl;
5776
5776
  const syncPositions = (0,external_react_.useCallback)((next, nextViewport, nextDurationSec) => {
5777
5777
  displayedRef.current = next;
5778
5778
  const collapsed = next.startMs === next.endMs;
@@ -5806,7 +5806,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5806
5806
  }), [refreshRangePositions]);
5807
5807
  (0,external_react_.useLayoutEffect)(() => {
5808
5808
  syncPositions(displayedRef.current, viewportRef.current, durationSec);
5809
- }, [activeHandle, displayed.endMs, displayed.startMs, durationSec, showClearOnly, showCommentButton, syncPositions]);
5809
+ }, [activeHandle, displayed.endMs, displayed.startMs, durationSec, showClearControl, showCommentButton, syncPositions]);
5810
5810
  (0,external_react_.useLayoutEffect)(() => {
5811
5811
  const next = (0,waveform_viewport/* createWaveformViewport */.eq)({
5812
5812
  durationSec: viewport.durationSec,
@@ -5993,7 +5993,6 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5993
5993
  "aria-hidden": "true",
5994
5994
  className: "bp-WaveformRange-commentIcon"
5995
5995
  }), "Comment");
5996
- const isTapeClearAvailable = cameraMode === 'tape' && onRangeClear != null;
5997
5996
  let commentButton = null;
5998
5997
  if (showClearOnly && onRangeClear) {
5999
5998
  commentButton = /*#__PURE__*/external_react_["default"].createElement("button", {
@@ -6014,8 +6013,8 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
6014
6013
  }));
6015
6014
  } else if (showCommentButton && onDragCreate) {
6016
6015
  const commentAction = /*#__PURE__*/external_react_["default"].createElement("button", {
6017
- ref: isTapeClearAvailable ? undefined : commentButtonRef,
6018
- className: isTapeClearAvailable ? 'bp-WaveformRange-commentLabel' : 'bp-WaveformRange-comment',
6016
+ ref: showClearControl ? undefined : commentButtonRef,
6017
+ className: showClearControl ? 'bp-WaveformRange-commentLabel' : 'bp-WaveformRange-comment',
6019
6018
  "data-testid": "bp-waveform-range-comment",
6020
6019
  onClick: event => {
6021
6020
  stopRangeEvent(event);
@@ -6025,7 +6024,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
6025
6024
  onPointerUp: stopRangeEvent,
6026
6025
  type: "button"
6027
6026
  }, commentLabel);
6028
- commentButton = isTapeClearAvailable ? /*#__PURE__*/external_react_["default"].createElement("div", {
6027
+ commentButton = showClearControl && onRangeClear ? /*#__PURE__*/external_react_["default"].createElement("div", {
6029
6028
  ref: commentPillRef,
6030
6029
  className: "bp-WaveformRange-comment bp-WaveformRange-comment--withClear",
6031
6030
  "data-testid": "bp-waveform-range-comment-pill",
@@ -7331,7 +7330,6 @@ function WaveformView({
7331
7330
  "data-testid": "bp-waveform-playhead"
7332
7331
  }), showRangeOverlay && overlayRange && /*#__PURE__*/external_react_["default"].createElement(waveform_WaveformRangeSelection, {
7333
7332
  ref: rangeLayerRef,
7334
- cameraMode: cameraMode,
7335
7333
  currentTimeSec: currentTime,
7336
7334
  durationSec: durationSec,
7337
7335
  getPlayheadSec: getPlayheadSec,
@@ -25100,7 +25098,7 @@ class Browser {
25100
25098
  ;// ./src/lib/Logger.js
25101
25099
  /* eslint-disable no-undef */
25102
25100
  const CLIENT_NAME = "box-content-preview";
25103
- const CLIENT_VERSION = "3.101.0";
25101
+ const CLIENT_VERSION = "3.103.0";
25104
25102
  /* eslint-enable no-undef */
25105
25103
 
25106
25104
  class Logger {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-content-preview",
3
- "version": "3.101.0",
3
+ "version": "3.103.0",
4
4
  "description": "Box Content Preview UI Element",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -99,7 +99,7 @@
99
99
  "eslint-plugin-jest": "^23.1.1",
100
100
  "eslint-plugin-jsx-a11y": "^6.2.3",
101
101
  "eslint-plugin-lodash": "^6.0.0",
102
- "eslint-plugin-prettier": "^3.1.2",
102
+ "eslint-plugin-prettier": "5.2.3",
103
103
  "eslint-plugin-react": "^7.17.0",
104
104
  "eslint-plugin-react-hooks": "^1.7.0",
105
105
  "file-loader": "^6.2.0",
@@ -117,7 +117,7 @@
117
117
  "npm-run-all": "^4.1.5",
118
118
  "postcss": "^8.5.18",
119
119
  "postcss-loader": "^8.1.1",
120
- "prettier": "^1.19.1",
120
+ "prettier": "^3.2.5",
121
121
  "raw-loader": "^4.0.2",
122
122
  "react": "18.3.1",
123
123
  "react-dom": "18.3.1",