@atlaskit/editor-plugin-toolbar 4.0.4 → 4.0.5
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 +10 -0
- package/dist/cjs/toolbarPlugin.js +7 -9
- package/dist/cjs/ui/SelectionToolbar/index.js +1 -1
- package/dist/cjs/ui/toolbar-components.js +1 -1
- package/dist/es2019/toolbarPlugin.js +7 -9
- package/dist/es2019/ui/SelectionToolbar/index.js +1 -1
- package/dist/es2019/ui/toolbar-components.js +1 -1
- package/dist/esm/toolbarPlugin.js +7 -9
- package/dist/esm/ui/SelectionToolbar/index.js +1 -1
- package/dist/esm/ui/toolbar-components.js +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 4.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0caee373bff2d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0caee373bff2d) -
|
|
8
|
+
Exported additional types to fix typescript portable annotation errors
|
|
9
|
+
- [`20d29306fb10e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/20d29306fb10e) -
|
|
10
|
+
[ED-29451] clean up platform_editor_toolbar_aifc_patch_5
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 4.0.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -128,15 +128,13 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
128
128
|
apply: function apply(tr, pluginState, _, newState) {
|
|
129
129
|
var meta = tr.getMeta(_pluginKey.editorToolbarPluginKey);
|
|
130
130
|
var newPluginState = _objectSpread({}, pluginState);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
newPluginState.selectedNode = newSelectedNode;
|
|
139
|
-
}
|
|
131
|
+
var shouldUpdateNode = tr.docChanged || tr.selectionSet;
|
|
132
|
+
if (shouldUpdateNode) {
|
|
133
|
+
var newSelectedNode = getSelectedNode(newState);
|
|
134
|
+
var oldNode = pluginState.selectedNode;
|
|
135
|
+
var hasNodeChanged = !oldNode || !newSelectedNode || oldNode.nodeType !== newSelectedNode.nodeType || oldNode.pos !== newSelectedNode.pos || JSON.stringify(oldNode.marks) !== JSON.stringify(newSelectedNode.marks);
|
|
136
|
+
if (hasNodeChanged) {
|
|
137
|
+
newPluginState.selectedNode = newSelectedNode;
|
|
140
138
|
}
|
|
141
139
|
}
|
|
142
140
|
if (meta) {
|
|
@@ -145,7 +145,7 @@ var SelectionToolbar = exports.SelectionToolbar = function SelectionToolbar(_ref
|
|
|
145
145
|
var _api$analytics;
|
|
146
146
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent(payload);
|
|
147
147
|
},
|
|
148
|
-
keyboardNavigation:
|
|
148
|
+
keyboardNavigation: keyboardNavigation
|
|
149
149
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbarModel.ToolbarModelRenderer, {
|
|
150
150
|
toolbar: toolbar,
|
|
151
151
|
components: components,
|
|
@@ -28,7 +28,7 @@ var getInlineTextToolbarComponents = function getInlineTextToolbarComponents() {
|
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.Toolbar, {
|
|
29
29
|
label: _consts.SELECTION_TOOLBAR_LABEL,
|
|
30
30
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.SELECTION_TOOLBAR,
|
|
31
|
-
testId:
|
|
31
|
+
testId: 'editor-floating-toolbar'
|
|
32
32
|
}, children);
|
|
33
33
|
}
|
|
34
34
|
}];
|
|
@@ -115,15 +115,13 @@ export const toolbarPlugin = ({
|
|
|
115
115
|
let newPluginState = {
|
|
116
116
|
...pluginState
|
|
117
117
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
newPluginState.selectedNode = newSelectedNode;
|
|
126
|
-
}
|
|
118
|
+
const shouldUpdateNode = tr.docChanged || tr.selectionSet;
|
|
119
|
+
if (shouldUpdateNode) {
|
|
120
|
+
const newSelectedNode = getSelectedNode(newState);
|
|
121
|
+
const oldNode = pluginState.selectedNode;
|
|
122
|
+
const hasNodeChanged = !oldNode || !newSelectedNode || oldNode.nodeType !== newSelectedNode.nodeType || oldNode.pos !== newSelectedNode.pos || JSON.stringify(oldNode.marks) !== JSON.stringify(newSelectedNode.marks);
|
|
123
|
+
if (hasNodeChanged) {
|
|
124
|
+
newPluginState.selectedNode = newSelectedNode;
|
|
127
125
|
}
|
|
128
126
|
}
|
|
129
127
|
if (meta) {
|
|
@@ -138,7 +138,7 @@ export const SelectionToolbar = ({
|
|
|
138
138
|
var _api$analytics;
|
|
139
139
|
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent(payload);
|
|
140
140
|
},
|
|
141
|
-
keyboardNavigation:
|
|
141
|
+
keyboardNavigation: keyboardNavigation
|
|
142
142
|
}, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
|
|
143
143
|
toolbar: toolbar,
|
|
144
144
|
components: components,
|
|
@@ -21,7 +21,7 @@ const getInlineTextToolbarComponents = () => {
|
|
|
21
21
|
return /*#__PURE__*/React.createElement(Toolbar, {
|
|
22
22
|
label: SELECTION_TOOLBAR_LABEL,
|
|
23
23
|
actionSubjectId: ACTION_SUBJECT_ID.SELECTION_TOOLBAR,
|
|
24
|
-
testId:
|
|
24
|
+
testId: 'editor-floating-toolbar'
|
|
25
25
|
}, children);
|
|
26
26
|
}
|
|
27
27
|
}];
|
|
@@ -121,15 +121,13 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
121
121
|
apply: function apply(tr, pluginState, _, newState) {
|
|
122
122
|
var meta = tr.getMeta(editorToolbarPluginKey);
|
|
123
123
|
var newPluginState = _objectSpread({}, pluginState);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
newPluginState.selectedNode = newSelectedNode;
|
|
132
|
-
}
|
|
124
|
+
var shouldUpdateNode = tr.docChanged || tr.selectionSet;
|
|
125
|
+
if (shouldUpdateNode) {
|
|
126
|
+
var newSelectedNode = getSelectedNode(newState);
|
|
127
|
+
var oldNode = pluginState.selectedNode;
|
|
128
|
+
var hasNodeChanged = !oldNode || !newSelectedNode || oldNode.nodeType !== newSelectedNode.nodeType || oldNode.pos !== newSelectedNode.pos || JSON.stringify(oldNode.marks) !== JSON.stringify(newSelectedNode.marks);
|
|
129
|
+
if (hasNodeChanged) {
|
|
130
|
+
newPluginState.selectedNode = newSelectedNode;
|
|
133
131
|
}
|
|
134
132
|
}
|
|
135
133
|
if (meta) {
|
|
@@ -137,7 +137,7 @@ export var SelectionToolbar = function SelectionToolbar(_ref) {
|
|
|
137
137
|
var _api$analytics;
|
|
138
138
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent(payload);
|
|
139
139
|
},
|
|
140
|
-
keyboardNavigation:
|
|
140
|
+
keyboardNavigation: keyboardNavigation
|
|
141
141
|
}, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
|
|
142
142
|
toolbar: toolbar,
|
|
143
143
|
components: components,
|
|
@@ -21,7 +21,7 @@ var getInlineTextToolbarComponents = function getInlineTextToolbarComponents() {
|
|
|
21
21
|
return /*#__PURE__*/React.createElement(Toolbar, {
|
|
22
22
|
label: SELECTION_TOOLBAR_LABEL,
|
|
23
23
|
actionSubjectId: ACTION_SUBJECT_ID.SELECTION_TOOLBAR,
|
|
24
|
-
testId:
|
|
24
|
+
testId: 'editor-floating-toolbar'
|
|
25
25
|
}, children);
|
|
26
26
|
}
|
|
27
27
|
}];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { toolbarPlugin } from './toolbarPlugin';
|
|
2
|
-
export type { ToolbarPlugin } from './toolbarPluginType';
|
|
3
|
-
export type { ToolbarPluginOptions } from './types';
|
|
2
|
+
export type { ToolbarPlugin, EditorToolbarPluginState } from './toolbarPluginType';
|
|
3
|
+
export type { ToolbarPluginOptions, RegisterComponentsAction } from './types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { toolbarPlugin } from './toolbarPlugin';
|
|
2
|
-
export type { ToolbarPlugin } from './toolbarPluginType';
|
|
3
|
-
export type { ToolbarPluginOptions } from './types';
|
|
2
|
+
export type { ToolbarPlugin, EditorToolbarPluginState } from './toolbarPluginType';
|
|
3
|
+
export type { ToolbarPluginOptions, RegisterComponentsAction } from './types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
43
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
43
|
+
"@atlaskit/tmp-editor-statsig": "^16.19.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"bind-event-listener": "^3.0.0",
|
|
46
46
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^111.
|
|
49
|
+
"@atlaskit/editor-common": "^111.8.0",
|
|
50
50
|
"react": "^18.2.0"
|
|
51
51
|
},
|
|
52
52
|
"platform-feature-flags": {
|