@atlaskit/renderer 118.1.0 → 118.1.1

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 (34) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/react/nodes/mediaGroup.js +6 -3
  3. package/dist/cjs/react/nodes/table/sticky.js +2 -1
  4. package/dist/cjs/react/nodes/table/table.js +7 -2
  5. package/dist/cjs/react/nodes/table.js +46 -16
  6. package/dist/cjs/react/nodes/tableNew.js +116 -88
  7. package/dist/cjs/ui/Renderer/index.js +3 -9
  8. package/dist/cjs/ui/annotations/element/mark.js +16 -23
  9. package/dist/cjs/ui/annotations/hooks/use-events.js +1 -1
  10. package/dist/es2019/react/nodes/mediaGroup.js +6 -3
  11. package/dist/es2019/react/nodes/table/sticky.js +2 -1
  12. package/dist/es2019/react/nodes/table/table.js +6 -2
  13. package/dist/es2019/react/nodes/table.js +45 -17
  14. package/dist/es2019/react/nodes/tableNew.js +112 -94
  15. package/dist/es2019/ui/Renderer/index.js +3 -9
  16. package/dist/es2019/ui/annotations/element/mark.js +16 -25
  17. package/dist/es2019/ui/annotations/hooks/use-events.js +1 -1
  18. package/dist/esm/react/nodes/mediaGroup.js +6 -3
  19. package/dist/esm/react/nodes/table/sticky.js +2 -1
  20. package/dist/esm/react/nodes/table/table.js +7 -2
  21. package/dist/esm/react/nodes/table.js +46 -16
  22. package/dist/esm/react/nodes/tableNew.js +118 -90
  23. package/dist/esm/ui/Renderer/index.js +3 -9
  24. package/dist/esm/ui/annotations/element/mark.js +16 -23
  25. package/dist/esm/ui/annotations/hooks/use-events.js +1 -1
  26. package/dist/types/react/nodes/table/table.d.ts +2 -1
  27. package/dist/types/react/nodes/table.d.ts +1 -1
  28. package/dist/types/react/nodes/tableNew.d.ts +33 -0
  29. package/dist/types/ui/annotations/element/mark.d.ts +0 -6
  30. package/dist/types-ts4.5/react/nodes/table/table.d.ts +2 -1
  31. package/dist/types-ts4.5/react/nodes/table.d.ts +1 -1
  32. package/dist/types-ts4.5/react/nodes/tableNew.d.ts +33 -0
  33. package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +0 -6
  34. package/package.json +11 -11
@@ -14,7 +14,6 @@ import { AnnotationMarkStates } from '@atlaskit/adf-schema';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import { useIntl } from 'react-intl-next';
16
16
  import { inlineCommentMessages } from '../../../messages';
17
- import { useAnnotationManagerDispatch, useAnnotationManagerState } from '../contexts/AnnotationManagerContext';
18
17
  var markStyles = css(_defineProperty({
19
18
  color: 'inherit',
20
19
  backgroundColor: 'unset',
@@ -123,20 +122,6 @@ export var MarkComponent = function MarkComponent(_ref) {
123
122
  var annotationIds = useMemo(function () {
124
123
  return _toConsumableArray(new Set([].concat(_toConsumableArray(annotationParentIds), [id])));
125
124
  }, [id, annotationParentIds]);
126
- var _useAnnotationManager = useAnnotationManagerDispatch(),
127
- dispatch = _useAnnotationManager.dispatch;
128
- var _useAnnotationManager2 = useAnnotationManagerState(),
129
- currentSelectedAnnotationId = _useAnnotationManager2.currentSelectedAnnotationId;
130
- var markRef = useCallback(function (node) {
131
- if (id === currentSelectedAnnotationId && node) {
132
- dispatch({
133
- type: 'setSelectedMarkRef',
134
- data: {
135
- markRef: node
136
- }
137
- });
138
- }
139
- }, [dispatch, id, currentSelectedAnnotationId]);
140
125
  var onMarkClick = useCallback(function (event) {
141
126
  // prevent inline mark logic for media block marks
142
127
  if (event.currentTarget instanceof HTMLElement && event.currentTarget.getAttribute('data-block-mark')) {
@@ -163,13 +148,22 @@ export var MarkComponent = function MarkComponent(_ref) {
163
148
  // prevents from opening link URL inside webView in Safari
164
149
  event.preventDefault();
165
150
  }
166
-
167
- // Ignored via go/ees005
168
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
169
- onClick({
170
- eventTarget: event.target,
171
- annotationIds: annotationIds
172
- });
151
+ if (fg('platform_editor_comments_api_manager')) {
152
+ // currentTarget is the right element if there are multiple overlapping annotations
153
+ // Ignored via go/ees005
154
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
155
+ onClick({
156
+ eventTarget: event.currentTarget,
157
+ annotationIds: annotationIds
158
+ });
159
+ } else {
160
+ // Ignored via go/ees005
161
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
162
+ onClick({
163
+ eventTarget: event.target,
164
+ annotationIds: annotationIds
165
+ });
166
+ }
173
167
  }, [annotationIds, onClick, state]);
174
168
  var onMarkEnter = function onMarkEnter(evt) {
175
169
  var _document$activeEleme;
@@ -195,7 +189,6 @@ export var MarkComponent = function MarkComponent(_ref) {
195
189
  'aria-details': annotationIds.join(', ')
196
190
  }, desktopAccessibilityAttributes);
197
191
  return jsx(useBlockLevel ? 'div' : 'mark', _objectSpread(_objectSpread(_objectSpread(_defineProperty({
198
- ref: id === currentSelectedAnnotationId ? markRef : undefined,
199
192
  id: id
200
193
  }, fg('editor_inline_comments_on_inline_nodes') ? 'onClickCapture' : 'onClick', onMarkClick), accessibility), overriddenData), !useBlockLevel && {
201
194
  css: [markStyles, fg('platform_renderer_nested_annotation_styling') && markStylesLayeringFix, fg('editor_inline_comments_on_inline_nodes') && markStylesWithInlineComments, fg('confluence-frontend-comments-panel') && markStylesWithCommentsPanel, !isMobile() && accessibilityStyles, markStylesWithUpdatedShadow],
@@ -194,7 +194,7 @@ export var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
194
194
  }
195
195
  }, [updateSubscriber, createAnalyticsEvent, isNestedRender]);
196
196
  if (fg('platform_editor_comments_api_manager')) {
197
- return selectedAnnotation;
197
+ return isNestedRender ? null : selectedAnnotation;
198
198
  } else {
199
199
  return annotationClickEvent;
200
200
  }
@@ -4,6 +4,7 @@ type TableProps = SharedTableProps & {
4
4
  innerRef?: React.RefObject<HTMLTableElement>;
5
5
  children: React.ReactNode[];
6
6
  isPresentational?: boolean;
7
+ fixTableSSRResizing?: boolean;
7
8
  };
8
- export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, isInsideOfTable, isinsideMultiBodiedExtension, allowTableResizing, isPresentational, }: TableProps) => React.JSX.Element>;
9
+ export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, isInsideOfTable, isinsideMultiBodiedExtension, allowTableResizing, isPresentational, fixTableSSRResizing, }: TableProps) => React.JSX.Element>;
9
10
  export {};
@@ -42,7 +42,7 @@ export interface TableState {
42
42
  headerRowHeight: number;
43
43
  }
44
44
  /**
45
- * Class for Tables in Renderer
45
+ *
46
46
  */
47
47
  export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
48
48
  state: TableState;
@@ -42,6 +42,9 @@ export interface TableState {
42
42
  wrapperWidth: number;
43
43
  headerRowHeight: number;
44
44
  }
45
+ /**
46
+ * TableContainer renders tables using only CSS-based rules
47
+ */
45
48
  export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
46
49
  state: TableState;
47
50
  tableRef: React.RefObject<HTMLTableElement>;
@@ -55,26 +58,56 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
55
58
  updatedLayout: TableLayout | 'custom';
56
59
  private resizeObserver;
57
60
  private applyResizerChange;
61
+ /**
62
+ *
63
+ * @example
64
+ */
58
65
  componentDidMount(): void;
66
+ /**
67
+ *
68
+ * @param prevProps
69
+ * @param prevState
70
+ * @example
71
+ */
59
72
  componentDidUpdate(prevProps: TableProps, prevState: TableState): void;
60
73
  componentWillUnmount: () => void;
61
74
  getScrollTop: () => number;
62
75
  updateSticky: () => void;
63
76
  onScroll: () => void;
64
77
  onWrapperScrolled: () => void;
78
+ /**
79
+ *
80
+ */
65
81
  get pinTop(): number | undefined;
82
+ /**
83
+ *
84
+ */
66
85
  get shouldAddOverflowParentOffsetTop_DO_NOT_USE(): boolean | null | undefined;
86
+ /**
87
+ *
88
+ */
67
89
  get stickyTop(): number | undefined;
90
+ /**
91
+ *
92
+ * @example
93
+ */
68
94
  render(): React.JSX.Element;
69
95
  private grabFirstRowRef;
70
96
  }
71
97
  type TableProcessorState = {
72
98
  tableOrderStatus?: TableOrderStatus;
73
99
  };
100
+ /**
101
+ *
102
+ */
74
103
  export declare class TableProcessorWithContainerStyles extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableProcessorState> {
75
104
  state: {
76
105
  tableOrderStatus: undefined;
77
106
  };
107
+ /**
108
+ *
109
+ * @example
110
+ */
78
111
  render(): React.JSX.Element | null;
79
112
  private addSortableColumn;
80
113
  private changeSortOrder;
@@ -27,7 +27,6 @@ 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;
31
30
  id: string;
32
31
  } | {
33
32
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -42,7 +41,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
42
41
  'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
43
42
  'data-id': string;
44
43
  'aria-disabled': boolean;
45
- ref: ((node: HTMLElement | null) => void) | undefined;
46
44
  id: string;
47
45
  } | {
48
46
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -60,7 +58,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
60
58
  'aria-expanded'?: undefined;
61
59
  'aria-details': string;
62
60
  'aria-disabled'?: undefined;
63
- ref: ((node: HTMLElement | null) => void) | undefined;
64
61
  id: string;
65
62
  } | {
66
63
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -80,7 +77,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
80
77
  'aria-expanded'?: undefined;
81
78
  'aria-details': string;
82
79
  'aria-disabled'?: undefined;
83
- ref: ((node: HTMLElement | null) => void) | undefined;
84
80
  id: string;
85
81
  } | {
86
82
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -98,7 +94,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
98
94
  'aria-expanded': boolean;
99
95
  'aria-details': string;
100
96
  'aria-disabled'?: undefined;
101
- ref: ((node: HTMLElement | null) => void) | undefined;
102
97
  id: string;
103
98
  } | {
104
99
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -118,7 +113,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
118
113
  'aria-expanded': boolean;
119
114
  'aria-details': string;
120
115
  'aria-disabled'?: undefined;
121
- ref: ((node: HTMLElement | null) => void) | undefined;
122
116
  id: string;
123
117
  }, string | React.JSXElementConstructor<any>>;
124
118
  export {};
@@ -4,6 +4,7 @@ type TableProps = SharedTableProps & {
4
4
  innerRef?: React.RefObject<HTMLTableElement>;
5
5
  children: React.ReactNode[];
6
6
  isPresentational?: boolean;
7
+ fixTableSSRResizing?: boolean;
7
8
  };
8
- export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, isInsideOfTable, isinsideMultiBodiedExtension, allowTableResizing, isPresentational, }: TableProps) => React.JSX.Element>;
9
+ export declare const Table: React.MemoExoticComponent<({ innerRef, isNumberColumnEnabled, columnWidths, layout, renderWidth, children, tableNode, rendererAppearance, isInsideOfBlockNode, isInsideOfTable, isinsideMultiBodiedExtension, allowTableResizing, isPresentational, fixTableSSRResizing, }: TableProps) => React.JSX.Element>;
9
10
  export {};
@@ -42,7 +42,7 @@ export interface TableState {
42
42
  headerRowHeight: number;
43
43
  }
44
44
  /**
45
- * Class for Tables in Renderer
45
+ *
46
46
  */
47
47
  export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
48
48
  state: TableState;
@@ -42,6 +42,9 @@ export interface TableState {
42
42
  wrapperWidth: number;
43
43
  headerRowHeight: number;
44
44
  }
45
+ /**
46
+ * TableContainer renders tables using only CSS-based rules
47
+ */
45
48
  export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
46
49
  state: TableState;
47
50
  tableRef: React.RefObject<HTMLTableElement>;
@@ -55,26 +58,56 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
55
58
  updatedLayout: TableLayout | 'custom';
56
59
  private resizeObserver;
57
60
  private applyResizerChange;
61
+ /**
62
+ *
63
+ * @example
64
+ */
58
65
  componentDidMount(): void;
66
+ /**
67
+ *
68
+ * @param prevProps
69
+ * @param prevState
70
+ * @example
71
+ */
59
72
  componentDidUpdate(prevProps: TableProps, prevState: TableState): void;
60
73
  componentWillUnmount: () => void;
61
74
  getScrollTop: () => number;
62
75
  updateSticky: () => void;
63
76
  onScroll: () => void;
64
77
  onWrapperScrolled: () => void;
78
+ /**
79
+ *
80
+ */
65
81
  get pinTop(): number | undefined;
82
+ /**
83
+ *
84
+ */
66
85
  get shouldAddOverflowParentOffsetTop_DO_NOT_USE(): boolean | null | undefined;
86
+ /**
87
+ *
88
+ */
67
89
  get stickyTop(): number | undefined;
90
+ /**
91
+ *
92
+ * @example
93
+ */
68
94
  render(): React.JSX.Element;
69
95
  private grabFirstRowRef;
70
96
  }
71
97
  type TableProcessorState = {
72
98
  tableOrderStatus?: TableOrderStatus;
73
99
  };
100
+ /**
101
+ *
102
+ */
74
103
  export declare class TableProcessorWithContainerStyles extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableProcessorState> {
75
104
  state: {
76
105
  tableOrderStatus: undefined;
77
106
  };
107
+ /**
108
+ *
109
+ * @example
110
+ */
78
111
  render(): React.JSX.Element | null;
79
112
  private addSortableColumn;
80
113
  private changeSortOrder;
@@ -27,7 +27,6 @@ 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;
31
30
  id: string;
32
31
  } | {
33
32
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -42,7 +41,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
42
41
  'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
43
42
  'data-id': string;
44
43
  'aria-disabled': boolean;
45
- ref: ((node: HTMLElement | null) => void) | undefined;
46
44
  id: string;
47
45
  } | {
48
46
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -60,7 +58,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
60
58
  'aria-expanded'?: undefined;
61
59
  'aria-details': string;
62
60
  'aria-disabled'?: undefined;
63
- ref: ((node: HTMLElement | null) => void) | undefined;
64
61
  id: string;
65
62
  } | {
66
63
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -80,7 +77,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
80
77
  'aria-expanded'?: undefined;
81
78
  'aria-details': string;
82
79
  'aria-disabled'?: undefined;
83
- ref: ((node: HTMLElement | null) => void) | undefined;
84
80
  id: string;
85
81
  } | {
86
82
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -98,7 +94,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
98
94
  'aria-expanded': boolean;
99
95
  'aria-details': string;
100
96
  'aria-disabled'?: undefined;
101
- ref: ((node: HTMLElement | null) => void) | undefined;
102
97
  id: string;
103
98
  } | {
104
99
  css?: (false | import("@emotion/react").SerializedStyles)[] | undefined;
@@ -118,7 +113,6 @@ export declare const MarkComponent: ({ annotationParentIds, children, dataAttrib
118
113
  'aria-expanded': boolean;
119
114
  'aria-details': string;
120
115
  'aria-disabled'?: undefined;
121
- ref: ((node: HTMLElement | null) => void) | undefined;
122
116
  id: string;
123
117
  }, string | React.JSXElementConstructor<any>>;
124
118
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "118.1.0",
3
+ "version": "118.1.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,9 +29,9 @@
29
29
  "@atlaskit/analytics-listeners": "^9.0.0",
30
30
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
31
31
  "@atlaskit/analytics-next": "^11.0.0",
32
- "@atlaskit/button": "^23.0.0",
32
+ "@atlaskit/button": "^23.2.0",
33
33
  "@atlaskit/code": "^17.2.0",
34
- "@atlaskit/editor-common": "^105.5.0",
34
+ "@atlaskit/editor-common": "^105.6.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.24.0",
36
36
  "@atlaskit/editor-palette": "^2.1.0",
37
37
  "@atlaskit/editor-prosemirror": "7.0.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/editor-tables": "^2.9.0",
40
40
  "@atlaskit/emoji": "^69.2.0",
41
41
  "@atlaskit/feature-gate-js-client": "^5.3.0",
42
- "@atlaskit/icon": "^26.0.0",
42
+ "@atlaskit/icon": "^26.1.0",
43
43
  "@atlaskit/link-datasource": "^4.10.0",
44
44
  "@atlaskit/media-card": "^79.2.0",
45
45
  "@atlaskit/media-client": "^33.3.0",
@@ -50,13 +50,13 @@
50
50
  "@atlaskit/media-viewer": "^52.0.0",
51
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
52
52
  "@atlaskit/platform-feature-flags-react": "^0.2.0",
53
- "@atlaskit/react-ufo": "^3.12.0",
54
- "@atlaskit/smart-card": "^38.1.0",
53
+ "@atlaskit/react-ufo": "^3.13.0",
54
+ "@atlaskit/smart-card": "^38.2.0",
55
55
  "@atlaskit/status": "^3.0.0",
56
56
  "@atlaskit/task-decision": "^19.2.0",
57
57
  "@atlaskit/theme": "^18.0.0",
58
58
  "@atlaskit/tmp-editor-statsig": "^4.22.0",
59
- "@atlaskit/tokens": "^4.8.0",
59
+ "@atlaskit/tokens": "^4.9.0",
60
60
  "@atlaskit/tooltip": "^20.0.0",
61
61
  "@atlaskit/visually-hidden": "^3.0.0",
62
62
  "@babel/runtime": "^7.0.0",
@@ -79,7 +79,7 @@
79
79
  "@af/visual-regression": "workspace:^",
80
80
  "@atlaskit/analytics-gas-types": "^5.1.0",
81
81
  "@atlaskit/checkbox": "^17.1.0",
82
- "@atlaskit/css-reset": "^7.2.0",
82
+ "@atlaskit/css-reset": "^7.3.0",
83
83
  "@atlaskit/link-provider": "^3.0.0",
84
84
  "@atlaskit/link-test-helpers": "^8.0.0",
85
85
  "@atlaskit/linking-common": "^9.0.0",
@@ -132,9 +132,6 @@
132
132
  "cc_complexit_reduce_portal_rerenders": {
133
133
  "type": "boolean"
134
134
  },
135
- "cc_perf_reduce_rerenders": {
136
- "type": "boolean"
137
- },
138
135
  "cc_complexit_fe_reduce_fragment_serialization": {
139
136
  "type": "boolean"
140
137
  },
@@ -185,6 +182,9 @@
185
182
  "platform_editor_accessible_heading_copy_link": {
186
183
  "type": "boolean"
187
184
  },
185
+ "platform_editor_fix_vc90_bug_with_files": {
186
+ "type": "boolean"
187
+ },
188
188
  "editor_a11y_status_renderer_description": {
189
189
  "type": "boolean"
190
190
  },