@atlaskit/editor-plugin-selection-marker 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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-selection-marker
2
2
 
3
+ ## 3.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#183158](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183158)
8
+ [`d6096ec5c8ad9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6096ec5c8ad9) -
9
+ Migrate to useSharedPluginStateWithSelector
10
+ - Updated dependencies
11
+
12
+ ## 3.0.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 3.0.0
4
19
 
5
20
  ### Major Changes
@@ -12,19 +12,27 @@ var _main = require("./pm-plugins/main");
12
12
  var _globalStyles = require("./ui/global-styles");
13
13
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
14
  var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
15
- var hasFocus = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'focus.hasFocus');
16
- var isOpen = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'typeAhead.isOpen');
17
- var editorDisabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorDisabled.editorDisabled');
15
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['focus', 'typeAhead', 'editorDisabled'], function (states) {
16
+ var _states$focusState, _states$typeAheadStat, _states$editorDisable;
17
+ return {
18
+ hasFocus: (_states$focusState = states.focusState) === null || _states$focusState === void 0 ? void 0 : _states$focusState.hasFocus,
19
+ isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
20
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
21
+ };
22
+ }),
23
+ hasFocus = _useSharedPluginState.hasFocus,
24
+ isOpen = _useSharedPluginState.isOpen,
25
+ editorDisabled = _useSharedPluginState.editorDisabled;
18
26
  return {
19
27
  hasFocus: hasFocus,
20
28
  isOpen: isOpen,
21
29
  editorDisabled: editorDisabled
22
30
  };
23
31
  }, function (api) {
24
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['focus', 'typeAhead', 'editorDisabled']),
25
- focusState = _useSharedPluginState.focusState,
26
- typeAheadState = _useSharedPluginState.typeAheadState,
27
- editorDisabledState = _useSharedPluginState.editorDisabledState;
32
+ var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['focus', 'typeAhead', 'editorDisabled']),
33
+ focusState = _useSharedPluginState2.focusState,
34
+ typeAheadState = _useSharedPluginState2.typeAheadState,
35
+ editorDisabledState = _useSharedPluginState2.editorDisabledState;
28
36
  return {
29
37
  hasFocus: focusState === null || focusState === void 0 ? void 0 : focusState.hasFocus,
30
38
  isOpen: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isOpen,
@@ -1,12 +1,21 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
2
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
4
4
  import { createPlugin, dispatchShouldHideDecorations, key } from './pm-plugins/main';
5
5
  import { GlobalStylesWrapper } from './ui/global-styles';
6
6
  const useSharedState = sharedPluginStateHookMigratorFactory(api => {
7
- const hasFocus = useSharedPluginStateSelector(api, 'focus.hasFocus');
8
- const isOpen = useSharedPluginStateSelector(api, 'typeAhead.isOpen');
9
- const editorDisabled = useSharedPluginStateSelector(api, 'editorDisabled.editorDisabled');
7
+ const {
8
+ hasFocus,
9
+ isOpen,
10
+ editorDisabled
11
+ } = useSharedPluginStateWithSelector(api, ['focus', 'typeAhead', 'editorDisabled'], states => {
12
+ var _states$focusState, _states$typeAheadStat, _states$editorDisable;
13
+ return {
14
+ hasFocus: (_states$focusState = states.focusState) === null || _states$focusState === void 0 ? void 0 : _states$focusState.hasFocus,
15
+ isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
16
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
17
+ };
18
+ });
10
19
  return {
11
20
  hasFocus,
12
21
  isOpen,
@@ -1,22 +1,30 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
2
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
4
4
  import { createPlugin, dispatchShouldHideDecorations, key } from './pm-plugins/main';
5
5
  import { GlobalStylesWrapper } from './ui/global-styles';
6
6
  var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
7
- var hasFocus = useSharedPluginStateSelector(api, 'focus.hasFocus');
8
- var isOpen = useSharedPluginStateSelector(api, 'typeAhead.isOpen');
9
- var editorDisabled = useSharedPluginStateSelector(api, 'editorDisabled.editorDisabled');
7
+ var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['focus', 'typeAhead', 'editorDisabled'], function (states) {
8
+ var _states$focusState, _states$typeAheadStat, _states$editorDisable;
9
+ return {
10
+ hasFocus: (_states$focusState = states.focusState) === null || _states$focusState === void 0 ? void 0 : _states$focusState.hasFocus,
11
+ isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
12
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
13
+ };
14
+ }),
15
+ hasFocus = _useSharedPluginState.hasFocus,
16
+ isOpen = _useSharedPluginState.isOpen,
17
+ editorDisabled = _useSharedPluginState.editorDisabled;
10
18
  return {
11
19
  hasFocus: hasFocus,
12
20
  isOpen: isOpen,
13
21
  editorDisabled: editorDisabled
14
22
  };
15
23
  }, function (api) {
16
- var _useSharedPluginState = useSharedPluginState(api, ['focus', 'typeAhead', 'editorDisabled']),
17
- focusState = _useSharedPluginState.focusState,
18
- typeAheadState = _useSharedPluginState.typeAheadState,
19
- editorDisabledState = _useSharedPluginState.editorDisabledState;
24
+ var _useSharedPluginState2 = useSharedPluginState(api, ['focus', 'typeAhead', 'editorDisabled']),
25
+ focusState = _useSharedPluginState2.focusState,
26
+ typeAheadState = _useSharedPluginState2.typeAheadState,
27
+ editorDisabledState = _useSharedPluginState2.editorDisabledState;
20
28
  return {
21
29
  hasFocus: focusState === null || focusState === void 0 ? void 0 : focusState.hasFocus,
22
30
  isOpen: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isOpen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-marker",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Selection marker plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,15 +38,15 @@
38
38
  "@atlaskit/link": "^3.2.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
40
  "@atlaskit/primitives": "^14.10.0",
41
- "@atlaskit/theme": "^18.0.0",
42
- "@atlaskit/tmp-editor-statsig": "^8.7.0",
41
+ "@atlaskit/theme": "^19.0.0",
42
+ "@atlaskit/tmp-editor-statsig": "^9.1.0",
43
43
  "@atlaskit/tokens": "^5.4.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1",
46
46
  "lodash": "^4.17.21"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^107.6.0",
49
+ "@atlaskit/editor-common": "^107.7.0",
50
50
  "react": "^18.2.0",
51
51
  "react-dom": "^18.2.0"
52
52
  },