@atlaskit/renderer 109.17.0 → 109.17.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 +6 -0
- package/dist/cjs/react/index.js +3 -1
- package/dist/cjs/react/nodes/media/index.js +42 -2
- package/dist/cjs/react/nodes/mediaSingle/index.js +48 -35
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/index.js +3 -1
- package/dist/es2019/react/nodes/media/index.js +35 -3
- package/dist/es2019/react/nodes/mediaSingle/index.js +47 -36
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/index.js +3 -1
- package/dist/esm/react/nodes/media/index.js +41 -2
- package/dist/esm/react/nodes/mediaSingle/index.js +50 -37
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/media/index.d.ts +6 -8
- package/dist/types-ts4.5/react/nodes/media/index.d.ts +6 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.17.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#89893](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89893) [`8103423f9266`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8103423f9266) - [ED-22909] Update media content wrap dom with annotation draft related data attributes so that create dialog can be correctly positioned next to media
|
|
8
|
+
|
|
3
9
|
## 109.17.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -421,7 +421,9 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
421
421
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
422
422
|
featureFlags: this.media && this.media.featureFlags,
|
|
423
423
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
424
|
-
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
|
|
424
|
+
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr,
|
|
425
|
+
// surroundTextNodesWithTextWrapper checks inlineComment.allowDraftMode
|
|
426
|
+
allowAnnotationsDraftMode: this.surroundTextNodesWithTextWrapper
|
|
425
427
|
});
|
|
426
428
|
}
|
|
427
429
|
}, {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
12
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -28,6 +29,7 @@ var _utils = require("../../../utils");
|
|
|
28
29
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
29
30
|
var _events = require("../../../analytics/events");
|
|
30
31
|
var _annotation = _interopRequireDefault(require("../../marks/annotation"));
|
|
32
|
+
var _context = require("../../../ui/annotations/context");
|
|
31
33
|
var _styles = require("./styles");
|
|
32
34
|
var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
33
35
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -37,6 +39,8 @@ var _excluded = ["marks"];
|
|
|
37
39
|
/** @jsx jsx */
|
|
38
40
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
39
41
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
42
|
+
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; }
|
|
43
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
40
44
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
41
45
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
42
46
|
var MediaBorder = function MediaBorder(_ref) {
|
|
@@ -141,7 +145,7 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
141
145
|
onClick: onClick
|
|
142
146
|
}, rest));
|
|
143
147
|
};
|
|
144
|
-
var Media =
|
|
148
|
+
var Media = /*#__PURE__*/function (_PureComponent) {
|
|
145
149
|
(0, _inherits2.default)(Media, _PureComponent);
|
|
146
150
|
var _super = _createSuper(Media);
|
|
147
151
|
function Media(props) {
|
|
@@ -237,4 +241,40 @@ var Media = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
237
241
|
}
|
|
238
242
|
}]);
|
|
239
243
|
return Media;
|
|
240
|
-
}(_react.PureComponent);
|
|
244
|
+
}(_react.PureComponent);
|
|
245
|
+
var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
246
|
+
var draftPosition = _react.default.useContext(_context.AnnotationsDraftContext);
|
|
247
|
+
var dataAttributes = props.dataAttributes;
|
|
248
|
+
var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
249
|
+
var _useState = (0, _react.useState)(),
|
|
250
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
251
|
+
position = _useState2[0],
|
|
252
|
+
setPosition = _useState2[1];
|
|
253
|
+
var _useState3 = (0, _react.useState)(false),
|
|
254
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
255
|
+
shouldApplyDraftAnnotation = _useState4[0],
|
|
256
|
+
setShouldApplyDraftAnnotation = _useState4[1];
|
|
257
|
+
(0, _react.useEffect)(function () {
|
|
258
|
+
if (pos === undefined) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (draftPosition !== null && draftPosition.from === pos) {
|
|
262
|
+
setShouldApplyDraftAnnotation(true);
|
|
263
|
+
setPosition(draftPosition === null || draftPosition === void 0 ? void 0 : draftPosition.from);
|
|
264
|
+
} else if (draftPosition === null && shouldApplyDraftAnnotation) {
|
|
265
|
+
setShouldApplyDraftAnnotation(false);
|
|
266
|
+
setPosition(undefined);
|
|
267
|
+
}
|
|
268
|
+
}, [draftPosition, pos, shouldApplyDraftAnnotation]);
|
|
269
|
+
var applyDraftAnnotation = props.allowAnnotationsDraftMode && shouldApplyDraftAnnotation && position !== undefined;
|
|
270
|
+
var dataAttributesWithDraftAnnotation = (0, _react.useMemo)(function () {
|
|
271
|
+
return applyDraftAnnotation ? _objectSpread(_objectSpread({}, dataAttributes), {}, {
|
|
272
|
+
'data-annotation-draft-mark': true,
|
|
273
|
+
'data-renderer-mark': true
|
|
274
|
+
}) : dataAttributes;
|
|
275
|
+
}, [applyDraftAnnotation, dataAttributes]);
|
|
276
|
+
return (0, _react2.jsx)(Media, (0, _extends2.default)({}, props, {
|
|
277
|
+
dataAttributes: dataAttributesWithDraftAnnotation
|
|
278
|
+
}));
|
|
279
|
+
};
|
|
280
|
+
var _default = exports.default = MediaWithDraftAnnotation;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.getMediaContainerWidth = exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _react2 = require("@emotion/react");
|
|
@@ -58,19 +59,20 @@ var getMediaContainerWidth = exports.getMediaContainerWidth = function getMediaC
|
|
|
58
59
|
}
|
|
59
60
|
return currentContainerWidth;
|
|
60
61
|
};
|
|
61
|
-
var
|
|
62
|
+
var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
|
|
62
63
|
var rendererAppearance = props.rendererAppearance,
|
|
63
64
|
featureFlags = props.featureFlags,
|
|
64
65
|
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
65
66
|
layout = props.layout,
|
|
66
|
-
children = props.children,
|
|
67
67
|
widthAttr = props.width,
|
|
68
68
|
widthType = props.widthType,
|
|
69
69
|
_props$allowCaptions = props.allowCaptions,
|
|
70
70
|
allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions,
|
|
71
71
|
_props$isInsideOfInli = props.isInsideOfInlineExtension,
|
|
72
72
|
isInsideOfInlineExtension = _props$isInsideOfInli === void 0 ? false : _props$isInsideOfInli,
|
|
73
|
-
dataAttributes = props.dataAttributes
|
|
73
|
+
dataAttributes = props.dataAttributes,
|
|
74
|
+
media = props.media,
|
|
75
|
+
caption = props.caption;
|
|
74
76
|
var _React$useState = _react.default.useState({
|
|
75
77
|
width: 0,
|
|
76
78
|
height: 0
|
|
@@ -87,20 +89,6 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
87
89
|
height: height
|
|
88
90
|
});
|
|
89
91
|
}, []);
|
|
90
|
-
var media;
|
|
91
|
-
var _React$Children$toArr3 = _react.default.Children.toArray(children),
|
|
92
|
-
_React$Children$toArr4 = (0, _slicedToArray2.default)(_React$Children$toArr3, 2),
|
|
93
|
-
node = _React$Children$toArr4[0],
|
|
94
|
-
caption = _React$Children$toArr4[1];
|
|
95
|
-
if (!isMediaElement(node)) {
|
|
96
|
-
var mediaElement = checkForMediaElement(node.props.children);
|
|
97
|
-
if (!mediaElement) {
|
|
98
|
-
return node;
|
|
99
|
-
}
|
|
100
|
-
media = mediaElement;
|
|
101
|
-
} else {
|
|
102
|
-
media = node;
|
|
103
|
-
}
|
|
104
92
|
var _media$props = media.props,
|
|
105
93
|
_media$props$width = _media$props.width,
|
|
106
94
|
width = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
@@ -126,7 +114,7 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
126
114
|
|
|
127
115
|
var padding = rendererAppearance === 'full-page' ? _style.FullPagePadding * 2 : 0;
|
|
128
116
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
129
|
-
var calcDimensions = function
|
|
117
|
+
var calcDimensions = (0, _react.useCallback)(function (mediaContainerWidth) {
|
|
130
118
|
var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
131
119
|
var maxWidth = containerWidth;
|
|
132
120
|
var maxHeight = height / width * maxWidth;
|
|
@@ -149,16 +137,26 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
149
137
|
cardDimensions: cardDimensions,
|
|
150
138
|
lineLength: lineLength
|
|
151
139
|
};
|
|
152
|
-
};
|
|
153
|
-
var originalDimensions = {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
140
|
+
}, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width]);
|
|
141
|
+
var originalDimensions = (0, _react.useMemo)(function () {
|
|
142
|
+
return {
|
|
143
|
+
width: width,
|
|
144
|
+
height: height
|
|
145
|
+
};
|
|
146
|
+
}, [height, width]);
|
|
147
|
+
|
|
148
|
+
// Note: in SSR mode the `window` object is not defined,
|
|
149
|
+
// therefore width here is 0, see:
|
|
150
|
+
// packages/editor/editor-common/src/ui/WidthProvider/index.tsx
|
|
151
|
+
var _useContext = (0, _react.useContext)(_ui.WidthContext),
|
|
152
|
+
renderWidth = _useContext.width;
|
|
153
|
+
var containerWidth = getMediaContainerWidth(renderWidth, layout);
|
|
154
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
155
|
+
return calcDimensions(containerWidth);
|
|
156
|
+
}, [calcDimensions, containerWidth]),
|
|
157
|
+
cardDimensions = _useMemo.cardDimensions,
|
|
158
|
+
lineLength = _useMemo.lineLength;
|
|
159
|
+
var renderMediaSingle = function renderMediaSingle() {
|
|
162
160
|
var mediaComponent = /*#__PURE__*/_react.default.cloneElement(media, {
|
|
163
161
|
resizeMode: 'stretchy-fit',
|
|
164
162
|
cardDimensions: cardDimensions,
|
|
@@ -186,12 +184,27 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
186
184
|
dataAttributes: dataAttributes
|
|
187
185
|
}, (0, _react2.jsx)(_react.Fragment, null, mediaComponent), allowCaptions && caption);
|
|
188
186
|
};
|
|
189
|
-
return (
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
187
|
+
return renderMediaSingle();
|
|
188
|
+
};
|
|
189
|
+
var MediaSingle = function MediaSingle(props) {
|
|
190
|
+
var children = props.children;
|
|
191
|
+
var media;
|
|
192
|
+
var _React$Children$toArr3 = _react.default.Children.toArray(children),
|
|
193
|
+
_React$Children$toArr4 = (0, _slicedToArray2.default)(_React$Children$toArr3, 2),
|
|
194
|
+
node = _React$Children$toArr4[0],
|
|
195
|
+
caption = _React$Children$toArr4[1];
|
|
196
|
+
if (!isMediaElement(node)) {
|
|
197
|
+
var mediaElement = checkForMediaElement(node.props.children);
|
|
198
|
+
if (!mediaElement) {
|
|
199
|
+
return node;
|
|
200
|
+
}
|
|
201
|
+
media = mediaElement;
|
|
202
|
+
} else {
|
|
203
|
+
media = node;
|
|
204
|
+
}
|
|
205
|
+
return (0, _react2.jsx)(MediaSingleWithChildren, (0, _extends2.default)({}, props, {
|
|
206
|
+
media: media,
|
|
207
|
+
caption: caption
|
|
208
|
+
}));
|
|
196
209
|
};
|
|
197
210
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(MediaSingle);
|
|
@@ -55,7 +55,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
55
55
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
56
56
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "109.17.
|
|
58
|
+
var packageVersion = "109.17.1";
|
|
59
59
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
60
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
61
61
|
var _super = _createSuper(Renderer);
|
|
@@ -369,7 +369,9 @@ export default class ReactSerializer {
|
|
|
369
369
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
370
370
|
featureFlags: this.media && this.media.featureFlags,
|
|
371
371
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
372
|
-
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
|
|
372
|
+
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr,
|
|
373
|
+
// surroundTextNodesWithTextWrapper checks inlineComment.allowDraftMode
|
|
374
|
+
allowAnnotationsDraftMode: this.surroundTextNodesWithTextWrapper
|
|
373
375
|
};
|
|
374
376
|
}
|
|
375
377
|
getEmojiProps(node) {
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
|
|
5
|
-
import React, { PureComponent, Fragment } from 'react';
|
|
5
|
+
import React, { PureComponent, Fragment, useEffect, useState, useMemo } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
8
8
|
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
@@ -15,6 +15,7 @@ import { getEventHandler } from '../../../utils';
|
|
|
15
15
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
16
16
|
import { MODE, PLATFORM } from '../../../analytics/events';
|
|
17
17
|
import AnnotationComponent from '../../marks/annotation';
|
|
18
|
+
import { AnnotationsDraftContext } from '../../../ui/annotations/context';
|
|
18
19
|
import { linkStyle, borderStyle } from './styles';
|
|
19
20
|
import { CommentBadge as CommentBadgeComponent } from '@atlaskit/editor-common/media-single';
|
|
20
21
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -124,7 +125,7 @@ const CommentBadgeWrapper = ({
|
|
|
124
125
|
onClick: onClick
|
|
125
126
|
}, rest));
|
|
126
127
|
};
|
|
127
|
-
|
|
128
|
+
class Media extends PureComponent {
|
|
128
129
|
constructor(props) {
|
|
129
130
|
super(props);
|
|
130
131
|
_defineProperty(this, "renderCard", (providers = {}) => {
|
|
@@ -218,4 +219,35 @@ export default class Media extends PureComponent {
|
|
|
218
219
|
renderNode: this.renderCard
|
|
219
220
|
});
|
|
220
221
|
}
|
|
221
|
-
}
|
|
222
|
+
}
|
|
223
|
+
const MediaWithDraftAnnotation = props => {
|
|
224
|
+
const draftPosition = React.useContext(AnnotationsDraftContext);
|
|
225
|
+
const {
|
|
226
|
+
dataAttributes
|
|
227
|
+
} = props;
|
|
228
|
+
const pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
229
|
+
const [position, setPosition] = useState();
|
|
230
|
+
const [shouldApplyDraftAnnotation, setShouldApplyDraftAnnotation] = useState(false);
|
|
231
|
+
useEffect(() => {
|
|
232
|
+
if (pos === undefined) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (draftPosition !== null && draftPosition.from === pos) {
|
|
236
|
+
setShouldApplyDraftAnnotation(true);
|
|
237
|
+
setPosition(draftPosition === null || draftPosition === void 0 ? void 0 : draftPosition.from);
|
|
238
|
+
} else if (draftPosition === null && shouldApplyDraftAnnotation) {
|
|
239
|
+
setShouldApplyDraftAnnotation(false);
|
|
240
|
+
setPosition(undefined);
|
|
241
|
+
}
|
|
242
|
+
}, [draftPosition, pos, shouldApplyDraftAnnotation]);
|
|
243
|
+
const applyDraftAnnotation = props.allowAnnotationsDraftMode && shouldApplyDraftAnnotation && position !== undefined;
|
|
244
|
+
const dataAttributesWithDraftAnnotation = useMemo(() => applyDraftAnnotation ? {
|
|
245
|
+
...dataAttributes,
|
|
246
|
+
'data-annotation-draft-mark': true,
|
|
247
|
+
'data-renderer-mark': true
|
|
248
|
+
} : dataAttributes, [applyDraftAnnotation, dataAttributes]);
|
|
249
|
+
return jsx(Media, _extends({}, props, {
|
|
250
|
+
dataAttributes: dataAttributesWithDraftAnnotation
|
|
251
|
+
}));
|
|
252
|
+
};
|
|
253
|
+
export default MediaWithDraftAnnotation;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
|
|
3
|
-
import { default as React, Fragment } from 'react';
|
|
4
|
+
import { default as React, Fragment, useCallback, useContext, useMemo } from 'react';
|
|
4
5
|
import { jsx } from '@emotion/react';
|
|
5
6
|
import { injectIntl } from 'react-intl-next';
|
|
6
|
-
import { MediaSingle as UIMediaSingle,
|
|
7
|
+
import { MediaSingle as UIMediaSingle, WidthContext } from '@atlaskit/editor-common/ui';
|
|
7
8
|
import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
8
9
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
9
10
|
import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
|
|
@@ -46,18 +47,19 @@ export const getMediaContainerWidth = (currentContainerWidth, layout) => {
|
|
|
46
47
|
}
|
|
47
48
|
return currentContainerWidth;
|
|
48
49
|
};
|
|
49
|
-
const
|
|
50
|
+
const MediaSingleWithChildren = props => {
|
|
50
51
|
const {
|
|
51
52
|
rendererAppearance,
|
|
52
53
|
featureFlags,
|
|
53
54
|
isInsideOfBlockNode,
|
|
54
55
|
layout,
|
|
55
|
-
children,
|
|
56
56
|
width: widthAttr,
|
|
57
57
|
widthType,
|
|
58
58
|
allowCaptions = false,
|
|
59
59
|
isInsideOfInlineExtension = false,
|
|
60
|
-
dataAttributes
|
|
60
|
+
dataAttributes,
|
|
61
|
+
media,
|
|
62
|
+
caption
|
|
61
63
|
} = props;
|
|
62
64
|
const [externalImageDimensions, setExternalImageDimensions] = React.useState({
|
|
63
65
|
width: 0,
|
|
@@ -73,17 +75,6 @@ const MediaSingle = props => {
|
|
|
73
75
|
height
|
|
74
76
|
});
|
|
75
77
|
}, []);
|
|
76
|
-
let media;
|
|
77
|
-
const [node, caption] = React.Children.toArray(children);
|
|
78
|
-
if (!isMediaElement(node)) {
|
|
79
|
-
const mediaElement = checkForMediaElement(node.props.children);
|
|
80
|
-
if (!mediaElement) {
|
|
81
|
-
return node;
|
|
82
|
-
}
|
|
83
|
-
media = mediaElement;
|
|
84
|
-
} else {
|
|
85
|
-
media = node;
|
|
86
|
-
}
|
|
87
78
|
let {
|
|
88
79
|
width = DEFAULT_WIDTH,
|
|
89
80
|
height = DEFAULT_HEIGHT,
|
|
@@ -110,7 +101,7 @@ const MediaSingle = props => {
|
|
|
110
101
|
|
|
111
102
|
const padding = rendererAppearance === 'full-page' ? FullPagePadding * 2 : 0;
|
|
112
103
|
const isFullWidth = rendererAppearance === 'full-width';
|
|
113
|
-
const calcDimensions = mediaContainerWidth => {
|
|
104
|
+
const calcDimensions = useCallback(mediaContainerWidth => {
|
|
114
105
|
const containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
115
106
|
const maxWidth = containerWidth;
|
|
116
107
|
const maxHeight = height / width * maxWidth;
|
|
@@ -133,17 +124,24 @@ const MediaSingle = props => {
|
|
|
133
124
|
cardDimensions,
|
|
134
125
|
lineLength
|
|
135
126
|
};
|
|
136
|
-
};
|
|
137
|
-
const originalDimensions = {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
127
|
+
}, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width]);
|
|
128
|
+
const originalDimensions = useMemo(() => ({
|
|
129
|
+
width,
|
|
130
|
+
height
|
|
131
|
+
}), [height, width]);
|
|
132
|
+
|
|
133
|
+
// Note: in SSR mode the `window` object is not defined,
|
|
134
|
+
// therefore width here is 0, see:
|
|
135
|
+
// packages/editor/editor-common/src/ui/WidthProvider/index.tsx
|
|
136
|
+
const {
|
|
137
|
+
width: renderWidth
|
|
138
|
+
} = useContext(WidthContext);
|
|
139
|
+
const containerWidth = getMediaContainerWidth(renderWidth, layout);
|
|
140
|
+
const {
|
|
141
|
+
cardDimensions,
|
|
142
|
+
lineLength
|
|
143
|
+
} = useMemo(() => calcDimensions(containerWidth), [calcDimensions, containerWidth]);
|
|
144
|
+
const renderMediaSingle = () => {
|
|
147
145
|
const mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
148
146
|
resizeMode: 'stretchy-fit',
|
|
149
147
|
cardDimensions,
|
|
@@ -171,13 +169,26 @@ const MediaSingle = props => {
|
|
|
171
169
|
dataAttributes: dataAttributes
|
|
172
170
|
}, jsx(Fragment, null, mediaComponent), allowCaptions && caption);
|
|
173
171
|
};
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
172
|
+
return renderMediaSingle();
|
|
173
|
+
};
|
|
174
|
+
const MediaSingle = props => {
|
|
175
|
+
const {
|
|
176
|
+
children
|
|
177
|
+
} = props;
|
|
178
|
+
let media;
|
|
179
|
+
const [node, caption] = React.Children.toArray(children);
|
|
180
|
+
if (!isMediaElement(node)) {
|
|
181
|
+
const mediaElement = checkForMediaElement(node.props.children);
|
|
182
|
+
if (!mediaElement) {
|
|
183
|
+
return node;
|
|
184
|
+
}
|
|
185
|
+
media = mediaElement;
|
|
186
|
+
} else {
|
|
187
|
+
media = node;
|
|
188
|
+
}
|
|
189
|
+
return jsx(MediaSingleWithChildren, _extends({}, props, {
|
|
190
|
+
media: media,
|
|
191
|
+
caption: caption
|
|
192
|
+
}));
|
|
182
193
|
};
|
|
183
194
|
export default injectIntl(MediaSingle);
|
|
@@ -36,7 +36,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
36
36
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
37
37
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
38
38
|
const packageName = "@atlaskit/renderer";
|
|
39
|
-
const packageVersion = "109.17.
|
|
39
|
+
const packageVersion = "109.17.1";
|
|
40
40
|
export class Renderer extends PureComponent {
|
|
41
41
|
constructor(props) {
|
|
42
42
|
super(props);
|
package/dist/esm/react/index.js
CHANGED
|
@@ -414,7 +414,9 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
414
414
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
415
415
|
featureFlags: this.media && this.media.featureFlags,
|
|
416
416
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
417
|
-
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
|
|
417
|
+
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr,
|
|
418
|
+
// surroundTextNodesWithTextWrapper checks inlineComment.allowDraftMode
|
|
419
|
+
allowAnnotationsDraftMode: this.surroundTextNodesWithTextWrapper
|
|
418
420
|
});
|
|
419
421
|
}
|
|
420
422
|
}, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -8,11 +9,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
9
|
import _extends from "@babel/runtime/helpers/extends";
|
|
9
10
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
10
11
|
var _excluded = ["marks"];
|
|
12
|
+
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; }
|
|
13
|
+
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
14
|
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
15
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
16
|
/** @jsx jsx */
|
|
14
17
|
|
|
15
|
-
import React, { PureComponent, Fragment } from 'react';
|
|
18
|
+
import React, { PureComponent, Fragment, useEffect, useState, useMemo } from 'react';
|
|
16
19
|
import { jsx } from '@emotion/react';
|
|
17
20
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
18
21
|
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
@@ -25,6 +28,7 @@ import { getEventHandler } from '../../../utils';
|
|
|
25
28
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
26
29
|
import { MODE, PLATFORM } from '../../../analytics/events';
|
|
27
30
|
import AnnotationComponent from '../../marks/annotation';
|
|
31
|
+
import { AnnotationsDraftContext } from '../../../ui/annotations/context';
|
|
28
32
|
import { linkStyle, borderStyle } from './styles';
|
|
29
33
|
import { CommentBadge as CommentBadgeComponent } from '@atlaskit/editor-common/media-single';
|
|
30
34
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -229,4 +233,39 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
229
233
|
}]);
|
|
230
234
|
return Media;
|
|
231
235
|
}(PureComponent);
|
|
232
|
-
|
|
236
|
+
var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
237
|
+
var draftPosition = React.useContext(AnnotationsDraftContext);
|
|
238
|
+
var dataAttributes = props.dataAttributes;
|
|
239
|
+
var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
240
|
+
var _useState = useState(),
|
|
241
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
242
|
+
position = _useState2[0],
|
|
243
|
+
setPosition = _useState2[1];
|
|
244
|
+
var _useState3 = useState(false),
|
|
245
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
246
|
+
shouldApplyDraftAnnotation = _useState4[0],
|
|
247
|
+
setShouldApplyDraftAnnotation = _useState4[1];
|
|
248
|
+
useEffect(function () {
|
|
249
|
+
if (pos === undefined) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (draftPosition !== null && draftPosition.from === pos) {
|
|
253
|
+
setShouldApplyDraftAnnotation(true);
|
|
254
|
+
setPosition(draftPosition === null || draftPosition === void 0 ? void 0 : draftPosition.from);
|
|
255
|
+
} else if (draftPosition === null && shouldApplyDraftAnnotation) {
|
|
256
|
+
setShouldApplyDraftAnnotation(false);
|
|
257
|
+
setPosition(undefined);
|
|
258
|
+
}
|
|
259
|
+
}, [draftPosition, pos, shouldApplyDraftAnnotation]);
|
|
260
|
+
var applyDraftAnnotation = props.allowAnnotationsDraftMode && shouldApplyDraftAnnotation && position !== undefined;
|
|
261
|
+
var dataAttributesWithDraftAnnotation = useMemo(function () {
|
|
262
|
+
return applyDraftAnnotation ? _objectSpread(_objectSpread({}, dataAttributes), {}, {
|
|
263
|
+
'data-annotation-draft-mark': true,
|
|
264
|
+
'data-renderer-mark': true
|
|
265
|
+
}) : dataAttributes;
|
|
266
|
+
}, [applyDraftAnnotation, dataAttributes]);
|
|
267
|
+
return jsx(Media, _extends({}, props, {
|
|
268
|
+
dataAttributes: dataAttributesWithDraftAnnotation
|
|
269
|
+
}));
|
|
270
|
+
};
|
|
271
|
+
export default MediaWithDraftAnnotation;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
/** @jsx jsx */
|
|
3
4
|
|
|
4
|
-
import { default as React, Fragment } from 'react';
|
|
5
|
+
import { default as React, Fragment, useCallback, useContext, useMemo } from 'react';
|
|
5
6
|
import { jsx } from '@emotion/react';
|
|
6
7
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
-
import { MediaSingle as UIMediaSingle,
|
|
8
|
+
import { MediaSingle as UIMediaSingle, WidthContext } from '@atlaskit/editor-common/ui';
|
|
8
9
|
import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
10
11
|
import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
|
|
@@ -48,19 +49,20 @@ export var getMediaContainerWidth = function getMediaContainerWidth(currentConta
|
|
|
48
49
|
}
|
|
49
50
|
return currentContainerWidth;
|
|
50
51
|
};
|
|
51
|
-
var
|
|
52
|
+
var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
|
|
52
53
|
var rendererAppearance = props.rendererAppearance,
|
|
53
54
|
featureFlags = props.featureFlags,
|
|
54
55
|
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
55
56
|
layout = props.layout,
|
|
56
|
-
children = props.children,
|
|
57
57
|
widthAttr = props.width,
|
|
58
58
|
widthType = props.widthType,
|
|
59
59
|
_props$allowCaptions = props.allowCaptions,
|
|
60
60
|
allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions,
|
|
61
61
|
_props$isInsideOfInli = props.isInsideOfInlineExtension,
|
|
62
62
|
isInsideOfInlineExtension = _props$isInsideOfInli === void 0 ? false : _props$isInsideOfInli,
|
|
63
|
-
dataAttributes = props.dataAttributes
|
|
63
|
+
dataAttributes = props.dataAttributes,
|
|
64
|
+
media = props.media,
|
|
65
|
+
caption = props.caption;
|
|
64
66
|
var _React$useState = React.useState({
|
|
65
67
|
width: 0,
|
|
66
68
|
height: 0
|
|
@@ -77,20 +79,6 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
77
79
|
height: height
|
|
78
80
|
});
|
|
79
81
|
}, []);
|
|
80
|
-
var media;
|
|
81
|
-
var _React$Children$toArr3 = React.Children.toArray(children),
|
|
82
|
-
_React$Children$toArr4 = _slicedToArray(_React$Children$toArr3, 2),
|
|
83
|
-
node = _React$Children$toArr4[0],
|
|
84
|
-
caption = _React$Children$toArr4[1];
|
|
85
|
-
if (!isMediaElement(node)) {
|
|
86
|
-
var mediaElement = checkForMediaElement(node.props.children);
|
|
87
|
-
if (!mediaElement) {
|
|
88
|
-
return node;
|
|
89
|
-
}
|
|
90
|
-
media = mediaElement;
|
|
91
|
-
} else {
|
|
92
|
-
media = node;
|
|
93
|
-
}
|
|
94
82
|
var _media$props = media.props,
|
|
95
83
|
_media$props$width = _media$props.width,
|
|
96
84
|
width = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
@@ -116,7 +104,7 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
116
104
|
|
|
117
105
|
var padding = rendererAppearance === 'full-page' ? FullPagePadding * 2 : 0;
|
|
118
106
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
119
|
-
var calcDimensions = function
|
|
107
|
+
var calcDimensions = useCallback(function (mediaContainerWidth) {
|
|
120
108
|
var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
121
109
|
var maxWidth = containerWidth;
|
|
122
110
|
var maxHeight = height / width * maxWidth;
|
|
@@ -139,16 +127,26 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
139
127
|
cardDimensions: cardDimensions,
|
|
140
128
|
lineLength: lineLength
|
|
141
129
|
};
|
|
142
|
-
};
|
|
143
|
-
var originalDimensions = {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
130
|
+
}, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width]);
|
|
131
|
+
var originalDimensions = useMemo(function () {
|
|
132
|
+
return {
|
|
133
|
+
width: width,
|
|
134
|
+
height: height
|
|
135
|
+
};
|
|
136
|
+
}, [height, width]);
|
|
137
|
+
|
|
138
|
+
// Note: in SSR mode the `window` object is not defined,
|
|
139
|
+
// therefore width here is 0, see:
|
|
140
|
+
// packages/editor/editor-common/src/ui/WidthProvider/index.tsx
|
|
141
|
+
var _useContext = useContext(WidthContext),
|
|
142
|
+
renderWidth = _useContext.width;
|
|
143
|
+
var containerWidth = getMediaContainerWidth(renderWidth, layout);
|
|
144
|
+
var _useMemo = useMemo(function () {
|
|
145
|
+
return calcDimensions(containerWidth);
|
|
146
|
+
}, [calcDimensions, containerWidth]),
|
|
147
|
+
cardDimensions = _useMemo.cardDimensions,
|
|
148
|
+
lineLength = _useMemo.lineLength;
|
|
149
|
+
var renderMediaSingle = function renderMediaSingle() {
|
|
152
150
|
var mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
153
151
|
resizeMode: 'stretchy-fit',
|
|
154
152
|
cardDimensions: cardDimensions,
|
|
@@ -176,12 +174,27 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
176
174
|
dataAttributes: dataAttributes
|
|
177
175
|
}, jsx(Fragment, null, mediaComponent), allowCaptions && caption);
|
|
178
176
|
};
|
|
179
|
-
return
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
177
|
+
return renderMediaSingle();
|
|
178
|
+
};
|
|
179
|
+
var MediaSingle = function MediaSingle(props) {
|
|
180
|
+
var children = props.children;
|
|
181
|
+
var media;
|
|
182
|
+
var _React$Children$toArr3 = React.Children.toArray(children),
|
|
183
|
+
_React$Children$toArr4 = _slicedToArray(_React$Children$toArr3, 2),
|
|
184
|
+
node = _React$Children$toArr4[0],
|
|
185
|
+
caption = _React$Children$toArr4[1];
|
|
186
|
+
if (!isMediaElement(node)) {
|
|
187
|
+
var mediaElement = checkForMediaElement(node.props.children);
|
|
188
|
+
if (!mediaElement) {
|
|
189
|
+
return node;
|
|
190
|
+
}
|
|
191
|
+
media = mediaElement;
|
|
192
|
+
} else {
|
|
193
|
+
media = node;
|
|
194
|
+
}
|
|
195
|
+
return jsx(MediaSingleWithChildren, _extends({}, props, {
|
|
196
|
+
media: media,
|
|
197
|
+
caption: caption
|
|
198
|
+
}));
|
|
186
199
|
};
|
|
187
200
|
export default injectIntl(MediaSingle);
|
|
@@ -46,7 +46,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
46
46
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
47
47
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
48
48
|
var packageName = "@atlaskit/renderer";
|
|
49
|
-
var packageVersion = "109.17.
|
|
49
|
+
var packageVersion = "109.17.1";
|
|
50
50
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
51
51
|
_inherits(Renderer, _PureComponent);
|
|
52
52
|
var _super = _createSuper(Renderer);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { jsx } from '@emotion/react';
|
|
3
5
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
6
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
@@ -19,14 +21,10 @@ export type MediaProps = MediaCardProps & {
|
|
|
19
21
|
featureFlags?: MediaFeatureFlags;
|
|
20
22
|
eventHandlers?: EventHandlers;
|
|
21
23
|
enableDownloadButton?: boolean;
|
|
24
|
+
allowAnnotationsDraftMode?: boolean;
|
|
22
25
|
mediaSingleElement?: HTMLElement | null;
|
|
23
26
|
width?: number;
|
|
24
27
|
height?: number;
|
|
25
28
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private handleMediaLinkClickFn;
|
|
29
|
-
private renderCard;
|
|
30
|
-
private handleMediaLinkClick;
|
|
31
|
-
render(): jsx.JSX.Element;
|
|
32
|
-
}
|
|
29
|
+
declare const MediaWithDraftAnnotation: (props: PropsWithChildren<MediaProps>) => jsx.JSX.Element;
|
|
30
|
+
export default MediaWithDraftAnnotation;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { jsx } from '@emotion/react';
|
|
3
5
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
6
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
@@ -19,14 +21,10 @@ export type MediaProps = MediaCardProps & {
|
|
|
19
21
|
featureFlags?: MediaFeatureFlags;
|
|
20
22
|
eventHandlers?: EventHandlers;
|
|
21
23
|
enableDownloadButton?: boolean;
|
|
24
|
+
allowAnnotationsDraftMode?: boolean;
|
|
22
25
|
mediaSingleElement?: HTMLElement | null;
|
|
23
26
|
width?: number;
|
|
24
27
|
height?: number;
|
|
25
28
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private handleMediaLinkClickFn;
|
|
29
|
-
private renderCard;
|
|
30
|
-
private handleMediaLinkClick;
|
|
31
|
-
render(): jsx.JSX.Element;
|
|
32
|
-
}
|
|
29
|
+
declare const MediaWithDraftAnnotation: (props: PropsWithChildren<MediaProps>) => jsx.JSX.Element;
|
|
30
|
+
export default MediaWithDraftAnnotation;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.17.
|
|
3
|
+
"version": "109.17.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/media-ui": "^25.7.0",
|
|
48
48
|
"@atlaskit/media-viewer": "^48.4.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
50
|
-
"@atlaskit/smart-card": "^26.
|
|
50
|
+
"@atlaskit/smart-card": "^26.54.0",
|
|
51
51
|
"@atlaskit/status": "^1.4.0",
|
|
52
52
|
"@atlaskit/task-decision": "^17.9.0",
|
|
53
53
|
"@atlaskit/theme": "^12.7.0",
|