@atlaskit/editor-plugin-annotation 28.1.0 → 28.1.2
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 +12 -0
- package/dist/cjs/pm-plugins/annotation-manager-hooks.js +2 -0
- package/dist/cjs/pm-plugins/resolve-annotatable-target.js +4 -4
- package/dist/es2019/pm-plugins/annotation-manager-hooks.js +1 -0
- package/dist/es2019/pm-plugins/resolve-annotatable-target.js +1 -1
- package/dist/esm/pm-plugins/annotation-manager-hooks.js +1 -0
- package/dist/esm/pm-plugins/resolve-annotatable-target.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,8 @@ var _editorCommands = require("../editor-commands");
|
|
|
13
13
|
var _types = require("../types");
|
|
14
14
|
var _resolveAnnotatableTarget = require("./resolve-annotatable-target");
|
|
15
15
|
var _utils2 = require("./utils");
|
|
16
|
+
// eslint-disable-next-line @atlaskit/platform/no-barrel-entry-imports
|
|
17
|
+
|
|
16
18
|
var ERROR_REASON_DRAFT_NOT_STARTED = 'draft-not-started';
|
|
17
19
|
var ERROR_REASON_DRAFT_IN_PROGRESS = 'draft-in-progress';
|
|
18
20
|
var ERROR_REASON_RANGE_MISSING = 'range-no-longer-exists';
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.resolveAnnotatableTargetFromLocalId = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _nodesByLocalIds = require("@atlaskit/editor-common/utils/nodes-by-localIds");
|
|
8
|
+
var _utils = require("./utils");
|
|
9
9
|
/**
|
|
10
10
|
* Resolves the node to annotate for a `localId`: the node itself when it accepts an annotation
|
|
11
11
|
* (allows the mark, or is a supported block node), otherwise its closest accepting ancestor.
|
|
@@ -15,13 +15,13 @@ var _utils2 = require("./utils");
|
|
|
15
15
|
*/
|
|
16
16
|
var resolveAnnotatableTargetFromLocalId = exports.resolveAnnotatableTargetFromLocalId = function resolveAnnotatableTargetFromLocalId(state, localId, opts) {
|
|
17
17
|
var supportedBlockNodes = opts.supportedBlockNodes;
|
|
18
|
-
var matches = (0,
|
|
18
|
+
var matches = (0, _nodesByLocalIds.findNodePosByLocalIds)(state, [localId]);
|
|
19
19
|
if (matches.length === 0) {
|
|
20
20
|
return undefined;
|
|
21
21
|
}
|
|
22
22
|
var annotationMarkType = state.schema.marks.annotation;
|
|
23
23
|
var nodeAcceptsAnnotation = function nodeAcceptsAnnotation(node) {
|
|
24
|
-
return node.type.allowsMarkType(annotationMarkType) || (0,
|
|
24
|
+
return node.type.allowsMarkType(annotationMarkType) || (0, _utils.isSupportedBlockNode)(node, supportedBlockNodes);
|
|
25
25
|
};
|
|
26
26
|
var _matches$ = matches[0],
|
|
27
27
|
node = _matches$.node,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnnotationTypes } from '@atlaskit/adf-schema/annotation';
|
|
2
|
+
// eslint-disable-next-line @atlaskit/platform/no-barrel-entry-imports
|
|
2
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import { getAnnotationInlineNodeTypes, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils/annotation';
|
|
4
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnnotationTypes } from '@atlaskit/adf-schema/annotation';
|
|
2
|
+
// eslint-disable-next-line @atlaskit/platform/no-barrel-entry-imports
|
|
2
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import { getAnnotationInlineNodeTypes, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils/annotation';
|
|
4
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "28.1.
|
|
3
|
+
"version": "28.1.2",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
32
32
|
"@atlaskit/icon": "^38.0.0",
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
34
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^242.0.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|