@atlaskit/renderer 109.10.6 → 109.11.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 +16 -0
- package/dist/cjs/actions/index.js +4 -1
- package/dist/cjs/react/nodes/embedCard.js +1 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/context.js +16 -6
- package/dist/cjs/ui/annotations/contexts/AnnotationRangeContext.js +48 -8
- package/dist/cjs/ui/annotations/hooks/user-selection.js +18 -14
- package/dist/cjs/ui/annotations/selection/mounter.js +15 -4
- package/dist/cjs/ui/annotations/selection/range-validator.js +9 -5
- package/dist/cjs/ui/annotations/wrapper.js +15 -1
- package/dist/es2019/actions/index.js +4 -1
- package/dist/es2019/react/nodes/embedCard.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/context.js +19 -7
- package/dist/es2019/ui/annotations/contexts/AnnotationRangeContext.js +42 -3
- package/dist/es2019/ui/annotations/hooks/user-selection.js +19 -15
- package/dist/es2019/ui/annotations/selection/mounter.js +15 -4
- package/dist/es2019/ui/annotations/selection/range-validator.js +7 -4
- package/dist/es2019/ui/annotations/wrapper.js +17 -1
- package/dist/esm/actions/index.js +4 -1
- package/dist/esm/react/nodes/embedCard.js +1 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/context.js +16 -6
- package/dist/esm/ui/annotations/contexts/AnnotationRangeContext.js +48 -8
- package/dist/esm/ui/annotations/hooks/user-selection.js +19 -15
- package/dist/esm/ui/annotations/selection/mounter.js +15 -4
- package/dist/esm/ui/annotations/selection/range-validator.js +9 -5
- package/dist/esm/ui/annotations/wrapper.js +15 -1
- package/dist/types/actions/index.d.ts +7 -6
- package/dist/types/ui/annotations/context.d.ts +2 -0
- package/dist/types/ui/annotations/contexts/AnnotationRangeContext.d.ts +3 -0
- package/dist/types/ui/annotations/hooks/user-selection.d.ts +1 -1
- package/dist/types/ui/annotations/hover/mounter.d.ts +2 -2
- package/dist/types/ui/annotations/selection/mounter.d.ts +5 -4
- package/dist/types/ui/annotations/selection/range-validator.d.ts +2 -2
- package/dist/types-ts4.5/actions/index.d.ts +7 -6
- package/dist/types-ts4.5/ui/annotations/context.d.ts +2 -0
- package/dist/types-ts4.5/ui/annotations/contexts/AnnotationRangeContext.d.ts +3 -0
- package/dist/types-ts4.5/ui/annotations/hooks/user-selection.d.ts +1 -0
- package/dist/types-ts4.5/ui/annotations/hover/mounter.d.ts +2 -2
- package/dist/types-ts4.5/ui/annotations/selection/mounter.d.ts +5 -4
- package/dist/types-ts4.5/ui/annotations/selection/range-validator.d.ts +2 -2
- package/package.json +3 -3
- package/.eslintrc.js +0 -8
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AnnotationByMatches,
|
|
2
|
+
import type { AnnotationByMatches, InlineCommentHoverComponentProps } from '@atlaskit/editor-common/types';
|
|
3
3
|
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
7
|
range: Range;
|
|
8
|
-
component: React.ComponentType<
|
|
8
|
+
component: React.ComponentType<InlineCommentHoverComponentProps>;
|
|
9
9
|
wrapperDOM: React.RefObject<HTMLDivElement>;
|
|
10
10
|
documentPosition: Position | false;
|
|
11
11
|
isAnnotationAllowed: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { AnnotationByMatches, InlineCommentSelectionComponentProps } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { ApplyAnnotation } from '../../../actions/index';
|
|
4
|
-
import { Position } from '../types';
|
|
5
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import type { ApplyAnnotation } from '../../../actions/index';
|
|
4
|
+
import type { Position } from '../types';
|
|
5
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
6
6
|
type Props = {
|
|
7
|
-
range: Range;
|
|
7
|
+
range: Range | null;
|
|
8
|
+
draftRange: Range | null;
|
|
8
9
|
component: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
|
|
9
10
|
wrapperDOM: React.RefObject<HTMLDivElement>;
|
|
10
11
|
documentPosition: Position | false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Position } from '../types';
|
|
2
|
+
import type { Position } from '../types';
|
|
3
3
|
import type { InlineCommentSelectionComponentProps } from '@atlaskit/editor-common/types';
|
|
4
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
type Props = {
|
|
6
6
|
selectionComponent: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
|
|
7
7
|
rendererRef: React.RefObject<HTMLDivElement>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
2
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
3
3
|
import type { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
5
|
-
import { Node, Schema, Mark } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import { Step
|
|
7
|
-
import {
|
|
5
|
+
import type { Node, Schema, Mark } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
+
import { RemoveMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
|
+
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
8
9
|
type ActionResult = {
|
|
9
10
|
step: Step;
|
|
10
11
|
doc: JSONDocNode;
|
|
@@ -50,9 +51,9 @@ export default class RendererActions implements RendererActionsOptions, Annotati
|
|
|
50
51
|
doc: JSONDocNode;
|
|
51
52
|
};
|
|
52
53
|
annotate(range: Range, annotationId: string, annotationType: 'inlineComment'): AnnotationActionResult;
|
|
53
|
-
isValidAnnotationRange(range: Range): boolean;
|
|
54
|
+
isValidAnnotationRange(range: Range | null): boolean;
|
|
54
55
|
isValidAnnotationPosition(pos: Position): boolean;
|
|
55
|
-
getPositionFromRange(range: Range): Position | false;
|
|
56
|
+
getPositionFromRange(range: Range | null): Position | false;
|
|
56
57
|
getAnnotationMarks(): Mark[];
|
|
57
58
|
getAnnotationsByPosition(range: Range): string[];
|
|
58
59
|
applyAnnotation(pos: Position, annotation: Annotation): AnnotationActionResult;
|
|
@@ -8,6 +8,8 @@ export type AnnotationsDraftContextWrapperChildrenProps = {
|
|
|
8
8
|
};
|
|
9
9
|
export type RenderCallbackType = (props: React.PropsWithChildren<AnnotationsDraftContextWrapperChildrenProps>) => React.ReactNode;
|
|
10
10
|
type Props = {
|
|
11
|
+
setDraftRange: () => void;
|
|
12
|
+
clearDraftRange: () => void;
|
|
11
13
|
children: RenderCallbackType;
|
|
12
14
|
};
|
|
13
15
|
type State = {
|
|
@@ -2,13 +2,16 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface AnnotationRangeStateContext {
|
|
4
4
|
range: Range | null;
|
|
5
|
+
draftRange: Range | null;
|
|
5
6
|
type: 'selection' | 'hover' | null;
|
|
6
7
|
}
|
|
7
8
|
interface AnnotationRangeDispatchContext {
|
|
8
9
|
clearRange: () => void;
|
|
9
10
|
clearSelectionRange: () => void;
|
|
11
|
+
clearDraftRange: () => void;
|
|
10
12
|
clearHoverRange: () => void;
|
|
11
13
|
setRange: (range: Range) => void;
|
|
14
|
+
setDraftRange: (draftRange: Range | null) => void;
|
|
12
15
|
setHoverTarget?: (target: HTMLElement) => void;
|
|
13
16
|
}
|
|
14
17
|
export declare const AnnotationRangeStateContext: React.Context<AnnotationRangeStateContext>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AnnotationByMatches,
|
|
2
|
+
import type { AnnotationByMatches, InlineCommentHoverComponentProps } from '@atlaskit/editor-common/types';
|
|
3
3
|
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
7
|
range: Range;
|
|
8
|
-
component: React.ComponentType<
|
|
8
|
+
component: React.ComponentType<InlineCommentHoverComponentProps>;
|
|
9
9
|
wrapperDOM: React.RefObject<HTMLDivElement>;
|
|
10
10
|
documentPosition: Position | false;
|
|
11
11
|
isAnnotationAllowed: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { AnnotationByMatches, InlineCommentSelectionComponentProps } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { ApplyAnnotation } from '../../../actions/index';
|
|
4
|
-
import { Position } from '../types';
|
|
5
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
import type { ApplyAnnotation } from '../../../actions/index';
|
|
4
|
+
import type { Position } from '../types';
|
|
5
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
6
6
|
type Props = {
|
|
7
|
-
range: Range;
|
|
7
|
+
range: Range | null;
|
|
8
|
+
draftRange: Range | null;
|
|
8
9
|
component: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
|
|
9
10
|
wrapperDOM: React.RefObject<HTMLDivElement>;
|
|
10
11
|
documentPosition: Position | false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Position } from '../types';
|
|
2
|
+
import type { Position } from '../types';
|
|
3
3
|
import type { InlineCommentSelectionComponentProps } from '@atlaskit/editor-common/types';
|
|
4
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
type Props = {
|
|
6
6
|
selectionComponent: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
|
|
7
7
|
rendererRef: React.RefObject<HTMLDivElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.
|
|
3
|
+
"version": "109.11.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
32
32
|
"@atlaskit/button": "^17.7.0",
|
|
33
33
|
"@atlaskit/code": "^15.1.0",
|
|
34
|
-
"@atlaskit/editor-common": "^78.
|
|
34
|
+
"@atlaskit/editor-common": "^78.21.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.3",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/smart-card": "^26.50.0",
|
|
51
51
|
"@atlaskit/status": "^1.4.0",
|
|
52
52
|
"@atlaskit/task-decision": "^17.9.0",
|
|
53
|
-
"@atlaskit/theme": "^12.
|
|
53
|
+
"@atlaskit/theme": "^12.7.0",
|
|
54
54
|
"@atlaskit/tokens": "^1.42.0",
|
|
55
55
|
"@atlaskit/tooltip": "^18.1.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|