@atlaskit/renderer 108.17.3 → 108.18.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/marks/alignment.js +2 -3
- package/dist/cjs/react/marks/breakout.js +2 -3
- package/dist/cjs/react/marks/link.js +3 -4
- package/dist/cjs/react/nodes/blockCard.js +11 -13
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +2 -5
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockButtonContainer.js +4 -6
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +2 -3
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockCopyButton.js +8 -11
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockWrapButton.js +8 -11
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +7 -8
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +5 -6
- package/dist/cjs/react/nodes/embedCard.js +8 -9
- package/dist/cjs/react/nodes/heading-anchor.js +4 -5
- package/dist/cjs/react/nodes/layoutColumn.js +2 -3
- package/dist/cjs/react/nodes/media/index.js +8 -11
- package/dist/cjs/react/nodes/mediaInline.js +20 -47
- package/dist/cjs/react/nodes/mediaSingle/index.js +3 -6
- package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -1
- package/dist/cjs/react/nodes/panel.js +7 -9
- package/dist/cjs/react/nodes/table/sticky.js +6 -7
- package/dist/cjs/react/utils/EditorMediaClientProvider.js +40 -0
- package/dist/cjs/ui/Expand.js +16 -18
- package/dist/cjs/ui/MediaCard.js +71 -74
- package/dist/cjs/ui/Renderer/index.js +35 -28
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +2 -3
- package/dist/cjs/ui/SortingIcon.js +4 -5
- package/dist/cjs/ui/annotations/draft/component.js +8 -9
- package/dist/cjs/ui/annotations/element/mark.js +1 -2
- package/dist/es2019/react/marks/alignment.js +3 -4
- package/dist/es2019/react/marks/breakout.js +3 -4
- package/dist/es2019/react/marks/link.js +4 -5
- package/dist/es2019/react/nodes/blockCard.js +12 -13
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +2 -4
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockButtonContainer.js +5 -6
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +3 -4
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockCopyButton.js +5 -7
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockWrapButton.js +7 -9
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -9
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +4 -6
- package/dist/es2019/react/nodes/embedCard.js +9 -10
- package/dist/es2019/react/nodes/heading-anchor.js +5 -6
- package/dist/es2019/react/nodes/layoutColumn.js +3 -4
- package/dist/es2019/react/nodes/media/index.js +7 -13
- package/dist/es2019/react/nodes/mediaInline.js +12 -20
- package/dist/es2019/react/nodes/mediaSingle/index.js +3 -6
- package/dist/es2019/react/nodes/mediaSingle/styles.js +0 -1
- package/dist/es2019/react/nodes/panel.js +7 -8
- package/dist/es2019/react/nodes/table/sticky.js +7 -8
- package/dist/es2019/react/utils/EditorMediaClientProvider.js +27 -0
- package/dist/es2019/ui/Expand.js +16 -17
- package/dist/es2019/ui/MediaCard.js +25 -29
- package/dist/es2019/ui/Renderer/index.js +36 -31
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +3 -4
- package/dist/es2019/ui/SortingIcon.js +5 -6
- package/dist/es2019/ui/annotations/draft/component.js +9 -10
- package/dist/es2019/ui/annotations/element/mark.js +2 -3
- package/dist/esm/react/marks/alignment.js +3 -4
- package/dist/esm/react/marks/breakout.js +3 -4
- package/dist/esm/react/marks/link.js +4 -5
- package/dist/esm/react/nodes/blockCard.js +12 -13
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +2 -4
- package/dist/esm/react/nodes/codeBlock/components/codeBlockButtonContainer.js +5 -6
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +3 -4
- package/dist/esm/react/nodes/codeBlock/components/codeBlockCopyButton.js +5 -7
- package/dist/esm/react/nodes/codeBlock/components/codeBlockWrapButton.js +7 -9
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -9
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +4 -6
- package/dist/esm/react/nodes/embedCard.js +9 -10
- package/dist/esm/react/nodes/heading-anchor.js +5 -6
- package/dist/esm/react/nodes/layoutColumn.js +3 -4
- package/dist/esm/react/nodes/media/index.js +8 -14
- package/dist/esm/react/nodes/mediaInline.js +21 -48
- package/dist/esm/react/nodes/mediaSingle/index.js +3 -6
- package/dist/esm/react/nodes/mediaSingle/styles.js +0 -1
- package/dist/esm/react/nodes/panel.js +7 -8
- package/dist/esm/react/nodes/table/sticky.js +7 -8
- package/dist/esm/react/utils/EditorMediaClientProvider.js +30 -0
- package/dist/esm/ui/Expand.js +16 -17
- package/dist/esm/ui/MediaCard.js +71 -74
- package/dist/esm/ui/Renderer/index.js +36 -31
- package/dist/esm/ui/Renderer/truncated-wrapper.js +3 -4
- package/dist/esm/ui/SortingIcon.js +5 -6
- package/dist/esm/ui/annotations/draft/component.js +9 -10
- package/dist/esm/ui/annotations/element/mark.js +2 -3
- package/dist/types/react/nodes/media/index.d.ts +2 -3
- package/dist/types/react/nodes/mediaInline.d.ts +2 -1
- 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 -1
- 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 +3 -3
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";
|
|
@@ -14,7 +15,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
14
15
|
import React, { Component } 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
|
-
var _this$
|
|
209
|
-
cardDimensions = _this$
|
|
210
|
-
resizeMode = _this$
|
|
211
|
-
appearance = _this$
|
|
212
|
-
url = _this$
|
|
213
|
-
imageStatus = _this$
|
|
214
|
-
disableOverlay = _this$
|
|
215
|
-
alt = _this$
|
|
216
|
-
featureFlags = _this$
|
|
217
|
-
ssr = _this$
|
|
218
|
-
rendererAppearance = _this$
|
|
197
|
+
var _this$props$mediaClie;
|
|
198
|
+
var _this$props4 = this.props,
|
|
199
|
+
cardDimensions = _this$props4.cardDimensions,
|
|
200
|
+
resizeMode = _this$props4.resizeMode,
|
|
201
|
+
appearance = _this$props4.appearance,
|
|
202
|
+
url = _this$props4.url,
|
|
203
|
+
imageStatus = _this$props4.imageStatus,
|
|
204
|
+
disableOverlay = _this$props4.disableOverlay,
|
|
205
|
+
alt = _this$props4.alt,
|
|
206
|
+
featureFlags = _this$props4.featureFlags,
|
|
207
|
+
ssr = _this$props4.ssr,
|
|
208
|
+
rendererAppearance = _this$props4.rendererAppearance;
|
|
219
209
|
if (imageStatus === 'loading' || !url) {
|
|
220
210
|
return this.renderLoadingCard();
|
|
221
211
|
}
|
|
@@ -224,6 +214,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
224
214
|
name: url,
|
|
225
215
|
mediaItemType: 'external-image'
|
|
226
216
|
};
|
|
217
|
+
var mediaClientConfig = (_this$props$mediaClie = this.props.mediaClient) === null || _this$props$mediaClie === void 0 ? void 0 : _this$props$mediaClie.mediaClientConfig;
|
|
227
218
|
return /*#__PURE__*/React.createElement(Card
|
|
228
219
|
// TODO MPT-315: clean up after we move mediaClientConfig into FileIdentifier
|
|
229
220
|
// context is not really used when the type is external and we want to render the component asap
|
|
@@ -245,26 +236,26 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
245
236
|
}, {
|
|
246
237
|
key: "render",
|
|
247
238
|
value: function render() {
|
|
239
|
+
var _this$props$mediaClie2;
|
|
248
240
|
var _this$state = this.state,
|
|
249
241
|
contextIdentifierProvider = _this$state.contextIdentifierProvider,
|
|
250
|
-
mediaClientConfigInState = _this$state.mediaClientConfig,
|
|
251
242
|
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$
|
|
243
|
+
var _this$props5 = this.props,
|
|
244
|
+
id = _this$props5.id,
|
|
245
|
+
alt = _this$props5.alt,
|
|
246
|
+
type = _this$props5.type,
|
|
247
|
+
collection = _this$props5.collection,
|
|
248
|
+
occurrenceKey = _this$props5.occurrenceKey,
|
|
249
|
+
cardDimensions = _this$props5.cardDimensions,
|
|
250
|
+
resizeMode = _this$props5.resizeMode,
|
|
251
|
+
rendererAppearance = _this$props5.rendererAppearance,
|
|
252
|
+
disableOverlay = _this$props5.disableOverlay,
|
|
253
|
+
useInlinePlayer = _this$props5.useInlinePlayer,
|
|
254
|
+
originalDimensions = _this$props5.originalDimensions,
|
|
255
|
+
forceOpenMediaViewer = _this$props5.shouldOpenMediaViewer,
|
|
256
|
+
featureFlags = _this$props5.featureFlags,
|
|
257
|
+
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
|
|
258
|
+
ssr = _this$props5.ssr;
|
|
268
259
|
var isMobile = rendererAppearance === 'mobile';
|
|
269
260
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
270
261
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -276,7 +267,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
276
267
|
if (type === 'link') {
|
|
277
268
|
return null;
|
|
278
269
|
}
|
|
279
|
-
var mediaClientConfig = !!ssr ? ssr.config :
|
|
270
|
+
var mediaClientConfig = !!ssr ? ssr.config : (_this$props$mediaClie2 = this.props.mediaClient) === null || _this$props$mediaClie2 === void 0 ? void 0 : _this$props$mediaClie2.mediaClientConfig;
|
|
280
271
|
if (!mediaClientConfig || !id) {
|
|
281
272
|
return this.renderLoadingCard();
|
|
282
273
|
}
|
|
@@ -320,7 +311,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
320
311
|
}));
|
|
321
312
|
}
|
|
322
313
|
}]);
|
|
323
|
-
return
|
|
314
|
+
return MediaCardView;
|
|
324
315
|
}(Component);
|
|
325
316
|
// Needed for copy & paste
|
|
326
317
|
export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
@@ -355,4 +346,10 @@ export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
|
355
346
|
'data-alt': alt
|
|
356
347
|
};
|
|
357
348
|
};
|
|
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
|
+
};
|
|
358
355
|
export var MediaCard = withImageLoader(MediaCardInternal);
|
|
@@ -10,13 +10,10 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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
|
-
|
|
14
|
-
import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
|
|
15
|
-
import { jsx } from '@emotion/react';
|
|
16
|
-
import { PureComponent } from 'react';
|
|
13
|
+
import React, { Fragment, useContext, useLayoutEffect, useRef, PureComponent } from 'react';
|
|
17
14
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
|
|
18
15
|
import { reduce } from '@atlaskit/adf-utils/traverse';
|
|
19
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
16
|
+
import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
|
|
20
17
|
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
21
18
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI, getDistortedDurationMonitor, browser } from '@atlaskit/editor-common/utils';
|
|
22
19
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
@@ -42,10 +39,11 @@ import { RendererContextProvider } from '../../renderer-context';
|
|
|
42
39
|
import memoizeOne from 'memoize-one';
|
|
43
40
|
import { ErrorBoundary } from './ErrorBoundary';
|
|
44
41
|
import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
42
|
+
import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientProvider';
|
|
45
43
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
44
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
45
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "108.
|
|
46
|
+
var packageVersion = "108.18.0";
|
|
49
47
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
48
|
_inherits(Renderer, _PureComponent);
|
|
51
49
|
var _super = _createSuper(Renderer);
|
|
@@ -292,7 +290,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
292
290
|
allowColumnSorting = _this$props.allowColumnSorting,
|
|
293
291
|
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
294
292
|
allowWrapCodeBlock = _this$props.allowWrapCodeBlock,
|
|
295
|
-
allowCustomPanels = _this$props.allowCustomPanels
|
|
293
|
+
allowCustomPanels = _this$props.allowCustomPanels,
|
|
294
|
+
media = _this$props.media;
|
|
296
295
|
var featureFlags = this.featureFlags(this.props.featureFlags);
|
|
297
296
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
298
297
|
/**
|
|
@@ -350,17 +349,19 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
350
349
|
if (onComplete) {
|
|
351
350
|
onComplete(stat);
|
|
352
351
|
}
|
|
353
|
-
var rendererOutput =
|
|
352
|
+
var rendererOutput = /*#__PURE__*/React.createElement(RendererContextProvider, {
|
|
354
353
|
value: this.featureFlags(this.props.featureFlags)
|
|
355
|
-
},
|
|
354
|
+
}, /*#__PURE__*/React.createElement(ActiveHeaderIdProvider, {
|
|
356
355
|
value: getActiveHeadingId(allowHeadingAnchorLinks)
|
|
357
|
-
},
|
|
356
|
+
}, /*#__PURE__*/React.createElement(AnalyticsContext.Provider, {
|
|
358
357
|
value: {
|
|
359
358
|
fireAnalyticsEvent: function fireAnalyticsEvent(event) {
|
|
360
359
|
return _this3.fireAnalyticsEvent(event);
|
|
361
360
|
}
|
|
362
361
|
}
|
|
363
|
-
},
|
|
362
|
+
}, /*#__PURE__*/React.createElement(SmartCardStorageProvider, null, /*#__PURE__*/React.createElement(ProviderFactoryProvider, {
|
|
363
|
+
value: this.providerFactory
|
|
364
|
+
}, /*#__PURE__*/React.createElement(RendererWrapper, {
|
|
364
365
|
appearance: appearance,
|
|
365
366
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
366
367
|
allowColumnSorting: allowColumnSorting,
|
|
@@ -372,31 +373,32 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
372
373
|
addTelepointer: this.props.addTelepointer,
|
|
373
374
|
innerRef: this.editorRef,
|
|
374
375
|
onClick: handleWrapperOnClick,
|
|
375
|
-
onMouseDown: this.onMouseDownEditView
|
|
376
|
-
|
|
376
|
+
onMouseDown: this.onMouseDownEditView,
|
|
377
|
+
ssr: media === null || media === void 0 ? void 0 : media.ssr
|
|
378
|
+
}, enableSsrInlineScripts ? /*#__PURE__*/React.createElement(BreakoutSSRInlineScript, null) : null, /*#__PURE__*/React.createElement(RendererActionsInternalUpdater, {
|
|
377
379
|
doc: pmDoc,
|
|
378
380
|
schema: schema,
|
|
379
381
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
380
|
-
}, result))))));
|
|
381
|
-
var rendererResult = truncated ?
|
|
382
|
+
}, result)))))));
|
|
383
|
+
var rendererResult = truncated ? /*#__PURE__*/React.createElement(TruncatedWrapper, {
|
|
382
384
|
height: maxHeight,
|
|
383
385
|
fadeHeight: fadeOutHeight
|
|
384
386
|
}, rendererOutput) : rendererOutput;
|
|
385
387
|
var rendererRenderTracking = (_this$featureFlags2 = this.featureFlags(this.props.featureFlags)) === null || _this$featureFlags2 === void 0 || (_this$featureFlags2 = _this$featureFlags2.featureFlags) === null || _this$featureFlags2 === void 0 || (_this$featureFlags2 = _this$featureFlags2.rendererRenderTracking) === null || _this$featureFlags2 === void 0 ? void 0 : _this$featureFlags2[ACTION_SUBJECT.RENDERER];
|
|
386
|
-
var reRenderTracking = (rendererRenderTracking === null || rendererRenderTracking === void 0 ? void 0 : rendererRenderTracking.enabled) &&
|
|
388
|
+
var reRenderTracking = (rendererRenderTracking === null || rendererRenderTracking === void 0 ? void 0 : rendererRenderTracking.enabled) && /*#__PURE__*/React.createElement(RenderTracking, {
|
|
387
389
|
componentProps: this.props,
|
|
388
390
|
action: ACTION.RE_RENDERED,
|
|
389
391
|
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
390
392
|
handleAnalyticsEvent: this.fireAnalyticsEvent,
|
|
391
393
|
useShallow: rendererRenderTracking.useShallow
|
|
392
394
|
});
|
|
393
|
-
return
|
|
395
|
+
return /*#__PURE__*/React.createElement(Fragment, null, reRenderTracking, rendererResult);
|
|
394
396
|
} catch (e) {
|
|
395
397
|
var _featureFlags$feature2;
|
|
396
398
|
if (onError) {
|
|
397
399
|
onError(e);
|
|
398
400
|
}
|
|
399
|
-
return
|
|
401
|
+
return /*#__PURE__*/React.createElement(RendererWrapper, {
|
|
400
402
|
appearance: appearance,
|
|
401
403
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
402
404
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
@@ -406,7 +408,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
406
408
|
useBlockRenderForCodeBlock: (_featureFlags$feature2 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
|
|
407
409
|
addTelepointer: this.props.addTelepointer,
|
|
408
410
|
onClick: handleWrapperOnClick
|
|
409
|
-
},
|
|
411
|
+
}, /*#__PURE__*/React.createElement(UnsupportedBlock, null));
|
|
410
412
|
}
|
|
411
413
|
}
|
|
412
414
|
}, {
|
|
@@ -427,7 +429,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
427
429
|
return Renderer;
|
|
428
430
|
}(PureComponent);
|
|
429
431
|
var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
|
|
430
|
-
return
|
|
432
|
+
return /*#__PURE__*/React.createElement(FabricEditorAnalyticsContext, {
|
|
431
433
|
data: {
|
|
432
434
|
appearance: getAnalyticsAppearance(props.appearance),
|
|
433
435
|
packageName: packageName,
|
|
@@ -435,15 +437,15 @@ var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
|
|
|
435
437
|
componentName: 'renderer',
|
|
436
438
|
editorSessionId: uuid()
|
|
437
439
|
}
|
|
438
|
-
},
|
|
440
|
+
}, /*#__PURE__*/React.createElement(WithCreateAnalyticsEvent, {
|
|
439
441
|
render: function render(createAnalyticsEvent) {
|
|
440
442
|
// `IntlErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
|
|
441
|
-
return
|
|
443
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
442
444
|
component: ACTION_SUBJECT.RENDERER,
|
|
443
445
|
rethrowError: true,
|
|
444
446
|
fallbackComponent: null,
|
|
445
447
|
createAnalyticsEvent: createAnalyticsEvent
|
|
446
|
-
},
|
|
448
|
+
}, /*#__PURE__*/React.createElement(IntlErrorBoundary, null, /*#__PURE__*/React.createElement(Renderer, _extends({}, props, {
|
|
447
449
|
createAnalyticsEvent: createAnalyticsEvent
|
|
448
450
|
}))));
|
|
449
451
|
}
|
|
@@ -458,7 +460,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
458
460
|
onClick = props.onClick,
|
|
459
461
|
onMouseDown = props.onMouseDown,
|
|
460
462
|
useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock,
|
|
461
|
-
addTelepointer = props.addTelepointer
|
|
463
|
+
addTelepointer = props.addTelepointer,
|
|
464
|
+
ssr = props.ssr;
|
|
462
465
|
var createTelepointer = function createTelepointer() {
|
|
463
466
|
var telepointer = document.createElement('span');
|
|
464
467
|
telepointer.textContent = "\u200B";
|
|
@@ -510,12 +513,14 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
510
513
|
};
|
|
511
514
|
}
|
|
512
515
|
}, [innerRef, addTelepointer]);
|
|
513
|
-
return
|
|
516
|
+
return /*#__PURE__*/React.createElement(WidthProvider, {
|
|
514
517
|
className: "ak-renderer-wrapper is-".concat(appearance),
|
|
515
518
|
"data-appearance": appearance
|
|
516
|
-
},
|
|
519
|
+
}, /*#__PURE__*/React.createElement(BaseTheme, {
|
|
517
520
|
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
518
|
-
},
|
|
521
|
+
}, /*#__PURE__*/React.createElement(EditorMediaClientProvider, {
|
|
522
|
+
ssr: ssr
|
|
523
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
519
524
|
ref: innerRef,
|
|
520
525
|
onClick: onClick,
|
|
521
526
|
onMouseDown: onMouseDown,
|
|
@@ -525,7 +530,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
525
530
|
allowColumnSorting: !!allowColumnSorting,
|
|
526
531
|
useBlockRenderForCodeBlock: useBlockRenderForCodeBlock
|
|
527
532
|
})
|
|
528
|
-
}, children)));
|
|
533
|
+
}, children))));
|
|
529
534
|
});
|
|
530
535
|
function RendererActionsInternalUpdater(_ref) {
|
|
531
536
|
var children = _ref.children,
|
|
@@ -552,15 +557,15 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
|
|
|
552
557
|
var localRef = React.useRef(null);
|
|
553
558
|
var innerRef = props.innerRef || localRef;
|
|
554
559
|
if (!allowAnnotations) {
|
|
555
|
-
return
|
|
560
|
+
return /*#__PURE__*/React.createElement(RendererWithAnalytics, _extends({
|
|
556
561
|
innerRef: innerRef
|
|
557
562
|
}, props));
|
|
558
563
|
}
|
|
559
|
-
return
|
|
564
|
+
return /*#__PURE__*/React.createElement(RendererActionsContext, null, /*#__PURE__*/React.createElement(AnnotationsWrapper, {
|
|
560
565
|
rendererRef: innerRef,
|
|
561
566
|
adfDocument: adfDocument,
|
|
562
567
|
annotationProvider: props.annotationProvider
|
|
563
|
-
},
|
|
568
|
+
}, /*#__PURE__*/React.createElement(RendererWithAnalytics, _extends({
|
|
564
569
|
innerRef: innerRef
|
|
565
570
|
}, props, {
|
|
566
571
|
featureFlags: props.featureFlags
|
|
@@ -7,8 +7,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
7
7
|
var _templateObject;
|
|
8
8
|
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); }; }
|
|
9
9
|
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; } }
|
|
10
|
-
|
|
11
|
-
import { css, jsx } from '@emotion/react';
|
|
10
|
+
import { css } from '@emotion/react';
|
|
12
11
|
import { Component } from 'react';
|
|
13
12
|
var fadeOutStyles = function fadeOutStyles(maxHeight, top, backgroundColor) {
|
|
14
13
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n background-image: linear-gradient(\n ", ",\n ", "\n );\n }\n"])), maxHeight, top, "var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0))", backgroundColor);
|
|
@@ -20,7 +19,7 @@ var FadeOut = function FadeOut(props) {
|
|
|
20
19
|
height = props.height;
|
|
21
20
|
var top = height - fadeHeight;
|
|
22
21
|
var styles = fadeOutStyles(height, top, backgroundColor);
|
|
23
|
-
return
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
24
23
|
css: styles
|
|
25
24
|
}, children);
|
|
26
25
|
};
|
|
@@ -44,7 +43,7 @@ export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
44
43
|
_this$props$backgroun = _this$props.backgroundColor,
|
|
45
44
|
backgroundColor = _this$props$backgroun === void 0 ? "var(--ds-surface, white)" : _this$props$backgroun,
|
|
46
45
|
children = _this$props.children;
|
|
47
|
-
return
|
|
46
|
+
return /*#__PURE__*/React.createElement(FadeOut, {
|
|
48
47
|
height: height,
|
|
49
48
|
fadeHeight: fadeHeight,
|
|
50
49
|
backgroundColor: backgroundColor
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
-
|
|
4
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
5
4
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
5
|
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
7
6
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
@@ -93,11 +92,11 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
93
92
|
onKeyDown(event);
|
|
94
93
|
}
|
|
95
94
|
};
|
|
96
|
-
return
|
|
95
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
97
96
|
delay: 0,
|
|
98
97
|
content: content,
|
|
99
98
|
position: "top"
|
|
100
|
-
},
|
|
99
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
101
100
|
css: buttonStyles,
|
|
102
101
|
className: buttonClassName,
|
|
103
102
|
role: "button",
|
|
@@ -106,10 +105,10 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
106
105
|
"aria-disabled": !isSortingAllowed,
|
|
107
106
|
onClick: handleClick,
|
|
108
107
|
onKeyDown: handleKeyDown
|
|
109
|
-
},
|
|
108
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
110
109
|
css: iconWrapperStyles,
|
|
111
110
|
className: getIconClassName(isSortingAllowed, sortOrdered)
|
|
112
|
-
},
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
113
112
|
css: iconStyles
|
|
114
113
|
}))));
|
|
115
114
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _templateObject;
|
|
4
|
-
/** @jsx jsx */
|
|
5
4
|
import React, { Fragment } from 'react';
|
|
6
|
-
import { css
|
|
5
|
+
import { css } from '@emotion/react';
|
|
7
6
|
import { InsertDraftPosition } from '../types';
|
|
8
7
|
import { AnnotationsDraftContext } from '../context';
|
|
9
8
|
import { splitText, calcTextSplitOffset, findTextString } from './text';
|
|
@@ -16,7 +15,7 @@ var markStyles = function markStyles(props) {
|
|
|
16
15
|
export var AnnotationDraft = function AnnotationDraft(_ref) {
|
|
17
16
|
var draftPosition = _ref.draftPosition,
|
|
18
17
|
children = _ref.children;
|
|
19
|
-
return
|
|
18
|
+
return /*#__PURE__*/React.createElement("mark", _extends({
|
|
20
19
|
"data-renderer-mark": true
|
|
21
20
|
}, dataAttributes(draftPosition), {
|
|
22
21
|
css: markStyles
|
|
@@ -41,12 +40,12 @@ export var applyAnnotationOnText = function applyAnnotationOnText(_ref2) {
|
|
|
41
40
|
var annotateIndex = getAnnotationIndex(shouldApplyAnnotationAt, texts.length);
|
|
42
41
|
return texts.map(function (value, index) {
|
|
43
42
|
if (annotateIndex === index) {
|
|
44
|
-
return
|
|
43
|
+
return /*#__PURE__*/React.createElement(AnnotationDraft, {
|
|
45
44
|
key: index,
|
|
46
45
|
draftPosition: draftPosition
|
|
47
46
|
}, value);
|
|
48
47
|
}
|
|
49
|
-
return
|
|
48
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
50
49
|
key: index
|
|
51
50
|
}, value);
|
|
52
51
|
});
|
|
@@ -69,27 +68,27 @@ export var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
|
69
68
|
return calcInsertDraftPositionOnText(textPosition, nextDraftPosition);
|
|
70
69
|
}, [nextDraftPosition, textPosition]);
|
|
71
70
|
if (shouldApplyAnnotationAt === false || !nextDraftPosition) {
|
|
72
|
-
return
|
|
71
|
+
return /*#__PURE__*/React.createElement(Fragment, null, children);
|
|
73
72
|
}
|
|
74
73
|
if (shouldApplyAnnotationAt === InsertDraftPosition.AROUND_TEXT) {
|
|
75
|
-
return
|
|
74
|
+
return /*#__PURE__*/React.createElement(AnnotationDraft, {
|
|
76
75
|
key: 0,
|
|
77
76
|
draftPosition: nextDraftPosition
|
|
78
77
|
}, children);
|
|
79
78
|
}
|
|
80
79
|
var textString = findTextString(children);
|
|
81
80
|
if (!textString) {
|
|
82
|
-
return
|
|
81
|
+
return /*#__PURE__*/React.createElement(Fragment, null, children);
|
|
83
82
|
}
|
|
84
83
|
var offsets = calcTextSplitOffset(nextDraftPosition, textPosition, textString);
|
|
85
84
|
var texts = splitText(textString, offsets);
|
|
86
85
|
if (!texts) {
|
|
87
|
-
return
|
|
86
|
+
return /*#__PURE__*/React.createElement(Fragment, null, children);
|
|
88
87
|
}
|
|
89
88
|
var components = applyAnnotationOnText({
|
|
90
89
|
texts: texts,
|
|
91
90
|
shouldApplyAnnotationAt: shouldApplyAnnotationAt,
|
|
92
91
|
draftPosition: nextDraftPosition
|
|
93
92
|
});
|
|
94
|
-
return
|
|
93
|
+
return /*#__PURE__*/React.createElement(Fragment, null, components);
|
|
95
94
|
};
|
|
@@ -5,9 +5,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
5
5
|
var _templateObject;
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
/** @jsx jsx */
|
|
9
8
|
import React, { useMemo, useCallback } from 'react';
|
|
10
|
-
import { css
|
|
9
|
+
import { css } from '@emotion/react';
|
|
11
10
|
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
12
11
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
13
12
|
var markStyles = function markStyles(props) {
|
|
@@ -50,7 +49,7 @@ export var MarkComponent = function MarkComponent(_ref) {
|
|
|
50
49
|
} : {
|
|
51
50
|
'aria-details': annotationIds.join(', ')
|
|
52
51
|
};
|
|
53
|
-
return
|
|
52
|
+
return /*#__PURE__*/React.createElement("mark", _extends({
|
|
54
53
|
id: id,
|
|
55
54
|
onClick: onMarkClick
|
|
56
55
|
}, accessibility, overriddenData, {
|
|
@@ -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,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { FC } from 'react';
|
|
2
3
|
import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
4
|
import type { FileIdentifier } from '@atlaskit/media-client';
|
|
4
5
|
import type { MediaProvider, ClipboardAttrs } from '../../ui/MediaCard';
|
|
@@ -31,7 +32,7 @@ export type MediaInlineProps = {
|
|
|
31
32
|
rendererAppearance?: RendererAppearance;
|
|
32
33
|
featureFlags?: MediaFeatureFlags;
|
|
33
34
|
};
|
|
34
|
-
export declare const RenderMediaInline:
|
|
35
|
+
export declare const RenderMediaInline: FC<RenderMediaInlineProps>;
|
|
35
36
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl">>> & {
|
|
36
37
|
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps<"intl">>;
|
|
37
38
|
};
|