@atlaskit/editor-plugin-toolbar 0.2.4 → 0.3.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/editor-plugin-toolbar
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`44b183a57537a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/44b183a57537a) -
8
+ Introduce a new plugin config option for editor-plugin-toolbar to disable the selection toolbar
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 0.2.4
4
15
 
5
16
  ### Patch Changes
@@ -17,6 +17,9 @@
17
17
  "../src/**/examples.*"
18
18
  ],
19
19
  "references": [
20
+ {
21
+ "path": "../../editor-plugin-connectivity/afm-dev-agents/tsconfig.json"
22
+ },
20
23
  {
21
24
  "path": "../../editor-plugin-editor-viewmode/afm-dev-agents/tsconfig.json"
22
25
  },
@@ -17,6 +17,9 @@
17
17
  "../src/**/examples.*"
18
18
  ],
19
19
  "references": [
20
+ {
21
+ "path": "../../editor-plugin-connectivity/afm-jira/tsconfig.json"
22
+ },
20
23
  {
21
24
  "path": "../../editor-plugin-editor-viewmode/afm-jira/tsconfig.json"
22
25
  },
@@ -17,6 +17,9 @@
17
17
  "../src/**/examples.*"
18
18
  ],
19
19
  "references": [
20
+ {
21
+ "path": "../../editor-plugin-connectivity/afm-passionfruit/tsconfig.json"
22
+ },
20
23
  {
21
24
  "path": "../../editor-plugin-editor-viewmode/afm-passionfruit/tsconfig.json"
22
25
  },
@@ -17,6 +17,9 @@
17
17
  "../src/**/examples.*"
18
18
  ],
19
19
  "references": [
20
+ {
21
+ "path": "../../editor-plugin-connectivity/afm-post-office/tsconfig.json"
22
+ },
20
23
  {
21
24
  "path": "../../editor-plugin-editor-viewmode/afm-post-office/tsconfig.json"
22
25
  },
@@ -17,6 +17,9 @@
17
17
  "../src/**/examples.*"
18
18
  ],
19
19
  "references": [
20
+ {
21
+ "path": "../../editor-plugin-connectivity/afm-rovo-extension/tsconfig.json"
22
+ },
20
23
  {
21
24
  "path": "../../editor-plugin-editor-viewmode/afm-rovo-extension/tsconfig.json"
22
25
  },
@@ -17,6 +17,9 @@
17
17
  "../src/**/examples.*"
18
18
  ],
19
19
  "references": [
20
+ {
21
+ "path": "../../editor-plugin-connectivity/afm-townsquare/tsconfig.json"
22
+ },
20
23
  {
21
24
  "path": "../../editor-plugin-editor-viewmode/afm-townsquare/tsconfig.json"
22
25
  },
@@ -10,7 +10,12 @@ var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
10
10
  var _SelectionToolbar = require("./ui/SelectionToolbar");
11
11
  var _toolbarComponents = require("./ui/toolbar-components");
12
12
  var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
13
- var api = _ref.api;
13
+ var api = _ref.api,
14
+ _ref$config = _ref.config,
15
+ config = _ref$config === void 0 ? {
16
+ disableSelectionToolbar: false
17
+ } : _ref$config;
18
+ var disableSelectionToolbar = config.disableSelectionToolbar;
14
19
  var registry = (0, _editorToolbarModel.createComponentRegistry)();
15
20
  registry.register((0, _toolbarComponents.getToolbarComponents)(api));
16
21
  return {
@@ -23,7 +28,7 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
23
28
  return registry.components;
24
29
  }
25
30
  },
26
- contentComponent: function contentComponent(_ref2) {
31
+ contentComponent: !disableSelectionToolbar ? function (_ref2) {
27
32
  var editorView = _ref2.editorView,
28
33
  popupsMountPoint = _ref2.popupsMountPoint;
29
34
  return /*#__PURE__*/_react.default.createElement(_SelectionToolbar.SelectionToolbar, {
@@ -31,6 +36,6 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
31
36
  editorView: editorView,
32
37
  mountPoint: popupsMountPoint
33
38
  });
34
- }
39
+ } : undefined
35
40
  };
36
41
  };
@@ -0,0 +1 @@
1
+ "use strict";
@@ -3,8 +3,14 @@ import { createComponentRegistry } from '@atlaskit/editor-toolbar-model';
3
3
  import { SelectionToolbar } from './ui/SelectionToolbar';
4
4
  import { getToolbarComponents } from './ui/toolbar-components';
5
5
  export const toolbarPlugin = ({
6
- api
6
+ api,
7
+ config = {
8
+ disableSelectionToolbar: false
9
+ }
7
10
  }) => {
11
+ const {
12
+ disableSelectionToolbar
13
+ } = config;
8
14
  const registry = createComponentRegistry();
9
15
  registry.register(getToolbarComponents(api));
10
16
  return {
@@ -17,7 +23,7 @@ export const toolbarPlugin = ({
17
23
  return registry.components;
18
24
  }
19
25
  },
20
- contentComponent: ({
26
+ contentComponent: !disableSelectionToolbar ? ({
21
27
  editorView,
22
28
  popupsMountPoint
23
29
  }) => {
@@ -26,6 +32,6 @@ export const toolbarPlugin = ({
26
32
  editorView: editorView,
27
33
  mountPoint: popupsMountPoint
28
34
  });
29
- }
35
+ } : undefined
30
36
  };
31
37
  };
File without changes
@@ -3,7 +3,12 @@ import { createComponentRegistry } from '@atlaskit/editor-toolbar-model';
3
3
  import { SelectionToolbar } from './ui/SelectionToolbar';
4
4
  import { getToolbarComponents } from './ui/toolbar-components';
5
5
  export var toolbarPlugin = function toolbarPlugin(_ref) {
6
- var api = _ref.api;
6
+ var api = _ref.api,
7
+ _ref$config = _ref.config,
8
+ config = _ref$config === void 0 ? {
9
+ disableSelectionToolbar: false
10
+ } : _ref$config;
11
+ var disableSelectionToolbar = config.disableSelectionToolbar;
7
12
  var registry = createComponentRegistry();
8
13
  registry.register(getToolbarComponents(api));
9
14
  return {
@@ -16,7 +21,7 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
16
21
  return registry.components;
17
22
  }
18
23
  },
19
- contentComponent: function contentComponent(_ref2) {
24
+ contentComponent: !disableSelectionToolbar ? function (_ref2) {
20
25
  var editorView = _ref2.editorView,
21
26
  popupsMountPoint = _ref2.popupsMountPoint;
22
27
  return /*#__PURE__*/React.createElement(SelectionToolbar, {
@@ -24,6 +29,6 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
24
29
  editorView: editorView,
25
30
  mountPoint: popupsMountPoint
26
31
  });
27
- }
32
+ } : undefined
28
33
  };
29
34
  };
File without changes
@@ -1,2 +1,3 @@
1
1
  export { toolbarPlugin } from './toolbarPlugin';
2
2
  export type { ToolbarPlugin } from './toolbarPluginType';
3
+ export type { ToolbarPluginOptions } from './types';
@@ -5,7 +5,9 @@ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
5
5
  import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
6
6
  import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
7
7
  import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
8
+ import type { ToolbarPluginOptions } from './types';
8
9
  export type ToolbarPlugin = NextEditorPlugin<'toolbar', {
10
+ pluginConfiguration?: ToolbarPluginOptions;
9
11
  dependencies: [
10
12
  OptionalPlugin<UserIntentPlugin>,
11
13
  OptionalPlugin<SelectionPlugin>,
@@ -0,0 +1,3 @@
1
+ export type ToolbarPluginOptions = {
2
+ disableSelectionToolbar?: boolean;
3
+ };
@@ -1,2 +1,3 @@
1
1
  export { toolbarPlugin } from './toolbarPlugin';
2
2
  export type { ToolbarPlugin } from './toolbarPluginType';
3
+ export type { ToolbarPluginOptions } from './types';
@@ -5,7 +5,9 @@ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
5
5
  import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
6
6
  import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
7
7
  import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
8
+ import type { ToolbarPluginOptions } from './types';
8
9
  export type ToolbarPlugin = NextEditorPlugin<'toolbar', {
10
+ pluginConfiguration?: ToolbarPluginOptions;
9
11
  dependencies: [
10
12
  OptionalPlugin<UserIntentPlugin>,
11
13
  OptionalPlugin<SelectionPlugin>,
@@ -0,0 +1,3 @@
1
+ export type ToolbarPluginOptions = {
2
+ disableSelectionToolbar?: boolean;
3
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "Toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/editor-plugin-connectivity": "^3.1.0",
35
35
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
36
- "@atlaskit/editor-plugin-selection": "^3.0.0",
36
+ "@atlaskit/editor-plugin-selection": "^3.1.0",
37
37
  "@atlaskit/editor-plugin-user-intent": "^1.1.0",
38
38
  "@atlaskit/editor-plugin-user-preferences": "^1.2.0",
39
39
  "@atlaskit/editor-prosemirror": "7.0.0",