@atlaskit/editor-core 188.12.0 → 188.12.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 +15 -0
- package/dist/cjs/labs/next/presets/universal.js +12 -1
- package/dist/cjs/plugins/annotation/index.js +12 -1
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/cjs/plugins/annotation/pm-plugins/plugin-factory.js +5 -0
- package/dist/cjs/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/cjs/plugins/annotation/toolbar.js +2 -156
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +33 -31
- package/dist/cjs/plugins/layout/actions.js +20 -17
- package/dist/cjs/plugins/layout/index.js +6 -2
- package/dist/cjs/plugins/panel/index.js +1 -1
- package/dist/cjs/plugins/panel/toolbar.js +9 -7
- package/dist/cjs/plugins/paste/plugins/media.js +50 -24
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +0 -6
- package/dist/cjs/plugins/paste/pm-plugins/main.js +1 -0
- package/dist/cjs/plugins/rank.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +104 -90
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +12 -1
- package/dist/es2019/plugins/annotation/index.js +14 -1
- package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/es2019/plugins/annotation/pm-plugins/plugin-factory.js +6 -0
- package/dist/es2019/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/es2019/plugins/annotation/toolbar.js +1 -156
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -3
- package/dist/es2019/plugins/layout/actions.js +4 -3
- package/dist/es2019/plugins/layout/index.js +63 -57
- package/dist/es2019/plugins/panel/index.js +1 -1
- package/dist/es2019/plugins/panel/toolbar.js +9 -7
- package/dist/es2019/plugins/paste/plugins/media.js +53 -25
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +1 -4
- package/dist/es2019/plugins/paste/pm-plugins/main.js +4 -5
- package/dist/es2019/plugins/rank.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +22 -14
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +12 -1
- package/dist/esm/plugins/annotation/index.js +12 -1
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/esm/plugins/annotation/pm-plugins/plugin-factory.js +5 -0
- package/dist/esm/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/esm/plugins/annotation/toolbar.js +1 -156
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +33 -31
- package/dist/esm/plugins/layout/actions.js +15 -12
- package/dist/esm/plugins/layout/index.js +7 -3
- package/dist/esm/plugins/panel/index.js +1 -1
- package/dist/esm/plugins/panel/toolbar.js +9 -7
- package/dist/esm/plugins/paste/plugins/media.js +50 -23
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +1 -6
- package/dist/esm/plugins/paste/pm-plugins/main.js +4 -5
- package/dist/esm/plugins/rank.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +104 -90
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/annotation/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/insert-block/types.d.ts +3 -1
- package/dist/types/plugins/layout/actions.d.ts +2 -1
- package/dist/types/plugins/layout/index.d.ts +4 -0
- package/dist/types/plugins/panel/index.d.ts +2 -2
- package/dist/types/plugins/panel/toolbar.d.ts +5 -3
- package/dist/types/plugins/paste/plugins/media.d.ts +11 -0
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +0 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +7 -4
- package/dist/types/plugins/tasks-and-decisions/types.d.ts +5 -1
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/layout/actions.d.ts +2 -1
- package/dist/types-ts4.5/plugins/layout/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/panel/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +5 -3
- package/dist/types-ts4.5/plugins/paste/plugins/media.d.ts +11 -0
- package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +0 -1
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +7 -4
- package/dist/types-ts4.5/plugins/tasks-and-decisions/types.d.ts +3 -1
- package/package.json +6 -2
|
@@ -17,7 +17,8 @@ import { findPanel } from './utils';
|
|
|
17
17
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
18
18
|
import { DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
19
19
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
20
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID
|
|
20
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
21
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
21
22
|
import { messages } from './message';
|
|
22
23
|
export var panelIconMap = (_panelIconMap = {}, _defineProperty(_panelIconMap, PanelType.INFO, {
|
|
23
24
|
shortName: ':info:',
|
|
@@ -38,7 +39,7 @@ export var panelIconMap = (_panelIconMap = {}, _defineProperty(_panelIconMap, Pa
|
|
|
38
39
|
shortName: ':tip:',
|
|
39
40
|
id: 'atlassian-tip'
|
|
40
41
|
}), _panelIconMap);
|
|
41
|
-
export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, activePanelType, activePanelColor, activePanelIcon, state) {
|
|
42
|
+
export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, hoverDecoration, editorAnalyticsAPI, activePanelType, activePanelColor, activePanelIcon, state) {
|
|
42
43
|
// TODO: ED-14403 investigate why these titles are not getting translated for the tooltips
|
|
43
44
|
var items = [{
|
|
44
45
|
id: 'editor.panel.info',
|
|
@@ -111,7 +112,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
111
112
|
},
|
|
112
113
|
eventType: EVENT_TYPE.TRACK
|
|
113
114
|
};
|
|
114
|
-
withAnalytics(payload)(changePanelType(PanelType.CUSTOM, _objectSpread({
|
|
115
|
+
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(PanelType.CUSTOM, _objectSpread({
|
|
115
116
|
color: color
|
|
116
117
|
}, previousEmoji), isCustomPanelEnabled))(state, dispatch);
|
|
117
118
|
return false;
|
|
@@ -142,7 +143,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
142
143
|
},
|
|
143
144
|
eventType: EVENT_TYPE.TRACK
|
|
144
145
|
};
|
|
145
|
-
withAnalytics(payload)(changePanelType(PanelType.CUSTOM, {
|
|
146
|
+
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(PanelType.CUSTOM, {
|
|
146
147
|
emoji: emoji.shortName,
|
|
147
148
|
emojiId: emoji.id,
|
|
148
149
|
emojiText: emoji.fallback
|
|
@@ -168,7 +169,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
168
169
|
},
|
|
169
170
|
eventType: EVENT_TYPE.TRACK
|
|
170
171
|
};
|
|
171
|
-
withAnalytics(payload)(changePanelType(PanelType.CUSTOM, {
|
|
172
|
+
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(PanelType.CUSTOM, {
|
|
172
173
|
emoji: undefined,
|
|
173
174
|
emojiId: undefined,
|
|
174
175
|
emojiText: undefined
|
|
@@ -253,10 +254,11 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
253
254
|
export var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
254
255
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
255
256
|
var providerFactory = arguments.length > 3 ? arguments[3] : undefined;
|
|
256
|
-
var
|
|
257
|
+
var api = arguments.length > 4 ? arguments[4] : undefined;
|
|
257
258
|
var formatMessage = intl.formatMessage;
|
|
258
259
|
var panelObject = findPanel(state);
|
|
259
260
|
if (panelObject) {
|
|
261
|
+
var _api$analytics;
|
|
260
262
|
var nodeType = state.schema.nodes.panel;
|
|
261
263
|
var _panelObject$node$att = panelObject.node.attrs,
|
|
262
264
|
panelType = _panelObject$node$att.panelType,
|
|
@@ -267,7 +269,7 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
|
267
269
|
};
|
|
268
270
|
|
|
269
271
|
// force toolbar to be turned on
|
|
270
|
-
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, hoverDecoration, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
|
|
272
|
+
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
|
|
271
273
|
var getDomRef = function getDomRef(editorView) {
|
|
272
274
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
273
275
|
var element = findDomRefAtPos(panelObject.pos, domAtPos);
|
|
@@ -5,6 +5,13 @@ import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
|
5
5
|
import { mapSlice, unwrap, removeNestedEmptyEls, walkUpTreeUntil } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { getRandomHex } from '@atlaskit/media-common';
|
|
8
|
+
import { DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Ensure correct layout in nested mode
|
|
12
|
+
*
|
|
13
|
+
* TODO: this func is only used in handlePaste, so layout update won't work for drop event
|
|
14
|
+
*/
|
|
8
15
|
export function transformSliceForMedia(slice, schema) {
|
|
9
16
|
var _schema$nodes = schema.nodes,
|
|
10
17
|
mediaSingle = _schema$nodes.mediaSingle,
|
|
@@ -12,8 +19,6 @@ export function transformSliceForMedia(slice, schema) {
|
|
|
12
19
|
table = _schema$nodes.table,
|
|
13
20
|
bulletList = _schema$nodes.bulletList,
|
|
14
21
|
orderedList = _schema$nodes.orderedList,
|
|
15
|
-
media = _schema$nodes.media,
|
|
16
|
-
mediaInline = _schema$nodes.mediaInline,
|
|
17
22
|
expand = _schema$nodes.expand,
|
|
18
23
|
nestedExpand = _schema$nodes.nestedExpand;
|
|
19
24
|
return function (selection) {
|
|
@@ -40,27 +45,6 @@ export function transformSliceForMedia(slice, schema) {
|
|
|
40
45
|
return node.type.name === 'mediaSingle' ? mediaSingle.createChecked(attrs, node.content, node.marks) : node;
|
|
41
46
|
});
|
|
42
47
|
}
|
|
43
|
-
var __mediaTraceId = getRandomHex(8);
|
|
44
|
-
newSlice = mapSlice(newSlice, function (node) {
|
|
45
|
-
// This logic is duplicated in editor-plugin-ai where external images can be inserted
|
|
46
|
-
// from external sources through the use of AI. The editor-plugin-ai package is avoiding
|
|
47
|
-
// sharing dependencies with editor-core to support products using it with various versions
|
|
48
|
-
// of editor packages.
|
|
49
|
-
// The duplication is in the following file:
|
|
50
|
-
// packages/editor/editor-plugin-ai/src/prebuilt/content-transformers/markdown-to-pm/markdown-transformer.ts
|
|
51
|
-
if (node.type.name === 'media') {
|
|
52
|
-
return media.createChecked(_objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
53
|
-
__external: node.attrs.type === 'external',
|
|
54
|
-
__mediaTraceId: node.attrs.type === 'external' ? null : __mediaTraceId
|
|
55
|
-
}), node.content, node.marks);
|
|
56
|
-
}
|
|
57
|
-
if (node.type.name === 'mediaInline') {
|
|
58
|
-
return mediaInline.createChecked(_objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
59
|
-
__mediaTraceId: __mediaTraceId
|
|
60
|
-
}), node.content, node.marks);
|
|
61
|
-
}
|
|
62
|
-
return node;
|
|
63
|
-
});
|
|
64
48
|
return newSlice;
|
|
65
49
|
};
|
|
66
50
|
}
|
|
@@ -86,6 +70,49 @@ export var transformSliceToCorrectMediaWrapper = function transformSliceToCorrec
|
|
|
86
70
|
});
|
|
87
71
|
};
|
|
88
72
|
|
|
73
|
+
/**
|
|
74
|
+
* This func will be called when copy & paste, drag & drop external html with media, media files, and slices from editor
|
|
75
|
+
* Because width may not be available when transform, DEFAULT_IMAGE_WIDTH is used as a fallback
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
export var transformSliceToMediaSingleWithNewExperience = function transformSliceToMediaSingleWithNewExperience(slice, schema) {
|
|
79
|
+
var _schema$nodes3 = schema.nodes,
|
|
80
|
+
mediaInline = _schema$nodes3.mediaInline,
|
|
81
|
+
mediaSingle = _schema$nodes3.mediaSingle,
|
|
82
|
+
media = _schema$nodes3.media;
|
|
83
|
+
var newSlice = mapSlice(slice, function (node) {
|
|
84
|
+
// This logic is duplicated in editor-plugin-ai where external images can be inserted
|
|
85
|
+
// from external sources through the use of AI. The editor-plugin-ai package is avoiding
|
|
86
|
+
// sharing dependencies with editor-core to support products using it with various versions
|
|
87
|
+
// of editor packages.
|
|
88
|
+
// The duplication is in the following file:
|
|
89
|
+
// packages/editor/editor-plugin-ai/src/prebuilt/content-transformers/markdown-to-pm/markdown-transformer.ts
|
|
90
|
+
if (node.type === mediaSingle) {
|
|
91
|
+
return getBooleanFF('platform.editor.media.extended-resize-experience') ? mediaSingle.createChecked({
|
|
92
|
+
width: node.attrs.width || DEFAULT_IMAGE_WIDTH,
|
|
93
|
+
widthType: node.attrs.widthType || 'pixel',
|
|
94
|
+
layout: node.attrs.layout
|
|
95
|
+
}, node.content, node.marks) : node;
|
|
96
|
+
}
|
|
97
|
+
return node;
|
|
98
|
+
});
|
|
99
|
+
return mapSlice(newSlice, function (node) {
|
|
100
|
+
var __mediaTraceId = getRandomHex(8);
|
|
101
|
+
if (node.type === media) {
|
|
102
|
+
return media.createChecked(_objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
103
|
+
__external: node.attrs.type === 'external',
|
|
104
|
+
__mediaTraceId: node.attrs.type === 'external' ? null : __mediaTraceId
|
|
105
|
+
}), node.content, node.marks);
|
|
106
|
+
}
|
|
107
|
+
if (node.type.name === 'mediaInline') {
|
|
108
|
+
return mediaInline.createChecked(_objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
109
|
+
__mediaTraceId: __mediaTraceId
|
|
110
|
+
}), node.content, node.marks);
|
|
111
|
+
}
|
|
112
|
+
return node;
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
|
|
89
116
|
/**
|
|
90
117
|
* Check base styles to see if an element will be invisible when rendered in a document.
|
|
91
118
|
* @param element
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, PasteTypes, PasteContents
|
|
5
|
+
import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, PasteTypes, PasteContents } from '../../analytics';
|
|
6
6
|
import { getPasteSource } from '../util';
|
|
7
7
|
import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption, handlePastePanelOrDecisionContentIntoList, handlePasteNonNestableBlockNodesIntoList } from '../handlers';
|
|
8
8
|
import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -212,11 +212,6 @@ export function sendPasteAnalyticsEvent(view, event, slice, pasteContext) {
|
|
|
212
212
|
var payload = createPasteAnalyticsPayload(view, event, slice, pasteContext);
|
|
213
213
|
view.dispatch(addAnalytics(view.state, view.state.tr, payload));
|
|
214
214
|
}
|
|
215
|
-
export function pasteCommandWithAnalytics(view, event, slice, pasteContext) {
|
|
216
|
-
return withAnalytics(function () {
|
|
217
|
-
return createPasteAnalyticsPayload(view, event, slice, pasteContext);
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
215
|
export var handlePasteAsPlainTextWithAnalytics = function handlePasteAsPlainTextWithAnalytics(view, event, slice) {
|
|
221
216
|
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
222
217
|
type: PasteTypes.plain,
|
|
@@ -7,19 +7,17 @@ import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
|
|
|
7
7
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
8
8
|
import { mapChildren } from '../../../utils/slice';
|
|
9
9
|
import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/extensions';
|
|
10
|
-
import { isPastedFile as isPastedFileFromEvent } from '@atlaskit/editor-common/paste';
|
|
11
|
-
import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, unwrapNestedMediaElements } from '../plugins/media';
|
|
10
|
+
import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
|
|
11
|
+
import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, transformSliceToMediaSingleWithNewExperience, unwrapNestedMediaElements } from '../plugins/media';
|
|
12
12
|
import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from '../util';
|
|
13
|
-
import { linkifyContent } from '@atlaskit/editor-common/utils';
|
|
13
|
+
import { linkifyContent, measureRender } from '@atlaskit/editor-common/utils';
|
|
14
14
|
import { transformSliceNestedExpandToExpand } from '../../expand/utils';
|
|
15
15
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
|
|
16
16
|
import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
|
|
17
17
|
import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics, handlePastePanelOrDecisionIntoListWithAnalytics, handlePasteNonNestableBlockNodesIntoListWithAnalytics } from './analytics';
|
|
18
18
|
import { ACTION, analyticsPluginKey, INPUT_METHOD, PasteTypes } from '../../analytics';
|
|
19
19
|
import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
|
|
20
|
-
import { measureRender } from '@atlaskit/editor-common/utils';
|
|
21
20
|
import { upgradeTextToLists, splitParagraphs } from '../commands';
|
|
22
|
-
import { md } from '@atlaskit/editor-common/paste';
|
|
23
21
|
import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
|
|
24
22
|
import { containsAnyAnnotations, stripNonExistingAnnotations } from '../../annotation/utils';
|
|
25
23
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
@@ -385,6 +383,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
385
383
|
}
|
|
386
384
|
slice = transformSingleLineCodeBlockToCodeMark(slice, schema);
|
|
387
385
|
slice = transformSliceToCorrectMediaWrapper(slice, schema);
|
|
386
|
+
slice = transformSliceToMediaSingleWithNewExperience(slice, schema);
|
|
388
387
|
slice = transformSliceToDecisionList(slice, schema);
|
|
389
388
|
|
|
390
389
|
// splitting linebreaks into paragraphs must happen before upgrading text to lists
|
package/dist/esm/plugins/rank.js
CHANGED
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
'mediaKeymap',
|
|
14
14
|
// selection keymap needs to be above gap cursor keymap so it can set node selections from
|
|
15
15
|
// left/right arrows
|
|
16
|
-
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
|
|
16
|
+
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'selectionToolbar', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
|
|
17
17
|
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
18
18
|
marks: [
|
|
19
19
|
// Fragment mark is both for inline and block elements
|
|
@@ -72,7 +72,7 @@ var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
|
72
72
|
name: 'tasksAndDecisionsKeyMap',
|
|
73
73
|
plugin: function plugin(_ref5) {
|
|
74
74
|
var schema = _ref5.schema;
|
|
75
|
-
return keymap(schema, allowNestedTasks, consumeTabs);
|
|
75
|
+
return keymap(schema, api, allowNestedTasks, consumeTabs);
|
|
76
76
|
}
|
|
77
77
|
} // Needs to be after "save-on-enter"
|
|
78
78
|
];
|
|
@@ -9,7 +9,8 @@ import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
|
9
9
|
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { uuid } from '@atlaskit/adf-schema';
|
|
11
11
|
import { filterCommand as filter, isEmptySelectionAtStart, isEmptySelectionAtEnd, deleteEmptyParagraphAndMoveBlockUp } from '@atlaskit/editor-common/utils';
|
|
12
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD
|
|
12
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
13
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
13
14
|
import { insertTaskDecisionWithAnalytics } from '../commands';
|
|
14
15
|
import { joinAtCut, liftSelection, wrapSelectionInTaskList } from './commands';
|
|
15
16
|
import { getBlockRange, getCurrentIndentLevel, isActionOrDecisionItem, isActionOrDecisionList, isEmptyTaskDecision, isInsideTask, isInsideTaskOrDecisionItem, liftBlock, walkOut, getTaskItemIndex, isInsideDecision, isTable } from './helpers';
|
|
@@ -88,16 +89,18 @@ var joinTaskDecisionFollowing = function joinTaskDecisionFollowing(state, dispat
|
|
|
88
89
|
}
|
|
89
90
|
return false;
|
|
90
91
|
};
|
|
91
|
-
export var getUnindentCommand = function getUnindentCommand() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
export var getUnindentCommand = function getUnindentCommand(editorAnalyticsAPI) {
|
|
93
|
+
return function () {
|
|
94
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
95
|
+
return filter(isInsideTask, function (state, dispatch) {
|
|
96
|
+
var normalizedSelection = normalizeTaskItemsSelection(state.selection);
|
|
97
|
+
var curIndentLevel = getCurrentIndentLevel(normalizedSelection);
|
|
98
|
+
if (!curIndentLevel || curIndentLevel === 1) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
return withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.OUTDENT, inputMethod))(autoJoin(liftSelection, ['taskList']))(state, dispatch);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
101
104
|
};
|
|
102
105
|
|
|
103
106
|
// if selection is decision item or first action item in table cell
|
|
@@ -114,53 +117,59 @@ var shouldLetTabThroughInTable = function shouldLetTabThroughInTable(state) {
|
|
|
114
117
|
}
|
|
115
118
|
return false;
|
|
116
119
|
};
|
|
117
|
-
export var getIndentCommand = function getIndentCommand() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
export var getIndentCommand = function getIndentCommand(editorAnalyticsAPI) {
|
|
121
|
+
return function () {
|
|
122
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
123
|
+
return filter(isInsideTask, function (state, dispatch) {
|
|
124
|
+
var normalizedSelection = normalizeTaskItemsSelection(state.selection);
|
|
125
|
+
var curIndentLevel = getCurrentIndentLevel(normalizedSelection);
|
|
126
|
+
if (!curIndentLevel || curIndentLevel >= 6) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
return withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.INDENT, inputMethod))(autoJoin(wrapSelectionInTaskList, ['taskList']))(state, dispatch);
|
|
130
|
+
});
|
|
131
|
+
};
|
|
127
132
|
};
|
|
128
|
-
var backspaceFrom = function backspaceFrom(
|
|
129
|
-
return function (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
var backspaceFrom = function backspaceFrom(editorAnalyticsAPI) {
|
|
134
|
+
return function ($from) {
|
|
135
|
+
return function (state, dispatch) {
|
|
136
|
+
// previous was empty, just delete backwards
|
|
137
|
+
var taskBefore = $from.doc.resolve($from.before());
|
|
138
|
+
if (taskBefore.nodeBefore && isActionOrDecisionItem(taskBefore.nodeBefore) && taskBefore.nodeBefore.nodeSize === 2) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
135
141
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
// if nested, just unindent
|
|
143
|
+
var _state$schema$nodes3 = state.schema.nodes,
|
|
144
|
+
taskList = _state$schema$nodes3.taskList,
|
|
145
|
+
paragraph = _state$schema$nodes3.paragraph;
|
|
146
|
+
if ($from.node($from.depth - 2).type === taskList) {
|
|
147
|
+
return getUnindentCommand(editorAnalyticsAPI)()(state, dispatch);
|
|
148
|
+
}
|
|
143
149
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
150
|
+
// bottom level, should "unwrap" taskItem contents into paragraph
|
|
151
|
+
// we achieve this by slicing the content out, and replacing
|
|
152
|
+
if (actionDecisionFollowsOrNothing($from)) {
|
|
153
|
+
if (dispatch) {
|
|
154
|
+
var taskContent = state.doc.slice($from.start(), $from.end()).content;
|
|
149
155
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
156
|
+
// might be end of document after
|
|
157
|
+
var slice = taskContent.size ? paragraph.createChecked(undefined, taskContent) : paragraph.createChecked();
|
|
158
|
+
dispatch(splitListItemWith(state.tr, slice, $from, true));
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
153
161
|
}
|
|
154
|
-
return
|
|
155
|
-
}
|
|
156
|
-
return false;
|
|
162
|
+
return false;
|
|
163
|
+
};
|
|
157
164
|
};
|
|
158
165
|
};
|
|
159
|
-
var backspace =
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
var backspace = function backspace(editorAnalyticsAPI) {
|
|
167
|
+
return filter(isEmptySelectionAtStart, autoJoin(chainCommands(function (state, dispatch) {
|
|
168
|
+
return joinAtCut(state.selection.$from)(state, dispatch);
|
|
169
|
+
}, filter(isInsideTaskOrDecisionItem, function (state, dispatch) {
|
|
170
|
+
return backspaceFrom(editorAnalyticsAPI)(state.selection.$from)(state, dispatch);
|
|
171
|
+
})), ['taskList', 'decisionList']));
|
|
172
|
+
};
|
|
164
173
|
var unindentTaskOrUnwrapTaskDecisionFollowing = function unindentTaskOrUnwrapTaskDecisionFollowing(state, dispatch) {
|
|
165
174
|
var $from = state.selection.$from,
|
|
166
175
|
_state$schema$nodes4 = state.schema.nodes,
|
|
@@ -270,42 +279,44 @@ var splitListItem = function splitListItem(state, dispatch) {
|
|
|
270
279
|
}
|
|
271
280
|
return false;
|
|
272
281
|
};
|
|
273
|
-
var enter =
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
$
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
282
|
+
var enter = function enter(editorAnalyticsAPI) {
|
|
283
|
+
return filter(isInsideTaskOrDecisionItem, chainCommands(filter(isEmptyTaskDecision, chainCommands(getUnindentCommand(editorAnalyticsAPI)(), splitListItem)), function (state, dispatch) {
|
|
284
|
+
var selection = state.selection,
|
|
285
|
+
schema = state.schema;
|
|
286
|
+
var taskItem = schema.nodes.taskItem;
|
|
287
|
+
var $from = selection.$from,
|
|
288
|
+
$to = selection.$to;
|
|
289
|
+
var node = $from.node($from.depth);
|
|
290
|
+
var nodeType = node && node.type;
|
|
291
|
+
var listType = nodeType === taskItem ? 'taskList' : 'decisionList';
|
|
292
|
+
var addItem = function addItem(_ref) {
|
|
293
|
+
var tr = _ref.tr,
|
|
294
|
+
itemLocalId = _ref.itemLocalId;
|
|
295
|
+
// ED-8932: When cursor is at the beginning of a task item, instead of split, we insert above.
|
|
296
|
+
if ($from.pos === $to.pos && $from.parentOffset === 0) {
|
|
297
|
+
var newTask = nodeType.createAndFill({
|
|
298
|
+
localId: itemLocalId
|
|
299
|
+
});
|
|
300
|
+
if (newTask) {
|
|
301
|
+
// Current position will point to text node, but we want to insert above the taskItem node
|
|
302
|
+
return tr.insert($from.pos - 1, newTask);
|
|
303
|
+
}
|
|
293
304
|
}
|
|
305
|
+
return tr.split($from.pos, 1, [{
|
|
306
|
+
type: nodeType,
|
|
307
|
+
attrs: {
|
|
308
|
+
localId: itemLocalId
|
|
309
|
+
}
|
|
310
|
+
}]);
|
|
311
|
+
};
|
|
312
|
+
var insertTr = insertTaskDecisionWithAnalytics(state, listType, INPUT_METHOD.KEYBOARD, addItem);
|
|
313
|
+
if (insertTr && dispatch) {
|
|
314
|
+
insertTr.scrollIntoView();
|
|
315
|
+
dispatch(insertTr);
|
|
294
316
|
}
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
localId: itemLocalId
|
|
299
|
-
}
|
|
300
|
-
}]);
|
|
301
|
-
};
|
|
302
|
-
var insertTr = insertTaskDecisionWithAnalytics(state, listType, INPUT_METHOD.KEYBOARD, addItem);
|
|
303
|
-
if (insertTr && dispatch) {
|
|
304
|
-
insertTr.scrollIntoView();
|
|
305
|
-
dispatch(insertTr);
|
|
306
|
-
}
|
|
307
|
-
return true;
|
|
308
|
-
}));
|
|
317
|
+
return true;
|
|
318
|
+
}));
|
|
319
|
+
};
|
|
309
320
|
var cmdOptEnter = filter(isInsideTaskOrDecisionItem, function (state, dispatch) {
|
|
310
321
|
var selection = state.selection,
|
|
311
322
|
schema = state.schema;
|
|
@@ -326,17 +337,20 @@ var cmdOptEnter = filter(isInsideTaskOrDecisionItem, function (state, dispatch)
|
|
|
326
337
|
}
|
|
327
338
|
return true;
|
|
328
339
|
});
|
|
329
|
-
export function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
340
|
+
export function keymapPlugin(schema, api, allowNestedTasks, consumeTabs) {
|
|
341
|
+
var _api$analytics3, _api$analytics4;
|
|
330
342
|
var indentHandlers = {
|
|
331
343
|
'Shift-Tab': filter([isInsideTaskOrDecisionItem, function (state) {
|
|
332
344
|
return !shouldLetTabThroughInTable(state);
|
|
333
345
|
}], function (state, dispatch) {
|
|
334
|
-
|
|
346
|
+
var _api$analytics;
|
|
347
|
+
return getUnindentCommand(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs;
|
|
335
348
|
}),
|
|
336
349
|
Tab: filter([isInsideTaskOrDecisionItem, function (state) {
|
|
337
350
|
return !shouldLetTabThroughInTable(state);
|
|
338
351
|
}], function (state, dispatch) {
|
|
339
|
-
|
|
352
|
+
var _api$analytics2;
|
|
353
|
+
return getIndentCommand(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs;
|
|
340
354
|
})
|
|
341
355
|
};
|
|
342
356
|
var defaultHandlers = consumeTabs ? {
|
|
@@ -344,10 +358,10 @@ export function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
|
344
358
|
Tab: isInsideTaskOrDecisionItem
|
|
345
359
|
} : {};
|
|
346
360
|
var keymaps = _objectSpread(_defineProperty({
|
|
347
|
-
Backspace: backspace,
|
|
361
|
+
Backspace: backspace(api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions),
|
|
348
362
|
Delete: deleteForwards,
|
|
349
363
|
'Ctrl-d': deleteForwards,
|
|
350
|
-
Enter: enter
|
|
364
|
+
Enter: enter(api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions)
|
|
351
365
|
}, toggleTaskItemCheckbox.common, cmdOptEnter), allowNestedTasks ? indentHandlers : defaultHandlers);
|
|
352
366
|
return keymap(keymaps);
|
|
353
367
|
}
|
|
@@ -24,7 +24,8 @@ export var onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
|
24
24
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.indentList(INPUT_METHOD.TOOLBAR));
|
|
25
25
|
}
|
|
26
26
|
if (node === 'taskList') {
|
|
27
|
-
|
|
27
|
+
var _pluginInjectionApi$a;
|
|
28
|
+
indentTaskList(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
28
29
|
}
|
|
29
30
|
break;
|
|
30
31
|
}
|
|
@@ -39,7 +40,8 @@ export var onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
|
39
40
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.outdentList(INPUT_METHOD.TOOLBAR));
|
|
40
41
|
}
|
|
41
42
|
if (_node === 'taskList') {
|
|
42
|
-
|
|
43
|
+
var _pluginInjectionApi$a2;
|
|
44
|
+
outdentTaskList(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
43
45
|
}
|
|
44
46
|
break;
|
|
45
47
|
}
|
|
@@ -10,6 +10,7 @@ import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
|
10
10
|
import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
|
|
11
11
|
import type codeBlockPlugin from '../code-block';
|
|
12
12
|
import type panelPlugin from '../panel';
|
|
13
|
+
import type { LayoutPlugin } from '../layout';
|
|
13
14
|
import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
|
|
14
15
|
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
15
16
|
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
@@ -31,5 +32,6 @@ export type InsertBlockPluginDependencies = [
|
|
|
31
32
|
OptionalPlugin<typeof panelPlugin>,
|
|
32
33
|
OptionalPlugin<MediaPlugin>,
|
|
33
34
|
OptionalPlugin<MentionsPlugin>,
|
|
34
|
-
OptionalPlugin<StatusPlugin
|
|
35
|
+
OptionalPlugin<StatusPlugin>,
|
|
36
|
+
OptionalPlugin<LayoutPlugin>
|
|
35
37
|
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Command } from '../../types/command';
|
|
3
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
5
|
import type { Change, PresetLayout } from './types';
|
|
5
6
|
import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
6
7
|
export declare const ONE_COL_LAYOUTS: PresetLayout[];
|
|
@@ -14,7 +15,7 @@ export declare const getPresetLayout: (section: Node) => PresetLayout | undefine
|
|
|
14
15
|
export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
|
|
15
16
|
export declare const createDefaultLayoutSection: (state: EditorState) => Node;
|
|
16
17
|
export declare const insertLayoutColumns: Command;
|
|
17
|
-
export declare const insertLayoutColumnsWithAnalytics: (inputMethod: TOOLBAR_MENU_TYPE) => Command;
|
|
18
|
+
export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
|
|
18
19
|
export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
|
|
19
20
|
export declare const setPresetLayout: (layout: PresetLayout) => Command;
|
|
20
21
|
export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { insertLayoutColumnsWithAnalytics } from './actions';
|
|
2
3
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
3
4
|
import type { LayoutPluginOptions } from './types';
|
|
4
5
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
@@ -7,6 +8,9 @@ export { pluginKey };
|
|
|
7
8
|
export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
8
9
|
pluginConfiguration: LayoutPluginOptions | undefined;
|
|
9
10
|
dependencies: [DecorationsPlugin, OptionalPlugin<AnalyticsPlugin>];
|
|
11
|
+
actions: {
|
|
12
|
+
insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
|
|
13
|
+
};
|
|
10
14
|
}>;
|
|
11
15
|
declare const layoutPlugin: LayoutPlugin;
|
|
12
16
|
export default layoutPlugin;
|
|
@@ -3,7 +3,7 @@ import { INPUT_METHOD } from '../analytics';
|
|
|
3
3
|
import type { PanelPluginOptions } from './types';
|
|
4
4
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
5
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
6
|
-
|
|
6
|
+
export type PanelPlugin = NextEditorPlugin<'panel', {
|
|
7
7
|
pluginConfiguration: PanelPluginOptions | undefined;
|
|
8
8
|
dependencies: [
|
|
9
9
|
typeof decorationsPlugin,
|
|
@@ -13,5 +13,5 @@ declare const panelPlugin: NextEditorPlugin<'panel', {
|
|
|
13
13
|
insertPanel: (inputMethod: INPUT_METHOD) => Command;
|
|
14
14
|
};
|
|
15
15
|
}>;
|
|
16
|
+
declare const panelPlugin: PanelPlugin;
|
|
16
17
|
export default panelPlugin;
|
|
17
|
-
export type PanelPlugin = typeof panelPlugin;
|