@atlaskit/renderer 141.0.6 → 142.0.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 +34 -0
- package/dist/cjs/react/marks/breakout.js +2 -5
- package/dist/cjs/react/nodes/panel-compiled.js +1 -1
- package/dist/cjs/react/nodes/panel-emotion.js +1 -1
- package/dist/cjs/react/nodes/table/colgroup.js +2 -3
- package/dist/cjs/react/nodes/table.js +4 -4
- package/dist/cjs/render-document.js +40 -50
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +2 -2
- package/dist/cjs/ui/Renderer/index.js +3 -10
- package/dist/es2019/react/marks/breakout.js +2 -5
- package/dist/es2019/react/nodes/panel-compiled.js +1 -1
- package/dist/es2019/react/nodes/panel-emotion.js +1 -1
- package/dist/es2019/react/nodes/table/colgroup.js +2 -3
- package/dist/es2019/react/nodes/table.js +4 -4
- package/dist/es2019/render-document.js +31 -38
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +2 -2
- package/dist/es2019/ui/Renderer/index.js +3 -10
- package/dist/esm/react/marks/breakout.js +2 -5
- package/dist/esm/react/nodes/panel-compiled.js +1 -1
- package/dist/esm/react/nodes/panel-emotion.js +1 -1
- package/dist/esm/react/nodes/table/colgroup.js +2 -3
- package/dist/esm/react/nodes/table.js +4 -4
- package/dist/esm/render-document.js +40 -50
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +2 -2
- package/dist/esm/ui/Renderer/index.js +3 -10
- package/dist/types/render-document.d.ts +1 -1
- package/dist/types/ui/renderer-props.d.ts +0 -2
- package/package.json +3 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 142.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`01047cd51f538`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/01047cd51f538) -
|
|
8
|
+
Clean up `platform_editor_renderer_rm_usespecbasedvalidator` and always use spec-based validation
|
|
9
|
+
in the renderer.
|
|
10
|
+
|
|
11
|
+
Remove the deprecated `useSpecBasedValidator` renderer prop and the fifth `renderDocument`
|
|
12
|
+
argument. Remove this prop from renderer usages and remove the fifth argument from direct
|
|
13
|
+
`renderDocument` calls, shifting any subsequent arguments one position to the left. The legacy
|
|
14
|
+
validator is no longer available through the renderer.
|
|
15
|
+
|
|
16
|
+
Update editor AI renderer consumers to use the permanent validation behavior.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`90cc9e3c7fc0c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/90cc9e3c7fc0c) -
|
|
21
|
+
Support gated dark-background styling for the configured Rovo Chat agent mention in editors and
|
|
22
|
+
the renderer.
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
25
|
+
## 141.0.7
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- [`3f8ea6c51b718`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3f8ea6c51b718) -
|
|
30
|
+
Remove the rolled-out `editor_tinymce_full_width_mode` and
|
|
31
|
+
`confluence_max_width_content_appearance` experiments and make max-width content behavior
|
|
32
|
+
permanent.
|
|
33
|
+
- [`a181b8f5541eb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a181b8f5541eb) -
|
|
34
|
+
Clean up feature gate `platform_editor_nest_table_in_panel_patch_2`
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
|
|
3
37
|
## 141.0.6
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
|
@@ -9,7 +9,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
11
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
12
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
12
|
var _consts = require("../../consts");
|
|
14
13
|
/**
|
|
15
14
|
* @jsxRuntime classic
|
|
@@ -31,10 +30,8 @@ var getWidth = function getWidth(width, mode) {
|
|
|
31
30
|
if ((0, _editorExperiment.editorExperiment)('advanced_layouts', true) && width) {
|
|
32
31
|
return "min(".concat(width, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
33
32
|
} else {
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
return "min(".concat(_editorSharedStyles.akEditorMaxLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
37
|
-
}
|
|
33
|
+
if (mode === 'max' || typeof width === 'number' && width >= _editorSharedStyles.akEditorFullWidthLayoutWidth) {
|
|
34
|
+
return "min(".concat(_editorSharedStyles.akEditorMaxLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
38
35
|
}
|
|
39
36
|
if (mode === 'full-width') {
|
|
40
37
|
return "min(".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
@@ -48,7 +48,7 @@ var PanelStyledCompiled = exports.PanelStyledCompiled = function PanelStyledComp
|
|
|
48
48
|
var customBackgroundColor = backgroundColor ? (0, _editorPalette.hexToEditorBackgroundPaletteColor)(backgroundColor) || backgroundColor : undefined;
|
|
49
49
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, props, {
|
|
50
50
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class
|
|
51
|
-
className: (0, _runtime.ax)(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && (0, _fg.fg)('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) &&
|
|
51
|
+
className: (0, _runtime.ax)(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && (0, _fg.fg)('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === _panel.PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
|
|
52
52
|
style: _objectSpread(_objectSpread({}, {
|
|
53
53
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable
|
|
54
54
|
'--ak-renderer-panel-custom-bg-color': customBackgroundColor
|
|
@@ -213,7 +213,7 @@ var PanelStyledEmotion = exports.PanelStyledEmotion = function PanelStyledEmotio
|
|
|
213
213
|
{
|
|
214
214
|
'--ak-renderer-panel-custom-bg-color': customBackgroundColor
|
|
215
215
|
},
|
|
216
|
-
css: [panelBaseStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && (0, _fg.fg)('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) &&
|
|
216
|
+
css: [panelBaseStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && (0, _fg.fg)('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === _panel.PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
|
|
217
217
|
// Ignored via go/ees005
|
|
218
218
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
219
219
|
}, props), props.children);
|
|
@@ -13,7 +13,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
13
13
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
16
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
var _rendererContext = require("../../../renderer-context");
|
|
18
17
|
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); }
|
|
19
18
|
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; }
|
|
@@ -370,8 +369,8 @@ var Colgroup = exports.Colgroup = function Colgroup(props) {
|
|
|
370
369
|
})) !== null && _renderSyncBlockColgr !== void 0 ? _renderSyncBlockColgr : renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
|
|
371
370
|
isTopLevelRenderer: isTopLevelRenderer,
|
|
372
371
|
isInsideOfSyncBlock: isInsideOfSyncBlock,
|
|
373
|
-
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max'
|
|
374
|
-
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max'
|
|
372
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' || props.rendererAppearance === 'comment',
|
|
373
|
+
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max')
|
|
375
374
|
}));
|
|
376
375
|
if (!colStyles) {
|
|
377
376
|
return null;
|
|
@@ -622,7 +622,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
622
622
|
}) ? 'calc(100cqw - var(--ak-renderer--full-page-gutter) * 2)' : "100cqw - ".concat(_style.FullPagePadding, "px * 2");
|
|
623
623
|
var renderWidthCSS = rendererAppearance === 'full-page' ? fullPageRendererWidthCSS : "100cqw";
|
|
624
624
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode) {
|
|
625
|
-
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)
|
|
625
|
+
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
626
626
|
return "min(".concat(_editorSharedStyles.akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
627
627
|
} else if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
628
628
|
return "min(".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
@@ -641,9 +641,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
641
641
|
var fullWidthLineLengthCSS = "min(".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
642
642
|
var maxWidthLineLengthCSS = "min(".concat(_editorSharedStyles.akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
643
643
|
var isCommentAppearanceAndTableAlignmentEnabled = (0, _appearance.isCommentAppearance)(rendererAppearance) && allowTableAlignment;
|
|
644
|
-
var lineLengthCSS = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLengthCSS : (0, _appearance.isMaxWidthAppearance)(rendererAppearance)
|
|
644
|
+
var lineLengthCSS = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLengthCSS : (0, _appearance.isMaxWidthAppearance)(rendererAppearance) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
645
645
|
var tableWidthNew = (0, _nodeWidth.getTableContainerWidth)(tableNode);
|
|
646
|
-
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance) || (0, _appearance.isMaxWidthAppearance)(rendererAppearance)
|
|
646
|
+
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance) || (0, _appearance.isMaxWidthAppearance)(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
647
647
|
var leftCSS;
|
|
648
648
|
if (shouldCalculateLeftForAlignment) {
|
|
649
649
|
leftCSS = "(".concat(tableWidthCSS, " - ").concat(lineLengthCSS, ") / 2");
|
|
@@ -672,7 +672,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
672
672
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
673
673
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
674
674
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
675
|
-
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max'
|
|
675
|
+
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max') {
|
|
676
676
|
finalTableContainerWidth = allowTableResizing ? "calc(".concat(tableWidthCSS, ")") : 'inherit';
|
|
677
677
|
}
|
|
678
678
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -11,7 +11,6 @@ var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
|
11
11
|
var _transforms = require("@atlaskit/adf-utils/transforms");
|
|
12
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
|
-
var _validator = require("@atlaskit/editor-common/validator");
|
|
15
14
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
16
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
var _events = require("./analytics/events");
|
|
@@ -34,37 +33,34 @@ var withStopwatch = function withStopwatch(cb) {
|
|
|
34
33
|
|
|
35
34
|
/** Schema-variant escape hatches handed to the ADF validator. */
|
|
36
35
|
|
|
37
|
-
var _validation = function _validation(doc, schema, adfStage,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
|
|
54
|
-
// which is what a renderer wants: stored documents can contain them, and wrapping such content
|
|
55
|
-
// as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
|
|
56
|
-
// strictness and gets it. The legacy branch below reads the same value as a schema selector and
|
|
57
|
-
// so keeps its own `final` default.
|
|
58
|
-
result = skipValidation ? transformedAdf || doc : (0, _utils.validateADFEntity)(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
|
|
59
|
-
} else {
|
|
60
|
-
result = (0, _validator.getValidDocument)(doc, schema, adfStage !== null && adfStage !== void 0 ? adfStage : 'final');
|
|
36
|
+
var _validation = function _validation(doc, schema, adfStage, dispatchAnalyticsEvent, skipValidation, validationOverrides) {
|
|
37
|
+
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
38
|
+
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
39
|
+
var _transformMediaLinkMa = (0, _transforms.transformMediaLinkMarks)(doc),
|
|
40
|
+
transformedAdf = _transformMediaLinkMa.transformedAdf,
|
|
41
|
+
isTransformed = _transformMediaLinkMa.isTransformed;
|
|
42
|
+
if (isTransformed && dispatchAnalyticsEvent) {
|
|
43
|
+
dispatchAnalyticsEvent({
|
|
44
|
+
action: _analytics.ACTION.MEDIA_LINK_TRANSFORMED,
|
|
45
|
+
actionSubject: _analytics.ACTION_SUBJECT.RENDERER,
|
|
46
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
47
|
+
});
|
|
61
48
|
}
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
|
|
50
|
+
// Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
|
|
51
|
+
// which is what a renderer wants: stored documents can contain them, and wrapping such content
|
|
52
|
+
// as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
|
|
53
|
+
// strictness and gets it.
|
|
54
|
+
var result = skipValidation ? transformedAdf || doc : (0, _utils.validateADFEntity)(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
|
|
55
|
+
|
|
56
|
+
// The spec validator can return the original root object when malformed JSON has no node type.
|
|
57
|
+
// Reject it here, matching the legacy validator, before ProseMirror attempts to deserialize it.
|
|
58
|
+
if (!result || typeof result.type !== 'string' || result.type.length === 0) {
|
|
59
|
+
return null;
|
|
64
60
|
}
|
|
65
61
|
|
|
66
62
|
// ProseMirror always require a child under doc
|
|
67
|
-
if (result.type === 'doc'
|
|
63
|
+
if (result.type === 'doc') {
|
|
68
64
|
if (Array.isArray(result.content) && result.content.length === 0) {
|
|
69
65
|
result.content.push({
|
|
70
66
|
type: 'paragraph',
|
|
@@ -149,24 +145,22 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
|
|
|
149
145
|
return result;
|
|
150
146
|
};
|
|
151
147
|
var memoValidation = (0, _memoizeOne.default)(_validation, function (newArgs, lastArgs) {
|
|
152
|
-
var _newArgs = (0, _slicedToArray2.default)(newArgs,
|
|
148
|
+
var _newArgs = (0, _slicedToArray2.default)(newArgs, 6),
|
|
153
149
|
newDoc = _newArgs[0],
|
|
154
150
|
newSchema = _newArgs[1],
|
|
155
151
|
newADFStage = _newArgs[2],
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
var _lastArgs = (0, _slicedToArray2.default)(lastArgs, 7),
|
|
152
|
+
/* ignoring dispatchAnalyticsEvent */newSkipValidation = _newArgs[4],
|
|
153
|
+
newValidationOverrides = _newArgs[5];
|
|
154
|
+
var _lastArgs = (0, _slicedToArray2.default)(lastArgs, 6),
|
|
160
155
|
oldDoc = _lastArgs[0],
|
|
161
156
|
oldSchema = _lastArgs[1],
|
|
162
157
|
oldADFStage = _lastArgs[2],
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
oldValidationOverrides = _lastArgs[6];
|
|
158
|
+
/* ignoring dispatchAnalyticsEvent */oldSkipValidation = _lastArgs[4],
|
|
159
|
+
oldValidationOverrides = _lastArgs[5];
|
|
166
160
|
|
|
167
161
|
// `areDocsEqual` may stringify the whole document, so it goes last and only runs once everything
|
|
168
162
|
// cheaper has matched.
|
|
169
|
-
return newSchema === oldSchema && newADFStage === oldADFStage &&
|
|
163
|
+
return newSchema === oldSchema && newADFStage === oldADFStage && newSkipValidation === oldSkipValidation && areValidationOverridesEqual(newValidationOverrides, oldValidationOverrides) && areDocsEqual(newDoc, oldDoc);
|
|
170
164
|
});
|
|
171
165
|
|
|
172
166
|
// Ignored via go/ees005
|
|
@@ -260,22 +254,18 @@ var memoCreateNodeAndCheck = (0, _memoizeOne.default)(_createNodeAndCheck, funct
|
|
|
260
254
|
var renderDocument = exports.renderDocument = function renderDocument(doc, serializer) {
|
|
261
255
|
var schema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _schemaDefault.defaultSchema;
|
|
262
256
|
var adfStage = arguments.length > 3 ? arguments[3] : undefined;
|
|
263
|
-
var
|
|
264
|
-
var
|
|
265
|
-
var
|
|
266
|
-
var
|
|
267
|
-
var
|
|
268
|
-
var
|
|
269
|
-
var
|
|
270
|
-
var validationOverrides = arguments.length > 11 ? arguments[11] : undefined;
|
|
257
|
+
var rendererId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'noid';
|
|
258
|
+
var dispatchAnalyticsEvent = arguments.length > 5 ? arguments[5] : undefined;
|
|
259
|
+
var unsupportedContentLevelsTracking = arguments.length > 6 ? arguments[6] : undefined;
|
|
260
|
+
var appearance = arguments.length > 7 ? arguments[7] : undefined;
|
|
261
|
+
var includeNodesCountInStats = arguments.length > 8 ? arguments[8] : undefined;
|
|
262
|
+
var skipValidation = arguments.length > 9 ? arguments[9] : undefined;
|
|
263
|
+
var validationOverrides = arguments.length > 10 ? arguments[10] : undefined;
|
|
271
264
|
var stat = {
|
|
272
265
|
sanitizeTime: 0
|
|
273
266
|
};
|
|
274
|
-
if ((0, _fg.fg)('platform_editor_renderer_rm_usespecbasedvalidator')) {
|
|
275
|
-
useSpecBasedValidator = true;
|
|
276
|
-
}
|
|
277
267
|
var _withStopwatch = withStopwatch(function () {
|
|
278
|
-
return memoValidation(doc, schema, adfStage,
|
|
268
|
+
return memoValidation(doc, schema, adfStage, dispatchAnalyticsEvent, skipValidation, validationOverrides);
|
|
279
269
|
}),
|
|
280
270
|
validDoc = _withStopwatch.output,
|
|
281
271
|
sanitizeTime = _withStopwatch.time;
|
|
@@ -304,7 +294,7 @@ var renderDocument = exports.renderDocument = function renderDocument(doc, seria
|
|
|
304
294
|
|
|
305
295
|
// save serialize tree time to stats
|
|
306
296
|
stat.serializeTime = serializeTime;
|
|
307
|
-
if (dispatchAnalyticsEvent
|
|
297
|
+
if (dispatchAnalyticsEvent) {
|
|
308
298
|
(0, _utils.findAndTrackUnsupportedContentNodes)(node, schema, dispatchAnalyticsEvent);
|
|
309
299
|
if (unsupportedContentLevelsTracking !== null && unsupportedContentLevelsTracking !== void 0 && unsupportedContentLevelsTracking.enabled) {
|
|
310
300
|
var documentData = {
|
|
@@ -2313,13 +2313,13 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2313
2313
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- CSS custom properties for UGC font tokens
|
|
2314
2314
|
'--ak-renderer-editor-font-small-text': _ugcTokens.editorUGCTokensRefreshed['editor.font.body.small']
|
|
2315
2315
|
},
|
|
2316
|
-
css: [(0, _expValEquals.expValEquals)('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, fontSizeStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, headingAnchorButtonFocusVisibleStyles, (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'
|
|
2316
|
+
css: [(0, _expValEquals.expValEquals)('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, fontSizeStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, headingAnchorButtonFocusVisibleStyles, (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, _table2.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && ((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' && extensionStyle, contentMode === 'compact' ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, listItemHiddenMarkerStyles, indentationSharedStyles, indentationSharedStylesWithMarginFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, !(0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && highlightLinksUnsetStyles,
|
|
2317
2317
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2318
2318
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix, headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, (0, _fg.fg)('editor_inline_comments_on_inline_nodes') && ((0, _expValEquals.expValEquals)('confluence_fe_renderer_inline_node_mark_color_fix', 'isEnabled', true) ? rendererAnnotationStyles : rendererAnnotationStylesOld),
|
|
2319
2319
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2320
2320
|
(0, _fg.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, expandSsrMarginStyles,
|
|
2321
2321
|
// this should be placed after baseOtherStyles
|
|
2322
|
-
(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, _fg.fg)('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, (0, _fg.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, 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, (0, _fg.fg)('platform_renderer_ssr_block_margin_fix') && [blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles], appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max'
|
|
2322
|
+
(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, _fg.fg)('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, (0, _fg.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, 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, (0, _fg.fg)('platform_renderer_ssr_block_margin_fix') && [blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles], appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max') && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? contentMode === 'compact' ? scaledDenseEmojiStyles : scaledEmojiStyles : contentMode === 'compact' ? denseStyles : undefined, contentMode === 'compact' ? scaledDenseUnicodeEmojiStylesNew : scaledUnicodeEmojiStylesNew, syncBlockStyles, centerWrapperStyles, isInsideSyncBlock ? syncBlockRendererStyles : null, isInsideSyncBlock && tableFakeBorderStyles, isInsideSyncBlock && (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null, (0, _expValEquals.expValEquals)('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2323
2323
|
"data-testid": testId
|
|
2324
2324
|
}, children);
|
|
2325
2325
|
};
|
|
@@ -29,8 +29,6 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
29
29
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
30
30
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
31
31
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
32
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
33
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
34
32
|
var _ = require("../../");
|
|
35
33
|
var _analyticsContext = _interopRequireDefault(require("../../analytics/analyticsContext"));
|
|
36
34
|
var _events = require("../../analytics/events");
|
|
@@ -73,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
73
71
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
74
72
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
75
73
|
var packageName = "@atlaskit/renderer";
|
|
76
|
-
var packageVersion = "141.0.
|
|
74
|
+
var packageVersion = "141.0.7";
|
|
77
75
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
78
76
|
containerName: 'ak-renderer-wrapper',
|
|
79
77
|
containerType: 'inline-size'
|
|
@@ -500,7 +498,7 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
500
498
|
try {
|
|
501
499
|
var _rendererContext$feat, _props$media;
|
|
502
500
|
var schema = getSchema(props.schema, props.adfStage);
|
|
503
|
-
var _renderDocument = (0, _.renderDocument)(props.shouldRemoveEmptySpaceAroundContent ? (0, _rendererHelper.removeEmptySpaceAroundContent)(props.document) : props.document, serializer, schema, props.adfStage,
|
|
501
|
+
var _renderDocument = (0, _.renderDocument)(props.shouldRemoveEmptySpaceAroundContent ? (0, _rendererHelper.removeEmptySpaceAroundContent)(props.document) : props.document, serializer, schema, props.adfStage, id, _fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats, props.skipValidation, validationOverrides),
|
|
504
502
|
result = _renderDocument.result,
|
|
505
503
|
stat = _renderDocument.stat,
|
|
506
504
|
pmDoc = _renderDocument.pmDoc;
|
|
@@ -802,7 +800,7 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
802
800
|
// Only apply container-type = inline-size when having a known width in full-page/full-width/comment mode.
|
|
803
801
|
// Otherwise when appearance is unspecified the renderer size is decided by the content.
|
|
804
802
|
// In this case we can't set the container-type = inline-size as it will collapse width to 0.
|
|
805
|
-
return (appearance === 'full-page' || appearance === 'full-width' ||
|
|
803
|
+
return (appearance === 'full-page' || appearance === 'full-width' || appearance === 'max') &&
|
|
806
804
|
// In case of having excerpt-include on page there are multiple renderers nested.
|
|
807
805
|
// Make sure only the root renderer is set to be query container.
|
|
808
806
|
isTopLevelRenderer && allowRendererContainerStyles ? (0, _react2.jsx)("div", {
|
|
@@ -859,11 +857,6 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
|
|
|
859
857
|
adfDocument = props.document;
|
|
860
858
|
var localRef = _react.default.useRef(null);
|
|
861
859
|
var innerRef = props.innerRef || localRef;
|
|
862
|
-
|
|
863
|
-
// @see https://hello.jira.atlassian.cloud/browse/EDITOR-3389
|
|
864
|
-
if (props.appearance === 'max' && !(0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) && !(0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) {
|
|
865
|
-
props.appearance = 'full-width';
|
|
866
|
-
}
|
|
867
860
|
if (!allowAnnotations) {
|
|
868
861
|
// Ignored via go/ees005
|
|
869
862
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -7,7 +7,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
7
7
|
import { jsx, css } from '@emotion/react';
|
|
8
8
|
import { akEditorFullWidthLayoutWidth, akEditorMaxLayoutWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
10
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
10
|
import { RendererCssClassName } from '../../consts';
|
|
12
11
|
const flexWrapperStyles = css({
|
|
13
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -23,10 +22,8 @@ const getWidth = (width, mode) => {
|
|
|
23
22
|
if (editorExperiment('advanced_layouts', true) && width) {
|
|
24
23
|
return `min(${width}px, var(--ak-editor--breakout-container-without-gutter-width))`;
|
|
25
24
|
} else {
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
return `min(${akEditorMaxLayoutWidth}px, var(--ak-editor--breakout-container-without-gutter-width))`;
|
|
29
|
-
}
|
|
25
|
+
if (mode === 'max' || typeof width === 'number' && width >= akEditorFullWidthLayoutWidth) {
|
|
26
|
+
return `min(${akEditorMaxLayoutWidth}px, var(--ak-editor--breakout-container-without-gutter-width))`;
|
|
30
27
|
}
|
|
31
28
|
if (mode === 'full-width') {
|
|
32
29
|
return `min(${akEditorFullWidthLayoutWidth}px, var(--ak-editor--breakout-container-without-gutter-width))`;
|
|
@@ -37,7 +37,7 @@ export const PanelStyledCompiled = ({
|
|
|
37
37
|
const customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) || backgroundColor : undefined;
|
|
38
38
|
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
39
39
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class
|
|
40
|
-
className: ax(["_lklzfajl _1alzoqnp _xmo1idpf _u70eidpf _1m1jidpf _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3ckbl _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hau12gs _7c6pj39m _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) &&
|
|
40
|
+
className: ax(["_lklzfajl _1alzoqnp _xmo1idpf _u70eidpf _1m1jidpf _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3ckbl _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hau12gs _7c6pj39m _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
|
|
41
41
|
style: {
|
|
42
42
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable
|
|
43
43
|
'--ak-renderer-panel-custom-bg-color': customBackgroundColor
|
|
@@ -206,7 +206,7 @@ export const PanelStyledEmotion = ({
|
|
|
206
206
|
{
|
|
207
207
|
'--ak-renderer-panel-custom-bg-color': customBackgroundColor
|
|
208
208
|
},
|
|
209
|
-
css: [panelBaseStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) &&
|
|
209
|
+
css: [panelBaseStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
|
|
210
210
|
// Ignored via go/ees005
|
|
211
211
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
212
212
|
}, props), props.children);
|
|
@@ -4,7 +4,6 @@ import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common
|
|
|
4
4
|
import { WidthContext } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
7
|
import { useRendererContext } from '../../../renderer-context';
|
|
9
8
|
// we allow scaling down column widths by no more than 30%
|
|
10
9
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
@@ -342,8 +341,8 @@ export const Colgroup = props => {
|
|
|
342
341
|
...props,
|
|
343
342
|
isTopLevelRenderer,
|
|
344
343
|
isInsideOfSyncBlock,
|
|
345
|
-
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max'
|
|
346
|
-
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max'
|
|
344
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' || props.rendererAppearance === 'comment',
|
|
345
|
+
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max')
|
|
347
346
|
});
|
|
348
347
|
if (!colStyles) {
|
|
349
348
|
return null;
|
|
@@ -561,7 +561,7 @@ export class TableContainer extends React.Component {
|
|
|
561
561
|
}) ? 'calc(100cqw - var(--ak-renderer--full-page-gutter) * 2)' : `100cqw - ${FullPagePadding}px * 2`;
|
|
562
562
|
const renderWidthCSS = rendererAppearance === 'full-page' ? fullPageRendererWidthCSS : `100cqw`;
|
|
563
563
|
const calcDefaultLayoutWidthByAppearance = (rendererAppearance, tableNode) => {
|
|
564
|
-
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)
|
|
564
|
+
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
565
565
|
return `min(${akEditorMaxWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
566
566
|
} else if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
567
567
|
return `min(${akEditorFullWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
@@ -580,9 +580,9 @@ export class TableContainer extends React.Component {
|
|
|
580
580
|
const fullWidthLineLengthCSS = `min(${akEditorFullWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
581
581
|
const maxWidthLineLengthCSS = `min(${akEditorMaxWidthLayoutWidth}px, ${renderWidthCSS})`;
|
|
582
582
|
const isCommentAppearanceAndTableAlignmentEnabled = isCommentAppearance(rendererAppearance) && allowTableAlignment;
|
|
583
|
-
const lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isMaxWidthAppearance(rendererAppearance)
|
|
583
|
+
const lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isMaxWidthAppearance(rendererAppearance) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : `${lineLengthFixedWidth}px`;
|
|
584
584
|
const tableWidthNew = getTableContainerWidth(tableNode);
|
|
585
|
-
const shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isMaxWidthAppearance(rendererAppearance)
|
|
585
|
+
const shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isMaxWidthAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
586
586
|
let leftCSS;
|
|
587
587
|
if (shouldCalculateLeftForAlignment) {
|
|
588
588
|
leftCSS = `(${tableWidthCSS} - ${lineLengthCSS}) / 2`;
|
|
@@ -611,7 +611,7 @@ export class TableContainer extends React.Component {
|
|
|
611
611
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
612
612
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
613
613
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
614
|
-
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max'
|
|
614
|
+
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max') {
|
|
615
615
|
finalTableContainerWidth = allowTableResizing ? `calc(${tableWidthCSS})` : 'inherit';
|
|
616
616
|
}
|
|
617
617
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -6,7 +6,6 @@ import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
|
6
6
|
import { nativeEmbedsFallbackTransform, transformContainerNodes, transformMediaLinkMarks, transformNestedTablesIncomingDocument } from '@atlaskit/adf-utils/transforms';
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { findAndTrackUnsupportedContentNodes, validateADFEntity } from '@atlaskit/editor-common/utils';
|
|
9
|
-
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
10
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
11
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
11
|
import { PLATFORM } from './analytics/events';
|
|
@@ -26,38 +25,35 @@ const withStopwatch = cb => {
|
|
|
26
25
|
|
|
27
26
|
/** Schema-variant escape hatches handed to the ADF validator. */
|
|
28
27
|
|
|
29
|
-
const _validation = (doc, schema, adfStage,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
|
|
47
|
-
// which is what a renderer wants: stored documents can contain them, and wrapping such content
|
|
48
|
-
// as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
|
|
49
|
-
// strictness and gets it. The legacy branch below reads the same value as a schema selector and
|
|
50
|
-
// so keeps its own `final` default.
|
|
51
|
-
result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
|
|
52
|
-
} else {
|
|
53
|
-
result = getValidDocument(doc, schema, adfStage !== null && adfStage !== void 0 ? adfStage : 'final');
|
|
28
|
+
const _validation = (doc, schema, adfStage, dispatchAnalyticsEvent, skipValidation, validationOverrides) => {
|
|
29
|
+
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
30
|
+
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
31
|
+
const {
|
|
32
|
+
transformedAdf,
|
|
33
|
+
isTransformed
|
|
34
|
+
} = transformMediaLinkMarks(doc);
|
|
35
|
+
if (isTransformed && dispatchAnalyticsEvent) {
|
|
36
|
+
dispatchAnalyticsEvent({
|
|
37
|
+
action: ACTION.MEDIA_LINK_TRANSFORMED,
|
|
38
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
39
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
40
|
+
});
|
|
54
41
|
}
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
|
|
43
|
+
// Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
|
|
44
|
+
// which is what a renderer wants: stored documents can contain them, and wrapping such content
|
|
45
|
+
// as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
|
|
46
|
+
// strictness and gets it.
|
|
47
|
+
let result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
|
|
48
|
+
|
|
49
|
+
// The spec validator can return the original root object when malformed JSON has no node type.
|
|
50
|
+
// Reject it here, matching the legacy validator, before ProseMirror attempts to deserialize it.
|
|
51
|
+
if (!result || typeof result.type !== 'string' || result.type.length === 0) {
|
|
52
|
+
return null;
|
|
57
53
|
}
|
|
58
54
|
|
|
59
55
|
// ProseMirror always require a child under doc
|
|
60
|
-
if (result.type === 'doc'
|
|
56
|
+
if (result.type === 'doc') {
|
|
61
57
|
if (Array.isArray(result.content) && result.content.length === 0) {
|
|
62
58
|
result.content.push({
|
|
63
59
|
type: 'paragraph',
|
|
@@ -145,12 +141,12 @@ const _validation = (doc, schema, adfStage, useSpecBasedValidator, dispatchAnaly
|
|
|
145
141
|
return result;
|
|
146
142
|
};
|
|
147
143
|
const memoValidation = memoizeOne(_validation, (newArgs, lastArgs) => {
|
|
148
|
-
const [newDoc, newSchema, newADFStage
|
|
149
|
-
const [oldDoc, oldSchema, oldADFStage
|
|
144
|
+
const [newDoc, newSchema, newADFStage,, /* ignoring dispatchAnalyticsEvent */newSkipValidation, newValidationOverrides] = newArgs;
|
|
145
|
+
const [oldDoc, oldSchema, oldADFStage,, /* ignoring dispatchAnalyticsEvent */oldSkipValidation, oldValidationOverrides] = lastArgs;
|
|
150
146
|
|
|
151
147
|
// `areDocsEqual` may stringify the whole document, so it goes last and only runs once everything
|
|
152
148
|
// cheaper has matched.
|
|
153
|
-
return newSchema === oldSchema && newADFStage === oldADFStage &&
|
|
149
|
+
return newSchema === oldSchema && newADFStage === oldADFStage && newSkipValidation === oldSkipValidation && areValidationOverridesEqual(newValidationOverrides, oldValidationOverrides) && areDocsEqual(newDoc, oldDoc);
|
|
154
150
|
});
|
|
155
151
|
|
|
156
152
|
// Ignored via go/ees005
|
|
@@ -228,18 +224,15 @@ const memoCreateNodeAndCheck = memoizeOne(_createNodeAndCheck, (newArgs, lastArg
|
|
|
228
224
|
const [oldSchema, oldDoc] = lastArgs;
|
|
229
225
|
return newSchema === oldSchema && areDocsEqual(newDoc, oldDoc);
|
|
230
226
|
});
|
|
231
|
-
export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage,
|
|
227
|
+
export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage, rendererId = 'noid', dispatchAnalyticsEvent, unsupportedContentLevelsTracking, appearance, includeNodesCountInStats, skipValidation, validationOverrides) => {
|
|
232
228
|
const stat = {
|
|
233
229
|
sanitizeTime: 0
|
|
234
230
|
};
|
|
235
|
-
if (fg('platform_editor_renderer_rm_usespecbasedvalidator')) {
|
|
236
|
-
useSpecBasedValidator = true;
|
|
237
|
-
}
|
|
238
231
|
const {
|
|
239
232
|
output: validDoc,
|
|
240
233
|
time: sanitizeTime
|
|
241
234
|
} = withStopwatch(() => {
|
|
242
|
-
return memoValidation(doc, schema, adfStage,
|
|
235
|
+
return memoValidation(doc, schema, adfStage, dispatchAnalyticsEvent, skipValidation, validationOverrides);
|
|
243
236
|
});
|
|
244
237
|
|
|
245
238
|
// save sanitize time to stats
|
|
@@ -268,7 +261,7 @@ export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage
|
|
|
268
261
|
|
|
269
262
|
// save serialize tree time to stats
|
|
270
263
|
stat.serializeTime = serializeTime;
|
|
271
|
-
if (dispatchAnalyticsEvent
|
|
264
|
+
if (dispatchAnalyticsEvent) {
|
|
272
265
|
findAndTrackUnsupportedContentNodes(node, schema, dispatchAnalyticsEvent);
|
|
273
266
|
if (unsupportedContentLevelsTracking !== null && unsupportedContentLevelsTracking !== void 0 && unsupportedContentLevelsTracking.enabled) {
|
|
274
267
|
const documentData = {
|
|
@@ -2948,13 +2948,13 @@ export const RendererStyleContainer = props => {
|
|
|
2948
2948
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- CSS custom properties for UGC font tokens
|
|
2949
2949
|
'--ak-renderer-editor-font-small-text': editorUGCTokensRefreshed['editor.font.body.small']
|
|
2950
2950
|
},
|
|
2951
|
-
css: [expValEquals('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, fontSizeStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, headingAnchorButtonFocusVisibleStyles, 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' && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererFullWidthStyles : oldRendererFullWidthStyles), (appearance === 'full-width' || appearance === 'max'
|
|
2951
|
+
css: [expValEquals('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, fontSizeStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, headingAnchorButtonFocusVisibleStyles, 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' && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererFullWidthStyles : oldRendererFullWidthStyles), (appearance === 'full-width' || appearance === 'max') && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererMaxWidthStyles : oldRendererMaxWidthStyles), rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && extensionStyle, contentMode === 'compact' ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, listItemHiddenMarkerStyles, indentationSharedStyles, indentationSharedStylesWithMarginFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, !expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && highlightLinksUnsetStyles,
|
|
2952
2952
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2953
2953
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix, headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && (expValEquals('confluence_fe_renderer_inline_node_mark_color_fix', 'isEnabled', true) ? rendererAnnotationStyles : rendererAnnotationStylesOld),
|
|
2954
2954
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2955
2955
|
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, expandSsrMarginStyles,
|
|
2956
2956
|
// this should be placed after baseOtherStyles
|
|
2957
|
-
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (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, fg('platform_renderer_ssr_block_margin_fix') && [blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles], appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max'
|
|
2957
|
+
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (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, fg('platform_renderer_ssr_block_margin_fix') && [blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles], appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max') && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? contentMode === 'compact' ? scaledDenseEmojiStyles : scaledEmojiStyles : contentMode === 'compact' ? denseStyles : undefined, contentMode === 'compact' ? scaledDenseUnicodeEmojiStylesNew : scaledUnicodeEmojiStylesNew, syncBlockStyles, centerWrapperStyles, isInsideSyncBlock ? syncBlockRendererStyles : null, isInsideSyncBlock && tableFakeBorderStyles, isInsideSyncBlock && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2958
2958
|
"data-testid": testId
|
|
2959
2959
|
}, children);
|
|
2960
2960
|
};
|
|
@@ -23,8 +23,6 @@ import { BaseTheme, IntlErrorBoundary, UnsupportedBlock, WidthProvider, WithCrea
|
|
|
23
23
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
24
24
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
25
25
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
26
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
27
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
28
26
|
import { ReactSerializer, renderDocument } from '../../';
|
|
29
27
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
30
28
|
import { MODE, PLATFORM } from '../../analytics/events';
|
|
@@ -58,7 +56,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
58
56
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
59
57
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
60
58
|
const packageName = "@atlaskit/renderer";
|
|
61
|
-
const packageVersion = "141.0.
|
|
59
|
+
const packageVersion = "141.0.7";
|
|
62
60
|
const setAsQueryContainerStyles = css({
|
|
63
61
|
containerName: 'ak-renderer-wrapper',
|
|
64
62
|
containerType: 'inline-size'
|
|
@@ -496,7 +494,7 @@ export const RendererFunctionalComponent = props => {
|
|
|
496
494
|
result,
|
|
497
495
|
stat,
|
|
498
496
|
pmDoc
|
|
499
|
-
} = renderDocument(props.shouldRemoveEmptySpaceAroundContent ? removeEmptySpaceAroundContent(props.document) : props.document, serializer, schema, props.adfStage,
|
|
497
|
+
} = renderDocument(props.shouldRemoveEmptySpaceAroundContent ? removeEmptySpaceAroundContent(props.document) : props.document, serializer, schema, props.adfStage, id, fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats, props.skipValidation, validationOverrides);
|
|
500
498
|
if (props.onComplete) {
|
|
501
499
|
pendingOnCompleteStatRef.current = stat;
|
|
502
500
|
}
|
|
@@ -793,7 +791,7 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
793
791
|
// Only apply container-type = inline-size when having a known width in full-page/full-width/comment mode.
|
|
794
792
|
// Otherwise when appearance is unspecified the renderer size is decided by the content.
|
|
795
793
|
// In this case we can't set the container-type = inline-size as it will collapse width to 0.
|
|
796
|
-
return (appearance === 'full-page' || appearance === 'full-width' ||
|
|
794
|
+
return (appearance === 'full-page' || appearance === 'full-width' || appearance === 'max') &&
|
|
797
795
|
// In case of having excerpt-include on page there are multiple renderers nested.
|
|
798
796
|
// Make sure only the root renderer is set to be query container.
|
|
799
797
|
isTopLevelRenderer && allowRendererContainerStyles ? jsx("div", {
|
|
@@ -849,11 +847,6 @@ const RendererWithAnnotationSelection = props => {
|
|
|
849
847
|
} = props;
|
|
850
848
|
const localRef = React.useRef(null);
|
|
851
849
|
const innerRef = props.innerRef || localRef;
|
|
852
|
-
|
|
853
|
-
// @see https://hello.jira.atlassian.cloud/browse/EDITOR-3389
|
|
854
|
-
if (props.appearance === 'max' && !expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) && !expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) {
|
|
855
|
-
props.appearance = 'full-width';
|
|
856
|
-
}
|
|
857
850
|
if (!allowAnnotations) {
|
|
858
851
|
// Ignored via go/ees005
|
|
859
852
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -7,7 +7,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
7
7
|
import { jsx, css } from '@emotion/react';
|
|
8
8
|
import { akEditorFullWidthLayoutWidth, akEditorMaxLayoutWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
10
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
10
|
import { RendererCssClassName } from '../../consts';
|
|
12
11
|
var flexWrapperStyles = css({
|
|
13
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -23,10 +22,8 @@ var getWidth = function getWidth(width, mode) {
|
|
|
23
22
|
if (editorExperiment('advanced_layouts', true) && width) {
|
|
24
23
|
return "min(".concat(width, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
25
24
|
} else {
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
return "min(".concat(akEditorMaxLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
29
|
-
}
|
|
25
|
+
if (mode === 'max' || typeof width === 'number' && width >= akEditorFullWidthLayoutWidth) {
|
|
26
|
+
return "min(".concat(akEditorMaxLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
30
27
|
}
|
|
31
28
|
if (mode === 'full-width') {
|
|
32
29
|
return "min(".concat(akEditorFullWidthLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
@@ -41,7 +41,7 @@ var PanelStyledCompiled = function PanelStyledCompiled(_ref) {
|
|
|
41
41
|
var customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) || backgroundColor : undefined;
|
|
42
42
|
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
43
43
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class
|
|
44
|
-
className: ax(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) &&
|
|
44
|
+
className: ax(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && "_niep1s93 _a9e5p2ly _giv8n729 _vy90n729 _eba1ibhp _18hz1vk5 _93eu1aok", expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && "_19mdyhbg", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", "_9dunutpp _pzbautpp", "_1wvnia51", className]),
|
|
45
45
|
style: _objectSpread(_objectSpread({}, {
|
|
46
46
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable
|
|
47
47
|
'--ak-renderer-panel-custom-bg-color': customBackgroundColor
|
|
@@ -207,7 +207,7 @@ var PanelStyledEmotion = function PanelStyledEmotion(_ref) {
|
|
|
207
207
|
{
|
|
208
208
|
'--ak-renderer-panel-custom-bg-color': customBackgroundColor
|
|
209
209
|
},
|
|
210
|
-
css: [panelBaseStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) &&
|
|
210
|
+
css: [panelBaseStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && fg('platform_editor_nest_table_in_panel_patch_3') && panelBackgroundColorVariableStyles, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) && panelInfoIconStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && panelCustomBackground, panelNestedIconStyles, nestedPanelStyles]
|
|
211
211
|
// Ignored via go/ees005
|
|
212
212
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
213
213
|
}, props), props.children);
|
|
@@ -7,7 +7,6 @@ import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common
|
|
|
7
7
|
import { WidthContext } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
10
|
import { useRendererContext } from '../../../renderer-context';
|
|
12
11
|
// we allow scaling down column widths by no more than 30%
|
|
13
12
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
@@ -361,8 +360,8 @@ export var Colgroup = function Colgroup(props) {
|
|
|
361
360
|
})) !== null && _renderSyncBlockColgr !== void 0 ? _renderSyncBlockColgr : renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
|
|
362
361
|
isTopLevelRenderer: isTopLevelRenderer,
|
|
363
362
|
isInsideOfSyncBlock: isInsideOfSyncBlock,
|
|
364
|
-
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max'
|
|
365
|
-
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max'
|
|
363
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' || props.rendererAppearance === 'comment',
|
|
364
|
+
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max')
|
|
366
365
|
}));
|
|
367
366
|
if (!colStyles) {
|
|
368
367
|
return null;
|
|
@@ -617,7 +617,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
617
617
|
}) ? 'calc(100cqw - var(--ak-renderer--full-page-gutter) * 2)' : "100cqw - ".concat(FullPagePadding, "px * 2");
|
|
618
618
|
var renderWidthCSS = rendererAppearance === 'full-page' ? fullPageRendererWidthCSS : "100cqw";
|
|
619
619
|
var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(rendererAppearance, tableNode) {
|
|
620
|
-
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)
|
|
620
|
+
if (rendererAppearance === 'max' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
621
621
|
return "min(".concat(akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
622
622
|
} else if (rendererAppearance === 'full-width' && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
623
623
|
return "min(".concat(akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
@@ -636,9 +636,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
636
636
|
var fullWidthLineLengthCSS = "min(".concat(akEditorFullWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
637
637
|
var maxWidthLineLengthCSS = "min(".concat(akEditorMaxWidthLayoutWidth, "px, ").concat(renderWidthCSS, ")");
|
|
638
638
|
var isCommentAppearanceAndTableAlignmentEnabled = isCommentAppearance(rendererAppearance) && allowTableAlignment;
|
|
639
|
-
var lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isMaxWidthAppearance(rendererAppearance)
|
|
639
|
+
var lineLengthCSS = isFullWidthAppearance(rendererAppearance) ? fullWidthLineLengthCSS : isMaxWidthAppearance(rendererAppearance) ? maxWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
640
640
|
var tableWidthNew = getTableContainerWidth(tableNode);
|
|
641
|
-
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isMaxWidthAppearance(rendererAppearance)
|
|
641
|
+
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && (isFullPageAppearance(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || isFullWidthAppearance(rendererAppearance) || isMaxWidthAppearance(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
642
642
|
var leftCSS;
|
|
643
643
|
if (shouldCalculateLeftForAlignment) {
|
|
644
644
|
leftCSS = "(".concat(tableWidthCSS, " - ").concat(lineLengthCSS, ") / 2");
|
|
@@ -667,7 +667,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
667
667
|
// We can only use CSS to determine the width when we have a known width in container.
|
|
668
668
|
// When appearance is full-page, full-width or comment we use CSS based width calculation.
|
|
669
669
|
// Otherwise it's fixed table width (customized width) or inherit.
|
|
670
|
-
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max'
|
|
670
|
+
if (rendererAppearance === 'full-page' || rendererAppearance === 'full-width' || rendererAppearance === 'max') {
|
|
671
671
|
finalTableContainerWidth = allowTableResizing ? "calc(".concat(tableWidthCSS, ")") : 'inherit';
|
|
672
672
|
}
|
|
673
673
|
if (rendererAppearance === 'comment' && allowTableResizing && !allowTableAlignment) {
|
|
@@ -7,7 +7,6 @@ import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
|
7
7
|
import { nativeEmbedsFallbackTransform, transformContainerNodes, transformMediaLinkMarks, transformNestedTablesIncomingDocument } from '@atlaskit/adf-utils/transforms';
|
|
8
8
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { findAndTrackUnsupportedContentNodes, validateADFEntity } from '@atlaskit/editor-common/utils';
|
|
10
|
-
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
11
10
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
11
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
12
|
import { PLATFORM } from './analytics/events';
|
|
@@ -27,37 +26,34 @@ var withStopwatch = function withStopwatch(cb) {
|
|
|
27
26
|
|
|
28
27
|
/** Schema-variant escape hatches handed to the ADF validator. */
|
|
29
28
|
|
|
30
|
-
var _validation = function _validation(doc, schema, adfStage,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
|
|
47
|
-
// which is what a renderer wants: stored documents can contain them, and wrapping such content
|
|
48
|
-
// as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
|
|
49
|
-
// strictness and gets it. The legacy branch below reads the same value as a schema selector and
|
|
50
|
-
// so keeps its own `final` default.
|
|
51
|
-
result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
|
|
52
|
-
} else {
|
|
53
|
-
result = getValidDocument(doc, schema, adfStage !== null && adfStage !== void 0 ? adfStage : 'final');
|
|
29
|
+
var _validation = function _validation(doc, schema, adfStage, dispatchAnalyticsEvent, skipValidation, validationOverrides) {
|
|
30
|
+
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
31
|
+
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
32
|
+
var _transformMediaLinkMa = transformMediaLinkMarks(doc),
|
|
33
|
+
transformedAdf = _transformMediaLinkMa.transformedAdf,
|
|
34
|
+
isTransformed = _transformMediaLinkMa.isTransformed;
|
|
35
|
+
if (isTransformed && dispatchAnalyticsEvent) {
|
|
36
|
+
dispatchAnalyticsEvent({
|
|
37
|
+
action: ACTION.MEDIA_LINK_TRANSFORMED,
|
|
38
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
39
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
40
|
+
});
|
|
54
41
|
}
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
|
|
43
|
+
// Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
|
|
44
|
+
// which is what a renderer wants: stored documents can contain them, and wrapping such content
|
|
45
|
+
// as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
|
|
46
|
+
// strictness and gets it.
|
|
47
|
+
var result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
|
|
48
|
+
|
|
49
|
+
// The spec validator can return the original root object when malformed JSON has no node type.
|
|
50
|
+
// Reject it here, matching the legacy validator, before ProseMirror attempts to deserialize it.
|
|
51
|
+
if (!result || typeof result.type !== 'string' || result.type.length === 0) {
|
|
52
|
+
return null;
|
|
57
53
|
}
|
|
58
54
|
|
|
59
55
|
// ProseMirror always require a child under doc
|
|
60
|
-
if (result.type === 'doc'
|
|
56
|
+
if (result.type === 'doc') {
|
|
61
57
|
if (Array.isArray(result.content) && result.content.length === 0) {
|
|
62
58
|
result.content.push({
|
|
63
59
|
type: 'paragraph',
|
|
@@ -142,24 +138,22 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
|
|
|
142
138
|
return result;
|
|
143
139
|
};
|
|
144
140
|
var memoValidation = memoizeOne(_validation, function (newArgs, lastArgs) {
|
|
145
|
-
var _newArgs = _slicedToArray(newArgs,
|
|
141
|
+
var _newArgs = _slicedToArray(newArgs, 6),
|
|
146
142
|
newDoc = _newArgs[0],
|
|
147
143
|
newSchema = _newArgs[1],
|
|
148
144
|
newADFStage = _newArgs[2],
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
var _lastArgs = _slicedToArray(lastArgs, 7),
|
|
145
|
+
/* ignoring dispatchAnalyticsEvent */newSkipValidation = _newArgs[4],
|
|
146
|
+
newValidationOverrides = _newArgs[5];
|
|
147
|
+
var _lastArgs = _slicedToArray(lastArgs, 6),
|
|
153
148
|
oldDoc = _lastArgs[0],
|
|
154
149
|
oldSchema = _lastArgs[1],
|
|
155
150
|
oldADFStage = _lastArgs[2],
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
oldValidationOverrides = _lastArgs[6];
|
|
151
|
+
/* ignoring dispatchAnalyticsEvent */oldSkipValidation = _lastArgs[4],
|
|
152
|
+
oldValidationOverrides = _lastArgs[5];
|
|
159
153
|
|
|
160
154
|
// `areDocsEqual` may stringify the whole document, so it goes last and only runs once everything
|
|
161
155
|
// cheaper has matched.
|
|
162
|
-
return newSchema === oldSchema && newADFStage === oldADFStage &&
|
|
156
|
+
return newSchema === oldSchema && newADFStage === oldADFStage && newSkipValidation === oldSkipValidation && areValidationOverridesEqual(newValidationOverrides, oldValidationOverrides) && areDocsEqual(newDoc, oldDoc);
|
|
163
157
|
});
|
|
164
158
|
|
|
165
159
|
// Ignored via go/ees005
|
|
@@ -253,22 +247,18 @@ var memoCreateNodeAndCheck = memoizeOne(_createNodeAndCheck, function (newArgs,
|
|
|
253
247
|
export var renderDocument = function renderDocument(doc, serializer) {
|
|
254
248
|
var schema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultSchema;
|
|
255
249
|
var adfStage = arguments.length > 3 ? arguments[3] : undefined;
|
|
256
|
-
var
|
|
257
|
-
var
|
|
258
|
-
var
|
|
259
|
-
var
|
|
260
|
-
var
|
|
261
|
-
var
|
|
262
|
-
var
|
|
263
|
-
var validationOverrides = arguments.length > 11 ? arguments[11] : undefined;
|
|
250
|
+
var rendererId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'noid';
|
|
251
|
+
var dispatchAnalyticsEvent = arguments.length > 5 ? arguments[5] : undefined;
|
|
252
|
+
var unsupportedContentLevelsTracking = arguments.length > 6 ? arguments[6] : undefined;
|
|
253
|
+
var appearance = arguments.length > 7 ? arguments[7] : undefined;
|
|
254
|
+
var includeNodesCountInStats = arguments.length > 8 ? arguments[8] : undefined;
|
|
255
|
+
var skipValidation = arguments.length > 9 ? arguments[9] : undefined;
|
|
256
|
+
var validationOverrides = arguments.length > 10 ? arguments[10] : undefined;
|
|
264
257
|
var stat = {
|
|
265
258
|
sanitizeTime: 0
|
|
266
259
|
};
|
|
267
|
-
if (fg('platform_editor_renderer_rm_usespecbasedvalidator')) {
|
|
268
|
-
useSpecBasedValidator = true;
|
|
269
|
-
}
|
|
270
260
|
var _withStopwatch = withStopwatch(function () {
|
|
271
|
-
return memoValidation(doc, schema, adfStage,
|
|
261
|
+
return memoValidation(doc, schema, adfStage, dispatchAnalyticsEvent, skipValidation, validationOverrides);
|
|
272
262
|
}),
|
|
273
263
|
validDoc = _withStopwatch.output,
|
|
274
264
|
sanitizeTime = _withStopwatch.time;
|
|
@@ -297,7 +287,7 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
297
287
|
|
|
298
288
|
// save serialize tree time to stats
|
|
299
289
|
stat.serializeTime = serializeTime;
|
|
300
|
-
if (dispatchAnalyticsEvent
|
|
290
|
+
if (dispatchAnalyticsEvent) {
|
|
301
291
|
findAndTrackUnsupportedContentNodes(node, schema, dispatchAnalyticsEvent);
|
|
302
292
|
if (unsupportedContentLevelsTracking !== null && unsupportedContentLevelsTracking !== void 0 && unsupportedContentLevelsTracking.enabled) {
|
|
303
293
|
var documentData = {
|
|
@@ -2306,13 +2306,13 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
2306
2306
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- CSS custom properties for UGC font tokens
|
|
2307
2307
|
'--ak-renderer-editor-font-small-text': editorUGCTokensRefreshed['editor.font.body.small']
|
|
2308
2308
|
},
|
|
2309
|
-
css: [expValEquals('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, fontSizeStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, headingAnchorButtonFocusVisibleStyles, 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' && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererFullWidthStyles : oldRendererFullWidthStyles), (appearance === 'full-width' || appearance === 'max'
|
|
2309
|
+
css: [expValEquals('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, fontSizeStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingAnchorStyles : headingAnchorStylesDuplicateAnchor, headingAnchorButtonFocusVisibleStyles, 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' && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererFullWidthStyles : oldRendererFullWidthStyles), (appearance === 'full-width' || appearance === 'max') && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererMaxWidthStyles : oldRendererMaxWidthStyles), rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && extensionStyle, contentMode === 'compact' ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, listItemHiddenMarkerStyles, indentationSharedStyles, indentationSharedStylesWithMarginFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, !expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && highlightLinksUnsetStyles,
|
|
2310
2310
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2311
2311
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix, headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && (expValEquals('confluence_fe_renderer_inline_node_mark_color_fix', 'isEnabled', true) ? rendererAnnotationStyles : rendererAnnotationStylesOld),
|
|
2312
2312
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2313
2313
|
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, expandSsrMarginStyles,
|
|
2314
2314
|
// this should be placed after baseOtherStyles
|
|
2315
|
-
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (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, fg('platform_renderer_ssr_block_margin_fix') && [blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles], appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max'
|
|
2315
|
+
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (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, fg('platform_renderer_ssr_block_margin_fix') && [blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles], appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max') && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? contentMode === 'compact' ? scaledDenseEmojiStyles : scaledEmojiStyles : contentMode === 'compact' ? denseStyles : undefined, contentMode === 'compact' ? scaledDenseUnicodeEmojiStylesNew : scaledUnicodeEmojiStylesNew, syncBlockStyles, centerWrapperStyles, isInsideSyncBlock ? syncBlockRendererStyles : null, isInsideSyncBlock && tableFakeBorderStyles, isInsideSyncBlock && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2316
2316
|
"data-testid": testId
|
|
2317
2317
|
}, children);
|
|
2318
2318
|
};
|
|
@@ -28,8 +28,6 @@ import { BaseTheme, IntlErrorBoundary, UnsupportedBlock, WidthProvider, WithCrea
|
|
|
28
28
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
29
29
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
30
30
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
31
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
32
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
33
31
|
import { ReactSerializer, renderDocument } from '../../';
|
|
34
32
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
35
33
|
import { MODE, PLATFORM } from '../../analytics/events';
|
|
@@ -63,7 +61,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
63
61
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
64
62
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
65
63
|
var packageName = "@atlaskit/renderer";
|
|
66
|
-
var packageVersion = "141.0.
|
|
64
|
+
var packageVersion = "141.0.7";
|
|
67
65
|
var setAsQueryContainerStyles = css({
|
|
68
66
|
containerName: 'ak-renderer-wrapper',
|
|
69
67
|
containerType: 'inline-size'
|
|
@@ -490,7 +488,7 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
490
488
|
try {
|
|
491
489
|
var _rendererContext$feat, _props$media;
|
|
492
490
|
var schema = getSchema(props.schema, props.adfStage);
|
|
493
|
-
var _renderDocument = renderDocument(props.shouldRemoveEmptySpaceAroundContent ? removeEmptySpaceAroundContent(props.document) : props.document, serializer, schema, props.adfStage,
|
|
491
|
+
var _renderDocument = renderDocument(props.shouldRemoveEmptySpaceAroundContent ? removeEmptySpaceAroundContent(props.document) : props.document, serializer, schema, props.adfStage, id, _fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats, props.skipValidation, validationOverrides),
|
|
494
492
|
result = _renderDocument.result,
|
|
495
493
|
stat = _renderDocument.stat,
|
|
496
494
|
pmDoc = _renderDocument.pmDoc;
|
|
@@ -792,7 +790,7 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
792
790
|
// Only apply container-type = inline-size when having a known width in full-page/full-width/comment mode.
|
|
793
791
|
// Otherwise when appearance is unspecified the renderer size is decided by the content.
|
|
794
792
|
// In this case we can't set the container-type = inline-size as it will collapse width to 0.
|
|
795
|
-
return (appearance === 'full-page' || appearance === 'full-width' ||
|
|
793
|
+
return (appearance === 'full-page' || appearance === 'full-width' || appearance === 'max') &&
|
|
796
794
|
// In case of having excerpt-include on page there are multiple renderers nested.
|
|
797
795
|
// Make sure only the root renderer is set to be query container.
|
|
798
796
|
isTopLevelRenderer && allowRendererContainerStyles ? jsx("div", {
|
|
@@ -849,11 +847,6 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
|
|
|
849
847
|
adfDocument = props.document;
|
|
850
848
|
var localRef = React.useRef(null);
|
|
851
849
|
var innerRef = props.innerRef || localRef;
|
|
852
|
-
|
|
853
|
-
// @see https://hello.jira.atlassian.cloud/browse/EDITOR-3389
|
|
854
|
-
if (props.appearance === 'max' && !expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) && !expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) {
|
|
855
|
-
props.appearance = 'full-width';
|
|
856
|
-
}
|
|
857
850
|
if (!allowAnnotations) {
|
|
858
851
|
// Ignored via go/ees005
|
|
859
852
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -25,5 +25,5 @@ type ValidationOverrides = {
|
|
|
25
25
|
allowNestedTables?: boolean;
|
|
26
26
|
allowTableInPanel?: boolean;
|
|
27
27
|
};
|
|
28
|
-
export declare const renderDocument: <T>(doc: any, serializer: Serializer<T>, schema?: Schema, adfStage?: ADFStage,
|
|
28
|
+
export declare const renderDocument: <T>(doc: any, serializer: Serializer<T>, schema?: Schema, adfStage?: ADFStage, rendererId?: string, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking, appearance?: RendererAppearance, includeNodesCountInStats?: boolean, skipValidation?: boolean, validationOverrides?: ValidationOverrides) => RenderOutput<T | null>;
|
|
29
29
|
export {};
|
|
@@ -230,7 +230,5 @@ export interface RendererProps {
|
|
|
230
230
|
/** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-26490 Internal documentation for deprecation (no external access)} This prop has been marked stable and therefore replaced by the `textHighlighter` prop. Please use `textHighlighter` prop instead. */
|
|
231
231
|
UNSTABLE_textHighlighter?: TextHighlighter;
|
|
232
232
|
unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking;
|
|
233
|
-
/** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-3649 Internal documentation for deprecation (no external access)} This prop will be removed and set as default enabled, as the same flag on the Editor is also now default enabled. */
|
|
234
|
-
useSpecBasedValidator?: boolean;
|
|
235
233
|
}
|
|
236
234
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "142.0.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@atlaskit/status": "^5.12.0",
|
|
74
74
|
"@atlaskit/task-decision": "^21.10.0",
|
|
75
75
|
"@atlaskit/theme": "^28.2.0",
|
|
76
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
76
|
+
"@atlaskit/tmp-editor-statsig": "^202.0.0",
|
|
77
77
|
"@atlaskit/tokens": "^18.2.0",
|
|
78
78
|
"@atlaskit/tooltip": "^24.3.0",
|
|
79
79
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"uuid": "^11.1.1"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"@atlaskit/editor-common": "^123.
|
|
91
|
+
"@atlaskit/editor-common": "^123.6.0",
|
|
92
92
|
"@atlaskit/link-provider": "^5.7.0",
|
|
93
93
|
"@atlaskit/media-core": "^38.2.0",
|
|
94
94
|
"react": "^18.2.0 || ^19.2.0",
|
|
@@ -194,15 +194,9 @@
|
|
|
194
194
|
"type": "boolean",
|
|
195
195
|
"referenceOnly": true
|
|
196
196
|
},
|
|
197
|
-
"platform_editor_renderer_rm_usespecbasedvalidator": {
|
|
198
|
-
"type": "boolean"
|
|
199
|
-
},
|
|
200
197
|
"platform_editor_bordered_panel_nested_in_table": {
|
|
201
198
|
"type": "boolean"
|
|
202
199
|
},
|
|
203
|
-
"platform_editor_nest_table_in_panel_patch_2": {
|
|
204
|
-
"type": "boolean"
|
|
205
|
-
},
|
|
206
200
|
"platform_editor_nest_table_in_panel_patch_3": {
|
|
207
201
|
"type": "boolean"
|
|
208
202
|
},
|