@atlaskit/editor-plugin-extension 5.0.1 → 5.0.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 +15 -0
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/pm-plugins/toolbar.js +1 -1
- package/dist/cjs/pm-plugins/unique-id.js +0 -1
- package/dist/cjs/ui/context-panel.js +1 -1
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/toolbar.js +1 -1
- package/dist/es2019/pm-plugins/unique-id.js +0 -1
- package/dist/es2019/ui/context-panel.js +0 -1
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/toolbar.js +1 -1
- package/dist/esm/pm-plugins/unique-id.js +0 -1
- package/dist/esm/ui/context-panel.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-extension
|
|
2
2
|
|
|
3
|
+
## 5.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 5.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#123345](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/123345)
|
|
14
|
+
[`31b02e82858e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31b02e82858e5) -
|
|
15
|
+
NO-ISSUE: Update usages of selection utils
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 5.0.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -227,7 +227,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
|
|
|
227
227
|
var maybeBodiedExtension = selection instanceof _state.TextSelection ? (0, _utils.findParentNodeOfTypeClosestToPos)($head, bodiedExtension) : (0, _utils.findSelectedNodeOfType)(bodiedExtension)(selection);
|
|
228
228
|
if (maybeBodiedExtension) {
|
|
229
229
|
var end = maybeBodiedExtension.pos + maybeBodiedExtension.node.nodeSize;
|
|
230
|
-
if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && (0, _selection2.isSelectionAtStartOfNode)($head, maybeBodiedExtension)) {
|
|
230
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && (0, _selection2.isSelectionAtStartOfNode)($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
|
|
231
231
|
var anchor = end + 1;
|
|
232
232
|
|
|
233
233
|
// an offset is used here so that left arrow selects the first character before the node (consistent with arrow right)
|
|
@@ -237,7 +237,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
|
|
|
237
237
|
view.dispatch(tr.setSelection(newSelection));
|
|
238
238
|
return true;
|
|
239
239
|
}
|
|
240
|
-
if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && (0, _selection2.isSelectionAtEndOfNode)($head, maybeBodiedExtension)) {
|
|
240
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && (0, _selection2.isSelectionAtEndOfNode)($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
|
|
241
241
|
var _anchor = maybeBodiedExtension.pos - 1;
|
|
242
242
|
var _head = end + 1;
|
|
243
243
|
var _newSelection = _state.TextSelection.create(doc, Math.min(_anchor, selection.anchor), _head);
|
|
@@ -135,7 +135,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
135
135
|
var extensionState = (0, _pluginFactory.getPluginState)(state);
|
|
136
136
|
if ((0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro')) {
|
|
137
137
|
var _extensionApi$decorat, _extensionApi$context, _extensionApi$analyti;
|
|
138
|
-
// TODO: Change these all to const upon removal of the above FG. Remove the function params also.
|
|
138
|
+
// TODO: ED-26962 - Change these all to const upon removal of the above FG. Remove the function params also.
|
|
139
139
|
hoverDecoration = extensionApi === null || extensionApi === void 0 || (_extensionApi$decorat = extensionApi.decorations) === null || _extensionApi$decorat === void 0 ? void 0 : _extensionApi$decorat.actions.hoverDecoration;
|
|
140
140
|
applyChangeToContextPanel = extensionApi === null || extensionApi === void 0 || (_extensionApi$context = extensionApi.contextPanel) === null || _extensionApi$context === void 0 ? void 0 : _extensionApi$context.actions.applyChange;
|
|
141
141
|
editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 || (_extensionApi$analyti = extensionApi.analytics) === null || _extensionApi$analyti === void 0 ? void 0 : _extensionApi$analyti.actions;
|
|
@@ -15,7 +15,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
15
15
|
var pluginKey = new _state.PluginKey('extensionUniqueIdPlugin');
|
|
16
16
|
var createPlugin = exports.createPlugin = function createPlugin() {
|
|
17
17
|
return new _safePlugin.SafePlugin({
|
|
18
|
-
// TODO: @see ED-8839
|
|
19
18
|
appendTransaction: function appendTransaction(transactions, _oldState, newState) {
|
|
20
19
|
var tr = newState.tr;
|
|
21
20
|
var selectionBookmark = tr.selection.getBookmark();
|
|
@@ -194,7 +194,7 @@ function _onChangeAction() {
|
|
|
194
194
|
}
|
|
195
195
|
return _context3.abrupt("return");
|
|
196
196
|
case 7:
|
|
197
|
-
unwrappedOldParameters = processParametersBefore ? processParametersBefore(oldParameters) : oldParameters;
|
|
197
|
+
unwrappedOldParameters = processParametersBefore ? processParametersBefore(oldParameters) : oldParameters;
|
|
198
198
|
if (!areParametersEqual(unwrappedOldParameters, updatedParameters)) {
|
|
199
199
|
_context3.next = 10;
|
|
200
200
|
break;
|
|
@@ -176,7 +176,7 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, porta
|
|
|
176
176
|
const maybeBodiedExtension = selection instanceof TextSelection ? findParentNodeOfTypeClosestToPos($head, bodiedExtension) : findSelectedNodeOfType(bodiedExtension)(selection);
|
|
177
177
|
if (maybeBodiedExtension) {
|
|
178
178
|
const end = maybeBodiedExtension.pos + maybeBodiedExtension.node.nodeSize;
|
|
179
|
-
if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && isSelectionAtStartOfNode($head, maybeBodiedExtension)) {
|
|
179
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && isSelectionAtStartOfNode($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
|
|
180
180
|
const anchor = end + 1;
|
|
181
181
|
|
|
182
182
|
// an offset is used here so that left arrow selects the first character before the node (consistent with arrow right)
|
|
@@ -186,7 +186,7 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, porta
|
|
|
186
186
|
view.dispatch(tr.setSelection(newSelection));
|
|
187
187
|
return true;
|
|
188
188
|
}
|
|
189
|
-
if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && isSelectionAtEndOfNode($head, maybeBodiedExtension)) {
|
|
189
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && isSelectionAtEndOfNode($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
|
|
190
190
|
const anchor = maybeBodiedExtension.pos - 1;
|
|
191
191
|
const head = end + 1;
|
|
192
192
|
const newSelection = TextSelection.create(doc, Math.min(anchor, selection.anchor), head);
|
|
@@ -141,7 +141,7 @@ export const getToolbarConfig = ({
|
|
|
141
141
|
const extensionState = getPluginState(state);
|
|
142
142
|
if (fg('platform_editor_legacy_content_macro')) {
|
|
143
143
|
var _extensionApi$decorat, _extensionApi$context, _extensionApi$analyti;
|
|
144
|
-
// TODO: Change these all to const upon removal of the above FG. Remove the function params also.
|
|
144
|
+
// TODO: ED-26962 - Change these all to const upon removal of the above FG. Remove the function params also.
|
|
145
145
|
hoverDecoration = extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$decorat = extensionApi.decorations) === null || _extensionApi$decorat === void 0 ? void 0 : _extensionApi$decorat.actions.hoverDecoration;
|
|
146
146
|
applyChangeToContextPanel = extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$context = extensionApi.contextPanel) === null || _extensionApi$context === void 0 ? void 0 : _extensionApi$context.actions.applyChange;
|
|
147
147
|
editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$analyti = extensionApi.analytics) === null || _extensionApi$analyti === void 0 ? void 0 : _extensionApi$analyti.actions;
|
|
@@ -4,7 +4,6 @@ import { stepAddsOneOf } from '@atlaskit/editor-common/utils';
|
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
const pluginKey = new PluginKey('extensionUniqueIdPlugin');
|
|
6
6
|
const createPlugin = () => new SafePlugin({
|
|
7
|
-
// TODO: @see ED-8839
|
|
8
7
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
9
8
|
const tr = newState.tr;
|
|
10
9
|
const selectionBookmark = tr.selection.getBookmark();
|
|
@@ -114,7 +114,6 @@ export async function onChangeAction(editorView, updatedParameters = {}, oldPara
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
const unwrappedOldParameters = processParametersBefore ? processParametersBefore(oldParameters) : oldParameters;
|
|
117
|
-
// todo: update to only check parameters which are in the manifest's field definitions
|
|
118
117
|
if (areParametersEqual(unwrappedOldParameters, updatedParameters)) {
|
|
119
118
|
return;
|
|
120
119
|
}
|
|
@@ -220,7 +220,7 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
|
|
|
220
220
|
var maybeBodiedExtension = selection instanceof TextSelection ? findParentNodeOfTypeClosestToPos($head, bodiedExtension) : findSelectedNodeOfType(bodiedExtension)(selection);
|
|
221
221
|
if (maybeBodiedExtension) {
|
|
222
222
|
var end = maybeBodiedExtension.pos + maybeBodiedExtension.node.nodeSize;
|
|
223
|
-
if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && isSelectionAtStartOfNode($head, maybeBodiedExtension)) {
|
|
223
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && isSelectionAtStartOfNode($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
|
|
224
224
|
var anchor = end + 1;
|
|
225
225
|
|
|
226
226
|
// an offset is used here so that left arrow selects the first character before the node (consistent with arrow right)
|
|
@@ -230,7 +230,7 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
|
|
|
230
230
|
view.dispatch(tr.setSelection(newSelection));
|
|
231
231
|
return true;
|
|
232
232
|
}
|
|
233
|
-
if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && isSelectionAtEndOfNode($head, maybeBodiedExtension)) {
|
|
233
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && isSelectionAtEndOfNode($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
|
|
234
234
|
var _anchor = maybeBodiedExtension.pos - 1;
|
|
235
235
|
var _head = end + 1;
|
|
236
236
|
var _newSelection = TextSelection.create(doc, Math.min(_anchor, selection.anchor), _head);
|
|
@@ -128,7 +128,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
128
128
|
var extensionState = getPluginState(state);
|
|
129
129
|
if (fg('platform_editor_legacy_content_macro')) {
|
|
130
130
|
var _extensionApi$decorat, _extensionApi$context, _extensionApi$analyti;
|
|
131
|
-
// TODO: Change these all to const upon removal of the above FG. Remove the function params also.
|
|
131
|
+
// TODO: ED-26962 - Change these all to const upon removal of the above FG. Remove the function params also.
|
|
132
132
|
hoverDecoration = extensionApi === null || extensionApi === void 0 || (_extensionApi$decorat = extensionApi.decorations) === null || _extensionApi$decorat === void 0 ? void 0 : _extensionApi$decorat.actions.hoverDecoration;
|
|
133
133
|
applyChangeToContextPanel = extensionApi === null || extensionApi === void 0 || (_extensionApi$context = extensionApi.contextPanel) === null || _extensionApi$context === void 0 ? void 0 : _extensionApi$context.actions.applyChange;
|
|
134
134
|
editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 || (_extensionApi$analyti = extensionApi.analytics) === null || _extensionApi$analyti === void 0 ? void 0 : _extensionApi$analyti.actions;
|
|
@@ -8,7 +8,6 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
8
8
|
var pluginKey = new PluginKey('extensionUniqueIdPlugin');
|
|
9
9
|
var createPlugin = function createPlugin() {
|
|
10
10
|
return new SafePlugin({
|
|
11
|
-
// TODO: @see ED-8839
|
|
12
11
|
appendTransaction: function appendTransaction(transactions, _oldState, newState) {
|
|
13
12
|
var tr = newState.tr;
|
|
14
13
|
var selectionBookmark = tr.selection.getBookmark();
|
|
@@ -187,7 +187,7 @@ function _onChangeAction() {
|
|
|
187
187
|
}
|
|
188
188
|
return _context3.abrupt("return");
|
|
189
189
|
case 7:
|
|
190
|
-
unwrappedOldParameters = processParametersBefore ? processParametersBefore(oldParameters) : oldParameters;
|
|
190
|
+
unwrappedOldParameters = processParametersBefore ? processParametersBefore(oldParameters) : oldParameters;
|
|
191
191
|
if (!areParametersEqual(unwrappedOldParameters, updatedParameters)) {
|
|
192
192
|
_context3.next = 10;
|
|
193
193
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
29
29
|
"@atlaskit/adf-utils": "^19.19.0",
|
|
30
30
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
31
|
-
"@atlaskit/avatar": "^
|
|
31
|
+
"@atlaskit/avatar": "^25.0.0",
|
|
32
32
|
"@atlaskit/button": "^21.1.0",
|
|
33
33
|
"@atlaskit/checkbox": "^17.0.0",
|
|
34
34
|
"@atlaskit/datetime-picker": "^16.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^
|
|
35
|
+
"@atlaskit/editor-common": "^102.3.0",
|
|
36
36
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-context-identifier": "^2.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
46
46
|
"@atlaskit/empty-state": "^9.0.0",
|
|
47
47
|
"@atlaskit/form": "^12.0.0",
|
|
48
|
-
"@atlaskit/heading": "5.1.0",
|
|
48
|
+
"@atlaskit/heading": "^5.1.0",
|
|
49
49
|
"@atlaskit/icon": "^24.1.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
51
|
"@atlaskit/primitives": "^14.1.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"@atlaskit/textarea": "^8.0.0",
|
|
59
59
|
"@atlaskit/textfield": "^8.0.0",
|
|
60
60
|
"@atlaskit/theme": "^18.0.0",
|
|
61
|
-
"@atlaskit/tmp-editor-statsig": "^3.
|
|
61
|
+
"@atlaskit/tmp-editor-statsig": "^3.5.0",
|
|
62
62
|
"@atlaskit/toggle": "^15.0.0",
|
|
63
|
-
"@atlaskit/tokens": "^4.
|
|
63
|
+
"@atlaskit/tokens": "^4.4.0",
|
|
64
64
|
"@atlaskit/tooltip": "^20.0.0",
|
|
65
65
|
"@babel/runtime": "^7.0.0",
|
|
66
66
|
"@emotion/react": "^11.7.1",
|