@atlaskit/renderer 120.5.1 → 120.5.2

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 (150) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/afm-cc/tsconfig.json +2 -2
  3. package/dist/cjs/ui/Renderer/index.js +1 -1
  4. package/dist/es2019/ui/Renderer/index.js +1 -1
  5. package/dist/esm/ui/Renderer/index.js +1 -1
  6. package/dist/types/actions/index.d.ts +2 -2
  7. package/dist/types/actions/matches-utils.d.ts +2 -2
  8. package/dist/types/analytics/events.d.ts +18 -18
  9. package/dist/types/analytics/unsupported-content.d.ts +2 -2
  10. package/dist/types/react/index.d.ts +32 -32
  11. package/dist/types/react/marks/link.d.ts +1 -1
  12. package/dist/types/react/nodes/blockCard.d.ts +4 -4
  13. package/dist/types/react/nodes/bodiedExtension.d.ts +9 -9
  14. package/dist/types/react/nodes/codeBlock/codeBlock.d.ts +3 -3
  15. package/dist/types/react/nodes/date.d.ts +1 -1
  16. package/dist/types/react/nodes/embedCard.d.ts +6 -6
  17. package/dist/types/react/nodes/emoji.d.ts +2 -2
  18. package/dist/types/react/nodes/extension.d.ts +7 -7
  19. package/dist/types/react/nodes/extensionFrame.d.ts +8 -8
  20. package/dist/types/react/nodes/fallback.d.ts +3 -3
  21. package/dist/types/react/nodes/heading-anchor.d.ts +3 -3
  22. package/dist/types/react/nodes/heading.d.ts +4 -4
  23. package/dist/types/react/nodes/index.d.ts +18 -18
  24. package/dist/types/react/nodes/inlineCard.d.ts +3 -3
  25. package/dist/types/react/nodes/inlineExtension.d.ts +5 -5
  26. package/dist/types/react/nodes/media/index.d.ts +11 -11
  27. package/dist/types/react/nodes/mediaGroup.d.ts +1 -1
  28. package/dist/types/react/nodes/mediaInline.d.ts +3 -3
  29. package/dist/types/react/nodes/mediaSingle/index.d.ts +9 -9
  30. package/dist/types/react/nodes/mention.d.ts +3 -3
  31. package/dist/types/react/nodes/multiBodiedExtension/actions.d.ts +2 -2
  32. package/dist/types/react/nodes/multiBodiedExtension/context.d.ts +2 -2
  33. package/dist/types/react/nodes/multiBodiedExtension.d.ts +8 -8
  34. package/dist/types/react/nodes/multiBodiedExtensionOld.d.ts +8 -8
  35. package/dist/types/react/nodes/orderedList.d.ts +3 -3
  36. package/dist/types/react/nodes/panel.d.ts +4 -4
  37. package/dist/types/react/nodes/placeholder.d.ts +1 -1
  38. package/dist/types/react/nodes/status.d.ts +1 -1
  39. package/dist/types/react/nodes/table/sticky.d.ts +11 -11
  40. package/dist/types/react/nodes/table/table.d.ts +2 -2
  41. package/dist/types/react/nodes/table/types.d.ts +6 -6
  42. package/dist/types/react/nodes/table.d.ts +6 -6
  43. package/dist/types/react/nodes/tableCell.d.ts +5 -5
  44. package/dist/types/react/nodes/tableNew.d.ts +5 -5
  45. package/dist/types/react/nodes/tableRow.d.ts +4 -4
  46. package/dist/types/react/nodes/task-item-with-providers.d.ts +9 -9
  47. package/dist/types/react/nodes/taskItem.d.ts +3 -3
  48. package/dist/types/react/nodes/taskList.d.ts +1 -1
  49. package/dist/types/react/nodes/text-wrapper.d.ts +3 -3
  50. package/dist/types/react/types.d.ts +29 -29
  51. package/dist/types/react/utils/segment-text.d.ts +3 -3
  52. package/dist/types/render-document.d.ts +2 -2
  53. package/dist/types/steps/index.d.ts +1 -1
  54. package/dist/types/types/i18n.d.ts +2 -2
  55. package/dist/types/types/mediaOptions.d.ts +3 -3
  56. package/dist/types/types/smartLinksOptions.d.ts +19 -19
  57. package/dist/types/ui/Expand.d.ts +2 -2
  58. package/dist/types/ui/ExtensionRenderer.d.ts +11 -11
  59. package/dist/types/ui/MediaCard.d.ts +18 -18
  60. package/dist/types/ui/Renderer/ErrorBoundary.d.ts +4 -4
  61. package/dist/types/ui/Renderer/ValidationContext.d.ts +1 -1
  62. package/dist/types/ui/Renderer/index.d.ts +12 -12
  63. package/dist/types/ui/Renderer/truncated-wrapper.d.ts +2 -2
  64. package/dist/types/ui/annotations/contexts/AnnotationManagerContext.d.ts +15 -15
  65. package/dist/types/ui/annotations/contexts/AnnotationRangeContext.d.ts +15 -15
  66. package/dist/types/ui/annotations/draft/component.d.ts +5 -5
  67. package/dist/types/ui/annotations/draft/text.d.ts +1 -1
  68. package/dist/types/ui/annotations/element/index.d.ts +2 -2
  69. package/dist/types/ui/annotations/element/mark.d.ts +2 -2
  70. package/dist/types/ui/annotations/hooks/use-events.d.ts +2 -2
  71. package/dist/types/ui/annotations/hover/mounter.d.ts +6 -6
  72. package/dist/types/ui/annotations/hover/range-validator.d.ts +1 -1
  73. package/dist/types/ui/annotations/selection/mounter.d.ts +6 -6
  74. package/dist/types/ui/annotations/selection/range-validator.d.ts +2 -2
  75. package/dist/types/ui/annotations/types.d.ts +6 -6
  76. package/dist/types/ui/annotations/wrapper.d.ts +1 -1
  77. package/dist/types/ui/renderer-props.d.ts +62 -62
  78. package/dist/types-ts4.5/actions/index.d.ts +2 -2
  79. package/dist/types-ts4.5/actions/matches-utils.d.ts +2 -2
  80. package/dist/types-ts4.5/analytics/events.d.ts +18 -18
  81. package/dist/types-ts4.5/analytics/unsupported-content.d.ts +2 -2
  82. package/dist/types-ts4.5/react/index.d.ts +32 -32
  83. package/dist/types-ts4.5/react/marks/link.d.ts +1 -1
  84. package/dist/types-ts4.5/react/nodes/blockCard.d.ts +4 -4
  85. package/dist/types-ts4.5/react/nodes/bodiedExtension.d.ts +9 -9
  86. package/dist/types-ts4.5/react/nodes/codeBlock/codeBlock.d.ts +3 -3
  87. package/dist/types-ts4.5/react/nodes/date.d.ts +1 -1
  88. package/dist/types-ts4.5/react/nodes/embedCard.d.ts +6 -6
  89. package/dist/types-ts4.5/react/nodes/emoji.d.ts +2 -2
  90. package/dist/types-ts4.5/react/nodes/extension.d.ts +7 -7
  91. package/dist/types-ts4.5/react/nodes/extensionFrame.d.ts +8 -8
  92. package/dist/types-ts4.5/react/nodes/fallback.d.ts +3 -3
  93. package/dist/types-ts4.5/react/nodes/heading-anchor.d.ts +3 -3
  94. package/dist/types-ts4.5/react/nodes/heading.d.ts +4 -4
  95. package/dist/types-ts4.5/react/nodes/index.d.ts +18 -18
  96. package/dist/types-ts4.5/react/nodes/inlineCard.d.ts +3 -3
  97. package/dist/types-ts4.5/react/nodes/inlineExtension.d.ts +5 -5
  98. package/dist/types-ts4.5/react/nodes/media/index.d.ts +11 -11
  99. package/dist/types-ts4.5/react/nodes/mediaGroup.d.ts +1 -1
  100. package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +3 -3
  101. package/dist/types-ts4.5/react/nodes/mediaSingle/index.d.ts +9 -9
  102. package/dist/types-ts4.5/react/nodes/mention.d.ts +3 -3
  103. package/dist/types-ts4.5/react/nodes/multiBodiedExtension/actions.d.ts +2 -2
  104. package/dist/types-ts4.5/react/nodes/multiBodiedExtension/context.d.ts +2 -2
  105. package/dist/types-ts4.5/react/nodes/multiBodiedExtension.d.ts +8 -8
  106. package/dist/types-ts4.5/react/nodes/multiBodiedExtensionOld.d.ts +8 -8
  107. package/dist/types-ts4.5/react/nodes/orderedList.d.ts +3 -3
  108. package/dist/types-ts4.5/react/nodes/panel.d.ts +4 -4
  109. package/dist/types-ts4.5/react/nodes/placeholder.d.ts +1 -1
  110. package/dist/types-ts4.5/react/nodes/status.d.ts +1 -1
  111. package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +11 -11
  112. package/dist/types-ts4.5/react/nodes/table/table.d.ts +2 -2
  113. package/dist/types-ts4.5/react/nodes/table/types.d.ts +6 -6
  114. package/dist/types-ts4.5/react/nodes/table.d.ts +6 -6
  115. package/dist/types-ts4.5/react/nodes/tableCell.d.ts +5 -5
  116. package/dist/types-ts4.5/react/nodes/tableNew.d.ts +5 -5
  117. package/dist/types-ts4.5/react/nodes/tableRow.d.ts +4 -4
  118. package/dist/types-ts4.5/react/nodes/task-item-with-providers.d.ts +9 -9
  119. package/dist/types-ts4.5/react/nodes/taskItem.d.ts +3 -3
  120. package/dist/types-ts4.5/react/nodes/taskList.d.ts +1 -1
  121. package/dist/types-ts4.5/react/nodes/text-wrapper.d.ts +3 -3
  122. package/dist/types-ts4.5/react/types.d.ts +29 -29
  123. package/dist/types-ts4.5/react/utils/segment-text.d.ts +3 -3
  124. package/dist/types-ts4.5/render-document.d.ts +2 -2
  125. package/dist/types-ts4.5/steps/index.d.ts +1 -1
  126. package/dist/types-ts4.5/types/i18n.d.ts +2 -2
  127. package/dist/types-ts4.5/types/mediaOptions.d.ts +3 -3
  128. package/dist/types-ts4.5/types/smartLinksOptions.d.ts +19 -19
  129. package/dist/types-ts4.5/ui/Expand.d.ts +2 -2
  130. package/dist/types-ts4.5/ui/ExtensionRenderer.d.ts +11 -11
  131. package/dist/types-ts4.5/ui/MediaCard.d.ts +18 -18
  132. package/dist/types-ts4.5/ui/Renderer/ErrorBoundary.d.ts +4 -4
  133. package/dist/types-ts4.5/ui/Renderer/ValidationContext.d.ts +1 -1
  134. package/dist/types-ts4.5/ui/Renderer/index.d.ts +12 -12
  135. package/dist/types-ts4.5/ui/Renderer/truncated-wrapper.d.ts +2 -2
  136. package/dist/types-ts4.5/ui/annotations/contexts/AnnotationManagerContext.d.ts +15 -15
  137. package/dist/types-ts4.5/ui/annotations/contexts/AnnotationRangeContext.d.ts +15 -15
  138. package/dist/types-ts4.5/ui/annotations/draft/component.d.ts +5 -5
  139. package/dist/types-ts4.5/ui/annotations/draft/text.d.ts +1 -1
  140. package/dist/types-ts4.5/ui/annotations/element/index.d.ts +2 -2
  141. package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +2 -2
  142. package/dist/types-ts4.5/ui/annotations/hooks/use-events.d.ts +2 -2
  143. package/dist/types-ts4.5/ui/annotations/hover/mounter.d.ts +6 -6
  144. package/dist/types-ts4.5/ui/annotations/hover/range-validator.d.ts +1 -1
  145. package/dist/types-ts4.5/ui/annotations/selection/mounter.d.ts +6 -6
  146. package/dist/types-ts4.5/ui/annotations/selection/range-validator.d.ts +2 -2
  147. package/dist/types-ts4.5/ui/annotations/types.d.ts +6 -6
  148. package/dist/types-ts4.5/ui/annotations/wrapper.d.ts +1 -1
  149. package/dist/types-ts4.5/ui/renderer-props.d.ts +62 -62
  150. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
1
  export interface MessageDescriptor {
2
- id: string;
3
- description: string;
4
2
  defaultMessage: string;
3
+ description: string;
4
+ id: string;
5
5
  }
@@ -1,14 +1,14 @@
1
1
  import type { MediaClientConfig } from '@atlaskit/media-core';
2
2
  import type { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
3
3
  export type MediaSSR = {
4
- mode: SSR;
5
4
  config: MediaClientConfig;
5
+ mode: SSR;
6
6
  };
7
7
  export interface MediaOptions {
8
+ allowCaptions?: boolean;
8
9
  allowLinking?: boolean;
9
10
  enableDownloadButton?: boolean;
11
+ enableSyncMediaCard?: boolean;
10
12
  featureFlags?: MediaFeatureFlags;
11
13
  ssr?: MediaSSR;
12
- allowCaptions?: boolean;
13
- enableSyncMediaCard?: boolean;
14
14
  }
@@ -1,20 +1,6 @@
1
1
  import type React from 'react';
2
2
  import type { CardProps } from '@atlaskit/smart-card';
3
3
  export interface SmartLinksOptions {
4
- /**
5
- * A flag to enable inline Smart Link to render without lazy loading.
6
- * Default is false.
7
- *
8
- * Component: inline
9
- */
10
- ssr?: boolean;
11
- /**
12
- * A flag to disable hover preview on inline Smart Link.
13
- * Default is false.
14
- *
15
- * Component: inline
16
- */
17
- hideHoverPreview?: boolean;
18
4
  /**
19
5
  * Configure visibility of actions available.
20
6
  * By default, smart links show all actions available on the views.
@@ -24,6 +10,13 @@ export interface SmartLinksOptions {
24
10
  * Component: inline (hover preview), block (card)
25
11
  */
26
12
  actionOptions?: CardProps['actionOptions'];
13
+ /**
14
+ * Competitor Prompt Component for Competitor link
15
+ */
16
+ CompetitorPrompt?: React.ComponentType<{
17
+ linkType?: string;
18
+ sourceUrl: string;
19
+ }>;
27
20
  /**
28
21
  * A prop that determines the style of a frame:
29
22
  * whether to show it, hide it or only show it when a user hovers over embed.
@@ -33,10 +26,17 @@ export interface SmartLinksOptions {
33
26
  */
34
27
  frameStyle?: CardProps['frameStyle'];
35
28
  /**
36
- * Competitor Prompt Component for Competitor link
29
+ * A flag to disable hover preview on inline Smart Link.
30
+ * Default is false.
31
+ *
32
+ * Component: inline
37
33
  */
38
- CompetitorPrompt?: React.ComponentType<{
39
- sourceUrl: string;
40
- linkType?: string;
41
- }>;
34
+ hideHoverPreview?: boolean;
35
+ /**
36
+ * A flag to enable inline Smart Link to render without lazy loading.
37
+ * Default is false.
38
+ *
39
+ * Component: inline
40
+ */
41
+ ssr?: boolean;
42
42
  }
@@ -3,12 +3,12 @@ import type { WrappedComponentProps } from 'react-intl-next';
3
3
  import type { AnalyticsEventPayload } from '../analytics/events';
4
4
  import type { RendererAppearance } from './Renderer/types';
5
5
  export interface ExpandProps {
6
- title: string;
7
- nodeType: 'expand' | 'nestedExpand';
8
6
  children: React.ReactNode;
9
7
  fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
10
8
  nestedHeaderIds?: Array<string>;
9
+ nodeType: 'expand' | 'nestedExpand';
11
10
  rendererAppearance?: RendererAppearance;
11
+ title: string;
12
12
  }
13
13
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<ExpandProps & WrappedComponentProps>> & {
14
14
  WrappedComponent: React.ComponentType<ExpandProps & WrappedComponentProps>;
@@ -10,22 +10,22 @@ import type { ExtensionHandlers, MultiBodiedExtensionActions } from '@atlaskit/e
10
10
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
11
11
  import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
12
12
  interface Props {
13
- type: 'extension' | 'inlineExtension' | 'bodiedExtension' | 'multiBodiedExtension';
14
- extensionHandlers?: ExtensionHandlers;
15
- providers?: ProviderFactory;
16
- rendererContext: RendererContext;
17
- extensionType: string;
18
- extensionKey: string;
19
13
  actions?: MultiBodiedExtensionActions;
20
- text?: string;
21
- parameters?: any;
14
+ children: ({ result }: {
15
+ result?: JSX.Element | null;
16
+ }) => JSX.Element;
22
17
  content?: any;
18
+ extensionHandlers?: ExtensionHandlers;
19
+ extensionKey: string;
20
+ extensionType: string;
23
21
  layout?: ExtensionLayout;
24
22
  localId?: string;
25
23
  marks?: PMMark[];
26
- children: ({ result }: {
27
- result?: JSX.Element | null;
28
- }) => JSX.Element;
24
+ parameters?: any;
25
+ providers?: ProviderFactory;
26
+ rendererContext: RendererContext;
27
+ text?: string;
28
+ type: 'extension' | 'inlineExtension' | 'bodiedExtension' | 'multiBodiedExtension';
29
29
  }
30
30
  export default function ExtensionRenderer(props: Props): JSX.Element;
31
31
  export declare const InlineNodeRendererWrapper: ({ children, ssrPlaceholder, ssrPlaceholderReplace, }: React.PropsWithChildren<{
@@ -14,33 +14,33 @@ export type MediaProvider = {
14
14
  viewMediaClientConfig: MediaClientConfig;
15
15
  };
16
16
  export interface MediaCardProps {
17
- id?: string;
17
+ alt?: string;
18
+ appearance?: CardAppearance;
19
+ cardDimensions?: CardDimensions;
20
+ collection?: string;
18
21
  contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
22
+ dataAttributes?: Record<string, any>;
23
+ disableOverlay?: boolean;
24
+ enableSyncMediaCard?: boolean;
19
25
  eventHandlers?: {
20
26
  media?: {
21
27
  onClick?: CardOnClickCallback;
22
28
  };
23
29
  };
24
- shouldOpenMediaViewer?: boolean;
25
- type: MediaType;
26
- collection?: string;
27
- url?: string;
28
- cardDimensions?: CardDimensions;
30
+ featureFlags?: MediaFeatureFlags;
31
+ id?: string;
32
+ imageStatus?: ImageStatus;
33
+ occurrenceKey?: string;
29
34
  originalDimensions?: NumericalCardDimensions;
30
- resizeMode?: ImageResizeMode;
31
- appearance?: CardAppearance;
32
35
  rendererAppearance?: RendererAppearance;
33
- occurrenceKey?: string;
34
- imageStatus?: ImageStatus;
35
- disableOverlay?: boolean;
36
- useInlinePlayer?: boolean;
37
36
  rendererContext?: RendererContext;
38
- alt?: string;
39
- featureFlags?: MediaFeatureFlags;
37
+ resizeMode?: ImageResizeMode;
40
38
  shouldEnableDownloadButton?: boolean;
39
+ shouldOpenMediaViewer?: boolean;
41
40
  ssr?: MediaSSR;
42
- dataAttributes?: Record<string, any>;
43
- enableSyncMediaCard?: boolean;
41
+ type: MediaType;
42
+ url?: string;
43
+ useInlinePlayer?: boolean;
44
44
  }
45
45
  interface State {
46
46
  contextIdentifierProvider?: ContextIdentifierProvider;
@@ -68,12 +68,12 @@ export declare class MediaCardView extends Component<MediaCardProps & {
68
68
  render(): React.JSX.Element | null;
69
69
  }
70
70
  export type ClipboardAttrs = {
71
- id: string;
72
71
  alt?: string;
73
72
  collection?: string;
74
73
  contextIdentifierProvider?: ContextIdentifierProvider;
75
- originalDimensions?: NumericalCardDimensions;
76
74
  fileState?: FileState;
75
+ id: string;
76
+ originalDimensions?: NumericalCardDimensions;
77
77
  };
78
78
  export declare const getClipboardAttrs: ({ id, alt, collection, contextIdentifierProvider, originalDimensions, fileState, }: ClipboardAttrs) => {
79
79
  [key: string]: string | number | undefined;
@@ -2,17 +2,17 @@ import React from 'react';
2
2
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import type { ComponentCrashErrorAEP } from '../../analytics/events';
4
4
  interface ErrorBoundaryProps {
5
- component: ComponentCrashErrorAEP['actionSubject'];
5
+ additionalInfo?: string;
6
6
  children: React.ReactNode;
7
+ component: ComponentCrashErrorAEP['actionSubject'];
7
8
  componentId?: ComponentCrashErrorAEP['actionSubjectId'];
8
- fallbackComponent?: React.ReactNode;
9
9
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
10
+ fallbackComponent?: React.ReactNode;
10
11
  rethrowError?: boolean;
11
- additionalInfo?: string;
12
12
  }
13
13
  interface ErrorBoundaryState {
14
- errorCaptured: boolean;
15
14
  domError: boolean;
15
+ errorCaptured: boolean;
16
16
  }
17
17
  export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
18
18
  state: {
@@ -1,6 +1,6 @@
1
1
  type ValidationContextType = {
2
- skipValidation?: boolean;
3
2
  allowNestedTables?: boolean;
3
+ skipValidation?: boolean;
4
4
  } | null;
5
5
  /**
6
6
  * The ValidationContext is used to pass down the `skipValidation` flag from the NBMRenderer
@@ -10,8 +10,8 @@ import type { RendererAppearance } from './types';
10
10
  export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
11
11
  export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
12
12
  export declare const RendererFunctionalComponent: (props: RendererProps & {
13
- startPos?: number;
14
13
  skipValidation?: boolean;
14
+ startPos?: number;
15
15
  validationOverrides?: {
16
16
  allowNestedTables?: boolean;
17
17
  };
@@ -24,25 +24,25 @@ export declare const RendererFunctionalComponent: (props: RendererProps & {
24
24
  export declare function Renderer(props: RendererProps): jsx.JSX.Element;
25
25
  export declare const RendererWithAnalytics: React.MemoExoticComponent<(props: RendererProps) => jsx.JSX.Element>;
26
26
  export type RendererWrapperProps = {
27
+ addTelepointer?: boolean;
27
28
  allowAnnotations?: boolean;
28
- appearance: RendererAppearance;
29
- innerRef?: React.RefObject<HTMLDivElement>;
30
29
  allowColumnSorting?: boolean;
31
30
  allowCopyToClipboard?: boolean;
32
- allowWrapCodeBlock?: boolean;
33
- allowPlaceholderText?: boolean;
34
31
  allowCustomPanels?: boolean;
35
- addTelepointer?: boolean;
36
32
  allowNestedHeaderLinks: boolean;
37
- useBlockRenderForCodeBlock: boolean;
38
- onClick?: (event: React.MouseEvent) => void;
39
- onMouseDown?: (event: React.MouseEvent) => void;
40
- ssr?: MediaSSR;
41
- isInsideOfInlineExtension?: boolean;
33
+ allowPlaceholderText?: boolean;
34
+ allowRendererContainerStyles?: boolean;
42
35
  allowTableResizing?: boolean;
36
+ allowWrapCodeBlock?: boolean;
37
+ appearance: RendererAppearance;
38
+ innerRef?: React.RefObject<HTMLDivElement>;
39
+ isInsideOfInlineExtension?: boolean;
43
40
  isTopLevelRenderer?: boolean;
41
+ onClick?: (event: React.MouseEvent) => void;
42
+ onMouseDown?: (event: React.MouseEvent) => void;
44
43
  shouldRemoveEmptySpaceAroundContent?: boolean;
45
- allowRendererContainerStyles?: boolean;
44
+ ssr?: MediaSSR;
45
+ useBlockRenderForCodeBlock: boolean;
46
46
  } & {
47
47
  children?: React.ReactNode;
48
48
  };
@@ -5,10 +5,10 @@
5
5
  import { jsx } from '@emotion/react';
6
6
  import { Component } from 'react';
7
7
  interface TruncatedWrapperProps {
8
- height?: number;
9
- fadeHeight?: number;
10
8
  backgroundColor?: string;
11
9
  children?: React.ReactNode;
10
+ fadeHeight?: number;
11
+ height?: number;
12
12
  }
13
13
  export declare class TruncatedWrapper extends Component<TruncatedWrapperProps, unknown> {
14
14
  constructor(props: TruncatedWrapperProps);
@@ -8,14 +8,14 @@ interface AnnotationState {
8
8
  }
9
9
  type AnnotationsStateRecord = Record<AnnotationId, AnnotationState>;
10
10
  interface AnnotationManagerStateContext {
11
- isDrafting: boolean;
12
- draftId: string | undefined;
13
- draftMarkRef: HTMLElement | undefined;
14
- draftActionResult: ActionResult | undefined;
15
11
  annotations: AnnotationsStateRecord;
12
+ currentHoveredAnnotationId: AnnotationId | undefined;
16
13
  currentSelectedAnnotationId: AnnotationId | undefined;
17
14
  currentSelectedMarkRef: HTMLElement | undefined;
18
- currentHoveredAnnotationId: AnnotationId | undefined;
15
+ draftActionResult: ActionResult | undefined;
16
+ draftId: string | undefined;
17
+ draftMarkRef: HTMLElement | undefined;
18
+ isDrafting: boolean;
19
19
  }
20
20
  interface AnnotationManagerDispatchContext {
21
21
  annotationManager: AnnotationManager | undefined;
@@ -26,44 +26,44 @@ declare const AnnotationManagerDispatchContext: React.Context<AnnotationManagerD
26
26
  type AnnotationManagerAction = {
27
27
  type: 'reset';
28
28
  } | {
29
- type: 'loadAnnotation';
30
29
  data: {
31
30
  id: AnnotationId;
32
31
  markState?: AnnotationMarkStates;
33
32
  }[];
33
+ type: 'loadAnnotation';
34
34
  } | {
35
- type: 'updateAnnotation';
36
35
  data: {
37
- id: AnnotationId;
38
- selected?: boolean;
39
36
  hovered?: boolean;
37
+ id: AnnotationId;
40
38
  markState?: AnnotationMarkStates;
39
+ selected?: boolean;
41
40
  };
41
+ type: 'updateAnnotation';
42
42
  } | {
43
43
  type: 'resetSelectedAnnotation';
44
44
  } | {
45
45
  type: 'resetHoveredAnnotation';
46
46
  } | {
47
- type: 'setDrafting';
48
47
  data: {
49
- isDrafting: boolean;
50
- draftId: string | undefined;
51
48
  draftActionResult: ActionResult | undefined;
49
+ draftId: string | undefined;
50
+ isDrafting: boolean;
52
51
  };
52
+ type: 'setDrafting';
53
53
  } | {
54
- type: 'setDraftMarkRef';
55
54
  data: {
56
55
  draftMarkRef: HTMLElement | undefined;
57
56
  };
57
+ type: 'setDraftMarkRef';
58
58
  } | {
59
- type: 'setSelectedMarkRef';
60
59
  data: {
61
60
  markRef: HTMLElement | undefined;
62
61
  };
62
+ type: 'setSelectedMarkRef';
63
63
  };
64
64
  export declare const AnnotationManagerProvider: ({ children, annotationManager, updateSubscriber, }: {
65
- children?: ReactNode;
66
65
  annotationManager?: AnnotationManager;
66
+ children?: ReactNode;
67
67
  updateSubscriber?: AnnotationUpdateEmitter;
68
68
  }) => React.JSX.Element;
69
69
  export declare const useAnnotationManagerState: () => AnnotationManagerStateContext;
@@ -3,46 +3,46 @@ import React from 'react';
3
3
  import type { Position } from '../types';
4
4
  export type RangeType = 'selection' | 'hover' | null;
5
5
  interface AnnotationRangeStateContext {
6
+ hoverDraftDocumentPosition: Position | null;
7
+ hoverDraftRange: Range | null;
6
8
  /**
7
9
  * This range represents the selection that the user has made before they intend to save an annotation
8
10
  */
9
11
  range: Range | null;
10
12
  /**
11
- * This represents the type of range that is currently set on the range property, ie, whether the range is a hover or selection.
13
+ * When a selection or hover is promoted to a draft, we need to store the document position of the selection or hover.
14
+ * This is only set once on promotion, the position should not change while the draft is open.
12
15
  */
13
- type: RangeType;
16
+ selectionDraftDocumentPosition: Position | null;
14
17
  /**
15
18
  * This range represents the "pre-committed" placeholder range that the user will eventually save as an annotation
16
19
  * If the user does not set allowDraftMode, this will be ignored as it only is set when we call applyAnnotationDraftAt()
17
20
  */
18
21
  selectionDraftRange: Range | null;
19
- hoverDraftRange: Range | null;
20
22
  /**
21
- * When a selection or hover is promoted to a draft, we need to store the document position of the selection or hover.
22
- * This is only set once on promotion, the position should not change while the draft is open.
23
+ * This represents the type of range that is currently set on the range property, ie, whether the range is a hover or selection.
23
24
  */
24
- selectionDraftDocumentPosition: Position | null;
25
- hoverDraftDocumentPosition: Position | null;
25
+ type: RangeType;
26
26
  }
27
27
  interface AnnotationRangeDispatchContext {
28
- clearSelectionRange: () => void;
28
+ clearHoverDraft: () => void;
29
29
  clearHoverRange: () => void;
30
- setSelectionRange: (range: Range) => void;
31
- setHoverTarget?: (target: HTMLElement) => void;
32
- promoteSelectionToDraft: (position: Position | null) => void;
33
- promoteHoverToDraft: (position: Position | null) => void;
34
30
  clearSelectionDraft: () => void;
35
- clearHoverDraft: () => void;
31
+ clearSelectionRange: () => void;
32
+ promoteHoverToDraft: (position: Position | null) => void;
33
+ promoteSelectionToDraft: (position: Position | null) => void;
34
+ setHoverTarget?: (target: HTMLElement) => void;
35
+ setSelectionRange: (range: Range) => void;
36
36
  }
37
37
  export declare const AnnotationRangeStateContext: React.Context<AnnotationRangeStateContext>;
38
38
  export declare const AnnotationRangeDispatchContext: React.Context<AnnotationRangeDispatchContext>;
39
39
  export declare const AnnotationRangeProviderInner: ({ children, allowCommentsOnMedia, }: {
40
- children?: ReactNode;
41
40
  allowCommentsOnMedia?: boolean;
41
+ children?: ReactNode;
42
42
  }) => React.JSX.Element;
43
43
  export declare const AnnotationRangeProvider: ({ children, allowCommentsOnMedia, isNestedRender, }: {
44
- children?: ReactNode;
45
44
  allowCommentsOnMedia?: boolean;
45
+ children?: ReactNode;
46
46
  isNestedRender?: boolean;
47
47
  }) => React.JSX.Element;
48
48
  export declare const useAnnotationRangeState: () => AnnotationRangeStateContext;
@@ -12,19 +12,19 @@ export declare const AnnotationDraft: ({ draftPosition, children, }: React.Props
12
12
  draftPosition: Position;
13
13
  }>) => jsx.JSX.Element;
14
14
  type ApplyAnnotationsProps = {
15
- texts: string[];
16
- shouldApplyAnnotationAt: InsertDraftPosition.INSIDE | InsertDraftPosition.START | InsertDraftPosition.END;
17
15
  draftPosition: Position;
18
- textHighlighter?: TextHighlighter;
19
16
  marks?: readonly Mark[];
17
+ shouldApplyAnnotationAt: InsertDraftPosition.INSIDE | InsertDraftPosition.START | InsertDraftPosition.END;
18
+ textHighlighter?: TextHighlighter;
19
+ texts: string[];
20
20
  };
21
21
  export declare const getAnnotationIndex: (annotationPosition: InsertDraftPosition, fragmentCount: number) => number;
22
22
  export declare const applyAnnotationOnText: ({ texts, shouldApplyAnnotationAt, draftPosition, textHighlighter, marks, }: ApplyAnnotationsProps) => JSX.Element[];
23
23
  type Props = React.PropsWithChildren<{
24
- startPos: number;
25
24
  endPos: number;
26
- textHighlighter?: TextHighlighter;
27
25
  marks?: readonly Mark[];
26
+ startPos: number;
27
+ textHighlighter?: TextHighlighter;
28
28
  }>;
29
29
  export declare const TextWithAnnotationDraft: ({ startPos, endPos, children, textHighlighter, marks, }: Props) => jsx.JSX.Element;
30
30
  export {};
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import { type TextPosition, type Position } from '../types';
3
3
  export declare const findTextString: (reactNode: React.ReactNode) => string | null;
4
4
  type Offset = {
5
- startOffset: number;
6
5
  endOffset: number;
6
+ startOffset: number;
7
7
  };
8
8
  export declare const splitText: (text: string, { startOffset, endOffset }: Offset) => string[] | null;
9
9
  export declare const calcTextSplitOffset: (position: Position, textPosition: TextPosition, text: string) => {
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { type AnnotationId, type AnnotationDataAttributes, type AnnotationTypes } from '@atlaskit/adf-schema';
3
3
  type MarkElementProps = React.PropsWithChildren<{
4
- id: AnnotationId;
5
4
  annotationParentIds: AnnotationId[];
6
- dataAttributes: AnnotationDataAttributes;
7
5
  annotationType: AnnotationTypes;
6
+ dataAttributes: AnnotationDataAttributes;
7
+ id: AnnotationId;
8
8
  useBlockLevel?: boolean;
9
9
  }>;
10
10
  declare const MarkElement: ({ annotationParentIds, children, dataAttributes, id, useBlockLevel, }: MarkElementProps) => React.JSX.Element;
@@ -7,13 +7,13 @@ import type { OnAnnotationClickPayload } from '@atlaskit/editor-common/types';
7
7
  import type { AnnotationId, AnnotationDataAttributes } from '@atlaskit/adf-schema';
8
8
  import { AnnotationMarkStates } from '@atlaskit/adf-schema';
9
9
  type MarkComponentProps = {
10
- id: AnnotationId;
11
10
  annotationParentIds: AnnotationId[];
12
11
  dataAttributes: AnnotationDataAttributes;
13
- state: AnnotationMarkStates | null;
14
12
  hasFocus: boolean;
13
+ id: AnnotationId;
15
14
  isHovered: boolean;
16
15
  onClick: (props: OnAnnotationClickPayload) => void;
16
+ state: AnnotationMarkStates | null;
17
17
  useBlockLevel?: boolean;
18
18
  };
19
19
  export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, isHovered, onClick, useBlockLevel, }: React.PropsWithChildren<MarkComponentProps>) => React.ReactElement<{
@@ -3,10 +3,10 @@ import type { AnnotationMarkStates, AnnotationId } from '@atlaskit/adf-schema';
3
3
  import { AnnotationTypes } from '@atlaskit/adf-schema';
4
4
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
5
5
  type ListenEventProps = {
6
- id: AnnotationId;
7
- updateSubscriber: AnnotationUpdateEmitter | null;
8
6
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
7
+ id: AnnotationId;
9
8
  isNestedRender?: boolean;
9
+ updateSubscriber: AnnotationUpdateEmitter | null;
10
10
  };
11
11
  type UseAnnotationUpdateSatteByEventProps = {
12
12
  type: AnnotationTypes;
@@ -4,16 +4,16 @@ import type { ApplyAnnotation } from '../../../actions/index';
4
4
  import type { Position } from '../types';
5
5
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
6
6
  type Props = {
7
- range: Range;
8
- isWithinRange: boolean;
7
+ applyAnnotation: ApplyAnnotation;
9
8
  component: React.ComponentType<InlineCommentHoverComponentProps>;
10
- wrapperDOM: React.RefObject<HTMLDivElement>;
9
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
11
10
  documentPosition: Position | false;
11
+ generateIndexMatch?: (pos: Position) => false | AnnotationByMatches;
12
12
  isAnnotationAllowed: boolean;
13
+ isWithinRange: boolean;
13
14
  onClose: () => void;
14
- applyAnnotation: ApplyAnnotation;
15
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
16
- generateIndexMatch?: (pos: Position) => false | AnnotationByMatches;
15
+ range: Range;
16
+ wrapperDOM: React.RefObject<HTMLDivElement>;
17
17
  };
18
18
  export declare const Mounter: React.MemoExoticComponent<(props: Props) => React.JSX.Element>;
19
19
  export {};
@@ -3,8 +3,8 @@ import type { InlineCommentHoverComponentProps } from '@atlaskit/editor-common/t
3
3
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
4
  type Props = {
5
5
  component: React.ComponentType<InlineCommentHoverComponentProps>;
6
- rendererRef: React.RefObject<HTMLDivElement>;
7
6
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
7
+ rendererRef: React.RefObject<HTMLDivElement>;
8
8
  };
9
9
  export declare const RangeValidator: {
10
10
  (props: Props): React.JSX.Element | null;
@@ -4,16 +4,16 @@ import type { ApplyAnnotation } from '../../../actions/index';
4
4
  import type { Position } from '../types';
5
5
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
6
6
  type Props = {
7
- range: Range | null;
8
- draftRange: Range | null;
7
+ applyAnnotation: ApplyAnnotation;
9
8
  component: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
10
- wrapperDOM: React.RefObject<HTMLDivElement>;
9
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
11
10
  documentPosition: Position | false;
11
+ draftRange: Range | null;
12
+ generateIndexMatch?: (pos: Position) => false | AnnotationByMatches;
12
13
  isAnnotationAllowed: boolean;
13
14
  onClose: () => void;
14
- applyAnnotation: ApplyAnnotation;
15
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
16
- generateIndexMatch?: (pos: Position) => false | AnnotationByMatches;
15
+ range: Range | null;
16
+ wrapperDOM: React.RefObject<HTMLDivElement>;
17
17
  };
18
18
  export declare const SelectionInlineCommentMounter: React.MemoExoticComponent<(props: React.PropsWithChildren<Props>) => React.JSX.Element>;
19
19
  export {};
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import type { InlineCommentSelectionComponentProps } from '@atlaskit/editor-common/types';
3
3
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
4
  type Props = {
5
- selectionComponent: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
6
- rendererRef: React.RefObject<HTMLDivElement>;
7
5
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
6
+ rendererRef: React.RefObject<HTMLDivElement>;
7
+ selectionComponent: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
8
8
  };
9
9
  export declare const SelectionRangeValidator: {
10
10
  (props: Props): React.JSX.Element | null;
@@ -11,9 +11,12 @@ export type Position = {
11
11
  to: number;
12
12
  };
13
13
  export type AnnotationsWrapperProps = React.PropsWithChildren<{
14
+ /**
15
+ * This is set internally -- and should not be set by consumers.
16
+ */
17
+ _startPos?: number;
14
18
  adfDocument: JSONDocNode;
15
19
  annotationProvider: AnnotationProviders | null | undefined;
16
- rendererRef: React.RefObject<HTMLDivElement>;
17
20
  /**
18
21
  * This is set (by consumers) for nested renderers when they are
19
22
  * rendering bodied extension content.
@@ -22,12 +25,9 @@ export type AnnotationsWrapperProps = React.PropsWithChildren<{
22
25
  onLoadComplete?: ({ numberOfUnresolvedInlineComments, }: {
23
26
  numberOfUnresolvedInlineComments: number;
24
27
  }) => void;
25
- /**
26
- * This is set internally -- and should not be set by consumers.
27
- */
28
- _startPos?: number;
28
+ rendererRef: React.RefObject<HTMLDivElement>;
29
29
  }>;
30
30
  export type TextPosition = {
31
- start: number;
32
31
  end: number;
32
+ start: number;
33
33
  };
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  type Props = {
4
- rendererRef: React.RefObject<HTMLDivElement>;
5
4
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
6
5
  isNestedRender?: boolean;
6
+ rendererRef: React.RefObject<HTMLDivElement>;
7
7
  };
8
8
  export declare const AnnotationsContextWrapper: (props: React.PropsWithChildren<Props>) => JSX.Element;
9
9
  export {};