@atlaskit/editor-core 193.28.4 → 193.28.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 +8 -0
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/utils/document.js +0 -8
- package/dist/cjs/utils/index.js +0 -38
- package/dist/cjs/utils/nodes.js +0 -30
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/utils/document.js +1 -8
- package/dist/es2019/utils/index.js +1 -3
- package/dist/es2019/utils/nodes.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/utils/document.js +1 -8
- package/dist/esm/utils/index.js +1 -3
- package/dist/esm/utils/nodes.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/utils/document.d.ts +0 -3
- package/dist/types/utils/index.d.ts +1 -3
- package/dist/types/utils/nodes.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/utils/document.d.ts +0 -3
- package/dist/types-ts4.5/utils/index.d.ts +1 -3
- package/dist/types-ts4.5/utils/nodes.d.ts +1 -1
- package/package.json +1 -1
- package/tsconfig.json +2 -1
- package/dist/cjs/utils/clipboard.js +0 -24
- package/dist/cjs/utils/commands.js +0 -22
- package/dist/cjs/utils/dom.js +0 -60
- package/dist/cjs/utils/plugin-state-factory.js +0 -12
- package/dist/cjs/utils/selection.js +0 -38
- package/dist/cjs/utils/slice.js +0 -36
- package/dist/es2019/utils/clipboard.js +0 -1
- package/dist/es2019/utils/commands.js +0 -19
- package/dist/es2019/utils/dom.js +0 -1
- package/dist/es2019/utils/plugin-state-factory.js +0 -1
- package/dist/es2019/utils/selection.js +0 -9
- package/dist/es2019/utils/slice.js +0 -1
- package/dist/esm/utils/clipboard.js +0 -1
- package/dist/esm/utils/commands.js +0 -17
- package/dist/esm/utils/dom.js +0 -1
- package/dist/esm/utils/plugin-state-factory.js +0 -1
- package/dist/esm/utils/selection.js +0 -9
- package/dist/esm/utils/slice.js +0 -1
- package/dist/types/utils/clipboard.d.ts +0 -1
- package/dist/types/utils/commands.d.ts +0 -13
- package/dist/types/utils/dom.d.ts +0 -2
- package/dist/types/utils/plugin-state-factory.d.ts +0 -2
- package/dist/types/utils/selection.d.ts +0 -3
- package/dist/types/utils/slice.d.ts +0 -2
- package/dist/types-ts4.5/utils/clipboard.d.ts +0 -1
- package/dist/types-ts4.5/utils/commands.d.ts +0 -13
- package/dist/types-ts4.5/utils/dom.d.ts +0 -2
- package/dist/types-ts4.5/utils/plugin-state-factory.d.ts +0 -2
- package/dist/types-ts4.5/utils/selection.d.ts +0 -3
- package/dist/types-ts4.5/utils/slice.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 193.28.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#114448](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114448)
|
|
8
|
+
[`68d40145e3e0a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/68d40145e3e0a) -
|
|
9
|
+
Remove unused barrel util files.
|
|
10
|
+
|
|
3
11
|
## 193.28.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -157,7 +157,7 @@ Object.defineProperty(exports, "name", {
|
|
|
157
157
|
Object.defineProperty(exports, "setTextSelection", {
|
|
158
158
|
enumerable: true,
|
|
159
159
|
get: function get() {
|
|
160
|
-
return
|
|
160
|
+
return _utils2.setTextSelection;
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
Object.defineProperty(exports, "version", {
|
|
@@ -181,6 +181,7 @@ var _teamResource = require("@atlaskit/mention/team-resource");
|
|
|
181
181
|
var _annotation = require("@atlaskit/editor-common/annotation");
|
|
182
182
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
183
183
|
var _utils = require("./utils");
|
|
184
|
+
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
184
185
|
var _actions = _interopRequireDefault(require("./actions"));
|
|
185
186
|
var _portalProvider = require("@atlaskit/editor-common/portal-provider");
|
|
186
187
|
var _ContentStyles = require("./ui/ContentStyles");
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "isInEmptyLine", {
|
|
|
12
12
|
return _utils.isInEmptyLine;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
16
15
|
exports.processRawFragmentValue = processRawFragmentValue;
|
|
17
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
18
17
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -32,13 +31,6 @@ function processRawFragmentValue(schema, value, providerFactory, sanitizePrivate
|
|
|
32
31
|
}
|
|
33
32
|
return _model.Fragment.from(adfEntities);
|
|
34
33
|
}
|
|
35
|
-
function nodesBetweenChanged(tr, f, startPos) {
|
|
36
|
-
var stepRange = (0, _utils.getStepRange)(tr);
|
|
37
|
-
if (!stepRange) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
41
|
-
}
|
|
42
34
|
function getNodesCount(node) {
|
|
43
35
|
var count = {};
|
|
44
36
|
node.nodesBetween(0, node.nodeSize - 2, function (node) {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -59,19 +59,7 @@ Object.defineProperty(exports, "isLastItemMediaGroup", {
|
|
|
59
59
|
return _utils.isLastItemMediaGroup;
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
Object.defineProperty(exports, "isLinkMark", {
|
|
63
|
-
enumerable: true,
|
|
64
|
-
get: function get() {
|
|
65
|
-
return _nodes.isLinkMark;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
62
|
exports.isMarkTypeAllowedInCurrentSelection = isMarkTypeAllowedInCurrentSelection;
|
|
69
|
-
Object.defineProperty(exports, "isParagraph", {
|
|
70
|
-
enumerable: true,
|
|
71
|
-
get: function get() {
|
|
72
|
-
return _nodes.isParagraph;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
63
|
Object.defineProperty(exports, "isSelectionInsideLastNodeInDocument", {
|
|
76
64
|
enumerable: true,
|
|
77
65
|
get: function get() {
|
|
@@ -79,12 +67,6 @@ Object.defineProperty(exports, "isSelectionInsideLastNodeInDocument", {
|
|
|
79
67
|
}
|
|
80
68
|
});
|
|
81
69
|
exports.isTemporary = void 0;
|
|
82
|
-
Object.defineProperty(exports, "isText", {
|
|
83
|
-
enumerable: true,
|
|
84
|
-
get: function get() {
|
|
85
|
-
return _nodes.isText;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
70
|
Object.defineProperty(exports, "isTextSelection", {
|
|
89
71
|
enumerable: true,
|
|
90
72
|
get: function get() {
|
|
@@ -103,30 +85,12 @@ Object.defineProperty(exports, "nodeToJSON", {
|
|
|
103
85
|
return _utils.nodeToJSON;
|
|
104
86
|
}
|
|
105
87
|
});
|
|
106
|
-
Object.defineProperty(exports, "nodesBetweenChanged", {
|
|
107
|
-
enumerable: true,
|
|
108
|
-
get: function get() {
|
|
109
|
-
return _document.nodesBetweenChanged;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
88
|
Object.defineProperty(exports, "nonNullable", {
|
|
113
89
|
enumerable: true,
|
|
114
90
|
get: function get() {
|
|
115
91
|
return _utils.nonNullable;
|
|
116
92
|
}
|
|
117
93
|
});
|
|
118
|
-
Object.defineProperty(exports, "setNodeSelection", {
|
|
119
|
-
enumerable: true,
|
|
120
|
-
get: function get() {
|
|
121
|
-
return _selection.setNodeSelection;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
Object.defineProperty(exports, "setTextSelection", {
|
|
125
|
-
enumerable: true,
|
|
126
|
-
get: function get() {
|
|
127
|
-
return _selection.setTextSelection;
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
94
|
exports.stringRepeat = stringRepeat;
|
|
131
95
|
exports.sum = sum;
|
|
132
96
|
Object.defineProperty(exports, "toJSON", {
|
|
@@ -140,8 +104,6 @@ var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
|
140
104
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
141
105
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
142
106
|
var _document = require("./document");
|
|
143
|
-
var _nodes = require("./nodes");
|
|
144
|
-
var _selection = require("./selection");
|
|
145
107
|
var _measureEnum = _interopRequireDefault(require("./performance/measure-enum"));
|
|
146
108
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
147
109
|
function isMarkTypeCompatibleWithMark(markType, mark) {
|
package/dist/cjs/utils/nodes.js
CHANGED
|
@@ -15,42 +15,12 @@ Object.defineProperty(exports, "findChangedNodesFromTransaction", {
|
|
|
15
15
|
return _utils.findChangedNodesFromTransaction;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "isLinkMark", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _utils.isLinkMark;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
18
|
Object.defineProperty(exports, "isNodeSelectedOrInRange", {
|
|
25
19
|
enumerable: true,
|
|
26
20
|
get: function get() {
|
|
27
21
|
return _utils.isNodeSelectedOrInRange;
|
|
28
22
|
}
|
|
29
23
|
});
|
|
30
|
-
Object.defineProperty(exports, "isParagraph", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _utils.isParagraph;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "isSupportedInParent", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function get() {
|
|
39
|
-
return _utils.isSupportedInParent;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "isText", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function get() {
|
|
45
|
-
return _utils.isText;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "isType", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function get() {
|
|
51
|
-
return _utils.isType;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
24
|
Object.defineProperty(exports, "validNode", {
|
|
55
25
|
enumerable: true,
|
|
56
26
|
get: function get() {
|
package/dist/es2019/index.js
CHANGED
|
@@ -30,7 +30,8 @@ export { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
|
|
|
30
30
|
|
|
31
31
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
32
32
|
// Used in editor-test-helpers and mobile bridge
|
|
33
|
-
export {
|
|
33
|
+
export { getNodesCount, measurements } from './utils';
|
|
34
|
+
export { setTextSelection } from '@atlaskit/editor-common/utils';
|
|
34
35
|
export { default as EditorActions } from './actions';
|
|
35
36
|
// Re-export from provider factory to not cause a breaking change
|
|
36
37
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { processRawValue } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { getBreakoutMode } from './node-width';
|
|
4
4
|
export { isInEmptyLine } from '@atlaskit/editor-common/utils';
|
|
@@ -12,13 +12,6 @@ export function processRawFragmentValue(schema, value, providerFactory, sanitize
|
|
|
12
12
|
}
|
|
13
13
|
return Fragment.from(adfEntities);
|
|
14
14
|
}
|
|
15
|
-
export function nodesBetweenChanged(tr, f, startPos) {
|
|
16
|
-
const stepRange = getStepRange(tr);
|
|
17
|
-
if (!stepRange) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
21
|
-
}
|
|
22
15
|
export function getNodesCount(node) {
|
|
23
16
|
let count = {};
|
|
24
17
|
node.nodesBetween(0, node.nodeSize - 2, node => {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { toggleMark } from '@atlaskit/editor-prosemirror/commands';
|
|
2
2
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, toJSON, nodeToJSON } from '@atlaskit/editor-common/utils';
|
|
3
3
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
4
|
-
export {
|
|
5
|
-
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
6
|
-
export { setNodeSelection, setTextSelection } from './selection';
|
|
4
|
+
export { getNodesCount } from './document';
|
|
7
5
|
export { default as measurements } from './performance/measure-enum';
|
|
8
6
|
function isMarkTypeCompatibleWithMark(markType, mark) {
|
|
9
7
|
return !mark.type.excludes(markType) && !markType.excludes(mark.type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { findChangedNodesFromTransaction, validNode, validateNodes,
|
|
1
|
+
export { findChangedNodesFromTransaction, validNode, validateNodes, SelectedState, isNodeSelectedOrInRange } from '@atlaskit/editor-common/utils';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "193.28.
|
|
2
|
+
export const version = "193.28.5";
|
package/dist/esm/index.js
CHANGED
|
@@ -30,7 +30,8 @@ export { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
|
|
|
30
30
|
|
|
31
31
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
32
32
|
// Used in editor-test-helpers and mobile bridge
|
|
33
|
-
export {
|
|
33
|
+
export { getNodesCount, measurements } from './utils';
|
|
34
|
+
export { setTextSelection } from '@atlaskit/editor-common/utils';
|
|
34
35
|
export { default as EditorActions } from './actions';
|
|
35
36
|
// Re-export from provider factory to not cause a breaking change
|
|
36
37
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import {
|
|
2
|
+
import { processRawValue } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { getBreakoutMode } from './node-width';
|
|
5
5
|
export { isInEmptyLine } from '@atlaskit/editor-common/utils';
|
|
@@ -17,13 +17,6 @@ export function processRawFragmentValue(schema, value, providerFactory, sanitize
|
|
|
17
17
|
}
|
|
18
18
|
return Fragment.from(adfEntities);
|
|
19
19
|
}
|
|
20
|
-
export function nodesBetweenChanged(tr, f, startPos) {
|
|
21
|
-
var stepRange = getStepRange(tr);
|
|
22
|
-
if (!stepRange) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
26
|
-
}
|
|
27
20
|
export function getNodesCount(node) {
|
|
28
21
|
var count = {};
|
|
29
22
|
node.nodesBetween(0, node.nodeSize - 2, function (node) {
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { toggleMark } from '@atlaskit/editor-prosemirror/commands';
|
|
2
2
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, toJSON, nodeToJSON } from '@atlaskit/editor-common/utils';
|
|
3
3
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
4
|
-
export {
|
|
5
|
-
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
6
|
-
export { setNodeSelection, setTextSelection } from './selection';
|
|
4
|
+
export { getNodesCount } from './document';
|
|
7
5
|
export { default as measurements } from './performance/measure-enum';
|
|
8
6
|
function isMarkTypeCompatibleWithMark(markType, mark) {
|
|
9
7
|
return !mark.type.excludes(markType) && !markType.excludes(mark.type);
|
package/dist/esm/utils/nodes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { findChangedNodesFromTransaction, validNode, validateNodes,
|
|
1
|
+
export { findChangedNodesFromTransaction, validNode, validateNodes, SelectedState, isNodeSelectedOrInRange } from '@atlaskit/editor-common/utils';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "193.28.
|
|
2
|
+
export var version = "193.28.5";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -29,7 +29,8 @@ export type { AnnotationProviders, InlineCommentAnnotationProvider, InlineCommen
|
|
|
29
29
|
export type { TypeAheadItem } from '@atlaskit/editor-common/provider-factory';
|
|
30
30
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, } from '@atlaskit/editor-common/analytics';
|
|
31
31
|
export type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
32
|
-
export {
|
|
32
|
+
export { getNodesCount, measurements } from './utils';
|
|
33
|
+
export { setTextSelection } from '@atlaskit/editor-common/utils';
|
|
33
34
|
export type { Command, EditorPlugin, EditorProps, EditorInstance, CommandDispatch } from './types';
|
|
34
35
|
export { default as EditorActions } from './actions';
|
|
35
36
|
export type { MacroProvider, MacroAttributes, ExtensionType, CardProvider, } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -4,11 +4,8 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
4
4
|
import type { ReplaceRawValue, Transformer } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
8
7
|
export { isInEmptyLine } from '@atlaskit/editor-common/utils';
|
|
9
8
|
export declare function processRawFragmentValue(schema: Schema, value?: ReplaceRawValue[], providerFactory?: ProviderFactory, sanitizePrivateContent?: boolean, contentTransformer?: Transformer<string>, dispatchAnalyticsEvent?: DispatchAnalyticsEvent): Fragment | undefined;
|
|
10
|
-
export type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
11
|
-
export declare function nodesBetweenChanged(tr: Transaction | ReadonlyTransaction, f: ChangedFn, startPos?: number): void;
|
|
12
9
|
export declare function getNodesCount(node: Node): Record<string, number>;
|
|
13
10
|
/**
|
|
14
11
|
* Returns a set of active child breakout modes
|
|
@@ -3,9 +3,7 @@ import type { MarkType, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, toJSON, nodeToJSON, } from '@atlaskit/editor-common/utils';
|
|
5
5
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
6
|
-
export {
|
|
7
|
-
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
8
|
-
export { setNodeSelection, setTextSelection } from './selection';
|
|
6
|
+
export { getNodesCount } from './document';
|
|
9
7
|
export type { JSONDocNode };
|
|
10
8
|
export { default as measurements } from './performance/measure-enum';
|
|
11
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { findChangedNodesFromTransaction, validNode, validateNodes,
|
|
1
|
+
export { findChangedNodesFromTransaction, validNode, validateNodes, SelectedState, isNodeSelectedOrInRange, } from '@atlaskit/editor-common/utils';
|
|
@@ -29,7 +29,8 @@ export type { AnnotationProviders, InlineCommentAnnotationProvider, InlineCommen
|
|
|
29
29
|
export type { TypeAheadItem } from '@atlaskit/editor-common/provider-factory';
|
|
30
30
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, } from '@atlaskit/editor-common/analytics';
|
|
31
31
|
export type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
32
|
-
export {
|
|
32
|
+
export { getNodesCount, measurements } from './utils';
|
|
33
|
+
export { setTextSelection } from '@atlaskit/editor-common/utils';
|
|
33
34
|
export type { Command, EditorPlugin, EditorProps, EditorInstance, CommandDispatch } from './types';
|
|
34
35
|
export { default as EditorActions } from './actions';
|
|
35
36
|
export type { MacroProvider, MacroAttributes, ExtensionType, CardProvider, } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -4,11 +4,8 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
4
4
|
import type { ReplaceRawValue, Transformer } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
8
7
|
export { isInEmptyLine } from '@atlaskit/editor-common/utils';
|
|
9
8
|
export declare function processRawFragmentValue(schema: Schema, value?: ReplaceRawValue[], providerFactory?: ProviderFactory, sanitizePrivateContent?: boolean, contentTransformer?: Transformer<string>, dispatchAnalyticsEvent?: DispatchAnalyticsEvent): Fragment | undefined;
|
|
10
|
-
export type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
11
|
-
export declare function nodesBetweenChanged(tr: Transaction | ReadonlyTransaction, f: ChangedFn, startPos?: number): void;
|
|
12
9
|
export declare function getNodesCount(node: Node): Record<string, number>;
|
|
13
10
|
/**
|
|
14
11
|
* Returns a set of active child breakout modes
|
|
@@ -3,9 +3,7 @@ import type { MarkType, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, toJSON, nodeToJSON, } from '@atlaskit/editor-common/utils';
|
|
5
5
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
6
|
-
export {
|
|
7
|
-
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
8
|
-
export { setNodeSelection, setTextSelection } from './selection';
|
|
6
|
+
export { getNodesCount } from './document';
|
|
9
7
|
export type { JSONDocNode };
|
|
10
8
|
export { default as measurements } from './performance/measure-enum';
|
|
11
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { findChangedNodesFromTransaction, validNode, validateNodes,
|
|
1
|
+
export { findChangedNodesFromTransaction, validNode, validateNodes, SelectedState, isNodeSelectedOrInRange, } from '@atlaskit/editor-common/utils';
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"./examples/**/*.tsx",
|
|
10
10
|
"./example-helpers/**/*.ts",
|
|
11
11
|
"./example-helpers/**/*.tsx",
|
|
12
|
-
"./playwright/**/*.ts"
|
|
12
|
+
"./playwright/**/*.ts"
|
|
13
|
+
],
|
|
13
14
|
"compilerOptions": {
|
|
14
15
|
"baseUrl": "./",
|
|
15
16
|
"noErrorTruncation": true
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "copyHTMLToClipboard", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _clipboard.copyHTMLToClipboard;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "copyHTMLToClipboardPolyfill", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _clipboard.copyHTMLToClipboardPolyfill;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "copyToClipboard", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _clipboard.copyToClipboard;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _clipboard = require("@atlaskit/editor-common/clipboard");
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isNthParentOfType = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Creates a filter that checks if the node at a given number of parents above the current
|
|
9
|
-
* selection is of the correct node type.
|
|
10
|
-
*
|
|
11
|
-
* @param nodeType The node type to compare the nth parent against
|
|
12
|
-
* @param depthAway How many levels above the current node to check against. 0 refers to
|
|
13
|
-
* the current selection's parent, which will be the containing node when the selection
|
|
14
|
-
* is usually inside the text content.
|
|
15
|
-
*/
|
|
16
|
-
var isNthParentOfType = exports.isNthParentOfType = function isNthParentOfType(nodeType, depthAway) {
|
|
17
|
-
return function (state) {
|
|
18
|
-
var $from = state.selection.$from;
|
|
19
|
-
var parent = $from.node($from.depth - depthAway);
|
|
20
|
-
return !!parent && parent.type === state.schema.nodes[nodeType];
|
|
21
|
-
};
|
|
22
|
-
};
|
package/dist/cjs/utils/dom.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "closest", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _utils.closest;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "closestElement", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _utils.closestElement;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "containsClassName", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _utils.containsClassName;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "mapElem", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _utils.mapElem;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "maphElem", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _utils.maphElem;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "parsePx", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function get() {
|
|
39
|
-
return _utils.parsePx;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "removeNestedEmptyEls", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function get() {
|
|
45
|
-
return _utils.removeNestedEmptyEls;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "unwrap", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function get() {
|
|
51
|
-
return _utils.unwrap;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "walkUpTreeUntil", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function get() {
|
|
57
|
-
return _utils.walkUpTreeUntil;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "pluginFactory", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _utils.pluginFactory;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isValidPosition = void 0;
|
|
7
|
-
Object.defineProperty(exports, "setAllSelection", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _utils.setAllSelection;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "setCellSelection", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _utils.setCellSelection;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "setNodeSelection", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _utils.setNodeSelection;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "setTextSelection", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _utils.setTextSelection;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
32
|
-
// checks if the given position is within the ProseMirror document
|
|
33
|
-
var isValidPosition = exports.isValidPosition = function isValidPosition(pos, state) {
|
|
34
|
-
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
return false;
|
|
38
|
-
};
|
package/dist/cjs/utils/slice.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "flatmap", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _utils.flatmap;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "getFragmentBackingArray", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _utils.getFragmentBackingArray;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "mapChildren", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _utils.mapChildren;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "mapFragment", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _utils.mapFragment;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "mapSlice", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _utils.mapSlice;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { copyToClipboard, copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '@atlaskit/editor-common/clipboard';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a filter that checks if the node at a given number of parents above the current
|
|
3
|
-
* selection is of the correct node type.
|
|
4
|
-
*
|
|
5
|
-
* @param nodeType The node type to compare the nth parent against
|
|
6
|
-
* @param depthAway How many levels above the current node to check against. 0 refers to
|
|
7
|
-
* the current selection's parent, which will be the containing node when the selection
|
|
8
|
-
* is usually inside the text content.
|
|
9
|
-
*/
|
|
10
|
-
const isNthParentOfType = (nodeType, depthAway) => {
|
|
11
|
-
return state => {
|
|
12
|
-
const {
|
|
13
|
-
$from
|
|
14
|
-
} = state.selection;
|
|
15
|
-
const parent = $from.node($from.depth - depthAway);
|
|
16
|
-
return !!parent && parent.type === state.schema.nodes[nodeType];
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export { isNthParentOfType };
|
package/dist/es2019/utils/dom.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { walkUpTreeUntil, unwrap, removeNestedEmptyEls, containsClassName, closest, closestElement, parsePx, mapElem, maphElem } from '@atlaskit/editor-common/utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { setNodeSelection, setTextSelection, setAllSelection, setCellSelection } from '@atlaskit/editor-common/utils';
|
|
2
|
-
|
|
3
|
-
// checks if the given position is within the ProseMirror document
|
|
4
|
-
export const isValidPosition = (pos, state) => {
|
|
5
|
-
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
return false;
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren } from '@atlaskit/editor-common/utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { copyToClipboard, copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '@atlaskit/editor-common/clipboard';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a filter that checks if the node at a given number of parents above the current
|
|
3
|
-
* selection is of the correct node type.
|
|
4
|
-
*
|
|
5
|
-
* @param nodeType The node type to compare the nth parent against
|
|
6
|
-
* @param depthAway How many levels above the current node to check against. 0 refers to
|
|
7
|
-
* the current selection's parent, which will be the containing node when the selection
|
|
8
|
-
* is usually inside the text content.
|
|
9
|
-
*/
|
|
10
|
-
var isNthParentOfType = function isNthParentOfType(nodeType, depthAway) {
|
|
11
|
-
return function (state) {
|
|
12
|
-
var $from = state.selection.$from;
|
|
13
|
-
var parent = $from.node($from.depth - depthAway);
|
|
14
|
-
return !!parent && parent.type === state.schema.nodes[nodeType];
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export { isNthParentOfType };
|
package/dist/esm/utils/dom.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { walkUpTreeUntil, unwrap, removeNestedEmptyEls, containsClassName, closest, closestElement, parsePx, mapElem, maphElem } from '@atlaskit/editor-common/utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { setNodeSelection, setTextSelection, setAllSelection, setCellSelection } from '@atlaskit/editor-common/utils';
|
|
2
|
-
|
|
3
|
-
// checks if the given position is within the ProseMirror document
|
|
4
|
-
export var isValidPosition = function isValidPosition(pos, state) {
|
|
5
|
-
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
return false;
|
|
9
|
-
};
|
package/dist/esm/utils/slice.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren } from '@atlaskit/editor-common/utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { copyToClipboard, copyHTMLToClipboard, copyHTMLToClipboardPolyfill, } from '@atlaskit/editor-common/clipboard';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a filter that checks if the node at a given number of parents above the current
|
|
5
|
-
* selection is of the correct node type.
|
|
6
|
-
*
|
|
7
|
-
* @param nodeType The node type to compare the nth parent against
|
|
8
|
-
* @param depthAway How many levels above the current node to check against. 0 refers to
|
|
9
|
-
* the current selection's parent, which will be the containing node when the selection
|
|
10
|
-
* is usually inside the text content.
|
|
11
|
-
*/
|
|
12
|
-
declare const isNthParentOfType: (nodeType: string, depthAway: number) => (state: EditorState, view?: EditorView) => boolean;
|
|
13
|
-
export { isNthParentOfType };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export { setNodeSelection, setTextSelection, setAllSelection, setCellSelection, } from '@atlaskit/editor-common/utils';
|
|
3
|
-
export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { copyToClipboard, copyHTMLToClipboard, copyHTMLToClipboardPolyfill, } from '@atlaskit/editor-common/clipboard';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a filter that checks if the node at a given number of parents above the current
|
|
5
|
-
* selection is of the correct node type.
|
|
6
|
-
*
|
|
7
|
-
* @param nodeType The node type to compare the nth parent against
|
|
8
|
-
* @param depthAway How many levels above the current node to check against. 0 refers to
|
|
9
|
-
* the current selection's parent, which will be the containing node when the selection
|
|
10
|
-
* is usually inside the text content.
|
|
11
|
-
*/
|
|
12
|
-
declare const isNthParentOfType: (nodeType: string, depthAway: number) => (state: EditorState, view?: EditorView) => boolean;
|
|
13
|
-
export { isNthParentOfType };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export { setNodeSelection, setTextSelection, setAllSelection, setCellSelection, } from '@atlaskit/editor-common/utils';
|
|
3
|
-
export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
|