@atlaskit/renderer 138.1.3 → 138.1.6
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 +29 -0
- package/dist/cjs/react/nodes/blockCard.js +2 -2
- package/dist/cjs/react/nodes/extension.js +14 -5
- package/dist/cjs/react/nodes/fallback.js +3 -3
- package/dist/cjs/render-document.js +6 -12
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +4 -1
- package/dist/cjs/ui/Renderer/index.js +3 -7
- package/dist/es2019/react/nodes/blockCard.js +1 -1
- package/dist/es2019/react/nodes/extension.js +14 -5
- package/dist/es2019/react/nodes/fallback.js +1 -1
- package/dist/es2019/render-document.js +6 -12
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +6 -1
- package/dist/es2019/ui/Renderer/index.js +3 -9
- package/dist/esm/react/nodes/blockCard.js +1 -1
- package/dist/esm/react/nodes/extension.js +14 -5
- package/dist/esm/react/nodes/fallback.js +1 -1
- package/dist/esm/render-document.js +6 -12
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +4 -1
- package/dist/esm/ui/Renderer/index.js +3 -7
- package/package.json +7 -6
- package/afm-cc/tsconfig.json +0 -164
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 138.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bbd1404101645`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bbd1404101645) -
|
|
8
|
+
Clean up the `platform_editor_adf_validator_perf` experiment, keeping the enabled behaviour: the
|
|
9
|
+
validator caches allowed content per node type, `renderDocument` compares `validationOverrides` by
|
|
10
|
+
value and ProseMirror nodes with `Node.eq`, and `Renderer` passes a stable `validationOverrides`
|
|
11
|
+
reference across re-renders.
|
|
12
|
+
- [`60a282ed26282`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/60a282ed26282) -
|
|
13
|
+
Behind `platform_forge_inline_bodied_macro`, allow text adjacent to migrated inline-bodied macros
|
|
14
|
+
to wrap naturally without applying native Forge nested-renderer styling.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
17
|
+
## 138.1.5
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`9f200fd3beece`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9f200fd3beece) -
|
|
22
|
+
Cleanup experiment `platform_editor_table_fit_to_content_patch_1`. Make extension containment
|
|
23
|
+
styles permanent in editor tables and preserve renderer container styles outside tables.
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
26
|
+
## 138.1.4
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
|
|
3
32
|
## 138.1.3
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -15,7 +15,7 @@ var _getCardClickHandler = require("../utils/getCardClickHandler");
|
|
|
15
15
|
var _utils = require("../../utils");
|
|
16
16
|
var _inlineCard = _interopRequireDefault(require("./inlineCard"));
|
|
17
17
|
var _AnalyticsContext = _interopRequireDefault(require("@atlaskit/analytics-next/AnalyticsContext"));
|
|
18
|
-
var
|
|
18
|
+
var _datasourceTableViewWithWrappers = require("@atlaskit/link-datasource/datasource-table-view-with-wrappers");
|
|
19
19
|
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
20
20
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
21
21
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
@@ -138,7 +138,7 @@ function BlockCard(props) {
|
|
|
138
138
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
139
139
|
width: isNodeNested ? '100%' : (0, _utils2.calcBreakoutWidth)(layout, width)
|
|
140
140
|
}
|
|
141
|
-
}, (0, _react.jsx)(
|
|
141
|
+
}, (0, _react.jsx)(_datasourceTableViewWithWrappers.DatasourceTableViewWithWrappers, {
|
|
142
142
|
datasourceId: datasource.id,
|
|
143
143
|
parameters: datasource.parameters,
|
|
144
144
|
visibleColumnKeys: visibleColumnKeys,
|
|
@@ -125,7 +125,8 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
125
125
|
* per render, and the cheap checks stay in front of it so anything ineligible short-circuits
|
|
126
126
|
* without firing an exposure it can never act on.
|
|
127
127
|
*/
|
|
128
|
-
var
|
|
128
|
+
var hasForgeInlineBodiedMarker = Boolean((node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.content) && (node === null || node === void 0 || (_node$parameters = node.parameters) === null || _node$parameters === void 0 || (_node$parameters = _node$parameters.guestParams) === null || _node$parameters === void 0 ? void 0 : _node$parameters[FORGE_INLINE_BODIED_PARAM]) === 'true');
|
|
129
|
+
var isForgeInlineBodiedEnabled = hasForgeInlineBodiedMarker && (0, _fg.fg)('platform_forge_inline_bodied_macro');
|
|
129
130
|
/**
|
|
130
131
|
* The pass that marks the sibling textblocks around an inline extension resolves their
|
|
131
132
|
* positions without a depth term, so it only ever matches at the top level. Inlining a nested
|
|
@@ -143,6 +144,12 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
143
144
|
* nested document's block spacing be collapsed too.
|
|
144
145
|
*/
|
|
145
146
|
var isNativeForgeInline = Boolean(isInline && isForgeInlineBodiedEnabled);
|
|
147
|
+
/**
|
|
148
|
+
* Migrated inline-bodied macros intentionally do not receive the native Forge marker. Mark the
|
|
149
|
+
* rendered wrapper instead so the stylesheet can fix only the surrounding text flow without
|
|
150
|
+
* applying the native nested-renderer, overflow or sizing rules to migrated content.
|
|
151
|
+
*/
|
|
152
|
+
var isMigratedInlineBodied = Boolean(isInline && (node === null || node === void 0 ? void 0 : node.content) && !hasForgeInlineBodiedMarker && (0, _fg.fg)('platform_forge_inline_bodied_macro'));
|
|
146
153
|
var asInlineAnalytics = isInline && fireAnalyticsEvent && node ? (0, _react.jsx)(FireExtensionAsInlineAnalytics, {
|
|
147
154
|
fireAnalyticsEvent: fireAnalyticsEvent,
|
|
148
155
|
node: node
|
|
@@ -165,13 +172,14 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
165
172
|
"data-testid": "extension--wrapper",
|
|
166
173
|
"data-node-type": "extension",
|
|
167
174
|
"data-top-level": isTopLevel || undefined,
|
|
168
|
-
"data-forge-inline": isNativeForgeInline || undefined
|
|
175
|
+
"data-forge-inline": isNativeForgeInline || undefined,
|
|
176
|
+
"data-migrated-inline": isMigratedInlineBodied || undefined
|
|
169
177
|
}, (0, _react.jsx)("div", {
|
|
170
178
|
tabIndex: options.tabIndex
|
|
171
179
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
172
180
|
,
|
|
173
181
|
className: "".concat(_consts.RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
174
|
-
css: [!
|
|
182
|
+
css: [(!isInsideOfTable || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension && (0, _fg.fg)('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
175
183
|
}, asInlineAnalytics, content));
|
|
176
184
|
return centerAlignClass ? (0, _react.jsx)("div", {
|
|
177
185
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -196,13 +204,14 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
196
204
|
"data-layout": layout,
|
|
197
205
|
"data-local-id": localId,
|
|
198
206
|
"data-top-level": isTopLevel || undefined,
|
|
199
|
-
"data-forge-inline": isNativeForgeInline || undefined
|
|
207
|
+
"data-forge-inline": isNativeForgeInline || undefined,
|
|
208
|
+
"data-migrated-inline": isMigratedInlineBodied || undefined
|
|
200
209
|
}, (0, _react.jsx)("div", {
|
|
201
210
|
tabIndex: options.tabIndex
|
|
202
211
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
203
212
|
,
|
|
204
213
|
className: "".concat(_consts.RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
205
|
-
css: [!
|
|
214
|
+
css: [(!isInsideOfTable || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension && (0, _fg.fg)('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
206
215
|
}, asInlineAnalytics, content));
|
|
207
216
|
return centerAlignClass ? (0, _react.jsx)("div", {
|
|
208
217
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -13,7 +13,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _isSafeUrl = require("@atlaskit/adf-schema/is-safe-url");
|
|
15
15
|
var _link = _interopRequireDefault(require("@atlaskit/link/link"));
|
|
16
|
-
var
|
|
16
|
+
var _renderFailed = require("@atlaskit/link-datasource/analytics/render-failed");
|
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
|
18
18
|
var _ = require("./");
|
|
19
19
|
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; }
|
|
@@ -80,7 +80,7 @@ var CardErrorBoundary = exports.CardErrorBoundary = /*#__PURE__*/function (_Reac
|
|
|
80
80
|
}, url);
|
|
81
81
|
if (isDatasource) {
|
|
82
82
|
if ((0, _isSafeUrl.isSafeUrl)(url)) {
|
|
83
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_renderFailed.LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
84
84
|
datasourceId: datasourceId,
|
|
85
85
|
error: this.state.error
|
|
86
86
|
}, /*#__PURE__*/_react.default.createElement(_.InlineCard
|
|
@@ -88,7 +88,7 @@ var CardErrorBoundary = exports.CardErrorBoundary = /*#__PURE__*/function (_Reac
|
|
|
88
88
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
89
89
|
, this.props));
|
|
90
90
|
} else {
|
|
91
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_renderFailed.LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
92
92
|
datasourceId: datasourceId,
|
|
93
93
|
error: this.state.error
|
|
94
94
|
}, fallback);
|
|
@@ -11,7 +11,6 @@ var _transforms = require("@atlaskit/adf-utils/transforms");
|
|
|
11
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _validator = require("@atlaskit/editor-common/validator");
|
|
14
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
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 _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
@@ -165,13 +164,9 @@ var memoValidation = (0, _memoizeOne.default)(_validation, function (newArgs, la
|
|
|
165
164
|
/* ignoring dispatchAnalyticsEvent */oldSkipValidation = _lastArgs[5],
|
|
166
165
|
oldValidationOverrides = _lastArgs[6];
|
|
167
166
|
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
// `areDocsEqual` stringifies the whole document, so it goes last and only runs once everything
|
|
172
|
-
// cheaper has matched. Pure predicates, so ordering cannot change the result; the experiment is
|
|
173
|
-
// resolved above regardless, so exposure does not depend on reaching it.
|
|
174
|
-
return newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && newSkipValidation === oldSkipValidation && validationOverridesAreEqual && areDocsEqual(newDoc, oldDoc);
|
|
167
|
+
// `areDocsEqual` may stringify the whole document, so it goes last and only runs once everything
|
|
168
|
+
// cheaper has matched.
|
|
169
|
+
return newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && newSkipValidation === oldSkipValidation && areValidationOverridesEqual(newValidationOverrides, oldValidationOverrides) && areDocsEqual(newDoc, oldDoc);
|
|
175
170
|
});
|
|
176
171
|
|
|
177
172
|
// Ignored via go/ees005
|
|
@@ -186,10 +181,9 @@ var areDocsEqual = function areDocsEqual(docA, docB) {
|
|
|
186
181
|
|
|
187
182
|
// PMNode
|
|
188
183
|
if (docA.type && docA.toJSON && docB.type && docB.toJSON) {
|
|
189
|
-
// `Node.eq` compares markup and content directly
|
|
190
|
-
//
|
|
191
|
-
|
|
192
|
-
if (typeof docA.eq === 'function' && typeof docB.eq === 'function' && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_adf_validator_perf')) {
|
|
184
|
+
// `Node.eq` compares markup and content directly; stringifying both `toJSON` trees gives the
|
|
185
|
+
// same answer ~14x slower on a 5k-node document.
|
|
186
|
+
if (typeof docA.eq === 'function' && typeof docB.eq === 'function') {
|
|
193
187
|
return docA.eq(docB);
|
|
194
188
|
}
|
|
195
189
|
return JSON.stringify(docA.toJSON()) === JSON.stringify(docB.toJSON());
|
|
@@ -868,6 +868,9 @@ var extensionAsInlineStyle = (0, _react.css)((0, _defineProperty2.default)((0, _
|
|
|
868
868
|
}), ".".concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE, " .").concat(_consts.RendererCssClassName.EXTENSION_INNER_WRAPPER), {
|
|
869
869
|
display: 'inline-block'
|
|
870
870
|
}));
|
|
871
|
+
var migratedInlineBodiedFlowStyle = (0, _react.css)((0, _defineProperty2.default)({}, [".".concat(_consts.RendererCssClassName.DOCUMENT, " [data-migrated-inline] + [data-as-inline=\"on\"]"), ".".concat(_consts.RendererCssClassName.DOCUMENT, " [data-as-inline=\"on\"]:has(+ [data-migrated-inline])")].join(', '), {
|
|
872
|
+
display: 'inline'
|
|
873
|
+
}));
|
|
871
874
|
var forgeInlineBodiedSpacingStyle = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_consts.RendererCssClassName.DOCUMENT, " .").concat(_consts.RendererCssClassName.EXTENSION_AS_INLINE, "[data-forge-inline]"), {
|
|
872
875
|
marginBottom: 0,
|
|
873
876
|
verticalAlign: 'baseline',
|
|
@@ -2288,7 +2291,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2288
2291
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2289
2292
|
(0, _fg.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor,
|
|
2290
2293
|
// this should be placed after baseOtherStyles
|
|
2291
|
-
(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), 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, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeScopedStyles, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && 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, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? 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],
|
|
2294
|
+
(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, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeScopedStyles, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && 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, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? 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],
|
|
2292
2295
|
"data-testid": testId
|
|
2293
2296
|
}, children);
|
|
2294
2297
|
};
|
|
@@ -73,7 +73,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
73
73
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
74
74
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
75
75
|
var packageName = "@atlaskit/renderer";
|
|
76
|
-
var packageVersion = "138.1.
|
|
76
|
+
var packageVersion = "138.1.5";
|
|
77
77
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
78
78
|
containerName: 'ak-renderer-wrapper',
|
|
79
79
|
containerType: 'inline-size'
|
|
@@ -472,7 +472,8 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
472
472
|
var isCollapsibleHeadingsEnabled = props.allowCollapsibleHeadings === true && ['full-page', 'full-width', 'max'].includes(props.appearance || '') && rendererContext.isTopLevelRenderer && (0, _isExperimentEnabled.isExperimentEnabled)('platform_renderer_collapsible_headings');
|
|
473
473
|
(0, _useScrollToBlock.useScrollToBlock)(editorRef, props.document, props.scrollToBlock);
|
|
474
474
|
var allowNestedTables = props.allowNestedTables;
|
|
475
|
-
|
|
475
|
+
// Memoised so `renderDocument`'s validation memo can match by reference across re-renders.
|
|
476
|
+
var validationOverrides = (0, _react.useMemo)(function () {
|
|
476
477
|
var schema = getSchema(props.schema, props.adfStage);
|
|
477
478
|
return (0, _nesting.isPanelNestingTableSupported)(schema) ? {
|
|
478
479
|
allowNestedTables: allowNestedTables,
|
|
@@ -482,11 +483,6 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
482
483
|
};
|
|
483
484
|
}, [allowNestedTables, getSchema, props.schema, props.adfStage]);
|
|
484
485
|
|
|
485
|
-
// Gate read only on the table-in-panel path, the one that used to build a new object every
|
|
486
|
-
// render; elsewhere both arms are already identical. Control keeps the copy-per-render
|
|
487
|
-
// behaviour, which is what makes `renderDocument`'s validation memo miss.
|
|
488
|
-
var validationOverrides = stableValidationOverrides.allowTableInPanel && !(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_adf_validator_perf') ? _objectSpread({}, stableValidationOverrides) : stableValidationOverrides;
|
|
489
|
-
|
|
490
486
|
// Invoking `onComplete` during render lets consumers set state on other components mid-render,
|
|
491
487
|
// so the stat is parked here and delivered once the rendered document has been committed.
|
|
492
488
|
// No dependency array: `renderDocument` produces a new stat on every render, so the callback
|
|
@@ -13,7 +13,7 @@ import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
|
13
13
|
import { getEventHandler } from '../../utils';
|
|
14
14
|
import InlineCard from './inlineCard';
|
|
15
15
|
import AnalyticsContext from '@atlaskit/analytics-next/AnalyticsContext';
|
|
16
|
-
import { DatasourceTableView } from '@atlaskit/link-datasource';
|
|
16
|
+
import { DatasourceTableViewWithWrappers as DatasourceTableView } from '@atlaskit/link-datasource/datasource-table-view-with-wrappers';
|
|
17
17
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
18
18
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
19
19
|
import { calcBreakoutWidth, canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
@@ -104,7 +104,8 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
104
104
|
* per render, and the cheap checks stay in front of it so anything ineligible short-circuits
|
|
105
105
|
* without firing an exposure it can never act on.
|
|
106
106
|
*/
|
|
107
|
-
const
|
|
107
|
+
const hasForgeInlineBodiedMarker = Boolean((node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.content) && (node === null || node === void 0 ? void 0 : (_node$parameters = node.parameters) === null || _node$parameters === void 0 ? void 0 : (_node$parameters$gues = _node$parameters.guestParams) === null || _node$parameters$gues === void 0 ? void 0 : _node$parameters$gues[FORGE_INLINE_BODIED_PARAM]) === 'true');
|
|
108
|
+
const isForgeInlineBodiedEnabled = hasForgeInlineBodiedMarker && fg('platform_forge_inline_bodied_macro');
|
|
108
109
|
/**
|
|
109
110
|
* The pass that marks the sibling textblocks around an inline extension resolves their
|
|
110
111
|
* positions without a depth term, so it only ever matches at the top level. Inlining a nested
|
|
@@ -122,6 +123,12 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
122
123
|
* nested document's block spacing be collapsed too.
|
|
123
124
|
*/
|
|
124
125
|
const isNativeForgeInline = Boolean(isInline && isForgeInlineBodiedEnabled);
|
|
126
|
+
/**
|
|
127
|
+
* Migrated inline-bodied macros intentionally do not receive the native Forge marker. Mark the
|
|
128
|
+
* rendered wrapper instead so the stylesheet can fix only the surrounding text flow without
|
|
129
|
+
* applying the native nested-renderer, overflow or sizing rules to migrated content.
|
|
130
|
+
*/
|
|
131
|
+
const isMigratedInlineBodied = Boolean(isInline && (node === null || node === void 0 ? void 0 : node.content) && !hasForgeInlineBodiedMarker && fg('platform_forge_inline_bodied_macro'));
|
|
125
132
|
const asInlineAnalytics = isInline && fireAnalyticsEvent && node ? jsx(FireExtensionAsInlineAnalytics, {
|
|
126
133
|
fireAnalyticsEvent: fireAnalyticsEvent,
|
|
127
134
|
node: node
|
|
@@ -144,13 +151,14 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
144
151
|
"data-testid": "extension--wrapper",
|
|
145
152
|
"data-node-type": "extension",
|
|
146
153
|
"data-top-level": isTopLevel || undefined,
|
|
147
|
-
"data-forge-inline": isNativeForgeInline || undefined
|
|
154
|
+
"data-forge-inline": isNativeForgeInline || undefined,
|
|
155
|
+
"data-migrated-inline": isMigratedInlineBodied || undefined
|
|
148
156
|
}, jsx("div", {
|
|
149
157
|
tabIndex: options.tabIndex
|
|
150
158
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
151
159
|
,
|
|
152
160
|
className: `${RendererCssClassName.EXTENSION_INNER_WRAPPER} ${overflowContainerClass}`,
|
|
153
|
-
css: [!
|
|
161
|
+
css: [(!isInsideOfTable || isExperimentEnabled('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension && fg('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
154
162
|
}, asInlineAnalytics, content));
|
|
155
163
|
return centerAlignClass ? jsx("div", {
|
|
156
164
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -176,13 +184,14 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
176
184
|
"data-layout": layout,
|
|
177
185
|
"data-local-id": localId,
|
|
178
186
|
"data-top-level": isTopLevel || undefined,
|
|
179
|
-
"data-forge-inline": isNativeForgeInline || undefined
|
|
187
|
+
"data-forge-inline": isNativeForgeInline || undefined,
|
|
188
|
+
"data-migrated-inline": isMigratedInlineBodied || undefined
|
|
180
189
|
}, jsx("div", {
|
|
181
190
|
tabIndex: options.tabIndex
|
|
182
191
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
183
192
|
,
|
|
184
193
|
className: `${RendererCssClassName.EXTENSION_INNER_WRAPPER} ${overflowContainerClass}`,
|
|
185
|
-
css: [!
|
|
194
|
+
css: [(!isInsideOfTable || isExperimentEnabled('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension && fg('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
186
195
|
}, asInlineAnalytics, content));
|
|
187
196
|
return centerAlignClass ? jsx("div", {
|
|
188
197
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
3
3
|
import Link from '@atlaskit/link/link';
|
|
4
|
-
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource';
|
|
4
|
+
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource/analytics/render-failed';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { InlineCard } from './';
|
|
7
7
|
// Ignored via go/ees005
|
|
@@ -6,7 +6,6 @@ import { nativeEmbedsFallbackTransform, transformContainerNodes, transformMediaL
|
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import { findAndTrackUnsupportedContentNodes, validateADFEntity } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
9
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
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 memoizeOne from 'memoize-one';
|
|
@@ -149,13 +148,9 @@ const memoValidation = memoizeOne(_validation, (newArgs, lastArgs) => {
|
|
|
149
148
|
const [newDoc, newSchema, newADFStage, newUseSpecValidator,, /* ignoring dispatchAnalyticsEvent */newSkipValidation, newValidationOverrides] = newArgs;
|
|
150
149
|
const [oldDoc, oldSchema, oldADFStage, oldUseSpecValidator,, /* ignoring dispatchAnalyticsEvent */oldSkipValidation, oldValidationOverrides] = lastArgs;
|
|
151
150
|
|
|
152
|
-
//
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
// `areDocsEqual` stringifies the whole document, so it goes last and only runs once everything
|
|
156
|
-
// cheaper has matched. Pure predicates, so ordering cannot change the result; the experiment is
|
|
157
|
-
// resolved above regardless, so exposure does not depend on reaching it.
|
|
158
|
-
return newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && newSkipValidation === oldSkipValidation && validationOverridesAreEqual && areDocsEqual(newDoc, oldDoc);
|
|
151
|
+
// `areDocsEqual` may stringify the whole document, so it goes last and only runs once everything
|
|
152
|
+
// cheaper has matched.
|
|
153
|
+
return newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && newSkipValidation === oldSkipValidation && areValidationOverridesEqual(newValidationOverrides, oldValidationOverrides) && areDocsEqual(newDoc, oldDoc);
|
|
159
154
|
});
|
|
160
155
|
|
|
161
156
|
// Ignored via go/ees005
|
|
@@ -170,10 +165,9 @@ const areDocsEqual = (docA, docB) => {
|
|
|
170
165
|
|
|
171
166
|
// PMNode
|
|
172
167
|
if (docA.type && docA.toJSON && docB.type && docB.toJSON) {
|
|
173
|
-
// `Node.eq` compares markup and content directly
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
if (typeof docA.eq === 'function' && typeof docB.eq === 'function' && isExperimentEnabled('platform_editor_adf_validator_perf')) {
|
|
168
|
+
// `Node.eq` compares markup and content directly; stringifying both `toJSON` trees gives the
|
|
169
|
+
// same answer ~14x slower on a 5k-node document.
|
|
170
|
+
if (typeof docA.eq === 'function' && typeof docB.eq === 'function') {
|
|
177
171
|
return docA.eq(docB);
|
|
178
172
|
}
|
|
179
173
|
return JSON.stringify(docA.toJSON()) === JSON.stringify(docB.toJSON());
|
|
@@ -1028,6 +1028,11 @@ const extensionAsInlineStyle = css({
|
|
|
1028
1028
|
display: 'inline-block'
|
|
1029
1029
|
}
|
|
1030
1030
|
});
|
|
1031
|
+
const migratedInlineBodiedFlowStyle = css({
|
|
1032
|
+
[[`.${RendererCssClassName.DOCUMENT} [data-migrated-inline] + [data-as-inline="on"]`, `.${RendererCssClassName.DOCUMENT} [data-as-inline="on"]:has(+ [data-migrated-inline])`].join(', ')]: {
|
|
1033
|
+
display: 'inline'
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
1031
1036
|
const forgeInlineBodiedSpacingStyle = css({
|
|
1032
1037
|
[`.${RendererCssClassName.DOCUMENT} .${RendererCssClassName.EXTENSION_AS_INLINE}[data-forge-inline]`]: {
|
|
1033
1038
|
marginBottom: 0,
|
|
@@ -2916,7 +2921,7 @@ export const RendererStyleContainer = props => {
|
|
|
2916
2921
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2917
2922
|
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor,
|
|
2918
2923
|
// this should be placed after baseOtherStyles
|
|
2919
|
-
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), 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, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeScopedStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && 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, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && 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],
|
|
2924
|
+
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, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeScopedStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && 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, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && 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],
|
|
2920
2925
|
"data-testid": testId
|
|
2921
2926
|
}, children);
|
|
2922
2927
|
};
|
|
@@ -59,7 +59,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
59
59
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
60
60
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
61
61
|
const packageName = "@atlaskit/renderer";
|
|
62
|
-
const packageVersion = "138.1.
|
|
62
|
+
const packageVersion = "138.1.5";
|
|
63
63
|
const setAsQueryContainerStyles = css({
|
|
64
64
|
containerName: 'ak-renderer-wrapper',
|
|
65
65
|
containerType: 'inline-size'
|
|
@@ -463,7 +463,8 @@ export const RendererFunctionalComponent = props => {
|
|
|
463
463
|
const {
|
|
464
464
|
allowNestedTables
|
|
465
465
|
} = props;
|
|
466
|
-
|
|
466
|
+
// Memoised so `renderDocument`'s validation memo can match by reference across re-renders.
|
|
467
|
+
const validationOverrides = useMemo(() => {
|
|
467
468
|
const schema = getSchema(props.schema, props.adfStage);
|
|
468
469
|
return isPanelNestingTableSupported(schema) ? {
|
|
469
470
|
allowNestedTables,
|
|
@@ -473,13 +474,6 @@ export const RendererFunctionalComponent = props => {
|
|
|
473
474
|
};
|
|
474
475
|
}, [allowNestedTables, getSchema, props.schema, props.adfStage]);
|
|
475
476
|
|
|
476
|
-
// Gate read only on the table-in-panel path, the one that used to build a new object every
|
|
477
|
-
// render; elsewhere both arms are already identical. Control keeps the copy-per-render
|
|
478
|
-
// behaviour, which is what makes `renderDocument`'s validation memo miss.
|
|
479
|
-
const validationOverrides = stableValidationOverrides.allowTableInPanel && !isExperimentEnabled('platform_editor_adf_validator_perf') ? {
|
|
480
|
-
...stableValidationOverrides
|
|
481
|
-
} : stableValidationOverrides;
|
|
482
|
-
|
|
483
477
|
// Invoking `onComplete` during render lets consumers set state on other components mid-render,
|
|
484
478
|
// so the stat is parked here and delivered once the rendered document has been committed.
|
|
485
479
|
// No dependency array: `renderDocument` produces a new stat on every render, so the callback
|
|
@@ -13,7 +13,7 @@ import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
|
13
13
|
import { getEventHandler } from '../../utils';
|
|
14
14
|
import InlineCard from './inlineCard';
|
|
15
15
|
import AnalyticsContext from '@atlaskit/analytics-next/AnalyticsContext';
|
|
16
|
-
import { DatasourceTableView } from '@atlaskit/link-datasource';
|
|
16
|
+
import { DatasourceTableViewWithWrappers as DatasourceTableView } from '@atlaskit/link-datasource/datasource-table-view-with-wrappers';
|
|
17
17
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
18
18
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
19
19
|
import { calcBreakoutWidth, canRenderDatasource } from '@atlaskit/editor-common/utils';
|
|
@@ -115,7 +115,8 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
115
115
|
* per render, and the cheap checks stay in front of it so anything ineligible short-circuits
|
|
116
116
|
* without firing an exposure it can never act on.
|
|
117
117
|
*/
|
|
118
|
-
var
|
|
118
|
+
var hasForgeInlineBodiedMarker = Boolean((node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.content) && (node === null || node === void 0 || (_node$parameters = node.parameters) === null || _node$parameters === void 0 || (_node$parameters = _node$parameters.guestParams) === null || _node$parameters === void 0 ? void 0 : _node$parameters[FORGE_INLINE_BODIED_PARAM]) === 'true');
|
|
119
|
+
var isForgeInlineBodiedEnabled = hasForgeInlineBodiedMarker && fg('platform_forge_inline_bodied_macro');
|
|
119
120
|
/**
|
|
120
121
|
* The pass that marks the sibling textblocks around an inline extension resolves their
|
|
121
122
|
* positions without a depth term, so it only ever matches at the top level. Inlining a nested
|
|
@@ -133,6 +134,12 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
133
134
|
* nested document's block spacing be collapsed too.
|
|
134
135
|
*/
|
|
135
136
|
var isNativeForgeInline = Boolean(isInline && isForgeInlineBodiedEnabled);
|
|
137
|
+
/**
|
|
138
|
+
* Migrated inline-bodied macros intentionally do not receive the native Forge marker. Mark the
|
|
139
|
+
* rendered wrapper instead so the stylesheet can fix only the surrounding text flow without
|
|
140
|
+
* applying the native nested-renderer, overflow or sizing rules to migrated content.
|
|
141
|
+
*/
|
|
142
|
+
var isMigratedInlineBodied = Boolean(isInline && (node === null || node === void 0 ? void 0 : node.content) && !hasForgeInlineBodiedMarker && fg('platform_forge_inline_bodied_macro'));
|
|
136
143
|
var asInlineAnalytics = isInline && fireAnalyticsEvent && node ? jsx(FireExtensionAsInlineAnalytics, {
|
|
137
144
|
fireAnalyticsEvent: fireAnalyticsEvent,
|
|
138
145
|
node: node
|
|
@@ -155,13 +162,14 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
155
162
|
"data-testid": "extension--wrapper",
|
|
156
163
|
"data-node-type": "extension",
|
|
157
164
|
"data-top-level": isTopLevel || undefined,
|
|
158
|
-
"data-forge-inline": isNativeForgeInline || undefined
|
|
165
|
+
"data-forge-inline": isNativeForgeInline || undefined,
|
|
166
|
+
"data-migrated-inline": isMigratedInlineBodied || undefined
|
|
159
167
|
}, jsx("div", {
|
|
160
168
|
tabIndex: options.tabIndex
|
|
161
169
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
162
170
|
,
|
|
163
171
|
className: "".concat(RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
164
|
-
css: [!
|
|
172
|
+
css: [(!isInsideOfTable || isExperimentEnabled('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension && fg('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
165
173
|
}, asInlineAnalytics, content));
|
|
166
174
|
return centerAlignClass ? jsx("div", {
|
|
167
175
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -186,13 +194,14 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
186
194
|
"data-layout": layout,
|
|
187
195
|
"data-local-id": localId,
|
|
188
196
|
"data-top-level": isTopLevel || undefined,
|
|
189
|
-
"data-forge-inline": isNativeForgeInline || undefined
|
|
197
|
+
"data-forge-inline": isNativeForgeInline || undefined,
|
|
198
|
+
"data-migrated-inline": isMigratedInlineBodied || undefined
|
|
190
199
|
}, jsx("div", {
|
|
191
200
|
tabIndex: options.tabIndex
|
|
192
201
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
193
202
|
,
|
|
194
203
|
className: "".concat(RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
195
|
-
css: [!
|
|
204
|
+
css: [(!isInsideOfTable || isExperimentEnabled('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension && fg('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
196
205
|
}, asInlineAnalytics, content));
|
|
197
206
|
return centerAlignClass ? jsx("div", {
|
|
198
207
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -10,7 +10,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
12
12
|
import Link from '@atlaskit/link/link';
|
|
13
|
-
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource';
|
|
13
|
+
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource/analytics/render-failed';
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { InlineCard } from './';
|
|
16
16
|
// Ignored via go/ees005
|
|
@@ -7,7 +7,6 @@ import { nativeEmbedsFallbackTransform, transformContainerNodes, transformMediaL
|
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { findAndTrackUnsupportedContentNodes, validateADFEntity } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
10
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
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 memoizeOne from 'memoize-one';
|
|
@@ -158,13 +157,9 @@ var memoValidation = memoizeOne(_validation, function (newArgs, lastArgs) {
|
|
|
158
157
|
/* ignoring dispatchAnalyticsEvent */oldSkipValidation = _lastArgs[5],
|
|
159
158
|
oldValidationOverrides = _lastArgs[6];
|
|
160
159
|
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// `areDocsEqual` stringifies the whole document, so it goes last and only runs once everything
|
|
165
|
-
// cheaper has matched. Pure predicates, so ordering cannot change the result; the experiment is
|
|
166
|
-
// resolved above regardless, so exposure does not depend on reaching it.
|
|
167
|
-
return newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && newSkipValidation === oldSkipValidation && validationOverridesAreEqual && areDocsEqual(newDoc, oldDoc);
|
|
160
|
+
// `areDocsEqual` may stringify the whole document, so it goes last and only runs once everything
|
|
161
|
+
// cheaper has matched.
|
|
162
|
+
return newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator && newSkipValidation === oldSkipValidation && areValidationOverridesEqual(newValidationOverrides, oldValidationOverrides) && areDocsEqual(newDoc, oldDoc);
|
|
168
163
|
});
|
|
169
164
|
|
|
170
165
|
// Ignored via go/ees005
|
|
@@ -179,10 +174,9 @@ var areDocsEqual = function areDocsEqual(docA, docB) {
|
|
|
179
174
|
|
|
180
175
|
// PMNode
|
|
181
176
|
if (docA.type && docA.toJSON && docB.type && docB.toJSON) {
|
|
182
|
-
// `Node.eq` compares markup and content directly
|
|
183
|
-
//
|
|
184
|
-
|
|
185
|
-
if (typeof docA.eq === 'function' && typeof docB.eq === 'function' && isExperimentEnabled('platform_editor_adf_validator_perf')) {
|
|
177
|
+
// `Node.eq` compares markup and content directly; stringifying both `toJSON` trees gives the
|
|
178
|
+
// same answer ~14x slower on a 5k-node document.
|
|
179
|
+
if (typeof docA.eq === 'function' && typeof docB.eq === 'function') {
|
|
186
180
|
return docA.eq(docB);
|
|
187
181
|
}
|
|
188
182
|
return JSON.stringify(docA.toJSON()) === JSON.stringify(docB.toJSON());
|
|
@@ -861,6 +861,9 @@ var extensionAsInlineStyle = css(_defineProperty(_defineProperty(_defineProperty
|
|
|
861
861
|
}), ".".concat(RendererCssClassName.EXTENSION_AS_INLINE, " .").concat(RendererCssClassName.EXTENSION_INNER_WRAPPER), {
|
|
862
862
|
display: 'inline-block'
|
|
863
863
|
}));
|
|
864
|
+
var migratedInlineBodiedFlowStyle = css(_defineProperty({}, [".".concat(RendererCssClassName.DOCUMENT, " [data-migrated-inline] + [data-as-inline=\"on\"]"), ".".concat(RendererCssClassName.DOCUMENT, " [data-as-inline=\"on\"]:has(+ [data-migrated-inline])")].join(', '), {
|
|
865
|
+
display: 'inline'
|
|
866
|
+
}));
|
|
864
867
|
var forgeInlineBodiedSpacingStyle = css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(RendererCssClassName.DOCUMENT, " .").concat(RendererCssClassName.EXTENSION_AS_INLINE, "[data-forge-inline]"), {
|
|
865
868
|
marginBottom: 0,
|
|
866
869
|
verticalAlign: 'baseline',
|
|
@@ -2281,7 +2284,7 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
2281
2284
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2282
2285
|
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor,
|
|
2283
2286
|
// this should be placed after baseOtherStyles
|
|
2284
|
-
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), 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, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeScopedStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && 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, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && 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],
|
|
2287
|
+
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, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeScopedStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && 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, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && 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],
|
|
2285
2288
|
"data-testid": testId
|
|
2286
2289
|
}, children);
|
|
2287
2290
|
};
|
|
@@ -64,7 +64,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
64
64
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
65
65
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
66
66
|
var packageName = "@atlaskit/renderer";
|
|
67
|
-
var packageVersion = "138.1.
|
|
67
|
+
var packageVersion = "138.1.5";
|
|
68
68
|
var setAsQueryContainerStyles = css({
|
|
69
69
|
containerName: 'ak-renderer-wrapper',
|
|
70
70
|
containerType: 'inline-size'
|
|
@@ -463,7 +463,8 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
463
463
|
var isCollapsibleHeadingsEnabled = props.allowCollapsibleHeadings === true && ['full-page', 'full-width', 'max'].includes(props.appearance || '') && rendererContext.isTopLevelRenderer && isExperimentEnabled('platform_renderer_collapsible_headings');
|
|
464
464
|
useScrollToBlock(editorRef, props.document, props.scrollToBlock);
|
|
465
465
|
var allowNestedTables = props.allowNestedTables;
|
|
466
|
-
|
|
466
|
+
// Memoised so `renderDocument`'s validation memo can match by reference across re-renders.
|
|
467
|
+
var validationOverrides = useMemo(function () {
|
|
467
468
|
var schema = getSchema(props.schema, props.adfStage);
|
|
468
469
|
return isPanelNestingTableSupported(schema) ? {
|
|
469
470
|
allowNestedTables: allowNestedTables,
|
|
@@ -473,11 +474,6 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
473
474
|
};
|
|
474
475
|
}, [allowNestedTables, getSchema, props.schema, props.adfStage]);
|
|
475
476
|
|
|
476
|
-
// Gate read only on the table-in-panel path, the one that used to build a new object every
|
|
477
|
-
// render; elsewhere both arms are already identical. Control keeps the copy-per-render
|
|
478
|
-
// behaviour, which is what makes `renderDocument`'s validation memo miss.
|
|
479
|
-
var validationOverrides = stableValidationOverrides.allowTableInPanel && !isExperimentEnabled('platform_editor_adf_validator_perf') ? _objectSpread({}, stableValidationOverrides) : stableValidationOverrides;
|
|
480
|
-
|
|
481
477
|
// Invoking `onComplete` during render lets consumers set state on other components mid-render,
|
|
482
478
|
// so the stat is parked here and delivered once the rendered document has been committed.
|
|
483
479
|
// No dependency array: `renderDocument` produces a new stat on every render, so the callback
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "138.1.
|
|
3
|
+
"version": "138.1.6",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/link-extractors": "^4.2.0",
|
|
55
55
|
"@atlaskit/linking-common": "^12.1.0",
|
|
56
56
|
"@atlaskit/media-card": "^81.10.0",
|
|
57
|
-
"@atlaskit/media-client": "^38.
|
|
57
|
+
"@atlaskit/media-client": "^38.1.0",
|
|
58
58
|
"@atlaskit/media-client-react": "^6.4.0",
|
|
59
59
|
"@atlaskit/media-common": "^14.6.0",
|
|
60
60
|
"@atlaskit/media-filmstrip": "^52.4.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@atlaskit/status": "^5.9.0",
|
|
71
71
|
"@atlaskit/task-decision": "^21.9.0",
|
|
72
72
|
"@atlaskit/theme": "^28.2.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^184.0.0",
|
|
74
74
|
"@atlaskit/tokens": "^16.11.0",
|
|
75
75
|
"@atlaskit/tooltip": "^24.3.0",
|
|
76
76
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"uuid": "^11.1.1"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/editor-common": "^121.
|
|
89
|
-
"@atlaskit/link-provider": "^5.
|
|
88
|
+
"@atlaskit/editor-common": "^121.2.0",
|
|
89
|
+
"@atlaskit/link-provider": "^5.6.0",
|
|
90
90
|
"@atlaskit/media-core": "^38.2.0",
|
|
91
91
|
"react": "^18.2.0 || ^19.2.0",
|
|
92
92
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@atlaskit/editor-test-helpers": "workspace:^",
|
|
102
102
|
"@atlaskit/inline-edit": "^16.4.0",
|
|
103
103
|
"@atlaskit/json-ld-types": "^2.0.0",
|
|
104
|
-
"@atlaskit/link-provider": "^5.
|
|
104
|
+
"@atlaskit/link-provider": "^5.6.0",
|
|
105
105
|
"@atlaskit/link-test-helpers": "^11.2.0",
|
|
106
106
|
"@atlaskit/media-core": "^38.2.0",
|
|
107
107
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
125
125
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
126
126
|
"@atlassian/testing-library": "^0.11.0",
|
|
127
|
+
"@atlassian/workbench": "workspace:*",
|
|
127
128
|
"@testing-library/react": "^16.3.0",
|
|
128
129
|
"@testing-library/user-event": "^14.4.3",
|
|
129
130
|
"@types/react-loadable": "^5.4.1",
|
package/afm-cc/tsconfig.json
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.local-consumption.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../../../../confluence/tsDist/@atlaskit__renderer",
|
|
5
|
-
"rootDir": "../",
|
|
6
|
-
"composite": true,
|
|
7
|
-
"noCheck": true
|
|
8
|
-
},
|
|
9
|
-
"include": [
|
|
10
|
-
"../src/**/*.ts",
|
|
11
|
-
"../src/**/*.tsx"
|
|
12
|
-
],
|
|
13
|
-
"exclude": [
|
|
14
|
-
"../src/**/__tests__/*",
|
|
15
|
-
"../src/**/*.test.*",
|
|
16
|
-
"../src/**/test.*",
|
|
17
|
-
"../src/**/examples.*",
|
|
18
|
-
"../src/**/examples/*",
|
|
19
|
-
"../src/**/examples/**/*",
|
|
20
|
-
"../src/**/*.stories.*",
|
|
21
|
-
"../src/**/stories/*",
|
|
22
|
-
"../src/**/stories/**/*"
|
|
23
|
-
],
|
|
24
|
-
"references": [
|
|
25
|
-
{
|
|
26
|
-
"path": "../../adf-schema/afm-cc/tsconfig.json"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"path": "../../adf-utils/afm-cc/tsconfig.json"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"path": "../../../analytics/analytics-listeners/afm-cc/tsconfig.json"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"path": "../../../analytics/analytics-namespaced-context/afm-cc/tsconfig.json"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"path": "../../../analytics/analytics-next/afm-cc/tsconfig.json"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"path": "../../../helpers/browser-apis/afm-cc/tsconfig.json"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"path": "../../../design-system/button/afm-cc/tsconfig.json"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"path": "../../../design-system/code/afm-cc/tsconfig.json"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"path": "../../../design-system/css/afm-cc/tsconfig.json"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"path": "../../editor-card-provider/afm-cc/tsconfig.json"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"path": "../../editor-json-transformer/afm-cc/tsconfig.json"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"path": "../../editor-palette/afm-cc/tsconfig.json"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"path": "../../editor-prosemirror/afm-cc/tsconfig.json"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"path": "../../editor-shared-styles/afm-cc/tsconfig.json"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"path": "../../editor-smart-link-draggable/afm-cc/tsconfig.json"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"path": "../../../elements/emoji/afm-cc/tsconfig.json"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"path": "../../../measurement/feature-gate-js-client/afm-cc/tsconfig.json"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"path": "../../../design-system/icon/afm-cc/tsconfig.json"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"path": "../../../design-system/link/afm-cc/tsconfig.json"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"path": "../../../linking-platform/link-datasource/afm-cc/tsconfig.json"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"path": "../../../linking-platform/link-extractors/afm-cc/tsconfig.json"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"path": "../../../linking-platform/linking-common/afm-cc/tsconfig.json"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"path": "../../../media/media-card/afm-cc/tsconfig.json"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"path": "../../../media/media-client/afm-cc/tsconfig.json"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"path": "../../../media/media-client-react/afm-cc/tsconfig.json"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"path": "../../../media/media-common/afm-cc/tsconfig.json"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"path": "../../../media/media-filmstrip/afm-cc/tsconfig.json"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"path": "../../../media/media-ui/afm-cc/tsconfig.json"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"path": "../../../media/media-viewer/afm-cc/tsconfig.json"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"path": "../../../platform/feature-experiments/afm-cc/tsconfig.json"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"path": "../../../platform/feature-flags-react/afm-cc/tsconfig.json"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"path": "../../../pragmatic-drag-and-drop/core/afm-cc/tsconfig.json"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"path": "../../../react-compiler/react-compiler-gating/afm-cc/tsconfig.json"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"path": "../../../react-ufo/atlaskit/afm-cc/tsconfig.json"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"path": "../../../linking-platform/smart-card/afm-cc/tsconfig.json"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"path": "../../../elements/status/afm-cc/tsconfig.json"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"path": "../../../elements/task-decision/afm-cc/tsconfig.json"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"path": "../../../design-system/theme/afm-cc/tsconfig.json"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"path": "../../tmp-editor-statsig/afm-cc/tsconfig.json"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"path": "../../../design-system/tokens/afm-cc/tsconfig.json"
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"path": "../../../design-system/tooltip/afm-cc/tsconfig.json"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"path": "../../../design-system/visually-hidden/afm-cc/tsconfig.json"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"path": "../../editor-common/afm-cc/tsconfig.json"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"path": "../../../linking-platform/link-provider/afm-cc/tsconfig.json"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
"path": "../../../media/media-core/afm-cc/tsconfig.json"
|
|
162
|
-
}
|
|
163
|
-
]
|
|
164
|
-
}
|