@atlaskit/editor-plugin-highlight 3.0.0 → 3.0.2
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 +14 -0
- package/dist/cjs/ui/FloatingToolbarHighlightColor.js +8 -8
- package/dist/cjs/ui/PrimaryToolbarHighlightColor.js +8 -8
- package/dist/es2019/ui/FloatingToolbarHighlightColor.js +9 -9
- package/dist/es2019/ui/PrimaryToolbarHighlightColor.js +9 -9
- package/dist/esm/ui/FloatingToolbarHighlightColor.js +9 -9
- package/dist/esm/ui/PrimaryToolbarHighlightColor.js +9 -9
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-highlight
|
|
2
2
|
|
|
3
|
+
## 3.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#182839](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/182839)
|
|
8
|
+
[`81f1c3383bdab`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81f1c3383bdab) -
|
|
9
|
+
refactor: use useSharedPluginStateWithSelector instead of useSharedPluginStateSelector
|
|
10
|
+
|
|
11
|
+
## 3.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 3.0.0
|
|
4
18
|
|
|
5
19
|
### Major Changes
|
|
@@ -16,7 +16,6 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
16
16
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
17
17
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
18
18
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
19
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
20
19
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
21
20
|
var _highlight = _interopRequireDefault(require("@atlaskit/icon/core/highlight"));
|
|
22
21
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
|
|
@@ -39,15 +38,16 @@ var expandIconContainerHighlightStyle = (0, _react2.css)({
|
|
|
39
38
|
var highlightIconContainerStyle = (0, _react2.css)({
|
|
40
39
|
marginTop: "var(--ds-space-negative-050, -4px)"
|
|
41
40
|
});
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var activeColor = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'highlight.activeColor');
|
|
45
|
-
var disabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'highlight.disabled');
|
|
41
|
+
var selector = function selector(states) {
|
|
42
|
+
var _states$highlightStat, _states$highlightStat2, _states$highlightStat3;
|
|
46
43
|
return {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
isPaletteOpen: (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.isPaletteOpen,
|
|
45
|
+
activeColor: (_states$highlightStat2 = states.highlightState) === null || _states$highlightStat2 === void 0 ? void 0 : _states$highlightStat2.activeColor,
|
|
46
|
+
disabled: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.disabled
|
|
50
47
|
};
|
|
48
|
+
};
|
|
49
|
+
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
50
|
+
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['highlight'], selector);
|
|
51
51
|
}, function (api) {
|
|
52
52
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['highlight']),
|
|
53
53
|
highlightState = _useSharedPluginState.highlightState;
|
|
@@ -15,7 +15,6 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
15
15
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
16
16
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
17
17
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
18
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
19
18
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
20
19
|
var _highlight = _interopRequireDefault(require("@atlaskit/icon/core/highlight"));
|
|
21
20
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
|
|
@@ -32,15 +31,16 @@ var _useDropdownEvents2 = require("./shared/useDropdownEvents");
|
|
|
32
31
|
|
|
33
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
34
33
|
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var highlightDisabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'highlight.disabled');
|
|
38
|
-
var activeColor = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'highlight.activeColor');
|
|
34
|
+
var selector = function selector(states) {
|
|
35
|
+
var _states$highlightStat, _states$highlightStat2, _states$highlightStat3;
|
|
39
36
|
return {
|
|
40
|
-
isPaletteOpen: isPaletteOpen,
|
|
41
|
-
highlightDisabled:
|
|
42
|
-
activeColor: activeColor
|
|
37
|
+
isPaletteOpen: (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.isPaletteOpen,
|
|
38
|
+
highlightDisabled: (_states$highlightStat2 = states.highlightState) === null || _states$highlightStat2 === void 0 ? void 0 : _states$highlightStat2.disabled,
|
|
39
|
+
activeColor: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.activeColor
|
|
43
40
|
};
|
|
41
|
+
};
|
|
42
|
+
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
43
|
+
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['highlight'], selector);
|
|
44
44
|
}, function (api) {
|
|
45
45
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['highlight']),
|
|
46
46
|
highlightState = _useSharedPluginState.highlightState;
|
|
@@ -8,13 +8,12 @@ import { useRef, useState } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
12
12
|
import { DynamicStrokeIconDecoration } from '@atlaskit/editor-common/icons';
|
|
13
13
|
import { toggleHighlightPalette, tooltip, getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
14
14
|
import { highlightMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
15
|
import { disableBlueBorderStyles, expandIconContainerStyle, triggerWrapperStylesWithPadding } from '@atlaskit/editor-common/styles';
|
|
16
16
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
17
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
18
17
|
import { hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
19
18
|
import HighlightIcon from '@atlaskit/icon/core/highlight';
|
|
20
19
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
@@ -30,15 +29,16 @@ const expandIconContainerHighlightStyle = css({
|
|
|
30
29
|
const highlightIconContainerStyle = css({
|
|
31
30
|
marginTop: "var(--ds-space-negative-050, -4px)"
|
|
32
31
|
});
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const activeColor = useSharedPluginStateSelector(api, 'highlight.activeColor');
|
|
36
|
-
const disabled = useSharedPluginStateSelector(api, 'highlight.disabled');
|
|
32
|
+
const selector = states => {
|
|
33
|
+
var _states$highlightStat, _states$highlightStat2, _states$highlightStat3;
|
|
37
34
|
return {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
isPaletteOpen: (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.isPaletteOpen,
|
|
36
|
+
activeColor: (_states$highlightStat2 = states.highlightState) === null || _states$highlightStat2 === void 0 ? void 0 : _states$highlightStat2.activeColor,
|
|
37
|
+
disabled: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.disabled
|
|
41
38
|
};
|
|
39
|
+
};
|
|
40
|
+
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
41
|
+
return useSharedPluginStateWithSelector(api, ['highlight'], selector);
|
|
42
42
|
}, api => {
|
|
43
43
|
const {
|
|
44
44
|
highlightState
|
|
@@ -8,13 +8,12 @@ import { useRef } from 'react';
|
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
12
12
|
import { DynamicStrokeIconDecoration } from '@atlaskit/editor-common/icons';
|
|
13
13
|
import { getAriaKeyshortcuts, toggleHighlightPalette, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
14
14
|
import { highlightMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
15
|
import { disableBlueBorderStyles, expandIconContainerStyle, expandIconWrapperStyle, triggerWrapperStylesWithPadding } from '@atlaskit/editor-common/styles';
|
|
16
16
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
17
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
18
17
|
import { hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
19
18
|
import HighlightIcon from '@atlaskit/icon/core/highlight';
|
|
20
19
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
@@ -24,15 +23,16 @@ import { setPalette } from '../editor-commands/palette';
|
|
|
24
23
|
import { EditorHighlightIcon } from './shared/EditorHighlightIcon';
|
|
25
24
|
import { PaletteDropdown } from './shared/PaletteDropdown';
|
|
26
25
|
import { useDropdownEvents } from './shared/useDropdownEvents';
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const highlightDisabled = useSharedPluginStateSelector(api, 'highlight.disabled');
|
|
30
|
-
const activeColor = useSharedPluginStateSelector(api, 'highlight.activeColor');
|
|
26
|
+
const selector = states => {
|
|
27
|
+
var _states$highlightStat, _states$highlightStat2, _states$highlightStat3;
|
|
31
28
|
return {
|
|
32
|
-
isPaletteOpen,
|
|
33
|
-
highlightDisabled,
|
|
34
|
-
activeColor
|
|
29
|
+
isPaletteOpen: (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.isPaletteOpen,
|
|
30
|
+
highlightDisabled: (_states$highlightStat2 = states.highlightState) === null || _states$highlightStat2 === void 0 ? void 0 : _states$highlightStat2.disabled,
|
|
31
|
+
activeColor: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.activeColor
|
|
35
32
|
};
|
|
33
|
+
};
|
|
34
|
+
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
35
|
+
return useSharedPluginStateWithSelector(api, ['highlight'], selector);
|
|
36
36
|
}, api => {
|
|
37
37
|
const {
|
|
38
38
|
highlightState
|
|
@@ -9,13 +9,12 @@ import { useRef, useState } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { injectIntl } from 'react-intl-next';
|
|
11
11
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
12
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
13
13
|
import { DynamicStrokeIconDecoration } from '@atlaskit/editor-common/icons';
|
|
14
14
|
import { toggleHighlightPalette, tooltip, getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
15
15
|
import { highlightMessages as messages } from '@atlaskit/editor-common/messages';
|
|
16
16
|
import { disableBlueBorderStyles, expandIconContainerStyle, triggerWrapperStylesWithPadding } from '@atlaskit/editor-common/styles';
|
|
17
17
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
18
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
19
18
|
import { hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
20
19
|
import HighlightIcon from '@atlaskit/icon/core/highlight';
|
|
21
20
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
@@ -31,15 +30,16 @@ var expandIconContainerHighlightStyle = css({
|
|
|
31
30
|
var highlightIconContainerStyle = css({
|
|
32
31
|
marginTop: "var(--ds-space-negative-050, -4px)"
|
|
33
32
|
});
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var activeColor = useSharedPluginStateSelector(api, 'highlight.activeColor');
|
|
37
|
-
var disabled = useSharedPluginStateSelector(api, 'highlight.disabled');
|
|
33
|
+
var selector = function selector(states) {
|
|
34
|
+
var _states$highlightStat, _states$highlightStat2, _states$highlightStat3;
|
|
38
35
|
return {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
isPaletteOpen: (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.isPaletteOpen,
|
|
37
|
+
activeColor: (_states$highlightStat2 = states.highlightState) === null || _states$highlightStat2 === void 0 ? void 0 : _states$highlightStat2.activeColor,
|
|
38
|
+
disabled: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.disabled
|
|
42
39
|
};
|
|
40
|
+
};
|
|
41
|
+
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
42
|
+
return useSharedPluginStateWithSelector(api, ['highlight'], selector);
|
|
43
43
|
}, function (api) {
|
|
44
44
|
var _useSharedPluginState = useSharedPluginState(api, ['highlight']),
|
|
45
45
|
highlightState = _useSharedPluginState.highlightState;
|
|
@@ -8,13 +8,12 @@ import { useRef } from 'react';
|
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
10
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
12
12
|
import { DynamicStrokeIconDecoration } from '@atlaskit/editor-common/icons';
|
|
13
13
|
import { getAriaKeyshortcuts, toggleHighlightPalette, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
14
14
|
import { highlightMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
15
|
import { disableBlueBorderStyles, expandIconContainerStyle, expandIconWrapperStyle, triggerWrapperStylesWithPadding } from '@atlaskit/editor-common/styles';
|
|
16
16
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
17
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
18
17
|
import { hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
19
18
|
import HighlightIcon from '@atlaskit/icon/core/highlight';
|
|
20
19
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
@@ -24,15 +23,16 @@ import { setPalette } from '../editor-commands/palette';
|
|
|
24
23
|
import { EditorHighlightIcon } from './shared/EditorHighlightIcon';
|
|
25
24
|
import { PaletteDropdown } from './shared/PaletteDropdown';
|
|
26
25
|
import { useDropdownEvents } from './shared/useDropdownEvents';
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var highlightDisabled = useSharedPluginStateSelector(api, 'highlight.disabled');
|
|
30
|
-
var activeColor = useSharedPluginStateSelector(api, 'highlight.activeColor');
|
|
26
|
+
var selector = function selector(states) {
|
|
27
|
+
var _states$highlightStat, _states$highlightStat2, _states$highlightStat3;
|
|
31
28
|
return {
|
|
32
|
-
isPaletteOpen: isPaletteOpen,
|
|
33
|
-
highlightDisabled:
|
|
34
|
-
activeColor: activeColor
|
|
29
|
+
isPaletteOpen: (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.isPaletteOpen,
|
|
30
|
+
highlightDisabled: (_states$highlightStat2 = states.highlightState) === null || _states$highlightStat2 === void 0 ? void 0 : _states$highlightStat2.disabled,
|
|
31
|
+
activeColor: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.activeColor
|
|
35
32
|
};
|
|
33
|
+
};
|
|
34
|
+
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
35
|
+
return useSharedPluginStateWithSelector(api, ['highlight'], selector);
|
|
36
36
|
}, function (api) {
|
|
37
37
|
var _useSharedPluginState = useSharedPluginState(api, ['highlight']),
|
|
38
38
|
highlightState = _useSharedPluginState.highlightState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-highlight",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Highlight plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
46
46
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
47
|
-
"@atlaskit/icon": "^27.
|
|
47
|
+
"@atlaskit/icon": "^27.3.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/primitives": "^14.10.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^9.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^5.4.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@atlaskit/editor-common": "^107.
|
|
56
|
+
"@atlaskit/editor-common": "^107.7.0",
|
|
57
57
|
"react": "^18.2.0",
|
|
58
58
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
59
59
|
},
|