@atlaskit/editor-plugin-avatar-group 3.1.4 → 3.1.6
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,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-avatar-group
|
|
2
2
|
|
|
3
|
+
## 3.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.1.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#151999](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/151999)
|
|
14
|
+
[`daf7c638efb95`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/daf7c638efb95) -
|
|
15
|
+
Refactor to use sharedPluginStateHookMigratorFactory
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 3.1.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -13,6 +13,26 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
|
|
|
13
13
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
14
|
var _avatars = require("./avatars");
|
|
15
15
|
var _inviteToEdit = require("./invite-to-edit");
|
|
16
|
+
var useAvatarsWithPluginState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
17
|
+
var sessionId = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'collabEdit.sessionId');
|
|
18
|
+
var activeParticipants = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'collabEdit.activeParticipants');
|
|
19
|
+
var initialised = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'collabEdit.initialised');
|
|
20
|
+
return {
|
|
21
|
+
sessionId: sessionId,
|
|
22
|
+
activeParticipants: activeParticipants,
|
|
23
|
+
isInitialised: !!initialised,
|
|
24
|
+
collabEditState: undefined
|
|
25
|
+
};
|
|
26
|
+
}, function (api) {
|
|
27
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['collabEdit']),
|
|
28
|
+
collabEditState = _useSharedPluginState.collabEditState;
|
|
29
|
+
return {
|
|
30
|
+
activeParticipants: collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.activeParticipants,
|
|
31
|
+
sessionId: collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.sessionId,
|
|
32
|
+
isInitialised: !!(collabEditState !== null && collabEditState !== void 0 && collabEditState.initialised),
|
|
33
|
+
collabEditState: collabEditState
|
|
34
|
+
};
|
|
35
|
+
});
|
|
16
36
|
var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
17
37
|
var title = props.intl.formatMessage(_messages.default.inviteToEditButtonTitle);
|
|
18
38
|
var selected = props.isInviteToEditButtonSelected,
|
|
@@ -22,29 +42,15 @@ var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
|
22
42
|
featureFlags = props.featureFlags,
|
|
23
43
|
editorAnalyticsAPI = props.editorAnalyticsAPI,
|
|
24
44
|
editorAPI = props.editorAPI;
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// sessionId
|
|
31
|
-
var sessionIdSelector = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'collabEdit.sessionId', {
|
|
32
|
-
disabled: (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', false)
|
|
33
|
-
});
|
|
34
|
-
var sessionId = (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', true) ? sessionIdSelector : collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.sessionId;
|
|
35
|
-
|
|
36
|
-
// activeParticipants
|
|
37
|
-
var activeParticipantsSelector = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'collabEdit.activeParticipants', {
|
|
38
|
-
disabled: (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', false)
|
|
39
|
-
});
|
|
40
|
-
var activeParticipants = (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', true) ? activeParticipantsSelector : collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.activeParticipants;
|
|
41
|
-
var initialised = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'collabEdit.initialised', {
|
|
42
|
-
disabled: (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', false)
|
|
43
|
-
});
|
|
45
|
+
var _useAvatarsWithPlugin = useAvatarsWithPluginState(editorAPI),
|
|
46
|
+
sessionId = _useAvatarsWithPlugin.sessionId,
|
|
47
|
+
activeParticipants = _useAvatarsWithPlugin.activeParticipants,
|
|
48
|
+
isInitialised = _useAvatarsWithPlugin.isInitialised,
|
|
49
|
+
collabEditState = _useAvatarsWithPlugin.collabEditState;
|
|
44
50
|
if (!collabEditState && (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', false)) {
|
|
45
51
|
return null;
|
|
46
52
|
}
|
|
47
|
-
if (!
|
|
53
|
+
if (!isInitialised && (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', true)) {
|
|
48
54
|
return null;
|
|
49
55
|
}
|
|
50
56
|
return /*#__PURE__*/_react.default.createElement(_avatars.Avatars, {
|
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import messages from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
6
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
7
|
import { Avatars } from './avatars';
|
|
8
8
|
import { InviteToEditButton } from './invite-to-edit';
|
|
9
|
+
const useAvatarsWithPluginState = sharedPluginStateHookMigratorFactory(api => {
|
|
10
|
+
const sessionId = useSharedPluginStateSelector(api, 'collabEdit.sessionId');
|
|
11
|
+
const activeParticipants = useSharedPluginStateSelector(api, 'collabEdit.activeParticipants');
|
|
12
|
+
const initialised = useSharedPluginStateSelector(api, 'collabEdit.initialised');
|
|
13
|
+
return {
|
|
14
|
+
sessionId,
|
|
15
|
+
activeParticipants,
|
|
16
|
+
isInitialised: !!initialised,
|
|
17
|
+
collabEditState: undefined
|
|
18
|
+
};
|
|
19
|
+
}, api => {
|
|
20
|
+
const {
|
|
21
|
+
collabEditState
|
|
22
|
+
} = useSharedPluginState(api, ['collabEdit']);
|
|
23
|
+
return {
|
|
24
|
+
activeParticipants: collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.activeParticipants,
|
|
25
|
+
sessionId: collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.sessionId,
|
|
26
|
+
isInitialised: !!(collabEditState !== null && collabEditState !== void 0 && collabEditState.initialised),
|
|
27
|
+
collabEditState
|
|
28
|
+
};
|
|
29
|
+
});
|
|
9
30
|
const AvatarsWithPluginState = props => {
|
|
10
31
|
const title = props.intl.formatMessage(messages.inviteToEditButtonTitle);
|
|
11
32
|
const {
|
|
@@ -18,29 +39,15 @@ const AvatarsWithPluginState = props => {
|
|
|
18
39
|
editorAPI
|
|
19
40
|
} = props;
|
|
20
41
|
const {
|
|
42
|
+
sessionId,
|
|
43
|
+
activeParticipants,
|
|
44
|
+
isInitialised,
|
|
21
45
|
collabEditState
|
|
22
|
-
} =
|
|
23
|
-
disabled: editorExperiment('platform_editor_usesharedpluginstateselector', true)
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// sessionId
|
|
27
|
-
const sessionIdSelector = useSharedPluginStateSelector(editorAPI, 'collabEdit.sessionId', {
|
|
28
|
-
disabled: editorExperiment('platform_editor_usesharedpluginstateselector', false)
|
|
29
|
-
});
|
|
30
|
-
const sessionId = editorExperiment('platform_editor_usesharedpluginstateselector', true) ? sessionIdSelector : collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.sessionId;
|
|
31
|
-
|
|
32
|
-
// activeParticipants
|
|
33
|
-
const activeParticipantsSelector = useSharedPluginStateSelector(editorAPI, 'collabEdit.activeParticipants', {
|
|
34
|
-
disabled: editorExperiment('platform_editor_usesharedpluginstateselector', false)
|
|
35
|
-
});
|
|
36
|
-
const activeParticipants = editorExperiment('platform_editor_usesharedpluginstateselector', true) ? activeParticipantsSelector : collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.activeParticipants;
|
|
37
|
-
const initialised = useSharedPluginStateSelector(editorAPI, 'collabEdit.initialised', {
|
|
38
|
-
disabled: editorExperiment('platform_editor_usesharedpluginstateselector', false)
|
|
39
|
-
});
|
|
46
|
+
} = useAvatarsWithPluginState(editorAPI);
|
|
40
47
|
if (!collabEditState && editorExperiment('platform_editor_usesharedpluginstateselector', false)) {
|
|
41
48
|
return null;
|
|
42
49
|
}
|
|
43
|
-
if (!
|
|
50
|
+
if (!isInitialised && editorExperiment('platform_editor_usesharedpluginstateselector', true)) {
|
|
44
51
|
return null;
|
|
45
52
|
}
|
|
46
53
|
return /*#__PURE__*/React.createElement(Avatars, {
|
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import messages from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
6
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
7
|
import { Avatars } from './avatars';
|
|
8
8
|
import { InviteToEditButton } from './invite-to-edit';
|
|
9
|
+
var useAvatarsWithPluginState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
10
|
+
var sessionId = useSharedPluginStateSelector(api, 'collabEdit.sessionId');
|
|
11
|
+
var activeParticipants = useSharedPluginStateSelector(api, 'collabEdit.activeParticipants');
|
|
12
|
+
var initialised = useSharedPluginStateSelector(api, 'collabEdit.initialised');
|
|
13
|
+
return {
|
|
14
|
+
sessionId: sessionId,
|
|
15
|
+
activeParticipants: activeParticipants,
|
|
16
|
+
isInitialised: !!initialised,
|
|
17
|
+
collabEditState: undefined
|
|
18
|
+
};
|
|
19
|
+
}, function (api) {
|
|
20
|
+
var _useSharedPluginState = useSharedPluginState(api, ['collabEdit']),
|
|
21
|
+
collabEditState = _useSharedPluginState.collabEditState;
|
|
22
|
+
return {
|
|
23
|
+
activeParticipants: collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.activeParticipants,
|
|
24
|
+
sessionId: collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.sessionId,
|
|
25
|
+
isInitialised: !!(collabEditState !== null && collabEditState !== void 0 && collabEditState.initialised),
|
|
26
|
+
collabEditState: collabEditState
|
|
27
|
+
};
|
|
28
|
+
});
|
|
9
29
|
var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
10
30
|
var title = props.intl.formatMessage(messages.inviteToEditButtonTitle);
|
|
11
31
|
var selected = props.isInviteToEditButtonSelected,
|
|
@@ -15,29 +35,15 @@ var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
|
15
35
|
featureFlags = props.featureFlags,
|
|
16
36
|
editorAnalyticsAPI = props.editorAnalyticsAPI,
|
|
17
37
|
editorAPI = props.editorAPI;
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// sessionId
|
|
24
|
-
var sessionIdSelector = useSharedPluginStateSelector(editorAPI, 'collabEdit.sessionId', {
|
|
25
|
-
disabled: editorExperiment('platform_editor_usesharedpluginstateselector', false)
|
|
26
|
-
});
|
|
27
|
-
var sessionId = editorExperiment('platform_editor_usesharedpluginstateselector', true) ? sessionIdSelector : collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.sessionId;
|
|
28
|
-
|
|
29
|
-
// activeParticipants
|
|
30
|
-
var activeParticipantsSelector = useSharedPluginStateSelector(editorAPI, 'collabEdit.activeParticipants', {
|
|
31
|
-
disabled: editorExperiment('platform_editor_usesharedpluginstateselector', false)
|
|
32
|
-
});
|
|
33
|
-
var activeParticipants = editorExperiment('platform_editor_usesharedpluginstateselector', true) ? activeParticipantsSelector : collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.activeParticipants;
|
|
34
|
-
var initialised = useSharedPluginStateSelector(editorAPI, 'collabEdit.initialised', {
|
|
35
|
-
disabled: editorExperiment('platform_editor_usesharedpluginstateselector', false)
|
|
36
|
-
});
|
|
38
|
+
var _useAvatarsWithPlugin = useAvatarsWithPluginState(editorAPI),
|
|
39
|
+
sessionId = _useAvatarsWithPlugin.sessionId,
|
|
40
|
+
activeParticipants = _useAvatarsWithPlugin.activeParticipants,
|
|
41
|
+
isInitialised = _useAvatarsWithPlugin.isInitialised,
|
|
42
|
+
collabEditState = _useAvatarsWithPlugin.collabEditState;
|
|
37
43
|
if (!collabEditState && editorExperiment('platform_editor_usesharedpluginstateselector', false)) {
|
|
38
44
|
return null;
|
|
39
45
|
}
|
|
40
|
-
if (!
|
|
46
|
+
if (!isInitialised && editorExperiment('platform_editor_usesharedpluginstateselector', true)) {
|
|
41
47
|
return null;
|
|
42
48
|
}
|
|
43
49
|
return /*#__PURE__*/React.createElement(Avatars, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-avatar-group",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"description": "Avatar Group plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/avatar-group": "^12.0.0",
|
|
40
|
-
"@atlaskit/editor-common": "^
|
|
40
|
+
"@atlaskit/editor-common": "^105.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
42
42
|
"@atlaskit/editor-plugin-collab-edit": "^3.6.0",
|
|
43
43
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|