@atlaskit/editor-plugin-floating-toolbar 7.0.1 → 7.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,21 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 7.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2475c192d69b0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2475c192d69b0) -
8
+ [ux] Hide floating toolbar when block menu is open
9
+ - Updated dependencies
10
+
11
+ ## 7.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [`6fb79942fc3a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6fb79942fc3a5) -
16
+ Internal changes to how borders are applied.
17
+ - Updated dependencies
18
+
3
19
  ## 7.0.1
4
20
 
5
21
  ### 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 _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
28
29
  var _commands = require("./pm-plugins/commands");
@@ -193,6 +194,9 @@ var floatingToolbarPlugin = exports.floatingToolbarPlugin = function floatingToo
193
194
  editorView = _ref4.editorView,
194
195
  providerFactory = _ref4.providerFactory,
195
196
  dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
197
+ if (!editorView) {
198
+ return null;
199
+ }
196
200
  return /*#__PURE__*/_react.default.createElement(ContentComponent, {
197
201
  editorView: editorView,
198
202
  pluginInjectionApi: api,
@@ -231,7 +235,7 @@ function ContentComponent(_ref5) {
231
235
  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)) {
232
236
  return null;
233
237
  }
234
- if ((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging') {
238
+ if ((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging' || (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'blockMenuOpen' && (0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_hide_floating_toolbar')) {
235
239
  return null;
236
240
  }
237
241
 
@@ -12,7 +12,7 @@ var _primitives = require("@atlaskit/primitives");
12
12
  var styles = (0, _primitives.xcss)({
13
13
  width: '100%',
14
14
  borderBlockEnd: 'none',
15
- borderBlockStart: "1px solid ".concat("var(--ds-border, #091E4224)"),
15
+ borderBlockStart: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, #091E4224)"),
16
16
  borderInline: 'none'
17
17
  });
18
18
  var Divider = exports.Divider = function Divider() {
@@ -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 { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
18
  import { copyNode } from './pm-plugins/commands';
@@ -179,6 +180,9 @@ export const floatingToolbarPlugin = ({
179
180
  providerFactory,
180
181
  dispatchAnalyticsEvent
181
182
  }) {
183
+ if (!editorView) {
184
+ return null;
185
+ }
182
186
  return /*#__PURE__*/React.createElement(ContentComponent, {
183
187
  editorView: editorView,
184
188
  pluginInjectionApi: api,
@@ -221,7 +225,7 @@ export function ContentComponent({
221
225
  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)) {
222
226
  return null;
223
227
  }
224
- if ((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging') {
228
+ if ((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging' || (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'blockMenuOpen' && expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_hide_floating_toolbar')) {
225
229
  return null;
226
230
  }
227
231
 
@@ -5,7 +5,7 @@ import { Box, xcss } from '@atlaskit/primitives';
5
5
  const styles = xcss({
6
6
  width: '100%',
7
7
  borderBlockEnd: 'none',
8
- borderBlockStart: `1px solid ${"var(--ds-border, #091E4224)"}`,
8
+ borderBlockStart: `${"var(--ds-border-width, 1px)"} solid ${"var(--ds-border, #091E4224)"}`,
9
9
  borderInline: 'none'
10
10
  });
11
11
  export const Divider = () => /*#__PURE__*/React.createElement(Box, {
@@ -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 { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
22
  import { copyNode as _copyNode } from './pm-plugins/commands';
@@ -184,6 +185,9 @@ export var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
184
185
  editorView = _ref4.editorView,
185
186
  providerFactory = _ref4.providerFactory,
186
187
  dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
188
+ if (!editorView) {
189
+ return null;
190
+ }
187
191
  return /*#__PURE__*/React.createElement(ContentComponent, {
188
192
  editorView: editorView,
189
193
  pluginInjectionApi: api,
@@ -222,7 +226,7 @@ export function ContentComponent(_ref5) {
222
226
  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)) {
223
227
  return null;
224
228
  }
225
- if ((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging') {
229
+ if ((userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'dragging' || (userIntentState === null || userIntentState === void 0 ? void 0 : userIntentState.currentUserIntent) === 'blockMenuOpen' && expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_hide_floating_toolbar')) {
226
230
  return null;
227
231
  }
228
232
 
@@ -5,7 +5,7 @@ import { Box, xcss } from '@atlaskit/primitives';
5
5
  var styles = xcss({
6
6
  width: '100%',
7
7
  borderBlockEnd: 'none',
8
- borderBlockStart: "1px solid ".concat("var(--ds-border, #091E4224)"),
8
+ borderBlockStart: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, #091E4224)"),
9
9
  borderInline: 'none'
10
10
  });
11
11
  export var Divider = function Divider() {
@@ -5,11 +5,14 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import type { ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolbarHandler, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
6
6
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
9
  import type { ConfigWithNodeInfo, FloatingToolbarPlugin, FloatingToolbarPluginState } from './floatingToolbarPluginType';
9
10
  export declare const getRelevantConfig: (selection: Selection, configs: Array<FloatingToolbarConfig>) => ConfigWithNodeInfo | undefined;
10
11
  export declare const floatingToolbarPlugin: FloatingToolbarPlugin;
11
12
  export declare function ContentComponent({ pluginInjectionApi, editorView, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, providerFactory, dispatchAnalyticsEvent, }: Pick<UiComponentFactoryParams, 'editorView' | 'popupsMountPoint' | 'popupsBoundariesElement' | 'providerFactory' | 'dispatchAnalyticsEvent' | 'popupsScrollableElement'> & {
12
13
  pluginInjectionApi: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
14
+ } & {
15
+ editorView: EditorView;
13
16
  }): React.JSX.Element | null;
14
17
  /**
15
18
  *
@@ -5,11 +5,14 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import type { ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolbarHandler, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
6
6
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
9
  import type { ConfigWithNodeInfo, FloatingToolbarPlugin, FloatingToolbarPluginState } from './floatingToolbarPluginType';
9
10
  export declare const getRelevantConfig: (selection: Selection, configs: Array<FloatingToolbarConfig>) => ConfigWithNodeInfo | undefined;
10
11
  export declare const floatingToolbarPlugin: FloatingToolbarPlugin;
11
12
  export declare function ContentComponent({ pluginInjectionApi, editorView, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, providerFactory, dispatchAnalyticsEvent, }: Pick<UiComponentFactoryParams, 'editorView' | 'popupsMountPoint' | 'popupsBoundariesElement' | 'providerFactory' | 'dispatchAnalyticsEvent' | 'popupsScrollableElement'> & {
12
13
  pluginInjectionApi: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
14
+ } & {
15
+ editorView: EditorView;
13
16
  }): React.JSX.Element | null;
14
17
  /**
15
18
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,31 +21,31 @@
21
21
  ],
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
- "@atlaskit/adf-utils": "^19.21.0",
24
+ "@atlaskit/adf-utils": "^19.23.0",
25
25
  "@atlaskit/button": "^23.4.0",
26
26
  "@atlaskit/checkbox": "^17.1.0",
27
27
  "@atlaskit/editor-palette": "^2.1.0",
28
- "@atlaskit/editor-plugin-analytics": "^5.0.0",
28
+ "@atlaskit/editor-plugin-analytics": "^5.2.0",
29
29
  "@atlaskit/editor-plugin-context-panel": "^7.0.0",
30
30
  "@atlaskit/editor-plugin-copy-button": "^5.0.0",
31
31
  "@atlaskit/editor-plugin-decorations": "^5.0.0",
32
32
  "@atlaskit/editor-plugin-editor-disabled": "^5.0.0",
33
33
  "@atlaskit/editor-plugin-editor-viewmode": "^7.0.0",
34
- "@atlaskit/editor-plugin-emoji": "^6.0.0",
35
- "@atlaskit/editor-plugin-extension": "^8.0.0",
34
+ "@atlaskit/editor-plugin-emoji": "^6.3.0",
35
+ "@atlaskit/editor-plugin-extension": "^8.2.0",
36
36
  "@atlaskit/editor-plugin-interaction": "^7.0.0",
37
- "@atlaskit/editor-plugin-table": "^14.0.0",
37
+ "@atlaskit/editor-plugin-table": "^14.2.0",
38
38
  "@atlaskit/editor-plugin-user-intent": "^3.0.0",
39
39
  "@atlaskit/editor-prosemirror": "7.0.0",
40
40
  "@atlaskit/emoji": "^69.5.0",
41
- "@atlaskit/icon": "^28.1.0",
41
+ "@atlaskit/icon": "^28.2.0",
42
42
  "@atlaskit/menu": "^8.4.0",
43
43
  "@atlaskit/modal-dialog": "^14.3.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
- "@atlaskit/primitives": "^14.14.0",
46
- "@atlaskit/select": "^21.2.0",
45
+ "@atlaskit/primitives": "^14.15.0",
46
+ "@atlaskit/select": "^21.3.0",
47
47
  "@atlaskit/theme": "^21.0.0",
48
- "@atlaskit/tmp-editor-statsig": "^12.10.0",
48
+ "@atlaskit/tmp-editor-statsig": "^12.29.0",
49
49
  "@atlaskit/tokens": "^6.3.0",
50
50
  "@atlaskit/tooltip": "^20.4.0",
51
51
  "@babel/runtime": "^7.0.0",
@@ -57,7 +57,7 @@
57
57
  "react-loadable": "^5.1.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^109.1.0",
60
+ "@atlaskit/editor-common": "^109.13.0",
61
61
  "react": "^18.2.0",
62
62
  "react-dom": "^18.2.0"
63
63
  },
@@ -118,6 +118,9 @@
118
118
  },
119
119
  "platform_editor_user_intent_plugin": {
120
120
  "type": "boolean"
121
+ },
122
+ "platform_editor_block_menu_hide_floating_toolbar": {
123
+ "type": "boolean"
121
124
  }
122
125
  }
123
126
  }