box-content-preview 3.97.0 → 3.98.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 +7 -7
- package/dist/lib/index.css +2 -2
- package/dist/lib/index.js +166 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://mergify.io)
|
|
3
3
|
[](https://github.com/prettier/prettier)
|
|
4
4
|
[](https://travis-ci.org/box/box-content-preview)
|
|
5
|
-
[](https://github.com/box/box-content-preview)
|
|
6
6
|
[](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.
|
|
25
|
+
- Version: v3.98.0
|
|
26
26
|
- Locale: en-US
|
|
27
27
|
|
|
28
|
-
https://cdn01.boxcdn.net/platform/preview/3.
|
|
29
|
-
https://cdn01.boxcdn.net/platform/preview/3.
|
|
28
|
+
https://cdn01.boxcdn.net/platform/preview/3.98.0/en-US/preview.js
|
|
29
|
+
https://cdn01.boxcdn.net/platform/preview/3.98.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.
|
|
55
|
+
<script src="https://cdn01.boxcdn.net/platform/preview/3.98.0/en-US/preview.js"></script>
|
|
56
56
|
<link
|
|
57
57
|
rel="stylesheet"
|
|
58
|
-
href="https://cdn01.boxcdn.net/platform/preview/3.
|
|
58
|
+
href="https://cdn01.boxcdn.net/platform/preview/3.98.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.
|
|
79
|
+
- Check out a specific version with `git checkout v3.98.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.css
CHANGED
|
@@ -62,11 +62,11 @@
|
|
|
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
64
|
.bp-WaveformShuttle{position:absolute;top:48px;left:50%;z-index:6;display:flex;gap:4px;align-items:center;height:48px;padding:8px 16px;color:#fff;background:rgba(255,255,255,.1);border-radius:24px;box-shadow:0 2px 12px rgba(0,0,0,.08);transform:translateX(-50%);backdrop-filter:blur(60px);pointer-events:none;-webkit-user-select:none;user-select:none}.bp-WaveformShuttle-glyph{display:block;flex:0 0 auto;width:19px;height:11px}.bp-WaveformShuttle.bp-is-reverse .bp-WaveformShuttle-glyph{transform:scaleX(-1)}.bp-WaveformShuttle-rate{font-weight:500;font-size:14px;line-height:22px;white-space:nowrap}
|
|
65
|
-
.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-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--swiping .bp-WaveformRange-region{visibility:hidden}.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}}
|
|
66
66
|
.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}
|
|
67
67
|
.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}
|
|
68
68
|
.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}}
|
|
69
|
-
.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:
|
|
69
|
+
.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:4;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}
|
|
70
70
|
.bp-Filmstrip{position:absolute;bottom:100%;overflow:hidden;background:transparent;box-shadow:0 0 1px #464a4f;visibility:hidden}.bp-Filmstrip.bp-is-shown{visibility:visible}.bp-Filmstrip-frame{display:flex;align-items:center;justify-content:center}.bp-Filmstrip-time{height:20px;color:#fff;font-size:13px;line-height:20px;text-align:center;background-color:#222}
|
|
71
71
|
.bp-TimeControls{position:relative;margin-right:10px;margin-left:10px}.bp-TimeControls-slider{height:18px}.bp-TimeControls-slider .bp-SliderControl-thumb{transform:scale(0);transition:transform 100ms ease;will-change:transform}.bp-TimeControls-slider .bp-SliderControl-track{backface-visibility:hidden;transition:transform 100ms ease;will-change:transform}.bp-TimeControls-slider.bp-is-scrubbing .bp-SliderControl-thumb,.bp-TimeControls-slider:focus .bp-SliderControl-thumb,.bp-TimeControls-slider:hover .bp-SliderControl-thumb{transform:scale(1)}.bp-TimeControls-slider.bp-is-scrubbing .bp-SliderControl-track,.bp-TimeControls-slider:focus .bp-SliderControl-track,.bp-TimeControls-slider:hover .bp-SliderControl-track{transform:scaleY(2)}
|
|
72
72
|
.bp-MP3Controls{display:flex;flex-direction:column;width:360px;background-color:#000}.bp-MP3Controls-bar{display:flex;justify-content:space-between;padding:0 10px 5px}.bp-MP3Controls-group{display:flex;align-items:center}.bp-MP3Controls-settings{position:relative}.bp-MP3Controls-settings .bp-SettingsFlyout{right:15px}.bp-MP3Controls-settings .bp-SettingsToggle-button{width:36px;height:40px}
|
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.
|
|
1032
|
+
const CLIENT_VERSION = "3.98.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 = {};
|
|
@@ -5659,6 +5659,7 @@ function IconComment24(props) {
|
|
|
5659
5659
|
|
|
5660
5660
|
|
|
5661
5661
|
|
|
5662
|
+
|
|
5662
5663
|
function offsetLeftCss(base, offsetPx) {
|
|
5663
5664
|
if (!offsetPx) {
|
|
5664
5665
|
return base;
|
|
@@ -5692,11 +5693,13 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5692
5693
|
currentTimeSec = 0,
|
|
5693
5694
|
durationSec,
|
|
5694
5695
|
getPlayheadSec,
|
|
5696
|
+
isSwiping = false,
|
|
5695
5697
|
interactive = true,
|
|
5696
5698
|
isHighlighted = false,
|
|
5697
5699
|
keepHighlight = true,
|
|
5698
5700
|
onDragCreate,
|
|
5699
5701
|
onDragChange,
|
|
5702
|
+
onDragPointerX,
|
|
5700
5703
|
onPreviewChange,
|
|
5701
5704
|
onRangeChange,
|
|
5702
5705
|
range,
|
|
@@ -5710,11 +5713,13 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5710
5713
|
const tooltipRef = (0,external_react_.useRef)(null);
|
|
5711
5714
|
const commentRef = (0,external_react_.useRef)(null);
|
|
5712
5715
|
const dragRef = (0,external_react_.useRef)(null);
|
|
5716
|
+
const replayDragRef = (0,external_react_.useRef)(() => undefined);
|
|
5713
5717
|
const rangeRef = (0,external_react_.useRef)(range);
|
|
5714
5718
|
const displayedRef = (0,external_react_.useRef)((0,waveform_range/* resolveRange */.Ss)(range, (0,waveform_range/* durationMsFromSec */.uH)(durationSec)));
|
|
5715
5719
|
const viewportRef = (0,external_react_.useRef)(viewport);
|
|
5716
5720
|
const durationSecRef = (0,external_react_.useRef)(durationSec);
|
|
5717
5721
|
const onDragChangeRef = (0,external_react_.useRef)(onDragChange);
|
|
5722
|
+
const onDragPointerXRef = (0,external_react_.useRef)(onDragPointerX);
|
|
5718
5723
|
const onPreviewChangeRef = (0,external_react_.useRef)(onPreviewChange);
|
|
5719
5724
|
const onRangeChangeRef = (0,external_react_.useRef)(onRangeChange);
|
|
5720
5725
|
const getPlayheadSecRef = (0,external_react_.useRef)(getPlayheadSec);
|
|
@@ -5724,6 +5729,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5724
5729
|
rangeRef.current = range;
|
|
5725
5730
|
durationSecRef.current = durationSec;
|
|
5726
5731
|
onDragChangeRef.current = onDragChange;
|
|
5732
|
+
onDragPointerXRef.current = onDragPointerX;
|
|
5727
5733
|
onPreviewChangeRef.current = onPreviewChange;
|
|
5728
5734
|
onRangeChangeRef.current = onRangeChange;
|
|
5729
5735
|
getPlayheadSecRef.current = getPlayheadSec;
|
|
@@ -5749,18 +5755,27 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5749
5755
|
comment.style.left = (0,waveform_viewport/* timeLeftPercent */.Mu)((next.startMs + next.endMs) / 2000, nextDurationSec, nextViewport);
|
|
5750
5756
|
}
|
|
5751
5757
|
}, []);
|
|
5758
|
+
const refreshRangePositions = (0,external_react_.useCallback)(() => {
|
|
5759
|
+
const drag = dragRef.current;
|
|
5760
|
+
if (!drag) {
|
|
5761
|
+
syncPositions(displayedRef.current, viewportRef.current, durationSecRef.current);
|
|
5762
|
+
return;
|
|
5763
|
+
}
|
|
5764
|
+
replayDragRef.current(drag.lastClientX);
|
|
5765
|
+
}, [syncPositions]);
|
|
5752
5766
|
(0,external_react_.useImperativeHandle)(ref, () => ({
|
|
5753
5767
|
applyViewport: nextViewport => {
|
|
5754
5768
|
viewportRef.current = nextViewport;
|
|
5755
|
-
|
|
5769
|
+
refreshRangePositions();
|
|
5756
5770
|
}
|
|
5757
|
-
}), [
|
|
5771
|
+
}), [refreshRangePositions]);
|
|
5758
5772
|
(0,external_react_.useLayoutEffect)(() => {
|
|
5759
5773
|
syncPositions(displayedRef.current, viewportRef.current, durationSec);
|
|
5760
5774
|
}, [activeHandle, displayed.endMs, displayed.startMs, durationSec, showCommentButton, syncPositions]);
|
|
5761
5775
|
(0,external_react_.useLayoutEffect)(() => {
|
|
5762
5776
|
const next = (0,waveform_viewport/* createWaveformViewport */.eq)({
|
|
5763
5777
|
durationSec: viewport.durationSec,
|
|
5778
|
+
gutterPx: viewport.gutterPx,
|
|
5764
5779
|
heightPx: viewport.heightPx,
|
|
5765
5780
|
maxZoom: viewport.maxZoom,
|
|
5766
5781
|
scrollLeftPx: viewportRef.current.scrollLeftPx,
|
|
@@ -5768,8 +5783,8 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5768
5783
|
zoomLevel: viewport.zoomLevel
|
|
5769
5784
|
});
|
|
5770
5785
|
viewportRef.current = next;
|
|
5771
|
-
|
|
5772
|
-
}, [
|
|
5786
|
+
refreshRangePositions();
|
|
5787
|
+
}, [refreshRangePositions, viewport.durationSec, viewport.gutterPx, viewport.heightPx, viewport.maxZoom, viewport.widthPx, viewport.zoomLevel]);
|
|
5773
5788
|
const endDrag = (0,external_react_.useCallback)(event => {
|
|
5774
5789
|
const drag = dragRef.current;
|
|
5775
5790
|
if (!drag || event.pointerId && drag.pointerId !== event.pointerId) {
|
|
@@ -5784,6 +5799,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5784
5799
|
setActiveHandle(null);
|
|
5785
5800
|
setDragRange(null);
|
|
5786
5801
|
onDragChangeRef.current?.(false);
|
|
5802
|
+
event.stopPropagation();
|
|
5787
5803
|
const didChange = drag.range.startMs !== drag.originRange.startMs || drag.range.endMs !== drag.originRange.endMs;
|
|
5788
5804
|
if (!didChange) {
|
|
5789
5805
|
return;
|
|
@@ -5802,6 +5818,8 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5802
5818
|
if (!root) {
|
|
5803
5819
|
return;
|
|
5804
5820
|
}
|
|
5821
|
+
drag.lastClientX = event.clientX;
|
|
5822
|
+
onDragPointerXRef.current?.(event.clientX);
|
|
5805
5823
|
const rect = root.getBoundingClientRect();
|
|
5806
5824
|
const pointerX = event.clientX - rect.left;
|
|
5807
5825
|
const vp = viewportRef.current;
|
|
@@ -5813,6 +5831,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5813
5831
|
timeMs: (0,waveform_range/* pointerTimeMs */.v2)(pointerX, vp)
|
|
5814
5832
|
});
|
|
5815
5833
|
if (drag.originMs === drag.range.startMs && drag.originMs === drag.range.endMs && pointerMs === drag.originMs) {
|
|
5834
|
+
syncPositions(drag.range, vp, durationSecRef.current);
|
|
5816
5835
|
return;
|
|
5817
5836
|
}
|
|
5818
5837
|
const next = (0,waveform_range/* dragRangeHandle */.Mo)({
|
|
@@ -5834,6 +5853,16 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5834
5853
|
startMs: next.range.startMs
|
|
5835
5854
|
});
|
|
5836
5855
|
}, [currentTimeSec, syncPositions]);
|
|
5856
|
+
replayDragRef.current = clientX => {
|
|
5857
|
+
const drag = dragRef.current;
|
|
5858
|
+
if (!drag || !Number.isFinite(clientX)) {
|
|
5859
|
+
return;
|
|
5860
|
+
}
|
|
5861
|
+
moveDrag({
|
|
5862
|
+
clientX,
|
|
5863
|
+
pointerId: drag.pointerId
|
|
5864
|
+
});
|
|
5865
|
+
};
|
|
5837
5866
|
const startDrag = (0,external_react_.useCallback)((handle, event) => {
|
|
5838
5867
|
if (readOnly || !interactive || event.button > 1 || event.ctrlKey || event.metaKey) {
|
|
5839
5868
|
return;
|
|
@@ -5843,6 +5872,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5843
5872
|
const resolved = (0,waveform_range/* resolveRange */.Ss)(rangeRef.current, (0,waveform_range/* durationMsFromSec */.uH)(durationSecRef.current));
|
|
5844
5873
|
dragRef.current = {
|
|
5845
5874
|
handle,
|
|
5875
|
+
lastClientX: event.clientX,
|
|
5846
5876
|
originMs: handle === 'start' ? resolved.startMs : resolved.endMs,
|
|
5847
5877
|
originRange: {
|
|
5848
5878
|
endMs: resolved.endMs,
|
|
@@ -5851,6 +5881,7 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5851
5881
|
pointerId: event.pointerId,
|
|
5852
5882
|
range: resolved
|
|
5853
5883
|
};
|
|
5884
|
+
onDragPointerXRef.current?.(event.clientX);
|
|
5854
5885
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
5855
5886
|
setActiveHandle(handle);
|
|
5856
5887
|
setDragRange(resolved);
|
|
@@ -5941,7 +5972,11 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5941
5972
|
}), "Comment") : null;
|
|
5942
5973
|
return /*#__PURE__*/external_react_["default"].createElement("div", {
|
|
5943
5974
|
ref: rootRef,
|
|
5944
|
-
className:
|
|
5975
|
+
className: classnames_default()('bp-WaveformRange', {
|
|
5976
|
+
'bp-WaveformRange--highlight': highlight,
|
|
5977
|
+
'bp-WaveformRange--persist': keepHighlight,
|
|
5978
|
+
'bp-WaveformRange--swiping': collapsed && isSwiping
|
|
5979
|
+
}),
|
|
5945
5980
|
"data-collapsed": collapsed ? 'true' : 'false',
|
|
5946
5981
|
"data-highlighted": highlight ? 'true' : 'false',
|
|
5947
5982
|
"data-readonly": readOnly ? 'true' : 'false',
|
|
@@ -5952,7 +5987,9 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5952
5987
|
"data-testid": "bp-waveform-range-region"
|
|
5953
5988
|
}), !readOnly && /*#__PURE__*/external_react_["default"].createElement("div", {
|
|
5954
5989
|
ref: startHandleRef,
|
|
5955
|
-
className:
|
|
5990
|
+
className: classnames_default()('bp-WaveformRange-handle', 'bp-WaveformRange-handle--start', {
|
|
5991
|
+
'bp-WaveformRange-handle--dragging': activeHandle === 'start'
|
|
5992
|
+
}),
|
|
5956
5993
|
"data-testid": "bp-waveform-range-handle-start",
|
|
5957
5994
|
onMouseMove: event => event.stopPropagation(),
|
|
5958
5995
|
onPointerDown: onHandlePointerDown
|
|
@@ -5960,7 +5997,9 @@ const WaveformRangeSelection = /*#__PURE__*/(0,external_react_.forwardRef)(funct
|
|
|
5960
5997
|
className: "bp-WaveformRange-handleGrip"
|
|
5961
5998
|
})), !readOnly && /*#__PURE__*/external_react_["default"].createElement("div", {
|
|
5962
5999
|
ref: endHandleRef,
|
|
5963
|
-
className:
|
|
6000
|
+
className: classnames_default()('bp-WaveformRange-handle', 'bp-WaveformRange-handle--end', {
|
|
6001
|
+
'bp-WaveformRange-handle--dragging': activeHandle === 'end'
|
|
6002
|
+
}),
|
|
5964
6003
|
"data-testid": "bp-waveform-range-handle-end",
|
|
5965
6004
|
onMouseMove: event => event.stopPropagation(),
|
|
5966
6005
|
onPointerDown: onHandlePointerDown
|
|
@@ -6228,8 +6267,9 @@ function WaveformView({
|
|
|
6228
6267
|
const isRangeDraggingRef = (0,external_react_.useRef)(false);
|
|
6229
6268
|
const rangeRef = (0,external_react_.useRef)(range); // latest committed draft; drag-create must not start on top of an open span
|
|
6230
6269
|
const createDragRef = (0,external_react_.useRef)(null);
|
|
6270
|
+
const rangeDragPointerXRef = (0,external_react_.useRef)(null); // clientX while a handle or create-drag is down
|
|
6231
6271
|
const removeCreateDragListenersRef = (0,external_react_.useRef)(null);
|
|
6232
|
-
const skipNextSeekRef = (0,external_react_.useRef)(false);
|
|
6272
|
+
const skipNextSeekRef = (0,external_react_.useRef)(false); // ignore the click fired when a handle is released
|
|
6233
6273
|
const lastSetTimeSecRef = (0,external_react_.useRef)(null);
|
|
6234
6274
|
const [isRangeHovered, setIsRangeHovered] = (0,external_react_.useState)(false);
|
|
6235
6275
|
const isControlled = typeof zoomLevelProp === 'number';
|
|
@@ -6303,11 +6343,19 @@ function WaveformView({
|
|
|
6303
6343
|
viewportRef,
|
|
6304
6344
|
wavesurferRef
|
|
6305
6345
|
});
|
|
6346
|
+
const suppressTapToPlayPause = (0,external_react_.useCallback)(() => {
|
|
6347
|
+
suppressNextTapPlayPauseRef.current = true;
|
|
6348
|
+
window.clearTimeout(suppressNextTapPlayPauseTimerRef.current);
|
|
6349
|
+
suppressNextTapPlayPauseTimerRef.current = window.setTimeout(() => {
|
|
6350
|
+
suppressNextTapPlayPauseRef.current = false;
|
|
6351
|
+
suppressNextTapPlayPauseTimerRef.current = 0;
|
|
6352
|
+
}, constants/* WAVEFORM_TAPE_CLICK_SUPPRESS_MS */.fI);
|
|
6353
|
+
}, []);
|
|
6306
6354
|
const toggleTapePlayback = (0,external_react_.useCallback)(() => {
|
|
6307
6355
|
if (!interactiveRef.current) {
|
|
6308
6356
|
return;
|
|
6309
6357
|
}
|
|
6310
|
-
if (isUserPanning() || pointerZoomRef.current) {
|
|
6358
|
+
if (isUserPanning() || pointerZoomRef.current || isRangeDraggingRef.current) {
|
|
6311
6359
|
return;
|
|
6312
6360
|
}
|
|
6313
6361
|
if (suppressNextTapPlayPauseRef.current) {
|
|
@@ -6317,13 +6365,8 @@ function WaveformView({
|
|
|
6317
6365
|
return;
|
|
6318
6366
|
}
|
|
6319
6367
|
onPlayPauseRef.current?.(!isPlayingRef.current);
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
suppressNextTapPlayPauseTimerRef.current = window.setTimeout(() => {
|
|
6323
|
-
suppressNextTapPlayPauseRef.current = false;
|
|
6324
|
-
suppressNextTapPlayPauseTimerRef.current = 0;
|
|
6325
|
-
}, constants/* WAVEFORM_TAPE_CLICK_SUPPRESS_MS */.fI);
|
|
6326
|
-
}, [isUserPanning]);
|
|
6368
|
+
suppressTapToPlayPause();
|
|
6369
|
+
}, [isUserPanning, suppressTapToPlayPause]);
|
|
6327
6370
|
toggleTapePlaybackRef.current = toggleTapePlayback;
|
|
6328
6371
|
(0,external_react_.useLayoutEffect)(() => {
|
|
6329
6372
|
viewportRef.current = (0,waveform_viewport/* createWaveformViewport */.eq)({
|
|
@@ -6529,12 +6572,13 @@ function WaveformView({
|
|
|
6529
6572
|
onSeekRef.current?.(timeSec);
|
|
6530
6573
|
});
|
|
6531
6574
|
const unsubscribeScroll = wavesurfer.on('scroll', () => {
|
|
6532
|
-
if (suppressViewportSyncRef.current) {
|
|
6575
|
+
if (suppressViewportSyncRef.current || isRangeDraggingRef.current) {
|
|
6576
|
+
// A handle drag scrolls from its own frame loop. A pan settle would pull it back.
|
|
6533
6577
|
return;
|
|
6534
6578
|
}
|
|
6535
6579
|
// User pan: map scroll to the time under the playhead, then tape seeks it.
|
|
6536
6580
|
handleCameraScroll(timeSec => {
|
|
6537
|
-
if (cameraModeRef.current === 'tape' && !pointerZoomRef.current) {
|
|
6581
|
+
if (cameraModeRef.current === 'tape' && !pointerZoomRef.current && !createDragRef.current) {
|
|
6538
6582
|
handleTapeSwipe(timeSec);
|
|
6539
6583
|
}
|
|
6540
6584
|
syncViewport();
|
|
@@ -6654,14 +6698,18 @@ function WaveformView({
|
|
|
6654
6698
|
const tick = () => {
|
|
6655
6699
|
if (!media.paused) {
|
|
6656
6700
|
updatePlayheadPosition(media.currentTime);
|
|
6657
|
-
|
|
6701
|
+
if (!isRangeDraggingRef.current) {
|
|
6702
|
+
applyPlayheadCamera(media.currentTime, false);
|
|
6703
|
+
}
|
|
6658
6704
|
}
|
|
6659
6705
|
playheadAnimationRef.current = window.requestAnimationFrame(tick);
|
|
6660
6706
|
};
|
|
6661
6707
|
const startLoop = () => {
|
|
6662
6708
|
window.cancelAnimationFrame(playheadAnimationRef.current);
|
|
6663
6709
|
releaseUserPanHold();
|
|
6664
|
-
|
|
6710
|
+
if (!isRangeDraggingRef.current) {
|
|
6711
|
+
applyPlayheadCamera(media.currentTime, true);
|
|
6712
|
+
}
|
|
6665
6713
|
playheadAnimationRef.current = window.requestAnimationFrame(tick);
|
|
6666
6714
|
};
|
|
6667
6715
|
const stopLoop = () => {
|
|
@@ -6676,7 +6724,7 @@ function WaveformView({
|
|
|
6676
6724
|
};
|
|
6677
6725
|
const handleSeeked = () => {
|
|
6678
6726
|
onPlayheadSeek(media.currentTime);
|
|
6679
|
-
if (!isUserPanning()) {
|
|
6727
|
+
if (!isUserPanning() && !isRangeDraggingRef.current) {
|
|
6680
6728
|
seekTo(media.currentTime);
|
|
6681
6729
|
}
|
|
6682
6730
|
updatePlayheadPosition(media.currentTime);
|
|
@@ -6861,9 +6909,12 @@ function WaveformView({
|
|
|
6861
6909
|
const handleRangeDragChange = (0,external_react_.useCallback)(isDragging => {
|
|
6862
6910
|
isRangeDraggingRef.current = isDragging;
|
|
6863
6911
|
setIsRangeDragging(isDragging);
|
|
6912
|
+
suppressTapToPlayPause();
|
|
6913
|
+
cancelJump();
|
|
6864
6914
|
if (isDragging) {
|
|
6865
6915
|
setHoverProgress(null);
|
|
6866
6916
|
} else {
|
|
6917
|
+
rangeDragPointerXRef.current = null;
|
|
6867
6918
|
skipNextSeekRef.current = true;
|
|
6868
6919
|
window.setTimeout(() => {
|
|
6869
6920
|
skipNextSeekRef.current = false;
|
|
@@ -6871,7 +6922,60 @@ function WaveformView({
|
|
|
6871
6922
|
setPreviewRange(null);
|
|
6872
6923
|
}
|
|
6873
6924
|
onRangeDragChange?.(isDragging);
|
|
6874
|
-
}, [onRangeDragChange]);
|
|
6925
|
+
}, [cancelJump, onRangeDragChange, suppressTapToPlayPause]);
|
|
6926
|
+
(0,external_react_.useEffect)(() => {
|
|
6927
|
+
if (!isTape || !isRangeDragging) {
|
|
6928
|
+
return undefined;
|
|
6929
|
+
}
|
|
6930
|
+
let frameId = 0;
|
|
6931
|
+
let previousFrameMs = 0;
|
|
6932
|
+
let hasPreviousFrame = false;
|
|
6933
|
+
let pendingScrollPx = 0;
|
|
6934
|
+
const getPointerInTrack = () => {
|
|
6935
|
+
const track = trackRef.current;
|
|
6936
|
+
const pointerClientX = rangeDragPointerXRef.current;
|
|
6937
|
+
if (!track || pointerClientX == null || !Number.isFinite(pointerClientX)) {
|
|
6938
|
+
return null;
|
|
6939
|
+
}
|
|
6940
|
+
const rect = track.getBoundingClientRect();
|
|
6941
|
+
return {
|
|
6942
|
+
width: rect.width,
|
|
6943
|
+
x: pointerClientX - rect.left
|
|
6944
|
+
};
|
|
6945
|
+
};
|
|
6946
|
+
const scrollWhileHandleAtEdge = frameMs => {
|
|
6947
|
+
const rawElapsedSec = hasPreviousFrame ? Math.max(0, (frameMs - previousFrameMs) / 1000) : 0;
|
|
6948
|
+
const elapsedSec = Math.min(rawElapsedSec, constants/* WAVEFORM_RANGE_EDGE_SCROLL_MAX_FRAME_SEC */.bf);
|
|
6949
|
+
hasPreviousFrame = true;
|
|
6950
|
+
previousFrameMs = frameMs;
|
|
6951
|
+
const pointer = getPointerInTrack();
|
|
6952
|
+
const viewport = viewportRef.current;
|
|
6953
|
+
const scrollDeltaPx = pointer ? (0,waveform_viewport/* getRangeEdgeScrollDeltaPx */.CD)({
|
|
6954
|
+
elapsedSec,
|
|
6955
|
+
pixelsPerSecond: viewport.pixelsPerSecond,
|
|
6956
|
+
pointerX: pointer.x,
|
|
6957
|
+
widthPx: pointer.width
|
|
6958
|
+
}) : null;
|
|
6959
|
+
if (scrollDeltaPx == null) {
|
|
6960
|
+
pendingScrollPx = 0;
|
|
6961
|
+
} else {
|
|
6962
|
+
pendingScrollPx += scrollDeltaPx;
|
|
6963
|
+
const nextScroll = Math.min((0,waveform_viewport/* maxScrollLeft */.d0)(viewport), Math.max(0, viewport.scrollLeftPx + pendingScrollPx));
|
|
6964
|
+
const scrolledPx = nextScroll - viewport.scrollLeftPx;
|
|
6965
|
+
pendingScrollPx = scrolledPx === 0 ? 0 : pendingScrollPx - scrolledPx;
|
|
6966
|
+
if (scrolledPx !== 0) {
|
|
6967
|
+
applyScrollLeft(nextScroll, true);
|
|
6968
|
+
const nextViewport = viewportRef.current;
|
|
6969
|
+
onSeekRef.current?.((0,waveform_viewport/* timeFromPositionPx */.lZ)(nextViewport.widthPx / 2, nextViewport));
|
|
6970
|
+
}
|
|
6971
|
+
}
|
|
6972
|
+
frameId = window.requestAnimationFrame(scrollWhileHandleAtEdge);
|
|
6973
|
+
};
|
|
6974
|
+
frameId = window.requestAnimationFrame(scrollWhileHandleAtEdge);
|
|
6975
|
+
return () => {
|
|
6976
|
+
window.cancelAnimationFrame(frameId);
|
|
6977
|
+
};
|
|
6978
|
+
}, [applyScrollLeft, isRangeDragging, isTape]);
|
|
6875
6979
|
const getPlayheadSec = (0,external_react_.useCallback)(() => {
|
|
6876
6980
|
return mediaElRef.current ? mediaElRef.current.currentTime : currentTimeRef.current;
|
|
6877
6981
|
}, []);
|
|
@@ -7023,9 +7127,13 @@ function WaveformView({
|
|
|
7023
7127
|
getPlayheadSec: getPlayheadSec,
|
|
7024
7128
|
interactive: interactive && !isOverlayReadOnly,
|
|
7025
7129
|
isHighlighted: isRangeDragging || isRangeHovered,
|
|
7130
|
+
isSwiping: isTape && scrubPreviewTimeSec != null,
|
|
7026
7131
|
keepHighlight: true,
|
|
7027
7132
|
onDragChange: handleRangeDragChange,
|
|
7028
7133
|
onDragCreate: interactive && !isRangeDragging && !isOverlayReadOnly ? onRangeDragCreate : undefined,
|
|
7134
|
+
onDragPointerX: clientX => {
|
|
7135
|
+
rangeDragPointerXRef.current = clientX;
|
|
7136
|
+
},
|
|
7029
7137
|
onPreviewChange: setPreviewRange,
|
|
7030
7138
|
onRangeChange: interactive && !isOverlayReadOnly ? onRangeChange : undefined,
|
|
7031
7139
|
range: overlayRange,
|
|
@@ -7595,11 +7703,14 @@ function isFpsAvailable(player) {
|
|
|
7595
7703
|
/* harmony export */ LW: () => (/* binding */ WAVEFORM_ZOOM_MIN),
|
|
7596
7704
|
/* harmony export */ Le: () => (/* binding */ TAPE_POINTER_MEDIA_QUERY),
|
|
7597
7705
|
/* harmony export */ Lu: () => (/* binding */ WAVEFORM_BAR_GAP),
|
|
7706
|
+
/* harmony export */ MR: () => (/* binding */ WAVEFORM_RANGE_EDGE_ZONE_PX),
|
|
7598
7707
|
/* harmony export */ NM: () => (/* binding */ WAVEFORM_FOLLOW_INSET_PX),
|
|
7599
7708
|
/* harmony export */ QD: () => (/* binding */ WAVEFORM_ZOOM_BUTTON_STEP),
|
|
7709
|
+
/* harmony export */ VS: () => (/* binding */ WAVEFORM_RANGE_EDGE_SCROLL_AUDIO_SEC_PER_SEC),
|
|
7600
7710
|
/* harmony export */ XS: () => (/* binding */ WAVEFORM_BAR_MIN_HEIGHT),
|
|
7601
7711
|
/* harmony export */ Zs: () => (/* binding */ WAVEFORM_FOLLOW_SCROLL_SETTLE_MS),
|
|
7602
7712
|
/* harmony export */ bX: () => (/* binding */ WAVEFORM_RANGE_MIN_DURATION_MS),
|
|
7713
|
+
/* harmony export */ bf: () => (/* binding */ WAVEFORM_RANGE_EDGE_SCROLL_MAX_FRAME_SEC),
|
|
7603
7714
|
/* harmony export */ f3: () => (/* binding */ CLIENT_DECODE_PEAK_COUNT),
|
|
7604
7715
|
/* harmony export */ fI: () => (/* binding */ WAVEFORM_TAPE_CLICK_SUPPRESS_MS),
|
|
7605
7716
|
/* harmony export */ h1: () => (/* binding */ WAVEFORM_RANGE_HANDLE_LINE_PX),
|
|
@@ -7682,6 +7793,12 @@ const WAVEFORM_RANGE_SNAP_PX = 8;
|
|
|
7682
7793
|
const WAVEFORM_RANGE_MIN_DURATION_MS = 250;
|
|
7683
7794
|
/** Pointer travel before a waveform press becomes a new draft range. Shorter presses stay click-to-seek. */
|
|
7684
7795
|
const WAVEFORM_RANGE_CREATE_DRAG_PX = 4;
|
|
7796
|
+
/** Drag a handle inside this many CSS pixels of either view edge and the tape scrolls. */
|
|
7797
|
+
const WAVEFORM_RANGE_EDGE_ZONE_PX = 100;
|
|
7798
|
+
/** Audio seconds moved per wall-clock second when the pointer is on the view edge. */
|
|
7799
|
+
const WAVEFORM_RANGE_EDGE_SCROLL_AUDIO_SEC_PER_SEC = 4;
|
|
7800
|
+
/** Longest gap one edge-scroll frame may apply. A stalled timestamp must not jump the playhead. */
|
|
7801
|
+
const WAVEFORM_RANGE_EDGE_SCROLL_MAX_FRAME_SEC = 0.05;
|
|
7685
7802
|
const WAVEFORM_RANGE_GRIP_IN_MS = 150;
|
|
7686
7803
|
const WAVEFORM_RANGE_GRIP_OUT_MS = 100;
|
|
7687
7804
|
|
|
@@ -8719,6 +8836,7 @@ function isRetryableWaveformError(code) {
|
|
|
8719
8836
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
8720
8837
|
|
|
8721
8838
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8839
|
+
/* harmony export */ CD: () => (/* binding */ getRangeEdgeScrollDeltaPx),
|
|
8722
8840
|
/* harmony export */ Iw: () => (/* binding */ sliderValueFromZoom),
|
|
8723
8841
|
/* harmony export */ J$: () => (/* binding */ getZoomedPixelsPerSecond),
|
|
8724
8842
|
/* harmony export */ KH: () => (/* binding */ viewportEquals),
|
|
@@ -9009,6 +9127,30 @@ function getTapePinnedPlayheadLeft() {
|
|
|
9009
9127
|
return '50%';
|
|
9010
9128
|
}
|
|
9011
9129
|
|
|
9130
|
+
/**
|
|
9131
|
+
* Pixels to scroll this frame while a range handle is held in the edge zone.
|
|
9132
|
+
* Negative moves toward the start of the file. Null means the pointer is outside the zone.
|
|
9133
|
+
*/
|
|
9134
|
+
function getRangeEdgeScrollDeltaPx({
|
|
9135
|
+
audioSecPerSec = _constants__WEBPACK_IMPORTED_MODULE_0__/* .WAVEFORM_RANGE_EDGE_SCROLL_AUDIO_SEC_PER_SEC */ .VS,
|
|
9136
|
+
elapsedSec,
|
|
9137
|
+
edgeZonePx = _constants__WEBPACK_IMPORTED_MODULE_0__/* .WAVEFORM_RANGE_EDGE_ZONE_PX */ .MR,
|
|
9138
|
+
pixelsPerSecond,
|
|
9139
|
+
pointerX,
|
|
9140
|
+
widthPx
|
|
9141
|
+
}) {
|
|
9142
|
+
if (!(widthPx > 0) || !(elapsedSec > 0) || !(edgeZonePx > 0) || !(pixelsPerSecond > 0)) {
|
|
9143
|
+
return null;
|
|
9144
|
+
}
|
|
9145
|
+
const distanceFromEdgePx = Math.min(pointerX, widthPx - pointerX);
|
|
9146
|
+
if (distanceFromEdgePx >= edgeZonePx) {
|
|
9147
|
+
return null;
|
|
9148
|
+
}
|
|
9149
|
+
const intensity = 1 - distanceFromEdgePx / edgeZonePx;
|
|
9150
|
+
const direction = pointerX < widthPx / 2 ? -1 : 1;
|
|
9151
|
+
return direction * pixelsPerSecond * audioSecPerSec * elapsedSec * intensity;
|
|
9152
|
+
}
|
|
9153
|
+
|
|
9012
9154
|
/** CSS left % of the playhead from the left of the visible window. */
|
|
9013
9155
|
function timeLeftPercent(timeSec, durationSec, viewport) {
|
|
9014
9156
|
if (viewport.widthPx > 0 && viewport.pixelsPerSecond > 0) {
|
|
@@ -24741,7 +24883,7 @@ class Browser {
|
|
|
24741
24883
|
;// ./src/lib/Logger.js
|
|
24742
24884
|
/* eslint-disable no-undef */
|
|
24743
24885
|
const CLIENT_NAME = "box-content-preview";
|
|
24744
|
-
const CLIENT_VERSION = "3.
|
|
24886
|
+
const CLIENT_VERSION = "3.98.0";
|
|
24745
24887
|
/* eslint-enable no-undef */
|
|
24746
24888
|
|
|
24747
24889
|
class Logger {
|