@atlaskit/editor-core 187.17.6 → 187.18.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 +18 -0
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/annotation/toolbar.js +31 -8
- package/dist/cjs/plugins/help-dialog/ui/index.js +26 -27
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/list/index.js +5 -5
- package/dist/cjs/plugins/list/transforms.js +1 -223
- package/dist/cjs/plugins/paste/commands.js +224 -2
- package/dist/cjs/plugins/paste/pm-plugins/main.js +3 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +3 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +4 -4
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/annotation/toolbar.js +34 -9
- package/dist/es2019/plugins/help-dialog/ui/index.js +1 -2
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/list/index.js +1 -1
- package/dist/es2019/plugins/list/transforms.js +2 -210
- package/dist/es2019/plugins/paste/commands.js +210 -2
- package/dist/es2019/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +1 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/annotation/toolbar.js +30 -7
- package/dist/esm/plugins/help-dialog/ui/index.js +1 -2
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/list/index.js +1 -1
- package/dist/esm/plugins/list/transforms.js +2 -219
- package/dist/esm/plugins/paste/commands.js +218 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/labs/next/presets/default.d.ts +28 -28
- package/dist/types/plugins/annotation/types.d.ts +9 -3
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +1 -2
- package/dist/types/plugins/list/transforms.d.ts +0 -13
- package/dist/types/plugins/paste/commands.d.ts +14 -0
- package/dist/types/plugins/paste/index.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +0 -5
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +28 -28
- package/dist/types-ts4.5/plugins/annotation/types.d.ts +9 -3
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +1 -2
- package/dist/types-ts4.5/plugins/list/transforms.d.ts +0 -13
- package/dist/types-ts4.5/plugins/paste/commands.d.ts +14 -0
- package/dist/types-ts4.5/plugins/paste/index.d.ts +2 -0
- package/package.json +3 -2
- package/report.api.md +1 -24
- package/tmp/api-report-tmp.d.ts +1 -21
- package/dist/cjs/plugins/text-formatting/actions.js +0 -188
- package/dist/cjs/plugins/text-formatting/commands/clear-formatting.js +0 -111
- package/dist/cjs/plugins/text-formatting/commands/text-formatting.js +0 -143
- package/dist/cjs/plugins/text-formatting/commands/transform-to-code.js +0 -68
- package/dist/cjs/plugins/text-formatting/index.js +0 -136
- package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +0 -21
- package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting.js +0 -36
- package/dist/cjs/plugins/text-formatting/pm-plugins/cursor.js +0 -55
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +0 -276
- package/dist/cjs/plugins/text-formatting/pm-plugins/keymap.js +0 -52
- package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +0 -113
- package/dist/cjs/plugins/text-formatting/pm-plugins/plugin-key.js +0 -9
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +0 -176
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/constants.js +0 -19
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +0 -86
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +0 -53
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +0 -225
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/menu-state.js +0 -23
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.js +0 -60
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +0 -201
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/more-button.js +0 -40
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +0 -46
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/types.js +0 -17
- package/dist/cjs/plugins/text-formatting/utils/cell-selection.js +0 -12
- package/dist/cjs/plugins/text-formatting/utils.js +0 -86
- package/dist/es2019/plugins/text-formatting/actions.js +0 -161
- package/dist/es2019/plugins/text-formatting/commands/clear-formatting.js +0 -105
- package/dist/es2019/plugins/text-formatting/commands/text-formatting.js +0 -144
- package/dist/es2019/plugins/text-formatting/commands/transform-to-code.js +0 -71
- package/dist/es2019/plugins/text-formatting/index.js +0 -127
- package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +0 -10
- package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting.js +0 -26
- package/dist/es2019/plugins/text-formatting/pm-plugins/cursor.js +0 -52
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +0 -244
- package/dist/es2019/plugins/text-formatting/pm-plugins/keymap.js +0 -43
- package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +0 -109
- package/dist/es2019/plugins/text-formatting/pm-plugins/plugin-key.js +0 -2
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +0 -155
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/constants.js +0 -20
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +0 -66
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +0 -42
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +0 -210
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/menu-state.js +0 -11
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.js +0 -48
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +0 -168
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/more-button.js +0 -32
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +0 -36
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/types.js +0 -10
- package/dist/es2019/plugins/text-formatting/utils/cell-selection.js +0 -5
- package/dist/es2019/plugins/text-formatting/utils.js +0 -74
- package/dist/esm/plugins/text-formatting/actions.js +0 -168
- package/dist/esm/plugins/text-formatting/commands/clear-formatting.js +0 -101
- package/dist/esm/plugins/text-formatting/commands/text-formatting.js +0 -134
- package/dist/esm/plugins/text-formatting/commands/transform-to-code.js +0 -61
- package/dist/esm/plugins/text-formatting/index.js +0 -128
- package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +0 -10
- package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting.js +0 -28
- package/dist/esm/plugins/text-formatting/pm-plugins/cursor.js +0 -48
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +0 -259
- package/dist/esm/plugins/text-formatting/pm-plugins/keymap.js +0 -43
- package/dist/esm/plugins/text-formatting/pm-plugins/main.js +0 -98
- package/dist/esm/plugins/text-formatting/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +0 -169
- package/dist/esm/plugins/text-formatting/ui/Toolbar/constants.js +0 -8
- package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +0 -75
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +0 -45
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +0 -213
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/menu-state.js +0 -15
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.js +0 -50
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +0 -191
- package/dist/esm/plugins/text-formatting/ui/Toolbar/more-button.js +0 -31
- package/dist/esm/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +0 -35
- package/dist/esm/plugins/text-formatting/ui/Toolbar/types.js +0 -10
- package/dist/esm/plugins/text-formatting/utils/cell-selection.js +0 -5
- package/dist/esm/plugins/text-formatting/utils.js +0 -75
- package/dist/types/plugins/text-formatting/actions.d.ts +0 -22
- package/dist/types/plugins/text-formatting/commands/clear-formatting.d.ts +0 -6
- package/dist/types/plugins/text-formatting/commands/text-formatting.d.ts +0 -5
- package/dist/types/plugins/text-formatting/commands/transform-to-code.d.ts +0 -2
- package/dist/types/plugins/text-formatting/index.d.ts +0 -17
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting-keymap.d.ts +0 -4
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -8
- package/dist/types/plugins/text-formatting/pm-plugins/cursor.d.ts +0 -3
- package/dist/types/plugins/text-formatting/pm-plugins/input-rule.d.ts +0 -24
- package/dist/types/plugins/text-formatting/pm-plugins/keymap.d.ts +0 -4
- package/dist/types/plugins/text-formatting/pm-plugins/main.d.ts +0 -7
- package/dist/types/plugins/text-formatting/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +0 -3
- package/dist/types/plugins/text-formatting/ui/Toolbar/constants.d.ts +0 -6
- package/dist/types/plugins/text-formatting/ui/Toolbar/dropdown-menu.d.ts +0 -15
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.d.ts +0 -7
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.d.ts +0 -14
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/menu-state.d.ts +0 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.d.ts +0 -20
- package/dist/types/plugins/text-formatting/ui/Toolbar/index.d.ts +0 -26
- package/dist/types/plugins/text-formatting/ui/Toolbar/more-button.d.ts +0 -13
- package/dist/types/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.d.ts +0 -9
- package/dist/types/plugins/text-formatting/ui/Toolbar/types.d.ts +0 -32
- package/dist/types/plugins/text-formatting/utils/cell-selection.d.ts +0 -3
- package/dist/types/plugins/text-formatting/utils.d.ts +0 -11
- package/dist/types-ts4.5/plugins/text-formatting/actions.d.ts +0 -22
- package/dist/types-ts4.5/plugins/text-formatting/commands/clear-formatting.d.ts +0 -6
- package/dist/types-ts4.5/plugins/text-formatting/commands/text-formatting.d.ts +0 -5
- package/dist/types-ts4.5/plugins/text-formatting/commands/transform-to-code.d.ts +0 -2
- package/dist/types-ts4.5/plugins/text-formatting/index.d.ts +0 -19
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting-keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -8
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/cursor.d.ts +0 -3
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/input-rule.d.ts +0 -24
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/main.d.ts +0 -7
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +0 -3
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/constants.d.ts +0 -6
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/dropdown-menu.d.ts +0 -15
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.d.ts +0 -7
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.d.ts +0 -14
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/menu-state.d.ts +0 -5
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.d.ts +0 -20
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/index.d.ts +0 -26
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/more-button.d.ts +0 -13
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.d.ts +0 -9
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/types.d.ts +0 -32
- package/dist/types-ts4.5/plugins/text-formatting/utils/cell-selection.d.ts +0 -3
- package/dist/types-ts4.5/plugins/text-formatting/utils.d.ts +0 -11
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
3
|
import { createCommand } from './pm-plugins/plugin-factory';
|
|
2
4
|
import { PastePluginActionTypes as ActionTypes } from './actions';
|
|
3
|
-
|
|
5
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import { isListNode, mapChildren, mapSlice } from '@atlaskit/editor-common/utils';
|
|
7
|
+
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
+
import { autoJoin } from '@atlaskit/editor-prosemirror/commands';
|
|
4
9
|
/**
|
|
5
10
|
* Use this to register macro link positions during a paste operation, that you
|
|
6
11
|
* want to track in a document over time, through any document changes.
|
|
@@ -28,4 +33,216 @@ export var stopTrackingPastedMacroPositions = function stopTrackingPastedMacroPo
|
|
|
28
33
|
pastedMacroPositionKeys: pastedMacroPositionKeys
|
|
29
34
|
};
|
|
30
35
|
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// matchers for text lists
|
|
39
|
+
var bullets = /^\s*[\*\-\u2022](\s+|\s+$)/;
|
|
40
|
+
var numbers = /^\s*\d[\.\)](\s+|$)/;
|
|
41
|
+
var getListType = function getListType(node, schema) {
|
|
42
|
+
if (!node.text) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
var _schema$nodes = schema.nodes,
|
|
46
|
+
bulletList = _schema$nodes.bulletList,
|
|
47
|
+
orderedList = _schema$nodes.orderedList;
|
|
48
|
+
return [{
|
|
49
|
+
node: bulletList,
|
|
50
|
+
matcher: bullets
|
|
51
|
+
}, {
|
|
52
|
+
node: orderedList,
|
|
53
|
+
matcher: numbers
|
|
54
|
+
}].reduce(function (lastMatch, listType) {
|
|
55
|
+
if (lastMatch) {
|
|
56
|
+
return lastMatch;
|
|
57
|
+
}
|
|
58
|
+
var match = node.text.match(listType.matcher);
|
|
59
|
+
return match ? [listType.node, match[0].length] : lastMatch;
|
|
60
|
+
}, null);
|
|
61
|
+
};
|
|
62
|
+
var extractListFromParagraph = function extractListFromParagraph(node, parent, schema) {
|
|
63
|
+
var _schema$nodes2 = schema.nodes,
|
|
64
|
+
hardBreak = _schema$nodes2.hardBreak,
|
|
65
|
+
bulletList = _schema$nodes2.bulletList,
|
|
66
|
+
orderedList = _schema$nodes2.orderedList;
|
|
67
|
+
var content = mapChildren(node.content, function (node) {
|
|
68
|
+
return node;
|
|
69
|
+
});
|
|
70
|
+
var listTypes = [bulletList, orderedList];
|
|
71
|
+
|
|
72
|
+
// wrap each line into a listItem and a containing list
|
|
73
|
+
var listified = content.map(function (child, index) {
|
|
74
|
+
var listMatch = getListType(child, schema);
|
|
75
|
+
var prevChild = index > 0 && content[index - 1];
|
|
76
|
+
|
|
77
|
+
// only extract list when preceded by a hardbreak
|
|
78
|
+
if (prevChild && prevChild.type !== hardBreak) {
|
|
79
|
+
return child;
|
|
80
|
+
}
|
|
81
|
+
if (!listMatch || !child.text) {
|
|
82
|
+
return child;
|
|
83
|
+
}
|
|
84
|
+
var _listMatch = _slicedToArray(listMatch, 2),
|
|
85
|
+
nodeType = _listMatch[0],
|
|
86
|
+
length = _listMatch[1];
|
|
87
|
+
|
|
88
|
+
// convert to list item
|
|
89
|
+
var newText = child.text.substr(length);
|
|
90
|
+
var listItemNode = schema.nodes.listItem.createAndFill(undefined, schema.nodes.paragraph.createChecked(undefined, newText.length ? schema.text(newText) : undefined));
|
|
91
|
+
if (!listItemNode) {
|
|
92
|
+
return child;
|
|
93
|
+
}
|
|
94
|
+
var newList = nodeType.createChecked(undefined, [listItemNode]);
|
|
95
|
+
// Check whether our new list is valid content in our current structure,
|
|
96
|
+
// otherwise dont convert.
|
|
97
|
+
if (parent && !parent.type.validContent(Fragment.from(newList))) {
|
|
98
|
+
return child;
|
|
99
|
+
}
|
|
100
|
+
return newList;
|
|
101
|
+
}).filter(function (child, idx, arr) {
|
|
102
|
+
// remove hardBreaks that have a list node on either side
|
|
103
|
+
|
|
104
|
+
// wasn't hardBreak, leave as-is
|
|
105
|
+
if (child.type !== hardBreak) {
|
|
106
|
+
return child;
|
|
107
|
+
}
|
|
108
|
+
if (idx > 0 && listTypes.indexOf(arr[idx - 1].type) > -1) {
|
|
109
|
+
// list node on the left
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
if (idx < arr.length - 1 && listTypes.indexOf(arr[idx + 1].type) > -1) {
|
|
113
|
+
// list node on the right
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
return child;
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// try to join
|
|
120
|
+
var mockState = EditorState.create({
|
|
121
|
+
schema: schema
|
|
122
|
+
});
|
|
123
|
+
var joinedListsTr;
|
|
124
|
+
var mockDispatch = function mockDispatch(tr) {
|
|
125
|
+
joinedListsTr = tr;
|
|
126
|
+
};
|
|
127
|
+
autoJoin(function (state, dispatch) {
|
|
128
|
+
if (!dispatch) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Return false to prevent replaceWith from wrapping the text node in a paragraph
|
|
133
|
+
// paragraph since that will be done later. If it's done here, it will fail
|
|
134
|
+
// the paragraph.validContent check.
|
|
135
|
+
// Dont return false if there are lists, as they arent validContent for paragraphs
|
|
136
|
+
// and will result in hanging textNodes
|
|
137
|
+
var containsList = listified.some(function (node) {
|
|
138
|
+
return node.type === bulletList || node.type === orderedList;
|
|
139
|
+
});
|
|
140
|
+
if (listified.some(function (node) {
|
|
141
|
+
return node.isText;
|
|
142
|
+
}) && !containsList) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
dispatch(state.tr.replaceWith(0, 2, listified));
|
|
146
|
+
return true;
|
|
147
|
+
}, function (before, after) {
|
|
148
|
+
return isListNode(before) && isListNode(after);
|
|
149
|
+
})(mockState, mockDispatch);
|
|
150
|
+
var fragment = joinedListsTr ? joinedListsTr.doc.content : Fragment.from(listified);
|
|
151
|
+
|
|
152
|
+
// try to re-wrap fragment in paragraph (which is the original node we unwrapped)
|
|
153
|
+
var paragraph = schema.nodes.paragraph;
|
|
154
|
+
if (paragraph.validContent(fragment)) {
|
|
155
|
+
return Fragment.from(paragraph.create(node.attrs, fragment, node.marks));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// fragment now contains other nodes, get Prosemirror to wrap with ContentMatch later
|
|
159
|
+
return fragment;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// above will wrap everything in paragraphs for us
|
|
163
|
+
export var upgradeTextToLists = function upgradeTextToLists(slice, schema) {
|
|
164
|
+
return mapSlice(slice, function (node, parent) {
|
|
165
|
+
if (node.type === schema.nodes.paragraph) {
|
|
166
|
+
return extractListFromParagraph(node, parent, schema);
|
|
167
|
+
}
|
|
168
|
+
return node;
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
export var splitParagraphs = function splitParagraphs(slice, schema) {
|
|
172
|
+
// exclude Text nodes with a code mark, since we transform those later
|
|
173
|
+
// into a codeblock
|
|
174
|
+
var hasCodeMark = false;
|
|
175
|
+
slice.content.forEach(function (child) {
|
|
176
|
+
hasCodeMark = hasCodeMark || child.marks.some(function (mark) {
|
|
177
|
+
return mark.type === schema.marks.code;
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// slice might just be a raw text string
|
|
182
|
+
if (schema.nodes.paragraph.validContent(slice.content) && !hasCodeMark) {
|
|
183
|
+
var replSlice = splitIntoParagraphs({
|
|
184
|
+
fragment: slice.content,
|
|
185
|
+
schema: schema
|
|
186
|
+
});
|
|
187
|
+
return new Slice(replSlice, slice.openStart + 1, slice.openEnd + 1);
|
|
188
|
+
}
|
|
189
|
+
return mapSlice(slice, function (node) {
|
|
190
|
+
if (node.type === schema.nodes.paragraph) {
|
|
191
|
+
return splitIntoParagraphs({
|
|
192
|
+
fragment: node.content,
|
|
193
|
+
blockMarks: node.marks,
|
|
194
|
+
schema: schema
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return node;
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Walks the slice, creating paragraphs that were previously separated by hardbreaks.
|
|
203
|
+
* Returns the original paragraph node (as a fragment), or a fragment containing multiple nodes.
|
|
204
|
+
*/
|
|
205
|
+
export var splitIntoParagraphs = function splitIntoParagraphs(_ref) {
|
|
206
|
+
var fragment = _ref.fragment,
|
|
207
|
+
_ref$blockMarks = _ref.blockMarks,
|
|
208
|
+
blockMarks = _ref$blockMarks === void 0 ? [] : _ref$blockMarks,
|
|
209
|
+
schema = _ref.schema;
|
|
210
|
+
var paragraphs = [];
|
|
211
|
+
var curChildren = [];
|
|
212
|
+
var lastNode = null;
|
|
213
|
+
var _schema$nodes3 = schema.nodes,
|
|
214
|
+
hardBreak = _schema$nodes3.hardBreak,
|
|
215
|
+
paragraph = _schema$nodes3.paragraph;
|
|
216
|
+
fragment.forEach(function (node, i) {
|
|
217
|
+
var isNodeValidContentForParagraph = schema.nodes.paragraph.validContent(Fragment.from(node));
|
|
218
|
+
if (!isNodeValidContentForParagraph) {
|
|
219
|
+
paragraphs.push(node);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
// ED-14725 Fixed the issue that it make duplicated line
|
|
223
|
+
// when pasting <br /> from google docs.
|
|
224
|
+
if (i === 0 && node.type === hardBreak) {
|
|
225
|
+
paragraphs.push(paragraph.createChecked(undefined, curChildren, _toConsumableArray(blockMarks)));
|
|
226
|
+
lastNode = node;
|
|
227
|
+
return;
|
|
228
|
+
} else if (lastNode && lastNode.type === hardBreak && node.type === hardBreak) {
|
|
229
|
+
// double hardbreak
|
|
230
|
+
|
|
231
|
+
// backtrack a little; remove the trailing hardbreak we added last loop
|
|
232
|
+
curChildren.pop();
|
|
233
|
+
|
|
234
|
+
// create a new paragraph
|
|
235
|
+
paragraphs.push(paragraph.createChecked(undefined, curChildren, _toConsumableArray(blockMarks)));
|
|
236
|
+
curChildren = [];
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// add to this paragraph
|
|
241
|
+
curChildren.push(node);
|
|
242
|
+
lastNode = node;
|
|
243
|
+
});
|
|
244
|
+
if (curChildren.length) {
|
|
245
|
+
paragraphs.push(paragraph.createChecked(undefined, curChildren, _toConsumableArray(blockMarks)));
|
|
246
|
+
}
|
|
247
|
+
return Fragment.from(paragraphs.length ? paragraphs : [paragraph.createAndFill(undefined, undefined, _toConsumableArray(blockMarks))]);
|
|
31
248
|
};
|
|
@@ -19,7 +19,7 @@ import { ACTION, analyticsPluginKey, INPUT_METHOD, PasteTypes } from '../../anal
|
|
|
19
19
|
import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
|
|
20
20
|
import { measureRender } from '@atlaskit/editor-common/utils';
|
|
21
21
|
import { transformSliceToCorrectMediaWrapper, unwrapNestedMediaElements } from '../../media/utils/media-common';
|
|
22
|
-
import { upgradeTextToLists, splitParagraphs } from '
|
|
22
|
+
import { upgradeTextToLists, splitParagraphs } from '../commands';
|
|
23
23
|
import { md } from '@atlaskit/editor-common/paste';
|
|
24
24
|
import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
|
|
25
25
|
import { containsAnyAnnotations, stripNonExistingAnnotations } from '../../annotation/utils';
|
|
@@ -7,7 +7,7 @@ import IndentIcon from '@atlaskit/icon/glyph/editor/indent';
|
|
|
7
7
|
import OutdentIcon from '@atlaskit/icon/glyph/editor/outdent';
|
|
8
8
|
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, ToolTipContent, tooltip } from '../../../keymaps';
|
|
9
9
|
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../ui/ToolbarButton';
|
|
10
|
-
import { messages } from '
|
|
10
|
+
import { listMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { messages as indentationMessages } from '../../indentation/messages';
|
|
12
12
|
import { separatorStyles, buttonGroupStyle } from '@atlaskit/editor-common/styles';
|
|
13
13
|
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
@@ -10,7 +10,7 @@ import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/ed
|
|
|
10
10
|
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
11
11
|
import { expandIconWrapperStyle, shortcutStyle } from '../../../ui/styles';
|
|
12
12
|
import { wrapperStyle, separatorStyles } from '@atlaskit/editor-common/styles';
|
|
13
|
-
import {
|
|
13
|
+
import { listMessages } from '@atlaskit/editor-common/messages';
|
|
14
14
|
import { messages as indentationMessages } from '../../indentation/messages';
|
|
15
15
|
export function ToolbarDropdown(props) {
|
|
16
16
|
var _useIntl = useIntl(),
|
package/dist/esm/version.json
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -77,8 +77,3 @@ export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
|
77
77
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
78
78
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
79
79
|
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
80
|
-
export type {
|
|
81
|
-
/**
|
|
82
|
-
* Temporary, until we extract the plugin to its own package
|
|
83
|
-
* @deprecated Don't use this
|
|
84
|
-
*/ textFormattingPlugin, } from './plugins';
|
|
@@ -255,13 +255,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
255
255
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
256
256
|
}>>];
|
|
257
257
|
actions: {
|
|
258
|
-
toggleSuperscript: import("
|
|
259
|
-
toggleSubscript: import("
|
|
260
|
-
toggleStrike: import("
|
|
261
|
-
toggleCode: import("
|
|
262
|
-
toggleUnderline: import("
|
|
263
|
-
toggleEm: import("
|
|
264
|
-
toggleStrong: import("
|
|
258
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
259
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
260
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
261
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
262
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
263
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
264
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
265
265
|
};
|
|
266
266
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
267
267
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -295,13 +295,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
295
295
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
296
296
|
}>>];
|
|
297
297
|
actions: {
|
|
298
|
-
toggleSuperscript: import("
|
|
299
|
-
toggleSubscript: import("
|
|
300
|
-
toggleStrike: import("
|
|
301
|
-
toggleCode: import("
|
|
302
|
-
toggleUnderline: import("
|
|
303
|
-
toggleEm: import("
|
|
304
|
-
toggleStrong: import("
|
|
298
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
299
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
300
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
301
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
302
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
303
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
304
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
305
305
|
};
|
|
306
306
|
}>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
307
307
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
@@ -618,13 +618,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
618
618
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
619
619
|
}>>];
|
|
620
620
|
actions: {
|
|
621
|
-
toggleSuperscript: import("
|
|
622
|
-
toggleSubscript: import("
|
|
623
|
-
toggleStrike: import("
|
|
624
|
-
toggleCode: import("
|
|
625
|
-
toggleUnderline: import("
|
|
626
|
-
toggleEm: import("
|
|
627
|
-
toggleStrong: import("
|
|
621
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
622
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
623
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
624
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
625
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
626
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
627
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
628
628
|
};
|
|
629
629
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
630
630
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -658,13 +658,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
658
658
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
659
659
|
}>>];
|
|
660
660
|
actions: {
|
|
661
|
-
toggleSuperscript: import("
|
|
662
|
-
toggleSubscript: import("
|
|
663
|
-
toggleStrike: import("
|
|
664
|
-
toggleCode: import("
|
|
665
|
-
toggleUnderline: import("
|
|
666
|
-
toggleEm: import("
|
|
667
|
-
toggleStrong: import("
|
|
661
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
662
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
663
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
664
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
665
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
666
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
667
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
668
668
|
};
|
|
669
669
|
}>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
670
670
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
-
import { AnnotationUpdateEmitter } from './update-provider';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { AnnotationUpdateEmitter } from './update-provider';
|
|
4
4
|
export type AnnotationInfo = {
|
|
5
5
|
id: string;
|
|
6
6
|
type: AnnotationTypes.INLINE_COMMENT;
|
|
@@ -73,4 +73,10 @@ export declare const AnnotationTestIds: {
|
|
|
73
73
|
componentSave: string;
|
|
74
74
|
componentClose: string;
|
|
75
75
|
};
|
|
76
|
+
export type CoordsAtPos = {
|
|
77
|
+
top: number;
|
|
78
|
+
bottom: number;
|
|
79
|
+
left: number;
|
|
80
|
+
right: number;
|
|
81
|
+
};
|
|
76
82
|
export {};
|
|
@@ -31,7 +31,6 @@ export { default as saveOnEnterPlugin } from './save-on-enter';
|
|
|
31
31
|
export { default as submitEditorPlugin } from './submit-editor';
|
|
32
32
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
33
33
|
export { default as textColorPlugin } from './text-color';
|
|
34
|
-
export { default as textFormattingPlugin } from './text-formatting';
|
|
35
34
|
export { default as typeAheadPlugin } from './type-ahead';
|
|
36
35
|
export { default as unsupportedContentPlugin } from './unsupported-content';
|
|
37
36
|
export { default as floatingToolbarPlugin } from './floating-toolbar';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { InputRuleWrapper } from '@atlaskit/
|
|
2
|
+
import type { InputRuleWrapper, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
4
|
type WrappingRuleProps = {
|
|
6
5
|
featureFlags: FeatureFlags;
|
|
7
6
|
match: RegExp;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import type { Schema, Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
1
|
import type { Transaction, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
2
|
export declare function liftFollowingList(from: number, to: number, rootListDepth: number, tr: Transaction): Transaction;
|
|
5
3
|
export declare function liftNodeSelectionList(selection: Selection, tr: Transaction): Transaction;
|
|
6
4
|
export declare function liftTextSelectionList(selection: Selection, tr: Transaction): Transaction;
|
|
7
|
-
/**
|
|
8
|
-
* Walks the slice, creating paragraphs that were previously separated by hardbreaks.
|
|
9
|
-
* Returns the original paragraph node (as a fragment), or a fragment containing multiple nodes.
|
|
10
|
-
*/
|
|
11
|
-
export declare const splitIntoParagraphs: ({ fragment, blockMarks, schema, }: {
|
|
12
|
-
fragment: Fragment;
|
|
13
|
-
blockMarks?: readonly Mark[] | undefined;
|
|
14
|
-
schema: Schema;
|
|
15
|
-
}) => Fragment;
|
|
16
|
-
export declare const splitParagraphs: (slice: Slice, schema: Schema) => Slice;
|
|
17
|
-
export declare const upgradeTextToLists: (slice: Slice, schema: Schema) => Slice;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
1
4
|
/**
|
|
2
5
|
* Use this to register macro link positions during a paste operation, that you
|
|
3
6
|
* want to track in a document over time, through any document changes.
|
|
@@ -14,3 +17,14 @@ export declare const startTrackingPastedMacroPositions: (pastedMacroPositions: {
|
|
|
14
17
|
[key: string]: number;
|
|
15
18
|
}) => import("@atlaskit/editor-common/types").Command;
|
|
16
19
|
export declare const stopTrackingPastedMacroPositions: (pastedMacroPositionKeys: string[]) => import("@atlaskit/editor-common/types").Command;
|
|
20
|
+
export declare const upgradeTextToLists: (slice: Slice, schema: Schema) => Slice;
|
|
21
|
+
export declare const splitParagraphs: (slice: Slice, schema: Schema) => Slice;
|
|
22
|
+
/**
|
|
23
|
+
* Walks the slice, creating paragraphs that were previously separated by hardbreaks.
|
|
24
|
+
* Returns the original paragraph node (as a fragment), or a fragment containing multiple nodes.
|
|
25
|
+
*/
|
|
26
|
+
export declare const splitIntoParagraphs: ({ fragment, blockMarks, schema, }: {
|
|
27
|
+
fragment: Fragment;
|
|
28
|
+
blockMarks?: readonly Mark[] | undefined;
|
|
29
|
+
schema: Schema;
|
|
30
|
+
}) => Fragment;
|
|
@@ -3,6 +3,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
|
3
3
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { cardPlugin } from '@atlaskit/editor-plugin-card';
|
|
5
5
|
import type betterTypeHistoryPlugin from '../better-type-history';
|
|
6
|
+
import type listPlugin from '../list';
|
|
6
7
|
export type PastePluginOptions = {
|
|
7
8
|
cardOptions?: CardOptions;
|
|
8
9
|
sanitizePrivateContent?: boolean;
|
|
@@ -11,6 +12,7 @@ declare const pastePlugin: NextEditorPlugin<'paste', {
|
|
|
11
12
|
pluginConfiguration: PastePluginOptions;
|
|
12
13
|
dependencies: [
|
|
13
14
|
typeof featureFlagsPlugin,
|
|
15
|
+
OptionalPlugin<typeof listPlugin>,
|
|
14
16
|
typeof betterTypeHistoryPlugin,
|
|
15
17
|
OptionalPlugin<typeof cardPlugin>
|
|
16
18
|
];
|
|
@@ -77,8 +77,3 @@ export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
|
77
77
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
78
78
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
79
79
|
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
80
|
-
export type {
|
|
81
|
-
/**
|
|
82
|
-
* Temporary, until we extract the plugin to its own package
|
|
83
|
-
* @deprecated Don't use this
|
|
84
|
-
*/ textFormattingPlugin, } from './plugins';
|
|
@@ -310,13 +310,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
310
310
|
}>>
|
|
311
311
|
];
|
|
312
312
|
actions: {
|
|
313
|
-
toggleSuperscript: import("
|
|
314
|
-
toggleSubscript: import("
|
|
315
|
-
toggleStrike: import("
|
|
316
|
-
toggleCode: import("
|
|
317
|
-
toggleUnderline: import("
|
|
318
|
-
toggleEm: import("
|
|
319
|
-
toggleStrong: import("
|
|
313
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
314
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
315
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
316
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
317
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
318
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
319
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
320
320
|
};
|
|
321
321
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
322
322
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -356,13 +356,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
356
356
|
}>>
|
|
357
357
|
];
|
|
358
358
|
actions: {
|
|
359
|
-
toggleSuperscript: import("
|
|
360
|
-
toggleSubscript: import("
|
|
361
|
-
toggleStrike: import("
|
|
362
|
-
toggleCode: import("
|
|
363
|
-
toggleUnderline: import("
|
|
364
|
-
toggleEm: import("
|
|
365
|
-
toggleStrong: import("
|
|
359
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
360
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
361
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
362
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
363
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
364
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
365
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
366
366
|
};
|
|
367
367
|
}>,
|
|
368
368
|
(config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
@@ -751,13 +751,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
751
751
|
}>>
|
|
752
752
|
];
|
|
753
753
|
actions: {
|
|
754
|
-
toggleSuperscript: import("
|
|
755
|
-
toggleSubscript: import("
|
|
756
|
-
toggleStrike: import("
|
|
757
|
-
toggleCode: import("
|
|
758
|
-
toggleUnderline: import("
|
|
759
|
-
toggleEm: import("
|
|
760
|
-
toggleStrong: import("
|
|
754
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
755
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
756
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
757
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
758
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
759
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
760
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
761
761
|
};
|
|
762
762
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
763
763
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -797,13 +797,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
797
797
|
}>>
|
|
798
798
|
];
|
|
799
799
|
actions: {
|
|
800
|
-
toggleSuperscript: import("
|
|
801
|
-
toggleSubscript: import("
|
|
802
|
-
toggleStrike: import("
|
|
803
|
-
toggleCode: import("
|
|
804
|
-
toggleUnderline: import("
|
|
805
|
-
toggleEm: import("
|
|
806
|
-
toggleStrong: import("
|
|
800
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
801
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
802
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
803
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
804
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
805
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
806
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
807
807
|
};
|
|
808
808
|
}>,
|
|
809
809
|
(config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
-
import { AnnotationUpdateEmitter } from './update-provider';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { AnnotationUpdateEmitter } from './update-provider';
|
|
4
4
|
export type AnnotationInfo = {
|
|
5
5
|
id: string;
|
|
6
6
|
type: AnnotationTypes.INLINE_COMMENT;
|
|
@@ -73,4 +73,10 @@ export declare const AnnotationTestIds: {
|
|
|
73
73
|
componentSave: string;
|
|
74
74
|
componentClose: string;
|
|
75
75
|
};
|
|
76
|
+
export type CoordsAtPos = {
|
|
77
|
+
top: number;
|
|
78
|
+
bottom: number;
|
|
79
|
+
left: number;
|
|
80
|
+
right: number;
|
|
81
|
+
};
|
|
76
82
|
export {};
|
|
@@ -31,7 +31,6 @@ export { default as saveOnEnterPlugin } from './save-on-enter';
|
|
|
31
31
|
export { default as submitEditorPlugin } from './submit-editor';
|
|
32
32
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
33
33
|
export { default as textColorPlugin } from './text-color';
|
|
34
|
-
export { default as textFormattingPlugin } from './text-formatting';
|
|
35
34
|
export { default as typeAheadPlugin } from './type-ahead';
|
|
36
35
|
export { default as unsupportedContentPlugin } from './unsupported-content';
|
|
37
36
|
export { default as floatingToolbarPlugin } from './floating-toolbar';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { InputRuleWrapper } from '@atlaskit/
|
|
2
|
+
import type { InputRuleWrapper, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
4
|
type WrappingRuleProps = {
|
|
6
5
|
featureFlags: FeatureFlags;
|
|
7
6
|
match: RegExp;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import type { Schema, Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
1
|
import type { Transaction, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
2
|
export declare function liftFollowingList(from: number, to: number, rootListDepth: number, tr: Transaction): Transaction;
|
|
5
3
|
export declare function liftNodeSelectionList(selection: Selection, tr: Transaction): Transaction;
|
|
6
4
|
export declare function liftTextSelectionList(selection: Selection, tr: Transaction): Transaction;
|
|
7
|
-
/**
|
|
8
|
-
* Walks the slice, creating paragraphs that were previously separated by hardbreaks.
|
|
9
|
-
* Returns the original paragraph node (as a fragment), or a fragment containing multiple nodes.
|
|
10
|
-
*/
|
|
11
|
-
export declare const splitIntoParagraphs: ({ fragment, blockMarks, schema, }: {
|
|
12
|
-
fragment: Fragment;
|
|
13
|
-
blockMarks?: readonly Mark[] | undefined;
|
|
14
|
-
schema: Schema;
|
|
15
|
-
}) => Fragment;
|
|
16
|
-
export declare const splitParagraphs: (slice: Slice, schema: Schema) => Slice;
|
|
17
|
-
export declare const upgradeTextToLists: (slice: Slice, schema: Schema) => Slice;
|