@atlaskit/editor-plugin-floating-toolbar 1.4.8 → 1.5.0
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 +13 -0
- package/dist/cjs/plugin.js +6 -5
- package/dist/es2019/plugin.js +6 -5
- package/dist/esm/plugin.js +6 -5
- package/dist/types/types.d.ts +3 -1
- package/dist/types-ts4.5/types.d.ts +3 -1
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#108458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108458)
|
|
8
|
+
[`66522b500303c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/66522b500303c) -
|
|
9
|
+
[ED-23469] Add featureFlag plugin as optional plugin dependency and switch to read
|
|
10
|
+
platform_editor_element_drag_and_drop gate value
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 1.4.8
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -18,7 +18,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
18
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
19
19
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
20
20
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
21
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
21
|
var _forceFocus = _interopRequireWildcard(require("./pm-plugins/force-focus"));
|
|
23
22
|
var _commands = require("./pm-plugins/toolbar-data/commands");
|
|
24
23
|
var _plugin = require("./pm-plugins/toolbar-data/plugin");
|
|
@@ -189,7 +188,7 @@ var floatingToolbarPlugin = exports.floatingToolbarPlugin = function floatingToo
|
|
|
189
188
|
};
|
|
190
189
|
};
|
|
191
190
|
function ContentComponent(_ref5) {
|
|
192
|
-
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$
|
|
191
|
+
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
193
192
|
var pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
194
193
|
editorView = _ref5.editorView,
|
|
195
194
|
popupsMountPoint = _ref5.popupsMountPoint,
|
|
@@ -197,17 +196,19 @@ function ContentComponent(_ref5) {
|
|
|
197
196
|
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
198
197
|
providerFactory = _ref5.providerFactory,
|
|
199
198
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
200
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['floatingToolbar', 'editorDisabled', 'editorViewMode']),
|
|
199
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['floatingToolbar', 'editorDisabled', 'editorViewMode', 'featureFlags', 'blockControls']),
|
|
201
200
|
floatingToolbarState = _useSharedPluginState.floatingToolbarState,
|
|
202
201
|
editorDisabledState = _useSharedPluginState.editorDisabledState,
|
|
203
|
-
editorViewModeState = _useSharedPluginState.editorViewModeState
|
|
202
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
203
|
+
featureFlagsState = _useSharedPluginState.featureFlagsState,
|
|
204
|
+
blockControlsState = _useSharedPluginState.blockControlsState;
|
|
204
205
|
var _ref6 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
|
|
205
206
|
configWithNodeInfo = _ref6.configWithNodeInfo,
|
|
206
207
|
floatingToolbarData = _ref6.floatingToolbarData;
|
|
207
208
|
if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
|
|
208
209
|
return null;
|
|
209
210
|
}
|
|
210
|
-
if (
|
|
211
|
+
if (featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop && blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging) {
|
|
211
212
|
return null;
|
|
212
213
|
}
|
|
213
214
|
var config = configWithNodeInfo.config,
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -8,7 +8,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
8
8
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
11
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
13
12
|
import { hideConfirmDialog } from './pm-plugins/toolbar-data/commands';
|
|
14
13
|
import { createPlugin as floatingToolbarDataPluginFactory } from './pm-plugins/toolbar-data/plugin';
|
|
@@ -183,12 +182,14 @@ export function ContentComponent({
|
|
|
183
182
|
providerFactory,
|
|
184
183
|
dispatchAnalyticsEvent
|
|
185
184
|
}) {
|
|
186
|
-
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$
|
|
185
|
+
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
187
186
|
const {
|
|
188
187
|
floatingToolbarState,
|
|
189
188
|
editorDisabledState,
|
|
190
|
-
editorViewModeState
|
|
191
|
-
|
|
189
|
+
editorViewModeState,
|
|
190
|
+
featureFlagsState,
|
|
191
|
+
blockControlsState
|
|
192
|
+
} = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorDisabled', 'editorViewMode', 'featureFlags', 'blockControls']);
|
|
192
193
|
const {
|
|
193
194
|
configWithNodeInfo,
|
|
194
195
|
floatingToolbarData
|
|
@@ -196,7 +197,7 @@ export function ContentComponent({
|
|
|
196
197
|
if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
|
|
197
198
|
return null;
|
|
198
199
|
}
|
|
199
|
-
if (
|
|
200
|
+
if (featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop && blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging) {
|
|
200
201
|
return null;
|
|
201
202
|
}
|
|
202
203
|
const {
|
package/dist/esm/plugin.js
CHANGED
|
@@ -11,7 +11,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
11
11
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
13
13
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
14
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
16
15
|
import { hideConfirmDialog } from './pm-plugins/toolbar-data/commands';
|
|
17
16
|
import { createPlugin as floatingToolbarDataPluginFactory } from './pm-plugins/toolbar-data/plugin';
|
|
@@ -179,7 +178,7 @@ export var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
|
179
178
|
};
|
|
180
179
|
};
|
|
181
180
|
export function ContentComponent(_ref5) {
|
|
182
|
-
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$
|
|
181
|
+
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
183
182
|
var pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
184
183
|
editorView = _ref5.editorView,
|
|
185
184
|
popupsMountPoint = _ref5.popupsMountPoint,
|
|
@@ -187,17 +186,19 @@ export function ContentComponent(_ref5) {
|
|
|
187
186
|
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
188
187
|
providerFactory = _ref5.providerFactory,
|
|
189
188
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
190
|
-
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorDisabled', 'editorViewMode']),
|
|
189
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorDisabled', 'editorViewMode', 'featureFlags', 'blockControls']),
|
|
191
190
|
floatingToolbarState = _useSharedPluginState.floatingToolbarState,
|
|
192
191
|
editorDisabledState = _useSharedPluginState.editorDisabledState,
|
|
193
|
-
editorViewModeState = _useSharedPluginState.editorViewModeState
|
|
192
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
193
|
+
featureFlagsState = _useSharedPluginState.featureFlagsState,
|
|
194
|
+
blockControlsState = _useSharedPluginState.blockControlsState;
|
|
194
195
|
var _ref6 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
|
|
195
196
|
configWithNodeInfo = _ref6.configWithNodeInfo,
|
|
196
197
|
floatingToolbarData = _ref6.floatingToolbarData;
|
|
197
198
|
if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
|
|
198
199
|
return null;
|
|
199
200
|
}
|
|
200
|
-
if (
|
|
201
|
+
if (featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop && blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging) {
|
|
201
202
|
return null;
|
|
202
203
|
}
|
|
203
204
|
var config = configWithNodeInfo.config,
|
package/dist/types/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
|
6
6
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
7
7
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
8
8
|
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
9
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
9
10
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
10
11
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
11
12
|
export type ConfigWithNodeInfo = {
|
|
@@ -32,7 +33,8 @@ export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
|
32
33
|
CopyButtonPlugin,
|
|
33
34
|
EditorDisabledPlugin,
|
|
34
35
|
OptionalPlugin<EditorViewModePlugin>,
|
|
35
|
-
OptionalPlugin<BlockControlsPlugin
|
|
36
|
+
OptionalPlugin<BlockControlsPlugin>,
|
|
37
|
+
OptionalPlugin<FeatureFlagsPlugin>
|
|
36
38
|
];
|
|
37
39
|
actions: {
|
|
38
40
|
forceFocusSelector: ForceFocusSelector;
|
|
@@ -6,6 +6,7 @@ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
|
6
6
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
7
7
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
8
8
|
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
9
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
9
10
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
10
11
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
11
12
|
export type ConfigWithNodeInfo = {
|
|
@@ -32,7 +33,8 @@ export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
|
32
33
|
CopyButtonPlugin,
|
|
33
34
|
EditorDisabledPlugin,
|
|
34
35
|
OptionalPlugin<EditorViewModePlugin>,
|
|
35
|
-
OptionalPlugin<BlockControlsPlugin
|
|
36
|
+
OptionalPlugin<BlockControlsPlugin>,
|
|
37
|
+
OptionalPlugin<FeatureFlagsPlugin>
|
|
36
38
|
];
|
|
37
39
|
actions: {
|
|
38
40
|
forceFocusSelector: ForceFocusSelector;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@atlaskit/adf-utils": "^19.2.0",
|
|
28
28
|
"@atlaskit/button": "^17.17.0",
|
|
29
29
|
"@atlaskit/checkbox": "^13.4.0",
|
|
30
|
-
"@atlaskit/editor-common": "^82.
|
|
30
|
+
"@atlaskit/editor-common": "^82.3.0",
|
|
31
31
|
"@atlaskit/editor-palette": "1.6.0",
|
|
32
32
|
"@atlaskit/editor-plugin-block-controls": "^1.4.1",
|
|
33
33
|
"@atlaskit/editor-plugin-context-panel": "^1.1.0",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-viewmode": "^1.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-extension": "^1.5.0",
|
|
39
|
-
"@atlaskit/editor-plugin-table": "^7.
|
|
39
|
+
"@atlaskit/editor-plugin-table": "^7.17.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
41
41
|
"@atlaskit/emoji": "^67.6.0",
|
|
42
42
|
"@atlaskit/icon": "^22.3.0",
|
|
43
|
-
"@atlaskit/menu": "^2.
|
|
43
|
+
"@atlaskit/menu": "^2.4.0",
|
|
44
44
|
"@atlaskit/modal-dialog": "^12.13.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.2.5",
|
|
46
46
|
"@atlaskit/select": "^17.10.0",
|
|
47
|
-
"@atlaskit/theme": "^12.
|
|
48
|
-
"@atlaskit/tokens": "^1.
|
|
47
|
+
"@atlaskit/theme": "^12.9.0",
|
|
48
|
+
"@atlaskit/tokens": "^1.50.0",
|
|
49
49
|
"@atlaskit/tooltip": "^18.4.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1",
|
|
@@ -111,9 +111,6 @@
|
|
|
111
111
|
},
|
|
112
112
|
"platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
|
|
113
113
|
"type": "boolean"
|
|
114
|
-
},
|
|
115
|
-
"platform.editor.drag-and-drop_wmv9t": {
|
|
116
|
-
"type": "boolean"
|
|
117
114
|
}
|
|
118
115
|
}
|
|
119
116
|
}
|