@atlaskit/editor-core 188.13.1 → 188.13.3
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 +12 -0
- package/dist/cjs/plugins/code-block/actions.js +27 -25
- package/dist/cjs/plugins/code-block/ide-ux/commands.js +64 -60
- package/dist/cjs/plugins/code-block/index.js +1 -1
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +6 -4
- package/dist/cjs/plugins/code-block/toolbar.js +8 -5
- package/dist/cjs/plugins/layout/actions.js +53 -50
- package/dist/cjs/plugins/layout/index.js +1 -2
- package/dist/cjs/plugins/layout/toolbar.js +10 -6
- package/dist/cjs/plugins/panel/actions.js +59 -56
- package/dist/cjs/plugins/panel/index.js +18 -10
- package/dist/cjs/plugins/panel/toolbar.js +11 -11
- package/dist/cjs/plugins/undo-redo/pm-plugins/keymaps.js +10 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/code-block/actions.js +4 -4
- package/dist/es2019/plugins/code-block/ide-ux/commands.js +9 -9
- package/dist/es2019/plugins/code-block/index.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +6 -4
- package/dist/es2019/plugins/code-block/toolbar.js +7 -3
- package/dist/es2019/plugins/layout/actions.js +6 -7
- package/dist/es2019/plugins/layout/index.js +1 -2
- package/dist/es2019/plugins/layout/toolbar.js +10 -5
- package/dist/es2019/plugins/panel/actions.js +8 -7
- package/dist/es2019/plugins/panel/index.js +18 -10
- package/dist/es2019/plugins/panel/toolbar.js +11 -11
- package/dist/es2019/plugins/undo-redo/pm-plugins/keymaps.js +11 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/code-block/actions.js +27 -25
- package/dist/esm/plugins/code-block/ide-ux/commands.js +62 -58
- package/dist/esm/plugins/code-block/index.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +6 -4
- package/dist/esm/plugins/code-block/toolbar.js +8 -5
- package/dist/esm/plugins/layout/actions.js +53 -50
- package/dist/esm/plugins/layout/index.js +1 -2
- package/dist/esm/plugins/layout/toolbar.js +10 -6
- package/dist/esm/plugins/panel/actions.js +59 -56
- package/dist/esm/plugins/panel/index.js +18 -10
- package/dist/esm/plugins/panel/toolbar.js +11 -11
- package/dist/esm/plugins/undo-redo/pm-plugins/keymaps.js +11 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/code-block/actions.d.ts +1 -1
- package/dist/types/plugins/code-block/ide-ux/commands.d.ts +4 -3
- package/dist/types/plugins/code-block/toolbar.d.ts +3 -3
- package/dist/types/plugins/layout/actions.d.ts +2 -2
- package/dist/types/plugins/layout/toolbar.d.ts +3 -3
- package/dist/types/plugins/panel/actions.d.ts +4 -4
- package/dist/types/plugins/panel/index.d.ts +1 -1
- package/dist/types/plugins/undo-redo/pm-plugins/keymaps.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-block/actions.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-block/ide-ux/commands.d.ts +4 -3
- package/dist/types-ts4.5/plugins/code-block/toolbar.d.ts +3 -3
- package/dist/types-ts4.5/plugins/layout/actions.d.ts +2 -2
- package/dist/types-ts4.5/plugins/layout/toolbar.d.ts +3 -3
- package/dist/types-ts4.5/plugins/panel/actions.d.ts +4 -4
- package/dist/types-ts4.5/plugins/panel/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/undo-redo/pm-plugins/keymaps.d.ts +1 -1
- package/package.json +2 -2
|
@@ -4,12 +4,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { removeParentNodeOfType, findSelectedNodeOfType, removeSelectedNode, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { findPanel } from './utils';
|
|
9
9
|
import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
|
|
10
10
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
11
11
|
import { wrapSelectionIn } from '@atlaskit/editor-common/utils';
|
|
12
|
-
export var removePanel = function removePanel() {
|
|
12
|
+
export var removePanel = function removePanel(editorAnalyticsAPI) {
|
|
13
13
|
return function (state, dispatch) {
|
|
14
14
|
var nodes = state.schema.nodes,
|
|
15
15
|
tr = state.tr;
|
|
@@ -31,65 +31,68 @@ export var removePanel = function removePanel() {
|
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
33
|
if (dispatch) {
|
|
34
|
-
|
|
34
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(deleteTr);
|
|
35
|
+
dispatch(deleteTr);
|
|
35
36
|
}
|
|
36
37
|
return true;
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
|
-
export var changePanelType = function changePanelType(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
40
|
+
export var changePanelType = function changePanelType(editorAnalyticsAPI) {
|
|
41
|
+
return function (panelType) {
|
|
42
|
+
var panelOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
43
|
+
var allowCustomPanel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
44
|
+
return function (state, dispatch) {
|
|
45
|
+
var nodes = state.schema.nodes,
|
|
46
|
+
tr = state.tr;
|
|
47
|
+
var panelNode = findPanel(state);
|
|
48
|
+
if (panelNode === undefined) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
var newType = panelType;
|
|
52
|
+
var previousType = panelNode.node.attrs.panelType;
|
|
53
|
+
var newTr;
|
|
54
|
+
if (allowCustomPanel) {
|
|
55
|
+
var previousColor = panelNode.node.attrs.panelType === 'custom' ? panelNode.node.attrs.panelColor || 'none' : getPanelTypeBackgroundNoTokens(previousType);
|
|
56
|
+
var previousIcon = panelNode.node.attrs.panelIcon;
|
|
57
|
+
var previousIconId = panelNode.node.attrs.panelIconId;
|
|
58
|
+
var previousIconText = panelNode.node.attrs.panelIconText;
|
|
59
|
+
var newPanelOptions = _objectSpread({
|
|
60
|
+
color: previousColor,
|
|
61
|
+
emoji: previousIcon,
|
|
62
|
+
emojiId: previousIconId,
|
|
63
|
+
emojiText: previousIconText
|
|
64
|
+
}, panelOptions);
|
|
65
|
+
newTr = tr.setNodeMarkup(panelNode.pos, nodes.panel, {
|
|
66
|
+
panelIcon: newPanelOptions.emoji,
|
|
67
|
+
panelIconId: newPanelOptions.emojiId,
|
|
68
|
+
panelIconText: newPanelOptions.emojiText,
|
|
69
|
+
panelColor: newPanelOptions.color,
|
|
70
|
+
panelType: panelType
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
newTr = tr.setNodeMarkup(panelNode.pos, nodes.panel, {
|
|
74
|
+
panelType: panelType
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
var payload = {
|
|
78
|
+
action: ACTION.CHANGED_TYPE,
|
|
79
|
+
actionSubject: ACTION_SUBJECT.PANEL,
|
|
80
|
+
attributes: {
|
|
81
|
+
newType: newType,
|
|
82
|
+
previousType: previousType
|
|
83
|
+
},
|
|
84
|
+
eventType: EVENT_TYPE.TRACK
|
|
85
|
+
};
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
// Select the panel if it was previously selected
|
|
88
|
+
var newTrWithSelection = state.selection instanceof NodeSelection && state.selection.node.type.name === 'panel' ? newTr.setSelection(new NodeSelection(tr.doc.resolve(panelNode.pos))) : newTr;
|
|
89
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(newTrWithSelection);
|
|
90
|
+
newTrWithSelection.setMeta('scrollIntoView', false);
|
|
91
|
+
if (dispatch) {
|
|
92
|
+
dispatch(newTrWithSelection);
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
};
|
|
93
96
|
};
|
|
94
97
|
};
|
|
95
98
|
export function insertPanelWithAnalytics(inputMethod, analyticsAPI) {
|
|
@@ -3,7 +3,7 @@ import { panel, PanelType } from '@atlaskit/adf-schema';
|
|
|
3
3
|
import { createPlugin } from './pm-plugins/main';
|
|
4
4
|
import { getToolbarConfig } from './toolbar';
|
|
5
5
|
import keymap from './pm-plugins/keymaps';
|
|
6
|
-
import {
|
|
6
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import { IconPanel, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanelError } from '@atlaskit/editor-common/quick-insert';
|
|
8
8
|
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
@@ -61,7 +61,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
61
61
|
state: state,
|
|
62
62
|
attributes: {
|
|
63
63
|
panelType: PanelType.INFO
|
|
64
|
-
}
|
|
64
|
+
},
|
|
65
|
+
api: api
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
}, {
|
|
@@ -77,7 +78,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
77
78
|
state: state,
|
|
78
79
|
attributes: {
|
|
79
80
|
panelType: PanelType.NOTE
|
|
80
|
-
}
|
|
81
|
+
},
|
|
82
|
+
api: api
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
}, {
|
|
@@ -94,7 +96,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
94
96
|
state: state,
|
|
95
97
|
attributes: {
|
|
96
98
|
panelType: PanelType.SUCCESS
|
|
97
|
-
}
|
|
99
|
+
},
|
|
100
|
+
api: api
|
|
98
101
|
});
|
|
99
102
|
}
|
|
100
103
|
}, {
|
|
@@ -110,7 +113,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
110
113
|
state: state,
|
|
111
114
|
attributes: {
|
|
112
115
|
panelType: PanelType.WARNING
|
|
113
|
-
}
|
|
116
|
+
},
|
|
117
|
+
api: api
|
|
114
118
|
});
|
|
115
119
|
}
|
|
116
120
|
}, {
|
|
@@ -126,7 +130,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
126
130
|
state: state,
|
|
127
131
|
attributes: {
|
|
128
132
|
panelType: PanelType.ERROR
|
|
129
|
-
}
|
|
133
|
+
},
|
|
134
|
+
api: api
|
|
130
135
|
});
|
|
131
136
|
}
|
|
132
137
|
}];
|
|
@@ -150,7 +155,8 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
150
155
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-7268
|
|
151
156
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
152
157
|
panelColor: T50
|
|
153
|
-
}
|
|
158
|
+
},
|
|
159
|
+
api: api
|
|
154
160
|
});
|
|
155
161
|
}
|
|
156
162
|
});
|
|
@@ -178,14 +184,16 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
178
184
|
*/
|
|
179
185
|
function createPanelAction(_ref4) {
|
|
180
186
|
var state = _ref4.state,
|
|
181
|
-
attributes = _ref4.attributes
|
|
187
|
+
attributes = _ref4.attributes,
|
|
188
|
+
api = _ref4.api;
|
|
182
189
|
var tr = createWrapSelectionTransaction({
|
|
183
190
|
state: state,
|
|
184
191
|
type: state.schema.nodes.panel,
|
|
185
192
|
nodeAttributes: attributes
|
|
186
193
|
});
|
|
187
194
|
if (tr) {
|
|
188
|
-
|
|
195
|
+
var _api$analytics2;
|
|
196
|
+
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
189
197
|
action: ACTION.INSERTED,
|
|
190
198
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
191
199
|
actionSubjectId: ACTION_SUBJECT_ID.PANEL,
|
|
@@ -194,7 +202,7 @@ function createPanelAction(_ref4) {
|
|
|
194
202
|
panelType: attributes.panelType
|
|
195
203
|
},
|
|
196
204
|
eventType: EVENT_TYPE.TRACK
|
|
197
|
-
});
|
|
205
|
+
})(tr);
|
|
198
206
|
}
|
|
199
207
|
return tr;
|
|
200
208
|
}
|
|
@@ -45,7 +45,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
45
45
|
id: 'editor.panel.info',
|
|
46
46
|
type: 'button',
|
|
47
47
|
icon: InfoIcon,
|
|
48
|
-
onClick: changePanelType(PanelType.INFO),
|
|
48
|
+
onClick: changePanelType(editorAnalyticsAPI)(PanelType.INFO),
|
|
49
49
|
selected: activePanelType === PanelType.INFO,
|
|
50
50
|
title: formatMessage(messages.info),
|
|
51
51
|
tabIndex: null
|
|
@@ -53,7 +53,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
53
53
|
id: 'editor.panel.note',
|
|
54
54
|
type: 'button',
|
|
55
55
|
icon: NoteIcon,
|
|
56
|
-
onClick: changePanelType(PanelType.NOTE),
|
|
56
|
+
onClick: changePanelType(editorAnalyticsAPI)(PanelType.NOTE),
|
|
57
57
|
selected: activePanelType === PanelType.NOTE,
|
|
58
58
|
title: formatMessage(messages.note),
|
|
59
59
|
tabIndex: null
|
|
@@ -61,7 +61,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
61
61
|
id: 'editor.panel.success',
|
|
62
62
|
type: 'button',
|
|
63
63
|
icon: SuccessIcon,
|
|
64
|
-
onClick: changePanelType(PanelType.SUCCESS),
|
|
64
|
+
onClick: changePanelType(editorAnalyticsAPI)(PanelType.SUCCESS),
|
|
65
65
|
selected: activePanelType === PanelType.SUCCESS,
|
|
66
66
|
title: formatMessage(messages.success),
|
|
67
67
|
tabIndex: null
|
|
@@ -69,7 +69,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
69
69
|
id: 'editor.panel.warning',
|
|
70
70
|
type: 'button',
|
|
71
71
|
icon: WarningIcon,
|
|
72
|
-
onClick: changePanelType(PanelType.WARNING),
|
|
72
|
+
onClick: changePanelType(editorAnalyticsAPI)(PanelType.WARNING),
|
|
73
73
|
selected: activePanelType === PanelType.WARNING,
|
|
74
74
|
title: formatMessage(messages.warning),
|
|
75
75
|
tabIndex: null
|
|
@@ -77,7 +77,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
77
77
|
id: 'editor.panel.error',
|
|
78
78
|
type: 'button',
|
|
79
79
|
icon: ErrorIcon,
|
|
80
|
-
onClick: changePanelType(PanelType.ERROR),
|
|
80
|
+
onClick: changePanelType(editorAnalyticsAPI)(PanelType.ERROR),
|
|
81
81
|
selected: activePanelType === PanelType.ERROR,
|
|
82
82
|
title: formatMessage(messages.error),
|
|
83
83
|
tabIndex: null
|
|
@@ -97,7 +97,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
97
97
|
emojiId: panelEmoji.id
|
|
98
98
|
} : {};
|
|
99
99
|
if (previousColor === color) {
|
|
100
|
-
changePanelType(PanelType.CUSTOM, _objectSpread({
|
|
100
|
+
changePanelType(editorAnalyticsAPI)(PanelType.CUSTOM, _objectSpread({
|
|
101
101
|
color: color
|
|
102
102
|
}, previousEmoji), isCustomPanelEnabled)(state, dispatch);
|
|
103
103
|
return false;
|
|
@@ -112,7 +112,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
112
112
|
},
|
|
113
113
|
eventType: EVENT_TYPE.TRACK
|
|
114
114
|
};
|
|
115
|
-
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(PanelType.CUSTOM, _objectSpread({
|
|
115
|
+
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(editorAnalyticsAPI)(PanelType.CUSTOM, _objectSpread({
|
|
116
116
|
color: color
|
|
117
117
|
}, previousEmoji), isCustomPanelEnabled))(state, dispatch);
|
|
118
118
|
return false;
|
|
@@ -126,7 +126,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
126
126
|
}
|
|
127
127
|
var previousIcon = panelNode.node.attrs.panelIcon || '';
|
|
128
128
|
if (previousIcon === emoji.shortName) {
|
|
129
|
-
changePanelType(PanelType.CUSTOM, {
|
|
129
|
+
changePanelType(editorAnalyticsAPI)(PanelType.CUSTOM, {
|
|
130
130
|
emoji: emoji.shortName,
|
|
131
131
|
emojiId: emoji.id,
|
|
132
132
|
emojiText: emoji.fallback
|
|
@@ -143,7 +143,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
143
143
|
},
|
|
144
144
|
eventType: EVENT_TYPE.TRACK
|
|
145
145
|
};
|
|
146
|
-
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(PanelType.CUSTOM, {
|
|
146
|
+
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(editorAnalyticsAPI)(PanelType.CUSTOM, {
|
|
147
147
|
emoji: emoji.shortName,
|
|
148
148
|
emojiId: emoji.id,
|
|
149
149
|
emojiText: emoji.fallback
|
|
@@ -169,7 +169,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
169
169
|
},
|
|
170
170
|
eventType: EVENT_TYPE.TRACK
|
|
171
171
|
};
|
|
172
|
-
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(PanelType.CUSTOM, {
|
|
172
|
+
withAnalytics(editorAnalyticsAPI, payload)(changePanelType(editorAnalyticsAPI)(PanelType.CUSTOM, {
|
|
173
173
|
emoji: undefined,
|
|
174
174
|
emojiId: undefined,
|
|
175
175
|
emojiText: undefined
|
|
@@ -241,7 +241,7 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
|
|
|
241
241
|
appearance: 'danger',
|
|
242
242
|
focusEditoronEnter: true,
|
|
243
243
|
icon: RemoveIcon,
|
|
244
|
-
onClick: removePanel(),
|
|
244
|
+
onClick: removePanel(editorAnalyticsAPI),
|
|
245
245
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
246
246
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, false),
|
|
247
247
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(panelNodeType, true),
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { undo, redo, bindKeymapWithCommand, findKeyMapForBrowser, isCapsLockOnAndModifyKeyboardEvent } from '@atlaskit/editor-common/keymaps';
|
|
2
3
|
import { redoFromKeyboard, undoFromKeyboard } from '../commands';
|
|
4
|
+
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
5
|
export function keymapPlugin() {
|
|
4
6
|
var list = {};
|
|
5
7
|
bindKeymapWithCommand(findKeyMapForBrowser(redo), redoFromKeyboard, list);
|
|
6
8
|
bindKeymapWithCommand(undo.common, undoFromKeyboard, list);
|
|
7
|
-
return
|
|
9
|
+
return new SafePlugin({
|
|
10
|
+
props: {
|
|
11
|
+
handleKeyDown: function handleKeyDown(view, event) {
|
|
12
|
+
var keyboardEvent = isCapsLockOnAndModifyKeyboardEvent(event);
|
|
13
|
+
return keydownHandler(list)(view, keyboardEvent);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
8
17
|
}
|
|
@@ -2,7 +2,7 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import type { Command } from '../../types';
|
|
3
3
|
import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
export declare const removeCodeBlock: Command;
|
|
5
|
-
export declare const changeLanguage: (language: string) => Command;
|
|
5
|
+
export declare const changeLanguage: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (language: string) => Command;
|
|
6
6
|
export declare const copyContentToClipboard: Command;
|
|
7
7
|
export declare const resetCopiedState: Command;
|
|
8
8
|
export declare const ignoreFollowingMutations: Command;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { CommandDispatch } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare const indent: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
|
|
5
|
+
export declare const outdent: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
|
|
5
6
|
export declare function insertIndent(state: EditorState, dispatch: CommandDispatch): boolean;
|
|
6
7
|
export declare function insertNewlineWithIndent(state: EditorState, dispatch?: CommandDispatch): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FloatingToolbarHandler, SelectOption } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type {
|
|
1
|
+
import type { FloatingToolbarHandler, SelectOption, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { CodeBlockPlugin } from '.';
|
|
3
3
|
export declare const messages: {
|
|
4
4
|
selectLanguage: {
|
|
5
5
|
id: string;
|
|
@@ -7,7 +7,7 @@ export declare const messages: {
|
|
|
7
7
|
description: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export declare const getToolbarConfig: (allowCopyToClipboard: boolean | undefined,
|
|
10
|
+
export declare const getToolbarConfig: (allowCopyToClipboard: boolean | undefined, api: ExtractInjectionAPI<CodeBlockPlugin> | undefined) => FloatingToolbarHandler;
|
|
11
11
|
/**
|
|
12
12
|
* Filters language list based on both name and alias properties.
|
|
13
13
|
*/
|
|
@@ -17,7 +17,7 @@ export declare const createDefaultLayoutSection: (state: EditorState) => Node;
|
|
|
17
17
|
export declare const insertLayoutColumns: Command;
|
|
18
18
|
export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
|
|
19
19
|
export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
|
|
20
|
-
export declare const setPresetLayout: (layout: PresetLayout) => Command;
|
|
20
|
+
export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
|
|
21
21
|
export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
|
|
22
22
|
export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
|
|
23
|
-
export declare const deleteActiveLayoutNode: Command;
|
|
23
|
+
export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type {
|
|
3
|
+
import type { FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { LayoutPlugin } from './';
|
|
5
5
|
export declare const layoutToolbarTitle = "Layout floating controls";
|
|
6
|
-
export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean,
|
|
6
|
+
export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { Command } from '../../types';
|
|
3
|
-
import { INPUT_METHOD } from '
|
|
4
|
-
import type { PanelOptions } from './pm-plugins/main';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
4
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import type { PanelOptions } from './pm-plugins/main';
|
|
6
6
|
export type DomAtPos = (pos: number) => {
|
|
7
7
|
node: HTMLElement;
|
|
8
8
|
offset: number;
|
|
9
9
|
};
|
|
10
|
-
export declare const removePanel: () => Command;
|
|
11
|
-
export declare const changePanelType: (panelType: PanelType, panelOptions?: PanelOptions, allowCustomPanel?: boolean) => Command;
|
|
10
|
+
export declare const removePanel: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
11
|
+
export declare const changePanelType: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (panelType: PanelType, panelOptions?: PanelOptions, allowCustomPanel?: boolean) => Command;
|
|
12
12
|
export declare function insertPanelWithAnalytics(inputMethod: INPUT_METHOD, analyticsAPI?: EditorAnalyticsAPI): import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { INPUT_METHOD } from '
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/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';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
export declare function keymapPlugin(): SafePlugin;
|
|
@@ -2,7 +2,7 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import type { Command } from '../../types';
|
|
3
3
|
import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
export declare const removeCodeBlock: Command;
|
|
5
|
-
export declare const changeLanguage: (language: string) => Command;
|
|
5
|
+
export declare const changeLanguage: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (language: string) => Command;
|
|
6
6
|
export declare const copyContentToClipboard: Command;
|
|
7
7
|
export declare const resetCopiedState: Command;
|
|
8
8
|
export declare const ignoreFollowingMutations: Command;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { CommandDispatch } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare const indent: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
|
|
5
|
+
export declare const outdent: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
|
|
5
6
|
export declare function insertIndent(state: EditorState, dispatch: CommandDispatch): boolean;
|
|
6
7
|
export declare function insertNewlineWithIndent(state: EditorState, dispatch?: CommandDispatch): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FloatingToolbarHandler, SelectOption } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type {
|
|
1
|
+
import type { FloatingToolbarHandler, SelectOption, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { CodeBlockPlugin } from '.';
|
|
3
3
|
export declare const messages: {
|
|
4
4
|
selectLanguage: {
|
|
5
5
|
id: string;
|
|
@@ -7,7 +7,7 @@ export declare const messages: {
|
|
|
7
7
|
description: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export declare const getToolbarConfig: (allowCopyToClipboard: boolean | undefined,
|
|
10
|
+
export declare const getToolbarConfig: (allowCopyToClipboard: boolean | undefined, api: ExtractInjectionAPI<CodeBlockPlugin> | undefined) => FloatingToolbarHandler;
|
|
11
11
|
/**
|
|
12
12
|
* Filters language list based on both name and alias properties.
|
|
13
13
|
*/
|
|
@@ -17,7 +17,7 @@ export declare const createDefaultLayoutSection: (state: EditorState) => Node;
|
|
|
17
17
|
export declare const insertLayoutColumns: Command;
|
|
18
18
|
export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
|
|
19
19
|
export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
|
|
20
|
-
export declare const setPresetLayout: (layout: PresetLayout) => Command;
|
|
20
|
+
export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
|
|
21
21
|
export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
|
|
22
22
|
export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
|
|
23
|
-
export declare const deleteActiveLayoutNode: Command;
|
|
23
|
+
export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type {
|
|
3
|
+
import type { FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { LayoutPlugin } from './';
|
|
5
5
|
export declare const layoutToolbarTitle = "Layout floating controls";
|
|
6
|
-
export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean,
|
|
6
|
+
export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { Command } from '../../types';
|
|
3
|
-
import { INPUT_METHOD } from '
|
|
4
|
-
import type { PanelOptions } from './pm-plugins/main';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
4
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import type { PanelOptions } from './pm-plugins/main';
|
|
6
6
|
export type DomAtPos = (pos: number) => {
|
|
7
7
|
node: HTMLElement;
|
|
8
8
|
offset: number;
|
|
9
9
|
};
|
|
10
|
-
export declare const removePanel: () => Command;
|
|
11
|
-
export declare const changePanelType: (panelType: PanelType, panelOptions?: PanelOptions, allowCustomPanel?: boolean) => Command;
|
|
10
|
+
export declare const removePanel: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
11
|
+
export declare const changePanelType: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (panelType: PanelType, panelOptions?: PanelOptions, allowCustomPanel?: boolean) => Command;
|
|
12
12
|
export declare function insertPanelWithAnalytics(inputMethod: INPUT_METHOD, analyticsAPI?: EditorAnalyticsAPI): import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { INPUT_METHOD } from '
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/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';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
export declare function keymapPlugin(): SafePlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "188.13.
|
|
3
|
+
"version": "188.13.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
49
49
|
"@atlaskit/avatar": "^21.4.0",
|
|
50
50
|
"@atlaskit/avatar-group": "^9.4.0",
|
|
51
|
-
"@atlaskit/button": "^16.
|
|
51
|
+
"@atlaskit/button": "^16.11.0",
|
|
52
52
|
"@atlaskit/checkbox": "^12.6.0",
|
|
53
53
|
"@atlaskit/code": "^14.6.0",
|
|
54
54
|
"@atlaskit/date": "^0.10.0",
|