@atlaskit/renderer 136.2.1 → 136.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/cjs/react/nodes/inlineCard.js +8 -64
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +1 -1
- package/dist/cjs/ui/Renderer/index.js +18 -11
- package/dist/es2019/react/nodes/inlineCard.js +8 -62
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +22 -10
- package/dist/esm/react/nodes/inlineCard.js +8 -64
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +1 -1
- package/dist/esm/ui/Renderer/index.js +18 -11
- package/dist/types/ui/Renderer/index.d.ts +1 -3
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 136.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9e4a665de419a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9e4a665de419a) -
|
|
8
|
+
Clean up of expriment flag `platform_editor_preview_panel_linking_exp_conf` and
|
|
9
|
+
`platform_editor_preview_panel_linking_exp_jira`.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 136.2.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`e2be8a7b1a21b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e2be8a7b1a21b) -
|
|
17
|
+
Under experiment `platform_editor_adf_validator_perf`, `validationOverrides` (including the
|
|
18
|
+
`allowTableInPanel` override) is built in a single `useMemo` instead of a fresh object literal per
|
|
19
|
+
render. The unstable reference made `renderDocument`'s validation memo miss, re-validating an
|
|
20
|
+
unchanged document on every render. Added a test asserting the reference stays stable across
|
|
21
|
+
re-renders.
|
|
22
|
+
|
|
23
|
+
`RendererFunctionalComponent` now takes an `allowNestedTables` boolean in place of the
|
|
24
|
+
`validationOverrides` object prop, and derives the overrides itself.
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 136.2.1
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -17,8 +17,6 @@ var _ssr = require("@atlaskit/smart-card/ssr");
|
|
|
17
17
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
18
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
19
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
20
|
-
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
21
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
22
20
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
23
21
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
24
22
|
var _editorSmartLinkDraggable = require("@atlaskit/editor-smart-link-draggable");
|
|
@@ -41,11 +39,6 @@ var _linkExtractors = require("@atlaskit/link-extractors");
|
|
|
41
39
|
var HoverLinkOverlayNoop = function HoverLinkOverlayNoop(props) {
|
|
42
40
|
return (0, _react2.jsx)(_react.Fragment, null, props.children);
|
|
43
41
|
};
|
|
44
|
-
var HoverLinkOverlayWithCondition = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
|
|
45
|
-
return (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
46
|
-
exposure: true
|
|
47
|
-
});
|
|
48
|
-
}, _ui.HoverLinkOverlay, HoverLinkOverlayNoop);
|
|
49
42
|
var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
|
|
50
43
|
var _cardContext$value2, _cardContext$value3, _cardContext$value3$i, _cardContext$value4;
|
|
51
44
|
var rendererAppearance = _ref.rendererAppearance,
|
|
@@ -106,7 +99,7 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
|
|
|
106
99
|
// When inside preview panel iframe, hide the overlay button
|
|
107
100
|
var isInPreviewPanel = (0, _utils.isWithinPreviewPanelIFrame)();
|
|
108
101
|
var showPanelButton = isInPreviewPanel ? isPreviewPanelAvailable : isPreviewAvailable;
|
|
109
|
-
var Overlay = isPreviewAvailable ?
|
|
102
|
+
var Overlay = isPreviewAvailable ? _ui.HoverLinkOverlay : HoverLinkOverlayNoop;
|
|
110
103
|
return (0, _react2.jsx)(Overlay, {
|
|
111
104
|
isVisible: isResolvedViewRendered,
|
|
112
105
|
url: url,
|
|
@@ -130,17 +123,13 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
|
|
|
130
123
|
embedUrl: (0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = (0, _linkExtractors.extractSmartLinkEmbed)(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
|
|
131
124
|
}
|
|
132
125
|
});
|
|
133
|
-
(
|
|
134
|
-
exposure: true
|
|
135
|
-
}) && fireHoverLabelAEP('panel');
|
|
126
|
+
fireHoverLabelAEP('panel');
|
|
136
127
|
} else if (isPreviewModalAvailable) {
|
|
137
128
|
event.preventDefault();
|
|
138
129
|
if (preview) {
|
|
139
130
|
preview.invoke();
|
|
140
131
|
}
|
|
141
|
-
(
|
|
142
|
-
exposure: true
|
|
143
|
-
}) && fireHoverLabelAEP('modal');
|
|
132
|
+
fireHoverLabelAEP('modal');
|
|
144
133
|
}
|
|
145
134
|
}
|
|
146
135
|
}, children);
|
|
@@ -228,52 +217,7 @@ var InlineCard = function InlineCard(props) {
|
|
|
228
217
|
}
|
|
229
218
|
}, [provider, url]);
|
|
230
219
|
var MaybeOverlay = cardContext !== null && cardContext !== void 0 && cardContext.value ? OverlayWithCardContext : HoverLinkOverlayNoop;
|
|
231
|
-
if ((ssr || cardState && (0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url
|
|
232
|
-
exposure: true
|
|
233
|
-
})) {
|
|
234
|
-
if (
|
|
235
|
-
// eslint-disable-next-line @atlaskit/platform/no-invalid-feature-flag-usage
|
|
236
|
-
(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
237
|
-
return (0, _react2.jsx)(_editorSmartLinkDraggable.SmartLinkDraggable, {
|
|
238
|
-
url: url,
|
|
239
|
-
appearance: _editorSmartLinkDraggable.SMART_LINK_APPEARANCE.INLINE,
|
|
240
|
-
source: _editorSmartLinkDraggable.SMART_LINK_DRAG_TYPES.RENDERER
|
|
241
|
-
}, (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
242
|
-
"data-inline-card": true
|
|
243
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
244
|
-
,
|
|
245
|
-
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
246
|
-
"data-card-url": url
|
|
247
|
-
// Ignored via go/ees005
|
|
248
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
249
|
-
}, inlineAnnotationProps), (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
250
|
-
data: analyticsData
|
|
251
|
-
}, wrapWithSuspense((0, _react2.jsx)(_ssr.CardSSR, {
|
|
252
|
-
appearance: "inline",
|
|
253
|
-
url: url,
|
|
254
|
-
showHoverPreview: !hideHoverPreview,
|
|
255
|
-
actionOptions: actionOptions,
|
|
256
|
-
onClick: onClick,
|
|
257
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
258
|
-
})))));
|
|
259
|
-
}
|
|
260
|
-
return (0, _react2.jsx)(_editorSmartLinkDraggable.SmartLinkDraggable, {
|
|
261
|
-
url: url,
|
|
262
|
-
appearance: _editorSmartLinkDraggable.SMART_LINK_APPEARANCE.INLINE,
|
|
263
|
-
source: _editorSmartLinkDraggable.SMART_LINK_DRAG_TYPES.RENDERER
|
|
264
|
-
}, (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
265
|
-
data: analyticsData
|
|
266
|
-
}, wrapWithSuspense((0, _react2.jsx)(_ssr.CardSSR, {
|
|
267
|
-
appearance: "inline",
|
|
268
|
-
url: url,
|
|
269
|
-
showHoverPreview: !hideHoverPreview,
|
|
270
|
-
actionOptions: actionOptions,
|
|
271
|
-
onClick: onClick,
|
|
272
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
273
|
-
})), CompetitorPromptComponent));
|
|
274
|
-
} else if ((ssr || cardState && (0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
275
|
-
exposure: true
|
|
276
|
-
})) {
|
|
220
|
+
if ((ssr || cardState && (0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url) {
|
|
277
221
|
if (
|
|
278
222
|
// eslint-disable-next-line @atlaskit/platform/no-invalid-feature-flag-usage
|
|
279
223
|
(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
@@ -398,10 +342,10 @@ var InlineCard = function InlineCard(props) {
|
|
|
398
342
|
setIsResolvedViewRendered(true);
|
|
399
343
|
}
|
|
400
344
|
},
|
|
401
|
-
onError: onError
|
|
402
|
-
disablePreviewPanel
|
|
403
|
-
|
|
404
|
-
|
|
345
|
+
onError: onError
|
|
346
|
+
// Setting disablePreviewPanel={true} leaves the overlay button as the only way to open the panel.
|
|
347
|
+
,
|
|
348
|
+
disablePreviewPanel: true
|
|
405
349
|
})))), CompetitorPromptComponent))));
|
|
406
350
|
};
|
|
407
351
|
var _default_1 = (0, _SmartCardStorage.withSmartCardStorage)(InlineCard);
|
|
@@ -2287,7 +2287,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2287
2287
|
}),
|
|
2288
2288
|
css: [(0, _expValEquals.expValEquals)('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true) && 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, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererMaxWidthStyles : oldRendererMaxWidthStyles), rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && extensionStyle, contentMode === 'compact' ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, (0, _expValEquals.expValEquals)('platform_editor_flexible_list_schema', 'isEnabled', true) && 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,
|
|
2289
2289
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2290
|
-
textHighlightPaddingStyles, tasksAndDecisionsStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix,
|
|
2290
|
+
textHighlightPaddingStyles, tasksAndDecisionsStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix, headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && ((0, _expValEquals.expValEquals)('confluence_fe_renderer_inline_node_mark_color_fix', 'isEnabled', true) ? rendererAnnotationStyles : rendererAnnotationStylesOld),
|
|
2291
2291
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2292
2292
|
(0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, !(0, _expValEquals.expValEquals)('platform_editor_flex_based_centering', 'isEnabled', true) && extensionCenterAlignLegacyStyles,
|
|
2293
2293
|
// this should be placed after baseOtherStyles
|
|
@@ -24,6 +24,7 @@ var _measureRender = require("@atlaskit/editor-common/performance/measure-render
|
|
|
24
24
|
var _navigation = require("@atlaskit/editor-common/performance/navigation");
|
|
25
25
|
var _useScrollToBlock = require("../hooks/useScrollToBlock");
|
|
26
26
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
27
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
27
28
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
29
|
var _types = require("@atlaskit/analytics-listeners/types");
|
|
29
30
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
@@ -73,7 +74,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
73
74
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
74
75
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
75
76
|
var packageName = "@atlaskit/renderer";
|
|
76
|
-
var packageVersion = "136.2.
|
|
77
|
+
var packageVersion = "136.2.2";
|
|
77
78
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
78
79
|
containerName: 'ak-renderer-wrapper',
|
|
79
80
|
containerType: 'inline-size'
|
|
@@ -473,13 +474,24 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
473
474
|
}, [props.featureFlags, props.isTopLevelRenderer, createRendererContext, props.timeZone]);
|
|
474
475
|
var isCollapsibleHeadingsEnabled = props.allowCollapsibleHeadings === true && ['full-page', 'full-width', 'max'].includes(props.appearance || '') && rendererContext.isTopLevelRenderer && (0, _expValEquals.expValEquals)('platform_renderer_collapsible_headings', 'isEnabled', true);
|
|
475
476
|
(0, _useScrollToBlock.useScrollToBlock)(editorRef, props.document, props.scrollToBlock);
|
|
477
|
+
var allowNestedTables = props.allowNestedTables;
|
|
478
|
+
var stableValidationOverrides = (0, _react.useMemo)(function () {
|
|
479
|
+
var schema = getSchema(props.schema, props.adfStage);
|
|
480
|
+
return (0, _nesting.isPanelNestingTableSupported)(schema) ? {
|
|
481
|
+
allowNestedTables: allowNestedTables,
|
|
482
|
+
allowTableInPanel: true
|
|
483
|
+
} : {
|
|
484
|
+
allowNestedTables: allowNestedTables
|
|
485
|
+
};
|
|
486
|
+
}, [allowNestedTables, getSchema, props.schema, props.adfStage]);
|
|
487
|
+
|
|
488
|
+
// Gate read only on the table-in-panel path, the one that used to build a new object every
|
|
489
|
+
// render; elsewhere both arms are already identical. Control keeps the copy-per-render
|
|
490
|
+
// behaviour, which is what makes `renderDocument`'s validation memo miss.
|
|
491
|
+
var validationOverrides = stableValidationOverrides.allowTableInPanel && !(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_adf_validator_perf') ? _objectSpread({}, stableValidationOverrides) : stableValidationOverrides;
|
|
476
492
|
try {
|
|
477
493
|
var _rendererContext$feat, _props$media;
|
|
478
494
|
var schema = getSchema(props.schema, props.adfStage);
|
|
479
|
-
var allowTableInPanel = (0, _nesting.isPanelNestingTableSupported)(schema);
|
|
480
|
-
var validationOverrides = allowTableInPanel ? _objectSpread(_objectSpread({}, props.validationOverrides), {}, {
|
|
481
|
-
allowTableInPanel: true
|
|
482
|
-
}) : props.validationOverrides;
|
|
483
495
|
var _renderDocument = (0, _.renderDocument)(props.shouldRemoveEmptySpaceAroundContent ? (0, _rendererHelper.removeEmptySpaceAroundContent)(props.document) : props.document, serializer, schema, props.adfStage, props.useSpecBasedValidator, id, _fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats, props.skipValidation, validationOverrides),
|
|
484
496
|
result = _renderDocument.result,
|
|
485
497
|
stat = _renderDocument.stat,
|
|
@@ -595,11 +607,6 @@ function Renderer(props) {
|
|
|
595
607
|
var _ref = (0, _react.useContext)(_ValidationContext.ValidationContext) || {},
|
|
596
608
|
skipValidation = _ref.skipValidation,
|
|
597
609
|
allowNestedTables = _ref.allowNestedTables;
|
|
598
|
-
var validationOverrides = (0, _react.useMemo)(function () {
|
|
599
|
-
return {
|
|
600
|
-
allowNestedTables: allowNestedTables
|
|
601
|
-
};
|
|
602
|
-
}, [allowNestedTables]);
|
|
603
610
|
return (0, _react2.jsx)(RendererFunctionalComponentWithPortalContext
|
|
604
611
|
// Ignored via go/ees005
|
|
605
612
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -607,7 +614,7 @@ function Renderer(props) {
|
|
|
607
614
|
startPos: startPos,
|
|
608
615
|
isTopLevelRenderer: (_props$isTopLevelRend = props.isTopLevelRenderer) !== null && _props$isTopLevelRend !== void 0 ? _props$isTopLevelRend : isTopLevelRenderer,
|
|
609
616
|
skipValidation: skipValidation,
|
|
610
|
-
|
|
617
|
+
allowNestedTables: allowNestedTables
|
|
611
618
|
}));
|
|
612
619
|
}
|
|
613
620
|
|
|
@@ -15,8 +15,6 @@ import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
|
15
15
|
import { HoverLinkOverlay, UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
17
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
18
|
-
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
19
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
18
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
19
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
22
20
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
@@ -29,9 +27,6 @@ import { useInlineAnnotationProps } from '../../ui/annotations/element/useInline
|
|
|
29
27
|
import { usePortal } from '../../ui/Renderer/PortalContext';
|
|
30
28
|
import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
|
|
31
29
|
const HoverLinkOverlayNoop = props => jsx(Fragment, null, props.children);
|
|
32
|
-
const HoverLinkOverlayWithCondition = componentWithCondition(() => editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
33
|
-
exposure: true
|
|
34
|
-
}), HoverLinkOverlay, HoverLinkOverlayNoop);
|
|
35
30
|
const OverlayWithCardContext = ({
|
|
36
31
|
rendererAppearance,
|
|
37
32
|
isResolvedViewRendered,
|
|
@@ -89,7 +84,7 @@ const OverlayWithCardContext = ({
|
|
|
89
84
|
// When inside preview panel iframe, hide the overlay button
|
|
90
85
|
const isInPreviewPanel = isWithinPreviewPanelIFrame();
|
|
91
86
|
const showPanelButton = isInPreviewPanel ? isPreviewPanelAvailable : isPreviewAvailable;
|
|
92
|
-
const Overlay = isPreviewAvailable ?
|
|
87
|
+
const Overlay = isPreviewAvailable ? HoverLinkOverlay : HoverLinkOverlayNoop;
|
|
93
88
|
return jsx(Overlay, {
|
|
94
89
|
isVisible: isResolvedViewRendered,
|
|
95
90
|
url: url,
|
|
@@ -113,17 +108,13 @@ const OverlayWithCardContext = ({
|
|
|
113
108
|
embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
|
|
114
109
|
}
|
|
115
110
|
});
|
|
116
|
-
|
|
117
|
-
exposure: true
|
|
118
|
-
}) && fireHoverLabelAEP('panel');
|
|
111
|
+
fireHoverLabelAEP('panel');
|
|
119
112
|
} else if (isPreviewModalAvailable) {
|
|
120
113
|
event.preventDefault();
|
|
121
114
|
if (preview) {
|
|
122
115
|
preview.invoke();
|
|
123
116
|
}
|
|
124
|
-
|
|
125
|
-
exposure: true
|
|
126
|
-
}) && fireHoverLabelAEP('modal');
|
|
117
|
+
fireHoverLabelAEP('modal');
|
|
127
118
|
}
|
|
128
119
|
}
|
|
129
120
|
}, children);
|
|
@@ -213,52 +204,7 @@ const InlineCard = props => {
|
|
|
213
204
|
}
|
|
214
205
|
}, [provider, url]);
|
|
215
206
|
const MaybeOverlay = cardContext !== null && cardContext !== void 0 && cardContext.value ? OverlayWithCardContext : HoverLinkOverlayNoop;
|
|
216
|
-
if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url
|
|
217
|
-
exposure: true
|
|
218
|
-
})) {
|
|
219
|
-
if (
|
|
220
|
-
// eslint-disable-next-line @atlaskit/platform/no-invalid-feature-flag-usage
|
|
221
|
-
fg('editor_inline_comments_on_inline_nodes')) {
|
|
222
|
-
return jsx(SmartLinkDraggable, {
|
|
223
|
-
url: url,
|
|
224
|
-
appearance: SMART_LINK_APPEARANCE.INLINE,
|
|
225
|
-
source: SMART_LINK_DRAG_TYPES.RENDERER
|
|
226
|
-
}, jsx("span", _extends({
|
|
227
|
-
"data-inline-card": true
|
|
228
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
229
|
-
,
|
|
230
|
-
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
231
|
-
"data-card-url": url
|
|
232
|
-
// Ignored via go/ees005
|
|
233
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
234
|
-
}, inlineAnnotationProps), jsx(AnalyticsContext, {
|
|
235
|
-
data: analyticsData
|
|
236
|
-
}, wrapWithSuspense(jsx(CardSSR, {
|
|
237
|
-
appearance: "inline",
|
|
238
|
-
url: url,
|
|
239
|
-
showHoverPreview: !hideHoverPreview,
|
|
240
|
-
actionOptions: actionOptions,
|
|
241
|
-
onClick: onClick,
|
|
242
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
243
|
-
})))));
|
|
244
|
-
}
|
|
245
|
-
return jsx(SmartLinkDraggable, {
|
|
246
|
-
url: url,
|
|
247
|
-
appearance: SMART_LINK_APPEARANCE.INLINE,
|
|
248
|
-
source: SMART_LINK_DRAG_TYPES.RENDERER
|
|
249
|
-
}, jsx(AnalyticsContext, {
|
|
250
|
-
data: analyticsData
|
|
251
|
-
}, wrapWithSuspense(jsx(CardSSR, {
|
|
252
|
-
appearance: "inline",
|
|
253
|
-
url: url,
|
|
254
|
-
showHoverPreview: !hideHoverPreview,
|
|
255
|
-
actionOptions: actionOptions,
|
|
256
|
-
onClick: onClick,
|
|
257
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
258
|
-
})), CompetitorPromptComponent));
|
|
259
|
-
} else if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
260
|
-
exposure: true
|
|
261
|
-
})) {
|
|
207
|
+
if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url) {
|
|
262
208
|
if (
|
|
263
209
|
// eslint-disable-next-line @atlaskit/platform/no-invalid-feature-flag-usage
|
|
264
210
|
fg('editor_inline_comments_on_inline_nodes')) {
|
|
@@ -383,10 +329,10 @@ const InlineCard = props => {
|
|
|
383
329
|
setIsResolvedViewRendered(true);
|
|
384
330
|
}
|
|
385
331
|
},
|
|
386
|
-
onError: onError
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
332
|
+
onError: onError
|
|
333
|
+
// Setting disablePreviewPanel={true} leaves the overlay button as the only way to open the panel.
|
|
334
|
+
,
|
|
335
|
+
disablePreviewPanel: true
|
|
390
336
|
})))), CompetitorPromptComponent))));
|
|
391
337
|
};
|
|
392
338
|
const _default_1 = withSmartCardStorage(InlineCard);
|
|
@@ -2913,7 +2913,7 @@ export const RendererStyleContainer = props => {
|
|
|
2913
2913
|
},
|
|
2914
2914
|
css: [expValEquals('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, expValEquals('platform_editor_small_font_size', 'isEnabled', true) && 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' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) && (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, expValEquals('platform_editor_flexible_list_schema', 'isEnabled', true) && 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,
|
|
2915
2915
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2916
|
-
textHighlightPaddingStyles, tasksAndDecisionsStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix,
|
|
2916
|
+
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),
|
|
2917
2917
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2918
2918
|
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, !expValEquals('platform_editor_flex_based_centering', 'isEnabled', true) && extensionCenterAlignLegacyStyles,
|
|
2919
2919
|
// this should be placed after baseOtherStyles
|
|
@@ -18,6 +18,7 @@ import { getDistortedDurationMonitor } from '@atlaskit/editor-common/performance
|
|
|
18
18
|
import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
|
|
19
19
|
import { useScrollToBlock } from '../hooks/useScrollToBlock';
|
|
20
20
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
21
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
21
22
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
23
|
import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
23
24
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
@@ -59,7 +60,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
59
60
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
60
61
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
61
62
|
const packageName = "@atlaskit/renderer";
|
|
62
|
-
const packageVersion = "136.2.
|
|
63
|
+
const packageVersion = "136.2.2";
|
|
63
64
|
const setAsQueryContainerStyles = css({
|
|
64
65
|
containerName: 'ak-renderer-wrapper',
|
|
65
66
|
containerType: 'inline-size'
|
|
@@ -462,14 +463,28 @@ export const RendererFunctionalComponent = props => {
|
|
|
462
463
|
}), [props.featureFlags, props.isTopLevelRenderer, createRendererContext, props.timeZone]);
|
|
463
464
|
const isCollapsibleHeadingsEnabled = props.allowCollapsibleHeadings === true && ['full-page', 'full-width', 'max'].includes(props.appearance || '') && rendererContext.isTopLevelRenderer && expValEquals('platform_renderer_collapsible_headings', 'isEnabled', true);
|
|
464
465
|
useScrollToBlock(editorRef, props.document, props.scrollToBlock);
|
|
466
|
+
const {
|
|
467
|
+
allowNestedTables
|
|
468
|
+
} = props;
|
|
469
|
+
const stableValidationOverrides = useMemo(() => {
|
|
470
|
+
const schema = getSchema(props.schema, props.adfStage);
|
|
471
|
+
return isPanelNestingTableSupported(schema) ? {
|
|
472
|
+
allowNestedTables,
|
|
473
|
+
allowTableInPanel: true
|
|
474
|
+
} : {
|
|
475
|
+
allowNestedTables
|
|
476
|
+
};
|
|
477
|
+
}, [allowNestedTables, getSchema, props.schema, props.adfStage]);
|
|
478
|
+
|
|
479
|
+
// Gate read only on the table-in-panel path, the one that used to build a new object every
|
|
480
|
+
// render; elsewhere both arms are already identical. Control keeps the copy-per-render
|
|
481
|
+
// behaviour, which is what makes `renderDocument`'s validation memo miss.
|
|
482
|
+
const validationOverrides = stableValidationOverrides.allowTableInPanel && !isExperimentEnabled('platform_editor_adf_validator_perf') ? {
|
|
483
|
+
...stableValidationOverrides
|
|
484
|
+
} : stableValidationOverrides;
|
|
465
485
|
try {
|
|
466
486
|
var _rendererContext$feat, _props$media;
|
|
467
487
|
const schema = getSchema(props.schema, props.adfStage);
|
|
468
|
-
const allowTableInPanel = isPanelNestingTableSupported(schema);
|
|
469
|
-
const validationOverrides = allowTableInPanel ? {
|
|
470
|
-
...props.validationOverrides,
|
|
471
|
-
allowTableInPanel: true
|
|
472
|
-
} : props.validationOverrides;
|
|
473
488
|
const {
|
|
474
489
|
result,
|
|
475
490
|
stat,
|
|
@@ -585,9 +600,6 @@ export function Renderer(props) {
|
|
|
585
600
|
skipValidation,
|
|
586
601
|
allowNestedTables
|
|
587
602
|
} = useContext(ValidationContext) || {};
|
|
588
|
-
const validationOverrides = useMemo(() => ({
|
|
589
|
-
allowNestedTables
|
|
590
|
-
}), [allowNestedTables]);
|
|
591
603
|
return jsx(RendererFunctionalComponentWithPortalContext
|
|
592
604
|
// Ignored via go/ees005
|
|
593
605
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -595,7 +607,7 @@ export function Renderer(props) {
|
|
|
595
607
|
startPos: startPos,
|
|
596
608
|
isTopLevelRenderer: (_props$isTopLevelRend = props.isTopLevelRenderer) !== null && _props$isTopLevelRend !== void 0 ? _props$isTopLevelRend : isTopLevelRenderer,
|
|
597
609
|
skipValidation: skipValidation,
|
|
598
|
-
|
|
610
|
+
allowNestedTables: allowNestedTables
|
|
599
611
|
}));
|
|
600
612
|
}
|
|
601
613
|
|
|
@@ -16,8 +16,6 @@ import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
|
16
16
|
import { HoverLinkOverlay, UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
18
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
19
|
-
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
20
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
21
19
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
22
20
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
23
21
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
@@ -32,11 +30,6 @@ import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
|
|
|
32
30
|
var HoverLinkOverlayNoop = function HoverLinkOverlayNoop(props) {
|
|
33
31
|
return jsx(Fragment, null, props.children);
|
|
34
32
|
};
|
|
35
|
-
var HoverLinkOverlayWithCondition = componentWithCondition(function () {
|
|
36
|
-
return editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
37
|
-
exposure: true
|
|
38
|
-
});
|
|
39
|
-
}, HoverLinkOverlay, HoverLinkOverlayNoop);
|
|
40
33
|
var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
|
|
41
34
|
var _cardContext$value2, _cardContext$value3, _cardContext$value3$i, _cardContext$value4;
|
|
42
35
|
var rendererAppearance = _ref.rendererAppearance,
|
|
@@ -97,7 +90,7 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
|
|
|
97
90
|
// When inside preview panel iframe, hide the overlay button
|
|
98
91
|
var isInPreviewPanel = isWithinPreviewPanelIFrame();
|
|
99
92
|
var showPanelButton = isInPreviewPanel ? isPreviewPanelAvailable : isPreviewAvailable;
|
|
100
|
-
var Overlay = isPreviewAvailable ?
|
|
93
|
+
var Overlay = isPreviewAvailable ? HoverLinkOverlay : HoverLinkOverlayNoop;
|
|
101
94
|
return jsx(Overlay, {
|
|
102
95
|
isVisible: isResolvedViewRendered,
|
|
103
96
|
url: url,
|
|
@@ -121,17 +114,13 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
|
|
|
121
114
|
embedUrl: expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(cardState === null || cardState === void 0 ? void 0 : cardState.details)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : undefined
|
|
122
115
|
}
|
|
123
116
|
});
|
|
124
|
-
|
|
125
|
-
exposure: true
|
|
126
|
-
}) && fireHoverLabelAEP('panel');
|
|
117
|
+
fireHoverLabelAEP('panel');
|
|
127
118
|
} else if (isPreviewModalAvailable) {
|
|
128
119
|
event.preventDefault();
|
|
129
120
|
if (preview) {
|
|
130
121
|
preview.invoke();
|
|
131
122
|
}
|
|
132
|
-
|
|
133
|
-
exposure: true
|
|
134
|
-
}) && fireHoverLabelAEP('modal');
|
|
123
|
+
fireHoverLabelAEP('modal');
|
|
135
124
|
}
|
|
136
125
|
}
|
|
137
126
|
}, children);
|
|
@@ -219,52 +208,7 @@ var InlineCard = function InlineCard(props) {
|
|
|
219
208
|
}
|
|
220
209
|
}, [provider, url]);
|
|
221
210
|
var MaybeOverlay = cardContext !== null && cardContext !== void 0 && cardContext.value ? OverlayWithCardContext : HoverLinkOverlayNoop;
|
|
222
|
-
if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url
|
|
223
|
-
exposure: true
|
|
224
|
-
})) {
|
|
225
|
-
if (
|
|
226
|
-
// eslint-disable-next-line @atlaskit/platform/no-invalid-feature-flag-usage
|
|
227
|
-
fg('editor_inline_comments_on_inline_nodes')) {
|
|
228
|
-
return jsx(SmartLinkDraggable, {
|
|
229
|
-
url: url,
|
|
230
|
-
appearance: SMART_LINK_APPEARANCE.INLINE,
|
|
231
|
-
source: SMART_LINK_DRAG_TYPES.RENDERER
|
|
232
|
-
}, jsx("span", _extends({
|
|
233
|
-
"data-inline-card": true
|
|
234
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
235
|
-
,
|
|
236
|
-
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
237
|
-
"data-card-url": url
|
|
238
|
-
// Ignored via go/ees005
|
|
239
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
240
|
-
}, inlineAnnotationProps), jsx(AnalyticsContext, {
|
|
241
|
-
data: analyticsData
|
|
242
|
-
}, wrapWithSuspense(jsx(CardSSR, {
|
|
243
|
-
appearance: "inline",
|
|
244
|
-
url: url,
|
|
245
|
-
showHoverPreview: !hideHoverPreview,
|
|
246
|
-
actionOptions: actionOptions,
|
|
247
|
-
onClick: onClick,
|
|
248
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
249
|
-
})))));
|
|
250
|
-
}
|
|
251
|
-
return jsx(SmartLinkDraggable, {
|
|
252
|
-
url: url,
|
|
253
|
-
appearance: SMART_LINK_APPEARANCE.INLINE,
|
|
254
|
-
source: SMART_LINK_DRAG_TYPES.RENDERER
|
|
255
|
-
}, jsx(AnalyticsContext, {
|
|
256
|
-
data: analyticsData
|
|
257
|
-
}, wrapWithSuspense(jsx(CardSSR, {
|
|
258
|
-
appearance: "inline",
|
|
259
|
-
url: url,
|
|
260
|
-
showHoverPreview: !hideHoverPreview,
|
|
261
|
-
actionOptions: actionOptions,
|
|
262
|
-
onClick: onClick,
|
|
263
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
264
|
-
})), CompetitorPromptComponent));
|
|
265
|
-
} else if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
266
|
-
exposure: true
|
|
267
|
-
})) {
|
|
211
|
+
if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url) {
|
|
268
212
|
if (
|
|
269
213
|
// eslint-disable-next-line @atlaskit/platform/no-invalid-feature-flag-usage
|
|
270
214
|
fg('editor_inline_comments_on_inline_nodes')) {
|
|
@@ -389,10 +333,10 @@ var InlineCard = function InlineCard(props) {
|
|
|
389
333
|
setIsResolvedViewRendered(true);
|
|
390
334
|
}
|
|
391
335
|
},
|
|
392
|
-
onError: onError
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
336
|
+
onError: onError
|
|
337
|
+
// Setting disablePreviewPanel={true} leaves the overlay button as the only way to open the panel.
|
|
338
|
+
,
|
|
339
|
+
disablePreviewPanel: true
|
|
396
340
|
})))), CompetitorPromptComponent))));
|
|
397
341
|
};
|
|
398
342
|
var _default_1 = withSmartCardStorage(InlineCard);
|
|
@@ -2280,7 +2280,7 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
2280
2280
|
}),
|
|
2281
2281
|
css: [expValEquals('confluence_ttvc_inline_extensions', 'isEnabled', true) ? baseFontStyle : originalBaseFontLineHeight, baseStyles, expValEquals('platform_editor_small_font_size', 'isEnabled', true) && 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' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true)) && (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, expValEquals('platform_editor_flexible_list_schema', 'isEnabled', true) && 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,
|
|
2282
2282
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2283
|
-
textHighlightPaddingStyles, tasksAndDecisionsStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix,
|
|
2283
|
+
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),
|
|
2284
2284
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2285
2285
|
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, !expValEquals('platform_editor_flex_based_centering', 'isEnabled', true) && extensionCenterAlignLegacyStyles,
|
|
2286
2286
|
// this should be placed after baseOtherStyles
|
|
@@ -23,6 +23,7 @@ import { getDistortedDurationMonitor } from '@atlaskit/editor-common/performance
|
|
|
23
23
|
import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
|
|
24
24
|
import { useScrollToBlock } from '../hooks/useScrollToBlock';
|
|
25
25
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
26
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
26
27
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
28
|
import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
28
29
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
@@ -64,7 +65,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
64
65
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
65
66
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
66
67
|
var packageName = "@atlaskit/renderer";
|
|
67
|
-
var packageVersion = "136.2.
|
|
68
|
+
var packageVersion = "136.2.2";
|
|
68
69
|
var setAsQueryContainerStyles = css({
|
|
69
70
|
containerName: 'ak-renderer-wrapper',
|
|
70
71
|
containerType: 'inline-size'
|
|
@@ -464,13 +465,24 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
464
465
|
}, [props.featureFlags, props.isTopLevelRenderer, createRendererContext, props.timeZone]);
|
|
465
466
|
var isCollapsibleHeadingsEnabled = props.allowCollapsibleHeadings === true && ['full-page', 'full-width', 'max'].includes(props.appearance || '') && rendererContext.isTopLevelRenderer && expValEquals('platform_renderer_collapsible_headings', 'isEnabled', true);
|
|
466
467
|
useScrollToBlock(editorRef, props.document, props.scrollToBlock);
|
|
468
|
+
var allowNestedTables = props.allowNestedTables;
|
|
469
|
+
var stableValidationOverrides = useMemo(function () {
|
|
470
|
+
var schema = getSchema(props.schema, props.adfStage);
|
|
471
|
+
return isPanelNestingTableSupported(schema) ? {
|
|
472
|
+
allowNestedTables: allowNestedTables,
|
|
473
|
+
allowTableInPanel: true
|
|
474
|
+
} : {
|
|
475
|
+
allowNestedTables: allowNestedTables
|
|
476
|
+
};
|
|
477
|
+
}, [allowNestedTables, getSchema, props.schema, props.adfStage]);
|
|
478
|
+
|
|
479
|
+
// Gate read only on the table-in-panel path, the one that used to build a new object every
|
|
480
|
+
// render; elsewhere both arms are already identical. Control keeps the copy-per-render
|
|
481
|
+
// behaviour, which is what makes `renderDocument`'s validation memo miss.
|
|
482
|
+
var validationOverrides = stableValidationOverrides.allowTableInPanel && !isExperimentEnabled('platform_editor_adf_validator_perf') ? _objectSpread({}, stableValidationOverrides) : stableValidationOverrides;
|
|
467
483
|
try {
|
|
468
484
|
var _rendererContext$feat, _props$media;
|
|
469
485
|
var schema = getSchema(props.schema, props.adfStage);
|
|
470
|
-
var allowTableInPanel = isPanelNestingTableSupported(schema);
|
|
471
|
-
var validationOverrides = allowTableInPanel ? _objectSpread(_objectSpread({}, props.validationOverrides), {}, {
|
|
472
|
-
allowTableInPanel: true
|
|
473
|
-
}) : props.validationOverrides;
|
|
474
486
|
var _renderDocument = renderDocument(props.shouldRemoveEmptySpaceAroundContent ? removeEmptySpaceAroundContent(props.document) : props.document, serializer, schema, props.adfStage, props.useSpecBasedValidator, id, _fireAnalyticsEvent, props.unsupportedContentLevelsTracking, props.appearance, props.includeNodesCountInStats, props.skipValidation, validationOverrides),
|
|
475
487
|
result = _renderDocument.result,
|
|
476
488
|
stat = _renderDocument.stat,
|
|
@@ -586,11 +598,6 @@ export function Renderer(props) {
|
|
|
586
598
|
var _ref = useContext(ValidationContext) || {},
|
|
587
599
|
skipValidation = _ref.skipValidation,
|
|
588
600
|
allowNestedTables = _ref.allowNestedTables;
|
|
589
|
-
var validationOverrides = useMemo(function () {
|
|
590
|
-
return {
|
|
591
|
-
allowNestedTables: allowNestedTables
|
|
592
|
-
};
|
|
593
|
-
}, [allowNestedTables]);
|
|
594
601
|
return jsx(RendererFunctionalComponentWithPortalContext
|
|
595
602
|
// Ignored via go/ees005
|
|
596
603
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -598,7 +605,7 @@ export function Renderer(props) {
|
|
|
598
605
|
startPos: startPos,
|
|
599
606
|
isTopLevelRenderer: (_props$isTopLevelRend = props.isTopLevelRenderer) !== null && _props$isTopLevelRend !== void 0 ? _props$isTopLevelRend : isTopLevelRenderer,
|
|
600
607
|
skipValidation: skipValidation,
|
|
601
|
-
|
|
608
|
+
allowNestedTables: allowNestedTables
|
|
602
609
|
}));
|
|
603
610
|
}
|
|
604
611
|
|
|
@@ -10,11 +10,9 @@ import type { RendererAppearance, RendererContentMode } from './types';
|
|
|
10
10
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
11
11
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
12
12
|
export declare const RendererFunctionalComponent: (props: RendererProps & {
|
|
13
|
+
allowNestedTables?: boolean;
|
|
13
14
|
skipValidation?: boolean;
|
|
14
15
|
startPos?: number;
|
|
15
|
-
validationOverrides?: {
|
|
16
|
-
allowNestedTables?: boolean;
|
|
17
|
-
};
|
|
18
16
|
}) => jsx.JSX.Element;
|
|
19
17
|
/**
|
|
20
18
|
* Top-level ADF renderer: renders document content with analytics and validation context.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "136.2.
|
|
3
|
+
"version": "136.2.3",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
51
51
|
"@atlaskit/icon": "^37.5.0",
|
|
52
52
|
"@atlaskit/link": "^5.1.0",
|
|
53
|
-
"@atlaskit/link-datasource": "^6.
|
|
53
|
+
"@atlaskit/link-datasource": "^6.7.0",
|
|
54
54
|
"@atlaskit/link-extractors": "^4.1.0",
|
|
55
55
|
"@atlaskit/linking-common": "^12.0.0",
|
|
56
56
|
"@atlaskit/media-card": "^81.7.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@atlaskit/status": "^5.8.0",
|
|
71
71
|
"@atlaskit/task-decision": "^21.8.0",
|
|
72
72
|
"@atlaskit/theme": "^28.1.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^158.0.0",
|
|
74
74
|
"@atlaskit/tokens": "^16.8.0",
|
|
75
75
|
"@atlaskit/tooltip": "^24.2.0",
|
|
76
76
|
"@atlaskit/visually-hidden": "^4.3.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"uuid": "^3.1.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/editor-common": "^119.
|
|
88
|
+
"@atlaskit/editor-common": "^119.16.0",
|
|
89
89
|
"@atlaskit/link-provider": "^5.4.0",
|
|
90
90
|
"@atlaskit/media-core": "^38.0.0",
|
|
91
91
|
"react": "^18.2.0",
|
|
@@ -105,11 +105,11 @@
|
|
|
105
105
|
"@atlaskit/mention": "^27.18.0",
|
|
106
106
|
"@atlaskit/modal-dialog": "^16.5.0",
|
|
107
107
|
"@atlaskit/navigation-system": "^10.16.0",
|
|
108
|
-
"@atlaskit/profilecard": "^26.
|
|
108
|
+
"@atlaskit/profilecard": "^26.19.0",
|
|
109
109
|
"@atlaskit/side-nav-items": "^2.3.0",
|
|
110
110
|
"@atlaskit/util-data-test": "^19.1.0",
|
|
111
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
112
|
-
"@atlassian/a11y-playwright-testing": "^0.
|
|
111
|
+
"@atlassian/a11y-jest-testing": "^0.17.0",
|
|
112
|
+
"@atlassian/a11y-playwright-testing": "^0.12.0",
|
|
113
113
|
"@atlassian/experiment-test-utils": "^0.2.0",
|
|
114
114
|
"@atlassian/feature-flags-test-utils": "^1.2.0",
|
|
115
115
|
"@atlassian/structured-docs-types": "workspace:^",
|