@atlaskit/editor-core 187.28.5 → 187.29.2
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 +16 -0
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/labs/next/presets/universal.js +2 -1
- package/dist/cjs/plugins/analytics/index.js +0 -6
- package/dist/cjs/plugins/analytics/types/index.js +0 -6
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/commands.js +1 -1
- package/dist/cjs/utils/commands.js +1 -33
- package/dist/cjs/utils/index.js +0 -13
- package/dist/cjs/utils/mark.js +2 -46
- package/dist/cjs/utils/selection.js +0 -5
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/labs/next/presets/universal.js +2 -1
- package/dist/es2019/plugins/analytics/index.js +1 -1
- package/dist/es2019/plugins/analytics/types/index.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/commands.js +1 -1
- package/dist/es2019/utils/commands.js +1 -33
- package/dist/es2019/utils/index.js +1 -2
- package/dist/es2019/utils/mark.js +0 -41
- package/dist/es2019/utils/selection.js +0 -6
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/labs/next/presets/universal.js +2 -1
- package/dist/esm/plugins/analytics/index.js +1 -1
- package/dist/esm/plugins/analytics/types/index.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/commands.js +1 -1
- package/dist/esm/utils/commands.js +1 -31
- package/dist/esm/utils/index.js +1 -2
- package/dist/esm/utils/mark.js +0 -42
- package/dist/esm/utils/selection.js +0 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/types/index.d.ts +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/paste/index.d.ts +1 -1
- package/dist/types/utils/commands.d.ts +1 -4
- package/dist/types/utils/index.d.ts +1 -2
- package/dist/types/utils/mark.d.ts +2 -12
- package/dist/types/utils/selection.d.ts +0 -2
- package/dist/types-ts4.5/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/analytics/types/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/paste/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/commands.d.ts +1 -4
- package/dist/types-ts4.5/utils/index.d.ts +1 -2
- package/dist/types-ts4.5/utils/mark.d.ts +2 -12
- package/dist/types-ts4.5/utils/selection.d.ts +0 -2
- package/package.json +7 -3
- package/report.api.md +0 -9
- package/tmp/api-report-tmp.d.ts +0 -9
- package/dist/cjs/plugins/list/actions/conversions.js +0 -153
- package/dist/cjs/plugins/list/actions/indent-list-items-selected.js +0 -125
- package/dist/cjs/plugins/list/actions/indent-list.js +0 -49
- package/dist/cjs/plugins/list/actions/join-list-items-forward.js +0 -59
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/index.js +0 -40
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -88
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -85
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -79
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -45
- package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -56
- package/dist/cjs/plugins/list/actions/merge-lists.js +0 -27
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +0 -291
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +0 -98
- package/dist/cjs/plugins/list/commands/indent-list.js +0 -71
- package/dist/cjs/plugins/list/commands/index.js +0 -348
- package/dist/cjs/plugins/list/commands/join-list-item-forward.js +0 -61
- package/dist/cjs/plugins/list/commands/listBackspace.js +0 -284
- package/dist/cjs/plugins/list/commands/outdent-list.js +0 -70
- package/dist/cjs/plugins/list/index.js +0 -133
- package/dist/cjs/plugins/list/messages.js +0 -37
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +0 -61
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +0 -36
- package/dist/cjs/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +0 -58
- package/dist/cjs/plugins/list/pm-plugins/keymap.js +0 -27
- package/dist/cjs/plugins/list/pm-plugins/main.js +0 -168
- package/dist/cjs/plugins/list/transforms.js +0 -100
- package/dist/cjs/plugins/list/types.js +0 -8
- package/dist/cjs/plugins/list/utils/analytics.js +0 -22
- package/dist/cjs/plugins/list/utils/find.js +0 -68
- package/dist/cjs/plugins/list/utils/indentation.js +0 -22
- package/dist/cjs/plugins/list/utils/node.js +0 -16
- package/dist/cjs/plugins/list/utils/selection.js +0 -95
- package/dist/cjs/utils/input-rules.js +0 -30
- package/dist/es2019/plugins/list/actions/conversions.js +0 -160
- package/dist/es2019/plugins/list/actions/indent-list-items-selected.js +0 -124
- package/dist/es2019/plugins/list/actions/indent-list.js +0 -44
- package/dist/es2019/plugins/list/actions/join-list-items-forward.js +0 -54
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/index.js +0 -5
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -74
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -78
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -72
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -37
- package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -48
- package/dist/es2019/plugins/list/actions/merge-lists.js +0 -24
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +0 -295
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +0 -91
- package/dist/es2019/plugins/list/commands/indent-list.js +0 -62
- package/dist/es2019/plugins/list/commands/index.js +0 -322
- package/dist/es2019/plugins/list/commands/join-list-item-forward.js +0 -53
- package/dist/es2019/plugins/list/commands/listBackspace.js +0 -276
- package/dist/es2019/plugins/list/commands/outdent-list.js +0 -60
- package/dist/es2019/plugins/list/index.js +0 -120
- package/dist/es2019/plugins/list/messages.js +0 -29
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +0 -55
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +0 -33
- package/dist/es2019/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +0 -52
- package/dist/es2019/plugins/list/pm-plugins/keymap.js +0 -19
- package/dist/es2019/plugins/list/pm-plugins/main.js +0 -159
- package/dist/es2019/plugins/list/transforms.js +0 -102
- package/dist/es2019/plugins/list/types.js +0 -1
- package/dist/es2019/plugins/list/utils/analytics.js +0 -12
- package/dist/es2019/plugins/list/utils/find.js +0 -61
- package/dist/es2019/plugins/list/utils/indentation.js +0 -16
- package/dist/es2019/plugins/list/utils/node.js +0 -12
- package/dist/es2019/plugins/list/utils/selection.js +0 -96
- package/dist/es2019/utils/input-rules.js +0 -20
- package/dist/esm/plugins/list/actions/conversions.js +0 -147
- package/dist/esm/plugins/list/actions/indent-list-items-selected.js +0 -117
- package/dist/esm/plugins/list/actions/indent-list.js +0 -43
- package/dist/esm/plugins/list/actions/join-list-items-forward.js +0 -52
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/index.js +0 -5
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -81
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -79
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -73
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -38
- package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -49
- package/dist/esm/plugins/list/actions/merge-lists.js +0 -21
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +0 -283
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +0 -92
- package/dist/esm/plugins/list/commands/indent-list.js +0 -63
- package/dist/esm/plugins/list/commands/index.js +0 -320
- package/dist/esm/plugins/list/commands/join-list-item-forward.js +0 -53
- package/dist/esm/plugins/list/commands/listBackspace.js +0 -275
- package/dist/esm/plugins/list/commands/outdent-list.js +0 -62
- package/dist/esm/plugins/list/index.js +0 -127
- package/dist/esm/plugins/list/messages.js +0 -29
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +0 -56
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +0 -30
- package/dist/esm/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +0 -51
- package/dist/esm/plugins/list/pm-plugins/keymap.js +0 -19
- package/dist/esm/plugins/list/pm-plugins/main.js +0 -159
- package/dist/esm/plugins/list/transforms.js +0 -92
- package/dist/esm/plugins/list/types.js +0 -1
- package/dist/esm/plugins/list/utils/analytics.js +0 -12
- package/dist/esm/plugins/list/utils/find.js +0 -59
- package/dist/esm/plugins/list/utils/indentation.js +0 -16
- package/dist/esm/plugins/list/utils/node.js +0 -10
- package/dist/esm/plugins/list/utils/selection.js +0 -81
- package/dist/esm/utils/input-rules.js +0 -22
- package/dist/types/plugins/list/actions/conversions.d.ts +0 -6
- package/dist/types/plugins/list/actions/indent-list-items-selected.d.ts +0 -2
- package/dist/types/plugins/list/actions/indent-list.d.ts +0 -2
- package/dist/types/plugins/list/actions/join-list-items-forward.d.ts +0 -13
- package/dist/types/plugins/list/actions/join-list-items-scenarios/index.d.ts +0 -5
- package/dist/types/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.d.ts +0 -9
- package/dist/types/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.d.ts +0 -9
- package/dist/types/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.d.ts +0 -9
- package/dist/types/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.d.ts +0 -9
- package/dist/types/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.d.ts +0 -9
- package/dist/types/plugins/list/actions/merge-lists.d.ts +0 -7
- package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +0 -3
- package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +0 -15
- package/dist/types/plugins/list/commands/indent-list.d.ts +0 -6
- package/dist/types/plugins/list/commands/index.d.ts +0 -17
- package/dist/types/plugins/list/commands/join-list-item-forward.d.ts +0 -3
- package/dist/types/plugins/list/commands/listBackspace.d.ts +0 -10
- package/dist/types/plugins/list/commands/outdent-list.d.ts +0 -7
- package/dist/types/plugins/list/index.d.ts +0 -3
- package/dist/types/plugins/list/messages.d.ts +0 -27
- package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +0 -9
- package/dist/types/plugins/list/pm-plugins/input-rules/index.d.ts +0 -4
- package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +0 -12
- package/dist/types/plugins/list/pm-plugins/keymap.d.ts +0 -5
- package/dist/types/plugins/list/pm-plugins/main.d.ts +0 -11
- package/dist/types/plugins/list/transforms.d.ts +0 -4
- package/dist/types/plugins/list/types.d.ts +0 -4
- package/dist/types/plugins/list/utils/analytics.d.ts +0 -5
- package/dist/types/plugins/list/utils/find.d.ts +0 -10
- package/dist/types/plugins/list/utils/indentation.d.ts +0 -2
- package/dist/types/plugins/list/utils/node.d.ts +0 -2
- package/dist/types/plugins/list/utils/selection.d.ts +0 -14
- package/dist/types/utils/input-rules.d.ts +0 -10
- package/dist/types-ts4.5/plugins/list/actions/conversions.d.ts +0 -6
- package/dist/types-ts4.5/plugins/list/actions/indent-list-items-selected.d.ts +0 -2
- package/dist/types-ts4.5/plugins/list/actions/indent-list.d.ts +0 -2
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-forward.d.ts +0 -16
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/index.d.ts +0 -5
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.d.ts +0 -9
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.d.ts +0 -9
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.d.ts +0 -9
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.d.ts +0 -9
- package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.d.ts +0 -9
- package/dist/types-ts4.5/plugins/list/actions/merge-lists.d.ts +0 -7
- package/dist/types-ts4.5/plugins/list/actions/outdent-list-items-selected.d.ts +0 -3
- package/dist/types-ts4.5/plugins/list/actions/wrap-and-join-lists.d.ts +0 -15
- package/dist/types-ts4.5/plugins/list/commands/indent-list.d.ts +0 -6
- package/dist/types-ts4.5/plugins/list/commands/index.d.ts +0 -17
- package/dist/types-ts4.5/plugins/list/commands/join-list-item-forward.d.ts +0 -3
- package/dist/types-ts4.5/plugins/list/commands/listBackspace.d.ts +0 -13
- package/dist/types-ts4.5/plugins/list/commands/outdent-list.d.ts +0 -7
- package/dist/types-ts4.5/plugins/list/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/list/messages.d.ts +0 -27
- package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +0 -9
- package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/index.d.ts +0 -4
- package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +0 -12
- package/dist/types-ts4.5/plugins/list/pm-plugins/keymap.d.ts +0 -5
- package/dist/types-ts4.5/plugins/list/pm-plugins/main.d.ts +0 -11
- package/dist/types-ts4.5/plugins/list/transforms.d.ts +0 -4
- package/dist/types-ts4.5/plugins/list/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/list/utils/analytics.d.ts +0 -5
- package/dist/types-ts4.5/plugins/list/utils/find.d.ts +0 -10
- package/dist/types-ts4.5/plugins/list/utils/indentation.d.ts +0 -2
- package/dist/types-ts4.5/plugins/list/utils/node.d.ts +0 -2
- package/dist/types-ts4.5/plugins/list/utils/selection.d.ts +0 -14
- package/dist/types-ts4.5/utils/input-rules.d.ts +0 -10
package/dist/esm/utils/mark.js
CHANGED
|
@@ -31,46 +31,4 @@ export var isMarkExcluded = function isMarkExcluded(type, marks) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
return false;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Removes marks from nodes in the current selection that are not supported
|
|
38
|
-
*/
|
|
39
|
-
export var sanitiseSelectionMarksForWrapping = function sanitiseSelectionMarksForWrapping(state, newParentType) {
|
|
40
|
-
var tr = state.tr;
|
|
41
|
-
sanitiseMarksInSelection(tr, newParentType);
|
|
42
|
-
return tr;
|
|
43
|
-
};
|
|
44
|
-
export var sanitiseMarksInSelection = function sanitiseMarksInSelection(tr, newParentType) {
|
|
45
|
-
var _tr$selection = tr.selection,
|
|
46
|
-
from = _tr$selection.from,
|
|
47
|
-
to = _tr$selection.to;
|
|
48
|
-
var nodesSanitized = [];
|
|
49
|
-
tr.doc.nodesBetween(from, to, function (node, pos, parent) {
|
|
50
|
-
if (node.isText) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
// Skip expands and layouts if they are outside selection
|
|
54
|
-
// but continue to iterate over their children.
|
|
55
|
-
if (['expand', 'layoutSection'].includes(node.type.name) && (pos < from || pos > to)) {
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
node.marks.forEach(function (mark) {
|
|
59
|
-
if (!(parent !== null && parent !== void 0 && parent.type.allowsMarkType(mark.type)) || newParentType && !newParentType.allowsMarkType(mark.type)) {
|
|
60
|
-
var filteredMarks = node.marks.filter(function (m) {
|
|
61
|
-
return m.type !== mark.type;
|
|
62
|
-
});
|
|
63
|
-
var position = pos > 0 ? pos : 0;
|
|
64
|
-
var marksRemoved = node.marks.filter(function (m) {
|
|
65
|
-
return m.type === mark.type;
|
|
66
|
-
});
|
|
67
|
-
nodesSanitized.push({
|
|
68
|
-
node: node,
|
|
69
|
-
marksRemoved: marksRemoved
|
|
70
|
-
});
|
|
71
|
-
tr.setNodeMarkup(position, undefined, node.attrs, filteredMarks);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
return nodesSanitized;
|
|
76
34
|
};
|
|
@@ -8,10 +8,6 @@ export function setAllSelection(view) {
|
|
|
8
8
|
var tr = state.tr.setSelection(new AllSelection(view.state.doc));
|
|
9
9
|
dispatch(tr);
|
|
10
10
|
}
|
|
11
|
-
export function setGapCursorSelection(view, pos, side) {
|
|
12
|
-
var state = view.state;
|
|
13
|
-
view.dispatch(state.tr.setSelection(new GapCursorSelection(state.doc.resolve(pos), side)));
|
|
14
|
-
}
|
|
15
11
|
export function setCellSelection(view, anchor, head) {
|
|
16
12
|
var state = view.state,
|
|
17
13
|
dispatch = view.dispatch;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -26,9 +26,6 @@ export { changeColor } from './plugins/text-color/commands/change-color';
|
|
|
26
26
|
export { insertHorizontalRule } from './plugins/rule/commands';
|
|
27
27
|
export { blockPluginStateKey } from './plugins';
|
|
28
28
|
export type { BlockTypeState } from './plugins';
|
|
29
|
-
export { pluginKey as listStateKey } from './plugins/list/pm-plugins/main';
|
|
30
|
-
export type { ListState } from './plugins/list/types';
|
|
31
|
-
export type { InputMethod as ListInputMethod } from './plugins/list/commands';
|
|
32
29
|
export { subscribeToToolbarAndPickerUpdates } from './plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates';
|
|
33
30
|
export { subscribeTypeAheadUpdates } from './plugins/view-update-subscription/subscribe/type-ahead-updates';
|
|
34
31
|
export type { InputMethodToolbar as TextFormattingInputMethodToolbar, InputMethodBasic as TextFormattingInputMethodBasic, } from '@atlaskit/editor-common/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import analyticsPlugin from './plugin';
|
|
2
|
-
export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION,
|
|
2
|
+
export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, fireAnalyticsEvent, getAnalyticsEventsFromTransaction, } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, ErrorEventAttributes, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, FireAnalyticsCallback, FireAnalyticsEvent, } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
export { withAnalytics, addAnalytics } from './utils';
|
|
5
5
|
export declare const analyticsPluginKey: import("prosemirror-state").PluginKey<any>;
|
|
@@ -6,4 +6,4 @@ export type { MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, } from '.
|
|
|
6
6
|
export type { DispatchAnalyticsEvent } from './dispatch-analytics-event';
|
|
7
7
|
export type { CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, } from './link-tool-bar-events';
|
|
8
8
|
export type { FormatEventPayload, CommonListAnalyticsAttributes, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, ListEventPayload, PasteContent, PasteEventPayload, PasteSource, PasteType, PasteContents, SubstituteEventPayload, TableEventPayload, PasteSources, PasteTypes, PASTE_ACTION_SUBJECT_ID, } from '@atlaskit/editor-common/analytics';
|
|
9
|
-
export { USER_CONTEXT, DELETE_DIRECTION, INDENT_DIRECTION, PUNC, TABLE_ACTION, INDENT_TYPE,
|
|
9
|
+
export { USER_CONTEXT, DELETE_DIRECTION, INDENT_DIRECTION, PUNC, TABLE_ACTION, INDENT_TYPE, SYMBOL, TABLE_BREAKOUT, } from '@atlaskit/editor-common/analytics';
|
|
@@ -14,7 +14,6 @@ export { default as helpDialogPlugin } from './help-dialog';
|
|
|
14
14
|
export { default as insertBlockPlugin } from './insert-block';
|
|
15
15
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
16
16
|
export { default as layoutPlugin } from './layout';
|
|
17
|
-
export { default as listPlugin } from './list';
|
|
18
17
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
19
18
|
export { default as macroPlugin } from './macro';
|
|
20
19
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
@@ -3,7 +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 '
|
|
6
|
+
import type { listPlugin } from '@atlaskit/editor-plugin-list';
|
|
7
7
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
8
|
export type PastePluginOptions = {
|
|
9
9
|
cardOptions?: CardOptions;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
4
3
|
import type { Command, HigherOrderCommand } from '@atlaskit/editor-common/types';
|
|
5
|
-
declare const isFirstChildOfParent: (state: EditorState) => boolean;
|
|
6
4
|
/**
|
|
7
5
|
* Creates a filter that checks if the node at a given number of parents above the current
|
|
8
6
|
* selection is of the correct node type.
|
|
@@ -12,7 +10,6 @@ declare const isFirstChildOfParent: (state: EditorState) => boolean;
|
|
|
12
10
|
* is usually inside the text content.
|
|
13
11
|
*/
|
|
14
12
|
declare const isNthParentOfType: (nodeType: string, depthAway: number) => (state: EditorState, view?: EditorView) => boolean;
|
|
15
|
-
declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
|
|
16
13
|
declare const withScrollIntoView: HigherOrderCommand;
|
|
17
14
|
/**
|
|
18
15
|
* Insert content, delete a range and create a new selection
|
|
@@ -24,4 +21,4 @@ declare const withScrollIntoView: HigherOrderCommand;
|
|
|
24
21
|
* @param deletions the ranges to delete
|
|
25
22
|
*/
|
|
26
23
|
declare const selectNode: (pos: number) => Command;
|
|
27
|
-
export {
|
|
24
|
+
export { isNthParentOfType, withScrollIntoView, selectNode };
|
|
@@ -4,9 +4,8 @@ import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
|
|
|
4
4
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, } from '@atlaskit/editor-common/utils';
|
|
5
5
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
6
6
|
export { isNodeEmpty, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount, } from './document';
|
|
7
|
-
export { sanitiseMarksInSelection } from './mark';
|
|
8
7
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
9
|
-
export { setNodeSelection,
|
|
8
|
+
export { setNodeSelection, setTextSelection } from './selection';
|
|
10
9
|
export type { JSONDocNode };
|
|
11
10
|
export { default as measurements } from './performance/measure-enum';
|
|
12
11
|
export declare function getCursor(selection: Selection): ResolvedPos | undefined;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import type { Node, Mark, MarkType
|
|
2
|
-
import type { SelectionRange
|
|
1
|
+
import type { Node, Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { SelectionRange } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const isMarkAllowedInRange: (doc: Node, ranges: readonly SelectionRange[], type: MarkType) => boolean;
|
|
4
4
|
export declare const isMarkExcluded: (type: MarkType, marks?: readonly Mark[] | null) => boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Removes marks from nodes in the current selection that are not supported
|
|
7
|
-
*/
|
|
8
|
-
export declare const sanitiseSelectionMarksForWrapping: (state: EditorState, newParentType?: NodeType) => Transaction | undefined;
|
|
9
|
-
type NodesSanitized = Array<{
|
|
10
|
-
node: Node;
|
|
11
|
-
marksRemoved: Mark[];
|
|
12
|
-
}>;
|
|
13
|
-
export declare const sanitiseMarksInSelection: (tr: Transaction, newParentType?: NodeType) => NodesSanitized;
|
|
14
|
-
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { Side } from '@atlaskit/editor-common/selection';
|
|
5
4
|
export { setNodeSelection, setTextSelection, } from '@atlaskit/editor-common/utils';
|
|
6
5
|
export declare function setAllSelection(view: EditorView): void;
|
|
7
|
-
export declare function setGapCursorSelection(view: EditorView, pos: number, side: Side): void;
|
|
8
6
|
export declare function setCellSelection(view: EditorView, anchor: number, head?: number): void;
|
|
9
7
|
export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
|
|
10
8
|
export declare const duplicateSelection: (selectionToDuplicate: Selection, doc: Node) => Selection | undefined;
|
|
@@ -26,9 +26,6 @@ export { changeColor } from './plugins/text-color/commands/change-color';
|
|
|
26
26
|
export { insertHorizontalRule } from './plugins/rule/commands';
|
|
27
27
|
export { blockPluginStateKey } from './plugins';
|
|
28
28
|
export type { BlockTypeState } from './plugins';
|
|
29
|
-
export { pluginKey as listStateKey } from './plugins/list/pm-plugins/main';
|
|
30
|
-
export type { ListState } from './plugins/list/types';
|
|
31
|
-
export type { InputMethod as ListInputMethod } from './plugins/list/commands';
|
|
32
29
|
export { subscribeToToolbarAndPickerUpdates } from './plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates';
|
|
33
30
|
export { subscribeTypeAheadUpdates } from './plugins/view-update-subscription/subscribe/type-ahead-updates';
|
|
34
31
|
export type { InputMethodToolbar as TextFormattingInputMethodToolbar, InputMethodBasic as TextFormattingInputMethodBasic, } from '@atlaskit/editor-common/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import analyticsPlugin from './plugin';
|
|
2
|
-
export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION,
|
|
2
|
+
export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, fireAnalyticsEvent, getAnalyticsEventsFromTransaction, } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, ErrorEventAttributes, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, FireAnalyticsCallback, FireAnalyticsEvent, } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
export { withAnalytics, addAnalytics } from './utils';
|
|
5
5
|
export declare const analyticsPluginKey: import("prosemirror-state").PluginKey<any>;
|
|
@@ -6,4 +6,4 @@ export type { MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, } from '.
|
|
|
6
6
|
export type { DispatchAnalyticsEvent } from './dispatch-analytics-event';
|
|
7
7
|
export type { CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, } from './link-tool-bar-events';
|
|
8
8
|
export type { FormatEventPayload, CommonListAnalyticsAttributes, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, ListEventPayload, PasteContent, PasteEventPayload, PasteSource, PasteType, PasteContents, SubstituteEventPayload, TableEventPayload, PasteSources, PasteTypes, PASTE_ACTION_SUBJECT_ID, } from '@atlaskit/editor-common/analytics';
|
|
9
|
-
export { USER_CONTEXT, DELETE_DIRECTION, INDENT_DIRECTION, PUNC, TABLE_ACTION, INDENT_TYPE,
|
|
9
|
+
export { USER_CONTEXT, DELETE_DIRECTION, INDENT_DIRECTION, PUNC, TABLE_ACTION, INDENT_TYPE, SYMBOL, TABLE_BREAKOUT, } from '@atlaskit/editor-common/analytics';
|
|
@@ -14,7 +14,6 @@ export { default as helpDialogPlugin } from './help-dialog';
|
|
|
14
14
|
export { default as insertBlockPlugin } from './insert-block';
|
|
15
15
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
16
16
|
export { default as layoutPlugin } from './layout';
|
|
17
|
-
export { default as listPlugin } from './list';
|
|
18
17
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
19
18
|
export { default as macroPlugin } from './macro';
|
|
20
19
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
@@ -3,7 +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 '
|
|
6
|
+
import type { listPlugin } from '@atlaskit/editor-plugin-list';
|
|
7
7
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
8
|
export type PastePluginOptions = {
|
|
9
9
|
cardOptions?: CardOptions;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
4
3
|
import type { Command, HigherOrderCommand } from '@atlaskit/editor-common/types';
|
|
5
|
-
declare const isFirstChildOfParent: (state: EditorState) => boolean;
|
|
6
4
|
/**
|
|
7
5
|
* Creates a filter that checks if the node at a given number of parents above the current
|
|
8
6
|
* selection is of the correct node type.
|
|
@@ -12,7 +10,6 @@ declare const isFirstChildOfParent: (state: EditorState) => boolean;
|
|
|
12
10
|
* is usually inside the text content.
|
|
13
11
|
*/
|
|
14
12
|
declare const isNthParentOfType: (nodeType: string, depthAway: number) => (state: EditorState, view?: EditorView) => boolean;
|
|
15
|
-
declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
|
|
16
13
|
declare const withScrollIntoView: HigherOrderCommand;
|
|
17
14
|
/**
|
|
18
15
|
* Insert content, delete a range and create a new selection
|
|
@@ -24,4 +21,4 @@ declare const withScrollIntoView: HigherOrderCommand;
|
|
|
24
21
|
* @param deletions the ranges to delete
|
|
25
22
|
*/
|
|
26
23
|
declare const selectNode: (pos: number) => Command;
|
|
27
|
-
export {
|
|
24
|
+
export { isNthParentOfType, withScrollIntoView, selectNode };
|
|
@@ -4,9 +4,8 @@ import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
|
|
|
4
4
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, } from '@atlaskit/editor-common/utils';
|
|
5
5
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
6
6
|
export { isNodeEmpty, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount, } from './document';
|
|
7
|
-
export { sanitiseMarksInSelection } from './mark';
|
|
8
7
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
9
|
-
export { setNodeSelection,
|
|
8
|
+
export { setNodeSelection, setTextSelection } from './selection';
|
|
10
9
|
export type { JSONDocNode };
|
|
11
10
|
export { default as measurements } from './performance/measure-enum';
|
|
12
11
|
export declare function getCursor(selection: Selection): ResolvedPos | undefined;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import type { Node, Mark, MarkType
|
|
2
|
-
import type { SelectionRange
|
|
1
|
+
import type { Node, Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { SelectionRange } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const isMarkAllowedInRange: (doc: Node, ranges: readonly SelectionRange[], type: MarkType) => boolean;
|
|
4
4
|
export declare const isMarkExcluded: (type: MarkType, marks?: readonly Mark[] | null) => boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Removes marks from nodes in the current selection that are not supported
|
|
7
|
-
*/
|
|
8
|
-
export declare const sanitiseSelectionMarksForWrapping: (state: EditorState, newParentType?: NodeType) => Transaction | undefined;
|
|
9
|
-
type NodesSanitized = Array<{
|
|
10
|
-
node: Node;
|
|
11
|
-
marksRemoved: Mark[];
|
|
12
|
-
}>;
|
|
13
|
-
export declare const sanitiseMarksInSelection: (tr: Transaction, newParentType?: NodeType) => NodesSanitized;
|
|
14
|
-
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { Side } from '@atlaskit/editor-common/selection';
|
|
5
4
|
export { setNodeSelection, setTextSelection, } from '@atlaskit/editor-common/utils';
|
|
6
5
|
export declare function setAllSelection(view: EditorView): void;
|
|
7
|
-
export declare function setGapCursorSelection(view: EditorView, pos: number, side: Side): void;
|
|
8
6
|
export declare function setCellSelection(view: EditorView, anchor: number, head?: number): void;
|
|
9
7
|
export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
|
|
10
8
|
export declare const duplicateSelection: (selectionToDuplicate: Selection, doc: Node) => Selection | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.
|
|
3
|
+
"version": "187.29.2",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.7.0",
|
|
58
|
-
"@atlaskit/editor-common": "^74.
|
|
58
|
+
"@atlaskit/editor-common": "^74.50.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@atlaskit/editor-plugin-guideline": "^0.3.4",
|
|
74
74
|
"@atlaskit/editor-plugin-hyperlink": "^0.3.0",
|
|
75
75
|
"@atlaskit/editor-plugin-image-upload": "^0.1.0",
|
|
76
|
-
"@atlaskit/editor-plugin-list": "^0.
|
|
76
|
+
"@atlaskit/editor-plugin-list": "^1.0.0",
|
|
77
77
|
"@atlaskit/editor-plugin-table": "^2.10.0",
|
|
78
78
|
"@atlaskit/editor-plugin-text-formatting": "^0.2.0",
|
|
79
79
|
"@atlaskit/editor-plugin-width": "^0.1.0",
|
|
@@ -243,6 +243,10 @@
|
|
|
243
243
|
"type": "boolean",
|
|
244
244
|
"referenceOnly": "true"
|
|
245
245
|
},
|
|
246
|
+
"platform.editor.table-remove-update-resize-handles_djvab": {
|
|
247
|
+
"type": "boolean",
|
|
248
|
+
"referenceOnly": "true"
|
|
249
|
+
},
|
|
246
250
|
"platform.editor.media.extended-resize-experience": {
|
|
247
251
|
"type": "boolean"
|
|
248
252
|
},
|
package/report.api.md
CHANGED
|
@@ -93,7 +93,6 @@ import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
|
|
|
93
93
|
import { jsx } from '@emotion/react';
|
|
94
94
|
import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
95
95
|
import type { LinkingOptions } from '@atlaskit/editor-common/types';
|
|
96
|
-
import { ListState } from '@atlaskit/editor-plugin-list';
|
|
97
96
|
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
98
97
|
import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
|
|
99
98
|
import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -1185,14 +1184,6 @@ export { lightModeStatusColorPalette };
|
|
|
1185
1184
|
// @public (undocumented)
|
|
1186
1185
|
type Listener = (data: any) => void;
|
|
1187
1186
|
|
|
1188
|
-
// @public (undocumented)
|
|
1189
|
-
export type ListInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
1190
|
-
|
|
1191
|
-
export { ListState };
|
|
1192
|
-
|
|
1193
|
-
// @public (undocumented)
|
|
1194
|
-
export const listStateKey: PluginKey<ListState>;
|
|
1195
|
-
|
|
1196
1187
|
export { MacroAttributes };
|
|
1197
1188
|
|
|
1198
1189
|
export { MacroProvider };
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -82,7 +82,6 @@ import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
|
|
|
82
82
|
import { jsx } from '@emotion/react';
|
|
83
83
|
import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
84
84
|
import type { LinkingOptions } from '@atlaskit/editor-common/types';
|
|
85
|
-
import { ListState } from '@atlaskit/editor-plugin-list';
|
|
86
85
|
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
87
86
|
import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
|
|
88
87
|
import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -1062,14 +1061,6 @@ export { lightModeStatusColorPalette }
|
|
|
1062
1061
|
// @public (undocumented)
|
|
1063
1062
|
type Listener = (data: any) => void;
|
|
1064
1063
|
|
|
1065
|
-
// @public (undocumented)
|
|
1066
|
-
export type ListInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
1067
|
-
|
|
1068
|
-
export { ListState }
|
|
1069
|
-
|
|
1070
|
-
// @public (undocumented)
|
|
1071
|
-
export const listStateKey: PluginKey<ListState>;
|
|
1072
|
-
|
|
1073
1064
|
export { MacroAttributes }
|
|
1074
1065
|
|
|
1075
1066
|
export { MacroProvider }
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.convertListType = convertListType;
|
|
7
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
|
-
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
10
|
-
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
|
-
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
12
|
-
var _lists = require("@atlaskit/editor-common/lists");
|
|
13
|
-
var _find = require("../utils/find");
|
|
14
|
-
var _selection = require("@atlaskit/editor-common/selection");
|
|
15
|
-
function convertListType(_ref) {
|
|
16
|
-
var tr = _ref.tr,
|
|
17
|
-
nextListNodeType = _ref.nextListNodeType;
|
|
18
|
-
var doc = tr.doc,
|
|
19
|
-
_tr$selection = tr.selection,
|
|
20
|
-
$from = _tr$selection.$from,
|
|
21
|
-
$to = _tr$selection.$to;
|
|
22
|
-
var listRange;
|
|
23
|
-
if (tr.selection instanceof _selection.GapCursorSelection) {
|
|
24
|
-
var _$from$nodeAfter;
|
|
25
|
-
var nodeSize = ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.nodeSize) || 1;
|
|
26
|
-
listRange = $from.blockRange($from.doc.resolve($from.pos + nodeSize));
|
|
27
|
-
} else {
|
|
28
|
-
listRange = $from.blockRange($to, _utils2.isListNode);
|
|
29
|
-
}
|
|
30
|
-
if (listRange) {
|
|
31
|
-
return convertSelectedList({
|
|
32
|
-
tr: tr,
|
|
33
|
-
nextListNodeType: nextListNodeType
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
var nodeRangeAroundList = $from.blockRange($to);
|
|
37
|
-
if (!nodeRangeAroundList) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
var parentNode = nodeRangeAroundList.parent;
|
|
41
|
-
var startIndex = nodeRangeAroundList.startIndex,
|
|
42
|
-
endIndex = nodeRangeAroundList.endIndex,
|
|
43
|
-
depth = nodeRangeAroundList.depth;
|
|
44
|
-
|
|
45
|
-
// Checking for invalid nodes to prevent conversion
|
|
46
|
-
// eg. a panel cannot be wrapped in a list so return
|
|
47
|
-
// It will skip this check if the selection begins within a list
|
|
48
|
-
// This is to match the behaviour of the toolbar buttons being disabled
|
|
49
|
-
if (!(0, _find.findFirstParentListNode)($from)) {
|
|
50
|
-
for (var i = startIndex; i < endIndex; i++) {
|
|
51
|
-
var position = nodeRangeAroundList.$from.posAtIndex(i, depth);
|
|
52
|
-
var resolvedPosition = doc.resolve(position);
|
|
53
|
-
var currentChild = parentNode.child(i);
|
|
54
|
-
var currentNodeRange = resolvedPosition.blockRange(tr.doc.resolve(position + currentChild.nodeSize));
|
|
55
|
-
if (currentNodeRange && !(0, _utils2.isListNode)(currentChild) && !(0, _transform.findWrapping)(currentNodeRange, nextListNodeType)) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Checking for any non list nodes and wrapping them in a list
|
|
62
|
-
// so they can be converted
|
|
63
|
-
tr.doc.nodesBetween(nodeRangeAroundList.start, nodeRangeAroundList.end, function (node, pos) {
|
|
64
|
-
// Skip over any nodes that are part of a list
|
|
65
|
-
if ((0, _find.findFirstParentListNode)(tr.doc.resolve(tr.mapping.map(pos)))) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// The following applies to suitable nodes that are not within a list
|
|
70
|
-
var currentNodeNotWrappedInList = node;
|
|
71
|
-
var isNotAnEmptyParagraphAndIsParagraphOrLeafNode = !(0, _utils2.isEmptyParagraph)(currentNodeNotWrappedInList) && (!node.type.isBlock || node.type.name === 'paragraph');
|
|
72
|
-
if (isNotAnEmptyParagraphAndIsParagraphOrLeafNode && nodeRangeAroundList) {
|
|
73
|
-
var remainingNodeRange = new _model.NodeRange(tr.doc.resolve(tr.mapping.map(pos)), tr.doc.resolve(tr.mapping.map(pos) + currentNodeNotWrappedInList.nodeSize), nodeRangeAroundList.depth);
|
|
74
|
-
convertAroundList({
|
|
75
|
-
tr: tr,
|
|
76
|
-
nextListNodeType: nextListNodeType,
|
|
77
|
-
nodeRange: remainingNodeRange
|
|
78
|
-
});
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
convertSelectedList({
|
|
83
|
-
tr: tr,
|
|
84
|
-
nextListNodeType: nextListNodeType
|
|
85
|
-
});
|
|
86
|
-
if (tr.docChanged) {
|
|
87
|
-
(0, _lists.joinSiblingLists)({
|
|
88
|
-
tr: tr,
|
|
89
|
-
forceListType: nextListNodeType
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
var convertSelectedList = function convertSelectedList(_ref2) {
|
|
94
|
-
var tr = _ref2.tr,
|
|
95
|
-
nextListNodeType = _ref2.nextListNodeType;
|
|
96
|
-
var selection = tr.selection,
|
|
97
|
-
_tr$selection2 = tr.selection,
|
|
98
|
-
from = _tr$selection2.from,
|
|
99
|
-
to = _tr$selection2.to;
|
|
100
|
-
var codeBlock = tr.doc.type.schema.nodes.codeBlock;
|
|
101
|
-
// get the positions of all the leaf nodes within the selection
|
|
102
|
-
var nodePositions = [];
|
|
103
|
-
if (selection instanceof _state.TextSelection && selection.$cursor || selection instanceof _selection.GapCursorSelection) {
|
|
104
|
-
nodePositions.push(from);
|
|
105
|
-
} else {
|
|
106
|
-
// nodesBetween doesn't return leaf nodes that are outside of from and to
|
|
107
|
-
tr.doc.nodesBetween(from, to, function (node, pos) {
|
|
108
|
-
// isLeaf is false for empty codeBlock so adding additional check for childCount
|
|
109
|
-
if (!node.isLeaf && !(node.type === codeBlock && node.childCount === 0)) {
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
nodePositions.push(pos);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// use those positions to get the closest parent list nodes
|
|
117
|
-
nodePositions.reduce(function (acc, pos) {
|
|
118
|
-
var closestParentListNode = (0, _utils.findParentNodeClosestToPos)(tr.doc.resolve(pos), _utils2.isListNode);
|
|
119
|
-
if (!closestParentListNode) {
|
|
120
|
-
return acc;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// don't add duplicates if the parent has already been added into the array
|
|
124
|
-
var existingParent = acc.find(function (node) {
|
|
125
|
-
return node.pos === closestParentListNode.pos && node.start === closestParentListNode.start && node.depth === closestParentListNode.depth;
|
|
126
|
-
});
|
|
127
|
-
if (!existingParent) {
|
|
128
|
-
acc.push(closestParentListNode);
|
|
129
|
-
}
|
|
130
|
-
return acc;
|
|
131
|
-
}, []).forEach(function (item) {
|
|
132
|
-
tr.setNodeMarkup(item.pos, nextListNodeType);
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
var convertAroundList = function convertAroundList(_ref3) {
|
|
136
|
-
var tr = _ref3.tr,
|
|
137
|
-
nextListNodeType = _ref3.nextListNodeType,
|
|
138
|
-
nodeRange = _ref3.nodeRange;
|
|
139
|
-
for (var i = nodeRange.endIndex - 1; i >= nodeRange.startIndex; i--) {
|
|
140
|
-
// @ts-ignore posAtIndex is a public API but has no type yet
|
|
141
|
-
var position = nodeRange.$from.posAtIndex(i, nodeRange.depth);
|
|
142
|
-
var resolvedPos = tr.doc.resolve(position + 1);
|
|
143
|
-
var range = resolvedPos.blockRange(resolvedPos);
|
|
144
|
-
if (!range) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
var wrappings = (0, _transform.findWrapping)(range, nextListNodeType);
|
|
148
|
-
if (!range || !wrappings) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
tr.wrap(range, wrappings);
|
|
152
|
-
}
|
|
153
|
-
};
|