@atlaskit/editor-plugin-guideline 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,19 @@
1
1
  # @atlaskit/editor-plugin-guideline
2
2
 
3
+ ## 3.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#182839](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/182839)
14
+ [`81f1c3383bdab`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81f1c3383bdab) -
15
+ refactor: use useSharedPluginStateWithSelector instead of useSharedPluginStateSelector
16
+
3
17
  ## 3.0.0
4
18
 
5
19
  ### Major Changes
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _react = require("@emotion/react");
10
10
  var _hooks = require("@atlaskit/editor-common/hooks");
11
11
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
12
- var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
13
12
  var _state = require("@atlaskit/editor-prosemirror/state");
14
13
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
15
14
  var _guidelineContainer = require("./ui/guidelineContainer");
@@ -57,17 +56,17 @@ var guidelinePMPlugin = new _safePlugin.SafePlugin({
57
56
  }
58
57
  }
59
58
  });
60
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
61
- var width = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'width.width');
62
- var lineLength = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'width.lineLength');
63
- var guidelines = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'guideline.guidelines');
64
- var rect = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'guideline.rect');
59
+ var selector = function selector(states) {
60
+ var _states$widthState, _states$widthState2, _states$guidelineStat, _states$guidelineStat2;
65
61
  return {
66
- width: width,
67
- lineLength: lineLength,
68
- guidelines: guidelines,
69
- rect: rect
62
+ width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width,
63
+ lineLength: (_states$widthState2 = states.widthState) === null || _states$widthState2 === void 0 ? void 0 : _states$widthState2.lineLength,
64
+ guidelines: (_states$guidelineStat = states.guidelineState) === null || _states$guidelineStat === void 0 ? void 0 : _states$guidelineStat.guidelines,
65
+ rect: (_states$guidelineStat2 = states.guidelineState) === null || _states$guidelineStat2 === void 0 ? void 0 : _states$guidelineStat2.rect
70
66
  };
67
+ };
68
+ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
69
+ return (0, _hooks.useSharedPluginStateWithSelector)(api, ['width', 'guideline'], selector);
71
70
  }, function (api) {
72
71
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['width', 'guideline']),
73
72
  widthState = _useSharedPluginState.widthState,
@@ -4,9 +4,8 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css, jsx } from '@emotion/react';
7
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
7
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
8
8
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
9
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
10
9
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
11
10
  import { akEditorGridLineZIndex } from '@atlaskit/editor-shared-styles';
12
11
  import { GuidelineContainer } from './ui/guidelineContainer';
@@ -52,17 +51,17 @@ const guidelinePMPlugin = new SafePlugin({
52
51
  }
53
52
  }
54
53
  });
55
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
56
- const width = useSharedPluginStateSelector(api, 'width.width');
57
- const lineLength = useSharedPluginStateSelector(api, 'width.lineLength');
58
- const guidelines = useSharedPluginStateSelector(api, 'guideline.guidelines');
59
- const rect = useSharedPluginStateSelector(api, 'guideline.rect');
54
+ const selector = states => {
55
+ var _states$widthState, _states$widthState2, _states$guidelineStat, _states$guidelineStat2;
60
56
  return {
61
- width,
62
- lineLength,
63
- guidelines,
64
- rect
57
+ width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width,
58
+ lineLength: (_states$widthState2 = states.widthState) === null || _states$widthState2 === void 0 ? void 0 : _states$widthState2.lineLength,
59
+ guidelines: (_states$guidelineStat = states.guidelineState) === null || _states$guidelineStat === void 0 ? void 0 : _states$guidelineStat.guidelines,
60
+ rect: (_states$guidelineStat2 = states.guidelineState) === null || _states$guidelineStat2 === void 0 ? void 0 : _states$guidelineStat2.rect
65
61
  };
62
+ };
63
+ const useSharedState = sharedPluginStateHookMigratorFactory(api => {
64
+ return useSharedPluginStateWithSelector(api, ['width', 'guideline'], selector);
66
65
  }, api => {
67
66
  const {
68
67
  widthState,
@@ -7,9 +7,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  */
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
10
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
11
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
12
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
13
12
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
14
13
  import { akEditorGridLineZIndex } from '@atlaskit/editor-shared-styles';
15
14
  import { GuidelineContainer } from './ui/guidelineContainer';
@@ -52,17 +51,17 @@ var guidelinePMPlugin = new SafePlugin({
52
51
  }
53
52
  }
54
53
  });
55
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
56
- var width = useSharedPluginStateSelector(api, 'width.width');
57
- var lineLength = useSharedPluginStateSelector(api, 'width.lineLength');
58
- var guidelines = useSharedPluginStateSelector(api, 'guideline.guidelines');
59
- var rect = useSharedPluginStateSelector(api, 'guideline.rect');
54
+ var selector = function selector(states) {
55
+ var _states$widthState, _states$widthState2, _states$guidelineStat, _states$guidelineStat2;
60
56
  return {
61
- width: width,
62
- lineLength: lineLength,
63
- guidelines: guidelines,
64
- rect: rect
57
+ width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width,
58
+ lineLength: (_states$widthState2 = states.widthState) === null || _states$widthState2 === void 0 ? void 0 : _states$widthState2.lineLength,
59
+ guidelines: (_states$guidelineStat = states.guidelineState) === null || _states$guidelineStat === void 0 ? void 0 : _states$guidelineStat.guidelines,
60
+ rect: (_states$guidelineStat2 = states.guidelineState) === null || _states$guidelineStat2 === void 0 ? void 0 : _states$guidelineStat2.rect
65
61
  };
62
+ };
63
+ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
64
+ return useSharedPluginStateWithSelector(api, ['width', 'guideline'], selector);
66
65
  }, function (api) {
67
66
  var _useSharedPluginState = useSharedPluginState(api, ['width', 'guideline']),
68
67
  widthState = _useSharedPluginState.widthState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-guideline",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "guideline plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,13 +27,13 @@
27
27
  "@atlaskit/editor-plugin-width": "^4.0.0",
28
28
  "@atlaskit/editor-prosemirror": "7.0.0",
29
29
  "@atlaskit/editor-shared-styles": "^3.4.0",
30
- "@atlaskit/theme": "^18.0.0",
30
+ "@atlaskit/theme": "^19.0.0",
31
31
  "@atlaskit/tokens": "^5.4.0",
32
32
  "@babel/runtime": "^7.0.0",
33
33
  "@emotion/react": "^11.7.1"
34
34
  },
35
35
  "peerDependencies": {
36
- "@atlaskit/editor-common": "^107.6.0",
36
+ "@atlaskit/editor-common": "^107.7.0",
37
37
  "react": "^18.2.0",
38
38
  "react-dom": "^18.2.0"
39
39
  },