@atlaskit/renderer 111.0.1 → 111.1.0
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 +21 -0
- package/dist/cjs/actions/index.js +4 -7
- package/dist/cjs/react/index.js +12 -3
- package/dist/cjs/react/nodes/bodiedExtension.js +6 -1
- package/dist/cjs/react/nodes/media/index.js +2 -4
- package/dist/cjs/ui/Renderer/index.js +62 -12
- package/dist/cjs/ui/annotations/hover/mounter.js +4 -7
- package/dist/cjs/ui/annotations/index.js +9 -1
- package/dist/cjs/ui/annotations/selection/mounter.js +4 -7
- package/dist/es2019/actions/index.js +5 -8
- package/dist/es2019/react/index.js +12 -3
- package/dist/es2019/react/nodes/bodiedExtension.js +6 -1
- package/dist/es2019/react/nodes/media/index.js +4 -6
- package/dist/es2019/ui/Renderer/index.js +55 -6
- package/dist/es2019/ui/annotations/hover/mounter.js +4 -7
- package/dist/es2019/ui/annotations/index.js +8 -0
- package/dist/es2019/ui/annotations/selection/mounter.js +4 -7
- package/dist/esm/actions/index.js +4 -7
- package/dist/esm/react/index.js +12 -3
- package/dist/esm/react/nodes/bodiedExtension.js +6 -1
- package/dist/esm/react/nodes/media/index.js +4 -6
- package/dist/esm/ui/Renderer/index.js +60 -12
- package/dist/esm/ui/annotations/hover/mounter.js +4 -7
- package/dist/esm/ui/annotations/index.js +8 -0
- package/dist/esm/ui/annotations/selection/mounter.js +4 -7
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/react/index.d.ts +7 -0
- package/dist/types/react/nodes/bodiedExtension.d.ts +1 -0
- package/dist/types/ui/Renderer/index.d.ts +13 -3
- package/dist/types/ui/annotations/index.d.ts +4 -1
- package/dist/types/ui/annotations/types.d.ts +8 -0
- package/dist/types-ts4.5/actions/index.d.ts +2 -2
- package/dist/types-ts4.5/react/index.d.ts +7 -0
- package/dist/types-ts4.5/react/nodes/bodiedExtension.d.ts +1 -0
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +13 -3
- package/dist/types-ts4.5/ui/annotations/index.d.ts +4 -1
- package/dist/types-ts4.5/ui/annotations/types.d.ts +8 -0
- package/package.json +4 -4
|
@@ -9,7 +9,12 @@ import type { RendererProps } from '../renderer-props';
|
|
|
9
9
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
10
10
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
11
11
|
export declare const defaultNodeComponents: NodeComponentsProps;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Exported due to enzyme test reliance on this component.
|
|
14
|
+
*/
|
|
15
|
+
export declare class __RendererClassComponent extends PureComponent<RendererProps & {
|
|
16
|
+
startPos?: number;
|
|
17
|
+
}> {
|
|
13
18
|
private providerFactory;
|
|
14
19
|
private serializer;
|
|
15
20
|
private editorRef;
|
|
@@ -21,10 +26,14 @@ export declare class Renderer extends PureComponent<RendererProps> {
|
|
|
21
26
|
* deleted once that measurement occurs.
|
|
22
27
|
*/
|
|
23
28
|
private renderedMeasurementDistortedDurationMonitor?;
|
|
24
|
-
constructor(props: RendererProps
|
|
29
|
+
constructor(props: RendererProps & {
|
|
30
|
+
startPos: number;
|
|
31
|
+
});
|
|
25
32
|
private anchorLinkAnalytics;
|
|
26
33
|
componentDidMount(): void;
|
|
27
|
-
UNSAFE_componentWillReceiveProps(nextProps: RendererProps
|
|
34
|
+
UNSAFE_componentWillReceiveProps(nextProps: RendererProps & {
|
|
35
|
+
startPos: number;
|
|
36
|
+
}): void;
|
|
28
37
|
private deriveSerializerProps;
|
|
29
38
|
private featureFlags;
|
|
30
39
|
private fireAnalyticsEvent;
|
|
@@ -34,6 +43,7 @@ export declare class Renderer extends PureComponent<RendererProps> {
|
|
|
34
43
|
render(): jsx.JSX.Element;
|
|
35
44
|
componentWillUnmount(): void;
|
|
36
45
|
}
|
|
46
|
+
export declare function Renderer(props: RendererProps): jsx.JSX.Element;
|
|
37
47
|
export declare const RendererWithAnalytics: React.MemoExoticComponent<(props: RendererProps) => jsx.JSX.Element>;
|
|
38
48
|
declare const RendererWithAnnotationSelection: (props: RendererProps) => jsx.JSX.Element;
|
|
39
49
|
export default RendererWithAnnotationSelection;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type AnnotationsWrapperProps } from './types';
|
|
3
|
+
export declare const AnnotationsPositionContext: React.Context<{
|
|
4
|
+
startPos: number;
|
|
5
|
+
}>;
|
|
3
6
|
export declare const AnnotationsWrapper: (props: AnnotationsWrapperProps) => JSX.Element;
|
|
4
7
|
export { TextWithAnnotationDraft } from './draft';
|
|
5
8
|
export { MarkElement as AnnotationMark } from './element';
|
|
@@ -15,10 +15,18 @@ export type AnnotationsWrapperProps = React.PropsWithChildren<{
|
|
|
15
15
|
adfDocument: JSONDocNode;
|
|
16
16
|
annotationProvider: AnnotationProviders | null | undefined;
|
|
17
17
|
rendererRef: React.RefObject<HTMLDivElement>;
|
|
18
|
+
/**
|
|
19
|
+
* This is set (by consumers) for nested renderers when they are
|
|
20
|
+
* rendering bodied extension content.
|
|
21
|
+
*/
|
|
18
22
|
isNestedRender: boolean;
|
|
19
23
|
onLoadComplete?: ({ numberOfUnresolvedInlineComments, }: {
|
|
20
24
|
numberOfUnresolvedInlineComments: number;
|
|
21
25
|
}) => void;
|
|
26
|
+
/**
|
|
27
|
+
* This is set internally -- and should not be set by consumers.
|
|
28
|
+
*/
|
|
29
|
+
_startPos?: number;
|
|
22
30
|
}>;
|
|
23
31
|
export type TextPosition = {
|
|
24
32
|
start: number;
|
|
@@ -22,7 +22,7 @@ interface RendererActionsOptions {
|
|
|
22
22
|
deleteAnnotation: (annotationId: string, annotationType: 'inlineComment') => ActionResult;
|
|
23
23
|
isValidAnnotationRange: (range: Range) => boolean;
|
|
24
24
|
}
|
|
25
|
-
export type ApplyAnnotation = (pos: Position, annotation: Annotation
|
|
25
|
+
export type ApplyAnnotation = (pos: Position, annotation: Annotation) => AnnotationActionResult;
|
|
26
26
|
interface AnnotationsRendererActionsOptions {
|
|
27
27
|
isValidAnnotationPosition: (pos: Position) => boolean;
|
|
28
28
|
applyAnnotation: ApplyAnnotation;
|
|
@@ -65,7 +65,7 @@ export default class RendererActions implements RendererActionsOptions, Annotati
|
|
|
65
65
|
getPositionFromRange(range: Range | null): Position | false;
|
|
66
66
|
getAnnotationMarks(): Mark[];
|
|
67
67
|
getAnnotationsByPosition(range: Range): string[];
|
|
68
|
-
applyAnnotation(pos: Position, annotation: Annotation
|
|
68
|
+
applyAnnotation(pos: Position, annotation: Annotation): AnnotationActionResult;
|
|
69
69
|
generateAnnotationIndexMatch(pos: Position): AnnotationByMatches | false;
|
|
70
70
|
getInlineNodeTypes(annotationId: string): string[] | undefined;
|
|
71
71
|
}
|
|
@@ -12,6 +12,12 @@ import type { MediaOptions } from '../types/mediaOptions';
|
|
|
12
12
|
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
13
13
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
14
14
|
export interface ReactSerializerInit {
|
|
15
|
+
/**
|
|
16
|
+
* Used for to set positions on nodes for annotations.
|
|
17
|
+
*
|
|
18
|
+
* When not provided defaults to 1.
|
|
19
|
+
*/
|
|
20
|
+
startPos?: number;
|
|
15
21
|
providers?: ProviderFactory;
|
|
16
22
|
eventHandlers?: EventHandlers;
|
|
17
23
|
extensionHandlers?: ExtensionHandlers;
|
|
@@ -79,6 +85,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
79
85
|
private allowAltTextOnImages?;
|
|
80
86
|
private stickyHeaders?;
|
|
81
87
|
private allowMediaLinking?;
|
|
88
|
+
private initStartPos;
|
|
82
89
|
private startPos;
|
|
83
90
|
private surroundTextNodesWithTextWrapper;
|
|
84
91
|
private media?;
|
|
@@ -9,7 +9,12 @@ import type { RendererProps } from '../renderer-props';
|
|
|
9
9
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
10
10
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
11
11
|
export declare const defaultNodeComponents: NodeComponentsProps;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Exported due to enzyme test reliance on this component.
|
|
14
|
+
*/
|
|
15
|
+
export declare class __RendererClassComponent extends PureComponent<RendererProps & {
|
|
16
|
+
startPos?: number;
|
|
17
|
+
}> {
|
|
13
18
|
private providerFactory;
|
|
14
19
|
private serializer;
|
|
15
20
|
private editorRef;
|
|
@@ -21,10 +26,14 @@ export declare class Renderer extends PureComponent<RendererProps> {
|
|
|
21
26
|
* deleted once that measurement occurs.
|
|
22
27
|
*/
|
|
23
28
|
private renderedMeasurementDistortedDurationMonitor?;
|
|
24
|
-
constructor(props: RendererProps
|
|
29
|
+
constructor(props: RendererProps & {
|
|
30
|
+
startPos: number;
|
|
31
|
+
});
|
|
25
32
|
private anchorLinkAnalytics;
|
|
26
33
|
componentDidMount(): void;
|
|
27
|
-
UNSAFE_componentWillReceiveProps(nextProps: RendererProps
|
|
34
|
+
UNSAFE_componentWillReceiveProps(nextProps: RendererProps & {
|
|
35
|
+
startPos: number;
|
|
36
|
+
}): void;
|
|
28
37
|
private deriveSerializerProps;
|
|
29
38
|
private featureFlags;
|
|
30
39
|
private fireAnalyticsEvent;
|
|
@@ -34,6 +43,7 @@ export declare class Renderer extends PureComponent<RendererProps> {
|
|
|
34
43
|
render(): jsx.JSX.Element;
|
|
35
44
|
componentWillUnmount(): void;
|
|
36
45
|
}
|
|
46
|
+
export declare function Renderer(props: RendererProps): jsx.JSX.Element;
|
|
37
47
|
export declare const RendererWithAnalytics: React.MemoExoticComponent<(props: RendererProps) => jsx.JSX.Element>;
|
|
38
48
|
declare const RendererWithAnnotationSelection: (props: RendererProps) => jsx.JSX.Element;
|
|
39
49
|
export default RendererWithAnnotationSelection;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type AnnotationsWrapperProps } from './types';
|
|
3
|
+
export declare const AnnotationsPositionContext: React.Context<{
|
|
4
|
+
startPos: number;
|
|
5
|
+
}>;
|
|
3
6
|
export declare const AnnotationsWrapper: (props: AnnotationsWrapperProps) => JSX.Element;
|
|
4
7
|
export { TextWithAnnotationDraft } from './draft';
|
|
5
8
|
export { MarkElement as AnnotationMark } from './element';
|
|
@@ -15,10 +15,18 @@ export type AnnotationsWrapperProps = React.PropsWithChildren<{
|
|
|
15
15
|
adfDocument: JSONDocNode;
|
|
16
16
|
annotationProvider: AnnotationProviders | null | undefined;
|
|
17
17
|
rendererRef: React.RefObject<HTMLDivElement>;
|
|
18
|
+
/**
|
|
19
|
+
* This is set (by consumers) for nested renderers when they are
|
|
20
|
+
* rendering bodied extension content.
|
|
21
|
+
*/
|
|
18
22
|
isNestedRender: boolean;
|
|
19
23
|
onLoadComplete?: ({ numberOfUnresolvedInlineComments, }: {
|
|
20
24
|
numberOfUnresolvedInlineComments: number;
|
|
21
25
|
}) => void;
|
|
26
|
+
/**
|
|
27
|
+
* This is set internally -- and should not be set by consumers.
|
|
28
|
+
*/
|
|
29
|
+
_startPos?: number;
|
|
22
30
|
}>;
|
|
23
31
|
export type TextPosition = {
|
|
24
32
|
start: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "111.0
|
|
3
|
+
"version": "111.1.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
30
30
|
"@atlaskit/button": "^20.2.0",
|
|
31
31
|
"@atlaskit/code": "^15.6.0",
|
|
32
|
-
"@atlaskit/editor-common": "^92.
|
|
32
|
+
"@atlaskit/editor-common": "^92.1.0",
|
|
33
33
|
"@atlaskit/editor-json-transformer": "^8.18.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.6.1",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
36
36
|
"@atlaskit/editor-shared-styles": "^3.0.0",
|
|
37
37
|
"@atlaskit/emoji": "^67.8.0",
|
|
38
38
|
"@atlaskit/feature-gate-js-client": "^4.19.0",
|
|
39
|
-
"@atlaskit/icon": "^22.
|
|
40
|
-
"@atlaskit/link-datasource": "^3.
|
|
39
|
+
"@atlaskit/icon": "^22.20.0",
|
|
40
|
+
"@atlaskit/link-datasource": "^3.2.0",
|
|
41
41
|
"@atlaskit/media-card": "^78.5.0",
|
|
42
42
|
"@atlaskit/media-client": "^28.0.0",
|
|
43
43
|
"@atlaskit/media-client-react": "^2.2.0",
|