@atlaskit/renderer 115.0.2 → 115.0.4

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 (37) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/ui/Renderer/index.js +1 -1
  3. package/dist/cjs/ui/annotations/contexts/AnnotationManagerContext.js +421 -0
  4. package/dist/cjs/ui/annotations/draft/component.js +13 -1
  5. package/dist/cjs/ui/annotations/element/index.js +38 -6
  6. package/dist/cjs/ui/annotations/element/mark.js +16 -0
  7. package/dist/cjs/ui/annotations/hooks/use-events.js +77 -27
  8. package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +18 -2
  9. package/dist/cjs/ui/annotations/index.js +49 -12
  10. package/dist/cjs/ui/annotations/selection/mounter.js +177 -4
  11. package/dist/es2019/ui/Renderer/index.js +1 -1
  12. package/dist/es2019/ui/annotations/contexts/AnnotationManagerContext.js +416 -0
  13. package/dist/es2019/ui/annotations/draft/component.js +15 -3
  14. package/dist/es2019/ui/annotations/element/index.js +39 -6
  15. package/dist/es2019/ui/annotations/element/mark.js +18 -0
  16. package/dist/es2019/ui/annotations/hooks/use-events.js +85 -28
  17. package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +19 -2
  18. package/dist/es2019/ui/annotations/index.js +47 -10
  19. package/dist/es2019/ui/annotations/selection/mounter.js +177 -6
  20. package/dist/esm/ui/Renderer/index.js +1 -1
  21. package/dist/esm/ui/annotations/contexts/AnnotationManagerContext.js +411 -0
  22. package/dist/esm/ui/annotations/draft/component.js +14 -3
  23. package/dist/esm/ui/annotations/element/index.js +38 -6
  24. package/dist/esm/ui/annotations/element/mark.js +16 -0
  25. package/dist/esm/ui/annotations/hooks/use-events.js +78 -28
  26. package/dist/esm/ui/annotations/hooks/use-load-annotations.js +18 -2
  27. package/dist/esm/ui/annotations/index.js +45 -10
  28. package/dist/esm/ui/annotations/selection/mounter.js +179 -6
  29. package/dist/types/ui/annotations/contexts/AnnotationManagerContext.d.ts +71 -0
  30. package/dist/types/ui/annotations/draft/component.d.ts +5 -1
  31. package/dist/types/ui/annotations/element/mark.d.ts +6 -0
  32. package/dist/types/ui/annotations/index.d.ts +1 -0
  33. package/dist/types-ts4.5/ui/annotations/contexts/AnnotationManagerContext.d.ts +71 -0
  34. package/dist/types-ts4.5/ui/annotations/draft/component.d.ts +5 -1
  35. package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +6 -0
  36. package/dist/types-ts4.5/ui/annotations/index.d.ts +1 -0
  37. package/package.json +13 -5
@@ -0,0 +1,71 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { type AnnotationId, AnnotationMarkStates } from '@atlaskit/adf-schema';
3
+ import type { AnnotationManager, ActionResult } from '@atlaskit/editor-common/annotation';
4
+ import { AnnotationUpdateEmitter } from '@atlaskit/editor-common/types';
5
+ interface AnnotationState {
6
+ id: AnnotationId;
7
+ markState: AnnotationMarkStates;
8
+ }
9
+ type AnnotationsStateRecord = Record<AnnotationId, AnnotationState>;
10
+ interface AnnotationManagerStateContext {
11
+ isDrafting: boolean;
12
+ draftId: string | undefined;
13
+ draftMarkRef: HTMLElement | undefined;
14
+ draftActionResult: ActionResult | undefined;
15
+ annotations: AnnotationsStateRecord;
16
+ currentSelectedAnnotationId: AnnotationId | undefined;
17
+ currentSelectedMarkRef: HTMLElement | undefined;
18
+ currentHoveredAnnotationId: AnnotationId | undefined;
19
+ }
20
+ interface AnnotationManagerDispatchContext {
21
+ annotationManager: AnnotationManager | undefined;
22
+ dispatch: React.Dispatch<AnnotationManagerAction>;
23
+ }
24
+ declare const AnnotationManagerStateContext: React.Context<AnnotationManagerStateContext>;
25
+ declare const AnnotationManagerDispatchContext: React.Context<AnnotationManagerDispatchContext>;
26
+ type AnnotationManagerAction = {
27
+ type: 'reset';
28
+ } | {
29
+ type: 'loadAnnotation';
30
+ data: {
31
+ id: AnnotationId;
32
+ markState?: AnnotationMarkStates;
33
+ }[];
34
+ } | {
35
+ type: 'updateAnnotation';
36
+ data: {
37
+ id: AnnotationId;
38
+ selected?: boolean;
39
+ hovered?: boolean;
40
+ markState?: AnnotationMarkStates;
41
+ };
42
+ } | {
43
+ type: 'resetSelectedAnnotation';
44
+ } | {
45
+ type: 'resetHoveredAnnotation';
46
+ } | {
47
+ type: 'setDrafting';
48
+ data: {
49
+ isDrafting: boolean;
50
+ draftId: string | undefined;
51
+ draftActionResult: ActionResult | undefined;
52
+ };
53
+ } | {
54
+ type: 'setDraftMarkRef';
55
+ data: {
56
+ draftMarkRef: HTMLElement | undefined;
57
+ };
58
+ } | {
59
+ type: 'setSelectedMarkRef';
60
+ data: {
61
+ markRef: HTMLElement | undefined;
62
+ };
63
+ };
64
+ export declare const AnnotationManagerProvider: ({ children, annotationManager, updateSubscriber, }: {
65
+ children?: ReactNode;
66
+ annotationManager?: AnnotationManager | undefined;
67
+ updateSubscriber?: AnnotationUpdateEmitter | undefined;
68
+ }) => React.JSX.Element;
69
+ export declare const useAnnotationManagerState: () => AnnotationManagerStateContext;
70
+ export declare const useAnnotationManagerDispatch: () => AnnotationManagerDispatchContext;
71
+ export {};
@@ -1,8 +1,12 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
1
5
  import React from 'react';
2
6
  import { jsx } from '@emotion/react';
7
+ import type { Mark } from '@atlaskit/editor-prosemirror/model';
3
8
  import type { Position } from '../types';
4
9
  import { InsertDraftPosition } from '../types';
5
- import type { Mark } from '@atlaskit/editor-prosemirror/model';
6
10
  import type { TextHighlighter } from '../../../react/types';
7
11
  export declare const AnnotationDraft: ({ draftPosition, children, }: React.PropsWithChildren<{
8
12
  draftPosition: Position;
@@ -27,6 +27,7 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
27
27
  'data-id': string;
28
28
  'data-mark-annotation-state'?: AnnotationMarkStates | undefined;
29
29
  'aria-disabled': boolean;
30
+ ref: ((node: HTMLElement | null) => void) | undefined;
30
31
  id: string;
31
32
  } | {
32
33
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -41,6 +42,7 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
41
42
  'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
42
43
  'data-id': string;
43
44
  'aria-disabled': boolean;
45
+ ref: ((node: HTMLElement | null) => void) | undefined;
44
46
  id: string;
45
47
  } | {
46
48
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -58,6 +60,7 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
58
60
  'aria-expanded'?: undefined;
59
61
  'aria-details': string;
60
62
  'aria-disabled'?: undefined;
63
+ ref: ((node: HTMLElement | null) => void) | undefined;
61
64
  id: string;
62
65
  } | {
63
66
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -77,6 +80,7 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
77
80
  'aria-expanded'?: undefined;
78
81
  'aria-details': string;
79
82
  'aria-disabled'?: undefined;
83
+ ref: ((node: HTMLElement | null) => void) | undefined;
80
84
  id: string;
81
85
  } | {
82
86
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -94,6 +98,7 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
94
98
  'aria-expanded': boolean;
95
99
  'aria-details': string;
96
100
  'aria-disabled'?: undefined;
101
+ ref: ((node: HTMLElement | null) => void) | undefined;
97
102
  id: string;
98
103
  } | {
99
104
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -113,6 +118,7 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
113
118
  'aria-expanded': boolean;
114
119
  'aria-details': string;
115
120
  'aria-disabled'?: undefined;
121
+ ref: ((node: HTMLElement | null) => void) | undefined;
116
122
  id: string;
117
123
  }, string | React.JSXElementConstructor<any>>;
118
124
  export {};
@@ -3,4 +3,5 @@ import { type AnnotationsWrapperProps } from './types';
3
3
  export declare const AnnotationsPositionContext: React.Context<{
4
4
  startPos: number;
5
5
  }>;
6
+ export declare const AnnotationsWrapperInner: (props: Omit<AnnotationsWrapperProps, 'annotationProvider'>) => React.JSX.Element;
6
7
  export declare const AnnotationsWrapper: (props: AnnotationsWrapperProps) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "115.0.2",
3
+ "version": "115.0.4",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/editor-tables": "^2.9.0",
40
40
  "@atlaskit/emoji": "^69.1.0",
41
41
  "@atlaskit/feature-gate-js-client": "^5.3.0",
42
- "@atlaskit/icon": "^25.7.0",
42
+ "@atlaskit/icon": "^26.0.0",
43
43
  "@atlaskit/link-datasource": "^4.9.0",
44
44
  "@atlaskit/media-card": "^79.2.0",
45
45
  "@atlaskit/media-client": "^33.0.0",
@@ -51,11 +51,11 @@
51
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
52
52
  "@atlaskit/platform-feature-flags-react": "^0.2.0",
53
53
  "@atlaskit/react-ufo": "^3.10.0",
54
- "@atlaskit/smart-card": "^37.0.0",
54
+ "@atlaskit/smart-card": "^37.1.0",
55
55
  "@atlaskit/status": "^3.0.0",
56
56
  "@atlaskit/task-decision": "^19.2.0",
57
57
  "@atlaskit/theme": "^18.0.0",
58
- "@atlaskit/tmp-editor-statsig": "^4.18.0",
58
+ "@atlaskit/tmp-editor-statsig": "^4.19.0",
59
59
  "@atlaskit/tokens": "^4.8.0",
60
60
  "@atlaskit/tooltip": "^20.0.0",
61
61
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -78,14 +78,16 @@
78
78
  "@af/integration-testing": "workspace:^",
79
79
  "@af/visual-regression": "workspace:^",
80
80
  "@atlaskit/analytics-gas-types": "^5.1.0",
81
+ "@atlaskit/checkbox": "^17.1.0",
81
82
  "@atlaskit/css-reset": "^7.2.0",
82
83
  "@atlaskit/link-provider": "^2.1.0",
83
84
  "@atlaskit/link-test-helpers": "^8.0.0",
84
- "@atlaskit/linking-common": "^8.0.0",
85
+ "@atlaskit/linking-common": "^8.1.0",
85
86
  "@atlaskit/media-core": "^36.0.0",
86
87
  "@atlaskit/media-integration-test-helpers": "workspace:^",
87
88
  "@atlaskit/media-test-helpers": "^36.0.0",
88
89
  "@atlaskit/mention": "^24.1.0",
90
+ "@atlaskit/modal-dialog": "^14.1.0",
89
91
  "@atlaskit/navigation-next": "patch:@atlaskit/navigation-next@npm%3A9.0.17#~/.yarn/patches/@atlaskit-navigation-next-npm-9.0.17-d1445f2f74.patch",
90
92
  "@atlaskit/util-data-test": "^18.0.0",
91
93
  "@atlaskit/visual-regression": "workspace:^",
@@ -207,6 +209,12 @@
207
209
  "platform_editor_nested_dnd_styles_changes": {
208
210
  "type": "boolean"
209
211
  },
212
+ "platform_editor_comments_api_manager": {
213
+ "type": "boolean"
214
+ },
215
+ "platform_editor_comments_api_manager_select": {
216
+ "type": "boolean"
217
+ },
210
218
  "platform_renderer_isPresentational": {
211
219
  "type": "boolean"
212
220
  },