@atlaskit/renderer 108.20.9 → 108.21.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/CHANGELOG.md +12 -0
- package/dist/cjs/react/index.js +4 -1
- package/dist/cjs/react/nodes/media/index.js +1 -3
- package/dist/cjs/react/nodes/mediaInline.js +21 -47
- package/dist/cjs/react/utils/EditorMediaClientProvider.js +48 -0
- package/dist/cjs/ui/MediaCard.js +73 -74
- package/dist/cjs/ui/Renderer/index.js +15 -7
- package/dist/es2019/react/index.js +3 -1
- package/dist/es2019/react/nodes/media/index.js +1 -4
- package/dist/es2019/react/nodes/mediaInline.js +13 -20
- package/dist/es2019/react/utils/EditorMediaClientProvider.js +33 -0
- package/dist/es2019/ui/MediaCard.js +30 -32
- package/dist/es2019/ui/Renderer/index.js +17 -10
- package/dist/esm/react/index.js +4 -1
- package/dist/esm/react/nodes/media/index.js +2 -5
- package/dist/esm/react/nodes/mediaInline.js +22 -48
- package/dist/esm/react/utils/EditorMediaClientProvider.js +38 -0
- package/dist/esm/ui/MediaCard.js +74 -75
- package/dist/esm/ui/Renderer/index.js +17 -10
- package/dist/types/react/nodes/media/index.d.ts +2 -3
- package/dist/types/react/nodes/mediaInline.d.ts +2 -2
- package/dist/types/react/utils/EditorMediaClientProvider.d.ts +5 -0
- package/dist/types/ui/MediaCard.d.ts +6 -5
- package/dist/types/ui/Renderer/index.d.ts +2 -1
- package/dist/types-ts4.5/react/nodes/media/index.d.ts +2 -3
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +2 -2
- package/dist/types-ts4.5/react/utils/EditorMediaClientProvider.d.ts +5 -0
- package/dist/types-ts4.5/ui/MediaCard.d.ts +6 -5
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +2 -1
- package/package.json +2 -2
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -11,10 +12,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
12
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
13
|
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); }; }
|
|
13
14
|
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; } }
|
|
14
|
-
import React, { Component } from 'react';
|
|
15
|
+
import React, { Component, useContext } from 'react';
|
|
15
16
|
import { filter } from '@atlaskit/adf-utils/traverse';
|
|
16
17
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
17
|
-
import {
|
|
18
|
+
import { MediaClientContext } from '@atlaskit/media-client-react';
|
|
18
19
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
19
20
|
export var mediaIdentifierMap = new Map();
|
|
20
21
|
export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
|
|
@@ -45,29 +46,32 @@ export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(do
|
|
|
45
46
|
return identifierList;
|
|
46
47
|
}, []);
|
|
47
48
|
};
|
|
48
|
-
export var
|
|
49
|
-
_inherits(
|
|
50
|
-
var _super = _createSuper(
|
|
51
|
-
function
|
|
49
|
+
export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
50
|
+
_inherits(MediaCardView, _Component);
|
|
51
|
+
var _super = _createSuper(MediaCardView);
|
|
52
|
+
function MediaCardView() {
|
|
52
53
|
var _this;
|
|
53
|
-
_classCallCheck(this,
|
|
54
|
+
_classCallCheck(this, MediaCardView);
|
|
54
55
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
55
56
|
args[_key] = arguments[_key];
|
|
56
57
|
}
|
|
57
58
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
58
59
|
_defineProperty(_assertThisInitialized(_this), "state", {});
|
|
59
60
|
_defineProperty(_assertThisInitialized(_this), "saveFileState", /*#__PURE__*/function () {
|
|
60
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id
|
|
61
|
-
var collectionName, mediaClient, options, fileState;
|
|
61
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
|
62
|
+
var _this$props, collectionName, mediaClient, options, fileState;
|
|
62
63
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
63
64
|
while (1) switch (_context.prev = _context.next) {
|
|
64
65
|
case 0:
|
|
65
|
-
collectionName = _this.props.
|
|
66
|
-
mediaClient = getMediaClient(mediaClientConfig);
|
|
66
|
+
_this$props = _this.props, collectionName = _this$props.collection, mediaClient = _this$props.mediaClient;
|
|
67
67
|
options = {
|
|
68
68
|
collectionName: collectionName
|
|
69
69
|
};
|
|
70
|
-
_context.prev =
|
|
70
|
+
_context.prev = 2;
|
|
71
|
+
if (!mediaClient) {
|
|
72
|
+
_context.next = 8;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
71
75
|
_context.next = 6;
|
|
72
76
|
return mediaClient.file.getCurrentState(id, options);
|
|
73
77
|
case 6:
|
|
@@ -75,18 +79,19 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
75
79
|
_this.setState({
|
|
76
80
|
fileState: fileState
|
|
77
81
|
});
|
|
82
|
+
case 8:
|
|
78
83
|
_context.next = 12;
|
|
79
84
|
break;
|
|
80
85
|
case 10:
|
|
81
86
|
_context.prev = 10;
|
|
82
|
-
_context.t0 = _context["catch"](
|
|
87
|
+
_context.t0 = _context["catch"](2);
|
|
83
88
|
case 12:
|
|
84
89
|
case "end":
|
|
85
90
|
return _context.stop();
|
|
86
91
|
}
|
|
87
|
-
}, _callee, null, [[
|
|
92
|
+
}, _callee, null, [[2, 10]]);
|
|
88
93
|
}));
|
|
89
|
-
return function (_x
|
|
94
|
+
return function (_x) {
|
|
90
95
|
return _ref.apply(this, arguments);
|
|
91
96
|
};
|
|
92
97
|
}());
|
|
@@ -117,40 +122,29 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
117
122
|
});
|
|
118
123
|
return _this;
|
|
119
124
|
}
|
|
120
|
-
_createClass(
|
|
125
|
+
_createClass(MediaCardView, [{
|
|
121
126
|
key: "componentDidMount",
|
|
122
127
|
value: function () {
|
|
123
128
|
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
124
|
-
var _this$
|
|
129
|
+
var _this$props2, rendererContext, contextIdentifierProvider, id, url, collectionName, nodeIsInCache;
|
|
125
130
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
126
131
|
while (1) switch (_context2.prev = _context2.next) {
|
|
127
132
|
case 0:
|
|
128
|
-
_this$
|
|
129
|
-
if (mediaProvider) {
|
|
130
|
-
_context2.next = 3;
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
return _context2.abrupt("return");
|
|
134
|
-
case 3:
|
|
133
|
+
_this$props2 = this.props, rendererContext = _this$props2.rendererContext, contextIdentifierProvider = _this$props2.contextIdentifierProvider, id = _this$props2.id, url = _this$props2.url, collectionName = _this$props2.collection;
|
|
135
134
|
if (!contextIdentifierProvider) {
|
|
136
|
-
_context2.next =
|
|
135
|
+
_context2.next = 8;
|
|
137
136
|
break;
|
|
138
137
|
}
|
|
139
138
|
_context2.t0 = this;
|
|
140
|
-
_context2.next =
|
|
139
|
+
_context2.next = 5;
|
|
141
140
|
return contextIdentifierProvider;
|
|
142
|
-
case
|
|
141
|
+
case 5:
|
|
143
142
|
_context2.t1 = _context2.sent;
|
|
144
143
|
_context2.t2 = {
|
|
145
144
|
contextIdentifierProvider: _context2.t1
|
|
146
145
|
};
|
|
147
146
|
_context2.t0.setState.call(_context2.t0, _context2.t2);
|
|
148
|
-
case
|
|
149
|
-
_context2.next = 12;
|
|
150
|
-
return mediaProvider;
|
|
151
|
-
case 12:
|
|
152
|
-
mediaProviderObject = _context2.sent;
|
|
153
|
-
mediaClientConfig = mediaProviderObject.viewMediaClientConfig;
|
|
147
|
+
case 8:
|
|
154
148
|
nodeIsInCache = id && mediaIdentifierMap.has(id) || url && mediaIdentifierMap.has(url);
|
|
155
149
|
if (rendererContext && rendererContext.adDoc && !nodeIsInCache) {
|
|
156
150
|
getListOfIdentifiersFromDoc(rendererContext.adDoc).forEach(function (identifier) {
|
|
@@ -163,13 +157,10 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
163
157
|
}
|
|
164
158
|
});
|
|
165
159
|
}
|
|
166
|
-
this.setState({
|
|
167
|
-
mediaClientConfig: mediaClientConfig
|
|
168
|
-
});
|
|
169
160
|
if (id) {
|
|
170
|
-
this.saveFileState(id
|
|
161
|
+
this.saveFileState(id);
|
|
171
162
|
}
|
|
172
|
-
case
|
|
163
|
+
case 11:
|
|
173
164
|
case "end":
|
|
174
165
|
return _context2.stop();
|
|
175
166
|
}
|
|
@@ -183,18 +174,17 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
183
174
|
}, {
|
|
184
175
|
key: "UNSAFE_componentWillReceiveProps",
|
|
185
176
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
186
|
-
var mediaClientConfig = this.state.mediaClientConfig;
|
|
187
177
|
var newId = newProps.id;
|
|
188
|
-
if (
|
|
189
|
-
this.saveFileState(newId
|
|
178
|
+
if (newId && newId !== this.props.id) {
|
|
179
|
+
this.saveFileState(newId);
|
|
190
180
|
}
|
|
191
181
|
}
|
|
192
182
|
}, {
|
|
193
183
|
key: "componentWillUnmount",
|
|
194
184
|
value: function componentWillUnmount() {
|
|
195
|
-
var _this$
|
|
196
|
-
id = _this$
|
|
197
|
-
dataURI = _this$
|
|
185
|
+
var _this$props3 = this.props,
|
|
186
|
+
id = _this$props3.id,
|
|
187
|
+
dataURI = _this$props3.url;
|
|
198
188
|
if (id) {
|
|
199
189
|
mediaIdentifierMap.delete(id);
|
|
200
190
|
} else if (dataURI) {
|
|
@@ -204,18 +194,18 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
204
194
|
}, {
|
|
205
195
|
key: "renderExternal",
|
|
206
196
|
value: function renderExternal(shouldOpenMediaViewer) {
|
|
207
|
-
var
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
197
|
+
var _this$props4 = this.props,
|
|
198
|
+
cardDimensions = _this$props4.cardDimensions,
|
|
199
|
+
resizeMode = _this$props4.resizeMode,
|
|
200
|
+
appearance = _this$props4.appearance,
|
|
201
|
+
url = _this$props4.url,
|
|
202
|
+
imageStatus = _this$props4.imageStatus,
|
|
203
|
+
disableOverlay = _this$props4.disableOverlay,
|
|
204
|
+
alt = _this$props4.alt,
|
|
205
|
+
featureFlags = _this$props4.featureFlags,
|
|
206
|
+
ssr = _this$props4.ssr,
|
|
207
|
+
rendererAppearance = _this$props4.rendererAppearance,
|
|
208
|
+
mediaClient = _this$props4.mediaClient;
|
|
219
209
|
if (imageStatus === 'loading' || !url) {
|
|
220
210
|
return this.renderLoadingCard();
|
|
221
211
|
}
|
|
@@ -224,6 +214,9 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
224
214
|
name: url,
|
|
225
215
|
mediaItemType: 'external-image'
|
|
226
216
|
};
|
|
217
|
+
|
|
218
|
+
// we need this statement for the mandatory mediaClientConfig below
|
|
219
|
+
var mediaClientConfig = mediaClient === null || mediaClient === void 0 ? void 0 : mediaClient.mediaClientConfig;
|
|
227
220
|
return /*#__PURE__*/React.createElement(Card
|
|
228
221
|
// TODO MPT-315: clean up after we move mediaClientConfig into FileIdentifier
|
|
229
222
|
// context is not really used when the type is external and we want to render the component asap
|
|
@@ -247,24 +240,24 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
247
240
|
value: function render() {
|
|
248
241
|
var _this$state = this.state,
|
|
249
242
|
contextIdentifierProvider = _this$state.contextIdentifierProvider,
|
|
250
|
-
mediaClientConfigInState = _this$state.mediaClientConfig,
|
|
251
243
|
fileState = _this$state.fileState;
|
|
252
|
-
var _this$
|
|
253
|
-
id = _this$
|
|
254
|
-
alt = _this$
|
|
255
|
-
type = _this$
|
|
256
|
-
collection = _this$
|
|
257
|
-
occurrenceKey = _this$
|
|
258
|
-
cardDimensions = _this$
|
|
259
|
-
resizeMode = _this$
|
|
260
|
-
rendererAppearance = _this$
|
|
261
|
-
disableOverlay = _this$
|
|
262
|
-
useInlinePlayer = _this$
|
|
263
|
-
originalDimensions = _this$
|
|
264
|
-
forceOpenMediaViewer = _this$
|
|
265
|
-
featureFlags = _this$
|
|
266
|
-
shouldEnableDownloadButton = _this$
|
|
267
|
-
ssr = _this$
|
|
244
|
+
var _this$props5 = this.props,
|
|
245
|
+
id = _this$props5.id,
|
|
246
|
+
alt = _this$props5.alt,
|
|
247
|
+
type = _this$props5.type,
|
|
248
|
+
collection = _this$props5.collection,
|
|
249
|
+
occurrenceKey = _this$props5.occurrenceKey,
|
|
250
|
+
cardDimensions = _this$props5.cardDimensions,
|
|
251
|
+
resizeMode = _this$props5.resizeMode,
|
|
252
|
+
rendererAppearance = _this$props5.rendererAppearance,
|
|
253
|
+
disableOverlay = _this$props5.disableOverlay,
|
|
254
|
+
useInlinePlayer = _this$props5.useInlinePlayer,
|
|
255
|
+
originalDimensions = _this$props5.originalDimensions,
|
|
256
|
+
forceOpenMediaViewer = _this$props5.shouldOpenMediaViewer,
|
|
257
|
+
featureFlags = _this$props5.featureFlags,
|
|
258
|
+
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
|
|
259
|
+
ssr = _this$props5.ssr,
|
|
260
|
+
mediaClient = _this$props5.mediaClient;
|
|
268
261
|
var isMobile = rendererAppearance === 'mobile';
|
|
269
262
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
270
263
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -276,7 +269,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
276
269
|
if (type === 'link') {
|
|
277
270
|
return null;
|
|
278
271
|
}
|
|
279
|
-
var mediaClientConfig = !!ssr ? ssr.config :
|
|
272
|
+
var mediaClientConfig = !!ssr ? ssr.config : mediaClient === null || mediaClient === void 0 ? void 0 : mediaClient.mediaClientConfig;
|
|
280
273
|
if (!mediaClientConfig || !id) {
|
|
281
274
|
return this.renderLoadingCard();
|
|
282
275
|
}
|
|
@@ -320,7 +313,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
320
313
|
}));
|
|
321
314
|
}
|
|
322
315
|
}]);
|
|
323
|
-
return
|
|
316
|
+
return MediaCardView;
|
|
324
317
|
}(Component);
|
|
325
318
|
// Needed for copy & paste
|
|
326
319
|
export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
@@ -355,4 +348,10 @@ export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
|
355
348
|
'data-alt': alt
|
|
356
349
|
};
|
|
357
350
|
};
|
|
351
|
+
export var MediaCardInternal = function MediaCardInternal(props) {
|
|
352
|
+
var mediaClient = useContext(MediaClientContext);
|
|
353
|
+
return /*#__PURE__*/React.createElement(MediaCardView, _extends({}, props, {
|
|
354
|
+
mediaClient: mediaClient
|
|
355
|
+
}));
|
|
356
|
+
};
|
|
358
357
|
export var MediaCard = withImageLoader(MediaCardInternal);
|
|
@@ -11,12 +11,11 @@ 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 } from 'react';
|
|
14
|
+
import React, { Fragment, useContext, useLayoutEffect, useRef, PureComponent } from 'react';
|
|
15
15
|
import { jsx } from '@emotion/react';
|
|
16
|
-
import { PureComponent } from 'react';
|
|
17
16
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
|
|
18
17
|
import { reduce } from '@atlaskit/adf-utils/traverse';
|
|
19
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
18
|
+
import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
|
|
20
19
|
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
21
20
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI, getDistortedDurationMonitor, browser } from '@atlaskit/editor-common/utils';
|
|
22
21
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
@@ -42,10 +41,11 @@ import { RendererContextProvider } from '../../renderer-context';
|
|
|
42
41
|
import memoizeOne from 'memoize-one';
|
|
43
42
|
import { ErrorBoundary } from './ErrorBoundary';
|
|
44
43
|
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.21.0";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -292,7 +292,8 @@ 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
|
|
295
|
+
allowCustomPanels = _this$props.allowCustomPanels,
|
|
296
|
+
media = _this$props.media;
|
|
296
297
|
var featureFlags = this.featureFlags(this.props.featureFlags);
|
|
297
298
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
298
299
|
/**
|
|
@@ -360,7 +361,9 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
360
361
|
return _this3.fireAnalyticsEvent(event);
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
|
-
}, jsx(SmartCardStorageProvider, null, jsx(
|
|
364
|
+
}, jsx(SmartCardStorageProvider, null, jsx(ProviderFactoryProvider, {
|
|
365
|
+
value: this.providerFactory
|
|
366
|
+
}, jsx(RendererWrapper, {
|
|
364
367
|
appearance: appearance,
|
|
365
368
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
366
369
|
allowColumnSorting: allowColumnSorting,
|
|
@@ -372,12 +375,13 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
372
375
|
addTelepointer: this.props.addTelepointer,
|
|
373
376
|
innerRef: this.editorRef,
|
|
374
377
|
onClick: handleWrapperOnClick,
|
|
375
|
-
onMouseDown: this.onMouseDownEditView
|
|
378
|
+
onMouseDown: this.onMouseDownEditView,
|
|
379
|
+
ssr: media === null || media === void 0 ? void 0 : media.ssr
|
|
376
380
|
}, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, null) : null, jsx(RendererActionsInternalUpdater, {
|
|
377
381
|
doc: pmDoc,
|
|
378
382
|
schema: schema,
|
|
379
383
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
380
|
-
}, result))))));
|
|
384
|
+
}, result)))))));
|
|
381
385
|
var rendererResult = truncated ? jsx(TruncatedWrapper, {
|
|
382
386
|
height: maxHeight,
|
|
383
387
|
fadeHeight: fadeOutHeight
|
|
@@ -458,7 +462,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
458
462
|
onClick = props.onClick,
|
|
459
463
|
onMouseDown = props.onMouseDown,
|
|
460
464
|
useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock,
|
|
461
|
-
addTelepointer = props.addTelepointer
|
|
465
|
+
addTelepointer = props.addTelepointer,
|
|
466
|
+
ssr = props.ssr;
|
|
462
467
|
var createTelepointer = function createTelepointer() {
|
|
463
468
|
var telepointer = document.createElement('span');
|
|
464
469
|
telepointer.textContent = "\u200B";
|
|
@@ -515,6 +520,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
515
520
|
"data-appearance": appearance
|
|
516
521
|
}, jsx(BaseTheme, {
|
|
517
522
|
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
523
|
+
}, jsx(EditorMediaClientProvider, {
|
|
524
|
+
ssr: ssr
|
|
518
525
|
}, jsx("div", {
|
|
519
526
|
ref: innerRef,
|
|
520
527
|
onClick: onClick,
|
|
@@ -525,7 +532,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
525
532
|
allowColumnSorting: !!allowColumnSorting,
|
|
526
533
|
useBlockRenderForCodeBlock: useBlockRenderForCodeBlock
|
|
527
534
|
})
|
|
528
|
-
}, children)));
|
|
535
|
+
}, children))));
|
|
529
536
|
});
|
|
530
537
|
function RendererActionsInternalUpdater(_ref) {
|
|
531
538
|
var children = _ref.children,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PureComponent } from 'react';
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
3
2
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
5
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
6
5
|
import type { MediaCardProps } from '../../../ui/MediaCard';
|
|
7
6
|
import type { LinkDefinition, BorderMarkDefinition } from '@atlaskit/adf-schema';
|
|
8
7
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { FileIdentifier } from '@atlaskit/media-client';
|
|
5
5
|
import type { MediaProvider, ClipboardAttrs } from '../../ui/MediaCard';
|
|
@@ -34,7 +34,7 @@ export type MediaInlineProps = {
|
|
|
34
34
|
featureFlags?: MediaFeatureFlags;
|
|
35
35
|
};
|
|
36
36
|
export declare const RenderMediaInline: FC<RenderMediaInlineProps & MediaInlineAttrs>;
|
|
37
|
-
declare const _default: FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>> & {
|
|
37
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>> & {
|
|
38
38
|
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>;
|
|
39
39
|
};
|
|
40
40
|
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 } from '@atlaskit/media-client';
|
|
5
|
+
import type { ImageResizeMode, Identifier, FileState, MediaClient } 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,7 +15,6 @@ export type MediaProvider = {
|
|
|
15
15
|
};
|
|
16
16
|
export interface MediaCardProps {
|
|
17
17
|
id?: string;
|
|
18
|
-
mediaProvider?: Promise<MediaProvider>;
|
|
19
18
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
20
19
|
eventHandlers?: {
|
|
21
20
|
media?: {
|
|
@@ -42,18 +41,19 @@ export interface MediaCardProps {
|
|
|
42
41
|
ssr?: MediaSSR;
|
|
43
42
|
}
|
|
44
43
|
export interface State {
|
|
45
|
-
mediaClientConfig?: MediaClientConfig;
|
|
46
44
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
47
45
|
fileState?: FileState;
|
|
48
46
|
}
|
|
49
47
|
export declare const mediaIdentifierMap: Map<string, Identifier>;
|
|
50
48
|
export declare const getListOfIdentifiersFromDoc: (doc?: ADFEntity) => Identifier[];
|
|
51
|
-
export declare class
|
|
49
|
+
export declare class MediaCardView extends Component<MediaCardProps & {
|
|
50
|
+
mediaClient?: MediaClient;
|
|
51
|
+
}, 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
|
|
56
|
+
saveFileState: (id: string) => Promise<void>;
|
|
57
57
|
private renderLoadingCard;
|
|
58
58
|
private renderExternal;
|
|
59
59
|
/**
|
|
@@ -76,4 +76,5 @@ 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;
|
|
79
80
|
export declare const MediaCard: React.ComponentClass<MediaCardProps & import("@atlaskit/editor-common/utils").ImageLoaderProps, any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
import type { RendererProps } from '../renderer-props';
|
|
4
5
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
5
6
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PureComponent } from 'react';
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
3
2
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
5
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
6
5
|
import type { MediaCardProps } from '../../../ui/MediaCard';
|
|
7
6
|
import type { LinkDefinition, BorderMarkDefinition } from '@atlaskit/adf-schema';
|
|
8
7
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { FileIdentifier } from '@atlaskit/media-client';
|
|
5
5
|
import type { MediaProvider, ClipboardAttrs } from '../../ui/MediaCard';
|
|
@@ -34,7 +34,7 @@ export type MediaInlineProps = {
|
|
|
34
34
|
featureFlags?: MediaFeatureFlags;
|
|
35
35
|
};
|
|
36
36
|
export declare const RenderMediaInline: FC<RenderMediaInlineProps & MediaInlineAttrs>;
|
|
37
|
-
declare const _default: FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>> & {
|
|
37
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>> & {
|
|
38
38
|
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>;
|
|
39
39
|
};
|
|
40
40
|
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 } from '@atlaskit/media-client';
|
|
5
|
+
import type { ImageResizeMode, Identifier, FileState, MediaClient } 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,7 +15,6 @@ export type MediaProvider = {
|
|
|
15
15
|
};
|
|
16
16
|
export interface MediaCardProps {
|
|
17
17
|
id?: string;
|
|
18
|
-
mediaProvider?: Promise<MediaProvider>;
|
|
19
18
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
20
19
|
eventHandlers?: {
|
|
21
20
|
media?: {
|
|
@@ -42,18 +41,19 @@ export interface MediaCardProps {
|
|
|
42
41
|
ssr?: MediaSSR;
|
|
43
42
|
}
|
|
44
43
|
export interface State {
|
|
45
|
-
mediaClientConfig?: MediaClientConfig;
|
|
46
44
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
47
45
|
fileState?: FileState;
|
|
48
46
|
}
|
|
49
47
|
export declare const mediaIdentifierMap: Map<string, Identifier>;
|
|
50
48
|
export declare const getListOfIdentifiersFromDoc: (doc?: ADFEntity) => Identifier[];
|
|
51
|
-
export declare class
|
|
49
|
+
export declare class MediaCardView extends Component<MediaCardProps & {
|
|
50
|
+
mediaClient?: MediaClient;
|
|
51
|
+
}, 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
|
|
56
|
+
saveFileState: (id: string) => Promise<void>;
|
|
57
57
|
private renderLoadingCard;
|
|
58
58
|
private renderExternal;
|
|
59
59
|
/**
|
|
@@ -76,4 +76,5 @@ 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;
|
|
79
80
|
export declare const MediaCard: React.ComponentClass<MediaCardProps & import("@atlaskit/editor-common/utils").ImageLoaderProps, any>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
import type { RendererProps } from '../renderer-props';
|
|
4
5
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
5
6
|
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.21.0",
|
|
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": "^
|
|
33
|
+
"@atlaskit/button": "^17.0.0",
|
|
34
34
|
"@atlaskit/code": "^15.1.0",
|
|
35
35
|
"@atlaskit/editor-common": "^76.26.0",
|
|
36
36
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|