@atlaskit/renderer 109.13.1 → 109.15.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 +23 -0
- package/dist/cjs/actions/index.js +30 -8
- package/dist/cjs/react/index.js +1 -1
- package/dist/cjs/steps/index.js +11 -0
- package/dist/cjs/ui/MediaCard.js +3 -2
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/actions/index.js +31 -9
- package/dist/es2019/react/index.js +1 -1
- package/dist/es2019/steps/index.js +9 -0
- package/dist/es2019/ui/MediaCard.js +3 -2
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/actions/index.js +31 -9
- package/dist/esm/react/index.js +1 -1
- package/dist/esm/steps/index.js +11 -0
- package/dist/esm/ui/MediaCard.js +3 -2
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/actions/index.d.ts +1 -2
- package/dist/types/ui/MediaCard.d.ts +1 -0
- package/dist/types-ts4.5/actions/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/MediaCard.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#87820](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87820) [`120f76a32bf9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/120f76a32bf9) - [ED-22819]
|
|
8
|
+
|
|
9
|
+
- Update ApplyAnnotation to return `step` of type AddNodeMarkStep for annotation on media and correct `doc` that includes newly add annotation mark
|
|
10
|
+
- Make media node read in data attributes so that it shows data-renderer-start-pos
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 109.14.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- [#87313](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87313) [`1789491c0687`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1789491c0687) - [ED-22804] Update renderer action deleteAnnotation to function with media node
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 109.13.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -80,8 +80,13 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
80
80
|
});
|
|
81
81
|
var from;
|
|
82
82
|
var to;
|
|
83
|
+
var nodePos;
|
|
84
|
+
var step;
|
|
83
85
|
this.doc.descendants(function (node, pos) {
|
|
84
86
|
var found = mark.isInSet(node.marks);
|
|
87
|
+
if (found && node.type.name === 'media') {
|
|
88
|
+
nodePos = pos;
|
|
89
|
+
}
|
|
85
90
|
if (found && !from) {
|
|
86
91
|
// Set both here incase it only spans one node.
|
|
87
92
|
from = pos;
|
|
@@ -93,10 +98,14 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
93
98
|
}
|
|
94
99
|
return true;
|
|
95
100
|
});
|
|
96
|
-
if (
|
|
97
|
-
|
|
101
|
+
if (nodePos !== undefined) {
|
|
102
|
+
step = new _transform.RemoveNodeMarkStep(nodePos, mark);
|
|
103
|
+
} else {
|
|
104
|
+
if (from === undefined || to === undefined) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
step = new _transform.RemoveMarkStep(from, to, mark);
|
|
98
108
|
}
|
|
99
|
-
var step = new _transform.RemoveMarkStep(from, to, mark);
|
|
100
109
|
var _step$apply = step.apply(this.doc),
|
|
101
110
|
doc = _step$apply.doc,
|
|
102
111
|
failed = _step$apply.failed;
|
|
@@ -217,11 +226,24 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
217
226
|
to = pos.to;
|
|
218
227
|
var annotationId = annotation.annotationId,
|
|
219
228
|
annotationType = annotation.annotationType;
|
|
220
|
-
var step
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
229
|
+
var step;
|
|
230
|
+
|
|
231
|
+
// If from points to a node position,
|
|
232
|
+
// we need to 1 position before it for nodeAt to return the node itself
|
|
233
|
+
var beforeNodePos = Math.max(from - 1, 0);
|
|
234
|
+
var possibleNode = this.doc.nodeAt(beforeNodePos);
|
|
235
|
+
if ((possibleNode === null || possibleNode === void 0 ? void 0 : possibleNode.type.name) === 'media') {
|
|
236
|
+
step = new _transform.AddNodeMarkStep(beforeNodePos, this.schema.marks.annotation.create({
|
|
237
|
+
id: annotationId,
|
|
238
|
+
type: annotationType
|
|
239
|
+
}));
|
|
240
|
+
} else {
|
|
241
|
+
step = (0, _steps.createAnnotationStep)(from, to, {
|
|
242
|
+
annotationId: annotationId,
|
|
243
|
+
annotationType: annotationType,
|
|
244
|
+
schema: this.schema
|
|
245
|
+
});
|
|
246
|
+
}
|
|
225
247
|
var _step$apply2 = step.apply(this.doc),
|
|
226
248
|
doc = _step$apply2.doc,
|
|
227
249
|
failed = _step$apply2.failed;
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -411,7 +411,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
411
411
|
var isBorderMark = function isBorderMark(mark) {
|
|
412
412
|
return isChildOfMediaSingle && mark.type === border;
|
|
413
413
|
};
|
|
414
|
-
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
414
|
+
return _objectSpread(_objectSpread({}, this.getProps(node, path)), {}, {
|
|
415
415
|
marks: node.marks.filter(function (m) {
|
|
416
416
|
return !isLinkMark(m) || _this6.allowMediaLinking === true;
|
|
417
417
|
}),
|
package/dist/cjs/steps/index.js
CHANGED
|
@@ -10,6 +10,9 @@ var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
|
10
10
|
function getStartPos(element) {
|
|
11
11
|
return parseInt(element.dataset.rendererStartPos || '-1', 10);
|
|
12
12
|
}
|
|
13
|
+
var getNodeType = function getNodeType(element) {
|
|
14
|
+
return element.dataset.nodeType;
|
|
15
|
+
};
|
|
13
16
|
function isPositionPointer(element) {
|
|
14
17
|
return getStartPos(element) > -1;
|
|
15
18
|
}
|
|
@@ -114,6 +117,14 @@ function getPosFromRange(range) {
|
|
|
114
117
|
startOffset = range.startOffset,
|
|
115
118
|
endContainer = range.endContainer,
|
|
116
119
|
endOffset = range.endOffset;
|
|
120
|
+
var parent = findParent(startContainer);
|
|
121
|
+
if (parent && getNodeType(parent) === 'media') {
|
|
122
|
+
var pos = getStartPos(parent);
|
|
123
|
+
return {
|
|
124
|
+
from: pos,
|
|
125
|
+
to: pos
|
|
126
|
+
};
|
|
127
|
+
}
|
|
117
128
|
var from = resolvePos(startContainer, startOffset);
|
|
118
129
|
var to = resolvePos(endContainer, endOffset);
|
|
119
130
|
if (from === false || to === false) {
|
package/dist/cjs/ui/MediaCard.js
CHANGED
|
@@ -269,7 +269,8 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
269
269
|
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
|
|
270
270
|
ssr = _this$props5.ssr,
|
|
271
271
|
mediaClient = _this$props5.mediaClient,
|
|
272
|
-
setHoverTarget = _this$props5.setHoverTarget
|
|
272
|
+
setHoverTarget = _this$props5.setHoverTarget,
|
|
273
|
+
dataAttributes = _this$props5.dataAttributes;
|
|
273
274
|
var isMobile = rendererAppearance === 'mobile';
|
|
274
275
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
275
276
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -304,7 +305,7 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
304
305
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
305
306
|
originalDimensions: originalDimensions,
|
|
306
307
|
fileState: fileState
|
|
307
|
-
}), {
|
|
308
|
+
}), dataAttributes, {
|
|
308
309
|
onMouseEnter: function onMouseEnter(event) {
|
|
309
310
|
// We will not allow a hover target to be set if any mouse button is depressed during the mouse enter state.
|
|
310
311
|
// This could be due to the user trying to select text across the document.
|
|
@@ -55,7 +55,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
55
55
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
56
56
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "109.
|
|
58
|
+
var packageVersion = "109.15.0";
|
|
59
59
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
60
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
61
61
|
var _super = _createSuper(Renderer);
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
3
3
|
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
5
|
-
import { RemoveMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
|
+
import { AddNodeMarkStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
6
6
|
import { createAnnotationStep, getPosFromRange } from '../steps';
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { getIndexMatch } from './matches-utils';
|
|
@@ -61,8 +61,13 @@ export default class RendererActions {
|
|
|
61
61
|
});
|
|
62
62
|
let from;
|
|
63
63
|
let to;
|
|
64
|
+
let nodePos;
|
|
65
|
+
let step;
|
|
64
66
|
this.doc.descendants((node, pos) => {
|
|
65
67
|
const found = mark.isInSet(node.marks);
|
|
68
|
+
if (found && node.type.name === 'media') {
|
|
69
|
+
nodePos = pos;
|
|
70
|
+
}
|
|
66
71
|
if (found && !from) {
|
|
67
72
|
// Set both here incase it only spans one node.
|
|
68
73
|
from = pos;
|
|
@@ -74,10 +79,14 @@ export default class RendererActions {
|
|
|
74
79
|
}
|
|
75
80
|
return true;
|
|
76
81
|
});
|
|
77
|
-
if (
|
|
78
|
-
|
|
82
|
+
if (nodePos !== undefined) {
|
|
83
|
+
step = new RemoveNodeMarkStep(nodePos, mark);
|
|
84
|
+
} else {
|
|
85
|
+
if (from === undefined || to === undefined) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
step = new RemoveMarkStep(from, to, mark);
|
|
79
89
|
}
|
|
80
|
-
const step = new RemoveMarkStep(from, to, mark);
|
|
81
90
|
const {
|
|
82
91
|
doc,
|
|
83
92
|
failed
|
|
@@ -195,11 +204,24 @@ export default class RendererActions {
|
|
|
195
204
|
annotationId,
|
|
196
205
|
annotationType
|
|
197
206
|
} = annotation;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
207
|
+
let step;
|
|
208
|
+
|
|
209
|
+
// If from points to a node position,
|
|
210
|
+
// we need to 1 position before it for nodeAt to return the node itself
|
|
211
|
+
const beforeNodePos = Math.max(from - 1, 0);
|
|
212
|
+
const possibleNode = this.doc.nodeAt(beforeNodePos);
|
|
213
|
+
if ((possibleNode === null || possibleNode === void 0 ? void 0 : possibleNode.type.name) === 'media') {
|
|
214
|
+
step = new AddNodeMarkStep(beforeNodePos, this.schema.marks.annotation.create({
|
|
215
|
+
id: annotationId,
|
|
216
|
+
type: annotationType
|
|
217
|
+
}));
|
|
218
|
+
} else {
|
|
219
|
+
step = createAnnotationStep(from, to, {
|
|
220
|
+
annotationId,
|
|
221
|
+
annotationType,
|
|
222
|
+
schema: this.schema
|
|
223
|
+
});
|
|
224
|
+
}
|
|
203
225
|
const {
|
|
204
226
|
doc,
|
|
205
227
|
failed
|
|
@@ -361,7 +361,7 @@ export default class ReactSerializer {
|
|
|
361
361
|
const isLinkMark = mark => mark.type === link;
|
|
362
362
|
const isBorderMark = mark => isChildOfMediaSingle && mark.type === border;
|
|
363
363
|
return {
|
|
364
|
-
...this.getProps(node),
|
|
364
|
+
...this.getProps(node, path),
|
|
365
365
|
marks: node.marks.filter(m => !isLinkMark(m) || this.allowMediaLinking === true),
|
|
366
366
|
isLinkMark,
|
|
367
367
|
isBorderMark,
|
|
@@ -2,6 +2,7 @@ import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
|
2
2
|
function getStartPos(element) {
|
|
3
3
|
return parseInt(element.dataset.rendererStartPos || '-1', 10);
|
|
4
4
|
}
|
|
5
|
+
const getNodeType = element => element.dataset.nodeType;
|
|
5
6
|
function isPositionPointer(element) {
|
|
6
7
|
return getStartPos(element) > -1;
|
|
7
8
|
}
|
|
@@ -112,6 +113,14 @@ export function getPosFromRange(range) {
|
|
|
112
113
|
endContainer,
|
|
113
114
|
endOffset
|
|
114
115
|
} = range;
|
|
116
|
+
const parent = findParent(startContainer);
|
|
117
|
+
if (parent && getNodeType(parent) === 'media') {
|
|
118
|
+
const pos = getStartPos(parent);
|
|
119
|
+
return {
|
|
120
|
+
from: pos,
|
|
121
|
+
to: pos
|
|
122
|
+
};
|
|
123
|
+
}
|
|
115
124
|
const from = resolvePos(startContainer, startOffset);
|
|
116
125
|
const to = resolvePos(endContainer, endOffset);
|
|
117
126
|
if (from === false || to === false) {
|
|
@@ -201,7 +201,8 @@ export class MediaCardView extends Component {
|
|
|
201
201
|
shouldEnableDownloadButton,
|
|
202
202
|
ssr,
|
|
203
203
|
mediaClient,
|
|
204
|
-
setHoverTarget
|
|
204
|
+
setHoverTarget,
|
|
205
|
+
dataAttributes
|
|
205
206
|
} = this.props;
|
|
206
207
|
const isMobile = rendererAppearance === 'mobile';
|
|
207
208
|
const shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
@@ -237,7 +238,7 @@ export class MediaCardView extends Component {
|
|
|
237
238
|
contextIdentifierProvider,
|
|
238
239
|
originalDimensions,
|
|
239
240
|
fileState
|
|
240
|
-
}), {
|
|
241
|
+
}), dataAttributes, {
|
|
241
242
|
onMouseEnter: event => {
|
|
242
243
|
// We will not allow a hover target to be set if any mouse button is depressed during the mouse enter state.
|
|
243
244
|
// This could be due to the user trying to select text across the document.
|
|
@@ -36,7 +36,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
36
36
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
37
37
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
38
38
|
const packageName = "@atlaskit/renderer";
|
|
39
|
-
const packageVersion = "109.
|
|
39
|
+
const packageVersion = "109.15.0";
|
|
40
40
|
export class Renderer extends PureComponent {
|
|
41
41
|
constructor(props) {
|
|
42
42
|
super(props);
|
|
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
6
6
|
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
8
|
-
import { RemoveMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
|
+
import { AddNodeMarkStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
9
9
|
import { createAnnotationStep, getPosFromRange } from '../steps';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import { getIndexMatch } from './matches-utils';
|
|
@@ -73,8 +73,13 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
73
73
|
});
|
|
74
74
|
var from;
|
|
75
75
|
var to;
|
|
76
|
+
var nodePos;
|
|
77
|
+
var step;
|
|
76
78
|
this.doc.descendants(function (node, pos) {
|
|
77
79
|
var found = mark.isInSet(node.marks);
|
|
80
|
+
if (found && node.type.name === 'media') {
|
|
81
|
+
nodePos = pos;
|
|
82
|
+
}
|
|
78
83
|
if (found && !from) {
|
|
79
84
|
// Set both here incase it only spans one node.
|
|
80
85
|
from = pos;
|
|
@@ -86,10 +91,14 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
86
91
|
}
|
|
87
92
|
return true;
|
|
88
93
|
});
|
|
89
|
-
if (
|
|
90
|
-
|
|
94
|
+
if (nodePos !== undefined) {
|
|
95
|
+
step = new RemoveNodeMarkStep(nodePos, mark);
|
|
96
|
+
} else {
|
|
97
|
+
if (from === undefined || to === undefined) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
step = new RemoveMarkStep(from, to, mark);
|
|
91
101
|
}
|
|
92
|
-
var step = new RemoveMarkStep(from, to, mark);
|
|
93
102
|
var _step$apply = step.apply(this.doc),
|
|
94
103
|
doc = _step$apply.doc,
|
|
95
104
|
failed = _step$apply.failed;
|
|
@@ -210,11 +219,24 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
210
219
|
to = pos.to;
|
|
211
220
|
var annotationId = annotation.annotationId,
|
|
212
221
|
annotationType = annotation.annotationType;
|
|
213
|
-
var step
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
var step;
|
|
223
|
+
|
|
224
|
+
// If from points to a node position,
|
|
225
|
+
// we need to 1 position before it for nodeAt to return the node itself
|
|
226
|
+
var beforeNodePos = Math.max(from - 1, 0);
|
|
227
|
+
var possibleNode = this.doc.nodeAt(beforeNodePos);
|
|
228
|
+
if ((possibleNode === null || possibleNode === void 0 ? void 0 : possibleNode.type.name) === 'media') {
|
|
229
|
+
step = new AddNodeMarkStep(beforeNodePos, this.schema.marks.annotation.create({
|
|
230
|
+
id: annotationId,
|
|
231
|
+
type: annotationType
|
|
232
|
+
}));
|
|
233
|
+
} else {
|
|
234
|
+
step = createAnnotationStep(from, to, {
|
|
235
|
+
annotationId: annotationId,
|
|
236
|
+
annotationType: annotationType,
|
|
237
|
+
schema: this.schema
|
|
238
|
+
});
|
|
239
|
+
}
|
|
218
240
|
var _step$apply2 = step.apply(this.doc),
|
|
219
241
|
doc = _step$apply2.doc,
|
|
220
242
|
failed = _step$apply2.failed;
|
package/dist/esm/react/index.js
CHANGED
|
@@ -404,7 +404,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
404
404
|
var isBorderMark = function isBorderMark(mark) {
|
|
405
405
|
return isChildOfMediaSingle && mark.type === border;
|
|
406
406
|
};
|
|
407
|
-
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
407
|
+
return _objectSpread(_objectSpread({}, this.getProps(node, path)), {}, {
|
|
408
408
|
marks: node.marks.filter(function (m) {
|
|
409
409
|
return !isLinkMark(m) || _this6.allowMediaLinking === true;
|
|
410
410
|
}),
|
package/dist/esm/steps/index.js
CHANGED
|
@@ -2,6 +2,9 @@ import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
|
2
2
|
function getStartPos(element) {
|
|
3
3
|
return parseInt(element.dataset.rendererStartPos || '-1', 10);
|
|
4
4
|
}
|
|
5
|
+
var getNodeType = function getNodeType(element) {
|
|
6
|
+
return element.dataset.nodeType;
|
|
7
|
+
};
|
|
5
8
|
function isPositionPointer(element) {
|
|
6
9
|
return getStartPos(element) > -1;
|
|
7
10
|
}
|
|
@@ -106,6 +109,14 @@ export function getPosFromRange(range) {
|
|
|
106
109
|
startOffset = range.startOffset,
|
|
107
110
|
endContainer = range.endContainer,
|
|
108
111
|
endOffset = range.endOffset;
|
|
112
|
+
var parent = findParent(startContainer);
|
|
113
|
+
if (parent && getNodeType(parent) === 'media') {
|
|
114
|
+
var pos = getStartPos(parent);
|
|
115
|
+
return {
|
|
116
|
+
from: pos,
|
|
117
|
+
to: pos
|
|
118
|
+
};
|
|
119
|
+
}
|
|
109
120
|
var from = resolvePos(startContainer, startOffset);
|
|
110
121
|
var to = resolvePos(endContainer, endOffset);
|
|
111
122
|
if (from === false || to === false) {
|
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -259,7 +259,8 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
259
259
|
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
|
|
260
260
|
ssr = _this$props5.ssr,
|
|
261
261
|
mediaClient = _this$props5.mediaClient,
|
|
262
|
-
setHoverTarget = _this$props5.setHoverTarget
|
|
262
|
+
setHoverTarget = _this$props5.setHoverTarget,
|
|
263
|
+
dataAttributes = _this$props5.dataAttributes;
|
|
263
264
|
var isMobile = rendererAppearance === 'mobile';
|
|
264
265
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
265
266
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -294,7 +295,7 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
294
295
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
295
296
|
originalDimensions: originalDimensions,
|
|
296
297
|
fileState: fileState
|
|
297
|
-
}), {
|
|
298
|
+
}), dataAttributes, {
|
|
298
299
|
onMouseEnter: function onMouseEnter(event) {
|
|
299
300
|
// We will not allow a hover target to be set if any mouse button is depressed during the mouse enter state.
|
|
300
301
|
// This could be due to the user trying to select text across the document.
|
|
@@ -46,7 +46,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
46
46
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
47
47
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
48
48
|
var packageName = "@atlaskit/renderer";
|
|
49
|
-
var packageVersion = "109.
|
|
49
|
+
var packageVersion = "109.15.0";
|
|
50
50
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
51
51
|
_inherits(Renderer, _PureComponent);
|
|
52
52
|
var _super = _createSuper(Renderer);
|
|
@@ -4,7 +4,6 @@ import type { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/edit
|
|
|
4
4
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
5
5
|
import type { Node, Schema, Mark } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
import { RemoveMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
7
|
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
9
8
|
type ActionResult = {
|
|
10
9
|
step: Step;
|
|
@@ -47,7 +46,7 @@ export default class RendererActions implements RendererActionsOptions, Annotati
|
|
|
47
46
|
*/
|
|
48
47
|
_privateValidatePositionsForAnnotation(from: number, to: number): boolean;
|
|
49
48
|
deleteAnnotation(annotationId: string, annotationType: 'inlineComment'): false | {
|
|
50
|
-
step:
|
|
49
|
+
step: Step;
|
|
51
50
|
doc: JSONDocNode;
|
|
52
51
|
};
|
|
53
52
|
annotate(range: Range, annotationId: string, annotationType: 'inlineComment'): AnnotationActionResult;
|
|
@@ -39,6 +39,7 @@ export interface MediaCardProps {
|
|
|
39
39
|
featureFlags?: MediaFeatureFlags;
|
|
40
40
|
shouldEnableDownloadButton?: boolean;
|
|
41
41
|
ssr?: MediaSSR;
|
|
42
|
+
dataAttributes?: Record<string, any>;
|
|
42
43
|
}
|
|
43
44
|
export interface State {
|
|
44
45
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
@@ -4,7 +4,6 @@ import type { AnnotationActionResult, AnnotationByMatches } from '@atlaskit/edit
|
|
|
4
4
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
5
5
|
import type { Node, Schema, Mark } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
import { RemoveMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
7
|
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
9
8
|
type ActionResult = {
|
|
10
9
|
step: Step;
|
|
@@ -47,7 +46,7 @@ export default class RendererActions implements RendererActionsOptions, Annotati
|
|
|
47
46
|
*/
|
|
48
47
|
_privateValidatePositionsForAnnotation(from: number, to: number): boolean;
|
|
49
48
|
deleteAnnotation(annotationId: string, annotationType: 'inlineComment'): false | {
|
|
50
|
-
step:
|
|
49
|
+
step: Step;
|
|
51
50
|
doc: JSONDocNode;
|
|
52
51
|
};
|
|
53
52
|
annotate(range: Range, annotationId: string, annotationType: 'inlineComment'): AnnotationActionResult;
|
|
@@ -39,6 +39,7 @@ export interface MediaCardProps {
|
|
|
39
39
|
featureFlags?: MediaFeatureFlags;
|
|
40
40
|
shouldEnableDownloadButton?: boolean;
|
|
41
41
|
ssr?: MediaSSR;
|
|
42
|
+
dataAttributes?: Record<string, any>;
|
|
42
43
|
}
|
|
43
44
|
export interface State {
|
|
44
45
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.
|
|
3
|
+
"version": "109.15.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/analytics-listeners": "^8.9.0",
|
|
30
30
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
31
31
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
32
|
-
"@atlaskit/button": "^17.
|
|
32
|
+
"@atlaskit/button": "^17.10.0",
|
|
33
33
|
"@atlaskit/code": "^15.1.0",
|
|
34
34
|
"@atlaskit/editor-common": "^78.23.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
39
39
|
"@atlaskit/emoji": "^67.6.0",
|
|
40
40
|
"@atlaskit/icon": "^22.1.0",
|
|
41
|
-
"@atlaskit/link-datasource": "^1.
|
|
41
|
+
"@atlaskit/link-datasource": "^1.25.0",
|
|
42
42
|
"@atlaskit/media-card": "^77.10.0",
|
|
43
43
|
"@atlaskit/media-client": "^26.2.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
45
45
|
"@atlaskit/media-common": "^11.1.0",
|
|
46
46
|
"@atlaskit/media-filmstrip": "^47.0.0",
|
|
47
|
-
"@atlaskit/media-ui": "^25.
|
|
47
|
+
"@atlaskit/media-ui": "^25.5.0",
|
|
48
48
|
"@atlaskit/media-viewer": "^48.4.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
50
|
-
"@atlaskit/smart-card": "^26.
|
|
50
|
+
"@atlaskit/smart-card": "^26.52.0",
|
|
51
51
|
"@atlaskit/status": "^1.4.0",
|
|
52
52
|
"@atlaskit/task-decision": "^17.9.0",
|
|
53
53
|
"@atlaskit/theme": "^12.7.0",
|