@atlaskit/renderer 108.19.0 → 108.20.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/CHANGELOG.md +12 -0
- package/dist/cjs/react/nodes/media/index.js +3 -1
- package/dist/cjs/react/nodes/mediaInline.js +50 -46
- package/dist/cjs/ui/MediaCard.js +74 -71
- package/dist/cjs/ui/Renderer/index.js +7 -15
- package/dist/cjs/ui/Renderer/style.js +1 -1
- package/dist/es2019/react/nodes/media/index.js +4 -1
- package/dist/es2019/react/nodes/mediaInline.js +23 -37
- package/dist/es2019/ui/MediaCard.js +29 -25
- package/dist/es2019/ui/Renderer/index.js +10 -17
- package/dist/es2019/ui/Renderer/style.js +10 -0
- package/dist/esm/react/nodes/media/index.js +5 -2
- package/dist/esm/react/nodes/mediaInline.js +51 -47
- package/dist/esm/ui/MediaCard.js +74 -71
- package/dist/esm/ui/Renderer/index.js +10 -17
- package/dist/esm/ui/Renderer/style.js +1 -1
- package/dist/types/react/nodes/index.d.ts +1 -1
- package/dist/types/react/nodes/media/index.d.ts +3 -2
- package/dist/types/react/nodes/mediaInline.d.ts +3 -5
- package/dist/types/ui/MediaCard.d.ts +5 -6
- package/dist/types/ui/Renderer/index.d.ts +1 -2
- package/dist/types-ts4.5/react/nodes/index.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/media/index.d.ts +3 -2
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +3 -5
- package/dist/types-ts4.5/ui/MediaCard.d.ts +5 -6
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/cjs/react/utils/EditorMediaClientProvider.js +0 -40
- package/dist/es2019/react/utils/EditorMediaClientProvider.js +0 -27
- package/dist/esm/react/utils/EditorMediaClientProvider.js +0 -30
- package/dist/types/react/utils/EditorMediaClientProvider.d.ts +0 -5
- package/dist/types-ts4.5/react/utils/EditorMediaClientProvider.d.ts +0 -5
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -15,7 +14,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
15
14
|
import React, { Component } from 'react';
|
|
16
15
|
import { filter } from '@atlaskit/adf-utils/traverse';
|
|
17
16
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
18
|
-
import {
|
|
17
|
+
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
19
18
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
20
19
|
export var mediaIdentifierMap = new Map();
|
|
21
20
|
export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
|
|
@@ -46,32 +45,29 @@ export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(do
|
|
|
46
45
|
return identifierList;
|
|
47
46
|
}, []);
|
|
48
47
|
};
|
|
49
|
-
export var
|
|
50
|
-
_inherits(
|
|
51
|
-
var _super = _createSuper(
|
|
52
|
-
function
|
|
48
|
+
export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
49
|
+
_inherits(MediaCardInternal, _Component);
|
|
50
|
+
var _super = _createSuper(MediaCardInternal);
|
|
51
|
+
function MediaCardInternal() {
|
|
53
52
|
var _this;
|
|
54
|
-
_classCallCheck(this,
|
|
53
|
+
_classCallCheck(this, MediaCardInternal);
|
|
55
54
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
56
55
|
args[_key] = arguments[_key];
|
|
57
56
|
}
|
|
58
57
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
59
58
|
_defineProperty(_assertThisInitialized(_this), "state", {});
|
|
60
59
|
_defineProperty(_assertThisInitialized(_this), "saveFileState", /*#__PURE__*/function () {
|
|
61
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
|
62
|
-
var
|
|
60
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id, mediaClientConfig) {
|
|
61
|
+
var collectionName, mediaClient, options, fileState;
|
|
63
62
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
64
63
|
while (1) switch (_context.prev = _context.next) {
|
|
65
64
|
case 0:
|
|
66
|
-
|
|
65
|
+
collectionName = _this.props.collection;
|
|
66
|
+
mediaClient = getMediaClient(mediaClientConfig);
|
|
67
67
|
options = {
|
|
68
68
|
collectionName: collectionName
|
|
69
69
|
};
|
|
70
|
-
_context.prev =
|
|
71
|
-
if (!mediaClient) {
|
|
72
|
-
_context.next = 8;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
70
|
+
_context.prev = 3;
|
|
75
71
|
_context.next = 6;
|
|
76
72
|
return mediaClient.file.getCurrentState(id, options);
|
|
77
73
|
case 6:
|
|
@@ -79,19 +75,18 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
79
75
|
_this.setState({
|
|
80
76
|
fileState: fileState
|
|
81
77
|
});
|
|
82
|
-
case 8:
|
|
83
78
|
_context.next = 12;
|
|
84
79
|
break;
|
|
85
80
|
case 10:
|
|
86
81
|
_context.prev = 10;
|
|
87
|
-
_context.t0 = _context["catch"](
|
|
82
|
+
_context.t0 = _context["catch"](3);
|
|
88
83
|
case 12:
|
|
89
84
|
case "end":
|
|
90
85
|
return _context.stop();
|
|
91
86
|
}
|
|
92
|
-
}, _callee, null, [[
|
|
87
|
+
}, _callee, null, [[3, 10]]);
|
|
93
88
|
}));
|
|
94
|
-
return function (_x) {
|
|
89
|
+
return function (_x, _x2) {
|
|
95
90
|
return _ref.apply(this, arguments);
|
|
96
91
|
};
|
|
97
92
|
}());
|
|
@@ -122,29 +117,40 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
122
117
|
});
|
|
123
118
|
return _this;
|
|
124
119
|
}
|
|
125
|
-
_createClass(
|
|
120
|
+
_createClass(MediaCardInternal, [{
|
|
126
121
|
key: "componentDidMount",
|
|
127
122
|
value: function () {
|
|
128
123
|
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
129
|
-
var _this$
|
|
124
|
+
var _this$props, rendererContext, mediaProvider, contextIdentifierProvider, id, url, collectionName, mediaProviderObject, mediaClientConfig, nodeIsInCache;
|
|
130
125
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
131
126
|
while (1) switch (_context2.prev = _context2.next) {
|
|
132
127
|
case 0:
|
|
133
|
-
_this$
|
|
128
|
+
_this$props = this.props, rendererContext = _this$props.rendererContext, mediaProvider = _this$props.mediaProvider, contextIdentifierProvider = _this$props.contextIdentifierProvider, id = _this$props.id, url = _this$props.url, collectionName = _this$props.collection;
|
|
129
|
+
if (mediaProvider) {
|
|
130
|
+
_context2.next = 3;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
return _context2.abrupt("return");
|
|
134
|
+
case 3:
|
|
134
135
|
if (!contextIdentifierProvider) {
|
|
135
|
-
_context2.next =
|
|
136
|
+
_context2.next = 10;
|
|
136
137
|
break;
|
|
137
138
|
}
|
|
138
139
|
_context2.t0 = this;
|
|
139
|
-
_context2.next =
|
|
140
|
+
_context2.next = 7;
|
|
140
141
|
return contextIdentifierProvider;
|
|
141
|
-
case
|
|
142
|
+
case 7:
|
|
142
143
|
_context2.t1 = _context2.sent;
|
|
143
144
|
_context2.t2 = {
|
|
144
145
|
contextIdentifierProvider: _context2.t1
|
|
145
146
|
};
|
|
146
147
|
_context2.t0.setState.call(_context2.t0, _context2.t2);
|
|
147
|
-
case
|
|
148
|
+
case 10:
|
|
149
|
+
_context2.next = 12;
|
|
150
|
+
return mediaProvider;
|
|
151
|
+
case 12:
|
|
152
|
+
mediaProviderObject = _context2.sent;
|
|
153
|
+
mediaClientConfig = mediaProviderObject.viewMediaClientConfig;
|
|
148
154
|
nodeIsInCache = id && mediaIdentifierMap.has(id) || url && mediaIdentifierMap.has(url);
|
|
149
155
|
if (rendererContext && rendererContext.adDoc && !nodeIsInCache) {
|
|
150
156
|
getListOfIdentifiersFromDoc(rendererContext.adDoc).forEach(function (identifier) {
|
|
@@ -157,10 +163,13 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
157
163
|
}
|
|
158
164
|
});
|
|
159
165
|
}
|
|
166
|
+
this.setState({
|
|
167
|
+
mediaClientConfig: mediaClientConfig
|
|
168
|
+
});
|
|
160
169
|
if (id) {
|
|
161
|
-
this.saveFileState(id);
|
|
170
|
+
this.saveFileState(id, mediaClientConfig);
|
|
162
171
|
}
|
|
163
|
-
case
|
|
172
|
+
case 18:
|
|
164
173
|
case "end":
|
|
165
174
|
return _context2.stop();
|
|
166
175
|
}
|
|
@@ -174,17 +183,18 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
174
183
|
}, {
|
|
175
184
|
key: "UNSAFE_componentWillReceiveProps",
|
|
176
185
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
186
|
+
var mediaClientConfig = this.state.mediaClientConfig;
|
|
177
187
|
var newId = newProps.id;
|
|
178
|
-
if (newId && newId !== this.props.id) {
|
|
179
|
-
this.saveFileState(newId);
|
|
188
|
+
if (mediaClientConfig && newId && newId !== this.props.id) {
|
|
189
|
+
this.saveFileState(newId, mediaClientConfig);
|
|
180
190
|
}
|
|
181
191
|
}
|
|
182
192
|
}, {
|
|
183
193
|
key: "componentWillUnmount",
|
|
184
194
|
value: function componentWillUnmount() {
|
|
185
|
-
var _this$
|
|
186
|
-
id = _this$
|
|
187
|
-
dataURI = _this$
|
|
195
|
+
var _this$props2 = this.props,
|
|
196
|
+
id = _this$props2.id,
|
|
197
|
+
dataURI = _this$props2.url;
|
|
188
198
|
if (id) {
|
|
189
199
|
mediaIdentifierMap.delete(id);
|
|
190
200
|
} else if (dataURI) {
|
|
@@ -194,18 +204,18 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
194
204
|
}, {
|
|
195
205
|
key: "renderExternal",
|
|
196
206
|
value: function renderExternal(shouldOpenMediaViewer) {
|
|
197
|
-
var
|
|
198
|
-
var _this$
|
|
199
|
-
cardDimensions = _this$
|
|
200
|
-
resizeMode = _this$
|
|
201
|
-
appearance = _this$
|
|
202
|
-
url = _this$
|
|
203
|
-
imageStatus = _this$
|
|
204
|
-
disableOverlay = _this$
|
|
205
|
-
alt = _this$
|
|
206
|
-
featureFlags = _this$
|
|
207
|
-
ssr = _this$
|
|
208
|
-
rendererAppearance = _this$
|
|
207
|
+
var mediaClientConfig = this.state.mediaClientConfig;
|
|
208
|
+
var _this$props3 = this.props,
|
|
209
|
+
cardDimensions = _this$props3.cardDimensions,
|
|
210
|
+
resizeMode = _this$props3.resizeMode,
|
|
211
|
+
appearance = _this$props3.appearance,
|
|
212
|
+
url = _this$props3.url,
|
|
213
|
+
imageStatus = _this$props3.imageStatus,
|
|
214
|
+
disableOverlay = _this$props3.disableOverlay,
|
|
215
|
+
alt = _this$props3.alt,
|
|
216
|
+
featureFlags = _this$props3.featureFlags,
|
|
217
|
+
ssr = _this$props3.ssr,
|
|
218
|
+
rendererAppearance = _this$props3.rendererAppearance;
|
|
209
219
|
if (imageStatus === 'loading' || !url) {
|
|
210
220
|
return this.renderLoadingCard();
|
|
211
221
|
}
|
|
@@ -214,7 +224,6 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
214
224
|
name: url,
|
|
215
225
|
mediaItemType: 'external-image'
|
|
216
226
|
};
|
|
217
|
-
var mediaClientConfig = (_this$props$mediaClie = this.props.mediaClient) === null || _this$props$mediaClie === void 0 ? void 0 : _this$props$mediaClie.mediaClientConfig;
|
|
218
227
|
return /*#__PURE__*/React.createElement(Card
|
|
219
228
|
// TODO MPT-315: clean up after we move mediaClientConfig into FileIdentifier
|
|
220
229
|
// context is not really used when the type is external and we want to render the component asap
|
|
@@ -236,26 +245,26 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
236
245
|
}, {
|
|
237
246
|
key: "render",
|
|
238
247
|
value: function render() {
|
|
239
|
-
var _this$props$mediaClie2;
|
|
240
248
|
var _this$state = this.state,
|
|
241
249
|
contextIdentifierProvider = _this$state.contextIdentifierProvider,
|
|
250
|
+
mediaClientConfigInState = _this$state.mediaClientConfig,
|
|
242
251
|
fileState = _this$state.fileState;
|
|
243
|
-
var _this$
|
|
244
|
-
id = _this$
|
|
245
|
-
alt = _this$
|
|
246
|
-
type = _this$
|
|
247
|
-
collection = _this$
|
|
248
|
-
occurrenceKey = _this$
|
|
249
|
-
cardDimensions = _this$
|
|
250
|
-
resizeMode = _this$
|
|
251
|
-
rendererAppearance = _this$
|
|
252
|
-
disableOverlay = _this$
|
|
253
|
-
useInlinePlayer = _this$
|
|
254
|
-
originalDimensions = _this$
|
|
255
|
-
forceOpenMediaViewer = _this$
|
|
256
|
-
featureFlags = _this$
|
|
257
|
-
shouldEnableDownloadButton = _this$
|
|
258
|
-
ssr = _this$
|
|
252
|
+
var _this$props4 = this.props,
|
|
253
|
+
id = _this$props4.id,
|
|
254
|
+
alt = _this$props4.alt,
|
|
255
|
+
type = _this$props4.type,
|
|
256
|
+
collection = _this$props4.collection,
|
|
257
|
+
occurrenceKey = _this$props4.occurrenceKey,
|
|
258
|
+
cardDimensions = _this$props4.cardDimensions,
|
|
259
|
+
resizeMode = _this$props4.resizeMode,
|
|
260
|
+
rendererAppearance = _this$props4.rendererAppearance,
|
|
261
|
+
disableOverlay = _this$props4.disableOverlay,
|
|
262
|
+
useInlinePlayer = _this$props4.useInlinePlayer,
|
|
263
|
+
originalDimensions = _this$props4.originalDimensions,
|
|
264
|
+
forceOpenMediaViewer = _this$props4.shouldOpenMediaViewer,
|
|
265
|
+
featureFlags = _this$props4.featureFlags,
|
|
266
|
+
shouldEnableDownloadButton = _this$props4.shouldEnableDownloadButton,
|
|
267
|
+
ssr = _this$props4.ssr;
|
|
259
268
|
var isMobile = rendererAppearance === 'mobile';
|
|
260
269
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
261
270
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -267,7 +276,7 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
267
276
|
if (type === 'link') {
|
|
268
277
|
return null;
|
|
269
278
|
}
|
|
270
|
-
var mediaClientConfig = !!ssr ? ssr.config :
|
|
279
|
+
var mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
|
|
271
280
|
if (!mediaClientConfig || !id) {
|
|
272
281
|
return this.renderLoadingCard();
|
|
273
282
|
}
|
|
@@ -311,7 +320,7 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
311
320
|
}));
|
|
312
321
|
}
|
|
313
322
|
}]);
|
|
314
|
-
return
|
|
323
|
+
return MediaCardInternal;
|
|
315
324
|
}(Component);
|
|
316
325
|
// Needed for copy & paste
|
|
317
326
|
export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
@@ -346,10 +355,4 @@ export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
|
346
355
|
'data-alt': alt
|
|
347
356
|
};
|
|
348
357
|
};
|
|
349
|
-
export var MediaCardInternal = function MediaCardInternal(props) {
|
|
350
|
-
var mediaClient = React.useContext(MediaClientContext);
|
|
351
|
-
return /*#__PURE__*/React.createElement(MediaCardView, _extends({}, props, {
|
|
352
|
-
mediaClient: mediaClient
|
|
353
|
-
}));
|
|
354
|
-
};
|
|
355
358
|
export var MediaCard = withImageLoader(MediaCardInternal);
|
|
@@ -11,11 +11,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
/** @jsx jsx */
|
|
14
|
-
import React, { Fragment, useContext, useLayoutEffect, useRef
|
|
14
|
+
import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
|
|
15
15
|
import { jsx } from '@emotion/react';
|
|
16
|
+
import { PureComponent } from 'react';
|
|
16
17
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
|
|
17
18
|
import { reduce } from '@atlaskit/adf-utils/traverse';
|
|
18
|
-
import { ProviderFactory
|
|
19
|
+
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
19
20
|
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
20
21
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI, getDistortedDurationMonitor, browser } from '@atlaskit/editor-common/utils';
|
|
21
22
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
@@ -41,11 +42,10 @@ import { RendererContextProvider } from '../../renderer-context';
|
|
|
41
42
|
import memoizeOne from 'memoize-one';
|
|
42
43
|
import { ErrorBoundary } from './ErrorBoundary';
|
|
43
44
|
import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
44
|
-
import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientProvider';
|
|
45
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "108.
|
|
48
|
+
var packageVersion = "108.20.1";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -292,8 +292,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
292
292
|
allowColumnSorting = _this$props.allowColumnSorting,
|
|
293
293
|
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
294
294
|
allowWrapCodeBlock = _this$props.allowWrapCodeBlock,
|
|
295
|
-
allowCustomPanels = _this$props.allowCustomPanels
|
|
296
|
-
media = _this$props.media;
|
|
295
|
+
allowCustomPanels = _this$props.allowCustomPanels;
|
|
297
296
|
var featureFlags = this.featureFlags(this.props.featureFlags);
|
|
298
297
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
299
298
|
/**
|
|
@@ -361,9 +360,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
361
360
|
return _this3.fireAnalyticsEvent(event);
|
|
362
361
|
}
|
|
363
362
|
}
|
|
364
|
-
}, jsx(SmartCardStorageProvider, null, jsx(
|
|
365
|
-
value: this.providerFactory
|
|
366
|
-
}, jsx(RendererWrapper, {
|
|
363
|
+
}, jsx(SmartCardStorageProvider, null, jsx(RendererWrapper, {
|
|
367
364
|
appearance: appearance,
|
|
368
365
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
369
366
|
allowColumnSorting: allowColumnSorting,
|
|
@@ -375,13 +372,12 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
375
372
|
addTelepointer: this.props.addTelepointer,
|
|
376
373
|
innerRef: this.editorRef,
|
|
377
374
|
onClick: handleWrapperOnClick,
|
|
378
|
-
onMouseDown: this.onMouseDownEditView
|
|
379
|
-
ssr: media === null || media === void 0 ? void 0 : media.ssr
|
|
375
|
+
onMouseDown: this.onMouseDownEditView
|
|
380
376
|
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, null) : null, jsx(RendererActionsInternalUpdater, {
|
|
381
377
|
doc: pmDoc,
|
|
382
378
|
schema: schema,
|
|
383
379
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
384
|
-
}, result))))))
|
|
380
|
+
}, result))))));
|
|
385
381
|
var rendererResult = truncated ? jsx(TruncatedWrapper, {
|
|
386
382
|
height: maxHeight,
|
|
387
383
|
fadeHeight: fadeOutHeight
|
|
@@ -462,8 +458,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
462
458
|
onClick = props.onClick,
|
|
463
459
|
onMouseDown = props.onMouseDown,
|
|
464
460
|
useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock,
|
|
465
|
-
addTelepointer = props.addTelepointer
|
|
466
|
-
ssr = props.ssr;
|
|
461
|
+
addTelepointer = props.addTelepointer;
|
|
467
462
|
var createTelepointer = function createTelepointer() {
|
|
468
463
|
var telepointer = document.createElement('span');
|
|
469
464
|
telepointer.textContent = "\u200B";
|
|
@@ -520,8 +515,6 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
520
515
|
"data-appearance": appearance
|
|
521
516
|
}, jsx(BaseTheme, {
|
|
522
517
|
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
523
|
-
}, jsx(EditorMediaClientProvider, {
|
|
524
|
-
ssr: ssr
|
|
525
518
|
}, jsx("div", {
|
|
526
519
|
ref: innerRef,
|
|
527
520
|
onClick: onClick,
|
|
@@ -532,7 +525,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
532
525
|
allowColumnSorting: !!allowColumnSorting,
|
|
533
526
|
useBlockRenderForCodeBlock: useBlockRenderForCodeBlock
|
|
534
527
|
})
|
|
535
|
-
}, children)))
|
|
528
|
+
}, children)));
|
|
536
529
|
});
|
|
537
530
|
function RendererActionsInternalUpdater(_ref) {
|
|
538
531
|
var children = _ref.children,
|
|
@@ -62,7 +62,7 @@ export var headingSizes = {
|
|
|
62
62
|
};
|
|
63
63
|
var headingAnchorStyle = function headingAnchorStyle(headingTag) {
|
|
64
64
|
return (// TODO Delete this comment after verifying space token -> previous value `margin-left: 6px`
|
|
65
|
-
css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: ", ";\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName)
|
|
65
|
+
css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: ", ";\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n\n /**\n * Adds the visibility of the button when in focus through keyboard navigation.\n */\n .", " {\n button:focus {\n opacity: 1;\n transform: none !important;\n }\n }\n "])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName)
|
|
66
66
|
);
|
|
67
67
|
};
|
|
68
68
|
var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
|
|
@@ -58,7 +58,7 @@ declare const BlockCard: React.ComponentType<{
|
|
|
58
58
|
}> & Loadable.LoadableComponent;
|
|
59
59
|
declare const Media: React.ComponentType<import("./media").MediaProps> & Loadable.LoadableComponent;
|
|
60
60
|
declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupProps> & Loadable.LoadableComponent;
|
|
61
|
-
declare const MediaInline: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaInline").MediaInlineProps & import("react-intl-next").WrappedComponentProps<"intl"
|
|
61
|
+
declare const MediaInline: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaInline").MediaInlineProps & import("react-intl-next").WrappedComponentProps<"intl">>> & Loadable.LoadableComponent;
|
|
62
62
|
declare const MediaSingle: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaSingle").Props & import("react-intl-next").WrappedComponentProps<"intl">>> & Loadable.LoadableComponent;
|
|
63
63
|
declare const Mention: React.ComponentType<import("./mention").Props> & Loadable.LoadableComponent;
|
|
64
64
|
declare const Expand: React.ComponentType<import("react-intl-next").WithIntlProps<import("../../ui/Expand").ExpandProps & import("react-intl-next").WrappedComponentProps<"intl">>> & Loadable.LoadableComponent;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
6
|
import type { MediaCardProps } from '../../../ui/MediaCard';
|
|
6
7
|
import type { LinkDefinition, BorderMarkDefinition } from '@atlaskit/adf-schema';
|
|
7
8
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { FC } from 'react';
|
|
3
2
|
import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
3
|
import type { FileIdentifier } from '@atlaskit/media-client';
|
|
5
4
|
import type { MediaProvider, ClipboardAttrs } from '../../ui/MediaCard';
|
|
@@ -8,7 +7,6 @@ import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
|
8
7
|
import type { RendererAppearance } from '../../ui/Renderer/types';
|
|
9
8
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
10
9
|
import type { RendererContext } from '../types';
|
|
11
|
-
import type { MediaInlineAttrs } from '@atlaskit/editor-common/media-inline';
|
|
12
10
|
type MediaInlineProviders = {
|
|
13
11
|
mediaProvider?: Promise<MediaProvider>;
|
|
14
12
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
@@ -33,8 +31,8 @@ export type MediaInlineProps = {
|
|
|
33
31
|
rendererAppearance?: RendererAppearance;
|
|
34
32
|
featureFlags?: MediaFeatureFlags;
|
|
35
33
|
};
|
|
36
|
-
export declare const RenderMediaInline: FC<RenderMediaInlineProps
|
|
37
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl"
|
|
38
|
-
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps<"intl"
|
|
34
|
+
export declare const RenderMediaInline: React.FC<RenderMediaInlineProps>;
|
|
35
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl">>> & {
|
|
36
|
+
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps<"intl">>;
|
|
39
37
|
};
|
|
40
38
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
3
|
import type { CardAppearance, CardDimensions, CardOnClickCallback, NumericalCardDimensions } from '@atlaskit/media-card';
|
|
4
4
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
5
|
-
import type { ImageResizeMode, Identifier, FileState
|
|
5
|
+
import type { ImageResizeMode, Identifier, FileState } from '@atlaskit/media-client';
|
|
6
6
|
import type { MediaType } from '@atlaskit/adf-schema';
|
|
7
7
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
8
8
|
import type { ImageStatus } from '@atlaskit/editor-common/utils';
|
|
@@ -15,6 +15,7 @@ export type MediaProvider = {
|
|
|
15
15
|
};
|
|
16
16
|
export interface MediaCardProps {
|
|
17
17
|
id?: string;
|
|
18
|
+
mediaProvider?: Promise<MediaProvider>;
|
|
18
19
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
19
20
|
eventHandlers?: {
|
|
20
21
|
media?: {
|
|
@@ -41,19 +42,18 @@ export interface MediaCardProps {
|
|
|
41
42
|
ssr?: MediaSSR;
|
|
42
43
|
}
|
|
43
44
|
export interface State {
|
|
45
|
+
mediaClientConfig?: MediaClientConfig;
|
|
44
46
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
45
47
|
fileState?: FileState;
|
|
46
48
|
}
|
|
47
49
|
export declare const mediaIdentifierMap: Map<string, Identifier>;
|
|
48
50
|
export declare const getListOfIdentifiersFromDoc: (doc?: ADFEntity) => Identifier[];
|
|
49
|
-
export declare class
|
|
50
|
-
mediaClient?: MediaClient;
|
|
51
|
-
}, State> {
|
|
51
|
+
export declare class MediaCardInternal extends Component<MediaCardProps, State> {
|
|
52
52
|
state: State;
|
|
53
53
|
componentDidMount(): Promise<void>;
|
|
54
54
|
UNSAFE_componentWillReceiveProps(newProps: MediaCardProps): void;
|
|
55
55
|
componentWillUnmount(): void;
|
|
56
|
-
saveFileState: (id: string) => Promise<void>;
|
|
56
|
+
saveFileState: (id: string, mediaClientConfig: MediaClientConfig) => Promise<void>;
|
|
57
57
|
private renderLoadingCard;
|
|
58
58
|
private renderExternal;
|
|
59
59
|
/**
|
|
@@ -76,5 +76,4 @@ export type ClipboardAttrs = {
|
|
|
76
76
|
export declare const getClipboardAttrs: ({ id, alt, collection, contextIdentifierProvider, originalDimensions, fileState, }: ClipboardAttrs) => {
|
|
77
77
|
[key: string]: string | number | undefined;
|
|
78
78
|
};
|
|
79
|
-
export declare const MediaCardInternal: (props: MediaCardProps) => JSX.Element;
|
|
80
79
|
export declare const MediaCard: React.ComponentClass<MediaCardProps & import("@atlaskit/editor-common/utils").ImageLoaderProps, any>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
1
|
import { jsx } from '@emotion/react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
4
3
|
import type { RendererProps } from '../renderer-props';
|
|
5
4
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
6
5
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
@@ -58,7 +58,7 @@ declare const BlockCard: React.ComponentType<{
|
|
|
58
58
|
}> & Loadable.LoadableComponent;
|
|
59
59
|
declare const Media: React.ComponentType<import("./media").MediaProps> & Loadable.LoadableComponent;
|
|
60
60
|
declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupProps> & Loadable.LoadableComponent;
|
|
61
|
-
declare const MediaInline: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaInline").MediaInlineProps & import("react-intl-next").WrappedComponentProps<"intl"
|
|
61
|
+
declare const MediaInline: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaInline").MediaInlineProps & import("react-intl-next").WrappedComponentProps<"intl">>> & Loadable.LoadableComponent;
|
|
62
62
|
declare const MediaSingle: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaSingle").Props & import("react-intl-next").WrappedComponentProps<"intl">>> & Loadable.LoadableComponent;
|
|
63
63
|
declare const Mention: React.ComponentType<import("./mention").Props> & Loadable.LoadableComponent;
|
|
64
64
|
declare const Expand: React.ComponentType<import("react-intl-next").WithIntlProps<import("../../ui/Expand").ExpandProps & import("react-intl-next").WrappedComponentProps<"intl">>> & Loadable.LoadableComponent;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
6
|
import type { MediaCardProps } from '../../../ui/MediaCard';
|
|
6
7
|
import type { LinkDefinition, BorderMarkDefinition } from '@atlaskit/adf-schema';
|
|
7
8
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { FC } from 'react';
|
|
3
2
|
import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
3
|
import type { FileIdentifier } from '@atlaskit/media-client';
|
|
5
4
|
import type { MediaProvider, ClipboardAttrs } from '../../ui/MediaCard';
|
|
@@ -8,7 +7,6 @@ import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
|
8
7
|
import type { RendererAppearance } from '../../ui/Renderer/types';
|
|
9
8
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
10
9
|
import type { RendererContext } from '../types';
|
|
11
|
-
import type { MediaInlineAttrs } from '@atlaskit/editor-common/media-inline';
|
|
12
10
|
type MediaInlineProviders = {
|
|
13
11
|
mediaProvider?: Promise<MediaProvider>;
|
|
14
12
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
@@ -33,8 +31,8 @@ export type MediaInlineProps = {
|
|
|
33
31
|
rendererAppearance?: RendererAppearance;
|
|
34
32
|
featureFlags?: MediaFeatureFlags;
|
|
35
33
|
};
|
|
36
|
-
export declare const RenderMediaInline: FC<RenderMediaInlineProps
|
|
37
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl"
|
|
38
|
-
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps<"intl"
|
|
34
|
+
export declare const RenderMediaInline: React.FC<RenderMediaInlineProps>;
|
|
35
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl">>> & {
|
|
36
|
+
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps<"intl">>;
|
|
39
37
|
};
|
|
40
38
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
3
|
import type { CardAppearance, CardDimensions, CardOnClickCallback, NumericalCardDimensions } from '@atlaskit/media-card';
|
|
4
4
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
5
|
-
import type { ImageResizeMode, Identifier, FileState
|
|
5
|
+
import type { ImageResizeMode, Identifier, FileState } from '@atlaskit/media-client';
|
|
6
6
|
import type { MediaType } from '@atlaskit/adf-schema';
|
|
7
7
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
8
8
|
import type { ImageStatus } from '@atlaskit/editor-common/utils';
|
|
@@ -15,6 +15,7 @@ export type MediaProvider = {
|
|
|
15
15
|
};
|
|
16
16
|
export interface MediaCardProps {
|
|
17
17
|
id?: string;
|
|
18
|
+
mediaProvider?: Promise<MediaProvider>;
|
|
18
19
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
19
20
|
eventHandlers?: {
|
|
20
21
|
media?: {
|
|
@@ -41,19 +42,18 @@ export interface MediaCardProps {
|
|
|
41
42
|
ssr?: MediaSSR;
|
|
42
43
|
}
|
|
43
44
|
export interface State {
|
|
45
|
+
mediaClientConfig?: MediaClientConfig;
|
|
44
46
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
45
47
|
fileState?: FileState;
|
|
46
48
|
}
|
|
47
49
|
export declare const mediaIdentifierMap: Map<string, Identifier>;
|
|
48
50
|
export declare const getListOfIdentifiersFromDoc: (doc?: ADFEntity) => Identifier[];
|
|
49
|
-
export declare class
|
|
50
|
-
mediaClient?: MediaClient;
|
|
51
|
-
}, State> {
|
|
51
|
+
export declare class MediaCardInternal extends Component<MediaCardProps, State> {
|
|
52
52
|
state: State;
|
|
53
53
|
componentDidMount(): Promise<void>;
|
|
54
54
|
UNSAFE_componentWillReceiveProps(newProps: MediaCardProps): void;
|
|
55
55
|
componentWillUnmount(): void;
|
|
56
|
-
saveFileState: (id: string) => Promise<void>;
|
|
56
|
+
saveFileState: (id: string, mediaClientConfig: MediaClientConfig) => Promise<void>;
|
|
57
57
|
private renderLoadingCard;
|
|
58
58
|
private renderExternal;
|
|
59
59
|
/**
|
|
@@ -76,5 +76,4 @@ export type ClipboardAttrs = {
|
|
|
76
76
|
export declare const getClipboardAttrs: ({ id, alt, collection, contextIdentifierProvider, originalDimensions, fileState, }: ClipboardAttrs) => {
|
|
77
77
|
[key: string]: string | number | undefined;
|
|
78
78
|
};
|
|
79
|
-
export declare const MediaCardInternal: (props: MediaCardProps) => JSX.Element;
|
|
80
79
|
export declare const MediaCard: React.ComponentClass<MediaCardProps & import("@atlaskit/editor-common/utils").ImageLoaderProps, any>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
1
|
import { jsx } from '@emotion/react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
4
3
|
import type { RendererProps } from '../renderer-props';
|
|
5
4
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
6
5
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "108.
|
|
3
|
+
"version": "108.20.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
31
31
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
32
32
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
33
|
-
"@atlaskit/button": "^16.
|
|
33
|
+
"@atlaskit/button": "^16.18.0",
|
|
34
34
|
"@atlaskit/code": "^15.1.0",
|
|
35
35
|
"@atlaskit/editor-common": "^76.25.0",
|
|
36
36
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|