@atlaskit/renderer 137.1.8 → 137.1.10

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/react/index.js +1 -1
  3. package/dist/cjs/react/nodes/table/colgroup.js +1 -2
  4. package/dist/cjs/react/nodes/table/sticky.js +2 -4
  5. package/dist/cjs/react/nodes/table/table.js +1 -12
  6. package/dist/cjs/react/nodes/table.js +471 -203
  7. package/dist/cjs/ui/Expand.js +33 -7
  8. package/dist/cjs/ui/Renderer/breakout-ssr.js +1 -2
  9. package/dist/cjs/ui/Renderer/index.js +3 -3
  10. package/dist/cjs/ui/utils/expand-body.js +218 -0
  11. package/dist/cjs/ui/utils/expand-search-text.js +39 -1
  12. package/dist/es2019/react/index.js +1 -1
  13. package/dist/es2019/react/nodes/table/colgroup.js +1 -2
  14. package/dist/es2019/react/nodes/table/sticky.js +2 -3
  15. package/dist/es2019/react/nodes/table/table.js +1 -12
  16. package/dist/es2019/react/nodes/table.js +457 -190
  17. package/dist/es2019/ui/Expand.js +33 -7
  18. package/dist/es2019/ui/Renderer/breakout-ssr.js +1 -2
  19. package/dist/es2019/ui/Renderer/index.js +3 -3
  20. package/dist/es2019/ui/utils/expand-body.js +198 -0
  21. package/dist/es2019/ui/utils/expand-search-text.js +38 -0
  22. package/dist/esm/react/index.js +1 -1
  23. package/dist/esm/react/nodes/table/colgroup.js +1 -2
  24. package/dist/esm/react/nodes/table/sticky.js +2 -4
  25. package/dist/esm/react/nodes/table/table.js +1 -12
  26. package/dist/esm/react/nodes/table.js +471 -202
  27. package/dist/esm/ui/Expand.js +33 -7
  28. package/dist/esm/ui/Renderer/breakout-ssr.js +1 -2
  29. package/dist/esm/ui/Renderer/index.js +3 -3
  30. package/dist/esm/ui/utils/expand-body.js +210 -0
  31. package/dist/esm/ui/utils/expand-search-text.js +38 -0
  32. package/dist/types/react/nodes/table/sticky.d.ts +1 -2
  33. package/dist/types/react/nodes/table.d.ts +78 -8
  34. package/dist/types/ui/{expand-body.d.ts → utils/expand-body.d.ts} +26 -5
  35. package/dist/types/ui/utils/expand-search-text.d.ts +14 -0
  36. package/package.json +6 -9
  37. package/dist/cjs/react/nodes/tableNew.js +0 -1050
  38. package/dist/cjs/ui/expand-body.js +0 -122
  39. package/dist/es2019/react/nodes/tableNew.js +0 -986
  40. package/dist/es2019/ui/expand-body.js +0 -107
  41. package/dist/esm/react/nodes/tableNew.js +0 -1044
  42. package/dist/esm/ui/expand-body.js +0 -114
  43. package/dist/types/react/nodes/tableNew.d.ts +0 -189
@@ -17,7 +17,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
17
17
  var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
18
18
  var _Tooltip = _interopRequireDefault(require("@atlaskit/tooltip/Tooltip"));
19
19
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
20
- var _expandBody = require("./expand-body");
20
+ var _expandBody = require("./utils/expand-body");
21
21
  var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
22
22
  var _reactIntl = require("react-intl");
23
23
  var _events = require("../analytics/events");
@@ -219,6 +219,7 @@ function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
219
219
  });
220
220
  }
221
221
  function Expand(_ref) {
222
+ var _ancestorBody$reveale;
222
223
  var title = _ref.title,
223
224
  children = _ref.children,
224
225
  nodeType = _ref.nodeType,
@@ -229,7 +230,25 @@ function Expand(_ref) {
229
230
  rendererContentMode = _ref.rendererContentMode,
230
231
  node = _ref.node;
231
232
  var ancestorBody = (0, _expandBody.useExpandBody)();
232
- var _useState = (0, _react2.useState)(false),
233
+
234
+ // Shared with every expand in the chain: the element that stood in for this expand and caught the
235
+ // find sits under an expand further out, and by the time this one mounts that element is gone.
236
+ //
237
+ // Built on first render rather than passed to `useRef`, which would evaluate and discard a new set
238
+ // on every render for the life of the expand.
239
+ var ownRevealedByFind = (0, _react2.useRef)(null);
240
+ if (!ownRevealedByFind.current) {
241
+ ownRevealedByFind.current = new WeakSet();
242
+ }
243
+ var revealedByFind = (_ancestorBody$reveale = ancestorBody === null || ancestorBody === void 0 ? void 0 : ancestorBody.revealedByFind) !== null && _ancestorBody$reveale !== void 0 ? _ancestorBody$reveale : ownRevealedByFind.current;
244
+ /**
245
+ * Browser find matched inside this expand while the expand above it was still collapsed, so it
246
+ * opens as soon as it mounts — otherwise the reader would watch the outer expand open onto a
247
+ * closed one, with the match nowhere to be seen. Empty on the server and on the first client
248
+ * render, so hydration cannot disagree; only a find on the client ever puts anything in it.
249
+ */
250
+ var revealedByFindOnMount = node !== undefined && revealedByFind.has(node);
251
+ var _useState = (0, _react2.useState)(revealedByFindOnMount),
233
252
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
234
253
  expanded = _useState2[0],
235
254
  setExpanded = _useState2[1];
@@ -242,9 +261,9 @@ function Expand(_ref) {
242
261
  * Throwing it away would re-run every macro and Forge fetch inside it on the next open, which is
243
262
  * slower and visibly reloads content the reader has already seen. We only wanted to save work on
244
263
  * the first page load, and by now that has happened. Starts false on both the server and the
245
- * client, so hydration cannot disagree.
264
+ * first client render, so hydration cannot disagree.
246
265
  */
247
- var _useState5 = (0, _react2.useState)(false),
266
+ var _useState5 = (0, _react2.useState)(revealedByFindOnMount),
248
267
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
249
268
  hasBeenExpanded = _useState6[0],
250
269
  setHasBeenExpanded = _useState6[1];
@@ -270,9 +289,15 @@ function Expand(_ref) {
270
289
  // inside other expands, those have to open too or the reader still cannot see it. Each expand
271
290
  // asks the one above it, so a single match opens the whole chain and nothing else.
272
291
  var openWithAncestors = (0, _react2.useCallback)(function () {
292
+ // Remembered before anything opens: a block above this expand may have been standing in for
293
+ // itself, and rendering it rebuilds this expand. Without this it would come back closed over
294
+ // the match the reader was just taken to.
295
+ if (node) {
296
+ revealedByFind.add(node);
297
+ }
273
298
  openBody();
274
299
  ancestorBody === null || ancestorBody === void 0 || ancestorBody.openWithAncestors();
275
- }, [ancestorBody, openBody]);
300
+ }, [ancestorBody, node, openBody, revealedByFind]);
276
301
 
277
302
  // Feature-detect hidden="until-found" support via the beforematch event. Chrome 102+,
278
303
  // Firefox 139+ and Safari 26.2+ all have it; in a browser without it, hidden="until-found" is
@@ -354,9 +379,10 @@ function Expand(_ref) {
354
379
  var expandBody = (0, _react2.useMemo)(function () {
355
380
  return {
356
381
  revealed: revealed,
357
- openWithAncestors: openWithAncestors
382
+ openWithAncestors: openWithAncestors,
383
+ revealedByFind: revealedByFind
358
384
  };
359
- }, [revealed, openWithAncestors]);
385
+ }, [revealed, openWithAncestors, revealedByFind]);
360
386
  return (0, _react.jsx)(Container, {
361
387
  "data-testid": "expand-container-".concat(nodeType, "-").concat(id),
362
388
  "data-node-type": nodeType,
@@ -37,7 +37,7 @@ function BreakoutSSRInlineScript(_ref) {
37
37
  }
38
38
  var id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
39
39
  var shouldSkipScript = {
40
- table: (0, _fg.fg)('platform-ssr-table-resize')
40
+ table: true
41
41
  };
42
42
  return /*#__PURE__*/_react.default.createElement("script", {
43
43
  "data-breakout-script-id": id
@@ -96,7 +96,6 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript, fla
96
96
  return;
97
97
  }
98
98
 
99
- // Remove with feature gate 'platform-ssr-table-resize'
100
99
  // Ignored via go/ees005
101
100
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
102
101
  if (item.target.classList.contains('ak-renderer-document')) {
@@ -74,7 +74,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
74
74
  var TABLE_INFO_TIMEOUT = 10000;
75
75
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
76
76
  var packageName = "@atlaskit/renderer";
77
- var packageVersion = "137.1.7";
77
+ var packageVersion = "137.1.9";
78
78
  var setAsQueryContainerStyles = (0, _react2.css)({
79
79
  containerName: 'ak-renderer-wrapper',
80
80
  containerType: 'inline-size'
@@ -784,7 +784,7 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
784
784
  //
785
785
 
786
786
  // allowRendererContainerStyles is not needed for comment container styling as container should always be set for comments
787
- if (appearance === 'comment' && isTopLevelRenderer && (0, _fg.fg)('platform-ssr-table-resize')) {
787
+ if (appearance === 'comment' && isTopLevelRenderer) {
788
788
  return (0, _react2.jsx)("div", {
789
789
  css: setAsQueryContainerStyles
790
790
  }, renderer);
@@ -797,7 +797,7 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
797
797
  return (appearance === 'full-page' || appearance === 'full-width' || ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true)) && appearance === 'max') &&
798
798
  // In case of having excerpt-include on page there are multiple renderers nested.
799
799
  // Make sure only the root renderer is set to be query container.
800
- isTopLevelRenderer && allowRendererContainerStyles && (0, _fg.fg)('platform-ssr-table-resize') ? (0, _react2.jsx)("div", {
800
+ isTopLevelRenderer && allowRendererContainerStyles ? (0, _react2.jsx)("div", {
801
801
  css: setAsQueryContainerStyles
802
802
  }, renderer) : renderer;
803
803
  });
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.withExpandBodyBlock = exports.useExpandBody = exports.mergeExpandBodyText = exports.ExpandBodyTable = exports.ExpandBodyProvider = exports.ExpandBodyBlock = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
10
+ var _expandSearchText = require("./expand-search-text");
11
+ 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); }
12
+ var ExpandBodyContext = /*#__PURE__*/(0, _react.createContext)(null);
13
+ var ExpandBodyProvider = exports.ExpandBodyProvider = ExpandBodyContext.Provider;
14
+ var useExpandBody = exports.useExpandBody = function useExpandBody() {
15
+ return (0, _react.useContext)(ExpandBodyContext);
16
+ };
17
+ /**
18
+ * One or more neighbouring blocks of an expand's body. Shows their text until the expand is
19
+ * opened, then renders them. Falls back to rendering if there is no text, or if there is no
20
+ * expand above it.
21
+ *
22
+ * The text is rendered as-is, with no element around it. Nothing reads it but browser find,
23
+ * which only needs the characters to be in the DOM.
24
+ */
25
+ var ExpandBodyBlock = exports.ExpandBodyBlock = function ExpandBodyBlock(_ref) {
26
+ var children = _ref.children,
27
+ searchText = _ref.searchText;
28
+ var body = useExpandBody();
29
+ if (searchText === undefined || body === null || body.revealed) {
30
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
31
+ }
32
+ return searchText;
33
+ };
34
+
35
+ /**
36
+ * Called for every node the serializer renders. If the node is a block of an expand's body,
37
+ * wraps it so it can show its text instead of rendering while that expand is collapsed.
38
+ * Everything else is returned untouched.
39
+ *
40
+ * A block holding an expand of its own is returned untouched, because standing in for the whole
41
+ * block would take that expand with it, and the expand needs an element of its own: the element
42
+ * browser find reveals is the only way we learn the match was inside it rather than higher up. A
43
+ * table is handed to `ExpandBodyTable`, which stands in for its own rows and keeps only the rows
44
+ * that hold an expand. Everything else — a panel, a list, an extension with stashed ADF — renders
45
+ * in full, so the reader searches once instead of once per level.
46
+ *
47
+ * `ancestors` is the node's ancestor chain, nearest last.
48
+ */
49
+ var withExpandBodyBlock = exports.withExpandBodyBlock = function withExpandBodyBlock(node, ancestors, index, serialized) {
50
+ var parent = ancestors[ancestors.length - 1];
51
+ if (!parent || !(0, _expandSearchText.isExpandNode)(parent)) {
52
+ return serialized;
53
+ }
54
+ if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_defer_collapsed_expand_body')) {
55
+ return serialized;
56
+ }
57
+
58
+ // `serialized` is only null for a node the renderer has no component for, which a table is not.
59
+ // Such a table falls through to the paths below, which do not reach into it.
60
+ if (node.type.name === 'table' && serialized !== null) {
61
+ var parts = (0, _expandSearchText.getTableStandInParts)(node);
62
+
63
+ // With no row to keep, one string can stand in for the whole table — the table then renders
64
+ // nothing at all, and its text joins with the blocks either side of it.
65
+ return parts.every(function (part) {
66
+ return typeof part === 'string';
67
+ }) ? /*#__PURE__*/_react.default.createElement(ExpandBodyBlock, {
68
+ key: "expand-body-block-".concat(index),
69
+ searchText: parts.join('')
70
+ }, serialized) : /*#__PURE__*/_react.default.createElement(ExpandBodyTable, {
71
+ key: "expand-body-table-".concat(index),
72
+ node: node
73
+ }, serialized);
74
+ }
75
+ if ((0, _expandSearchText.holdsRevealableContent)(node)) {
76
+ return serialized;
77
+ }
78
+ var searchText = (0, _expandSearchText.getBlockSearchText)(node);
79
+ if (searchText === undefined) {
80
+ return serialized;
81
+ }
82
+ return /*#__PURE__*/_react.default.createElement(ExpandBodyBlock, {
83
+ key: "expand-body-block-".concat(index),
84
+ searchText: searchText
85
+ }, serialized);
86
+ };
87
+ var isRow = function isRow(child) {
88
+ return /*#__PURE__*/(0, _react.isValidElement)(child) && child.props.nodeType === 'tableRow';
89
+ };
90
+
91
+ /**
92
+ * The rows inside the serialized table, wherever they sit.
93
+ *
94
+ * What the serializer hands over is not reliably the element whose children are the rows. Marks are
95
+ * folded around the node afterwards, and a product's own serializer may wrap the rows themselves —
96
+ * Confluence's progressive renderer wraps every row but the first. Assuming either a depth or a set
97
+ * of direct children means any wrapper added later silently costs the saving, so the rows are found
98
+ * instead by the `nodeType` the serializer puts on every node.
99
+ *
100
+ * Descent stops at each row: a nested table's rows sit inside a row of this one, and would
101
+ * otherwise be counted among them.
102
+ *
103
+ * The count is only a consistency check. `getTableStandInParts` indexes the rows by position, so a
104
+ * partial match cannot be lined up and the table has to render instead.
105
+ */
106
+ var rowsOf = function rowsOf(serialized, rowCount) {
107
+ var rows = [];
108
+ var _collect = function collect(node) {
109
+ _react.default.Children.toArray(node).forEach(function (child) {
110
+ if (! /*#__PURE__*/(0, _react.isValidElement)(child)) {
111
+ return;
112
+ }
113
+ if (isRow(child)) {
114
+ rows.push(child);
115
+ return;
116
+ }
117
+ _collect(child.props.children);
118
+ });
119
+ };
120
+ _collect(serialized);
121
+ return rows.length === rowCount ? rows : undefined;
122
+ };
123
+
124
+ /**
125
+ * A table in the body of a collapsed expand. Shows the text of its rows until the expand is opened,
126
+ * keeping the rows that hold an expand of their own — those need an element for find to reveal.
127
+ *
128
+ * Standing in for the whole table, the way an ordinary block does, would take that expand with it.
129
+ */
130
+ var ExpandBodyTable = exports.ExpandBodyTable = function ExpandBodyTable(_ref2) {
131
+ var children = _ref2.children,
132
+ node = _ref2.node;
133
+ var body = useExpandBody();
134
+ if (body === null || body.revealed) {
135
+ return children;
136
+ }
137
+ var rows = rowsOf(children, node.childCount);
138
+ if (!rows) {
139
+ // Nothing is wrong: the table renders as it always did, only without the saving. Still worth
140
+ // saying, because a silent fallback looks exactly like the feature being switched off.
141
+ // Every environment but production says it: a wrapper added by a product is only ever seen
142
+ // once that product has deployed, which a `NODE_ENV` check never reaches.
143
+ if (process.env.CLOUD_ENV !== 'production') {
144
+ // eslint-disable-next-line no-console
145
+ console.info('@atlaskit/renderer: the rows of a table in a collapsed expand were not found, so the table renders in full rather than showing their text');
146
+ }
147
+ return children;
148
+ }
149
+ return (0, _expandSearchText.getTableStandInParts)(node).map(function (part) {
150
+ return typeof part === 'string' ? part :
151
+ /*#__PURE__*/
152
+ // A row cannot stand in the page on its own — `<tr>` is only valid inside a table — so it
153
+ // keeps the least table around it that makes the markup valid. None of this is laid out: the
154
+ // body is hidden until the reader or find opens the expand, and opening it renders the real
155
+ // table in place of all this.
156
+ _react.default.createElement("table", {
157
+ key: "expand-body-row-".concat(part)
158
+ }, /*#__PURE__*/_react.default.createElement("tbody", null, rows[part]));
159
+ });
160
+ };
161
+
162
+ /** Whatever the serializer produced for one child: an element, a string, an array of either. */
163
+
164
+ var searchTextOf = function searchTextOf(child) {
165
+ return /*#__PURE__*/(0, _react.isValidElement)(child) && child.type === ExpandBodyBlock ? child.props.searchText : undefined;
166
+ };
167
+
168
+ /**
169
+ * Joins neighbouring blocks that are showing text into one, so a run of them is a single string in
170
+ * the DOM rather than one per block. A body of twenty paragraphs becomes one text node instead of
171
+ * twenty.
172
+ *
173
+ * A block that is being rendered — a nested expand, say — ends the run, because the text either
174
+ * side of it has to stay either side of it.
175
+ */
176
+ var mergeExpandBodyText = exports.mergeExpandBodyText = function mergeExpandBodyText(children) {
177
+ // Called for every fragment in the document, and only an expand's body has anything to merge, so
178
+ // leave the array alone unless two neighbours are actually showing text.
179
+ var hasRun = children.some(function (child, index) {
180
+ return index > 0 && searchTextOf(child) !== undefined && searchTextOf(children[index - 1]) !== undefined;
181
+ });
182
+ if (!hasRun) {
183
+ return children;
184
+ }
185
+ var merged = [];
186
+ var run = [];
187
+ var endRun = function endRun() {
188
+ if (run.length === 0) {
189
+ return;
190
+ }
191
+ if (run.length === 1) {
192
+ merged.push(run[0]);
193
+ } else {
194
+ var _key;
195
+ var text = run.map(searchTextOf).filter(Boolean).join(_expandSearchText.BLOCK_SEPARATOR);
196
+ // The blocks themselves, not the wrappers around them: nesting the wrappers would show
197
+ // each block's text again inside the joined run.
198
+ var blocks = run.map(function (child) {
199
+ return child.props.children;
200
+ });
201
+ merged.push( /*#__PURE__*/_react.default.createElement(ExpandBodyBlock, {
202
+ key: (_key = run[0].key) !== null && _key !== void 0 ? _key : undefined,
203
+ searchText: text
204
+ }, blocks));
205
+ }
206
+ run = [];
207
+ };
208
+ children.forEach(function (child) {
209
+ if (searchTextOf(child) === undefined) {
210
+ endRun();
211
+ merged.push(child);
212
+ return;
213
+ }
214
+ run.push(child);
215
+ });
216
+ endRun();
217
+ return merged;
218
+ };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isExpandNode = exports.holdsRevealableContent = exports.getBlockSearchText = exports.BLOCK_SEPARATOR = void 0;
6
+ exports.isExpandNode = exports.holdsRevealableContent = exports.getTableStandInParts = exports.getBlockSearchText = exports.BLOCK_SEPARATOR = void 0;
7
7
  var _utils = require("@atlaskit/editor-prosemirror/utils");
8
8
  /**
9
9
  * Minimal structural view of an ADF entity. `parameters.nestedContent` holds raw ADF JSON rather
@@ -135,4 +135,42 @@ var getBlockSearchText = exports.getBlockSearchText = function getBlockSearchTex
135
135
  searchTextCache.set(node, cached);
136
136
  }
137
137
  return cached !== null && cached !== void 0 ? cached : undefined;
138
+ };
139
+
140
+ /**
141
+ * One piece of what a collapsed table shows: either the text of the rows being stood in for, or the
142
+ * index of a row that has to keep rendering.
143
+ */
144
+
145
+ var tableStandInCache = new WeakMap();
146
+
147
+ /**
148
+ * What a table inside a collapsed expand shows in place of rendering, in table order so that find
149
+ * walks it the way the reader reads it.
150
+ *
151
+ * A row keeps rendering when it holds an expand of its own, which needs a real element for browser
152
+ * find to reveal, or when its text carries an inline comment. Its text is left out of the runs
153
+ * either side of it, since the row itself puts that text in the DOM.
154
+ */
155
+ var getTableStandInParts = exports.getTableStandInParts = function getTableStandInParts(table) {
156
+ var cached = tableStandInCache.get(table);
157
+ if (cached !== undefined) {
158
+ return cached;
159
+ }
160
+ var parts = [];
161
+ table.forEach(function (row, _offset, index) {
162
+ var text = holdsRevealableContent(row) ? undefined : getBlockSearchText(row);
163
+ if (text === undefined) {
164
+ parts.push(index);
165
+ return;
166
+ }
167
+ var last = parts[parts.length - 1];
168
+ if (typeof last === 'string') {
169
+ parts[parts.length - 1] = "".concat(last).concat(BLOCK_SEPARATOR).concat(text);
170
+ return;
171
+ }
172
+ parts.push(text);
173
+ });
174
+ tableStandInCache.set(table, parts);
175
+ return parts;
138
176
  };
@@ -4,7 +4,7 @@ import React from 'react';
4
4
  import { MarkType } from '@atlaskit/editor-prosemirror/model';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
- import { mergeExpandBodyText, withExpandBodyBlock } from '../ui/expand-body';
7
+ import { mergeExpandBodyText, withExpandBodyBlock } from '../ui/utils/expand-body';
8
8
  import { Doc, DocWithSelectAllTrap, isTextNode, isTextWrapper, mergeTextNodes, toReact } from './nodes';
9
9
  import TextWrapperComponent from './nodes/text-wrapper';
10
10
  import { isNestedHeaderLinksEnabled } from './utils/links';
@@ -259,11 +259,10 @@ const renderScaleDownColgroup = props => {
259
259
  }
260
260
  // scaling down
261
261
  else if (renderWidth < tableWidth && !isTableWidthFixed) {
262
- const shouldTable100ScaleDown = rendererAppearance === 'comment' && allowTableResizing && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width);
263
262
  scaleDownPercent = calcScalePercent({
264
263
  renderWidth,
265
264
  tableWidth,
266
- maxScale: fg('platform-ssr-table-resize') ? maxScalingPercent : shouldTable100ScaleDown ? 1 : maxScalingPercent,
265
+ maxScale: maxScalingPercent,
267
266
  isNumberColumnEnabled: isNumberColumnEnabled
268
267
  });
269
268
  }
@@ -123,7 +123,6 @@ export const StickyTable = ({
123
123
  tableNode,
124
124
  rendererAppearance,
125
125
  allowTableResizing,
126
- fixTableSSRResizing = false,
127
126
  allowFixedColumnWidthOption
128
127
  }) => {
129
128
  let styles;
@@ -160,7 +159,7 @@ export const StickyTable = ({
160
159
  style: {
161
160
  width: tableWidth,
162
161
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
163
- marginBottom: fixTableSSRResizing ? 0 : ''
162
+ marginBottom: 0
164
163
  }
165
164
  }, jsx("div", {
166
165
  ref: innerRef
@@ -178,7 +177,7 @@ export const StickyTable = ({
178
177
  renderWidth: renderWidth,
179
178
  tableNode: tableNode,
180
179
  rendererAppearance: rendererAppearance,
181
- fixTableSSRResizing: fixTableSSRResizing,
180
+ fixTableSSRResizing: true,
182
181
  allowFixedColumnWidthOption: allowFixedColumnWidthOption
183
182
  },
184
183
  /**
@@ -31,21 +31,10 @@ export const Table = /*#__PURE__*/React.memo(({
31
31
  if (rendererAppearance === 'comment' && allowTableResizing && tableNode && !((_tableNode$attrs = tableNode.attrs) !== null && _tableNode$attrs !== void 0 && _tableNode$attrs.width)) {
32
32
  tableWidth = 'inherit';
33
33
  }
34
- if (rendererAppearance === 'comment' && !allowTableResizing) {
35
- // in the case we have css container stylings,
36
- // we don't need to calculate width here as this
37
- // is done via css
38
- if (!fg('platform-ssr-table-resize')) {
39
- tableWidth = renderWidth;
40
- }
41
- }
42
-
43
34
  // for columns that are evenly distributed, do not return `colgroup` since existing table containerQuery
44
35
  // scales up the columns width. This ensures columns always have 42px.
45
36
  if (rendererAppearance === 'comment') {
46
- if (fg('platform-ssr-table-resize')) {
47
- tableColumnWidths = columnWidths && colWidthSum(columnWidths) ? columnWidths : undefined;
48
- }
37
+ tableColumnWidths = columnWidths && colWidthSum(columnWidths) ? columnWidths : undefined;
49
38
  }
50
39
  const tableLayout = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.layout;
51
40
  const tableDisplayMode = tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.displayMode;