@atlaskit/renderer 120.5.0 → 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.
- package/CHANGELOG.md +17 -0
- package/afm-cc/tsconfig.json +2 -2
- package/dist/cjs/react/nodes/inlineCard.js +2 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/inlineCard.js +2 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/inlineCard.js +2 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/actions/matches-utils.d.ts +2 -2
- package/dist/types/analytics/events.d.ts +18 -18
- package/dist/types/analytics/unsupported-content.d.ts +2 -2
- package/dist/types/react/index.d.ts +32 -32
- package/dist/types/react/marks/link.d.ts +1 -1
- package/dist/types/react/nodes/blockCard.d.ts +4 -4
- package/dist/types/react/nodes/bodiedExtension.d.ts +9 -9
- package/dist/types/react/nodes/codeBlock/codeBlock.d.ts +3 -3
- package/dist/types/react/nodes/date.d.ts +1 -1
- package/dist/types/react/nodes/embedCard.d.ts +6 -6
- package/dist/types/react/nodes/emoji.d.ts +2 -2
- package/dist/types/react/nodes/extension.d.ts +7 -7
- package/dist/types/react/nodes/extensionFrame.d.ts +8 -8
- package/dist/types/react/nodes/fallback.d.ts +3 -3
- package/dist/types/react/nodes/heading-anchor.d.ts +3 -3
- package/dist/types/react/nodes/heading.d.ts +4 -4
- package/dist/types/react/nodes/index.d.ts +18 -18
- package/dist/types/react/nodes/inlineCard.d.ts +3 -3
- package/dist/types/react/nodes/inlineExtension.d.ts +5 -5
- package/dist/types/react/nodes/media/index.d.ts +11 -11
- package/dist/types/react/nodes/mediaGroup.d.ts +1 -1
- package/dist/types/react/nodes/mediaInline.d.ts +3 -3
- package/dist/types/react/nodes/mediaSingle/index.d.ts +9 -9
- package/dist/types/react/nodes/mention.d.ts +3 -3
- package/dist/types/react/nodes/multiBodiedExtension/actions.d.ts +2 -2
- package/dist/types/react/nodes/multiBodiedExtension/context.d.ts +2 -2
- package/dist/types/react/nodes/multiBodiedExtension.d.ts +8 -8
- package/dist/types/react/nodes/multiBodiedExtensionOld.d.ts +8 -8
- package/dist/types/react/nodes/orderedList.d.ts +3 -3
- package/dist/types/react/nodes/panel.d.ts +4 -4
- package/dist/types/react/nodes/placeholder.d.ts +1 -1
- package/dist/types/react/nodes/status.d.ts +1 -1
- package/dist/types/react/nodes/table/sticky.d.ts +11 -11
- package/dist/types/react/nodes/table/table.d.ts +2 -2
- package/dist/types/react/nodes/table/types.d.ts +6 -6
- package/dist/types/react/nodes/table.d.ts +6 -6
- package/dist/types/react/nodes/tableCell.d.ts +5 -5
- package/dist/types/react/nodes/tableNew.d.ts +5 -5
- package/dist/types/react/nodes/tableRow.d.ts +4 -4
- package/dist/types/react/nodes/task-item-with-providers.d.ts +9 -9
- package/dist/types/react/nodes/taskItem.d.ts +3 -3
- package/dist/types/react/nodes/taskList.d.ts +1 -1
- package/dist/types/react/nodes/text-wrapper.d.ts +3 -3
- package/dist/types/react/types.d.ts +29 -29
- package/dist/types/react/utils/segment-text.d.ts +3 -3
- package/dist/types/render-document.d.ts +2 -2
- package/dist/types/steps/index.d.ts +1 -1
- package/dist/types/types/i18n.d.ts +2 -2
- package/dist/types/types/mediaOptions.d.ts +3 -3
- package/dist/types/types/smartLinksOptions.d.ts +19 -19
- package/dist/types/ui/Expand.d.ts +2 -2
- package/dist/types/ui/ExtensionRenderer.d.ts +11 -11
- package/dist/types/ui/MediaCard.d.ts +18 -18
- package/dist/types/ui/Renderer/ErrorBoundary.d.ts +4 -4
- package/dist/types/ui/Renderer/ValidationContext.d.ts +1 -1
- package/dist/types/ui/Renderer/index.d.ts +12 -12
- package/dist/types/ui/Renderer/truncated-wrapper.d.ts +2 -2
- package/dist/types/ui/annotations/contexts/AnnotationManagerContext.d.ts +15 -15
- package/dist/types/ui/annotations/contexts/AnnotationRangeContext.d.ts +15 -15
- package/dist/types/ui/annotations/draft/component.d.ts +5 -5
- package/dist/types/ui/annotations/draft/text.d.ts +1 -1
- package/dist/types/ui/annotations/element/index.d.ts +2 -2
- package/dist/types/ui/annotations/element/mark.d.ts +2 -2
- package/dist/types/ui/annotations/hooks/use-events.d.ts +2 -2
- package/dist/types/ui/annotations/hover/mounter.d.ts +6 -6
- package/dist/types/ui/annotations/hover/range-validator.d.ts +1 -1
- package/dist/types/ui/annotations/selection/mounter.d.ts +6 -6
- package/dist/types/ui/annotations/selection/range-validator.d.ts +2 -2
- package/dist/types/ui/annotations/types.d.ts +6 -6
- package/dist/types/ui/annotations/wrapper.d.ts +1 -1
- package/dist/types/ui/renderer-props.d.ts +62 -62
- package/dist/types-ts4.5/actions/index.d.ts +2 -2
- package/dist/types-ts4.5/actions/matches-utils.d.ts +2 -2
- package/dist/types-ts4.5/analytics/events.d.ts +18 -18
- package/dist/types-ts4.5/analytics/unsupported-content.d.ts +2 -2
- package/dist/types-ts4.5/react/index.d.ts +32 -32
- package/dist/types-ts4.5/react/marks/link.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/blockCard.d.ts +4 -4
- package/dist/types-ts4.5/react/nodes/bodiedExtension.d.ts +9 -9
- package/dist/types-ts4.5/react/nodes/codeBlock/codeBlock.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/date.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/embedCard.d.ts +6 -6
- package/dist/types-ts4.5/react/nodes/emoji.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/extension.d.ts +7 -7
- package/dist/types-ts4.5/react/nodes/extensionFrame.d.ts +8 -8
- package/dist/types-ts4.5/react/nodes/fallback.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/heading-anchor.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/heading.d.ts +4 -4
- package/dist/types-ts4.5/react/nodes/index.d.ts +18 -18
- package/dist/types-ts4.5/react/nodes/inlineCard.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/inlineExtension.d.ts +5 -5
- package/dist/types-ts4.5/react/nodes/media/index.d.ts +11 -11
- package/dist/types-ts4.5/react/nodes/mediaGroup.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/mediaSingle/index.d.ts +9 -9
- package/dist/types-ts4.5/react/nodes/mention.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/multiBodiedExtension/actions.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/multiBodiedExtension/context.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/multiBodiedExtension.d.ts +8 -8
- package/dist/types-ts4.5/react/nodes/multiBodiedExtensionOld.d.ts +8 -8
- package/dist/types-ts4.5/react/nodes/orderedList.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/panel.d.ts +4 -4
- package/dist/types-ts4.5/react/nodes/placeholder.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/status.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +11 -11
- package/dist/types-ts4.5/react/nodes/table/table.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/table/types.d.ts +6 -6
- package/dist/types-ts4.5/react/nodes/table.d.ts +6 -6
- package/dist/types-ts4.5/react/nodes/tableCell.d.ts +5 -5
- package/dist/types-ts4.5/react/nodes/tableNew.d.ts +5 -5
- package/dist/types-ts4.5/react/nodes/tableRow.d.ts +4 -4
- package/dist/types-ts4.5/react/nodes/task-item-with-providers.d.ts +9 -9
- package/dist/types-ts4.5/react/nodes/taskItem.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/taskList.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/text-wrapper.d.ts +3 -3
- package/dist/types-ts4.5/react/types.d.ts +29 -29
- package/dist/types-ts4.5/react/utils/segment-text.d.ts +3 -3
- package/dist/types-ts4.5/render-document.d.ts +2 -2
- package/dist/types-ts4.5/steps/index.d.ts +1 -1
- package/dist/types-ts4.5/types/i18n.d.ts +2 -2
- package/dist/types-ts4.5/types/mediaOptions.d.ts +3 -3
- package/dist/types-ts4.5/types/smartLinksOptions.d.ts +19 -19
- package/dist/types-ts4.5/ui/Expand.d.ts +2 -2
- package/dist/types-ts4.5/ui/ExtensionRenderer.d.ts +11 -11
- package/dist/types-ts4.5/ui/MediaCard.d.ts +18 -18
- package/dist/types-ts4.5/ui/Renderer/ErrorBoundary.d.ts +4 -4
- package/dist/types-ts4.5/ui/Renderer/ValidationContext.d.ts +1 -1
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +12 -12
- package/dist/types-ts4.5/ui/Renderer/truncated-wrapper.d.ts +2 -2
- package/dist/types-ts4.5/ui/annotations/contexts/AnnotationManagerContext.d.ts +15 -15
- package/dist/types-ts4.5/ui/annotations/contexts/AnnotationRangeContext.d.ts +15 -15
- package/dist/types-ts4.5/ui/annotations/draft/component.d.ts +5 -5
- package/dist/types-ts4.5/ui/annotations/draft/text.d.ts +1 -1
- package/dist/types-ts4.5/ui/annotations/element/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +2 -2
- package/dist/types-ts4.5/ui/annotations/hooks/use-events.d.ts +2 -2
- package/dist/types-ts4.5/ui/annotations/hover/mounter.d.ts +6 -6
- package/dist/types-ts4.5/ui/annotations/hover/range-validator.d.ts +1 -1
- package/dist/types-ts4.5/ui/annotations/selection/mounter.d.ts +6 -6
- package/dist/types-ts4.5/ui/annotations/selection/range-validator.d.ts +2 -2
- package/dist/types-ts4.5/ui/annotations/types.d.ts +6 -6
- package/dist/types-ts4.5/ui/annotations/wrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/renderer-props.d.ts +62 -62
- package/package.json +5 -6
|
@@ -8,66 +8,66 @@ import type { Serializer } from '../serializer';
|
|
|
8
8
|
import type { RendererAppearance, HeadingAnchorLinksProps } from '../ui/Renderer/types';
|
|
9
9
|
import type { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
|
|
10
10
|
export interface RendererContext {
|
|
11
|
-
objectAri?: string;
|
|
12
|
-
containerAri?: string;
|
|
13
11
|
adDoc?: any;
|
|
12
|
+
containerAri?: string;
|
|
13
|
+
objectAri?: string;
|
|
14
14
|
schema?: Schema;
|
|
15
15
|
}
|
|
16
16
|
export interface NodeMeta {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
serializer: Serializer<JSX.Element>;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
allowCopyToClipboard?: boolean;
|
|
19
|
+
allowCustomPanels?: boolean;
|
|
20
|
+
allowHeadingAnchorLinks?: HeadingAnchorLinksProps;
|
|
21
|
+
allowPlaceholderText?: boolean;
|
|
22
|
+
allowWrapCodeBlock?: boolean;
|
|
24
23
|
content?: {
|
|
25
24
|
[key: string]: any;
|
|
26
25
|
} | null;
|
|
27
|
-
allowHeadingAnchorLinks?: HeadingAnchorLinksProps;
|
|
28
|
-
allowCopyToClipboard?: boolean;
|
|
29
|
-
allowWrapCodeBlock?: boolean;
|
|
30
|
-
allowPlaceholderText?: boolean;
|
|
31
|
-
allowCustomPanels?: boolean;
|
|
32
|
-
rendererAppearance?: RendererAppearance;
|
|
33
|
-
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
34
|
-
nodeType: NodeType['name'];
|
|
35
|
-
marks: PMNode['marks'];
|
|
36
26
|
dataAttributes: {
|
|
37
27
|
'data-renderer-start-pos': number;
|
|
38
28
|
};
|
|
39
|
-
|
|
29
|
+
eventHandlers?: EventHandlers | undefined;
|
|
30
|
+
extensionHandlers?: ExtensionHandlers | undefined;
|
|
31
|
+
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
32
|
+
marks: PMNode['marks'];
|
|
33
|
+
nodeType: NodeType['name'];
|
|
34
|
+
portal?: HTMLElement | undefined;
|
|
35
|
+
providers?: ProviderFactory | undefined;
|
|
36
|
+
rendererAppearance?: RendererAppearance;
|
|
37
|
+
rendererContext?: RendererContext;
|
|
38
|
+
serializer: Serializer<JSX.Element>;
|
|
39
|
+
text?: PMNode['text'];
|
|
40
40
|
}
|
|
41
41
|
export interface MarkMeta {
|
|
42
|
+
[key: string]: any;
|
|
42
43
|
dataAttributes: {
|
|
43
|
-
'data-renderer-mark': true;
|
|
44
44
|
'data-block-mark'?: true;
|
|
45
|
+
'data-renderer-mark': true;
|
|
45
46
|
};
|
|
46
47
|
eventHandlers?: EventHandlers;
|
|
47
48
|
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
48
|
-
markKey?: any;
|
|
49
49
|
isInline?: boolean;
|
|
50
|
-
|
|
50
|
+
markKey?: any;
|
|
51
51
|
}
|
|
52
52
|
export interface AnnotationMarkMeta extends MarkMeta {
|
|
53
|
-
id: AnnotationId;
|
|
54
|
-
annotationType: AnnotationTypes;
|
|
55
|
-
annotationParentIds: string[];
|
|
56
53
|
allowAnnotations: boolean;
|
|
57
|
-
|
|
54
|
+
annotationParentIds: string[];
|
|
55
|
+
annotationType: AnnotationTypes;
|
|
56
|
+
id: AnnotationId;
|
|
58
57
|
isMediaInline?: boolean;
|
|
58
|
+
useBlockLevel?: boolean;
|
|
59
59
|
}
|
|
60
60
|
export type NodeProps<NodeAttrs = Object> = NodeAttrs & PropsWithChildren<NodeMeta>;
|
|
61
61
|
export type MarkProps<MarkAttrs = Object> = MarkAttrs & PropsWithChildren<MarkMeta>;
|
|
62
62
|
export type TextHighlighter = {
|
|
63
|
-
pattern: RegExp;
|
|
64
63
|
component: React.ComponentType<{
|
|
65
64
|
children: React.ReactNode;
|
|
66
|
-
match: string;
|
|
67
|
-
marks: Set<string>;
|
|
68
65
|
groups: Array<string> | undefined;
|
|
66
|
+
marks: Set<string>;
|
|
67
|
+
match: string;
|
|
69
68
|
startPos: number;
|
|
70
69
|
}>;
|
|
70
|
+
pattern: RegExp;
|
|
71
71
|
};
|
|
72
72
|
export interface ExtensionViewportSize {
|
|
73
73
|
extensionId?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { TextHighlighter } from '../types';
|
|
2
2
|
export type TextSegment = {
|
|
3
|
-
type: 'plain';
|
|
4
3
|
text: string;
|
|
4
|
+
type: 'plain';
|
|
5
5
|
} | {
|
|
6
|
-
type: 'match';
|
|
7
|
-
text: string;
|
|
8
6
|
groups: Array<string> | undefined;
|
|
7
|
+
text: string;
|
|
8
|
+
type: 'match';
|
|
9
9
|
};
|
|
10
10
|
export declare function segmentText(text: string | undefined, highlighter: TextHighlighter | undefined): Array<TextSegment>;
|
|
@@ -5,15 +5,15 @@ import { type AnalyticsEventPayload } from './analytics/events';
|
|
|
5
5
|
import { type Serializer } from './serializer';
|
|
6
6
|
import { type RendererAppearance } from './ui/Renderer/types';
|
|
7
7
|
export interface RenderOutput<T> {
|
|
8
|
+
pmDoc?: PMNode;
|
|
8
9
|
result: T;
|
|
9
10
|
stat: RenderOutputStat;
|
|
10
|
-
pmDoc?: PMNode;
|
|
11
11
|
}
|
|
12
12
|
export interface RenderOutputStat {
|
|
13
13
|
buildTreeTime?: number;
|
|
14
|
+
nodesCount?: Record<string, number>;
|
|
14
15
|
sanitizeTime: number;
|
|
15
16
|
serializeTime?: number;
|
|
16
|
-
nodesCount?: Record<string, number>;
|
|
17
17
|
}
|
|
18
18
|
export interface ResultWithTime<T> {
|
|
19
19
|
output: T;
|
|
@@ -3,9 +3,9 @@ import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
|
3
3
|
export declare function isRoot(element: HTMLElement | null): boolean;
|
|
4
4
|
export declare function resolvePos(node: Node | null, offset: number, findEnd?: boolean): number | false;
|
|
5
5
|
interface AnnotationStepOptions {
|
|
6
|
-
schema: Schema;
|
|
7
6
|
annotationId: string;
|
|
8
7
|
annotationType: 'inlineComment';
|
|
8
|
+
schema: Schema;
|
|
9
9
|
}
|
|
10
10
|
export declare function getPosFromRange(range: Range): {
|
|
11
11
|
from: number;
|
|
@@ -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
|
-
*
|
|
29
|
+
* A flag to disable hover preview on inline Smart Link.
|
|
30
|
+
* Default is false.
|
|
31
|
+
*
|
|
32
|
+
* Component: inline
|
|
37
33
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
21
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
39
|
-
featureFlags?: MediaFeatureFlags;
|
|
37
|
+
resizeMode?: ImageResizeMode;
|
|
40
38
|
shouldEnableDownloadButton?: boolean;
|
|
39
|
+
shouldOpenMediaViewer?: boolean;
|
|
41
40
|
ssr?: MediaSSR;
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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: {
|
|
@@ -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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
25
|
-
hoverDraftDocumentPosition: Position | null;
|
|
25
|
+
type: RangeType;
|
|
26
26
|
}
|
|
27
27
|
interface AnnotationRangeDispatchContext {
|
|
28
|
-
|
|
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
|
-
|
|
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;
|