@atlaskit/renderer 126.8.10 → 126.9.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 +19 -0
- package/dist/cjs/messages.js +1 -1
- package/dist/cjs/react/nodes/bodiedExtension.js +4 -2
- package/dist/cjs/react/nodes/date.js +7 -2
- package/dist/cjs/react/nodes/extension.js +14 -7
- package/dist/cjs/react/nodes/multiBodiedExtension.js +20 -8
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +35 -4
- package/dist/cjs/ui/Renderer/index.js +5 -3
- package/dist/es2019/messages.js +1 -1
- package/dist/es2019/react/nodes/bodiedExtension.js +4 -2
- package/dist/es2019/react/nodes/date.js +8 -2
- package/dist/es2019/react/nodes/extension.js +14 -7
- package/dist/es2019/react/nodes/multiBodiedExtension.js +20 -8
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +40 -4
- package/dist/es2019/ui/Renderer/index.js +5 -2
- package/dist/esm/messages.js +1 -1
- package/dist/esm/react/nodes/bodiedExtension.js +4 -2
- package/dist/esm/react/nodes/date.js +7 -2
- package/dist/esm/react/nodes/extension.js +14 -7
- package/dist/esm/react/nodes/multiBodiedExtension.js +20 -8
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +35 -4
- package/dist/esm/ui/Renderer/index.js +5 -3
- package/dist/types/react/nodes/bodiedExtension.d.ts +2 -0
- package/dist/types/react/nodes/extension.d.ts +4 -1
- package/dist/types/react/nodes/multiBodiedExtension.d.ts +2 -0
- package/dist/types/renderer-context.d.ts +1 -0
- package/dist/types/ui/renderer-props.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/bodiedExtension.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/extension.d.ts +4 -1
- package/dist/types-ts4.5/react/nodes/multiBodiedExtension.d.ts +2 -0
- package/dist/types-ts4.5/renderer-context.d.ts +1 -0
- package/dist/types-ts4.5/ui/renderer-props.d.ts +1 -0
- package/package.json +12 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 126.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`aac76ca1cde5b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aac76ca1cde5b) -
|
|
8
|
+
Fix hydration error with dates in task lists
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 126.8.11
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`4ba962abdce44`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4ba962abdce44) -
|
|
19
|
+
EDITOR-4667 - Inline Bodied Extension: Remove important from existing extension width style
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 126.8.10
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/cjs/messages.js
CHANGED
|
@@ -37,7 +37,7 @@ var headingAnchorLinkMessages = exports.headingAnchorLinkMessages = (0, _reactIn
|
|
|
37
37
|
copyAriaLabel: {
|
|
38
38
|
id: 'fabric.editor.headingLink.copyAriaLabel',
|
|
39
39
|
defaultMessage: 'Copy',
|
|
40
|
-
description: '
|
|
40
|
+
description: 'Aria label for the copy link button displayed next to a heading. Used by screen readers to describe the button that copies the heading anchor link to the clipboard.'
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
var tableCellMessages = exports.tableCellMessages = (0, _reactIntlNext.defineMessages)({
|
|
@@ -65,7 +65,8 @@ var BodiedExtension = function BodiedExtension(props) {
|
|
|
65
65
|
if (result && /*#__PURE__*/_react.default.isValidElement(result)) {
|
|
66
66
|
// Return the content directly if it's a valid JSX.Element
|
|
67
67
|
return (0, _extension.renderExtension)(result, layout, {
|
|
68
|
-
isTopLevel: path.length < 1
|
|
68
|
+
isTopLevel: path.length < 1,
|
|
69
|
+
rendererAppearance: props.rendererAppearance
|
|
69
70
|
}, removeOverflow, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, undefined, localId, shouldDisplayExtensionAsInline, node);
|
|
70
71
|
}
|
|
71
72
|
} catch (_unused) {
|
|
@@ -75,7 +76,8 @@ var BodiedExtension = function BodiedExtension(props) {
|
|
|
75
76
|
|
|
76
77
|
// Always return default content if anything goes wrong
|
|
77
78
|
return (0, _extension.renderExtension)(children, layout, {
|
|
78
|
-
isTopLevel: path.length < 1
|
|
79
|
+
isTopLevel: path.length < 1,
|
|
80
|
+
rendererAppearance: props.rendererAppearance
|
|
79
81
|
}, removeOverflow, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, undefined, localId, shouldDisplayExtensionAsInline, node);
|
|
80
82
|
}))));
|
|
81
83
|
};
|
|
@@ -11,7 +11,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
13
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
15
|
var _reactIntlNext = require("react-intl-next");
|
|
16
|
+
var _rendererContext = require("../../renderer-context");
|
|
15
17
|
var _TaskItemsFormatContext = require("../../ui/TaskItemsFormatContext/TaskItemsFormatContext");
|
|
16
18
|
var _useInlineAnnotationProps = require("../../ui/annotations/element/useInlineAnnotationProps");
|
|
17
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -20,7 +22,10 @@ var Date = /*#__PURE__*/(0, _react.memo)(function Date(props) {
|
|
|
20
22
|
var timestamp = props.timestamp,
|
|
21
23
|
parentIsIncompleteTask = props.parentIsIncompleteTask,
|
|
22
24
|
intl = props.intl;
|
|
23
|
-
var
|
|
25
|
+
var _useRendererContext = (0, _rendererContext.useRendererContext)(),
|
|
26
|
+
contextTimeZone = _useRendererContext.timeZone;
|
|
27
|
+
var timeZone = (0, _expValEquals.expValEquals)('confluence_frontend_fix_date_hydration_error', 'isEnabled', true) ? contextTimeZone : undefined;
|
|
28
|
+
var className = !!parentIsIncompleteTask && (0, _utils.isPastDate)(timestamp, timeZone) ? 'date-node date-node-highlighted' : 'date-node';
|
|
24
29
|
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({
|
|
25
30
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
26
31
|
className: _styles.DateSharedCssClassName.DATE_WRAPPER
|
|
@@ -31,7 +36,7 @@ var Date = /*#__PURE__*/(0, _react.memo)(function Date(props) {
|
|
|
31
36
|
className: className,
|
|
32
37
|
"data-node-type": "date",
|
|
33
38
|
"data-timestamp": timestamp
|
|
34
|
-
}, parentIsIncompleteTask ? (0, _utils.timestampToTaskContext)(timestamp, intl) : (0, _utils.timestampToString)(timestamp, intl)));
|
|
39
|
+
}, parentIsIncompleteTask ? (0, _utils.timestampToTaskContext)(timestamp, intl, timeZone) : (0, _utils.timestampToString)(timestamp, intl)));
|
|
35
40
|
});
|
|
36
41
|
var DateComponent = exports.DateComponent = (0, _reactIntlNext.injectIntl)(Date);
|
|
37
42
|
function DateWithFormatContext(props) {
|
|
@@ -61,8 +61,12 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
61
61
|
// by default, we assume the extension is at top level, (direct child of doc node)
|
|
62
62
|
var _ref = options || {},
|
|
63
63
|
_ref$isTopLevel = _ref.isTopLevel,
|
|
64
|
-
isTopLevel = _ref$isTopLevel === void 0 ? true : _ref$isTopLevel
|
|
65
|
-
|
|
64
|
+
isTopLevel = _ref$isTopLevel === void 0 ? true : _ref$isTopLevel,
|
|
65
|
+
rendererAppearance = _ref.rendererAppearance;
|
|
66
|
+
// we should only use custom layout for full-page appearance
|
|
67
|
+
var canUseCustomLayout = (0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererAppearance === 'full-page' : true;
|
|
68
|
+
var isCustomLayout = isTopLevel && ['wide', 'full-width'].includes(layout) && canUseCustomLayout;
|
|
69
|
+
var centerAlignClass = isCustomLayout ? _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN : '';
|
|
66
70
|
/**
|
|
67
71
|
* To reduce cumulative layout shift, we check installed manifest values (viewportSize) for Forge and extension node parameters
|
|
68
72
|
* for Connect (legacy). As Connect is being phased out, we want Forge to also start to store its expected height
|
|
@@ -80,9 +84,9 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
80
84
|
,
|
|
81
85
|
className: "".concat(_consts.RendererCssClassName.EXTENSION, " ").concat(inlineClassName, " ").concat(options.shadowClassNames, " ").concat(centerAlignClass),
|
|
82
86
|
style: {
|
|
83
|
-
width: isInline ? undefined : isTopLevel ?
|
|
87
|
+
width: isInline ? undefined : ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? isCustomLayout : isTopLevel) ?
|
|
84
88
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
85
|
-
(0, _breakout.calcBreakoutWidthCss)(layout) : '100%',
|
|
89
|
+
(0, _breakout.calcBreakoutWidthCss)(layout) : (0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%',
|
|
86
90
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
87
91
|
minHeight: isInline ? undefined : extensionHeight && "".concat(extensionHeight, "px")
|
|
88
92
|
},
|
|
@@ -106,8 +110,9 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
106
110
|
,
|
|
107
111
|
className: "".concat(_consts.RendererCssClassName.EXTENSION, " ").concat(inlineClassName, " ").concat(options.shadowClassNames, " ").concat(centerAlignClass),
|
|
108
112
|
style: {
|
|
113
|
+
width: isInline ? undefined : ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? isCustomLayout : isTopLevel) ?
|
|
109
114
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
110
|
-
|
|
115
|
+
(0, _utils.calcBreakoutWidth)(layout, width) : (0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%',
|
|
111
116
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
112
117
|
minHeight: isInline ? undefined : "".concat(extensionHeight, "px")
|
|
113
118
|
},
|
|
@@ -149,7 +154,8 @@ var Extension = function Extension(props) {
|
|
|
149
154
|
isTopLevel: path.length < 1,
|
|
150
155
|
handleRef: handleRef,
|
|
151
156
|
shadowClassNames: shadowClassNames,
|
|
152
|
-
tabIndex: (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? props.tabIndex : undefined
|
|
157
|
+
tabIndex: (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? props.tabIndex : undefined,
|
|
158
|
+
rendererAppearance: props.rendererAppearance
|
|
153
159
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
154
160
|
}
|
|
155
161
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -162,7 +168,8 @@ var Extension = function Extension(props) {
|
|
|
162
168
|
isTopLevel: path.length < 1,
|
|
163
169
|
handleRef: handleRef,
|
|
164
170
|
shadowClassNames: shadowClassNames,
|
|
165
|
-
tabIndex: (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? props.tabIndex : undefined
|
|
171
|
+
tabIndex: (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? props.tabIndex : undefined,
|
|
172
|
+
rendererAppearance: props.rendererAppearance
|
|
166
173
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
167
174
|
});
|
|
168
175
|
};
|
|
@@ -49,17 +49,22 @@ var MultiBodiedExtensionWrapperLegacy = function MultiBodiedExtensionWrapperLega
|
|
|
49
49
|
var width = _ref3.width,
|
|
50
50
|
path = _ref3.path,
|
|
51
51
|
layout = _ref3.layout,
|
|
52
|
+
rendererAppearance = _ref3.rendererAppearance,
|
|
52
53
|
children = _ref3.children;
|
|
53
54
|
var isTopLevel = path.length < 1;
|
|
54
|
-
|
|
55
|
+
// we should only use custom layout for full-page appearance
|
|
56
|
+
var canUseCustomLayout = (0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererAppearance === 'full-page' : true;
|
|
57
|
+
var isCustomLayout = isTopLevel && ['wide', 'full-width'].includes(layout) && canUseCustomLayout;
|
|
58
|
+
var centerAlignClass = isCustomLayout ? _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN : '';
|
|
55
59
|
|
|
56
60
|
// This hierarchy is copied from regular extension (see extension.tsx)
|
|
57
61
|
return (0, _react.jsx)("div", {
|
|
58
62
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
59
63
|
className: "".concat(_consts.RendererCssClassName.EXTENSION, " ").concat(centerAlignClass),
|
|
60
64
|
style: {
|
|
65
|
+
width: ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? isCustomLayout : isTopLevel) ?
|
|
61
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
62
|
-
|
|
67
|
+
(0, _utils.calcBreakoutWidth)(layout, width) : (0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%'
|
|
63
68
|
},
|
|
64
69
|
"data-layout": layout,
|
|
65
70
|
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
@@ -71,18 +76,22 @@ var MultiBodiedExtensionWrapperLegacy = function MultiBodiedExtensionWrapperLega
|
|
|
71
76
|
var MultiBodiedExtensionWrapperNext = function MultiBodiedExtensionWrapperNext(_ref4) {
|
|
72
77
|
var path = _ref4.path,
|
|
73
78
|
layout = _ref4.layout,
|
|
79
|
+
rendererAppearance = _ref4.rendererAppearance,
|
|
74
80
|
children = _ref4.children;
|
|
75
81
|
var isTopLevel = path.length < 1;
|
|
76
|
-
|
|
82
|
+
// we should only use custom layout for full-page appearance
|
|
83
|
+
var canUseCustomLayout = (0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererAppearance === 'full-page' : true;
|
|
84
|
+
var isCustomLayout = isTopLevel && ['wide', 'full-width'].includes(layout) && canUseCustomLayout;
|
|
85
|
+
var centerAlignClass = isCustomLayout ? _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN : '';
|
|
77
86
|
|
|
78
87
|
// This hierarchy is copied from regular extension (see extension.tsx)
|
|
79
88
|
return (0, _react.jsx)("div", {
|
|
80
89
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
81
90
|
className: "".concat(_consts.RendererCssClassName.EXTENSION, " ").concat(centerAlignClass),
|
|
82
91
|
style: {
|
|
83
|
-
width: isTopLevel ?
|
|
92
|
+
width: ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? isCustomLayout : isTopLevel) ?
|
|
84
93
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
85
|
-
(0, _breakout.calcBreakoutWidthCss)(layout) : '100%'
|
|
94
|
+
(0, _breakout.calcBreakoutWidthCss)(layout) : (0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%'
|
|
86
95
|
},
|
|
87
96
|
"data-layout": layout,
|
|
88
97
|
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
@@ -103,7 +112,8 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
103
112
|
extensionKey = props.extensionKey,
|
|
104
113
|
content = props.content,
|
|
105
114
|
marks = props.marks,
|
|
106
|
-
localId = props.localId
|
|
115
|
+
localId = props.localId,
|
|
116
|
+
rendererAppearance = props.rendererAppearance;
|
|
107
117
|
var _useState = (0, _react2.useState)(0),
|
|
108
118
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
109
119
|
activeChildIndex = _useState2[0],
|
|
@@ -166,7 +176,8 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
166
176
|
"data-node-type": "multiBodiedExtension"
|
|
167
177
|
}, (0, _react.jsx)(MultiBodiedExtensionWrapperNext, {
|
|
168
178
|
layout: layout,
|
|
169
|
-
path: path
|
|
179
|
+
path: path,
|
|
180
|
+
rendererAppearance: rendererAppearance
|
|
170
181
|
}, renderContent()));
|
|
171
182
|
}
|
|
172
183
|
return (0, _react.jsx)("section", {
|
|
@@ -181,7 +192,8 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
181
192
|
return (0, _react.jsx)(MultiBodiedExtensionWrapperLegacy, {
|
|
182
193
|
layout: layout,
|
|
183
194
|
width: width,
|
|
184
|
-
path: path
|
|
195
|
+
path: path,
|
|
196
|
+
rendererAppearance: rendererAppearance
|
|
185
197
|
}, renderContent());
|
|
186
198
|
}));
|
|
187
199
|
};
|
|
@@ -275,11 +275,29 @@ var rendererFullPageStylesWithReducedPadding = (0, _react.css)((0, _defineProper
|
|
|
275
275
|
}, "@media (max-width: ".concat(_editorSharedStyles.akEditorFullPageNarrowBreakout, "px)"), {
|
|
276
276
|
'--ak-renderer--full-page-gutter': "".concat(_editorSharedStyles.akEditorGutterPaddingReduced, "px")
|
|
277
277
|
}));
|
|
278
|
+
var oldRendererFullWidthStyles = (0, _react.css)({
|
|
279
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
280
|
+
maxWidth: "".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px"),
|
|
281
|
+
margin: "0 auto",
|
|
282
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
283
|
+
'.fabric-editor-breakout-mark:not([data-has-width="true"]), .ak-renderer-extension': {
|
|
284
|
+
width: '100% !important'
|
|
285
|
+
}
|
|
286
|
+
});
|
|
278
287
|
var rendererFullWidthStyles = (0, _react.css)({
|
|
279
288
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
280
289
|
maxWidth: "".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px"),
|
|
281
290
|
margin: "0 auto",
|
|
282
291
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
292
|
+
'.fabric-editor-breakout-mark:not([data-has-width="true"])': {
|
|
293
|
+
width: '100% !important'
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
var oldRendererMaxWidthStyles = (0, _react.css)({
|
|
297
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
298
|
+
maxWidth: "".concat(_editorSharedStyles.akEditorMaxWidthLayoutWidth, "px"),
|
|
299
|
+
margin: "0 auto",
|
|
300
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
283
301
|
'.fabric-editor-breakout-mark:not([data-has-width="true"]), .ak-renderer-extension': {
|
|
284
302
|
width: '100% !important'
|
|
285
303
|
}
|
|
@@ -289,7 +307,7 @@ var rendererMaxWidthStyles = (0, _react.css)({
|
|
|
289
307
|
maxWidth: "".concat(_editorSharedStyles.akEditorMaxWidthLayoutWidth, "px"),
|
|
290
308
|
margin: "0 auto",
|
|
291
309
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
292
|
-
'.fabric-editor-breakout-mark:not([data-has-width="true"])
|
|
310
|
+
'.fabric-editor-breakout-mark:not([data-has-width="true"])': {
|
|
293
311
|
width: '100% !important'
|
|
294
312
|
}
|
|
295
313
|
});
|
|
@@ -777,7 +795,7 @@ var extensionStyle = (0, _react.css)({
|
|
|
777
795
|
fontSize: 'var(--ak-renderer-base-font-size)'
|
|
778
796
|
}
|
|
779
797
|
});
|
|
780
|
-
var
|
|
798
|
+
var oldExtensionAsInlineStyle = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_consts.RendererCssClassName.DOCUMENT, " [data-as-inline=\"on\"]"), {
|
|
781
799
|
display: 'inline-block'
|
|
782
800
|
}), ".".concat(_consts.RendererCssClassName.DOCUMENT, " .").concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE), {
|
|
783
801
|
display: 'inline-block',
|
|
@@ -792,6 +810,19 @@ var extensionAsInlineStyle = (0, _react.css)((0, _defineProperty2.default)((0, _
|
|
|
792
810
|
}), ".".concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE, " div, .").concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE, " p"), {
|
|
793
811
|
display: 'inline-block'
|
|
794
812
|
}));
|
|
813
|
+
var extensionAsInlineStyle = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_consts.RendererCssClassName.DOCUMENT, " [data-as-inline=\"on\"]"), {
|
|
814
|
+
display: 'inline-block'
|
|
815
|
+
}), ".".concat(_consts.RendererCssClassName.DOCUMENT, " .").concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE), {
|
|
816
|
+
display: 'inline-block',
|
|
817
|
+
width: 'auto',
|
|
818
|
+
marginTop: 0
|
|
819
|
+
}), ".".concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE, " .").concat(_consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER), {
|
|
820
|
+
display: 'inline-block',
|
|
821
|
+
overflowX: 'visible',
|
|
822
|
+
containerType: 'normal'
|
|
823
|
+
}), ".".concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE, " div, .").concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE, " p"), {
|
|
824
|
+
display: 'inline-block'
|
|
825
|
+
}));
|
|
795
826
|
|
|
796
827
|
// Removes the blockNodesVerticalMargin styling for inline extensions, i.e. borderless excerpt-include
|
|
797
828
|
var inlineExtensionRendererMarginFix = (0, _react.css)({
|
|
@@ -1901,13 +1932,13 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
1901
1932
|
'--ak-renderer-editor-font-heading-h6': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.heading.h6')),
|
|
1902
1933
|
'--ak-renderer-editor-font-normal-text': "".concat((0, _ugcTokens.editorUGCToken)('editor.font.body'))
|
|
1903
1934
|
},
|
|
1904
|
-
css: [(0, _expValEquals.expValEquals)('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) && rendererMaxWidthStyles, rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && isCompactModeSupported && extensionStyle, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? isCompactModeSupported ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : isCompactModeSupported ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles,
|
|
1935
|
+
css: [(0, _expValEquals.expValEquals)('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererFullWidthStyles : oldRendererFullWidthStyles), (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererMaxWidthStyles : oldRendererMaxWidthStyles), rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && isCompactModeSupported && extensionStyle, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? isCompactModeSupported ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : isCompactModeSupported ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles,
|
|
1905
1936
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
1906
1937
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, smartCardStyles, smartCardStylesAvatarFix, (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true) && headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
|
|
1907
1938
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
1908
1939
|
(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor,
|
|
1909
1940
|
// this should be placed after baseOtherStyles
|
|
1910
|
-
(0, _expValEquals.expValEquals)('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && extensionAsInlineStyle, (0, _expValEquals.expValEquals)('confluence_insert_excerpt_inline_vertical_align', 'isEnabled', true) && inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle,
|
|
1941
|
+
(0, _expValEquals.expValEquals)('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), (0, _expValEquals.expValEquals)('confluence_insert_excerpt_inline_vertical_align', 'isEnabled', true) && inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle,
|
|
1911
1942
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
1912
1943
|
(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 && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, 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' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, (0, _experiments.editorExperiment)('platform_synced_block', true) && syncBlockStyles, (0, _experiments.editorExperiment)('platform_synced_block', true) && syncBlockOverflowStyles, (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_2') && syncBlockPatch2Styles],
|
|
1913
1944
|
"data-testid": testId
|
|
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
71
71
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
72
72
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
73
73
|
var packageName = "@atlaskit/renderer";
|
|
74
|
-
var packageVersion = "126.8.
|
|
74
|
+
var packageVersion = "126.8.11";
|
|
75
75
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
76
76
|
containerName: 'ak-renderer-wrapper',
|
|
77
77
|
containerType: 'inline-size'
|
|
@@ -438,8 +438,10 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
438
438
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
439
439
|
}, []);
|
|
440
440
|
var rendererContext = (0, _react.useMemo)(function () {
|
|
441
|
-
return createRendererContext(props.featureFlags, props.isTopLevelRenderer, props.contentMode)
|
|
442
|
-
|
|
441
|
+
return _objectSpread(_objectSpread({}, createRendererContext(props.featureFlags, props.isTopLevelRenderer, props.contentMode)), {}, {
|
|
442
|
+
timeZone: props.timeZone
|
|
443
|
+
});
|
|
444
|
+
}, [props.featureFlags, props.isTopLevelRenderer, createRendererContext, props.contentMode, props.timeZone]);
|
|
443
445
|
(0, _useScrollToBlock.useScrollToBlock)(editorRef, props.document);
|
|
444
446
|
try {
|
|
445
447
|
var _rendererContext$feat, _props$media;
|
package/dist/es2019/messages.js
CHANGED
|
@@ -31,7 +31,7 @@ export const headingAnchorLinkMessages = defineMessages({
|
|
|
31
31
|
copyAriaLabel: {
|
|
32
32
|
id: 'fabric.editor.headingLink.copyAriaLabel',
|
|
33
33
|
defaultMessage: 'Copy',
|
|
34
|
-
description: '
|
|
34
|
+
description: 'Aria label for the copy link button displayed next to a heading. Used by screen readers to describe the button that copies the heading anchor link to the clipboard.'
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
export const tableCellMessages = defineMessages({
|
|
@@ -54,7 +54,8 @@ const BodiedExtension = props => {
|
|
|
54
54
|
if (result && /*#__PURE__*/React.isValidElement(result)) {
|
|
55
55
|
// Return the content directly if it's a valid JSX.Element
|
|
56
56
|
return renderExtension(result, layout, {
|
|
57
|
-
isTopLevel: path.length < 1
|
|
57
|
+
isTopLevel: path.length < 1,
|
|
58
|
+
rendererAppearance: props.rendererAppearance
|
|
58
59
|
}, removeOverflow, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, undefined, localId, shouldDisplayExtensionAsInline, node);
|
|
59
60
|
}
|
|
60
61
|
} catch {
|
|
@@ -64,7 +65,8 @@ const BodiedExtension = props => {
|
|
|
64
65
|
|
|
65
66
|
// Always return default content if anything goes wrong
|
|
66
67
|
return renderExtension(children, layout, {
|
|
67
|
-
isTopLevel: path.length < 1
|
|
68
|
+
isTopLevel: path.length < 1,
|
|
69
|
+
rendererAppearance: props.rendererAppearance
|
|
68
70
|
}, removeOverflow, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, undefined, localId, shouldDisplayExtensionAsInline, node);
|
|
69
71
|
}))));
|
|
70
72
|
};
|
|
@@ -2,7 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { memo } from 'react';
|
|
3
3
|
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
+
import { useRendererContext } from '../../renderer-context';
|
|
6
8
|
import { useTaskItemsFormatContext } from '../../ui/TaskItemsFormatContext/TaskItemsFormatContext';
|
|
7
9
|
import { useInlineAnnotationProps } from '../../ui/annotations/element/useInlineAnnotationProps';
|
|
8
10
|
const Date = /*#__PURE__*/memo(function Date(props) {
|
|
@@ -12,7 +14,11 @@ const Date = /*#__PURE__*/memo(function Date(props) {
|
|
|
12
14
|
parentIsIncompleteTask,
|
|
13
15
|
intl
|
|
14
16
|
} = props;
|
|
15
|
-
const
|
|
17
|
+
const {
|
|
18
|
+
timeZone: contextTimeZone
|
|
19
|
+
} = useRendererContext();
|
|
20
|
+
const timeZone = expValEquals('confluence_frontend_fix_date_hydration_error', 'isEnabled', true) ? contextTimeZone : undefined;
|
|
21
|
+
const className = !!parentIsIncompleteTask && isPastDate(timestamp, timeZone) ? 'date-node date-node-highlighted' : 'date-node';
|
|
16
22
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
17
23
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
18
24
|
className: DateSharedCssClassName.DATE_WRAPPER
|
|
@@ -23,7 +29,7 @@ const Date = /*#__PURE__*/memo(function Date(props) {
|
|
|
23
29
|
className: className,
|
|
24
30
|
"data-node-type": "date",
|
|
25
31
|
"data-timestamp": timestamp
|
|
26
|
-
}, parentIsIncompleteTask ? timestampToTaskContext(timestamp, intl) : timestampToString(timestamp, intl)));
|
|
32
|
+
}, parentIsIncompleteTask ? timestampToTaskContext(timestamp, intl, timeZone) : timestampToString(timestamp, intl)));
|
|
27
33
|
});
|
|
28
34
|
export const DateComponent = injectIntl(Date);
|
|
29
35
|
function DateWithFormatContext(props) {
|
|
@@ -41,9 +41,13 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
41
41
|
|
|
42
42
|
// by default, we assume the extension is at top level, (direct child of doc node)
|
|
43
43
|
const {
|
|
44
|
-
isTopLevel = true
|
|
44
|
+
isTopLevel = true,
|
|
45
|
+
rendererAppearance
|
|
45
46
|
} = options || {};
|
|
46
|
-
|
|
47
|
+
// we should only use custom layout for full-page appearance
|
|
48
|
+
const canUseCustomLayout = expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererAppearance === 'full-page' : true;
|
|
49
|
+
const isCustomLayout = isTopLevel && ['wide', 'full-width'].includes(layout) && canUseCustomLayout;
|
|
50
|
+
const centerAlignClass = isCustomLayout ? RendererCssClassName.EXTENSION_CENTER_ALIGN : '';
|
|
47
51
|
/**
|
|
48
52
|
* To reduce cumulative layout shift, we check installed manifest values (viewportSize) for Forge and extension node parameters
|
|
49
53
|
* for Connect (legacy). As Connect is being phased out, we want Forge to also start to store its expected height
|
|
@@ -61,9 +65,9 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
61
65
|
,
|
|
62
66
|
className: `${RendererCssClassName.EXTENSION} ${inlineClassName} ${options.shadowClassNames} ${centerAlignClass}`,
|
|
63
67
|
style: {
|
|
64
|
-
width: isInline ? undefined : isTopLevel ?
|
|
68
|
+
width: isInline ? undefined : (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? isCustomLayout : isTopLevel) ?
|
|
65
69
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
66
|
-
calcBreakoutWidthCss(layout) : '100%',
|
|
70
|
+
calcBreakoutWidthCss(layout) : expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%',
|
|
67
71
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
68
72
|
minHeight: isInline ? undefined : extensionHeight && `${extensionHeight}px`
|
|
69
73
|
},
|
|
@@ -87,8 +91,9 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
87
91
|
,
|
|
88
92
|
className: `${RendererCssClassName.EXTENSION} ${inlineClassName} ${options.shadowClassNames} ${centerAlignClass}`,
|
|
89
93
|
style: {
|
|
94
|
+
width: isInline ? undefined : (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? isCustomLayout : isTopLevel) ?
|
|
90
95
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
91
|
-
width:
|
|
96
|
+
calcBreakoutWidth(layout, width) : expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%',
|
|
92
97
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
93
98
|
minHeight: isInline ? undefined : `${extensionHeight}px`
|
|
94
99
|
},
|
|
@@ -130,7 +135,8 @@ const Extension = props => {
|
|
|
130
135
|
isTopLevel: path.length < 1,
|
|
131
136
|
handleRef,
|
|
132
137
|
shadowClassNames,
|
|
133
|
-
tabIndex: fg('platform_editor_dec_a11y_fixes') ? props.tabIndex : undefined
|
|
138
|
+
tabIndex: fg('platform_editor_dec_a11y_fixes') ? props.tabIndex : undefined,
|
|
139
|
+
rendererAppearance: props.rendererAppearance
|
|
134
140
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
135
141
|
}
|
|
136
142
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -143,7 +149,8 @@ const Extension = props => {
|
|
|
143
149
|
isTopLevel: path.length < 1,
|
|
144
150
|
handleRef,
|
|
145
151
|
shadowClassNames,
|
|
146
|
-
tabIndex: fg('platform_editor_dec_a11y_fixes') ? props.tabIndex : undefined
|
|
152
|
+
tabIndex: fg('platform_editor_dec_a11y_fixes') ? props.tabIndex : undefined,
|
|
153
|
+
rendererAppearance: props.rendererAppearance
|
|
147
154
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
148
155
|
});
|
|
149
156
|
};
|
|
@@ -40,18 +40,23 @@ const MultiBodiedExtensionWrapperLegacy = ({
|
|
|
40
40
|
width,
|
|
41
41
|
path,
|
|
42
42
|
layout,
|
|
43
|
+
rendererAppearance,
|
|
43
44
|
children
|
|
44
45
|
}) => {
|
|
45
46
|
const isTopLevel = path.length < 1;
|
|
46
|
-
|
|
47
|
+
// we should only use custom layout for full-page appearance
|
|
48
|
+
const canUseCustomLayout = expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererAppearance === 'full-page' : true;
|
|
49
|
+
const isCustomLayout = isTopLevel && ['wide', 'full-width'].includes(layout) && canUseCustomLayout;
|
|
50
|
+
const centerAlignClass = isCustomLayout ? RendererCssClassName.EXTENSION_CENTER_ALIGN : '';
|
|
47
51
|
|
|
48
52
|
// This hierarchy is copied from regular extension (see extension.tsx)
|
|
49
53
|
return jsx("div", {
|
|
50
54
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
51
55
|
className: `${RendererCssClassName.EXTENSION} ${centerAlignClass}`,
|
|
52
56
|
style: {
|
|
57
|
+
width: (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? isCustomLayout : isTopLevel) ?
|
|
53
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
54
|
-
|
|
59
|
+
calcBreakoutWidth(layout, width) : expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%'
|
|
55
60
|
},
|
|
56
61
|
"data-layout": layout,
|
|
57
62
|
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
@@ -63,19 +68,23 @@ const MultiBodiedExtensionWrapperLegacy = ({
|
|
|
63
68
|
const MultiBodiedExtensionWrapperNext = ({
|
|
64
69
|
path,
|
|
65
70
|
layout,
|
|
71
|
+
rendererAppearance,
|
|
66
72
|
children
|
|
67
73
|
}) => {
|
|
68
74
|
const isTopLevel = path.length < 1;
|
|
69
|
-
|
|
75
|
+
// we should only use custom layout for full-page appearance
|
|
76
|
+
const canUseCustomLayout = expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererAppearance === 'full-page' : true;
|
|
77
|
+
const isCustomLayout = isTopLevel && ['wide', 'full-width'].includes(layout) && canUseCustomLayout;
|
|
78
|
+
const centerAlignClass = isCustomLayout ? RendererCssClassName.EXTENSION_CENTER_ALIGN : '';
|
|
70
79
|
|
|
71
80
|
// This hierarchy is copied from regular extension (see extension.tsx)
|
|
72
81
|
return jsx("div", {
|
|
73
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
74
83
|
className: `${RendererCssClassName.EXTENSION} ${centerAlignClass}`,
|
|
75
84
|
style: {
|
|
76
|
-
width: isTopLevel ?
|
|
85
|
+
width: (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? isCustomLayout : isTopLevel) ?
|
|
77
86
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
78
|
-
calcBreakoutWidthCss(layout) : '100%'
|
|
87
|
+
calcBreakoutWidthCss(layout) : expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%'
|
|
79
88
|
},
|
|
80
89
|
"data-layout": layout,
|
|
81
90
|
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
@@ -95,7 +104,8 @@ const MultiBodiedExtension = props => {
|
|
|
95
104
|
extensionKey,
|
|
96
105
|
content,
|
|
97
106
|
marks,
|
|
98
|
-
localId
|
|
107
|
+
localId,
|
|
108
|
+
rendererAppearance
|
|
99
109
|
} = props;
|
|
100
110
|
const [activeChildIndex, setActiveChildIndex] = useState(0);
|
|
101
111
|
const {
|
|
@@ -161,7 +171,8 @@ const MultiBodiedExtension = props => {
|
|
|
161
171
|
"data-node-type": "multiBodiedExtension"
|
|
162
172
|
}, jsx(MultiBodiedExtensionWrapperNext, {
|
|
163
173
|
layout: layout,
|
|
164
|
-
path: path
|
|
174
|
+
path: path,
|
|
175
|
+
rendererAppearance: rendererAppearance
|
|
165
176
|
}, renderContent()));
|
|
166
177
|
}
|
|
167
178
|
return jsx("section", {
|
|
@@ -176,7 +187,8 @@ const MultiBodiedExtension = props => {
|
|
|
176
187
|
}) => jsx(MultiBodiedExtensionWrapperLegacy, {
|
|
177
188
|
layout: layout,
|
|
178
189
|
width: width,
|
|
179
|
-
path: path
|
|
190
|
+
path: path,
|
|
191
|
+
rendererAppearance: rendererAppearance
|
|
180
192
|
}, renderContent())));
|
|
181
193
|
};
|
|
182
194
|
export default MultiBodiedExtension;
|