@atlaskit/renderer 109.47.0 → 109.49.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 +20 -0
- package/dist/cjs/react/index.js +3 -1
- package/dist/cjs/react/nodes/media/index.js +113 -12
- package/dist/cjs/react/nodes/table.js +5 -3
- package/dist/cjs/ui/Renderer/index.js +3 -2
- package/dist/es2019/react/index.js +3 -1
- package/dist/es2019/react/nodes/media/index.js +94 -6
- package/dist/es2019/react/nodes/table.js +5 -3
- package/dist/es2019/ui/Renderer/index.js +3 -2
- package/dist/esm/react/index.js +3 -1
- package/dist/esm/react/nodes/media/index.js +116 -15
- package/dist/esm/react/nodes/table.js +5 -3
- package/dist/esm/ui/Renderer/index.js +3 -2
- package/dist/types/react/index.d.ts +2 -0
- package/dist/types/react/nodes/table.d.ts +22 -0
- package/dist/types/ui/renderer-props.d.ts +1 -0
- package/dist/types-ts4.5/react/index.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/table.d.ts +22 -0
- package/dist/types-ts4.5/ui/renderer-props.d.ts +1 -0
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.49.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3ee11b74099d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3ee11b74099d5) -
|
|
8
|
+
[ux] Adds UNSTABLE_allowTableAlignment prop on Renderer to allow consumers enable Table Alignment
|
|
9
|
+
feature (for now available only for Confluence)
|
|
10
|
+
|
|
11
|
+
## 109.48.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#130065](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130065)
|
|
16
|
+
[`e71a357ea40dd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e71a357ea40dd) -
|
|
17
|
+
[ux] [ED-24323] Add external image badge for externally hosted images
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 109.47.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -191,6 +191,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
191
191
|
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
192
192
|
this.textHighlighter = init.textHighlighter;
|
|
193
193
|
this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
|
|
194
|
+
this.allowTableAlignment = init.allowTableAlignment;
|
|
194
195
|
}
|
|
195
196
|
(0, _createClass2.default)(ReactSerializer, [{
|
|
196
197
|
key: "resetState",
|
|
@@ -363,7 +364,8 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
363
364
|
tableNode: node,
|
|
364
365
|
stickyHeaders: stickyHeaders,
|
|
365
366
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
366
|
-
isInsideMultiBodiedExtension: isInsideMultiBodiedExtension
|
|
367
|
+
isInsideMultiBodiedExtension: isInsideMultiBodiedExtension,
|
|
368
|
+
allowTableAlignment: this.allowTableAlignment
|
|
367
369
|
});
|
|
368
370
|
}
|
|
369
371
|
}, {
|
|
@@ -36,7 +36,8 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
36
36
|
var _hooks = require("../../../ui/annotations/hooks");
|
|
37
37
|
var _types = require("@atlaskit/editor-common/types");
|
|
38
38
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
39
|
-
var _excluded = ["marks", "mediaSingleElement", "isDrafting"]
|
|
39
|
+
var _excluded = ["marks", "mediaSingleElement", "isDrafting"],
|
|
40
|
+
_excluded2 = ["marks", "mediaSingleElement", "isDrafting"];
|
|
40
41
|
var _templateObject, _templateObject2;
|
|
41
42
|
/**
|
|
42
43
|
* @jsxRuntime classic
|
|
@@ -163,7 +164,7 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
163
164
|
var parentNode = mutation.target.parentNode;
|
|
164
165
|
if (mutation.attributeName === 'data-has-focus') {
|
|
165
166
|
var isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
166
|
-
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!(0, _platformFeatureFlags.
|
|
167
|
+
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!(0, _platformFeatureFlags.fg)('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
167
168
|
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
168
169
|
}
|
|
169
170
|
});
|
|
@@ -205,6 +206,85 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
205
206
|
onClick: onClick
|
|
206
207
|
}, rest));
|
|
207
208
|
};
|
|
209
|
+
|
|
210
|
+
// This is a copy of above component with adding forwardRef.
|
|
211
|
+
// Clean this up when removing fg('platform_editor_insert_media_plugin_phase_one') flag.
|
|
212
|
+
var CommentBadgeWrapperWithRef = /*#__PURE__*/_react.default.forwardRef(function (_ref6, ref) {
|
|
213
|
+
var _marks$map2;
|
|
214
|
+
var marks = _ref6.marks,
|
|
215
|
+
mediaSingleElement = _ref6.mediaSingleElement,
|
|
216
|
+
_ref6$isDrafting = _ref6.isDrafting,
|
|
217
|
+
isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
|
|
218
|
+
rest = (0, _objectWithoutProperties2.default)(_ref6, _excluded2);
|
|
219
|
+
var intl = (0, _reactIntlNext.useIntl)();
|
|
220
|
+
var _useState5 = (0, _react.useState)('default'),
|
|
221
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
222
|
+
status = _useState6[0],
|
|
223
|
+
setStatus = _useState6[1];
|
|
224
|
+
var _useState7 = (0, _react.useState)(false),
|
|
225
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
226
|
+
entered = _useState8[0],
|
|
227
|
+
setEntered = _useState8[1];
|
|
228
|
+
var updateSubscriber = (0, _hooks.useInlineCommentSubscriberContext)();
|
|
229
|
+
var activeParentIds = (0, _hooks.useInlineCommentsFilter)({
|
|
230
|
+
annotationIds: (_marks$map2 = marks === null || marks === void 0 ? void 0 : marks.map(function (mark) {
|
|
231
|
+
return mark.attrs.id;
|
|
232
|
+
})) !== null && _marks$map2 !== void 0 ? _marks$map2 : [''],
|
|
233
|
+
filter: {
|
|
234
|
+
state: _adfSchema.AnnotationMarkStates.ACTIVE
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
(0, _react.useEffect)(function () {
|
|
238
|
+
var observer = new MutationObserver(function (mutationList) {
|
|
239
|
+
mutationList.forEach(function (mutation) {
|
|
240
|
+
var parentNode = mutation.target.parentNode;
|
|
241
|
+
if (mutation.attributeName === 'data-has-focus') {
|
|
242
|
+
var isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
243
|
+
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!(0, _platformFeatureFlags.fg)('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
244
|
+
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
if (mediaSingleElement) {
|
|
249
|
+
observer.observe(mediaSingleElement, {
|
|
250
|
+
attributes: true,
|
|
251
|
+
subtree: true,
|
|
252
|
+
attributeFilter: ['data-has-focus']
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return function () {
|
|
256
|
+
observer.disconnect();
|
|
257
|
+
};
|
|
258
|
+
}, [mediaSingleElement, setStatus]);
|
|
259
|
+
if (!isDrafting && !activeParentIds.length) {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
var onClick = function onClick(e) {
|
|
263
|
+
e.preventDefault();
|
|
264
|
+
if (updateSubscriber) {
|
|
265
|
+
updateSubscriber.emit(_types.AnnotationUpdateEvent.ON_ANNOTATION_CLICK, {
|
|
266
|
+
annotationIds: activeParentIds,
|
|
267
|
+
eventTarget: e.target,
|
|
268
|
+
// use mediaSingle here to align with annotation viewed event dispatched in editor
|
|
269
|
+
eventTargetType: 'mediaSingle',
|
|
270
|
+
viewMethod: _analytics.VIEW_METHOD.BADGE
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
return (0, _react2.jsx)(_mediaSingle.CommentBadge, (0, _extends2.default)({
|
|
275
|
+
ref: ref,
|
|
276
|
+
intl: intl,
|
|
277
|
+
onMouseEnter: function onMouseEnter() {
|
|
278
|
+
return setEntered(true);
|
|
279
|
+
},
|
|
280
|
+
onMouseLeave: function onMouseLeave() {
|
|
281
|
+
return setEntered(false);
|
|
282
|
+
},
|
|
283
|
+
status: entered ? 'entered' : status,
|
|
284
|
+
onClick: onClick,
|
|
285
|
+
mediaSingleElement: mediaSingleElement
|
|
286
|
+
}, rest));
|
|
287
|
+
});
|
|
208
288
|
var Media = /*#__PURE__*/function (_PureComponent) {
|
|
209
289
|
(0, _inherits2.default)(Media, _PureComponent);
|
|
210
290
|
var _super = _createSuper(Media);
|
|
@@ -212,6 +292,7 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
212
292
|
var _this;
|
|
213
293
|
(0, _classCallCheck2.default)(this, Media);
|
|
214
294
|
_this = _super.call(this, props);
|
|
295
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "commentBadgeRef", /*#__PURE__*/_react.default.createRef());
|
|
215
296
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderCard", function () {
|
|
216
297
|
var providers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
217
298
|
var contextIdentifierProvider = providers.contextIdentifierProvider;
|
|
@@ -236,6 +317,14 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
236
317
|
var isInPageInclude = mediaSingleElement === null || mediaSingleElement === void 0 ? void 0 : mediaSingleElement.closest('[data-node-type="include"]');
|
|
237
318
|
var isIncludeExcerpt = !!(mediaSingleElement !== null && mediaSingleElement !== void 0 && mediaSingleElement.closest('.ak-excerpt-include'));
|
|
238
319
|
var showCommentBadge = !!annotationMarks && (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMedia) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaIncludePage) || !isInPageInclude) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaInsertExcerpt) || !isIncludeExcerpt);
|
|
320
|
+
var insertMediaPluginPhaseOneFlag = (0, _platformFeatureFlags.fg)('platform_editor_insert_media_plugin_phase_one');
|
|
321
|
+
var shouldShowExternalMediaBadge = _this.props.type === 'external' && insertMediaPluginPhaseOneFlag;
|
|
322
|
+
var commentBadgeOffset = function commentBadgeOffset() {
|
|
323
|
+
if (_this.commentBadgeRef.current) {
|
|
324
|
+
return _this.commentBadgeRef.current.offsetWidth + 2;
|
|
325
|
+
}
|
|
326
|
+
return 0;
|
|
327
|
+
};
|
|
239
328
|
return (0, _react2.jsx)(MediaLink, {
|
|
240
329
|
mark: linkMark,
|
|
241
330
|
onClick: _this.handleMediaLinkClickFn
|
|
@@ -247,13 +336,25 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
247
336
|
data: (0, _defineProperty2.default)({}, _analyticsNamespacedContext.MEDIA_CONTEXT, {
|
|
248
337
|
border: !!borderMark
|
|
249
338
|
})
|
|
250
|
-
},
|
|
339
|
+
}, shouldShowExternalMediaBadge && (0, _react2.jsx)(_mediaSingle.ExternalImageBadge, {
|
|
340
|
+
commentBadgeRightOffset: commentBadgeOffset(),
|
|
341
|
+
mediaElement: mediaSingleElement,
|
|
342
|
+
mediaWidth: width,
|
|
343
|
+
mediaHeight: height
|
|
344
|
+
}), showCommentBadge && (insertMediaPluginPhaseOneFlag ? (0, _react2.jsx)(CommentBadgeWrapperWithRef, {
|
|
345
|
+
ref: _this.commentBadgeRef,
|
|
251
346
|
marks: annotationMarks,
|
|
252
347
|
mediaSingleElement: mediaSingleElement,
|
|
253
348
|
width: width,
|
|
254
349
|
height: height,
|
|
255
350
|
isDrafting: isDrafting
|
|
256
|
-
})
|
|
351
|
+
}) : (0, _react2.jsx)(CommentBadgeWrapper, {
|
|
352
|
+
marks: annotationMarks,
|
|
353
|
+
mediaSingleElement: mediaSingleElement,
|
|
354
|
+
width: width,
|
|
355
|
+
height: height,
|
|
356
|
+
isDrafting: isDrafting
|
|
357
|
+
})), (0, _react2.jsx)(_MediaCard.MediaCard, (0, _extends2.default)({
|
|
257
358
|
contextIdentifierProvider: contextIdentifierProvider
|
|
258
359
|
}, _this.props, {
|
|
259
360
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
@@ -314,14 +415,14 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
314
415
|
var isCommentsOnMediaBugFixEnabled = !!(providers !== null && providers !== void 0 && providers.inlineComment.isCommentsOnMediaBugFixEnabled);
|
|
315
416
|
var dataAttributes = props.dataAttributes;
|
|
316
417
|
var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
position =
|
|
320
|
-
setPosition =
|
|
321
|
-
var
|
|
322
|
-
|
|
323
|
-
shouldApplyDraftAnnotation =
|
|
324
|
-
setShouldApplyDraftAnnotation =
|
|
418
|
+
var _useState9 = (0, _react.useState)(),
|
|
419
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
420
|
+
position = _useState10[0],
|
|
421
|
+
setPosition = _useState10[1];
|
|
422
|
+
var _useState11 = (0, _react.useState)(false),
|
|
423
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
424
|
+
shouldApplyDraftAnnotation = _useState12[0],
|
|
425
|
+
setShouldApplyDraftAnnotation = _useState12[1];
|
|
325
426
|
(0, _react.useEffect)(function () {
|
|
326
427
|
var _draftPosition$from;
|
|
327
428
|
if (pos === undefined) {
|
|
@@ -298,7 +298,8 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
298
298
|
tableNode = _this$props.tableNode,
|
|
299
299
|
rendererAppearance = _this$props.rendererAppearance,
|
|
300
300
|
isInsideOfBlockNode = _this$props.isInsideOfBlockNode,
|
|
301
|
-
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension
|
|
301
|
+
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension,
|
|
302
|
+
allowTableAlignment = _this$props.allowTableAlignment;
|
|
302
303
|
var stickyMode = this.state.stickyMode;
|
|
303
304
|
var lineLengthFixedWidth = _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
304
305
|
var left;
|
|
@@ -323,10 +324,11 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
323
324
|
var tableWidth = calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode);
|
|
324
325
|
var isCommentAppearanceAndTableAlignmentEnabled =
|
|
325
326
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
326
|
-
|
|
327
|
+
allowTableAlignment && (0, _platformFeatureFlags.fg)('platform_editor_table_support_in_comment');
|
|
327
328
|
|
|
328
329
|
// Logic for table alignment in renderer
|
|
329
|
-
var isTableAlignStart = ((0, _appearance.isFullWidthOrFullPageAppearance)(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && (0, _platformFeatureFlags.fg)('platform.editor.table.allow-table-alignment');
|
|
330
|
+
var isTableAlignStart = ((0, _appearance.isFullWidthOrFullPageAppearance)(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment && (0, _platformFeatureFlags.fg)('platform.editor.table.allow-table-alignment'); // allowTableAlignment should be used instead of fg('platform.editor.table.allow-table-alignment') after this fg cleanup
|
|
331
|
+
|
|
330
332
|
var fullWidthLineLength = isRenderWidthValid ? Math.min(_editorSharedStyles.akEditorFullWidthLayoutWidth, renderWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
331
333
|
var commentLineLength = isRenderWidthValid ? renderWidth : lineLengthFixedWidth;
|
|
332
334
|
var lineLength = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
@@ -60,7 +60,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
60
60
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
61
61
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
62
62
|
var packageName = "@atlaskit/renderer";
|
|
63
|
-
var packageVersion = "109.
|
|
63
|
+
var packageVersion = "109.49.0";
|
|
64
64
|
var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
|
|
65
65
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
66
66
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
@@ -289,7 +289,8 @@ var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
289
289
|
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
290
290
|
isInsideOfInlineExtension: (0, _platformFeatureFlags.fg)('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
|
|
291
291
|
textHighlighter: props.UNSTABLE_textHighlighter,
|
|
292
|
-
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix
|
|
292
|
+
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix,
|
|
293
|
+
allowTableAlignment: props.UNSTABLE_allowTableAlignment
|
|
293
294
|
};
|
|
294
295
|
}
|
|
295
296
|
}, {
|
|
@@ -177,6 +177,7 @@ export default class ReactSerializer {
|
|
|
177
177
|
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
178
178
|
this.textHighlighter = init.textHighlighter;
|
|
179
179
|
this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
|
|
180
|
+
this.allowTableAlignment = init.allowTableAlignment;
|
|
180
181
|
}
|
|
181
182
|
resetState() {
|
|
182
183
|
this.headingIds = [];
|
|
@@ -325,7 +326,8 @@ export default class ReactSerializer {
|
|
|
325
326
|
tableNode: node,
|
|
326
327
|
stickyHeaders,
|
|
327
328
|
isInsideOfBlockNode,
|
|
328
|
-
isInsideMultiBodiedExtension
|
|
329
|
+
isInsideMultiBodiedExtension,
|
|
330
|
+
allowTableAlignment: this.allowTableAlignment
|
|
329
331
|
};
|
|
330
332
|
}
|
|
331
333
|
getDateProps(node, parentInfo, path = []) {
|
|
@@ -20,11 +20,11 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, VIEW_METHOD } fr
|
|
|
20
20
|
import { MODE, PLATFORM } from '../../../analytics/events';
|
|
21
21
|
import AnnotationComponent from '../../marks/annotation';
|
|
22
22
|
import { AnnotationsDraftContext, ProvidersContext } from '../../../ui/annotations/context';
|
|
23
|
-
import { CommentBadge as CommentBadgeComponent } from '@atlaskit/editor-common/media-single';
|
|
24
|
-
import { injectIntl } from 'react-intl-next';
|
|
23
|
+
import { CommentBadge as CommentBadgeComponent, ExternalImageBadge } from '@atlaskit/editor-common/media-single';
|
|
24
|
+
import { useIntl, injectIntl } from 'react-intl-next';
|
|
25
25
|
import { useInlineCommentSubscriberContext, useInlineCommentsFilter } from '../../../ui/annotations/hooks';
|
|
26
26
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
27
|
-
import {
|
|
27
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
28
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
29
29
|
export const linkStyle = css`
|
|
30
30
|
position: absolute;
|
|
@@ -148,7 +148,7 @@ const CommentBadgeWrapper = ({
|
|
|
148
148
|
const parentNode = mutation.target.parentNode;
|
|
149
149
|
if (mutation.attributeName === 'data-has-focus') {
|
|
150
150
|
const isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
151
|
-
const elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!
|
|
151
|
+
const elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!fg('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
152
152
|
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
153
153
|
}
|
|
154
154
|
});
|
|
@@ -186,9 +186,77 @@ const CommentBadgeWrapper = ({
|
|
|
186
186
|
onClick: onClick
|
|
187
187
|
}, rest));
|
|
188
188
|
};
|
|
189
|
+
|
|
190
|
+
// This is a copy of above component with adding forwardRef.
|
|
191
|
+
// Clean this up when removing fg('platform_editor_insert_media_plugin_phase_one') flag.
|
|
192
|
+
const CommentBadgeWrapperWithRef = /*#__PURE__*/React.forwardRef(({
|
|
193
|
+
marks,
|
|
194
|
+
mediaSingleElement,
|
|
195
|
+
isDrafting = false,
|
|
196
|
+
...rest
|
|
197
|
+
}, ref) => {
|
|
198
|
+
var _marks$map2;
|
|
199
|
+
const intl = useIntl();
|
|
200
|
+
const [status, setStatus] = useState('default');
|
|
201
|
+
const [entered, setEntered] = useState(false);
|
|
202
|
+
const updateSubscriber = useInlineCommentSubscriberContext();
|
|
203
|
+
const activeParentIds = useInlineCommentsFilter({
|
|
204
|
+
annotationIds: (_marks$map2 = marks === null || marks === void 0 ? void 0 : marks.map(mark => mark.attrs.id)) !== null && _marks$map2 !== void 0 ? _marks$map2 : [''],
|
|
205
|
+
filter: {
|
|
206
|
+
state: AnnotationMarkStates.ACTIVE
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
useEffect(() => {
|
|
210
|
+
const observer = new MutationObserver(mutationList => {
|
|
211
|
+
mutationList.forEach(mutation => {
|
|
212
|
+
const parentNode = mutation.target.parentNode;
|
|
213
|
+
if (mutation.attributeName === 'data-has-focus') {
|
|
214
|
+
const isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
215
|
+
const elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!fg('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
216
|
+
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
if (mediaSingleElement) {
|
|
221
|
+
observer.observe(mediaSingleElement, {
|
|
222
|
+
attributes: true,
|
|
223
|
+
subtree: true,
|
|
224
|
+
attributeFilter: ['data-has-focus']
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
return () => {
|
|
228
|
+
observer.disconnect();
|
|
229
|
+
};
|
|
230
|
+
}, [mediaSingleElement, setStatus]);
|
|
231
|
+
if (!isDrafting && !activeParentIds.length) {
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
const onClick = e => {
|
|
235
|
+
e.preventDefault();
|
|
236
|
+
if (updateSubscriber) {
|
|
237
|
+
updateSubscriber.emit(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, {
|
|
238
|
+
annotationIds: activeParentIds,
|
|
239
|
+
eventTarget: e.target,
|
|
240
|
+
// use mediaSingle here to align with annotation viewed event dispatched in editor
|
|
241
|
+
eventTargetType: 'mediaSingle',
|
|
242
|
+
viewMethod: VIEW_METHOD.BADGE
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
return jsx(CommentBadgeComponent, _extends({
|
|
247
|
+
ref: ref,
|
|
248
|
+
intl: intl,
|
|
249
|
+
onMouseEnter: () => setEntered(true),
|
|
250
|
+
onMouseLeave: () => setEntered(false),
|
|
251
|
+
status: entered ? 'entered' : status,
|
|
252
|
+
onClick: onClick,
|
|
253
|
+
mediaSingleElement: mediaSingleElement
|
|
254
|
+
}, rest));
|
|
255
|
+
});
|
|
189
256
|
class Media extends PureComponent {
|
|
190
257
|
constructor(props) {
|
|
191
258
|
super(props);
|
|
259
|
+
_defineProperty(this, "commentBadgeRef", /*#__PURE__*/React.createRef());
|
|
192
260
|
_defineProperty(this, "renderCard", (providers = {}) => {
|
|
193
261
|
const {
|
|
194
262
|
contextIdentifierProvider
|
|
@@ -214,6 +282,14 @@ class Media extends PureComponent {
|
|
|
214
282
|
const isInPageInclude = mediaSingleElement === null || mediaSingleElement === void 0 ? void 0 : mediaSingleElement.closest('[data-node-type="include"]');
|
|
215
283
|
const isIncludeExcerpt = !!(mediaSingleElement !== null && mediaSingleElement !== void 0 && mediaSingleElement.closest('.ak-excerpt-include'));
|
|
216
284
|
const showCommentBadge = !!annotationMarks && (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMedia) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaIncludePage) || !isInPageInclude) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaInsertExcerpt) || !isIncludeExcerpt);
|
|
285
|
+
const insertMediaPluginPhaseOneFlag = fg('platform_editor_insert_media_plugin_phase_one');
|
|
286
|
+
const shouldShowExternalMediaBadge = this.props.type === 'external' && insertMediaPluginPhaseOneFlag;
|
|
287
|
+
const commentBadgeOffset = () => {
|
|
288
|
+
if (this.commentBadgeRef.current) {
|
|
289
|
+
return this.commentBadgeRef.current.offsetWidth + 2;
|
|
290
|
+
}
|
|
291
|
+
return 0;
|
|
292
|
+
};
|
|
217
293
|
return jsx(MediaLink, {
|
|
218
294
|
mark: linkMark,
|
|
219
295
|
onClick: this.handleMediaLinkClickFn
|
|
@@ -227,13 +303,25 @@ class Media extends PureComponent {
|
|
|
227
303
|
border: !!borderMark
|
|
228
304
|
}
|
|
229
305
|
}
|
|
230
|
-
},
|
|
306
|
+
}, shouldShowExternalMediaBadge && jsx(ExternalImageBadge, {
|
|
307
|
+
commentBadgeRightOffset: commentBadgeOffset(),
|
|
308
|
+
mediaElement: mediaSingleElement,
|
|
309
|
+
mediaWidth: width,
|
|
310
|
+
mediaHeight: height
|
|
311
|
+
}), showCommentBadge && (insertMediaPluginPhaseOneFlag ? jsx(CommentBadgeWrapperWithRef, {
|
|
312
|
+
ref: this.commentBadgeRef,
|
|
313
|
+
marks: annotationMarks,
|
|
314
|
+
mediaSingleElement: mediaSingleElement,
|
|
315
|
+
width: width,
|
|
316
|
+
height: height,
|
|
317
|
+
isDrafting: isDrafting
|
|
318
|
+
}) : jsx(CommentBadgeWrapper, {
|
|
231
319
|
marks: annotationMarks,
|
|
232
320
|
mediaSingleElement: mediaSingleElement,
|
|
233
321
|
width: width,
|
|
234
322
|
height: height,
|
|
235
323
|
isDrafting: isDrafting
|
|
236
|
-
}), jsx(MediaCard, _extends({
|
|
324
|
+
})), jsx(MediaCard, _extends({
|
|
237
325
|
contextIdentifierProvider: contextIdentifierProvider
|
|
238
326
|
}, this.props, {
|
|
239
327
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
@@ -242,7 +242,8 @@ export class TableContainer extends React.Component {
|
|
|
242
242
|
tableNode,
|
|
243
243
|
rendererAppearance,
|
|
244
244
|
isInsideOfBlockNode,
|
|
245
|
-
isinsideMultiBodiedExtension
|
|
245
|
+
isinsideMultiBodiedExtension,
|
|
246
|
+
allowTableAlignment
|
|
246
247
|
} = this.props;
|
|
247
248
|
const {
|
|
248
249
|
stickyMode
|
|
@@ -270,10 +271,11 @@ export class TableContainer extends React.Component {
|
|
|
270
271
|
const tableWidth = calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode);
|
|
271
272
|
const isCommentAppearanceAndTableAlignmentEnabled =
|
|
272
273
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
273
|
-
|
|
274
|
+
allowTableAlignment && fg('platform_editor_table_support_in_comment');
|
|
274
275
|
|
|
275
276
|
// Logic for table alignment in renderer
|
|
276
|
-
const isTableAlignStart = (isFullWidthOrFullPageAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && fg('platform.editor.table.allow-table-alignment');
|
|
277
|
+
const isTableAlignStart = (isFullWidthOrFullPageAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment && fg('platform.editor.table.allow-table-alignment'); // allowTableAlignment should be used instead of fg('platform.editor.table.allow-table-alignment') after this fg cleanup
|
|
278
|
+
|
|
277
279
|
const fullWidthLineLength = isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
278
280
|
const commentLineLength = isRenderWidthValid ? renderWidth : lineLengthFixedWidth;
|
|
279
281
|
let lineLength = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
@@ -42,7 +42,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
42
42
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
43
43
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
44
44
|
const packageName = "@atlaskit/renderer";
|
|
45
|
-
const packageVersion = "109.
|
|
45
|
+
const packageVersion = "109.49.0";
|
|
46
46
|
export const defaultNodeComponents = nodeToReact;
|
|
47
47
|
export class Renderer extends PureComponent {
|
|
48
48
|
constructor(props) {
|
|
@@ -269,7 +269,8 @@ export class Renderer extends PureComponent {
|
|
|
269
269
|
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
270
270
|
isInsideOfInlineExtension: fg('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
|
|
271
271
|
textHighlighter: props.UNSTABLE_textHighlighter,
|
|
272
|
-
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix
|
|
272
|
+
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix,
|
|
273
|
+
allowTableAlignment: props.UNSTABLE_allowTableAlignment
|
|
273
274
|
};
|
|
274
275
|
}
|
|
275
276
|
render() {
|
package/dist/esm/react/index.js
CHANGED
|
@@ -184,6 +184,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
184
184
|
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
185
185
|
this.textHighlighter = init.textHighlighter;
|
|
186
186
|
this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
|
|
187
|
+
this.allowTableAlignment = init.allowTableAlignment;
|
|
187
188
|
}
|
|
188
189
|
_createClass(ReactSerializer, [{
|
|
189
190
|
key: "resetState",
|
|
@@ -356,7 +357,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
356
357
|
tableNode: node,
|
|
357
358
|
stickyHeaders: stickyHeaders,
|
|
358
359
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
359
|
-
isInsideMultiBodiedExtension: isInsideMultiBodiedExtension
|
|
360
|
+
isInsideMultiBodiedExtension: isInsideMultiBodiedExtension,
|
|
361
|
+
allowTableAlignment: this.allowTableAlignment
|
|
360
362
|
});
|
|
361
363
|
}
|
|
362
364
|
}, {
|
|
@@ -9,7 +9,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
9
9
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
10
10
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
11
11
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
12
|
-
var _excluded = ["marks", "mediaSingleElement", "isDrafting"]
|
|
12
|
+
var _excluded = ["marks", "mediaSingleElement", "isDrafting"],
|
|
13
|
+
_excluded2 = ["marks", "mediaSingleElement", "isDrafting"];
|
|
13
14
|
var _templateObject, _templateObject2;
|
|
14
15
|
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; }
|
|
15
16
|
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; }
|
|
@@ -35,11 +36,11 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, VIEW_METHOD } fr
|
|
|
35
36
|
import { MODE, PLATFORM } from '../../../analytics/events';
|
|
36
37
|
import AnnotationComponent from '../../marks/annotation';
|
|
37
38
|
import { AnnotationsDraftContext, ProvidersContext } from '../../../ui/annotations/context';
|
|
38
|
-
import { CommentBadge as CommentBadgeComponent } from '@atlaskit/editor-common/media-single';
|
|
39
|
-
import { injectIntl } from 'react-intl-next';
|
|
39
|
+
import { CommentBadge as CommentBadgeComponent, ExternalImageBadge } from '@atlaskit/editor-common/media-single';
|
|
40
|
+
import { useIntl, injectIntl } from 'react-intl-next';
|
|
40
41
|
import { useInlineCommentSubscriberContext, useInlineCommentsFilter } from '../../../ui/annotations/hooks';
|
|
41
42
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
42
|
-
import {
|
|
43
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
43
44
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
44
45
|
export var linkStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\tbackground: transparent;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tcursor: pointer;\n\twidth: 100% !important;\n\theight: 100% !important;\n"])));
|
|
45
46
|
|
|
@@ -154,7 +155,7 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
154
155
|
var parentNode = mutation.target.parentNode;
|
|
155
156
|
if (mutation.attributeName === 'data-has-focus') {
|
|
156
157
|
var isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
157
|
-
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!
|
|
158
|
+
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!fg('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
158
159
|
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
159
160
|
}
|
|
160
161
|
});
|
|
@@ -196,6 +197,85 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
196
197
|
onClick: onClick
|
|
197
198
|
}, rest));
|
|
198
199
|
};
|
|
200
|
+
|
|
201
|
+
// This is a copy of above component with adding forwardRef.
|
|
202
|
+
// Clean this up when removing fg('platform_editor_insert_media_plugin_phase_one') flag.
|
|
203
|
+
var CommentBadgeWrapperWithRef = /*#__PURE__*/React.forwardRef(function (_ref6, ref) {
|
|
204
|
+
var _marks$map2;
|
|
205
|
+
var marks = _ref6.marks,
|
|
206
|
+
mediaSingleElement = _ref6.mediaSingleElement,
|
|
207
|
+
_ref6$isDrafting = _ref6.isDrafting,
|
|
208
|
+
isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
|
|
209
|
+
rest = _objectWithoutProperties(_ref6, _excluded2);
|
|
210
|
+
var intl = useIntl();
|
|
211
|
+
var _useState5 = useState('default'),
|
|
212
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
213
|
+
status = _useState6[0],
|
|
214
|
+
setStatus = _useState6[1];
|
|
215
|
+
var _useState7 = useState(false),
|
|
216
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
217
|
+
entered = _useState8[0],
|
|
218
|
+
setEntered = _useState8[1];
|
|
219
|
+
var updateSubscriber = useInlineCommentSubscriberContext();
|
|
220
|
+
var activeParentIds = useInlineCommentsFilter({
|
|
221
|
+
annotationIds: (_marks$map2 = marks === null || marks === void 0 ? void 0 : marks.map(function (mark) {
|
|
222
|
+
return mark.attrs.id;
|
|
223
|
+
})) !== null && _marks$map2 !== void 0 ? _marks$map2 : [''],
|
|
224
|
+
filter: {
|
|
225
|
+
state: AnnotationMarkStates.ACTIVE
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
useEffect(function () {
|
|
229
|
+
var observer = new MutationObserver(function (mutationList) {
|
|
230
|
+
mutationList.forEach(function (mutation) {
|
|
231
|
+
var parentNode = mutation.target.parentNode;
|
|
232
|
+
if (mutation.attributeName === 'data-has-focus') {
|
|
233
|
+
var isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
234
|
+
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!fg('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
235
|
+
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
if (mediaSingleElement) {
|
|
240
|
+
observer.observe(mediaSingleElement, {
|
|
241
|
+
attributes: true,
|
|
242
|
+
subtree: true,
|
|
243
|
+
attributeFilter: ['data-has-focus']
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
return function () {
|
|
247
|
+
observer.disconnect();
|
|
248
|
+
};
|
|
249
|
+
}, [mediaSingleElement, setStatus]);
|
|
250
|
+
if (!isDrafting && !activeParentIds.length) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
var onClick = function onClick(e) {
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
if (updateSubscriber) {
|
|
256
|
+
updateSubscriber.emit(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, {
|
|
257
|
+
annotationIds: activeParentIds,
|
|
258
|
+
eventTarget: e.target,
|
|
259
|
+
// use mediaSingle here to align with annotation viewed event dispatched in editor
|
|
260
|
+
eventTargetType: 'mediaSingle',
|
|
261
|
+
viewMethod: VIEW_METHOD.BADGE
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
return jsx(CommentBadgeComponent, _extends({
|
|
266
|
+
ref: ref,
|
|
267
|
+
intl: intl,
|
|
268
|
+
onMouseEnter: function onMouseEnter() {
|
|
269
|
+
return setEntered(true);
|
|
270
|
+
},
|
|
271
|
+
onMouseLeave: function onMouseLeave() {
|
|
272
|
+
return setEntered(false);
|
|
273
|
+
},
|
|
274
|
+
status: entered ? 'entered' : status,
|
|
275
|
+
onClick: onClick,
|
|
276
|
+
mediaSingleElement: mediaSingleElement
|
|
277
|
+
}, rest));
|
|
278
|
+
});
|
|
199
279
|
var Media = /*#__PURE__*/function (_PureComponent) {
|
|
200
280
|
_inherits(Media, _PureComponent);
|
|
201
281
|
var _super = _createSuper(Media);
|
|
@@ -203,6 +283,7 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
203
283
|
var _this;
|
|
204
284
|
_classCallCheck(this, Media);
|
|
205
285
|
_this = _super.call(this, props);
|
|
286
|
+
_defineProperty(_assertThisInitialized(_this), "commentBadgeRef", /*#__PURE__*/React.createRef());
|
|
206
287
|
_defineProperty(_assertThisInitialized(_this), "renderCard", function () {
|
|
207
288
|
var providers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
208
289
|
var contextIdentifierProvider = providers.contextIdentifierProvider;
|
|
@@ -227,6 +308,14 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
227
308
|
var isInPageInclude = mediaSingleElement === null || mediaSingleElement === void 0 ? void 0 : mediaSingleElement.closest('[data-node-type="include"]');
|
|
228
309
|
var isIncludeExcerpt = !!(mediaSingleElement !== null && mediaSingleElement !== void 0 && mediaSingleElement.closest('.ak-excerpt-include'));
|
|
229
310
|
var showCommentBadge = !!annotationMarks && (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMedia) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaIncludePage) || !isInPageInclude) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaInsertExcerpt) || !isIncludeExcerpt);
|
|
311
|
+
var insertMediaPluginPhaseOneFlag = fg('platform_editor_insert_media_plugin_phase_one');
|
|
312
|
+
var shouldShowExternalMediaBadge = _this.props.type === 'external' && insertMediaPluginPhaseOneFlag;
|
|
313
|
+
var commentBadgeOffset = function commentBadgeOffset() {
|
|
314
|
+
if (_this.commentBadgeRef.current) {
|
|
315
|
+
return _this.commentBadgeRef.current.offsetWidth + 2;
|
|
316
|
+
}
|
|
317
|
+
return 0;
|
|
318
|
+
};
|
|
230
319
|
return jsx(MediaLink, {
|
|
231
320
|
mark: linkMark,
|
|
232
321
|
onClick: _this.handleMediaLinkClickFn
|
|
@@ -238,13 +327,25 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
238
327
|
data: _defineProperty({}, MEDIA_CONTEXT, {
|
|
239
328
|
border: !!borderMark
|
|
240
329
|
})
|
|
241
|
-
},
|
|
330
|
+
}, shouldShowExternalMediaBadge && jsx(ExternalImageBadge, {
|
|
331
|
+
commentBadgeRightOffset: commentBadgeOffset(),
|
|
332
|
+
mediaElement: mediaSingleElement,
|
|
333
|
+
mediaWidth: width,
|
|
334
|
+
mediaHeight: height
|
|
335
|
+
}), showCommentBadge && (insertMediaPluginPhaseOneFlag ? jsx(CommentBadgeWrapperWithRef, {
|
|
336
|
+
ref: _this.commentBadgeRef,
|
|
242
337
|
marks: annotationMarks,
|
|
243
338
|
mediaSingleElement: mediaSingleElement,
|
|
244
339
|
width: width,
|
|
245
340
|
height: height,
|
|
246
341
|
isDrafting: isDrafting
|
|
247
|
-
})
|
|
342
|
+
}) : jsx(CommentBadgeWrapper, {
|
|
343
|
+
marks: annotationMarks,
|
|
344
|
+
mediaSingleElement: mediaSingleElement,
|
|
345
|
+
width: width,
|
|
346
|
+
height: height,
|
|
347
|
+
isDrafting: isDrafting
|
|
348
|
+
})), jsx(MediaCard, _extends({
|
|
248
349
|
contextIdentifierProvider: contextIdentifierProvider
|
|
249
350
|
}, _this.props, {
|
|
250
351
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
@@ -305,14 +406,14 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
305
406
|
var isCommentsOnMediaBugFixEnabled = !!(providers !== null && providers !== void 0 && providers.inlineComment.isCommentsOnMediaBugFixEnabled);
|
|
306
407
|
var dataAttributes = props.dataAttributes;
|
|
307
408
|
var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
position =
|
|
311
|
-
setPosition =
|
|
312
|
-
var
|
|
313
|
-
|
|
314
|
-
shouldApplyDraftAnnotation =
|
|
315
|
-
setShouldApplyDraftAnnotation =
|
|
409
|
+
var _useState9 = useState(),
|
|
410
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
411
|
+
position = _useState10[0],
|
|
412
|
+
setPosition = _useState10[1];
|
|
413
|
+
var _useState11 = useState(false),
|
|
414
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
415
|
+
shouldApplyDraftAnnotation = _useState12[0],
|
|
416
|
+
setShouldApplyDraftAnnotation = _useState12[1];
|
|
316
417
|
useEffect(function () {
|
|
317
418
|
var _draftPosition$from;
|
|
318
419
|
if (pos === undefined) {
|
|
@@ -291,7 +291,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
291
291
|
tableNode = _this$props.tableNode,
|
|
292
292
|
rendererAppearance = _this$props.rendererAppearance,
|
|
293
293
|
isInsideOfBlockNode = _this$props.isInsideOfBlockNode,
|
|
294
|
-
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension
|
|
294
|
+
isinsideMultiBodiedExtension = _this$props.isinsideMultiBodiedExtension,
|
|
295
|
+
allowTableAlignment = _this$props.allowTableAlignment;
|
|
295
296
|
var stickyMode = this.state.stickyMode;
|
|
296
297
|
var lineLengthFixedWidth = akEditorDefaultLayoutWidth;
|
|
297
298
|
var left;
|
|
@@ -316,10 +317,11 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
316
317
|
var tableWidth = calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode);
|
|
317
318
|
var isCommentAppearanceAndTableAlignmentEnabled =
|
|
318
319
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
319
|
-
|
|
320
|
+
allowTableAlignment && fg('platform_editor_table_support_in_comment');
|
|
320
321
|
|
|
321
322
|
// Logic for table alignment in renderer
|
|
322
|
-
var isTableAlignStart = (isFullWidthOrFullPageAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && fg('platform.editor.table.allow-table-alignment');
|
|
323
|
+
var isTableAlignStart = (isFullWidthOrFullPageAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled) && tableNode && tableNode.attrs && tableNode.attrs.layout === 'align-start' && allowTableAlignment && fg('platform.editor.table.allow-table-alignment'); // allowTableAlignment should be used instead of fg('platform.editor.table.allow-table-alignment') after this fg cleanup
|
|
324
|
+
|
|
323
325
|
var fullWidthLineLength = isRenderWidthValid ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : akEditorFullWidthLayoutWidth;
|
|
324
326
|
var commentLineLength = isRenderWidthValid ? renderWidth : lineLengthFixedWidth;
|
|
325
327
|
var lineLength = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
@@ -52,7 +52,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
52
52
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
53
53
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
54
54
|
var packageName = "@atlaskit/renderer";
|
|
55
|
-
var packageVersion = "109.
|
|
55
|
+
var packageVersion = "109.49.0";
|
|
56
56
|
export var defaultNodeComponents = nodeToReact;
|
|
57
57
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
58
58
|
_inherits(Renderer, _PureComponent);
|
|
@@ -281,7 +281,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
281
281
|
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
282
282
|
isInsideOfInlineExtension: fg('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
|
|
283
283
|
textHighlighter: props.UNSTABLE_textHighlighter,
|
|
284
|
-
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix
|
|
284
|
+
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix,
|
|
285
|
+
allowTableAlignment: props.UNSTABLE_allowTableAlignment
|
|
285
286
|
};
|
|
286
287
|
}
|
|
287
288
|
}, {
|
|
@@ -42,6 +42,7 @@ export interface ReactSerializerInit {
|
|
|
42
42
|
isInsideOfInlineExtension?: boolean;
|
|
43
43
|
textHighlighter?: TextHighlighter;
|
|
44
44
|
isCommentsOnMediaMediaInlineBugFixEnabled?: boolean;
|
|
45
|
+
allowTableAlignment?: boolean;
|
|
45
46
|
}
|
|
46
47
|
interface ParentInfo {
|
|
47
48
|
parentIsIncompleteTask: boolean;
|
|
@@ -90,6 +91,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
90
91
|
private isInsideOfInlineExtension?;
|
|
91
92
|
private isCommentsOnMediaMediaInlineBugFixEnabled?;
|
|
92
93
|
private textHighlighter?;
|
|
94
|
+
private allowTableAlignment?;
|
|
93
95
|
constructor(init: ReactSerializerInit);
|
|
94
96
|
private resetState;
|
|
95
97
|
private getNodeProps;
|
|
@@ -14,6 +14,7 @@ export type TableProps = SharedTableProps & {
|
|
|
14
14
|
rendererAppearance?: RendererAppearance;
|
|
15
15
|
allowColumnSorting?: boolean;
|
|
16
16
|
stickyHeaders?: StickyHeaderConfig;
|
|
17
|
+
allowTableAlignment?: boolean;
|
|
17
18
|
};
|
|
18
19
|
interface TableOrderStatus {
|
|
19
20
|
columnIndex: number;
|
|
@@ -67,6 +68,7 @@ declare const _default: {
|
|
|
67
68
|
rendererAppearance?: RendererAppearance;
|
|
68
69
|
allowColumnSorting?: boolean | undefined;
|
|
69
70
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
71
|
+
allowTableAlignment?: boolean | undefined;
|
|
70
72
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps> | Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
71
73
|
renderWidth?: number | undefined;
|
|
72
74
|
} & Omit<SharedTableProps & {
|
|
@@ -75,6 +77,7 @@ declare const _default: {
|
|
|
75
77
|
rendererAppearance?: RendererAppearance;
|
|
76
78
|
allowColumnSorting?: boolean | undefined;
|
|
77
79
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
80
|
+
allowTableAlignment?: boolean | undefined;
|
|
78
81
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>): {
|
|
79
82
|
render(): JSX.Element;
|
|
80
83
|
context: any;
|
|
@@ -86,6 +89,7 @@ declare const _default: {
|
|
|
86
89
|
rendererAppearance?: RendererAppearance;
|
|
87
90
|
allowColumnSorting?: boolean | undefined;
|
|
88
91
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
92
|
+
allowTableAlignment?: boolean | undefined;
|
|
89
93
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
90
94
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
91
95
|
readonly props: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
@@ -96,6 +100,7 @@ declare const _default: {
|
|
|
96
100
|
rendererAppearance?: RendererAppearance;
|
|
97
101
|
allowColumnSorting?: boolean | undefined;
|
|
98
102
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
103
|
+
allowTableAlignment?: boolean | undefined;
|
|
99
104
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>> & Readonly<{
|
|
100
105
|
children?: React.ReactNode;
|
|
101
106
|
}>;
|
|
@@ -112,6 +117,7 @@ declare const _default: {
|
|
|
112
117
|
rendererAppearance?: RendererAppearance;
|
|
113
118
|
allowColumnSorting?: boolean | undefined;
|
|
114
119
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
120
|
+
allowTableAlignment?: boolean | undefined;
|
|
115
121
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
116
122
|
componentWillUnmount?(): void;
|
|
117
123
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
@@ -123,6 +129,7 @@ declare const _default: {
|
|
|
123
129
|
rendererAppearance?: RendererAppearance;
|
|
124
130
|
allowColumnSorting?: boolean | undefined;
|
|
125
131
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
132
|
+
allowTableAlignment?: boolean | undefined;
|
|
126
133
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, prevState: Readonly<{}>): any;
|
|
127
134
|
componentDidUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
128
135
|
renderWidth?: number | undefined;
|
|
@@ -132,6 +139,7 @@ declare const _default: {
|
|
|
132
139
|
rendererAppearance?: RendererAppearance;
|
|
133
140
|
allowColumnSorting?: boolean | undefined;
|
|
134
141
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
142
|
+
allowTableAlignment?: boolean | undefined;
|
|
135
143
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
136
144
|
componentWillMount?(): void;
|
|
137
145
|
UNSAFE_componentWillMount?(): void;
|
|
@@ -143,6 +151,7 @@ declare const _default: {
|
|
|
143
151
|
rendererAppearance?: RendererAppearance;
|
|
144
152
|
allowColumnSorting?: boolean | undefined;
|
|
145
153
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
154
|
+
allowTableAlignment?: boolean | undefined;
|
|
146
155
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextContext: any): void;
|
|
147
156
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
148
157
|
renderWidth?: number | undefined;
|
|
@@ -152,6 +161,7 @@ declare const _default: {
|
|
|
152
161
|
rendererAppearance?: RendererAppearance;
|
|
153
162
|
allowColumnSorting?: boolean | undefined;
|
|
154
163
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
164
|
+
allowTableAlignment?: boolean | undefined;
|
|
155
165
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextContext: any): void;
|
|
156
166
|
componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
157
167
|
renderWidth?: number | undefined;
|
|
@@ -161,6 +171,7 @@ declare const _default: {
|
|
|
161
171
|
rendererAppearance?: RendererAppearance;
|
|
162
172
|
allowColumnSorting?: boolean | undefined;
|
|
163
173
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
174
|
+
allowTableAlignment?: boolean | undefined;
|
|
164
175
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
165
176
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
166
177
|
renderWidth?: number | undefined;
|
|
@@ -170,6 +181,7 @@ declare const _default: {
|
|
|
170
181
|
rendererAppearance?: RendererAppearance;
|
|
171
182
|
allowColumnSorting?: boolean | undefined;
|
|
172
183
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
184
|
+
allowTableAlignment?: boolean | undefined;
|
|
173
185
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
174
186
|
};
|
|
175
187
|
new (props: import("@atlaskit/editor-common/utils").Diff<{
|
|
@@ -180,6 +192,7 @@ declare const _default: {
|
|
|
180
192
|
rendererAppearance?: RendererAppearance;
|
|
181
193
|
allowColumnSorting?: boolean | undefined;
|
|
182
194
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
195
|
+
allowTableAlignment?: boolean | undefined;
|
|
183
196
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>, context: any): {
|
|
184
197
|
render(): JSX.Element;
|
|
185
198
|
context: any;
|
|
@@ -191,6 +204,7 @@ declare const _default: {
|
|
|
191
204
|
rendererAppearance?: RendererAppearance;
|
|
192
205
|
allowColumnSorting?: boolean | undefined;
|
|
193
206
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
207
|
+
allowTableAlignment?: boolean | undefined;
|
|
194
208
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
195
209
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
196
210
|
readonly props: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
@@ -201,6 +215,7 @@ declare const _default: {
|
|
|
201
215
|
rendererAppearance?: RendererAppearance;
|
|
202
216
|
allowColumnSorting?: boolean | undefined;
|
|
203
217
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
218
|
+
allowTableAlignment?: boolean | undefined;
|
|
204
219
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>> & Readonly<{
|
|
205
220
|
children?: React.ReactNode;
|
|
206
221
|
}>;
|
|
@@ -217,6 +232,7 @@ declare const _default: {
|
|
|
217
232
|
rendererAppearance?: RendererAppearance;
|
|
218
233
|
allowColumnSorting?: boolean | undefined;
|
|
219
234
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
235
|
+
allowTableAlignment?: boolean | undefined;
|
|
220
236
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
221
237
|
componentWillUnmount?(): void;
|
|
222
238
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
@@ -228,6 +244,7 @@ declare const _default: {
|
|
|
228
244
|
rendererAppearance?: RendererAppearance;
|
|
229
245
|
allowColumnSorting?: boolean | undefined;
|
|
230
246
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
247
|
+
allowTableAlignment?: boolean | undefined;
|
|
231
248
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, prevState: Readonly<{}>): any;
|
|
232
249
|
componentDidUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
233
250
|
renderWidth?: number | undefined;
|
|
@@ -237,6 +254,7 @@ declare const _default: {
|
|
|
237
254
|
rendererAppearance?: RendererAppearance;
|
|
238
255
|
allowColumnSorting?: boolean | undefined;
|
|
239
256
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
257
|
+
allowTableAlignment?: boolean | undefined;
|
|
240
258
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
241
259
|
componentWillMount?(): void;
|
|
242
260
|
UNSAFE_componentWillMount?(): void;
|
|
@@ -248,6 +266,7 @@ declare const _default: {
|
|
|
248
266
|
rendererAppearance?: RendererAppearance;
|
|
249
267
|
allowColumnSorting?: boolean | undefined;
|
|
250
268
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
269
|
+
allowTableAlignment?: boolean | undefined;
|
|
251
270
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextContext: any): void;
|
|
252
271
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
253
272
|
renderWidth?: number | undefined;
|
|
@@ -257,6 +276,7 @@ declare const _default: {
|
|
|
257
276
|
rendererAppearance?: RendererAppearance;
|
|
258
277
|
allowColumnSorting?: boolean | undefined;
|
|
259
278
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
279
|
+
allowTableAlignment?: boolean | undefined;
|
|
260
280
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextContext: any): void;
|
|
261
281
|
componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
262
282
|
renderWidth?: number | undefined;
|
|
@@ -266,6 +286,7 @@ declare const _default: {
|
|
|
266
286
|
rendererAppearance?: RendererAppearance;
|
|
267
287
|
allowColumnSorting?: boolean | undefined;
|
|
268
288
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
289
|
+
allowTableAlignment?: boolean | undefined;
|
|
269
290
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
270
291
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
271
292
|
renderWidth?: number | undefined;
|
|
@@ -275,6 +296,7 @@ declare const _default: {
|
|
|
275
296
|
rendererAppearance?: RendererAppearance;
|
|
276
297
|
allowColumnSorting?: boolean | undefined;
|
|
277
298
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
299
|
+
allowTableAlignment?: boolean | undefined;
|
|
278
300
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
279
301
|
};
|
|
280
302
|
contextType?: React.Context<any> | undefined;
|
|
@@ -42,6 +42,7 @@ export interface ReactSerializerInit {
|
|
|
42
42
|
isInsideOfInlineExtension?: boolean;
|
|
43
43
|
textHighlighter?: TextHighlighter;
|
|
44
44
|
isCommentsOnMediaMediaInlineBugFixEnabled?: boolean;
|
|
45
|
+
allowTableAlignment?: boolean;
|
|
45
46
|
}
|
|
46
47
|
interface ParentInfo {
|
|
47
48
|
parentIsIncompleteTask: boolean;
|
|
@@ -90,6 +91,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
90
91
|
private isInsideOfInlineExtension?;
|
|
91
92
|
private isCommentsOnMediaMediaInlineBugFixEnabled?;
|
|
92
93
|
private textHighlighter?;
|
|
94
|
+
private allowTableAlignment?;
|
|
93
95
|
constructor(init: ReactSerializerInit);
|
|
94
96
|
private resetState;
|
|
95
97
|
private getNodeProps;
|
|
@@ -14,6 +14,7 @@ export type TableProps = SharedTableProps & {
|
|
|
14
14
|
rendererAppearance?: RendererAppearance;
|
|
15
15
|
allowColumnSorting?: boolean;
|
|
16
16
|
stickyHeaders?: StickyHeaderConfig;
|
|
17
|
+
allowTableAlignment?: boolean;
|
|
17
18
|
};
|
|
18
19
|
interface TableOrderStatus {
|
|
19
20
|
columnIndex: number;
|
|
@@ -67,6 +68,7 @@ declare const _default: {
|
|
|
67
68
|
rendererAppearance?: RendererAppearance;
|
|
68
69
|
allowColumnSorting?: boolean | undefined;
|
|
69
70
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
71
|
+
allowTableAlignment?: boolean | undefined;
|
|
70
72
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps> | Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
71
73
|
renderWidth?: number | undefined;
|
|
72
74
|
} & Omit<SharedTableProps & {
|
|
@@ -75,6 +77,7 @@ declare const _default: {
|
|
|
75
77
|
rendererAppearance?: RendererAppearance;
|
|
76
78
|
allowColumnSorting?: boolean | undefined;
|
|
77
79
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
80
|
+
allowTableAlignment?: boolean | undefined;
|
|
78
81
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>): {
|
|
79
82
|
render(): JSX.Element;
|
|
80
83
|
context: any;
|
|
@@ -86,6 +89,7 @@ declare const _default: {
|
|
|
86
89
|
rendererAppearance?: RendererAppearance;
|
|
87
90
|
allowColumnSorting?: boolean | undefined;
|
|
88
91
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
92
|
+
allowTableAlignment?: boolean | undefined;
|
|
89
93
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
90
94
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
91
95
|
readonly props: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
@@ -96,6 +100,7 @@ declare const _default: {
|
|
|
96
100
|
rendererAppearance?: RendererAppearance;
|
|
97
101
|
allowColumnSorting?: boolean | undefined;
|
|
98
102
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
103
|
+
allowTableAlignment?: boolean | undefined;
|
|
99
104
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>> & Readonly<{
|
|
100
105
|
children?: React.ReactNode;
|
|
101
106
|
}>;
|
|
@@ -112,6 +117,7 @@ declare const _default: {
|
|
|
112
117
|
rendererAppearance?: RendererAppearance;
|
|
113
118
|
allowColumnSorting?: boolean | undefined;
|
|
114
119
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
120
|
+
allowTableAlignment?: boolean | undefined;
|
|
115
121
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
116
122
|
componentWillUnmount?(): void;
|
|
117
123
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
@@ -123,6 +129,7 @@ declare const _default: {
|
|
|
123
129
|
rendererAppearance?: RendererAppearance;
|
|
124
130
|
allowColumnSorting?: boolean | undefined;
|
|
125
131
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
132
|
+
allowTableAlignment?: boolean | undefined;
|
|
126
133
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, prevState: Readonly<{}>): any;
|
|
127
134
|
componentDidUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
128
135
|
renderWidth?: number | undefined;
|
|
@@ -132,6 +139,7 @@ declare const _default: {
|
|
|
132
139
|
rendererAppearance?: RendererAppearance;
|
|
133
140
|
allowColumnSorting?: boolean | undefined;
|
|
134
141
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
142
|
+
allowTableAlignment?: boolean | undefined;
|
|
135
143
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
136
144
|
componentWillMount?(): void;
|
|
137
145
|
UNSAFE_componentWillMount?(): void;
|
|
@@ -143,6 +151,7 @@ declare const _default: {
|
|
|
143
151
|
rendererAppearance?: RendererAppearance;
|
|
144
152
|
allowColumnSorting?: boolean | undefined;
|
|
145
153
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
154
|
+
allowTableAlignment?: boolean | undefined;
|
|
146
155
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextContext: any): void;
|
|
147
156
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
148
157
|
renderWidth?: number | undefined;
|
|
@@ -152,6 +161,7 @@ declare const _default: {
|
|
|
152
161
|
rendererAppearance?: RendererAppearance;
|
|
153
162
|
allowColumnSorting?: boolean | undefined;
|
|
154
163
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
164
|
+
allowTableAlignment?: boolean | undefined;
|
|
155
165
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextContext: any): void;
|
|
156
166
|
componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
157
167
|
renderWidth?: number | undefined;
|
|
@@ -161,6 +171,7 @@ declare const _default: {
|
|
|
161
171
|
rendererAppearance?: RendererAppearance;
|
|
162
172
|
allowColumnSorting?: boolean | undefined;
|
|
163
173
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
174
|
+
allowTableAlignment?: boolean | undefined;
|
|
164
175
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
165
176
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
166
177
|
renderWidth?: number | undefined;
|
|
@@ -170,6 +181,7 @@ declare const _default: {
|
|
|
170
181
|
rendererAppearance?: RendererAppearance;
|
|
171
182
|
allowColumnSorting?: boolean | undefined;
|
|
172
183
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
184
|
+
allowTableAlignment?: boolean | undefined;
|
|
173
185
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
174
186
|
};
|
|
175
187
|
new (props: import("@atlaskit/editor-common/utils").Diff<{
|
|
@@ -180,6 +192,7 @@ declare const _default: {
|
|
|
180
192
|
rendererAppearance?: RendererAppearance;
|
|
181
193
|
allowColumnSorting?: boolean | undefined;
|
|
182
194
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
195
|
+
allowTableAlignment?: boolean | undefined;
|
|
183
196
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>, context: any): {
|
|
184
197
|
render(): JSX.Element;
|
|
185
198
|
context: any;
|
|
@@ -191,6 +204,7 @@ declare const _default: {
|
|
|
191
204
|
rendererAppearance?: RendererAppearance;
|
|
192
205
|
allowColumnSorting?: boolean | undefined;
|
|
193
206
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
207
|
+
allowTableAlignment?: boolean | undefined;
|
|
194
208
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
195
209
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
196
210
|
readonly props: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
@@ -201,6 +215,7 @@ declare const _default: {
|
|
|
201
215
|
rendererAppearance?: RendererAppearance;
|
|
202
216
|
allowColumnSorting?: boolean | undefined;
|
|
203
217
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
218
|
+
allowTableAlignment?: boolean | undefined;
|
|
204
219
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>> & Readonly<{
|
|
205
220
|
children?: React.ReactNode;
|
|
206
221
|
}>;
|
|
@@ -217,6 +232,7 @@ declare const _default: {
|
|
|
217
232
|
rendererAppearance?: RendererAppearance;
|
|
218
233
|
allowColumnSorting?: boolean | undefined;
|
|
219
234
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
235
|
+
allowTableAlignment?: boolean | undefined;
|
|
220
236
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
221
237
|
componentWillUnmount?(): void;
|
|
222
238
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
@@ -228,6 +244,7 @@ declare const _default: {
|
|
|
228
244
|
rendererAppearance?: RendererAppearance;
|
|
229
245
|
allowColumnSorting?: boolean | undefined;
|
|
230
246
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
247
|
+
allowTableAlignment?: boolean | undefined;
|
|
231
248
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, prevState: Readonly<{}>): any;
|
|
232
249
|
componentDidUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
233
250
|
renderWidth?: number | undefined;
|
|
@@ -237,6 +254,7 @@ declare const _default: {
|
|
|
237
254
|
rendererAppearance?: RendererAppearance;
|
|
238
255
|
allowColumnSorting?: boolean | undefined;
|
|
239
256
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
257
|
+
allowTableAlignment?: boolean | undefined;
|
|
240
258
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
241
259
|
componentWillMount?(): void;
|
|
242
260
|
UNSAFE_componentWillMount?(): void;
|
|
@@ -248,6 +266,7 @@ declare const _default: {
|
|
|
248
266
|
rendererAppearance?: RendererAppearance;
|
|
249
267
|
allowColumnSorting?: boolean | undefined;
|
|
250
268
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
269
|
+
allowTableAlignment?: boolean | undefined;
|
|
251
270
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextContext: any): void;
|
|
252
271
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
253
272
|
renderWidth?: number | undefined;
|
|
@@ -257,6 +276,7 @@ declare const _default: {
|
|
|
257
276
|
rendererAppearance?: RendererAppearance;
|
|
258
277
|
allowColumnSorting?: boolean | undefined;
|
|
259
278
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
279
|
+
allowTableAlignment?: boolean | undefined;
|
|
260
280
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextContext: any): void;
|
|
261
281
|
componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
262
282
|
renderWidth?: number | undefined;
|
|
@@ -266,6 +286,7 @@ declare const _default: {
|
|
|
266
286
|
rendererAppearance?: RendererAppearance;
|
|
267
287
|
allowColumnSorting?: boolean | undefined;
|
|
268
288
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
289
|
+
allowTableAlignment?: boolean | undefined;
|
|
269
290
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
270
291
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<{
|
|
271
292
|
renderWidth?: number | undefined;
|
|
@@ -275,6 +296,7 @@ declare const _default: {
|
|
|
275
296
|
rendererAppearance?: RendererAppearance;
|
|
276
297
|
allowColumnSorting?: boolean | undefined;
|
|
277
298
|
stickyHeaders?: StickyHeaderConfig | undefined;
|
|
299
|
+
allowTableAlignment?: boolean | undefined;
|
|
278
300
|
} & WithSmartCardStorageProps, "renderWidth">, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
279
301
|
};
|
|
280
302
|
contextType?: React.Context<any> | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.
|
|
3
|
+
"version": "109.49.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
32
32
|
"@atlaskit/button": "^20.0.0",
|
|
33
33
|
"@atlaskit/code": "^15.5.0",
|
|
34
|
-
"@atlaskit/editor-common": "^87.
|
|
34
|
+
"@atlaskit/editor-common": "^87.12.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.18.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.6.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@atlaskit/link-datasource": "^2.11.0",
|
|
43
43
|
"@atlaskit/media-card": "^78.0.0",
|
|
44
44
|
"@atlaskit/media-client": "^27.3.0",
|
|
45
|
-
"@atlaskit/media-client-react": "^2.
|
|
46
|
-
"@atlaskit/media-common": "^11.
|
|
45
|
+
"@atlaskit/media-client-react": "^2.1.0",
|
|
46
|
+
"@atlaskit/media-common": "^11.4.0",
|
|
47
47
|
"@atlaskit/media-filmstrip": "^47.2.0",
|
|
48
48
|
"@atlaskit/media-ui": "^25.11.0",
|
|
49
49
|
"@atlaskit/media-viewer": "^48.7.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@atlaskit/link-provider": "^1.14.0",
|
|
67
|
-
"@atlaskit/media-core": "^34.
|
|
67
|
+
"@atlaskit/media-core": "^34.3.0",
|
|
68
68
|
"react": "^16.8.0",
|
|
69
69
|
"react-dom": "^16.8.0"
|
|
70
70
|
},
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@atlaskit/link-provider": "^1.14.0",
|
|
78
78
|
"@atlaskit/link-test-helpers": "^7.4.0",
|
|
79
79
|
"@atlaskit/linking-common": "^5.11.0",
|
|
80
|
-
"@atlaskit/media-core": "^34.
|
|
80
|
+
"@atlaskit/media-core": "^34.3.0",
|
|
81
81
|
"@atlaskit/media-integration-test-helpers": "^3.1.0",
|
|
82
82
|
"@atlaskit/media-test-helpers": "^34.0.0",
|
|
83
83
|
"@atlaskit/mention": "^23.2.0",
|
|
@@ -152,6 +152,9 @@
|
|
|
152
152
|
"platform.comments-on-media.bug.incorrect-badge-highlight": {
|
|
153
153
|
"type": "boolean"
|
|
154
154
|
},
|
|
155
|
+
"platform_editor_insert_media_plugin_phase_one": {
|
|
156
|
+
"type": "boolean"
|
|
157
|
+
},
|
|
155
158
|
"platform-fix-table-ssr-resizing": {
|
|
156
159
|
"type": "boolean"
|
|
157
160
|
},
|