@atlaskit/editor-plugin-layout 3.0.1 → 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,14 @@
1
1
  # @atlaskit/editor-plugin-layout
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
+ - Updated dependencies
11
+
3
12
  ## 3.0.1
4
13
 
5
14
  ### Patch Changes
@@ -47,11 +47,14 @@ var isEmptyLayout = function isEmptyLayout(node) {
47
47
  });
48
48
  return isEmpty;
49
49
  };
50
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
51
- var editorDisabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'editorDisabled.editorDisabled');
50
+ var selector = function selector(states) {
51
+ var _states$editorDisable;
52
52
  return {
53
- editorDisabled: editorDisabled
53
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
54
54
  };
55
+ };
56
+ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
57
+ return (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorDisabled'], selector);
55
58
  }, function (api) {
56
59
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['editorDisabled']),
57
60
  editorDisabledState = _useSharedPluginState.editorDisabledState;
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
2
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
4
4
  import { BreakoutResizer, ignoreResizerMutations } from '@atlaskit/editor-common/resizer';
5
5
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
@@ -31,11 +31,14 @@ const isEmptyLayout = node => {
31
31
  });
32
32
  return isEmpty;
33
33
  };
34
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
35
- const editorDisabled = useSharedPluginStateSelector(api, 'editorDisabled.editorDisabled');
34
+ const selector = states => {
35
+ var _states$editorDisable;
36
36
  return {
37
- editorDisabled
37
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
38
38
  };
39
+ };
40
+ const useSharedState = sharedPluginStateHookMigratorFactory(api => {
41
+ return useSharedPluginStateWithSelector(api, ['editorDisabled'], selector);
39
42
  }, api => {
40
43
  const {
41
44
  editorDisabledState
@@ -6,7 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
6
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
7
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
8
  import React, { useCallback } from 'react';
9
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
9
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
10
10
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
11
11
  import { BreakoutResizer, ignoreResizerMutations } from '@atlaskit/editor-common/resizer';
12
12
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
@@ -38,11 +38,14 @@ var isEmptyLayout = function isEmptyLayout(node) {
38
38
  });
39
39
  return isEmpty;
40
40
  };
41
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
42
- var editorDisabled = useSharedPluginStateSelector(api, 'editorDisabled.editorDisabled');
41
+ var selector = function selector(states) {
42
+ var _states$editorDisable;
43
43
  return {
44
- editorDisabled: editorDisabled
44
+ editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled
45
45
  };
46
+ };
47
+ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
48
+ return useSharedPluginStateWithSelector(api, ['editorDisabled'], selector);
46
49
  }, function (api) {
47
50
  var _useSharedPluginState = useSharedPluginState(api, ['editorDisabled']),
48
51
  editorDisabledState = _useSharedPluginState.editorDisabledState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",