@atlaskit/editor-plugin-panel 5.1.1 → 5.1.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 +15 -0
- package/dist/cjs/nodeviews/panel.js +10 -5
- package/dist/es2019/nodeviews/panel.js +10 -4
- package/dist/esm/nodeviews/panel.js +11 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 5.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 5.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#183109](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183109)
|
|
14
|
+
[`3fd4ff5c71ef7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3fd4ff5c71ef7) -
|
|
15
|
+
Migrate to useSharedPluginStateWithSelector
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 5.1.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -14,7 +14,6 @@ var _emoji = require("@atlaskit/editor-common/emoji");
|
|
|
14
14
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
15
15
|
var _icons = require("@atlaskit/editor-common/icons");
|
|
16
16
|
var _panel = require("@atlaskit/editor-common/panel");
|
|
17
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
18
17
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
19
18
|
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
20
19
|
var _lightbulbEditorHint = _interopRequireDefault(require("@atlaskit/icon/core/migration/lightbulb--editor-hint"));
|
|
@@ -32,13 +31,19 @@ var panelIcons = exports.panelIcons = {
|
|
|
32
31
|
};
|
|
33
32
|
/* eslint-enable @atlaskit/editor/no-re-export */
|
|
34
33
|
|
|
34
|
+
var selector = function selector(states) {
|
|
35
|
+
return {
|
|
36
|
+
emojiState: states.emojiState
|
|
37
|
+
};
|
|
38
|
+
};
|
|
35
39
|
var useEmojiProvider = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
36
|
-
var
|
|
37
|
-
return emojiProvider;
|
|
38
|
-
}, function (api) {
|
|
39
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['emoji']),
|
|
40
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['emoji'], selector),
|
|
40
41
|
emojiState = _useSharedPluginState.emojiState;
|
|
41
42
|
return emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider;
|
|
43
|
+
}, function (api) {
|
|
44
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['emoji']),
|
|
45
|
+
emojiState = _useSharedPluginState2.emojiState;
|
|
46
|
+
return emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider;
|
|
42
47
|
});
|
|
43
48
|
var PanelIcon = exports.PanelIcon = function PanelIcon(props) {
|
|
44
49
|
var allowCustomPanel = props.allowCustomPanel,
|
|
@@ -2,10 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import uuid from 'uuid/v4';
|
|
3
3
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
4
4
|
import { Emoji } from '@atlaskit/editor-common/emoji';
|
|
5
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
5
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
6
6
|
import { PanelErrorIcon, PanelInfoIcon, PanelNoteIcon, PanelSuccessIcon, PanelWarningIcon } from '@atlaskit/editor-common/icons';
|
|
7
7
|
import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
8
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
9
8
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
10
9
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
11
10
|
import LightbulbIcon from '@atlaskit/icon/core/migration/lightbulb--editor-hint';
|
|
@@ -24,9 +23,16 @@ export const panelIcons = {
|
|
|
24
23
|
};
|
|
25
24
|
/* eslint-enable @atlaskit/editor/no-re-export */
|
|
26
25
|
|
|
26
|
+
const selector = states => {
|
|
27
|
+
return {
|
|
28
|
+
emojiState: states.emojiState
|
|
29
|
+
};
|
|
30
|
+
};
|
|
27
31
|
const useEmojiProvider = sharedPluginStateHookMigratorFactory(api => {
|
|
28
|
-
const
|
|
29
|
-
|
|
32
|
+
const {
|
|
33
|
+
emojiState
|
|
34
|
+
} = useSharedPluginStateWithSelector(api, ['emoji'], selector);
|
|
35
|
+
return emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider;
|
|
30
36
|
}, api => {
|
|
31
37
|
const {
|
|
32
38
|
emojiState
|
|
@@ -4,10 +4,9 @@ import React from 'react';
|
|
|
4
4
|
import uuid from 'uuid/v4';
|
|
5
5
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
6
6
|
import { Emoji } from '@atlaskit/editor-common/emoji';
|
|
7
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
7
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
8
8
|
import { PanelErrorIcon, PanelInfoIcon, PanelNoteIcon, PanelSuccessIcon, PanelWarningIcon } from '@atlaskit/editor-common/icons';
|
|
9
9
|
import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
10
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
11
10
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
12
11
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
13
12
|
import LightbulbIcon from '@atlaskit/icon/core/migration/lightbulb--editor-hint';
|
|
@@ -26,13 +25,19 @@ export var panelIcons = {
|
|
|
26
25
|
};
|
|
27
26
|
/* eslint-enable @atlaskit/editor/no-re-export */
|
|
28
27
|
|
|
28
|
+
var selector = function selector(states) {
|
|
29
|
+
return {
|
|
30
|
+
emojiState: states.emojiState
|
|
31
|
+
};
|
|
32
|
+
};
|
|
29
33
|
var useEmojiProvider = sharedPluginStateHookMigratorFactory(function (api) {
|
|
30
|
-
var
|
|
31
|
-
return emojiProvider;
|
|
32
|
-
}, function (api) {
|
|
33
|
-
var _useSharedPluginState = useSharedPluginState(api, ['emoji']),
|
|
34
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['emoji'], selector),
|
|
34
35
|
emojiState = _useSharedPluginState.emojiState;
|
|
35
36
|
return emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider;
|
|
37
|
+
}, function (api) {
|
|
38
|
+
var _useSharedPluginState2 = useSharedPluginState(api, ['emoji']),
|
|
39
|
+
emojiState = _useSharedPluginState2.emojiState;
|
|
40
|
+
return emojiState === null || emojiState === void 0 ? void 0 : emojiState.emojiProvider;
|
|
36
41
|
});
|
|
37
42
|
export var PanelIcon = function PanelIcon(props) {
|
|
38
43
|
var allowCustomPanel = props.allowCustomPanel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@atlaskit/emoji": "^69.3.0",
|
|
41
41
|
"@atlaskit/icon": "^27.3.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
|
-
"@atlaskit/theme": "^
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
43
|
+
"@atlaskit/theme": "^19.0.0",
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^9.1.0",
|
|
45
45
|
"@atlaskit/tokens": "^5.4.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"uuid": "^3.1.0"
|