@atlaskit/renderer 110.5.3 → 110.5.5
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 +19 -0
- package/dist/cjs/react/index.js +1 -2
- package/dist/cjs/react/nodes/TableStickyScrollbar.js +5 -11
- package/dist/cjs/ui/Renderer/index.js +1 -2
- package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +2 -11
- package/dist/cjs/ui/annotations/index.js +4 -8
- package/dist/es2019/react/index.js +1 -2
- package/dist/es2019/react/nodes/TableStickyScrollbar.js +5 -11
- package/dist/es2019/ui/Renderer/index.js +1 -2
- package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +2 -9
- package/dist/es2019/ui/annotations/index.js +4 -8
- package/dist/esm/react/index.js +1 -2
- package/dist/esm/react/nodes/TableStickyScrollbar.js +5 -11
- package/dist/esm/ui/Renderer/index.js +1 -2
- package/dist/esm/ui/annotations/hooks/use-load-annotations.js +2 -11
- package/dist/esm/ui/annotations/index.js +4 -8
- package/dist/types/react/index.d.ts +0 -2
- package/dist/types/ui/annotations/hooks/use-load-annotations.d.ts +1 -4
- package/dist/types/ui/annotations/types.d.ts +0 -3
- package/dist/types-ts4.5/react/index.d.ts +0 -2
- package/dist/types-ts4.5/ui/annotations/hooks/use-load-annotations.d.ts +1 -4
- package/dist/types-ts4.5/ui/annotations/types.d.ts +0 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 110.5.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#146981](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146981)
|
|
8
|
+
[`1bb47674cd3df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1bb47674cd3df) -
|
|
9
|
+
[ED-24683] clean up `confluence.frontend.fabric.editor.comments-on-media-media-inline-bug-fix`
|
|
10
|
+
- [#146246](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146246)
|
|
11
|
+
[`2a4fc73d45dfd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2a4fc73d45dfd) -
|
|
12
|
+
Reverting change to add onLoadComplete callback for useLoadAnnotations annotations hook
|
|
13
|
+
|
|
14
|
+
## 110.5.4
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#146688](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146688)
|
|
19
|
+
[`f834ba0388625`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f834ba0388625) -
|
|
20
|
+
[ux] Fix double horizontal scrollbar issue on table in the Preview.
|
|
21
|
+
|
|
3
22
|
## 110.5.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -100,7 +100,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
100
100
|
isMediaLink: true
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
103
|
+
if (node.type.name === 'mediaInline' && mark.type.name === 'annotation') {
|
|
104
104
|
return _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
105
105
|
isMediaInline: true
|
|
106
106
|
});
|
|
@@ -190,7 +190,6 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
190
190
|
this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
|
|
191
191
|
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
192
192
|
this.textHighlighter = init.textHighlighter;
|
|
193
|
-
this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
|
|
194
193
|
this.allowTableAlignment = init.allowTableAlignment;
|
|
195
194
|
this.allowTableResizing = init.allowTableResizing;
|
|
196
195
|
}
|
|
@@ -8,7 +8,6 @@ exports.TableStickyScrollbar = void 0;
|
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
13
12
|
var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function () {
|
|
14
13
|
function TableStickyScrollbar(wrapper) {
|
|
@@ -60,7 +59,7 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
60
59
|
var _this2 = this,
|
|
61
60
|
_this$wrapper,
|
|
62
61
|
_this$wrapper2;
|
|
63
|
-
this.rendererScrollableElement =
|
|
62
|
+
this.rendererScrollableElement = window.document;
|
|
64
63
|
if (!this.rendererScrollableElement || !this.wrapper) {
|
|
65
64
|
return;
|
|
66
65
|
}
|
|
@@ -69,12 +68,7 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
69
68
|
return;
|
|
70
69
|
}
|
|
71
70
|
entries.forEach(function (entry) {
|
|
72
|
-
var _entry$rootBounds;
|
|
73
71
|
var target = entry.target;
|
|
74
|
-
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
75
|
-
if (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.height) === 0) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
72
|
if (target.classList.contains(_styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) {
|
|
79
73
|
_this2.sentinelBottomCallback(entry);
|
|
80
74
|
}
|
|
@@ -104,16 +98,16 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
104
98
|
}, {
|
|
105
99
|
key: "sentinelBottomCallback",
|
|
106
100
|
value: function sentinelBottomCallback(entry) {
|
|
107
|
-
var _entry$
|
|
108
|
-
var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$
|
|
101
|
+
var _entry$rootBounds;
|
|
102
|
+
var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.top) || 0);
|
|
109
103
|
this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
|
|
110
104
|
this.toggle();
|
|
111
105
|
}
|
|
112
106
|
}, {
|
|
113
107
|
key: "sentinelTopCallback",
|
|
114
108
|
value: function sentinelTopCallback(entry) {
|
|
115
|
-
var _entry$
|
|
116
|
-
var sentinelIsBelowScrollArea = (((_entry$
|
|
109
|
+
var _entry$rootBounds2;
|
|
110
|
+
var sentinelIsBelowScrollArea = (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.bottom) || 0) < entry.boundingClientRect.top;
|
|
117
111
|
this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
|
|
118
112
|
this.toggle();
|
|
119
113
|
}
|
|
@@ -63,7 +63,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
63
63
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
64
64
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
65
65
|
var packageName = "@atlaskit/renderer";
|
|
66
|
-
var packageVersion = "110.5.
|
|
66
|
+
var packageVersion = "110.5.5";
|
|
67
67
|
var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
|
|
68
68
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
69
69
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
@@ -290,7 +290,6 @@ var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
290
290
|
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
291
291
|
isInsideOfInlineExtension: (0, _platformFeatureFlags.fg)('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
|
|
292
292
|
textHighlighter: props.UNSTABLE_textHighlighter,
|
|
293
|
-
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix,
|
|
294
293
|
allowTableAlignment: props.UNSTABLE_allowTableAlignment,
|
|
295
294
|
allowTableResizing: props.UNSTABLE_allowTableResizing
|
|
296
295
|
};
|
|
@@ -14,8 +14,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
var useLoadAnnotations = exports.useLoadAnnotations = function useLoadAnnotations(_ref) {
|
|
16
16
|
var adfDocument = _ref.adfDocument,
|
|
17
|
-
isNestedRender = _ref.isNestedRender
|
|
18
|
-
onLoadComplete = _ref.onLoadComplete;
|
|
17
|
+
isNestedRender = _ref.isNestedRender;
|
|
19
18
|
var actions = (0, _react.useContext)(_RendererActionsContext.RendererContext);
|
|
20
19
|
var providers = (0, _react.useContext)(_context.ProvidersContext);
|
|
21
20
|
(0, _react.useEffect)(function () {
|
|
@@ -28,9 +27,6 @@ var useLoadAnnotations = exports.useLoadAnnotations = function useLoadAnnotation
|
|
|
28
27
|
var annotations = actions.getAnnotationMarks();
|
|
29
28
|
// we don't want to request integrators for state with an empty list of ids.
|
|
30
29
|
if (!annotations.length) {
|
|
31
|
-
onLoadComplete && onLoadComplete({
|
|
32
|
-
numberOfUnresolvedInlineComments: 0
|
|
33
|
-
});
|
|
34
30
|
return;
|
|
35
31
|
}
|
|
36
32
|
var ids = annotations.map(function (mark) {
|
|
@@ -44,12 +40,7 @@ var useLoadAnnotations = exports.useLoadAnnotations = function useLoadAnnotation
|
|
|
44
40
|
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, value.id, value));
|
|
45
41
|
}, {});
|
|
46
42
|
updateSubscriberInlineComment.emit(_types.AnnotationUpdateEvent.SET_ANNOTATION_STATE, payload);
|
|
47
|
-
onLoadComplete && onLoadComplete({
|
|
48
|
-
numberOfUnresolvedInlineComments: data.filter(function (data) {
|
|
49
|
-
return data.state === 'active';
|
|
50
|
-
}).length
|
|
51
|
-
});
|
|
52
43
|
};
|
|
53
44
|
inlineCommentGetState(ids, isNestedRender).then(cb);
|
|
54
|
-
}, [actions, providers, adfDocument, isNestedRender
|
|
45
|
+
}, [actions, providers, adfDocument, isNestedRender]);
|
|
55
46
|
};
|
|
@@ -31,12 +31,10 @@ var _draft = require("./draft");
|
|
|
31
31
|
var _element = require("./element");
|
|
32
32
|
var LoadAnnotations = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
33
33
|
var adfDocument = _ref.adfDocument,
|
|
34
|
-
isNestedRender = _ref.isNestedRender
|
|
35
|
-
onLoadComplete = _ref.onLoadComplete;
|
|
34
|
+
isNestedRender = _ref.isNestedRender;
|
|
36
35
|
(0, _useLoadAnnotations.useLoadAnnotations)({
|
|
37
36
|
adfDocument: adfDocument,
|
|
38
|
-
isNestedRender: isNestedRender
|
|
39
|
-
onLoadComplete: onLoadComplete
|
|
37
|
+
isNestedRender: isNestedRender
|
|
40
38
|
});
|
|
41
39
|
return null;
|
|
42
40
|
});
|
|
@@ -46,8 +44,7 @@ var AnnotationsWrapper = exports.AnnotationsWrapper = function AnnotationsWrappe
|
|
|
46
44
|
annotationProvider = props.annotationProvider,
|
|
47
45
|
rendererRef = props.rendererRef,
|
|
48
46
|
adfDocument = props.adfDocument,
|
|
49
|
-
isNestedRender = props.isNestedRender
|
|
50
|
-
onLoadComplete = props.onLoadComplete;
|
|
47
|
+
isNestedRender = props.isNestedRender;
|
|
51
48
|
var updateSubscriber = annotationProvider && annotationProvider.inlineComment && annotationProvider.inlineComment.updateSubscriber;
|
|
52
49
|
var inlineCommentAnnotationsState = (0, _useEvents.useAnnotationStateByTypeEvent)({
|
|
53
50
|
type: _adfSchema.AnnotationTypes.INLINE_COMMENT,
|
|
@@ -66,8 +63,7 @@ var AnnotationsWrapper = exports.AnnotationsWrapper = function AnnotationsWrappe
|
|
|
66
63
|
rendererRef: rendererRef
|
|
67
64
|
}, /*#__PURE__*/_react.default.createElement(LoadAnnotations, {
|
|
68
65
|
adfDocument: adfDocument,
|
|
69
|
-
isNestedRender: isNestedRender
|
|
70
|
-
onLoadComplete: onLoadComplete
|
|
66
|
+
isNestedRender: isNestedRender
|
|
71
67
|
}), /*#__PURE__*/_react.default.createElement(_view.AnnotationView, {
|
|
72
68
|
createAnalyticsEvent: createAnalyticsEvent
|
|
73
69
|
}), children)))));
|
|
@@ -82,7 +82,7 @@ export default class ReactSerializer {
|
|
|
82
82
|
isMediaLink: true
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
85
|
+
if (node.type.name === 'mediaInline' && mark.type.name === 'annotation') {
|
|
86
86
|
return {
|
|
87
87
|
...defaultProps,
|
|
88
88
|
isMediaInline: true
|
|
@@ -176,7 +176,6 @@ export default class ReactSerializer {
|
|
|
176
176
|
this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
|
|
177
177
|
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
178
178
|
this.textHighlighter = init.textHighlighter;
|
|
179
|
-
this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
|
|
180
179
|
this.allowTableAlignment = init.allowTableAlignment;
|
|
181
180
|
this.allowTableResizing = init.allowTableResizing;
|
|
182
181
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
3
2
|
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
4
3
|
export class TableStickyScrollbar {
|
|
5
4
|
constructor(wrapper) {
|
|
@@ -39,7 +38,7 @@ export class TableStickyScrollbar {
|
|
|
39
38
|
}
|
|
40
39
|
createIntersectionObserver() {
|
|
41
40
|
var _this$wrapper, _this$wrapper$parentE2, _this$wrapper$parentE3, _this$wrapper2, _this$wrapper2$parent, _this$wrapper2$parent2;
|
|
42
|
-
this.rendererScrollableElement =
|
|
41
|
+
this.rendererScrollableElement = window.document;
|
|
43
42
|
if (!this.rendererScrollableElement || !this.wrapper) {
|
|
44
43
|
return;
|
|
45
44
|
}
|
|
@@ -48,12 +47,7 @@ export class TableStickyScrollbar {
|
|
|
48
47
|
return;
|
|
49
48
|
}
|
|
50
49
|
entries.forEach(entry => {
|
|
51
|
-
var _entry$rootBounds;
|
|
52
50
|
const target = entry.target;
|
|
53
|
-
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
54
|
-
if (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.height) === 0) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
51
|
if (target.classList.contains(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) {
|
|
58
52
|
this.sentinelBottomCallback(entry);
|
|
59
53
|
}
|
|
@@ -77,14 +71,14 @@ export class TableStickyScrollbar {
|
|
|
77
71
|
}
|
|
78
72
|
}
|
|
79
73
|
sentinelBottomCallback(entry) {
|
|
80
|
-
var _entry$
|
|
81
|
-
const sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$
|
|
74
|
+
var _entry$rootBounds;
|
|
75
|
+
const sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.top) || 0);
|
|
82
76
|
this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
|
|
83
77
|
this.toggle();
|
|
84
78
|
}
|
|
85
79
|
sentinelTopCallback(entry) {
|
|
86
|
-
var _entry$
|
|
87
|
-
const sentinelIsBelowScrollArea = (((_entry$
|
|
80
|
+
var _entry$rootBounds2;
|
|
81
|
+
const sentinelIsBelowScrollArea = (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.bottom) || 0) < entry.boundingClientRect.top;
|
|
88
82
|
this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
|
|
89
83
|
this.toggle();
|
|
90
84
|
}
|
|
@@ -45,7 +45,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
45
45
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
const packageName = "@atlaskit/renderer";
|
|
48
|
-
const packageVersion = "110.5.
|
|
48
|
+
const packageVersion = "110.5.5";
|
|
49
49
|
export const defaultNodeComponents = nodeToReact;
|
|
50
50
|
export class Renderer extends PureComponent {
|
|
51
51
|
constructor(props) {
|
|
@@ -270,7 +270,6 @@ export class Renderer extends PureComponent {
|
|
|
270
270
|
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
271
271
|
isInsideOfInlineExtension: fg('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
|
|
272
272
|
textHighlighter: props.UNSTABLE_textHighlighter,
|
|
273
|
-
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix,
|
|
274
273
|
allowTableAlignment: props.UNSTABLE_allowTableAlignment,
|
|
275
274
|
allowTableResizing: props.UNSTABLE_allowTableResizing
|
|
276
275
|
};
|
|
@@ -4,8 +4,7 @@ import { ProvidersContext } from '../context';
|
|
|
4
4
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
5
5
|
export const useLoadAnnotations = ({
|
|
6
6
|
adfDocument,
|
|
7
|
-
isNestedRender
|
|
8
|
-
onLoadComplete
|
|
7
|
+
isNestedRender
|
|
9
8
|
}) => {
|
|
10
9
|
const actions = useContext(ActionsContext);
|
|
11
10
|
const providers = useContext(ProvidersContext);
|
|
@@ -22,9 +21,6 @@ export const useLoadAnnotations = ({
|
|
|
22
21
|
const annotations = actions.getAnnotationMarks();
|
|
23
22
|
// we don't want to request integrators for state with an empty list of ids.
|
|
24
23
|
if (!annotations.length) {
|
|
25
|
-
onLoadComplete && onLoadComplete({
|
|
26
|
-
numberOfUnresolvedInlineComments: 0
|
|
27
|
-
});
|
|
28
24
|
return;
|
|
29
25
|
}
|
|
30
26
|
const ids = annotations.map(mark => mark.attrs.id);
|
|
@@ -37,10 +33,7 @@ export const useLoadAnnotations = ({
|
|
|
37
33
|
[value.id]: value
|
|
38
34
|
}), {});
|
|
39
35
|
updateSubscriberInlineComment.emit(AnnotationUpdateEvent.SET_ANNOTATION_STATE, payload);
|
|
40
|
-
onLoadComplete && onLoadComplete({
|
|
41
|
-
numberOfUnresolvedInlineComments: data.filter(data => data.state === 'active').length
|
|
42
|
-
});
|
|
43
36
|
};
|
|
44
37
|
inlineCommentGetState(ids, isNestedRender).then(cb);
|
|
45
|
-
}, [actions, providers, adfDocument, isNestedRender
|
|
38
|
+
}, [actions, providers, adfDocument, isNestedRender]);
|
|
46
39
|
};
|
|
@@ -10,13 +10,11 @@ import { AnnotationRangeProvider } from './contexts/AnnotationRangeContext';
|
|
|
10
10
|
import { AnnotationHoverContext } from './contexts/AnnotationHoverContext';
|
|
11
11
|
const LoadAnnotations = /*#__PURE__*/React.memo(({
|
|
12
12
|
adfDocument,
|
|
13
|
-
isNestedRender
|
|
14
|
-
onLoadComplete
|
|
13
|
+
isNestedRender
|
|
15
14
|
}) => {
|
|
16
15
|
useLoadAnnotations({
|
|
17
16
|
adfDocument,
|
|
18
|
-
isNestedRender
|
|
19
|
-
onLoadComplete
|
|
17
|
+
isNestedRender
|
|
20
18
|
});
|
|
21
19
|
return null;
|
|
22
20
|
});
|
|
@@ -27,8 +25,7 @@ export const AnnotationsWrapper = props => {
|
|
|
27
25
|
annotationProvider,
|
|
28
26
|
rendererRef,
|
|
29
27
|
adfDocument,
|
|
30
|
-
isNestedRender
|
|
31
|
-
onLoadComplete
|
|
28
|
+
isNestedRender
|
|
32
29
|
} = props;
|
|
33
30
|
const updateSubscriber = annotationProvider && annotationProvider.inlineComment && annotationProvider.inlineComment.updateSubscriber;
|
|
34
31
|
const inlineCommentAnnotationsState = useAnnotationStateByTypeEvent({
|
|
@@ -49,8 +46,7 @@ export const AnnotationsWrapper = props => {
|
|
|
49
46
|
rendererRef: rendererRef
|
|
50
47
|
}, /*#__PURE__*/React.createElement(LoadAnnotations, {
|
|
51
48
|
adfDocument: adfDocument,
|
|
52
|
-
isNestedRender: isNestedRender
|
|
53
|
-
onLoadComplete: onLoadComplete
|
|
49
|
+
isNestedRender: isNestedRender
|
|
54
50
|
}), /*#__PURE__*/React.createElement(AnnotationView, {
|
|
55
51
|
createAnalyticsEvent: createAnalyticsEvent
|
|
56
52
|
}), children)))));
|
package/dist/esm/react/index.js
CHANGED
|
@@ -93,7 +93,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
93
93
|
isMediaLink: true
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
if (
|
|
96
|
+
if (node.type.name === 'mediaInline' && mark.type.name === 'annotation') {
|
|
97
97
|
return _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
98
98
|
isMediaInline: true
|
|
99
99
|
});
|
|
@@ -183,7 +183,6 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
183
183
|
this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
|
|
184
184
|
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
185
185
|
this.textHighlighter = init.textHighlighter;
|
|
186
|
-
this.isCommentsOnMediaMediaInlineBugFixEnabled = init.isCommentsOnMediaMediaInlineBugFixEnabled;
|
|
187
186
|
this.allowTableAlignment = init.allowTableAlignment;
|
|
188
187
|
this.allowTableResizing = init.allowTableResizing;
|
|
189
188
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
5
4
|
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
5
|
export var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
7
6
|
function TableStickyScrollbar(wrapper) {
|
|
@@ -53,7 +52,7 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
|
53
52
|
var _this2 = this,
|
|
54
53
|
_this$wrapper,
|
|
55
54
|
_this$wrapper2;
|
|
56
|
-
this.rendererScrollableElement =
|
|
55
|
+
this.rendererScrollableElement = window.document;
|
|
57
56
|
if (!this.rendererScrollableElement || !this.wrapper) {
|
|
58
57
|
return;
|
|
59
58
|
}
|
|
@@ -62,12 +61,7 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
|
62
61
|
return;
|
|
63
62
|
}
|
|
64
63
|
entries.forEach(function (entry) {
|
|
65
|
-
var _entry$rootBounds;
|
|
66
64
|
var target = entry.target;
|
|
67
|
-
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
68
|
-
if (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.height) === 0) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
65
|
if (target.classList.contains(TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) {
|
|
72
66
|
_this2.sentinelBottomCallback(entry);
|
|
73
67
|
}
|
|
@@ -97,16 +91,16 @@ export var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
|
97
91
|
}, {
|
|
98
92
|
key: "sentinelBottomCallback",
|
|
99
93
|
value: function sentinelBottomCallback(entry) {
|
|
100
|
-
var _entry$
|
|
101
|
-
var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$
|
|
94
|
+
var _entry$rootBounds;
|
|
95
|
+
var sentinelIsAboveScrollArea = entry.boundingClientRect.top < (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.top) || 0);
|
|
102
96
|
this.bottomSentinelState = sentinelIsAboveScrollArea ? 'above' : entry.isIntersecting ? 'visible' : 'below';
|
|
103
97
|
this.toggle();
|
|
104
98
|
}
|
|
105
99
|
}, {
|
|
106
100
|
key: "sentinelTopCallback",
|
|
107
101
|
value: function sentinelTopCallback(entry) {
|
|
108
|
-
var _entry$
|
|
109
|
-
var sentinelIsBelowScrollArea = (((_entry$
|
|
102
|
+
var _entry$rootBounds2;
|
|
103
|
+
var sentinelIsBelowScrollArea = (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.bottom) || 0) < entry.boundingClientRect.top;
|
|
110
104
|
this.topSentinelState = sentinelIsBelowScrollArea ? 'below' : entry.isIntersecting ? 'visible' : 'above';
|
|
111
105
|
this.toggle();
|
|
112
106
|
}
|
|
@@ -55,7 +55,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
55
55
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
56
56
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "110.5.
|
|
58
|
+
var packageVersion = "110.5.5";
|
|
59
59
|
export var defaultNodeComponents = nodeToReact;
|
|
60
60
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
61
61
|
_inherits(Renderer, _PureComponent);
|
|
@@ -282,7 +282,6 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
282
282
|
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
283
283
|
isInsideOfInlineExtension: fg('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension,
|
|
284
284
|
textHighlighter: props.UNSTABLE_textHighlighter,
|
|
285
|
-
isCommentsOnMediaMediaInlineBugFixEnabled: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMediaMediaInlineBugFix,
|
|
286
285
|
allowTableAlignment: props.UNSTABLE_allowTableAlignment,
|
|
287
286
|
allowTableResizing: props.UNSTABLE_allowTableResizing
|
|
288
287
|
};
|
|
@@ -7,8 +7,7 @@ import { ProvidersContext } from '../context';
|
|
|
7
7
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
8
8
|
export var useLoadAnnotations = function useLoadAnnotations(_ref) {
|
|
9
9
|
var adfDocument = _ref.adfDocument,
|
|
10
|
-
isNestedRender = _ref.isNestedRender
|
|
11
|
-
onLoadComplete = _ref.onLoadComplete;
|
|
10
|
+
isNestedRender = _ref.isNestedRender;
|
|
12
11
|
var actions = useContext(ActionsContext);
|
|
13
12
|
var providers = useContext(ProvidersContext);
|
|
14
13
|
useEffect(function () {
|
|
@@ -21,9 +20,6 @@ export var useLoadAnnotations = function useLoadAnnotations(_ref) {
|
|
|
21
20
|
var annotations = actions.getAnnotationMarks();
|
|
22
21
|
// we don't want to request integrators for state with an empty list of ids.
|
|
23
22
|
if (!annotations.length) {
|
|
24
|
-
onLoadComplete && onLoadComplete({
|
|
25
|
-
numberOfUnresolvedInlineComments: 0
|
|
26
|
-
});
|
|
27
23
|
return;
|
|
28
24
|
}
|
|
29
25
|
var ids = annotations.map(function (mark) {
|
|
@@ -37,12 +33,7 @@ export var useLoadAnnotations = function useLoadAnnotations(_ref) {
|
|
|
37
33
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, value.id, value));
|
|
38
34
|
}, {});
|
|
39
35
|
updateSubscriberInlineComment.emit(AnnotationUpdateEvent.SET_ANNOTATION_STATE, payload);
|
|
40
|
-
onLoadComplete && onLoadComplete({
|
|
41
|
-
numberOfUnresolvedInlineComments: data.filter(function (data) {
|
|
42
|
-
return data.state === 'active';
|
|
43
|
-
}).length
|
|
44
|
-
});
|
|
45
36
|
};
|
|
46
37
|
inlineCommentGetState(ids, isNestedRender).then(cb);
|
|
47
|
-
}, [actions, providers, adfDocument, isNestedRender
|
|
38
|
+
}, [actions, providers, adfDocument, isNestedRender]);
|
|
48
39
|
};
|
|
@@ -10,12 +10,10 @@ import { AnnotationRangeProvider } from './contexts/AnnotationRangeContext';
|
|
|
10
10
|
import { AnnotationHoverContext } from './contexts/AnnotationHoverContext';
|
|
11
11
|
var LoadAnnotations = /*#__PURE__*/React.memo(function (_ref) {
|
|
12
12
|
var adfDocument = _ref.adfDocument,
|
|
13
|
-
isNestedRender = _ref.isNestedRender
|
|
14
|
-
onLoadComplete = _ref.onLoadComplete;
|
|
13
|
+
isNestedRender = _ref.isNestedRender;
|
|
15
14
|
useLoadAnnotations({
|
|
16
15
|
adfDocument: adfDocument,
|
|
17
|
-
isNestedRender: isNestedRender
|
|
18
|
-
onLoadComplete: onLoadComplete
|
|
16
|
+
isNestedRender: isNestedRender
|
|
19
17
|
});
|
|
20
18
|
return null;
|
|
21
19
|
});
|
|
@@ -25,8 +23,7 @@ export var AnnotationsWrapper = function AnnotationsWrapper(props) {
|
|
|
25
23
|
annotationProvider = props.annotationProvider,
|
|
26
24
|
rendererRef = props.rendererRef,
|
|
27
25
|
adfDocument = props.adfDocument,
|
|
28
|
-
isNestedRender = props.isNestedRender
|
|
29
|
-
onLoadComplete = props.onLoadComplete;
|
|
26
|
+
isNestedRender = props.isNestedRender;
|
|
30
27
|
var updateSubscriber = annotationProvider && annotationProvider.inlineComment && annotationProvider.inlineComment.updateSubscriber;
|
|
31
28
|
var inlineCommentAnnotationsState = useAnnotationStateByTypeEvent({
|
|
32
29
|
type: AnnotationTypes.INLINE_COMMENT,
|
|
@@ -45,8 +42,7 @@ export var AnnotationsWrapper = function AnnotationsWrapper(props) {
|
|
|
45
42
|
rendererRef: rendererRef
|
|
46
43
|
}, /*#__PURE__*/React.createElement(LoadAnnotations, {
|
|
47
44
|
adfDocument: adfDocument,
|
|
48
|
-
isNestedRender: isNestedRender
|
|
49
|
-
onLoadComplete: onLoadComplete
|
|
45
|
+
isNestedRender: isNestedRender
|
|
50
46
|
}), /*#__PURE__*/React.createElement(AnnotationView, {
|
|
51
47
|
createAnalyticsEvent: createAnalyticsEvent
|
|
52
48
|
}), children)))));
|
|
@@ -41,7 +41,6 @@ export interface ReactSerializerInit {
|
|
|
41
41
|
allowWindowedCodeBlock?: boolean;
|
|
42
42
|
isInsideOfInlineExtension?: boolean;
|
|
43
43
|
textHighlighter?: TextHighlighter;
|
|
44
|
-
isCommentsOnMediaMediaInlineBugFixEnabled?: boolean;
|
|
45
44
|
allowTableAlignment?: boolean;
|
|
46
45
|
allowTableResizing?: boolean;
|
|
47
46
|
}
|
|
@@ -90,7 +89,6 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
90
89
|
private nodeComponents?;
|
|
91
90
|
private allowWindowedCodeBlock?;
|
|
92
91
|
private isInsideOfInlineExtension?;
|
|
93
|
-
private isCommentsOnMediaMediaInlineBugFixEnabled?;
|
|
94
92
|
private textHighlighter?;
|
|
95
93
|
private allowTableAlignment?;
|
|
96
94
|
private allowTableResizing?;
|
|
@@ -2,9 +2,6 @@ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
|
2
2
|
type Props = {
|
|
3
3
|
adfDocument: JSONDocNode;
|
|
4
4
|
isNestedRender: boolean;
|
|
5
|
-
onLoadComplete?: ({ numberOfUnresolvedInlineComments, }: {
|
|
6
|
-
numberOfUnresolvedInlineComments: number;
|
|
7
|
-
}) => void;
|
|
8
5
|
};
|
|
9
|
-
export declare const useLoadAnnotations: ({ adfDocument, isNestedRender
|
|
6
|
+
export declare const useLoadAnnotations: ({ adfDocument, isNestedRender }: Props) => void;
|
|
10
7
|
export {};
|
|
@@ -16,9 +16,6 @@ export type AnnotationsWrapperProps = React.PropsWithChildren<{
|
|
|
16
16
|
annotationProvider: AnnotationProviders | null | undefined;
|
|
17
17
|
rendererRef: React.RefObject<HTMLDivElement>;
|
|
18
18
|
isNestedRender: boolean;
|
|
19
|
-
onLoadComplete?: ({ numberOfUnresolvedInlineComments, }: {
|
|
20
|
-
numberOfUnresolvedInlineComments: number;
|
|
21
|
-
}) => void;
|
|
22
19
|
}>;
|
|
23
20
|
export type TextPosition = {
|
|
24
21
|
start: number;
|
|
@@ -41,7 +41,6 @@ export interface ReactSerializerInit {
|
|
|
41
41
|
allowWindowedCodeBlock?: boolean;
|
|
42
42
|
isInsideOfInlineExtension?: boolean;
|
|
43
43
|
textHighlighter?: TextHighlighter;
|
|
44
|
-
isCommentsOnMediaMediaInlineBugFixEnabled?: boolean;
|
|
45
44
|
allowTableAlignment?: boolean;
|
|
46
45
|
allowTableResizing?: boolean;
|
|
47
46
|
}
|
|
@@ -90,7 +89,6 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
90
89
|
private nodeComponents?;
|
|
91
90
|
private allowWindowedCodeBlock?;
|
|
92
91
|
private isInsideOfInlineExtension?;
|
|
93
|
-
private isCommentsOnMediaMediaInlineBugFixEnabled?;
|
|
94
92
|
private textHighlighter?;
|
|
95
93
|
private allowTableAlignment?;
|
|
96
94
|
private allowTableResizing?;
|
|
@@ -2,9 +2,6 @@ import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
|
2
2
|
type Props = {
|
|
3
3
|
adfDocument: JSONDocNode;
|
|
4
4
|
isNestedRender: boolean;
|
|
5
|
-
onLoadComplete?: ({ numberOfUnresolvedInlineComments, }: {
|
|
6
|
-
numberOfUnresolvedInlineComments: number;
|
|
7
|
-
}) => void;
|
|
8
5
|
};
|
|
9
|
-
export declare const useLoadAnnotations: ({ adfDocument, isNestedRender
|
|
6
|
+
export declare const useLoadAnnotations: ({ adfDocument, isNestedRender }: Props) => void;
|
|
10
7
|
export {};
|
|
@@ -16,9 +16,6 @@ export type AnnotationsWrapperProps = React.PropsWithChildren<{
|
|
|
16
16
|
annotationProvider: AnnotationProviders | null | undefined;
|
|
17
17
|
rendererRef: React.RefObject<HTMLDivElement>;
|
|
18
18
|
isNestedRender: boolean;
|
|
19
|
-
onLoadComplete?: ({ numberOfUnresolvedInlineComments, }: {
|
|
20
|
-
numberOfUnresolvedInlineComments: number;
|
|
21
|
-
}) => void;
|
|
22
19
|
}>;
|
|
23
20
|
export type TextPosition = {
|
|
24
21
|
start: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "110.5.
|
|
3
|
+
"version": "110.5.5",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,14 +29,14 @@
|
|
|
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": "^91.
|
|
32
|
+
"@atlaskit/editor-common": "^91.2.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.
|
|
39
|
+
"@atlaskit/icon": "^22.19.0",
|
|
40
40
|
"@atlaskit/link-datasource": "^3.1.0",
|
|
41
41
|
"@atlaskit/media-card": "^78.5.0",
|
|
42
42
|
"@atlaskit/media-client": "^28.0.0",
|