@atlaskit/editor-plugin-toolbar 1.0.1 → 1.1.1

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,23 @@
1
1
  # @atlaskit/editor-plugin-toolbar
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`50976babce55d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/50976babce55d) -
14
+ Add new 'onClick' to dropdown menu, hook up new toolbar api to regsiter components on selection
15
+ change, add new safeRegistry method to replace existing objects
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 1.0.1
4
22
 
5
23
  ### Patch Changes
@@ -32,7 +32,12 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
32
32
  name: 'toolbar',
33
33
  actions: {
34
34
  registerComponents: function registerComponents(toolbarComponents) {
35
- registry.register(toolbarComponents);
35
+ var replaceItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
36
+ if (replaceItems) {
37
+ registry.safeRegister(toolbarComponents);
38
+ } else {
39
+ registry.register(toolbarComponents);
40
+ }
36
41
  },
37
42
  getComponents: function getComponents() {
38
43
  return registry.components;
@@ -1 +1,5 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -23,8 +23,12 @@ export const toolbarPlugin = ({
23
23
  return {
24
24
  name: 'toolbar',
25
25
  actions: {
26
- registerComponents: toolbarComponents => {
27
- registry.register(toolbarComponents);
26
+ registerComponents: (toolbarComponents, replaceItems = false) => {
27
+ if (replaceItems) {
28
+ registry.safeRegister(toolbarComponents);
29
+ } else {
30
+ registry.register(toolbarComponents);
31
+ }
28
32
  },
29
33
  getComponents: () => {
30
34
  return registry.components;
@@ -0,0 +1 @@
1
+ export {};
@@ -25,7 +25,12 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
25
25
  name: 'toolbar',
26
26
  actions: {
27
27
  registerComponents: function registerComponents(toolbarComponents) {
28
- registry.register(toolbarComponents);
28
+ var replaceItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
29
+ if (replaceItems) {
30
+ registry.safeRegister(toolbarComponents);
31
+ } else {
32
+ registry.register(toolbarComponents);
33
+ }
29
34
  },
30
35
  getComponents: function getComponents() {
31
36
  return registry.components;
@@ -0,0 +1 @@
1
+ export {};
@@ -5,11 +5,11 @@ 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
+ import type { RegisterComponentsAction, ToolbarPluginOptions } from './types';
9
9
  export type ToolbarPlugin = NextEditorPlugin<'toolbar', {
10
10
  actions: {
11
11
  getComponents: () => Array<RegisterComponent>;
12
- registerComponents: (toolbarComponents: Array<RegisterComponent>) => void;
12
+ registerComponents: RegisterComponentsAction;
13
13
  };
14
14
  dependencies: [
15
15
  OptionalPlugin<UserIntentPlugin>,
@@ -1,4 +1,6 @@
1
+ import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
1
2
  export type ToolbarPluginOptions = {
2
3
  disableSelectionToolbar?: boolean;
3
4
  disableSelectionToolbarWhenPinned?: boolean;
4
5
  };
6
+ export type RegisterComponentsAction = (toolbarComponents: Array<RegisterComponent>, replaceItems?: boolean) => void;
@@ -5,11 +5,11 @@ 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
+ import type { RegisterComponentsAction, ToolbarPluginOptions } from './types';
9
9
  export type ToolbarPlugin = NextEditorPlugin<'toolbar', {
10
10
  actions: {
11
11
  getComponents: () => Array<RegisterComponent>;
12
- registerComponents: (toolbarComponents: Array<RegisterComponent>) => void;
12
+ registerComponents: RegisterComponentsAction;
13
13
  };
14
14
  dependencies: [
15
15
  OptionalPlugin<UserIntentPlugin>,
@@ -1,4 +1,6 @@
1
+ import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
1
2
  export type ToolbarPluginOptions = {
2
3
  disableSelectionToolbar?: boolean;
3
4
  disableSelectionToolbarWhenPinned?: boolean;
4
5
  };
6
+ export type RegisterComponentsAction = (toolbarComponents: Array<RegisterComponent>, replaceItems?: boolean) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,15 +34,15 @@
34
34
  "@atlaskit/editor-plugin-user-intent": "^2.0.0",
35
35
  "@atlaskit/editor-plugin-user-preferences": "^2.0.0",
36
36
  "@atlaskit/editor-prosemirror": "7.0.0",
37
- "@atlaskit/editor-toolbar": "^0.6.0",
37
+ "@atlaskit/editor-toolbar": "^0.8.0",
38
38
  "@atlaskit/editor-toolbar-model": "^0.2.0",
39
- "@atlaskit/tmp-editor-statsig": "^12.1.0",
39
+ "@atlaskit/tmp-editor-statsig": "^12.4.0",
40
40
  "@babel/runtime": "^7.0.0",
41
41
  "bind-event-listener": "^3.0.0",
42
42
  "react-intl-next": "npm:react-intl@^5.18.1"
43
43
  },
44
44
  "peerDependencies": {
45
- "@atlaskit/editor-common": "^108.0.0",
45
+ "@atlaskit/editor-common": "^108.2.0",
46
46
  "react": "^18.2.0"
47
47
  },
48
48
  "techstack": {