@atlaskit/renderer 108.7.2 → 108.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/react/nodes/table/colgroup.js +5 -4
  3. package/dist/cjs/react/nodes/table/sticky.js +19 -15
  4. package/dist/cjs/react/nodes/table/table.js +4 -2
  5. package/dist/cjs/react/nodes/table.js +13 -5
  6. package/dist/cjs/react/utils/appearance.js +18 -0
  7. package/dist/cjs/ui/Renderer/index.js +1 -1
  8. package/dist/cjs/ui/Renderer/style.js +7 -4
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/react/nodes/table/colgroup.js +6 -4
  11. package/dist/es2019/react/nodes/table/sticky.js +46 -40
  12. package/dist/es2019/react/nodes/table/table.js +4 -2
  13. package/dist/es2019/react/nodes/table.js +9 -4
  14. package/dist/es2019/react/utils/appearance.js +3 -0
  15. package/dist/es2019/ui/Renderer/index.js +1 -1
  16. package/dist/es2019/ui/Renderer/style.js +8 -5
  17. package/dist/es2019/version.json +1 -1
  18. package/dist/esm/react/nodes/table/colgroup.js +6 -4
  19. package/dist/esm/react/nodes/table/sticky.js +19 -15
  20. package/dist/esm/react/nodes/table/table.js +4 -2
  21. package/dist/esm/react/nodes/table.js +11 -4
  22. package/dist/esm/react/utils/appearance.js +9 -0
  23. package/dist/esm/ui/Renderer/index.js +1 -1
  24. package/dist/esm/ui/Renderer/style.js +7 -4
  25. package/dist/esm/version.json +1 -1
  26. package/dist/types/react/nodes/table/sticky.d.ts +4 -1
  27. package/dist/types/react/nodes/table/table.d.ts +1 -1
  28. package/dist/types/react/nodes/table/types.d.ts +2 -0
  29. package/dist/types/react/nodes/table.d.ts +1 -0
  30. package/dist/types/react/utils/appearance.d.ts +4 -0
  31. package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +4 -1
  32. package/dist/types-ts4.5/react/nodes/table/table.d.ts +1 -1
  33. package/dist/types-ts4.5/react/nodes/table/types.d.ts +2 -0
  34. package/dist/types-ts4.5/react/nodes/table.d.ts +1 -0
  35. package/dist/types-ts4.5/react/utils/appearance.d.ts +4 -0
  36. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 108.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e7ed90bad7c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7ed90bad7c) - Use renderer appearance to use custom width
8
+
3
9
  ## 108.7.2
4
10
 
5
11
  ### Patch Changes
@@ -8,8 +8,8 @@ exports.calcScalePercent = exports.Colgroup = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _styles = require("@atlaskit/editor-common/styles");
10
10
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var _nodeWidth = require("@atlaskit/editor-common/node-width");
12
+ var _table = require("../table");
13
13
  // we allow scaling down column widths by no more than 30%
14
14
  // this intends to reduce unwanted scrolling in the Renderer in these scenarios:
15
15
  // User A creates a table with column widths → User B views it on a smaller screen
@@ -58,12 +58,13 @@ var Colgroup = function Colgroup(props) {
58
58
  layout = props.layout,
59
59
  isNumberColumnEnabled = props.isNumberColumnEnabled,
60
60
  renderWidth = props.renderWidth,
61
- tableNode = props.tableNode;
61
+ tableNode = props.tableNode,
62
+ rendererAppearance = props.rendererAppearance;
62
63
  if (!columnWidths) {
63
64
  return null;
64
65
  }
65
66
  var tableResized = isTableResized(columnWidths);
66
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && !tableResized) {
67
+ if ((0, _table.isTableResizingEnabled)(rendererAppearance) && !tableResized) {
67
68
  return /*#__PURE__*/_react.default.createElement("colgroup", null, isNumberColumnEnabled && /*#__PURE__*/_react.default.createElement("col", {
68
69
  style: {
69
70
  width: _editorSharedStyles.akEditorTableNumberColumnWidth
@@ -80,7 +81,7 @@ var Colgroup = function Colgroup(props) {
80
81
  return null;
81
82
  }
82
83
  var tableContainerWidth;
83
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && tableNode) {
84
+ if ((0, _table.isTableResizingEnabled)(rendererAppearance) && tableNode) {
84
85
  tableContainerWidth = (0, _nodeWidth.getTableContainerWidth)(tableNode);
85
86
  } else {
86
87
  tableContainerWidth = getTableLayoutWidth(layout);
@@ -14,9 +14,9 @@ var _react2 = require("@emotion/react");
14
14
  var _styles = require("@atlaskit/editor-common/styles");
15
15
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
16
16
  var _colors = require("@atlaskit/theme/colors");
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
17
  var _table = require("./table");
19
18
  var _injectProps = require("../../utils/inject-props");
19
+ var _table2 = require("../table");
20
20
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
21
21
  /** @jsx jsx */
22
22
  var tableStickyPadding = 8;
@@ -26,22 +26,23 @@ var modeSpecficStyles = {
26
26
  stick: (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: fixed;\n "]))),
27
27
  'pin-bottom': (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n "])))
28
28
  };
29
- var stickyHeaderZIndex;
30
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width')) {
31
- stickyHeaderZIndex = 13;
32
- } else {
33
- stickyHeaderZIndex = _editorSharedStyles.akEditorStickyHeaderZIndex;
34
- }
35
29
 
36
30
  // TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4123
37
- var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width) {
38
- return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n tr {\n background: ", ";\n }\n }\n\n border-top: ", "px solid\n ", ";\n background: ", ";\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".is-sticky.right-shadow::after,\n &\n .", ".is-sticky.left-shadow::before {\n top: 0px;\n height: 100%;\n }\n"])), typeof top === 'number' && "top: ".concat(top, "px;"), width, stickyHeaderZIndex, _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-surface, white)", tableStickyPadding, "var(--ds-surface, white)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overflow-perimeter, ".concat(_colors.N40A, ")"), _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_CONTAINER);
31
+ var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, rendererAppearance) {
32
+ var stickyHeaderZIndex;
33
+ if ((0, _table2.isTableResizingEnabled)(rendererAppearance)) {
34
+ stickyHeaderZIndex = 13;
35
+ } else {
36
+ stickyHeaderZIndex = _editorSharedStyles.akEditorStickyHeaderZIndex;
37
+ }
38
+ return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n tr {\n background: ", ";\n }\n }\n\n border-top: ", "px solid\n ", ";\n background: ", ";\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".is-sticky.right-shadow::after,\n &\n .", ".is-sticky.left-shadow::before {\n top: 0px;\n height: 100%;\n }\n "])), typeof top === 'number' && "top: ".concat(top, "px;"), width, stickyHeaderZIndex, _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-surface, white)", tableStickyPadding, "var(--ds-surface, white)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overflow-perimeter, ".concat(_colors.N40A, ")"), _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_CONTAINER);
39
39
  };
40
40
  var FixedTableDiv = function FixedTableDiv(props) {
41
41
  var top = props.top,
42
42
  wrapperWidth = props.wrapperWidth,
43
- mode = props.mode;
44
- var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
43
+ mode = props.mode,
44
+ rendererAppearance = props.rendererAppearance;
45
+ var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth, rendererAppearance), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
45
46
  var attrs = {
46
47
  mode: mode
47
48
  };
@@ -65,10 +66,11 @@ var StickyTable = function StickyTable(_ref) {
65
66
  columnWidths = _ref.columnWidths,
66
67
  renderWidth = _ref.renderWidth,
67
68
  rowHeight = _ref.rowHeight,
68
- tableNode = _ref.tableNode;
69
+ tableNode = _ref.tableNode,
70
+ rendererAppearance = _ref.rendererAppearance;
69
71
  var styles;
70
72
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
71
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width')) {
73
+ if ((0, _table2.isTableResizingEnabled)(rendererAppearance)) {
72
74
  styles = (0, _react2.css)({
73
75
  top: mode === 'pin-bottom' ? top : undefined,
74
76
  position: 'relative'
@@ -86,7 +88,8 @@ var StickyTable = function StickyTable(_ref) {
86
88
  }, (0, _react2.jsx)(FixedTableDiv, {
87
89
  top: mode === 'stick' ? top : undefined,
88
90
  mode: rowHeight > 300 ? 'none' : mode,
89
- wrapperWidth: wrapperWidth
91
+ wrapperWidth: wrapperWidth,
92
+ rendererAppearance: rendererAppearance
90
93
  }, (0, _react2.jsx)("div", {
91
94
  className: "".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, " is-sticky ").concat(shadowClassNames || ''),
92
95
  "data-layout": layout,
@@ -104,7 +107,8 @@ var StickyTable = function StickyTable(_ref) {
104
107
  layout: layout,
105
108
  isNumberColumnEnabled: isNumberColumnEnabled,
106
109
  renderWidth: renderWidth,
107
- tableNode: tableNode
110
+ tableNode: tableNode,
111
+ rendererAppearance: rendererAppearance
108
112
  },
109
113
  /**
110
114
  * @see https://product-fabric.atlassian.net/browse/ED-10235
@@ -14,7 +14,8 @@ var Table = /*#__PURE__*/_react.default.memo(function (_ref) {
14
14
  layout = _ref.layout,
15
15
  renderWidth = _ref.renderWidth,
16
16
  children = _ref.children,
17
- tableNode = _ref.tableNode;
17
+ tableNode = _ref.tableNode,
18
+ rendererAppearance = _ref.rendererAppearance;
18
19
  return /*#__PURE__*/_react.default.createElement("table", {
19
20
  "data-number-column": isNumberColumnEnabled,
20
21
  ref: innerRef
@@ -23,7 +24,8 @@ var Table = /*#__PURE__*/_react.default.memo(function (_ref) {
23
24
  layout: layout,
24
25
  isNumberColumnEnabled: isNumberColumnEnabled,
25
26
  renderWidth: renderWidth,
26
- tableNode: tableNode
27
+ tableNode: tableNode,
28
+ rendererAppearance: rendererAppearance
27
29
  }), /*#__PURE__*/_react.default.createElement("tbody", null, children));
28
30
  });
29
31
  exports.Table = Table;
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = exports.TableProcessor = exports.TableContainer = void 0;
7
+ exports.isTableResizingEnabled = exports.default = exports.TableProcessor = exports.TableContainer = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -26,8 +26,13 @@ var _tableCell = require("./tableCell");
26
26
  var _SmartCardStorage = require("../../ui/SmartCardStorage");
27
27
  var _sticky = require("./table/sticky");
28
28
  var _table = require("./table/table");
29
+ var _appearance = require("../utils/appearance");
29
30
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
30
31
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
32
+ var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
33
+ return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && (0, _appearance.isFullWidthOrFullPageAppearance)(appearance);
34
+ };
35
+ exports.isTableResizingEnabled = isTableResizingEnabled;
31
36
  var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
32
37
  if (!tableOrderStatus || tableOrderStatus.order === _types.SortOrder.NO_ORDER) {
33
38
  return children;
@@ -261,7 +266,7 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
261
266
  var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance) {
262
267
  return rendererAppearance === 'full-width' && !tableNode.attrs.width ? Math.min(_editorSharedStyles.akEditorFullWidthLayoutWidth, renderWidth) : Math.min((0, _nodeWidth.getTableContainerWidth)(tableNode), renderWidth);
263
268
  };
264
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && tableNode) {
269
+ if (isTableResizingEnabled(rendererAppearance) && tableNode) {
265
270
  tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
266
271
  } else {
267
272
  tableWidth = (0, _styles.calcTableWidth)(layout, renderWidth, false);
@@ -284,7 +289,8 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
284
289
  innerRef: this.stickyWrapperRef,
285
290
  wrapperWidth: wrapperWidth,
286
291
  columnWidths: columnWidths,
287
- rowHeight: this.headerRowHeight
292
+ rowHeight: this.headerRowHeight,
293
+ rendererAppearance: rendererAppearance
288
294
  }, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
289
295
  className: "".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
290
296
  "data-layout": layout,
@@ -306,7 +312,8 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
306
312
  wrapperWidth: wrapperWidth,
307
313
  columnWidths: columnWidths,
308
314
  rowHeight: this.headerRowHeight,
309
- tableNode: tableNode
315
+ tableNode: tableNode,
316
+ rendererAppearance: rendererAppearance
310
317
  }, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
311
318
  className: _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER,
312
319
  ref: this.wrapperRef,
@@ -317,7 +324,8 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
317
324
  layout: layout,
318
325
  isNumberColumnEnabled: isNumberColumnEnabled,
319
326
  renderWidth: renderWidth,
320
- tableNode: tableNode
327
+ tableNode: tableNode,
328
+ rendererAppearance: rendererAppearance
321
329
  }, this.grabFirstRowRef(children)))));
322
330
  }
323
331
  }]);
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isFullWidthOrFullPageAppearance = exports.isFullWidthAppearance = exports.isFullPageAppearance = void 0;
7
+ var isFullWidthAppearance = function isFullWidthAppearance(appearance) {
8
+ return appearance === 'full-width';
9
+ };
10
+ exports.isFullWidthAppearance = isFullWidthAppearance;
11
+ var isFullPageAppearance = function isFullPageAppearance(appearance) {
12
+ return appearance === 'full-page';
13
+ };
14
+ exports.isFullPageAppearance = isFullPageAppearance;
15
+ var isFullWidthOrFullPageAppearance = function isFullWidthOrFullPageAppearance(appearance) {
16
+ return isFullPageAppearance(appearance) || isFullWidthAppearance(appearance);
17
+ };
18
+ exports.isFullWidthOrFullPageAppearance = isFullWidthOrFullPageAppearance;
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
55
55
  var DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
57
57
  var packageName = "@atlaskit/renderer";
58
- var packageVersion = "108.7.2";
58
+ var packageVersion = "108.7.3";
59
59
  var Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -12,7 +12,6 @@ var _components = require("@atlaskit/theme/components");
12
12
  var _constants = require("@atlaskit/theme/constants");
13
13
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
14
14
  var _typography = require("@atlaskit/theme/typography");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _styles = require("@atlaskit/editor-common/styles");
17
16
  var _ui = require("@atlaskit/editor-common/ui");
18
17
  var _utils = require("@atlaskit/editor-common/utils");
@@ -20,6 +19,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
20
19
  var _consts = require("../../consts");
21
20
  var _headingAnchor = require("../../react/nodes/heading-anchor");
22
21
  var _lightWeightCodeBlock = require("../../react/nodes/codeBlock/components/lightWeightCodeBlock");
22
+ var _table = require("../../react/nodes/table");
23
23
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
24
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -50,14 +50,17 @@ var headingSizes = {
50
50
  };
51
51
  exports.headingSizes = headingSizes;
52
52
  var headingAnchorStyle = function headingAnchorStyle(headingTag) {
53
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: 6px;\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), _headingAnchor.HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, _headingAnchor.HeadingAnchorWrapperClassName, _headingAnchor.HeadingAnchorWrapperClassName);
53
+ return (// TODO Delete this comment after verifying space token -> previous value `margin-left: 6px`
54
+ (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: ", ";\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), _headingAnchor.HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, "var(--ds-space-075, 6px)", _headingAnchor.HeadingAnchorWrapperClassName, _headingAnchor.HeadingAnchorWrapperClassName)
55
+ );
54
56
  };
55
57
  var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
56
58
  var allowNestedHeaderLinks = _ref.allowNestedHeaderLinks;
57
59
  if (!allowNestedHeaderLinks) {
58
60
  return '';
59
61
  }
60
- return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "], ["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "])), _headingAnchor.HeadingAnchorWrapperClassName, _headingAnchor.HeadingAnchorWrapperClassName, _headingAnchor.HeadingAnchorWrapperClassName);
62
+ // TODO Delete this comment after verifying space token -> previous value `margin: 6px`
63
+ return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 ", " 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "], ["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 ", " 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "])), _headingAnchor.HeadingAnchorWrapperClassName, _headingAnchor.HeadingAnchorWrapperClassName, "var(--ds-space-075, 6px)", _headingAnchor.HeadingAnchorWrapperClassName);
61
64
  };
62
65
  var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
63
66
  var allowColumnSorting = _ref2.allowColumnSorting,
@@ -84,7 +87,7 @@ var fullWidthStyles = function fullWidthStyles(_ref5) {
84
87
  if (appearance !== 'full-width') {
85
88
  return '';
86
89
  }
87
- return (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .ak-renderer-extension {\n width: 100% !important;\n }\n\n ", "\n "])), _editorSharedStyles.akEditorFullWidthLayoutWidth, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
90
+ return (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .ak-renderer-extension {\n width: 100% !important;\n }\n\n ", "\n "])), _editorSharedStyles.akEditorFullWidthLayoutWidth, (0, _table.isTableResizingEnabled)(appearance) ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
88
91
  };
89
92
  var breakoutWidthStyle = function breakoutWidthStyle(useFragmentMarkBreakoutWidthStylingFix) {
90
93
  if (useFragmentMarkBreakoutWidthStylingFix) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.7.2",
3
+ "version": "108.7.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { akEditorTableNumberColumnWidth, akEditorWideLayoutWidth, akEditorFullWidthLayoutWidth, akEditorTableLegacyCellMinWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
4
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
5
+ import { isTableResizingEnabled } from '../table';
6
+
6
7
  // we allow scaling down column widths by no more than 30%
7
8
  // this intends to reduce unwanted scrolling in the Renderer in these scenarios:
8
9
  // User A creates a table with column widths → User B views it on a smaller screen
@@ -50,13 +51,14 @@ export const Colgroup = props => {
50
51
  layout,
51
52
  isNumberColumnEnabled,
52
53
  renderWidth,
53
- tableNode
54
+ tableNode,
55
+ rendererAppearance
54
56
  } = props;
55
57
  if (!columnWidths) {
56
58
  return null;
57
59
  }
58
60
  const tableResized = isTableResized(columnWidths);
59
- if (getBooleanFF('platform.editor.custom-table-width') && !tableResized) {
61
+ if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
60
62
  return /*#__PURE__*/React.createElement("colgroup", null, isNumberColumnEnabled && /*#__PURE__*/React.createElement("col", {
61
63
  style: {
62
64
  width: akEditorTableNumberColumnWidth
@@ -71,7 +73,7 @@ export const Colgroup = props => {
71
73
  return null;
72
74
  }
73
75
  let tableContainerWidth;
74
- if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
76
+ if (isTableResizingEnabled(rendererAppearance) && tableNode) {
75
77
  tableContainerWidth = getTableContainerWidth(tableNode);
76
78
  } else {
77
79
  tableContainerWidth = getTableLayoutWidth(layout);
@@ -5,9 +5,9 @@ import { css, jsx } from '@emotion/react';
5
5
  import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
6
6
  import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
7
7
  import { N40A } from '@atlaskit/theme/colors';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
8
  import { Table } from './table';
10
9
  import { recursivelyInjectProps } from '../../utils/inject-props';
10
+ import { isTableResizingEnabled } from '../table';
11
11
  export const tableStickyPadding = 8;
12
12
  const modeSpecficStyles = {
13
13
  none: css`
@@ -20,54 +20,57 @@ const modeSpecficStyles = {
20
20
  position: absolute;
21
21
  `
22
22
  };
23
- let stickyHeaderZIndex;
24
- if (getBooleanFF('platform.editor.custom-table-width')) {
25
- stickyHeaderZIndex = 13;
26
- } else {
27
- stickyHeaderZIndex = akEditorStickyHeaderZIndex;
28
- }
29
23
 
30
24
  // TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4123
31
- const fixedTableDivStaticStyles = (top, width) => css`
32
- ${typeof top === 'number' && `top: ${top}px;`}
33
- width: ${width}px;
34
- z-index: ${stickyHeaderZIndex};
35
- &
36
- .${TableSharedCssClassName.TABLE_CONTAINER},
25
+ const fixedTableDivStaticStyles = (top, width, rendererAppearance) => {
26
+ let stickyHeaderZIndex;
27
+ if (isTableResizingEnabled(rendererAppearance)) {
28
+ stickyHeaderZIndex = 13;
29
+ } else {
30
+ stickyHeaderZIndex = akEditorStickyHeaderZIndex;
31
+ }
32
+ return css`
33
+ ${typeof top === 'number' && `top: ${top}px;`}
34
+ width: ${width}px;
35
+ z-index: ${stickyHeaderZIndex};
37
36
  &
38
- .${TableSharedCssClassName.TABLE_STICKY_WRAPPER}
39
- > table {
40
- margin-top: 0;
41
- margin-bottom: 0;
42
- tr {
43
- background: ${"var(--ds-surface, white)"};
37
+ .${TableSharedCssClassName.TABLE_CONTAINER},
38
+ &
39
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER}
40
+ > table {
41
+ margin-top: 0;
42
+ margin-bottom: 0;
43
+ tr {
44
+ background: ${"var(--ds-surface, white)"};
45
+ }
44
46
  }
45
- }
46
47
 
47
- border-top: ${tableStickyPadding}px solid
48
- ${"var(--ds-surface, white)"};
49
- background: ${"var(--ds-surface-overlay, white)"};
50
- box-shadow: 0 6px 4px -4px ${`var(--ds-shadow-overflow-perimeter, ${N40A})`};
48
+ border-top: ${tableStickyPadding}px solid
49
+ ${"var(--ds-surface, white)"};
50
+ background: ${"var(--ds-surface-overlay, white)"};
51
+ box-shadow: 0 6px 4px -4px ${`var(--ds-shadow-overflow-perimeter, ${N40A})`};
51
52
 
52
- div[data-expanded='false'] & {
53
- display: none;
54
- }
53
+ div[data-expanded='false'] & {
54
+ display: none;
55
+ }
55
56
 
56
- &
57
- .${TableSharedCssClassName.TABLE_CONTAINER}.is-sticky.right-shadow::after,
58
57
  &
59
- .${TableSharedCssClassName.TABLE_CONTAINER}.is-sticky.left-shadow::before {
60
- top: 0px;
61
- height: 100%;
62
- }
63
- `;
58
+ .${TableSharedCssClassName.TABLE_CONTAINER}.is-sticky.right-shadow::after,
59
+ &
60
+ .${TableSharedCssClassName.TABLE_CONTAINER}.is-sticky.left-shadow::before {
61
+ top: 0px;
62
+ height: 100%;
63
+ }
64
+ `;
65
+ };
64
66
  export const FixedTableDiv = props => {
65
67
  const {
66
68
  top,
67
69
  wrapperWidth,
68
- mode
70
+ mode,
71
+ rendererAppearance
69
72
  } = props;
70
- const fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
73
+ const fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth, rendererAppearance), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
71
74
  const attrs = {
72
75
  mode
73
76
  };
@@ -90,11 +93,12 @@ export const StickyTable = ({
90
93
  columnWidths,
91
94
  renderWidth,
92
95
  rowHeight,
93
- tableNode
96
+ tableNode,
97
+ rendererAppearance
94
98
  }) => {
95
99
  let styles;
96
100
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
97
- if (getBooleanFF('platform.editor.custom-table-width')) {
101
+ if (isTableResizingEnabled(rendererAppearance)) {
98
102
  styles = css({
99
103
  top: mode === 'pin-bottom' ? top : undefined,
100
104
  position: 'relative'
@@ -112,7 +116,8 @@ export const StickyTable = ({
112
116
  }, jsx(FixedTableDiv, {
113
117
  top: mode === 'stick' ? top : undefined,
114
118
  mode: rowHeight > 300 ? 'none' : mode,
115
- wrapperWidth: wrapperWidth
119
+ wrapperWidth: wrapperWidth,
120
+ rendererAppearance: rendererAppearance
116
121
  }, jsx("div", {
117
122
  className: `${TableSharedCssClassName.TABLE_CONTAINER} is-sticky ${shadowClassNames || ''}`,
118
123
  "data-layout": layout,
@@ -130,7 +135,8 @@ export const StickyTable = ({
130
135
  layout: layout,
131
136
  isNumberColumnEnabled: isNumberColumnEnabled,
132
137
  renderWidth: renderWidth,
133
- tableNode: tableNode
138
+ tableNode: tableNode,
139
+ rendererAppearance: rendererAppearance
134
140
  },
135
141
  /**
136
142
  * @see https://product-fabric.atlassian.net/browse/ED-10235
@@ -7,7 +7,8 @@ export const Table = /*#__PURE__*/React.memo(({
7
7
  layout,
8
8
  renderWidth,
9
9
  children,
10
- tableNode
10
+ tableNode,
11
+ rendererAppearance
11
12
  }) => {
12
13
  return /*#__PURE__*/React.createElement("table", {
13
14
  "data-number-column": isNumberColumnEnabled,
@@ -17,6 +18,7 @@ export const Table = /*#__PURE__*/React.memo(({
17
18
  layout: layout,
18
19
  isNumberColumnEnabled: isNumberColumnEnabled,
19
20
  renderWidth: renderWidth,
20
- tableNode: tableNode
21
+ tableNode: tableNode,
22
+ rendererAppearance: rendererAppearance
21
23
  }), /*#__PURE__*/React.createElement("tbody", null, children));
22
24
  });
@@ -14,6 +14,8 @@ import { TableHeader } from './tableCell';
14
14
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
15
15
  import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
16
16
  import { Table } from './table/table';
17
+ import { isFullWidthOrFullPageAppearance } from '../utils/appearance';
18
+ export const isTableResizingEnabled = appearance => getBooleanFF('platform.editor.custom-table-width') && isFullWidthOrFullPageAppearance(appearance);
17
19
  const orderChildren = (children, tableNode, smartCardStorage, tableOrderStatus) => {
18
20
  if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
19
21
  return children;
@@ -221,7 +223,7 @@ export class TableContainer extends React.Component {
221
223
  const calcDefaultLayoutWidthByAppearance = (tableNode, rendererAppearance) => {
222
224
  return rendererAppearance === 'full-width' && !tableNode.attrs.width ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : Math.min(getTableContainerWidth(tableNode), renderWidth);
223
225
  };
224
- if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
226
+ if (isTableResizingEnabled(rendererAppearance) && tableNode) {
225
227
  tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
226
228
  } else {
227
229
  tableWidth = calcTableWidth(layout, renderWidth, false);
@@ -244,7 +246,8 @@ export class TableContainer extends React.Component {
244
246
  innerRef: this.stickyWrapperRef,
245
247
  wrapperWidth: wrapperWidth,
246
248
  columnWidths: columnWidths,
247
- rowHeight: this.headerRowHeight
249
+ rowHeight: this.headerRowHeight,
250
+ rendererAppearance: rendererAppearance
248
251
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
249
252
  className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames || ''}`,
250
253
  "data-layout": layout,
@@ -266,7 +269,8 @@ export class TableContainer extends React.Component {
266
269
  wrapperWidth: wrapperWidth,
267
270
  columnWidths: columnWidths,
268
271
  rowHeight: this.headerRowHeight,
269
- tableNode: tableNode
272
+ tableNode: tableNode,
273
+ rendererAppearance: rendererAppearance
270
274
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
271
275
  className: TableSharedCssClassName.TABLE_NODE_WRAPPER,
272
276
  ref: this.wrapperRef,
@@ -277,7 +281,8 @@ export class TableContainer extends React.Component {
277
281
  layout: layout,
278
282
  isNumberColumnEnabled: isNumberColumnEnabled,
279
283
  renderWidth: renderWidth,
280
- tableNode: tableNode
284
+ tableNode: tableNode,
285
+ rendererAppearance: rendererAppearance
281
286
  }, this.grabFirstRowRef(children)))));
282
287
  }
283
288
  }
@@ -0,0 +1,3 @@
1
+ export const isFullWidthAppearance = appearance => appearance === 'full-width';
2
+ export const isFullPageAppearance = appearance => appearance === 'full-page';
3
+ export const isFullWidthOrFullPageAppearance = appearance => isFullPageAppearance(appearance) || isFullWidthAppearance(appearance);
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
35
35
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
36
36
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
37
37
  const packageName = "@atlaskit/renderer";
38
- const packageVersion = "108.7.2";
38
+ const packageVersion = "108.7.3";
39
39
  export class Renderer extends PureComponent {
40
40
  constructor(props) {
41
41
  super(props);
@@ -3,7 +3,6 @@ import { themed } from '@atlaskit/theme/components';
3
3
  import { fontFamily, fontSize } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
5
  import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
6
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
6
  import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
8
7
  import { shadowClassNames } from '@atlaskit/editor-common/ui';
9
8
  import { browser } from '@atlaskit/editor-common/utils';
@@ -12,6 +11,7 @@ import { RendererCssClassName } from '../../consts';
12
11
  import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
13
12
  import { shadowObserverClassNames } from '@atlaskit/editor-common/ui';
14
13
  import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
14
+ import { isTableResizingEnabled } from '../../react/nodes/table';
15
15
  export const FullPagePadding = 32;
16
16
  const getLineHeight = fontCode => headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
17
17
  export const headingSizes = {
@@ -34,7 +34,9 @@ export const headingSizes = {
34
34
  lineHeight: getLineHeight('h100')
35
35
  }
36
36
  };
37
- const headingAnchorStyle = headingTag => css`
37
+ const headingAnchorStyle = headingTag =>
38
+ // TODO Delete this comment after verifying space token -> previous value `margin-left: 6px`
39
+ css`
38
40
  /**
39
41
  * The copy link button doesn't reserve space in the DOM so that
40
42
  * the text alignment isn't impacted by the button/icon's space.
@@ -43,7 +45,7 @@ const headingAnchorStyle = headingTag => css`
43
45
  position: absolute;
44
46
  height: ${headingSizes[headingTag].lineHeight}em;
45
47
 
46
- margin-left: 6px;
48
+ margin-left: ${"var(--ds-space-075, 6px)"};
47
49
 
48
50
  button {
49
51
  padding-left: 0;
@@ -83,6 +85,7 @@ const alignedHeadingAnchorStyle = ({
83
85
  if (!allowNestedHeaderLinks) {
84
86
  return '';
85
87
  }
88
+ // TODO Delete this comment after verifying space token -> previous value `margin: 6px`
86
89
  return css`
87
90
  .fabric-editor-block-mark[data-align] > {
88
91
  h1,
@@ -134,7 +137,7 @@ const alignedHeadingAnchorStyle = ({
134
137
  }
135
138
  }
136
139
  .${HeadingAnchorWrapperClassName} {
137
- margin: 0 6px 0 0;
140
+ margin: 0 ${"var(--ds-space-075, 6px)"} 0 0;
138
141
  }
139
142
 
140
143
  @media (hover: hover) and (pointer: fine) {
@@ -272,7 +275,7 @@ const fullWidthStyles = ({
272
275
  width: 100% !important;
273
276
  }
274
277
 
275
- ${getBooleanFF('platform.editor.custom-table-width') ? '' : `
278
+ ${isTableResizingEnabled(appearance) ? '' : `
276
279
  .pm-table-container {
277
280
  width: 100% !important;
278
281
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.7.2",
3
+ "version": "108.7.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { akEditorTableNumberColumnWidth, akEditorWideLayoutWidth, akEditorFullWidthLayoutWidth, akEditorTableLegacyCellMinWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
4
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
5
+ import { isTableResizingEnabled } from '../table';
6
+
6
7
  // we allow scaling down column widths by no more than 30%
7
8
  // this intends to reduce unwanted scrolling in the Renderer in these scenarios:
8
9
  // User A creates a table with column widths → User B views it on a smaller screen
@@ -50,12 +51,13 @@ export var Colgroup = function Colgroup(props) {
50
51
  layout = props.layout,
51
52
  isNumberColumnEnabled = props.isNumberColumnEnabled,
52
53
  renderWidth = props.renderWidth,
53
- tableNode = props.tableNode;
54
+ tableNode = props.tableNode,
55
+ rendererAppearance = props.rendererAppearance;
54
56
  if (!columnWidths) {
55
57
  return null;
56
58
  }
57
59
  var tableResized = isTableResized(columnWidths);
58
- if (getBooleanFF('platform.editor.custom-table-width') && !tableResized) {
60
+ if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
59
61
  return /*#__PURE__*/React.createElement("colgroup", null, isNumberColumnEnabled && /*#__PURE__*/React.createElement("col", {
60
62
  style: {
61
63
  width: akEditorTableNumberColumnWidth
@@ -72,7 +74,7 @@ export var Colgroup = function Colgroup(props) {
72
74
  return null;
73
75
  }
74
76
  var tableContainerWidth;
75
- if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
77
+ if (isTableResizingEnabled(rendererAppearance) && tableNode) {
76
78
  tableContainerWidth = getTableContainerWidth(tableNode);
77
79
  } else {
78
80
  tableContainerWidth = getTableLayoutWidth(layout);
@@ -9,31 +9,32 @@ import { css, jsx } from '@emotion/react';
9
9
  import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
10
10
  import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
11
11
  import { N40A } from '@atlaskit/theme/colors';
12
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
13
12
  import { Table } from './table';
14
13
  import { recursivelyInjectProps } from '../../utils/inject-props';
14
+ import { isTableResizingEnabled } from '../table';
15
15
  export var tableStickyPadding = 8;
16
16
  var modeSpecficStyles = {
17
17
  none: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n "]))),
18
18
  stick: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: fixed;\n "]))),
19
19
  'pin-bottom': css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n "])))
20
20
  };
21
- var stickyHeaderZIndex;
22
- if (getBooleanFF('platform.editor.custom-table-width')) {
23
- stickyHeaderZIndex = 13;
24
- } else {
25
- stickyHeaderZIndex = akEditorStickyHeaderZIndex;
26
- }
27
21
 
28
22
  // TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4123
29
- var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width) {
30
- return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n tr {\n background: ", ";\n }\n }\n\n border-top: ", "px solid\n ", ";\n background: ", ";\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".is-sticky.right-shadow::after,\n &\n .", ".is-sticky.left-shadow::before {\n top: 0px;\n height: 100%;\n }\n"])), typeof top === 'number' && "top: ".concat(top, "px;"), width, stickyHeaderZIndex, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-surface, white)", tableStickyPadding, "var(--ds-surface, white)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
23
+ var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, rendererAppearance) {
24
+ var stickyHeaderZIndex;
25
+ if (isTableResizingEnabled(rendererAppearance)) {
26
+ stickyHeaderZIndex = 13;
27
+ } else {
28
+ stickyHeaderZIndex = akEditorStickyHeaderZIndex;
29
+ }
30
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n tr {\n background: ", ";\n }\n }\n\n border-top: ", "px solid\n ", ";\n background: ", ";\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".is-sticky.right-shadow::after,\n &\n .", ".is-sticky.left-shadow::before {\n top: 0px;\n height: 100%;\n }\n "])), typeof top === 'number' && "top: ".concat(top, "px;"), width, stickyHeaderZIndex, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-surface, white)", tableStickyPadding, "var(--ds-surface, white)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
31
31
  };
32
32
  export var FixedTableDiv = function FixedTableDiv(props) {
33
33
  var top = props.top,
34
34
  wrapperWidth = props.wrapperWidth,
35
- mode = props.mode;
36
- var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
35
+ mode = props.mode,
36
+ rendererAppearance = props.rendererAppearance;
37
+ var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth, rendererAppearance), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
37
38
  var attrs = {
38
39
  mode: mode
39
40
  };
@@ -56,10 +57,11 @@ export var StickyTable = function StickyTable(_ref) {
56
57
  columnWidths = _ref.columnWidths,
57
58
  renderWidth = _ref.renderWidth,
58
59
  rowHeight = _ref.rowHeight,
59
- tableNode = _ref.tableNode;
60
+ tableNode = _ref.tableNode,
61
+ rendererAppearance = _ref.rendererAppearance;
60
62
  var styles;
61
63
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
62
- if (getBooleanFF('platform.editor.custom-table-width')) {
64
+ if (isTableResizingEnabled(rendererAppearance)) {
63
65
  styles = css({
64
66
  top: mode === 'pin-bottom' ? top : undefined,
65
67
  position: 'relative'
@@ -77,7 +79,8 @@ export var StickyTable = function StickyTable(_ref) {
77
79
  }, jsx(FixedTableDiv, {
78
80
  top: mode === 'stick' ? top : undefined,
79
81
  mode: rowHeight > 300 ? 'none' : mode,
80
- wrapperWidth: wrapperWidth
82
+ wrapperWidth: wrapperWidth,
83
+ rendererAppearance: rendererAppearance
81
84
  }, jsx("div", {
82
85
  className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " is-sticky ").concat(shadowClassNames || ''),
83
86
  "data-layout": layout,
@@ -95,7 +98,8 @@ export var StickyTable = function StickyTable(_ref) {
95
98
  layout: layout,
96
99
  isNumberColumnEnabled: isNumberColumnEnabled,
97
100
  renderWidth: renderWidth,
98
- tableNode: tableNode
101
+ tableNode: tableNode,
102
+ rendererAppearance: rendererAppearance
99
103
  },
100
104
  /**
101
105
  * @see https://product-fabric.atlassian.net/browse/ED-10235
@@ -7,7 +7,8 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
7
7
  layout = _ref.layout,
8
8
  renderWidth = _ref.renderWidth,
9
9
  children = _ref.children,
10
- tableNode = _ref.tableNode;
10
+ tableNode = _ref.tableNode,
11
+ rendererAppearance = _ref.rendererAppearance;
11
12
  return /*#__PURE__*/React.createElement("table", {
12
13
  "data-number-column": isNumberColumnEnabled,
13
14
  ref: innerRef
@@ -16,6 +17,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
16
17
  layout: layout,
17
18
  isNumberColumnEnabled: isNumberColumnEnabled,
18
19
  renderWidth: renderWidth,
19
- tableNode: tableNode
20
+ tableNode: tableNode,
21
+ rendererAppearance: rendererAppearance
20
22
  }), /*#__PURE__*/React.createElement("tbody", null, children));
21
23
  });
@@ -22,6 +22,10 @@ import { TableHeader } from './tableCell';
22
22
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
23
23
  import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
24
24
  import { Table } from './table/table';
25
+ import { isFullWidthOrFullPageAppearance } from '../utils/appearance';
26
+ export var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
27
+ return getBooleanFF('platform.editor.custom-table-width') && isFullWidthOrFullPageAppearance(appearance);
28
+ };
25
29
  var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
26
30
  if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
27
31
  return children;
@@ -255,7 +259,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
255
259
  var calcDefaultLayoutWidthByAppearance = function calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance) {
256
260
  return rendererAppearance === 'full-width' && !tableNode.attrs.width ? Math.min(akEditorFullWidthLayoutWidth, renderWidth) : Math.min(getTableContainerWidth(tableNode), renderWidth);
257
261
  };
258
- if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
262
+ if (isTableResizingEnabled(rendererAppearance) && tableNode) {
259
263
  tableWidth = calcDefaultLayoutWidthByAppearance(tableNode, rendererAppearance);
260
264
  } else {
261
265
  tableWidth = calcTableWidth(layout, renderWidth, false);
@@ -278,7 +282,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
278
282
  innerRef: this.stickyWrapperRef,
279
283
  wrapperWidth: wrapperWidth,
280
284
  columnWidths: columnWidths,
281
- rowHeight: this.headerRowHeight
285
+ rowHeight: this.headerRowHeight,
286
+ rendererAppearance: rendererAppearance
282
287
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
283
288
  className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
284
289
  "data-layout": layout,
@@ -300,7 +305,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
300
305
  wrapperWidth: wrapperWidth,
301
306
  columnWidths: columnWidths,
302
307
  rowHeight: this.headerRowHeight,
303
- tableNode: tableNode
308
+ tableNode: tableNode,
309
+ rendererAppearance: rendererAppearance
304
310
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
305
311
  className: TableSharedCssClassName.TABLE_NODE_WRAPPER,
306
312
  ref: this.wrapperRef,
@@ -311,7 +317,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
311
317
  layout: layout,
312
318
  isNumberColumnEnabled: isNumberColumnEnabled,
313
319
  renderWidth: renderWidth,
314
- tableNode: tableNode
320
+ tableNode: tableNode,
321
+ rendererAppearance: rendererAppearance
315
322
  }, this.grabFirstRowRef(children)))));
316
323
  }
317
324
  }]);
@@ -0,0 +1,9 @@
1
+ export var isFullWidthAppearance = function isFullWidthAppearance(appearance) {
2
+ return appearance === 'full-width';
3
+ };
4
+ export var isFullPageAppearance = function isFullPageAppearance(appearance) {
5
+ return appearance === 'full-page';
6
+ };
7
+ export var isFullWidthOrFullPageAppearance = function isFullWidthOrFullPageAppearance(appearance) {
8
+ return isFullPageAppearance(appearance) || isFullWidthAppearance(appearance);
9
+ };
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
45
45
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
46
46
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
47
47
  var packageName = "@atlaskit/renderer";
48
- var packageVersion = "108.7.2";
48
+ var packageVersion = "108.7.3";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
@@ -5,7 +5,6 @@ import { themed } from '@atlaskit/theme/components';
5
5
  import { fontFamily, fontSize } from '@atlaskit/theme/constants';
6
6
  import * as colors from '@atlaskit/theme/colors';
7
7
  import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
8
  import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
10
9
  import { shadowClassNames } from '@atlaskit/editor-common/ui';
11
10
  import { browser } from '@atlaskit/editor-common/utils';
@@ -14,6 +13,7 @@ import { RendererCssClassName } from '../../consts';
14
13
  import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
15
14
  import { shadowObserverClassNames } from '@atlaskit/editor-common/ui';
16
15
  import { getLightWeightCodeBlockStylesForRootRendererStyleSheet } from '../../react/nodes/codeBlock/components/lightWeightCodeBlock';
16
+ import { isTableResizingEnabled } from '../../react/nodes/table';
17
17
  export var FullPagePadding = 32;
18
18
  var getLineHeight = function getLineHeight(fontCode) {
19
19
  return headingSizesImport[fontCode].lineHeight / headingSizesImport[fontCode].size;
@@ -39,14 +39,17 @@ export var headingSizes = {
39
39
  }
40
40
  };
41
41
  var headingAnchorStyle = function headingAnchorStyle(headingTag) {
42
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: 6px;\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
42
+ return (// TODO Delete this comment after verifying space token -> previous value `margin-left: 6px`
43
+ css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: ", ";\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName)
44
+ );
43
45
  };
44
46
  var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
45
47
  var allowNestedHeaderLinks = _ref.allowNestedHeaderLinks;
46
48
  if (!allowNestedHeaderLinks) {
47
49
  return '';
48
50
  }
49
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "], ["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
51
+ // TODO Delete this comment after verifying space token -> previous value `margin: 6px`
52
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 ", " 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "], ["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 ", " 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, "var(--ds-space-075, 6px)", HeadingAnchorWrapperClassName);
50
53
  };
51
54
  var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
52
55
  var allowColumnSorting = _ref2.allowColumnSorting,
@@ -73,7 +76,7 @@ var fullWidthStyles = function fullWidthStyles(_ref5) {
73
76
  if (appearance !== 'full-width') {
74
77
  return '';
75
78
  }
76
- return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .ak-renderer-extension {\n width: 100% !important;\n }\n\n ", "\n "])), akEditorFullWidthLayoutWidth, getBooleanFF('platform.editor.custom-table-width') ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
79
+ return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .ak-renderer-extension {\n width: 100% !important;\n }\n\n ", "\n "])), akEditorFullWidthLayoutWidth, isTableResizingEnabled(appearance) ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
77
80
  };
78
81
  var breakoutWidthStyle = function breakoutWidthStyle(useFragmentMarkBreakoutWidthStylingFix) {
79
82
  if (useFragmentMarkBreakoutWidthStylingFix) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.7.2",
3
+ "version": "108.7.3",
4
4
  "sideEffects": false
5
5
  }
@@ -4,12 +4,14 @@ import { jsx } from '@emotion/react';
4
4
  import { Node as PMNode } from 'prosemirror-model';
5
5
  import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
6
6
  import { TableLayout } from '@atlaskit/adf-schema';
7
+ import { RendererAppearance } from '../../../ui/Renderer/types';
7
8
  export type StickyMode = 'none' | 'stick' | 'pin-bottom';
8
9
  export declare const tableStickyPadding = 8;
9
10
  interface FixedProps {
10
11
  top?: number;
11
12
  wrapperWidth: number;
12
13
  mode: StickyMode;
14
+ rendererAppearance: RendererAppearance;
13
15
  }
14
16
  export declare const FixedTableDiv: React.FC<FixedProps>;
15
17
  export type StickyTableProps = {
@@ -26,8 +28,9 @@ export type StickyTableProps = {
26
28
  columnWidths?: number[];
27
29
  renderWidth: number;
28
30
  tableNode?: PMNode;
31
+ rendererAppearance: RendererAppearance;
29
32
  } & OverflowShadowProps;
30
- export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, }: StickyTableProps) => jsx.JSX.Element;
33
+ export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, rendererAppearance, }: StickyTableProps) => jsx.JSX.Element;
31
34
  export declare class OverflowParent {
32
35
  private ref;
33
36
  private constructor();
@@ -4,4 +4,4 @@ export type TableProps = SharedTableProps & {
4
4
  innerRef?: React.RefObject<HTMLTableElement>;
5
5
  children: React.ReactNode[];
6
6
  };
7
- export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, }: TableProps) => JSX.Element>;
7
+ export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, }: TableProps) => JSX.Element>;
@@ -1,9 +1,11 @@
1
1
  import { Node as PMNode } from 'prosemirror-model';
2
2
  import { TableLayout } from '@atlaskit/adf-schema';
3
+ import { RendererAppearance } from '../../../ui/Renderer/types';
3
4
  export type SharedTableProps = {
4
5
  columnWidths?: Array<number>;
5
6
  layout: TableLayout;
6
7
  isNumberColumnEnabled: boolean;
7
8
  renderWidth: number;
8
9
  tableNode?: PMNode;
10
+ rendererAppearance: RendererAppearance;
9
11
  };
@@ -6,6 +6,7 @@ import { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types'
6
6
  import { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
7
7
  import { StickyMode, OverflowParent } from './table/sticky';
8
8
  import { SharedTableProps } from './table/types';
9
+ export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
9
10
  export type TableProps = SharedTableProps & {
10
11
  children: React.ReactElement<any> | Array<React.ReactElement<any>>;
11
12
  tableNode?: PMNode;
@@ -0,0 +1,4 @@
1
+ import { RendererAppearance } from '../../ui/Renderer/types';
2
+ export declare const isFullWidthAppearance: (appearance: RendererAppearance) => boolean;
3
+ export declare const isFullPageAppearance: (appearance: RendererAppearance) => boolean;
4
+ export declare const isFullWidthOrFullPageAppearance: (appearance: RendererAppearance) => boolean;
@@ -4,12 +4,14 @@ import { jsx } from '@emotion/react';
4
4
  import { Node as PMNode } from 'prosemirror-model';
5
5
  import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
6
6
  import { TableLayout } from '@atlaskit/adf-schema';
7
+ import { RendererAppearance } from '../../../ui/Renderer/types';
7
8
  export type StickyMode = 'none' | 'stick' | 'pin-bottom';
8
9
  export declare const tableStickyPadding = 8;
9
10
  interface FixedProps {
10
11
  top?: number;
11
12
  wrapperWidth: number;
12
13
  mode: StickyMode;
14
+ rendererAppearance: RendererAppearance;
13
15
  }
14
16
  export declare const FixedTableDiv: React.FC<FixedProps>;
15
17
  export type StickyTableProps = {
@@ -26,8 +28,9 @@ export type StickyTableProps = {
26
28
  columnWidths?: number[];
27
29
  renderWidth: number;
28
30
  tableNode?: PMNode;
31
+ rendererAppearance: RendererAppearance;
29
32
  } & OverflowShadowProps;
30
- export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, }: StickyTableProps) => jsx.JSX.Element;
33
+ export declare const StickyTable: ({ top, left, mode, shadowClassNames, innerRef, wrapperWidth, tableWidth, isNumberColumnEnabled, layout, children, columnWidths, renderWidth, rowHeight, tableNode, rendererAppearance, }: StickyTableProps) => jsx.JSX.Element;
31
34
  export declare class OverflowParent {
32
35
  private ref;
33
36
  private constructor();
@@ -4,4 +4,4 @@ export type TableProps = SharedTableProps & {
4
4
  innerRef?: React.RefObject<HTMLTableElement>;
5
5
  children: React.ReactNode[];
6
6
  };
7
- export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, }: TableProps) => JSX.Element>;
7
+ export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, }: TableProps) => JSX.Element>;
@@ -1,9 +1,11 @@
1
1
  import { Node as PMNode } from 'prosemirror-model';
2
2
  import { TableLayout } from '@atlaskit/adf-schema';
3
+ import { RendererAppearance } from '../../../ui/Renderer/types';
3
4
  export type SharedTableProps = {
4
5
  columnWidths?: Array<number>;
5
6
  layout: TableLayout;
6
7
  isNumberColumnEnabled: boolean;
7
8
  renderWidth: number;
8
9
  tableNode?: PMNode;
10
+ rendererAppearance: RendererAppearance;
9
11
  };
@@ -6,6 +6,7 @@ import { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types'
6
6
  import { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
7
7
  import { StickyMode, OverflowParent } from './table/sticky';
8
8
  import { SharedTableProps } from './table/types';
9
+ export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
9
10
  export type TableProps = SharedTableProps & {
10
11
  children: React.ReactElement<any> | Array<React.ReactElement<any>>;
11
12
  tableNode?: PMNode;
@@ -0,0 +1,4 @@
1
+ import { RendererAppearance } from '../../ui/Renderer/types';
2
+ export declare const isFullWidthAppearance: (appearance: RendererAppearance) => boolean;
3
+ export declare const isFullPageAppearance: (appearance: RendererAppearance) => boolean;
4
+ export declare const isFullWidthOrFullPageAppearance: (appearance: RendererAppearance) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.7.2",
3
+ "version": "108.7.3",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/status": "^1.3.0",
51
51
  "@atlaskit/task-decision": "^17.7.0",
52
52
  "@atlaskit/theme": "^12.5.0",
53
- "@atlaskit/tokens": "^1.12.0",
53
+ "@atlaskit/tokens": "^1.13.0",
54
54
  "@atlaskit/tooltip": "^17.8.0",
55
55
  "@babel/runtime": "^7.0.0",
56
56
  "@emotion/react": "^11.7.1",
@@ -73,7 +73,7 @@
73
73
  "@af/visual-regression": "*",
74
74
  "@atlaskit/analytics-gas-types": "^5.1.0",
75
75
  "@atlaskit/css-reset": "^6.5.0",
76
- "@atlaskit/editor-core": "^187.0.0",
76
+ "@atlaskit/editor-core": "^187.2.0",
77
77
  "@atlaskit/editor-test-helpers": "^18.10.0",
78
78
  "@atlaskit/link-provider": "^1.6.0",
79
79
  "@atlaskit/link-test-helpers": "^4.1.0",