@atlaskit/renderer 128.8.0 → 128.9.1
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 +17 -0
- package/dist/cjs/react/nodes/table/colgroup.js +131 -13
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +27 -12
- package/dist/cjs/ui/Renderer/index.js +12 -4
- package/dist/es2019/react/nodes/inlineCard.js +18 -1
- package/dist/es2019/react/nodes/table/colgroup.js +116 -12
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +25 -8
- package/dist/es2019/ui/Renderer/index.js +13 -4
- package/dist/esm/react/nodes/inlineCard.js +18 -1
- package/dist/esm/react/nodes/table/colgroup.js +129 -13
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +27 -12
- package/dist/esm/ui/Renderer/index.js +12 -4
- package/dist/types/ui/Renderer/RendererStyleContainer.d.ts +2 -0
- package/dist/types-ts4.5/ui/Renderer/RendererStyleContainer.d.ts +2 -0
- package/package.json +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 128.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`571ae3a14ac53`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/571ae3a14ac53) -
|
|
8
|
+
Refresh cache for an inline smart card in renderer if it's not been fetched before
|
|
9
|
+
- [`eaf073b7563c8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eaf073b7563c8) -
|
|
10
|
+
Fix nested table column overflow in syncBlock by using saved table width as scaling target,
|
|
11
|
+
aligning with bodiedSyncBlock behaviour
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 128.9.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [`02d2faaaf5bb9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/02d2faaaf5bb9) -
|
|
19
|
+
A11Y fixes
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [`3e18e5bea1aa1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3e18e5bea1aa1) -
|
|
24
|
+
Fixed cursor placement when pressing Enter at the start of a nested task item. Fixed extra spacing
|
|
25
|
+
on nested task lists when flexible list indentation is enabled.
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 128.8.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -22,6 +22,7 @@ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
|
22
22
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
23
23
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
24
24
|
var _editorSmartLinkDraggable = require("@atlaskit/editor-smart-link-draggable");
|
|
25
|
+
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
25
26
|
var _fallback = require("./fallback");
|
|
26
27
|
var _SmartCardStorage = require("../../ui/SmartCardStorage");
|
|
27
28
|
var _getCardClickHandler = require("../utils/getCardClickHandler");
|
|
@@ -154,6 +155,7 @@ var InlineCard = function InlineCard(props) {
|
|
|
154
155
|
onSetLinkTarget = props.onSetLinkTarget;
|
|
155
156
|
var portal = (0, _PortalContext.usePortal)(props);
|
|
156
157
|
var cardContext = (0, _linkProvider.useSmartCardContext)();
|
|
158
|
+
var provider = (0, _providerFactory.useProvider)('cardProvider');
|
|
157
159
|
var SuspenseWrapperForUrl = smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.SuspenseWrapperForUrl;
|
|
158
160
|
|
|
159
161
|
// Helper fn to conditionally wrap cards when suspense boundary is passed in via product
|
|
@@ -204,6 +206,21 @@ var InlineCard = function InlineCard(props) {
|
|
|
204
206
|
throw err;
|
|
205
207
|
}
|
|
206
208
|
};
|
|
209
|
+
(0, _react.useEffect)(function () {
|
|
210
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true) && url) {
|
|
211
|
+
// Refresh cache in the background
|
|
212
|
+
provider === null || provider === void 0 || provider.then(function (providerInstance) {
|
|
213
|
+
var _refreshCache, _ref5;
|
|
214
|
+
(_refreshCache = (_ref5 = providerInstance).refreshCache) === null || _refreshCache === void 0 || _refreshCache.call(_ref5, {
|
|
215
|
+
// It's ok to cast any resourceUrl to inlineCard here, because only URL is important for the request.
|
|
216
|
+
type: 'inlineCard',
|
|
217
|
+
attrs: {
|
|
218
|
+
url: url
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}, [provider, url]);
|
|
207
224
|
var MaybeOverlay = cardContext !== null && cardContext !== void 0 && cardContext.value ? OverlayWithCardContext : HoverLinkOverlayNoop;
|
|
208
225
|
if ((ssr || cardState && (0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url && !(0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
|
|
209
226
|
exposure: true
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.colWidthSum = exports.Colgroup = void 0;
|
|
8
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
11
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
14
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
15
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
@@ -15,6 +17,7 @@ var _useFeatureFlags = require("../../../use-feature-flags");
|
|
|
15
17
|
var _rendererContext = require("../../../renderer-context");
|
|
16
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
19
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
|
+
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
21
|
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; }
|
|
19
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
23
|
// we allow scaling down column widths by no more than 30%
|
|
@@ -32,7 +35,8 @@ var isTableColumnResized = function isTableColumnResized(columnWidths) {
|
|
|
32
35
|
var fixColumnWidth = function fixColumnWidth(_ref) {
|
|
33
36
|
var columnWidth = _ref.columnWidth,
|
|
34
37
|
zeroWidthColumnsCount = _ref.zeroWidthColumnsCount,
|
|
35
|
-
scaleDownPercent = _ref.scaleDownPercent
|
|
38
|
+
scaleDownPercent = _ref.scaleDownPercent,
|
|
39
|
+
skipMinWidth = _ref.skipMinWidth;
|
|
36
40
|
if (columnWidth === 0) {
|
|
37
41
|
return columnWidth;
|
|
38
42
|
}
|
|
@@ -40,11 +44,14 @@ var fixColumnWidth = function fixColumnWidth(_ref) {
|
|
|
40
44
|
// If the tables total width (including no zero widths col or cols without width) is less than the current layout
|
|
41
45
|
// We scale up the columns to meet the minimum of the table layout.
|
|
42
46
|
if (zeroWidthColumnsCount === 0 && scaleDownPercent) {
|
|
43
|
-
|
|
47
|
+
var scaled = Math.floor((1 - scaleDownPercent) * columnWidth);
|
|
48
|
+
return skipMinWidth ? scaled : Math.max(scaled, _styles.tableCellMinWidth);
|
|
44
49
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
var adjusted = columnWidth - _styles.tableCellBorderWidth;
|
|
51
|
+
if (skipMinWidth) {
|
|
52
|
+
return adjusted;
|
|
53
|
+
}
|
|
54
|
+
return Math.max(adjusted, zeroWidthColumnsCount ? _editorSharedStyles.akEditorTableLegacyCellMinWidth : _styles.tableCellMinWidth);
|
|
48
55
|
};
|
|
49
56
|
var calcScalePercent = function calcScalePercent(_ref2) {
|
|
50
57
|
var renderWidth = _ref2.renderWidth,
|
|
@@ -63,6 +70,93 @@ var colWidthSum = exports.colWidthSum = function colWidthSum(columnWidths) {
|
|
|
63
70
|
return curr + prev;
|
|
64
71
|
}, 0);
|
|
65
72
|
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Returns the data-column available width: total width minus the fixed number column if enabled.
|
|
76
|
+
*/
|
|
77
|
+
var getDataColumnWidth = function getDataColumnWidth(totalWidth, isNumberColumnEnabled) {
|
|
78
|
+
return isNumberColumnEnabled ? totalWidth - _editorSharedStyles.akEditorTableNumberColumnWidth : totalWidth;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Scales column widths proportionally to fit within availableWidth, matching the editor's
|
|
83
|
+
* scaleTableTo(): floors each column to the nearest pixel, then redistributes any rounding
|
|
84
|
+
* remainder to the first column that can absorb it without going below tableCellMinWidth.
|
|
85
|
+
*/
|
|
86
|
+
var scaleColumnsToWidth = function scaleColumnsToWidth(columnWidths, availableWidth) {
|
|
87
|
+
var rawTotalWidth = columnWidths.reduce(function (sum, w) {
|
|
88
|
+
return sum + w;
|
|
89
|
+
}, 0);
|
|
90
|
+
var scaleFactor = availableWidth / rawTotalWidth;
|
|
91
|
+
var scaledWidths = columnWidths.map(function (colWidth) {
|
|
92
|
+
return Math.max(Math.floor(colWidth * scaleFactor), _styles.tableCellMinWidth);
|
|
93
|
+
});
|
|
94
|
+
var totalScaled = scaledWidths.reduce(function (sum, w) {
|
|
95
|
+
return sum + w;
|
|
96
|
+
}, 0);
|
|
97
|
+
var diff = availableWidth - totalScaled;
|
|
98
|
+
if (diff !== 0 && Math.abs(diff) < _styles.tableCellMinWidth) {
|
|
99
|
+
for (var i = 0; i < scaledWidths.length; i++) {
|
|
100
|
+
if (scaledWidths[i] + diff > _styles.tableCellMinWidth) {
|
|
101
|
+
scaledWidths[i] += diff;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return scaledWidths.map(function (width) {
|
|
107
|
+
return {
|
|
108
|
+
width: "".concat(width, "px")
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Computes column widths for tables inside sync blocks, matching the editor's scaleTableTo() exactly.
|
|
115
|
+
* Returns null if the flag is off or not inside a sync block.
|
|
116
|
+
*
|
|
117
|
+
* For nested tables (isInsideOfTable=true, gated by platform_synced_block_patch_9), we use
|
|
118
|
+
* getTableContainerWidth(tableNode) as the reference — the width the editor saved, which already
|
|
119
|
+
* accounts for the parent cell's available space (colwidth minus tableCellPadding * 2).
|
|
120
|
+
* This matches bodiedSyncBlock where isRendererNested=false, so renderScaleDownColgroup uses
|
|
121
|
+
* getTableContainerWidth(tableNode). For syncBlock the nested renderer has isRendererNested=true,
|
|
122
|
+
* which incorrectly overrides tableContainerWidth with renderWidth (the full container), causing
|
|
123
|
+
* overflow by 2 * tableCellPadding (16px).
|
|
124
|
+
*/
|
|
125
|
+
var renderSyncBlockColgroup = function renderSyncBlockColgroup(_ref3) {
|
|
126
|
+
var isInsideOfSyncBlock = _ref3.isInsideOfSyncBlock,
|
|
127
|
+
isInsideOfTable = _ref3.isInsideOfTable,
|
|
128
|
+
tableNode = _ref3.tableNode,
|
|
129
|
+
columnWidths = _ref3.columnWidths,
|
|
130
|
+
isNumberColumnEnabled = _ref3.isNumberColumnEnabled,
|
|
131
|
+
renderWidthProp = _ref3.renderWidth,
|
|
132
|
+
contextWidth = _ref3.contextWidth;
|
|
133
|
+
if (!isInsideOfSyncBlock || !(0, _platformFeatureFlags.fg)('platform_synced_block_patch_9')) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
var rawTotalWidth = columnWidths.reduce(function (sum, w) {
|
|
137
|
+
return sum + w;
|
|
138
|
+
}, 0);
|
|
139
|
+
if (isInsideOfTable) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// SSR / first render before WidthContext measures. Output % of original ADF proportions so
|
|
144
|
+
// columns are stable — the CSS container query (100cqw) handles actual scaling width.
|
|
145
|
+
if (contextWidth <= 0 && renderWidthProp <= 0) {
|
|
146
|
+
var fullTableWidth = isNumberColumnEnabled ? rawTotalWidth + _editorSharedStyles.akEditorTableNumberColumnWidth : rawTotalWidth;
|
|
147
|
+
return columnWidths.map(function (colWidth) {
|
|
148
|
+
return {
|
|
149
|
+
width: "".concat(colWidth / fullTableWidth * 100, "%")
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// contextWidth measures the sync block content area. Subtract 2 to match the editor's
|
|
155
|
+
// getParentNodeWidth() border offset. Fall back to renderWidthProp for the non-CSS path.
|
|
156
|
+
var effectiveRenderWidth = contextWidth > 0 ? contextWidth - 2 : renderWidthProp;
|
|
157
|
+
var availableWidth = getDataColumnWidth(effectiveRenderWidth, isNumberColumnEnabled);
|
|
158
|
+
return scaleColumnsToWidth(columnWidths, availableWidth);
|
|
159
|
+
};
|
|
66
160
|
var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
67
161
|
var _props$tableNode;
|
|
68
162
|
var columnWidths = props.columnWidths,
|
|
@@ -76,7 +170,9 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
76
170
|
isTableScalingEnabled = props.isTableScalingEnabled,
|
|
77
171
|
isTableFixedColumnWidthsOptionEnabled = props.isTableFixedColumnWidthsOptionEnabled,
|
|
78
172
|
allowTableResizing = props.allowTableResizing,
|
|
79
|
-
isTopLevelRenderer = props.isTopLevelRenderer
|
|
173
|
+
isTopLevelRenderer = props.isTopLevelRenderer,
|
|
174
|
+
isInsideOfSyncBlock = props.isInsideOfSyncBlock;
|
|
175
|
+
var skipMinWidth = (0, _platformFeatureFlags.fg)('platform_synced_block_patch_9') && !!(isInsideOfTable && isInsideOfSyncBlock);
|
|
80
176
|
if (!columnWidths || columnWidths.every(function (width) {
|
|
81
177
|
return width === 0;
|
|
82
178
|
}) && (0, _platformFeatureFlags.fg)('platform_editor_numbered_column_in_include')) {
|
|
@@ -183,7 +279,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
183
279
|
return fixColumnWidth({
|
|
184
280
|
columnWidth: width,
|
|
185
281
|
zeroWidthColumnsCount: zeroWidthColumnsCount,
|
|
186
|
-
scaleDownPercent: scaleDownPercent
|
|
282
|
+
scaleDownPercent: scaleDownPercent,
|
|
283
|
+
skipMinWidth: skipMinWidth
|
|
187
284
|
}) || cellMinWidth;
|
|
188
285
|
});
|
|
189
286
|
var sumFixedColumnWidths = colWidthSum(fixedColWidths);
|
|
@@ -210,7 +307,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
210
307
|
var width = fixColumnWidth({
|
|
211
308
|
columnWidth: colWidth,
|
|
212
309
|
zeroWidthColumnsCount: zeroWidthColumnsCount,
|
|
213
|
-
scaleDownPercent: scaleDownPercent
|
|
310
|
+
scaleDownPercent: scaleDownPercent,
|
|
311
|
+
skipMinWidth: skipMinWidth
|
|
214
312
|
}) || cellMinWidth;
|
|
215
313
|
var style = width ? {
|
|
216
314
|
width: "".concat(width, "px")
|
|
@@ -219,18 +317,38 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
219
317
|
});
|
|
220
318
|
};
|
|
221
319
|
var Colgroup = exports.Colgroup = function Colgroup(props) {
|
|
222
|
-
var
|
|
320
|
+
var _ref4, _renderSyncBlockColgr;
|
|
223
321
|
var _useRendererContext = (0, _rendererContext.useRendererContext)(),
|
|
224
|
-
isTopLevelRenderer = _useRendererContext.isTopLevelRenderer
|
|
322
|
+
isTopLevelRenderer = _useRendererContext.isTopLevelRenderer,
|
|
323
|
+
nestedRendererType = _useRendererContext.nestedRendererType;
|
|
225
324
|
var columnWidths = props.columnWidths,
|
|
226
325
|
isNumberColumnEnabled = props.isNumberColumnEnabled;
|
|
326
|
+
var _useContext = (0, _react.useContext)(_ui.WidthContext),
|
|
327
|
+
contextWidth = _useContext.width;
|
|
227
328
|
var flags = (0, _useFeatureFlags.useFeatureFlags)();
|
|
228
329
|
if (!columnWidths) {
|
|
229
330
|
return null;
|
|
230
331
|
}
|
|
231
|
-
var isTableFixedColumnWidthsOptionEnabled = (
|
|
232
|
-
|
|
332
|
+
var isTableFixedColumnWidthsOptionEnabled = (_ref4 = (0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? props.allowFixedColumnWidthOption : flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption) !== null && _ref4 !== void 0 ? _ref4 : false;
|
|
333
|
+
|
|
334
|
+
// For referenced sync blocks, nestedRendererType='syncedBlock' is set via RendererContextProvider
|
|
335
|
+
// in AKRendererWrapper. ReactSerializer is a class and cannot read React context, so we detect
|
|
336
|
+
// it here in the Colgroup component via useRendererContext() instead of prop-drilling.
|
|
337
|
+
var isInsideOfSyncBlock = nestedRendererType === 'syncedBlock';
|
|
338
|
+
|
|
339
|
+
// renderSyncBlockColgroup returns null when not applicable (flag off, SSR, not a sync block),
|
|
340
|
+
// in which case ?? falls back to the standard renderScaleDownColgroup path.
|
|
341
|
+
var colStyles = (_renderSyncBlockColgr = renderSyncBlockColgroup({
|
|
342
|
+
isInsideOfSyncBlock: isInsideOfSyncBlock,
|
|
343
|
+
isInsideOfTable: !!props.isInsideOfTable,
|
|
344
|
+
tableNode: props.tableNode,
|
|
345
|
+
columnWidths: columnWidths,
|
|
346
|
+
isNumberColumnEnabled: !!isNumberColumnEnabled,
|
|
347
|
+
renderWidth: props.renderWidth,
|
|
348
|
+
contextWidth: contextWidth
|
|
349
|
+
})) !== null && _renderSyncBlockColgr !== void 0 ? _renderSyncBlockColgr : renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
|
|
233
350
|
isTopLevelRenderer: isTopLevelRenderer,
|
|
351
|
+
isInsideOfSyncBlock: isInsideOfSyncBlock,
|
|
234
352
|
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) || props.rendererAppearance === 'comment' && (0, _experiments.editorExperiment)('support_table_in_comment', true, {
|
|
235
353
|
exposure: true
|
|
236
354
|
}) || props.rendererAppearance === 'comment' && (0, _experiments.editorExperiment)('support_table_in_comment_jira', true, {
|
|
@@ -26,7 +26,7 @@ var _getBaseFontSize = require("./get-base-font-size");
|
|
|
26
26
|
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
27
27
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
28
28
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
29
|
-
var
|
|
29
|
+
var _css9, _$concat3, _$concat6;
|
|
30
30
|
/* eslint-disable @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-unsafe-selectors */
|
|
31
31
|
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
32
32
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
@@ -227,6 +227,12 @@ var headingAnchorStyles = (0, _react.css)({
|
|
|
227
227
|
lineHeight: "".concat(16 / 11, "em")
|
|
228
228
|
})
|
|
229
229
|
});
|
|
230
|
+
var headingAnchorButtonFocusVisibleStyles = (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(_headingAnchor.HeadingAnchorWrapperClassName), {
|
|
231
|
+
'button:focus-visible': {
|
|
232
|
+
outline: "2px solid ".concat("var(--ds-border-focused, #4688EC)"),
|
|
233
|
+
borderRadius: "var(--ds-radius-small, 3px)"
|
|
234
|
+
}
|
|
235
|
+
}));
|
|
230
236
|
var akEditorBreakpointForSmallDevice = '1266px';
|
|
231
237
|
var responsiveBreakoutWidth = (0, _react.css)((0, _defineProperty2.default)({
|
|
232
238
|
'--ak-editor--breakout-container-without-gutter-width': "calc(100cqw - ".concat(_editorSharedStyles.akEditorGutterPadding, "px * 2)"),
|
|
@@ -646,13 +652,13 @@ var paragraphSharedStyleScaledMargin = (0, _react.css)({
|
|
|
646
652
|
letterSpacing: '-0.005em'
|
|
647
653
|
}
|
|
648
654
|
});
|
|
649
|
-
var listsSharedStyles = (0, _react.css)((
|
|
655
|
+
var listsSharedStyles = (0, _react.css)((_css9 = {
|
|
650
656
|
/* =============== INDENTATION SPACING ========= */
|
|
651
657
|
'ul, ol': {
|
|
652
658
|
boxSizing: 'border-box',
|
|
653
659
|
paddingLeft: "var(--ed--list--item-counter--padding, ".concat(_styles.listItemCounterPadding, "px)")
|
|
654
660
|
}
|
|
655
|
-
}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(
|
|
661
|
+
}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_css9, "".concat(_adfSchema.orderedListSelector, ", ").concat(_adfSchema.bulletListSelector), {
|
|
656
662
|
/*
|
|
657
663
|
Ensures list item content adheres to the list's margin instead
|
|
658
664
|
of filling the entire block row. This is important to allow
|
|
@@ -684,7 +690,7 @@ var listsSharedStyles = (0, _react.css)((_css8 = {
|
|
|
684
690
|
listStyleType: 'lower-alpha'
|
|
685
691
|
}), 'ol[data-indent-level="3"], ol[data-indent-level="6"]', {
|
|
686
692
|
listStyleType: 'lower-roman'
|
|
687
|
-
}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(
|
|
693
|
+
}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_css9, 'ul[data-indent-level="1"], ul[data-indent-level="4"]', {
|
|
688
694
|
listStyleType: 'disc'
|
|
689
695
|
}), 'ul[data-indent-level="2"], ul[data-indent-level="5"]', {
|
|
690
696
|
listStyleType: 'circle'
|
|
@@ -728,11 +734,13 @@ var listItemHiddenMarkerStyles = (0, _react.css)({
|
|
|
728
734
|
'li:has(> ul:only-child) > ul, li:has(> ol:only-child) > ol': {
|
|
729
735
|
marginTop: 0
|
|
730
736
|
},
|
|
731
|
-
//
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
737
|
+
// Remove top margin from nested taskLists not preceded by a sibling taskItem
|
|
738
|
+
'div[data-task-list-local-id] > div[data-task-list-local-id]': {
|
|
739
|
+
marginTop: 0
|
|
740
|
+
},
|
|
741
|
+
// Restore margin when a nested taskList follows a taskItem
|
|
742
|
+
'div[data-task-local-id] + div[data-task-list-local-id]': {
|
|
743
|
+
marginTop: "var(--ds-space-050, 4px)"
|
|
736
744
|
}
|
|
737
745
|
});
|
|
738
746
|
var indentationSharedStyles = (0, _react.css)({
|
|
@@ -1597,6 +1605,7 @@ var rendererTableSortableColumnStyles = (0, _react.css)((0, _defineProperty2.def
|
|
|
1597
1605
|
width: '100%',
|
|
1598
1606
|
height: '100%',
|
|
1599
1607
|
padding: "".concat(_styles.tableCellPadding, "px"),
|
|
1608
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-shape
|
|
1600
1609
|
borderWidth: '1.5px',
|
|
1601
1610
|
borderStyle: 'solid',
|
|
1602
1611
|
borderColor: "transparent",
|
|
@@ -1979,6 +1988,11 @@ var denseStyles = (0, _react.css)((0, _defineProperty2.default)((0, _definePrope
|
|
|
1979
1988
|
marginTop: RENDERER_LIST_DENSE_GAP
|
|
1980
1989
|
}
|
|
1981
1990
|
}));
|
|
1991
|
+
var syncBlockRendererStyles = (0, _react.css)({
|
|
1992
|
+
margin: 0,
|
|
1993
|
+
maxWidth: 'none',
|
|
1994
|
+
padding: 0
|
|
1995
|
+
});
|
|
1982
1996
|
var syncBlockStyles = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_syncBlock.SyncBlockSharedCssClassName.renderer, ", .").concat(_syncBlock.BodiedSyncBlockSharedCssClassName.renderer, ", .").concat(_syncBlock.SyncBlockSharedCssClassName.error, ", .").concat(_syncBlock.SyncBlockSharedCssClassName.loading), {
|
|
1983
1997
|
borderRadius: "var(--ds-radius-small, 3px)",
|
|
1984
1998
|
marginTop: "var(--ds-space-075, 6px)",
|
|
@@ -2011,7 +2025,8 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2011
2025
|
useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock,
|
|
2012
2026
|
children = props.children,
|
|
2013
2027
|
innerRef = props.innerRef,
|
|
2014
|
-
testId = props.testId
|
|
2028
|
+
testId = props.testId,
|
|
2029
|
+
isInsideSyncBlock = props.isInsideSyncBlock;
|
|
2015
2030
|
var isAdvancedLayoutsOn = (0, _experiments.editorExperiment)('advanced_layouts', true);
|
|
2016
2031
|
var isPreviewPanelResponsivenessOn = (0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true, {
|
|
2017
2032
|
exposure: true
|
|
@@ -2037,7 +2052,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2037
2052
|
}, (0, _expValEquals.expValEquals)('platform_editor_small_font_size', 'isEnabled', true) && {
|
|
2038
2053
|
'--ak-renderer-editor-font-small-text': (0, _ugcTokens.editorUGCToken)('editor.font.body.small')
|
|
2039
2054
|
}),
|
|
2040
|
-
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, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? hideHeadingCopyLinkWrapperStyles : hideHeadingCopyLinkWrapperStylesDuplicateAnchor, appearance === 'full-page' && isPreviewPanelResponsivenessOn && rendererFullPageStylesWithReducedPadding, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && rendererFullPageStyles, appearance === 'full-width' && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererFullWidthStyles : oldRendererFullWidthStyles), (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && !(0, _table.isTableResizingEnabled)(appearance) && rendererFullWidthStylesForTableResizing, appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererMaxWidthStyles : oldRendererMaxWidthStyles), rovoTelepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingWrapperInlineFlowStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? headingWithAlignmentStyles : headingWithAlignmentStylesDuplicateAnchor, ruleSharedStyles, contentMode === 'compact' && isCompactModeSupported && extensionStyle, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? isCompactModeSupported ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : isCompactModeSupported ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, (0, _expValEquals.expValEquals)('platform_editor_flexible_list_schema', 'isEnabled', true) && listItemHiddenMarkerStyles, indentationSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles,
|
|
2055
|
+
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, (0, _platformFeatureFlags.fg)('ally_30945_accessibility_outline_fix') && 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' && isCompactModeSupported && extensionStyle, (0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? isCompactModeSupported ? paragraphStylesUGCScaledMargin : paragraphSharedStylesWithEditorUGC : isCompactModeSupported ? paragraphSharedStyleScaledMargin : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, (0, _expValEquals.expValEquals)('platform_editor_flexible_list_schema', 'isEnabled', true) && listItemHiddenMarkerStyles, indentationSharedStyles, (0, _platformFeatureFlags.fg)('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? blockMarksSharedStyles : blockMarksSharedStylesDuplicateAnchor, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles,
|
|
2041
2056
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2042
2057
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix, (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true) && 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),
|
|
2043
2058
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
@@ -2045,7 +2060,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2045
2060
|
// this should be placed after baseOtherStyles
|
|
2046
2061
|
(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), inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle,
|
|
2047
2062
|
// merge firstWrappedMediaStyles with mediaSingleSharedStyle when clean up platform_editor_fix_media_in_renderer
|
|
2048
|
-
(0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, (0, _table.isStickyScrollbarEnabled)(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, (0, _experiments.editorExperiment)('platform_synced_block', true) && syncBlockStyles, centerWrapperStyles],
|
|
2063
|
+
(0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer') && firstWrappedMediaStyles, tableSharedStyle, tableRendererHeaderStylesForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? firstNodeWithNotMarginTopWithNestedDnD : firstNodeWithNotMarginTop, rendererTableStyles, (0, _table.isStickyScrollbarEnabled)(appearance) && stickyScrollbarStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, (0, _expValEquals.expValEquals)('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? isCompactModeEnabled ? scaledDenseEmojiStyles : scaledEmojiStyles : isCompactModeEnabled ? denseStyles : undefined, (0, _experiments.editorExperiment)('platform_synced_block', true) && syncBlockStyles, centerWrapperStyles, (0, _experiments.editorExperiment)('platform_synced_block', true) && isInsideSyncBlock && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_9') ? syncBlockRendererStyles : null],
|
|
2049
2064
|
"data-testid": testId
|
|
2050
2065
|
}, children);
|
|
2051
2066
|
};
|
|
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
71
71
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
72
72
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
73
73
|
var packageName = "@atlaskit/renderer";
|
|
74
|
-
var packageVersion = "128.
|
|
74
|
+
var packageVersion = "128.9.0";
|
|
75
75
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
76
76
|
containerName: 'ak-renderer-wrapper',
|
|
77
77
|
containerType: 'inline-size'
|
|
@@ -199,10 +199,15 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
199
199
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(featureFlags);
|
|
200
200
|
return {
|
|
201
201
|
featureFlags: normalizedFeatureFlags,
|
|
202
|
-
isTopLevelRenderer: isTopLevelRenderer === undefined
|
|
202
|
+
isTopLevelRenderer: isTopLevelRenderer === undefined,
|
|
203
|
+
// Propagate nestedRendererType into the inner RendererContextProvider so that
|
|
204
|
+
// React components inside the renderer (e.g. Colgroup) can read it via
|
|
205
|
+
// useRendererContext(). Without this, the inner provider overwrites the outer
|
|
206
|
+
// AKRendererWrapper context and nestedRendererType becomes undefined.
|
|
207
|
+
nestedRendererType: nestedRendererType
|
|
203
208
|
};
|
|
204
209
|
};
|
|
205
|
-
}, []);
|
|
210
|
+
}, [nestedRendererType]);
|
|
206
211
|
var fireAnalyticsEventOld = (0, _react.useCallback)(function (event) {
|
|
207
212
|
var createAnalyticsEvent = props.createAnalyticsEvent;
|
|
208
213
|
if (createAnalyticsEvent) {
|
|
@@ -627,6 +632,8 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
627
632
|
return telepointer;
|
|
628
633
|
};
|
|
629
634
|
var initialUpdate = _react.default.useRef(true);
|
|
635
|
+
var _useRendererContext3 = (0, _rendererContext.useRendererContext)(),
|
|
636
|
+
nestedRendererType = _useRendererContext3.nestedRendererType;
|
|
630
637
|
(0, _react.useEffect)(function () {
|
|
631
638
|
// We must check if window is defined, if it isn't we are in a SSR environment
|
|
632
639
|
// and we don't want to add the telepointer
|
|
@@ -724,7 +731,8 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
724
731
|
useBlockRenderForCodeBlock: useBlockRenderForCodeBlock,
|
|
725
732
|
allowAnnotations: props.allowAnnotations,
|
|
726
733
|
allowTableResizing: allowTableResizing,
|
|
727
|
-
allowRendererContainerStyles: allowRendererContainerStyles
|
|
734
|
+
allowRendererContainerStyles: allowRendererContainerStyles,
|
|
735
|
+
isInsideSyncBlock: nestedRendererType === 'syncedBlock'
|
|
728
736
|
}, children))));
|
|
729
737
|
|
|
730
738
|
// We can only make the wrapper div query container when we have a known width.
|
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
6
|
/* eslint-disable jsdoc/check-tag-names */
|
|
7
|
-
import { Fragment, useState, useMemo } from 'react';
|
|
7
|
+
import { Fragment, useState, useMemo, useEffect } from 'react';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
10
|
import { useSmartCardContext } from '@atlaskit/link-provider';
|
|
@@ -20,6 +20,7 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
|
20
20
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
21
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
22
22
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
23
|
+
import { useProvider } from '@atlaskit/editor-common/provider-factory';
|
|
23
24
|
import { CardErrorBoundary } from './fallback';
|
|
24
25
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
25
26
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
@@ -139,6 +140,7 @@ const InlineCard = props => {
|
|
|
139
140
|
} = props;
|
|
140
141
|
const portal = usePortal(props);
|
|
141
142
|
const cardContext = useSmartCardContext();
|
|
143
|
+
const provider = useProvider('cardProvider');
|
|
142
144
|
const SuspenseWrapperForUrl = smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.SuspenseWrapperForUrl;
|
|
143
145
|
|
|
144
146
|
// Helper fn to conditionally wrap cards when suspense boundary is passed in via product
|
|
@@ -189,6 +191,21 @@ const InlineCard = props => {
|
|
|
189
191
|
throw err;
|
|
190
192
|
}
|
|
191
193
|
};
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && url) {
|
|
196
|
+
// Refresh cache in the background
|
|
197
|
+
provider === null || provider === void 0 ? void 0 : provider.then(providerInstance => {
|
|
198
|
+
var _refreshCache, _ref;
|
|
199
|
+
(_refreshCache = (_ref = providerInstance).refreshCache) === null || _refreshCache === void 0 ? void 0 : _refreshCache.call(_ref, {
|
|
200
|
+
// It's ok to cast any resourceUrl to inlineCard here, because only URL is important for the request.
|
|
201
|
+
type: 'inlineCard',
|
|
202
|
+
attrs: {
|
|
203
|
+
url
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}, [provider, url]);
|
|
192
209
|
const MaybeOverlay = cardContext !== null && cardContext !== void 0 && cardContext.value ? OverlayWithCardContext : HoverLinkOverlayNoop;
|
|
193
210
|
if ((ssr || cardState && expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true)) && url && !editorExperiment('platform_editor_preview_panel_linking_exp', true, {
|
|
194
211
|
exposure: true
|