@atlaskit/renderer 118.6.2 → 118.6.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
+ ## 118.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#163358](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/163358)
8
+ [`a262d3094ad41`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a262d3094ad41) -
9
+ [ux] Allow remove 1px margin top from inline macro wrapper that causing element shift in initial
10
+ load
11
+ - [#163361](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/163361)
12
+ [`76c3619bccda1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76c3619bccda1) -
13
+ Changed the annotation manager feature gate to instead use the existance of the manager rather
14
+ then a gate
15
+ - Updated dependencies
16
+
3
17
  ## 118.6.2
4
18
 
5
19
  ### Patch Changes
@@ -19,6 +19,15 @@ var _utils = require("@atlaskit/editor-common/utils");
19
19
  */
20
20
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
21
21
 
22
+ // When running on server-side emotion will generate style tags before elements.
23
+ // This caused packages/editor/editor-common/src/styles/shared/block-marks.ts to override the margin-top.
24
+ // However as soon as the styles are extracted to <head> it adds back the margin.
25
+ // The timing is tricky as it happens to be when UFO collects the dimension for the placeholder for TTVC calculation.
26
+ // This resulted 1px mismatch on the image. Further cause everything on page to shift by 1px.
27
+ var forceMarginTopStyle = (0, _react.css)({
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
29
+ marginTop: "1px !important"
30
+ });
22
31
  var inlineExtensionStyle = (0, _react.css)({
23
32
  display: 'inline-block',
24
33
  maxWidth: '100%',
@@ -128,12 +137,12 @@ function ExtensionRenderer(props) {
128
137
  });
129
138
  }
130
139
  var InlineNodeRendererWrapper = exports.InlineNodeRendererWrapper = function InlineNodeRendererWrapper(_ref) {
131
- var children = _ref.children;
132
- return (
140
+ var _ref$forceMarginTop = _ref.forceMarginTop,
141
+ forceMarginTop = _ref$forceMarginTop === void 0 ? false : _ref$forceMarginTop,
142
+ children = _ref.children;
143
+ return (0, _react.jsx)("div", {
133
144
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
134
- (0, _react.jsx)("div", {
135
- className: "inline-extension-renderer",
136
- css: inlineExtensionStyle
137
- }, children)
138
- );
145
+ className: "inline-extension-renderer",
146
+ css: [inlineExtensionStyle, forceMarginTop && forceMarginTopStyle]
147
+ }, children);
139
148
  };
@@ -62,7 +62,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
62
62
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
63
63
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
64
64
  var packageName = "@atlaskit/renderer";
65
- var packageVersion = "118.6.2";
65
+ var packageVersion = "118.6.3";
66
66
  var setAsQueryContainerStyles = (0, _react2.css)({
67
67
  containerName: 'ak-renderer-wrapper',
68
68
  containerType: 'inline-size'
@@ -8,7 +8,6 @@ exports.MarkElement = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
10
  var _types = require("@atlaskit/editor-common/types");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var _mark = require("./mark");
13
12
  var _useInlineCommentsFilter = require("../hooks/use-inline-comments-filter");
14
13
  var _useInlineCommentSubscriber = require("../hooks/use-inline-comment-subscriber");
@@ -45,11 +44,11 @@ var MarkElement = exports.MarkElement = function MarkElement(_ref) {
45
44
  }
46
45
  var eventTarget = props.eventTarget,
47
46
  annotationIds = props.annotationIds;
48
- if ((0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager_select')) {
47
+ if (annotationManager) {
49
48
  if (hasFocus) {
50
49
  return;
51
50
  }
52
- annotationManager === null || annotationManager === void 0 || annotationManager.checkPreemptiveGate().then(function (canSelect) {
51
+ annotationManager.checkPreemptiveGate().then(function (canSelect) {
53
52
  if (canSelect) {
54
53
  // if there is a draft, clear it first
55
54
  annotationManager === null || annotationManager === void 0 || annotationManager.clearDraft();
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.AnnotationsWrapperInner = exports.AnnotationsWrapper = exports.AnnotationsPositionContext = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _adfSchema = require("@atlaskit/adf-schema");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  var _view = require("./view");
12
11
  var _wrapper = require("./wrapper");
13
12
  var _context = require("./context");
@@ -77,7 +76,7 @@ var AnnotationsWrapper = exports.AnnotationsWrapper = function AnnotationsWrappe
77
76
  adfDocument = props.adfDocument,
78
77
  isNestedRender = props.isNestedRender,
79
78
  onLoadComplete = props.onLoadComplete;
80
- if (!isNestedRender && (0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager')) {
79
+ if (!isNestedRender && annotationProvider !== null && annotationProvider !== void 0 && annotationProvider.annotationManager) {
81
80
  var _annotationProvider$i, _annotationProvider$i2;
82
81
  // We need to ensure there is a single instance of the annotation manager for the whole document
83
82
  // and that it is the same instance for all annotations.
@@ -86,7 +85,7 @@ var AnnotationsWrapper = exports.AnnotationsWrapper = function AnnotationsWrappe
86
85
  return /*#__PURE__*/_react.default.createElement(_context.ProvidersContext.Provider, {
87
86
  value: annotationProvider
88
87
  }, /*#__PURE__*/_react.default.createElement(_AnnotationManagerContext.AnnotationManagerProvider, {
89
- annotationManager: annotationProvider === null || annotationProvider === void 0 ? void 0 : annotationProvider.annotationManager,
88
+ annotationManager: annotationProvider.annotationManager,
90
89
  updateSubscriber: (_annotationProvider$i = annotationProvider === null || annotationProvider === void 0 || (_annotationProvider$i2 = annotationProvider.inlineComment) === null || _annotationProvider$i2 === void 0 ? void 0 : _annotationProvider$i2.updateSubscriber) !== null && _annotationProvider$i !== void 0 ? _annotationProvider$i : undefined
91
90
  }, /*#__PURE__*/_react.default.createElement(AnnotationsWrapperInner, {
92
91
  rendererRef: rendererRef,
@@ -202,21 +202,21 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
202
202
  onCloseProps();
203
203
  }, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent, inlineNodeTypes]);
204
204
  (0, _react.useEffect)(function () {
205
- if ((0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager')) {
205
+ if (annotationManager) {
206
206
  var allowAnnotation = function allowAnnotation() {
207
207
  if (isDrafting) {
208
208
  return false;
209
209
  }
210
210
  return isAnnotationAllowed;
211
211
  };
212
- annotationManager === null || annotationManager === void 0 || annotationManager.hook('allowAnnotation', allowAnnotation);
212
+ annotationManager.hook('allowAnnotation', allowAnnotation);
213
213
  return function () {
214
- annotationManager === null || annotationManager === void 0 || annotationManager.unhook('allowAnnotation', allowAnnotation);
214
+ annotationManager.unhook('allowAnnotation', allowAnnotation);
215
215
  };
216
216
  }
217
217
  }, [annotationManager, isAnnotationAllowed, isDrafting]);
218
218
  (0, _react.useEffect)(function () {
219
- if ((0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager')) {
219
+ if (annotationManager) {
220
220
  var startDraft = function startDraft() {
221
221
  var _result$inlineNodeTyp;
222
222
  if (isDrafting) {
@@ -265,14 +265,14 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
265
265
  }
266
266
  };
267
267
  };
268
- annotationManager === null || annotationManager === void 0 || annotationManager.hook('startDraft', startDraft);
268
+ annotationManager.hook('startDraft', startDraft);
269
269
  return function () {
270
- annotationManager === null || annotationManager === void 0 || annotationManager.unhook('startDraft', startDraft);
270
+ annotationManager.unhook('startDraft', startDraft);
271
271
  };
272
272
  }
273
273
  }, [annotationManager, isDrafting, applyDraftModeCallback, actions, range, dispatch]);
274
274
  (0, _react.useEffect)(function () {
275
- if ((0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager')) {
275
+ if (annotationManager) {
276
276
  var clearDraft = function clearDraft() {
277
277
  if (!isDrafting) {
278
278
  return {
@@ -293,14 +293,14 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
293
293
  success: true
294
294
  };
295
295
  };
296
- annotationManager === null || annotationManager === void 0 || annotationManager.hook('clearDraft', clearDraft);
296
+ annotationManager.hook('clearDraft', clearDraft);
297
297
  return function () {
298
- annotationManager === null || annotationManager === void 0 || annotationManager.unhook('clearDraft', clearDraft);
298
+ annotationManager.unhook('clearDraft', clearDraft);
299
299
  };
300
300
  }
301
301
  }, [annotationManager, onCloseCallback, isDrafting, dispatch]);
302
302
  (0, _react.useEffect)(function () {
303
- if ((0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager')) {
303
+ if (annotationManager) {
304
304
  var applyDraft = function applyDraft(id) {
305
305
  if (!isDrafting || !draftId) {
306
306
  return {
@@ -347,9 +347,9 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
347
347
  } : undefined
348
348
  };
349
349
  };
350
- annotationManager === null || annotationManager === void 0 || annotationManager.hook('applyDraft', applyDraft);
350
+ annotationManager.hook('applyDraft', applyDraft);
351
351
  return function () {
352
- annotationManager === null || annotationManager === void 0 || annotationManager.unhook('applyDraft', applyDraft);
352
+ annotationManager.unhook('applyDraft', applyDraft);
353
353
  };
354
354
  }
355
355
  }, [annotationManager, onCreateCallback, onCloseCallback, isDrafting, draftId, dispatch]);
@@ -368,11 +368,11 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
368
368
  ,
369
369
  wrapperDOM: wrapperDOM.current,
370
370
  isAnnotationAllowed: isAnnotationAllowed,
371
- onClose: (0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager') ? nop : onCloseCallback,
372
- onCreate: (0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager') ? nop : onCreateCallback,
371
+ onClose: annotationManager ? nop : onCloseCallback,
372
+ onCreate: annotationManager ? nop : onCreateCallback,
373
373
  getAnnotationIndexMatch: createIndexCallback,
374
- applyDraftMode: (0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager') ? nop : applyDraftModeCallback,
375
- removeDraftMode: (0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager') ? nop : removeDraftModeCallback,
374
+ applyDraftMode: annotationManager ? nop : applyDraftModeCallback,
375
+ removeDraftMode: annotationManager ? nop : removeDraftModeCallback,
376
376
  inlineNodeTypes: inlineNodeTypes
377
377
  });
378
378
  });
@@ -9,6 +9,15 @@ import memoizeOne from 'memoize-one';
9
9
  import { getNodeRenderer } from '@atlaskit/editor-common/extensions';
10
10
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
11
11
  import { getExtensionRenderer } from '@atlaskit/editor-common/utils';
12
+ // When running on server-side emotion will generate style tags before elements.
13
+ // This caused packages/editor/editor-common/src/styles/shared/block-marks.ts to override the margin-top.
14
+ // However as soon as the styles are extracted to <head> it adds back the margin.
15
+ // The timing is tricky as it happens to be when UFO collects the dimension for the placeholder for TTVC calculation.
16
+ // This resulted 1px mismatch on the image. Further cause everything on page to shift by 1px.
17
+ const forceMarginTopStyle = css({
18
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
19
+ marginTop: `1px !important`
20
+ });
12
21
  const inlineExtensionStyle = css({
13
22
  display: 'inline-block',
14
23
  maxWidth: '100%',
@@ -113,13 +122,12 @@ export default function ExtensionRenderer(props) {
113
122
  });
114
123
  }
115
124
  export const InlineNodeRendererWrapper = ({
125
+ forceMarginTop = false,
116
126
  children
117
127
  }) => {
118
- return (
128
+ return jsx("div", {
119
129
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
120
- jsx("div", {
121
- className: "inline-extension-renderer",
122
- css: inlineExtensionStyle
123
- }, children)
124
- );
130
+ className: "inline-extension-renderer",
131
+ css: [inlineExtensionStyle, forceMarginTop && forceMarginTopStyle]
132
+ }, children);
125
133
  };
@@ -48,7 +48,7 @@ import { PortalContext } from './PortalContext';
48
48
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
49
49
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
50
50
  const packageName = "@atlaskit/renderer";
51
- const packageVersion = "118.6.2";
51
+ const packageVersion = "118.6.3";
52
52
  const setAsQueryContainerStyles = css({
53
53
  containerName: 'ak-renderer-wrapper',
54
54
  containerType: 'inline-size'
@@ -1,7 +1,6 @@
1
1
  import React, { useMemo, useCallback, useContext } from 'react';
2
2
  import { AnnotationMarkStates } from '@atlaskit/adf-schema';
3
3
  import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { MarkComponent } from './mark';
6
5
  import { useInlineCommentsFilter } from '../hooks/use-inline-comments-filter';
7
6
  import { useInlineCommentSubscriberContext } from '../hooks/use-inline-comment-subscriber';
@@ -40,11 +39,11 @@ const MarkElement = ({
40
39
  eventTarget,
41
40
  annotationIds
42
41
  } = props;
43
- if (fg('platform_editor_comments_api_manager_select')) {
42
+ if (annotationManager) {
44
43
  if (hasFocus) {
45
44
  return;
46
45
  }
47
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.checkPreemptiveGate().then(canSelect => {
46
+ annotationManager.checkPreemptiveGate().then(canSelect => {
48
47
  if (canSelect) {
49
48
  // if there is a draft, clear it first
50
49
  annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.clearDraft();
@@ -1,6 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { AnnotationTypes } from '@atlaskit/adf-schema';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { AnnotationView } from './view';
5
4
  import { AnnotationsContextWrapper } from './wrapper';
6
5
  import { ProvidersContext, InlineCommentsStateContext } from './context';
@@ -75,7 +74,7 @@ export const AnnotationsWrapper = props => {
75
74
  isNestedRender,
76
75
  onLoadComplete
77
76
  } = props;
78
- if (!isNestedRender && fg('platform_editor_comments_api_manager')) {
77
+ if (!isNestedRender && annotationProvider !== null && annotationProvider !== void 0 && annotationProvider.annotationManager) {
79
78
  var _annotationProvider$i, _annotationProvider$i2;
80
79
  // We need to ensure there is a single instance of the annotation manager for the whole document
81
80
  // and that it is the same instance for all annotations.
@@ -84,7 +83,7 @@ export const AnnotationsWrapper = props => {
84
83
  return /*#__PURE__*/React.createElement(ProvidersContext.Provider, {
85
84
  value: annotationProvider
86
85
  }, /*#__PURE__*/React.createElement(AnnotationManagerProvider, {
87
- annotationManager: annotationProvider === null || annotationProvider === void 0 ? void 0 : annotationProvider.annotationManager,
86
+ annotationManager: annotationProvider.annotationManager,
88
87
  updateSubscriber: (_annotationProvider$i = annotationProvider === null || annotationProvider === void 0 ? void 0 : (_annotationProvider$i2 = annotationProvider.inlineComment) === null || _annotationProvider$i2 === void 0 ? void 0 : _annotationProvider$i2.updateSubscriber) !== null && _annotationProvider$i !== void 0 ? _annotationProvider$i : undefined
89
88
  }, /*#__PURE__*/React.createElement(AnnotationsWrapperInner, {
90
89
  rendererRef: rendererRef,
@@ -199,21 +199,21 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
199
199
  onCloseProps();
200
200
  }, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent, inlineNodeTypes]);
201
201
  useEffect(() => {
202
- if (fg('platform_editor_comments_api_manager')) {
202
+ if (annotationManager) {
203
203
  const allowAnnotation = () => {
204
204
  if (isDrafting) {
205
205
  return false;
206
206
  }
207
207
  return isAnnotationAllowed;
208
208
  };
209
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.hook('allowAnnotation', allowAnnotation);
209
+ annotationManager.hook('allowAnnotation', allowAnnotation);
210
210
  return () => {
211
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.unhook('allowAnnotation', allowAnnotation);
211
+ annotationManager.unhook('allowAnnotation', allowAnnotation);
212
212
  };
213
213
  }
214
214
  }, [annotationManager, isAnnotationAllowed, isDrafting]);
215
215
  useEffect(() => {
216
- if (fg('platform_editor_comments_api_manager')) {
216
+ if (annotationManager) {
217
217
  const startDraft = () => {
218
218
  var _result$inlineNodeTyp;
219
219
  if (isDrafting) {
@@ -262,14 +262,14 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
262
262
  }
263
263
  };
264
264
  };
265
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.hook('startDraft', startDraft);
265
+ annotationManager.hook('startDraft', startDraft);
266
266
  return () => {
267
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.unhook('startDraft', startDraft);
267
+ annotationManager.unhook('startDraft', startDraft);
268
268
  };
269
269
  }
270
270
  }, [annotationManager, isDrafting, applyDraftModeCallback, actions, range, dispatch]);
271
271
  useEffect(() => {
272
- if (fg('platform_editor_comments_api_manager')) {
272
+ if (annotationManager) {
273
273
  const clearDraft = () => {
274
274
  if (!isDrafting) {
275
275
  return {
@@ -290,14 +290,14 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
290
290
  success: true
291
291
  };
292
292
  };
293
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.hook('clearDraft', clearDraft);
293
+ annotationManager.hook('clearDraft', clearDraft);
294
294
  return () => {
295
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.unhook('clearDraft', clearDraft);
295
+ annotationManager.unhook('clearDraft', clearDraft);
296
296
  };
297
297
  }
298
298
  }, [annotationManager, onCloseCallback, isDrafting, dispatch]);
299
299
  useEffect(() => {
300
- if (fg('platform_editor_comments_api_manager')) {
300
+ if (annotationManager) {
301
301
  const applyDraft = id => {
302
302
  if (!isDrafting || !draftId) {
303
303
  return {
@@ -344,9 +344,9 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
344
344
  } : undefined
345
345
  };
346
346
  };
347
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.hook('applyDraft', applyDraft);
347
+ annotationManager.hook('applyDraft', applyDraft);
348
348
  return () => {
349
- annotationManager === null || annotationManager === void 0 ? void 0 : annotationManager.unhook('applyDraft', applyDraft);
349
+ annotationManager.unhook('applyDraft', applyDraft);
350
350
  };
351
351
  }
352
352
  }, [annotationManager, onCreateCallback, onCloseCallback, isDrafting, draftId, dispatch]);
@@ -361,11 +361,11 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
361
361
  ,
362
362
  wrapperDOM: wrapperDOM.current,
363
363
  isAnnotationAllowed: isAnnotationAllowed,
364
- onClose: fg('platform_editor_comments_api_manager') ? nop : onCloseCallback,
365
- onCreate: fg('platform_editor_comments_api_manager') ? nop : onCreateCallback,
364
+ onClose: annotationManager ? nop : onCloseCallback,
365
+ onCreate: annotationManager ? nop : onCreateCallback,
366
366
  getAnnotationIndexMatch: createIndexCallback,
367
- applyDraftMode: fg('platform_editor_comments_api_manager') ? nop : applyDraftModeCallback,
368
- removeDraftMode: fg('platform_editor_comments_api_manager') ? nop : removeDraftModeCallback,
367
+ applyDraftMode: annotationManager ? nop : applyDraftModeCallback,
368
+ removeDraftMode: annotationManager ? nop : removeDraftModeCallback,
369
369
  inlineNodeTypes: inlineNodeTypes
370
370
  });
371
371
  });
@@ -10,6 +10,15 @@ import memoizeOne from 'memoize-one';
10
10
  import { getNodeRenderer } from '@atlaskit/editor-common/extensions';
11
11
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
12
12
  import { getExtensionRenderer } from '@atlaskit/editor-common/utils';
13
+ // When running on server-side emotion will generate style tags before elements.
14
+ // This caused packages/editor/editor-common/src/styles/shared/block-marks.ts to override the margin-top.
15
+ // However as soon as the styles are extracted to <head> it adds back the margin.
16
+ // The timing is tricky as it happens to be when UFO collects the dimension for the placeholder for TTVC calculation.
17
+ // This resulted 1px mismatch on the image. Further cause everything on page to shift by 1px.
18
+ var forceMarginTopStyle = css({
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
20
+ marginTop: "1px !important"
21
+ });
13
22
  var inlineExtensionStyle = css({
14
23
  display: 'inline-block',
15
24
  maxWidth: '100%',
@@ -119,12 +128,12 @@ export default function ExtensionRenderer(props) {
119
128
  });
120
129
  }
121
130
  export var InlineNodeRendererWrapper = function InlineNodeRendererWrapper(_ref) {
122
- var children = _ref.children;
123
- return (
131
+ var _ref$forceMarginTop = _ref.forceMarginTop,
132
+ forceMarginTop = _ref$forceMarginTop === void 0 ? false : _ref$forceMarginTop,
133
+ children = _ref.children;
134
+ return jsx("div", {
124
135
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
125
- jsx("div", {
126
- className: "inline-extension-renderer",
127
- css: inlineExtensionStyle
128
- }, children)
129
- );
136
+ className: "inline-extension-renderer",
137
+ css: [inlineExtensionStyle, forceMarginTop && forceMarginTopStyle]
138
+ }, children);
130
139
  };
@@ -53,7 +53,7 @@ import { PortalContext } from './PortalContext';
53
53
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
54
54
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
55
55
  var packageName = "@atlaskit/renderer";
56
- var packageVersion = "118.6.2";
56
+ var packageVersion = "118.6.3";
57
57
  var setAsQueryContainerStyles = css({
58
58
  containerName: 'ak-renderer-wrapper',
59
59
  containerType: 'inline-size'
@@ -1,7 +1,6 @@
1
1
  import React, { useMemo, useCallback, useContext } from 'react';
2
2
  import { AnnotationMarkStates } from '@atlaskit/adf-schema';
3
3
  import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { MarkComponent } from './mark';
6
5
  import { useInlineCommentsFilter } from '../hooks/use-inline-comments-filter';
7
6
  import { useInlineCommentSubscriberContext } from '../hooks/use-inline-comment-subscriber';
@@ -37,11 +36,11 @@ var MarkElement = function MarkElement(_ref) {
37
36
  }
38
37
  var eventTarget = props.eventTarget,
39
38
  annotationIds = props.annotationIds;
40
- if (fg('platform_editor_comments_api_manager_select')) {
39
+ if (annotationManager) {
41
40
  if (hasFocus) {
42
41
  return;
43
42
  }
44
- annotationManager === null || annotationManager === void 0 || annotationManager.checkPreemptiveGate().then(function (canSelect) {
43
+ annotationManager.checkPreemptiveGate().then(function (canSelect) {
45
44
  if (canSelect) {
46
45
  // if there is a draft, clear it first
47
46
  annotationManager === null || annotationManager === void 0 || annotationManager.clearDraft();
@@ -1,6 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { AnnotationTypes } from '@atlaskit/adf-schema';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { AnnotationView } from './view';
5
4
  import { AnnotationsContextWrapper } from './wrapper';
6
5
  import { ProvidersContext, InlineCommentsStateContext } from './context';
@@ -69,7 +68,7 @@ export var AnnotationsWrapper = function AnnotationsWrapper(props) {
69
68
  adfDocument = props.adfDocument,
70
69
  isNestedRender = props.isNestedRender,
71
70
  onLoadComplete = props.onLoadComplete;
72
- if (!isNestedRender && fg('platform_editor_comments_api_manager')) {
71
+ if (!isNestedRender && annotationProvider !== null && annotationProvider !== void 0 && annotationProvider.annotationManager) {
73
72
  var _annotationProvider$i, _annotationProvider$i2;
74
73
  // We need to ensure there is a single instance of the annotation manager for the whole document
75
74
  // and that it is the same instance for all annotations.
@@ -78,7 +77,7 @@ export var AnnotationsWrapper = function AnnotationsWrapper(props) {
78
77
  return /*#__PURE__*/React.createElement(ProvidersContext.Provider, {
79
78
  value: annotationProvider
80
79
  }, /*#__PURE__*/React.createElement(AnnotationManagerProvider, {
81
- annotationManager: annotationProvider === null || annotationProvider === void 0 ? void 0 : annotationProvider.annotationManager,
80
+ annotationManager: annotationProvider.annotationManager,
82
81
  updateSubscriber: (_annotationProvider$i = annotationProvider === null || annotationProvider === void 0 || (_annotationProvider$i2 = annotationProvider.inlineComment) === null || _annotationProvider$i2 === void 0 ? void 0 : _annotationProvider$i2.updateSubscriber) !== null && _annotationProvider$i !== void 0 ? _annotationProvider$i : undefined
83
82
  }, /*#__PURE__*/React.createElement(AnnotationsWrapperInner, {
84
83
  rendererRef: rendererRef,
@@ -193,21 +193,21 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
193
193
  onCloseProps();
194
194
  }, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent, inlineNodeTypes]);
195
195
  useEffect(function () {
196
- if (fg('platform_editor_comments_api_manager')) {
196
+ if (annotationManager) {
197
197
  var allowAnnotation = function allowAnnotation() {
198
198
  if (isDrafting) {
199
199
  return false;
200
200
  }
201
201
  return isAnnotationAllowed;
202
202
  };
203
- annotationManager === null || annotationManager === void 0 || annotationManager.hook('allowAnnotation', allowAnnotation);
203
+ annotationManager.hook('allowAnnotation', allowAnnotation);
204
204
  return function () {
205
- annotationManager === null || annotationManager === void 0 || annotationManager.unhook('allowAnnotation', allowAnnotation);
205
+ annotationManager.unhook('allowAnnotation', allowAnnotation);
206
206
  };
207
207
  }
208
208
  }, [annotationManager, isAnnotationAllowed, isDrafting]);
209
209
  useEffect(function () {
210
- if (fg('platform_editor_comments_api_manager')) {
210
+ if (annotationManager) {
211
211
  var startDraft = function startDraft() {
212
212
  var _result$inlineNodeTyp;
213
213
  if (isDrafting) {
@@ -256,14 +256,14 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
256
256
  }
257
257
  };
258
258
  };
259
- annotationManager === null || annotationManager === void 0 || annotationManager.hook('startDraft', startDraft);
259
+ annotationManager.hook('startDraft', startDraft);
260
260
  return function () {
261
- annotationManager === null || annotationManager === void 0 || annotationManager.unhook('startDraft', startDraft);
261
+ annotationManager.unhook('startDraft', startDraft);
262
262
  };
263
263
  }
264
264
  }, [annotationManager, isDrafting, applyDraftModeCallback, actions, range, dispatch]);
265
265
  useEffect(function () {
266
- if (fg('platform_editor_comments_api_manager')) {
266
+ if (annotationManager) {
267
267
  var clearDraft = function clearDraft() {
268
268
  if (!isDrafting) {
269
269
  return {
@@ -284,14 +284,14 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
284
284
  success: true
285
285
  };
286
286
  };
287
- annotationManager === null || annotationManager === void 0 || annotationManager.hook('clearDraft', clearDraft);
287
+ annotationManager.hook('clearDraft', clearDraft);
288
288
  return function () {
289
- annotationManager === null || annotationManager === void 0 || annotationManager.unhook('clearDraft', clearDraft);
289
+ annotationManager.unhook('clearDraft', clearDraft);
290
290
  };
291
291
  }
292
292
  }, [annotationManager, onCloseCallback, isDrafting, dispatch]);
293
293
  useEffect(function () {
294
- if (fg('platform_editor_comments_api_manager')) {
294
+ if (annotationManager) {
295
295
  var applyDraft = function applyDraft(id) {
296
296
  if (!isDrafting || !draftId) {
297
297
  return {
@@ -338,9 +338,9 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
338
338
  } : undefined
339
339
  };
340
340
  };
341
- annotationManager === null || annotationManager === void 0 || annotationManager.hook('applyDraft', applyDraft);
341
+ annotationManager.hook('applyDraft', applyDraft);
342
342
  return function () {
343
- annotationManager === null || annotationManager === void 0 || annotationManager.unhook('applyDraft', applyDraft);
343
+ annotationManager.unhook('applyDraft', applyDraft);
344
344
  };
345
345
  }
346
346
  }, [annotationManager, onCreateCallback, onCloseCallback, isDrafting, draftId, dispatch]);
@@ -359,11 +359,11 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
359
359
  ,
360
360
  wrapperDOM: wrapperDOM.current,
361
361
  isAnnotationAllowed: isAnnotationAllowed,
362
- onClose: fg('platform_editor_comments_api_manager') ? nop : onCloseCallback,
363
- onCreate: fg('platform_editor_comments_api_manager') ? nop : onCreateCallback,
362
+ onClose: annotationManager ? nop : onCloseCallback,
363
+ onCreate: annotationManager ? nop : onCreateCallback,
364
364
  getAnnotationIndexMatch: createIndexCallback,
365
- applyDraftMode: fg('platform_editor_comments_api_manager') ? nop : applyDraftModeCallback,
366
- removeDraftMode: fg('platform_editor_comments_api_manager') ? nop : removeDraftModeCallback,
365
+ applyDraftMode: annotationManager ? nop : applyDraftModeCallback,
366
+ removeDraftMode: annotationManager ? nop : removeDraftModeCallback,
367
367
  inlineNodeTypes: inlineNodeTypes
368
368
  });
369
369
  });
@@ -28,5 +28,7 @@ interface Props {
28
28
  }) => JSX.Element;
29
29
  }
30
30
  export default function ExtensionRenderer(props: Props): JSX.Element;
31
- export declare const InlineNodeRendererWrapper: ({ children }: React.PropsWithChildren<unknown>) => jsx.JSX.Element;
31
+ export declare const InlineNodeRendererWrapper: ({ forceMarginTop, children, }: React.PropsWithChildren<{
32
+ forceMarginTop?: boolean | undefined;
33
+ }>) => jsx.JSX.Element;
32
34
  export {};
@@ -28,5 +28,7 @@ interface Props {
28
28
  }) => JSX.Element;
29
29
  }
30
30
  export default function ExtensionRenderer(props: Props): JSX.Element;
31
- export declare const InlineNodeRendererWrapper: ({ children }: React.PropsWithChildren<unknown>) => jsx.JSX.Element;
31
+ export declare const InlineNodeRendererWrapper: ({ forceMarginTop, children, }: React.PropsWithChildren<{
32
+ forceMarginTop?: boolean | undefined;
33
+ }>) => jsx.JSX.Element;
32
34
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "118.6.2",
3
+ "version": "118.6.3",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/status": "^3.0.0",
57
57
  "@atlaskit/task-decision": "^19.2.0",
58
58
  "@atlaskit/theme": "^18.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^5.6.0",
59
+ "@atlaskit/tmp-editor-statsig": "^5.7.0",
60
60
  "@atlaskit/tokens": "^4.9.0",
61
61
  "@atlaskit/tooltip": "^20.2.0",
62
62
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -206,9 +206,6 @@
206
206
  "platform_editor_comments_api_manager": {
207
207
  "type": "boolean"
208
208
  },
209
- "platform_editor_comments_api_manager_select": {
210
- "type": "boolean"
211
- },
212
209
  "platform_renderer_isPresentational": {
213
210
  "type": "boolean"
214
211
  },