@atlaskit/editor-plugin-extension 5.3.4 → 5.3.6
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/editor-commands/commands.js +12 -8
- package/dist/cjs/pm-plugins/toolbar.js +4 -3
- package/dist/cjs/ui/useConfigPanelPluginHook.js +58 -38
- package/dist/es2019/editor-commands/commands.js +12 -8
- package/dist/es2019/pm-plugins/toolbar.js +4 -3
- package/dist/es2019/ui/useConfigPanelPluginHook.js +2 -2
- package/dist/esm/editor-commands/commands.js +12 -8
- package/dist/esm/pm-plugins/toolbar.js +4 -3
- package/dist/esm/ui/useConfigPanelPluginHook.js +58 -38
- package/dist/types/editor-commands/commands.d.ts +4 -4
- package/dist/types-ts4.5/editor-commands/commands.d.ts +4 -4
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-extension
|
|
2
2
|
|
|
3
|
+
## 5.3.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 5.3.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#149482](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149482)
|
|
14
|
+
[`1f1f73876c3c8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f1f73876c3c8) -
|
|
15
|
+
ED-27860 Add analytics for copy and delete button in floating toolbars
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 5.3.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -13,6 +13,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
13
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
15
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
17
18
|
var _utils3 = require("../pm-plugins/utils");
|
|
18
19
|
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; }
|
|
@@ -91,7 +92,7 @@ var updateExtensionLayout = exports.updateExtensionLayout = function updateExten
|
|
|
91
92
|
return tr;
|
|
92
93
|
});
|
|
93
94
|
};
|
|
94
|
-
var removeExtension = exports.removeExtension = function removeExtension(editorAnalyticsAPI) {
|
|
95
|
+
var removeExtension = exports.removeExtension = function removeExtension(editorAnalyticsAPI, inputMethod) {
|
|
95
96
|
return (0, _pluginFactory.createCommand)({
|
|
96
97
|
type: 'UPDATE_STATE',
|
|
97
98
|
data: {
|
|
@@ -99,9 +100,9 @@ var removeExtension = exports.removeExtension = function removeExtension(editorA
|
|
|
99
100
|
}
|
|
100
101
|
}, function (tr, state) {
|
|
101
102
|
if ((0, _utils3.getSelectedExtension)(state)) {
|
|
102
|
-
return removeSelectedNodeWithAnalytics(state, tr, editorAnalyticsAPI);
|
|
103
|
+
return removeSelectedNodeWithAnalytics(state, tr, editorAnalyticsAPI, inputMethod);
|
|
103
104
|
} else {
|
|
104
|
-
return checkAndRemoveExtensionNode(state, tr, editorAnalyticsAPI);
|
|
105
|
+
return checkAndRemoveExtensionNode(state, tr, editorAnalyticsAPI, inputMethod);
|
|
105
106
|
}
|
|
106
107
|
});
|
|
107
108
|
};
|
|
@@ -115,7 +116,7 @@ var removeDescendantNodes = exports.removeDescendantNodes = function removeDesce
|
|
|
115
116
|
return sourceNode ? (0, _utils.removeConnectedNodes)(state, sourceNode) : tr;
|
|
116
117
|
});
|
|
117
118
|
};
|
|
118
|
-
var removeSelectedNodeWithAnalytics = exports.removeSelectedNodeWithAnalytics = function removeSelectedNodeWithAnalytics(state, tr, analyticsApi) {
|
|
119
|
+
var removeSelectedNodeWithAnalytics = exports.removeSelectedNodeWithAnalytics = function removeSelectedNodeWithAnalytics(state, tr, analyticsApi, inputMethod) {
|
|
119
120
|
if (state.selection instanceof _state.NodeSelection) {
|
|
120
121
|
var node = state.selection.node;
|
|
121
122
|
if (analyticsApi) {
|
|
@@ -127,14 +128,15 @@ var removeSelectedNodeWithAnalytics = exports.removeSelectedNodeWithAnalytics =
|
|
|
127
128
|
attributes: {
|
|
128
129
|
extensionType: node.attrs.extensionType,
|
|
129
130
|
extensionKey: node.attrs.extensionKey,
|
|
130
|
-
localId: node.attrs.localId
|
|
131
|
+
localId: node.attrs.localId,
|
|
132
|
+
inputMethod: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
131
133
|
}
|
|
132
134
|
})(tr);
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
return (0, _utils2.removeSelectedNode)(tr);
|
|
136
138
|
};
|
|
137
|
-
var checkAndRemoveExtensionNode = exports.checkAndRemoveExtensionNode = function checkAndRemoveExtensionNode(state, tr, analyticsApi) {
|
|
139
|
+
var checkAndRemoveExtensionNode = exports.checkAndRemoveExtensionNode = function checkAndRemoveExtensionNode(state, tr, analyticsApi, inputMethod) {
|
|
138
140
|
var nodeType = state.schema.nodes.bodiedExtension;
|
|
139
141
|
var maybeMBENode = (0, _utils2.findParentNodeOfType)(state.schema.nodes.multiBodiedExtension)(state.selection);
|
|
140
142
|
if (maybeMBENode) {
|
|
@@ -148,7 +150,8 @@ var checkAndRemoveExtensionNode = exports.checkAndRemoveExtensionNode = function
|
|
|
148
150
|
extensionType: maybeMBENode.node.attrs.extensionType,
|
|
149
151
|
extensionKey: maybeMBENode.node.attrs.extensionKey,
|
|
150
152
|
localId: maybeMBENode.node.attrs.localId,
|
|
151
|
-
currentFramesCount: maybeMBENode.node.content.childCount
|
|
153
|
+
currentFramesCount: maybeMBENode.node.content.childCount,
|
|
154
|
+
inputMethod: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
152
155
|
}
|
|
153
156
|
})(tr);
|
|
154
157
|
}
|
|
@@ -164,7 +167,8 @@ var checkAndRemoveExtensionNode = exports.checkAndRemoveExtensionNode = function
|
|
|
164
167
|
attributes: {
|
|
165
168
|
extensionType: bodiedExtensionNode.node.attrs.extensionType,
|
|
166
169
|
extensionKey: bodiedExtensionNode.node.attrs.extensionKey,
|
|
167
|
-
localId: bodiedExtensionNode.node.attrs.localId
|
|
170
|
+
localId: bodiedExtensionNode.node.attrs.localId,
|
|
171
|
+
inputMethod: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
168
172
|
}
|
|
169
173
|
})(tr);
|
|
170
174
|
}
|
|
@@ -8,6 +8,7 @@ exports.getToolbarConfig = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
12
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
12
13
|
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
|
|
13
14
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
@@ -340,7 +341,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
340
341
|
},
|
|
341
342
|
iconFallback: _delete.default,
|
|
342
343
|
appearance: 'danger',
|
|
343
|
-
onClick: (0, _commands.removeExtension)(editorAnalyticsAPI),
|
|
344
|
+
onClick: (0, _commands.removeExtension)(editorAnalyticsAPI, _analytics.INPUT_METHOD.FLOATING_TB),
|
|
344
345
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
345
346
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
|
|
346
347
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
@@ -362,7 +363,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
362
363
|
onClick: function onClick() {
|
|
363
364
|
var _extensionApi$core, _extensionApi$floatin;
|
|
364
365
|
extensionApi === null || extensionApi === void 0 || (_extensionApi$core = extensionApi.core) === null || _extensionApi$core === void 0 || _extensionApi$core.actions.execute( // @ts-ignore
|
|
365
|
-
extensionApi === null || extensionApi === void 0 || (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType));
|
|
366
|
+
extensionApi === null || extensionApi === void 0 || (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType, _analytics.INPUT_METHOD.FLOATING_TB));
|
|
366
367
|
return true;
|
|
367
368
|
},
|
|
368
369
|
icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
|
|
@@ -370,7 +371,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
370
371
|
})
|
|
371
372
|
}, hoverDecorationProps(nodeType, _editorSharedStyles.akEditorSelectedNodeClassName)), _objectSpread({
|
|
372
373
|
title: formatMessage(_messages.default.delete),
|
|
373
|
-
onClick: (0, _commands.removeExtension)(editorAnalyticsAPI),
|
|
374
|
+
onClick: (0, _commands.removeExtension)(editorAnalyticsAPI, _analytics.INPUT_METHOD.FLOATING_TB),
|
|
374
375
|
icon: /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
375
376
|
label: ""
|
|
376
377
|
})
|
|
@@ -120,28 +120,48 @@ function showConfigPanel(_ref2) {
|
|
|
120
120
|
},
|
|
121
121
|
BodyComponent: BodyComponent,
|
|
122
122
|
closeOptions: {
|
|
123
|
-
canClosePanel: function
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
123
|
+
canClosePanel: function () {
|
|
124
|
+
var _canClosePanel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
125
|
+
var extensionState;
|
|
126
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
127
|
+
while (1) switch (_context.prev = _context.next) {
|
|
128
|
+
case 0:
|
|
129
|
+
if (!editorView.isDestroyed) {
|
|
130
|
+
_context.next = 2;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
return _context.abrupt("return", true);
|
|
134
|
+
case 2:
|
|
135
|
+
extensionState = (0, _pluginFactory.getPluginState)(editorView.state);
|
|
136
|
+
/**
|
|
137
|
+
* If context panel is open, then first update extension plugin state.
|
|
138
|
+
* Updating extension plugin state will trigger useEffect in useConfigPanelPluginHook,
|
|
139
|
+
* which will call hideConfigPanel.
|
|
140
|
+
*/
|
|
141
|
+
if (!(extensionState !== null && extensionState !== void 0 && extensionState.showContextPanel)) {
|
|
142
|
+
_context.next = 7;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
_context.next = 6;
|
|
146
|
+
return startClosingConfigPanel({
|
|
147
|
+
api: api,
|
|
148
|
+
editorView: editorView
|
|
149
|
+
});
|
|
150
|
+
case 6:
|
|
151
|
+
return _context.abrupt("return", false);
|
|
152
|
+
case 7:
|
|
153
|
+
return _context.abrupt("return", true);
|
|
154
|
+
case 8:
|
|
155
|
+
case "end":
|
|
156
|
+
return _context.stop();
|
|
157
|
+
}
|
|
158
|
+
}, _callee);
|
|
159
|
+
}));
|
|
160
|
+
function canClosePanel() {
|
|
161
|
+
return _canClosePanel.apply(this, arguments);
|
|
140
162
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return true;
|
|
144
|
-
}
|
|
163
|
+
return canClosePanel;
|
|
164
|
+
}()
|
|
145
165
|
}
|
|
146
166
|
}, 'push', _constants.CONFIG_PANEL_WIDTH);
|
|
147
167
|
}
|
|
@@ -150,34 +170,34 @@ function startClosingConfigPanel(_x) {
|
|
|
150
170
|
return _startClosingConfigPanel.apply(this, arguments);
|
|
151
171
|
}
|
|
152
172
|
function _startClosingConfigPanel() {
|
|
153
|
-
_startClosingConfigPanel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
173
|
+
_startClosingConfigPanel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref3) {
|
|
154
174
|
var _api$contextPanel3;
|
|
155
175
|
var api, editorView, applyChange;
|
|
156
|
-
return _regenerator.default.wrap(function
|
|
157
|
-
while (1) switch (
|
|
176
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
177
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
158
178
|
case 0:
|
|
159
179
|
api = _ref3.api, editorView = _ref3.editorView;
|
|
160
180
|
applyChange = api === null || api === void 0 || (_api$contextPanel3 = api.contextPanel) === null || _api$contextPanel3 === void 0 ? void 0 : _api$contextPanel3.actions.applyChange; // Even if the save failed, we should proceed with closing the panel
|
|
161
181
|
(0, _commands.clearEditingContext)(applyChange)(editorView.state, editorView.dispatch);
|
|
162
|
-
|
|
163
|
-
|
|
182
|
+
_context3.prev = 3;
|
|
183
|
+
_context3.next = 6;
|
|
164
184
|
return new Promise(function (resolve, reject) {
|
|
165
185
|
(0, _commands.forceAutoSave)(applyChange)(resolve, reject)(editorView.state, editorView.dispatch);
|
|
166
186
|
});
|
|
167
187
|
case 6:
|
|
168
|
-
|
|
188
|
+
_context3.next = 11;
|
|
169
189
|
break;
|
|
170
190
|
case 8:
|
|
171
|
-
|
|
172
|
-
|
|
191
|
+
_context3.prev = 8;
|
|
192
|
+
_context3.t0 = _context3["catch"](3);
|
|
173
193
|
// Even if the save failed, we should proceed with closing the panel
|
|
174
194
|
// eslint-disable-next-line no-console
|
|
175
|
-
console.error("Autosave failed with error",
|
|
195
|
+
console.error("Autosave failed with error", _context3.t0);
|
|
176
196
|
case 11:
|
|
177
197
|
case "end":
|
|
178
|
-
return
|
|
198
|
+
return _context3.stop();
|
|
179
199
|
}
|
|
180
|
-
},
|
|
200
|
+
}, _callee3, null, [[3, 8]]);
|
|
181
201
|
}));
|
|
182
202
|
return _startClosingConfigPanel.apply(this, arguments);
|
|
183
203
|
}
|
|
@@ -224,11 +244,11 @@ var getContextPanelBodyComponent = exports.getContextPanelBodyComponent = functi
|
|
|
224
244
|
autoSaveTrigger: autoSaveResolve,
|
|
225
245
|
autoSaveReject: autoSaveReject,
|
|
226
246
|
onChange: ( /*#__PURE__*/function () {
|
|
227
|
-
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
228
|
-
return _regenerator.default.wrap(function
|
|
229
|
-
while (1) switch (
|
|
247
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(updatedParameters) {
|
|
248
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
249
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
230
250
|
case 0:
|
|
231
|
-
|
|
251
|
+
_context2.next = 2;
|
|
232
252
|
return (0, _contextPanel.onChangeAction)(editorView, updatedParameters, parameters, nodeWithPos, onSaveStarted);
|
|
233
253
|
case 2:
|
|
234
254
|
onSaveEnded();
|
|
@@ -237,9 +257,9 @@ var getContextPanelBodyComponent = exports.getContextPanelBodyComponent = functi
|
|
|
237
257
|
}
|
|
238
258
|
case 4:
|
|
239
259
|
case "end":
|
|
240
|
-
return
|
|
260
|
+
return _context2.stop();
|
|
241
261
|
}
|
|
242
|
-
},
|
|
262
|
+
}, _callee2);
|
|
243
263
|
}));
|
|
244
264
|
return function (_x2) {
|
|
245
265
|
return _ref6.apply(this, arguments);
|
|
@@ -2,6 +2,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, TARGET_SELECTION
|
|
|
2
2
|
import { removeConnectedNodes } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { findParentNodeOfType, removeParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
6
7
|
import { getSelectedExtension } from '../pm-plugins/utils';
|
|
7
8
|
|
|
@@ -72,16 +73,16 @@ export const updateExtensionLayout = (layout, analyticsApi) => createCommand({
|
|
|
72
73
|
}
|
|
73
74
|
return tr;
|
|
74
75
|
});
|
|
75
|
-
export const removeExtension = editorAnalyticsAPI => createCommand({
|
|
76
|
+
export const removeExtension = (editorAnalyticsAPI, inputMethod) => createCommand({
|
|
76
77
|
type: 'UPDATE_STATE',
|
|
77
78
|
data: {
|
|
78
79
|
element: undefined
|
|
79
80
|
}
|
|
80
81
|
}, (tr, state) => {
|
|
81
82
|
if (getSelectedExtension(state)) {
|
|
82
|
-
return removeSelectedNodeWithAnalytics(state, tr, editorAnalyticsAPI);
|
|
83
|
+
return removeSelectedNodeWithAnalytics(state, tr, editorAnalyticsAPI, inputMethod);
|
|
83
84
|
} else {
|
|
84
|
-
return checkAndRemoveExtensionNode(state, tr, editorAnalyticsAPI);
|
|
85
|
+
return checkAndRemoveExtensionNode(state, tr, editorAnalyticsAPI, inputMethod);
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
export const removeDescendantNodes = sourceNode => createCommand({
|
|
@@ -92,7 +93,7 @@ export const removeDescendantNodes = sourceNode => createCommand({
|
|
|
92
93
|
}, (tr, state) => {
|
|
93
94
|
return sourceNode ? removeConnectedNodes(state, sourceNode) : tr;
|
|
94
95
|
});
|
|
95
|
-
export const removeSelectedNodeWithAnalytics = (state, tr, analyticsApi) => {
|
|
96
|
+
export const removeSelectedNodeWithAnalytics = (state, tr, analyticsApi, inputMethod) => {
|
|
96
97
|
if (state.selection instanceof NodeSelection) {
|
|
97
98
|
const node = state.selection.node;
|
|
98
99
|
if (analyticsApi) {
|
|
@@ -104,14 +105,15 @@ export const removeSelectedNodeWithAnalytics = (state, tr, analyticsApi) => {
|
|
|
104
105
|
attributes: {
|
|
105
106
|
extensionType: node.attrs.extensionType,
|
|
106
107
|
extensionKey: node.attrs.extensionKey,
|
|
107
|
-
localId: node.attrs.localId
|
|
108
|
+
localId: node.attrs.localId,
|
|
109
|
+
inputMethod: fg('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
108
110
|
}
|
|
109
111
|
})(tr);
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
return removeSelectedNode(tr);
|
|
113
115
|
};
|
|
114
|
-
export const checkAndRemoveExtensionNode = (state, tr, analyticsApi) => {
|
|
116
|
+
export const checkAndRemoveExtensionNode = (state, tr, analyticsApi, inputMethod) => {
|
|
115
117
|
let nodeType = state.schema.nodes.bodiedExtension;
|
|
116
118
|
const maybeMBENode = findParentNodeOfType(state.schema.nodes.multiBodiedExtension)(state.selection);
|
|
117
119
|
if (maybeMBENode) {
|
|
@@ -125,7 +127,8 @@ export const checkAndRemoveExtensionNode = (state, tr, analyticsApi) => {
|
|
|
125
127
|
extensionType: maybeMBENode.node.attrs.extensionType,
|
|
126
128
|
extensionKey: maybeMBENode.node.attrs.extensionKey,
|
|
127
129
|
localId: maybeMBENode.node.attrs.localId,
|
|
128
|
-
currentFramesCount: maybeMBENode.node.content.childCount
|
|
130
|
+
currentFramesCount: maybeMBENode.node.content.childCount,
|
|
131
|
+
inputMethod: fg('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
129
132
|
}
|
|
130
133
|
})(tr);
|
|
131
134
|
}
|
|
@@ -141,7 +144,8 @@ export const checkAndRemoveExtensionNode = (state, tr, analyticsApi) => {
|
|
|
141
144
|
attributes: {
|
|
142
145
|
extensionType: bodiedExtensionNode.node.attrs.extensionType,
|
|
143
146
|
extensionKey: bodiedExtensionNode.node.attrs.extensionKey,
|
|
144
|
-
localId: bodiedExtensionNode.node.attrs.localId
|
|
147
|
+
localId: bodiedExtensionNode.node.attrs.localId,
|
|
148
|
+
inputMethod: fg('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
145
149
|
}
|
|
146
150
|
})(tr);
|
|
147
151
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import { messages } from '@atlaskit/editor-common/extensions';
|
|
3
4
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
4
5
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
@@ -327,7 +328,7 @@ export const getToolbarConfig = ({
|
|
|
327
328
|
}),
|
|
328
329
|
iconFallback: DeleteIcon,
|
|
329
330
|
appearance: 'danger',
|
|
330
|
-
onClick: removeExtension(editorAnalyticsAPI),
|
|
331
|
+
onClick: removeExtension(editorAnalyticsAPI, INPUT_METHOD.FLOATING_TB),
|
|
331
332
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
332
333
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
|
|
333
334
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
@@ -349,7 +350,7 @@ export const getToolbarConfig = ({
|
|
|
349
350
|
onClick: () => {
|
|
350
351
|
var _extensionApi$core, _extensionApi$floatin;
|
|
351
352
|
extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$core = extensionApi.core) === null || _extensionApi$core === void 0 ? void 0 : _extensionApi$core.actions.execute( // @ts-ignore
|
|
352
|
-
extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType));
|
|
353
|
+
extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType, INPUT_METHOD.FLOATING_TB));
|
|
353
354
|
return true;
|
|
354
355
|
},
|
|
355
356
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
@@ -358,7 +359,7 @@ export const getToolbarConfig = ({
|
|
|
358
359
|
...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
|
|
359
360
|
}, {
|
|
360
361
|
title: formatMessage(commonMessages.delete),
|
|
361
|
-
onClick: removeExtension(editorAnalyticsAPI),
|
|
362
|
+
onClick: removeExtension(editorAnalyticsAPI, INPUT_METHOD.FLOATING_TB),
|
|
362
363
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
363
364
|
label: ""
|
|
364
365
|
}),
|
|
@@ -105,7 +105,7 @@ export function showConfigPanel({
|
|
|
105
105
|
},
|
|
106
106
|
BodyComponent,
|
|
107
107
|
closeOptions: {
|
|
108
|
-
canClosePanel: () => {
|
|
108
|
+
canClosePanel: async () => {
|
|
109
109
|
// When navigating away from the editor, the editorView is destroyed.
|
|
110
110
|
if (editorView.isDestroyed) {
|
|
111
111
|
return true;
|
|
@@ -117,7 +117,7 @@ export function showConfigPanel({
|
|
|
117
117
|
* which will call hideConfigPanel.
|
|
118
118
|
*/
|
|
119
119
|
if (extensionState !== null && extensionState !== void 0 && extensionState.showContextPanel) {
|
|
120
|
-
startClosingConfigPanel({
|
|
120
|
+
await startClosingConfigPanel({
|
|
121
121
|
api,
|
|
122
122
|
editorView
|
|
123
123
|
});
|
|
@@ -5,6 +5,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, TARGET_SELECTION
|
|
|
5
5
|
import { removeConnectedNodes } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { findParentNodeOfType, removeParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
9
10
|
import { getSelectedExtension } from '../pm-plugins/utils';
|
|
10
11
|
|
|
@@ -82,7 +83,7 @@ export var updateExtensionLayout = function updateExtensionLayout(layout, analyt
|
|
|
82
83
|
return tr;
|
|
83
84
|
});
|
|
84
85
|
};
|
|
85
|
-
export var removeExtension = function removeExtension(editorAnalyticsAPI) {
|
|
86
|
+
export var removeExtension = function removeExtension(editorAnalyticsAPI, inputMethod) {
|
|
86
87
|
return createCommand({
|
|
87
88
|
type: 'UPDATE_STATE',
|
|
88
89
|
data: {
|
|
@@ -90,9 +91,9 @@ export var removeExtension = function removeExtension(editorAnalyticsAPI) {
|
|
|
90
91
|
}
|
|
91
92
|
}, function (tr, state) {
|
|
92
93
|
if (getSelectedExtension(state)) {
|
|
93
|
-
return removeSelectedNodeWithAnalytics(state, tr, editorAnalyticsAPI);
|
|
94
|
+
return removeSelectedNodeWithAnalytics(state, tr, editorAnalyticsAPI, inputMethod);
|
|
94
95
|
} else {
|
|
95
|
-
return checkAndRemoveExtensionNode(state, tr, editorAnalyticsAPI);
|
|
96
|
+
return checkAndRemoveExtensionNode(state, tr, editorAnalyticsAPI, inputMethod);
|
|
96
97
|
}
|
|
97
98
|
});
|
|
98
99
|
};
|
|
@@ -106,7 +107,7 @@ export var removeDescendantNodes = function removeDescendantNodes(sourceNode) {
|
|
|
106
107
|
return sourceNode ? removeConnectedNodes(state, sourceNode) : tr;
|
|
107
108
|
});
|
|
108
109
|
};
|
|
109
|
-
export var removeSelectedNodeWithAnalytics = function removeSelectedNodeWithAnalytics(state, tr, analyticsApi) {
|
|
110
|
+
export var removeSelectedNodeWithAnalytics = function removeSelectedNodeWithAnalytics(state, tr, analyticsApi, inputMethod) {
|
|
110
111
|
if (state.selection instanceof NodeSelection) {
|
|
111
112
|
var node = state.selection.node;
|
|
112
113
|
if (analyticsApi) {
|
|
@@ -118,14 +119,15 @@ export var removeSelectedNodeWithAnalytics = function removeSelectedNodeWithAnal
|
|
|
118
119
|
attributes: {
|
|
119
120
|
extensionType: node.attrs.extensionType,
|
|
120
121
|
extensionKey: node.attrs.extensionKey,
|
|
121
|
-
localId: node.attrs.localId
|
|
122
|
+
localId: node.attrs.localId,
|
|
123
|
+
inputMethod: fg('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
122
124
|
}
|
|
123
125
|
})(tr);
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
return removeSelectedNode(tr);
|
|
127
129
|
};
|
|
128
|
-
export var checkAndRemoveExtensionNode = function checkAndRemoveExtensionNode(state, tr, analyticsApi) {
|
|
130
|
+
export var checkAndRemoveExtensionNode = function checkAndRemoveExtensionNode(state, tr, analyticsApi, inputMethod) {
|
|
129
131
|
var nodeType = state.schema.nodes.bodiedExtension;
|
|
130
132
|
var maybeMBENode = findParentNodeOfType(state.schema.nodes.multiBodiedExtension)(state.selection);
|
|
131
133
|
if (maybeMBENode) {
|
|
@@ -139,7 +141,8 @@ export var checkAndRemoveExtensionNode = function checkAndRemoveExtensionNode(st
|
|
|
139
141
|
extensionType: maybeMBENode.node.attrs.extensionType,
|
|
140
142
|
extensionKey: maybeMBENode.node.attrs.extensionKey,
|
|
141
143
|
localId: maybeMBENode.node.attrs.localId,
|
|
142
|
-
currentFramesCount: maybeMBENode.node.content.childCount
|
|
144
|
+
currentFramesCount: maybeMBENode.node.content.childCount,
|
|
145
|
+
inputMethod: fg('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
143
146
|
}
|
|
144
147
|
})(tr);
|
|
145
148
|
}
|
|
@@ -155,7 +158,8 @@ export var checkAndRemoveExtensionNode = function checkAndRemoveExtensionNode(st
|
|
|
155
158
|
attributes: {
|
|
156
159
|
extensionType: bodiedExtensionNode.node.attrs.extensionType,
|
|
157
160
|
extensionKey: bodiedExtensionNode.node.attrs.extensionKey,
|
|
158
|
-
localId: bodiedExtensionNode.node.attrs.localId
|
|
161
|
+
localId: bodiedExtensionNode.node.attrs.localId,
|
|
162
|
+
inputMethod: fg('platform_editor_controls_patch_analytics_2') ? inputMethod : undefined
|
|
159
163
|
}
|
|
160
164
|
})(tr);
|
|
161
165
|
}
|
|
@@ -3,6 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
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
5
|
import React from 'react';
|
|
6
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
7
|
import { messages } from '@atlaskit/editor-common/extensions';
|
|
7
8
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
8
9
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
@@ -334,7 +335,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
334
335
|
},
|
|
335
336
|
iconFallback: DeleteIcon,
|
|
336
337
|
appearance: 'danger',
|
|
337
|
-
onClick: removeExtension(editorAnalyticsAPI),
|
|
338
|
+
onClick: removeExtension(editorAnalyticsAPI, INPUT_METHOD.FLOATING_TB),
|
|
338
339
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
339
340
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
|
|
340
341
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
|
|
@@ -356,7 +357,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
356
357
|
onClick: function onClick() {
|
|
357
358
|
var _extensionApi$core, _extensionApi$floatin;
|
|
358
359
|
extensionApi === null || extensionApi === void 0 || (_extensionApi$core = extensionApi.core) === null || _extensionApi$core === void 0 || _extensionApi$core.actions.execute( // @ts-ignore
|
|
359
|
-
extensionApi === null || extensionApi === void 0 || (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType));
|
|
360
|
+
extensionApi === null || extensionApi === void 0 || (_extensionApi$floatin = extensionApi.floatingToolbar) === null || _extensionApi$floatin === void 0 ? void 0 : _extensionApi$floatin.commands.copyNode(nodeType, INPUT_METHOD.FLOATING_TB));
|
|
360
361
|
return true;
|
|
361
362
|
},
|
|
362
363
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
@@ -364,7 +365,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
364
365
|
})
|
|
365
366
|
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)), _objectSpread({
|
|
366
367
|
title: formatMessage(commonMessages.delete),
|
|
367
|
-
onClick: removeExtension(editorAnalyticsAPI),
|
|
368
|
+
onClick: removeExtension(editorAnalyticsAPI, INPUT_METHOD.FLOATING_TB),
|
|
368
369
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
369
370
|
label: ""
|
|
370
371
|
})
|
|
@@ -106,28 +106,48 @@ export function showConfigPanel(_ref2) {
|
|
|
106
106
|
},
|
|
107
107
|
BodyComponent: BodyComponent,
|
|
108
108
|
closeOptions: {
|
|
109
|
-
canClosePanel: function
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
109
|
+
canClosePanel: function () {
|
|
110
|
+
var _canClosePanel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
111
|
+
var extensionState;
|
|
112
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
113
|
+
while (1) switch (_context.prev = _context.next) {
|
|
114
|
+
case 0:
|
|
115
|
+
if (!editorView.isDestroyed) {
|
|
116
|
+
_context.next = 2;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
return _context.abrupt("return", true);
|
|
120
|
+
case 2:
|
|
121
|
+
extensionState = getPluginState(editorView.state);
|
|
122
|
+
/**
|
|
123
|
+
* If context panel is open, then first update extension plugin state.
|
|
124
|
+
* Updating extension plugin state will trigger useEffect in useConfigPanelPluginHook,
|
|
125
|
+
* which will call hideConfigPanel.
|
|
126
|
+
*/
|
|
127
|
+
if (!(extensionState !== null && extensionState !== void 0 && extensionState.showContextPanel)) {
|
|
128
|
+
_context.next = 7;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
_context.next = 6;
|
|
132
|
+
return startClosingConfigPanel({
|
|
133
|
+
api: api,
|
|
134
|
+
editorView: editorView
|
|
135
|
+
});
|
|
136
|
+
case 6:
|
|
137
|
+
return _context.abrupt("return", false);
|
|
138
|
+
case 7:
|
|
139
|
+
return _context.abrupt("return", true);
|
|
140
|
+
case 8:
|
|
141
|
+
case "end":
|
|
142
|
+
return _context.stop();
|
|
143
|
+
}
|
|
144
|
+
}, _callee);
|
|
145
|
+
}));
|
|
146
|
+
function canClosePanel() {
|
|
147
|
+
return _canClosePanel.apply(this, arguments);
|
|
126
148
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
149
|
+
return canClosePanel;
|
|
150
|
+
}()
|
|
131
151
|
}
|
|
132
152
|
}, 'push', CONFIG_PANEL_WIDTH);
|
|
133
153
|
}
|
|
@@ -136,34 +156,34 @@ export function startClosingConfigPanel(_x) {
|
|
|
136
156
|
return _startClosingConfigPanel.apply(this, arguments);
|
|
137
157
|
}
|
|
138
158
|
function _startClosingConfigPanel() {
|
|
139
|
-
_startClosingConfigPanel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
159
|
+
_startClosingConfigPanel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
140
160
|
var _api$contextPanel3;
|
|
141
161
|
var api, editorView, applyChange;
|
|
142
|
-
return _regeneratorRuntime.wrap(function
|
|
143
|
-
while (1) switch (
|
|
162
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
163
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
144
164
|
case 0:
|
|
145
165
|
api = _ref3.api, editorView = _ref3.editorView;
|
|
146
166
|
applyChange = api === null || api === void 0 || (_api$contextPanel3 = api.contextPanel) === null || _api$contextPanel3 === void 0 ? void 0 : _api$contextPanel3.actions.applyChange; // Even if the save failed, we should proceed with closing the panel
|
|
147
167
|
clearEditingContext(applyChange)(editorView.state, editorView.dispatch);
|
|
148
|
-
|
|
149
|
-
|
|
168
|
+
_context3.prev = 3;
|
|
169
|
+
_context3.next = 6;
|
|
150
170
|
return new Promise(function (resolve, reject) {
|
|
151
171
|
forceAutoSave(applyChange)(resolve, reject)(editorView.state, editorView.dispatch);
|
|
152
172
|
});
|
|
153
173
|
case 6:
|
|
154
|
-
|
|
174
|
+
_context3.next = 11;
|
|
155
175
|
break;
|
|
156
176
|
case 8:
|
|
157
|
-
|
|
158
|
-
|
|
177
|
+
_context3.prev = 8;
|
|
178
|
+
_context3.t0 = _context3["catch"](3);
|
|
159
179
|
// Even if the save failed, we should proceed with closing the panel
|
|
160
180
|
// eslint-disable-next-line no-console
|
|
161
|
-
console.error("Autosave failed with error",
|
|
181
|
+
console.error("Autosave failed with error", _context3.t0);
|
|
162
182
|
case 11:
|
|
163
183
|
case "end":
|
|
164
|
-
return
|
|
184
|
+
return _context3.stop();
|
|
165
185
|
}
|
|
166
|
-
},
|
|
186
|
+
}, _callee3, null, [[3, 8]]);
|
|
167
187
|
}));
|
|
168
188
|
return _startClosingConfigPanel.apply(this, arguments);
|
|
169
189
|
}
|
|
@@ -210,11 +230,11 @@ export var getContextPanelBodyComponent = function getContextPanelBodyComponent(
|
|
|
210
230
|
autoSaveTrigger: autoSaveResolve,
|
|
211
231
|
autoSaveReject: autoSaveReject,
|
|
212
232
|
onChange: ( /*#__PURE__*/function () {
|
|
213
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
214
|
-
return _regeneratorRuntime.wrap(function
|
|
215
|
-
while (1) switch (
|
|
233
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(updatedParameters) {
|
|
234
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
235
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
216
236
|
case 0:
|
|
217
|
-
|
|
237
|
+
_context2.next = 2;
|
|
218
238
|
return onChangeAction(editorView, updatedParameters, parameters, nodeWithPos, onSaveStarted);
|
|
219
239
|
case 2:
|
|
220
240
|
onSaveEnded();
|
|
@@ -223,9 +243,9 @@ export var getContextPanelBodyComponent = function getContextPanelBodyComponent(
|
|
|
223
243
|
}
|
|
224
244
|
case 4:
|
|
225
245
|
case "end":
|
|
226
|
-
return
|
|
246
|
+
return _context2.stop();
|
|
227
247
|
}
|
|
228
|
-
},
|
|
248
|
+
}, _callee2);
|
|
229
249
|
}));
|
|
230
250
|
return function (_x2) {
|
|
231
251
|
return _ref6.apply(this, arguments);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionLayout } from '@atlaskit/adf-schema';
|
|
2
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { Parameters, TransformAfter, TransformBefore } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -10,7 +10,7 @@ export declare function setEditingContextToContextPanel<T extends Parameters = P
|
|
|
10
10
|
export declare const clearEditingContext: (applyChangeToContextPanel: ApplyChangeHandler | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
11
11
|
export declare const forceAutoSave: (applyChangeToContextPanel: ApplyChangeHandler | undefined) => (resolve: () => void, reject?: RejectSave) => import("@atlaskit/editor-common/types").Command;
|
|
12
12
|
export declare const updateExtensionLayout: (layout: ExtensionLayout, analyticsApi?: EditorAnalyticsAPI) => import("@atlaskit/editor-common/types").Command;
|
|
13
|
-
export declare const removeExtension: (editorAnalyticsAPI?: EditorAnalyticsAPI) => import("@atlaskit/editor-common/types").Command;
|
|
13
|
+
export declare const removeExtension: (editorAnalyticsAPI?: EditorAnalyticsAPI, inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB) => import("@atlaskit/editor-common/types").Command;
|
|
14
14
|
export declare const removeDescendantNodes: (sourceNode?: PMNode) => import("@atlaskit/editor-common/types").Command;
|
|
15
|
-
export declare const removeSelectedNodeWithAnalytics: (state: EditorState, tr: Transaction, analyticsApi?: EditorAnalyticsAPI) => Transaction;
|
|
16
|
-
export declare const checkAndRemoveExtensionNode: (state: EditorState, tr: Transaction, analyticsApi?: EditorAnalyticsAPI) => Transaction;
|
|
15
|
+
export declare const removeSelectedNodeWithAnalytics: (state: EditorState, tr: Transaction, analyticsApi?: EditorAnalyticsAPI, inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB) => Transaction;
|
|
16
|
+
export declare const checkAndRemoveExtensionNode: (state: EditorState, tr: Transaction, analyticsApi?: EditorAnalyticsAPI, inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB) => Transaction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionLayout } from '@atlaskit/adf-schema';
|
|
2
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { Parameters, TransformAfter, TransformBefore } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -10,7 +10,7 @@ export declare function setEditingContextToContextPanel<T extends Parameters = P
|
|
|
10
10
|
export declare const clearEditingContext: (applyChangeToContextPanel: ApplyChangeHandler | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
11
11
|
export declare const forceAutoSave: (applyChangeToContextPanel: ApplyChangeHandler | undefined) => (resolve: () => void, reject?: RejectSave) => import("@atlaskit/editor-common/types").Command;
|
|
12
12
|
export declare const updateExtensionLayout: (layout: ExtensionLayout, analyticsApi?: EditorAnalyticsAPI) => import("@atlaskit/editor-common/types").Command;
|
|
13
|
-
export declare const removeExtension: (editorAnalyticsAPI?: EditorAnalyticsAPI) => import("@atlaskit/editor-common/types").Command;
|
|
13
|
+
export declare const removeExtension: (editorAnalyticsAPI?: EditorAnalyticsAPI, inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB) => import("@atlaskit/editor-common/types").Command;
|
|
14
14
|
export declare const removeDescendantNodes: (sourceNode?: PMNode) => import("@atlaskit/editor-common/types").Command;
|
|
15
|
-
export declare const removeSelectedNodeWithAnalytics: (state: EditorState, tr: Transaction, analyticsApi?: EditorAnalyticsAPI) => Transaction;
|
|
16
|
-
export declare const checkAndRemoveExtensionNode: (state: EditorState, tr: Transaction, analyticsApi?: EditorAnalyticsAPI) => Transaction;
|
|
15
|
+
export declare const removeSelectedNodeWithAnalytics: (state: EditorState, tr: Transaction, analyticsApi?: EditorAnalyticsAPI, inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB) => Transaction;
|
|
16
|
+
export declare const checkAndRemoveExtensionNode: (state: EditorState, tr: Transaction, analyticsApi?: EditorAnalyticsAPI, inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB) => Transaction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.6",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"@atlaskit/button": "^23.0.0",
|
|
33
33
|
"@atlaskit/checkbox": "^17.1.0",
|
|
34
34
|
"@atlaskit/datetime-picker": "^17.0.0",
|
|
35
|
-
"@atlaskit/editor-common": "^
|
|
35
|
+
"@atlaskit/editor-common": "^104.1.0",
|
|
36
36
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-context-identifier": "^2.1.0",
|
|
40
|
-
"@atlaskit/editor-plugin-context-panel": "^4.
|
|
40
|
+
"@atlaskit/editor-plugin-context-panel": "^4.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
43
43
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/empty-state": "^10.0.0",
|
|
48
48
|
"@atlaskit/form": "^12.0.0",
|
|
49
49
|
"@atlaskit/heading": "^5.2.0",
|
|
50
|
-
"@atlaskit/icon": "^
|
|
50
|
+
"@atlaskit/icon": "^26.0.0",
|
|
51
51
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
52
52
|
"@atlaskit/primitives": "^14.7.0",
|
|
53
53
|
"@atlaskit/radio": "^8.1.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/textarea": "^8.0.0",
|
|
60
60
|
"@atlaskit/textfield": "^8.0.0",
|
|
61
61
|
"@atlaskit/theme": "^18.0.0",
|
|
62
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
62
|
+
"@atlaskit/tmp-editor-statsig": "^4.19.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.0.0",
|
|
64
64
|
"@atlaskit/tokens": "^4.8.0",
|
|
65
65
|
"@atlaskit/tooltip": "^20.0.0",
|
|
@@ -113,9 +113,6 @@
|
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
"platform-feature-flags": {
|
|
116
|
-
"platform_editor_legacy_content_macro": {
|
|
117
|
-
"type": "boolean"
|
|
118
|
-
},
|
|
119
116
|
"platform_editor_ai_object_sidebar_injection": {
|
|
120
117
|
"type": "boolean"
|
|
121
118
|
},
|
|
@@ -127,6 +124,9 @@
|
|
|
127
124
|
},
|
|
128
125
|
"platform_editor_controls_patch_2": {
|
|
129
126
|
"type": "boolean"
|
|
127
|
+
},
|
|
128
|
+
"platform_editor_controls_patch_analytics_2": {
|
|
129
|
+
"type": "boolean"
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
"stricter": {
|