@atlaskit/renderer 109.2.1 → 109.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 109.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#66919](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66919) [`d23cba211264`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d23cba211264) - Added a unsupported node type counts map to the unsupported content level tracking analytics event. This will provide information as to the type of unsupported nodes being encountered by user and help with debuggging the issue.
8
+ - [#67106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67106) [`f35f74b0b1e5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f35f74b0b1e5) - fix embed link overlaps table sticky header in Renderer
9
+
10
+ ## 109.2.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [#65494](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65494) [`14c48a2fa93d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/14c48a2fa93d) - Moved the example helpers from the test utlity library to editor-core
15
+ - [#65444](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65444) [`3fe0f77f03fb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3fe0f77f03fb) - Added type to expand button in Renderer & prevent default behaviour on click
16
+
3
17
  ## 109.2.1
4
18
 
5
19
  ### Patch Changes
@@ -15,7 +15,8 @@ var processLevelsAndTrack = function processLevelsAndTrack(item, thresholds, dis
15
15
  percentage = _getUnsupportedConten.percentage,
16
16
  _getUnsupportedConten2 = _getUnsupportedConten.counts,
17
17
  supportedNodes = _getUnsupportedConten2.supportedNodes,
18
- unsupportedNodes = _getUnsupportedConten2.unsupportedNodes;
18
+ unsupportedNodes = _getUnsupportedConten2.unsupportedNodes,
19
+ unsupportedNodeTypeCount = _getUnsupportedConten2.unsupportedNodeTypeCount;
19
20
  dispatchAnalyticsEvent({
20
21
  action: _analytics.ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED,
21
22
  actionSubject: _analytics.ACTION_SUBJECT.RENDERER,
@@ -25,7 +26,8 @@ var processLevelsAndTrack = function processLevelsAndTrack(item, thresholds, dis
25
26
  unsupportedContentLevelSeverity: severity,
26
27
  unsupportedContentLevelPercentage: percentage,
27
28
  unsupportedNodesCount: unsupportedNodes,
28
- supportedNodesCount: supportedNodes
29
+ supportedNodesCount: supportedNodes,
30
+ unsupportedNodeTypeCount: unsupportedNodeTypeCount
29
31
  },
30
32
  eventType: _analytics.EVENT_TYPE.OPERATIONAL
31
33
  });
@@ -34,7 +34,7 @@ var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, r
34
34
  } else {
35
35
  stickyHeaderZIndex = _editorSharedStyles.akEditorStickyHeaderZIndex;
36
36
  }
37
- 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);
37
+ 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\n &.fixedTableDiv[mode='stick'] {\n z-index: ", ";\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, stickyHeaderZIndex);
38
38
  };
39
39
  var FixedTableDiv = exports.FixedTableDiv = function FixedTableDiv(props) {
40
40
  var top = props.top,
@@ -47,6 +47,7 @@ var FixedTableDiv = exports.FixedTableDiv = function FixedTableDiv(props) {
47
47
  };
48
48
  return (0, _react2.jsx)("div", (0, _extends2.default)({}, attrs, {
49
49
  "data-testid": "sticky-table-fixed",
50
+ className: (0, _table2.isTableResizingEnabled)(rendererAppearance) ? 'fixedTableDiv' : '',
50
51
  css: fixedTableCss
51
52
  }), props.children);
52
53
  };
@@ -9,41 +9,42 @@ exports.default = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
12
- var _react = _interopRequireWildcard(require("react"));
13
- var _react2 = require("@emotion/react");
14
- var _constants = require("@atlaskit/theme/constants");
15
- var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right"));
16
- var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
12
+ var _react = require("@emotion/react");
13
+ var _react2 = _interopRequireWildcard(require("react"));
14
+ var _analytics = require("@atlaskit/editor-common/analytics");
17
15
  var _ui = require("@atlaskit/editor-common/ui");
18
16
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
19
- var _events = require("../analytics/events");
20
- var _analytics = require("@atlaskit/editor-common/analytics");
21
- var _reactIntlNext = require("react-intl-next");
22
- var _activeHeaderIdProvider = require("./active-header-id-provider");
17
+ var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right"));
18
+ var _constants = require("@atlaskit/theme/constants");
19
+ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
23
20
  var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
21
+ var _reactIntlNext = require("react-intl-next");
22
+ var _events = require("../analytics/events");
24
23
  var _utils = require("../utils");
24
+ var _activeHeaderIdProvider = require("./active-header-id-provider");
25
25
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
26
26
  /** @jsx jsx */
27
27
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
28
28
  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); }
29
29
  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; }
30
- var titleStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", ";\n text-align: left;\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _editorSharedStyles.akEditorLineHeight, "var(--ds-space-050, 4px)");
30
+ var titleStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", ";\n text-align: left;\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _editorSharedStyles.akEditorLineHeight, "var(--ds-space-050, 4px)");
31
31
  var Container = function Container(props) {
32
32
  var paddingBottom = props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
33
33
  var sharedContainerStyles = _ui.sharedExpandStyles.containerStyles(props);
34
34
  var styles = function styles() {
35
- return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n padding: 0;\n padding-bottom: ", ";\n "])), sharedContainerStyles(), paddingBottom);
35
+ return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n padding: 0;\n padding-bottom: ", ";\n "])), sharedContainerStyles(), paddingBottom);
36
36
  };
37
- return (0, _react2.jsx)("div", (0, _extends2.default)({
37
+ return (0, _react.jsx)("div", (0, _extends2.default)({
38
38
  css: styles
39
39
  }, props), props.children);
40
40
  };
41
41
  var TitleContainer = function TitleContainer(props) {
42
42
  var paddingBottom = !props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
43
43
  var styles = function styles() {
44
- return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n padding: ", ";\n padding-bottom: ", ";\n "])), _ui.sharedExpandStyles.titleContainerStyles(), "var(--ds-space-100, 8px)", paddingBottom);
44
+ return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n padding: ", ";\n padding-bottom: ", ";\n "])), _ui.sharedExpandStyles.titleContainerStyles(), "var(--ds-space-100, 8px)", paddingBottom);
45
45
  };
46
- return (0, _react2.jsx)("button", (0, _extends2.default)({
46
+ return (0, _react.jsx)("button", (0, _extends2.default)({
47
+ type: "button",
47
48
  css: styles
48
49
  }, props), props.children);
49
50
  };
@@ -52,9 +53,9 @@ var ContentContainer = function ContentContainer(props) {
52
53
  var sharedContentStyles = _ui.sharedExpandStyles.contentStyles(props);
53
54
  var visibility = props.expanded ? 'visible' : 'hidden';
54
55
  var styles = function styles() {
55
- return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n padding-right: ", ";\n // TODO: Migrate away from gridSize\n // Recommendation: Replace gridSize with 8, or directly replace with 36px\n padding-left: ", "px;\n visibility: ", ";\n "])), sharedContentStyles(), "var(--ds-space-200, 16px)", (0, _constants.gridSize)() * 5 - (0, _constants.gridSize)() / 2, visibility);
56
+ return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n padding-right: ", ";\n padding-left: ", ";\n visibility: ", ";\n "])), sharedContentStyles(), "var(--ds-space-200, 16px)", "var(--ds-space-400, 32px)", visibility);
56
57
  };
57
- return (0, _react2.jsx)("div", (0, _extends2.default)({
58
+ return (0, _react.jsx)("div", (0, _extends2.default)({
58
59
  css: styles
59
60
  }, props), props.children);
60
61
  };
@@ -81,39 +82,40 @@ function Expand(_ref) {
81
82
  fireAnalyticsEvent = _ref.fireAnalyticsEvent,
82
83
  nestedHeaderIds = _ref.nestedHeaderIds,
83
84
  rendererAppearance = _ref.rendererAppearance;
84
- var _React$useState = _react.default.useState(false),
85
+ var _React$useState = _react2.default.useState(false),
85
86
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
86
87
  expanded = _React$useState2[0],
87
88
  setExpanded = _React$useState2[1];
88
- var _React$useState3 = _react.default.useState(false),
89
+ var _React$useState3 = _react2.default.useState(false),
89
90
  _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
90
91
  focused = _React$useState4[0],
91
92
  setFocused = _React$useState4[1];
92
- var isMobile = (0, _react.useMemo)(function () {
93
+ var isMobile = (0, _react2.useMemo)(function () {
93
94
  return (0, _utils.getPlatform)(rendererAppearance) === 'mobile';
94
95
  }, [rendererAppearance]);
95
96
  var label = intl.formatMessage(expanded ? _ui.expandMessages.collapseNode : _ui.expandMessages.expandNode);
96
- var _useRef = (0, _react.useRef)((0, _uniqueId2.default)('expand-title-')),
97
+ var _useRef = (0, _react2.useRef)((0, _uniqueId2.default)('expand-title-')),
97
98
  id = _useRef.current;
98
- var handleFocus = (0, _react.useCallback)(function () {
99
+ var handleFocus = (0, _react2.useCallback)(function () {
99
100
  return setFocused(true);
100
101
  }, []);
101
- var handleBlur = (0, _react.useCallback)(function () {
102
+ var handleBlur = (0, _react2.useCallback)(function () {
102
103
  return setFocused(false);
103
104
  }, []);
104
- return (0, _react2.jsx)(Container, {
105
+ return (0, _react.jsx)(Container, {
105
106
  "data-node-type": nodeType,
106
107
  "data-title": title,
107
108
  "data-expanded": expanded,
108
109
  expanded: expanded,
109
110
  focused: focused
110
- }, nestedHeaderIds && nestedHeaderIds.length > 0 ? (0, _react2.jsx)(_activeHeaderIdProvider.ActiveHeaderIdConsumer, {
111
+ }, nestedHeaderIds && nestedHeaderIds.length > 0 ? (0, _react.jsx)(_activeHeaderIdProvider.ActiveHeaderIdConsumer, {
111
112
  nestedHeaderIds: nestedHeaderIds,
112
113
  onNestedHeaderIdMatch: function onNestedHeaderIdMatch() {
113
114
  return setExpanded(true);
114
115
  }
115
- }) : null, (0, _react2.jsx)(TitleContainer, {
116
+ }) : null, (0, _react.jsx)(TitleContainer, {
116
117
  onClick: function onClick(e) {
118
+ e.preventDefault();
117
119
  e.stopPropagation();
118
120
  fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent);
119
121
  setExpanded(!expanded);
@@ -127,27 +129,27 @@ function Expand(_ref) {
127
129
  "aria-expanded": expanded,
128
130
  contentEditable: false,
129
131
  expanded: expanded
130
- }, isMobile ? (0, _react2.jsx)(_ui.ExpandIconWrapper, {
132
+ }, isMobile ? (0, _react.jsx)(_ui.ExpandIconWrapper, {
131
133
  expanded: expanded
132
- }, (0, _react2.jsx)(_chevronRight.default, {
134
+ }, (0, _react.jsx)(_chevronRight.default, {
133
135
  label: label
134
- })) : (0, _react2.jsx)(_tooltip.default, {
136
+ })) : (0, _react.jsx)(_tooltip.default, {
135
137
  content: label,
136
138
  position: "top",
137
139
  tag: _ui.ExpandLayoutWrapperWithRef,
138
140
  testId: 'tooltip'
139
- }, (0, _react2.jsx)(_ui.ExpandIconWrapper, {
141
+ }, (0, _react.jsx)(_ui.ExpandIconWrapper, {
140
142
  expanded: expanded
141
- }, (0, _react2.jsx)(_chevronRight.default, {
143
+ }, (0, _react.jsx)(_chevronRight.default, {
142
144
  label: label
143
- }))), (0, _react2.jsx)("span", {
145
+ }))), (0, _react.jsx)("span", {
144
146
  css: titleStyles,
145
147
  id: id
146
- }, title || intl.formatMessage(_ui.expandMessages.expandDefaultTitle))), (0, _react2.jsx)(ContentContainer, {
148
+ }, title || intl.formatMessage(_ui.expandMessages.expandDefaultTitle))), (0, _react.jsx)(ContentContainer, {
147
149
  expanded: expanded
148
- }, (0, _react2.jsx)("div", {
150
+ }, (0, _react.jsx)("div", {
149
151
  className: "".concat(nodeType, "-content-wrapper")
150
- }, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
152
+ }, (0, _react.jsx)(_ui.WidthProvider, null, (0, _react.jsx)("div", {
151
153
  css: _ui.clearNextSiblingMarginTopStyle
152
154
  }), children))));
153
155
  }
@@ -54,7 +54,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
54
54
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
55
55
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  var packageName = "@atlaskit/renderer";
57
- var packageVersion = "109.2.1";
57
+ var packageVersion = "109.2.3";
58
58
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
59
59
  (0, _inherits2.default)(Renderer, _PureComponent);
60
60
  var _super = _createSuper(Renderer);
@@ -9,7 +9,8 @@ const processLevelsAndTrack = (item, thresholds, dispatchAnalyticsEvent) => {
9
9
  percentage,
10
10
  counts: {
11
11
  supportedNodes,
12
- unsupportedNodes
12
+ unsupportedNodes,
13
+ unsupportedNodeTypeCount
13
14
  }
14
15
  } = getUnsupportedContentLevelData(item.doc, thresholds);
15
16
  dispatchAnalyticsEvent({
@@ -21,7 +22,8 @@ const processLevelsAndTrack = (item, thresholds, dispatchAnalyticsEvent) => {
21
22
  unsupportedContentLevelSeverity: severity,
22
23
  unsupportedContentLevelPercentage: percentage,
23
24
  unsupportedNodesCount: unsupportedNodes,
24
- supportedNodesCount: supportedNodes
25
+ supportedNodesCount: supportedNodes,
26
+ unsupportedNodeTypeCount: unsupportedNodeTypeCount
25
27
  },
26
28
  eventType: EVENT_TYPE.OPERATIONAL
27
29
  });
@@ -61,6 +61,10 @@ const fixedTableDivStaticStyles = (top, width, rendererAppearance) => {
61
61
  top: 0px;
62
62
  height: 100%;
63
63
  }
64
+
65
+ &.fixedTableDiv[mode='stick'] {
66
+ z-index: ${stickyHeaderZIndex};
67
+ }
64
68
  `;
65
69
  };
66
70
  export const FixedTableDiv = props => {
@@ -76,6 +80,7 @@ export const FixedTableDiv = props => {
76
80
  };
77
81
  return jsx("div", _extends({}, attrs, {
78
82
  "data-testid": "sticky-table-fixed",
83
+ className: isTableResizingEnabled(rendererAppearance) ? 'fixedTableDiv' : '',
79
84
  css: fixedTableCss
80
85
  }), props.children);
81
86
  };
@@ -1,19 +1,19 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
- import React, { useRef, useCallback, useMemo } from 'react';
4
3
  import { css, jsx } from '@emotion/react';
4
+ import React, { useCallback, useMemo, useRef } from 'react';
5
5
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
6
- import { gridSize, fontSize } from '@atlaskit/theme/constants';
6
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
7
+ import { clearNextSiblingMarginTopStyle, ExpandIconWrapper, ExpandLayoutWrapperWithRef, expandMessages, sharedExpandStyles, WidthProvider } from '@atlaskit/editor-common/ui';
8
+ import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
7
9
  import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
10
+ import { fontSize } from '@atlaskit/theme/constants';
8
11
  import Tooltip from '@atlaskit/tooltip';
9
- import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, clearNextSiblingMarginTopStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
10
- import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
11
- import { PLATFORM, MODE } from '../analytics/events';
12
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
13
- import { injectIntl } from 'react-intl-next';
14
- import { ActiveHeaderIdConsumer } from './active-header-id-provider';
15
12
  import _uniqueId from 'lodash/uniqueId';
13
+ import { injectIntl } from 'react-intl-next';
14
+ import { MODE, PLATFORM } from '../analytics/events';
16
15
  import { getPlatform } from '../utils';
16
+ import { ActiveHeaderIdConsumer } from './active-header-id-provider';
17
17
  const titleStyles = css`
18
18
  outline: none;
19
19
  border: none;
@@ -46,6 +46,7 @@ const TitleContainer = props => {
46
46
  padding-bottom: ${paddingBottom};
47
47
  `;
48
48
  return jsx("button", _extends({
49
+ type: "button",
49
50
  css: styles
50
51
  }, props), props.children);
51
52
  };
@@ -56,9 +57,7 @@ const ContentContainer = props => {
56
57
  const styles = () => css`
57
58
  ${sharedContentStyles()};
58
59
  padding-right: ${"var(--ds-space-200, 16px)"};
59
- // TODO: Migrate away from gridSize
60
- // Recommendation: Replace gridSize with 8, or directly replace with 36px
61
- padding-left: ${gridSize() * 5 - gridSize() / 2}px;
60
+ padding-left: ${"var(--ds-space-400, 32px)"};
62
61
  visibility: ${visibility};
63
62
  `;
64
63
  return jsx("div", _extends({
@@ -109,6 +108,7 @@ function Expand({
109
108
  onNestedHeaderIdMatch: () => setExpanded(true)
110
109
  }) : null, jsx(TitleContainer, {
111
110
  onClick: e => {
111
+ e.preventDefault();
112
112
  e.stopPropagation();
113
113
  fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent);
114
114
  setExpanded(!expanded);
@@ -35,7 +35,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
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 = "109.2.1";
38
+ const packageVersion = "109.2.3";
39
39
  export class Renderer extends PureComponent {
40
40
  constructor(props) {
41
41
  super(props);
@@ -9,7 +9,8 @@ var processLevelsAndTrack = function processLevelsAndTrack(item, thresholds, dis
9
9
  percentage = _getUnsupportedConten.percentage,
10
10
  _getUnsupportedConten2 = _getUnsupportedConten.counts,
11
11
  supportedNodes = _getUnsupportedConten2.supportedNodes,
12
- unsupportedNodes = _getUnsupportedConten2.unsupportedNodes;
12
+ unsupportedNodes = _getUnsupportedConten2.unsupportedNodes,
13
+ unsupportedNodeTypeCount = _getUnsupportedConten2.unsupportedNodeTypeCount;
13
14
  dispatchAnalyticsEvent({
14
15
  action: ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED,
15
16
  actionSubject: ACTION_SUBJECT.RENDERER,
@@ -19,7 +20,8 @@ var processLevelsAndTrack = function processLevelsAndTrack(item, thresholds, dis
19
20
  unsupportedContentLevelSeverity: severity,
20
21
  unsupportedContentLevelPercentage: percentage,
21
22
  unsupportedNodesCount: unsupportedNodes,
22
- supportedNodesCount: supportedNodes
23
+ supportedNodesCount: supportedNodes,
24
+ unsupportedNodeTypeCount: unsupportedNodeTypeCount
23
25
  },
24
26
  eventType: EVENT_TYPE.OPERATIONAL
25
27
  });
@@ -27,7 +27,7 @@ var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, r
27
27
  } else {
28
28
  stickyHeaderZIndex = akEditorStickyHeaderZIndex;
29
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);
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\n &.fixedTableDiv[mode='stick'] {\n z-index: ", ";\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, stickyHeaderZIndex);
31
31
  };
32
32
  export var FixedTableDiv = function FixedTableDiv(props) {
33
33
  var top = props.top,
@@ -40,6 +40,7 @@ export var FixedTableDiv = function FixedTableDiv(props) {
40
40
  };
41
41
  return jsx("div", _extends({}, attrs, {
42
42
  "data-testid": "sticky-table-fixed",
43
+ className: isTableResizingEnabled(rendererAppearance) ? 'fixedTableDiv' : '',
43
44
  css: fixedTableCss
44
45
  }), props.children);
45
46
  };
@@ -3,20 +3,20 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
4
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
5
5
  /** @jsx jsx */
6
- import React, { useRef, useCallback, useMemo } from 'react';
7
6
  import { css, jsx } from '@emotion/react';
7
+ import React, { useCallback, useMemo, useRef } from 'react';
8
8
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
9
- import { gridSize, fontSize } from '@atlaskit/theme/constants';
9
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
10
+ import { clearNextSiblingMarginTopStyle, ExpandIconWrapper, ExpandLayoutWrapperWithRef, expandMessages, sharedExpandStyles, WidthProvider } from '@atlaskit/editor-common/ui';
11
+ import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
10
12
  import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
13
+ import { fontSize } from '@atlaskit/theme/constants';
11
14
  import Tooltip from '@atlaskit/tooltip';
12
- import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, clearNextSiblingMarginTopStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
13
- import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
14
- import { PLATFORM, MODE } from '../analytics/events';
15
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
16
- import { injectIntl } from 'react-intl-next';
17
- import { ActiveHeaderIdConsumer } from './active-header-id-provider';
18
15
  import _uniqueId from 'lodash/uniqueId';
16
+ import { injectIntl } from 'react-intl-next';
17
+ import { MODE, PLATFORM } from '../analytics/events';
19
18
  import { getPlatform } from '../utils';
19
+ import { ActiveHeaderIdConsumer } from './active-header-id-provider';
20
20
  var titleStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", ";\n text-align: left;\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, "var(--ds-space-050, 4px)");
21
21
  var Container = function Container(props) {
22
22
  var paddingBottom = props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
@@ -34,6 +34,7 @@ var TitleContainer = function TitleContainer(props) {
34
34
  return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", ";\n padding-bottom: ", ";\n "])), sharedExpandStyles.titleContainerStyles(), "var(--ds-space-100, 8px)", paddingBottom);
35
35
  };
36
36
  return jsx("button", _extends({
37
+ type: "button",
37
38
  css: styles
38
39
  }, props), props.children);
39
40
  };
@@ -42,7 +43,7 @@ var ContentContainer = function ContentContainer(props) {
42
43
  var sharedContentStyles = sharedExpandStyles.contentStyles(props);
43
44
  var visibility = props.expanded ? 'visible' : 'hidden';
44
45
  var styles = function styles() {
45
- return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", ";\n // TODO: Migrate away from gridSize\n // Recommendation: Replace gridSize with 8, or directly replace with 36px\n padding-left: ", "px;\n visibility: ", ";\n "])), sharedContentStyles(), "var(--ds-space-200, 16px)", gridSize() * 5 - gridSize() / 2, visibility);
46
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", ";\n padding-left: ", ";\n visibility: ", ";\n "])), sharedContentStyles(), "var(--ds-space-200, 16px)", "var(--ds-space-400, 32px)", visibility);
46
47
  };
47
48
  return jsx("div", _extends({
48
49
  css: styles
@@ -104,6 +105,7 @@ function Expand(_ref) {
104
105
  }
105
106
  }) : null, jsx(TitleContainer, {
106
107
  onClick: function onClick(e) {
108
+ e.preventDefault();
107
109
  e.stopPropagation();
108
110
  fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent);
109
111
  setExpanded(!expanded);
@@ -45,7 +45,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
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 = "109.2.1";
48
+ var packageVersion = "109.2.3";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
@@ -46,6 +46,7 @@ type RendererUnsupportedContentLevelsTrackingSucceeded = AEP<ACTION.UNSUPPORTED_
46
46
  unsupportedContentLevelPercentage: number;
47
47
  unsupportedNodesCount: number;
48
48
  supportedNodesCount: number;
49
+ unsupportedNodeTypeCount: Record<string, number>;
49
50
  }, EVENT_TYPE.OPERATIONAL>;
50
51
  type RendererUnsupportedContentLevelsTrackingErrored = AEP<ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED, ACTION_SUBJECT.RENDERER, undefined, {
51
52
  platform: PLATFORM.WEB;
@@ -1,5 +1,5 @@
1
1
  import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
2
- import { AnalyticsEventPayload } from './events';
2
+ import type { AnalyticsEventPayload } from './events';
3
3
  type DispatchAnalyticsEvent = (event: AnalyticsEventPayload) => void;
4
4
  type DocumentData = {
5
5
  rendererId: string;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { RendererContext } from '../types';
3
- import { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
2
+ import type { RendererContext } from '../types';
3
+ import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
5
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  export interface Props {
7
7
  extensionHandlers?: ExtensionHandlers;
8
8
  providers: ProviderFactory;
@@ -14,5 +14,5 @@ export interface Props {
14
14
  localId?: string;
15
15
  marks?: PMMark[];
16
16
  }
17
- declare const InlineExtension: React.StatelessComponent<Props>;
17
+ declare const InlineExtension: React.FunctionComponent<Props>;
18
18
  export default InlineExtension;
@@ -1,13 +1,13 @@
1
- /** @jsx jsx */
2
1
  import React from 'react';
3
- import type { AnalyticsEventPayload } from '../analytics/events';
4
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { AnalyticsEventPayload } from '../analytics/events';
5
4
  import type { RendererAppearance } from './Renderer/types';
6
5
  export type StyleProps = {
7
6
  expanded?: boolean;
8
7
  focused?: boolean;
9
8
  'data-node-type'?: 'expand' | 'nestedExpand';
10
9
  'data-title'?: string;
10
+ children?: React.ReactNode;
11
11
  };
12
12
  export interface ExpandProps {
13
13
  title: string;
@@ -46,6 +46,7 @@ type RendererUnsupportedContentLevelsTrackingSucceeded = AEP<ACTION.UNSUPPORTED_
46
46
  unsupportedContentLevelPercentage: number;
47
47
  unsupportedNodesCount: number;
48
48
  supportedNodesCount: number;
49
+ unsupportedNodeTypeCount: Record<string, number>;
49
50
  }, EVENT_TYPE.OPERATIONAL>;
50
51
  type RendererUnsupportedContentLevelsTrackingErrored = AEP<ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED, ACTION_SUBJECT.RENDERER, undefined, {
51
52
  platform: PLATFORM.WEB;
@@ -1,5 +1,5 @@
1
1
  import type { UnsupportedContentLevelsTracking } from '@atlaskit/editor-common/utils';
2
- import { AnalyticsEventPayload } from './events';
2
+ import type { AnalyticsEventPayload } from './events';
3
3
  type DispatchAnalyticsEvent = (event: AnalyticsEventPayload) => void;
4
4
  type DocumentData = {
5
5
  rendererId: string;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { RendererContext } from '../types';
3
- import { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
2
+ import type { RendererContext } from '../types';
3
+ import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
5
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  export interface Props {
7
7
  extensionHandlers?: ExtensionHandlers;
8
8
  providers: ProviderFactory;
@@ -14,5 +14,5 @@ export interface Props {
14
14
  localId?: string;
15
15
  marks?: PMMark[];
16
16
  }
17
- declare const InlineExtension: React.StatelessComponent<Props>;
17
+ declare const InlineExtension: React.FunctionComponent<Props>;
18
18
  export default InlineExtension;
@@ -1,13 +1,13 @@
1
- /** @jsx jsx */
2
1
  import React from 'react';
3
- import type { AnalyticsEventPayload } from '../analytics/events';
4
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { AnalyticsEventPayload } from '../analytics/events';
5
4
  import type { RendererAppearance } from './Renderer/types';
6
5
  export type StyleProps = {
7
6
  expanded?: boolean;
8
7
  focused?: boolean;
9
8
  'data-node-type'?: 'expand' | 'nestedExpand';
10
9
  'data-title'?: string;
10
+ children?: React.ReactNode;
11
11
  };
12
12
  export interface ExpandProps {
13
13
  title: string;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "109.2.1",
3
+ "version": "109.2.3",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
7
7
  },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
9
  "author": "Atlassian Pty Ltd",
10
10
  "license": "Apache-2.0",
11
11
  "main": "dist/cjs/index.js",
@@ -27,12 +27,12 @@
27
27
  "dependencies": {
28
28
  "@atlaskit/adf-schema": "^35.3.0",
29
29
  "@atlaskit/adf-utils": "^19.0.0",
30
- "@atlaskit/analytics-listeners": "^8.7.0",
31
- "@atlaskit/analytics-namespaced-context": "^6.7.0",
30
+ "@atlaskit/analytics-listeners": "^8.9.0",
31
+ "@atlaskit/analytics-namespaced-context": "^6.9.0",
32
32
  "@atlaskit/analytics-next": "^9.1.0",
33
33
  "@atlaskit/button": "^17.2.0",
34
34
  "@atlaskit/code": "^15.1.0",
35
- "@atlaskit/editor-common": "^76.35.0",
35
+ "@atlaskit/editor-common": "^76.39.0",
36
36
  "@atlaskit/editor-json-transformer": "^8.10.0",
37
37
  "@atlaskit/editor-palette": "1.5.2",
38
38
  "@atlaskit/editor-prosemirror": "1.1.0",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/emoji": "^67.6.0",
41
41
  "@atlaskit/icon": "^22.0.0",
42
42
  "@atlaskit/link-datasource": "^1.19.0",
43
- "@atlaskit/media-card": "^77.6.0",
43
+ "@atlaskit/media-card": "^77.7.0",
44
44
  "@atlaskit/media-client": "^26.1.0",
45
45
  "@atlaskit/media-client-react": "^2.0.0",
46
46
  "@atlaskit/media-common": "^11.0.0",