@atlaskit/editor-core 187.30.1 → 187.30.3
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 +6 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -2
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +2 -3
- package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +1 -2
- package/dist/cjs/plugins/base/pm-plugins/newline-preserve-marks.js +1 -2
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +1 -2
- package/dist/cjs/utils/document.js +0 -5
- package/dist/cjs/utils/index.js +0 -6
- package/dist/cjs/utils/performance/track-transactions.js +1 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +2 -3
- package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +1 -2
- package/dist/es2019/plugins/base/pm-plugins/newline-preserve-marks.js +1 -2
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +1 -1
- package/dist/es2019/utils/document.js +0 -1
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/performance/track-transactions.js +1 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +2 -3
- package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +1 -2
- package/dist/esm/plugins/base/pm-plugins/newline-preserve-marks.js +1 -2
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +1 -1
- package/dist/esm/utils/document.js +0 -3
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/performance/track-transactions.js +1 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +1 -1
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +1 -1
- package/dist/types/utils/document.d.ts +0 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/performance/track-transactions.d.ts +1 -1
- package/dist/types-ts4.5/plugins/base/pm-plugins/frozen-editor.d.ts +1 -1
- package/dist/types-ts4.5/plugins/base/utils/input-latency-tracking.d.ts +1 -1
- package/dist/types-ts4.5/utils/document.d.ts +0 -1
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/performance/track-transactions.d.ts +1 -1
- package/package.json +3 -3
- package/dist/cjs/utils/count-nodes.js +0 -37
- package/dist/cjs/utils/performance/get-performance-timing.js +0 -17
- package/dist/es2019/utils/count-nodes.js +0 -31
- package/dist/es2019/utils/performance/get-performance-timing.js +0 -8
- package/dist/esm/utils/count-nodes.js +0 -31
- package/dist/esm/utils/performance/get-performance-timing.js +0 -10
- package/dist/types/utils/count-nodes.d.ts +0 -8
- package/dist/types/utils/performance/get-performance-timing.d.ts +0 -8
- package/dist/types-ts4.5/utils/count-nodes.d.ts +0 -8
- package/dist/types-ts4.5/utils/performance/get-performance-timing.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.30.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f68eb1b1731`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f68eb1b1731) - Move common functions from `editor-core` to `editor-common` in preparation for `base` plugin extraction
|
|
8
|
+
|
|
3
9
|
## 187.30.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -36,7 +36,6 @@ var _createSchema = require("./create-schema");
|
|
|
36
36
|
var _pluginPerformanceObserver = require("../utils/performance/plugin-performance-observer");
|
|
37
37
|
var _getParticipantsCount = require("../plugins/collab-edit/get-participants-count");
|
|
38
38
|
var _trackTransactions = require("../utils/performance/track-transactions");
|
|
39
|
-
var _countNodes2 = require("../utils/count-nodes");
|
|
40
39
|
var _consts = require("./consts");
|
|
41
40
|
var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
|
|
42
41
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
@@ -609,7 +608,7 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
609
608
|
}, {
|
|
610
609
|
key: "countNodes",
|
|
611
610
|
value: function countNodes() {
|
|
612
|
-
return (0,
|
|
611
|
+
return (0, _utils.countNodes)(this.editorState);
|
|
613
612
|
}
|
|
614
613
|
}, {
|
|
615
614
|
key: "isTransactionTrackingExplicitlyDisabled",
|
|
@@ -10,9 +10,8 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
12
|
var _ufo = require("@atlaskit/editor-common/ufo");
|
|
13
|
-
var _analytics = require("
|
|
13
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _getParticipantsCount = require("../../collab-edit/get-participants-count");
|
|
15
|
-
var _countNodes = require("../../../utils/count-nodes");
|
|
16
15
|
var _contextIdentifier = require("./context-identifier");
|
|
17
16
|
var _frozenEditor = require("../utils/frozen-editor");
|
|
18
17
|
var _inputLatencyTracking = _interopRequireDefault(require("../utils/input-latency-tracking"));
|
|
@@ -73,7 +72,7 @@ var _default = function _default(dispatchAnalyticsEvent, inputTracking, browserF
|
|
|
73
72
|
if (state === prevNodeCountState) {
|
|
74
73
|
return prevNodeCount;
|
|
75
74
|
}
|
|
76
|
-
prevNodeCount = allowCountNodes ? (0,
|
|
75
|
+
prevNodeCount = allowCountNodes ? (0, _utils.countNodes)(state) : {};
|
|
77
76
|
prevNodeCountState = state;
|
|
78
77
|
return prevNodeCount;
|
|
79
78
|
};
|
|
@@ -8,7 +8,6 @@ var _view = require("@atlaskit/editor-prosemirror/view");
|
|
|
8
8
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
-
var _utils2 = require("../../../utils");
|
|
12
11
|
var inlineCursorTargetStateKey = new _state.PluginKey('inlineCursorTargetPlugin');
|
|
13
12
|
exports.inlineCursorTargetStateKey = inlineCursorTargetStateKey;
|
|
14
13
|
var isInlineNodeView = function isInlineNodeView(node) {
|
|
@@ -39,7 +38,7 @@ var _default = function _default() {
|
|
|
39
38
|
// To prevent blocking the selection, we check handleDOMEvents and add meta to
|
|
40
39
|
// the transaction to prevent the plugin from making cursor target decorations.
|
|
41
40
|
var safariShiftSelection = tr.getMeta(inlineCursorTargetStateKey);
|
|
42
|
-
if (selection && (0,
|
|
41
|
+
if (selection && (0, _utils.isTextSelection)(selection) && !safariShiftSelection) {
|
|
43
42
|
var hasInlineNodeViewAfter = isInlineNodeView($from.nodeAfter);
|
|
44
43
|
var hasInlineNodeViewBefore = isInlineNodeView($from.nodeBefore);
|
|
45
44
|
var isAtStartAndInlineNodeViewAfter = $from.parentOffset === 0 && isInlineNodeView($from.nodeAfter);
|
|
@@ -8,7 +8,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
9
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
-
var _utils2 = require("../../../utils");
|
|
12
11
|
var newlinePreserveMarksKey = new _state.PluginKey('newlinePreserveMarksPlugin');
|
|
13
12
|
exports.newlinePreserveMarksKey = newlinePreserveMarksKey;
|
|
14
13
|
var isSelectionAligned = function isSelectionAligned(state) {
|
|
@@ -27,7 +26,7 @@ var _default = function _default() {
|
|
|
27
26
|
key: newlinePreserveMarksKey,
|
|
28
27
|
props: {
|
|
29
28
|
handleKeyDown: (0, _keymap.keydownHandler)({
|
|
30
|
-
Enter: (0, _utils.filterCommand)([
|
|
29
|
+
Enter: (0, _utils.filterCommand)([_utils.isSelectionEndOfParagraph, isSelectionAligned], splitBlockPreservingMarks)
|
|
31
30
|
})
|
|
32
31
|
}
|
|
33
32
|
});
|
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _getPerformanceTiming = require("../../../utils/performance/get-performance-timing");
|
|
12
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
12
|
var InputLatencyTracker = /*#__PURE__*/function () {
|
|
14
13
|
function InputLatencyTracker(_ref) {
|
|
@@ -48,7 +47,7 @@ var InputLatencyTracker = /*#__PURE__*/function () {
|
|
|
48
47
|
return;
|
|
49
48
|
}
|
|
50
49
|
var isSlow = false;
|
|
51
|
-
var time = (0,
|
|
50
|
+
var time = (0, _utils.getTimeSince)(currentStart);
|
|
52
51
|
_this.push(time);
|
|
53
52
|
if (time > _this.slowThreshold) {
|
|
54
53
|
var _this$onSlowInput;
|
|
@@ -16,7 +16,6 @@ exports.getChildBreakoutModes = getChildBreakoutModes;
|
|
|
16
16
|
exports.getNodesCount = getNodesCount;
|
|
17
17
|
exports.isInEmptyLine = isInEmptyLine;
|
|
18
18
|
exports.isNodeEmpty = isNodeEmpty;
|
|
19
|
-
exports.isSelectionEndOfParagraph = void 0;
|
|
20
19
|
exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
21
20
|
exports.processRawFragmentValue = processRawFragmentValue;
|
|
22
21
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -70,10 +69,6 @@ function processRawFragmentValue(schema, value, providerFactory, sanitizePrivate
|
|
|
70
69
|
}
|
|
71
70
|
return _model.Fragment.from(adfEntities);
|
|
72
71
|
}
|
|
73
|
-
var isSelectionEndOfParagraph = function isSelectionEndOfParagraph(state) {
|
|
74
|
-
return state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
|
|
75
|
-
};
|
|
76
|
-
exports.isSelectionEndOfParagraph = isSelectionEndOfParagraph;
|
|
77
72
|
function getChangedNodesIn(_ref2) {
|
|
78
73
|
var tr = _ref2.tr,
|
|
79
74
|
doc = _ref2.doc;
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -88,12 +88,6 @@ Object.defineProperty(exports, "isParagraph", {
|
|
|
88
88
|
return _nodes.isParagraph;
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
Object.defineProperty(exports, "isSelectionEndOfParagraph", {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
get: function get() {
|
|
94
|
-
return _document.isSelectionEndOfParagraph;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
91
|
Object.defineProperty(exports, "isSelectionInsideLastNodeInDocument", {
|
|
98
92
|
enumerable: true,
|
|
99
93
|
get: function get() {
|
|
@@ -9,7 +9,6 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
|
-
var _getPerformanceTiming = require("./get-performance-timing");
|
|
13
12
|
var EVENT_NAME_STATE_APPLY = "\uD83E\uDD89 EditorView::state::apply";
|
|
14
13
|
exports.EVENT_NAME_STATE_APPLY = EVENT_NAME_STATE_APPLY;
|
|
15
14
|
var EVENT_NAME_UPDATE_STATE = "\uD83E\uDD89 EditorView::updateState";
|
|
@@ -71,7 +70,7 @@ var TransactionTracker = /*#__PURE__*/function () {
|
|
|
71
70
|
}
|
|
72
71
|
var startTime = _this.measureMap.get(measureName);
|
|
73
72
|
if (startTime) {
|
|
74
|
-
var _duration = (0,
|
|
73
|
+
var _duration = (0, _utils.getTimeSince)(startTime);
|
|
75
74
|
_this.measureMap.delete(measureName);
|
|
76
75
|
if (onMeasureComplete) {
|
|
77
76
|
onMeasureComplete(_duration, startTime);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.30.
|
|
9
|
+
var version = "187.30.3";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -22,7 +22,7 @@ import { createSchema } from './create-schema';
|
|
|
22
22
|
import { PluginPerformanceObserver } from '../utils/performance/plugin-performance-observer';
|
|
23
23
|
import { getParticipantsCount } from '../plugins/collab-edit/get-participants-count';
|
|
24
24
|
import { EVENT_NAME_DISPATCH_TRANSACTION, EVENT_NAME_STATE_APPLY, EVENT_NAME_UPDATE_STATE, EVENT_NAME_VIEW_STATE_UPDATED, EVENT_NAME_ON_CHANGE, TransactionTracker } from '../utils/performance/track-transactions';
|
|
25
|
-
import { countNodes } from '
|
|
25
|
+
import { countNodes } from '@atlaskit/editor-common/utils';
|
|
26
26
|
import { PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, DEFAULT_SAMPLING_RATE_VALID_TRANSACTIONS } from './consts';
|
|
27
27
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
28
28
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { isPerformanceObserverAvailable, isPerformanceAPIAvailable, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import { isPerformanceObserverAvailable, isPerformanceAPIAvailable, getAnalyticsEventSeverity, countNodes } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
5
|
-
import { ACTION, ACTION_SUBJECT, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE } from '
|
|
5
|
+
import { ACTION, ACTION_SUBJECT, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { getParticipantsCount } from '../../collab-edit/get-participants-count';
|
|
7
|
-
import { countNodes } from '../../../utils/count-nodes';
|
|
8
7
|
import { getContextIdentifier } from './context-identifier';
|
|
9
8
|
import { setInteractionType } from '../utils/frozen-editor';
|
|
10
9
|
import InputLatencyTracker from '../utils/input-latency-tracking';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { ZERO_WIDTH_SPACE, browser } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { isTextSelection } from '../../../utils';
|
|
4
|
+
import { ZERO_WIDTH_SPACE, browser, isTextSelection } from '@atlaskit/editor-common/utils';
|
|
6
5
|
export const inlineCursorTargetStateKey = new PluginKey('inlineCursorTargetPlugin');
|
|
7
6
|
export const isInlineNodeView = node => {
|
|
8
7
|
return node && node.type.isInline && !node.type.isText;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
|
-
import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { isSelectionEndOfParagraph } from '../../../utils';
|
|
4
|
+
import { filterCommand as filter, isSelectionEndOfParagraph } from '@atlaskit/editor-common/utils';
|
|
6
5
|
export const newlinePreserveMarksKey = new PluginKey('newlinePreserveMarksPlugin');
|
|
7
6
|
const isSelectionAligned = state => !!state.selection.$to.parent.marks.find(m => m.type === state.schema.marks.alignment);
|
|
8
7
|
const splitBlockPreservingMarks = (state, dispatch) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { getTimeSince } from '
|
|
2
|
+
import { getTimeSince } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils';
|
|
4
4
|
export default class InputLatencyTracker {
|
|
5
5
|
constructor({
|
|
@@ -47,7 +47,6 @@ export function processRawFragmentValue(schema, value, providerFactory, sanitize
|
|
|
47
47
|
}
|
|
48
48
|
return Fragment.from(adfEntities);
|
|
49
49
|
}
|
|
50
|
-
export const isSelectionEndOfParagraph = state => state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
|
|
51
50
|
export function getChangedNodesIn({
|
|
52
51
|
tr,
|
|
53
52
|
doc
|
|
@@ -4,7 +4,7 @@ import { FakeTextCursorSelection } from '../plugins/fake-text-cursor/cursor';
|
|
|
4
4
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem } from '@atlaskit/editor-common/utils';
|
|
6
6
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
7
|
-
export { isNodeEmpty, findFarthestParentNode,
|
|
7
|
+
export { isNodeEmpty, findFarthestParentNode, nodesBetweenChanged, getNodesCount } from './document';
|
|
8
8
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
9
9
|
export { setNodeSelection, setTextSelection } from './selection';
|
|
10
10
|
export { default as measurements } from './performance/measure-enum';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { isPerformanceAPIAvailable, startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import { getTimeSince } from './get-performance-timing';
|
|
2
|
+
import { isPerformanceAPIAvailable, startMeasure, stopMeasure, getTimeSince } from '@atlaskit/editor-common/utils';
|
|
4
3
|
export const EVENT_NAME_STATE_APPLY = `🦉 EditorView::state::apply`;
|
|
5
4
|
export const EVENT_NAME_UPDATE_STATE = `🦉 EditorView::updateState`;
|
|
6
5
|
export const EVENT_NAME_VIEW_STATE_UPDATED = `🦉 EditorView::onEditorViewStateUpdated`;
|
|
@@ -33,7 +33,7 @@ import { createSchema } from './create-schema';
|
|
|
33
33
|
import { PluginPerformanceObserver } from '../utils/performance/plugin-performance-observer';
|
|
34
34
|
import { getParticipantsCount } from '../plugins/collab-edit/get-participants-count';
|
|
35
35
|
import { EVENT_NAME_DISPATCH_TRANSACTION, EVENT_NAME_STATE_APPLY, EVENT_NAME_UPDATE_STATE, EVENT_NAME_VIEW_STATE_UPDATED, EVENT_NAME_ON_CHANGE, TransactionTracker } from '../utils/performance/track-transactions';
|
|
36
|
-
import { countNodes as _countNodes } from '
|
|
36
|
+
import { countNodes as _countNodes } from '@atlaskit/editor-common/utils';
|
|
37
37
|
import { PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, DEFAULT_SAMPLING_RATE_VALID_TRANSACTIONS } from './consts';
|
|
38
38
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
39
39
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
@@ -3,11 +3,10 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { isPerformanceObserverAvailable, isPerformanceAPIAvailable, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { isPerformanceObserverAvailable, isPerformanceAPIAvailable, getAnalyticsEventSeverity, countNodes } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
8
|
-
import { ACTION, ACTION_SUBJECT, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE } from '
|
|
8
|
+
import { ACTION, ACTION_SUBJECT, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { getParticipantsCount } from '../../collab-edit/get-participants-count';
|
|
10
|
-
import { countNodes } from '../../../utils/count-nodes';
|
|
11
10
|
import { getContextIdentifier } from './context-identifier';
|
|
12
11
|
import { setInteractionType } from '../utils/frozen-editor';
|
|
13
12
|
import InputLatencyTracker from '../utils/input-latency-tracking';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { ZERO_WIDTH_SPACE, browser } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { isTextSelection } from '../../../utils';
|
|
4
|
+
import { ZERO_WIDTH_SPACE, browser, isTextSelection } from '@atlaskit/editor-common/utils';
|
|
6
5
|
export var inlineCursorTargetStateKey = new PluginKey('inlineCursorTargetPlugin');
|
|
7
6
|
export var isInlineNodeView = function isInlineNodeView(node) {
|
|
8
7
|
return node && node.type.isInline && !node.type.isText;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
|
-
import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { isSelectionEndOfParagraph } from '../../../utils';
|
|
4
|
+
import { filterCommand as filter, isSelectionEndOfParagraph } from '@atlaskit/editor-common/utils';
|
|
6
5
|
export var newlinePreserveMarksKey = new PluginKey('newlinePreserveMarksPlugin');
|
|
7
6
|
var isSelectionAligned = function isSelectionAligned(state) {
|
|
8
7
|
return !!state.selection.$to.parent.marks.find(function (m) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
import { getTimeSince } from '
|
|
4
|
+
import { getTimeSince } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils';
|
|
6
6
|
var InputLatencyTracker = /*#__PURE__*/function () {
|
|
7
7
|
function InputLatencyTracker(_ref) {
|
|
@@ -51,9 +51,6 @@ export function processRawFragmentValue(schema, value, providerFactory, sanitize
|
|
|
51
51
|
}
|
|
52
52
|
return Fragment.from(adfEntities);
|
|
53
53
|
}
|
|
54
|
-
export var isSelectionEndOfParagraph = function isSelectionEndOfParagraph(state) {
|
|
55
|
-
return state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
|
|
56
|
-
};
|
|
57
54
|
export function getChangedNodesIn(_ref2) {
|
|
58
55
|
var tr = _ref2.tr,
|
|
59
56
|
doc = _ref2.doc;
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { FakeTextCursorSelection } from '../plugins/fake-text-cursor/cursor';
|
|
|
4
4
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem } from '@atlaskit/editor-common/utils';
|
|
6
6
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
7
|
-
export { isNodeEmpty, findFarthestParentNode,
|
|
7
|
+
export { isNodeEmpty, findFarthestParentNode, nodesBetweenChanged, getNodesCount } from './document';
|
|
8
8
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
9
9
|
export { setNodeSelection, setTextSelection } from './selection';
|
|
10
10
|
export { default as measurements } from './performance/measure-enum';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
import { isPerformanceAPIAvailable, startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { getTimeSince } from './get-performance-timing';
|
|
4
|
+
import { isPerformanceAPIAvailable, startMeasure, stopMeasure, getTimeSince } from '@atlaskit/editor-common/utils';
|
|
6
5
|
export var EVENT_NAME_STATE_APPLY = "\uD83E\uDD89 EditorView::state::apply";
|
|
7
6
|
export var EVENT_NAME_UPDATE_STATE = "\uD83E\uDD89 EditorView::updateState";
|
|
8
7
|
export var EVENT_NAME_VIEW_STATE_UPDATED = "\uD83E\uDD89 EditorView::onEditorViewStateUpdated";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { DispatchAnalyticsEvent } from '
|
|
3
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { InputTracking, BrowserFreezetracking } from '../../../types/performance-tracking';
|
|
5
5
|
export declare const frozenEditorPluginKey: PluginKey<any>;
|
|
6
6
|
export declare const DEFAULT_FREEZE_THRESHOLD = 600;
|
|
@@ -12,7 +12,6 @@ export { findFarthestParentNode } from '@atlaskit/editor-common/utils';
|
|
|
12
12
|
export declare function isNodeEmpty(node?: Node): boolean;
|
|
13
13
|
export declare function isInEmptyLine(state: EditorState): boolean;
|
|
14
14
|
export declare function processRawFragmentValue(schema: Schema, value?: ReplaceRawValue[], providerFactory?: ProviderFactory, sanitizePrivateContent?: boolean, contentTransformer?: Transformer<string>, dispatchAnalyticsEvent?: DispatchAnalyticsEvent): Fragment | undefined;
|
|
15
|
-
export declare const isSelectionEndOfParagraph: (state: EditorState) => boolean;
|
|
16
15
|
export type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
17
16
|
export declare function getChangedNodesIn({ tr, doc, }: {
|
|
18
17
|
tr: ReadonlyTransaction | Transaction;
|
|
@@ -3,7 +3,7 @@ import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state'
|
|
|
3
3
|
import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
|
|
4
4
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, } from '@atlaskit/editor-common/utils';
|
|
5
5
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
6
|
-
export { isNodeEmpty, findFarthestParentNode,
|
|
6
|
+
export { isNodeEmpty, findFarthestParentNode, nodesBetweenChanged, getNodesCount, } from './document';
|
|
7
7
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
8
8
|
export { setNodeSelection, setTextSelection } from './selection';
|
|
9
9
|
export type { JSONDocNode };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionTracking } from '../../types/performance-tracking';
|
|
1
|
+
import type { TransactionTracking } from '../../types/performance-tracking';
|
|
2
2
|
export declare const EVENT_NAME_STATE_APPLY = "\uD83E\uDD89 EditorView::state::apply";
|
|
3
3
|
export declare const EVENT_NAME_UPDATE_STATE = "\uD83E\uDD89 EditorView::updateState";
|
|
4
4
|
export declare const EVENT_NAME_VIEW_STATE_UPDATED = "\uD83E\uDD89 EditorView::onEditorViewStateUpdated";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { DispatchAnalyticsEvent } from '
|
|
3
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { InputTracking, BrowserFreezetracking } from '../../../types/performance-tracking';
|
|
5
5
|
export declare const frozenEditorPluginKey: PluginKey<any>;
|
|
6
6
|
export declare const DEFAULT_FREEZE_THRESHOLD = 600;
|
|
@@ -12,7 +12,6 @@ export { findFarthestParentNode } from '@atlaskit/editor-common/utils';
|
|
|
12
12
|
export declare function isNodeEmpty(node?: Node): boolean;
|
|
13
13
|
export declare function isInEmptyLine(state: EditorState): boolean;
|
|
14
14
|
export declare function processRawFragmentValue(schema: Schema, value?: ReplaceRawValue[], providerFactory?: ProviderFactory, sanitizePrivateContent?: boolean, contentTransformer?: Transformer<string>, dispatchAnalyticsEvent?: DispatchAnalyticsEvent): Fragment | undefined;
|
|
15
|
-
export declare const isSelectionEndOfParagraph: (state: EditorState) => boolean;
|
|
16
15
|
export type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
17
16
|
export declare function getChangedNodesIn({ tr, doc, }: {
|
|
18
17
|
tr: ReadonlyTransaction | Transaction;
|
|
@@ -3,7 +3,7 @@ import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state'
|
|
|
3
3
|
import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
|
|
4
4
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, } from '@atlaskit/editor-common/utils';
|
|
5
5
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
6
|
-
export { isNodeEmpty, findFarthestParentNode,
|
|
6
|
+
export { isNodeEmpty, findFarthestParentNode, nodesBetweenChanged, getNodesCount, } from './document';
|
|
7
7
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
8
8
|
export { setNodeSelection, setTextSelection } from './selection';
|
|
9
9
|
export type { JSONDocNode };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransactionTracking } from '../../types/performance-tracking';
|
|
1
|
+
import type { TransactionTracking } from '../../types/performance-tracking';
|
|
2
2
|
export declare const EVENT_NAME_STATE_APPLY = "\uD83E\uDD89 EditorView::state::apply";
|
|
3
3
|
export declare const EVENT_NAME_UPDATE_STATE = "\uD83E\uDD89 EditorView::updateState";
|
|
4
4
|
export declare const EVENT_NAME_VIEW_STATE_UPDATED = "\uD83E\uDD89 EditorView::onEditorViewStateUpdated";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.30.
|
|
3
|
+
"version": "187.30.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@atlaskit/section-message": "^6.4.0",
|
|
106
106
|
"@atlaskit/select": "^16.5.0",
|
|
107
107
|
"@atlaskit/smart-card": "^26.15.0",
|
|
108
|
-
"@atlaskit/smart-user-picker": "^6.
|
|
108
|
+
"@atlaskit/smart-user-picker": "^6.2.0",
|
|
109
109
|
"@atlaskit/spinner": "^15.5.0",
|
|
110
110
|
"@atlaskit/status": "^1.3.0",
|
|
111
111
|
"@atlaskit/tabs": "^13.4.0",
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
166
166
|
"@atlaskit/renderer": "^108.11.0",
|
|
167
167
|
"@atlaskit/section-message": "^6.4.0",
|
|
168
|
-
"@atlaskit/smart-user-picker": "^6.
|
|
168
|
+
"@atlaskit/smart-user-picker": "^6.2.0",
|
|
169
169
|
"@atlaskit/synchrony-test-helpers": "^2.3.0",
|
|
170
170
|
"@atlaskit/textarea": "^4.7.0",
|
|
171
171
|
"@atlaskit/toggle": "^12.6.0",
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.countNodes = countNodes;
|
|
7
|
-
function countNodes(state) {
|
|
8
|
-
var _nodeTypes$extension, _nodeTypes$inlineExte, _nodeTypes$bodiedExte;
|
|
9
|
-
var nodeCount = {};
|
|
10
|
-
var extensionNodeCount = {};
|
|
11
|
-
var nodeTypes = state.schema.nodes;
|
|
12
|
-
var extensionNodeTypes = [(_nodeTypes$extension = nodeTypes.extension) === null || _nodeTypes$extension === void 0 ? void 0 : _nodeTypes$extension.name, (_nodeTypes$inlineExte = nodeTypes.inlineExtension) === null || _nodeTypes$inlineExte === void 0 ? void 0 : _nodeTypes$inlineExte.name, (_nodeTypes$bodiedExte = nodeTypes.bodiedExtension) === null || _nodeTypes$bodiedExte === void 0 ? void 0 : _nodeTypes$bodiedExte.name];
|
|
13
|
-
state.doc.descendants(function (node) {
|
|
14
|
-
var _node$attrs;
|
|
15
|
-
var nodeName = node.type.name;
|
|
16
|
-
if (nodeName in nodeCount) {
|
|
17
|
-
nodeCount[nodeName]++;
|
|
18
|
-
} else {
|
|
19
|
-
nodeCount[nodeName] = 1;
|
|
20
|
-
}
|
|
21
|
-
var extensionNodeName = nodeName;
|
|
22
|
-
if (extensionNodeTypes.includes(extensionNodeName) && (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 && _node$attrs.extensionType) {
|
|
23
|
-
var _node$attrs2;
|
|
24
|
-
extensionNodeName = "".concat(node.attrs.extensionType, " - ").concat((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.extensionKey);
|
|
25
|
-
if (extensionNodeName in extensionNodeCount) {
|
|
26
|
-
extensionNodeCount[extensionNodeName]++;
|
|
27
|
-
} else {
|
|
28
|
-
extensionNodeCount[extensionNodeName] = 1;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return true;
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
nodeCount: nodeCount,
|
|
35
|
-
extensionNodeCount: extensionNodeCount
|
|
36
|
-
};
|
|
37
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getTimeSince = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Calculate the difference between performance.now() and the given startTime.
|
|
9
|
-
* This allows for the timing to be overridable during tests.
|
|
10
|
-
*
|
|
11
|
-
* @param startTime DOMHighResTimeStamp
|
|
12
|
-
* @returns DOMHighResTimeStamp
|
|
13
|
-
*/
|
|
14
|
-
var getTimeSince = function getTimeSince(startTime) {
|
|
15
|
-
return performance.now() - startTime;
|
|
16
|
-
};
|
|
17
|
-
exports.getTimeSince = getTimeSince;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export function countNodes(state) {
|
|
2
|
-
var _nodeTypes$extension, _nodeTypes$inlineExte, _nodeTypes$bodiedExte;
|
|
3
|
-
const nodeCount = {};
|
|
4
|
-
const extensionNodeCount = {};
|
|
5
|
-
const nodeTypes = state.schema.nodes;
|
|
6
|
-
const extensionNodeTypes = [(_nodeTypes$extension = nodeTypes.extension) === null || _nodeTypes$extension === void 0 ? void 0 : _nodeTypes$extension.name, (_nodeTypes$inlineExte = nodeTypes.inlineExtension) === null || _nodeTypes$inlineExte === void 0 ? void 0 : _nodeTypes$inlineExte.name, (_nodeTypes$bodiedExte = nodeTypes.bodiedExtension) === null || _nodeTypes$bodiedExte === void 0 ? void 0 : _nodeTypes$bodiedExte.name];
|
|
7
|
-
state.doc.descendants(node => {
|
|
8
|
-
var _node$attrs;
|
|
9
|
-
const nodeName = node.type.name;
|
|
10
|
-
if (nodeName in nodeCount) {
|
|
11
|
-
nodeCount[nodeName]++;
|
|
12
|
-
} else {
|
|
13
|
-
nodeCount[nodeName] = 1;
|
|
14
|
-
}
|
|
15
|
-
let extensionNodeName = nodeName;
|
|
16
|
-
if (extensionNodeTypes.includes(extensionNodeName) && (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 && _node$attrs.extensionType) {
|
|
17
|
-
var _node$attrs2;
|
|
18
|
-
extensionNodeName = `${node.attrs.extensionType} - ${(_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.extensionKey}`;
|
|
19
|
-
if (extensionNodeName in extensionNodeCount) {
|
|
20
|
-
extensionNodeCount[extensionNodeName]++;
|
|
21
|
-
} else {
|
|
22
|
-
extensionNodeCount[extensionNodeName] = 1;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
nodeCount,
|
|
29
|
-
extensionNodeCount
|
|
30
|
-
};
|
|
31
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
-
* This allows for the timing to be overridable during tests.
|
|
4
|
-
*
|
|
5
|
-
* @param startTime DOMHighResTimeStamp
|
|
6
|
-
* @returns DOMHighResTimeStamp
|
|
7
|
-
*/
|
|
8
|
-
export const getTimeSince = startTime => performance.now() - startTime;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export function countNodes(state) {
|
|
2
|
-
var _nodeTypes$extension, _nodeTypes$inlineExte, _nodeTypes$bodiedExte;
|
|
3
|
-
var nodeCount = {};
|
|
4
|
-
var extensionNodeCount = {};
|
|
5
|
-
var nodeTypes = state.schema.nodes;
|
|
6
|
-
var extensionNodeTypes = [(_nodeTypes$extension = nodeTypes.extension) === null || _nodeTypes$extension === void 0 ? void 0 : _nodeTypes$extension.name, (_nodeTypes$inlineExte = nodeTypes.inlineExtension) === null || _nodeTypes$inlineExte === void 0 ? void 0 : _nodeTypes$inlineExte.name, (_nodeTypes$bodiedExte = nodeTypes.bodiedExtension) === null || _nodeTypes$bodiedExte === void 0 ? void 0 : _nodeTypes$bodiedExte.name];
|
|
7
|
-
state.doc.descendants(function (node) {
|
|
8
|
-
var _node$attrs;
|
|
9
|
-
var nodeName = node.type.name;
|
|
10
|
-
if (nodeName in nodeCount) {
|
|
11
|
-
nodeCount[nodeName]++;
|
|
12
|
-
} else {
|
|
13
|
-
nodeCount[nodeName] = 1;
|
|
14
|
-
}
|
|
15
|
-
var extensionNodeName = nodeName;
|
|
16
|
-
if (extensionNodeTypes.includes(extensionNodeName) && (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 && _node$attrs.extensionType) {
|
|
17
|
-
var _node$attrs2;
|
|
18
|
-
extensionNodeName = "".concat(node.attrs.extensionType, " - ").concat((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.extensionKey);
|
|
19
|
-
if (extensionNodeName in extensionNodeCount) {
|
|
20
|
-
extensionNodeCount[extensionNodeName]++;
|
|
21
|
-
} else {
|
|
22
|
-
extensionNodeCount[extensionNodeName] = 1;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
nodeCount: nodeCount,
|
|
29
|
-
extensionNodeCount: extensionNodeCount
|
|
30
|
-
};
|
|
31
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
-
* This allows for the timing to be overridable during tests.
|
|
4
|
-
*
|
|
5
|
-
* @param startTime DOMHighResTimeStamp
|
|
6
|
-
* @returns DOMHighResTimeStamp
|
|
7
|
-
*/
|
|
8
|
-
export var getTimeSince = function getTimeSince(startTime) {
|
|
9
|
-
return performance.now() - startTime;
|
|
10
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
type NodeCount = Record<string, number>;
|
|
3
|
-
type NodesCount = {
|
|
4
|
-
nodeCount: NodeCount;
|
|
5
|
-
extensionNodeCount: NodeCount;
|
|
6
|
-
};
|
|
7
|
-
export declare function countNodes(state: EditorState): NodesCount;
|
|
8
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
-
* This allows for the timing to be overridable during tests.
|
|
4
|
-
*
|
|
5
|
-
* @param startTime DOMHighResTimeStamp
|
|
6
|
-
* @returns DOMHighResTimeStamp
|
|
7
|
-
*/
|
|
8
|
-
export declare const getTimeSince: (startTime: DOMHighResTimeStamp) => DOMHighResTimeStamp;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
type NodeCount = Record<string, number>;
|
|
3
|
-
type NodesCount = {
|
|
4
|
-
nodeCount: NodeCount;
|
|
5
|
-
extensionNodeCount: NodeCount;
|
|
6
|
-
};
|
|
7
|
-
export declare function countNodes(state: EditorState): NodesCount;
|
|
8
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
-
* This allows for the timing to be overridable during tests.
|
|
4
|
-
*
|
|
5
|
-
* @param startTime DOMHighResTimeStamp
|
|
6
|
-
* @returns DOMHighResTimeStamp
|
|
7
|
-
*/
|
|
8
|
-
export declare const getTimeSince: (startTime: DOMHighResTimeStamp) => DOMHighResTimeStamp;
|