box-content-preview 3.93.0 → 3.95.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.93.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
5
+ [![version](https://img.shields.io/badge/version-v3.95.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.93.0
25
+ - Version: v3.95.0
26
26
  - Locale: en-US
27
27
 
28
- https://cdn01.boxcdn.net/platform/preview/3.93.0/en-US/preview.js
29
- https://cdn01.boxcdn.net/platform/preview/3.93.0/en-US/preview.css
28
+ https://cdn01.boxcdn.net/platform/preview/3.95.0/en-US/preview.js
29
+ https://cdn01.boxcdn.net/platform/preview/3.95.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.93.0/en-US/preview.js"></script>
55
+ <script src="https://cdn01.boxcdn.net/platform/preview/3.95.0/en-US/preview.js"></script>
56
56
  <link
57
57
  rel="stylesheet"
58
- href="https://cdn01.boxcdn.net/platform/preview/3.93.0/en-US/preview.css"
58
+ href="https://cdn01.boxcdn.net/platform/preview/3.95.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.93.0`
79
+ - Check out a specific version with `git checkout v3.95.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`
@@ -61,8 +61,8 @@
61
61
  .bp-MarkerAvatarStack{position:absolute;bottom:calc(100% + 4px);left:50%;display:flex;align-items:center;transform:translateX(-50%)}.bp-MarkerAvatarStack-item{position:relative;flex-shrink:0;box-sizing:content-box;width:20px;height:20px;padding:0;background:none;border:0;border-radius:50%;outline:none;overflow:visible;cursor:pointer;appearance:none;transition:margin 150ms}.bp-MarkerAvatarStack-item:focus,.bp-MarkerAvatarStack-item:focus-visible{outline:none}.bp-MarkerAvatarStack-item:not(:first-child){margin-left:var(--bp-marker-stack-overlap, -10px)}.bp-MarkerAvatarStack-item .bp-MarkerAvatar{position:absolute;top:50%;bottom:auto;left:50%;display:block;transform:translate(-50%, -50%);transform-origin:center center}.bp-MarkerAvatarStack-item:hover,.bp-MarkerAvatarStack-item:focus-visible{z-index:3}:is(.bp-WaveformCommentMarkers-marker--group,.bp-TimeControlsV2-marker--group,.bp-MarkerCluster):is(:hover,:has(.bp-MarkerAvatarStack-item:focus-visible)) .bp-MarkerAvatarStack-item:not(:first-child){margin-left:2px}.bp-MarkerAvatarStack-overflow{cursor:pointer}.bp-MarkerAvatarStack-overflowBadge{background-color:#383838;color:#fff}.bp-MarkerAvatarStack-overflowBadge .bp-MarkerAvatar-initial{color:#fff}
62
62
  .bp-WaveformCommentMarkers{position:absolute;top:-2px;right:0;left:0;z-index:4;box-sizing:border-box;height:24px;padding:0 60px;overflow:visible;pointer-events:auto}.bp-WaveformCommentMarkers--zoomed,.bp-WaveformCommentMarkers--tape{padding:0;overflow:clip visible}.bp-WaveformCommentMarkers--tape{top:auto;bottom:100%;margin-bottom:12px}.bp-WaveformCommentMarkers-track{position:relative;width:100%;height:100%;overflow:visible}.bp-WaveformCommentMarkers--zoomed .bp-WaveformCommentMarkers-track,.bp-WaveformCommentMarkers--tape .bp-WaveformCommentMarkers-track{overflow:clip visible}.bp-WaveformCommentMarkers-marker{position:absolute;top:50%;z-index:1;display:flex;align-items:center;justify-content:center;width:auto;height:auto;padding:0;background:none;border:0;border-radius:50%;transform:translate(-50%, -50%);cursor:pointer;appearance:none;pointer-events:auto;overflow:visible;outline:none;transition:box-shadow 150ms}.bp-WaveformCommentMarkers-marker:focus,.bp-WaveformCommentMarkers-marker:focus-visible{outline:none}.bp-WaveformCommentMarkers-marker .bp-MarkerAvatar{overflow:visible;isolation:isolate;cursor:pointer}.bp-WaveformCommentMarkers-marker .bp-MarkerAvatar img{cursor:pointer}.bp-WaveformCommentMarkers-marker .bp-MarkerAvatar::after{position:absolute;z-index:1;inset:0;background:#000;border-radius:50%;opacity:.4;pointer-events:none;content:"";transition:opacity 150ms}.bp-WaveformCommentMarkers-marker>.bp-MarkerAvatar{position:relative;bottom:auto;left:auto;transform:none;transform-origin:center center}.bp-WaveformCommentMarkers-marker .bp-MarkerAvatar:not(.bp-MarkerAvatarStack-overflowBadge),.bp-WaveformCommentMarkers-marker .bp-MarkerAvatarStack .bp-MarkerAvatar:not(.bp-MarkerAvatarStack-overflowBadge){background-color:#000}.bp-WaveformCommentMarkers-marker .bp-MarkerAvatarStack{position:relative;bottom:auto;left:auto;transform:none}.bp-WaveformCommentMarkers-marker--group{width:auto}.bp-WaveformView:hover~.bp-WaveformCommentMarkers .bp-MarkerAvatar::after,.bp-WaveformCommentMarkers:hover .bp-MarkerAvatar::after,.bp-WaveformCommentMarkers:has(:focus-visible) .bp-MarkerAvatar::after,.bp-WaveformCommentMarkers-marker:not(.bp-WaveformCommentMarkers-marker--group).bp-WaveformCommentMarkers-marker--selected .bp-MarkerAvatar::after,.bp-WaveformCommentMarkers .bp-MarkerAvatarStack-item--selected .bp-MarkerAvatar::after{opacity:0}.bp-WaveformCommentMarkers-marker--selected{z-index:3}.bp-WaveformCommentMarkers-marker:hover,.bp-WaveformCommentMarkers-marker:focus-within{z-index:4}.bp-WaveformCommentMarkers .bp-MarkerAvatarStack-item{cursor:pointer;transition:margin 150ms}.bp-WaveformCommentMarkers .bp-MarkerAvatarStack-item:hover,.bp-WaveformCommentMarkers .bp-MarkerAvatarStack-item:focus-visible{z-index:3}@media(prefers-reduced-motion: reduce){.bp-WaveformCommentMarkers-marker,.bp-WaveformCommentMarkers .bp-MarkerAvatarStack-item,.bp-WaveformCommentMarkers-marker .bp-MarkerAvatar::after{transition:none}}
63
63
  .bp-WaveformGeneratingIndicator{display:flex;gap:4px;align-items:center;height:48px;padding:8px 16px 8px 12px;pointer-events:none}.bp-WaveformGeneratingIndicator-bars{display:flex;flex:0 0 24px;align-items:center;justify-content:center;width:24px;height:24px}.bp-WaveformGeneratingIndicator-bar{width:2px;height:10px;background:rgba(255,255,255,.3);border-radius:6px;animation:bp-WaveformGeneratingIndicator-pulse .66s ease-in-out infinite}.bp-WaveformGeneratingIndicator-bar:nth-child(2){margin-left:2px;animation-delay:.1s}.bp-WaveformGeneratingIndicator-bar:last-child{margin-left:2px;animation-delay:.2s}.bp-WaveformGeneratingIndicator-label{color:#fff;font-weight:normal;font-size:14px;line-height:22px;white-space:nowrap}@keyframes bp-WaveformGeneratingIndicator-pulse{0%,80%,100%{background:rgba(255,255,255,.3);transform:scaleY(1.2)}40%{background:#fff;transform:scaleY(1.6)}}@media(prefers-reduced-motion: reduce){.bp-WaveformGeneratingIndicator-bar{animation:none;background:#fff;transform:none}}
64
- .bp-WaveformRange{position:absolute;inset:0;z-index:2;pointer-events:none}.bp-WaveformRange-region{position:absolute;top:50%;box-sizing:border-box;height:150px;pointer-events:none;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.4);border-radius:10px;box-shadow:0 0 0 1px #222;transform:translateY(-50%);transition:border-width 100ms ease,border-color 100ms ease}.bp-WaveformRange--highlight .bp-WaveformRange-region,.bp-WaveformRange:has(.bp-WaveformRange-handle:hover) .bp-WaveformRange-region,.bp-WaveformRange:has(.bp-WaveformRange-handle--dragging) .bp-WaveformRange-region{border-width:2px;border-color:#fff}.bp-WaveformRange-handle{position:absolute;top:50%;z-index:1;width:24px;height:150px;pointer-events:auto;cursor:ew-resize;touch-action:none;transform:translate(-50%, -50%)}.bp-WaveformRange-handle--end{z-index:2}.bp-WaveformRange-handleGrip{position:absolute;top:50%;left:50%;width:8px;height:20px;background:#fff;border:1px solid #222;border-radius:4px;box-shadow:0 1px 4px rgba(0,0,0,.4);opacity:0;pointer-events:none;transform:translate(-50%, -50%) scale(0.5);transition:opacity 100ms ease-in,transform 100ms ease-in}.bp-WaveformRange-handle:hover .bp-WaveformRange-handleGrip,.bp-WaveformRange-handle:focus-visible .bp-WaveformRange-handleGrip,.bp-WaveformRange-handle--dragging .bp-WaveformRange-handleGrip{opacity:1;transform:translate(-50%, -50%) scale(1);transition:opacity 150ms ease-out,transform 150ms ease-out}.bp-WaveformRange-tooltip{position:absolute;top:100%;z-index:3;margin-top:4px;pointer-events:none;transform:translateX(-50%)}.bp-WaveformRange-tooltipTime{padding:4px 10px;color:#fff;font-weight:normal;font-size:14px;font-family:Lato,Arial,sans-serif;line-height:20px;letter-spacing:.3px;white-space:nowrap;background:rgba(34,34,34,.92);border:1px solid rgba(255,255,255,.18);border-radius:8px}@media(prefers-reduced-motion: reduce){.bp-WaveformRange-region,.bp-WaveformRange-handleGrip{transition:none}}
65
- .bp-WaveformView{box-sizing:border-box;width:100%;height:206px;min-height:206px;padding:0 60px;overflow:visible;background:none;-webkit-tap-highlight-color:transparent}.bp-WaveformView.bp-WaveformView--zoomed,.bp-WaveformView.bp-WaveformView--tape{padding:0;touch-action:none}.bp-WaveformView.bp-WaveformView--zoomed .bp-WaveformView-canvas,.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-canvas{overflow:hidden;mask-image:linear-gradient(to right, transparent, #000 92px, #000 calc(100% - 92px), transparent)}.bp-WaveformView.bp-WaveformView--zoomed .bp-WaveformView-canvas>*::part(scroll),.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-canvas>*::part(scroll){overscroll-behavior-x:none}.bp-WaveformView.bp-WaveformView--tape{flex:1 1 auto;height:100%;min-height:0}.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-canvas{height:100%}.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-canvas>*::part(scroll){scrollbar-width:none}.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-playhead,.bp-WaveformView.bp-WaveformView--tape .bp-WaveformRange-region,.bp-WaveformView.bp-WaveformView--tape .bp-WaveformRange-handle{height:calc(100% + 10px)}.bp-WaveformView-track{position:relative;display:flex;align-items:center;width:100%;height:100%;cursor:pointer}.bp-WaveformView-canvas{z-index:0;width:100%;height:140px}.bp-WaveformView-playhead{position:absolute;top:50%;left:0;z-index:1;width:2px;height:150px;pointer-events:none;background:linear-gradient(#2487ff, #006bed);border-radius:1px;box-shadow:0 0 0 1px #222,0 0 10px 0 rgba(36,135,255,.3);transform:translate(-50%, -50%)}.bp-WaveformView-hover{position:absolute;top:100%;z-index:2;margin-top:4px;pointer-events:none;transform:translateX(-50%)}.bp-WaveformView-hover--tape{top:-24px;left:50%;z-index:5;margin-top:0;transform:translate(-50%, -50%)}.bp-WaveformView-hoverTime{padding:4px 10px;color:#fff;font-weight:normal;font-size:14px;font-family:Lato,Arial,sans-serif;line-height:20px;letter-spacing:.3px;white-space:nowrap;background:rgba(34,34,34,.92);border:1px solid rgba(255,255,255,.18);border-radius:8px}.bp-WaveformView--inert{pointer-events:none}.bp-WaveformView--inert .bp-WaveformView-track{cursor:default}.bp-WaveformView--inert .bp-WaveformRange-handle{pointer-events:none;cursor:default}.bp-WaveformView:not(:hover) .bp-WaveformRange:not(.bp-WaveformRange--persist){opacity:.4}
64
+ .bp-WaveformRange{position:absolute;inset:0;z-index:2;pointer-events:none}.bp-WaveformRange-region{position:absolute;top:50%;box-sizing:border-box;height:150px;pointer-events:none;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.4);border-radius:10px;box-shadow:0 0 0 1px #222;transform:translateY(-50%);transition:border-width 100ms ease,border-color 100ms ease}.bp-WaveformRange--highlight .bp-WaveformRange-region,.bp-WaveformRange:has(.bp-WaveformRange-handle:hover) .bp-WaveformRange-region,.bp-WaveformRange:has(.bp-WaveformRange-handle--dragging) .bp-WaveformRange-region{border-width:2px;border-color:#fff}.bp-WaveformRange-handle{position:absolute;top:50%;z-index:1;width:24px;height:150px;pointer-events:auto;cursor:ew-resize;touch-action:none;transform:translate(-50%, -50%)}.bp-WaveformRange-handle--end{z-index:2}.bp-WaveformRange-handleGrip{position:absolute;top:50%;left:50%;width:8px;height:20px;background:#fff;border:1px solid #222;border-radius:4px;box-shadow:0 1px 4px rgba(0,0,0,.4);opacity:0;pointer-events:none;transform:translate(-50%, -50%) scale(0.5);transition:opacity 100ms ease-in,transform 100ms ease-in}.bp-WaveformRange-handle:hover .bp-WaveformRange-handleGrip,.bp-WaveformRange-handle:focus-visible .bp-WaveformRange-handleGrip,.bp-WaveformRange-handle--dragging .bp-WaveformRange-handleGrip{opacity:1;transform:translate(-50%, -50%) scale(1);transition:opacity 150ms ease-out,transform 150ms ease-out}.bp-WaveformRange-comment{position:absolute;top:calc(50% - 75px);z-index:5;display:inline-flex;gap:8px;align-items:center;justify-content:center;box-sizing:border-box;height:48px;padding:8px 14px;color:rgba(255,255,255,.8);font-weight:normal;font-size:14px;font-family:Lato,Arial,sans-serif;line-height:22px;letter-spacing:.1px;white-space:nowrap;background:rgba(0,0,0,.8);border:0;backdrop-filter:blur(12px);border-radius:46px;box-shadow:0 2px 4px 0 rgba(0,0,0,.12);transform:translate(-50%, calc(-100% - 36px));cursor:pointer;appearance:none;pointer-events:auto}.bp-WaveformRange-commentIcon{display:block;flex:0 0 auto;width:20px;height:20px}.bp-WaveformView--tape .bp-WaveformRange-comment{top:calc(50% - (100% + 10px) / 2)}.bp-WaveformRange-tooltip{position:absolute;top:100%;z-index:3;margin-top:4px;pointer-events:none;transform:translateX(-50%)}.bp-WaveformRange-tooltipTime{padding:4px 10px;color:#fff;font-weight:normal;font-size:14px;font-family:Lato,Arial,sans-serif;line-height:20px;letter-spacing:.3px;white-space:nowrap;background:rgba(34,34,34,.92);border:1px solid rgba(255,255,255,.18);border-radius:8px}@media(prefers-reduced-motion: reduce){.bp-WaveformRange-region,.bp-WaveformRange-handleGrip{transition:none}}
65
+ .bp-WaveformView{box-sizing:border-box;width:100%;height:206px;min-height:206px;padding:0 60px;overflow:visible;background:none;-webkit-tap-highlight-color:transparent}.bp-WaveformView.bp-WaveformView--zoomed,.bp-WaveformView.bp-WaveformView--tape{padding:0;touch-action:none}.bp-WaveformView.bp-WaveformView--zoomed .bp-WaveformView-canvas,.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-canvas{overflow:hidden;mask-image:linear-gradient(to right, transparent, #000 92px, #000 calc(100% - 92px), transparent)}.bp-WaveformView.bp-WaveformView--zoomed .bp-WaveformView-canvas>*::part(scroll),.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-canvas>*::part(scroll){overscroll-behavior-x:none}.bp-WaveformView.bp-WaveformView--tape{flex:1 1 auto;height:100%;min-height:0}.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-canvas{height:100%}.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-canvas>*::part(scroll){scrollbar-width:none}.bp-WaveformView.bp-WaveformView--tape .bp-WaveformView-playhead,.bp-WaveformView.bp-WaveformView--tape .bp-WaveformRange-region,.bp-WaveformView.bp-WaveformView--tape .bp-WaveformRange-handle{height:calc(100% + 10px)}.bp-WaveformView-track{position:relative;display:flex;align-items:center;width:100%;height:100%;cursor:pointer}.bp-WaveformView-canvas{z-index:0;width:100%;height:140px}.bp-WaveformView-playhead{position:absolute;top:50%;left:0;z-index:1;width:2px;height:150px;pointer-events:none;background:linear-gradient(#2487ff, #006bed);border-radius:1px;box-shadow:0 0 0 1px #222,0 0 10px 0 rgba(36,135,255,.3);transform:translate(-50%, -50%)}.bp-WaveformView-hover{position:absolute;top:100%;z-index:2;margin-top:4px;pointer-events:none;transform:translateX(-50%)}.bp-WaveformView-hover--tape{top:-24px;left:50%;z-index:5;margin-top:0;transform:translate(-50%, -50%)}.bp-WaveformView-hoverTime{padding:4px 10px;color:#fff;font-weight:normal;font-size:14px;font-family:Lato,Arial,sans-serif;line-height:20px;letter-spacing:.3px;white-space:nowrap;background:rgba(34,34,34,.92);border:1px solid rgba(255,255,255,.18);border-radius:8px}.bp-WaveformView--inert{pointer-events:none}.bp-WaveformView--inert .bp-WaveformView-track{cursor:default}.bp-WaveformView--inert .bp-WaveformRange-handle,.bp-WaveformView--inert .bp-WaveformRange-comment{pointer-events:none;cursor:default}.bp-WaveformView:not(:hover) .bp-WaveformRange:not(.bp-WaveformRange--persist){opacity:.4}
66
66
  .bp-SliderControl{outline:0;position:relative;cursor:pointer}.bp-SliderControl:focus:not(:disabled){box-shadow:inset 0 0 0 1px rgba(211,211,211,.5),0 1px 2px rgba(0,0,0,.1)}.bp-SliderControl:focus-visible:not(:disabled){box-shadow:inset 0 0 0 1px rgba(211,211,211,.5),0 1px 2px rgba(0,0,0,.1)}.bp-SliderControl:focus:not(:focus-visible){box-shadow:none}.bp-SliderControl-thumb{position:absolute;top:calc(50% - 6px);width:12px;height:12px;margin-left:-6px;background:#0061d5;border:0;border-radius:12px;cursor:pointer}.bp-SliderControl-track{position:absolute;inset:0;height:3px;margin:auto 3px;background:transparent linear-gradient(#fff, #fff) no-repeat center border-box}
67
67
  .bp-WaveformZoomControl{display:flex;flex-direction:row;gap:0;align-items:center;justify-content:flex-end;width:48px;height:48px;padding:4px;overflow:hidden;background:rgba(255,255,255,.1);border-radius:32px;box-shadow:0 2px 12px rgba(0,0,0,.08);backdrop-filter:blur(60px);transition:width 150ms ease-out,gap 150ms ease-out}.bp-WaveformZoomControl.bp-has-multiplier{padding:4px 4px 4px 12px}.bp-WaveformZoomControl.bp-has-multiplier:not(.bp-is-open){width:88px}.bp-WaveformZoomControl.bp-is-open{gap:8px;width:207px}.bp-WaveformZoomControl.bp-is-open.bp-has-multiplier{width:264px}.bp-WaveformZoomControl-multiplier{display:flex;flex:0 0 32px;order:-3;align-items:center;justify-content:center;width:32px;height:32px;color:#fff;font-weight:500;font-size:14px;line-height:22px;pointer-events:none;-webkit-user-select:none;user-select:none;white-space:nowrap}.bp-WaveformZoomControl-divider{display:none;flex:0 0 1px;order:-2;width:1px;height:28px;background:rgba(255,255,255,.3)}.bp-WaveformZoomControl.bp-is-open.bp-has-multiplier .bp-WaveformZoomControl-divider{display:block}.bp-WaveformZoomControl-flyout{display:flex;flex:0 0 auto;order:-1;gap:8px;align-items:center;width:0;height:40px;overflow:hidden;transition:width 150ms ease-out}.bp-WaveformZoomControl-flyout.bp-is-open{width:151px}.bp-WaveformZoomControl-slider{width:103px;height:8px}.bp-WaveformZoomControl-slider .bp-SliderControl-track{height:8px;margin:0;background:rgba(255,255,255,.3);background-image:none;border-radius:20px}.bp-WaveformZoomControl-slider .bp-SliderControl-track::after{position:absolute;top:0;left:0;width:calc(8px + 95px * var(--bp-zoom-t, 0));height:8px;background:rgba(255,255,255,.9);border-radius:20px;content:""}.bp-WaveformZoomControl-slider .bp-SliderControl-thumb{display:none}.bp-WaveformZoomControl-button{position:relative;z-index:1;display:flex;flex:0 0 40px;align-items:center;justify-content:center;width:40px;height:40px;padding:0;color:#fff;background:transparent;border:0;border-radius:50%;cursor:pointer}.bp-WaveformZoomControl-button[aria-disabled=true]{cursor:default;opacity:.3}.bp-WaveformZoomControl-button svg{width:20px;height:20px;padding:0}@media(prefers-reduced-motion: reduce){.bp-WaveformZoomControl,.bp-WaveformZoomControl-flyout{transition:none}}
68
68
  .bp-MP3ControlsRoot:has(.bp-MP3ControlsV2){position:absolute;inset:0;width:100%;height:100%;transform:none;pointer-events:none}.bp-MP3ControlsV2{--bp-waveform-bar-min: 140px;position:relative;width:100%;max-width:none;height:100%;background:transparent;pointer-events:none}.bp-MP3ControlsV2-stage{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:0;pointer-events:none}.bp-MP3ControlsV2-stage .bp-WaveformView,.bp-MP3ControlsV2-stage .bp-MP3ControlsV2-waveform,.bp-MP3ControlsV2-stage .bp-WaveformCommentMarkers{pointer-events:auto}.bp-MP3ControlsV2-waveform{position:relative;width:100%;overflow:visible}.bp-MP3ControlsV2-stage:has(.bp-WaveformView--tape) .bp-MP3ControlsV2-waveform{display:flex;flex-direction:column;height:max(var(--bp-waveform-bar-min, 140px), 25%);min-height:0}.bp-MP3ControlsV2-waveformZoom{position:absolute;top:48px;right:48px;z-index:6;pointer-events:none}.bp-MP3ControlsV2-waveformZoom .bp-WaveformZoomControl{pointer-events:auto}.bp-MP3ControlsV2-playOverlay{position:absolute;top:50%;left:50%;z-index:2;display:flex;align-items:center;justify-content:center;width:80px;height:80px;padding:0;background:rgba(0,0,0,.5);border:0;border-radius:50%;transform:translate(-50%, -50%);cursor:pointer;pointer-events:auto}.bp-MP3ControlsV2-playOverlay svg{width:48px;height:48px;fill:#fff}.bp-MP3ControlsV2-stage .bp-media-buffering-spinner{z-index:2;pointer-events:none}.bp-MP3ControlsV2-bar{position:absolute;right:0;bottom:0;left:0;z-index:2;display:flex;align-items:center;justify-content:space-between;min-height:32px;padding:30px 58px 25px;background:linear-gradient(to top, black, rgba(0, 0, 0, 0));pointer-events:auto}.bp-MP3ControlsV2-group{display:flex;gap:12px;align-items:center}.bp-MP3ControlsV2-divider{width:1px;height:24px;background-color:rgba(255,255,255,.1);border-radius:1px}.bp-MP3ControlsV2 .bp-MP3Controls-settings{position:relative}.bp-MP3ControlsV2 .bp-MP3Controls-settings .bp-SettingsFlyout{right:15px}.bp-MP3ControlsV2 .bp-MP3Controls-settings .bp-SettingsToggle-button{width:36px;height:40px}
package/dist/lib/index.js CHANGED
@@ -1018,7 +1018,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
1018
1018
  const CLIENT_NAME = "box-content-preview"; // eslint-disable-line no-undef
1019
1019
  const CLIENT_NAME_KEY = 'box_client_name';
1020
1020
  const CLIENT_VERSION_KEY = 'box_client_version';
1021
- const CLIENT_VERSION = "3.93.0"; // eslint-disable-line no-undef
1021
+ const CLIENT_VERSION = "3.95.0"; // eslint-disable-line no-undef
1022
1022
  const HEADER_CLIENT_NAME = 'X-Box-Client-Name';
1023
1023
  const HEADER_CLIENT_VERSION = 'X-Box-Client-Version';
1024
1024
  const PROMISE_MAP = {};
@@ -4609,7 +4609,7 @@ function getPdfjsWorkerSrc() {
4609
4609
 
4610
4610
  /***/ },
4611
4611
 
4612
- /***/ 673
4612
+ /***/ 8862
4613
4613
  (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
4614
4614
 
4615
4615
 
@@ -5605,6 +5605,25 @@ function usePlayheadCamera({
5605
5605
  seekTo
5606
5606
  };
5607
5607
  }
5608
+ ;// ./src/lib/viewers/controls/icons/IconComment24.tsx
5609
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
5610
+
5611
+ function IconComment24(props) {
5612
+ return /*#__PURE__*/external_react_.createElement("svg", _extends({
5613
+ "data-testid": "IconComment24",
5614
+ fill: "none",
5615
+ focusable: false,
5616
+ height: 24,
5617
+ viewBox: "0 0 24 24",
5618
+ width: 24
5619
+ }, props), /*#__PURE__*/external_react_.createElement("path", {
5620
+ clipRule: "evenodd",
5621
+ d: "M4 11c0-2.297.683-3.999 1.926-5.138C7.18 4.712 9.155 4 12 4c2.845 0 4.819.711 6.074 1.862C19.317 7.001 20 8.702 20 11c0 2.297-.683 3.999-1.926 5.138C16.82 17.288 14.845 18 12 18h-.459a1.1 1.1 0 0 0-.774.318C9.665 19.41 8.243 20.048 7.16 20.2c-.553.078-.905.013-1.07-.065C6 20.09 6 20.084 6 20V20c0-.22.072-.347.361-.813.285-.458.665-1.104.685-2.104a1.1 1.1 0 0 0-.606-1.005C4.885 15.298 4 13.745 4 11Zm8-9c-3.155 0-5.681.789-7.426 2.388C2.817 5.999 2 8.298 2 11c0 2.938.91 5.227 2.966 6.539a2.79 2.79 0 0 1-.303.592l-.055.088C4.372 18.591 4 19.18 4 20c0 .912.496 1.59 1.23 1.94.657.313 1.453.345 2.205.24 1.428-.2 3.108-.95 4.464-2.18H12c3.155 0 5.681-.789 7.426-2.388C21.183 16.001 22 13.702 22 11c0-2.703-.817-5.001-2.574-6.612C17.68 2.788 15.155 2 12 2ZM8 12a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm5-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
5622
+ fill: "currentColor",
5623
+ fillRule: "evenodd"
5624
+ }));
5625
+ }
5626
+ /* harmony default export */ const icons_IconComment24 = (IconComment24);
5608
5627
  ;// ./src/lib/viewers/media/waveform/WaveformRangeSelection.scss
5609
5628
  // extracted by mini-css-extract-plugin
5610
5629
 
@@ -5615,6 +5634,7 @@ function usePlayheadCamera({
5615
5634
 
5616
5635
 
5617
5636
 
5637
+
5618
5638
  function offsetLeftCss(base, offsetPx) {
5619
5639
  if (!offsetPx) {
5620
5640
  return base;
@@ -5651,6 +5671,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5651
5671
  interactive = true,
5652
5672
  isHighlighted = false,
5653
5673
  keepHighlight = true,
5674
+ onDragCreate,
5654
5675
  onDragChange,
5655
5676
  onPreviewChange,
5656
5677
  onRangeChange,
@@ -5662,6 +5683,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5662
5683
  const startHandleRef = (0,external_react_.useRef)(null);
5663
5684
  const endHandleRef = (0,external_react_.useRef)(null);
5664
5685
  const tooltipRef = (0,external_react_.useRef)(null);
5686
+ const commentRef = (0,external_react_.useRef)(null);
5665
5687
  const dragRef = (0,external_react_.useRef)(null);
5666
5688
  const rangeRef = (0,external_react_.useRef)(range);
5667
5689
  const displayedRef = (0,external_react_.useRef)((0,waveform_range/* resolveRange */.Ss)(range, (0,waveform_range/* durationMsFromSec */.uH)(durationSec)));
@@ -5684,6 +5706,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5684
5706
  const durationMs = (0,waveform_range/* durationMsFromSec */.uH)(durationSec);
5685
5707
  const displayed = dragRange ?? (0,waveform_range/* resolveRange */.Ss)(range, durationMs);
5686
5708
  displayedRef.current = displayed;
5709
+ const showCommentButton = Boolean(onDragCreate) && displayed.startMs !== displayed.endMs && activeHandle == null;
5687
5710
  const syncPositions = (0,external_react_.useCallback)((next, nextViewport, nextDurationSec) => {
5688
5711
  displayedRef.current = next;
5689
5712
  const collapsed = next.startMs === next.endMs;
@@ -5696,6 +5719,10 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5696
5719
  const tooltipMs = tooltipHandle === 'start' ? next.startMs : next.endMs;
5697
5720
  tooltip.style.left = (0,waveform_viewport/* timeLeftPercent */.Mu)(tooltipMs / 1000, nextDurationSec, nextViewport);
5698
5721
  }
5722
+ const comment = commentRef.current;
5723
+ if (comment && next.startMs !== next.endMs) {
5724
+ comment.style.left = (0,waveform_viewport/* timeLeftPercent */.Mu)((next.startMs + next.endMs) / 2000, nextDurationSec, nextViewport);
5725
+ }
5699
5726
  }, []);
5700
5727
  (0,external_react_.useImperativeHandle)(ref, () => ({
5701
5728
  applyViewport: nextViewport => {
@@ -5705,7 +5732,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5705
5732
  }), [syncPositions]);
5706
5733
  (0,external_react_.useLayoutEffect)(() => {
5707
5734
  syncPositions(displayedRef.current, viewportRef.current, durationSec);
5708
- }, [activeHandle, displayed.endMs, displayed.startMs, durationSec, syncPositions]);
5735
+ }, [activeHandle, displayed.endMs, displayed.startMs, durationSec, showCommentButton, syncPositions]);
5709
5736
  (0,external_react_.useLayoutEffect)(() => {
5710
5737
  const next = (0,waveform_viewport/* createWaveformViewport */.eq)({
5711
5738
  durationSec: viewport.durationSec,
@@ -5871,6 +5898,22 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5871
5898
  const tooltipMs = tooltipHandle === 'start' ? displayed.startMs : displayed.endMs;
5872
5899
  const collapsed = displayed.startMs === displayed.endMs;
5873
5900
  const highlight = isHighlighted || collapsed;
5901
+ const commentButton = showCommentButton && onDragCreate ? /*#__PURE__*/external_react_["default"].createElement("button", {
5902
+ ref: commentRef,
5903
+ className: "bp-WaveformRange-comment",
5904
+ "data-testid": "bp-waveform-range-comment",
5905
+ onClick: event => {
5906
+ event.stopPropagation();
5907
+ onDragCreate();
5908
+ },
5909
+ onPointerDown: event => {
5910
+ event.stopPropagation();
5911
+ },
5912
+ type: "button"
5913
+ }, /*#__PURE__*/external_react_["default"].createElement(icons_IconComment24, {
5914
+ "aria-hidden": "true",
5915
+ className: "bp-WaveformRange-commentIcon"
5916
+ }), "Comment") : null;
5874
5917
  return /*#__PURE__*/external_react_["default"].createElement("div", {
5875
5918
  ref: rootRef,
5876
5919
  className: `bp-WaveformRange${keepHighlight ? ' bp-WaveformRange--persist' : ''}${highlight ? ' bp-WaveformRange--highlight' : ''}`,
@@ -5903,7 +5946,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
5903
5946
  "data-testid": "bp-waveform-range-tooltip"
5904
5947
  }, /*#__PURE__*/external_react_["default"].createElement("div", {
5905
5948
  className: "bp-WaveformRange-tooltipTime"
5906
- }, formatTime(tooltipMs / 1000))));
5949
+ }, formatTime(tooltipMs / 1000))), commentButton);
5907
5950
  });
5908
5951
  /* harmony default export */ const waveform_WaveformRangeSelection = (/*#__PURE__*/external_react_["default"].memo(WaveformRangeSelection));
5909
5952
  ;// ./src/lib/viewers/media/waveform/WaveformView.scss
@@ -6023,6 +6066,46 @@ function zoomOriginAtPointer(pointerX, wavesurfer, durationSec, fallbackWidth) {
6023
6066
  timeSec: (WaveformView_getScrollLeft(wavesurfer) + pointerX) / fullWidth * durationSec
6024
6067
  };
6025
6068
  }
6069
+ /** Null when the press should stay a click-to-seek or is not on an empty span of the track. */
6070
+ function rangeCreateDragFromEvent(event, source) {
6071
+ const {
6072
+ track
6073
+ } = source;
6074
+ if (!track || !(source.durationSec > 0) || !Number.isFinite(event.clientX)) {
6075
+ return null;
6076
+ }
6077
+ const rect = track.getBoundingClientRect();
6078
+ if (!(rect.width > 0)) {
6079
+ return null;
6080
+ }
6081
+ const pointerX = event.clientX - rect.left;
6082
+ if (source.range && !(0,waveform_range/* isRangeCollapsed */.BT)(source.range) && (0,waveform_range/* isPointerOverRange */.H5)({
6083
+ pointerX,
6084
+ range: source.range,
6085
+ viewport: source.viewport
6086
+ })) {
6087
+ return null;
6088
+ }
6089
+ return {
6090
+ active: false,
6091
+ originMs: (0,waveform_range/* clampTimeMs */.DL)((0,waveform_range/* pointerTimeMs */.v2)(pointerX, source.viewport), (0,waveform_range/* durationMsFromSec */.uH)(source.durationSec)),
6092
+ originX: event.clientX,
6093
+ pointerId: event.pointerId,
6094
+ range: null
6095
+ };
6096
+ }
6097
+ function drawnRangeFromMove(drag, clientX, track, viewport, playheadSec, durationSec) {
6098
+ const pointerMs = (0,waveform_range/* snapTimeMs */.Mh)({
6099
+ pixelsPerSecond: viewport.pixelsPerSecond,
6100
+ playheadMs: playheadSec * 1000,
6101
+ timeMs: (0,waveform_range/* pointerTimeMs */.v2)(clientX - track.getBoundingClientRect().left, viewport)
6102
+ });
6103
+ return (0,waveform_range/* rangeFromCreateDrag */.Qp)({
6104
+ durationMs: (0,waveform_range/* durationMsFromSec */.uH)(durationSec),
6105
+ originMs: drag.originMs,
6106
+ pointerMs
6107
+ });
6108
+ }
6026
6109
 
6027
6110
  /**
6028
6111
  * Renders V1 peaks with wavesurfer. Does not fetch audio or attach a media element.
@@ -6039,6 +6122,7 @@ function WaveformView({
6039
6122
  onPlayPause,
6040
6123
  onRangeChange,
6041
6124
  onRangeClear,
6125
+ onRangeDragCreate,
6042
6126
  onRangeDragChange,
6043
6127
  onSeek,
6044
6128
  onViewportChange,
@@ -6065,7 +6149,9 @@ function WaveformView({
6065
6149
  const mediaElRef = (0,external_react_.useRef)(mediaEl); // latest <audio>/<video>; camera + playhead tick read this
6066
6150
  const onPlayPauseRef = (0,external_react_.useRef)(onPlayPause); // latest play/pause; tape tap must not re-bind
6067
6151
  const onSeekRef = (0,external_react_.useRef)(onSeek); // latest onSeek; click/scroll handlers must not re-bind
6152
+ const onRangeChangeRef = (0,external_react_.useRef)(onRangeChange); // latest range commit; drag-create must not re-bind
6068
6153
  const onRangeClearRef = (0,external_react_.useRef)(onRangeClear); // latest click-outside clear; WaveSurfer click must not re-bind
6154
+ const onRangeDragChangeRef = (0,external_react_.useRef)(onRangeDragChange); // latest drag flag; unmount must not re-bind
6069
6155
  const onViewportChangeRef = (0,external_react_.useRef)(onViewportChange); // latest viewport callback; camera commits here
6070
6156
  const peaksRef = (0,external_react_.useRef)(peaks); // latest peaks; WaveSurfer create() + morph read this
6071
6157
 
@@ -6098,7 +6184,9 @@ function WaveformView({
6098
6184
  mediaElRef.current = mediaEl;
6099
6185
  onPlayPauseRef.current = onPlayPause;
6100
6186
  onSeekRef.current = onSeek;
6187
+ onRangeChangeRef.current = onRangeChange;
6101
6188
  onRangeClearRef.current = onRangeClear;
6189
+ onRangeDragChangeRef.current = onRangeDragChange;
6102
6190
  onViewportChangeRef.current = onViewportChange;
6103
6191
  peaksRef.current = peaks;
6104
6192
  const [internalZoom, setInternalZoom] = (0,external_react_.useState)(constants/* WAVEFORM_ZOOM_MIN */.LW);
@@ -6108,8 +6196,12 @@ function WaveformView({
6108
6196
  const [canvasWidthPx, setCanvasWidthPx] = (0,external_react_.useState)(0);
6109
6197
  const [scrollLeft, setScrollLeft] = (0,external_react_.useState)(0);
6110
6198
  const [previewRange, setPreviewRange] = (0,external_react_.useState)(null);
6199
+ const [createRange, setCreateRange] = (0,external_react_.useState)(null);
6111
6200
  const [isRangeDragging, setIsRangeDragging] = (0,external_react_.useState)(false);
6112
6201
  const isRangeDraggingRef = (0,external_react_.useRef)(false);
6202
+ const rangeRef = (0,external_react_.useRef)(range); // latest committed draft; drag-create must not start on top of an open span
6203
+ const createDragRef = (0,external_react_.useRef)(null);
6204
+ const removeCreateDragListenersRef = (0,external_react_.useRef)(null);
6113
6205
  const skipNextSeekRef = (0,external_react_.useRef)(false);
6114
6206
  const lastSetTimeSecRef = (0,external_react_.useRef)(null);
6115
6207
  const [isRangeHovered, setIsRangeHovered] = (0,external_react_.useState)(false);
@@ -6130,7 +6222,8 @@ function WaveformView({
6130
6222
  const bufferProgress = getBufferedProgress(bufferedRange, durationSec);
6131
6223
  bufferProgressRef.current = bufferProgress;
6132
6224
  hoverProgressRef.current = isRangeDragging ? null : hoverProgress;
6133
- const activeRange = isRangeDragging ? previewRange ?? range : range;
6225
+ rangeRef.current = range;
6226
+ const activeRange = (isRangeDragging ? previewRange ?? createRange : createRange) ?? range;
6134
6227
  const activeRangeRef = (0,external_react_.useRef)(activeRange);
6135
6228
  activeRangeRef.current = activeRange;
6136
6229
  const durationMs = (0,waveform_range/* durationMsFromSec */.uH)(durationSec);
@@ -6755,12 +6848,104 @@ function WaveformView({
6755
6848
  const getPlayheadSec = (0,external_react_.useCallback)(() => {
6756
6849
  return mediaElRef.current ? mediaElRef.current.currentTime : currentTimeRef.current;
6757
6850
  }, []);
6851
+ (0,external_react_.useEffect)(() => {
6852
+ return () => {
6853
+ removeCreateDragListenersRef.current?.();
6854
+ if (createDragRef.current?.active) {
6855
+ createDragRef.current = null;
6856
+ onRangeDragChangeRef.current?.(false);
6857
+ }
6858
+ };
6859
+ }, []);
6860
+ (0,external_react_.useLayoutEffect)(() => {
6861
+ if (isRangeDraggingRef.current) {
6862
+ return;
6863
+ }
6864
+ setCreateRange(current => current == null ? current : null);
6865
+ }, [range]);
6866
+ const onTrackPointerDown = (0,external_react_.useCallback)(event => {
6867
+ if (cameraModeRef.current === 'tape' || !interactiveRef.current || event.button > 0 || event.ctrlKey || event.metaKey || isRangeDraggingRef.current || createDragRef.current) {
6868
+ return;
6869
+ }
6870
+ const {
6871
+ target
6872
+ } = event;
6873
+ if (target instanceof Element && target.closest('[data-testid="bp-waveform-range-handle-start"], [data-testid="bp-waveform-range-handle-end"], [data-testid="bp-waveform-range-comment"]')) {
6874
+ return;
6875
+ }
6876
+ const drag = rangeCreateDragFromEvent(event, {
6877
+ durationSec: durationSecRef.current,
6878
+ range: rangeRef.current,
6879
+ track: trackRef.current,
6880
+ viewport: viewportRef.current
6881
+ });
6882
+ if (!drag) {
6883
+ return;
6884
+ }
6885
+ createDragRef.current = drag;
6886
+ const onMove = moveEvent => {
6887
+ if (createDragRef.current !== drag || moveEvent.pointerId !== drag.pointerId) {
6888
+ return;
6889
+ }
6890
+ if (!Number.isFinite(moveEvent.clientX)) {
6891
+ return;
6892
+ }
6893
+ if (!drag.active && Math.abs(moveEvent.clientX - drag.originX) < constants/* WAVEFORM_RANGE_CREATE_DRAG_PX */.B4) {
6894
+ return;
6895
+ }
6896
+ const track = trackRef.current;
6897
+ if (!track) {
6898
+ return;
6899
+ }
6900
+ moveEvent.preventDefault();
6901
+ const playheadSec = mediaElRef.current ? mediaElRef.current.currentTime : currentTimeRef.current;
6902
+ drag.range = drawnRangeFromMove(drag, moveEvent.clientX, track, viewportRef.current, playheadSec, durationSecRef.current);
6903
+ if (!drag.active) {
6904
+ drag.active = true;
6905
+ handleRangeDragChange(true);
6906
+ }
6907
+ setCreateRange(drag.range);
6908
+ setPreviewRange(drag.range);
6909
+ };
6910
+ let onUp = () => undefined;
6911
+ const removeListeners = () => {
6912
+ window.removeEventListener('pointermove', onMove);
6913
+ window.removeEventListener('pointerup', onUp);
6914
+ window.removeEventListener('pointercancel', onUp);
6915
+ if (removeCreateDragListenersRef.current === removeListeners) {
6916
+ removeCreateDragListenersRef.current = null;
6917
+ }
6918
+ };
6919
+ onUp = upEvent => {
6920
+ if (createDragRef.current !== drag || upEvent.pointerId && upEvent.pointerId !== drag.pointerId) {
6921
+ return;
6922
+ }
6923
+ const wasActive = drag.active;
6924
+ const drawn = drag.range;
6925
+ createDragRef.current = null;
6926
+ removeListeners();
6927
+ if (!wasActive || !drawn) {
6928
+ return;
6929
+ }
6930
+ const committed = (0,waveform_range/* commitRangeChange */.dG)(drawn);
6931
+ if (committed) {
6932
+ setCreateRange(committed);
6933
+ onRangeChangeRef.current?.(committed);
6934
+ }
6935
+ handleRangeDragChange(false);
6936
+ };
6937
+ removeCreateDragListenersRef.current = removeListeners;
6938
+ window.addEventListener('pointermove', onMove);
6939
+ window.addEventListener('pointerup', onUp);
6940
+ window.addEventListener('pointercancel', onUp);
6941
+ }, [handleRangeDragChange]);
6758
6942
  const bindOverlayPortalHost = (0,external_react_.useCallback)(node => {
6759
6943
  const host = node?.parentElement ?? null;
6760
6944
  setOverlayPortalHost(prev => prev === host ? prev : host);
6761
6945
  }, []);
6762
6946
  const hoverLeft = isRangeDragging || hoverProgress == null ? null : (0,waveform_viewport/* timeLeftPercent */.Mu)(hoverProgress * durationSec, durationSec, viewportRef.current);
6763
- const showRangeOverlay = Boolean(range) && (isRangeDragging || !isPlaying || !(0,waveform_range/* isRangeCollapsed */.BT)(range));
6947
+ const overlayRange = createRange ?? range;
6948
+ const showRangeOverlay = Boolean(overlayRange) && (isRangeDragging || !isPlaying || !(0,waveform_range/* isRangeCollapsed */.BT)(overlayRange));
6764
6949
  const scrubTimeChip = isTape && scrubPreviewTimeSec != null ? /*#__PURE__*/external_react_["default"].createElement("div", {
6765
6950
  className: "bp-WaveformView-hover bp-WaveformView-hover--tape",
6766
6951
  "data-testid": "bp-waveform-hover"
@@ -6781,6 +6966,7 @@ function WaveformView({
6781
6966
  className: "bp-WaveformView-track",
6782
6967
  onMouseLeave: interactive && !isTape ? onHoverLeave : undefined,
6783
6968
  onMouseMove: interactive && !isTape ? onHoverMove : undefined,
6969
+ onPointerDown: onTrackPointerDown,
6784
6970
  onPointerMove: interactive && !isTape ? event => {
6785
6971
  if (event.pointerType === 'touch') {
6786
6972
  onHoverLeave();
@@ -6802,7 +6988,7 @@ function WaveformView({
6802
6988
  "aria-hidden": "true",
6803
6989
  className: "bp-WaveformView-playhead",
6804
6990
  "data-testid": "bp-waveform-playhead"
6805
- }), showRangeOverlay && range && /*#__PURE__*/external_react_["default"].createElement(waveform_WaveformRangeSelection, {
6991
+ }), showRangeOverlay && overlayRange && /*#__PURE__*/external_react_["default"].createElement(waveform_WaveformRangeSelection, {
6806
6992
  ref: rangeLayerRef,
6807
6993
  currentTimeSec: currentTime,
6808
6994
  durationSec: durationSec,
@@ -6811,9 +6997,10 @@ function WaveformView({
6811
6997
  isHighlighted: isRangeDragging || isRangeHovered,
6812
6998
  keepHighlight: true,
6813
6999
  onDragChange: handleRangeDragChange,
7000
+ onDragCreate: interactive && !isRangeDragging ? onRangeDragCreate : undefined,
6814
7001
  onPreviewChange: setPreviewRange,
6815
7002
  onRangeChange: interactive ? onRangeChange : undefined,
6816
- range: range,
7003
+ range: overlayRange,
6817
7004
  viewport: viewport
6818
7005
  }), hoverLeft != null && hoverProgress != null && !isRangeDragging && /*#__PURE__*/external_react_["default"].createElement("div", {
6819
7006
  className: "bp-WaveformView-hover",
@@ -7080,6 +7267,7 @@ function MP3ControlsV2({
7080
7267
  onCommentMarkerClick,
7081
7268
  onCommentRangeChange,
7082
7269
  onCommentRangeClear,
7270
+ onCommentRangeDragCreate,
7083
7271
  onCommentRangeDragChange,
7084
7272
  onMuteChange,
7085
7273
  onPlayPause,
@@ -7212,6 +7400,7 @@ function MP3ControlsV2({
7212
7400
  onRangeChange: isWaveformInteractive ? onCommentRangeChange : undefined,
7213
7401
  onRangeClear: isWaveformInteractive ? onCommentRangeClear : undefined,
7214
7402
  onRangeDragChange: onCommentRangeDragChange,
7403
+ onRangeDragCreate: isWaveformInteractive ? onCommentRangeDragCreate : undefined,
7215
7404
  onSeek: isWaveformInteractive ? onTimeChange : undefined,
7216
7405
  onViewportChange: hasRealPeaks ? handleViewportChange : undefined,
7217
7406
  onZoomChange: hasZoomHandlers ? handleWaveformZoom : undefined,
@@ -7354,6 +7543,7 @@ function isFpsAvailable(player) {
7354
7543
 
7355
7544
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7356
7545
  /* harmony export */ Av: () => (/* binding */ WAVEFORM_TAPE_DEFAULT_WINDOW_SEC),
7546
+ /* harmony export */ B4: () => (/* binding */ WAVEFORM_RANGE_CREATE_DRAG_PX),
7357
7547
  /* harmony export */ BG: () => (/* binding */ WAVEFORM_RANGE_COLLAPSED_OFFSET_PX),
7358
7548
  /* harmony export */ Bq: () => (/* binding */ WAVEFORM_PLAYHEAD_JUMP_MS),
7359
7549
  /* harmony export */ DY: () => (/* binding */ WAVEFORM_BAR_RADIUS),
@@ -7450,6 +7640,8 @@ const WAVEFORM_RANGE_COLLAPSED_OFFSET_PX = WAVEFORM_RANGE_HANDLE_LINE_PX / 2 + W
7450
7640
  const WAVEFORM_RANGE_SNAP_PX = 8;
7451
7641
  /** Shortest committed range. Collapsed drafts (`endMs: null`) are exempt. */
7452
7642
  const WAVEFORM_RANGE_MIN_DURATION_MS = 250;
7643
+ /** Pointer travel before a waveform press becomes a new draft range. Shorter presses stay click-to-seek. */
7644
+ const WAVEFORM_RANGE_CREATE_DRAG_PX = 4;
7453
7645
  const WAVEFORM_RANGE_GRIP_IN_MS = 150;
7454
7646
  const WAVEFORM_RANGE_GRIP_OUT_MS = 100;
7455
7647
 
@@ -8013,17 +8205,18 @@ function loadPeaks(request) {
8013
8205
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8014
8206
  /* harmony export */ BT: () => (/* binding */ isRangeCollapsed),
8015
8207
  /* harmony export */ D$: () => (/* binding */ rangeProgress),
8208
+ /* harmony export */ DL: () => (/* binding */ clampTimeMs),
8016
8209
  /* harmony export */ Eh: () => (/* binding */ visualRangeHandlePx),
8017
8210
  /* harmony export */ H5: () => (/* binding */ isPointerOverRange),
8018
8211
  /* harmony export */ HG: () => (/* binding */ pickRangeHandle),
8019
8212
  /* harmony export */ Mh: () => (/* binding */ snapTimeMs),
8020
8213
  /* harmony export */ Mo: () => (/* binding */ dragRangeHandle),
8214
+ /* harmony export */ Qp: () => (/* binding */ rangeFromCreateDrag),
8021
8215
  /* harmony export */ Ss: () => (/* binding */ resolveRange),
8022
8216
  /* harmony export */ dG: () => (/* binding */ commitRangeChange),
8023
8217
  /* harmony export */ uH: () => (/* binding */ durationMsFromSec),
8024
8218
  /* harmony export */ v2: () => (/* binding */ pointerTimeMs)
8025
8219
  /* harmony export */ });
8026
- /* unused harmony export clampTimeMs */
8027
8220
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4929);
8028
8221
  /* harmony import */ var _viewport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(772);
8029
8222
 
@@ -8210,6 +8403,28 @@ function commitRangeChange(range) {
8210
8403
  startMs: range.startMs
8211
8404
  };
8212
8405
  }
8406
+
8407
+ /**
8408
+ * Open a draft from a waveform drag. The press time stays anchored; the pointer
8409
+ * chooses which edge moves. Enforces the minimum span once the drag leaves the point.
8410
+ */
8411
+ function rangeFromCreateDrag({
8412
+ durationMs,
8413
+ originMs,
8414
+ pointerMs
8415
+ }) {
8416
+ const origin = clampTimeMs(originMs, durationMs);
8417
+ const handle = pointerMs >= origin ? 'end' : 'start';
8418
+ return dragRangeHandle({
8419
+ durationMs,
8420
+ handle,
8421
+ pointerMs,
8422
+ range: {
8423
+ endMs: origin,
8424
+ startMs: origin
8425
+ }
8426
+ }).range;
8427
+ }
8213
8428
  function rangeProgress(range, durationMs) {
8214
8429
  if (!(durationMs > 0) || range.endMs <= range.startMs) {
8215
8430
  return null;
@@ -24435,7 +24650,7 @@ class Browser {
24435
24650
  ;// ./src/lib/Logger.js
24436
24651
  /* eslint-disable no-undef */
24437
24652
  const CLIENT_NAME = "box-content-preview";
24438
- const CLIENT_VERSION = "3.93.0";
24653
+ const CLIENT_VERSION = "3.95.0";
24439
24654
  /* eslint-enable no-undef */
24440
24655
 
24441
24656
  class Logger {
@@ -33663,11 +33878,10 @@ class TextLoader extends viewers_AssetLoader {
33663
33878
  /* harmony default export */ const text_TextLoader = (new TextLoader());
33664
33879
  ;// ./src/lib/viewers/controls/media/types.ts
33665
33880
  /**
33666
- * Draft range the activity sidebar is holding. Preview draws start/end handles
33667
- * on the waveform until the sidebar sends `comment_range_draft_clear`.
33668
- * The viewer emits `comment_range_draft_change` on pointer-up so the host
33669
- * can persist the new timestamps, and `comment_range_draft_dismiss` when
33670
- * the user clicks the waveform outside an open range. See media/README.md.
33881
+ * Draft range drawn on the waveform. Sidebar sends `comment_range_draft`
33882
+ * when checkbox is toggled on and Preview keeps the handles until
33883
+ * `comment_range_draft_clear`. A waveform drag can also create a local draft
33884
+ * before the timestamp toggle is on. See media/README.md.
33671
33885
  * `endMs: null` means a single timestamp — both handles sit on `startMs`.
33672
33886
  */
33673
33887
 
@@ -33679,12 +33893,22 @@ const EVENT_COMMENT_RANGE_DRAFT = 'comment_range_draft';
33679
33893
  /** Sidebar → viewer: hide the handles (toggle-off, post, version switch, unmount). */
33680
33894
  const EVENT_COMMENT_RANGE_DRAFT_CLEAR = 'comment_range_draft_clear';
33681
33895
 
33682
- /** Viewer → sidebar: the user clicked the waveform outside an open draft range. */
33896
+ /** Viewer → sidebar: click outside an open range while the timestamp toggle is already on. */
33683
33897
  const EVENT_COMMENT_RANGE_DRAFT_DISMISS = 'comment_range_draft_dismiss';
33684
33898
 
33685
- /** Viewer → sidebar: a handle drag finished. Emitted on pointer-up only. */
33899
+ /**
33900
+ * Viewer → sidebar: a range edit finished while the timestamp toggle is already on.
33901
+ * Pointer-up only. Not used to start commenting — that is `comment_range_compose`.
33902
+ */
33686
33903
  const EVENT_COMMENT_RANGE_DRAFT_CHANGE = 'comment_range_draft_change';
33687
33904
 
33905
+ /**
33906
+ * Viewer → sidebar: the user pressed Comment on a draft range.
33907
+ * The host opens Activity if needed, checks the timestamp toggle, and adopts
33908
+ * `{ startMs, endMs }` without echoing `comment_range_draft`.
33909
+ */
33910
+ const EVENT_COMMENT_RANGE_DRAG_CREATE = 'comment_range_compose';
33911
+
33688
33912
  /** True when a host draft can be shown. Collapsed drafts use `endMs: null`. */
33689
33913
  function isValidCommentRangeDraft(value) {
33690
33914
  if (!value || typeof value !== 'object') {
@@ -37342,6 +37566,22 @@ class MP3Viewer extends media_MediaBaseViewer {
37342
37566
  if (this.isCommentRangeDragging || !isValidCommentRangeDraft(draft)) {
37343
37567
  return;
37344
37568
  }
37569
+ // Checkbox-on sends a collapsed playhead. A waveform-drawn span should
37570
+ // become that timestamp value instead of collapsing back to the playhead.
37571
+ const local = this.commentRangeDraft;
37572
+ if (local && !(0,range/* isRangeCollapsed */.BT)(local) && draft.endMs == null) {
37573
+ if (!this.isCommentRangeTimestampActive) {
37574
+ this.isCommentRangeTimestampActive = true;
37575
+ this.emit(EVENT_COMMENT_RANGE_DRAFT_CHANGE, {
37576
+ endMs: local.endMs,
37577
+ startMs: local.startMs
37578
+ });
37579
+ }
37580
+ this.syncCommentRangeLoop();
37581
+ this.renderUI();
37582
+ return;
37583
+ }
37584
+ this.isCommentRangeTimestampActive = true;
37345
37585
  this.commentRangeDraft = {
37346
37586
  endMs: draft.endMs == null ? null : draft.endMs,
37347
37587
  startMs: draft.startMs
@@ -37352,6 +37592,7 @@ class MP3Viewer extends media_MediaBaseViewer {
37352
37592
  MP3Viewer_defineProperty(this, "handleCommentRangeDraftClear", () => {
37353
37593
  this.commentRangeDraft = null;
37354
37594
  this.isCommentRangeDragging = false;
37595
+ this.isCommentRangeTimestampActive = false;
37355
37596
  this.syncCommentRangeLoop();
37356
37597
  this.renderUI();
37357
37598
  });
@@ -37363,13 +37604,26 @@ class MP3Viewer extends media_MediaBaseViewer {
37363
37604
  endMs: range.endMs,
37364
37605
  startMs: range.startMs
37365
37606
  };
37366
- this.emit(EVENT_COMMENT_RANGE_DRAFT_CHANGE, {
37367
- endMs: range.endMs,
37368
- startMs: range.startMs
37369
- });
37607
+ if (this.isCommentRangeTimestampActive) {
37608
+ this.emit(EVENT_COMMENT_RANGE_DRAFT_CHANGE, {
37609
+ endMs: range.endMs,
37610
+ startMs: range.startMs
37611
+ });
37612
+ }
37370
37613
  this.syncCommentRangeLoop();
37371
37614
  this.renderUI();
37372
37615
  });
37616
+ MP3Viewer_defineProperty(this, "handleCommentRangeDragCreate", () => {
37617
+ const draft = this.commentRangeDraft;
37618
+ if (!draft || (0,range/* isRangeCollapsed */.BT)(draft)) {
37619
+ return;
37620
+ }
37621
+ this.isCommentRangeTimestampActive = true;
37622
+ this.emit(EVENT_COMMENT_RANGE_DRAG_CREATE, {
37623
+ endMs: draft.endMs,
37624
+ startMs: draft.startMs
37625
+ });
37626
+ });
37373
37627
  MP3Viewer_defineProperty(this, "handleCommentRangeDragChange", isDragging => {
37374
37628
  this.isCommentRangeDragging = !!isDragging;
37375
37629
  });
@@ -37377,8 +37631,12 @@ class MP3Viewer extends media_MediaBaseViewer {
37377
37631
  if (!this.commentRangeDraft || this.commentRangeDraft.endMs == null) {
37378
37632
  return;
37379
37633
  }
37634
+ const notifyHost = this.isCommentRangeTimestampActive;
37380
37635
  this.commentRangeDraft = null;
37381
- this.emit(EVENT_COMMENT_RANGE_DRAFT_DISMISS);
37636
+ this.isCommentRangeTimestampActive = false;
37637
+ if (notifyHost) {
37638
+ this.emit(EVENT_COMMENT_RANGE_DRAFT_DISMISS);
37639
+ }
37382
37640
  this.syncCommentRangeLoop();
37383
37641
  this.renderUI();
37384
37642
  });
@@ -37442,6 +37700,7 @@ class MP3Viewer extends media_MediaBaseViewer {
37442
37700
  this.commentRangeDraft = null;
37443
37701
  this.hostSelectedMarkerId = null;
37444
37702
  this.isCommentRangeDragging = false;
37703
+ this.isCommentRangeTimestampActive = false;
37445
37704
  this.shuttleDirection = null;
37446
37705
  this.shuttleRate = 0;
37447
37706
  this.reverseShuttleTimer = 0;
@@ -37729,7 +37988,7 @@ class MP3Viewer extends media_MediaBaseViewer {
37729
37988
  * @return {Promise<{ default: Function }>} MP3ControlsV2 module
37730
37989
  */
37731
37990
  importV2Controls() {
37732
- return Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 673));
37991
+ return Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 8862));
37733
37992
  }
37734
37993
 
37735
37994
  /**
@@ -37757,6 +38016,7 @@ class MP3Viewer extends media_MediaBaseViewer {
37757
38016
  this.removeListener(EVENT_COMMENT_RANGE_DRAFT_CLEAR, this.handleCommentRangeDraftClear);
37758
38017
  this.commentRangeDraft = null;
37759
38018
  this.isCommentRangeDragging = false;
38019
+ this.isCommentRangeTimestampActive = false;
37760
38020
  this.stopReverseShuttle();
37761
38021
  this.shuttleDirection = null;
37762
38022
  this.shuttleRate = 0;
@@ -37772,6 +38032,7 @@ class MP3Viewer extends media_MediaBaseViewer {
37772
38032
  // A file-version switch is a clear, not a resync of the previous draft.
37773
38033
  this.commentRangeDraft = null;
37774
38034
  this.isCommentRangeDragging = false;
38035
+ this.isCommentRangeTimestampActive = false;
37775
38036
  this.syncCommentRangeLoop();
37776
38037
  this.showAudioLoadingShell();
37777
38038
  this.startConversionWaveformLoad();
@@ -38396,6 +38657,7 @@ class MP3Viewer extends media_MediaBaseViewer {
38396
38657
  onCommentRangeChange: this.handleCommentRangeChange,
38397
38658
  onCommentRangeClear: this.handleCommentRangeClear,
38398
38659
  onCommentRangeDragChange: this.handleCommentRangeDragChange,
38660
+ onCommentRangeDragCreate: this.handleCommentRangeDragCreate,
38399
38661
  onPlayNextChange: this.setPlayNext,
38400
38662
  peaks: this.waveformPeaks,
38401
38663
  playNext: this.isPlayNextEnabled()
@@ -54772,18 +55034,15 @@ const LOG_RETRY_COUNT = 3; // number of times to retry logging preview event
54772
55034
  const MS_IN_S = 1000; // ms in a sec
54773
55035
  const SUPPORT_URL = 'https://support.box.com';
54774
55036
 
54775
- // All preview assets are relative to preview.js. Here we create a location
54776
- // object that mimics the window location object and points to where
54777
- // preview.js is loaded from by the browser. This needs to be done statically
54778
- // outside the class so that location is found while this script is executing
54779
- // and not when preview is instantiated, which is too late.
54780
- // findScriptLocation throws when there is no preview.js <script> tag in the DOM;
54781
- // npm consumers have no such tag and populate this via Preview.show({ location }).
54782
- let PREVIEW_LOCATION;
54783
- try {
54784
- PREVIEW_LOCATION = (0,util/* findScriptLocation */.Is)(constants/* PREVIEW_SCRIPT_NAME */.Lq, document.currentScript);
54785
- } catch (e) {
54786
- PREVIEW_LOCATION = {};
55037
+ // document.currentScript is this file only while it evaluates.
55038
+ const IS_NPM_BUILD = true && true;
55039
+ let PREVIEW_LOCATION = {};
55040
+ if (!IS_NPM_BUILD) {
55041
+ try {
55042
+ PREVIEW_LOCATION = (0,util/* findScriptLocation */.Is)(constants/* PREVIEW_SCRIPT_NAME */.Lq, document.currentScript);
55043
+ } catch (e) {
55044
+ PREVIEW_LOCATION = {};
55045
+ }
54787
55046
  }
54788
55047
  class Preview extends (events_default()) {
54789
55048
  //--------------------------------------------------------------------------
@@ -54854,10 +55113,6 @@ class Preview extends (events_default()) {
54854
55113
  DEFAULT_DISABLED_VIEWERS.forEach(viewerName => {
54855
55114
  this.disabledViewers[viewerName] = 1;
54856
55115
  });
54857
-
54858
- // All preview assets are relative to preview.js. Here we create a location
54859
- // object that mimics the window location object and points to where
54860
- // preview.js is loaded from by the browser.
54861
55116
  this.location = PREVIEW_LOCATION;
54862
55117
  this.cache = new lib_Cache();
54863
55118
  this.ui = new lib_PreviewUI();
@@ -54926,11 +55181,11 @@ class Preview extends (events_default()) {
54926
55181
  // But it cannot be a random object.
54927
55182
  if (token === null || typeof token !== 'object') {
54928
55183
  // npm consumers have no CDN-served pdfjs at runtime; force the bundled npm pdfjs path.
54929
- const finalOptions = true ? Preview_objectSpread(Preview_objectSpread({}, options), {}, {
55184
+ const finalOptions = IS_NPM_BUILD ? Preview_objectSpread(Preview_objectSpread({}, options), {}, {
54930
55185
  features: Preview_objectSpread({
54931
55186
  useNpmPdfjs: true
54932
55187
  }, options.features || {})
54933
- }) : 0;
55188
+ }) : options;
54934
55189
  this.previewOptions = Preview_objectSpread(Preview_objectSpread({}, finalOptions), {}, {
54935
55190
  token
54936
55191
  });
@@ -54948,6 +55203,11 @@ class Preview extends (events_default()) {
54948
55203
  // Parse the preview options
54949
55204
  this.parseOptions(this.previewOptions);
54950
55205
 
55206
+ // /preview.js parses to locale ''. Throw only when locale is absent.
55207
+ if ((0,util/* getProp */.GT)(this.location, 'locale') == null) {
55208
+ throw new Error('Missing preview location. Load preview.js, or pass location to show().');
55209
+ }
55210
+
54951
55211
  // Load the preview
54952
55212
  this.load(fileIdOrFile);
54953
55213
  }
@@ -56893,8 +57153,10 @@ class Preview extends (events_default()) {
56893
57153
  return (0,util/* getProp */.GT)(this.previewOptions, `fileOptions.${fileId}.${optionName}`);
56894
57154
  }
56895
57155
  }
56896
- globalThis.Box = globalThis.Box || {};
56897
- globalThis.Box.Preview = Preview;
57156
+ if (!IS_NPM_BUILD) {
57157
+ globalThis.Box = globalThis.Box || {};
57158
+ globalThis.Box.Preview = Preview;
57159
+ }
56898
57160
  /* harmony default export */ const lib_Preview = (Preview);
56899
57161
  ;// ./src/index.ts
56900
57162
  // useNpmPdfjs is auto-injected by Preview.show() under __BCP_NPM_BUILD__.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-content-preview",
3
- "version": "3.93.0",
3
+ "version": "3.95.0",
4
4
  "description": "Box Content Preview UI Element",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",