@atlaskit/renderer 117.0.1 → 118.0.0
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 +50 -0
- package/dist/cjs/react/index.js +1 -5
- package/dist/cjs/react/nodes/table/sticky.js +47 -3
- package/dist/cjs/react/nodes/table.js +58 -63
- package/dist/cjs/render-document.js +5 -0
- package/dist/cjs/ui/Expand.js +4 -1
- package/dist/cjs/ui/Renderer/index.js +11 -2
- package/dist/es2019/react/index.js +2 -6
- package/dist/es2019/react/nodes/table/sticky.js +45 -2
- package/dist/es2019/react/nodes/table.js +53 -59
- package/dist/es2019/render-document.js +5 -0
- package/dist/es2019/ui/Expand.js +4 -1
- package/dist/es2019/ui/Renderer/index.js +11 -2
- package/dist/esm/react/index.js +2 -6
- package/dist/esm/react/nodes/table/sticky.js +47 -3
- package/dist/esm/react/nodes/table.js +58 -63
- package/dist/esm/render-document.js +5 -0
- package/dist/esm/ui/Expand.js +4 -1
- package/dist/esm/ui/Renderer/index.js +11 -2
- package/dist/types/react/nodes/table/sticky.d.ts +34 -1
- package/dist/types/react/nodes/table.d.ts +33 -0
- package/dist/types/ui/Renderer/index.d.ts +5 -0
- package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +34 -1
- package/dist/types-ts4.5/react/nodes/table.d.ts +33 -0
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +5 -0
- package/package.json +18 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 118.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#155804](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/155804)
|
|
8
|
+
[`5c9c24138fe0d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5c9c24138fe0d) -
|
|
9
|
+
ENGHEALTH-3649: Set useSpecBasedValidator renderer prop default to true in renderer, it is already
|
|
10
|
+
default to true in editor/editor
|
|
11
|
+
|
|
12
|
+
WHAT the breaking change is: Editor renderer package (editor view mode) has this
|
|
13
|
+
useSpecBasedValidator prop,
|
|
14
|
+
|
|
15
|
+
1. When set to true, it uses the validateADFEntity fn in
|
|
16
|
+
packages/editor/editor-core/src/utils/document.ts to validate a document using the ADF schema
|
|
17
|
+
dynamically
|
|
18
|
+
2. useSpecBasedValidator used to exist for Editor editor (editor edit mode), but it was removed
|
|
19
|
+
and default to use validateADFEntity at least before 14 Aug 2023.
|
|
20
|
+
3. This means any products that are using Editor editor, they have been using validateADFEntity fn
|
|
21
|
+
to validate documents for around 2 years. Any issues with it should be emerged aleady.
|
|
22
|
+
|
|
23
|
+
WHY the change was made
|
|
24
|
+
|
|
25
|
+
1. This useSpecBasedValidator is a deprecated prop for renderer, we already removed it for Editor
|
|
26
|
+
editor, we should do the same for renderer too
|
|
27
|
+
2. There was a situation around 20 April 2024, where a Jira renderer that didn’t have it enabled
|
|
28
|
+
actually caused some media bug in Jira. Thread here:
|
|
29
|
+
https://atlassian.slack.com/archives/CFG3PSQ9E/p1712719739079839
|
|
30
|
+
|
|
31
|
+
HOW a consumer should update their code
|
|
32
|
+
|
|
33
|
+
1. Consumer should not need to do anything other than update their renderer version
|
|
34
|
+
2. To be safe, this change is gated, if anything goes wrong, they can turn off the feature gate
|
|
35
|
+
platform_editor_renderer_rm_usespecbasedvalidator
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
|
|
41
|
+
## 117.1.0
|
|
42
|
+
|
|
43
|
+
### Minor Changes
|
|
44
|
+
|
|
45
|
+
- [#154858](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154858)
|
|
46
|
+
[`bf96267428ccd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf96267428ccd) -
|
|
47
|
+
Adds experiment to not render children of expand element until it gets expanded
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- Updated dependencies
|
|
52
|
+
|
|
3
53
|
## 117.0.1
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -407,11 +407,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
407
407
|
var stickyHeaders = !isInsideOfTable && !(0, _rendererNode.insideBreakoutLayout)(path) ? this.stickyHeaders : undefined;
|
|
408
408
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
409
409
|
allowColumnSorting: this.allowColumnSorting,
|
|
410
|
-
columnWidths:
|
|
411
|
-
// When allowTableResizing is enabled, the number of columns is required to render
|
|
412
|
-
// the same scaling logic as editor. Some tables can have unequal rows, so the entire
|
|
413
|
-
// table needs to be scanned.
|
|
414
|
-
this.allowTableResizing && (0, _platformFeatureFlags.fg)('platform_editor_table_col_calculation_fix') ? (0, _utils.getColumnWidths)(node) : (0, _utils.calcTableColumnWidths)(node),
|
|
410
|
+
columnWidths: (0, _utils.getColumnWidths)(node),
|
|
415
411
|
tableNode: node,
|
|
416
412
|
stickyHeaders: stickyHeaders,
|
|
417
413
|
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
@@ -102,7 +102,9 @@ var StickyTable = exports.StickyTable = function StickyTable(_ref) {
|
|
|
102
102
|
rowHeight = _ref.rowHeight,
|
|
103
103
|
tableNode = _ref.tableNode,
|
|
104
104
|
rendererAppearance = _ref.rendererAppearance,
|
|
105
|
-
allowTableResizing = _ref.allowTableResizing
|
|
105
|
+
allowTableResizing = _ref.allowTableResizing,
|
|
106
|
+
_ref$fixTableSSRResiz = _ref.fixTableSSRResizing,
|
|
107
|
+
fixTableSSRResizing = _ref$fixTableSSRResiz === void 0 ? false : _ref$fixTableSSRResiz;
|
|
106
108
|
var styles;
|
|
107
109
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
108
110
|
if (allowTableResizing) {
|
|
@@ -135,7 +137,9 @@ var StickyTable = exports.StickyTable = function StickyTable(_ref) {
|
|
|
135
137
|
className: "".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, " is-sticky ").concat(shadowClassNames || ''),
|
|
136
138
|
"data-layout": layout,
|
|
137
139
|
style: {
|
|
138
|
-
width: tableWidth
|
|
140
|
+
width: tableWidth,
|
|
141
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
142
|
+
marginBottom: fixTableSSRResizing ? 0 : ''
|
|
139
143
|
}
|
|
140
144
|
}, (0, _react2.jsx)("div", {
|
|
141
145
|
ref: innerRef
|
|
@@ -168,6 +172,9 @@ var StickyTable = exports.StickyTable = function StickyTable(_ref) {
|
|
|
168
172
|
|
|
169
173
|
/**
|
|
170
174
|
* Traverse DOM Tree upwards looking for table parents with "overflow: scroll".
|
|
175
|
+
* @param table
|
|
176
|
+
* @param defaultScrollRootId
|
|
177
|
+
* @example
|
|
171
178
|
*/
|
|
172
179
|
function findHorizontalOverflowScrollParent(table, defaultScrollRootId) {
|
|
173
180
|
var parent = table;
|
|
@@ -191,17 +198,36 @@ function findHorizontalOverflowScrollParent(table, defaultScrollRootId) {
|
|
|
191
198
|
}
|
|
192
199
|
return null;
|
|
193
200
|
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
194
205
|
var OverflowParent = exports.OverflowParent = /*#__PURE__*/function () {
|
|
195
206
|
function OverflowParent(ref) {
|
|
196
207
|
(0, _classCallCheck2.default)(this, OverflowParent);
|
|
197
208
|
this.ref = ref;
|
|
198
209
|
this.ref = ref;
|
|
199
210
|
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
*
|
|
214
|
+
* @param el
|
|
215
|
+
* @param defaultScrollRootId
|
|
216
|
+
* @example
|
|
217
|
+
*/
|
|
200
218
|
return (0, _createClass2.default)(OverflowParent, [{
|
|
201
219
|
key: "isElement",
|
|
202
|
-
get:
|
|
220
|
+
get:
|
|
221
|
+
/**
|
|
222
|
+
*
|
|
223
|
+
*/
|
|
224
|
+
function get() {
|
|
203
225
|
return this.ref instanceof HTMLElement;
|
|
204
226
|
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
*
|
|
230
|
+
*/
|
|
205
231
|
}, {
|
|
206
232
|
key: "id",
|
|
207
233
|
get: function get() {
|
|
@@ -210,6 +236,10 @@ var OverflowParent = exports.OverflowParent = /*#__PURE__*/function () {
|
|
|
210
236
|
}
|
|
211
237
|
return '';
|
|
212
238
|
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
*
|
|
242
|
+
*/
|
|
213
243
|
}, {
|
|
214
244
|
key: "top",
|
|
215
245
|
get: function get() {
|
|
@@ -219,6 +249,13 @@ var OverflowParent = exports.OverflowParent = /*#__PURE__*/function () {
|
|
|
219
249
|
return 0;
|
|
220
250
|
}
|
|
221
251
|
|
|
252
|
+
/**
|
|
253
|
+
*
|
|
254
|
+
* @param type
|
|
255
|
+
* @param cb
|
|
256
|
+
* @param {...any} args
|
|
257
|
+
* @example
|
|
258
|
+
*/
|
|
222
259
|
// Ignored via go/ees005
|
|
223
260
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
224
261
|
}, {
|
|
@@ -233,6 +270,13 @@ var OverflowParent = exports.OverflowParent = /*#__PURE__*/function () {
|
|
|
233
270
|
(_this$ref = this.ref).addEventListener.apply(_this$ref, [type, cb].concat(args));
|
|
234
271
|
}
|
|
235
272
|
|
|
273
|
+
/**
|
|
274
|
+
*
|
|
275
|
+
* @param type
|
|
276
|
+
* @param cb
|
|
277
|
+
* @param {...any} args
|
|
278
|
+
* @example
|
|
279
|
+
*/
|
|
236
280
|
// Ignored via go/ees005
|
|
237
281
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
238
282
|
}, {
|
|
@@ -14,7 +14,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
var _browser = require("@atlaskit/editor-common/browser");
|
|
18
17
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
19
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
20
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -30,7 +29,6 @@ var _sticky = require("./table/sticky");
|
|
|
30
29
|
var _table = require("./table/table");
|
|
31
30
|
var _appearance = require("../utils/appearance");
|
|
32
31
|
var _TableStickyScrollbar = require("./TableStickyScrollbar");
|
|
33
|
-
var _tableNew = require("./tableNew");
|
|
34
32
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
35
33
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
36
34
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -127,6 +125,9 @@ var isHeaderRowEnabled = exports.isHeaderRowEnabled = function isHeaderRowEnable
|
|
|
127
125
|
var tableCanBeSticky = exports.tableCanBeSticky = function tableCanBeSticky(node, children) {
|
|
128
126
|
return isHeaderRowEnabled(children) && node && node.firstChild && !hasRowspan(node.firstChild);
|
|
129
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* Class for Tables in Renderer
|
|
130
|
+
*/
|
|
130
131
|
// Ignored via go/ees005
|
|
131
132
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
132
133
|
var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
@@ -252,7 +253,12 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
252
253
|
(0, _inherits2.default)(TableContainer, _React$Component);
|
|
253
254
|
return (0, _createClass2.default)(TableContainer, [{
|
|
254
255
|
key: "componentDidMount",
|
|
255
|
-
value:
|
|
256
|
+
value:
|
|
257
|
+
/**
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
*/
|
|
261
|
+
function componentDidMount() {
|
|
256
262
|
this.resizeObserver = new ResizeObserver(this.applyResizerChange);
|
|
257
263
|
if (this.wrapperRef.current) {
|
|
258
264
|
this.resizeObserver.observe(this.wrapperRef.current);
|
|
@@ -271,6 +277,13 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
271
277
|
this.stickyScrollbar = new _TableStickyScrollbar.TableStickyScrollbar(this.wrapperRef.current);
|
|
272
278
|
}
|
|
273
279
|
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
*
|
|
283
|
+
* @param prevProps
|
|
284
|
+
* @param prevState
|
|
285
|
+
* @example
|
|
286
|
+
*/
|
|
274
287
|
}, {
|
|
275
288
|
key: "componentDidUpdate",
|
|
276
289
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
@@ -297,12 +310,20 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
297
310
|
}
|
|
298
311
|
}, {
|
|
299
312
|
key: "pinTop",
|
|
300
|
-
get:
|
|
313
|
+
get:
|
|
314
|
+
/**
|
|
315
|
+
*
|
|
316
|
+
*/
|
|
317
|
+
function get() {
|
|
301
318
|
if (!this.tableRef.current || !this.stickyHeaderRef.current) {
|
|
302
319
|
return;
|
|
303
320
|
}
|
|
304
321
|
return this.tableRef.current.offsetHeight - this.stickyHeaderRef.current.offsetHeight + _styles.tableMarginTop - _sticky.tableStickyPadding;
|
|
305
322
|
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
*
|
|
326
|
+
*/
|
|
306
327
|
}, {
|
|
307
328
|
key: "shouldAddOverflowParentOffsetTop_DO_NOT_USE",
|
|
308
329
|
get: function get() {
|
|
@@ -312,6 +333,10 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
312
333
|
// THEN we should add the OverflowParent offset top (RETURN TRUE)
|
|
313
334
|
return this.props.stickyHeaders && !!this.props.stickyHeaders.shouldAddDefaultScrollRootOffsetTop_DO_NOT_USE && !!this.props.stickyHeaders.defaultScrollRootId_DO_NOT_USE && this.overflowParent && this.overflowParent.id === this.props.stickyHeaders.defaultScrollRootId_DO_NOT_USE;
|
|
314
335
|
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
*
|
|
339
|
+
*/
|
|
315
340
|
}, {
|
|
316
341
|
key: "stickyTop",
|
|
317
342
|
get: function get() {
|
|
@@ -330,6 +355,11 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
330
355
|
return undefined;
|
|
331
356
|
}
|
|
332
357
|
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
*/
|
|
333
363
|
}, {
|
|
334
364
|
key: "render",
|
|
335
365
|
value: function render() {
|
|
@@ -383,7 +413,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
383
413
|
var isCommentAppearanceAndTableAlignmentEnabled = (0, _appearance.isCommentAppearance)(rendererAppearance) && allowTableAlignment;
|
|
384
414
|
var lineLength = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
|
|
385
415
|
var lineLengthCSS = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
|
|
386
|
-
var fixTableSSRResizing = (0, _platformFeatureFlags.fg)('platform-
|
|
416
|
+
var fixTableSSRResizing = (0, _platformFeatureFlags.fg)('platform-ssr-table-resize');
|
|
387
417
|
var tableWidthNew = fixTableSSRResizing ? (0, _nodeWidth.getTableContainerWidth)(tableNode) : tableWidth;
|
|
388
418
|
var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
|
|
389
419
|
var leftCSS;
|
|
@@ -481,7 +511,8 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
481
511
|
rowHeight: this.state.headerRowHeight,
|
|
482
512
|
tableNode: tableNode,
|
|
483
513
|
rendererAppearance: rendererAppearance,
|
|
484
|
-
allowTableResizing: allowTableResizing
|
|
514
|
+
allowTableResizing: allowTableResizing,
|
|
515
|
+
fixTableSSRResizing: fixTableSSRResizing
|
|
485
516
|
}, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
|
|
486
517
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
487
518
|
className: _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER,
|
|
@@ -529,6 +560,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
529
560
|
}
|
|
530
561
|
}]);
|
|
531
562
|
}(_react.default.Component);
|
|
563
|
+
/**
|
|
564
|
+
*
|
|
565
|
+
*/
|
|
532
566
|
// Ignored via go/ees005
|
|
533
567
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
534
568
|
var TableProcessor = exports.TableProcessor = /*#__PURE__*/function (_React$Component2) {
|
|
@@ -579,7 +613,12 @@ var TableProcessor = exports.TableProcessor = /*#__PURE__*/function (_React$Comp
|
|
|
579
613
|
(0, _inherits2.default)(TableProcessor, _React$Component2);
|
|
580
614
|
return (0, _createClass2.default)(TableProcessor, [{
|
|
581
615
|
key: "render",
|
|
582
|
-
value:
|
|
616
|
+
value:
|
|
617
|
+
/**
|
|
618
|
+
*
|
|
619
|
+
* @example
|
|
620
|
+
*/
|
|
621
|
+
function render() {
|
|
583
622
|
var children = this.props.children;
|
|
584
623
|
if (!children) {
|
|
585
624
|
return null;
|
|
@@ -595,17 +634,6 @@ var TableProcessor = exports.TableProcessor = /*#__PURE__*/function (_React$Comp
|
|
|
595
634
|
}
|
|
596
635
|
}]);
|
|
597
636
|
}(_react.default.Component); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
598
|
-
var TableWithShadowsAndContainerStyles = (0, _ui.overflowShadow)(_tableNew.TableProcessorWithContainerStyles, {
|
|
599
|
-
/**
|
|
600
|
-
* The :scope is in reference to table container and we are selecting only
|
|
601
|
-
* direct children that match the table node wrapper selector, not their
|
|
602
|
-
* descendants.
|
|
603
|
-
*/
|
|
604
|
-
overflowSelector: ":scope > .".concat(_styles.TableSharedCssClassName.TABLE_NODE_WRAPPER),
|
|
605
|
-
useShadowObserver: true
|
|
606
|
-
});
|
|
607
|
-
|
|
608
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
609
637
|
var TableWithShadows = (0, _ui.overflowShadow)(TableProcessor, {
|
|
610
638
|
/**
|
|
611
639
|
* The :scope is in reference to table container and we are selecting only
|
|
@@ -615,60 +643,27 @@ var TableWithShadows = (0, _ui.overflowShadow)(TableProcessor, {
|
|
|
615
643
|
overflowSelector: ":scope > .".concat(_styles.TableSharedCssClassName.TABLE_NODE_WRAPPER),
|
|
616
644
|
useShadowObserver: true
|
|
617
645
|
});
|
|
618
|
-
|
|
619
|
-
// Legacy tables have only one of the three layouts and do not have a width attribute
|
|
620
|
-
var isLegacyTable = function isLegacyTable(layout) {
|
|
621
|
-
return Boolean(['default', 'wide', 'full-width'].includes(layout));
|
|
622
|
-
};
|
|
623
|
-
var shouldRenderTableWithCSSWidth = function shouldRenderTableWithCSSWidth(layout, width) {
|
|
624
|
-
// The CSS width optimization is currently only in place when the table node
|
|
625
|
-
// has a defined width and is not a legacy table
|
|
626
|
-
|
|
627
|
-
// the optimization is also skipped for Safari due to browser limitations with container styles
|
|
628
|
-
if (_browser.browser.safari || !width || isLegacyTable(layout)) {
|
|
629
|
-
return false;
|
|
630
|
-
}
|
|
631
|
-
return true;
|
|
632
|
-
};
|
|
633
646
|
var TableWithWidth = function TableWithWidth(props) {
|
|
634
|
-
|
|
635
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
636
|
-
if ((shouldRenderTableWithCSSWidth((_props$tableNode$attr = (_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 || (_props$tableNode = _props$tableNode.attrs) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.layout) !== null && _props$tableNode$attr !== void 0 ? _props$tableNode$attr : '', (_props$tableNode2 = props.tableNode) === null || _props$tableNode2 === void 0 || (_props$tableNode2 = _props$tableNode2.attrs) === null || _props$tableNode2 === void 0 ? void 0 : _props$tableNode2.width) || props.rendererAppearance === 'comment') && (0, _platformFeatureFlags.fg)('platform-ssr-table-resize')) {
|
|
647
|
+
return /*#__PURE__*/_react.default.createElement(_ui.WidthConsumer, null, function (_ref2) {
|
|
637
648
|
var _props$columnWidths;
|
|
649
|
+
var width = _ref2.width;
|
|
650
|
+
var renderWidth = props.rendererAppearance === 'full-page' ? width - _style.FullPagePadding * 2 : width;
|
|
638
651
|
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
639
652
|
return total + val;
|
|
640
653
|
}, 0)) || 0;
|
|
641
654
|
if (colWidthsSum || props.allowTableResizing) {
|
|
642
655
|
// Ignored via go/ees005
|
|
643
656
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
644
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
645
|
-
}
|
|
646
|
-
return /*#__PURE__*/_react.default.createElement(_tableNew.TableProcessorWithContainerStyles
|
|
647
|
-
// Ignored via go/ees005
|
|
648
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
649
|
-
, props);
|
|
650
|
-
} else {
|
|
651
|
-
return /*#__PURE__*/_react.default.createElement(_ui.WidthConsumer, null, function (_ref2) {
|
|
652
|
-
var _props$columnWidths2;
|
|
653
|
-
var width = _ref2.width;
|
|
654
|
-
var renderWidth = props.rendererAppearance === 'full-page' ? width - _style.FullPagePadding * 2 : width;
|
|
655
|
-
var colWidthsSum = ((_props$columnWidths2 = props.columnWidths) === null || _props$columnWidths2 === void 0 ? void 0 : _props$columnWidths2.reduce(function (total, val) {
|
|
656
|
-
return total + val;
|
|
657
|
-
}, 0)) || 0;
|
|
658
|
-
if (colWidthsSum || props.allowTableResizing) {
|
|
659
|
-
// Ignored via go/ees005
|
|
660
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
661
|
-
return /*#__PURE__*/_react.default.createElement(TableWithShadows, (0, _extends2.default)({
|
|
662
|
-
renderWidth: renderWidth
|
|
663
|
-
}, props));
|
|
664
|
-
}
|
|
665
|
-
// there should not be a case when colWidthsSum is 0 and table is in overflow state - so no need to render shadows in this case
|
|
666
|
-
return /*#__PURE__*/_react.default.createElement(TableProcessor, (0, _extends2.default)({
|
|
657
|
+
return /*#__PURE__*/_react.default.createElement(TableWithShadows, (0, _extends2.default)({
|
|
667
658
|
renderWidth: renderWidth
|
|
668
|
-
// Ignored via go/ees005
|
|
669
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
670
659
|
}, props));
|
|
671
|
-
}
|
|
672
|
-
|
|
660
|
+
}
|
|
661
|
+
// there should not be a case when colWidthsSum is 0 and table is in overflow state - so no need to render shadows in this case
|
|
662
|
+
return /*#__PURE__*/_react.default.createElement(TableProcessor, (0, _extends2.default)({
|
|
663
|
+
renderWidth: renderWidth
|
|
664
|
+
// Ignored via go/ees005
|
|
665
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
666
|
+
}, props));
|
|
667
|
+
});
|
|
673
668
|
};
|
|
674
669
|
var _default = exports.default = (0, _SmartCardStorage.withSmartCardStorage)(TableWithWidth);
|
|
@@ -212,6 +212,11 @@ var renderDocument = exports.renderDocument = function renderDocument(doc, seria
|
|
|
212
212
|
var stat = {
|
|
213
213
|
sanitizeTime: 0
|
|
214
214
|
};
|
|
215
|
+
|
|
216
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
217
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_renderer_rm_usespecbasedvalidator')) {
|
|
218
|
+
useSpecBasedValidator = true;
|
|
219
|
+
}
|
|
215
220
|
var _withStopwatch = withStopwatch(function () {
|
|
216
221
|
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent, skipValidation);
|
|
217
222
|
}),
|
package/dist/cjs/ui/Expand.js
CHANGED
|
@@ -17,6 +17,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
17
17
|
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right"));
|
|
18
18
|
var _chevronRight2 = _interopRequireDefault(require("@atlaskit/icon/utility/chevron-right"));
|
|
19
19
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
20
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
20
21
|
var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
|
|
21
22
|
var _reactIntlNext = require("react-intl-next");
|
|
22
23
|
var _events = require("../analytics/events");
|
|
@@ -261,6 +262,8 @@ function Expand(_ref) {
|
|
|
261
262
|
className: "".concat(nodeType, "-content-wrapper")
|
|
262
263
|
}, (0, _react.jsx)(_ui.WidthProvider, null, (0, _react.jsx)("div", {
|
|
263
264
|
css: clearNextSiblingMarginTopStyle
|
|
264
|
-
}),
|
|
265
|
+
}), (0, _experiments.editorExperiment)('confluence_p2m_style_recalc_and_expand_joint_exp', true, {
|
|
266
|
+
exposure: true
|
|
267
|
+
}) ? expanded && children : children))));
|
|
265
268
|
}
|
|
266
269
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(Expand);
|
|
@@ -63,7 +63,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
63
63
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
64
64
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
65
65
|
var packageName = "@atlaskit/renderer";
|
|
66
|
-
var packageVersion = "
|
|
66
|
+
var packageVersion = "118.0.0";
|
|
67
67
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
68
68
|
containerName: 'ak-renderer-wrapper',
|
|
69
69
|
containerType: 'inline-size'
|
|
@@ -131,6 +131,9 @@ var handleMouseTripleClickInTables = function handleMouseTripleClickInTables(eve
|
|
|
131
131
|
* link, call the onUnhandledClick eventHandler (which in Jira for example, may switch the
|
|
132
132
|
* renderer out for the editor).
|
|
133
133
|
* @param event Click event anywhere inside renderer
|
|
134
|
+
* @param props
|
|
135
|
+
* @param mouseDownSelection
|
|
136
|
+
* @example
|
|
134
137
|
*/
|
|
135
138
|
var handleWrapperOnClick = function handleWrapperOnClick(event, props, mouseDownSelection) {
|
|
136
139
|
var _props$eventHandlers;
|
|
@@ -479,6 +482,12 @@ var getRendererComponent = function getRendererComponent(nodeComponents) {
|
|
|
479
482
|
}
|
|
480
483
|
return RendererFunctionalComponent;
|
|
481
484
|
};
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
*
|
|
488
|
+
* @param props
|
|
489
|
+
* @example
|
|
490
|
+
*/
|
|
482
491
|
function Renderer(props) {
|
|
483
492
|
var _React$useContext = _react.default.useContext(_annotations.AnnotationsPositionContext),
|
|
484
493
|
startPos = _React$useContext.startPos;
|
|
@@ -624,7 +633,7 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
624
633
|
// Only apply container-type = inline-size when having a known width in full-page/full-width/comment mode.
|
|
625
634
|
// Otherwise when appearance is unspecified the renderer size is decided by the content.
|
|
626
635
|
// In this case we can't set the container-type = inline-size as it will collapse width to 0.
|
|
627
|
-
return appearance === 'comment' &&
|
|
636
|
+
return (appearance === 'full-page' || appearance === 'full-width' || appearance === 'comment') &&
|
|
628
637
|
// In case of having excerpt-include on page there are multiple renderers nested.
|
|
629
638
|
// Make sure only the root renderer is set to be query container.
|
|
630
639
|
isTopLevelRenderer && (0, _platformFeatureFlags.fg)('platform-ssr-table-resize') ? (0, _react2.jsx)("div", {
|
|
@@ -8,7 +8,7 @@ import { Doc, DocWithSelectAllTrap, mergeTextNodes, isTextWrapper, isTextNode, t
|
|
|
8
8
|
import TextWrapperComponent from './nodes/text-wrapper';
|
|
9
9
|
import { toReact as markToReact, isAnnotationMark } from './marks';
|
|
10
10
|
import { getMarksByOrder, isSameMark } from '@atlaskit/editor-common/validator';
|
|
11
|
-
import {
|
|
11
|
+
import { getColumnWidths } from '@atlaskit/editor-common/utils';
|
|
12
12
|
import { getText } from '../utils';
|
|
13
13
|
import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -375,11 +375,7 @@ export default class ReactSerializer {
|
|
|
375
375
|
return {
|
|
376
376
|
...this.getProps(node),
|
|
377
377
|
allowColumnSorting: this.allowColumnSorting,
|
|
378
|
-
columnWidths:
|
|
379
|
-
// When allowTableResizing is enabled, the number of columns is required to render
|
|
380
|
-
// the same scaling logic as editor. Some tables can have unequal rows, so the entire
|
|
381
|
-
// table needs to be scanned.
|
|
382
|
-
this.allowTableResizing && fg('platform_editor_table_col_calculation_fix') ? getColumnWidths(node) : calcTableColumnWidths(node),
|
|
378
|
+
columnWidths: getColumnWidths(node),
|
|
383
379
|
tableNode: node,
|
|
384
380
|
stickyHeaders,
|
|
385
381
|
isInsideOfBlockNode,
|
|
@@ -103,7 +103,8 @@ export const StickyTable = ({
|
|
|
103
103
|
rowHeight,
|
|
104
104
|
tableNode,
|
|
105
105
|
rendererAppearance,
|
|
106
|
-
allowTableResizing
|
|
106
|
+
allowTableResizing,
|
|
107
|
+
fixTableSSRResizing = false
|
|
107
108
|
}) => {
|
|
108
109
|
let styles;
|
|
109
110
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
@@ -137,7 +138,9 @@ export const StickyTable = ({
|
|
|
137
138
|
className: `${TableSharedCssClassName.TABLE_CONTAINER} is-sticky ${shadowClassNames || ''}`,
|
|
138
139
|
"data-layout": layout,
|
|
139
140
|
style: {
|
|
140
|
-
width: tableWidth
|
|
141
|
+
width: tableWidth,
|
|
142
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
143
|
+
marginBottom: fixTableSSRResizing ? 0 : ''
|
|
141
144
|
}
|
|
142
145
|
}, jsx("div", {
|
|
143
146
|
ref: innerRef
|
|
@@ -170,6 +173,9 @@ export const StickyTable = ({
|
|
|
170
173
|
|
|
171
174
|
/**
|
|
172
175
|
* Traverse DOM Tree upwards looking for table parents with "overflow: scroll".
|
|
176
|
+
* @param table
|
|
177
|
+
* @param defaultScrollRootId
|
|
178
|
+
* @example
|
|
173
179
|
*/
|
|
174
180
|
function findHorizontalOverflowScrollParent(table, defaultScrollRootId) {
|
|
175
181
|
let parent = table;
|
|
@@ -193,23 +199,46 @@ function findHorizontalOverflowScrollParent(table, defaultScrollRootId) {
|
|
|
193
199
|
}
|
|
194
200
|
return null;
|
|
195
201
|
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
*
|
|
205
|
+
*/
|
|
196
206
|
export class OverflowParent {
|
|
197
207
|
constructor(ref) {
|
|
198
208
|
this.ref = ref;
|
|
199
209
|
this.ref = ref;
|
|
200
210
|
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
*
|
|
214
|
+
* @param el
|
|
215
|
+
* @param defaultScrollRootId
|
|
216
|
+
* @example
|
|
217
|
+
*/
|
|
201
218
|
static fromElement(el, defaultScrollRootId) {
|
|
202
219
|
return new OverflowParent(findHorizontalOverflowScrollParent(el, defaultScrollRootId) || window);
|
|
203
220
|
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
*
|
|
224
|
+
*/
|
|
204
225
|
get isElement() {
|
|
205
226
|
return this.ref instanceof HTMLElement;
|
|
206
227
|
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
*
|
|
231
|
+
*/
|
|
207
232
|
get id() {
|
|
208
233
|
if (this.ref instanceof HTMLElement) {
|
|
209
234
|
return this.ref.id;
|
|
210
235
|
}
|
|
211
236
|
return '';
|
|
212
237
|
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
*
|
|
241
|
+
*/
|
|
213
242
|
get top() {
|
|
214
243
|
if (this.ref instanceof HTMLElement) {
|
|
215
244
|
return this.ref.getBoundingClientRect().top;
|
|
@@ -217,6 +246,13 @@ export class OverflowParent {
|
|
|
217
246
|
return 0;
|
|
218
247
|
}
|
|
219
248
|
|
|
249
|
+
/**
|
|
250
|
+
*
|
|
251
|
+
* @param type
|
|
252
|
+
* @param cb
|
|
253
|
+
* @param {...any} args
|
|
254
|
+
* @example
|
|
255
|
+
*/
|
|
220
256
|
// Ignored via go/ees005
|
|
221
257
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
222
258
|
addEventListener(type, cb, ...args) {
|
|
@@ -225,6 +261,13 @@ export class OverflowParent {
|
|
|
225
261
|
this.ref.addEventListener(type, cb, ...args);
|
|
226
262
|
}
|
|
227
263
|
|
|
264
|
+
/**
|
|
265
|
+
*
|
|
266
|
+
* @param type
|
|
267
|
+
* @param cb
|
|
268
|
+
* @param {...any} args
|
|
269
|
+
* @example
|
|
270
|
+
*/
|
|
228
271
|
// Ignored via go/ees005
|
|
229
272
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
230
273
|
removeEventListener(type, cb, ...args) {
|