@atlaskit/renderer 124.6.0 → 124.7.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 +25 -0
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +9 -1
- package/dist/cjs/react/nodes/media/index.js +13 -106
- package/dist/cjs/react/nodes/mediaSingle/index.js +2 -2
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +34 -3
- package/dist/cjs/ui/Renderer/breakout-ssr.js +12 -3
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +12 -1
- package/dist/es2019/react/nodes/media/index.js +4 -84
- package/dist/es2019/react/nodes/mediaSingle/index.js +2 -2
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +36 -3
- package/dist/es2019/ui/Renderer/breakout-ssr.js +16 -10
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +9 -1
- package/dist/esm/react/nodes/media/index.js +14 -107
- package/dist/esm/react/nodes/mediaSingle/index.js +2 -2
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +35 -4
- package/dist/esm/ui/Renderer/breakout-ssr.js +12 -3
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +9 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 124.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5771b6f88f16a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5771b6f88f16a) -
|
|
8
|
+
Clean up platform_editor_fix_image_size_diff_during_ssr
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 124.7.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`5167552fe1a93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5167552fe1a93) -
|
|
16
|
+
[EDITOR-2339] Bump @atlaskit/adf-schema to 51.3.0
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`685d27211d400`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/685d27211d400) -
|
|
21
|
+
[ux] Adjust codeblock font size relative to parent
|
|
22
|
+
- [`c21648c080e0c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c21648c080e0c) -
|
|
23
|
+
[ux] EDITOR-2291: Tighten list and task spacing in dense content mode
|
|
24
|
+
- [`2bdec5e9ec1c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bdec5e9ec1c9) -
|
|
25
|
+
[EDITOR-442] Cleans up FG platform_editor_add_media_from_url_rollout
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 124.6.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -9,6 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
14
|
var _codeBlockButtonContainer = _interopRequireDefault(require("./codeBlockButtonContainer"));
|
|
13
15
|
/**
|
|
14
16
|
* @jsxRuntime classic
|
|
@@ -39,6 +41,12 @@ var codeBlockStyleOverrides = (0, _react.css)((0, _defineProperty2.default)({
|
|
|
39
41
|
backgroundAttachment: 'local, local, local, local, scroll, scroll, scroll, scroll',
|
|
40
42
|
backgroundPosition: '0 0, 0 0, 100% 0, 100% 0, 100% 0, 100% 0, 0 0, 0 0'
|
|
41
43
|
}));
|
|
44
|
+
var denseModeOverrides = (0, _react.css)((0, _defineProperty2.default)({}, "".concat(_styles.CodeBlockSharedCssClassName.DS_CODEBLOCK), {
|
|
45
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
46
|
+
fontSize: '0.875em',
|
|
47
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
48
|
+
lineHeight: '1.5em'
|
|
49
|
+
}));
|
|
42
50
|
var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
43
51
|
var allowCopyToClipboard = _ref.allowCopyToClipboard,
|
|
44
52
|
allowWrapCodeBlock = _ref.allowWrapCodeBlock,
|
|
@@ -52,7 +60,7 @@ var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
|
52
60
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
53
61
|
className: className,
|
|
54
62
|
"data-local-id": localId,
|
|
55
|
-
css: codeBlockStyleOverrides
|
|
63
|
+
css: [codeBlockStyleOverrides, (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') && denseModeOverrides]
|
|
56
64
|
}, (0, _react.jsx)(_codeBlockButtonContainer.default, {
|
|
57
65
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
58
66
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
@@ -26,17 +26,14 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
26
26
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
27
27
|
var _utils = require("../../../utils");
|
|
28
28
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
29
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
29
|
var _events = require("../../../analytics/events");
|
|
31
30
|
var _annotation = _interopRequireDefault(require("../../marks/annotation"));
|
|
32
31
|
var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
33
|
-
var _reactIntlNext = require("react-intl-next");
|
|
34
32
|
var _useInlineCommentsFilter = require("../../../ui/annotations/hooks/use-inline-comments-filter");
|
|
35
33
|
var _useInlineCommentSubscriber = require("../../../ui/annotations/hooks/use-inline-comment-subscriber");
|
|
36
34
|
var _types = require("@atlaskit/editor-common/types");
|
|
37
35
|
var _AnnotationRangeContext = require("../../../ui/annotations/contexts/AnnotationRangeContext");
|
|
38
|
-
var _excluded = ["marks", "mediaSingleElement", "isDrafting"]
|
|
39
|
-
_excluded2 = ["marks", "mediaSingleElement", "isDrafting"];
|
|
36
|
+
var _excluded = ["marks", "mediaSingleElement", "isDrafting"];
|
|
40
37
|
/**
|
|
41
38
|
* @jsxRuntime classic
|
|
42
39
|
* @jsx jsx
|
|
@@ -149,7 +146,6 @@ var _MediaAnnotations = function MediaAnnotations(_ref4) {
|
|
|
149
146
|
marks: otherMarks
|
|
150
147
|
}, children) : (0, _react2.jsx)(_react.Fragment, null, children)));
|
|
151
148
|
};
|
|
152
|
-
var CommentBadge = (0, _reactIntlNext.injectIntl)(_mediaSingle.CommentBadge);
|
|
153
149
|
var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
154
150
|
var _marks$map;
|
|
155
151
|
var marks = _ref5.marks,
|
|
@@ -213,89 +209,6 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
213
209
|
});
|
|
214
210
|
}
|
|
215
211
|
};
|
|
216
|
-
return (0, _react2.jsx)(CommentBadge, (0, _extends2.default)({
|
|
217
|
-
onMouseEnter: function onMouseEnter() {
|
|
218
|
-
return setEntered(true);
|
|
219
|
-
},
|
|
220
|
-
onMouseLeave: function onMouseLeave() {
|
|
221
|
-
return setEntered(false);
|
|
222
|
-
},
|
|
223
|
-
status: entered ? 'entered' : status,
|
|
224
|
-
onClick: onClick
|
|
225
|
-
// Ignored via go/ees005
|
|
226
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
227
|
-
}, rest));
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Remove CommentBadgeWrapper component above
|
|
232
|
-
* and rename CommentBadgeNextWrapper to CommentBadgeWrapper
|
|
233
|
-
* when clean up platform_editor_add_media_from_url feature flag
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref6) {
|
|
237
|
-
var _marks$map2;
|
|
238
|
-
var marks = _ref6.marks,
|
|
239
|
-
mediaSingleElement = _ref6.mediaSingleElement,
|
|
240
|
-
_ref6$isDrafting = _ref6.isDrafting,
|
|
241
|
-
isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
|
|
242
|
-
rest = (0, _objectWithoutProperties2.default)(_ref6, _excluded2);
|
|
243
|
-
var _useState5 = (0, _react.useState)('default'),
|
|
244
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
245
|
-
status = _useState6[0],
|
|
246
|
-
setStatus = _useState6[1];
|
|
247
|
-
var _useState7 = (0, _react.useState)(false),
|
|
248
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
249
|
-
entered = _useState8[0],
|
|
250
|
-
setEntered = _useState8[1];
|
|
251
|
-
var updateSubscriber = (0, _useInlineCommentSubscriber.useInlineCommentSubscriberContext)();
|
|
252
|
-
var activeParentIds = (0, _useInlineCommentsFilter.useInlineCommentsFilter)({
|
|
253
|
-
annotationIds: (_marks$map2 = marks === null || marks === void 0 ? void 0 : marks.map(function (mark) {
|
|
254
|
-
return mark.attrs.id;
|
|
255
|
-
})) !== null && _marks$map2 !== void 0 ? _marks$map2 : [''],
|
|
256
|
-
filter: {
|
|
257
|
-
state: _adfSchema.AnnotationMarkStates.ACTIVE
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
(0, _react.useEffect)(function () {
|
|
261
|
-
var observer = new MutationObserver(function (mutationList) {
|
|
262
|
-
mutationList.forEach(function (mutation) {
|
|
263
|
-
var parentNode = mutation.target.parentNode;
|
|
264
|
-
if (mutation.attributeName === 'data-has-focus') {
|
|
265
|
-
var isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
266
|
-
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && !isMediaCaption;
|
|
267
|
-
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
if (mediaSingleElement) {
|
|
272
|
-
observer.observe(mediaSingleElement, {
|
|
273
|
-
attributes: true,
|
|
274
|
-
subtree: true,
|
|
275
|
-
attributeFilter: ['data-has-focus']
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
return function () {
|
|
279
|
-
observer.disconnect();
|
|
280
|
-
};
|
|
281
|
-
}, [mediaSingleElement, setStatus]);
|
|
282
|
-
if (!isDrafting && !activeParentIds.length) {
|
|
283
|
-
return null;
|
|
284
|
-
}
|
|
285
|
-
var onClick = function onClick(e) {
|
|
286
|
-
e.preventDefault();
|
|
287
|
-
if (updateSubscriber) {
|
|
288
|
-
updateSubscriber.emit(_types.AnnotationUpdateEvent.ON_ANNOTATION_CLICK, {
|
|
289
|
-
annotationIds: activeParentIds,
|
|
290
|
-
// Ignored via go/ees005
|
|
291
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
292
|
-
eventTarget: e.target,
|
|
293
|
-
// use mediaSingle here to align with annotation viewed event dispatched in editor
|
|
294
|
-
eventTargetType: 'mediaSingle',
|
|
295
|
-
viewMethod: _analytics.VIEW_METHOD.BADGE
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
212
|
return (0, _react2.jsx)(_mediaSingle.CommentBadgeNext, (0, _extends2.default)({
|
|
300
213
|
onMouseEnter: function onMouseEnter() {
|
|
301
214
|
return setEntered(true);
|
|
@@ -353,27 +266,21 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
353
266
|
data: (0, _defineProperty2.default)({}, _analyticsNamespacedContext.MEDIA_CONTEXT, {
|
|
354
267
|
border: !!borderMark
|
|
355
268
|
})
|
|
356
|
-
}, (0,
|
|
269
|
+
}, (0, _react2.jsx)(_mediaSingle.MediaBadges, {
|
|
357
270
|
mediaElement: mediaSingleElement,
|
|
358
271
|
mediaWidth: width,
|
|
359
272
|
mediaHeight: height,
|
|
360
273
|
useMinimumZIndex: true
|
|
361
|
-
}, function (
|
|
362
|
-
var visible =
|
|
274
|
+
}, function (_ref7) {
|
|
275
|
+
var visible = _ref7.visible;
|
|
363
276
|
return (0, _react2.jsx)(_react.default.Fragment, null, visible && (0, _react2.jsx)(_mediaSingle.ExternalImageBadge, {
|
|
364
277
|
type: _this.props.type,
|
|
365
278
|
url: _this.props.type === 'external' ? _this.props.url : undefined
|
|
366
|
-
}), showCommentBadge && (0, _react2.jsx)(
|
|
279
|
+
}), showCommentBadge && (0, _react2.jsx)(CommentBadgeWrapper, {
|
|
367
280
|
marks: annotationMarks,
|
|
368
281
|
mediaSingleElement: mediaSingleElement,
|
|
369
282
|
isDrafting: isDrafting
|
|
370
283
|
}));
|
|
371
|
-
}), !(0, _platformFeatureFlags.fg)('platform_editor_add_media_from_url_rollout') && showCommentBadge && (0, _react2.jsx)(CommentBadgeWrapper, {
|
|
372
|
-
marks: annotationMarks,
|
|
373
|
-
mediaSingleElement: mediaSingleElement,
|
|
374
|
-
width: width,
|
|
375
|
-
height: height,
|
|
376
|
-
isDrafting: isDrafting
|
|
377
284
|
}), (0, _react2.jsx)(_MediaCard.MediaCard, (0, _extends2.default)({
|
|
378
285
|
contextIdentifierProvider: contextIdentifierProvider
|
|
379
286
|
// Ignored via go/ees005
|
|
@@ -436,14 +343,14 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
436
343
|
draftPosition = _useAnnotationRangeSt.hoverDraftDocumentPosition;
|
|
437
344
|
var dataAttributes = props.dataAttributes;
|
|
438
345
|
var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
position =
|
|
442
|
-
setPosition =
|
|
443
|
-
var
|
|
444
|
-
|
|
445
|
-
shouldApplyDraftAnnotation =
|
|
446
|
-
setShouldApplyDraftAnnotation =
|
|
346
|
+
var _useState5 = (0, _react.useState)(),
|
|
347
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
348
|
+
position = _useState6[0],
|
|
349
|
+
setPosition = _useState6[1];
|
|
350
|
+
var _useState7 = (0, _react.useState)(false),
|
|
351
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
352
|
+
shouldApplyDraftAnnotation = _useState8[0],
|
|
353
|
+
setShouldApplyDraftAnnotation = _useState8[1];
|
|
447
354
|
(0, _react.useEffect)(function () {
|
|
448
355
|
var _draftPosition$from;
|
|
449
356
|
if (pos === undefined) {
|
|
@@ -12,9 +12,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
14
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
16
17
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
18
|
var _style = require("../../../ui/Renderer/style");
|
|
19
19
|
var _AnnotationRangeContext = require("../../../ui/annotations/contexts/AnnotationRangeContext");
|
|
20
20
|
var _AnnotationHoverContext = require("../../../ui/annotations/contexts/AnnotationHoverContext");
|
|
@@ -148,7 +148,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
|
|
|
148
148
|
height: "100%"
|
|
149
149
|
};
|
|
150
150
|
} else {
|
|
151
|
-
var _maxWidth = (0, _coreUtils.isSSR)() && widthAttr && typeof widthAttr === 'number'
|
|
151
|
+
var _maxWidth = (0, _coreUtils.isSSR)() && widthAttr && typeof widthAttr === 'number' ? Math.max(widthAttr, containerWidth) : containerWidth;
|
|
152
152
|
var maxHeight = height / width * _maxWidth;
|
|
153
153
|
cardDimensions = {
|
|
154
154
|
width: "".concat(_maxWidth, "px"),
|
|
@@ -1522,7 +1522,9 @@ var rendererAnnotationStylesCommentHeightFix = (0, _react.css)({
|
|
|
1522
1522
|
paddingTop: "var(--ds-space-025, 2px)"
|
|
1523
1523
|
}
|
|
1524
1524
|
});
|
|
1525
|
-
var
|
|
1525
|
+
var RENDERER_LIST_DENSE_GAP = "max(0px,calc((var(--ak-renderer-base-font-size) - ".concat(_editorSharedStyles.akEditorFullPageDenseFontSize, "px)* (4/3)))");
|
|
1526
|
+
var TASKLIST_CONTAINER_DENSE_MARGIN = "max(calc(10px + (var(--ak-renderer-base-font-size) - ".concat(_editorSharedStyles.akEditorFullPageDenseFontSize, "px) *( 2 / 3)))");
|
|
1527
|
+
var denseStyles = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_emoji.EmojiSharedCssClassName.EMOJI_IMAGE), {
|
|
1526
1528
|
height: "calc(".concat(_emoji.defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, ")"),
|
|
1527
1529
|
width: "calc(".concat(_emoji.defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, ")"),
|
|
1528
1530
|
maxHeight: "calc(".concat(_emoji.defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(_editorSharedStyles.akEditorFullPageDefaultFontSize, ")"),
|
|
@@ -1535,6 +1537,35 @@ var denseStyles = (0, _react.css)((0, _defineProperty2.default)((0, _definePrope
|
|
|
1535
1537
|
}), ".".concat(_consts.RendererCssClassName.DOCUMENT, " .ak-editor-panel .ak-editor-panel__icon"), {
|
|
1536
1538
|
height: "var(--ds-space-250, 20px)",
|
|
1537
1539
|
width: "var(--ds-space-250, 20px)"
|
|
1540
|
+
}), ".".concat(_consts.RendererCssClassName.DOCUMENT), {
|
|
1541
|
+
// Adjacent list items
|
|
1542
|
+
'li + li': {
|
|
1543
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1544
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1545
|
+
},
|
|
1546
|
+
// Nested lists directly under an li (unordered and ordered)
|
|
1547
|
+
'li > ul, li > ol, .ak-ul li > ul, .ak-ul li > ol, .ak-ol li > ul, .ak-ol li > ol': {
|
|
1548
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1549
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1550
|
+
},
|
|
1551
|
+
// Task lists
|
|
1552
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1553
|
+
'[data-task-list-local-id]': {
|
|
1554
|
+
// Task lists: container top margin
|
|
1555
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1556
|
+
marginTop: TASKLIST_CONTAINER_DENSE_MARGIN
|
|
1557
|
+
},
|
|
1558
|
+
// Task lists: sibling items and nested lists
|
|
1559
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1560
|
+
'[data-task-list-local-id] > * + *': {
|
|
1561
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1562
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1563
|
+
},
|
|
1564
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1565
|
+
'[data-task-list-local-id] [data-task-list-local-id], [data-task-local-id] [data-task-local-id]': {
|
|
1566
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1567
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1568
|
+
}
|
|
1538
1569
|
}));
|
|
1539
1570
|
var RendererStyleContainer = exports.RendererStyleContainer = function RendererStyleContainer(props) {
|
|
1540
1571
|
var onClick = props.onClick,
|
|
@@ -1571,13 +1602,13 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
1571
1602
|
'--ak-renderer-editor-font-heading-h6': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.heading.h6')),
|
|
1572
1603
|
'--ak-renderer-editor-font-normal-text': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.body'))
|
|
1573
1604
|
},
|
|
1574
|
-
css: [baseStyles,
|
|
1605
|
+
css: [baseStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, !(0, _platformFeatureFlags.fg)('aifc_create_enabled') && telepointerStyles, (0, _platformFeatureFlags.fg)('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') && extensionStyle, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, _browser.browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, (0, _expValEquals.expValEquals)('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1575
1606
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1576
1607
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, (0, _platformFeatureFlags.fg)('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1577
1608
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
1578
1609
|
(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && (0, _platformFeatureFlags.fg)('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1579
1610
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
1580
|
-
(0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, (0, _table.isStickyScrollbarEnabled)(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, (0, _platformFeatureFlags.fg)('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, _browser.browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, appearance === 'full-width' && responsiveBreakoutWidthFullWidth],
|
|
1611
|
+
(0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, (0, _table.isStickyScrollbarEnabled)(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, (0, _platformFeatureFlags.fg)('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, _browser.browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, appearance === 'full-width' && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') && denseStyles],
|
|
1581
1612
|
"data-testid": testId
|
|
1582
1613
|
}, children)
|
|
1583
1614
|
);
|
|
@@ -48,13 +48,22 @@ function BreakoutSSRInlineScript(_ref) {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
function createBreakoutInlineScript(id, shouldSkipScript) {
|
|
51
|
-
|
|
51
|
+
var flags = {
|
|
52
|
+
platform_editor_fix_media_in_renderer: (0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer')
|
|
53
|
+
};
|
|
54
|
+
return "(function(window){\nif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) { return; }\n".concat(breakoutInlineScriptContext, ";\n(").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(JSON.stringify(shouldSkipScript), ", ").concat(JSON.stringify(flags), ");\n})(window);\n");
|
|
52
55
|
}
|
|
53
56
|
var breakoutInlineScriptContext = exports.breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(_utils.breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(_utils.breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(_utils.breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(_utils.breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(_utils.breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(_utils.breakoutConsts.calcWideWidth.toString(), ";\n breakoutConsts.FullPagePadding = ").concat(_style.FullPagePadding.toString(), ";\n");
|
|
54
57
|
|
|
58
|
+
/**
|
|
59
|
+
* WARNING: NO EXTERNAL FUNCTION CALL IN THIS FUNCTION
|
|
60
|
+
* This function will be put to DOM as an inline script.
|
|
61
|
+
* It can not have any external function dependency.
|
|
62
|
+
* All required data must be passed in as serializable parameters.
|
|
63
|
+
*/
|
|
55
64
|
// Ignored via go/ees005
|
|
56
65
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
-
function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
66
|
+
function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript, flags) {
|
|
58
67
|
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
59
68
|
var WIDE_LAYOUT_MODES = ['full-width', 'wide', 'custom'];
|
|
60
69
|
function findUp(element, condition) {
|
|
@@ -101,7 +110,7 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
101
110
|
if (!mode || !WIDE_LAYOUT_MODES.includes(mode) ||
|
|
102
111
|
// skip apply width styling to mediaSingle node with pixel width to avoid image size changing
|
|
103
112
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
104
|
-
isMediaSingleWithPixelWidth &&
|
|
113
|
+
isMediaSingleWithPixelWidth && flags['platform_editor_fix_media_in_renderer']) {
|
|
105
114
|
return;
|
|
106
115
|
}
|
|
107
116
|
|
|
@@ -68,7 +68,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
68
68
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
69
69
|
var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
70
70
|
var packageName = "@atlaskit/renderer";
|
|
71
|
-
var packageVersion = "
|
|
71
|
+
var packageVersion = "124.7.0";
|
|
72
72
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
73
73
|
containerName: 'ak-renderer-wrapper',
|
|
74
74
|
containerType: 'inline-size'
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { jsx, css } from '@emotion/react';
|
|
7
7
|
import { N20 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
11
|
import CodeBlockButtonContainer from './codeBlockButtonContainer';
|
|
10
12
|
const codeBlockStyleOverrides = css({
|
|
11
13
|
tabSize: 4,
|
|
@@ -64,6 +66,15 @@ const codeBlockStyleOverrides = css({
|
|
|
64
66
|
backgroundPosition: '0 0, 0 0, 100% 0, 100% 0, 100% 0, 100% 0, 0 0, 0 0'
|
|
65
67
|
}
|
|
66
68
|
});
|
|
69
|
+
const denseModeOverrides = css({
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
71
|
+
[`${CodeBlockSharedCssClassName.DS_CODEBLOCK}`]: {
|
|
72
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
73
|
+
fontSize: '0.875em',
|
|
74
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
75
|
+
lineHeight: '1.5em'
|
|
76
|
+
}
|
|
77
|
+
});
|
|
67
78
|
const CodeBlockContainer = ({
|
|
68
79
|
allowCopyToClipboard,
|
|
69
80
|
allowWrapCodeBlock,
|
|
@@ -78,7 +89,7 @@ const CodeBlockContainer = ({
|
|
|
78
89
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
79
90
|
className: className,
|
|
80
91
|
"data-local-id": localId,
|
|
81
|
-
css: codeBlockStyleOverrides
|
|
92
|
+
css: [codeBlockStyleOverrides, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && denseModeOverrides]
|
|
82
93
|
}, jsx(CodeBlockButtonContainer, {
|
|
83
94
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
84
95
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
@@ -18,11 +18,9 @@ import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
|
18
18
|
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
|
|
19
19
|
import { getEventHandler } from '../../../utils';
|
|
20
20
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, VIEW_METHOD } from '@atlaskit/editor-common/analytics';
|
|
21
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
21
|
import { MODE, PLATFORM } from '../../../analytics/events';
|
|
23
22
|
import AnnotationComponent from '../../marks/annotation';
|
|
24
|
-
import {
|
|
25
|
-
import { injectIntl } from 'react-intl-next';
|
|
23
|
+
import { CommentBadgeNext, ExternalImageBadge, MediaBadges } from '@atlaskit/editor-common/media-single';
|
|
26
24
|
import { useInlineCommentsFilter } from '../../../ui/annotations/hooks/use-inline-comments-filter';
|
|
27
25
|
import { useInlineCommentSubscriberContext } from '../../../ui/annotations/hooks/use-inline-comment-subscriber';
|
|
28
26
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
@@ -131,7 +129,6 @@ const MediaAnnotations = ({
|
|
|
131
129
|
marks: otherMarks
|
|
132
130
|
}, children) : jsx(Fragment, null, children)));
|
|
133
131
|
};
|
|
134
|
-
const CommentBadge = injectIntl(CommentBadgeComponent);
|
|
135
132
|
const CommentBadgeWrapper = ({
|
|
136
133
|
marks,
|
|
137
134
|
mediaSingleElement,
|
|
@@ -187,77 +184,6 @@ const CommentBadgeWrapper = ({
|
|
|
187
184
|
});
|
|
188
185
|
}
|
|
189
186
|
};
|
|
190
|
-
return jsx(CommentBadge, _extends({
|
|
191
|
-
onMouseEnter: () => setEntered(true),
|
|
192
|
-
onMouseLeave: () => setEntered(false),
|
|
193
|
-
status: entered ? 'entered' : status,
|
|
194
|
-
onClick: onClick
|
|
195
|
-
// Ignored via go/ees005
|
|
196
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
197
|
-
}, rest));
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Remove CommentBadgeWrapper component above
|
|
202
|
-
* and rename CommentBadgeNextWrapper to CommentBadgeWrapper
|
|
203
|
-
* when clean up platform_editor_add_media_from_url feature flag
|
|
204
|
-
*/
|
|
205
|
-
|
|
206
|
-
const CommentBadgeNextWrapper = ({
|
|
207
|
-
marks,
|
|
208
|
-
mediaSingleElement,
|
|
209
|
-
isDrafting = false,
|
|
210
|
-
...rest
|
|
211
|
-
}) => {
|
|
212
|
-
var _marks$map2;
|
|
213
|
-
const [status, setStatus] = useState('default');
|
|
214
|
-
const [entered, setEntered] = useState(false);
|
|
215
|
-
const updateSubscriber = useInlineCommentSubscriberContext();
|
|
216
|
-
const activeParentIds = useInlineCommentsFilter({
|
|
217
|
-
annotationIds: (_marks$map2 = marks === null || marks === void 0 ? void 0 : marks.map(mark => mark.attrs.id)) !== null && _marks$map2 !== void 0 ? _marks$map2 : [''],
|
|
218
|
-
filter: {
|
|
219
|
-
state: AnnotationMarkStates.ACTIVE
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
useEffect(() => {
|
|
223
|
-
const observer = new MutationObserver(mutationList => {
|
|
224
|
-
mutationList.forEach(mutation => {
|
|
225
|
-
const parentNode = mutation.target.parentNode;
|
|
226
|
-
if (mutation.attributeName === 'data-has-focus') {
|
|
227
|
-
const isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
228
|
-
const elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && !isMediaCaption;
|
|
229
|
-
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
if (mediaSingleElement) {
|
|
234
|
-
observer.observe(mediaSingleElement, {
|
|
235
|
-
attributes: true,
|
|
236
|
-
subtree: true,
|
|
237
|
-
attributeFilter: ['data-has-focus']
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
return () => {
|
|
241
|
-
observer.disconnect();
|
|
242
|
-
};
|
|
243
|
-
}, [mediaSingleElement, setStatus]);
|
|
244
|
-
if (!isDrafting && !activeParentIds.length) {
|
|
245
|
-
return null;
|
|
246
|
-
}
|
|
247
|
-
const onClick = e => {
|
|
248
|
-
e.preventDefault();
|
|
249
|
-
if (updateSubscriber) {
|
|
250
|
-
updateSubscriber.emit(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, {
|
|
251
|
-
annotationIds: activeParentIds,
|
|
252
|
-
// Ignored via go/ees005
|
|
253
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
254
|
-
eventTarget: e.target,
|
|
255
|
-
// use mediaSingle here to align with annotation viewed event dispatched in editor
|
|
256
|
-
eventTargetType: 'mediaSingle',
|
|
257
|
-
viewMethod: VIEW_METHOD.BADGE
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
187
|
return jsx(CommentBadgeNext, _extends({
|
|
262
188
|
onMouseEnter: () => setEntered(true),
|
|
263
189
|
onMouseLeave: () => setEntered(false),
|
|
@@ -312,7 +238,7 @@ class Media extends PureComponent {
|
|
|
312
238
|
border: !!borderMark
|
|
313
239
|
}
|
|
314
240
|
}
|
|
315
|
-
},
|
|
241
|
+
}, jsx(MediaBadges, {
|
|
316
242
|
mediaElement: mediaSingleElement,
|
|
317
243
|
mediaWidth: width,
|
|
318
244
|
mediaHeight: height,
|
|
@@ -322,17 +248,11 @@ class Media extends PureComponent {
|
|
|
322
248
|
}) => jsx(React.Fragment, null, visible && jsx(ExternalImageBadge, {
|
|
323
249
|
type: this.props.type,
|
|
324
250
|
url: this.props.type === 'external' ? this.props.url : undefined
|
|
325
|
-
}), showCommentBadge && jsx(
|
|
326
|
-
marks: annotationMarks,
|
|
327
|
-
mediaSingleElement: mediaSingleElement,
|
|
328
|
-
isDrafting: isDrafting
|
|
329
|
-
}))), !fg('platform_editor_add_media_from_url_rollout') && showCommentBadge && jsx(CommentBadgeWrapper, {
|
|
251
|
+
}), showCommentBadge && jsx(CommentBadgeWrapper, {
|
|
330
252
|
marks: annotationMarks,
|
|
331
253
|
mediaSingleElement: mediaSingleElement,
|
|
332
|
-
width: width,
|
|
333
|
-
height: height,
|
|
334
254
|
isDrafting: isDrafting
|
|
335
|
-
}), jsx(MediaCard, _extends({
|
|
255
|
+
}))), jsx(MediaCard, _extends({
|
|
336
256
|
contextIdentifierProvider: contextIdentifierProvider
|
|
337
257
|
// Ignored via go/ees005
|
|
338
258
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -9,9 +9,9 @@ import { default as React, Fragment, useCallback, useContext, useMemo, useEffect
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { injectIntl } from 'react-intl-next';
|
|
11
11
|
import { MediaSingle as UIMediaSingle, WidthContext } from '@atlaskit/editor-common/ui';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
13
14
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
16
16
|
import { useAnnotationRangeDispatch } from '../../../ui/annotations/contexts/AnnotationRangeContext';
|
|
17
17
|
import { useAnnotationHoverDispatch } from '../../../ui/annotations/contexts/AnnotationHoverContext';
|
|
@@ -135,7 +135,7 @@ const MediaSingleWithChildren = props => {
|
|
|
135
135
|
height: `100%`
|
|
136
136
|
};
|
|
137
137
|
} else {
|
|
138
|
-
const maxWidth = isSSR() && widthAttr && typeof widthAttr === 'number'
|
|
138
|
+
const maxWidth = isSSR() && widthAttr && typeof widthAttr === 'number' ? Math.max(widthAttr, containerWidth) : containerWidth;
|
|
139
139
|
const maxHeight = height / width * maxWidth;
|
|
140
140
|
cardDimensions = {
|
|
141
141
|
width: `${maxWidth}px`,
|
|
@@ -13,7 +13,7 @@ import { FullPagePadding } from './style';
|
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
15
15
|
import { RendererCssClassName } from '../../consts';
|
|
16
|
-
import { akEditorBlockquoteBorderColor, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, scaledBlockNodesVerticalMargin, gridMediumMaxWidth, akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
16
|
+
import { akEditorBlockquoteBorderColor, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, scaledBlockNodesVerticalMargin, gridMediumMaxWidth, akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
17
17
|
import { INLINE_IMAGE_WRAPPER_CLASS_NAME } from '@atlaskit/editor-common/media-inline';
|
|
18
18
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
19
19
|
import { CodeBlockSharedCssClassName, DateSharedCssClassName, listItemCounterPadding, richMediaClassName, SmartCardSharedCssClassName, tableCellBorderWidth, tableCellMinWidth, tableCellPadding, tableMarginTop, TableSharedCssClassName, TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -1924,6 +1924,8 @@ const rendererAnnotationStylesCommentHeightFix = css({
|
|
|
1924
1924
|
paddingTop: "var(--ds-space-025, 2px)"
|
|
1925
1925
|
}
|
|
1926
1926
|
});
|
|
1927
|
+
const RENDERER_LIST_DENSE_GAP = `max(0px,calc((var(--ak-renderer-base-font-size) - ${akEditorFullPageDenseFontSize}px)* (4/3)))`;
|
|
1928
|
+
const TASKLIST_CONTAINER_DENSE_MARGIN = `max(calc(10px + (var(--ak-renderer-base-font-size) - ${akEditorFullPageDenseFontSize}px) *( 2 / 3)))`;
|
|
1927
1929
|
const denseStyles = css({
|
|
1928
1930
|
// Scale emoji size based on base font size
|
|
1929
1931
|
// Default: 20px emoji at 16px base font
|
|
@@ -1945,6 +1947,37 @@ const denseStyles = css({
|
|
|
1945
1947
|
[`.${RendererCssClassName.DOCUMENT} .ak-editor-panel .ak-editor-panel__icon`]: {
|
|
1946
1948
|
height: "var(--ds-space-250, 20px)",
|
|
1947
1949
|
width: "var(--ds-space-250, 20px)"
|
|
1950
|
+
},
|
|
1951
|
+
// Condense spacing across lists, tasks and decisions
|
|
1952
|
+
[`.${RendererCssClassName.DOCUMENT}`]: {
|
|
1953
|
+
// Adjacent list items
|
|
1954
|
+
'li + li': {
|
|
1955
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1956
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1957
|
+
},
|
|
1958
|
+
// Nested lists directly under an li (unordered and ordered)
|
|
1959
|
+
'li > ul, li > ol, .ak-ul li > ul, .ak-ul li > ol, .ak-ol li > ul, .ak-ol li > ol': {
|
|
1960
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1961
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1962
|
+
},
|
|
1963
|
+
// Task lists
|
|
1964
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1965
|
+
'[data-task-list-local-id]': {
|
|
1966
|
+
// Task lists: container top margin
|
|
1967
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1968
|
+
marginTop: TASKLIST_CONTAINER_DENSE_MARGIN
|
|
1969
|
+
},
|
|
1970
|
+
// Task lists: sibling items and nested lists
|
|
1971
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1972
|
+
'[data-task-list-local-id] > * + *': {
|
|
1973
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1974
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1975
|
+
},
|
|
1976
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1977
|
+
'[data-task-list-local-id] [data-task-list-local-id], [data-task-local-id] [data-task-local-id]': {
|
|
1978
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1979
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1980
|
+
}
|
|
1948
1981
|
}
|
|
1949
1982
|
});
|
|
1950
1983
|
export const RendererStyleContainer = props => {
|
|
@@ -1984,13 +2017,13 @@ export const RendererStyleContainer = props => {
|
|
|
1984
2017
|
'--ak-renderer-editor-font-heading-h6': `${editorUGCToken('editor.font.heading.h6')}`,
|
|
1985
2018
|
'--ak-renderer-editor-font-normal-text': `${editorUGCToken('editor.font.body')}`
|
|
1986
2019
|
},
|
|
1987
|
-
css: [baseStyles,
|
|
2020
|
+
css: [baseStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, !fg('aifc_create_enabled') && telepointerStyles, fg('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && extensionStyle, fg('platform_editor_typography_ugc') ? expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, expValEquals('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1988
2021
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1989
2022
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, editorExperiment('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, fg('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1990
2023
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
1991
2024
|
fg('editor_inline_comments_on_inline_nodes') && fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1992
2025
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
1993
|
-
fg('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, fg('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, fg('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, appearance === 'full-width' && responsiveBreakoutWidthFullWidth],
|
|
2026
|
+
fg('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, fg('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, fg('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, appearance === 'full-width' && responsiveBreakoutWidthFullWidth, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && denseStyles],
|
|
1994
2027
|
"data-testid": testId
|
|
1995
2028
|
}, children)
|
|
1996
2029
|
);
|
|
@@ -40,14 +40,14 @@ export function BreakoutSSRInlineScript({
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
export function createBreakoutInlineScript(id, shouldSkipScript) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const flags = {
|
|
44
|
+
platform_editor_fix_media_in_renderer: fg('platform_editor_fix_media_in_renderer')
|
|
45
|
+
};
|
|
46
|
+
return `(function(window){
|
|
47
|
+
if(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) { return; }
|
|
48
|
+
${breakoutInlineScriptContext};
|
|
49
|
+
(${applyBreakoutAfterSSR.toString()})("${id}", breakoutConsts, ${JSON.stringify(shouldSkipScript)}, ${JSON.stringify(flags)});
|
|
50
|
+
})(window);
|
|
51
51
|
`;
|
|
52
52
|
}
|
|
53
53
|
export const breakoutInlineScriptContext = `
|
|
@@ -60,9 +60,15 @@ export const breakoutInlineScriptContext = `
|
|
|
60
60
|
breakoutConsts.FullPagePadding = ${FullPagePadding.toString()};
|
|
61
61
|
`;
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* WARNING: NO EXTERNAL FUNCTION CALL IN THIS FUNCTION
|
|
65
|
+
* This function will be put to DOM as an inline script.
|
|
66
|
+
* It can not have any external function dependency.
|
|
67
|
+
* All required data must be passed in as serializable parameters.
|
|
68
|
+
*/
|
|
63
69
|
// Ignored via go/ees005
|
|
64
70
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
65
|
-
function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
71
|
+
function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript, flags) {
|
|
66
72
|
const MEDIA_NODE_TYPE = 'mediaSingle';
|
|
67
73
|
const WIDE_LAYOUT_MODES = ['full-width', 'wide', 'custom'];
|
|
68
74
|
function findUp(element, condition) {
|
|
@@ -109,7 +115,7 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
109
115
|
if (!mode || !WIDE_LAYOUT_MODES.includes(mode) ||
|
|
110
116
|
// skip apply width styling to mediaSingle node with pixel width to avoid image size changing
|
|
111
117
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
112
|
-
isMediaSingleWithPixelWidth &&
|
|
118
|
+
isMediaSingleWithPixelWidth && flags['platform_editor_fix_media_in_renderer']) {
|
|
113
119
|
return;
|
|
114
120
|
}
|
|
115
121
|
|
|
@@ -54,7 +54,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
54
54
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
55
55
|
const TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
56
56
|
const packageName = "@atlaskit/renderer";
|
|
57
|
-
const packageVersion = "
|
|
57
|
+
const packageVersion = "124.7.0";
|
|
58
58
|
const setAsQueryContainerStyles = css({
|
|
59
59
|
containerName: 'ak-renderer-wrapper',
|
|
60
60
|
containerType: 'inline-size'
|
|
@@ -7,6 +7,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
import { jsx, css } from '@emotion/react';
|
|
8
8
|
import { N20 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
12
|
import CodeBlockButtonContainer from './codeBlockButtonContainer';
|
|
11
13
|
var codeBlockStyleOverrides = css(_defineProperty({
|
|
12
14
|
tabSize: 4,
|
|
@@ -31,6 +33,12 @@ var codeBlockStyleOverrides = css(_defineProperty({
|
|
|
31
33
|
backgroundAttachment: 'local, local, local, local, scroll, scroll, scroll, scroll',
|
|
32
34
|
backgroundPosition: '0 0, 0 0, 100% 0, 100% 0, 100% 0, 100% 0, 0 0, 0 0'
|
|
33
35
|
}));
|
|
36
|
+
var denseModeOverrides = css(_defineProperty({}, "".concat(CodeBlockSharedCssClassName.DS_CODEBLOCK), {
|
|
37
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
38
|
+
fontSize: '0.875em',
|
|
39
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
40
|
+
lineHeight: '1.5em'
|
|
41
|
+
}));
|
|
34
42
|
var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
35
43
|
var allowCopyToClipboard = _ref.allowCopyToClipboard,
|
|
36
44
|
allowWrapCodeBlock = _ref.allowWrapCodeBlock,
|
|
@@ -44,7 +52,7 @@ var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
|
44
52
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
45
53
|
className: className,
|
|
46
54
|
"data-local-id": localId,
|
|
47
|
-
css: codeBlockStyleOverrides
|
|
55
|
+
css: [codeBlockStyleOverrides, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && denseModeOverrides]
|
|
48
56
|
}, jsx(CodeBlockButtonContainer, {
|
|
49
57
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
50
58
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
@@ -7,8 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
import _extends from "@babel/runtime/helpers/extends";
|
|
8
8
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["marks", "mediaSingleElement", "isDrafting"]
|
|
11
|
-
_excluded2 = ["marks", "mediaSingleElement", "isDrafting"];
|
|
10
|
+
var _excluded = ["marks", "mediaSingleElement", "isDrafting"];
|
|
12
11
|
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
12
|
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; }
|
|
14
13
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
@@ -31,11 +30,9 @@ import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
|
31
30
|
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
|
|
32
31
|
import { getEventHandler } from '../../../utils';
|
|
33
32
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, VIEW_METHOD } from '@atlaskit/editor-common/analytics';
|
|
34
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
35
33
|
import { MODE, PLATFORM } from '../../../analytics/events';
|
|
36
34
|
import AnnotationComponent from '../../marks/annotation';
|
|
37
|
-
import {
|
|
38
|
-
import { injectIntl } from 'react-intl-next';
|
|
35
|
+
import { CommentBadgeNext, ExternalImageBadge, MediaBadges } from '@atlaskit/editor-common/media-single';
|
|
39
36
|
import { useInlineCommentsFilter } from '../../../ui/annotations/hooks/use-inline-comments-filter';
|
|
40
37
|
import { useInlineCommentSubscriberContext } from '../../../ui/annotations/hooks/use-inline-comment-subscriber';
|
|
41
38
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
@@ -141,7 +138,6 @@ var _MediaAnnotations = function MediaAnnotations(_ref4) {
|
|
|
141
138
|
marks: otherMarks
|
|
142
139
|
}, children) : jsx(Fragment, null, children)));
|
|
143
140
|
};
|
|
144
|
-
var CommentBadge = injectIntl(CommentBadgeComponent);
|
|
145
141
|
var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
146
142
|
var _marks$map;
|
|
147
143
|
var marks = _ref5.marks,
|
|
@@ -205,89 +201,6 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
205
201
|
});
|
|
206
202
|
}
|
|
207
203
|
};
|
|
208
|
-
return jsx(CommentBadge, _extends({
|
|
209
|
-
onMouseEnter: function onMouseEnter() {
|
|
210
|
-
return setEntered(true);
|
|
211
|
-
},
|
|
212
|
-
onMouseLeave: function onMouseLeave() {
|
|
213
|
-
return setEntered(false);
|
|
214
|
-
},
|
|
215
|
-
status: entered ? 'entered' : status,
|
|
216
|
-
onClick: onClick
|
|
217
|
-
// Ignored via go/ees005
|
|
218
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
219
|
-
}, rest));
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Remove CommentBadgeWrapper component above
|
|
224
|
-
* and rename CommentBadgeNextWrapper to CommentBadgeWrapper
|
|
225
|
-
* when clean up platform_editor_add_media_from_url feature flag
|
|
226
|
-
*/
|
|
227
|
-
|
|
228
|
-
var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref6) {
|
|
229
|
-
var _marks$map2;
|
|
230
|
-
var marks = _ref6.marks,
|
|
231
|
-
mediaSingleElement = _ref6.mediaSingleElement,
|
|
232
|
-
_ref6$isDrafting = _ref6.isDrafting,
|
|
233
|
-
isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
|
|
234
|
-
rest = _objectWithoutProperties(_ref6, _excluded2);
|
|
235
|
-
var _useState5 = useState('default'),
|
|
236
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
237
|
-
status = _useState6[0],
|
|
238
|
-
setStatus = _useState6[1];
|
|
239
|
-
var _useState7 = useState(false),
|
|
240
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
241
|
-
entered = _useState8[0],
|
|
242
|
-
setEntered = _useState8[1];
|
|
243
|
-
var updateSubscriber = useInlineCommentSubscriberContext();
|
|
244
|
-
var activeParentIds = useInlineCommentsFilter({
|
|
245
|
-
annotationIds: (_marks$map2 = marks === null || marks === void 0 ? void 0 : marks.map(function (mark) {
|
|
246
|
-
return mark.attrs.id;
|
|
247
|
-
})) !== null && _marks$map2 !== void 0 ? _marks$map2 : [''],
|
|
248
|
-
filter: {
|
|
249
|
-
state: AnnotationMarkStates.ACTIVE
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
useEffect(function () {
|
|
253
|
-
var observer = new MutationObserver(function (mutationList) {
|
|
254
|
-
mutationList.forEach(function (mutation) {
|
|
255
|
-
var parentNode = mutation.target.parentNode;
|
|
256
|
-
if (mutation.attributeName === 'data-has-focus') {
|
|
257
|
-
var isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
258
|
-
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && !isMediaCaption;
|
|
259
|
-
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
if (mediaSingleElement) {
|
|
264
|
-
observer.observe(mediaSingleElement, {
|
|
265
|
-
attributes: true,
|
|
266
|
-
subtree: true,
|
|
267
|
-
attributeFilter: ['data-has-focus']
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
return function () {
|
|
271
|
-
observer.disconnect();
|
|
272
|
-
};
|
|
273
|
-
}, [mediaSingleElement, setStatus]);
|
|
274
|
-
if (!isDrafting && !activeParentIds.length) {
|
|
275
|
-
return null;
|
|
276
|
-
}
|
|
277
|
-
var onClick = function onClick(e) {
|
|
278
|
-
e.preventDefault();
|
|
279
|
-
if (updateSubscriber) {
|
|
280
|
-
updateSubscriber.emit(AnnotationUpdateEvent.ON_ANNOTATION_CLICK, {
|
|
281
|
-
annotationIds: activeParentIds,
|
|
282
|
-
// Ignored via go/ees005
|
|
283
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
284
|
-
eventTarget: e.target,
|
|
285
|
-
// use mediaSingle here to align with annotation viewed event dispatched in editor
|
|
286
|
-
eventTargetType: 'mediaSingle',
|
|
287
|
-
viewMethod: VIEW_METHOD.BADGE
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
204
|
return jsx(CommentBadgeNext, _extends({
|
|
292
205
|
onMouseEnter: function onMouseEnter() {
|
|
293
206
|
return setEntered(true);
|
|
@@ -345,27 +258,21 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
345
258
|
data: _defineProperty({}, MEDIA_CONTEXT, {
|
|
346
259
|
border: !!borderMark
|
|
347
260
|
})
|
|
348
|
-
},
|
|
261
|
+
}, jsx(MediaBadges, {
|
|
349
262
|
mediaElement: mediaSingleElement,
|
|
350
263
|
mediaWidth: width,
|
|
351
264
|
mediaHeight: height,
|
|
352
265
|
useMinimumZIndex: true
|
|
353
|
-
}, function (
|
|
354
|
-
var visible =
|
|
266
|
+
}, function (_ref7) {
|
|
267
|
+
var visible = _ref7.visible;
|
|
355
268
|
return jsx(React.Fragment, null, visible && jsx(ExternalImageBadge, {
|
|
356
269
|
type: _this.props.type,
|
|
357
270
|
url: _this.props.type === 'external' ? _this.props.url : undefined
|
|
358
|
-
}), showCommentBadge && jsx(
|
|
271
|
+
}), showCommentBadge && jsx(CommentBadgeWrapper, {
|
|
359
272
|
marks: annotationMarks,
|
|
360
273
|
mediaSingleElement: mediaSingleElement,
|
|
361
274
|
isDrafting: isDrafting
|
|
362
275
|
}));
|
|
363
|
-
}), !fg('platform_editor_add_media_from_url_rollout') && showCommentBadge && jsx(CommentBadgeWrapper, {
|
|
364
|
-
marks: annotationMarks,
|
|
365
|
-
mediaSingleElement: mediaSingleElement,
|
|
366
|
-
width: width,
|
|
367
|
-
height: height,
|
|
368
|
-
isDrafting: isDrafting
|
|
369
276
|
}), jsx(MediaCard, _extends({
|
|
370
277
|
contextIdentifierProvider: contextIdentifierProvider
|
|
371
278
|
// Ignored via go/ees005
|
|
@@ -428,14 +335,14 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
428
335
|
draftPosition = _useAnnotationRangeSt.hoverDraftDocumentPosition;
|
|
429
336
|
var dataAttributes = props.dataAttributes;
|
|
430
337
|
var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
431
|
-
var
|
|
432
|
-
|
|
433
|
-
position =
|
|
434
|
-
setPosition =
|
|
435
|
-
var
|
|
436
|
-
|
|
437
|
-
shouldApplyDraftAnnotation =
|
|
438
|
-
setShouldApplyDraftAnnotation =
|
|
338
|
+
var _useState5 = useState(),
|
|
339
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
340
|
+
position = _useState6[0],
|
|
341
|
+
setPosition = _useState6[1];
|
|
342
|
+
var _useState7 = useState(false),
|
|
343
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
344
|
+
shouldApplyDraftAnnotation = _useState8[0],
|
|
345
|
+
setShouldApplyDraftAnnotation = _useState8[1];
|
|
439
346
|
useEffect(function () {
|
|
440
347
|
var _draftPosition$from;
|
|
441
348
|
if (pos === undefined) {
|
|
@@ -10,9 +10,9 @@ import { default as React, Fragment, useCallback, useContext, useMemo, useEffect
|
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import { MediaSingle as UIMediaSingle, WidthContext } from '@atlaskit/editor-common/ui';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
14
15
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
17
17
|
import { useAnnotationRangeDispatch } from '../../../ui/annotations/contexts/AnnotationRangeContext';
|
|
18
18
|
import { useAnnotationHoverDispatch } from '../../../ui/annotations/contexts/AnnotationHoverContext';
|
|
@@ -138,7 +138,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
|
|
|
138
138
|
height: "100%"
|
|
139
139
|
};
|
|
140
140
|
} else {
|
|
141
|
-
var _maxWidth = isSSR() && widthAttr && typeof widthAttr === 'number'
|
|
141
|
+
var _maxWidth = isSSR() && widthAttr && typeof widthAttr === 'number' ? Math.max(widthAttr, containerWidth) : containerWidth;
|
|
142
142
|
var maxHeight = height / width * _maxWidth;
|
|
143
143
|
cardDimensions = {
|
|
144
144
|
width: "".concat(_maxWidth, "px"),
|
|
@@ -15,7 +15,7 @@ import { FullPagePadding } from './style';
|
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
17
17
|
import { RendererCssClassName } from '../../consts';
|
|
18
|
-
import { akEditorBlockquoteBorderColor, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, scaledBlockNodesVerticalMargin, gridMediumMaxWidth, akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
18
|
+
import { akEditorBlockquoteBorderColor, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorFullPageNarrowBreakout, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorLineHeight, akEditorSelectedNodeClassName, akEditorShadowZIndex, akEditorStickyHeaderZIndex, akEditorTableBorder, akEditorTableCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, blockNodesVerticalMargin, scaledBlockNodesVerticalMargin, gridMediumMaxWidth, akEditorFullPageDefaultFontSize, akEditorFullPageDenseFontSize } from '@atlaskit/editor-shared-styles';
|
|
19
19
|
import { INLINE_IMAGE_WRAPPER_CLASS_NAME } from '@atlaskit/editor-common/media-inline';
|
|
20
20
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
21
21
|
import { CodeBlockSharedCssClassName, DateSharedCssClassName, listItemCounterPadding, richMediaClassName, SmartCardSharedCssClassName, tableCellBorderWidth, tableCellMinWidth, tableCellPadding, tableMarginTop, TableSharedCssClassName, TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -1515,7 +1515,9 @@ var rendererAnnotationStylesCommentHeightFix = css({
|
|
|
1515
1515
|
paddingTop: "var(--ds-space-025, 2px)"
|
|
1516
1516
|
}
|
|
1517
1517
|
});
|
|
1518
|
-
var
|
|
1518
|
+
var RENDERER_LIST_DENSE_GAP = "max(0px,calc((var(--ak-renderer-base-font-size) - ".concat(akEditorFullPageDenseFontSize, "px)* (4/3)))");
|
|
1519
|
+
var TASKLIST_CONTAINER_DENSE_MARGIN = "max(calc(10px + (var(--ak-renderer-base-font-size) - ".concat(akEditorFullPageDenseFontSize, "px) *( 2 / 3)))");
|
|
1520
|
+
var denseStyles = css(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(EmojiSharedCssClassName.EMOJI_IMAGE), {
|
|
1519
1521
|
height: "calc(".concat(defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(akEditorFullPageDefaultFontSize, ")"),
|
|
1520
1522
|
width: "calc(".concat(defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(akEditorFullPageDefaultFontSize, ")"),
|
|
1521
1523
|
maxHeight: "calc(".concat(defaultEmojiHeight, " * var(--ak-renderer-base-font-size) / ").concat(akEditorFullPageDefaultFontSize, ")"),
|
|
@@ -1528,6 +1530,35 @@ var denseStyles = css(_defineProperty(_defineProperty({}, ".".concat(EmojiShared
|
|
|
1528
1530
|
}), ".".concat(RendererCssClassName.DOCUMENT, " .ak-editor-panel .ak-editor-panel__icon"), {
|
|
1529
1531
|
height: "var(--ds-space-250, 20px)",
|
|
1530
1532
|
width: "var(--ds-space-250, 20px)"
|
|
1533
|
+
}), ".".concat(RendererCssClassName.DOCUMENT), {
|
|
1534
|
+
// Adjacent list items
|
|
1535
|
+
'li + li': {
|
|
1536
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1537
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1538
|
+
},
|
|
1539
|
+
// Nested lists directly under an li (unordered and ordered)
|
|
1540
|
+
'li > ul, li > ol, .ak-ul li > ul, .ak-ul li > ol, .ak-ol li > ul, .ak-ol li > ol': {
|
|
1541
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1542
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1543
|
+
},
|
|
1544
|
+
// Task lists
|
|
1545
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1546
|
+
'[data-task-list-local-id]': {
|
|
1547
|
+
// Task lists: container top margin
|
|
1548
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1549
|
+
marginTop: TASKLIST_CONTAINER_DENSE_MARGIN
|
|
1550
|
+
},
|
|
1551
|
+
// Task lists: sibling items and nested lists
|
|
1552
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1553
|
+
'[data-task-list-local-id] > * + *': {
|
|
1554
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1555
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1556
|
+
},
|
|
1557
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1558
|
+
'[data-task-list-local-id] [data-task-list-local-id], [data-task-local-id] [data-task-local-id]': {
|
|
1559
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
1560
|
+
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1561
|
+
}
|
|
1531
1562
|
}));
|
|
1532
1563
|
export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
1533
1564
|
var onClick = props.onClick,
|
|
@@ -1564,13 +1595,13 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
1564
1595
|
'--ak-renderer-editor-font-heading-h6': "".concat(editorUGCToken('editor.font.heading.h6')),
|
|
1565
1596
|
'--ak-renderer-editor-font-normal-text': "".concat(editorUGCToken('editor.font.body'))
|
|
1566
1597
|
},
|
|
1567
|
-
css: [baseStyles,
|
|
1598
|
+
css: [baseStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, !fg('aifc_create_enabled') && telepointerStyles, fg('aifc_create_enabled') && rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && extensionStyle, fg('platform_editor_typography_ugc') ? expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, expValEquals('platform_editor_text_highlight_padding', 'isEnabled', true) &&
|
|
1568
1599
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1569
1600
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, editorExperiment('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, fg('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1570
1601
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
1571
1602
|
fg('editor_inline_comments_on_inline_nodes') && fg('annotations_align_editor_and_renderer_styles') && rendererAnnotationStylesCommentHeightFix, baseOtherStyles, allowNestedHeaderLinks && alignedHeadingAnchorStyle, mediaSingleSharedStyle,
|
|
1572
1603
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
1573
|
-
fg('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, fg('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, fg('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, appearance === 'full-width' && responsiveBreakoutWidthFullWidth],
|
|
1604
|
+
fg('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, fg('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, isStickyScrollbarEnabled(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks, fg('platform_editor_tables_numbered_column_correction') ? rendererTableColumnStyles : rendererTableColumnStylesOld, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, appearance === 'full-width' && responsiveBreakoutWidthFullWidth, expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') && denseStyles],
|
|
1574
1605
|
"data-testid": testId
|
|
1575
1606
|
}, children)
|
|
1576
1607
|
);
|
|
@@ -39,13 +39,22 @@ export function BreakoutSSRInlineScript(_ref) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
export function createBreakoutInlineScript(id, shouldSkipScript) {
|
|
42
|
-
|
|
42
|
+
var flags = {
|
|
43
|
+
platform_editor_fix_media_in_renderer: fg('platform_editor_fix_media_in_renderer')
|
|
44
|
+
};
|
|
45
|
+
return "(function(window){\nif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) { return; }\n".concat(breakoutInlineScriptContext, ";\n(").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(JSON.stringify(shouldSkipScript), ", ").concat(JSON.stringify(flags), ");\n})(window);\n");
|
|
43
46
|
}
|
|
44
47
|
export var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(breakoutConsts.calcWideWidth.toString(), ";\n breakoutConsts.FullPagePadding = ").concat(FullPagePadding.toString(), ";\n");
|
|
45
48
|
|
|
49
|
+
/**
|
|
50
|
+
* WARNING: NO EXTERNAL FUNCTION CALL IN THIS FUNCTION
|
|
51
|
+
* This function will be put to DOM as an inline script.
|
|
52
|
+
* It can not have any external function dependency.
|
|
53
|
+
* All required data must be passed in as serializable parameters.
|
|
54
|
+
*/
|
|
46
55
|
// Ignored via go/ees005
|
|
47
56
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
-
function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
57
|
+
function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript, flags) {
|
|
49
58
|
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
50
59
|
var WIDE_LAYOUT_MODES = ['full-width', 'wide', 'custom'];
|
|
51
60
|
function findUp(element, condition) {
|
|
@@ -92,7 +101,7 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
92
101
|
if (!mode || !WIDE_LAYOUT_MODES.includes(mode) ||
|
|
93
102
|
// skip apply width styling to mediaSingle node with pixel width to avoid image size changing
|
|
94
103
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
95
|
-
isMediaSingleWithPixelWidth &&
|
|
104
|
+
isMediaSingleWithPixelWidth && flags['platform_editor_fix_media_in_renderer']) {
|
|
96
105
|
return;
|
|
97
106
|
}
|
|
98
107
|
|
|
@@ -59,7 +59,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
59
59
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
60
60
|
var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
61
61
|
var packageName = "@atlaskit/renderer";
|
|
62
|
-
var packageVersion = "
|
|
62
|
+
var packageVersion = "124.7.0";
|
|
63
63
|
var setAsQueryContainerStyles = css({
|
|
64
64
|
containerName: 'ak-renderer-wrapper',
|
|
65
65
|
containerType: 'inline-size'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "124.
|
|
3
|
+
"version": "124.7.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@atlaskit/adf-schema": "^51.
|
|
27
|
-
"@atlaskit/adf-utils": "^19.
|
|
26
|
+
"@atlaskit/adf-schema": "^51.3.0",
|
|
27
|
+
"@atlaskit/adf-utils": "^19.25.0",
|
|
28
28
|
"@atlaskit/afm-i18n-platform-editor-renderer": "2.7.0",
|
|
29
29
|
"@atlaskit/analytics-listeners": "^9.1.0",
|
|
30
30
|
"@atlaskit/analytics-namespaced-context": "^7.1.0",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"@atlaskit/browser-apis": "^0.0.1",
|
|
33
33
|
"@atlaskit/button": "^23.5.0",
|
|
34
34
|
"@atlaskit/code": "^17.2.0",
|
|
35
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
35
|
+
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
36
36
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
38
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
38
|
+
"@atlaskit/editor-shared-styles": "^3.8.0",
|
|
39
39
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
40
40
|
"@atlaskit/emoji": "^69.6.0",
|
|
41
41
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
42
42
|
"@atlaskit/icon": "^28.5.0",
|
|
43
43
|
"@atlaskit/link": "^3.2.0",
|
|
44
|
-
"@atlaskit/link-datasource": "^4.
|
|
44
|
+
"@atlaskit/link-datasource": "^4.26.0",
|
|
45
45
|
"@atlaskit/link-extractors": "^2.4.0",
|
|
46
46
|
"@atlaskit/media-card": "^79.5.0",
|
|
47
47
|
"@atlaskit/media-client": "^35.5.0",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
54
54
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
55
55
|
"@atlaskit/react-ufo": "^4.12.0",
|
|
56
|
-
"@atlaskit/smart-card": "^43.
|
|
56
|
+
"@atlaskit/smart-card": "^43.2.0",
|
|
57
57
|
"@atlaskit/status": "^3.0.0",
|
|
58
58
|
"@atlaskit/task-decision": "^19.2.0",
|
|
59
59
|
"@atlaskit/theme": "^21.0.0",
|
|
60
60
|
"@atlaskit/tmp-editor-statsig": "^13.13.0",
|
|
61
61
|
"@atlaskit/tokens": "^7.0.0",
|
|
62
|
-
"@atlaskit/tooltip": "^20.
|
|
62
|
+
"@atlaskit/tooltip": "^20.6.0",
|
|
63
63
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
64
64
|
"@babel/runtime": "^7.0.0",
|
|
65
65
|
"@emotion/react": "^11.7.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"uuid": "^3.1.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^110.
|
|
74
|
+
"@atlaskit/editor-common": "^110.14.0",
|
|
75
75
|
"@atlaskit/link-provider": "^4.0.0",
|
|
76
76
|
"@atlaskit/media-core": "^37.0.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
@@ -167,9 +167,6 @@
|
|
|
167
167
|
"platform_editor_multi_body_extension_extensibility": {
|
|
168
168
|
"type": "boolean"
|
|
169
169
|
},
|
|
170
|
-
"platform_editor_add_media_from_url_rollout": {
|
|
171
|
-
"type": "boolean"
|
|
172
|
-
},
|
|
173
170
|
"platform_editor_fix_media_in_renderer": {
|
|
174
171
|
"type": "boolean"
|
|
175
172
|
},
|
|
@@ -209,9 +206,6 @@
|
|
|
209
206
|
"platform_editor_bordered_panel_nested_in_table": {
|
|
210
207
|
"type": "boolean"
|
|
211
208
|
},
|
|
212
|
-
"platform_editor_fix_image_size_diff_during_ssr": {
|
|
213
|
-
"type": "boolean"
|
|
214
|
-
},
|
|
215
209
|
"smartcard_avatar_margin_fix": {
|
|
216
210
|
"type": "boolean"
|
|
217
211
|
},
|