@atlaskit/editor-plugin-floating-toolbar 13.0.1 → 13.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
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 13.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7a682c6422bb3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7a682c6422bb3) -
|
|
8
|
+
MAUI-590 hide floating toolbar after start remix
|
|
9
|
+
|
|
10
|
+
## 13.0.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 13.0.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -23,6 +23,7 @@ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
|
23
23
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
24
24
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
25
25
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
26
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
27
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
27
28
|
var _commands = require("./pm-plugins/commands");
|
|
28
29
|
var _forceFocus = _interopRequireWildcard(require("./pm-plugins/force-focus"));
|
|
@@ -246,8 +247,16 @@ function ContentComponent(_ref5) {
|
|
|
246
247
|
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
247
248
|
userIntentState = _useSharedPluginState.userIntentState;
|
|
248
249
|
var _ref6 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
|
|
249
|
-
|
|
250
|
+
configWithNodeInfoFromHook = _ref6.configWithNodeInfo,
|
|
250
251
|
floatingToolbarData = _ref6.floatingToolbarData;
|
|
252
|
+
var configWithNodeInfo = configWithNodeInfoFromHook;
|
|
253
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_ai_remix_toolbar')) {
|
|
254
|
+
var _pluginInjectionApi$f;
|
|
255
|
+
// Read configWithNodeInfo live because the hook snapshot can lag behind the
|
|
256
|
+
// current editor selection and keep the floating toolbar rendered stale.
|
|
257
|
+
// for example, trigger remix on panel will not hide the floating toolbar
|
|
258
|
+
configWithNodeInfo = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 || (_pluginInjectionApi$f = _pluginInjectionApi$f.sharedState.currentState()) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.configWithNodeInfo;
|
|
259
|
+
}
|
|
251
260
|
if ((0, _coreUtils.isSSR)()) {
|
|
252
261
|
return null;
|
|
253
262
|
}
|
|
@@ -257,8 +266,9 @@ function ContentComponent(_ref5) {
|
|
|
257
266
|
if (userIntentState !== null && userIntentState !== void 0 && userIntentState.currentUserIntent && SUPPRESS_TOOLBAR_USER_INTENTS.includes(userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent)) {
|
|
258
267
|
return null;
|
|
259
268
|
}
|
|
260
|
-
var
|
|
261
|
-
|
|
269
|
+
var _configWithNodeInfo = configWithNodeInfo,
|
|
270
|
+
config = _configWithNodeInfo.config,
|
|
271
|
+
node = _configWithNodeInfo.node;
|
|
262
272
|
|
|
263
273
|
// When the new inline editor-toolbar is enabled, suppress floating toolbar for text selections.
|
|
264
274
|
if (Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar)) {
|
|
@@ -12,6 +12,7 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
12
12
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { AllSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
14
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
17
|
import { copyNode } from './pm-plugins/commands';
|
|
17
18
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
@@ -233,9 +234,17 @@ export function ContentComponent({
|
|
|
233
234
|
userIntentState
|
|
234
235
|
} = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorDisabled', 'editorViewMode', 'userIntent']);
|
|
235
236
|
const {
|
|
236
|
-
configWithNodeInfo,
|
|
237
|
+
configWithNodeInfo: configWithNodeInfoFromHook,
|
|
237
238
|
floatingToolbarData
|
|
238
239
|
} = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {};
|
|
240
|
+
let configWithNodeInfo = configWithNodeInfoFromHook;
|
|
241
|
+
if (fg('platform_editor_ai_remix_toolbar')) {
|
|
242
|
+
var _pluginInjectionApi$f, _pluginInjectionApi$f2;
|
|
243
|
+
// Read configWithNodeInfo live because the hook snapshot can lag behind the
|
|
244
|
+
// current editor selection and keep the floating toolbar rendered stale.
|
|
245
|
+
// for example, trigger remix on panel will not hide the floating toolbar
|
|
246
|
+
configWithNodeInfo = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : (_pluginInjectionApi$f2 = _pluginInjectionApi$f.sharedState.currentState()) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.configWithNodeInfo;
|
|
247
|
+
}
|
|
239
248
|
if (isSSR()) {
|
|
240
249
|
return null;
|
|
241
250
|
}
|
|
@@ -16,6 +16,7 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
16
16
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { AllSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
18
18
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
19
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
20
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
21
|
import { copyNode as _copyNode } from './pm-plugins/commands';
|
|
21
22
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
@@ -236,8 +237,16 @@ export function ContentComponent(_ref5) {
|
|
|
236
237
|
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
237
238
|
userIntentState = _useSharedPluginState.userIntentState;
|
|
238
239
|
var _ref6 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
|
|
239
|
-
|
|
240
|
+
configWithNodeInfoFromHook = _ref6.configWithNodeInfo,
|
|
240
241
|
floatingToolbarData = _ref6.floatingToolbarData;
|
|
242
|
+
var configWithNodeInfo = configWithNodeInfoFromHook;
|
|
243
|
+
if (fg('platform_editor_ai_remix_toolbar')) {
|
|
244
|
+
var _pluginInjectionApi$f;
|
|
245
|
+
// Read configWithNodeInfo live because the hook snapshot can lag behind the
|
|
246
|
+
// current editor selection and keep the floating toolbar rendered stale.
|
|
247
|
+
// for example, trigger remix on panel will not hide the floating toolbar
|
|
248
|
+
configWithNodeInfo = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 || (_pluginInjectionApi$f = _pluginInjectionApi$f.sharedState.currentState()) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.configWithNodeInfo;
|
|
249
|
+
}
|
|
241
250
|
if (isSSR()) {
|
|
242
251
|
return null;
|
|
243
252
|
}
|
|
@@ -247,8 +256,9 @@ export function ContentComponent(_ref5) {
|
|
|
247
256
|
if (userIntentState !== null && userIntentState !== void 0 && userIntentState.currentUserIntent && SUPPRESS_TOOLBAR_USER_INTENTS.includes(userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent)) {
|
|
248
257
|
return null;
|
|
249
258
|
}
|
|
250
|
-
var
|
|
251
|
-
|
|
259
|
+
var _configWithNodeInfo = configWithNodeInfo,
|
|
260
|
+
config = _configWithNodeInfo.config,
|
|
261
|
+
node = _configWithNodeInfo.node;
|
|
252
262
|
|
|
253
263
|
// When the new inline editor-toolbar is enabled, suppress floating toolbar for text selections.
|
|
254
264
|
if (Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.3",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
"@atlaskit/editor-plugin-editor-disabled": "^11.0.0",
|
|
33
33
|
"@atlaskit/editor-plugin-editor-viewmode": "^13.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-emoji": "^12.0.0",
|
|
35
|
-
"@atlaskit/editor-plugin-extension": "^14.
|
|
35
|
+
"@atlaskit/editor-plugin-extension": "^14.1.0",
|
|
36
36
|
"@atlaskit/editor-plugin-interaction": "^20.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-user-intent": "^9.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
39
|
-
"@atlaskit/emoji": "^70.
|
|
39
|
+
"@atlaskit/emoji": "^70.16.0",
|
|
40
40
|
"@atlaskit/icon": "^35.4.0",
|
|
41
41
|
"@atlaskit/menu": "^8.5.0",
|
|
42
42
|
"@atlaskit/modal-dialog": "^15.2.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/primitives": "^19.0.0",
|
|
45
45
|
"@atlaskit/select": "^21.12.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
47
|
-
"@atlaskit/tokens": "^13.
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^90.0.0",
|
|
47
|
+
"@atlaskit/tokens": "^13.3.0",
|
|
48
48
|
"@atlaskit/tooltip": "^22.6.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"react-loadable": "^5.1.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@atlaskit/editor-common": "^115.
|
|
57
|
+
"@atlaskit/editor-common": "^115.7.0",
|
|
58
58
|
"react": "^18.2.0",
|
|
59
59
|
"react-dom": "^18.2.0",
|
|
60
60
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -110,5 +110,9 @@
|
|
|
110
110
|
]
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
-
"platform-feature-flags": {
|
|
113
|
+
"platform-feature-flags": {
|
|
114
|
+
"platform_editor_ai_remix_toolbar": {
|
|
115
|
+
"type": "boolean"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
114
118
|
}
|