@atlaskit/renderer 149.0.0 → 149.0.2
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/extension.js +3 -1
- package/dist/cjs/react/nodes/layoutColumn-compiled.js +1 -2
- package/dist/cjs/react/nodes/layoutColumn-emotion.js +1 -2
- package/dist/cjs/react/nodes/table/colgroup.js +1 -2
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +1 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/contexts/resolve-annotatable-target.js +65 -0
- package/dist/es2019/react/nodes/extension.js +3 -1
- package/dist/es2019/react/nodes/layoutColumn-compiled.js +2 -2
- package/dist/es2019/react/nodes/layoutColumn-emotion.js +2 -2
- package/dist/es2019/react/nodes/table/colgroup.js +1 -2
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/contexts/resolve-annotatable-target.js +57 -0
- package/dist/esm/react/nodes/extension.js +3 -1
- package/dist/esm/react/nodes/layoutColumn-compiled.js +2 -2
- package/dist/esm/react/nodes/layoutColumn-emotion.js +2 -2
- package/dist/esm/react/nodes/table/colgroup.js +1 -2
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +1 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/contexts/resolve-annotatable-target.js +59 -0
- package/dist/types/ui/annotations/contexts/resolve-annotatable-target.d.ts +17 -0
- package/package.json +9 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 149.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8fe99b7e9d198`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8fe99b7e9d198) -
|
|
8
|
+
Add `resolveAnnotatableTargetFromLocalId`, which resolves a `localId` to the node an annotation
|
|
9
|
+
can be applied to — the node itself when it accepts the annotation mark or is a supported block
|
|
10
|
+
node, otherwise its closest accepting ancestor. Mirrors the editor implementation so both sides
|
|
11
|
+
resolve the same node. Internal helper, not yet used by any code path.
|
|
12
|
+
- [`06e85e54427d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/06e85e54427d1) -
|
|
13
|
+
Correct Forge named viewport height reservation in View and Editor behind
|
|
14
|
+
confluence_forge_early_render_reserve_height while preserving numeric Connect heights.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
17
|
+
## 149.0.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`87d0a38064f7e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/87d0a38064f7e) -
|
|
22
|
+
Remove the rolled-out platform_renderer_ssr_block_margin_fix gate and preserve stable SSR block
|
|
23
|
+
spacing.
|
|
24
|
+
- [`17d7056a9a663`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/17d7056a9a663) -
|
|
25
|
+
Clean up feature gate `platform_editor_numbered_column_in_include`
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 149.0.0
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -112,6 +112,8 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
112
112
|
*/
|
|
113
113
|
var viewportSize = getViewportSize(extensionId, extensionViewportSizes);
|
|
114
114
|
var extensionHeight = nodeHeight || viewportSize;
|
|
115
|
+
// Forge manifest heights already include px; Connect node heights are numeric strings.
|
|
116
|
+
var extensionMinHeight = extensionHeight !== null && extensionHeight !== void 0 && extensionHeight.endsWith('px') && (0, _fg.fg)('confluence_forge_early_render_reserve_height') ? extensionHeight : extensionHeight && "".concat(extensionHeight, "px");
|
|
115
117
|
/**
|
|
116
118
|
* Scoped to nodes inserted by an app declaring `layout: inline-bodied`, which is what writes
|
|
117
119
|
* `atlassianForgeInlineBodied`. The output-type marker alone would also match migrated Connect
|
|
@@ -165,7 +167,7 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
165
167
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
166
168
|
(0, _breakout.calcBreakoutWidthCss)(layout) : (0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%',
|
|
167
169
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
168
|
-
minHeight: isInline ? undefined :
|
|
170
|
+
minHeight: isInline ? undefined : extensionMinHeight
|
|
169
171
|
},
|
|
170
172
|
"data-layout": layout,
|
|
171
173
|
"data-local-id": localId,
|
|
@@ -16,7 +16,6 @@ require("./layoutColumn-compiled.compiled.css");
|
|
|
16
16
|
var _runtime = require("@compiled/react/runtime");
|
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
|
18
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
19
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
20
19
|
// localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
|
|
21
20
|
var clearNextSiblingMarginTopStyle = null;
|
|
22
21
|
var verticalAlignMiddleStyles = null;
|
|
@@ -37,7 +36,7 @@ var LayoutSectionCompiled = exports.LayoutSectionCompiled = function LayoutSecti
|
|
|
37
36
|
},
|
|
38
37
|
className: (0, _runtime.ax)([props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", "_1tihidpf _12kpidpf"])
|
|
39
38
|
}, /*#__PURE__*/_react.default.createElement(_ui.WidthProvider, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
-
"data-layout-column-start":
|
|
39
|
+
"data-layout-column-start": "true",
|
|
41
40
|
className: (0, _runtime.ax)(["_1skbgrf3", "_19segrf3 _1ki1grf3 _bmdegrf3 _166hgrf3 _7g1ogrf3 _sk2jgrf3 _hgeogrf3"])
|
|
42
41
|
}), props.children));
|
|
43
42
|
};
|
|
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
12
|
/**
|
|
14
13
|
* @jsxRuntime classic
|
|
15
14
|
* @jsx jsx
|
|
@@ -69,7 +68,7 @@ var LayoutSectionEmotion = exports.LayoutSectionEmotion = function LayoutSection
|
|
|
69
68
|
// Keep separate: Compiled crashes on ternary/object lookup here.
|
|
70
69
|
props.valign === 'middle' && verticalAlignMiddleStyles, props.valign === 'bottom' && verticalAlignBottomStyles, multipleWrappedImagesStyle]
|
|
71
70
|
}, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
|
|
72
|
-
"data-layout-column-start":
|
|
71
|
+
"data-layout-column-start": "true",
|
|
73
72
|
css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
|
|
74
73
|
}), props.children));
|
|
75
74
|
};
|
|
@@ -12,7 +12,6 @@ var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
|
12
12
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
13
13
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
16
15
|
var _rendererContext = require("../../../renderer-context");
|
|
17
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
17
|
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; }
|
|
@@ -197,7 +196,7 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
197
196
|
var skipMinWidth = !!(isInsideOfTable && isInsideOfSyncBlock);
|
|
198
197
|
if (!columnWidths || columnWidths.every(function (width) {
|
|
199
198
|
return width === 0;
|
|
200
|
-
})
|
|
199
|
+
})) {
|
|
201
200
|
return [];
|
|
202
201
|
}
|
|
203
202
|
var tableColumnResized = isTableColumnResized(columnWidths);
|
|
@@ -2331,7 +2331,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2331
2331
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2332
2332
|
(0, _fg.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, expandSsrMarginStyles,
|
|
2333
2333
|
// this should be placed after baseOtherStyles
|
|
2334
|
-
(0, _expValEquals.expValEquals)('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), (0, _fg.fg)('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, (0, _fg.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles,
|
|
2334
|
+
(0, _expValEquals.expValEquals)('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), (0, _fg.fg)('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, (0, _fg.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max') && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? contentMode === 'compact' ? scaledDenseEmojiStyles : scaledEmojiStyles : contentMode === 'compact' ? denseStyles : undefined, contentMode === 'compact' ? scaledDenseUnicodeEmojiStylesNew : scaledUnicodeEmojiStylesNew, syncBlockStyles, centerWrapperStyles, isInsideSyncBlock ? syncBlockRendererStyles : null, isInsideSyncBlock && tableFakeBorderStyles, isInsideSyncBlock && (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null, (0, _expValEquals.expValEquals)('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2335
2335
|
"data-testid": testId
|
|
2336
2336
|
}, children);
|
|
2337
2337
|
};
|
|
@@ -72,7 +72,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
72
72
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
73
73
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
74
74
|
var packageName = "@atlaskit/renderer";
|
|
75
|
-
var packageVersion = "
|
|
75
|
+
var packageVersion = "149.0.1";
|
|
76
76
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
77
77
|
containerName: 'ak-renderer-wrapper',
|
|
78
78
|
containerType: 'inline-size'
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resolveAnnotatableTargetFromLocalId = void 0;
|
|
7
|
+
/** The node to annotate, with the position immediately before it (`doc.nodeAt(pos) === node`). */
|
|
8
|
+
|
|
9
|
+
/** Renderer copy of the editor's `isSupportedBlockNode`, kept identical so both resolve alike. */
|
|
10
|
+
var isSupportedBlockNode = function isSupportedBlockNode(node) {
|
|
11
|
+
var supportedBlockNodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
12
|
+
return supportedBlockNodes.indexOf(node.type.name) >= 0 || node.type.name === 'mediaSingle' && supportedBlockNodes.indexOf('media') >= 0;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Renderer equivalent of the editor's `resolveAnnotatableTargetFromLocalId`: resolves the node to
|
|
17
|
+
* annotate for a `localId`, climbing to the closest accepting ancestor when the node itself does
|
|
18
|
+
* not accept an annotation. Returns undefined when nothing in the chain accepts one.
|
|
19
|
+
*
|
|
20
|
+
* Kept in sync with the editor implementation so both sides resolve the same node.
|
|
21
|
+
*/
|
|
22
|
+
var resolveAnnotatableTargetFromLocalId = exports.resolveAnnotatableTargetFromLocalId = function resolveAnnotatableTargetFromLocalId(doc, localId) {
|
|
23
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
24
|
+
var supportedBlockNodes = opts.supportedBlockNodes;
|
|
25
|
+
|
|
26
|
+
// No `EditorState` here, so walk the doc directly like `findNodePosByLocalIds` does.
|
|
27
|
+
var match;
|
|
28
|
+
doc.descendants(function (node, pos) {
|
|
29
|
+
var _node$attrs;
|
|
30
|
+
if (match) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) === localId) {
|
|
34
|
+
match = {
|
|
35
|
+
node: node,
|
|
36
|
+
pos: pos
|
|
37
|
+
};
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
});
|
|
42
|
+
if (!match) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
var annotationMarkType = doc.type.schema.marks.annotation;
|
|
46
|
+
var nodeAcceptsAnnotation = function nodeAcceptsAnnotation(node) {
|
|
47
|
+
return !!annotationMarkType && node.type.allowsMarkType(annotationMarkType) || isSupportedBlockNode(node, supportedBlockNodes);
|
|
48
|
+
};
|
|
49
|
+
if (nodeAcceptsAnnotation(match.node)) {
|
|
50
|
+
return match;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Ancestors only — never descendants.
|
|
54
|
+
var $pos = doc.resolve(match.pos);
|
|
55
|
+
for (var depth = $pos.depth; depth >= 0; depth--) {
|
|
56
|
+
var ancestor = $pos.node(depth);
|
|
57
|
+
if (nodeAcceptsAnnotation(ancestor)) {
|
|
58
|
+
return {
|
|
59
|
+
node: ancestor,
|
|
60
|
+
pos: depth === 0 ? 0 : $pos.before(depth)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
};
|
|
@@ -94,6 +94,8 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
94
94
|
*/
|
|
95
95
|
const viewportSize = getViewportSize(extensionId, extensionViewportSizes);
|
|
96
96
|
const extensionHeight = nodeHeight || viewportSize;
|
|
97
|
+
// Forge manifest heights already include px; Connect node heights are numeric strings.
|
|
98
|
+
const extensionMinHeight = extensionHeight !== null && extensionHeight !== void 0 && extensionHeight.endsWith('px') && fg('confluence_forge_early_render_reserve_height') ? extensionHeight : extensionHeight && `${extensionHeight}px`;
|
|
97
99
|
/**
|
|
98
100
|
* Scoped to nodes inserted by an app declaring `layout: inline-bodied`, which is what writes
|
|
99
101
|
* `atlassianForgeInlineBodied`. The output-type marker alone would also match migrated Connect
|
|
@@ -147,7 +149,7 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
147
149
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
148
150
|
calcBreakoutWidthCss(layout) : expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%',
|
|
149
151
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
150
|
-
minHeight: isInline ? undefined :
|
|
152
|
+
minHeight: isInline ? undefined : extensionMinHeight
|
|
151
153
|
},
|
|
152
154
|
"data-layout": layout,
|
|
153
155
|
"data-local-id": localId,
|
|
@@ -9,7 +9,7 @@ import "./layoutColumn-compiled.compiled.css";
|
|
|
9
9
|
import { ax, ix } from "@compiled/react/runtime";
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { WidthProvider } from '@atlaskit/editor-common/ui';
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
// localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
|
|
14
14
|
const clearNextSiblingMarginTopStyle = null;
|
|
15
15
|
const verticalAlignMiddleStyles = null;
|
|
@@ -30,7 +30,7 @@ export const LayoutSectionCompiled = props => {
|
|
|
30
30
|
},
|
|
31
31
|
className: ax([props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", "_1tihidpf _12kpidpf"])
|
|
32
32
|
}, /*#__PURE__*/React.createElement(WidthProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
33
|
-
"data-layout-column-start":
|
|
33
|
+
"data-layout-column-start": "true",
|
|
34
34
|
className: ax(["_1skbgrf3", "_19segrf3 _1ki1grf3 _bmdegrf3 _166hgrf3 _7g1ogrf3 _sk2jgrf3 _hgeogrf3"])
|
|
35
35
|
}), props.children));
|
|
36
36
|
};
|
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- intentional: emotion fallback for compiled migration
|
|
14
14
|
import { css, jsx } from '@emotion/react';
|
|
15
15
|
import { WidthProvider } from '@atlaskit/editor-common/ui';
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
// localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
|
|
18
18
|
const clearNextSiblingMarginTopStyle = css({
|
|
19
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -70,7 +70,7 @@ export const LayoutSectionEmotion = props => {
|
|
|
70
70
|
// Keep separate: Compiled crashes on ternary/object lookup here.
|
|
71
71
|
props.valign === 'middle' && verticalAlignMiddleStyles, props.valign === 'bottom' && verticalAlignBottomStyles, multipleWrappedImagesStyle]
|
|
72
72
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
73
|
-
"data-layout-column-start":
|
|
73
|
+
"data-layout-column-start": "true",
|
|
74
74
|
css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
|
|
75
75
|
}), props.children));
|
|
76
76
|
};
|
|
@@ -3,7 +3,6 @@ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
|
3
3
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { WidthContext } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
6
|
import { useRendererContext } from '../../../renderer-context';
|
|
8
7
|
// we allow scaling down column widths by no more than 30%
|
|
9
8
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
@@ -166,7 +165,7 @@ const renderScaleDownColgroup = props => {
|
|
|
166
165
|
isInsideOfSyncBlock
|
|
167
166
|
} = props;
|
|
168
167
|
const skipMinWidth = !!(isInsideOfTable && isInsideOfSyncBlock);
|
|
169
|
-
if (!columnWidths || columnWidths.every(width => width === 0)
|
|
168
|
+
if (!columnWidths || columnWidths.every(width => width === 0)) {
|
|
170
169
|
return [];
|
|
171
170
|
}
|
|
172
171
|
const tableColumnResized = isTableColumnResized(columnWidths);
|
|
@@ -2967,7 +2967,7 @@ export const RendererStyleContainer = props => {
|
|
|
2967
2967
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2968
2968
|
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, expandSsrMarginStyles,
|
|
2969
2969
|
// this should be placed after baseOtherStyles
|
|
2970
|
-
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles,
|
|
2970
|
+
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max') && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? contentMode === 'compact' ? scaledDenseEmojiStyles : scaledEmojiStyles : contentMode === 'compact' ? denseStyles : undefined, contentMode === 'compact' ? scaledDenseUnicodeEmojiStylesNew : scaledUnicodeEmojiStylesNew, syncBlockStyles, centerWrapperStyles, isInsideSyncBlock ? syncBlockRendererStyles : null, isInsideSyncBlock && tableFakeBorderStyles, isInsideSyncBlock && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2971
2971
|
"data-testid": testId
|
|
2972
2972
|
}, children);
|
|
2973
2973
|
};
|
|
@@ -57,7 +57,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
57
57
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
58
58
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
59
59
|
const packageName = "@atlaskit/renderer";
|
|
60
|
-
const packageVersion = "
|
|
60
|
+
const packageVersion = "149.0.1";
|
|
61
61
|
const setAsQueryContainerStyles = css({
|
|
62
62
|
containerName: 'ak-renderer-wrapper',
|
|
63
63
|
containerType: 'inline-size'
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** The node to annotate, with the position immediately before it (`doc.nodeAt(pos) === node`). */
|
|
2
|
+
|
|
3
|
+
/** Renderer copy of the editor's `isSupportedBlockNode`, kept identical so both resolve alike. */
|
|
4
|
+
const isSupportedBlockNode = (node, supportedBlockNodes = []) => {
|
|
5
|
+
return supportedBlockNodes.indexOf(node.type.name) >= 0 || node.type.name === 'mediaSingle' && supportedBlockNodes.indexOf('media') >= 0;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Renderer equivalent of the editor's `resolveAnnotatableTargetFromLocalId`: resolves the node to
|
|
10
|
+
* annotate for a `localId`, climbing to the closest accepting ancestor when the node itself does
|
|
11
|
+
* not accept an annotation. Returns undefined when nothing in the chain accepts one.
|
|
12
|
+
*
|
|
13
|
+
* Kept in sync with the editor implementation so both sides resolve the same node.
|
|
14
|
+
*/
|
|
15
|
+
export const resolveAnnotatableTargetFromLocalId = (doc, localId, opts = {}) => {
|
|
16
|
+
const {
|
|
17
|
+
supportedBlockNodes
|
|
18
|
+
} = opts;
|
|
19
|
+
|
|
20
|
+
// No `EditorState` here, so walk the doc directly like `findNodePosByLocalIds` does.
|
|
21
|
+
let match;
|
|
22
|
+
doc.descendants((node, pos) => {
|
|
23
|
+
var _node$attrs;
|
|
24
|
+
if (match) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) === localId) {
|
|
28
|
+
match = {
|
|
29
|
+
node,
|
|
30
|
+
pos
|
|
31
|
+
};
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
});
|
|
36
|
+
if (!match) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const annotationMarkType = doc.type.schema.marks.annotation;
|
|
40
|
+
const nodeAcceptsAnnotation = node => !!annotationMarkType && node.type.allowsMarkType(annotationMarkType) || isSupportedBlockNode(node, supportedBlockNodes);
|
|
41
|
+
if (nodeAcceptsAnnotation(match.node)) {
|
|
42
|
+
return match;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Ancestors only — never descendants.
|
|
46
|
+
const $pos = doc.resolve(match.pos);
|
|
47
|
+
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
48
|
+
const ancestor = $pos.node(depth);
|
|
49
|
+
if (nodeAcceptsAnnotation(ancestor)) {
|
|
50
|
+
return {
|
|
51
|
+
node: ancestor,
|
|
52
|
+
pos: depth === 0 ? 0 : $pos.before(depth)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
};
|
|
@@ -107,6 +107,8 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
107
107
|
*/
|
|
108
108
|
var viewportSize = getViewportSize(extensionId, extensionViewportSizes);
|
|
109
109
|
var extensionHeight = nodeHeight || viewportSize;
|
|
110
|
+
// Forge manifest heights already include px; Connect node heights are numeric strings.
|
|
111
|
+
var extensionMinHeight = extensionHeight !== null && extensionHeight !== void 0 && extensionHeight.endsWith('px') && fg('confluence_forge_early_render_reserve_height') ? extensionHeight : extensionHeight && "".concat(extensionHeight, "px");
|
|
110
112
|
/**
|
|
111
113
|
* Scoped to nodes inserted by an app declaring `layout: inline-bodied`, which is what writes
|
|
112
114
|
* `atlassianForgeInlineBodied`. The output-type marker alone would also match migrated Connect
|
|
@@ -160,7 +162,7 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
160
162
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
161
163
|
calcBreakoutWidthCss(layout) : expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? undefined : '100%',
|
|
162
164
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
163
|
-
minHeight: isInline ? undefined :
|
|
165
|
+
minHeight: isInline ? undefined : extensionMinHeight
|
|
164
166
|
},
|
|
165
167
|
"data-layout": layout,
|
|
166
168
|
"data-local-id": localId,
|
|
@@ -9,7 +9,7 @@ import "./layoutColumn-compiled.compiled.css";
|
|
|
9
9
|
import { ax, ix } from "@compiled/react/runtime";
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { WidthProvider } from '@atlaskit/editor-common/ui';
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
// localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
|
|
14
14
|
var clearNextSiblingMarginTopStyle = null;
|
|
15
15
|
var verticalAlignMiddleStyles = null;
|
|
@@ -30,7 +30,7 @@ export var LayoutSectionCompiled = function LayoutSectionCompiled(props) {
|
|
|
30
30
|
},
|
|
31
31
|
className: ax([props.valign === 'middle' && "_1e0c1txw _2lx21bp4 _1bah1h6o", props.valign === 'bottom' && "_1e0c1txw _2lx21bp4 _1bahesu3", "_1tihidpf _12kpidpf"])
|
|
32
32
|
}, /*#__PURE__*/React.createElement(WidthProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
33
|
-
"data-layout-column-start":
|
|
33
|
+
"data-layout-column-start": "true",
|
|
34
34
|
className: ax(["_1skbgrf3", "_19segrf3 _1ki1grf3 _bmdegrf3 _166hgrf3 _7g1ogrf3 _sk2jgrf3 _hgeogrf3"])
|
|
35
35
|
}), props.children));
|
|
36
36
|
};
|
|
@@ -14,7 +14,7 @@ import React from 'react';
|
|
|
14
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- intentional: emotion fallback for compiled migration
|
|
15
15
|
import { css, jsx } from '@emotion/react';
|
|
16
16
|
import { WidthProvider } from '@atlaskit/editor-common/ui';
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
// localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
|
|
19
19
|
var clearNextSiblingMarginTopStyle = css({
|
|
20
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -61,7 +61,7 @@ export var LayoutSectionEmotion = function LayoutSectionEmotion(props) {
|
|
|
61
61
|
// Keep separate: Compiled crashes on ternary/object lookup here.
|
|
62
62
|
props.valign === 'middle' && verticalAlignMiddleStyles, props.valign === 'bottom' && verticalAlignBottomStyles, multipleWrappedImagesStyle]
|
|
63
63
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
64
|
-
"data-layout-column-start":
|
|
64
|
+
"data-layout-column-start": "true",
|
|
65
65
|
css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
|
|
66
66
|
}), props.children));
|
|
67
67
|
};
|
|
@@ -6,7 +6,6 @@ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
|
6
6
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
7
7
|
import { WidthContext } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
9
|
import { useRendererContext } from '../../../renderer-context';
|
|
11
10
|
// we allow scaling down column widths by no more than 30%
|
|
12
11
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
@@ -188,7 +187,7 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
188
187
|
var skipMinWidth = !!(isInsideOfTable && isInsideOfSyncBlock);
|
|
189
188
|
if (!columnWidths || columnWidths.every(function (width) {
|
|
190
189
|
return width === 0;
|
|
191
|
-
})
|
|
190
|
+
})) {
|
|
192
191
|
return [];
|
|
193
192
|
}
|
|
194
193
|
var tableColumnResized = isTableColumnResized(columnWidths);
|
|
@@ -2324,7 +2324,7 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
2324
2324
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2325
2325
|
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, expandSsrMarginStyles,
|
|
2326
2326
|
// this should be placed after baseOtherStyles
|
|
2327
|
-
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles,
|
|
2327
|
+
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, tableContentModeScopedStyles, tableContentModeExtensionContainmentStyles, tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, blockSsrMarginStyles, layoutBlockSsrMarginStyles, browser.safari && codeBlockInListSsrMarginSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max') && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? contentMode === 'compact' ? scaledDenseEmojiStyles : scaledEmojiStyles : contentMode === 'compact' ? denseStyles : undefined, contentMode === 'compact' ? scaledDenseUnicodeEmojiStylesNew : scaledUnicodeEmojiStylesNew, syncBlockStyles, centerWrapperStyles, isInsideSyncBlock ? syncBlockRendererStyles : null, isInsideSyncBlock && tableFakeBorderStyles, isInsideSyncBlock && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2328
2328
|
"data-testid": testId
|
|
2329
2329
|
}, children);
|
|
2330
2330
|
};
|
|
@@ -62,7 +62,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
62
62
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
63
63
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
64
64
|
var packageName = "@atlaskit/renderer";
|
|
65
|
-
var packageVersion = "
|
|
65
|
+
var packageVersion = "149.0.1";
|
|
66
66
|
var setAsQueryContainerStyles = css({
|
|
67
67
|
containerName: 'ak-renderer-wrapper',
|
|
68
68
|
containerType: 'inline-size'
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** The node to annotate, with the position immediately before it (`doc.nodeAt(pos) === node`). */
|
|
2
|
+
|
|
3
|
+
/** Renderer copy of the editor's `isSupportedBlockNode`, kept identical so both resolve alike. */
|
|
4
|
+
var isSupportedBlockNode = function isSupportedBlockNode(node) {
|
|
5
|
+
var supportedBlockNodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
6
|
+
return supportedBlockNodes.indexOf(node.type.name) >= 0 || node.type.name === 'mediaSingle' && supportedBlockNodes.indexOf('media') >= 0;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Renderer equivalent of the editor's `resolveAnnotatableTargetFromLocalId`: resolves the node to
|
|
11
|
+
* annotate for a `localId`, climbing to the closest accepting ancestor when the node itself does
|
|
12
|
+
* not accept an annotation. Returns undefined when nothing in the chain accepts one.
|
|
13
|
+
*
|
|
14
|
+
* Kept in sync with the editor implementation so both sides resolve the same node.
|
|
15
|
+
*/
|
|
16
|
+
export var resolveAnnotatableTargetFromLocalId = function resolveAnnotatableTargetFromLocalId(doc, localId) {
|
|
17
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
18
|
+
var supportedBlockNodes = opts.supportedBlockNodes;
|
|
19
|
+
|
|
20
|
+
// No `EditorState` here, so walk the doc directly like `findNodePosByLocalIds` does.
|
|
21
|
+
var match;
|
|
22
|
+
doc.descendants(function (node, pos) {
|
|
23
|
+
var _node$attrs;
|
|
24
|
+
if (match) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) === localId) {
|
|
28
|
+
match = {
|
|
29
|
+
node: node,
|
|
30
|
+
pos: pos
|
|
31
|
+
};
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
});
|
|
36
|
+
if (!match) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
var annotationMarkType = doc.type.schema.marks.annotation;
|
|
40
|
+
var nodeAcceptsAnnotation = function nodeAcceptsAnnotation(node) {
|
|
41
|
+
return !!annotationMarkType && node.type.allowsMarkType(annotationMarkType) || isSupportedBlockNode(node, supportedBlockNodes);
|
|
42
|
+
};
|
|
43
|
+
if (nodeAcceptsAnnotation(match.node)) {
|
|
44
|
+
return match;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Ancestors only — never descendants.
|
|
48
|
+
var $pos = doc.resolve(match.pos);
|
|
49
|
+
for (var depth = $pos.depth; depth >= 0; depth--) {
|
|
50
|
+
var ancestor = $pos.node(depth);
|
|
51
|
+
if (nodeAcceptsAnnotation(ancestor)) {
|
|
52
|
+
return {
|
|
53
|
+
node: ancestor,
|
|
54
|
+
pos: depth === 0 ? 0 : $pos.before(depth)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
/** The node to annotate, with the position immediately before it (`doc.nodeAt(pos) === node`). */
|
|
3
|
+
type ResolvedAnnotatableTarget = {
|
|
4
|
+
node: Node;
|
|
5
|
+
pos: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Renderer equivalent of the editor's `resolveAnnotatableTargetFromLocalId`: resolves the node to
|
|
9
|
+
* annotate for a `localId`, climbing to the closest accepting ancestor when the node itself does
|
|
10
|
+
* not accept an annotation. Returns undefined when nothing in the chain accepts one.
|
|
11
|
+
*
|
|
12
|
+
* Kept in sync with the editor implementation so both sides resolve the same node.
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveAnnotatableTargetFromLocalId: (doc: Node, localId: string, opts?: {
|
|
15
|
+
supportedBlockNodes?: string[];
|
|
16
|
+
}) => ResolvedAnnotatableTarget | undefined;
|
|
17
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "149.0.
|
|
3
|
+
"version": "149.0.2",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/editor-json-transformer": "^10.0.0",
|
|
48
48
|
"@atlaskit/editor-palette": "^3.5.0",
|
|
49
49
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
50
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
50
|
+
"@atlaskit/editor-shared-styles": "^4.4.0",
|
|
51
51
|
"@atlaskit/editor-smart-link-draggable": "^1.2.0",
|
|
52
52
|
"@atlaskit/emoji": "^72.5.0",
|
|
53
53
|
"@atlaskit/feature-gate-js-client": "^7.0.0",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
70
70
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
71
71
|
"@atlaskit/react-ufo": "^8.1.0",
|
|
72
|
-
"@atlaskit/smart-card": "^46.
|
|
72
|
+
"@atlaskit/smart-card": "^46.6.0",
|
|
73
73
|
"@atlaskit/status": "^5.13.0",
|
|
74
74
|
"@atlaskit/task-decision": "^21.12.0",
|
|
75
75
|
"@atlaskit/theme": "^28.2.0",
|
|
76
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
76
|
+
"@atlaskit/tmp-editor-statsig": "^229.0.0",
|
|
77
77
|
"@atlaskit/tokens": "^20.4.0",
|
|
78
78
|
"@atlaskit/tooltip": "^24.4.0",
|
|
79
79
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"uuid": "^11.1.1"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"@atlaskit/editor-common": "^130.
|
|
91
|
+
"@atlaskit/editor-common": "^130.3.0",
|
|
92
92
|
"@atlaskit/link-provider": "^6.0.0",
|
|
93
93
|
"@atlaskit/media-core": "^39.0.0",
|
|
94
94
|
"react": "^18.2.0 || ^19.2.0",
|
|
@@ -149,10 +149,11 @@
|
|
|
149
149
|
"worker-plugin": "^4.0.2"
|
|
150
150
|
},
|
|
151
151
|
"platform-feature-flags": {
|
|
152
|
-
"
|
|
153
|
-
"type": "boolean"
|
|
152
|
+
"confluence_forge_early_render_reserve_height": {
|
|
153
|
+
"type": "boolean",
|
|
154
|
+
"referenceOnly": true
|
|
154
155
|
},
|
|
155
|
-
"
|
|
156
|
+
"platform_editor_a11y_codeblock_haspopup": {
|
|
156
157
|
"type": "boolean"
|
|
157
158
|
},
|
|
158
159
|
"platform_native_embeds_rollout_non_maui_experience": {
|
|
@@ -200,9 +201,6 @@
|
|
|
200
201
|
"confluence_frontend_fix_view_page_slo": {
|
|
201
202
|
"type": "boolean"
|
|
202
203
|
},
|
|
203
|
-
"platform_editor_numbered_column_in_include": {
|
|
204
|
-
"type": "boolean"
|
|
205
|
-
},
|
|
206
204
|
"media-perf-uplift-mutation-fix": {
|
|
207
205
|
"type": "boolean"
|
|
208
206
|
},
|