@atlaskit/editor-plugin-selection-marker 3.0.9 → 4.0.0

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,18 @@
1
1
  # @atlaskit/editor-plugin-selection-marker
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.0.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [`0f8ecc0906213`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0f8ecc0906213) -
14
+ ED-29112: clean up sharedPluginStateHookMigratorFactory in selection-extension, selection-marker
15
+
3
16
  ## 3.0.9
4
17
 
5
18
  ### Patch Changes
@@ -11,34 +11,6 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
11
11
  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
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
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;
26
- return {
27
- hasFocus: hasFocus,
28
- isOpen: isOpen,
29
- editorDisabled: editorDisabled
30
- };
31
- }, function (api) {
32
- var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['focus', 'typeAhead', 'editorDisabled']),
33
- focusState = _useSharedPluginState2.focusState,
34
- typeAheadState = _useSharedPluginState2.typeAheadState,
35
- editorDisabledState = _useSharedPluginState2.editorDisabledState;
36
- return {
37
- hasFocus: focusState === null || focusState === void 0 ? void 0 : focusState.hasFocus,
38
- isOpen: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isOpen,
39
- editorDisabled: editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled
40
- };
41
- });
42
14
  var selectionMarkerPlugin = exports.selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
43
15
  var config = _ref.config,
44
16
  api = _ref.api;
@@ -106,10 +78,17 @@ var selectionMarkerPlugin = exports.selectionMarkerPlugin = function selectionMa
106
78
  // relatch when editorView changes (pretty good signal for reinit)
107
79
  editorHasNotBeenFocused.current = true;
108
80
  }, [editorView]);
109
- var _useSharedState = useSharedState(api),
110
- hasFocus = _useSharedState.hasFocus,
111
- isOpen = _useSharedState.isOpen,
112
- editorDisabled = _useSharedState.editorDisabled;
81
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['focus', 'typeAhead', 'editorDisabled'], function (states) {
82
+ var _states$focusState, _states$typeAheadStat, _states$editorDisable;
83
+ return {
84
+ hasFocus: (_states$focusState = states.focusState) === null || _states$focusState === void 0 ? void 0 : _states$focusState.hasFocus,
85
+ isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
86
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
87
+ };
88
+ }),
89
+ hasFocus = _useSharedPluginState.hasFocus,
90
+ isOpen = _useSharedPluginState.isOpen,
91
+ editorDisabled = _useSharedPluginState.editorDisabled;
113
92
  var isForcedHidden = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'selectionMarker.isForcedHidden');
114
93
  (0, _react.useEffect)(function () {
115
94
  var _ref5;
@@ -1,38 +1,8 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
2
+ import { 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
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
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
- });
19
- return {
20
- hasFocus,
21
- isOpen,
22
- editorDisabled
23
- };
24
- }, api => {
25
- const {
26
- focusState,
27
- typeAheadState,
28
- editorDisabledState
29
- } = useSharedPluginState(api, ['focus', 'typeAhead', 'editorDisabled']);
30
- return {
31
- hasFocus: focusState === null || focusState === void 0 ? void 0 : focusState.hasFocus,
32
- isOpen: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isOpen,
33
- editorDisabled: editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled
34
- };
35
- });
36
6
  export const selectionMarkerPlugin = ({
37
7
  config,
38
8
  api
@@ -104,7 +74,14 @@ export const selectionMarkerPlugin = ({
104
74
  hasFocus,
105
75
  isOpen,
106
76
  editorDisabled
107
- } = useSharedState(api);
77
+ } = useSharedPluginStateWithSelector(api, ['focus', 'typeAhead', 'editorDisabled'], states => {
78
+ var _states$focusState, _states$typeAheadStat, _states$editorDisable;
79
+ return {
80
+ hasFocus: (_states$focusState = states.focusState) === null || _states$focusState === void 0 ? void 0 : _states$focusState.hasFocus,
81
+ isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
82
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
83
+ };
84
+ });
108
85
  const isForcedHidden = useSharedPluginStateSelector(api, 'selectionMarker.isForcedHidden');
109
86
  useEffect(() => {
110
87
  var _ref;
@@ -1,36 +1,8 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
2
+ import { 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
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
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;
18
- return {
19
- hasFocus: hasFocus,
20
- isOpen: isOpen,
21
- editorDisabled: editorDisabled
22
- };
23
- }, function (api) {
24
- var _useSharedPluginState2 = useSharedPluginState(api, ['focus', 'typeAhead', 'editorDisabled']),
25
- focusState = _useSharedPluginState2.focusState,
26
- typeAheadState = _useSharedPluginState2.typeAheadState,
27
- editorDisabledState = _useSharedPluginState2.editorDisabledState;
28
- return {
29
- hasFocus: focusState === null || focusState === void 0 ? void 0 : focusState.hasFocus,
30
- isOpen: typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isOpen,
31
- editorDisabled: editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled
32
- };
33
- });
34
6
  export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
35
7
  var config = _ref.config,
36
8
  api = _ref.api;
@@ -98,10 +70,17 @@ export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
98
70
  // relatch when editorView changes (pretty good signal for reinit)
99
71
  editorHasNotBeenFocused.current = true;
100
72
  }, [editorView]);
101
- var _useSharedState = useSharedState(api),
102
- hasFocus = _useSharedState.hasFocus,
103
- isOpen = _useSharedState.isOpen,
104
- editorDisabled = _useSharedState.editorDisabled;
73
+ var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['focus', 'typeAhead', 'editorDisabled'], function (states) {
74
+ var _states$focusState, _states$typeAheadStat, _states$editorDisable;
75
+ return {
76
+ hasFocus: (_states$focusState = states.focusState) === null || _states$focusState === void 0 ? void 0 : _states$focusState.hasFocus,
77
+ isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
78
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
79
+ };
80
+ }),
81
+ hasFocus = _useSharedPluginState.hasFocus,
82
+ isOpen = _useSharedPluginState.isOpen,
83
+ editorDisabled = _useSharedPluginState.editorDisabled;
105
84
  var isForcedHidden = useSharedPluginStateSelector(api, 'selectionMarker.isForcedHidden');
106
85
  useEffect(function () {
107
86
  var _ref5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-marker",
3
- "version": "3.0.9",
3
+ "version": "4.0.0",
4
4
  "description": "Selection marker plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,26 +27,23 @@
27
27
  "*.compiled.css"
28
28
  ],
29
29
  "atlaskit:src": "src/index.ts",
30
- "af:exports": {
31
- ".": "./src/index.ts"
32
- },
33
30
  "dependencies": {
34
- "@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
35
- "@atlaskit/editor-plugin-focus": "^2.0.0",
36
- "@atlaskit/editor-plugin-type-ahead": "^3.1.0",
31
+ "@atlaskit/editor-plugin-editor-disabled": "^4.0.0",
32
+ "@atlaskit/editor-plugin-focus": "^3.0.0",
33
+ "@atlaskit/editor-plugin-type-ahead": "^4.0.0",
37
34
  "@atlaskit/editor-prosemirror": "7.0.0",
38
35
  "@atlaskit/link": "^3.2.0",
39
36
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
37
  "@atlaskit/primitives": "^14.12.0",
41
38
  "@atlaskit/theme": "^20.0.0",
42
- "@atlaskit/tmp-editor-statsig": "^11.8.0",
39
+ "@atlaskit/tmp-editor-statsig": "^12.0.0",
43
40
  "@atlaskit/tokens": "^6.1.0",
44
41
  "@babel/runtime": "^7.0.0",
45
42
  "@emotion/react": "^11.7.1",
46
43
  "lodash": "^4.17.21"
47
44
  },
48
45
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^107.31.0",
46
+ "@atlaskit/editor-common": "^108.0.0",
50
47
  "react": "^18.2.0",
51
48
  "react-dom": "^18.2.0"
52
49
  },