@atlaskit/editor-plugin-avatar-group 1.4.0 → 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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-plugin-avatar-group
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#126478](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/126478)
8
+ [`ca1665ebbfe4d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ca1665ebbfe4d) -
9
+ [ED-23435] Store primary toolbar component registry in a plugin variable instead of in plugin
10
+ state to avoid having to add effects to all plugins and enable SSR for the toolbar. [Breaking
11
+ change] Converted registerComponent from the primary toolbar plugin into an action.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 1.4.1
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 1.4.0
4
24
 
5
25
  ### Minor Changes
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _AvatarGroupPluginWrapper = _interopRequireDefault(require("./ui/AvatarGroupPluginWrapper"));
10
10
  var _avatarsWithPluginState = _interopRequireDefault(require("./ui/avatars-with-plugin-state"));
11
11
  var avatarGroupPlugin = exports.avatarGroupPlugin = function avatarGroupPlugin(_ref) {
12
- var _api$featureFlags;
12
+ var _api$featureFlags, _api$primaryToolbar;
13
13
  var props = _ref.config,
14
14
  api = _ref.api;
15
15
  var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
@@ -29,17 +29,12 @@ var avatarGroupPlugin = exports.avatarGroupPlugin = function avatarGroupPlugin(_
29
29
  editorAPI: api
30
30
  });
31
31
  };
32
+ api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
33
+ name: 'avatarGroup',
34
+ component: primaryToolbarComponent
35
+ });
32
36
  return {
33
37
  name: 'avatarGroup',
34
- usePluginHook: function usePluginHook() {
35
- if (props.showAvatarGroup) {
36
- var _api$core, _api$primaryToolbar;
37
- api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
38
- name: 'avatarGroup',
39
- component: primaryToolbarComponent
40
- }));
41
- }
42
- },
43
38
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && props.showAvatarGroup ? primaryToolbarComponent : undefined,
44
39
  actions: {
45
40
  getToolbarItem: function getToolbarItem(_ref3) {
@@ -5,7 +5,7 @@ export const avatarGroupPlugin = ({
5
5
  config: props,
6
6
  api
7
7
  }) => {
8
- var _api$featureFlags;
8
+ var _api$featureFlags, _api$primaryToolbar;
9
9
  const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
10
10
  const primaryToolbarComponent = ({
11
11
  editorView,
@@ -24,17 +24,12 @@ export const avatarGroupPlugin = ({
24
24
  editorAPI: api
25
25
  });
26
26
  };
27
+ api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.actions.registerComponent({
28
+ name: 'avatarGroup',
29
+ component: primaryToolbarComponent
30
+ });
27
31
  return {
28
32
  name: 'avatarGroup',
29
- usePluginHook: () => {
30
- if (props.showAvatarGroup) {
31
- var _api$core, _api$primaryToolbar;
32
- api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
33
- name: 'avatarGroup',
34
- component: primaryToolbarComponent
35
- }));
36
- }
37
- },
38
33
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && props.showAvatarGroup ? primaryToolbarComponent : undefined,
39
34
  actions: {
40
35
  getToolbarItem: ({
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import AvatarGroupPluginWrapper from './ui/AvatarGroupPluginWrapper';
3
3
  import AvatarsWithPluginState from './ui/avatars-with-plugin-state';
4
4
  export var avatarGroupPlugin = function avatarGroupPlugin(_ref) {
5
- var _api$featureFlags;
5
+ var _api$featureFlags, _api$primaryToolbar;
6
6
  var props = _ref.config,
7
7
  api = _ref.api;
8
8
  var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
@@ -22,17 +22,12 @@ export var avatarGroupPlugin = function avatarGroupPlugin(_ref) {
22
22
  editorAPI: api
23
23
  });
24
24
  };
25
+ api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
26
+ name: 'avatarGroup',
27
+ component: primaryToolbarComponent
28
+ });
25
29
  return {
26
30
  name: 'avatarGroup',
27
- usePluginHook: function usePluginHook() {
28
- if (props.showAvatarGroup) {
29
- var _api$core, _api$primaryToolbar;
30
- api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
31
- name: 'avatarGroup',
32
- component: primaryToolbarComponent
33
- }));
34
- }
35
- },
36
31
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && props.showAvatarGroup ? primaryToolbarComponent : undefined,
37
32
  actions: {
38
33
  getToolbarItem: function getToolbarItem(_ref3) {
@@ -87,11 +87,11 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
87
87
  };
88
88
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
89
89
  sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
90
- commands: {
90
+ actions: {
91
91
  registerComponent: ({ name, component, }: {
92
92
  name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
93
93
  component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
94
- }) => import("@atlaskit/editor-common/types").EditorCommand;
94
+ }) => void;
95
95
  };
96
96
  }, undefined>>];
97
97
  actions: {
@@ -175,11 +175,11 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
175
175
  };
176
176
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
177
177
  sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
178
- commands: {
178
+ actions: {
179
179
  registerComponent: ({ name, component, }: {
180
180
  name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
181
181
  component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
182
- }) => import("@atlaskit/editor-common/types").EditorCommand;
182
+ }) => void;
183
183
  };
184
184
  }, undefined>>];
185
185
  actions: {
@@ -70,11 +70,11 @@ declare const _default: import("memoize-one").MemoizedFn<(participant: CollabPar
70
70
  };
71
71
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
72
72
  sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
73
- commands: {
73
+ actions: {
74
74
  registerComponent: ({ name, component, }: {
75
75
  name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
76
76
  component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
77
- }) => import("@atlaskit/editor-common/types").EditorCommand;
77
+ }) => void;
78
78
  };
79
79
  }, undefined>>];
80
80
  actions: {
@@ -100,11 +100,11 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
100
100
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>>,
101
101
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
102
102
  sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
103
- commands: {
103
+ actions: {
104
104
  registerComponent: ({ name, component, }: {
105
105
  name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
106
106
  component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
107
- }) => import("@atlaskit/editor-common/types").EditorCommand;
107
+ }) => void;
108
108
  };
109
109
  }, undefined>>
110
110
  ];
@@ -202,11 +202,11 @@ declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
202
202
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>>,
203
203
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
204
204
  sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
205
- commands: {
205
+ actions: {
206
206
  registerComponent: ({ name, component, }: {
207
207
  name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
208
208
  component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
209
- }) => import("@atlaskit/editor-common/types").EditorCommand;
209
+ }) => void;
210
210
  };
211
211
  }, undefined>>
212
212
  ];
@@ -83,11 +83,11 @@ declare const _default: import("memoize-one").MemoizedFn<(participant: CollabPar
83
83
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>>,
84
84
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"primaryToolbar", {
85
85
  sharedState: import("@atlaskit/editor-plugin-primary-toolbar").PrimaryToolbarPluginState | undefined;
86
- commands: {
86
+ actions: {
87
87
  registerComponent: ({ name, component, }: {
88
88
  name: import("@atlaskit/editor-plugin-primary-toolbar").ToolbarElementNames;
89
89
  component: import("@atlaskit/editor-common/types").ToolbarUIComponentFactory;
90
- }) => import("@atlaskit/editor-common/types").EditorCommand;
90
+ }) => void;
91
91
  };
92
92
  }, undefined>>
93
93
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-avatar-group",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Avatar Group plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,14 +38,14 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@atlaskit/avatar-group": "^9.9.0",
41
- "@atlaskit/editor-common": "^86.8.0",
41
+ "@atlaskit/editor-common": "^87.3.0",
42
42
  "@atlaskit/editor-plugin-analytics": "^1.6.0",
43
43
  "@atlaskit/editor-plugin-collab-edit": "^1.11.0",
44
44
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
45
- "@atlaskit/editor-plugin-primary-toolbar": "^1.3.0",
45
+ "@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
46
46
  "@atlaskit/editor-prosemirror": "5.0.1",
47
47
  "@atlaskit/editor-shared-styles": "^2.13.0",
48
- "@atlaskit/icon": "^22.7.0",
48
+ "@atlaskit/icon": "^22.9.0",
49
49
  "@atlaskit/theme": "^12.11.0",
50
50
  "@atlaskit/tokens": "^1.56.0",
51
51
  "@babel/runtime": "^7.0.0",