@atlaskit/editor-plugin-highlight 3.1.0 → 3.1.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/editor-plugin-highlight
2
2
 
3
+ ## 3.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`bf3ab0c552ba7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf3ab0c552ba7) -
14
+ [ux] ED-29000 Add keyboard navigation to colour palette and minor UI fixes
15
+ - [`a2cd8c46a3e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a2cd8c46a3e94) -
16
+ EDITOR-1442 Bump adf-schema
17
+ - [`ec65234ef4b55`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ec65234ef4b55) -
18
+ Tidy up FG platform_editor_usesharedpluginstatewithselector for highlight and hyperlink
19
+ - Updated dependencies
20
+
3
21
  ## 3.1.0
4
22
 
5
23
  ### Minor Changes
@@ -45,26 +45,15 @@ var selector = function selector(states) {
45
45
  disabled: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.disabled
46
46
  };
47
47
  };
48
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
49
- return (0, _hooks.useSharedPluginStateWithSelector)(api, ['highlight'], selector);
50
- }, function (api) {
51
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['highlight']),
52
- highlightState = _useSharedPluginState.highlightState;
53
- return {
54
- isPaletteOpen: highlightState === null || highlightState === void 0 ? void 0 : highlightState.isPaletteOpen,
55
- activeColor: highlightState === null || highlightState === void 0 ? void 0 : highlightState.activeColor,
56
- disabled: highlightState === null || highlightState === void 0 ? void 0 : highlightState.disabled
57
- };
58
- });
59
48
  var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref) {
60
49
  var pluginInjectionApi = _ref.pluginInjectionApi,
61
50
  formatMessage = _ref.intl.formatMessage,
62
51
  editorView = _ref.editorView;
63
52
  var toolbarItemRef = (0, _react.useRef)(null);
64
- var _useSharedState = useSharedState(pluginInjectionApi),
65
- activeColor = _useSharedState.activeColor,
66
- disabled = _useSharedState.disabled,
67
- isPaletteOpen = _useSharedState.isPaletteOpen;
53
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['highlight'], selector),
54
+ activeColor = _useSharedPluginState.activeColor,
55
+ disabled = _useSharedPluginState.disabled,
56
+ isPaletteOpen = _useSharedPluginState.isPaletteOpen;
68
57
  var setDropdownOpen = function setDropdownOpen(isOpen) {
69
58
  var _pluginInjectionApi$a;
70
59
  if (!disabled && editorView && pluginInjectionApi) {
@@ -1,6 +1,6 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
3
- ._zulpu2gc{gap:var(--ds-space-100,8px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
2
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
+ ._zulp12x7{gap:var(--ds-space-075,6px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
4
4
  ._195gv77o{margin-inline:var(--ds-space-025,2px)}
5
5
  ._1dqonqa1{border-style:solid}
6
6
  ._1h6dmuej{border-color:var(--ds-border,#091e4224)}
@@ -28,8 +28,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
28
28
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
29
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30
30
  var styles = {
31
- container: "_zulpu2gc _19pkpxbi",
32
- removeHighlightButton: "_2rkoglpi _195gv77o _189ee4h9 _1dqonqa1 _1h6dmuej",
31
+ container: "_zulp12x7 _19pkpxbi",
32
+ removeHighlightButton: "_2rko12b0 _195gv77o _189ee4h9 _1dqonqa1 _1h6dmuej",
33
33
  icon: "_1e0c1o8l _18u01n1a"
34
34
  };
35
35
  var TextColorIconDecorator = function TextColorIconDecorator(_ref) {
@@ -39,17 +39,6 @@ var selector = function selector(states) {
39
39
  activeColor: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.activeColor
40
40
  };
41
41
  };
42
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
43
- return (0, _hooks.useSharedPluginStateWithSelector)(api, ['highlight'], selector);
44
- }, function (api) {
45
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['highlight']),
46
- highlightState = _useSharedPluginState.highlightState;
47
- return {
48
- isPaletteOpen: highlightState === null || highlightState === void 0 ? void 0 : highlightState.isPaletteOpen,
49
- highlightDisabled: highlightState === null || highlightState === void 0 ? void 0 : highlightState.disabled,
50
- activeColor: highlightState === null || highlightState === void 0 ? void 0 : highlightState.activeColor
51
- };
52
- });
53
42
  var PrimaryToolbarHighlightColor = function PrimaryToolbarHighlightColor(_ref) {
54
43
  var popupsMountPoint = _ref.popupsMountPoint,
55
44
  popupsBoundariesElement = _ref.popupsBoundariesElement,
@@ -60,10 +49,10 @@ var PrimaryToolbarHighlightColor = function PrimaryToolbarHighlightColor(_ref) {
60
49
  formatMessage = _ref.intl.formatMessage,
61
50
  editorView = _ref.editorView;
62
51
  var toolbarItemRef = (0, _react.useRef)(null);
63
- var _useSharedState = useSharedState(pluginInjectionApi),
64
- isPaletteOpen = _useSharedState.isPaletteOpen,
65
- highlightDisabled = _useSharedState.highlightDisabled,
66
- activeColor = _useSharedState.activeColor;
52
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['highlight'], selector),
53
+ isPaletteOpen = _useSharedPluginState.isPaletteOpen,
54
+ highlightDisabled = _useSharedPluginState.highlightDisabled,
55
+ activeColor = _useSharedPluginState.activeColor;
67
56
  var setIsDropdownOpen = function setIsDropdownOpen(isOpen) {
68
57
  if (!highlightDisabled) {
69
58
  var state = editorView.state,
@@ -8,7 +8,7 @@ import { useRef } 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, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
+ import { 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';
@@ -37,18 +37,6 @@ const selector = states => {
37
37
  disabled: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.disabled
38
38
  };
39
39
  };
40
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
41
- return useSharedPluginStateWithSelector(api, ['highlight'], selector);
42
- }, api => {
43
- const {
44
- highlightState
45
- } = useSharedPluginState(api, ['highlight']);
46
- return {
47
- isPaletteOpen: highlightState === null || highlightState === void 0 ? void 0 : highlightState.isPaletteOpen,
48
- activeColor: highlightState === null || highlightState === void 0 ? void 0 : highlightState.activeColor,
49
- disabled: highlightState === null || highlightState === void 0 ? void 0 : highlightState.disabled
50
- };
51
- });
52
40
  const FloatingToolbarHighlightColor = ({
53
41
  pluginInjectionApi,
54
42
  intl: {
@@ -61,7 +49,7 @@ const FloatingToolbarHighlightColor = ({
61
49
  activeColor,
62
50
  disabled,
63
51
  isPaletteOpen
64
- } = useSharedState(pluginInjectionApi);
52
+ } = useSharedPluginStateWithSelector(pluginInjectionApi, ['highlight'], selector);
65
53
  const setDropdownOpen = isOpen => {
66
54
  var _pluginInjectionApi$a;
67
55
  if (!disabled && editorView && pluginInjectionApi) {
@@ -1,6 +1,6 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
3
- ._zulpu2gc{gap:var(--ds-space-100,8px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
2
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
+ ._zulp12x7{gap:var(--ds-space-075,6px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
4
4
  ._195gv77o{margin-inline:var(--ds-space-025,2px)}
5
5
  ._1dqonqa1{border-style:solid}
6
6
  ._1h6dmuej{border-color:var(--ds-border,#091e4224)}
@@ -16,8 +16,8 @@ import Icon from '@atlaskit/icon/core/text-style';
16
16
  import { Stack, Text, Box } from '@atlaskit/primitives/compiled';
17
17
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
18
  const styles = {
19
- container: "_zulpu2gc _19pkpxbi",
20
- removeHighlightButton: "_2rkoglpi _195gv77o _189ee4h9 _1dqonqa1 _1h6dmuej",
19
+ container: "_zulp12x7 _19pkpxbi",
20
+ removeHighlightButton: "_2rko12b0 _195gv77o _189ee4h9 _1dqonqa1 _1h6dmuej",
21
21
  icon: "_1e0c1o8l _18u01n1a"
22
22
  };
23
23
  const TextColorIconDecorator = ({
@@ -8,7 +8,7 @@ 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, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
+ import { 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';
@@ -31,18 +31,6 @@ const selector = states => {
31
31
  activeColor: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.activeColor
32
32
  };
33
33
  };
34
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
35
- return useSharedPluginStateWithSelector(api, ['highlight'], selector);
36
- }, api => {
37
- const {
38
- highlightState
39
- } = useSharedPluginState(api, ['highlight']);
40
- return {
41
- isPaletteOpen: highlightState === null || highlightState === void 0 ? void 0 : highlightState.isPaletteOpen,
42
- highlightDisabled: highlightState === null || highlightState === void 0 ? void 0 : highlightState.disabled,
43
- activeColor: highlightState === null || highlightState === void 0 ? void 0 : highlightState.activeColor
44
- };
45
- });
46
34
  const PrimaryToolbarHighlightColor = ({
47
35
  popupsMountPoint,
48
36
  popupsBoundariesElement,
@@ -60,7 +48,7 @@ const PrimaryToolbarHighlightColor = ({
60
48
  isPaletteOpen,
61
49
  highlightDisabled,
62
50
  activeColor
63
- } = useSharedState(pluginInjectionApi);
51
+ } = useSharedPluginStateWithSelector(pluginInjectionApi, ['highlight'], selector);
64
52
  const setIsDropdownOpen = isOpen => {
65
53
  if (!highlightDisabled) {
66
54
  const {
@@ -8,7 +8,7 @@ import { useRef } 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, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
+ import { 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';
@@ -37,26 +37,15 @@ var selector = function selector(states) {
37
37
  disabled: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.disabled
38
38
  };
39
39
  };
40
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
41
- return useSharedPluginStateWithSelector(api, ['highlight'], selector);
42
- }, function (api) {
43
- var _useSharedPluginState = useSharedPluginState(api, ['highlight']),
44
- highlightState = _useSharedPluginState.highlightState;
45
- return {
46
- isPaletteOpen: highlightState === null || highlightState === void 0 ? void 0 : highlightState.isPaletteOpen,
47
- activeColor: highlightState === null || highlightState === void 0 ? void 0 : highlightState.activeColor,
48
- disabled: highlightState === null || highlightState === void 0 ? void 0 : highlightState.disabled
49
- };
50
- });
51
40
  var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref) {
52
41
  var pluginInjectionApi = _ref.pluginInjectionApi,
53
42
  formatMessage = _ref.intl.formatMessage,
54
43
  editorView = _ref.editorView;
55
44
  var toolbarItemRef = useRef(null);
56
- var _useSharedState = useSharedState(pluginInjectionApi),
57
- activeColor = _useSharedState.activeColor,
58
- disabled = _useSharedState.disabled,
59
- isPaletteOpen = _useSharedState.isPaletteOpen;
45
+ var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, ['highlight'], selector),
46
+ activeColor = _useSharedPluginState.activeColor,
47
+ disabled = _useSharedPluginState.disabled,
48
+ isPaletteOpen = _useSharedPluginState.isPaletteOpen;
60
49
  var setDropdownOpen = function setDropdownOpen(isOpen) {
61
50
  var _pluginInjectionApi$a;
62
51
  if (!disabled && editorView && pluginInjectionApi) {
@@ -1,6 +1,6 @@
1
1
 
2
- ._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
3
- ._zulpu2gc{gap:var(--ds-space-100,8px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
2
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
+ ._zulp12x7{gap:var(--ds-space-075,6px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
4
4
  ._195gv77o{margin-inline:var(--ds-space-025,2px)}
5
5
  ._1dqonqa1{border-style:solid}
6
6
  ._1h6dmuej{border-color:var(--ds-border,#091e4224)}
@@ -19,8 +19,8 @@ import Icon from '@atlaskit/icon/core/text-style';
19
19
  import { Stack, Text, Box } from '@atlaskit/primitives/compiled';
20
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
21
  var styles = {
22
- container: "_zulpu2gc _19pkpxbi",
23
- removeHighlightButton: "_2rkoglpi _195gv77o _189ee4h9 _1dqonqa1 _1h6dmuej",
22
+ container: "_zulp12x7 _19pkpxbi",
23
+ removeHighlightButton: "_2rko12b0 _195gv77o _189ee4h9 _1dqonqa1 _1h6dmuej",
24
24
  icon: "_1e0c1o8l _18u01n1a"
25
25
  };
26
26
  var TextColorIconDecorator = function TextColorIconDecorator(_ref) {
@@ -8,7 +8,7 @@ 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, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
+ import { 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';
@@ -31,17 +31,6 @@ var selector = function selector(states) {
31
31
  activeColor: (_states$highlightStat3 = states.highlightState) === null || _states$highlightStat3 === void 0 ? void 0 : _states$highlightStat3.activeColor
32
32
  };
33
33
  };
34
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
35
- return useSharedPluginStateWithSelector(api, ['highlight'], selector);
36
- }, function (api) {
37
- var _useSharedPluginState = useSharedPluginState(api, ['highlight']),
38
- highlightState = _useSharedPluginState.highlightState;
39
- return {
40
- isPaletteOpen: highlightState === null || highlightState === void 0 ? void 0 : highlightState.isPaletteOpen,
41
- highlightDisabled: highlightState === null || highlightState === void 0 ? void 0 : highlightState.disabled,
42
- activeColor: highlightState === null || highlightState === void 0 ? void 0 : highlightState.activeColor
43
- };
44
- });
45
34
  var PrimaryToolbarHighlightColor = function PrimaryToolbarHighlightColor(_ref) {
46
35
  var popupsMountPoint = _ref.popupsMountPoint,
47
36
  popupsBoundariesElement = _ref.popupsBoundariesElement,
@@ -52,10 +41,10 @@ var PrimaryToolbarHighlightColor = function PrimaryToolbarHighlightColor(_ref) {
52
41
  formatMessage = _ref.intl.formatMessage,
53
42
  editorView = _ref.editorView;
54
43
  var toolbarItemRef = useRef(null);
55
- var _useSharedState = useSharedState(pluginInjectionApi),
56
- isPaletteOpen = _useSharedState.isPaletteOpen,
57
- highlightDisabled = _useSharedState.highlightDisabled,
58
- activeColor = _useSharedState.activeColor;
44
+ var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, ['highlight'], selector),
45
+ isPaletteOpen = _useSharedPluginState.isPaletteOpen,
46
+ highlightDisabled = _useSharedPluginState.highlightDisabled,
47
+ activeColor = _useSharedPluginState.activeColor;
59
48
  var setIsDropdownOpen = function setIsDropdownOpen(isOpen) {
60
49
  if (!highlightDisabled) {
61
50
  var state = editorView.state,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-highlight",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Highlight plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "atlaskit:src": "src/index.ts",
34
34
  "dependencies": {
35
- "@atlaskit/adf-schema": "^50.2.2",
35
+ "@atlaskit/adf-schema": "^50.2.3",
36
36
  "@atlaskit/button": "^23.4.0",
37
37
  "@atlaskit/css": "^0.12.0",
38
38
  "@atlaskit/editor-palette": "^2.1.0",
@@ -44,18 +44,18 @@
44
44
  "@atlaskit/editor-prosemirror": "7.0.0",
45
45
  "@atlaskit/editor-shared-styles": "^3.6.0",
46
46
  "@atlaskit/editor-tables": "^2.9.0",
47
- "@atlaskit/editor-toolbar": "^0.4.0",
48
- "@atlaskit/editor-toolbar-model": "^0.1.0",
47
+ "@atlaskit/editor-toolbar": "^0.6.0",
48
+ "@atlaskit/editor-toolbar-model": "^0.2.0",
49
49
  "@atlaskit/icon": "^28.1.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
51
  "@atlaskit/primitives": "^14.12.0",
52
- "@atlaskit/tmp-editor-statsig": "^11.8.0",
52
+ "@atlaskit/tmp-editor-statsig": "^11.11.0",
53
53
  "@atlaskit/tokens": "^6.1.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1"
56
56
  },
57
57
  "peerDependencies": {
58
- "@atlaskit/editor-common": "^107.32.0",
58
+ "@atlaskit/editor-common": "^107.34.0",
59
59
  "react": "^18.2.0",
60
60
  "react-intl-next": "npm:react-intl@^5.18.1"
61
61
  },