@atlaskit/renderer 108.1.8 → 108.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/react/nodes/codeBlock/components/codeBlockCopyButton.js +2 -1
  3. package/dist/cjs/react/nodes/codeBlock/components/codeBlockWrapButton.js +2 -1
  4. package/dist/cjs/react/nodes/media.js +2 -0
  5. package/dist/cjs/react/nodes/table/colgroup.js +13 -12
  6. package/dist/cjs/react/nodes/table/table.js +4 -2
  7. package/dist/cjs/react/nodes/table.js +15 -6
  8. package/dist/cjs/ui/Renderer/index.js +1 -1
  9. package/dist/cjs/ui/Renderer/style.js +4 -3
  10. package/dist/cjs/ui/SortingIcon.js +1 -1
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/react/nodes/codeBlock/components/codeBlockCopyButton.js +2 -1
  13. package/dist/es2019/react/nodes/codeBlock/components/codeBlockWrapButton.js +2 -1
  14. package/dist/es2019/react/nodes/media.js +2 -0
  15. package/dist/es2019/react/nodes/table/colgroup.js +13 -12
  16. package/dist/es2019/react/nodes/table/table.js +4 -2
  17. package/dist/es2019/react/nodes/table.js +15 -6
  18. package/dist/es2019/ui/Renderer/index.js +1 -1
  19. package/dist/es2019/ui/Renderer/style.js +9 -3
  20. package/dist/es2019/ui/SortingIcon.js +1 -1
  21. package/dist/es2019/version.json +1 -1
  22. package/dist/esm/react/nodes/codeBlock/components/codeBlockCopyButton.js +2 -1
  23. package/dist/esm/react/nodes/codeBlock/components/codeBlockWrapButton.js +2 -1
  24. package/dist/esm/react/nodes/media.js +2 -0
  25. package/dist/esm/react/nodes/table/colgroup.js +13 -12
  26. package/dist/esm/react/nodes/table/table.js +4 -2
  27. package/dist/esm/react/nodes/table.js +15 -6
  28. package/dist/esm/ui/Renderer/index.js +1 -1
  29. package/dist/esm/ui/Renderer/style.js +4 -3
  30. package/dist/esm/ui/SortingIcon.js +1 -1
  31. package/dist/esm/version.json +1 -1
  32. package/dist/types/react/nodes/table/table.d.ts +1 -1
  33. package/dist/types/react/nodes/table/types.d.ts +2 -0
  34. package/dist/types-ts4.5/react/nodes/table/table.d.ts +1 -1
  35. package/dist/types-ts4.5/react/nodes/table/types.d.ts +2 -0
  36. package/package.json +10 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 108.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1b8397cca2c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b8397cca2c) - [ux] Stop event from bubbling when user clicks on either the copy clipboard button or wrap button for code blocks in renderer view
8
+
9
+ ## 108.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`149b6c14e3e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/149b6c14e3e) - [ux] [ED-17634] Use the table width attribute in the renderer when platform.editor.custom-table-width FF is true
14
+
15
+ ### Patch Changes
16
+
17
+ - [`406f89ad910`](https://bitbucket.org/atlassian/atlassian-frontend/commits/406f89ad910) - [ux] fix image border missing in renderer when image is linked and also double seperators issue
18
+
3
19
  ## 108.1.8
4
20
 
5
21
  ### Patch Changes
@@ -52,7 +52,7 @@ var CopyButton = function CopyButton(_ref) {
52
52
  iconBefore: (0, _react.jsx)(_copy.default, {
53
53
  label: tooltip
54
54
  }),
55
- onClick: function onClick() {
55
+ onClick: function onClick(event) {
56
56
  fireAnalyticsEvent({
57
57
  action: _enums.ACTION.CLICKED,
58
58
  actionSubject: _enums.ACTION_SUBJECT.BUTTON,
@@ -62,6 +62,7 @@ var CopyButton = function CopyButton(_ref) {
62
62
  (0, _clipboard.copyTextToClipboard)(content);
63
63
  setTooltip(intl.formatMessage(_messages.codeBlockButtonMessages.copiedCodeToClipboard));
64
64
  setClassName('copy-to-clipboard clicked');
65
+ event.stopPropagation();
65
66
  },
66
67
  spacing: "compact"
67
68
  }))));
@@ -56,7 +56,7 @@ var CodeBlockWrapButton = function CodeBlockWrapButton(_ref) {
56
56
  label: ""
57
57
  }),
58
58
  isSelected: wrapLongLines,
59
- onClick: function onClick() {
59
+ onClick: function onClick(event) {
60
60
  fireAnalyticsEvent({
61
61
  action: _enums.ACTION.CLICKED,
62
62
  actionSubject: _enums.ACTION_SUBJECT.BUTTON,
@@ -67,6 +67,7 @@ var CodeBlockWrapButton = function CodeBlockWrapButton(_ref) {
67
67
  eventType: _enums.EVENT_TYPE.UI
68
68
  });
69
69
  setWrapLongLines(!wrapLongLines);
70
+ event.stopPropagation();
70
71
  },
71
72
  spacing: "compact"
72
73
  })));
@@ -79,6 +79,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
79
79
  "data-color": borderColor,
80
80
  "data-size": borderWidth,
81
81
  style: {
82
+ width: '100%',
83
+ height: '100%',
82
84
  borderColor: paletteColorValue,
83
85
  borderWidth: "".concat(borderWidth, "px"),
84
86
  borderStyle: 'solid',
@@ -8,12 +8,14 @@ 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
+ var _nodeWidth = require("@atlaskit/editor-common/node-width");
11
13
  // we allow scaling down column widths by no more than 30%
12
14
  // this intends to reduce unwanted scrolling in the Renderer in these scenarios:
13
15
  // User A creates a table with column widths → User B views it on a smaller screen
14
16
  // User A creates a table with column widths → User A views it with reduced viewport space (eg. Confluence sidebar is open)
15
17
  var MAX_SCALING_PERCENT = 0.3;
16
- var getTableLayoutWidth = function getTableLayoutWidth(layout, opts) {
18
+ var getTableLayoutWidth = function getTableLayoutWidth(layout) {
17
19
  switch (layout) {
18
20
  case 'full-width':
19
21
  return _editorSharedStyles.akEditorFullWidthLayoutWidth;
@@ -55,22 +57,21 @@ var Colgroup = function Colgroup(props) {
55
57
  var columnWidths = props.columnWidths,
56
58
  layout = props.layout,
57
59
  isNumberColumnEnabled = props.isNumberColumnEnabled,
58
- renderWidth = props.renderWidth;
60
+ renderWidth = props.renderWidth,
61
+ tableNode = props.tableNode;
59
62
  if (!columnWidths || !isTableResized(columnWidths)) {
60
63
  return null;
61
64
  }
62
-
65
+ var tableContainerWidth;
66
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && tableNode) {
67
+ tableContainerWidth = (0, _nodeWidth.getTableContainerWidth)(tableNode);
68
+ } else {
69
+ tableContainerWidth = getTableLayoutWidth(layout);
70
+ }
63
71
  // @see ED-6056
64
- var layoutWidth = getTableLayoutWidth(layout, {
65
- containerWidth: renderWidth
66
- });
67
- var maxTableWidth = renderWidth < layoutWidth ? renderWidth : layoutWidth;
68
-
69
- // If table has a layout of default, it is confined by the defined column width.
70
- // renderWidth is better used for breakout tables.
71
- // @see ED-6737
72
+ var maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
72
73
  if (layout === 'default') {
73
- renderWidth = Math.min(renderWidth, layoutWidth);
74
+ renderWidth = Math.min(renderWidth, tableContainerWidth);
74
75
  }
75
76
  var tableWidth = isNumberColumnEnabled ? _editorSharedStyles.akEditorTableNumberColumnWidth : 0;
76
77
  var minTableWidth = tableWidth;
@@ -13,7 +13,8 @@ var Table = /*#__PURE__*/_react.default.memo(function (_ref) {
13
13
  columnWidths = _ref.columnWidths,
14
14
  layout = _ref.layout,
15
15
  renderWidth = _ref.renderWidth,
16
- children = _ref.children;
16
+ children = _ref.children,
17
+ tableNode = _ref.tableNode;
17
18
  return /*#__PURE__*/_react.default.createElement("table", {
18
19
  "data-number-column": isNumberColumnEnabled,
19
20
  ref: innerRef
@@ -21,7 +22,8 @@ var Table = /*#__PURE__*/_react.default.memo(function (_ref) {
21
22
  columnWidths: columnWidths,
22
23
  layout: layout,
23
24
  isNumberColumnEnabled: isNumberColumnEnabled,
24
- renderWidth: renderWidth
25
+ renderWidth: renderWidth,
26
+ tableNode: tableNode
25
27
  }), /*#__PURE__*/_react.default.createElement("tbody", null, children));
26
28
  });
27
29
  exports.Table = Table;
@@ -18,12 +18,14 @@ var _styles = require("@atlaskit/editor-common/styles");
18
18
  var _ui = require("@atlaskit/editor-common/ui");
19
19
  var _utils = require("@atlaskit/editor-common/utils");
20
20
  var _types = require("@atlaskit/editor-common/types");
21
+ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
+ var _nodeWidth = require("@atlaskit/editor-common/node-width");
21
24
  var _style = require("../../ui/Renderer/style");
22
25
  var _tableCell = require("./tableCell");
23
26
  var _SmartCardStorage = require("../../ui/SmartCardStorage");
24
27
  var _sticky = require("./table/sticky");
25
28
  var _table = require("./table/table");
26
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
27
29
  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); }; }
28
30
  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; } }
29
31
  var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
@@ -250,12 +252,18 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
250
252
  renderWidth = _this$props.renderWidth,
251
253
  columnWidths = _this$props.columnWidths,
252
254
  stickyHeaders = _this$props.stickyHeaders,
253
- tableNode = _this$props.tableNode;
255
+ tableNode = _this$props.tableNode,
256
+ rendererAppearance = _this$props.rendererAppearance;
254
257
  var stickyMode = this.state.stickyMode;
255
- var tableWidth = (0, _styles.calcTableWidth)(layout, renderWidth, false);
256
258
  var lineLength = _editorSharedStyles.akEditorDefaultLayoutWidth;
259
+ var tableWidth;
257
260
  var left;
258
- if (canUseLinelength(this.props.rendererAppearance) && tableWidth !== 'inherit') {
261
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && tableNode) {
262
+ tableWidth = Math.min((0, _nodeWidth.getTableContainerWidth)(tableNode), renderWidth);
263
+ } else {
264
+ tableWidth = (0, _styles.calcTableWidth)(layout, renderWidth, false);
265
+ }
266
+ if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
259
267
  left = lineLength / 2 - tableWidth / 2;
260
268
  }
261
269
  var wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
@@ -280,7 +288,7 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
280
288
  ref: this.props.handleRef,
281
289
  style: {
282
290
  width: tableWidth,
283
- left: left && left < 0 ? left : undefined
291
+ left: left
284
292
  }
285
293
  }, /*#__PURE__*/_react.default.createElement("div", {
286
294
  className: _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER,
@@ -291,7 +299,8 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
291
299
  columnWidths: columnWidths,
292
300
  layout: layout,
293
301
  isNumberColumnEnabled: isNumberColumnEnabled,
294
- renderWidth: renderWidth
302
+ renderWidth: renderWidth,
303
+ tableNode: tableNode
295
304
  }, this.grabFirstRowRef(children)))));
296
305
  }
297
306
  }]);
@@ -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.1.8";
58
+ var packageVersion = "108.2.1";
59
59
  var Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -12,6 +12,7 @@ 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");
15
16
  var _styles = require("@atlaskit/editor-common/styles");
16
17
  var _ui = require("@atlaskit/editor-common/ui");
17
18
  var _utils = require("@atlaskit/editor-common/utils");
@@ -83,7 +84,7 @@ var fullWidthStyles = function fullWidthStyles(_ref5) {
83
84
  if (appearance !== 'full-width') {
84
85
  return '';
85
86
  }
86
- return (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .pm-table-container,\n .ak-renderer-extension {\n width: 100% !important;\n }\n "])), _editorSharedStyles.akEditorFullWidthLayoutWidth);
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 ");
87
88
  };
88
89
  var breakoutWidthStyle = function breakoutWidthStyle(useFragmentMarkBreakoutWidthStylingFix) {
89
90
  if (useFragmentMarkBreakoutWidthStylingFix) {
@@ -107,7 +108,7 @@ var rendererStyles = function rendererStyles(wrapperProps) {
107
108
  })(themeProps), _styles.whitespaceSharedStyles, _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)(themeProps), (0, _styles.ruleSharedStyles)(themeProps), _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, (0, _styles.codeMarkSharedStyles)(themeProps), _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
108
109
  light: "var(--ds-background-neutral, ".concat(colors.N30A, ")"),
109
110
  dark: "var(--ds-background-neutral, ".concat(colors.DN70, ")")
110
- })(themeProps), "var(--ds-radius-100, 3px)", (0, _components.themed)({
111
+ })(themeProps), "var(--ds-border-radius-100, 3px)", (0, _components.themed)({
111
112
  light: "var(--ds-text, ".concat(colors.N800, ")"),
112
113
  dark: "var(--ds-text, ".concat(colors.DN600, ")")
113
114
  })(themeProps), "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, breakoutWidthStyle(wrapperProps.useFragmentMarkBreakoutWidthStylingFix), _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, _ui.shadowObserverClassNames.SHADOW_CONTAINER, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(themeProps), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, _ui.shadowObserverClassNames.SENTINEL_LEFT, _ui.shadowObserverClassNames.SENTINEL_RIGHT, _styles.tableMarginTop, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
@@ -137,7 +138,7 @@ var rendererStyles = function rendererStyles(wrapperProps) {
137
138
  })(themeProps), (0, _components.themed)({
138
139
  light: "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"),
139
140
  dark: "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableToolbarDark, ")")
140
- })(themeProps), "var(--ds-radius-100, 3px)", _editorSharedStyles.blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), (0, _lightWeightCodeBlock.getLightWeightCodeBlockStylesForRootRendererStyleSheet)(), _styles.columnLayoutSharedStyle, "var(--ds-space-250, 20px)", "var(--ds-space-400, 32px)", _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _utils.browser.safari ? _styles.codeBlockInListSafariFix : '');
141
+ })(themeProps), "var(--ds-border-radius-100, 3px)", _editorSharedStyles.blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), (0, _lightWeightCodeBlock.getLightWeightCodeBlockStylesForRootRendererStyleSheet)(), _styles.columnLayoutSharedStyle, "var(--ds-space-250, 20px)", "var(--ds-space-400, 32px)", _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _utils.browser.safari ? _styles.codeBlockInListSafariFix : '');
141
142
  };
142
143
  };
143
144
  exports.rendererStyles = rendererStyles;
@@ -23,7 +23,7 @@ var StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
23
23
  return StatusClassNames;
24
24
  }({});
25
25
  exports.StatusClassNames = StatusClassNames;
26
- var buttonStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", ";\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), "var(--ds-border, #fff)", "var(--ds-radius-100, 4px)", "var(--ds-surface-overlay, ".concat(_colors.N20, ")"), "var(--ds-surface-overlay-hovered, ".concat(_colors.N30, ")"), "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))", _consts.RendererCssClassName.SORTABLE_COLUMN_ICON);
26
+ var buttonStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", ";\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), "var(--ds-border, #fff)", "var(--ds-border-radius-100, 4px)", "var(--ds-surface-overlay, ".concat(_colors.N20, ")"), "var(--ds-surface-overlay-hovered, ".concat(_colors.N30, ")"), "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))", _consts.RendererCssClassName.SORTABLE_COLUMN_ICON);
27
27
  var iconWrapperStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n display: flex;\n justify-content: center;\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), StatusClassNames.DESC, _consts.RendererCssClassName.SORTABLE_COLUMN_ICON);
28
28
 
29
29
  // The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.1.8",
3
+ "version": "108.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -35,7 +35,7 @@ const CopyButton = ({
35
35
  iconBefore: jsx(CopyIcon, {
36
36
  label: tooltip
37
37
  }),
38
- onClick: () => {
38
+ onClick: event => {
39
39
  fireAnalyticsEvent({
40
40
  action: ACTION.CLICKED,
41
41
  actionSubject: ACTION_SUBJECT.BUTTON,
@@ -45,6 +45,7 @@ const CopyButton = ({
45
45
  copyTextToClipboard(content);
46
46
  setTooltip(intl.formatMessage(codeBlockButtonMessages.copiedCodeToClipboard));
47
47
  setClassName('copy-to-clipboard clicked');
48
+ event.stopPropagation();
48
49
  },
49
50
  spacing: "compact"
50
51
  })))));
@@ -49,7 +49,7 @@ const CodeBlockWrapButton = ({
49
49
  label: ""
50
50
  }),
51
51
  isSelected: wrapLongLines,
52
- onClick: () => {
52
+ onClick: event => {
53
53
  fireAnalyticsEvent({
54
54
  action: ACTION.CLICKED,
55
55
  actionSubject: ACTION_SUBJECT.BUTTON,
@@ -60,6 +60,7 @@ const CodeBlockWrapButton = ({
60
60
  eventType: EVENT_TYPE.UI
61
61
  });
62
62
  setWrapLongLines(!wrapLongLines);
63
+ event.stopPropagation();
63
64
  },
64
65
  spacing: "compact"
65
66
  }))));
@@ -60,6 +60,8 @@ export default class Media extends PureComponent {
60
60
  "data-color": borderColor,
61
61
  "data-size": borderWidth,
62
62
  style: {
63
+ width: '100%',
64
+ height: '100%',
63
65
  borderColor: paletteColorValue,
64
66
  borderWidth: `${borderWidth}px`,
65
67
  borderStyle: 'solid',
@@ -1,12 +1,14 @@
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
+ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
4
6
  // we allow scaling down column widths by no more than 30%
5
7
  // this intends to reduce unwanted scrolling in the Renderer in these scenarios:
6
8
  // User A creates a table with column widths → User B views it on a smaller screen
7
9
  // User A creates a table with column widths → User A views it with reduced viewport space (eg. Confluence sidebar is open)
8
10
  const MAX_SCALING_PERCENT = 0.3;
9
- const getTableLayoutWidth = (layout, opts) => {
11
+ const getTableLayoutWidth = layout => {
10
12
  switch (layout) {
11
13
  case 'full-width':
12
14
  return akEditorFullWidthLayoutWidth;
@@ -47,23 +49,22 @@ export const Colgroup = props => {
47
49
  columnWidths,
48
50
  layout,
49
51
  isNumberColumnEnabled,
50
- renderWidth
52
+ renderWidth,
53
+ tableNode
51
54
  } = props;
52
55
  if (!columnWidths || !isTableResized(columnWidths)) {
53
56
  return null;
54
57
  }
55
-
58
+ let tableContainerWidth;
59
+ if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
60
+ tableContainerWidth = getTableContainerWidth(tableNode);
61
+ } else {
62
+ tableContainerWidth = getTableLayoutWidth(layout);
63
+ }
56
64
  // @see ED-6056
57
- const layoutWidth = getTableLayoutWidth(layout, {
58
- containerWidth: renderWidth
59
- });
60
- const maxTableWidth = renderWidth < layoutWidth ? renderWidth : layoutWidth;
61
-
62
- // If table has a layout of default, it is confined by the defined column width.
63
- // renderWidth is better used for breakout tables.
64
- // @see ED-6737
65
+ const maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
65
66
  if (layout === 'default') {
66
- renderWidth = Math.min(renderWidth, layoutWidth);
67
+ renderWidth = Math.min(renderWidth, tableContainerWidth);
67
68
  }
68
69
  let tableWidth = isNumberColumnEnabled ? akEditorTableNumberColumnWidth : 0;
69
70
  let minTableWidth = tableWidth;
@@ -6,7 +6,8 @@ export const Table = /*#__PURE__*/React.memo(({
6
6
  columnWidths,
7
7
  layout,
8
8
  renderWidth,
9
- children
9
+ children,
10
+ tableNode
10
11
  }) => {
11
12
  return /*#__PURE__*/React.createElement("table", {
12
13
  "data-number-column": isNumberColumnEnabled,
@@ -15,6 +16,7 @@ export const Table = /*#__PURE__*/React.memo(({
15
16
  columnWidths: columnWidths,
16
17
  layout: layout,
17
18
  isNumberColumnEnabled: isNumberColumnEnabled,
18
- renderWidth: renderWidth
19
+ renderWidth: renderWidth,
20
+ tableNode: tableNode
19
21
  }), /*#__PURE__*/React.createElement("tbody", null, children));
20
22
  });
@@ -5,12 +5,14 @@ import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlask
5
5
  import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
6
6
  import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
7
7
  import { SortOrder } from '@atlaskit/editor-common/types';
8
+ import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
9
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
10
+ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
8
11
  import { FullPagePadding } from '../../ui/Renderer/style';
9
12
  import { TableHeader } from './tableCell';
10
13
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
11
14
  import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
12
15
  import { Table } from './table/table';
13
- import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
14
16
  const orderChildren = (children, tableNode, smartCardStorage, tableOrderStatus) => {
15
17
  if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
16
18
  return children;
@@ -206,15 +208,21 @@ export class TableContainer extends React.Component {
206
208
  renderWidth,
207
209
  columnWidths,
208
210
  stickyHeaders,
209
- tableNode
211
+ tableNode,
212
+ rendererAppearance
210
213
  } = this.props;
211
214
  const {
212
215
  stickyMode
213
216
  } = this.state;
214
- let tableWidth = calcTableWidth(layout, renderWidth, false);
215
217
  const lineLength = akEditorDefaultLayoutWidth;
218
+ let tableWidth;
216
219
  let left;
217
- if (canUseLinelength(this.props.rendererAppearance) && tableWidth !== 'inherit') {
220
+ if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
221
+ tableWidth = Math.min(getTableContainerWidth(tableNode), renderWidth);
222
+ } else {
223
+ tableWidth = calcTableWidth(layout, renderWidth, false);
224
+ }
225
+ if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
218
226
  left = lineLength / 2 - tableWidth / 2;
219
227
  }
220
228
  const wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
@@ -239,7 +247,7 @@ export class TableContainer extends React.Component {
239
247
  ref: this.props.handleRef,
240
248
  style: {
241
249
  width: tableWidth,
242
- left: left && left < 0 ? left : undefined
250
+ left
243
251
  }
244
252
  }, /*#__PURE__*/React.createElement("div", {
245
253
  className: TableSharedCssClassName.TABLE_NODE_WRAPPER,
@@ -250,7 +258,8 @@ export class TableContainer extends React.Component {
250
258
  columnWidths: columnWidths,
251
259
  layout: layout,
252
260
  isNumberColumnEnabled: isNumberColumnEnabled,
253
- renderWidth: renderWidth
261
+ renderWidth: renderWidth,
262
+ tableNode: tableNode
254
263
  }, this.grabFirstRowRef(children)))));
255
264
  }
256
265
  }
@@ -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.1.8";
38
+ const packageVersion = "108.2.1";
39
39
  export class Renderer extends PureComponent {
40
40
  constructor(props) {
41
41
  super(props);
@@ -3,6 +3,7 @@ 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';
6
7
  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';
7
8
  import { shadowClassNames } from '@atlaskit/editor-common/ui';
8
9
  import { browser } from '@atlaskit/editor-common/utils';
@@ -267,10 +268,15 @@ const fullWidthStyles = ({
267
268
  margin: 0 auto;
268
269
 
269
270
  .fabric-editor-breakout-mark,
270
- .pm-table-container,
271
271
  .ak-renderer-extension {
272
272
  width: 100% !important;
273
273
  }
274
+
275
+ ${getBooleanFF('platform.editor.custom-table-width') ? '' : `
276
+ .pm-table-container {
277
+ width: 100% !important;
278
+ }
279
+ `}
274
280
  `;
275
281
  };
276
282
  const breakoutWidthStyle = useFragmentMarkBreakoutWidthStylingFix => {
@@ -404,7 +410,7 @@ export const rendererStyles = wrapperProps => theme => {
404
410
  light: `var(--ds-background-neutral, ${colors.N30A})`,
405
411
  dark: `var(--ds-background-neutral, ${colors.DN70})`
406
412
  })(themeProps)};
407
- border-radius: ${"var(--ds-radius-100, 3px)"};
413
+ border-radius: ${"var(--ds-border-radius-100, 3px)"};
408
414
  color: ${themed({
409
415
  light: `var(--ds-text, ${colors.N800})`,
410
416
  dark: `var(--ds-text, ${colors.DN600})`
@@ -640,7 +646,7 @@ export const rendererStyles = wrapperProps => theme => {
640
646
  /* stylelint-enable */
641
647
 
642
648
  position: relative;
643
- border-radius: ${"var(--ds-radius-100, 3px)"};
649
+ border-radius: ${"var(--ds-border-radius-100, 3px)"};
644
650
 
645
651
  /*
646
652
  * The overall renderer has word-wrap: break; which causes issues with
@@ -22,7 +22,7 @@ const buttonStyles = css`
22
22
  right: 0;
23
23
  top: 0;
24
24
  border: 2px solid ${"var(--ds-border, #fff)"};
25
- border-radius: ${"var(--ds-radius-100, 4px)"};
25
+ border-radius: ${"var(--ds-border-radius-100, 4px)"};
26
26
  background-color: ${`var(--ds-surface-overlay, ${N20})`};
27
27
  justify-content: center;
28
28
  align-items: center;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.1.8",
3
+ "version": "108.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -41,7 +41,7 @@ var CopyButton = function CopyButton(_ref) {
41
41
  iconBefore: jsx(CopyIcon, {
42
42
  label: tooltip
43
43
  }),
44
- onClick: function onClick() {
44
+ onClick: function onClick(event) {
45
45
  fireAnalyticsEvent({
46
46
  action: ACTION.CLICKED,
47
47
  actionSubject: ACTION_SUBJECT.BUTTON,
@@ -51,6 +51,7 @@ var CopyButton = function CopyButton(_ref) {
51
51
  copyTextToClipboard(content);
52
52
  setTooltip(intl.formatMessage(codeBlockButtonMessages.copiedCodeToClipboard));
53
53
  setClassName('copy-to-clipboard clicked');
54
+ event.stopPropagation();
54
55
  },
55
56
  spacing: "compact"
56
57
  }))));
@@ -48,7 +48,7 @@ var CodeBlockWrapButton = function CodeBlockWrapButton(_ref) {
48
48
  label: ""
49
49
  }),
50
50
  isSelected: wrapLongLines,
51
- onClick: function onClick() {
51
+ onClick: function onClick(event) {
52
52
  fireAnalyticsEvent({
53
53
  action: ACTION.CLICKED,
54
54
  actionSubject: ACTION_SUBJECT.BUTTON,
@@ -59,6 +59,7 @@ var CodeBlockWrapButton = function CodeBlockWrapButton(_ref) {
59
59
  eventType: EVENT_TYPE.UI
60
60
  });
61
61
  setWrapLongLines(!wrapLongLines);
62
+ event.stopPropagation();
62
63
  },
63
64
  spacing: "compact"
64
65
  })));
@@ -71,6 +71,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
71
71
  "data-color": borderColor,
72
72
  "data-size": borderWidth,
73
73
  style: {
74
+ width: '100%',
75
+ height: '100%',
74
76
  borderColor: paletteColorValue,
75
77
  borderWidth: "".concat(borderWidth, "px"),
76
78
  borderStyle: 'solid',
@@ -1,12 +1,14 @@
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
+ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
4
6
  // we allow scaling down column widths by no more than 30%
5
7
  // this intends to reduce unwanted scrolling in the Renderer in these scenarios:
6
8
  // User A creates a table with column widths → User B views it on a smaller screen
7
9
  // User A creates a table with column widths → User A views it with reduced viewport space (eg. Confluence sidebar is open)
8
10
  var MAX_SCALING_PERCENT = 0.3;
9
- var getTableLayoutWidth = function getTableLayoutWidth(layout, opts) {
11
+ var getTableLayoutWidth = function getTableLayoutWidth(layout) {
10
12
  switch (layout) {
11
13
  case 'full-width':
12
14
  return akEditorFullWidthLayoutWidth;
@@ -47,22 +49,21 @@ export var Colgroup = function Colgroup(props) {
47
49
  var columnWidths = props.columnWidths,
48
50
  layout = props.layout,
49
51
  isNumberColumnEnabled = props.isNumberColumnEnabled,
50
- renderWidth = props.renderWidth;
52
+ renderWidth = props.renderWidth,
53
+ tableNode = props.tableNode;
51
54
  if (!columnWidths || !isTableResized(columnWidths)) {
52
55
  return null;
53
56
  }
54
-
57
+ var tableContainerWidth;
58
+ if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
59
+ tableContainerWidth = getTableContainerWidth(tableNode);
60
+ } else {
61
+ tableContainerWidth = getTableLayoutWidth(layout);
62
+ }
55
63
  // @see ED-6056
56
- var layoutWidth = getTableLayoutWidth(layout, {
57
- containerWidth: renderWidth
58
- });
59
- var maxTableWidth = renderWidth < layoutWidth ? renderWidth : layoutWidth;
60
-
61
- // If table has a layout of default, it is confined by the defined column width.
62
- // renderWidth is better used for breakout tables.
63
- // @see ED-6737
64
+ var maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
64
65
  if (layout === 'default') {
65
- renderWidth = Math.min(renderWidth, layoutWidth);
66
+ renderWidth = Math.min(renderWidth, tableContainerWidth);
66
67
  }
67
68
  var tableWidth = isNumberColumnEnabled ? akEditorTableNumberColumnWidth : 0;
68
69
  var minTableWidth = tableWidth;
@@ -6,7 +6,8 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
6
6
  columnWidths = _ref.columnWidths,
7
7
  layout = _ref.layout,
8
8
  renderWidth = _ref.renderWidth,
9
- children = _ref.children;
9
+ children = _ref.children,
10
+ tableNode = _ref.tableNode;
10
11
  return /*#__PURE__*/React.createElement("table", {
11
12
  "data-number-column": isNumberColumnEnabled,
12
13
  ref: innerRef
@@ -14,6 +15,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
14
15
  columnWidths: columnWidths,
15
16
  layout: layout,
16
17
  isNumberColumnEnabled: isNumberColumnEnabled,
17
- renderWidth: renderWidth
18
+ renderWidth: renderWidth,
19
+ tableNode: tableNode
18
20
  }), /*#__PURE__*/React.createElement("tbody", null, children));
19
21
  });
@@ -13,12 +13,14 @@ import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlask
13
13
  import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
14
14
  import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
15
15
  import { SortOrder } from '@atlaskit/editor-common/types';
16
+ import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
17
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
18
+ import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
16
19
  import { FullPagePadding } from '../../ui/Renderer/style';
17
20
  import { TableHeader } from './tableCell';
18
21
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
19
22
  import { StickyTable, tableStickyPadding, OverflowParent } from './table/sticky';
20
23
  import { Table } from './table/table';
21
- import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
22
24
  var orderChildren = function orderChildren(children, tableNode, smartCardStorage, tableOrderStatus) {
23
25
  if (!tableOrderStatus || tableOrderStatus.order === SortOrder.NO_ORDER) {
24
26
  return children;
@@ -243,12 +245,18 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
243
245
  renderWidth = _this$props.renderWidth,
244
246
  columnWidths = _this$props.columnWidths,
245
247
  stickyHeaders = _this$props.stickyHeaders,
246
- tableNode = _this$props.tableNode;
248
+ tableNode = _this$props.tableNode,
249
+ rendererAppearance = _this$props.rendererAppearance;
247
250
  var stickyMode = this.state.stickyMode;
248
- var tableWidth = calcTableWidth(layout, renderWidth, false);
249
251
  var lineLength = akEditorDefaultLayoutWidth;
252
+ var tableWidth;
250
253
  var left;
251
- if (canUseLinelength(this.props.rendererAppearance) && tableWidth !== 'inherit') {
254
+ if (getBooleanFF('platform.editor.custom-table-width') && tableNode) {
255
+ tableWidth = Math.min(getTableContainerWidth(tableNode), renderWidth);
256
+ } else {
257
+ tableWidth = calcTableWidth(layout, renderWidth, false);
258
+ }
259
+ if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
252
260
  left = lineLength / 2 - tableWidth / 2;
253
261
  }
254
262
  var wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
@@ -273,7 +281,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
273
281
  ref: this.props.handleRef,
274
282
  style: {
275
283
  width: tableWidth,
276
- left: left && left < 0 ? left : undefined
284
+ left: left
277
285
  }
278
286
  }, /*#__PURE__*/React.createElement("div", {
279
287
  className: TableSharedCssClassName.TABLE_NODE_WRAPPER,
@@ -284,7 +292,8 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
284
292
  columnWidths: columnWidths,
285
293
  layout: layout,
286
294
  isNumberColumnEnabled: isNumberColumnEnabled,
287
- renderWidth: renderWidth
295
+ renderWidth: renderWidth,
296
+ tableNode: tableNode
288
297
  }, this.grabFirstRowRef(children)))));
289
298
  }
290
299
  }]);
@@ -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.1.8";
48
+ var packageVersion = "108.2.1";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
@@ -5,6 +5,7 @@ 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';
8
9
  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';
9
10
  import { shadowClassNames } from '@atlaskit/editor-common/ui';
10
11
  import { browser } from '@atlaskit/editor-common/utils';
@@ -72,7 +73,7 @@ var fullWidthStyles = function fullWidthStyles(_ref5) {
72
73
  if (appearance !== 'full-width') {
73
74
  return '';
74
75
  }
75
- return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .pm-table-container,\n .ak-renderer-extension {\n width: 100% !important;\n }\n "])), akEditorFullWidthLayoutWidth);
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 ");
76
77
  };
77
78
  var breakoutWidthStyle = function breakoutWidthStyle(useFragmentMarkBreakoutWidthStylingFix) {
78
79
  if (useFragmentMarkBreakoutWidthStylingFix) {
@@ -96,7 +97,7 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
96
97
  })(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), ruleSharedStyles(themeProps), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(themeProps), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
97
98
  light: "var(--ds-background-neutral, ".concat(colors.N30A, ")"),
98
99
  dark: "var(--ds-background-neutral, ".concat(colors.DN70, ")")
99
- })(themeProps), "var(--ds-radius-100, 3px)", themed({
100
+ })(themeProps), "var(--ds-border-radius-100, 3px)", themed({
100
101
  light: "var(--ds-text, ".concat(colors.N800, ")"),
101
102
  dark: "var(--ds-text, ".concat(colors.DN600, ")")
102
103
  })(themeProps), "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, breakoutWidthStyle(wrapperProps.useFragmentMarkBreakoutWidthStylingFix), RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(themeProps), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, themed({
@@ -126,7 +127,7 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
126
127
  })(themeProps), themed({
127
128
  light: "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbar, ")"),
128
129
  dark: "var(--ds-background-accent-gray-subtler, ".concat(akEditorTableToolbarDark, ")")
129
- })(themeProps), "var(--ds-radius-100, 3px)", blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, "var(--ds-space-250, 20px)", "var(--ds-space-400, 32px)", gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, blockNodesVerticalMargin, browser.safari ? codeBlockInListSafariFix : '');
130
+ })(themeProps), "var(--ds-border-radius-100, 3px)", blockNodesVerticalMargin, useGridRenderForCodeBlock(useBlockRenderForCodeBlock), getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, "var(--ds-space-250, 20px)", "var(--ds-space-400, 32px)", gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, blockNodesVerticalMargin, browser.safari ? codeBlockInListSafariFix : '');
130
131
  };
131
132
  };
132
133
  var useGridRenderForCodeBlock = function useGridRenderForCodeBlock(codeBlockRenderAsBlock) {
@@ -15,7 +15,7 @@ export var StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
15
15
  StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
16
16
  return StatusClassNames;
17
17
  }({});
18
- var buttonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", ";\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), "var(--ds-border, #fff)", "var(--ds-radius-100, 4px)", "var(--ds-surface-overlay, ".concat(N20, ")"), "var(--ds-surface-overlay-hovered, ".concat(N30, ")"), "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))", RendererCssClassName.SORTABLE_COLUMN_ICON);
18
+ var buttonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid ", ";\n border-radius: ", ";\n background-color: ", ";\n justify-content: center;\n align-items: center;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &.", "__not-allowed {\n cursor: not-allowed;\n }\n"])), "var(--ds-border, #fff)", "var(--ds-border-radius-100, 4px)", "var(--ds-surface-overlay, ".concat(N20, ")"), "var(--ds-surface-overlay-hovered, ".concat(N30, ")"), "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))", RendererCssClassName.SORTABLE_COLUMN_ICON);
19
19
  var iconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n display: flex;\n justify-content: center;\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), StatusClassNames.DESC, RendererCssClassName.SORTABLE_COLUMN_ICON);
20
20
 
21
21
  // The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.1.8",
3
+ "version": "108.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -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, }: TableProps) => JSX.Element>;
7
+ export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, }: TableProps) => JSX.Element>;
@@ -1,7 +1,9 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
1
2
  import { TableLayout } from '@atlaskit/adf-schema';
2
3
  export type SharedTableProps = {
3
4
  columnWidths?: Array<number>;
4
5
  layout: TableLayout;
5
6
  isNumberColumnEnabled: boolean;
6
7
  renderWidth: number;
8
+ tableNode?: PMNode;
7
9
  };
@@ -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, }: TableProps) => JSX.Element>;
7
+ export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, }: TableProps) => JSX.Element>;
@@ -1,7 +1,9 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
1
2
  import { TableLayout } from '@atlaskit/adf-schema';
2
3
  export type SharedTableProps = {
3
4
  columnWidths?: Array<number>;
4
5
  layout: TableLayout;
5
6
  isNumberColumnEnabled: boolean;
6
7
  renderWidth: number;
8
+ tableNode?: PMNode;
7
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.1.8",
3
+ "version": "108.2.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,7 +32,7 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/adf-schema": "^25.8.0",
35
+ "@atlaskit/adf-schema": "^25.9.0",
36
36
  "@atlaskit/adf-utils": "^18.4.0",
37
37
  "@atlaskit/analytics-listeners": "^8.7.0",
38
38
  "@atlaskit/analytics-namespaced-context": "^6.7.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/status": "^1.3.0",
57
57
  "@atlaskit/task-decision": "^17.6.0",
58
58
  "@atlaskit/theme": "^12.5.0",
59
- "@atlaskit/tokens": "^1.5.0",
59
+ "@atlaskit/tokens": "^1.6.0",
60
60
  "@atlaskit/tooltip": "^17.8.0",
61
61
  "@babel/runtime": "^7.0.0",
62
62
  "@emotion/react": "^11.7.1",
@@ -82,6 +82,7 @@
82
82
  "@atlaskit/docs": "*",
83
83
  "@atlaskit/editor-core": "^185.2.0",
84
84
  "@atlaskit/editor-test-helpers": "^18.6.0",
85
+ "@atlaskit/inline-edit": "^12.3.3",
85
86
  "@atlaskit/link-provider": "^1.6.0",
86
87
  "@atlaskit/link-test-helpers": "^4.0.0",
87
88
  "@atlaskit/logo": "^13.14.0",
@@ -92,10 +93,12 @@
92
93
  "@atlaskit/navigation-next": "^9.0.0",
93
94
  "@atlaskit/radio": "^5.6.0",
94
95
  "@atlaskit/range": "^7.1.0",
96
+ "@atlaskit/textfield": "^5.5.1",
95
97
  "@atlaskit/util-data-test": "^17.8.0",
96
98
  "@atlaskit/visual-regression": "*",
97
99
  "@atlaskit/webdriver-runner": "*",
98
100
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
101
+ "@atlassian/feature-flags-test-utils": "*",
99
102
  "@testing-library/react": "^12.1.5",
100
103
  "@types/prosemirror-model": "^1.11.0",
101
104
  "@types/prosemirror-transform": "^1.1.0",
@@ -130,6 +133,9 @@
130
133
  "platform-feature-flags": {
131
134
  "platform.editor.sentry-error-monitoring_6bksu": {
132
135
  "type": "boolean"
136
+ },
137
+ "platform.editor.custom-table-width": {
138
+ "type": "boolean"
133
139
  }
134
140
  }
135
- }
141
+ }