@atlaskit/editor-plugin-metrics 3.3.1 → 3.4.1
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 +21 -0
- package/dist/cjs/metricsPlugin.js +20 -11
- package/dist/cjs/pm-plugins/main.js +22 -99
- package/dist/cjs/pm-plugins/utils/analytics.js +22 -28
- package/dist/cjs/pm-plugins/utils/check-tr-actions/check-tr-action-type.js +90 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-content-moved.js +26 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-deleting-content.js +20 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-empty-line-added-or-deleted.js +29 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-list-type-node-changed.js +37 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-mark-changed.js +16 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-node-attribute-changed.js +103 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-status-changed.js +22 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-table-column-resized.js +60 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/tr-checks/check-text-input.js +23 -0
- package/dist/cjs/pm-plugins/utils/check-tr-actions/types.js +23 -0
- package/dist/cjs/pm-plugins/utils/get-new-plugin-state.js +103 -0
- package/dist/cjs/pm-plugins/utils/is-safe-insert.js +37 -0
- package/dist/cjs/pm-plugins/utils/should-skip-tr.js +52 -0
- package/dist/es2019/metricsPlugin.js +9 -1
- package/dist/es2019/pm-plugins/main.js +22 -109
- package/dist/es2019/pm-plugins/utils/analytics.js +11 -19
- package/dist/es2019/pm-plugins/utils/check-tr-actions/check-tr-action-type.js +81 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-content-moved.js +20 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-deleting-content.js +17 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-empty-line-added-or-deleted.js +26 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-list-type-node-changed.js +23 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-mark-changed.js +10 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-node-attribute-changed.js +71 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-status-changed.js +18 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-table-column-resized.js +53 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/tr-checks/check-text-input.js +20 -0
- package/dist/es2019/pm-plugins/utils/check-tr-actions/types.js +17 -0
- package/dist/es2019/pm-plugins/utils/get-new-plugin-state.js +101 -0
- package/dist/es2019/pm-plugins/utils/is-safe-insert.js +28 -0
- package/dist/es2019/pm-plugins/utils/should-skip-tr.js +38 -0
- package/dist/esm/metricsPlugin.js +20 -11
- package/dist/esm/pm-plugins/main.js +21 -98
- package/dist/esm/pm-plugins/utils/analytics.js +21 -27
- package/dist/esm/pm-plugins/utils/check-tr-actions/check-tr-action-type.js +83 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-content-moved.js +20 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-deleting-content.js +14 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-empty-line-added-or-deleted.js +23 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-list-type-node-changed.js +31 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-mark-changed.js +10 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-node-attribute-changed.js +96 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-status-changed.js +16 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-table-column-resized.js +54 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/tr-checks/check-text-input.js +17 -0
- package/dist/esm/pm-plugins/utils/check-tr-actions/types.js +17 -0
- package/dist/esm/pm-plugins/utils/get-new-plugin-state.js +96 -0
- package/dist/esm/pm-plugins/utils/is-safe-insert.js +30 -0
- package/dist/esm/pm-plugins/utils/should-skip-tr.js +46 -0
- package/dist/types/metricsPluginType.d.ts +2 -2
- package/dist/types/pm-plugins/main.d.ts +4 -1
- package/dist/types/pm-plugins/utils/analytics.d.ts +1 -7
- package/dist/types/pm-plugins/utils/check-tr-actions/check-tr-action-type.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-content-moved.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-deleting-content.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-empty-line-added-or-deleted.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-list-type-node-changed.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-mark-changed.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-node-attribute-changed.d.ts +4 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-status-changed.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-table-column-resized.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-text-input.d.ts +3 -0
- package/dist/types/pm-plugins/utils/check-tr-actions/types.d.ts +44 -0
- package/dist/types/pm-plugins/utils/get-new-plugin-state.d.ts +56 -0
- package/dist/types/pm-plugins/utils/is-safe-insert.d.ts +3 -0
- package/dist/types/pm-plugins/utils/should-skip-tr.d.ts +2 -0
- package/dist/types-ts4.5/metricsPluginType.d.ts +2 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +4 -1
- package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +1 -7
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/check-tr-action-type.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-content-moved.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-deleting-content.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-empty-line-added-or-deleted.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-list-type-node-changed.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-mark-changed.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-node-attribute-changed.d.ts +4 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-status-changed.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-table-column-resized.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/tr-checks/check-text-input.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-actions/types.d.ts +44 -0
- package/dist/types-ts4.5/pm-plugins/utils/get-new-plugin-state.d.ts +56 -0
- package/dist/types-ts4.5/pm-plugins/utils/is-safe-insert.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/utils/should-skip-tr.d.ts +2 -0
- package/package.json +12 -6
- package/dist/cjs/pm-plugins/utils/check-tr-action-type.js +0 -312
- package/dist/es2019/pm-plugins/utils/check-tr-action-type.js +0 -271
- package/dist/esm/pm-plugins/utils/check-tr-action-type.js +0 -305
- package/dist/types/pm-plugins/utils/check-tr-action-type.d.ts +0 -38
- package/dist/types-ts4.5/pm-plugins/utils/check-tr-action-type.d.ts +0 -38
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import { checkTrActionType } from './check-tr-actions/check-tr-action-type';
|
|
5
|
+
import { ActionType } from './check-tr-actions/types';
|
|
6
|
+
import { isNonTextUndo } from './is-non-text-undo';
|
|
7
|
+
import { isSafeInsert } from './is-safe-insert';
|
|
8
|
+
var textInputActions = [ActionType.TEXT_INPUT, ActionType.EMPTY_LINE_ADDED_OR_DELETED];
|
|
9
|
+
var listActions = [ActionType.UPDATING_NEW_LIST_TYPE_ITEM, ActionType.INSERTING_NEW_LIST_TYPE_NODE];
|
|
10
|
+
var continuousActions = [].concat(textInputActions, listActions, [ActionType.UPDATING_STATUS]);
|
|
11
|
+
var checkIsDesiredAction = function checkIsDesiredAction(trType, desiredActions) {
|
|
12
|
+
return trType && desiredActions.includes(trType.type);
|
|
13
|
+
};
|
|
14
|
+
var getNewActionTypeCount = function getNewActionTypeCount(shouldIncrement, currentCount) {
|
|
15
|
+
return shouldIncrement ? currentCount + 1 : currentCount;
|
|
16
|
+
};
|
|
17
|
+
export var getNewPluginState = function getNewPluginState(_ref) {
|
|
18
|
+
var _trType$extraData, _previousTrType$extra;
|
|
19
|
+
var now = _ref.now,
|
|
20
|
+
intentToStartEditTime = _ref.intentToStartEditTime,
|
|
21
|
+
shouldPersistActiveSession = _ref.shouldPersistActiveSession,
|
|
22
|
+
tr = _ref.tr,
|
|
23
|
+
pluginState = _ref.pluginState,
|
|
24
|
+
oldState = _ref.oldState,
|
|
25
|
+
newState = _ref.newState;
|
|
26
|
+
var actionTypeCount = pluginState.actionTypeCount,
|
|
27
|
+
timeOfLastTextInput = pluginState.timeOfLastTextInput,
|
|
28
|
+
totalActionCount = pluginState.totalActionCount,
|
|
29
|
+
previousTrType = pluginState.previousTrType,
|
|
30
|
+
safeInsertCount = pluginState.safeInsertCount,
|
|
31
|
+
contentSizeChanged = pluginState.contentSizeChanged;
|
|
32
|
+
var newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
33
|
+
activeSessionTime: now - intentToStartEditTime,
|
|
34
|
+
contentSizeChanged: contentSizeChanged + Math.abs(newState.doc.content.size - oldState.doc.content.size),
|
|
35
|
+
intentToStartEditTime: intentToStartEditTime,
|
|
36
|
+
shouldPersistActiveSession: shouldPersistActiveSession
|
|
37
|
+
});
|
|
38
|
+
var trType = checkTrActionType(tr);
|
|
39
|
+
var newSafeInsertCount = getNewActionTypeCount(isSafeInsert(tr, oldState.tr.selection.from, trType === null || trType === void 0 ? void 0 : trType.type), safeInsertCount);
|
|
40
|
+
var newUndoCount = getNewActionTypeCount(isNonTextUndo(tr), actionTypeCount.undoCount);
|
|
41
|
+
if (!trType) {
|
|
42
|
+
return _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
43
|
+
totalActionCount: totalActionCount + 1,
|
|
44
|
+
timeOfLastTextInput: undefined,
|
|
45
|
+
actionTypeCount: _objectSpread(_objectSpread({}, actionTypeCount), {}, {
|
|
46
|
+
undoCount: newUndoCount
|
|
47
|
+
}),
|
|
48
|
+
previousTrType: trType,
|
|
49
|
+
safeInsertCount: newSafeInsertCount
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Below are conditions for special cases which should not increase action count if the previous action was the same or was textInput
|
|
54
|
+
// Check if tr is updating the same status node
|
|
55
|
+
var isNotNewStatus = trType.type === ActionType.UPDATING_STATUS && (previousTrType === null || previousTrType === void 0 ? void 0 : previousTrType.type) === ActionType.UPDATING_STATUS && (trType === null || trType === void 0 || (_trType$extraData = trType.extraData) === null || _trType$extraData === void 0 ? void 0 : _trType$extraData.statusId) === (previousTrType === null || previousTrType === void 0 || (_previousTrType$extra = previousTrType.extraData) === null || _previousTrType$extra === void 0 ? void 0 : _previousTrType$extra.statusId);
|
|
56
|
+
|
|
57
|
+
// Check if tr is adding text after adding a list node
|
|
58
|
+
var isAddingTextToListNode = trType.type === ActionType.TEXT_INPUT && checkIsDesiredAction(previousTrType, listActions);
|
|
59
|
+
|
|
60
|
+
// Check if tr is adding new list item after text input
|
|
61
|
+
var isAddingNewListItemAfterTextInput = (previousTrType === null || previousTrType === void 0 ? void 0 : previousTrType.type) === ActionType.TEXT_INPUT && trType.type === ActionType.UPDATING_NEW_LIST_TYPE_ITEM;
|
|
62
|
+
|
|
63
|
+
// Check if tr is textInput
|
|
64
|
+
var isTextInput = textInputActions.includes(trType.type);
|
|
65
|
+
|
|
66
|
+
// Don't increment action count if tr is text input, not a new status, adding text to list node or adding new list item if timeOfLastTextInput is set
|
|
67
|
+
var shouldNotIncrementActionCount = timeOfLastTextInput && (isTextInput || isNotNewStatus || isAddingTextToListNode || isAddingNewListItemAfterTextInput);
|
|
68
|
+
var newTotalActionCount = getNewActionTypeCount(!shouldNotIncrementActionCount, totalActionCount);
|
|
69
|
+
|
|
70
|
+
// Increment textInputCount if tr is text input and previous action was not text input or list action
|
|
71
|
+
var newTextInputCount = getNewActionTypeCount(isTextInput && !(timeOfLastTextInput && checkIsDesiredAction(previousTrType, [].concat(textInputActions, listActions))), actionTypeCount.textInputCount);
|
|
72
|
+
var newNodeAttrCount = getNewActionTypeCount((trType === null || trType === void 0 ? void 0 : trType.type) === ActionType.CHANGING_ATTRS, actionTypeCount.nodeAttributeChangeCount);
|
|
73
|
+
var isRepeatedAttrAction = (trType === null || trType === void 0 ? void 0 : trType.type) === ActionType.CHANGING_ATTRS && (previousTrType === null || previousTrType === void 0 ? void 0 : previousTrType.type) === ActionType.CHANGING_ATTRS && trType.extraData.attr === previousTrType.extraData.attr && trType.extraData.from === previousTrType.extraData.from && trType.extraData.to === previousTrType.extraData.to;
|
|
74
|
+
var newRepeatedActionCount = getNewActionTypeCount(isRepeatedAttrAction, pluginState.repeatedActionCount);
|
|
75
|
+
var contentMoved = getNewActionTypeCount((trType === null || trType === void 0 ? void 0 : trType.type) === ActionType.MOVING_CONTENT, actionTypeCount.contentMovedCount);
|
|
76
|
+
var newMarkChangeCount = getNewActionTypeCount((trType === null || trType === void 0 ? void 0 : trType.type) === ActionType.CHANGING_MARK, actionTypeCount.markChangeCount);
|
|
77
|
+
var newContentDeletedCount = getNewActionTypeCount((trType === null || trType === void 0 ? void 0 : trType.type) === ActionType.DELETING_CONTENT, actionTypeCount.contentDeletedCount);
|
|
78
|
+
|
|
79
|
+
// timeOfLastTextInput should be set if tr includes continuous text input on the same node
|
|
80
|
+
var shouldSetTimeOfLastTextInput = continuousActions.includes(trType.type) || isNotNewStatus;
|
|
81
|
+
return _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
82
|
+
totalActionCount: newTotalActionCount,
|
|
83
|
+
timeOfLastTextInput: shouldSetTimeOfLastTextInput ? now : undefined,
|
|
84
|
+
actionTypeCount: _objectSpread(_objectSpread({}, actionTypeCount), {}, {
|
|
85
|
+
textInputCount: newTextInputCount,
|
|
86
|
+
undoCount: newUndoCount,
|
|
87
|
+
nodeAttributeChangeCount: newNodeAttrCount,
|
|
88
|
+
contentMovedCount: contentMoved,
|
|
89
|
+
markChangeCount: newMarkChangeCount,
|
|
90
|
+
contentDeletedCount: newContentDeletedCount
|
|
91
|
+
}),
|
|
92
|
+
previousTrType: trType,
|
|
93
|
+
repeatedActionCount: newRepeatedActionCount,
|
|
94
|
+
safeInsertCount: newSafeInsertCount
|
|
95
|
+
});
|
|
96
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
export var isSafeInsert = function isSafeInsert(tr, insertPos, trType) {
|
|
4
|
+
var _$firstStepPos$node, _$insertPos$node;
|
|
5
|
+
// Exclude the cases where trType is defined, as it is a specific action
|
|
6
|
+
// that should not be considered for safe insert actions
|
|
7
|
+
if (trType) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (insertPos > tr.doc.content.size) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
var _tr$steps = _slicedToArray(tr.steps, 1),
|
|
14
|
+
firstStep = _tr$steps[0];
|
|
15
|
+
if (!(firstStep instanceof ReplaceStep)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
var firstStepPos = firstStep.from;
|
|
19
|
+
if (firstStepPos === insertPos) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
var $firstStepPos = tr.doc.resolve(firstStepPos);
|
|
23
|
+
if ($firstStepPos.node().type.name === 'paragraph') {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
var firstStepParentNodeType = (_$firstStepPos$node = $firstStepPos.node($firstStepPos.depth)) === null || _$firstStepPos$node === void 0 ? void 0 : _$firstStepPos$node.type.name;
|
|
27
|
+
var $insertPos = tr.doc.resolve(insertPos);
|
|
28
|
+
var parentNodeType = (_$insertPos$node = $insertPos.node($insertPos.depth - 1)) === null || _$insertPos$node === void 0 ? void 0 : _$insertPos$node.type.name;
|
|
29
|
+
return parentNodeType !== firstStepParentNodeType;
|
|
30
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { InsertTypeAheadStep, LinkMetaStep } from '@atlaskit/adf-schema/steps';
|
|
2
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
var isResolvingLink = function isResolvingLink(tr) {
|
|
4
|
+
var _linkStep$getMetadata;
|
|
5
|
+
// When links are added, there are two transactions that are fired and we want to ignore the last one where the link is resolved
|
|
6
|
+
var linkStep = tr.steps.find(function (step) {
|
|
7
|
+
return step instanceof LinkMetaStep;
|
|
8
|
+
});
|
|
9
|
+
var hasReplaceStep = tr.steps.some(function (step) {
|
|
10
|
+
return step instanceof ReplaceStep;
|
|
11
|
+
});
|
|
12
|
+
return Boolean(hasReplaceStep && linkStep instanceof LinkMetaStep && ((_linkStep$getMetadata = linkStep.getMetadata()) === null || _linkStep$getMetadata === void 0 ? void 0 : _linkStep$getMetadata.cardAction) === 'RESOLVE');
|
|
13
|
+
};
|
|
14
|
+
var checkTypeAheadStepStage = function checkTypeAheadStepStage(tr) {
|
|
15
|
+
var _tr$getMeta;
|
|
16
|
+
// When nodes are inserted from typeahead, there are multiple transactions that are fired that changes the document
|
|
17
|
+
// We want to ignore all but the last transaction where the node is inserted
|
|
18
|
+
if (((_tr$getMeta = tr.getMeta('typeAheadPlugin$')) === null || _tr$getMeta === void 0 ? void 0 : _tr$getMeta.action) === 'INSERT_RAW_QUERY') {
|
|
19
|
+
return 'INSERT_RAW_QUERY';
|
|
20
|
+
}
|
|
21
|
+
if (!tr.getMeta('appendedTransaction')) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
var insertTypeAheadStep = tr.steps.find(function (step) {
|
|
25
|
+
return step instanceof InsertTypeAheadStep;
|
|
26
|
+
});
|
|
27
|
+
var replaceStep = tr.steps.find(function (step) {
|
|
28
|
+
return step instanceof ReplaceStep;
|
|
29
|
+
});
|
|
30
|
+
if (!insertTypeAheadStep || !replaceStep) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return insertTypeAheadStep instanceof InsertTypeAheadStep && insertTypeAheadStep.stage;
|
|
34
|
+
};
|
|
35
|
+
export var shouldSkipTr = function shouldSkipTr(tr) {
|
|
36
|
+
if (isResolvingLink(tr)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
var typeAheadStepStage = checkTypeAheadStepStage(tr);
|
|
40
|
+
if (typeAheadStepStage) {
|
|
41
|
+
return typeAheadStepStage !== 'INSERTING_ITEM';
|
|
42
|
+
} else {
|
|
43
|
+
// Ignore all appended transactions apart from when typeahead is inserting an item
|
|
44
|
+
return tr.getMeta('appendedTransaction');
|
|
45
|
+
}
|
|
46
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
-
import type { BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
4
3
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
4
|
import type { MetricsState } from './pm-plugins/main';
|
|
6
5
|
type handleIntentToStartEditProps = {
|
|
@@ -9,9 +8,10 @@ type handleIntentToStartEditProps = {
|
|
|
9
8
|
shouldPersistActiveSession?: boolean;
|
|
10
9
|
};
|
|
11
10
|
export type MetricsPlugin = NextEditorPlugin<'metrics', {
|
|
12
|
-
dependencies: [
|
|
11
|
+
dependencies: [OptionalPlugin<AnalyticsPlugin>];
|
|
13
12
|
sharedState: MetricsState;
|
|
14
13
|
commands: {
|
|
14
|
+
setContentMoved: () => EditorCommand;
|
|
15
15
|
startActiveSessionTimer: () => EditorCommand;
|
|
16
16
|
stopActiveSession: () => EditorCommand;
|
|
17
17
|
handleIntentToStartEdit: ({ newSelection, shouldStartTimer, shouldPersistActiveSession, }: handleIntentToStartEditProps) => EditorCommand;
|
|
@@ -3,7 +3,7 @@ import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
3
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { PluginKey, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { type MetricsPlugin } from '../metricsPluginType';
|
|
6
|
-
import { type TrActionType } from './utils/check-tr-
|
|
6
|
+
import { type TrActionType } from './utils/check-tr-actions/types';
|
|
7
7
|
export declare const metricsKey: PluginKey<any>;
|
|
8
8
|
export type MetricsState = {
|
|
9
9
|
intentToStartEditTime?: number;
|
|
@@ -17,6 +17,7 @@ export type MetricsState = {
|
|
|
17
17
|
initialContent?: Fragment;
|
|
18
18
|
previousTrType?: TrActionType;
|
|
19
19
|
repeatedActionCount: number;
|
|
20
|
+
safeInsertCount: number;
|
|
20
21
|
};
|
|
21
22
|
export type ActionByType = {
|
|
22
23
|
textInputCount: number;
|
|
@@ -25,6 +26,8 @@ export type ActionByType = {
|
|
|
25
26
|
contentMovedCount: number;
|
|
26
27
|
nodeDeletionCount: number;
|
|
27
28
|
undoCount: number;
|
|
29
|
+
markChangeCount: number;
|
|
30
|
+
contentDeletedCount: number;
|
|
28
31
|
};
|
|
29
32
|
export declare const initialPluginState: MetricsState;
|
|
30
33
|
export declare const createPlugin: (api: ExtractInjectionAPI<MetricsPlugin> | undefined) => SafePlugin<MetricsState>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { type ActiveSessionEventPayload
|
|
1
|
+
import { type ActiveSessionEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { MetricsState } from '../main';
|
|
4
|
-
type Props = {
|
|
5
|
-
pluginState: MetricsState;
|
|
6
|
-
contentSizeChanged: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const getPayloadAttributes: ({ pluginState, contentSizeChanged, }: Props) => ActiveSessionEventAttributes;
|
|
9
4
|
export declare const getAnalyticsPayload: ({ currentContent, pluginState, }: {
|
|
10
5
|
currentContent: Fragment;
|
|
11
6
|
pluginState: MetricsState;
|
|
12
7
|
}) => ActiveSessionEventPayload;
|
|
13
|
-
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { ActionType, type TrAction } from '../types';
|
|
3
|
+
export declare const checkContentPastedOrMoved: (tr: ReadonlyTransaction) => TrAction<ActionType.MOVING_CONTENT | ActionType.PASTING_CONTENT> | undefined;
|
package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-list-type-node-changed.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
+
import { ActionType, type TrAction } from '../types';
|
|
3
|
+
export declare const checkListTypeNodeChanged: (step: ReplaceStep | ReplaceAroundStep) => TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE | ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | undefined;
|
package/dist/types/pm-plugins/utils/check-tr-actions/tr-checks/check-node-attribute-changed.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
import { type AttrChangeAction } from '../types';
|
|
4
|
+
export declare const checkNodeAttributeChanged: (tr: ReadonlyTransaction, step: ReplaceAroundStep | ReplaceStep) => AttrChangeAction | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
export interface DetailedReplaceStep extends ReplaceStep {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number;
|
|
6
|
+
slice: Slice;
|
|
7
|
+
}
|
|
8
|
+
export declare enum ActionType {
|
|
9
|
+
TEXT_INPUT = "textInput",
|
|
10
|
+
EMPTY_LINE_ADDED_OR_DELETED = "emptyLineAddedOrDeleted",
|
|
11
|
+
INSERTED_FROM_TYPE_AHEAD = "insertedFromTypeAhead",
|
|
12
|
+
INSERTING_NEW_LIST_TYPE_NODE = "insertingNewListTypeNode",
|
|
13
|
+
UPDATING_NEW_LIST_TYPE_ITEM = "updatingNewListItem",
|
|
14
|
+
ADDING_LINK = "addingLink",
|
|
15
|
+
UPDATING_STATUS = "updatingStatus",
|
|
16
|
+
CHANGING_MARK = "changingMark",
|
|
17
|
+
CHANGING_ATTRS = "changingAttrs",
|
|
18
|
+
MOVING_CONTENT = "contentMoved",
|
|
19
|
+
PASTING_CONTENT = "contentPasted",
|
|
20
|
+
DELETING_CONTENT = "deletingContent",
|
|
21
|
+
SAFE_INSERT = "safeInsert",
|
|
22
|
+
UNDO = "undo"
|
|
23
|
+
}
|
|
24
|
+
export type AttrChangeAction = {
|
|
25
|
+
type: ActionType.CHANGING_ATTRS;
|
|
26
|
+
extraData: {
|
|
27
|
+
attr: string;
|
|
28
|
+
from: number;
|
|
29
|
+
to: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type MarkChangeAction = {
|
|
33
|
+
type: ActionType.CHANGING_MARK;
|
|
34
|
+
};
|
|
35
|
+
export type StatusChangeAction = {
|
|
36
|
+
type: ActionType.UPDATING_STATUS;
|
|
37
|
+
extraData: {
|
|
38
|
+
statusId: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type TrAction<T extends Exclude<ActionType, ActionType.CHANGING_ATTRS | ActionType.CHANGING_MARK | ActionType.UPDATING_STATUS>> = {
|
|
42
|
+
type: T;
|
|
43
|
+
};
|
|
44
|
+
export type TrActionType = AttrChangeAction | MarkChangeAction | StatusChangeAction | TrAction<ActionType.TEXT_INPUT> | TrAction<ActionType.EMPTY_LINE_ADDED_OR_DELETED> | TrAction<ActionType.INSERTED_FROM_TYPE_AHEAD> | TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE> | TrAction<ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | TrAction<ActionType.ADDING_LINK> | TrAction<ActionType.MOVING_CONTENT> | TrAction<ActionType.PASTING_CONTENT> | TrAction<ActionType.DELETING_CONTENT> | TrAction<ActionType.SAFE_INSERT> | TrAction<ActionType.UNDO> | undefined;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { EditorState, ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { type MetricsState } from '../main';
|
|
3
|
+
import { ActionType } from './check-tr-actions/types';
|
|
4
|
+
export declare const getNewPluginState: ({ now, intentToStartEditTime, shouldPersistActiveSession, tr, pluginState, oldState, newState, }: {
|
|
5
|
+
now: number;
|
|
6
|
+
intentToStartEditTime: number;
|
|
7
|
+
shouldPersistActiveSession: boolean;
|
|
8
|
+
tr: ReadonlyTransaction;
|
|
9
|
+
pluginState: MetricsState;
|
|
10
|
+
newState: EditorState;
|
|
11
|
+
oldState: EditorState;
|
|
12
|
+
}) => {
|
|
13
|
+
totalActionCount: number;
|
|
14
|
+
timeOfLastTextInput: undefined;
|
|
15
|
+
actionTypeCount: {
|
|
16
|
+
undoCount: number;
|
|
17
|
+
textInputCount: number;
|
|
18
|
+
nodeInsertionCount: number;
|
|
19
|
+
nodeAttributeChangeCount: number;
|
|
20
|
+
contentMovedCount: number;
|
|
21
|
+
nodeDeletionCount: number;
|
|
22
|
+
markChangeCount: number;
|
|
23
|
+
contentDeletedCount: number;
|
|
24
|
+
};
|
|
25
|
+
previousTrType: undefined;
|
|
26
|
+
safeInsertCount: number;
|
|
27
|
+
activeSessionTime: number;
|
|
28
|
+
contentSizeChanged: number;
|
|
29
|
+
intentToStartEditTime: number;
|
|
30
|
+
shouldPersistActiveSession: boolean;
|
|
31
|
+
lastSelection?: import("prosemirror-state").Selection | undefined;
|
|
32
|
+
initialContent?: import("prosemirror-model").Fragment | undefined;
|
|
33
|
+
repeatedActionCount: number;
|
|
34
|
+
} | {
|
|
35
|
+
totalActionCount: number;
|
|
36
|
+
timeOfLastTextInput: number | undefined;
|
|
37
|
+
actionTypeCount: {
|
|
38
|
+
textInputCount: number;
|
|
39
|
+
undoCount: number;
|
|
40
|
+
nodeAttributeChangeCount: number;
|
|
41
|
+
contentMovedCount: number;
|
|
42
|
+
markChangeCount: number;
|
|
43
|
+
contentDeletedCount: number;
|
|
44
|
+
nodeInsertionCount: number;
|
|
45
|
+
nodeDeletionCount: number;
|
|
46
|
+
};
|
|
47
|
+
previousTrType: import("./check-tr-actions/types").AttrChangeAction | import("./check-tr-actions/types").MarkChangeAction | import("./check-tr-actions/types").StatusChangeAction | import("./check-tr-actions/types").TrAction<ActionType.TEXT_INPUT> | import("./check-tr-actions/types").TrAction<ActionType.EMPTY_LINE_ADDED_OR_DELETED> | import("./check-tr-actions/types").TrAction<ActionType.INSERTED_FROM_TYPE_AHEAD> | import("./check-tr-actions/types").TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE> | import("./check-tr-actions/types").TrAction<ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | import("./check-tr-actions/types").TrAction<ActionType.ADDING_LINK> | import("./check-tr-actions/types").TrAction<ActionType.MOVING_CONTENT> | import("./check-tr-actions/types").TrAction<ActionType.PASTING_CONTENT> | import("./check-tr-actions/types").TrAction<ActionType.DELETING_CONTENT> | import("./check-tr-actions/types").TrAction<ActionType.SAFE_INSERT> | import("./check-tr-actions/types").TrAction<ActionType.UNDO>;
|
|
48
|
+
repeatedActionCount: number;
|
|
49
|
+
safeInsertCount: number;
|
|
50
|
+
activeSessionTime: number;
|
|
51
|
+
contentSizeChanged: number;
|
|
52
|
+
intentToStartEditTime: number;
|
|
53
|
+
shouldPersistActiveSession: boolean;
|
|
54
|
+
lastSelection?: import("prosemirror-state").Selection | undefined;
|
|
55
|
+
initialContent?: import("prosemirror-model").Fragment | undefined;
|
|
56
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
-
import type { BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
4
3
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
4
|
import type { MetricsState } from './pm-plugins/main';
|
|
6
5
|
type handleIntentToStartEditProps = {
|
|
@@ -10,11 +9,11 @@ type handleIntentToStartEditProps = {
|
|
|
10
9
|
};
|
|
11
10
|
export type MetricsPlugin = NextEditorPlugin<'metrics', {
|
|
12
11
|
dependencies: [
|
|
13
|
-
AnalyticsPlugin
|
|
14
|
-
OptionalPlugin<BlockControlsPlugin>
|
|
12
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
15
13
|
];
|
|
16
14
|
sharedState: MetricsState;
|
|
17
15
|
commands: {
|
|
16
|
+
setContentMoved: () => EditorCommand;
|
|
18
17
|
startActiveSessionTimer: () => EditorCommand;
|
|
19
18
|
stopActiveSession: () => EditorCommand;
|
|
20
19
|
handleIntentToStartEdit: ({ newSelection, shouldStartTimer, shouldPersistActiveSession, }: handleIntentToStartEditProps) => EditorCommand;
|
|
@@ -3,7 +3,7 @@ import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
3
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { PluginKey, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { type MetricsPlugin } from '../metricsPluginType';
|
|
6
|
-
import { type TrActionType } from './utils/check-tr-
|
|
6
|
+
import { type TrActionType } from './utils/check-tr-actions/types';
|
|
7
7
|
export declare const metricsKey: PluginKey<any>;
|
|
8
8
|
export type MetricsState = {
|
|
9
9
|
intentToStartEditTime?: number;
|
|
@@ -17,6 +17,7 @@ export type MetricsState = {
|
|
|
17
17
|
initialContent?: Fragment;
|
|
18
18
|
previousTrType?: TrActionType;
|
|
19
19
|
repeatedActionCount: number;
|
|
20
|
+
safeInsertCount: number;
|
|
20
21
|
};
|
|
21
22
|
export type ActionByType = {
|
|
22
23
|
textInputCount: number;
|
|
@@ -25,6 +26,8 @@ export type ActionByType = {
|
|
|
25
26
|
contentMovedCount: number;
|
|
26
27
|
nodeDeletionCount: number;
|
|
27
28
|
undoCount: number;
|
|
29
|
+
markChangeCount: number;
|
|
30
|
+
contentDeletedCount: number;
|
|
28
31
|
};
|
|
29
32
|
export declare const initialPluginState: MetricsState;
|
|
30
33
|
export declare const createPlugin: (api: ExtractInjectionAPI<MetricsPlugin> | undefined) => SafePlugin<MetricsState>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { type ActiveSessionEventPayload
|
|
1
|
+
import { type ActiveSessionEventPayload } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { MetricsState } from '../main';
|
|
4
|
-
type Props = {
|
|
5
|
-
pluginState: MetricsState;
|
|
6
|
-
contentSizeChanged: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const getPayloadAttributes: ({ pluginState, contentSizeChanged, }: Props) => ActiveSessionEventAttributes;
|
|
9
4
|
export declare const getAnalyticsPayload: ({ currentContent, pluginState, }: {
|
|
10
5
|
currentContent: Fragment;
|
|
11
6
|
pluginState: MetricsState;
|
|
12
7
|
}) => ActiveSessionEventPayload;
|
|
13
|
-
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { ActionType, type TrAction } from '../types';
|
|
3
|
+
export declare const checkContentPastedOrMoved: (tr: ReadonlyTransaction) => TrAction<ActionType.MOVING_CONTENT | ActionType.PASTING_CONTENT> | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
+
import { ActionType, type TrAction } from '../types';
|
|
3
|
+
export declare const checkListTypeNodeChanged: (step: ReplaceStep | ReplaceAroundStep) => TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE | ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
import { type AttrChangeAction } from '../types';
|
|
4
|
+
export declare const checkNodeAttributeChanged: (tr: ReadonlyTransaction, step: ReplaceAroundStep | ReplaceStep) => AttrChangeAction | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
export interface DetailedReplaceStep extends ReplaceStep {
|
|
4
|
+
from: number;
|
|
5
|
+
to: number;
|
|
6
|
+
slice: Slice;
|
|
7
|
+
}
|
|
8
|
+
export declare enum ActionType {
|
|
9
|
+
TEXT_INPUT = "textInput",
|
|
10
|
+
EMPTY_LINE_ADDED_OR_DELETED = "emptyLineAddedOrDeleted",
|
|
11
|
+
INSERTED_FROM_TYPE_AHEAD = "insertedFromTypeAhead",
|
|
12
|
+
INSERTING_NEW_LIST_TYPE_NODE = "insertingNewListTypeNode",
|
|
13
|
+
UPDATING_NEW_LIST_TYPE_ITEM = "updatingNewListItem",
|
|
14
|
+
ADDING_LINK = "addingLink",
|
|
15
|
+
UPDATING_STATUS = "updatingStatus",
|
|
16
|
+
CHANGING_MARK = "changingMark",
|
|
17
|
+
CHANGING_ATTRS = "changingAttrs",
|
|
18
|
+
MOVING_CONTENT = "contentMoved",
|
|
19
|
+
PASTING_CONTENT = "contentPasted",
|
|
20
|
+
DELETING_CONTENT = "deletingContent",
|
|
21
|
+
SAFE_INSERT = "safeInsert",
|
|
22
|
+
UNDO = "undo"
|
|
23
|
+
}
|
|
24
|
+
export type AttrChangeAction = {
|
|
25
|
+
type: ActionType.CHANGING_ATTRS;
|
|
26
|
+
extraData: {
|
|
27
|
+
attr: string;
|
|
28
|
+
from: number;
|
|
29
|
+
to: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type MarkChangeAction = {
|
|
33
|
+
type: ActionType.CHANGING_MARK;
|
|
34
|
+
};
|
|
35
|
+
export type StatusChangeAction = {
|
|
36
|
+
type: ActionType.UPDATING_STATUS;
|
|
37
|
+
extraData: {
|
|
38
|
+
statusId: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type TrAction<T extends Exclude<ActionType, ActionType.CHANGING_ATTRS | ActionType.CHANGING_MARK | ActionType.UPDATING_STATUS>> = {
|
|
42
|
+
type: T;
|
|
43
|
+
};
|
|
44
|
+
export type TrActionType = AttrChangeAction | MarkChangeAction | StatusChangeAction | TrAction<ActionType.TEXT_INPUT> | TrAction<ActionType.EMPTY_LINE_ADDED_OR_DELETED> | TrAction<ActionType.INSERTED_FROM_TYPE_AHEAD> | TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE> | TrAction<ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | TrAction<ActionType.ADDING_LINK> | TrAction<ActionType.MOVING_CONTENT> | TrAction<ActionType.PASTING_CONTENT> | TrAction<ActionType.DELETING_CONTENT> | TrAction<ActionType.SAFE_INSERT> | TrAction<ActionType.UNDO> | undefined;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { EditorState, ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { type MetricsState } from '../main';
|
|
3
|
+
import { ActionType } from './check-tr-actions/types';
|
|
4
|
+
export declare const getNewPluginState: ({ now, intentToStartEditTime, shouldPersistActiveSession, tr, pluginState, oldState, newState, }: {
|
|
5
|
+
now: number;
|
|
6
|
+
intentToStartEditTime: number;
|
|
7
|
+
shouldPersistActiveSession: boolean;
|
|
8
|
+
tr: ReadonlyTransaction;
|
|
9
|
+
pluginState: MetricsState;
|
|
10
|
+
newState: EditorState;
|
|
11
|
+
oldState: EditorState;
|
|
12
|
+
}) => {
|
|
13
|
+
totalActionCount: number;
|
|
14
|
+
timeOfLastTextInput: undefined;
|
|
15
|
+
actionTypeCount: {
|
|
16
|
+
undoCount: number;
|
|
17
|
+
textInputCount: number;
|
|
18
|
+
nodeInsertionCount: number;
|
|
19
|
+
nodeAttributeChangeCount: number;
|
|
20
|
+
contentMovedCount: number;
|
|
21
|
+
nodeDeletionCount: number;
|
|
22
|
+
markChangeCount: number;
|
|
23
|
+
contentDeletedCount: number;
|
|
24
|
+
};
|
|
25
|
+
previousTrType: undefined;
|
|
26
|
+
safeInsertCount: number;
|
|
27
|
+
activeSessionTime: number;
|
|
28
|
+
contentSizeChanged: number;
|
|
29
|
+
intentToStartEditTime: number;
|
|
30
|
+
shouldPersistActiveSession: boolean;
|
|
31
|
+
lastSelection?: import("prosemirror-state").Selection | undefined;
|
|
32
|
+
initialContent?: import("prosemirror-model").Fragment | undefined;
|
|
33
|
+
repeatedActionCount: number;
|
|
34
|
+
} | {
|
|
35
|
+
totalActionCount: number;
|
|
36
|
+
timeOfLastTextInput: number | undefined;
|
|
37
|
+
actionTypeCount: {
|
|
38
|
+
textInputCount: number;
|
|
39
|
+
undoCount: number;
|
|
40
|
+
nodeAttributeChangeCount: number;
|
|
41
|
+
contentMovedCount: number;
|
|
42
|
+
markChangeCount: number;
|
|
43
|
+
contentDeletedCount: number;
|
|
44
|
+
nodeInsertionCount: number;
|
|
45
|
+
nodeDeletionCount: number;
|
|
46
|
+
};
|
|
47
|
+
previousTrType: import("./check-tr-actions/types").AttrChangeAction | import("./check-tr-actions/types").MarkChangeAction | import("./check-tr-actions/types").StatusChangeAction | import("./check-tr-actions/types").TrAction<ActionType.TEXT_INPUT> | import("./check-tr-actions/types").TrAction<ActionType.EMPTY_LINE_ADDED_OR_DELETED> | import("./check-tr-actions/types").TrAction<ActionType.INSERTED_FROM_TYPE_AHEAD> | import("./check-tr-actions/types").TrAction<ActionType.INSERTING_NEW_LIST_TYPE_NODE> | import("./check-tr-actions/types").TrAction<ActionType.UPDATING_NEW_LIST_TYPE_ITEM> | import("./check-tr-actions/types").TrAction<ActionType.ADDING_LINK> | import("./check-tr-actions/types").TrAction<ActionType.MOVING_CONTENT> | import("./check-tr-actions/types").TrAction<ActionType.PASTING_CONTENT> | import("./check-tr-actions/types").TrAction<ActionType.DELETING_CONTENT> | import("./check-tr-actions/types").TrAction<ActionType.SAFE_INSERT> | import("./check-tr-actions/types").TrAction<ActionType.UNDO>;
|
|
48
|
+
repeatedActionCount: number;
|
|
49
|
+
safeInsertCount: number;
|
|
50
|
+
activeSessionTime: number;
|
|
51
|
+
contentSizeChanged: number;
|
|
52
|
+
intentToStartEditTime: number;
|
|
53
|
+
shouldPersistActiveSession: boolean;
|
|
54
|
+
lastSelection?: import("prosemirror-state").Selection | undefined;
|
|
55
|
+
initialContent?: import("prosemirror-model").Fragment | undefined;
|
|
56
|
+
};
|