@atlaskit/renderer 109.6.3 → 109.7.1

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 (97) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/react/index.js +2 -0
  3. package/dist/cjs/react/nodes/codeBlock/components/codeBlockCopyButton.js +1 -4
  4. package/dist/cjs/react/nodes/codeBlock/components/codeBlockWrapButton.js +0 -1
  5. package/dist/cjs/react/nodes/embedCard.js +20 -6
  6. package/dist/cjs/react/nodes/mediaSingle/index.js +20 -19
  7. package/dist/cjs/ui/ExtensionRenderer.js +27 -7
  8. package/dist/cjs/ui/Renderer/index.js +6 -3
  9. package/dist/es2019/react/index.js +2 -0
  10. package/dist/es2019/react/nodes/codeBlock/components/codeBlockCopyButton.js +1 -1
  11. package/dist/es2019/react/nodes/codeBlock/components/codeBlockWrapButton.js +0 -1
  12. package/dist/es2019/react/nodes/embedCard.js +19 -20
  13. package/dist/es2019/react/nodes/mediaSingle/index.js +19 -19
  14. package/dist/es2019/ui/ExtensionRenderer.js +25 -6
  15. package/dist/es2019/ui/Renderer/index.js +6 -3
  16. package/dist/esm/react/index.js +2 -0
  17. package/dist/esm/react/nodes/codeBlock/components/codeBlockCopyButton.js +1 -1
  18. package/dist/esm/react/nodes/codeBlock/components/codeBlockWrapButton.js +0 -1
  19. package/dist/esm/react/nodes/embedCard.js +19 -6
  20. package/dist/esm/react/nodes/mediaSingle/index.js +20 -19
  21. package/dist/esm/ui/ExtensionRenderer.js +24 -6
  22. package/dist/esm/ui/Renderer/index.js +6 -3
  23. package/dist/types/react/index.d.ts +2 -0
  24. package/dist/types/react/marks/index.d.ts +2 -2
  25. package/dist/types/react/nodes/blockquote.d.ts +1 -1
  26. package/dist/types/react/nodes/bodiedExtension.d.ts +1 -1
  27. package/dist/types/react/nodes/bulletList.d.ts +3 -3
  28. package/dist/types/react/nodes/codeBlock/components/codeBlockCopyButton.d.ts +3 -3
  29. package/dist/types/react/nodes/codeBlock/components/codeBlockWrapButton.d.ts +2 -3
  30. package/dist/types/react/nodes/embedCard.d.ts +1 -0
  31. package/dist/types/react/nodes/extensionFrame.d.ts +2 -1
  32. package/dist/types/react/nodes/fallback.d.ts +1 -1
  33. package/dist/types/react/nodes/hardBreak.d.ts +2 -2
  34. package/dist/types/react/nodes/heading-anchor.d.ts +2 -9
  35. package/dist/types/react/nodes/index.d.ts +3 -2
  36. package/dist/types/react/nodes/inlineExtension.d.ts +2 -2
  37. package/dist/types/react/nodes/layoutColumn.d.ts +2 -2
  38. package/dist/types/react/nodes/layoutSection.d.ts +1 -1
  39. package/dist/types/react/nodes/listItem.d.ts +1 -1
  40. package/dist/types/react/nodes/mediaInline.d.ts +2 -3
  41. package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
  42. package/dist/types/react/nodes/multiBodiedExtension.d.ts +2 -1
  43. package/dist/types/react/nodes/table/sticky.d.ts +1 -1
  44. package/dist/types/react/nodes/unknownBlock.d.ts +1 -1
  45. package/dist/types/react/types.d.ts +7 -7
  46. package/dist/types/react/utils/EditorMediaClientProvider.d.ts +4 -4
  47. package/dist/types/ui/Renderer/ErrorBoundary.d.ts +1 -0
  48. package/dist/types/ui/Renderer/truncated-wrapper.d.ts +2 -1
  49. package/dist/types/ui/Renderer/types.d.ts +1 -1
  50. package/dist/types/ui/SmartCardStorage.d.ts +2 -2
  51. package/dist/types/ui/annotations/context.d.ts +1 -1
  52. package/dist/types/ui/annotations/draft/component.d.ts +4 -3
  53. package/dist/types/ui/annotations/element/index.d.ts +1 -1
  54. package/dist/types/ui/annotations/element/mark.d.ts +2 -1
  55. package/dist/types/ui/annotations/index.d.ts +1 -1
  56. package/dist/types/ui/annotations/selection/mounter.d.ts +2 -2
  57. package/dist/types/ui/annotations/selection/range-validator.d.ts +2 -2
  58. package/dist/types/ui/annotations/view/index.d.ts +2 -2
  59. package/dist/types/ui/renderer-props.d.ts +1 -0
  60. package/dist/types-ts4.5/react/index.d.ts +2 -0
  61. package/dist/types-ts4.5/react/marks/index.d.ts +2 -2
  62. package/dist/types-ts4.5/react/nodes/blockquote.d.ts +1 -1
  63. package/dist/types-ts4.5/react/nodes/bodiedExtension.d.ts +1 -1
  64. package/dist/types-ts4.5/react/nodes/bulletList.d.ts +3 -3
  65. package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockCopyButton.d.ts +3 -3
  66. package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockWrapButton.d.ts +2 -3
  67. package/dist/types-ts4.5/react/nodes/embedCard.d.ts +1 -0
  68. package/dist/types-ts4.5/react/nodes/extensionFrame.d.ts +2 -1
  69. package/dist/types-ts4.5/react/nodes/fallback.d.ts +1 -1
  70. package/dist/types-ts4.5/react/nodes/hardBreak.d.ts +2 -2
  71. package/dist/types-ts4.5/react/nodes/heading-anchor.d.ts +2 -9
  72. package/dist/types-ts4.5/react/nodes/index.d.ts +3 -2
  73. package/dist/types-ts4.5/react/nodes/inlineExtension.d.ts +2 -2
  74. package/dist/types-ts4.5/react/nodes/layoutColumn.d.ts +2 -2
  75. package/dist/types-ts4.5/react/nodes/layoutSection.d.ts +1 -1
  76. package/dist/types-ts4.5/react/nodes/listItem.d.ts +1 -1
  77. package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +2 -3
  78. package/dist/types-ts4.5/react/nodes/mediaSingle/index.d.ts +1 -0
  79. package/dist/types-ts4.5/react/nodes/multiBodiedExtension.d.ts +2 -1
  80. package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +1 -1
  81. package/dist/types-ts4.5/react/nodes/unknownBlock.d.ts +1 -1
  82. package/dist/types-ts4.5/react/types.d.ts +7 -7
  83. package/dist/types-ts4.5/react/utils/EditorMediaClientProvider.d.ts +4 -4
  84. package/dist/types-ts4.5/ui/Renderer/ErrorBoundary.d.ts +1 -0
  85. package/dist/types-ts4.5/ui/Renderer/truncated-wrapper.d.ts +2 -1
  86. package/dist/types-ts4.5/ui/Renderer/types.d.ts +1 -1
  87. package/dist/types-ts4.5/ui/SmartCardStorage.d.ts +2 -2
  88. package/dist/types-ts4.5/ui/annotations/context.d.ts +1 -1
  89. package/dist/types-ts4.5/ui/annotations/draft/component.d.ts +4 -3
  90. package/dist/types-ts4.5/ui/annotations/element/index.d.ts +1 -1
  91. package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +2 -1
  92. package/dist/types-ts4.5/ui/annotations/index.d.ts +1 -1
  93. package/dist/types-ts4.5/ui/annotations/selection/mounter.d.ts +2 -2
  94. package/dist/types-ts4.5/ui/annotations/selection/range-validator.d.ts +2 -2
  95. package/dist/types-ts4.5/ui/annotations/view/index.d.ts +2 -2
  96. package/dist/types-ts4.5/ui/renderer-props.d.ts +1 -0
  97. package/package.json +7 -4
@@ -1,7 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
- var _templateObject, _templateObject2;
5
3
  /** @jsx jsx */
6
4
  import { css, jsx } from '@emotion/react';
7
5
  import { useMemo, useContext, useState, useRef } from 'react';
@@ -15,8 +13,21 @@ import { CardErrorBoundary } from './fallback';
15
13
  import { FullPagePadding } from '../../ui/Renderer/style';
16
14
  import { getCardClickHandler } from '../utils/getCardClickHandler';
17
15
  import { AnalyticsContext } from '@atlaskit/analytics-next';
18
- var embedCardWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n\n > div {\n height: 100%;\n }\n\n .loader-wrapper {\n height: 100%;\n }\n\n margin: 0 auto;\n"])));
19
- var uIMediaSingleLayoutStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
16
+ var embedCardWrapperStyles = css({
17
+ width: '100%',
18
+ height: '100%',
19
+ '> div': {
20
+ height: '100%'
21
+ },
22
+ '.loader-wrapper': {
23
+ height: '100%'
24
+ },
25
+ margin: '0 auto'
26
+ });
27
+ var uIMediaSingleLayoutStyles = css({
28
+ marginLeft: '50%',
29
+ transform: 'translateX(-50%)'
30
+ });
20
31
  export default function EmbedCard(props) {
21
32
  var _smartLinks$frameStyl;
22
33
  var url = props.url,
@@ -27,7 +38,8 @@ export default function EmbedCard(props) {
27
38
  width = props.width,
28
39
  isInsideOfBlockNode = props.isInsideOfBlockNode,
29
40
  rendererAppearance = props.rendererAppearance,
30
- smartLinks = props.smartLinks;
41
+ smartLinks = props.smartLinks,
42
+ isInsideOfInlineExtension = props.isInsideOfInlineExtension;
31
43
  var embedIframeRef = useRef(null);
32
44
  var onClick = getCardClickHandler(eventHandlers, url);
33
45
  var _ref = smartLinks || {},
@@ -141,7 +153,8 @@ export default function EmbedCard(props) {
141
153
  fullWidthMode: isFullWidth,
142
154
  nodeType: "embedCard",
143
155
  lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
144
- hasFallbackContainer: hasPreview
156
+ hasFallbackContainer: hasPreview,
157
+ isInsideOfInlineExtension: isInsideOfInlineExtension
145
158
  }, jsx("div", {
146
159
  css: embedCardWrapperStyles
147
160
  }, jsx("div", {
@@ -35,19 +35,18 @@ var checkForMediaElement = function checkForMediaElement(children) {
35
35
  // returns the existing container width if available (non SSR mode), otherwise
36
36
  // we return a default width value
37
37
  export var getMediaContainerWidth = function getMediaContainerWidth(currentContainerWidth, layout) {
38
- if (currentContainerWidth) {
39
- return currentContainerWidth;
40
- }
41
-
42
- // SSR mode fallback to default layout width
43
- switch (layout) {
44
- case 'full-width':
45
- return akEditorFullWidthLayoutWidth;
46
- case 'wide':
47
- return akEditorWideLayoutWidth;
48
- default:
49
- return akEditorDefaultLayoutWidth;
38
+ if (!currentContainerWidth) {
39
+ // SSR mode fallback to default layout width
40
+ switch (layout) {
41
+ case 'full-width':
42
+ return akEditorFullWidthLayoutWidth;
43
+ case 'wide':
44
+ return akEditorWideLayoutWidth;
45
+ default:
46
+ return akEditorDefaultLayoutWidth;
47
+ }
50
48
  }
49
+ return currentContainerWidth;
51
50
  };
52
51
  var MediaSingle = function MediaSingle(props) {
53
52
  var rendererAppearance = props.rendererAppearance,
@@ -58,7 +57,9 @@ var MediaSingle = function MediaSingle(props) {
58
57
  widthAttr = props.width,
59
58
  widthType = props.widthType,
60
59
  _props$allowCaptions = props.allowCaptions,
61
- allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions;
60
+ allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions,
61
+ _props$isInsideOfInli = props.isInsideOfInlineExtension,
62
+ isInsideOfInlineExtension = _props$isInsideOfInli === void 0 ? false : _props$isInsideOfInli;
62
63
  var _React$useState = React.useState({
63
64
  width: 0,
64
65
  height: 0
@@ -135,8 +136,7 @@ var MediaSingle = function MediaSingle(props) {
135
136
  var lineLength = isFullWidth ? minWidth : nonFullWidthSize;
136
137
  return {
137
138
  cardDimensions: cardDimensions,
138
- lineLength: lineLength,
139
- containerWidth: containerWidth
139
+ lineLength: lineLength
140
140
  };
141
141
  };
142
142
  var originalDimensions = {
@@ -144,10 +144,10 @@ var MediaSingle = function MediaSingle(props) {
144
144
  width: width
145
145
  };
146
146
  var renderMediaSingle = function renderMediaSingle(renderWidth) {
147
- var _calcDimensions = calcDimensions(renderWidth),
147
+ var containerWidth = getMediaContainerWidth(renderWidth, layout);
148
+ var _calcDimensions = calcDimensions(containerWidth),
148
149
  cardDimensions = _calcDimensions.cardDimensions,
149
- lineLength = _calcDimensions.lineLength,
150
- containerWidth = _calcDimensions.containerWidth;
150
+ lineLength = _calcDimensions.lineLength;
151
151
  var mediaComponent = /*#__PURE__*/React.cloneElement(media, {
152
152
  resizeMode: 'stretchy-fit',
153
153
  cardDimensions: cardDimensions,
@@ -169,7 +169,8 @@ var MediaSingle = function MediaSingle(props) {
169
169
  width: widthAttr,
170
170
  widthType: widthType
171
171
  },
172
- fullWidthMode: isFullWidth
172
+ fullWidthMode: isFullWidth,
173
+ isInsideOfInlineExtension: isInsideOfInlineExtension
173
174
  }, jsx(Fragment, null, mediaComponent), allowCaptions && caption);
174
175
  };
175
176
  return jsx(WidthConsumer, null, function (_ref3) {
@@ -7,11 +7,19 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
9
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
- import React from 'react';
10
+ /** @jsx jsx */
11
+ import { css, jsx } from '@emotion/react';
12
+ import React, { Fragment } from 'react';
11
13
  import memoizeOne from 'memoize-one';
12
14
  import { getNodeRenderer } from '@atlaskit/editor-common/extensions';
13
15
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
14
16
  import { getExtensionRenderer } from '@atlaskit/editor-common/utils';
17
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
18
+ var inlineExtensionStyle = css({
19
+ '& .rich-media-item': {
20
+ maxWidth: '100%'
21
+ }
22
+ });
15
23
  var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
16
24
  _inherits(ExtensionRenderer, _React$Component);
17
25
  var _super = _createSuper(ExtensionRenderer);
@@ -69,14 +77,14 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
69
77
  if (!result && extensionProvider) {
70
78
  var NodeRenderer = _this.getNodeRenderer(extensionProvider, extensionType, extensionKey);
71
79
  if (node.type === 'multiBodiedExtension') {
72
- result = /*#__PURE__*/React.createElement(NodeRenderer, {
80
+ result = jsx(NodeRenderer, {
73
81
  node: node,
74
82
  actions: actions
75
83
  });
76
84
  } else {
77
- result = /*#__PURE__*/React.createElement(NodeRenderer, {
85
+ result = jsx(InlineNodeRendererWrapper, null, jsx(NodeRenderer, {
78
86
  node: node
79
- });
87
+ }));
80
88
  }
81
89
  }
82
90
  } catch (e) {
@@ -113,7 +121,7 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
113
121
  if (!providers) {
114
122
  return this.setupAndRenderExtensionNode({});
115
123
  }
116
- return /*#__PURE__*/React.createElement(WithProviders, {
124
+ return jsx(WithProviders, {
117
125
  providers: ['extensionProvider'],
118
126
  providerFactory: providers,
119
127
  renderNode: this.setupAndRenderExtensionNode
@@ -122,4 +130,14 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
122
130
  }]);
123
131
  return ExtensionRenderer;
124
132
  }(React.Component);
125
- export { ExtensionRenderer as default };
133
+ export { ExtensionRenderer as default };
134
+ var InlineNodeRendererWrapper = function InlineNodeRendererWrapper(_ref) {
135
+ var children = _ref.children;
136
+ if (getBooleanFF('platform.editor.inline_extension.extended_lcqdn')) {
137
+ return jsx("div", {
138
+ className: "inline-extension-renderer",
139
+ css: inlineExtensionStyle
140
+ }, children);
141
+ }
142
+ return jsx(Fragment, null, children);
143
+ };
@@ -18,6 +18,7 @@ import { reduce } from '@atlaskit/adf-utils/traverse';
18
18
  import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
19
19
  import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
20
20
  import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI, getDistortedDurationMonitor, browser } from '@atlaskit/editor-common/utils';
21
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
21
22
  import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
22
23
  import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
23
24
  import { FabricChannel } from '@atlaskit/analytics-listeners';
@@ -45,7 +46,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
45
46
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
46
47
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
47
48
  var packageName = "@atlaskit/renderer";
48
- var packageVersion = "109.6.3";
49
+ var packageVersion = "109.7.1";
49
50
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
51
  _inherits(Renderer, _PureComponent);
51
52
  var _super = _createSuper(Renderer);
@@ -270,7 +271,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
270
271
  allowPlaceholderText: props.allowPlaceholderText,
271
272
  nodeComponents: props.nodeComponents,
272
273
  // does not currently support SSR, should not be enabled in environments where Renderer is SSR-ed
273
- allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock
274
+ allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
275
+ isInsideOfInlineExtension: getBooleanFF('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension
274
276
  };
275
277
  }
276
278
  }, {
@@ -517,7 +519,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
517
519
  }, [innerRef, addTelepointer]);
518
520
  return jsx(WidthProvider, {
519
521
  className: "ak-renderer-wrapper is-".concat(appearance),
520
- "data-appearance": appearance
522
+ "data-appearance": appearance,
523
+ shouldCheckExistingValue: getBooleanFF('platform.editor.inline_extension.extended_lcqdn') || false
521
524
  }, jsx(BaseTheme, {
522
525
  baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
523
526
  }, jsx(EditorMediaClientProvider, {
@@ -39,6 +39,7 @@ export interface ReactSerializerInit {
39
39
  allowSelectAllTrap?: boolean;
40
40
  nodeComponents?: NodeComponentsProps;
41
41
  allowWindowedCodeBlock?: boolean;
42
+ isInsideOfInlineExtension?: boolean;
42
43
  }
43
44
  interface ParentInfo {
44
45
  parentIsIncompleteTask: boolean;
@@ -84,6 +85,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
84
85
  private allowSelectAllTrap?;
85
86
  private nodeComponents?;
86
87
  private allowWindowedCodeBlock?;
88
+ private isInsideOfInlineExtension?;
87
89
  constructor(init: ReactSerializerInit);
88
90
  private resetState;
89
91
  private getNodeProps;
@@ -16,7 +16,7 @@ import FragmentMark from './fragment';
16
16
  import Annotation, { isAnnotationMark } from './annotation';
17
17
  import Border from './border';
18
18
  export declare const markToReact: {
19
- [key: string]: ComponentType<any>;
19
+ [key: string]: ComponentType<React.PropsWithChildren<any>>;
20
20
  };
21
- export declare const toReact: (mark: Mark) => ComponentType<any>;
21
+ export declare const toReact: (mark: Mark) => ComponentType<React.PropsWithChildren<any>>;
22
22
  export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, Border, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, FragmentMark, };
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export default function Blockquote(props: React.Props<any>): JSX.Element;
2
+ export default function Blockquote(props: React.PropsWithChildren<unknown>): JSX.Element;
@@ -20,5 +20,5 @@ export interface Props {
20
20
  localId?: string;
21
21
  marks?: PMMark[];
22
22
  }
23
- declare const BodiedExtension: React.FunctionComponent<Props>;
23
+ declare const BodiedExtension: React.FunctionComponent<React.PropsWithChildren<Props>>;
24
24
  export default BodiedExtension;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Node } from '@atlaskit/editor-prosemirror/model';
3
- export default function BulletList(props: {
2
+ import type { Node } from '@atlaskit/editor-prosemirror/model';
3
+ export default function BulletList(props: React.PropsWithChildren<{
4
4
  path?: Node[];
5
- } & React.Props<any>): JSX.Element;
5
+ }>): JSX.Element;
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { WrappedComponentProps } from 'react-intl-next';
3
3
  type Props = {
4
4
  content: string;
5
5
  };
6
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
7
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
6
+ declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
7
+ WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
8
8
  };
9
9
  export default _default;
@@ -1,11 +1,10 @@
1
- import React from 'react';
2
1
  import type { Dispatch, SetStateAction } from 'react';
3
2
  import { WrappedComponentProps } from 'react-intl-next';
4
3
  type Props = {
5
4
  setWrapLongLines: Dispatch<SetStateAction<boolean>>;
6
5
  wrapLongLines?: boolean;
7
6
  };
8
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
9
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
7
+ declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
8
+ WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
10
9
  };
11
10
  export default _default;
@@ -16,4 +16,5 @@ export default function EmbedCard(props: {
16
16
  rendererAppearance?: RendererAppearance;
17
17
  isInsideOfBlockNode?: boolean;
18
18
  smartLinks?: SmartLinksOptions;
19
+ isInsideOfInlineExtension?: boolean;
19
20
  }): jsx.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
2
3
  import React from 'react';
3
4
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
5
  import type { RendererContext } from '../types';
@@ -20,5 +21,5 @@ export interface Props {
20
21
  layout?: ExtensionLayout;
21
22
  localId?: string;
22
23
  }
23
- declare const ExtensionFrame: React.FunctionComponent<Props>;
24
+ declare const ExtensionFrame: (props: React.PropsWithChildren<Props>) => jsx.JSX.Element;
24
25
  export default ExtensionFrame;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export type CardErrorBoundaryProps = {
3
- unsupportedComponent: React.ComponentType;
3
+ unsupportedComponent: React.ComponentType<React.PropsWithChildren<unknown>>;
4
4
  };
5
5
  export declare class CardErrorBoundary extends React.PureComponent<{
6
6
  url?: string;
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  interface Props {
3
3
  forceNewLine?: boolean;
4
4
  }
5
- declare const HardBreak: React.FunctionComponent<Props>;
5
+ declare const HardBreak: ({ forceNewLine }: Props) => JSX.Element;
6
6
  export default HardBreak;
@@ -1,13 +1,6 @@
1
1
  import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
2
  export declare const HeadingAnchorWrapperClassName = "heading-anchor-wrapper";
4
- type Props = {
5
- onCopyText: () => Promise<void>;
6
- enableNestedHeaderLinks?: boolean;
7
- level: number;
8
- };
9
- type HeadingAnchorProps = Props & React.Props<any> & WrappedComponentProps;
10
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<HeadingAnchorProps>> & {
11
- WrappedComponent: React.ComponentType<HeadingAnchorProps>;
3
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<any>> & {
4
+ WrappedComponent: React.ComponentType<any>;
12
5
  };
13
6
  export default _default;
@@ -50,6 +50,7 @@ declare const EmbedCard: React.ComponentType<{
50
50
  rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
51
51
  isInsideOfBlockNode?: boolean | undefined;
52
52
  smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions | undefined;
53
+ isInsideOfInlineExtension?: boolean | undefined;
53
54
  }> & Loadable.LoadableComponent;
54
55
  declare const InlineCard: React.ComponentType<import("@atlaskit/editor-common/utils").Diff<import("./inlineCard").InlineCardProps & import("../../ui/SmartCardStorage").WithSmartCardStorageProps, import("../../ui/SmartCardStorage").WithSmartCardStorageProps>> & Loadable.LoadableComponent;
55
56
  declare const BlockCard: React.ComponentType<{
@@ -70,13 +71,13 @@ declare const MediaSingle: React.ComponentType<import("react-intl-next").WithInt
70
71
  declare const Mention: React.ComponentType<import("./mention").Props> & Loadable.LoadableComponent;
71
72
  declare const Expand: React.ComponentType<import("react-intl-next").WithIntlProps<import("../../ui/Expand").ExpandProps & import("react-intl-next").WrappedComponentProps<"intl">>> & Loadable.LoadableComponent;
72
73
  export declare const nodeToReact: {
73
- [key: string]: React.ComponentType<any>;
74
+ [key: string]: React.ComponentType<React.PropsWithChildren<any>>;
74
75
  };
75
76
  export interface ToReactFlags {
76
77
  allowSelectAllTrap?: boolean;
77
78
  allowWindowedCodeBlock?: boolean;
78
79
  }
79
- export declare const toReact: (node: Node, flags?: ToReactFlags, nodeComponents?: NodeComponentsProps) => React.ComponentType<any>;
80
+ export declare const toReact: (node: Node, flags?: ToReactFlags, nodeComponents?: NodeComponentsProps) => React.ComponentType<React.PropsWithChildren<any>>;
80
81
  export interface TextWrapper {
81
82
  type: {
82
83
  name: 'textWrapper';
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import type { RendererContext } from '../types';
3
3
  import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
@@ -14,5 +14,5 @@ export interface Props {
14
14
  localId?: string;
15
15
  marks?: PMMark[];
16
16
  }
17
- declare const InlineExtension: React.FunctionComponent<Props>;
17
+ declare const InlineExtension: (props: Props) => JSX.Element;
18
18
  export default InlineExtension;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- export default function LayoutSection(props: {
4
+ export default function LayoutSection(props: React.PropsWithChildren<{
5
5
  width?: number;
6
- } & React.Props<any>): jsx.JSX.Element;
6
+ }>): jsx.JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export default function LayoutSection(props: React.Props<any>): JSX.Element;
2
+ export default function LayoutSection(props: React.PropsWithChildren<unknown>): JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export default function ListItem(props: React.Props<any>): JSX.Element;
2
+ export default function ListItem(props: React.PropsWithChildren<unknown>): JSX.Element;
@@ -3,7 +3,6 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
3
  import type { EventHandlers } from '@atlaskit/editor-common/ui';
4
4
  import type { FileIdentifier } from '@atlaskit/media-client';
5
5
  import type { MediaFeatureFlags } from '@atlaskit/media-common';
6
- import type { FC } from 'react';
7
6
  import React from 'react';
8
7
  import type { IntlShape, WrappedComponentProps } from 'react-intl-next';
9
8
  import type { ClipboardAttrs } from '../../ui/MediaCard';
@@ -32,8 +31,8 @@ export type MediaInlineProps = {
32
31
  marks?: Array<Mark>;
33
32
  ssr?: MediaSSR;
34
33
  };
35
- export declare const RenderMediaInline: FC<RenderMediaInlineProps>;
36
- declare const _default: FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>> & {
34
+ export declare const RenderMediaInline: ({ rendererAppearance, clipboardAttrs, collection: collectionName, eventHandlers, identifier, }: RenderMediaInlineProps) => JSX.Element;
35
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>> & {
37
36
  WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps<"intl"> & MediaInlineAttrs>;
38
37
  };
39
38
  export default _default;
@@ -16,6 +16,7 @@ export interface Props {
16
16
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
17
17
  featureFlags?: MediaFeatureFlags;
18
18
  allowCaptions?: boolean;
19
+ isInsideOfInlineExtension?: boolean;
19
20
  }
20
21
  export declare const getMediaContainerWidth: (currentContainerWidth: number, layout: MediaSingleLayout) => number;
21
22
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
2
3
  import React from 'react';
3
4
  import type { Mark as PMMark, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
5
  import type { RendererContext } from '../types';
@@ -21,5 +22,5 @@ export interface Props {
21
22
  localId?: string;
22
23
  marks?: PMMark[];
23
24
  }
24
- declare const MultiBodiedExtension: React.FunctionComponent<Props>;
25
+ declare const MultiBodiedExtension: (props: React.PropsWithChildren<Props>) => jsx.JSX.Element;
25
26
  export default MultiBodiedExtension;
@@ -13,7 +13,7 @@ interface FixedProps {
13
13
  mode: StickyMode;
14
14
  rendererAppearance: RendererAppearance;
15
15
  }
16
- export declare const FixedTableDiv: React.FC<FixedProps>;
16
+ export declare const FixedTableDiv: (props: React.PropsWithChildren<FixedProps>) => jsx.JSX.Element;
17
17
  export type StickyTableProps = {
18
18
  left?: number;
19
19
  top?: number;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export default function UnknownBlock(props: React.Props<any>): JSX.Element;
2
+ export default function UnknownBlock(props: React.PropsWithChildren<unknown>): JSX.Element;
@@ -1,12 +1,12 @@
1
- import { PropsWithChildren } from 'react';
2
- import { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
1
+ import type { PropsWithChildren } from 'react';
2
+ import type { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
4
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { EventHandlers } from '@atlaskit/editor-common/ui';
6
- import { AnalyticsEventPayload } from '../analytics/events';
7
- import { Serializer } from '../index';
8
- import { RendererAppearance, HeadingAnchorLinksProps } from '../ui/Renderer/types';
9
- import { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
6
+ import type { AnalyticsEventPayload } from '../analytics/events';
7
+ import type { Serializer } from '../index';
8
+ import type { RendererAppearance, HeadingAnchorLinksProps } from '../ui/Renderer/types';
9
+ import type { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
10
10
  export interface RendererContext {
11
11
  objectAri?: string;
12
12
  containerAri?: string;
@@ -1,5 +1,5 @@
1
- import type { FC } from 'react';
1
+ import React from 'react';
2
2
  import type { MediaSSR } from '../../types/mediaOptions';
3
- export declare const EditorMediaClientProvider: FC<{
4
- ssr?: MediaSSR;
5
- }>;
3
+ export declare const EditorMediaClientProvider: ({ children, ssr, }: React.PropsWithChildren<{
4
+ ssr?: MediaSSR | undefined;
5
+ }>) => JSX.Element;
@@ -3,6 +3,7 @@ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import type { ComponentCrashErrorAEP } from '../../analytics/events';
4
4
  interface ErrorBoundaryProps {
5
5
  component: ComponentCrashErrorAEP['actionSubject'];
6
+ children: React.ReactNode;
6
7
  componentId?: ComponentCrashErrorAEP['actionSubjectId'];
7
8
  fallbackComponent?: React.ReactNode;
8
9
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
@@ -5,8 +5,9 @@ export interface TruncatedWrapperProps {
5
5
  height?: number;
6
6
  fadeHeight?: number;
7
7
  backgroundColor?: string;
8
+ children?: React.ReactNode;
8
9
  }
9
- export declare class TruncatedWrapper extends Component<TruncatedWrapperProps, {}> {
10
+ export declare class TruncatedWrapper extends Component<TruncatedWrapperProps, unknown> {
10
11
  constructor(props: TruncatedWrapperProps);
11
12
  render(): jsx.JSX.Element;
12
13
  }
@@ -11,6 +11,6 @@ export type HeadingAnchorLinksConfig = {
11
11
  allowNestedHeaderLinks?: boolean;
12
12
  };
13
13
  export type NodeComponentsProps = {
14
- [key: string]: React.ComponentType<any>;
14
+ [key: string]: React.ComponentType<React.PropsWithChildren<any>>;
15
15
  };
16
16
  export type HeadingAnchorLinksProps = boolean | HeadingAnchorLinksConfig;
@@ -4,8 +4,8 @@ export interface WithSmartCardStorageProps {
4
4
  smartCardStorage: Map<string, string>;
5
5
  }
6
6
  export declare const Context: React.Context<Map<string, string>>;
7
- export declare const Provider: React.FunctionComponent;
8
- export declare const withSmartCardStorage: <Props extends WithSmartCardStorageProps>(WrappedComponent: React.ComponentType<Props>) => {
7
+ export declare const Provider: ({ children, }: React.PropsWithChildren<unknown>) => JSX.Element;
8
+ export declare const withSmartCardStorage: <Props extends WithSmartCardStorageProps>(WrappedComponent: React.ComponentType<React.PropsWithChildren<Props>>) => {
9
9
  new (props: Diff<Props, WithSmartCardStorageProps> | Readonly<Diff<Props, WithSmartCardStorageProps>>): {
10
10
  render(): JSX.Element;
11
11
  context: any;
@@ -6,7 +6,7 @@ type ChildrenProps = {
6
6
  applyAnnotationDraftAt: (position: Position) => void;
7
7
  clearAnnotationDraft: () => void;
8
8
  };
9
- export type RenderCallbackType = React.FC<ChildrenProps>;
9
+ export type RenderCallbackType = (props: React.PropsWithChildren<ChildrenProps>) => React.ReactNode;
10
10
  type Props = {
11
11
  children: RenderCallbackType;
12
12
  };
@@ -1,11 +1,12 @@
1
1
  /** @jsx jsx */
2
2
  import type { ReactNode } from 'react';
3
3
  import React from 'react';
4
+ import { jsx } from '@emotion/react';
4
5
  import type { Position } from '../types';
5
6
  import { InsertDraftPosition } from '../types';
6
- export declare const AnnotationDraft: React.FC<{
7
+ export declare const AnnotationDraft: ({ draftPosition, children, }: React.PropsWithChildren<{
7
8
  draftPosition: Position;
8
- }>;
9
+ }>) => jsx.JSX.Element;
9
10
  type ApplyAnnotationsProps = {
10
11
  texts: string[];
11
12
  shouldApplyAnnotationAt: InsertDraftPosition.INSIDE | InsertDraftPosition.START | InsertDraftPosition.END;
@@ -18,5 +19,5 @@ type Props = {
18
19
  endPos: number;
19
20
  children: ReactNode;
20
21
  };
21
- export declare const TextWithAnnotationDraft: React.FC<Props>;
22
+ export declare const TextWithAnnotationDraft: ({ startPos, endPos, children, }: Props) => jsx.JSX.Element;
22
23
  export {};
@@ -6,5 +6,5 @@ type MarkElementProps = {
6
6
  dataAttributes: AnnotationDataAttributes;
7
7
  annotationType: AnnotationTypes;
8
8
  };
9
- declare const MarkElement: React.FC<MarkElementProps>;
9
+ declare const MarkElement: ({ annotationParentIds, children, dataAttributes, id, }: React.PropsWithChildren<MarkElementProps>) => JSX.Element;
10
10
  export { MarkElement };
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { jsx } from '@emotion/react';
2
3
  import type { OnAnnotationClickPayload } from '@atlaskit/editor-common/types';
3
4
  import type { AnnotationId, AnnotationDataAttributes } from '@atlaskit/adf-schema';
4
5
  import { AnnotationMarkStates } from '@atlaskit/adf-schema';
@@ -10,5 +11,5 @@ type MarkComponentProps = {
10
11
  hasFocus: boolean;
11
12
  onClick: (props: OnAnnotationClickPayload) => void;
12
13
  };
13
- export declare const MarkComponent: React.FC<MarkComponentProps>;
14
+ export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, }: React.PropsWithChildren<MarkComponentProps>) => jsx.JSX.Element;
14
15
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { AnnotationsWrapperProps } from './types';
3
- export declare const AnnotationsWrapper: React.FC<AnnotationsWrapperProps>;
3
+ export declare const AnnotationsWrapper: (props: React.PropsWithChildren<AnnotationsWrapperProps>) => JSX.Element;
4
4
  export { TextWithAnnotationDraft } from './draft';
5
5
  export { MarkElement as AnnotationMark } from './element';