@atlaskit/editor-core 187.8.7 → 187.8.11
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 +14 -0
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +4 -4
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +5 -5
- package/dist/cjs/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/list/actions/conversions.js +5 -5
- package/dist/cjs/plugins/list/actions/indent-list-items-selected.js +11 -11
- package/dist/cjs/plugins/list/actions/join-list-items-forward.js +6 -6
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +6 -7
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +3 -4
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +3 -4
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +2 -2
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +2 -2
- package/dist/cjs/plugins/list/actions/merge-lists.js +3 -3
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +11 -11
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +2 -2
- package/dist/cjs/plugins/list/commands/indent-list.js +6 -7
- package/dist/cjs/plugins/list/commands/index.js +8 -10
- package/dist/cjs/plugins/list/commands/join-list-item-forward.js +5 -5
- package/dist/cjs/plugins/list/commands/listBackspace.js +13 -14
- package/dist/cjs/plugins/list/commands/outdent-list.js +4 -3
- package/dist/cjs/plugins/list/pm-plugins/main.js +5 -6
- package/dist/cjs/plugins/list/utils/analytics.js +1 -35
- package/dist/cjs/plugins/list/utils/indentation.js +2 -20
- package/dist/cjs/plugins/list/utils/node.js +2 -106
- package/dist/cjs/plugins/list/utils/selection.js +3 -54
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +2 -2
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +17 -18
- package/dist/cjs/plugins/text-formatting/index.js +23 -21
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +48 -54
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +28 -33
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/cjs/utils/commands.js +3 -109
- package/dist/cjs/utils/document.js +1 -26
- package/dist/cjs/utils/index.js +0 -6
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/es2019/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/list/actions/conversions.js +2 -2
- package/dist/es2019/plugins/list/actions/indent-list-items-selected.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-forward.js +1 -1
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +1 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +2 -2
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +1 -1
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +1 -1
- package/dist/es2019/plugins/list/actions/merge-lists.js +1 -1
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +3 -3
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +1 -1
- package/dist/es2019/plugins/list/commands/indent-list.js +3 -4
- package/dist/es2019/plugins/list/commands/index.js +4 -5
- package/dist/es2019/plugins/list/commands/join-list-item-forward.js +1 -1
- package/dist/es2019/plugins/list/commands/listBackspace.js +1 -2
- package/dist/es2019/plugins/list/commands/outdent-list.js +3 -2
- package/dist/es2019/plugins/list/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/list/utils/analytics.js +0 -36
- package/dist/es2019/plugins/list/utils/indentation.js +0 -18
- package/dist/es2019/plugins/list/utils/node.js +3 -89
- package/dist/es2019/plugins/list/utils/selection.js +1 -52
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/es2019/plugins/text-formatting/index.js +15 -10
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +20 -18
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +11 -12
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/es2019/utils/commands.js +2 -102
- package/dist/es2019/utils/document.js +1 -26
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/esm/plugins/block-type/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/esm/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/list/actions/conversions.js +2 -2
- package/dist/esm/plugins/list/actions/indent-list-items-selected.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-forward.js +1 -1
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +1 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +2 -2
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +1 -1
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +1 -1
- package/dist/esm/plugins/list/actions/merge-lists.js +1 -1
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +3 -3
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +1 -1
- package/dist/esm/plugins/list/commands/indent-list.js +3 -4
- package/dist/esm/plugins/list/commands/index.js +4 -5
- package/dist/esm/plugins/list/commands/join-list-item-forward.js +1 -1
- package/dist/esm/plugins/list/commands/listBackspace.js +1 -2
- package/dist/esm/plugins/list/commands/outdent-list.js +3 -2
- package/dist/esm/plugins/list/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/list/utils/analytics.js +0 -32
- package/dist/esm/plugins/list/utils/indentation.js +0 -17
- package/dist/esm/plugins/list/utils/node.js +3 -81
- package/dist/esm/plugins/list/utils/selection.js +3 -51
- package/dist/esm/plugins/tasks-and-decisions/commands.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/esm/plugins/text-formatting/index.js +23 -21
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +48 -54
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +26 -31
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
- package/dist/esm/utils/commands.js +2 -100
- package/dist/esm/utils/document.js +1 -26
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins/list/actions/join-list-items-forward.d.ts +1 -1
- package/dist/types/plugins/list/commands/indent-list.d.ts +2 -1
- package/dist/types/plugins/list/commands/index.d.ts +2 -1
- package/dist/types/plugins/list/commands/join-list-item-forward.d.ts +1 -1
- package/dist/types/plugins/list/commands/listBackspace.d.ts +1 -1
- package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types/plugins/list/utils/analytics.d.ts +2 -4
- package/dist/types/plugins/list/utils/indentation.d.ts +0 -5
- package/dist/types/plugins/list/utils/node.d.ts +2 -17
- package/dist/types/plugins/list/utils/selection.d.ts +1 -12
- package/dist/types/plugins/text-formatting/pm-plugins/input-rule.d.ts +2 -1
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +2 -2
- package/dist/types/utils/commands.d.ts +3 -32
- package/dist/types/utils/document.d.ts +0 -4
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-forward.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/indent-list.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/commands/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/commands/join-list-item-forward.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/listBackspace.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types-ts4.5/plugins/list/utils/analytics.d.ts +2 -4
- package/dist/types-ts4.5/plugins/list/utils/indentation.d.ts +0 -5
- package/dist/types-ts4.5/plugins/list/utils/node.d.ts +2 -17
- package/dist/types-ts4.5/plugins/list/utils/selection.d.ts +1 -12
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/input-rule.d.ts +2 -1
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +2 -2
- package/dist/types-ts4.5/utils/commands.d.ts +3 -38
- package/dist/types-ts4.5/utils/document.d.ts +0 -4
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/package.json +2 -2
- package/report.api.md +0 -3
- package/tmp/api-report-tmp.d.ts +0 -3
- package/dist/cjs/plugins/list/utils/replace-content.js +0 -24
- package/dist/cjs/utils/prosemirror/autojoin.js +0 -68
- package/dist/es2019/plugins/list/utils/replace-content.js +0 -18
- package/dist/es2019/utils/prosemirror/autojoin.js +0 -57
- package/dist/esm/plugins/list/utils/replace-content.js +0 -17
- package/dist/esm/utils/prosemirror/autojoin.js +0 -63
- package/dist/types/plugins/list/utils/replace-content.d.ts +0 -8
- package/dist/types/utils/prosemirror/autojoin.d.ts +0 -13
- package/dist/types-ts4.5/plugins/list/utils/replace-content.d.ts +0 -8
- package/dist/types-ts4.5/utils/prosemirror/autojoin.d.ts +0 -13
|
@@ -2,9 +2,9 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { ruleWithAnalytics } from '../../../utils/input-rules';
|
|
6
5
|
import { createRule, createPlugin } from '@atlaskit/prosemirror-input-rules';
|
|
7
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, PUNC, SYMBOL } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { inputRuleWithAnalytics } from '@atlaskit/editor-common/utils';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Creates an InputRuleHandler that will match on a regular expression of the
|
|
@@ -80,9 +80,9 @@ function createSingleQuotesRules() {
|
|
|
80
80
|
/**
|
|
81
81
|
* Get replacement rules related to product
|
|
82
82
|
*/
|
|
83
|
-
function getProductRules() {
|
|
83
|
+
function getProductRules(editorAnalyticsAPI) {
|
|
84
84
|
var productRuleWithAnalytics = function productRuleWithAnalytics(product) {
|
|
85
|
-
return
|
|
85
|
+
return inputRuleWithAnalytics(function (_, match) {
|
|
86
86
|
return {
|
|
87
87
|
action: ACTION.SUBSTITUTED,
|
|
88
88
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
@@ -93,7 +93,7 @@ function getProductRules() {
|
|
|
93
93
|
originalSpelling: match[2]
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
});
|
|
96
|
+
}, editorAnalyticsAPI);
|
|
97
97
|
};
|
|
98
98
|
return createReplacementRules({
|
|
99
99
|
Atlassian: /(\s+|^)(atlassian)(\s)$/,
|
|
@@ -107,24 +107,22 @@ function getProductRules() {
|
|
|
107
107
|
/**
|
|
108
108
|
* Get replacement rules related to symbol
|
|
109
109
|
*/
|
|
110
|
-
function getSymbolRules() {
|
|
110
|
+
function getSymbolRules(editorAnalyticsAPI) {
|
|
111
111
|
var symbolToString = {
|
|
112
112
|
'→': SYMBOL.ARROW_RIGHT,
|
|
113
113
|
'←': SYMBOL.ARROW_LEFT,
|
|
114
114
|
'↔︎': SYMBOL.ARROW_DOUBLE
|
|
115
115
|
};
|
|
116
116
|
var symbolRuleWithAnalytics = function symbolRuleWithAnalytics(symbol) {
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
};
|
|
127
|
-
});
|
|
117
|
+
return inputRuleWithAnalytics({
|
|
118
|
+
action: ACTION.SUBSTITUTED,
|
|
119
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
120
|
+
actionSubjectId: ACTION_SUBJECT_ID.SYMBOL,
|
|
121
|
+
eventType: EVENT_TYPE.TRACK,
|
|
122
|
+
attributes: {
|
|
123
|
+
symbol: symbolToString[symbol]
|
|
124
|
+
}
|
|
125
|
+
}, editorAnalyticsAPI);
|
|
128
126
|
};
|
|
129
127
|
return createReplacementRules({
|
|
130
128
|
'→': /(\s+|^)(--?>)(\s)$/,
|
|
@@ -136,25 +134,22 @@ function getSymbolRules() {
|
|
|
136
134
|
/**
|
|
137
135
|
* Get replacement rules related to punctuation
|
|
138
136
|
*/
|
|
139
|
-
function getPunctuationRules() {
|
|
137
|
+
function getPunctuationRules(editorAnalyticsAPI) {
|
|
140
138
|
var punctuationToString = _defineProperty({
|
|
141
139
|
'–': PUNC.DASH,
|
|
142
140
|
'…': PUNC.ELLIPSIS,
|
|
143
|
-
'“': PUNC.QUOTE_DOUBLE,
|
|
144
141
|
'”': PUNC.QUOTE_DOUBLE
|
|
145
142
|
}, PUNC.QUOTE_SINGLE, PUNC.QUOTE_SINGLE);
|
|
146
143
|
var punctuationRuleWithAnalytics = function punctuationRuleWithAnalytics(punctuation) {
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
};
|
|
157
|
-
});
|
|
144
|
+
return inputRuleWithAnalytics({
|
|
145
|
+
action: ACTION.SUBSTITUTED,
|
|
146
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
147
|
+
actionSubjectId: ACTION_SUBJECT_ID.PUNC,
|
|
148
|
+
eventType: EVENT_TYPE.TRACK,
|
|
149
|
+
attributes: {
|
|
150
|
+
punctuation: punctuationToString[punctuation]
|
|
151
|
+
}
|
|
152
|
+
}, editorAnalyticsAPI);
|
|
158
153
|
};
|
|
159
154
|
var dashEllipsisRules = createReplacementRules({
|
|
160
155
|
'–': /(\s+|^)(--)(\s)$/,
|
|
@@ -169,6 +164,6 @@ function getPunctuationRules() {
|
|
|
169
164
|
return punctuationRuleWithAnalytics(PUNC.QUOTE_SINGLE)(rule);
|
|
170
165
|
})));
|
|
171
166
|
}
|
|
172
|
-
export default (function (
|
|
173
|
-
return createPlugin('text-formatting:smart-input', [].concat(_toConsumableArray(getProductRules()), _toConsumableArray(getSymbolRules()), _toConsumableArray(getPunctuationRules())));
|
|
167
|
+
export default (function (editorAnalyticsAPI) {
|
|
168
|
+
return createPlugin('text-formatting:smart-input', [].concat(_toConsumableArray(getProductRules(editorAnalyticsAPI)), _toConsumableArray(getSymbolRules(editorAnalyticsAPI)), _toConsumableArray(getPunctuationRules(editorAnalyticsAPI))));
|
|
174
169
|
});
|
|
@@ -2,9 +2,10 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import { shallowEqual } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { isInsideListItem } from '../../list/utils/selection';
|
|
6
6
|
import { getCurrentIndentLevel as getTaskListIndentLevel, getTaskItemIndex, isInsideTask } from '../../tasks-and-decisions/pm-plugins/helpers';
|
|
7
7
|
import { isIndentationAllowed, MAX_INDENTATION_LEVEL } from '../../indentation/commands';
|
|
8
|
+
import { getListItemAttributes } from '@atlaskit/editor-common/lists';
|
|
8
9
|
export var pluginKey = new PluginKey('indentationButtonsPlugin');
|
|
9
10
|
function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndentation) {
|
|
10
11
|
var state = {
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
1
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
4
|
-
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
5
|
-
var isEmptySelectionAtStart = function isEmptySelectionAtStart(state) {
|
|
6
|
-
var _state$selection = state.selection,
|
|
7
|
-
empty = _state$selection.empty,
|
|
8
|
-
$from = _state$selection.$from;
|
|
9
|
-
return empty && ($from.parentOffset === 0 || state.selection instanceof GapCursorSelection);
|
|
10
|
-
};
|
|
11
|
-
var isEmptySelectionAtEnd = function isEmptySelectionAtEnd(state) {
|
|
12
|
-
var _state$selection2 = state.selection,
|
|
13
|
-
empty = _state$selection2.empty,
|
|
14
|
-
$from = _state$selection2.$from;
|
|
15
|
-
return empty && ($from.end() === $from.pos || state.selection instanceof GapCursorSelection);
|
|
16
|
-
};
|
|
17
3
|
var isFirstChildOfParent = function isFirstChildOfParent(state) {
|
|
18
4
|
var $from = state.selection.$from;
|
|
19
5
|
return $from.depth > 1 ? state.selection instanceof GapCursorSelection && $from.parentOffset === 0 || $from.index($from.depth - 1) === 0 : true;
|
|
@@ -68,44 +54,6 @@ var withScrollIntoView = function withScrollIntoView(command) {
|
|
|
68
54
|
}, view);
|
|
69
55
|
};
|
|
70
56
|
};
|
|
71
|
-
/**
|
|
72
|
-
* Walk forwards from a position until we encounter the (inside) start of
|
|
73
|
-
* the next node, or reach the end of the document.
|
|
74
|
-
*
|
|
75
|
-
* @param $startPos Position to start walking from.
|
|
76
|
-
*/
|
|
77
|
-
var walkNextNode = function walkNextNode($startPos) {
|
|
78
|
-
var $pos = $startPos;
|
|
79
|
-
|
|
80
|
-
// invariant 1: don't walk past the end of the document
|
|
81
|
-
// invariant 2: we are at the beginning or
|
|
82
|
-
// we haven't walked to the start of *any* node
|
|
83
|
-
// parentOffset includes textOffset.
|
|
84
|
-
while ($pos.pos < $pos.doc.nodeSize - 2 && ($pos.pos === $startPos.pos || $pos.parentOffset > 0)) {
|
|
85
|
-
$pos = $pos.doc.resolve($pos.pos + 1);
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
$pos: $pos,
|
|
89
|
-
foundNode: $pos.pos < $pos.doc.nodeSize - 2
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Walk backwards from a position until we encounter the (inside) end of
|
|
95
|
-
* the previous node, or reach the start of the document.
|
|
96
|
-
*
|
|
97
|
-
* @param $startPos Position to start walking from.
|
|
98
|
-
*/
|
|
99
|
-
var walkPrevNode = function walkPrevNode($startPos) {
|
|
100
|
-
var $pos = $startPos;
|
|
101
|
-
while ($pos.pos > 0 && ($pos.pos === $startPos.pos || $pos.parentOffset < $pos.parent.nodeSize - 2)) {
|
|
102
|
-
$pos = $pos.doc.resolve($pos.pos - 1);
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
$pos: $pos,
|
|
106
|
-
foundNode: $pos.pos > 0
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
57
|
|
|
110
58
|
/**
|
|
111
59
|
* Insert content, delete a range and create a new selection
|
|
@@ -117,21 +65,6 @@ var walkPrevNode = function walkPrevNode($startPos) {
|
|
|
117
65
|
* @param deletions the ranges to delete
|
|
118
66
|
*/
|
|
119
67
|
|
|
120
|
-
var insertContentDeleteRange = function insertContentDeleteRange(tr, getSelectionResolvedPos, insertions, deletions) {
|
|
121
|
-
insertions.forEach(function (contentInsert) {
|
|
122
|
-
var _contentInsert = _slicedToArray(contentInsert, 2),
|
|
123
|
-
content = _contentInsert[0],
|
|
124
|
-
pos = _contentInsert[1];
|
|
125
|
-
tr.insert(tr.mapping.map(pos), content);
|
|
126
|
-
});
|
|
127
|
-
deletions.forEach(function (deleteRange) {
|
|
128
|
-
var _deleteRange = _slicedToArray(deleteRange, 2),
|
|
129
|
-
firstPos = _deleteRange[0],
|
|
130
|
-
lastPos = _deleteRange[1];
|
|
131
|
-
tr.delete(tr.mapping.map(firstPos), tr.mapping.map(lastPos));
|
|
132
|
-
});
|
|
133
|
-
tr.setSelection(new TextSelection(getSelectionResolvedPos(tr)));
|
|
134
|
-
};
|
|
135
68
|
var selectNode = function selectNode(pos) {
|
|
136
69
|
return function (state, dispatch) {
|
|
137
70
|
if (dispatch) {
|
|
@@ -140,35 +73,4 @@ var selectNode = function selectNode(pos) {
|
|
|
140
73
|
return true;
|
|
141
74
|
};
|
|
142
75
|
};
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* If the selection is empty, is inside a paragraph node and `canNextNodeMoveUp` is true then delete current paragraph
|
|
146
|
-
* and move the node below it up. The selection will be retained, to be placed in the moved node.
|
|
147
|
-
*
|
|
148
|
-
* @param canNextNodeMoveUp check if node directly after the selection is able to be brought up to selection
|
|
149
|
-
* @returns PM Command
|
|
150
|
-
*/
|
|
151
|
-
var deleteEmptyParagraphAndMoveBlockUp = function deleteEmptyParagraphAndMoveBlockUp(canNextNodeMoveUp) {
|
|
152
|
-
return function (state, dispatch, view) {
|
|
153
|
-
var _state$selection3 = state.selection,
|
|
154
|
-
_state$selection3$$fr = _state$selection3.$from,
|
|
155
|
-
pos = _state$selection3$$fr.pos,
|
|
156
|
-
parent = _state$selection3$$fr.parent,
|
|
157
|
-
$head = _state$selection3.$head,
|
|
158
|
-
empty = _state$selection3.empty,
|
|
159
|
-
tr = state.tr,
|
|
160
|
-
doc = state.doc;
|
|
161
|
-
var _walkNextNode = walkNextNode($head),
|
|
162
|
-
$pos = _walkNextNode.$pos;
|
|
163
|
-
var nextPMNode = doc.nodeAt($pos.pos - 1);
|
|
164
|
-
if (empty && nextPMNode && canNextNodeMoveUp(nextPMNode) && isEmptyParagraph(parent) && view !== null && view !== void 0 && view.endOfTextblock('right')) {
|
|
165
|
-
tr.deleteRange(pos - 1, pos + 1);
|
|
166
|
-
if (dispatch) {
|
|
167
|
-
dispatch(tr);
|
|
168
|
-
}
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
return false;
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
export { isEmptySelectionAtStart, isEmptySelectionAtEnd, isFirstChildOfParent, isNthParentOfType, findCutBefore, withScrollIntoView, walkNextNode, walkPrevNode, insertContentDeleteRange, selectNode, deleteEmptyParagraphAndMoveBlockUp };
|
|
76
|
+
export { isFirstChildOfParent, isNthParentOfType, findCutBefore, withScrollIntoView, selectNode };
|
|
@@ -1,32 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
4
3
|
import { getBreakoutMode } from './node-width';
|
|
5
|
-
import { processRawValue, hasDocAsParent, getStepRange } from '@atlaskit/editor-common/utils';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
9
|
-
*/
|
|
10
|
-
export function hasVisibleContent(node) {
|
|
11
|
-
var isInlineNodeHasVisibleContent = function isInlineNodeHasVisibleContent(inlineNode) {
|
|
12
|
-
return inlineNode.isText ? !!inlineNode.textContent.trim() : inlineNode.type.name !== 'hardBreak';
|
|
13
|
-
};
|
|
14
|
-
if (node.isInline) {
|
|
15
|
-
return isInlineNodeHasVisibleContent(node);
|
|
16
|
-
} else if (node.isBlock && (node.isLeaf || node.isAtom)) {
|
|
17
|
-
return true;
|
|
18
|
-
} else if (!node.childCount) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
for (var _index = 0; _index < node.childCount; _index++) {
|
|
22
|
-
var child = node.child(_index);
|
|
23
|
-
var invisibleNodeTypes = ['paragraph', 'text', 'hardBreak'];
|
|
24
|
-
if (!invisibleNodeTypes.includes(child.type.name) || hasVisibleContent(child)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
4
|
+
import { processRawValue, hasDocAsParent, getStepRange, isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
30
5
|
|
|
31
6
|
/**
|
|
32
7
|
* Checks if a node has any content. Ignores node that only contain empty block nodes.
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { isNodeEmpty } from './document';
|
|
|
7
7
|
import { atTheBeginningOfDoc, atTheEndOfDoc } from './prosemirror/position';
|
|
8
8
|
import { isMediaNode } from '@atlaskit/editor-common/utils';
|
|
9
9
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
10
|
-
export {
|
|
10
|
+
export { isNodeEmpty, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount } from './document';
|
|
11
11
|
export { sanitiseMarksInSelection } from './mark';
|
|
12
12
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
13
13
|
export { setNodeSelection, setGapCursorSelection, setTextSelection } from './selection';
|
package/dist/esm/version.json
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export { historyPluginKey } from './plugins/history';
|
|
|
58
58
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, } from '@atlaskit/editor-common/analytics';
|
|
59
59
|
export type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
60
60
|
export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded, } from './plugins/mobile-dimensions/commands';
|
|
61
|
-
export { setTextSelection, dedupe, getNodesCount, measurements
|
|
61
|
+
export { setTextSelection, dedupe, getNodesCount, measurements } from './utils';
|
|
62
62
|
export { getListCommands } from './utils/list-commands';
|
|
63
63
|
export { ReactEditorView, BaseReactEditorView } from './create-editor';
|
|
64
64
|
export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WalkNode } from '
|
|
1
|
+
import type { WalkNode } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { LIST_TEXT_SCENARIOS } from '../../analytics';
|
|
3
3
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Command } from '../../../types';
|
|
2
|
-
import { EditorAnalyticsAPI
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
4
5
|
export declare const indentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => Command;
|
|
5
6
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ResolvedPos, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { Command } from '../../../types';
|
|
4
|
-
import {
|
|
4
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
6
|
import { outdentList } from './outdent-list';
|
|
6
7
|
import { indentList } from './indent-list';
|
|
7
8
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { Command } from '../../../types';
|
|
3
3
|
export declare const joinListItemForward: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WalkNode } from '
|
|
1
|
+
import type { WalkNode } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { LIST_TEXT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
2
|
import type { Command } from '../../../types';
|
|
2
|
-
import { INPUT_METHOD
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
5
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
5
6
|
export declare const outdentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod | undefined, featureFlags: FeatureFlags) => Command;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { RestartListsAttributesForListOutdented
|
|
3
|
-
export declare const getCommonListAnalyticsAttributes: (state: EditorState) => CommonListAnalyticsAttributes;
|
|
4
|
-
export declare const countListItemsInSelection: (state: EditorState) => number;
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { RestartListsAttributesForListOutdented } from '@atlaskit/editor-common/analytics';
|
|
5
3
|
export declare const RESTART_LISTS_ANALYTICS_KEY = "restartListsAnalytics";
|
|
6
4
|
export declare const getRestartListsAttributes: (tr: Transaction) => RestartListsAttributesForListOutdented;
|
|
7
5
|
export declare const storeRestartListsAttributes: (tr: Transaction, attributes: RestartListsAttributesForListOutdented) => void;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
export declare const getListLiftTarget: (resPos: ResolvedPos) => number;
|
|
4
|
-
export declare const hasValidListIndentationLevel: ({ tr, maxIndentation, }: {
|
|
5
|
-
tr: Transaction;
|
|
6
|
-
maxIndentation: number;
|
|
7
|
-
}) => boolean;
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export { isListNode, isListItemNode, isBulletList, isParagraphNode, } from '@atlaskit/editor-common/utils';
|
|
4
|
-
export declare enum JoinDirection {
|
|
5
|
-
LEFT = 1,
|
|
6
|
-
RIGHT = -1
|
|
7
|
-
}
|
|
8
|
-
type JoinSiblingListsProps = {
|
|
9
|
-
tr: Transaction;
|
|
10
|
-
direction?: JoinDirection;
|
|
11
|
-
forceListType?: NodeType;
|
|
12
|
-
};
|
|
13
|
-
type ListsJoined = {
|
|
14
|
-
orderedList: number;
|
|
15
|
-
bulletList: number;
|
|
16
|
-
};
|
|
17
|
-
export declare const joinSiblingLists: ({ tr, direction, forceListType, }: JoinSiblingListsProps) => ListsJoined;
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
export declare function isListNodeValidContent(node: PMNode): boolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Node as PMNode, ResolvedPos, NodeType, NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { EditorState, Transaction, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
3
|
export declare const isPosInsideParagraph: ($pos: ResolvedPos) => boolean;
|
|
5
4
|
export declare const isPosInsideList: ($pos: ResolvedPos) => boolean;
|
|
6
5
|
export declare const isWrappingPossible: (nodeType: NodeType, selection: Selection) => boolean;
|
|
@@ -8,16 +7,6 @@ export declare const isInsideListItem: (state: EditorState) => boolean;
|
|
|
8
7
|
export declare const isInsideTableCell: (state: EditorState) => boolean;
|
|
9
8
|
export declare const canJoinToPreviousListItem: (state: EditorState) => boolean;
|
|
10
9
|
export declare const selectionContainsList: (tr: Transaction) => PMNode | null;
|
|
11
|
-
export declare const numberNestedLists: (resolvedPos: ResolvedPos) => number;
|
|
12
|
-
export declare const getListItemAttributes: ($pos: ResolvedPos) => {
|
|
13
|
-
indentLevel: number;
|
|
14
|
-
itemIndex: number;
|
|
15
|
-
};
|
|
16
|
-
type NormalizeListItemsSelection = (props: {
|
|
17
|
-
selection: Selection;
|
|
18
|
-
doc: PMNode;
|
|
19
|
-
}) => Selection;
|
|
20
|
-
export declare const normalizeListItemsSelection: NormalizeListItemsSelection;
|
|
21
10
|
type CreateNodeRange = (props: {
|
|
22
11
|
selection: Selection;
|
|
23
12
|
}) => NodeRange | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
5
|
declare enum ValidAutoformatChars {
|
|
5
6
|
STRONG = "__",
|
|
@@ -19,5 +20,5 @@ export declare const italicRegex1: ReverseRegexExp;
|
|
|
19
20
|
export declare const italicRegex2: ReverseRegexExp;
|
|
20
21
|
export declare const strikeRegex: ReverseRegexExp;
|
|
21
22
|
export declare const codeRegex: ReverseRegexExp;
|
|
22
|
-
export declare function inputRulePlugin(schema: Schema,
|
|
23
|
+
export declare function inputRulePlugin(schema: Schema, _featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
23
24
|
export default inputRulePlugin;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const _default: (
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
declare const _default: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/safe-plugin").SafePlugin<any>;
|
|
3
3
|
export default _default;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { EditorState
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { ResolvedPos
|
|
3
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { Command, HigherOrderCommand } from '@atlaskit/editor-common/types';
|
|
5
|
-
declare const isEmptySelectionAtStart: (state: EditorState) => boolean;
|
|
6
|
-
declare const isEmptySelectionAtEnd: (state: EditorState) => boolean;
|
|
7
5
|
declare const isFirstChildOfParent: (state: EditorState) => boolean;
|
|
8
6
|
/**
|
|
9
7
|
* Creates a filter that checks if the node at a given number of parents above the current
|
|
@@ -16,24 +14,6 @@ declare const isFirstChildOfParent: (state: EditorState) => boolean;
|
|
|
16
14
|
declare const isNthParentOfType: (nodeType: string, depthAway: number) => (state: EditorState, view?: EditorView) => boolean;
|
|
17
15
|
declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
|
|
18
16
|
declare const withScrollIntoView: HigherOrderCommand;
|
|
19
|
-
export type WalkNode = {
|
|
20
|
-
$pos: ResolvedPos;
|
|
21
|
-
foundNode: boolean;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Walk forwards from a position until we encounter the (inside) start of
|
|
25
|
-
* the next node, or reach the end of the document.
|
|
26
|
-
*
|
|
27
|
-
* @param $startPos Position to start walking from.
|
|
28
|
-
*/
|
|
29
|
-
declare const walkNextNode: ($startPos: ResolvedPos) => WalkNode;
|
|
30
|
-
/**
|
|
31
|
-
* Walk backwards from a position until we encounter the (inside) end of
|
|
32
|
-
* the previous node, or reach the start of the document.
|
|
33
|
-
*
|
|
34
|
-
* @param $startPos Position to start walking from.
|
|
35
|
-
*/
|
|
36
|
-
declare const walkPrevNode: ($startPos: ResolvedPos) => WalkNode;
|
|
37
17
|
/**
|
|
38
18
|
* Insert content, delete a range and create a new selection
|
|
39
19
|
* This function automatically handles the mapping of positions for insertion and deletion.
|
|
@@ -43,14 +23,5 @@ declare const walkPrevNode: ($startPos: ResolvedPos) => WalkNode;
|
|
|
43
23
|
* @param insertions content to insert at the specified position
|
|
44
24
|
* @param deletions the ranges to delete
|
|
45
25
|
*/
|
|
46
|
-
declare const insertContentDeleteRange: (tr: Transaction, getSelectionResolvedPos: (tr: Transaction) => ResolvedPos, insertions: [Fragment, number][], deletions: [number, number][]) => void;
|
|
47
26
|
declare const selectNode: (pos: number) => Command;
|
|
48
|
-
|
|
49
|
-
* If the selection is empty, is inside a paragraph node and `canNextNodeMoveUp` is true then delete current paragraph
|
|
50
|
-
* and move the node below it up. The selection will be retained, to be placed in the moved node.
|
|
51
|
-
*
|
|
52
|
-
* @param canNextNodeMoveUp check if node directly after the selection is able to be brought up to selection
|
|
53
|
-
* @returns PM Command
|
|
54
|
-
*/
|
|
55
|
-
declare const deleteEmptyParagraphAndMoveBlockUp: (canNextNodeMoveUp: (nextNode: PMNode) => boolean) => Command;
|
|
56
|
-
export { isEmptySelectionAtStart, isEmptySelectionAtEnd, isFirstChildOfParent, isNthParentOfType, findCutBefore, withScrollIntoView, walkNextNode, walkPrevNode, insertContentDeleteRange, selectNode, deleteEmptyParagraphAndMoveBlockUp, };
|
|
27
|
+
export { isFirstChildOfParent, isNthParentOfType, findCutBefore, withScrollIntoView, selectNode, };
|
|
@@ -6,10 +6,6 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
6
6
|
import type { Transformer, ReplaceRawValue } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { DispatchAnalyticsEvent } from '../plugins/analytics/types/dispatch-analytics-event';
|
|
8
8
|
import type { BreakoutMarkAttrs } from '@atlaskit/adf-schema';
|
|
9
|
-
/**
|
|
10
|
-
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
11
|
-
*/
|
|
12
|
-
export declare function hasVisibleContent(node: Node): boolean;
|
|
13
9
|
/**
|
|
14
10
|
* Checks if a node has any content. Ignores node that only contain empty block nodes.
|
|
15
11
|
*/
|
|
@@ -2,7 +2,7 @@ import type { MarkType, Node, ResolvedPos, Schema, Slice } from '@atlaskit/edito
|
|
|
2
2
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
|
|
4
4
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
5
|
-
export {
|
|
5
|
+
export { isNodeEmpty, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount, } from './document';
|
|
6
6
|
export { sanitiseMarksInSelection } from './mark';
|
|
7
7
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
8
8
|
export { setNodeSelection, setGapCursorSelection, setTextSelection, } from './selection';
|
|
@@ -58,7 +58,7 @@ export { historyPluginKey } from './plugins/history';
|
|
|
58
58
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, } from '@atlaskit/editor-common/analytics';
|
|
59
59
|
export type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
60
60
|
export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded, } from './plugins/mobile-dimensions/commands';
|
|
61
|
-
export { setTextSelection, dedupe, getNodesCount, measurements
|
|
61
|
+
export { setTextSelection, dedupe, getNodesCount, measurements } from './utils';
|
|
62
62
|
export { getListCommands } from './utils/list-commands';
|
|
63
63
|
export { ReactEditorView, BaseReactEditorView } from './create-editor';
|
|
64
64
|
export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WalkNode } from '
|
|
1
|
+
import type { WalkNode } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { LIST_TEXT_SCENARIOS } from '../../analytics';
|
|
3
3
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Command } from '../../../types';
|
|
2
|
-
import { EditorAnalyticsAPI
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
4
5
|
export declare const indentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => Command;
|
|
5
6
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ResolvedPos, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { Command } from '../../../types';
|
|
4
|
-
import {
|
|
4
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
6
|
import { outdentList } from './outdent-list';
|
|
6
7
|
import { indentList } from './indent-list';
|
|
7
8
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { Command } from '../../../types';
|
|
3
3
|
export declare const joinListItemForward: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WalkNode } from '
|
|
1
|
+
import type { WalkNode } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { LIST_TEXT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
2
|
import type { Command } from '../../../types';
|
|
2
|
-
import { INPUT_METHOD
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
5
|
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
5
6
|
export declare const outdentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod | undefined, featureFlags: FeatureFlags) => Command;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { RestartListsAttributesForListOutdented
|
|
3
|
-
export declare const getCommonListAnalyticsAttributes: (state: EditorState) => CommonListAnalyticsAttributes;
|
|
4
|
-
export declare const countListItemsInSelection: (state: EditorState) => number;
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { RestartListsAttributesForListOutdented } from '@atlaskit/editor-common/analytics';
|
|
5
3
|
export declare const RESTART_LISTS_ANALYTICS_KEY = "restartListsAnalytics";
|
|
6
4
|
export declare const getRestartListsAttributes: (tr: Transaction) => RestartListsAttributesForListOutdented;
|
|
7
5
|
export declare const storeRestartListsAttributes: (tr: Transaction, attributes: RestartListsAttributesForListOutdented) => void;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
export declare const getListLiftTarget: (resPos: ResolvedPos) => number;
|
|
4
|
-
export declare const hasValidListIndentationLevel: ({ tr, maxIndentation, }: {
|
|
5
|
-
tr: Transaction;
|
|
6
|
-
maxIndentation: number;
|
|
7
|
-
}) => boolean;
|