@atlaskit/renderer 109.32.1 → 109.32.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,23 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 109.32.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#109969](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109969)
8
+ [`52590a0b562ef`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52590a0b562ef) -
9
+ ED-23690 Adds an attribute to annotation analytic events with the name of nodes inside the
10
+ annotation range
11
+ - Updated dependencies
12
+
13
+ ## 109.32.2
14
+
15
+ ### Patch Changes
16
+
17
+ - [#109033](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109033)
18
+ [`046555d9a96ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/046555d9a96ea) -
19
+ Converts LD flag to an experiment for Preserve Table Widths part two feature.
20
+
3
21
  ## 109.32.1
4
22
 
5
23
  ### Patch Changes
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getRendererRangeInlineNodeNames = getRendererRangeInlineNodeNames;
7
+ var _utils = require("@atlaskit/editor-common/utils");
8
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
+ function getRendererRangeInlineNodeNames(_ref) {
10
+ var actions = _ref.actions,
11
+ pos = _ref.pos;
12
+ if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
13
+ return undefined;
14
+ }
15
+ var doc = actions.doc;
16
+ if (!pos || !doc) {
17
+ return undefined;
18
+ }
19
+ var inlineNodeNames = (0, _utils.getRangeInlineNodeNames)({
20
+ doc: doc,
21
+ pos: pos
22
+ });
23
+ return inlineNodeNames;
24
+ }
@@ -16,6 +16,7 @@ var _transform = require("@atlaskit/editor-prosemirror/transform");
16
16
  var _steps = require("../steps");
17
17
  var _analytics = require("@atlaskit/editor-common/analytics");
18
18
  var _matchesUtils = require("./matches-utils");
19
+ var _getRendererRangeInlineNodeNames = require("./get-renderer-range-inline-node-names");
19
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
22
  var RendererActions = exports.default = /*#__PURE__*/function () {
@@ -116,7 +117,16 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
116
117
  action: _analytics.ACTION.DELETED,
117
118
  actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
118
119
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
119
- eventType: _analytics.EVENT_TYPE.TRACK
120
+ eventType: _analytics.EVENT_TYPE.TRACK,
121
+ attributes: {
122
+ inlineNodeNames: step instanceof _transform.RemoveMarkStep ? (0, _getRendererRangeInlineNodeNames.getRendererRangeInlineNodeNames)({
123
+ pos: {
124
+ from: from,
125
+ to: to
126
+ },
127
+ actions: this
128
+ }) : undefined
129
+ }
120
130
  };
121
131
  this.onAnalyticsEvent(payload);
122
132
  }
@@ -169,6 +179,10 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
169
179
  }
170
180
  return this._privateValidatePositionsForAnnotation(pos.from, pos.to);
171
181
  }
182
+
183
+ /**
184
+ * Note: False indicates that the selection not able to be calculated.
185
+ */
172
186
  }, {
173
187
  key: "getPositionFromRange",
174
188
  value: function getPositionFromRange(range, isCommentsOnMediaBugFixEnabled, isCommentsOnMediaBugVideoComment) {
@@ -62,7 +62,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
62
62
  rendererAppearance = props.rendererAppearance,
63
63
  isInsideOfBlockNode = props.isInsideOfBlockNode,
64
64
  isinsideMultiBodiedExtension = props.isinsideMultiBodiedExtension,
65
- isTableScalingEnabled = props.isTableScalingEnabled;
65
+ isTableScalingEnabled = props.isTableScalingEnabled,
66
+ isTableFixedColumnWidthsOptionEnabled = props.isTableFixedColumnWidthsOptionEnabled;
66
67
  if (!columnWidths) {
67
68
  return [];
68
69
  }
@@ -128,9 +129,9 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
128
129
  });
129
130
  var cellMinWidth = 0;
130
131
  var scaleDownPercent = 0;
131
- var isTableWithLockButtonEnabled = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button') && isTableScalingEnabled;
132
- var isTableWidthFixed = isTableWithLockButtonEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
133
- var maxScalingPercent = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent') && isTableWithLockButtonEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
132
+ var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
133
+ var isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
134
+ var maxScalingPercent = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent') && isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
134
135
 
135
136
  // fixes migration tables with zero-width columns
136
137
  if (zeroWidthColumnsCount > 0) {
@@ -163,7 +164,8 @@ var Colgroup = exports.Colgroup = function Colgroup(props) {
163
164
  return null;
164
165
  }
165
166
  var colStyles = renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
166
- isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth)
167
+ isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth),
168
+ isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption)
167
169
  }));
168
170
  if (!colStyles) {
169
171
  return null;
@@ -56,7 +56,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
56
56
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
57
57
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
58
58
  var packageName = "@atlaskit/renderer";
59
- var packageVersion = "109.32.1";
59
+ var packageVersion = "109.32.3";
60
60
  var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
61
61
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
62
62
  (0, _inherits2.default)(Renderer, _PureComponent);
@@ -12,6 +12,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
12
12
  var _draft = require("../draft");
13
13
  var _analyticsListeners = require("@atlaskit/analytics-listeners");
14
14
  var _analytics = require("@atlaskit/editor-common/analytics");
15
+ var _getRendererRangeInlineNodeNames = require("../../../actions/get-renderer-range-inline-node-names");
15
16
  var _RendererActionsContext = require("../../RendererActionsContext");
16
17
  var _context = require("../context");
17
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -58,7 +59,12 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
58
59
  action: _analytics.ACTION.INSERTED,
59
60
  actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
60
61
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
61
- attributes: {},
62
+ attributes: {
63
+ inlineNodeNames: (0, _getRendererRangeInlineNodeNames.getRendererRangeInlineNodeNames)({
64
+ pos: positionToAnnotate,
65
+ actions: actions
66
+ })
67
+ },
62
68
  eventType: _analytics.EVENT_TYPE.TRACK
63
69
  }).fire(_analyticsListeners.FabricChannel.editor);
64
70
  }
@@ -81,7 +87,12 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
81
87
  action: _analytics.ACTION.CREATE_NOT_ALLOWED,
82
88
  actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
83
89
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
84
- attributes: {},
90
+ attributes: {
91
+ inlineNodeNames: (0, _getRendererRangeInlineNodeNames.getRendererRangeInlineNodeNames)({
92
+ pos: documentPosition,
93
+ actions: actions
94
+ })
95
+ },
85
96
  eventType: _analytics.EVENT_TYPE.TRACK
86
97
  }).fire(_analyticsListeners.FabricChannel.editor);
87
98
  }
@@ -97,7 +108,11 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
97
108
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
98
109
  eventType: _analytics.EVENT_TYPE.TRACK,
99
110
  attributes: {
100
- overlap: uniqueAnnotationsInRange.length
111
+ overlap: uniqueAnnotationsInRange.length,
112
+ inlineNodeNames: (0, _getRendererRangeInlineNodeNames.getRendererRangeInlineNodeNames)({
113
+ pos: documentPosition,
114
+ actions: actions
115
+ })
101
116
  }
102
117
  }).fire(_analyticsListeners.FabricChannel.editor);
103
118
  }
@@ -136,12 +151,17 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
136
151
  actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
137
152
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
138
153
  eventType: _analytics.EVENT_TYPE.TRACK,
139
- attributes: {}
154
+ attributes: {
155
+ inlineNodeNames: (0, _getRendererRangeInlineNodeNames.getRendererRangeInlineNodeNames)({
156
+ pos: documentPosition,
157
+ actions: actions
158
+ })
159
+ }
140
160
  }).fire(_analyticsListeners.FabricChannel.editor);
141
161
  }
142
162
  removeDraftModeCallback();
143
163
  onCloseProps();
144
- }, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
164
+ }, [actions, documentPosition, onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
145
165
  return /*#__PURE__*/_react.default.createElement(Component, {
146
166
  range: range,
147
167
  draftRange: draftRange,
@@ -0,0 +1,19 @@
1
+ import { getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
2
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
+ export function getRendererRangeInlineNodeNames({
4
+ actions,
5
+ pos
6
+ }) {
7
+ if (!getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
8
+ return undefined;
9
+ }
10
+ const doc = actions.doc;
11
+ if (!pos || !doc) {
12
+ return undefined;
13
+ }
14
+ const inlineNodeNames = getRangeInlineNodeNames({
15
+ doc,
16
+ pos
17
+ });
18
+ return inlineNodeNames;
19
+ }
@@ -6,6 +6,7 @@ import { AddNodeMarkStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/e
6
6
  import { createAnnotationStep, getPosFromRange } from '../steps';
7
7
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
8
8
  import { getIndexMatch } from './matches-utils';
9
+ import { getRendererRangeInlineNodeNames } from './get-renderer-range-inline-node-names';
9
10
  export default class RendererActions {
10
11
  // Any kind of refence is allowed
11
12
 
@@ -96,7 +97,16 @@ export default class RendererActions {
96
97
  action: ACTION.DELETED,
97
98
  actionSubject: ACTION_SUBJECT.ANNOTATION,
98
99
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
99
- eventType: EVENT_TYPE.TRACK
100
+ eventType: EVENT_TYPE.TRACK,
101
+ attributes: {
102
+ inlineNodeNames: step instanceof RemoveMarkStep ? getRendererRangeInlineNodeNames({
103
+ pos: {
104
+ from: from,
105
+ to: to
106
+ },
107
+ actions: this
108
+ }) : undefined
109
+ }
100
110
  };
101
111
  this.onAnalyticsEvent(payload);
102
112
  }
@@ -145,6 +155,10 @@ export default class RendererActions {
145
155
  }
146
156
  return this._privateValidatePositionsForAnnotation(pos.from, pos.to);
147
157
  }
158
+
159
+ /**
160
+ * Note: False indicates that the selection not able to be calculated.
161
+ */
148
162
  getPositionFromRange(range, isCommentsOnMediaBugFixEnabled, isCommentsOnMediaBugVideoComment) {
149
163
  if (!this.doc || !this.schema || !range) {
150
164
  return false;
@@ -48,7 +48,8 @@ const renderScaleDownColgroup = props => {
48
48
  rendererAppearance,
49
49
  isInsideOfBlockNode,
50
50
  isinsideMultiBodiedExtension,
51
- isTableScalingEnabled
51
+ isTableScalingEnabled,
52
+ isTableFixedColumnWidthsOptionEnabled
52
53
  } = props;
53
54
  if (!columnWidths) {
54
55
  return [];
@@ -115,9 +116,9 @@ const renderScaleDownColgroup = props => {
115
116
  });
116
117
  let cellMinWidth = 0;
117
118
  let scaleDownPercent = 0;
118
- const isTableWithLockButtonEnabled = getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && isTableScalingEnabled;
119
- const isTableWidthFixed = isTableWithLockButtonEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
120
- const maxScalingPercent = getBooleanFF('platform.editor.table.use-increased-scaling-percent') && isTableWithLockButtonEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
119
+ const isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
120
+ const isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
121
+ const maxScalingPercent = getBooleanFF('platform.editor.table.use-increased-scaling-percent') && isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
121
122
 
122
123
  // fixes migration tables with zero-width columns
123
124
  if (zeroWidthColumnsCount > 0) {
@@ -153,7 +154,8 @@ export const Colgroup = props => {
153
154
  }
154
155
  const colStyles = renderScaleDownColgroup({
155
156
  ...props,
156
- isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth)
157
+ isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth),
158
+ isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption)
157
159
  });
158
160
  if (!colStyles) {
159
161
  return null;
@@ -37,7 +37,7 @@ import { nodeToReact } from '../../react/nodes';
37
37
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
38
38
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
39
39
  const packageName = "@atlaskit/renderer";
40
- const packageVersion = "109.32.1";
40
+ const packageVersion = "109.32.3";
41
41
  export const defaultNodeComponents = nodeToReact;
42
42
  export class Renderer extends PureComponent {
43
43
  constructor(props) {
@@ -3,6 +3,7 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
3
3
  import { updateWindowSelectionAroundDraft } from '../draft';
4
4
  import { FabricChannel } from '@atlaskit/analytics-listeners';
5
5
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
6
+ import { getRendererRangeInlineNodeNames } from '../../../actions/get-renderer-range-inline-node-names';
6
7
  import { RendererContext as ActionsContext } from '../../RendererActionsContext';
7
8
  import { ProvidersContext } from '../context';
8
9
  export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
@@ -46,7 +47,12 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
46
47
  action: ACTION.INSERTED,
47
48
  actionSubject: ACTION_SUBJECT.ANNOTATION,
48
49
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
49
- attributes: {},
50
+ attributes: {
51
+ inlineNodeNames: getRendererRangeInlineNodeNames({
52
+ pos: positionToAnnotate,
53
+ actions
54
+ })
55
+ },
50
56
  eventType: EVENT_TYPE.TRACK
51
57
  }).fire(FabricChannel.editor);
52
58
  }
@@ -69,7 +75,12 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
69
75
  action: ACTION.CREATE_NOT_ALLOWED,
70
76
  actionSubject: ACTION_SUBJECT.ANNOTATION,
71
77
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
72
- attributes: {},
78
+ attributes: {
79
+ inlineNodeNames: getRendererRangeInlineNodeNames({
80
+ pos: documentPosition,
81
+ actions
82
+ })
83
+ },
73
84
  eventType: EVENT_TYPE.TRACK
74
85
  }).fire(FabricChannel.editor);
75
86
  }
@@ -85,7 +96,11 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
85
96
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
86
97
  eventType: EVENT_TYPE.TRACK,
87
98
  attributes: {
88
- overlap: uniqueAnnotationsInRange.length
99
+ overlap: uniqueAnnotationsInRange.length,
100
+ inlineNodeNames: getRendererRangeInlineNodeNames({
101
+ pos: documentPosition,
102
+ actions
103
+ })
89
104
  }
90
105
  }).fire(FabricChannel.editor);
91
106
  }
@@ -124,12 +139,17 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
124
139
  actionSubject: ACTION_SUBJECT.ANNOTATION,
125
140
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
126
141
  eventType: EVENT_TYPE.TRACK,
127
- attributes: {}
142
+ attributes: {
143
+ inlineNodeNames: getRendererRangeInlineNodeNames({
144
+ pos: documentPosition,
145
+ actions
146
+ })
147
+ }
128
148
  }).fire(FabricChannel.editor);
129
149
  }
130
150
  removeDraftModeCallback();
131
151
  onCloseProps();
132
- }, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
152
+ }, [actions, documentPosition, onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
133
153
  return /*#__PURE__*/React.createElement(Component, {
134
154
  range: range,
135
155
  draftRange: draftRange,
@@ -0,0 +1,18 @@
1
+ import { getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
2
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
+ export function getRendererRangeInlineNodeNames(_ref) {
4
+ var actions = _ref.actions,
5
+ pos = _ref.pos;
6
+ if (!getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
7
+ return undefined;
8
+ }
9
+ var doc = actions.doc;
10
+ if (!pos || !doc) {
11
+ return undefined;
12
+ }
13
+ var inlineNodeNames = getRangeInlineNodeNames({
14
+ doc: doc,
15
+ pos: pos
16
+ });
17
+ return inlineNodeNames;
18
+ }
@@ -11,6 +11,7 @@ import { AddNodeMarkStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/e
11
11
  import { createAnnotationStep, getPosFromRange } from '../steps';
12
12
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
13
13
  import { getIndexMatch } from './matches-utils';
14
+ import { getRendererRangeInlineNodeNames } from './get-renderer-range-inline-node-names';
14
15
  var RendererActions = /*#__PURE__*/function () {
15
16
  // Any kind of refence is allowed
16
17
 
@@ -109,7 +110,16 @@ var RendererActions = /*#__PURE__*/function () {
109
110
  action: ACTION.DELETED,
110
111
  actionSubject: ACTION_SUBJECT.ANNOTATION,
111
112
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
112
- eventType: EVENT_TYPE.TRACK
113
+ eventType: EVENT_TYPE.TRACK,
114
+ attributes: {
115
+ inlineNodeNames: step instanceof RemoveMarkStep ? getRendererRangeInlineNodeNames({
116
+ pos: {
117
+ from: from,
118
+ to: to
119
+ },
120
+ actions: this
121
+ }) : undefined
122
+ }
113
123
  };
114
124
  this.onAnalyticsEvent(payload);
115
125
  }
@@ -162,6 +172,10 @@ var RendererActions = /*#__PURE__*/function () {
162
172
  }
163
173
  return this._privateValidatePositionsForAnnotation(pos.from, pos.to);
164
174
  }
175
+
176
+ /**
177
+ * Note: False indicates that the selection not able to be calculated.
178
+ */
165
179
  }, {
166
180
  key: "getPositionFromRange",
167
181
  value: function getPositionFromRange(range, isCommentsOnMediaBugFixEnabled, isCommentsOnMediaBugVideoComment) {
@@ -55,7 +55,8 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
55
55
  rendererAppearance = props.rendererAppearance,
56
56
  isInsideOfBlockNode = props.isInsideOfBlockNode,
57
57
  isinsideMultiBodiedExtension = props.isinsideMultiBodiedExtension,
58
- isTableScalingEnabled = props.isTableScalingEnabled;
58
+ isTableScalingEnabled = props.isTableScalingEnabled,
59
+ isTableFixedColumnWidthsOptionEnabled = props.isTableFixedColumnWidthsOptionEnabled;
59
60
  if (!columnWidths) {
60
61
  return [];
61
62
  }
@@ -121,9 +122,9 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
121
122
  });
122
123
  var cellMinWidth = 0;
123
124
  var scaleDownPercent = 0;
124
- var isTableWithLockButtonEnabled = getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && isTableScalingEnabled;
125
- var isTableWidthFixed = isTableWithLockButtonEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
126
- var maxScalingPercent = getBooleanFF('platform.editor.table.use-increased-scaling-percent') && isTableWithLockButtonEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
125
+ var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
126
+ var isTableWidthFixed = isTableScalingWithFixedColumnWidthsOptionEnabled && ((_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.attrs.displayMode) === 'fixed';
127
+ var maxScalingPercent = getBooleanFF('platform.editor.table.use-increased-scaling-percent') && isTableScalingWithFixedColumnWidthsOptionEnabled ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
127
128
 
128
129
  // fixes migration tables with zero-width columns
129
130
  if (zeroWidthColumnsCount > 0) {
@@ -156,7 +157,8 @@ export var Colgroup = function Colgroup(props) {
156
157
  return null;
157
158
  }
158
159
  var colStyles = renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
159
- isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth)
160
+ isTableScalingEnabled: !!(flags && 'tablePreserveWidth' in flags && flags.tablePreserveWidth),
161
+ isTableFixedColumnWidthsOptionEnabled: !!(flags && 'tableWithFixedColumnWidthsOption' in flags && flags.tableWithFixedColumnWidthsOption)
160
162
  }));
161
163
  if (!colStyles) {
162
164
  return null;
@@ -47,7 +47,7 @@ import { nodeToReact } from '../../react/nodes';
47
47
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
48
48
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
49
49
  var packageName = "@atlaskit/renderer";
50
- var packageVersion = "109.32.1";
50
+ var packageVersion = "109.32.3";
51
51
  export var defaultNodeComponents = nodeToReact;
52
52
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
53
53
  _inherits(Renderer, _PureComponent);
@@ -4,6 +4,7 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
4
4
  import { updateWindowSelectionAroundDraft } from '../draft';
5
5
  import { FabricChannel } from '@atlaskit/analytics-listeners';
6
6
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
7
+ import { getRendererRangeInlineNodeNames } from '../../../actions/get-renderer-range-inline-node-names';
7
8
  import { RendererContext as ActionsContext } from '../../RendererActionsContext';
8
9
  import { ProvidersContext } from '../context';
9
10
  export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (props) {
@@ -48,7 +49,12 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
48
49
  action: ACTION.INSERTED,
49
50
  actionSubject: ACTION_SUBJECT.ANNOTATION,
50
51
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
51
- attributes: {},
52
+ attributes: {
53
+ inlineNodeNames: getRendererRangeInlineNodeNames({
54
+ pos: positionToAnnotate,
55
+ actions: actions
56
+ })
57
+ },
52
58
  eventType: EVENT_TYPE.TRACK
53
59
  }).fire(FabricChannel.editor);
54
60
  }
@@ -71,7 +77,12 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
71
77
  action: ACTION.CREATE_NOT_ALLOWED,
72
78
  actionSubject: ACTION_SUBJECT.ANNOTATION,
73
79
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
74
- attributes: {},
80
+ attributes: {
81
+ inlineNodeNames: getRendererRangeInlineNodeNames({
82
+ pos: documentPosition,
83
+ actions: actions
84
+ })
85
+ },
75
86
  eventType: EVENT_TYPE.TRACK
76
87
  }).fire(FabricChannel.editor);
77
88
  }
@@ -87,7 +98,11 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
87
98
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
88
99
  eventType: EVENT_TYPE.TRACK,
89
100
  attributes: {
90
- overlap: uniqueAnnotationsInRange.length
101
+ overlap: uniqueAnnotationsInRange.length,
102
+ inlineNodeNames: getRendererRangeInlineNodeNames({
103
+ pos: documentPosition,
104
+ actions: actions
105
+ })
91
106
  }
92
107
  }).fire(FabricChannel.editor);
93
108
  }
@@ -126,12 +141,17 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
126
141
  actionSubject: ACTION_SUBJECT.ANNOTATION,
127
142
  actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
128
143
  eventType: EVENT_TYPE.TRACK,
129
- attributes: {}
144
+ attributes: {
145
+ inlineNodeNames: getRendererRangeInlineNodeNames({
146
+ pos: documentPosition,
147
+ actions: actions
148
+ })
149
+ }
130
150
  }).fire(FabricChannel.editor);
131
151
  }
132
152
  removeDraftModeCallback();
133
153
  onCloseProps();
134
- }, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
154
+ }, [actions, documentPosition, onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
135
155
  return /*#__PURE__*/React.createElement(Component, {
136
156
  range: range,
137
157
  draftRange: draftRange,
@@ -0,0 +1,12 @@
1
+ import type RendererActions from './index';
2
+ export declare function getRendererRangeInlineNodeNames({ actions, pos, }: {
3
+ actions: RendererActions;
4
+ /**
5
+ * documentPosition is caclulated by `actions.getPositionFromRange`
6
+ * where `false` means that the selection is not able to be calculated.
7
+ */
8
+ pos?: {
9
+ from: number;
10
+ to: number;
11
+ } | false;
12
+ }): string[] | undefined;
@@ -52,6 +52,9 @@ export default class RendererActions implements RendererActionsOptions, Annotati
52
52
  annotate(range: Range, annotationId: string, annotationType: 'inlineComment'): AnnotationActionResult;
53
53
  isValidAnnotationRange(range: Range | null): boolean;
54
54
  isValidAnnotationPosition(pos: Position): boolean;
55
+ /**
56
+ * Note: False indicates that the selection not able to be calculated.
57
+ */
55
58
  getPositionFromRange(range: Range | null, isCommentsOnMediaBugFixEnabled?: boolean, isCommentsOnMediaBugVideoComment?: boolean): Position | false;
56
59
  getAnnotationMarks(): Mark[];
57
60
  getAnnotationsByPosition(range: Range): string[];
@@ -104,7 +104,9 @@ export type AnnotationDraftAEPAttributes = {
104
104
  export type AnnotationResolvedAEPAttributes = {
105
105
  method?: RESOLVE_METHOD;
106
106
  };
107
- export type AnnotationDeleteAEP = AEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID, undefined, EVENT_TYPE.TRACK>;
107
+ export type AnnotationDeleteAEP = AEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID, {
108
+ inlineNodeNames?: string[];
109
+ }, EVENT_TYPE.TRACK>;
108
110
  export declare enum RESOLVE_METHOD {
109
111
  COMPONENT = "component",
110
112
  CONSUMER = "consumer",
@@ -0,0 +1,12 @@
1
+ import type RendererActions from './index';
2
+ export declare function getRendererRangeInlineNodeNames({ actions, pos, }: {
3
+ actions: RendererActions;
4
+ /**
5
+ * documentPosition is caclulated by `actions.getPositionFromRange`
6
+ * where `false` means that the selection is not able to be calculated.
7
+ */
8
+ pos?: {
9
+ from: number;
10
+ to: number;
11
+ } | false;
12
+ }): string[] | undefined;
@@ -52,6 +52,9 @@ export default class RendererActions implements RendererActionsOptions, Annotati
52
52
  annotate(range: Range, annotationId: string, annotationType: 'inlineComment'): AnnotationActionResult;
53
53
  isValidAnnotationRange(range: Range | null): boolean;
54
54
  isValidAnnotationPosition(pos: Position): boolean;
55
+ /**
56
+ * Note: False indicates that the selection not able to be calculated.
57
+ */
55
58
  getPositionFromRange(range: Range | null, isCommentsOnMediaBugFixEnabled?: boolean, isCommentsOnMediaBugVideoComment?: boolean): Position | false;
56
59
  getAnnotationMarks(): Mark[];
57
60
  getAnnotationsByPosition(range: Range): string[];
@@ -104,7 +104,9 @@ export type AnnotationDraftAEPAttributes = {
104
104
  export type AnnotationResolvedAEPAttributes = {
105
105
  method?: RESOLVE_METHOD;
106
106
  };
107
- export type AnnotationDeleteAEP = AEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID, undefined, EVENT_TYPE.TRACK>;
107
+ export type AnnotationDeleteAEP = AEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID, {
108
+ inlineNodeNames?: string[];
109
+ }, EVENT_TYPE.TRACK>;
108
110
  export declare enum RESOLVE_METHOD {
109
111
  COMPONENT = "component",
110
112
  CONSUMER = "consumer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "109.32.1",
3
+ "version": "109.32.3",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/analytics-next": "^9.3.0",
32
32
  "@atlaskit/button": "^17.17.0",
33
33
  "@atlaskit/code": "^15.2.0",
34
- "@atlaskit/editor-common": "^82.2.0",
34
+ "@atlaskit/editor-common": "^82.3.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.13.0",
36
36
  "@atlaskit/editor-palette": "1.6.0",
37
37
  "@atlaskit/editor-prosemirror": "4.0.1",
@@ -51,7 +51,7 @@
51
51
  "@atlaskit/status": "^1.4.0",
52
52
  "@atlaskit/task-decision": "^17.10.0",
53
53
  "@atlaskit/theme": "^12.9.0",
54
- "@atlaskit/tokens": "^1.49.0",
54
+ "@atlaskit/tokens": "^1.50.0",
55
55
  "@atlaskit/tooltip": "^18.4.0",
56
56
  "@babel/runtime": "^7.0.0",
57
57
  "@emotion/react": "^11.7.1",
@@ -139,9 +139,6 @@
139
139
  "platform.editor.scale-table-when-number-column-in-table-resized_y4qh2": {
140
140
  "type": "boolean"
141
141
  },
142
- "platform.editor.table.preserve-widths-with-lock-button": {
143
- "type": "boolean"
144
- },
145
142
  "platform.editor.table.use-increased-scaling-percent": {
146
143
  "type": "boolean"
147
144
  },