@atlaskit/renderer 118.6.1 → 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.
Files changed (79) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/entry-points/experimental-sync-custom-nodes/cards.js +26 -0
  3. package/dist/cjs/entry-points/experimental-sync-custom-nodes/media.js +28 -0
  4. package/dist/cjs/entry-points/experimental-sync-custom-nodes/small-nodes.js +42 -0
  5. package/dist/cjs/index.js +1 -2
  6. package/dist/cjs/react/marks/backgroundColor.js +1 -2
  7. package/dist/cjs/react/marks/confluence-inline-comment.js +1 -2
  8. package/dist/cjs/react/marks/index.js +1 -2
  9. package/dist/cjs/react/marks/link.js +1 -2
  10. package/dist/cjs/react/marks/textColor.js +1 -2
  11. package/dist/cjs/react/nodes/bodiedExtension.js +1 -2
  12. package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +1 -2
  13. package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +1 -2
  14. package/dist/cjs/react/nodes/date.js +1 -2
  15. package/dist/cjs/react/nodes/decisionList.js +1 -2
  16. package/dist/cjs/react/nodes/index.js +1 -2
  17. package/dist/cjs/react/nodes/loosely-lazy.js +1 -2
  18. package/dist/cjs/react/nodes/media/index.js +8 -9
  19. package/dist/cjs/react/nodes/mediaGroup.js +1 -2
  20. package/dist/cjs/react/nodes/mediaInline.js +1 -2
  21. package/dist/cjs/react/nodes/mediaSingle/index.js +1 -2
  22. package/dist/cjs/react/nodes/mention.js +1 -2
  23. package/dist/cjs/react/nodes/multiBodiedExtension.js +1 -2
  24. package/dist/cjs/react/nodes/multiBodiedExtensionOld.js +1 -2
  25. package/dist/cjs/react/nodes/status.js +1 -2
  26. package/dist/cjs/react/nodes/taskItem.js +1 -2
  27. package/dist/cjs/react/nodes/taskList.js +1 -2
  28. package/dist/cjs/react/utils/EditorMediaClientProvider.js +1 -2
  29. package/dist/cjs/ui/Expand.js +1 -2
  30. package/dist/cjs/ui/ExtensionRenderer.js +16 -7
  31. package/dist/cjs/ui/MediaCard.js +1 -2
  32. package/dist/cjs/ui/Renderer/PortalContext.js +1 -2
  33. package/dist/cjs/ui/Renderer/RendererStyleContainer.js +11 -1
  34. package/dist/cjs/ui/Renderer/index.js +2 -3
  35. package/dist/cjs/ui/RendererActionsContext/index.js +1 -2
  36. package/dist/cjs/ui/active-header-id-provider.js +1 -2
  37. package/dist/cjs/ui/annotations/contexts/AnnotationHoverContext.js +1 -2
  38. package/dist/cjs/ui/annotations/contexts/AnnotationManagerContext.js +1 -2
  39. package/dist/cjs/ui/annotations/contexts/AnnotationRangeContext.js +1 -2
  40. package/dist/cjs/ui/annotations/draft/component.js +1 -2
  41. package/dist/cjs/ui/annotations/element/index.js +3 -5
  42. package/dist/cjs/ui/annotations/hover/mounter.js +1 -2
  43. package/dist/cjs/ui/annotations/hover/range-validator.js +1 -2
  44. package/dist/cjs/ui/annotations/index.js +3 -5
  45. package/dist/cjs/ui/annotations/selection/mounter.js +17 -18
  46. package/dist/cjs/ui/annotations/selection/range-validator.js +1 -2
  47. package/dist/cjs/ui/annotations/view/index.js +1 -2
  48. package/dist/cjs/ui/annotations/wrapper.js +1 -2
  49. package/dist/es2019/entry-points/experimental-sync-custom-nodes/cards.js +20 -0
  50. package/dist/es2019/entry-points/experimental-sync-custom-nodes/media.js +22 -0
  51. package/dist/es2019/entry-points/experimental-sync-custom-nodes/small-nodes.js +36 -0
  52. package/dist/es2019/ui/ExtensionRenderer.js +14 -6
  53. package/dist/es2019/ui/Renderer/RendererStyleContainer.js +11 -1
  54. package/dist/es2019/ui/Renderer/index.js +1 -1
  55. package/dist/es2019/ui/annotations/element/index.js +2 -3
  56. package/dist/es2019/ui/annotations/index.js +2 -3
  57. package/dist/es2019/ui/annotations/selection/mounter.js +16 -16
  58. package/dist/esm/entry-points/experimental-sync-custom-nodes/cards.js +20 -0
  59. package/dist/esm/entry-points/experimental-sync-custom-nodes/media.js +22 -0
  60. package/dist/esm/entry-points/experimental-sync-custom-nodes/small-nodes.js +36 -0
  61. package/dist/esm/react/nodes/media/index.js +7 -7
  62. package/dist/esm/ui/ExtensionRenderer.js +16 -7
  63. package/dist/esm/ui/Renderer/RendererStyleContainer.js +11 -1
  64. package/dist/esm/ui/Renderer/index.js +1 -1
  65. package/dist/esm/ui/annotations/element/index.js +2 -3
  66. package/dist/esm/ui/annotations/index.js +2 -3
  67. package/dist/esm/ui/annotations/selection/mounter.js +16 -16
  68. package/dist/types/entry-points/experimental-sync-custom-nodes/cards.d.ts +9 -0
  69. package/dist/types/entry-points/experimental-sync-custom-nodes/media.d.ts +9 -0
  70. package/dist/types/entry-points/experimental-sync-custom-nodes/small-nodes.d.ts +9 -0
  71. package/dist/types/ui/ExtensionRenderer.d.ts +3 -1
  72. package/dist/types-ts4.5/entry-points/experimental-sync-custom-nodes/cards.d.ts +9 -0
  73. package/dist/types-ts4.5/entry-points/experimental-sync-custom-nodes/media.d.ts +9 -0
  74. package/dist/types-ts4.5/entry-points/experimental-sync-custom-nodes/small-nodes.d.ts +9 -0
  75. package/dist/types-ts4.5/ui/ExtensionRenderer.d.ts +3 -1
  76. package/experimental-sync-custom-nodes/cards/package.json +17 -0
  77. package/experimental-sync-custom-nodes/media/package.json +17 -0
  78. package/experimental-sync-custom-nodes/small-nodes/package.json +17 -0
  79. package/package.json +8 -5
@@ -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
  });
@@ -0,0 +1,20 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
4
+ import BlockCard from '../../react/nodes/blockCard';
5
+ import EmbedCard from '../../react/nodes/embedCard';
6
+ import InlineCard from '../../react/nodes/inlineCard';
7
+
8
+ /**
9
+ * Synchronous renderer node mapping for card nodes
10
+ *
11
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
12
+ *
13
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
14
+ */
15
+ var nodeToReact = {
16
+ blockCard: BlockCard,
17
+ embedCard: EmbedCard,
18
+ inlineCard: InlineCard
19
+ };
20
+ export default nodeToReact;
@@ -0,0 +1,22 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
4
+ import Media from '../../react/nodes/media';
5
+ import MediaGroup from '../../react/nodes/mediaGroup';
6
+ import MediaInline from '../../react/nodes/mediaInline';
7
+ import MediaSingle from '../../react/nodes/mediaSingle';
8
+
9
+ /**
10
+ * Synchronous renderer node mapping for media nodes
11
+ *
12
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
13
+ *
14
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
15
+ */
16
+ var nodeToReact = {
17
+ media: Media,
18
+ mediaGroup: MediaGroup,
19
+ mediaInline: MediaInline,
20
+ mediaSingle: MediaSingle
21
+ };
22
+ export default nodeToReact;
@@ -0,0 +1,36 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
4
+ import CodeBlock from '../../react/nodes/codeBlock/codeBlock';
5
+ import Date from '../../react/nodes/date';
6
+ import DecisionList from '../../react/nodes/decisionList';
7
+ import DecisionItem from '../../react/nodes/decisionItem';
8
+ import Emoji from '../../react/nodes/emoji';
9
+ import Mention from '../../react/nodes/mention';
10
+ import Panel from '../../react/nodes/panel';
11
+ import Status from '../../react/nodes/status';
12
+ import TaskItem from '../../react/nodes/taskItem';
13
+ import TaskList from '../../react/nodes/taskList';
14
+ import Expand from '../../ui/Expand';
15
+
16
+ /**
17
+ * Synchronous renderer node mapping for "small" / simple nodes
18
+ *
19
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
20
+ *
21
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
22
+ */
23
+ var nodeToReact = {
24
+ codeBlock: CodeBlock,
25
+ date: Date,
26
+ decisionList: DecisionList,
27
+ decisionItem: DecisionItem,
28
+ emoji: Emoji,
29
+ mention: Mention,
30
+ panel: Panel,
31
+ status: Status,
32
+ taskItem: TaskItem,
33
+ taskList: TaskList,
34
+ expand: Expand
35
+ };
36
+ export default nodeToReact;
@@ -429,13 +429,13 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
429
429
  var dataAttributes = props.dataAttributes;
430
430
  var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
431
431
  var _useState9 = useState(),
432
- _useState10 = _slicedToArray(_useState9, 2),
433
- position = _useState10[0],
434
- setPosition = _useState10[1];
435
- var _useState11 = useState(false),
436
- _useState12 = _slicedToArray(_useState11, 2),
437
- shouldApplyDraftAnnotation = _useState12[0],
438
- setShouldApplyDraftAnnotation = _useState12[1];
432
+ _useState0 = _slicedToArray(_useState9, 2),
433
+ position = _useState0[0],
434
+ setPosition = _useState0[1];
435
+ var _useState1 = useState(false),
436
+ _useState10 = _slicedToArray(_useState1, 2),
437
+ shouldApplyDraftAnnotation = _useState10[0],
438
+ setShouldApplyDraftAnnotation = _useState10[1];
439
439
  useEffect(function () {
440
440
  var _draftPosition$from;
441
441
  if (pos === undefined) {
@@ -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
  };
@@ -567,6 +567,16 @@ var indentationSharedStyles = css({
567
567
  }
568
568
  }
569
569
  });
570
+ var indentationSharedStylesWithMarginFix = css({
571
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
572
+ '.fabric-editor-indentation-mark': {
573
+ // Prevent marginTop of p:first-child overrode by batch.css
574
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
575
+ 'p:first-child': {
576
+ marginTop: blockNodesVerticalMargin
577
+ }
578
+ }
579
+ });
570
580
  var blockMarksSharedStyles = css(_defineProperty({}, "*:not(.fabric-editor-block-mark) >,\n \t*:not(.fabric-editor-block-mark) >\n div.fabric-editor-block-mark:first-of-type\n\t:not(.fabric-editor-indentation-mark)\n\t:not(.fabric-editor-alignment),\n \t.fabric-editor-alignment:first-of-type:first-child,\n \t.ProseMirror .fabric-editor-indentation-mark:first-of-type:first-child", {
571
581
  'p, h1, h2, h3, h4, h5, h6, .heading-wrapper': {
572
582
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
@@ -1390,7 +1400,7 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
1390
1400
  '--ak-renderer-editor-font-heading-h6': "".concat(editorUGCToken('editor.font.heading.h6')),
1391
1401
  '--ak-renderer-editor-font-normal-text': "".concat(editorUGCToken('editor.font.body'))
1392
1402
  },
1393
- css: [baseStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, telepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, tasksAndDecisionsStyles, smartCardStyles, fg('platform-linking-visual-refresh-v1') && smartCardStylesAvatarFix, fg('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix,
1403
+ css: [baseStyles, hideHeadingCopyLinkWrapperStyles, appearance === 'full-page' && rendererFullPageStyles, appearance === 'full-width' && rendererFullWidthStyles, appearance === 'full-width' && !isTableResizingEnabled(appearance) && rendererFullWidthStylesForTableResizing, telepointerStyles, whitespaceSharedStyles, blockquoteSharedStyles, fg('platform_editor_typography_ugc') ? headingsSharedStylesWithEditorUGC : headingsSharedStyles, headingWithAlignmentStyles, ruleSharedStyles, fg('platform_editor_typography_ugc') ? paragraphSharedStylesWithEditorUGC : paragraphSharedStyles, listsSharedStyles, browser.gecko && listsSharedStylesForGekko, indentationSharedStyles, fg('platform_editor__renderer_indentation_text_margin') && indentationSharedStylesWithMarginFix, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, backgroundColorStyles, tasksAndDecisionsStyles, smartCardStyles, fg('platform-linking-visual-refresh-v1') && smartCardStylesAvatarFix, fg('smartcard_avatar_margin_fix') && smartCardStylesAvatarMarginFix,
1394
1404
  // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
1395
1405
  fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStyles,
1396
1406
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
@@ -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.1";
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
  });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Synchronous renderer node mapping for card nodes
3
+ *
4
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
5
+ *
6
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
7
+ */
8
+ declare const nodeToReact: typeof import('../../react/nodes').nodeToReact;
9
+ export default nodeToReact;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Synchronous renderer node mapping for media nodes
3
+ *
4
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
5
+ *
6
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
7
+ */
8
+ declare const nodeToReact: typeof import('../../react/nodes').nodeToReact;
9
+ export default nodeToReact;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Synchronous renderer node mapping for "small" / simple nodes
3
+ *
4
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
5
+ *
6
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
7
+ */
8
+ declare const nodeToReact: typeof import('../../react/nodes').nodeToReact;
9
+ export default nodeToReact;
@@ -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 {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Synchronous renderer node mapping for card nodes
3
+ *
4
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
5
+ *
6
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
7
+ */
8
+ declare const nodeToReact: typeof import('../../react/nodes').nodeToReact;
9
+ export default nodeToReact;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Synchronous renderer node mapping for media nodes
3
+ *
4
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
5
+ *
6
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
7
+ */
8
+ declare const nodeToReact: typeof import('../../react/nodes').nodeToReact;
9
+ export default nodeToReact;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Synchronous renderer node mapping for "small" / simple nodes
3
+ *
4
+ * WARNING: This is an EXPERIMENTAL entry point and may change without notice in the future. Use it only at your own risk!
5
+ *
6
+ * Context: https://hello.atlassian.net/wiki/spaces/JIE/pages/5342146338 (Atlassian-internal)
7
+ */
8
+ declare const nodeToReact: typeof import('../../react/nodes').nodeToReact;
9
+ export default nodeToReact;
@@ -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 {};
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/renderer/experimental-sync-custom-nodes/cards",
3
+ "main": "../../dist/cjs/entry-points/experimental-sync-custom-nodes/cards.js",
4
+ "module": "../../dist/esm/entry-points/experimental-sync-custom-nodes/cards.js",
5
+ "module:es2019": "../../dist/es2019/entry-points/experimental-sync-custom-nodes/cards.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/entry-points/experimental-sync-custom-nodes/cards.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.4": {
12
+ "*": [
13
+ "../../dist/types-ts4.5/entry-points/experimental-sync-custom-nodes/cards.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/renderer/experimental-sync-custom-nodes/media",
3
+ "main": "../../dist/cjs/entry-points/experimental-sync-custom-nodes/media.js",
4
+ "module": "../../dist/esm/entry-points/experimental-sync-custom-nodes/media.js",
5
+ "module:es2019": "../../dist/es2019/entry-points/experimental-sync-custom-nodes/media.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/entry-points/experimental-sync-custom-nodes/media.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.4": {
12
+ "*": [
13
+ "../../dist/types-ts4.5/entry-points/experimental-sync-custom-nodes/media.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/renderer/experimental-sync-custom-nodes/small-nodes",
3
+ "main": "../../dist/cjs/entry-points/experimental-sync-custom-nodes/small-nodes.js",
4
+ "module": "../../dist/esm/entry-points/experimental-sync-custom-nodes/small-nodes.js",
5
+ "module:es2019": "../../dist/es2019/entry-points/experimental-sync-custom-nodes/small-nodes.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/entry-points/experimental-sync-custom-nodes/small-nodes.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.4": {
12
+ "*": [
13
+ "../../dist/types-ts4.5/entry-points/experimental-sync-custom-nodes/small-nodes.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "118.6.1",
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.5.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
  },
@@ -257,6 +254,9 @@
257
254
  "platform_editor_nested_table_extension_comment_fix": {
258
255
  "type": "boolean"
259
256
  },
257
+ "platform_editor__renderer_indentation_text_margin": {
258
+ "type": "boolean"
259
+ },
260
260
  "dst-a11y__replace-anchor-with-link__editor": {
261
261
  "type": "boolean"
262
262
  }
@@ -272,6 +272,9 @@
272
272
  "./text-serializer": "./src/text-serializer.ts",
273
273
  "./use-feature-flags": "./src/use-feature-flags.ts",
274
274
  "./utils": "./src/utils.ts",
275
+ "./experimental-sync-custom-nodes/cards": "./src/entry-points/experimental-sync-custom-nodes/cards.ts",
276
+ "./experimental-sync-custom-nodes/media": "./src/entry-points/experimental-sync-custom-nodes/media.ts",
277
+ "./experimental-sync-custom-nodes/small-nodes": "./src/entry-points/experimental-sync-custom-nodes/small-nodes.ts",
275
278
  "./custom-nodes": "./src/custom-nodes.ts"
276
279
  }
277
280
  }