box-content-preview 3.125.0 → 3.126.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.125.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
5
+ [![version](https://img.shields.io/badge/version-v3.126.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.125.0
25
+ - Version: v3.126.0
26
26
  - Locale: en-US
27
27
 
28
- https://cdn01.boxcdn.net/platform/preview/3.125.0/en-US/preview.js
29
- https://cdn01.boxcdn.net/platform/preview/3.125.0/en-US/preview.css
28
+ https://cdn01.boxcdn.net/platform/preview/3.126.0/en-US/preview.js
29
+ https://cdn01.boxcdn.net/platform/preview/3.126.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.125.0/en-US/preview.js"></script>
55
+ <script src="https://cdn01.boxcdn.net/platform/preview/3.126.0/en-US/preview.js"></script>
56
56
  <link
57
57
  rel="stylesheet"
58
- href="https://cdn01.boxcdn.net/platform/preview/3.125.0/en-US/preview.css"
58
+ href="https://cdn01.boxcdn.net/platform/preview/3.126.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.125.0`
79
+ - Check out a specific version with `git checkout v3.126.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
@@ -1328,7 +1328,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
1328
1328
  const CLIENT_NAME = "box-content-preview"; // eslint-disable-line no-undef
1329
1329
  const CLIENT_NAME_KEY = 'box_client_name';
1330
1330
  const CLIENT_VERSION_KEY = 'box_client_version';
1331
- const CLIENT_VERSION = "3.125.0"; // eslint-disable-line no-undef
1331
+ const CLIENT_VERSION = "3.126.0"; // eslint-disable-line no-undef
1332
1332
  const HEADER_CLIENT_NAME = 'X-Box-Client-Name';
1333
1333
  const HEADER_CLIENT_VERSION = 'X-Box-Client-Version';
1334
1334
  const PROMISE_MAP = {};
@@ -37304,7 +37304,7 @@ var isNpmBuild = __webpack_require__(8080);
37304
37304
  ;// ./src/lib/Logger.js
37305
37305
  /* eslint-disable no-undef */
37306
37306
  const CLIENT_NAME = "box-content-preview";
37307
- const CLIENT_VERSION = "3.125.0";
37307
+ const CLIENT_VERSION = "3.126.0";
37308
37308
  /* eslint-enable no-undef */
37309
37309
 
37310
37310
  class Logger {
@@ -41662,6 +41662,8 @@ const ANNOTATION_MODE_ICONS = {
41662
41662
  [AnnotationMode.REGION]: __WEBPACK_EXTERNAL_MODULE__box_blueprint_web_assets_icons_Medium_SquarePlus_c11758f1_default__
41663
41663
  };
41664
41664
  /* harmony default export */ const annotationModeIcons = (ANNOTATION_MODE_ICONS);
41665
+ // EXTERNAL MODULE: ./src/lib/viewers/controls/media/utils.ts
41666
+ var utils = __webpack_require__(5346);
41665
41667
  ;// ./src/lib/viewers/controls/controls-bar/ControlsBarV2.scss
41666
41668
  // extracted by mini-css-extract-plugin
41667
41669
 
@@ -41673,6 +41675,7 @@ function ControlsBarV2_objectWithoutPropertiesLoose(r, e) { if (null == r) retur
41673
41675
 
41674
41676
 
41675
41677
 
41678
+
41676
41679
  function ControlsBarV2(_ref, ref) {
41677
41680
  let {
41678
41681
  children,
@@ -41687,7 +41690,9 @@ function ControlsBarV2(_ref, ref) {
41687
41690
  className: `bp-ControlsBarV2 bp-ControlsBarV2--${size}`,
41688
41691
  colorScheme: "dark",
41689
41692
  "data-testid": "bp-ControlsBar"
41690
- }, rest), children);
41693
+ }, rest, {
41694
+ onKeyDown: utils/* stopToolbarKeyPropagation */.B9
41695
+ }), children);
41691
41696
  }
41692
41697
  /* harmony default export */ const controls_bar_ControlsBarV2 = (/*#__PURE__*/external_react_["default"].forwardRef(ControlsBarV2));
41693
41698
  ;// ./src/lib/viewers/controls/annotations/AnnotationsPaletteV2.scss
@@ -45850,8 +45855,6 @@ function Image360Controls({
45850
45855
  }
45851
45856
  ;// external "@box/blueprint-web-assets/icons/Medium/VrGoggles"
45852
45857
 
45853
- // EXTERNAL MODULE: ./src/lib/viewers/controls/media/utils.ts
45854
- var utils = __webpack_require__(5346);
45855
45858
  ;// ./src/lib/viewers/controls/box3d/VrToggleControlV2.tsx
45856
45859
  /* provided dependency */ var VrToggleControlV2_ = __webpack_require__(441)["Tl"];
45857
45860
  const VrToggleControlV2_excluded = ["buttonType", "isVrShown", "onVrToggle"];
@@ -47458,6 +47461,68 @@ class PrintModalRoot {
47458
47461
  }
47459
47462
  ;// ./src/lib/icons/print_checkmark.svg
47460
47463
  const print_checkmark_namespaceObject = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" focusable=\"false\">\n <path d=\"M4.187 6.48L3.067 7.6l3.6 3.6 8-8-1.12-1.12-6.88 6.88-2.48-2.48zM14.4 8c0 3.52-2.88 6.4-6.4 6.4-3.52 0-6.4-2.88-6.4-6.4 0-3.52 2.88-6.4 6.4-6.4.64 0 1.2.08 1.76.24L11.04.56C10.08.24 9.04 0 8 0 3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8h-1.6z\" fill=\"#22A7F0\" fill-rule=\"evenodd\"/>\n</svg>\n";
47464
+ ;// ./src/lib/viewers/text/printStyles.ts
47465
+ // The PlainText.scss and Markdown.scss rules that can match inside the print iframe, which holds only
47466
+ // the text element. Keep them in sync with those files; printStyles-test.ts fails when they drift.
47467
+ const PLAIN_TEXT_PRINT_STYLES = `
47468
+ .bp-text-plain {
47469
+ position: absolute;
47470
+ inset: 0;
47471
+ overflow: auto;
47472
+ margin: 0;
47473
+ line-height: 1.5;
47474
+ text-align: left;
47475
+ word-wrap: break-word;
47476
+ white-space: pre-wrap;
47477
+ background-color: #fff;
47478
+ }
47479
+
47480
+ .bp-text-plain ul {
47481
+ list-style: disc;
47482
+ }
47483
+
47484
+ .bp-text-plain ol {
47485
+ list-style: decimal;
47486
+ }
47487
+
47488
+ .bp-text-plain ol ul,
47489
+ .bp-text-plain ul ul {
47490
+ list-style: circle;
47491
+ }
47492
+
47493
+ .bp-text-truncated {
47494
+ padding-bottom: 75px;
47495
+ font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
47496
+ text-align: center;
47497
+ }
47498
+
47499
+ .bp-text-truncated p {
47500
+ margin: 10px 0;
47501
+ }
47502
+
47503
+ @media print {
47504
+ .bp-text-plain {
47505
+ position: static;
47506
+ overflow: visible;
47507
+ margin: 0;
47508
+ padding: 0;
47509
+ word-wrap: break-word;
47510
+ }
47511
+
47512
+ .bp-text-truncated .bp-btn-download {
47513
+ display: none;
47514
+ }
47515
+ }
47516
+ `;
47517
+ const MARKDOWN_PRINT_STYLES = `${PLAIN_TEXT_PRINT_STYLES}
47518
+ .markdown-body {
47519
+ white-space: normal;
47520
+ }
47521
+
47522
+ .markdown-body ul li {
47523
+ list-style: disc;
47524
+ }
47525
+ `;
47461
47526
  ;// ./src/lib/viewers/text/PlainText.scss
47462
47527
  // extracted by mini-css-extract-plugin
47463
47528
 
@@ -47478,6 +47543,8 @@ function PlainTextViewer_toPrimitive(t, r) { if ("object" != typeof t || !t) ret
47478
47543
 
47479
47544
 
47480
47545
 
47546
+
47547
+
47481
47548
  // Inline web worker JS
47482
47549
  const HIGHLIGHT_WORKER_JS = 'onmessage=function(e){importScripts(e.data.highlightSrc);postMessage(self.hljs.highlightAuto(e.data.text).value)};';
47483
47550
 
@@ -47606,7 +47673,7 @@ class PlainTextViewer extends text_TextBaseViewer {
47606
47673
  */
47607
47674
  print() {
47608
47675
  if (!this.printReady) {
47609
- this.preparePrint(this.getCSS().concat('preview.css'));
47676
+ this.preparePrint(this.getCSS());
47610
47677
  this.printPopup.show(PlainTextViewer_('print_loading'), PlainTextViewer_('print'), () => {
47611
47678
  this.printPopup.hide();
47612
47679
  this.printIframe();
@@ -47663,6 +47730,15 @@ class PlainTextViewer extends text_TextBaseViewer {
47663
47730
  return src_CSS;
47664
47731
  }
47665
47732
 
47733
+ /**
47734
+ * Returns the viewer styles that npm builds inject into the print iframe
47735
+ *
47736
+ * @return {string} CSS text
47737
+ */
47738
+ getPrintStyles() {
47739
+ return PLAIN_TEXT_PRINT_STYLES;
47740
+ }
47741
+
47666
47742
  /**
47667
47743
  * Finishes loading after text is highlighted.
47668
47744
  *
@@ -47751,19 +47827,30 @@ class PlainTextViewer extends text_TextBaseViewer {
47751
47827
  }
47752
47828
 
47753
47829
  /**
47754
- * Sets up the print iframe - uses a web worker to insert text content and
47755
- * styles into an iframe that can be printed.
47830
+ * Writes the text element into a printable iframe and attaches its print styles.
47756
47831
  *
47757
47832
  * @private
47758
- * @param {string[]} stylesheets - Stylesheets needed for print
47833
+ * @param {string[]} stylesheets - Third-party stylesheets needed for print, before the viewer's own styles
47759
47834
  * @return {void}
47760
47835
  */
47761
47836
  preparePrint(stylesheets) {
47762
47837
  const assetUrlCreator = (0,util/* createAssetUrlCreator */.my)(this.options.location);
47763
47838
  this.printframe = (0,util/* openContentInsideIframe */.G9)(this.textEl.outerHTML);
47839
+ const {
47840
+ head
47841
+ } = this.printframe.contentDocument;
47764
47842
  stylesheets.forEach(stylesheet => {
47765
- this.printframe.contentDocument.head.appendChild((0,util/* createStylesheet */.fX)(assetUrlCreator(stylesheet)));
47843
+ head.appendChild((0,util/* createStylesheet */.fX)(assetUrlCreator(stylesheet)));
47766
47844
  });
47845
+
47846
+ // npm consumers bundle the viewer CSS themselves and host no preview.css to link to.
47847
+ if ((0,isNpmBuild/* isNpmBuild */.w)()) {
47848
+ const printStyleEl = document.createElement('style');
47849
+ printStyleEl.textContent = this.getPrintStyles();
47850
+ head.appendChild(printStyleEl);
47851
+ } else {
47852
+ head.appendChild((0,util/* createStylesheet */.fX)(assetUrlCreator('preview.css')));
47853
+ }
47767
47854
  setTimeout(() => {
47768
47855
  if (this.printPopup instanceof PrintModalRoot) {
47769
47856
  this.printPopup.showReady(PlainTextViewer_('print_ready'));
@@ -47858,6 +47945,7 @@ function MarkdownControlsV2({
47858
47945
 
47859
47946
 
47860
47947
 
47948
+
47861
47949
  const MarkdownViewer_STATIC_URI = `third-party/text/${constants/* TEXT_STATIC_ASSETS_VERSION */.cR}/`;
47862
47950
  class MarkdownViewer extends text_PlainTextViewer {
47863
47951
  /**
@@ -47896,6 +47984,13 @@ class MarkdownViewer extends text_PlainTextViewer {
47896
47984
  return super.getCSS().concat(`${MarkdownViewer_STATIC_URI}github-markdown.min.css`);
47897
47985
  }
47898
47986
 
47987
+ /**
47988
+ * @inheritdoc
47989
+ */
47990
+ getPrintStyles() {
47991
+ return MARKDOWN_PRINT_STYLES;
47992
+ }
47993
+
47899
47994
  /**
47900
47995
  * Prints text using an an iframe. Adds Github Markdown CSS to print styles.
47901
47996
  *
@@ -47904,7 +47999,7 @@ class MarkdownViewer extends text_PlainTextViewer {
47904
47999
  */
47905
48000
  print() {
47906
48001
  if (!this.printReady) {
47907
- this.preparePrint(this.getCSS().concat('preview.css'));
48002
+ this.preparePrint(this.getCSS());
47908
48003
  this.printPopup.show(MarkdownViewer_('print_loading'), MarkdownViewer_('print'), () => {
47909
48004
  this.printPopup.hide();
47910
48005
  this.printIframe();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-content-preview",
3
- "version": "3.125.0",
3
+ "version": "3.126.0",
4
4
  "description": "Box Content Preview UI Element",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",