@atlaskit/renderer 109.13.1 → 109.14.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 +10 -0
- package/dist/cjs/actions/index.js +12 -3
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/actions/index.js +13 -4
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/actions/index.js +13 -4
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/actions/index.d.ts +1 -2
- package/dist/types-ts4.5/actions/index.d.ts +1 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 109.13.1
|
|
4
14
|
|
|
5
15
|
### 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;
|
|
@@ -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.14.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 { 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
|
|
@@ -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.14.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 { 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;
|
|
@@ -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.14.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;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.
|
|
3
|
+
"version": "109.14.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -44,10 +44,10 @@
|
|
|
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",
|