@atlaskit/renderer 110.4.3 → 110.4.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.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/actions/index.js +3 -3
- package/dist/cjs/steps/index.js +14 -33
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/hover/range-validator.js +1 -6
- package/dist/cjs/ui/annotations/selection/range-validator.js +1 -4
- package/dist/es2019/actions/index.js +3 -3
- package/dist/es2019/steps/index.js +14 -33
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/hover/range-validator.js +1 -6
- package/dist/es2019/ui/annotations/selection/range-validator.js +1 -4
- package/dist/esm/actions/index.js +3 -3
- package/dist/esm/steps/index.js +14 -33
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/hover/range-validator.js +1 -6
- package/dist/esm/ui/annotations/selection/range-validator.js +1 -4
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/steps/index.d.ts +1 -1
- package/dist/types-ts4.5/actions/index.d.ts +2 -2
- package/dist/types-ts4.5/steps/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 110.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#144052](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/144052)
|
|
8
|
+
[`f4124cac65f65`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f4124cac65f65) -
|
|
9
|
+
[ux] ED-24711 Clean up feature flag for media comment video bug
|
|
10
|
+
|
|
3
11
|
## 110.4.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -232,11 +232,11 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
232
232
|
*/
|
|
233
233
|
}, {
|
|
234
234
|
key: "getPositionFromRange",
|
|
235
|
-
value: function getPositionFromRange(range
|
|
235
|
+
value: function getPositionFromRange(range) {
|
|
236
236
|
if (!this.doc || !this.schema || !range) {
|
|
237
237
|
return false;
|
|
238
238
|
}
|
|
239
|
-
return (0, _steps.getPosFromRange)(range
|
|
239
|
+
return (0, _steps.getPosFromRange)(range);
|
|
240
240
|
}
|
|
241
241
|
}, {
|
|
242
242
|
key: "getAnnotationMarks",
|
|
@@ -281,7 +281,7 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
281
281
|
}
|
|
282
282
|
}, {
|
|
283
283
|
key: "applyAnnotation",
|
|
284
|
-
value: function applyAnnotation(pos, annotation, isCommentsOnMediaBugFixEnabled
|
|
284
|
+
value: function applyAnnotation(pos, annotation, isCommentsOnMediaBugFixEnabled) {
|
|
285
285
|
if (!this.doc || !pos || !this.schema) {
|
|
286
286
|
return false;
|
|
287
287
|
}
|
package/dist/cjs/steps/index.js
CHANGED
|
@@ -193,45 +193,26 @@ function resolvePos(node, offset) {
|
|
|
193
193
|
}
|
|
194
194
|
return resolvedPos + offset;
|
|
195
195
|
}
|
|
196
|
-
function getPosFromRange(range
|
|
196
|
+
function getPosFromRange(range) {
|
|
197
197
|
var startContainer = range.startContainer,
|
|
198
198
|
startOffset = range.startOffset,
|
|
199
199
|
endContainer = range.endContainer,
|
|
200
200
|
endOffset = range.endOffset;
|
|
201
201
|
var possibleMediaOrMediaSingleElement = findParent(startContainer);
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
if (pos !== undefined) {
|
|
212
|
-
return {
|
|
213
|
-
from: pos,
|
|
214
|
-
to: pos
|
|
215
|
-
};
|
|
216
|
-
}
|
|
202
|
+
|
|
203
|
+
// Video hover targets return media single, not media, thus, the extra check in condition.
|
|
204
|
+
var isMediaOrMediaSingle = possibleMediaOrMediaSingleElement && /media|mediaSingle/.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
205
|
+
if (isMediaOrMediaSingle) {
|
|
206
|
+
var pos;
|
|
207
|
+
var mediaSingleElement = getNodeType(possibleMediaOrMediaSingleElement) === 'mediaSingle' ? possibleMediaOrMediaSingleElement : findMediaParent(possibleMediaOrMediaSingleElement);
|
|
208
|
+
if (mediaSingleElement) {
|
|
209
|
+
pos = getStartPos(mediaSingleElement);
|
|
217
210
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if (_mediaSingleElement) {
|
|
224
|
-
_pos = getStartPos(_mediaSingleElement);
|
|
225
|
-
}
|
|
226
|
-
} else {
|
|
227
|
-
_pos = getStartPos(possibleMediaOrMediaSingleElement);
|
|
228
|
-
}
|
|
229
|
-
if (_pos !== undefined) {
|
|
230
|
-
return {
|
|
231
|
-
from: _pos,
|
|
232
|
-
to: _pos
|
|
233
|
-
};
|
|
234
|
-
}
|
|
211
|
+
if (pos !== undefined) {
|
|
212
|
+
return {
|
|
213
|
+
from: pos,
|
|
214
|
+
to: pos
|
|
215
|
+
};
|
|
235
216
|
}
|
|
236
217
|
}
|
|
237
218
|
var from = resolvePos(startContainer, startOffset);
|
|
@@ -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.4.
|
|
66
|
+
var packageVersion = "110.4.4";
|
|
67
67
|
var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
|
|
68
68
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
69
69
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
@@ -10,11 +10,9 @@ var _mounter = require("./mounter");
|
|
|
10
10
|
var _RendererActionsContext = require("../../RendererActionsContext");
|
|
11
11
|
var _AnnotationRangeContext = require("../contexts/AnnotationRangeContext");
|
|
12
12
|
var _AnnotationHoverContext = require("../contexts/AnnotationHoverContext");
|
|
13
|
-
var _context = require("../context");
|
|
14
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
15
|
var RangeValidator = exports.RangeValidator = function RangeValidator(props) {
|
|
17
|
-
var _providers$inlineComm, _providers$inlineComm2;
|
|
18
16
|
var component = props.component,
|
|
19
17
|
rendererRef = props.rendererRef,
|
|
20
18
|
applyAnnotationDraftAt = props.applyAnnotationDraftAt,
|
|
@@ -28,13 +26,10 @@ var RangeValidator = exports.RangeValidator = function RangeValidator(props) {
|
|
|
28
26
|
type = _useAnnotationRangeSt.type;
|
|
29
27
|
var _useAnnotationHoverCo = (0, _AnnotationHoverContext.useAnnotationHoverContext)(),
|
|
30
28
|
isWithinRange = _useAnnotationHoverCo.isWithinRange;
|
|
31
|
-
var providers = (0, _react.useContext)(_context.ProvidersContext);
|
|
32
|
-
var isCommentsOnMediaBugFixEnabled = (_providers$inlineComm = providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugFixEnabled) !== null && _providers$inlineComm !== void 0 ? _providers$inlineComm : false;
|
|
33
|
-
var isCommentsOnMediaBugVideoCommentEnabled = (_providers$inlineComm2 = providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugVideoCommentEnabled) !== null && _providers$inlineComm2 !== void 0 ? _providers$inlineComm2 : false;
|
|
34
29
|
if (!range || type !== 'hover') {
|
|
35
30
|
return null;
|
|
36
31
|
}
|
|
37
|
-
var documentPosition = actions.getPositionFromRange(range
|
|
32
|
+
var documentPosition = actions.getPositionFromRange(range);
|
|
38
33
|
return /*#__PURE__*/_react.default.createElement(_mounter.Mounter, {
|
|
39
34
|
isWithinRange: isWithinRange,
|
|
40
35
|
range: range,
|
|
@@ -11,7 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _userSelection = require("../hooks/user-selection");
|
|
12
12
|
var _mounter = require("./mounter");
|
|
13
13
|
var _RendererActionsContext = require("../../RendererActionsContext");
|
|
14
|
-
var _context = require("../context");
|
|
15
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
16
|
var SelectionRangeValidator = exports.SelectionRangeValidator = function SelectionRangeValidator(props) {
|
|
@@ -28,12 +27,10 @@ var SelectionRangeValidator = exports.SelectionRangeValidator = function Selecti
|
|
|
28
27
|
range = _useUserSelectionRang2[0],
|
|
29
28
|
draftRange = _useUserSelectionRang2[1],
|
|
30
29
|
clearRange = _useUserSelectionRang2[2];
|
|
31
|
-
var providers = (0, _react.useContext)(_context.ProvidersContext);
|
|
32
|
-
var isCommentsOnMediaBugFixEnabled = Boolean(providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugFixEnabled);
|
|
33
30
|
if (!range && !draftRange) {
|
|
34
31
|
return null;
|
|
35
32
|
}
|
|
36
|
-
var documentPosition = actions.getPositionFromRange(range
|
|
33
|
+
var documentPosition = actions.getPositionFromRange(range);
|
|
37
34
|
|
|
38
35
|
// This property is drilled down to consumers when a new range is selected to test it's validity
|
|
39
36
|
var isAnnotationAllowedOnRange = false;
|
|
@@ -206,11 +206,11 @@ export default class RendererActions {
|
|
|
206
206
|
/**
|
|
207
207
|
* Note: False indicates that the selection not able to be calculated.
|
|
208
208
|
*/
|
|
209
|
-
getPositionFromRange(range
|
|
209
|
+
getPositionFromRange(range) {
|
|
210
210
|
if (!this.doc || !this.schema || !range) {
|
|
211
211
|
return false;
|
|
212
212
|
}
|
|
213
|
-
return getPosFromRange(range
|
|
213
|
+
return getPosFromRange(range);
|
|
214
214
|
}
|
|
215
215
|
getAnnotationMarks() {
|
|
216
216
|
const {
|
|
@@ -253,7 +253,7 @@ export default class RendererActions {
|
|
|
253
253
|
}
|
|
254
254
|
return getAnnotationIdsFromRange(pos, this.doc, this.schema);
|
|
255
255
|
}
|
|
256
|
-
applyAnnotation(pos, annotation, isCommentsOnMediaBugFixEnabled
|
|
256
|
+
applyAnnotation(pos, annotation, isCommentsOnMediaBugFixEnabled) {
|
|
257
257
|
if (!this.doc || !pos || !this.schema) {
|
|
258
258
|
return false;
|
|
259
259
|
}
|
|
@@ -187,7 +187,7 @@ export function resolvePos(node, offset, findEnd = false) {
|
|
|
187
187
|
}
|
|
188
188
|
return resolvedPos + offset;
|
|
189
189
|
}
|
|
190
|
-
export function getPosFromRange(range
|
|
190
|
+
export function getPosFromRange(range) {
|
|
191
191
|
const {
|
|
192
192
|
startContainer,
|
|
193
193
|
startOffset,
|
|
@@ -195,39 +195,20 @@ export function getPosFromRange(range, isCommentsOnMediaBugFixEnabled, isComment
|
|
|
195
195
|
endOffset
|
|
196
196
|
} = range;
|
|
197
197
|
const possibleMediaOrMediaSingleElement = findParent(startContainer);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
if (pos !== undefined) {
|
|
208
|
-
return {
|
|
209
|
-
from: pos,
|
|
210
|
-
to: pos
|
|
211
|
-
};
|
|
212
|
-
}
|
|
198
|
+
|
|
199
|
+
// Video hover targets return media single, not media, thus, the extra check in condition.
|
|
200
|
+
const isMediaOrMediaSingle = possibleMediaOrMediaSingleElement && /media|mediaSingle/.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
201
|
+
if (isMediaOrMediaSingle) {
|
|
202
|
+
let pos;
|
|
203
|
+
const mediaSingleElement = getNodeType(possibleMediaOrMediaSingleElement) === 'mediaSingle' ? possibleMediaOrMediaSingleElement : findMediaParent(possibleMediaOrMediaSingleElement);
|
|
204
|
+
if (mediaSingleElement) {
|
|
205
|
+
pos = getStartPos(mediaSingleElement);
|
|
213
206
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (mediaSingleElement) {
|
|
220
|
-
pos = getStartPos(mediaSingleElement);
|
|
221
|
-
}
|
|
222
|
-
} else {
|
|
223
|
-
pos = getStartPos(possibleMediaOrMediaSingleElement);
|
|
224
|
-
}
|
|
225
|
-
if (pos !== undefined) {
|
|
226
|
-
return {
|
|
227
|
-
from: pos,
|
|
228
|
-
to: pos
|
|
229
|
-
};
|
|
230
|
-
}
|
|
207
|
+
if (pos !== undefined) {
|
|
208
|
+
return {
|
|
209
|
+
from: pos,
|
|
210
|
+
to: pos
|
|
211
|
+
};
|
|
231
212
|
}
|
|
232
213
|
}
|
|
233
214
|
const from = resolvePos(startContainer, startOffset);
|
|
@@ -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.4.
|
|
48
|
+
const packageVersion = "110.4.4";
|
|
49
49
|
export const defaultNodeComponents = nodeToReact;
|
|
50
50
|
export class Renderer extends PureComponent {
|
|
51
51
|
constructor(props) {
|
|
@@ -3,9 +3,7 @@ import { Mounter } from './mounter';
|
|
|
3
3
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
4
4
|
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
5
5
|
import { useAnnotationHoverContext } from '../contexts/AnnotationHoverContext';
|
|
6
|
-
import { ProvidersContext } from '../context';
|
|
7
6
|
export const RangeValidator = props => {
|
|
8
|
-
var _providers$inlineComm, _providers$inlineComm2;
|
|
9
7
|
const {
|
|
10
8
|
component,
|
|
11
9
|
rendererRef,
|
|
@@ -24,13 +22,10 @@ export const RangeValidator = props => {
|
|
|
24
22
|
const {
|
|
25
23
|
isWithinRange
|
|
26
24
|
} = useAnnotationHoverContext();
|
|
27
|
-
const providers = useContext(ProvidersContext);
|
|
28
|
-
const isCommentsOnMediaBugFixEnabled = (_providers$inlineComm = providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugFixEnabled) !== null && _providers$inlineComm !== void 0 ? _providers$inlineComm : false;
|
|
29
|
-
const isCommentsOnMediaBugVideoCommentEnabled = (_providers$inlineComm2 = providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugVideoCommentEnabled) !== null && _providers$inlineComm2 !== void 0 ? _providers$inlineComm2 : false;
|
|
30
25
|
if (!range || type !== 'hover') {
|
|
31
26
|
return null;
|
|
32
27
|
}
|
|
33
|
-
const documentPosition = actions.getPositionFromRange(range
|
|
28
|
+
const documentPosition = actions.getPositionFromRange(range);
|
|
34
29
|
return /*#__PURE__*/React.createElement(Mounter, {
|
|
35
30
|
isWithinRange: isWithinRange,
|
|
36
31
|
range: range,
|
|
@@ -2,7 +2,6 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import { useUserSelectionRange } from '../hooks/user-selection';
|
|
3
3
|
import { SelectionInlineCommentMounter } from './mounter';
|
|
4
4
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
5
|
-
import { ProvidersContext } from '../context';
|
|
6
5
|
export const SelectionRangeValidator = props => {
|
|
7
6
|
const {
|
|
8
7
|
selectionComponent,
|
|
@@ -15,12 +14,10 @@ export const SelectionRangeValidator = props => {
|
|
|
15
14
|
const [range, draftRange, clearRange] = useUserSelectionRange({
|
|
16
15
|
rendererRef
|
|
17
16
|
});
|
|
18
|
-
const providers = useContext(ProvidersContext);
|
|
19
|
-
const isCommentsOnMediaBugFixEnabled = Boolean(providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugFixEnabled);
|
|
20
17
|
if (!range && !draftRange) {
|
|
21
18
|
return null;
|
|
22
19
|
}
|
|
23
|
-
const documentPosition = actions.getPositionFromRange(range
|
|
20
|
+
const documentPosition = actions.getPositionFromRange(range);
|
|
24
21
|
|
|
25
22
|
// This property is drilled down to consumers when a new range is selected to test it's validity
|
|
26
23
|
let isAnnotationAllowedOnRange = false;
|
|
@@ -225,11 +225,11 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
225
225
|
*/
|
|
226
226
|
}, {
|
|
227
227
|
key: "getPositionFromRange",
|
|
228
|
-
value: function getPositionFromRange(range
|
|
228
|
+
value: function getPositionFromRange(range) {
|
|
229
229
|
if (!this.doc || !this.schema || !range) {
|
|
230
230
|
return false;
|
|
231
231
|
}
|
|
232
|
-
return getPosFromRange(range
|
|
232
|
+
return getPosFromRange(range);
|
|
233
233
|
}
|
|
234
234
|
}, {
|
|
235
235
|
key: "getAnnotationMarks",
|
|
@@ -274,7 +274,7 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
274
274
|
}
|
|
275
275
|
}, {
|
|
276
276
|
key: "applyAnnotation",
|
|
277
|
-
value: function applyAnnotation(pos, annotation, isCommentsOnMediaBugFixEnabled
|
|
277
|
+
value: function applyAnnotation(pos, annotation, isCommentsOnMediaBugFixEnabled) {
|
|
278
278
|
if (!this.doc || !pos || !this.schema) {
|
|
279
279
|
return false;
|
|
280
280
|
}
|
package/dist/esm/steps/index.js
CHANGED
|
@@ -184,45 +184,26 @@ export function resolvePos(node, offset) {
|
|
|
184
184
|
}
|
|
185
185
|
return resolvedPos + offset;
|
|
186
186
|
}
|
|
187
|
-
export function getPosFromRange(range
|
|
187
|
+
export function getPosFromRange(range) {
|
|
188
188
|
var startContainer = range.startContainer,
|
|
189
189
|
startOffset = range.startOffset,
|
|
190
190
|
endContainer = range.endContainer,
|
|
191
191
|
endOffset = range.endOffset;
|
|
192
192
|
var possibleMediaOrMediaSingleElement = findParent(startContainer);
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
if (pos !== undefined) {
|
|
203
|
-
return {
|
|
204
|
-
from: pos,
|
|
205
|
-
to: pos
|
|
206
|
-
};
|
|
207
|
-
}
|
|
193
|
+
|
|
194
|
+
// Video hover targets return media single, not media, thus, the extra check in condition.
|
|
195
|
+
var isMediaOrMediaSingle = possibleMediaOrMediaSingleElement && /media|mediaSingle/.test(getNodeType(possibleMediaOrMediaSingleElement) || '');
|
|
196
|
+
if (isMediaOrMediaSingle) {
|
|
197
|
+
var pos;
|
|
198
|
+
var mediaSingleElement = getNodeType(possibleMediaOrMediaSingleElement) === 'mediaSingle' ? possibleMediaOrMediaSingleElement : findMediaParent(possibleMediaOrMediaSingleElement);
|
|
199
|
+
if (mediaSingleElement) {
|
|
200
|
+
pos = getStartPos(mediaSingleElement);
|
|
208
201
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if (_mediaSingleElement) {
|
|
215
|
-
_pos = getStartPos(_mediaSingleElement);
|
|
216
|
-
}
|
|
217
|
-
} else {
|
|
218
|
-
_pos = getStartPos(possibleMediaOrMediaSingleElement);
|
|
219
|
-
}
|
|
220
|
-
if (_pos !== undefined) {
|
|
221
|
-
return {
|
|
222
|
-
from: _pos,
|
|
223
|
-
to: _pos
|
|
224
|
-
};
|
|
225
|
-
}
|
|
202
|
+
if (pos !== undefined) {
|
|
203
|
+
return {
|
|
204
|
+
from: pos,
|
|
205
|
+
to: pos
|
|
206
|
+
};
|
|
226
207
|
}
|
|
227
208
|
}
|
|
228
209
|
var from = resolvePos(startContainer, startOffset);
|
|
@@ -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.4.
|
|
58
|
+
var packageVersion = "110.4.4";
|
|
59
59
|
export var defaultNodeComponents = nodeToReact;
|
|
60
60
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
61
61
|
_inherits(Renderer, _PureComponent);
|
|
@@ -3,9 +3,7 @@ import { Mounter } from './mounter';
|
|
|
3
3
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
4
4
|
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
5
5
|
import { useAnnotationHoverContext } from '../contexts/AnnotationHoverContext';
|
|
6
|
-
import { ProvidersContext } from '../context';
|
|
7
6
|
export var RangeValidator = function RangeValidator(props) {
|
|
8
|
-
var _providers$inlineComm, _providers$inlineComm2;
|
|
9
7
|
var component = props.component,
|
|
10
8
|
rendererRef = props.rendererRef,
|
|
11
9
|
applyAnnotationDraftAt = props.applyAnnotationDraftAt,
|
|
@@ -19,13 +17,10 @@ export var RangeValidator = function RangeValidator(props) {
|
|
|
19
17
|
type = _useAnnotationRangeSt.type;
|
|
20
18
|
var _useAnnotationHoverCo = useAnnotationHoverContext(),
|
|
21
19
|
isWithinRange = _useAnnotationHoverCo.isWithinRange;
|
|
22
|
-
var providers = useContext(ProvidersContext);
|
|
23
|
-
var isCommentsOnMediaBugFixEnabled = (_providers$inlineComm = providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugFixEnabled) !== null && _providers$inlineComm !== void 0 ? _providers$inlineComm : false;
|
|
24
|
-
var isCommentsOnMediaBugVideoCommentEnabled = (_providers$inlineComm2 = providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugVideoCommentEnabled) !== null && _providers$inlineComm2 !== void 0 ? _providers$inlineComm2 : false;
|
|
25
20
|
if (!range || type !== 'hover') {
|
|
26
21
|
return null;
|
|
27
22
|
}
|
|
28
|
-
var documentPosition = actions.getPositionFromRange(range
|
|
23
|
+
var documentPosition = actions.getPositionFromRange(range);
|
|
29
24
|
return /*#__PURE__*/React.createElement(Mounter, {
|
|
30
25
|
isWithinRange: isWithinRange,
|
|
31
26
|
range: range,
|
|
@@ -3,7 +3,6 @@ import React, { useContext } from 'react';
|
|
|
3
3
|
import { useUserSelectionRange } from '../hooks/user-selection';
|
|
4
4
|
import { SelectionInlineCommentMounter } from './mounter';
|
|
5
5
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
6
|
-
import { ProvidersContext } from '../context';
|
|
7
6
|
export var SelectionRangeValidator = function SelectionRangeValidator(props) {
|
|
8
7
|
var selectionComponent = props.selectionComponent,
|
|
9
8
|
rendererRef = props.rendererRef,
|
|
@@ -18,12 +17,10 @@ export var SelectionRangeValidator = function SelectionRangeValidator(props) {
|
|
|
18
17
|
range = _useUserSelectionRang2[0],
|
|
19
18
|
draftRange = _useUserSelectionRang2[1],
|
|
20
19
|
clearRange = _useUserSelectionRang2[2];
|
|
21
|
-
var providers = useContext(ProvidersContext);
|
|
22
|
-
var isCommentsOnMediaBugFixEnabled = Boolean(providers === null || providers === void 0 ? void 0 : providers.inlineComment.isCommentsOnMediaBugFixEnabled);
|
|
23
20
|
if (!range && !draftRange) {
|
|
24
21
|
return null;
|
|
25
22
|
}
|
|
26
|
-
var documentPosition = actions.getPositionFromRange(range
|
|
23
|
+
var documentPosition = actions.getPositionFromRange(range);
|
|
27
24
|
|
|
28
25
|
// This property is drilled down to consumers when a new range is selected to test it's validity
|
|
29
26
|
var isAnnotationAllowedOnRange = false;
|
|
@@ -62,10 +62,10 @@ export default class RendererActions implements RendererActionsOptions, Annotati
|
|
|
62
62
|
/**
|
|
63
63
|
* Note: False indicates that the selection not able to be calculated.
|
|
64
64
|
*/
|
|
65
|
-
getPositionFromRange(range: Range | null
|
|
65
|
+
getPositionFromRange(range: Range | null): Position | false;
|
|
66
66
|
getAnnotationMarks(): Mark[];
|
|
67
67
|
getAnnotationsByPosition(range: Range): string[];
|
|
68
|
-
applyAnnotation(pos: Position, annotation: Annotation, isCommentsOnMediaBugFixEnabled?: boolean
|
|
68
|
+
applyAnnotation(pos: Position, annotation: Annotation, isCommentsOnMediaBugFixEnabled?: boolean): AnnotationActionResult;
|
|
69
69
|
generateAnnotationIndexMatch(pos: Position): AnnotationByMatches | false;
|
|
70
70
|
getInlineNodeTypes(annotationId: string): string[] | undefined;
|
|
71
71
|
}
|
|
@@ -7,7 +7,7 @@ interface AnnotationStepOptions {
|
|
|
7
7
|
annotationId: string;
|
|
8
8
|
annotationType: 'inlineComment';
|
|
9
9
|
}
|
|
10
|
-
export declare function getPosFromRange(range: Range
|
|
10
|
+
export declare function getPosFromRange(range: Range): {
|
|
11
11
|
from: number;
|
|
12
12
|
to: number;
|
|
13
13
|
} | false;
|
|
@@ -62,10 +62,10 @@ export default class RendererActions implements RendererActionsOptions, Annotati
|
|
|
62
62
|
/**
|
|
63
63
|
* Note: False indicates that the selection not able to be calculated.
|
|
64
64
|
*/
|
|
65
|
-
getPositionFromRange(range: Range | null
|
|
65
|
+
getPositionFromRange(range: Range | null): Position | false;
|
|
66
66
|
getAnnotationMarks(): Mark[];
|
|
67
67
|
getAnnotationsByPosition(range: Range): string[];
|
|
68
|
-
applyAnnotation(pos: Position, annotation: Annotation, isCommentsOnMediaBugFixEnabled?: boolean
|
|
68
|
+
applyAnnotation(pos: Position, annotation: Annotation, isCommentsOnMediaBugFixEnabled?: boolean): AnnotationActionResult;
|
|
69
69
|
generateAnnotationIndexMatch(pos: Position): AnnotationByMatches | false;
|
|
70
70
|
getInlineNodeTypes(annotationId: string): string[] | undefined;
|
|
71
71
|
}
|
|
@@ -7,7 +7,7 @@ interface AnnotationStepOptions {
|
|
|
7
7
|
annotationId: string;
|
|
8
8
|
annotationType: 'inlineComment';
|
|
9
9
|
}
|
|
10
|
-
export declare function getPosFromRange(range: Range
|
|
10
|
+
export declare function getPosFromRange(range: Range): {
|
|
11
11
|
from: number;
|
|
12
12
|
to: number;
|
|
13
13
|
} | false;
|