@atlaskit/renderer 123.1.0 → 123.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 123.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`7d5ceec8d7064`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7d5ceec8d7064) -
8
+ Removed feature gates for cleanup
9
+
10
+ ## 123.1.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [`0b31405e5ec3b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0b31405e5ec3b) -
15
+ Add local-id data attribute on nodes
16
+ - Updated dependencies
17
+
3
18
  ## 123.1.0
4
19
 
5
20
  ### Minor Changes
@@ -38,6 +38,7 @@ var renderExtension = exports.renderExtension = function renderExtension(content
38
38
  var extensionId = arguments.length > 4 ? arguments[4] : undefined;
39
39
  var extensionViewportSizes = arguments.length > 5 ? arguments[5] : undefined;
40
40
  var nodeHeight = arguments.length > 6 ? arguments[6] : undefined;
41
+ var localId = arguments.length > 7 ? arguments[7] : undefined;
41
42
  var overflowContainerClass = !removeOverflow ? _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER : '';
42
43
 
43
44
  // by default, we assume the extension is at top level, (direct child of doc node)
@@ -66,7 +67,8 @@ var renderExtension = exports.renderExtension = function renderExtension(content
66
67
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
67
68
  minHeight: "".concat(extensionHeight, "px")
68
69
  },
69
- "data-layout": layout
70
+ "data-layout": layout,
71
+ "data-local-id": localId
70
72
  }, /*#__PURE__*/_react.default.createElement("div", {
71
73
  className: overflowContainerClass
72
74
  }, content));
@@ -82,7 +84,8 @@ var Extension = function Extension(props) {
82
84
  path = _props$path === void 0 ? [] : _props$path,
83
85
  extensionViewportSizes = props.extensionViewportSizes,
84
86
  parameters = props.parameters,
85
- nodeHeight = props.nodeHeight;
87
+ nodeHeight = props.nodeHeight,
88
+ localId = props.localId;
86
89
  return /*#__PURE__*/_react.default.createElement(_ExtensionRenderer.default
87
90
  // Ignored via go/ees005
88
91
  // eslint-disable-next-line react/jsx-props-no-spreading
@@ -97,7 +100,7 @@ var Extension = function Extension(props) {
97
100
  isTopLevel: path.length < 1,
98
101
  handleRef: handleRef,
99
102
  shadowClassNames: shadowClassNames
100
- }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight);
103
+ }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId);
101
104
  }
102
105
  } catch (e) {
103
106
  /** We don't want this error to block renderer */
@@ -108,7 +111,7 @@ var Extension = function Extension(props) {
108
111
  isTopLevel: path.length < 1,
109
112
  handleRef: handleRef,
110
113
  shadowClassNames: shadowClassNames
111
- }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight);
114
+ }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId);
112
115
  });
113
116
  };
114
117
  var _default = exports.default = (0, _ui.overflowShadow)(Extension, {
@@ -184,6 +184,7 @@ function Expand(_ref) {
184
184
  nodeType = _ref.nodeType,
185
185
  intl = _ref.intl,
186
186
  fireAnalyticsEvent = _ref.fireAnalyticsEvent,
187
+ localId = _ref.localId,
187
188
  nestedHeaderIds = _ref.nestedHeaderIds,
188
189
  rendererAppearance = _ref.rendererAppearance;
189
190
  var _React$useState = _react2.default.useState(false),
@@ -209,6 +210,7 @@ function Expand(_ref) {
209
210
  "data-node-type": nodeType,
210
211
  "data-title": title,
211
212
  "data-expanded": expanded,
213
+ "data-local-id": localId,
212
214
  expanded: expanded,
213
215
  focused: focused
214
216
  }, nestedHeaderIds && nestedHeaderIds.length > 0 ? (0, _react.jsx)(_activeHeaderIdProvider.ActiveHeaderIdConsumer, {
@@ -218,7 +218,8 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
218
218
  ssr = _this$props4.ssr,
219
219
  mediaClient = _this$props4.mediaClient,
220
220
  dataAttributes = _this$props4.dataAttributes,
221
- enableSyncMediaCard = _this$props4.enableSyncMediaCard;
221
+ enableSyncMediaCard = _this$props4.enableSyncMediaCard,
222
+ localId = _this$props4.localId;
222
223
  if (imageStatus === 'loading' || !url) {
223
224
  return this.renderLoadingCard();
224
225
  }
@@ -236,7 +237,8 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
236
237
  // Ignored via go/ees005
237
238
  // eslint-disable-next-line react/jsx-props-no-spreading
238
239
  _react.default.createElement("div", (0, _extends2.default)({}, dataAttributes, {
239
- "data-node-type": "media"
240
+ "data-node-type": "media",
241
+ "data-local-id": localId
240
242
  }), /*#__PURE__*/_react.default.createElement(Card
241
243
  // TODO: MPT-315 - clean up after we move mediaClientConfig into FileIdentifier
242
244
  // context is not really used when the type is external and we want to render the component asap
@@ -281,7 +283,8 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
281
283
  ssr = _this$props5.ssr,
282
284
  mediaClient = _this$props5.mediaClient,
283
285
  dataAttributes = _this$props5.dataAttributes,
284
- enableSyncMediaCard = _this$props5.enableSyncMediaCard;
286
+ enableSyncMediaCard = _this$props5.enableSyncMediaCard,
287
+ localId = _this$props5.localId;
285
288
  var isMobile = false;
286
289
  var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
287
290
  var isInlinePlayer = isMobile ? false : shouldPlayInline;
@@ -317,7 +320,9 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
317
320
  contextIdentifierProvider: contextIdentifierProvider,
318
321
  originalDimensions: originalDimensions,
319
322
  fileState: fileState
320
- }), dataAttributes), /*#__PURE__*/_react.default.createElement(Card, {
323
+ }), dataAttributes, {
324
+ "data-local-id": localId
325
+ }), /*#__PURE__*/_react.default.createElement(Card, {
321
326
  identifier: identifier,
322
327
  alt: alt,
323
328
  contextId: contextId,
@@ -63,7 +63,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
63
63
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
64
64
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
65
65
  var packageName = "@atlaskit/renderer";
66
- var packageVersion = "123.0.0";
66
+ var packageVersion = "123.1.1";
67
67
  var setAsQueryContainerStyles = (0, _react2.css)({
68
68
  containerName: 'ak-renderer-wrapper',
69
69
  containerType: 'inline-size'
@@ -12,7 +12,6 @@ var _types = require("@atlaskit/editor-common/types");
12
12
  var _adfSchema = require("@atlaskit/adf-schema");
13
13
  var _analytics = require("@atlaskit/editor-common/analytics");
14
14
  var _types2 = require("@atlaskit/analytics-listeners/types");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _AnnotationManagerContext = require("../contexts/AnnotationManagerContext");
17
16
  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; }
18
17
  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; }
@@ -97,9 +96,6 @@ var useHasFocusEvent = exports.useHasFocusEvent = function useHasFocusEvent(_ref
97
96
  };
98
97
  var removeHoverEffect = function removeHoverEffect() {
99
98
  setIsHovered(false);
100
- if (document.activeElement instanceof HTMLElement && !(0, _platformFeatureFlags.fg)('confluence_frontend_comments_panel_editor_focus')) {
101
- document.activeElement.blur();
102
- }
103
99
  };
104
100
  if (!isAnnotationManagerEnabled) {
105
101
  updateSubscriber.on(_types.AnnotationUpdateEvent.SET_ANNOTATION_FOCUS, cb);
@@ -12,7 +12,6 @@ var _types = require("@atlaskit/analytics-listeners/types");
12
12
  var _analytics = require("@atlaskit/editor-common/analytics");
13
13
  var _RendererActionsContext = require("../../RendererActionsContext");
14
14
  var _AnnotationRangeContext = require("../contexts/AnnotationRangeContext");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
16
  var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props) {
18
17
  var Component = props.component,
@@ -102,20 +101,18 @@ var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props
102
101
  });
103
102
  var positionToAnnotate = hoverDraftDocumentPosition || documentPosition;
104
103
  if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
105
- if ((0, _platformFeatureFlags.fg)('cc_comments_improve_apply_draft_errors')) {
106
- if (createAnalyticsEvent) {
107
- createAnalyticsEvent({
108
- action: _analytics.ACTION.CREATE_NOT_ALLOWED,
109
- actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
110
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
111
- attributes: {
112
- positionToAnnotate: positionToAnnotate,
113
- applyAnnotationMissing: !applyAnnotation,
114
- annotationId: options.annotationId
115
- },
116
- eventType: _analytics.EVENT_TYPE.TRACK
117
- }).fire(_types.FabricChannel.editor);
118
- }
104
+ if (createAnalyticsEvent) {
105
+ createAnalyticsEvent({
106
+ action: _analytics.ACTION.CREATE_NOT_ALLOWED,
107
+ actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
108
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
109
+ attributes: {
110
+ positionToAnnotate: positionToAnnotate,
111
+ applyAnnotationMissing: !applyAnnotation,
112
+ annotationId: options.annotationId
113
+ },
114
+ eventType: _analytics.EVENT_TYPE.TRACK
115
+ }).fire(_types.FabricChannel.editor);
119
116
  }
120
117
  return false;
121
118
  }
@@ -153,20 +153,18 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
153
153
  // use platform_editor_comments_api_manager here so we can clear the code path when the flag is removed
154
154
  var positionToAnnotate = (0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager') ? documentPosition : selectionDraftDocumentPosition || documentPosition;
155
155
  if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
156
- if ((0, _platformFeatureFlags.fg)('cc_comments_improve_apply_draft_errors')) {
157
- if (createAnalyticsEvent) {
158
- createAnalyticsEvent({
159
- action: _analytics.ACTION.CREATE_NOT_ALLOWED,
160
- actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
161
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
162
- attributes: {
163
- positionToAnnotate: positionToAnnotate,
164
- applyAnnotationMissing: !applyAnnotation,
165
- annotationId: options.annotationId
166
- },
167
- eventType: _analytics.EVENT_TYPE.TRACK
168
- }).fire(_types.FabricChannel.editor);
169
- }
156
+ if (createAnalyticsEvent) {
157
+ createAnalyticsEvent({
158
+ action: _analytics.ACTION.CREATE_NOT_ALLOWED,
159
+ actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
160
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
161
+ attributes: {
162
+ positionToAnnotate: positionToAnnotate,
163
+ applyAnnotationMissing: !applyAnnotation,
164
+ annotationId: options.annotationId
165
+ },
166
+ eventType: _analytics.EVENT_TYPE.TRACK
167
+ }).fire(_types.FabricChannel.editor);
170
168
  }
171
169
  return false;
172
170
  }
@@ -23,7 +23,7 @@ const getViewportSize = (extensionId, extensionViewportSizes) => {
23
23
  return macroHeights[viewportSize];
24
24
  }
25
25
  };
26
- export const renderExtension = (content, layout, options = {}, removeOverflow, extensionId, extensionViewportSizes, nodeHeight) => {
26
+ export const renderExtension = (content, layout, options = {}, removeOverflow, extensionId, extensionViewportSizes, nodeHeight, localId) => {
27
27
  const overflowContainerClass = !removeOverflow ? RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER : '';
28
28
 
29
29
  // by default, we assume the extension is at top level, (direct child of doc node)
@@ -52,7 +52,8 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
52
52
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
53
53
  minHeight: `${extensionHeight}px`
54
54
  },
55
- "data-layout": layout
55
+ "data-layout": layout,
56
+ "data-local-id": localId
56
57
  }, /*#__PURE__*/React.createElement("div", {
57
58
  className: overflowContainerClass
58
59
  }, content)));
@@ -66,7 +67,8 @@ const Extension = props => {
66
67
  path = [],
67
68
  extensionViewportSizes,
68
69
  parameters,
69
- nodeHeight
70
+ nodeHeight,
71
+ localId
70
72
  } = props;
71
73
  return /*#__PURE__*/React.createElement(ExtensionRenderer
72
74
  // Ignored via go/ees005
@@ -83,7 +85,7 @@ const Extension = props => {
83
85
  isTopLevel: path.length < 1,
84
86
  handleRef,
85
87
  shadowClassNames
86
- }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight);
88
+ }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId);
87
89
  }
88
90
  } catch (e) {
89
91
  /** We don't want this error to block renderer */
@@ -94,7 +96,7 @@ const Extension = props => {
94
96
  isTopLevel: path.length < 1,
95
97
  handleRef,
96
98
  shadowClassNames
97
- }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight);
99
+ }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId);
98
100
  });
99
101
  };
100
102
  export default overflowShadow(Extension, {
@@ -174,6 +174,7 @@ function Expand({
174
174
  nodeType,
175
175
  intl,
176
176
  fireAnalyticsEvent,
177
+ localId,
177
178
  nestedHeaderIds,
178
179
  rendererAppearance
179
180
  }) {
@@ -191,6 +192,7 @@ function Expand({
191
192
  "data-node-type": nodeType,
192
193
  "data-title": title,
193
194
  "data-expanded": expanded,
195
+ "data-local-id": localId,
194
196
  expanded: expanded,
195
197
  focused: focused
196
198
  }, nestedHeaderIds && nestedHeaderIds.length > 0 ? jsx(ActiveHeaderIdConsumer, {
@@ -153,7 +153,8 @@ export class MediaCardView extends Component {
153
153
  ssr,
154
154
  mediaClient,
155
155
  dataAttributes,
156
- enableSyncMediaCard
156
+ enableSyncMediaCard,
157
+ localId
157
158
  } = this.props;
158
159
  if (imageStatus === 'loading' || !url) {
159
160
  return this.renderLoadingCard();
@@ -172,7 +173,8 @@ export class MediaCardView extends Component {
172
173
  // Ignored via go/ees005
173
174
  // eslint-disable-next-line react/jsx-props-no-spreading
174
175
  React.createElement("div", _extends({}, dataAttributes, {
175
- "data-node-type": "media"
176
+ "data-node-type": "media",
177
+ "data-local-id": localId
176
178
  }), /*#__PURE__*/React.createElement(Card
177
179
  // TODO: MPT-315 - clean up after we move mediaClientConfig into FileIdentifier
178
180
  // context is not really used when the type is external and we want to render the component asap
@@ -216,7 +218,8 @@ export class MediaCardView extends Component {
216
218
  ssr,
217
219
  mediaClient,
218
220
  dataAttributes,
219
- enableSyncMediaCard
221
+ enableSyncMediaCard,
222
+ localId
220
223
  } = this.props;
221
224
  const isMobile = false;
222
225
  const shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
@@ -253,7 +256,9 @@ export class MediaCardView extends Component {
253
256
  contextIdentifierProvider,
254
257
  originalDimensions,
255
258
  fileState
256
- }), dataAttributes), /*#__PURE__*/React.createElement(Card, {
259
+ }), dataAttributes, {
260
+ "data-local-id": localId
261
+ }), /*#__PURE__*/React.createElement(Card, {
257
262
  identifier: identifier,
258
263
  alt: alt,
259
264
  contextId: contextId,
@@ -49,7 +49,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
49
49
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
50
50
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
51
51
  const packageName = "@atlaskit/renderer";
52
- const packageVersion = "123.0.0";
52
+ const packageVersion = "123.1.1";
53
53
  const setAsQueryContainerStyles = css({
54
54
  containerName: 'ak-renderer-wrapper',
55
55
  containerType: 'inline-size'
@@ -3,7 +3,6 @@ import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
3
3
  import { AnnotationTypes } from '@atlaskit/adf-schema';
4
4
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
5
5
  import { FabricChannel } from '@atlaskit/analytics-listeners/types';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { useAnnotationManagerDispatch, useAnnotationManagerState } from '../contexts/AnnotationManagerContext';
8
7
  export const useAnnotationStateByTypeEvent = ({
9
8
  type,
@@ -92,9 +91,6 @@ export const useHasFocusEvent = ({
92
91
  };
93
92
  const removeHoverEffect = () => {
94
93
  setIsHovered(false);
95
- if (document.activeElement instanceof HTMLElement && !fg('confluence_frontend_comments_panel_editor_focus')) {
96
- document.activeElement.blur();
97
- }
98
94
  };
99
95
  if (!isAnnotationManagerEnabled) {
100
96
  updateSubscriber.on(AnnotationUpdateEvent.SET_ANNOTATION_FOCUS, cb);
@@ -5,7 +5,6 @@ import { FabricChannel } from '@atlaskit/analytics-listeners/types';
5
5
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
6
6
  import { RendererContext as ActionsContext } from '../../RendererActionsContext';
7
7
  import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  export const Mounter = /*#__PURE__*/React.memo(props => {
10
9
  const {
11
10
  component: Component,
@@ -98,20 +97,18 @@ export const Mounter = /*#__PURE__*/React.memo(props => {
98
97
  });
99
98
  const positionToAnnotate = hoverDraftDocumentPosition || documentPosition;
100
99
  if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
101
- if (fg('cc_comments_improve_apply_draft_errors')) {
102
- if (createAnalyticsEvent) {
103
- createAnalyticsEvent({
104
- action: ACTION.CREATE_NOT_ALLOWED,
105
- actionSubject: ACTION_SUBJECT.ANNOTATION,
106
- actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
107
- attributes: {
108
- positionToAnnotate,
109
- applyAnnotationMissing: !applyAnnotation,
110
- annotationId: options.annotationId
111
- },
112
- eventType: EVENT_TYPE.TRACK
113
- }).fire(FabricChannel.editor);
114
- }
100
+ if (createAnalyticsEvent) {
101
+ createAnalyticsEvent({
102
+ action: ACTION.CREATE_NOT_ALLOWED,
103
+ actionSubject: ACTION_SUBJECT.ANNOTATION,
104
+ actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
105
+ attributes: {
106
+ positionToAnnotate,
107
+ applyAnnotationMissing: !applyAnnotation,
108
+ annotationId: options.annotationId
109
+ },
110
+ eventType: EVENT_TYPE.TRACK
111
+ }).fire(FabricChannel.editor);
115
112
  }
116
113
  return false;
117
114
  }
@@ -150,20 +150,18 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
150
150
  // use platform_editor_comments_api_manager here so we can clear the code path when the flag is removed
151
151
  const positionToAnnotate = fg('platform_editor_comments_api_manager') ? documentPosition : selectionDraftDocumentPosition || documentPosition;
152
152
  if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
153
- if (fg('cc_comments_improve_apply_draft_errors')) {
154
- if (createAnalyticsEvent) {
155
- createAnalyticsEvent({
156
- action: ACTION.CREATE_NOT_ALLOWED,
157
- actionSubject: ACTION_SUBJECT.ANNOTATION,
158
- actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
159
- attributes: {
160
- positionToAnnotate,
161
- applyAnnotationMissing: !applyAnnotation,
162
- annotationId: options.annotationId
163
- },
164
- eventType: EVENT_TYPE.TRACK
165
- }).fire(FabricChannel.editor);
166
- }
153
+ if (createAnalyticsEvent) {
154
+ createAnalyticsEvent({
155
+ action: ACTION.CREATE_NOT_ALLOWED,
156
+ actionSubject: ACTION_SUBJECT.ANNOTATION,
157
+ actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
158
+ attributes: {
159
+ positionToAnnotate,
160
+ applyAnnotationMissing: !applyAnnotation,
161
+ annotationId: options.annotationId
162
+ },
163
+ eventType: EVENT_TYPE.TRACK
164
+ }).fire(FabricChannel.editor);
167
165
  }
168
166
  return false;
169
167
  }
@@ -31,6 +31,7 @@ export var renderExtension = function renderExtension(content, layout) {
31
31
  var extensionId = arguments.length > 4 ? arguments[4] : undefined;
32
32
  var extensionViewportSizes = arguments.length > 5 ? arguments[5] : undefined;
33
33
  var nodeHeight = arguments.length > 6 ? arguments[6] : undefined;
34
+ var localId = arguments.length > 7 ? arguments[7] : undefined;
34
35
  var overflowContainerClass = !removeOverflow ? RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER : '';
35
36
 
36
37
  // by default, we assume the extension is at top level, (direct child of doc node)
@@ -59,7 +60,8 @@ export var renderExtension = function renderExtension(content, layout) {
59
60
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
60
61
  minHeight: "".concat(extensionHeight, "px")
61
62
  },
62
- "data-layout": layout
63
+ "data-layout": layout,
64
+ "data-local-id": localId
63
65
  }, /*#__PURE__*/React.createElement("div", {
64
66
  className: overflowContainerClass
65
67
  }, content));
@@ -75,7 +77,8 @@ var Extension = function Extension(props) {
75
77
  path = _props$path === void 0 ? [] : _props$path,
76
78
  extensionViewportSizes = props.extensionViewportSizes,
77
79
  parameters = props.parameters,
78
- nodeHeight = props.nodeHeight;
80
+ nodeHeight = props.nodeHeight,
81
+ localId = props.localId;
79
82
  return /*#__PURE__*/React.createElement(ExtensionRenderer
80
83
  // Ignored via go/ees005
81
84
  // eslint-disable-next-line react/jsx-props-no-spreading
@@ -90,7 +93,7 @@ var Extension = function Extension(props) {
90
93
  isTopLevel: path.length < 1,
91
94
  handleRef: handleRef,
92
95
  shadowClassNames: shadowClassNames
93
- }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight);
96
+ }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId);
94
97
  }
95
98
  } catch (e) {
96
99
  /** We don't want this error to block renderer */
@@ -101,7 +104,7 @@ var Extension = function Extension(props) {
101
104
  isTopLevel: path.length < 1,
102
105
  handleRef: handleRef,
103
106
  shadowClassNames: shadowClassNames
104
- }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight);
107
+ }, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId);
105
108
  });
106
109
  };
107
110
  export default overflowShadow(Extension, {
@@ -175,6 +175,7 @@ function Expand(_ref) {
175
175
  nodeType = _ref.nodeType,
176
176
  intl = _ref.intl,
177
177
  fireAnalyticsEvent = _ref.fireAnalyticsEvent,
178
+ localId = _ref.localId,
178
179
  nestedHeaderIds = _ref.nestedHeaderIds,
179
180
  rendererAppearance = _ref.rendererAppearance;
180
181
  var _React$useState = React.useState(false),
@@ -200,6 +201,7 @@ function Expand(_ref) {
200
201
  "data-node-type": nodeType,
201
202
  "data-title": title,
202
203
  "data-expanded": expanded,
204
+ "data-local-id": localId,
203
205
  expanded: expanded,
204
206
  focused: focused
205
207
  }, nestedHeaderIds && nestedHeaderIds.length > 0 ? jsx(ActiveHeaderIdConsumer, {
@@ -209,7 +209,8 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
209
209
  ssr = _this$props4.ssr,
210
210
  mediaClient = _this$props4.mediaClient,
211
211
  dataAttributes = _this$props4.dataAttributes,
212
- enableSyncMediaCard = _this$props4.enableSyncMediaCard;
212
+ enableSyncMediaCard = _this$props4.enableSyncMediaCard,
213
+ localId = _this$props4.localId;
213
214
  if (imageStatus === 'loading' || !url) {
214
215
  return this.renderLoadingCard();
215
216
  }
@@ -227,7 +228,8 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
227
228
  // Ignored via go/ees005
228
229
  // eslint-disable-next-line react/jsx-props-no-spreading
229
230
  React.createElement("div", _extends({}, dataAttributes, {
230
- "data-node-type": "media"
231
+ "data-node-type": "media",
232
+ "data-local-id": localId
231
233
  }), /*#__PURE__*/React.createElement(Card
232
234
  // TODO: MPT-315 - clean up after we move mediaClientConfig into FileIdentifier
233
235
  // context is not really used when the type is external and we want to render the component asap
@@ -272,7 +274,8 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
272
274
  ssr = _this$props5.ssr,
273
275
  mediaClient = _this$props5.mediaClient,
274
276
  dataAttributes = _this$props5.dataAttributes,
275
- enableSyncMediaCard = _this$props5.enableSyncMediaCard;
277
+ enableSyncMediaCard = _this$props5.enableSyncMediaCard,
278
+ localId = _this$props5.localId;
276
279
  var isMobile = false;
277
280
  var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
278
281
  var isInlinePlayer = isMobile ? false : shouldPlayInline;
@@ -308,7 +311,9 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
308
311
  contextIdentifierProvider: contextIdentifierProvider,
309
312
  originalDimensions: originalDimensions,
310
313
  fileState: fileState
311
- }), dataAttributes), /*#__PURE__*/React.createElement(Card, {
314
+ }), dataAttributes, {
315
+ "data-local-id": localId
316
+ }), /*#__PURE__*/React.createElement(Card, {
312
317
  identifier: identifier,
313
318
  alt: alt,
314
319
  contextId: contextId,
@@ -54,7 +54,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
54
54
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
55
55
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  var packageName = "@atlaskit/renderer";
57
- var packageVersion = "123.0.0";
57
+ var packageVersion = "123.1.1";
58
58
  var setAsQueryContainerStyles = css({
59
59
  containerName: 'ak-renderer-wrapper',
60
60
  containerType: 'inline-size'
@@ -7,7 +7,6 @@ import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
7
7
  import { AnnotationTypes } from '@atlaskit/adf-schema';
8
8
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
9
9
  import { FabricChannel } from '@atlaskit/analytics-listeners/types';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { useAnnotationManagerDispatch, useAnnotationManagerState } from '../contexts/AnnotationManagerContext';
12
11
  export var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref) {
13
12
  var type = _ref.type,
@@ -90,9 +89,6 @@ export var useHasFocusEvent = function useHasFocusEvent(_ref2) {
90
89
  };
91
90
  var removeHoverEffect = function removeHoverEffect() {
92
91
  setIsHovered(false);
93
- if (document.activeElement instanceof HTMLElement && !fg('confluence_frontend_comments_panel_editor_focus')) {
94
- document.activeElement.blur();
95
- }
96
92
  };
97
93
  if (!isAnnotationManagerEnabled) {
98
94
  updateSubscriber.on(AnnotationUpdateEvent.SET_ANNOTATION_FOCUS, cb);
@@ -5,7 +5,6 @@ import { FabricChannel } from '@atlaskit/analytics-listeners/types';
5
5
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
6
6
  import { RendererContext as ActionsContext } from '../../RendererActionsContext';
7
7
  import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  export var Mounter = /*#__PURE__*/React.memo(function (props) {
10
9
  var Component = props.component,
11
10
  range = props.range,
@@ -94,20 +93,18 @@ export var Mounter = /*#__PURE__*/React.memo(function (props) {
94
93
  });
95
94
  var positionToAnnotate = hoverDraftDocumentPosition || documentPosition;
96
95
  if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
97
- if (fg('cc_comments_improve_apply_draft_errors')) {
98
- if (createAnalyticsEvent) {
99
- createAnalyticsEvent({
100
- action: ACTION.CREATE_NOT_ALLOWED,
101
- actionSubject: ACTION_SUBJECT.ANNOTATION,
102
- actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
103
- attributes: {
104
- positionToAnnotate: positionToAnnotate,
105
- applyAnnotationMissing: !applyAnnotation,
106
- annotationId: options.annotationId
107
- },
108
- eventType: EVENT_TYPE.TRACK
109
- }).fire(FabricChannel.editor);
110
- }
96
+ if (createAnalyticsEvent) {
97
+ createAnalyticsEvent({
98
+ action: ACTION.CREATE_NOT_ALLOWED,
99
+ actionSubject: ACTION_SUBJECT.ANNOTATION,
100
+ actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
101
+ attributes: {
102
+ positionToAnnotate: positionToAnnotate,
103
+ applyAnnotationMissing: !applyAnnotation,
104
+ annotationId: options.annotationId
105
+ },
106
+ eventType: EVENT_TYPE.TRACK
107
+ }).fire(FabricChannel.editor);
111
108
  }
112
109
  return false;
113
110
  }
@@ -144,20 +144,18 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
144
144
  // use platform_editor_comments_api_manager here so we can clear the code path when the flag is removed
145
145
  var positionToAnnotate = fg('platform_editor_comments_api_manager') ? documentPosition : selectionDraftDocumentPosition || documentPosition;
146
146
  if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
147
- if (fg('cc_comments_improve_apply_draft_errors')) {
148
- if (createAnalyticsEvent) {
149
- createAnalyticsEvent({
150
- action: ACTION.CREATE_NOT_ALLOWED,
151
- actionSubject: ACTION_SUBJECT.ANNOTATION,
152
- actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
153
- attributes: {
154
- positionToAnnotate: positionToAnnotate,
155
- applyAnnotationMissing: !applyAnnotation,
156
- annotationId: options.annotationId
157
- },
158
- eventType: EVENT_TYPE.TRACK
159
- }).fire(FabricChannel.editor);
160
- }
147
+ if (createAnalyticsEvent) {
148
+ createAnalyticsEvent({
149
+ action: ACTION.CREATE_NOT_ALLOWED,
150
+ actionSubject: ACTION_SUBJECT.ANNOTATION,
151
+ actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
152
+ attributes: {
153
+ positionToAnnotate: positionToAnnotate,
154
+ applyAnnotationMissing: !applyAnnotation,
155
+ annotationId: options.annotationId
156
+ },
157
+ eventType: EVENT_TYPE.TRACK
158
+ }).fire(FabricChannel.editor);
161
159
  }
162
160
  return false;
163
161
  }
@@ -26,7 +26,7 @@ type AllOrNone<T> = T | {
26
26
  type RenderExtensionOptions = {
27
27
  isTopLevel?: boolean;
28
28
  } & AllOrNone<OverflowShadowProps>;
29
- export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean, extensionId?: string, extensionViewportSizes?: ExtensionViewportSize[], nodeHeight?: string) => React.JSX.Element;
29
+ export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean, extensionId?: string, extensionViewportSizes?: ExtensionViewportSize[], nodeHeight?: string, localId?: string) => React.JSX.Element;
30
30
  declare const _default: {
31
31
  new (props: (Props & OverflowShadowProps) | Readonly<Props & OverflowShadowProps>): {
32
32
  overflowContainer?: HTMLElement | null;
@@ -5,6 +5,7 @@ import type { RendererAppearance } from './Renderer/types';
5
5
  export interface ExpandProps {
6
6
  children: React.ReactNode;
7
7
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
8
+ localId?: string;
8
9
  nestedHeaderIds?: Array<string>;
9
10
  nodeType: 'expand' | 'nestedExpand';
10
11
  rendererAppearance?: RendererAppearance;
@@ -30,6 +30,7 @@ export interface MediaCardProps {
30
30
  featureFlags?: MediaFeatureFlags;
31
31
  id?: string;
32
32
  imageStatus?: ImageStatus;
33
+ localId?: string;
33
34
  occurrenceKey?: string;
34
35
  originalDimensions?: NumericalCardDimensions;
35
36
  rendererAppearance?: RendererAppearance;
@@ -26,7 +26,7 @@ type AllOrNone<T> = T | {
26
26
  type RenderExtensionOptions = {
27
27
  isTopLevel?: boolean;
28
28
  } & AllOrNone<OverflowShadowProps>;
29
- export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean, extensionId?: string, extensionViewportSizes?: ExtensionViewportSize[], nodeHeight?: string) => React.JSX.Element;
29
+ export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean, extensionId?: string, extensionViewportSizes?: ExtensionViewportSize[], nodeHeight?: string, localId?: string) => React.JSX.Element;
30
30
  declare const _default: {
31
31
  new (props: (Props & OverflowShadowProps) | Readonly<Props & OverflowShadowProps>): {
32
32
  overflowContainer?: HTMLElement | null;
@@ -5,6 +5,7 @@ import type { RendererAppearance } from './Renderer/types';
5
5
  export interface ExpandProps {
6
6
  children: React.ReactNode;
7
7
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
8
+ localId?: string;
8
9
  nestedHeaderIds?: Array<string>;
9
10
  nodeType: 'expand' | 'nestedExpand';
10
11
  rendererAppearance?: RendererAppearance;
@@ -30,6 +30,7 @@ export interface MediaCardProps {
30
30
  featureFlags?: MediaFeatureFlags;
31
31
  id?: string;
32
32
  imageStatus?: ImageStatus;
33
+ localId?: string;
33
34
  occurrenceKey?: string;
34
35
  originalDimensions?: NumericalCardDimensions;
35
36
  rendererAppearance?: RendererAppearance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "123.1.0",
3
+ "version": "123.2.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-tables": "^2.9.0",
38
38
  "@atlaskit/emoji": "^69.5.0",
39
39
  "@atlaskit/feature-gate-js-client": "^5.5.0",
40
- "@atlaskit/icon": "^28.1.0",
40
+ "@atlaskit/icon": "^28.2.0",
41
41
  "@atlaskit/link": "^3.2.0",
42
42
  "@atlaskit/link-datasource": "^4.23.0",
43
43
  "@atlaskit/media-card": "^79.5.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/status": "^3.0.0",
55
55
  "@atlaskit/task-decision": "^19.2.0",
56
56
  "@atlaskit/theme": "^21.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^12.18.0",
57
+ "@atlaskit/tmp-editor-statsig": "^12.22.0",
58
58
  "@atlaskit/tokens": "^6.3.0",
59
59
  "@atlaskit/tooltip": "^20.4.0",
60
60
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -68,7 +68,7 @@
68
68
  "uuid": "^3.1.0"
69
69
  },
70
70
  "peerDependencies": {
71
- "@atlaskit/editor-common": "^109.5.0",
71
+ "@atlaskit/editor-common": "^109.7.0",
72
72
  "@atlaskit/link-provider": "^4.0.0",
73
73
  "@atlaskit/media-core": "^37.0.0",
74
74
  "react": "^18.2.0",
@@ -82,7 +82,7 @@
82
82
  "@atlaskit/css-reset": "^7.3.0",
83
83
  "@atlaskit/link-provider": "^4.0.0",
84
84
  "@atlaskit/link-test-helpers": "^8.3.0",
85
- "@atlaskit/linking-common": "^9.5.0",
85
+ "@atlaskit/linking-common": "^9.6.0",
86
86
  "@atlaskit/media-core": "^37.0.0",
87
87
  "@atlaskit/media-integration-test-helpers": "workspace:^",
88
88
  "@atlaskit/media-test-helpers": "^39.0.0",
@@ -125,9 +125,6 @@
125
125
  "confluence_frontend_table_scrollbar_ttvc_fix": {
126
126
  "type": "boolean"
127
127
  },
128
- "cc_comments_improve_apply_draft_errors": {
129
- "type": "boolean"
130
- },
131
128
  "cc_comments_create_inline_experience_entry_point": {
132
129
  "type": "boolean"
133
130
  },
@@ -242,9 +239,6 @@
242
239
  "issue_table_single_line_row_height_fast_follows": {
243
240
  "type": "boolean"
244
241
  },
245
- "confluence_frontend_comments_panel_editor_focus": {
246
- "type": "boolean"
247
- },
248
242
  "platform_custom_number_column": {
249
243
  "type": "boolean"
250
244
  },