@atlaskit/media-viewer 54.10.6 → 54.11.1
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/AGENTS.md +15 -1
- package/CHANGELOG.md +32 -0
- package/dist/cjs/DownloadButton.js +15 -1
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/content.js +15 -9
- package/dist/cjs/download.js +21 -4
- package/dist/cjs/header.js +91 -40
- package/dist/cjs/inset-sidebar-header.js +108 -0
- package/dist/cjs/insetViewerContext.js +34 -2
- package/dist/cjs/list.js +9 -5
- package/dist/cjs/media-viewer.js +43 -9
- package/dist/cjs/styleWrappers.compiled.css +32 -3
- package/dist/cjs/styleWrappers.js +205 -135
- package/dist/cjs/viewer-icon-button.js +38 -0
- package/dist/cjs/zoomControls.js +59 -5
- package/dist/es2019/DownloadButton.js +16 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/content.js +10 -4
- package/dist/es2019/download.js +22 -4
- package/dist/es2019/header.js +76 -33
- package/dist/es2019/inset-sidebar-header.js +100 -0
- package/dist/es2019/insetViewerContext.js +30 -4
- package/dist/es2019/list.js +9 -5
- package/dist/es2019/media-viewer.js +41 -11
- package/dist/es2019/styleWrappers.compiled.css +32 -3
- package/dist/es2019/styleWrappers.js +117 -32
- package/dist/es2019/viewer-icon-button.js +26 -0
- package/dist/es2019/zoomControls.js +57 -2
- package/dist/esm/DownloadButton.js +15 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/content.js +15 -9
- package/dist/esm/download.js +21 -4
- package/dist/esm/header.js +91 -40
- package/dist/esm/inset-sidebar-header.js +99 -0
- package/dist/esm/insetViewerContext.js +34 -2
- package/dist/esm/list.js +9 -5
- package/dist/esm/media-viewer.js +45 -11
- package/dist/esm/styleWrappers.compiled.css +32 -3
- package/dist/esm/styleWrappers.js +205 -135
- package/dist/esm/viewer-icon-button.js +31 -0
- package/dist/esm/zoomControls.js +59 -5
- package/dist/types/content.d.ts +2 -4
- package/dist/types/download.d.ts +1 -1
- package/dist/types/header.d.ts +3 -1
- package/dist/types/inset-sidebar-header.d.ts +13 -0
- package/dist/types/insetViewerContext.d.ts +6 -0
- package/dist/types/list.d.ts +4 -2
- package/dist/types/styleWrappers.d.ts +10 -1
- package/dist/types/viewer-icon-button.d.ts +18 -0
- package/dist/types/zoomControls.d.ts +6 -3
- package/package.json +8 -6
package/dist/cjs/media-viewer.js
CHANGED
|
@@ -23,6 +23,7 @@ var _closed = require("./analytics/events/ui/closed");
|
|
|
23
23
|
var _fireAnalytics = require("./analytics/fireAnalytics");
|
|
24
24
|
var _classnames = require("./classnames");
|
|
25
25
|
var _content = require("./content");
|
|
26
|
+
var _insetSidebarHeader = require("./inset-sidebar-header");
|
|
26
27
|
var _insetViewerContext = require("./insetViewerContext");
|
|
27
28
|
var _list = require("./list");
|
|
28
29
|
var _styleWrappers = require("./styleWrappers");
|
|
@@ -103,6 +104,7 @@ var MediaViewerComponent = function MediaViewerComponent(_ref) {
|
|
|
103
104
|
(0, _perfMarks.start)('MediaViewer.SessionDuration');
|
|
104
105
|
}, []);
|
|
105
106
|
var defaultSelectedItem = selectedItem || items[0];
|
|
107
|
+
var currentIdentifier = selectedIdentifier || defaultSelectedItem;
|
|
106
108
|
|
|
107
109
|
// Toggling the sidebar: opening is unconditional; closing goes through the
|
|
108
110
|
// optional onSidebarClose interceptor.
|
|
@@ -116,6 +118,24 @@ var MediaViewerComponent = function MediaViewerComponent(_ref) {
|
|
|
116
118
|
}
|
|
117
119
|
}, [isSidebarVisible, requestSidebarClose, setIsSidebarVisible]);
|
|
118
120
|
|
|
121
|
+
// In inset mode the sidebar toggle is in the media header while the sidebar is closed and in the
|
|
122
|
+
// sidebar's own header while it's open, so a toggle click unmounts the focused button. Move focus
|
|
123
|
+
// to the toggle that's now showing, only after a toggle click.
|
|
124
|
+
var showSidebarButtonRef = (0, _react.useRef)(null);
|
|
125
|
+
var hideSidebarButtonRef = (0, _react.useRef)(null);
|
|
126
|
+
var shouldFocusSidebarToggle = (0, _react.useRef)(false);
|
|
127
|
+
(0, _react.useEffect)(function () {
|
|
128
|
+
if (shouldFocusSidebarToggle.current) {
|
|
129
|
+
var _current;
|
|
130
|
+
shouldFocusSidebarToggle.current = false;
|
|
131
|
+
(_current = (isSidebarVisible ? hideSidebarButtonRef : showSidebarButtonRef).current) === null || _current === void 0 || _current.focus();
|
|
132
|
+
}
|
|
133
|
+
}, [isSidebarVisible]);
|
|
134
|
+
var onInsetSidebarButtonClick = (0, _react.useCallback)(function () {
|
|
135
|
+
shouldFocusSidebarToggle.current = true;
|
|
136
|
+
toggleSidebar();
|
|
137
|
+
}, [toggleSidebar]);
|
|
138
|
+
|
|
119
139
|
// The full modal close — used by ESC, the close button, and click-outside.
|
|
120
140
|
// Always passed through requestPreviewClose so the consumer can intercept.
|
|
121
141
|
var handlePreviewClose = (0, _react.useCallback)(function (reason) {
|
|
@@ -131,8 +151,7 @@ var MediaViewerComponent = function MediaViewerComponent(_ref) {
|
|
|
131
151
|
// in `items` with the current selected identifier's index. Falls back to
|
|
132
152
|
// 'next' if we can't determine direction (e.g. random jump from a list).
|
|
133
153
|
var computeNavigationDirection = (0, _react.useCallback)(function (nextIdentifier) {
|
|
134
|
-
var
|
|
135
|
-
var currentId = current && getIdentifierId(current);
|
|
154
|
+
var currentId = currentIdentifier && getIdentifierId(currentIdentifier);
|
|
136
155
|
var nextId = getIdentifierId(nextIdentifier);
|
|
137
156
|
if (!currentId || !nextId) {
|
|
138
157
|
return 'next';
|
|
@@ -147,13 +166,12 @@ var MediaViewerComponent = function MediaViewerComponent(_ref) {
|
|
|
147
166
|
return 'next';
|
|
148
167
|
}
|
|
149
168
|
return nextIndex < currentIndex ? 'prev' : 'next';
|
|
150
|
-
}, [items,
|
|
169
|
+
}, [items, currentIdentifier]);
|
|
151
170
|
var renderSidebar = function renderSidebar() {
|
|
152
|
-
|
|
153
|
-
if (sidebarSelectedIdentifier && isSidebarVisible && extensions !== null && extensions !== void 0 && extensions.sidebar) {
|
|
171
|
+
if (currentIdentifier && isSidebarVisible && extensions !== null && extensions !== void 0 && extensions.sidebar) {
|
|
154
172
|
return /*#__PURE__*/_react.default.createElement(_styleWrappers.SidebarWrapper, {
|
|
155
173
|
"data-testid": "media-viewer-sidebar-content"
|
|
156
|
-
}, extensions.sidebar.renderer(
|
|
174
|
+
}, extensions.sidebar.renderer(currentIdentifier, {
|
|
157
175
|
// `close` is what the sidebar renderer calls to dismiss itself.
|
|
158
176
|
// Route it through the same interceptor so confluence's
|
|
159
177
|
// unsaved-comment guard runs here too.
|
|
@@ -195,7 +213,7 @@ var MediaViewerComponent = function MediaViewerComponent(_ref) {
|
|
|
195
213
|
handlePreviewClose(reason);
|
|
196
214
|
}
|
|
197
215
|
}, /*#__PURE__*/_react.default.createElement(_list.List, {
|
|
198
|
-
defaultSelectedItem: defaultSelectedItem
|
|
216
|
+
defaultSelectedItem: defaultSelectedItem,
|
|
199
217
|
items: items
|
|
200
218
|
// Note: `onClose` here is what the prev/next list passes down for
|
|
201
219
|
// "close-the-modal" actions. Route through interceptor too.
|
|
@@ -220,13 +238,29 @@ var MediaViewerComponent = function MediaViewerComponent(_ref) {
|
|
|
220
238
|
var direction = computeNavigationDirection(identifier);
|
|
221
239
|
requestNavigation(direction, commit);
|
|
222
240
|
},
|
|
223
|
-
onSidebarButtonClick: toggleSidebar,
|
|
241
|
+
onSidebarButtonClick: isInsetViewer ? onInsetSidebarButtonClick : toggleSidebar,
|
|
224
242
|
isSidebarVisible: isSidebarVisible,
|
|
243
|
+
onHeaderClose: isInsetViewer ? function () {
|
|
244
|
+
return handlePreviewClose('button');
|
|
245
|
+
} : undefined,
|
|
246
|
+
sidebarToggleRef: isInsetViewer ? showSidebarButtonRef : undefined,
|
|
225
247
|
contextId: contextId,
|
|
226
248
|
featureFlags: featureFlags,
|
|
227
249
|
viewerOptions: viewerOptions,
|
|
228
250
|
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
229
|
-
})))
|
|
251
|
+
}))), isInsetViewer ? /*#__PURE__*/_react.default.createElement(_styleWrappers.MediaFooterBar, null) : null), isInsetViewer ? /*#__PURE__*/_react.default.createElement(_styleWrappers.SidebarColumn, {
|
|
252
|
+
isOpen: isSidebarVisible
|
|
253
|
+
}, currentIdentifier && extensions !== null && extensions !== void 0 && extensions.sidebar ? /*#__PURE__*/_react.default.createElement(_insetSidebarHeader.InsetSidebarHeader, {
|
|
254
|
+
identifier: currentIdentifier,
|
|
255
|
+
title: extensions.sidebar.title,
|
|
256
|
+
label: extensions.sidebar.label,
|
|
257
|
+
onHideSidebar: onInsetSidebarButtonClick,
|
|
258
|
+
onClose: function onClose() {
|
|
259
|
+
return handlePreviewClose('button');
|
|
260
|
+
},
|
|
261
|
+
hideSidebarButtonRef: hideSidebarButtonRef,
|
|
262
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
263
|
+
}) : null, renderSidebar()) : renderSidebar())))));
|
|
230
264
|
return intl ? content : /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
|
|
231
265
|
locale: "en"
|
|
232
266
|
}, content);
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
._151kfhey._151kfhey h1{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
3
|
._2rkofajl{border-radius:var(--ds-radius-small,3px)}
|
|
4
4
|
._2rkopb1k{border-radius:var(--ds-radius-xlarge,9pt)}
|
|
5
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
5
6
|
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
6
7
|
._189eidpf{border-width:0}
|
|
7
|
-
.
|
|
8
|
+
._1ii7kb7n{grid-row:1}
|
|
9
|
+
._yyhycs5v{grid-column:2}
|
|
8
10
|
._yyhykb7n{grid-column:1}._11pt15ty svg{filter:drop-shadow(0 1px 1px rgb(9 30 66/25%)) drop-shadow(0 0 1px rgb(9 30 66/31%))}
|
|
9
11
|
._152tidpf{inset-block-start:0}
|
|
10
12
|
._154i1ejb{top:var(--ds-space-300,24px)}
|
|
11
13
|
._154i1ssb{top:50%}
|
|
14
|
+
._154i1wug{top:auto}
|
|
12
15
|
._154iidpf{top:0}
|
|
13
16
|
._16jlidpf{flex-grow:0}
|
|
14
17
|
._16jlkb7n{flex-grow:1}
|
|
@@ -16,6 +19,8 @@
|
|
|
16
19
|
._18ew1wq8._18ew1wq8 h1{font-weight:var(--ds-font-weight-medium,500)}
|
|
17
20
|
._18m915vq{overflow-y:hidden}
|
|
18
21
|
._18m91wug{overflow-y:auto}
|
|
22
|
+
._18m9ewfl{overflow-y:visible}
|
|
23
|
+
._18u01wug{margin-left:auto}
|
|
19
24
|
._19bv1ejb{padding-left:var(--ds-space-300,24px)}
|
|
20
25
|
._19bv1mjv{padding-left:300px}
|
|
21
26
|
._19bvidpf{padding-left:0}
|
|
@@ -25,6 +30,8 @@
|
|
|
25
30
|
._19pk1ejb{margin-top:var(--ds-space-300,24px)}
|
|
26
31
|
._1bah1h6o{justify-content:center}
|
|
27
32
|
._1bah1y6m{justify-content:flex-start}
|
|
33
|
+
._1bah1yb4{justify-content:space-between}
|
|
34
|
+
._1bahesu3{justify-content:flex-end}
|
|
28
35
|
._1bahusic{justify-content:right}
|
|
29
36
|
._1bsb1ber{width:26pc}
|
|
30
37
|
._1bsb1kdj{width:25pc}
|
|
@@ -32,22 +39,30 @@
|
|
|
32
39
|
._1bsb1tcg{width:24px}
|
|
33
40
|
._1bsbauwl{width:100vw}
|
|
34
41
|
._1bsbyazj{width:calc(100% - 26pc)}
|
|
42
|
+
._1bsbze3t{width:var(--ds-space-0,0)}
|
|
35
43
|
._1bto1l2s{text-overflow:ellipsis}
|
|
44
|
+
._1doce4h9{border-bottom-width:var(--ds-border-width,1px)}
|
|
36
45
|
._1e02idpf{inset-inline-start:0}
|
|
37
46
|
._1e0c11p5{display:grid}
|
|
38
47
|
._1e0c1o8l{display:inline-block}
|
|
39
48
|
._1e0c1txw{display:flex}
|
|
40
49
|
._1ghp1kxc video{max-height:100vh}
|
|
50
|
+
._1il9nqa1{border-bottom-style:solid}
|
|
41
51
|
._1itkdlpg{background-image:linear-gradient(0deg,#101214,rgba(14,22,36,0))}
|
|
42
52
|
._1jyy1poe._1jyy1poe h1{color:#c7d1db}
|
|
53
|
+
._1jyyazsu._1jyyazsu h1{color:var(--ds-text-subtle,#505258)}
|
|
43
54
|
._1kemd8h4{image-rendering:pixelated}
|
|
44
55
|
._1l1f1n9t .mvng-hide-controls{position:fixed}
|
|
45
56
|
._1ltv1ejb{left:var(--ds-space-300,24px)}
|
|
46
57
|
._1ltv1mjv{left:300px}
|
|
47
58
|
._1ltvidpf{left:0}
|
|
59
|
+
._1o3i1l7x{border-bottom-color:var(--ds-border,#0b120e24)}
|
|
48
60
|
._1o9zidpf{flex-shrink:0}
|
|
49
61
|
._1o9zkb7n{flex-shrink:1}
|
|
62
|
+
._1oec1mzy{transition-duration:var(--ds-duration-long,.25s)}
|
|
63
|
+
._1oeci9qs{transition-duration:var(--ds-duration-medium,.2s)}
|
|
50
64
|
._1p351l2s._1p351l2s h1{text-overflow:ellipsis}
|
|
65
|
+
._1p3lnqa1{border-left-style:solid}
|
|
51
66
|
._1p6zkb7n video{flex-grow:1}
|
|
52
67
|
._1p8j15vq._1p8j15vq h1{overflow-y:hidden}
|
|
53
68
|
._1pby1qpw{z-index:520}
|
|
@@ -56,19 +71,24 @@
|
|
|
56
71
|
._1pbyuou7{z-index:522}
|
|
57
72
|
._1reo15vq{overflow-x:hidden}
|
|
58
73
|
._1reo1wug{overflow-x:auto}
|
|
74
|
+
._1reoewfl{overflow-x:visible}
|
|
59
75
|
._1tkeidpf{min-height:0}
|
|
76
|
+
._1tkexy5q{min-height:var(--ds-space-400,2pc)}
|
|
77
|
+
._1ul91kdj{min-width:25pc}
|
|
60
78
|
._1ul9idpf{min-width:0}
|
|
61
79
|
._1ul9uuw1{min-width:200px}
|
|
62
80
|
._1vgl1rj4 >*{pointer-events:all}
|
|
63
81
|
._1vnlkb7n video{flex-shrink:1}
|
|
64
82
|
._1xi21ejb{right:var(--ds-space-300,24px)}
|
|
83
|
+
._1xi21wug{right:auto}
|
|
65
84
|
._1xi2idpf{right:0}
|
|
66
85
|
._1xi2v47k{right:var(--ds-space-250,20px)}
|
|
67
86
|
._1y2kauwl video{width:100vw}
|
|
68
87
|
._20ka1poe._20ka1poe button:active svg{color:#c7d1db}
|
|
69
88
|
._2hwx1jfw{margin-right:var(--ds-space-500,40px)}
|
|
89
|
+
._2hwxidpf{margin-right:0}
|
|
70
90
|
._2lx21bp4{flex-direction:column}
|
|
71
|
-
.
|
|
91
|
+
._2z05i47z{grid-template-rows:minmax(0,1fr)}
|
|
72
92
|
._4cvr1fhb{align-items:stretch}
|
|
73
93
|
._4cvr1h6o{align-items:center}
|
|
74
94
|
._4cvresu3{align-items:flex-end}
|
|
@@ -76,8 +96,12 @@
|
|
|
76
96
|
._4t3i1kxc{height:100vh}
|
|
77
97
|
._4t3i1osq{height:100%}
|
|
78
98
|
._4t3i1uc6{height:98px}
|
|
99
|
+
._4t3ixncg{height:var(--ds-space-800,4pc)}
|
|
100
|
+
._4t3ixy5q{height:var(--ds-space-400,2pc)}
|
|
79
101
|
._4t3izwfg{height:2pc}
|
|
80
102
|
._5ralzm06{object-fit:scale-down}
|
|
103
|
+
._5wra1l7x{border-left-color:var(--ds-border,#0b120e24)}
|
|
104
|
+
._6fl4v1ec{transition-timing-function:var(--ds-easing-out-bold,cubic-bezier(0,.4,0,1))}
|
|
81
105
|
._7dir1j9a button{background-color:var(--ds-background-input,#fff)}
|
|
82
106
|
._80om73ad{cursor:default}
|
|
83
107
|
._80omtlke{cursor:pointer}
|
|
@@ -94,12 +118,14 @@
|
|
|
94
118
|
._ca0q1azu{padding-top:var(--ds-space-100,8px) var(--ds-space-300,24px)}
|
|
95
119
|
._ca0q1ejb{padding-top:var(--ds-space-300,24px)}
|
|
96
120
|
._ca0qidpf{padding-top:0}
|
|
121
|
+
._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
|
|
97
122
|
._ca0qv47k{padding-top:var(--ds-space-250,20px)}
|
|
98
123
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
99
124
|
._di7o9txx._di7o9txx button:hover svg{color:#b6c2cf}
|
|
100
125
|
._i0dl1wug{flex-basis:auto}
|
|
101
126
|
._i0dlf1ug{flex-basis:0%}
|
|
102
127
|
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
128
|
+
._k8m01ea5{transition-property:width}
|
|
103
129
|
._kqsw1n9t{position:fixed}
|
|
104
130
|
._kqswh2mm{position:relative}
|
|
105
131
|
._kqswstnw{position:absolute}
|
|
@@ -107,6 +133,7 @@
|
|
|
107
133
|
._lcxvglyw{pointer-events:none}
|
|
108
134
|
._n3td1ejb{padding-bottom:var(--ds-space-300,24px)}
|
|
109
135
|
._n3tdidpf{padding-bottom:0}
|
|
136
|
+
._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
|
|
110
137
|
._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
|
|
111
138
|
._n3tdv47k{padding-bottom:var(--ds-space-250,20px)}
|
|
112
139
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
@@ -121,6 +148,7 @@
|
|
|
121
148
|
._s7n4nkob{vertical-align:middle}
|
|
122
149
|
._syaz1poe{color:#c7d1db}
|
|
123
150
|
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
151
|
+
._t6vde4h9{border-left-width:var(--ds-border-width,1px)}
|
|
124
152
|
._t9ec1i34{transform:translateY(-50%)}
|
|
125
153
|
._tzy41w01{opacity:.85}
|
|
126
154
|
._u5f31ejb{padding-right:var(--ds-space-300,24px)}
|
|
@@ -140,4 +168,5 @@
|
|
|
140
168
|
._zcqx1osq p{line-height:100%}
|
|
141
169
|
._4pkp1fjg button:hover{color:#161a1d!important}
|
|
142
170
|
._6pupl4ek button:hover{background-color:var(--ds-background-input-hovered,#f8f8f8)}
|
|
143
|
-
._1sfy1fjg button:active{color:#161a1d!important}
|
|
171
|
+
._1sfy1fjg button:active{color:#161a1d!important}
|
|
172
|
+
@media (prefers-reduced-motion:reduce){._156y147i{transition-duration:var(--ds-duration-instant,0ms)}}
|