@atlaskit/editor-plugin-undo-redo 3.2.5 → 3.2.7

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-undo-redo
2
2
 
3
+ ## 3.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fa9e0ec694435`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fa9e0ec694435) -
8
+ ED-29117: cleans up sharedPluginStateHookMigratorFactory in undo redo plugin
9
+ - Updated dependencies
10
+
11
+ ## 3.2.6
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 3.2.5
4
18
 
5
19
  ### Patch Changes
@@ -23,7 +23,12 @@ var _utils = require("../../pm-plugins/utils");
23
23
  */
24
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
 
26
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
26
+ var ToolbarUndoRedo = exports.ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
27
+ var disabled = _ref.disabled,
28
+ isReducedSpacing = _ref.isReducedSpacing,
29
+ editorView = _ref.editorView,
30
+ api = _ref.api,
31
+ formatMessage = _ref.intl.formatMessage;
27
32
  var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['history'], function (states) {
28
33
  var _states$historyState, _states$historyState2;
29
34
  return {
@@ -33,27 +38,6 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
33
38
  }),
34
39
  canRedo = _useSharedPluginState.canRedo,
35
40
  canUndo = _useSharedPluginState.canUndo;
36
- return {
37
- canUndo: canUndo,
38
- canRedo: canRedo
39
- };
40
- }, function (api) {
41
- var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['history']),
42
- historyState = _useSharedPluginState2.historyState;
43
- return {
44
- canUndo: historyState === null || historyState === void 0 ? void 0 : historyState.canUndo,
45
- canRedo: historyState === null || historyState === void 0 ? void 0 : historyState.canRedo
46
- };
47
- });
48
- var ToolbarUndoRedo = exports.ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
49
- var disabled = _ref.disabled,
50
- isReducedSpacing = _ref.isReducedSpacing,
51
- editorView = _ref.editorView,
52
- api = _ref.api,
53
- formatMessage = _ref.intl.formatMessage;
54
- var _useSharedState = useSharedState(api),
55
- canUndo = _useSharedState.canUndo,
56
- canRedo = _useSharedState.canRedo;
57
41
  var handleUndo = function handleUndo() {
58
42
  var _api$analytics;
59
43
  (0, _utils.forceFocus)(editorView, api)((0, _commands.undoFromToolbarWithAnalytics)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions));
@@ -5,7 +5,7 @@
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { jsx } from '@emotion/react';
7
7
  import { injectIntl } from 'react-intl-next';
8
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
8
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
9
9
  import { getAriaKeyshortcuts, redo, redoAlt, tooltip, ToolTipContent, undo as undoKeymap } from '@atlaskit/editor-common/keymaps';
10
10
  import { undoRedoMessages } from '@atlaskit/editor-common/messages';
11
11
  import { buttonGroupStyle, buttonGroupStyleBeforeVisualRefresh, separatorStyles } from '@atlaskit/editor-common/styles';
@@ -15,30 +15,6 @@ import UndoIcon from '@atlaskit/icon/core/migration/undo';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
16
  import { redoFromToolbarWithAnalytics, undoFromToolbarWithAnalytics } from '../../pm-plugins/commands';
17
17
  import { forceFocus } from '../../pm-plugins/utils';
18
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
19
- const {
20
- canRedo,
21
- canUndo
22
- } = useSharedPluginStateWithSelector(api, ['history'], states => {
23
- var _states$historyState, _states$historyState2;
24
- return {
25
- canUndo: (_states$historyState = states.historyState) === null || _states$historyState === void 0 ? void 0 : _states$historyState.canUndo,
26
- canRedo: (_states$historyState2 = states.historyState) === null || _states$historyState2 === void 0 ? void 0 : _states$historyState2.canRedo
27
- };
28
- });
29
- return {
30
- canUndo,
31
- canRedo
32
- };
33
- }, api => {
34
- const {
35
- historyState
36
- } = useSharedPluginState(api, ['history']);
37
- return {
38
- canUndo: historyState === null || historyState === void 0 ? void 0 : historyState.canUndo,
39
- canRedo: historyState === null || historyState === void 0 ? void 0 : historyState.canRedo
40
- };
41
- });
42
18
  export const ToolbarUndoRedo = ({
43
19
  disabled,
44
20
  isReducedSpacing,
@@ -49,9 +25,15 @@ export const ToolbarUndoRedo = ({
49
25
  }
50
26
  }) => {
51
27
  const {
52
- canUndo,
53
- canRedo
54
- } = useSharedState(api);
28
+ canRedo,
29
+ canUndo
30
+ } = useSharedPluginStateWithSelector(api, ['history'], states => {
31
+ var _states$historyState, _states$historyState2;
32
+ return {
33
+ canUndo: (_states$historyState = states.historyState) === null || _states$historyState === void 0 ? void 0 : _states$historyState.canUndo,
34
+ canRedo: (_states$historyState2 = states.historyState) === null || _states$historyState2 === void 0 ? void 0 : _states$historyState2.canRedo
35
+ };
36
+ });
55
37
  const handleUndo = () => {
56
38
  var _api$analytics;
57
39
  forceFocus(editorView, api)(undoFromToolbarWithAnalytics(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions));
@@ -5,7 +5,7 @@
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { jsx } from '@emotion/react';
7
7
  import { injectIntl } from 'react-intl-next';
8
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
8
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
9
9
  import { getAriaKeyshortcuts, redo, redoAlt, tooltip, ToolTipContent, undo as undoKeymap } from '@atlaskit/editor-common/keymaps';
10
10
  import { undoRedoMessages } from '@atlaskit/editor-common/messages';
11
11
  import { buttonGroupStyle, buttonGroupStyleBeforeVisualRefresh, separatorStyles } from '@atlaskit/editor-common/styles';
@@ -15,7 +15,12 @@ import UndoIcon from '@atlaskit/icon/core/migration/undo';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
16
  import { redoFromToolbarWithAnalytics, undoFromToolbarWithAnalytics } from '../../pm-plugins/commands';
17
17
  import { forceFocus } from '../../pm-plugins/utils';
18
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
18
+ export var ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
19
+ var disabled = _ref.disabled,
20
+ isReducedSpacing = _ref.isReducedSpacing,
21
+ editorView = _ref.editorView,
22
+ api = _ref.api,
23
+ formatMessage = _ref.intl.formatMessage;
19
24
  var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['history'], function (states) {
20
25
  var _states$historyState, _states$historyState2;
21
26
  return {
@@ -25,27 +30,6 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
25
30
  }),
26
31
  canRedo = _useSharedPluginState.canRedo,
27
32
  canUndo = _useSharedPluginState.canUndo;
28
- return {
29
- canUndo: canUndo,
30
- canRedo: canRedo
31
- };
32
- }, function (api) {
33
- var _useSharedPluginState2 = useSharedPluginState(api, ['history']),
34
- historyState = _useSharedPluginState2.historyState;
35
- return {
36
- canUndo: historyState === null || historyState === void 0 ? void 0 : historyState.canUndo,
37
- canRedo: historyState === null || historyState === void 0 ? void 0 : historyState.canRedo
38
- };
39
- });
40
- export var ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
41
- var disabled = _ref.disabled,
42
- isReducedSpacing = _ref.isReducedSpacing,
43
- editorView = _ref.editorView,
44
- api = _ref.api,
45
- formatMessage = _ref.intl.formatMessage;
46
- var _useSharedState = useSharedState(api),
47
- canUndo = _useSharedState.canUndo,
48
- canRedo = _useSharedState.canRedo;
49
33
  var handleUndo = function handleUndo() {
50
34
  var _api$analytics;
51
35
  forceFocus(editorView, api)(undoFromToolbarWithAnalytics(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-undo-redo",
3
- "version": "3.2.5",
3
+ "version": "3.2.7",
4
4
  "description": "Undo redo plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,25 +28,22 @@
28
28
  "*.compiled.css"
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
- "af:exports": {
32
- ".": "./src/index.ts"
33
- },
34
31
  "dependencies": {
35
32
  "@atlaskit/editor-plugin-history": "^3.1.0",
36
33
  "@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
37
34
  "@atlaskit/editor-plugin-toolbar": "^0.4.0",
38
35
  "@atlaskit/editor-plugin-type-ahead": "^3.1.0",
39
36
  "@atlaskit/editor-prosemirror": "7.0.0",
40
- "@atlaskit/editor-toolbar": "^0.3.0",
37
+ "@atlaskit/editor-toolbar": "^0.5.0",
41
38
  "@atlaskit/editor-toolbar-model": "^0.1.0",
42
- "@atlaskit/icon": "^28.0.0",
39
+ "@atlaskit/icon": "^28.1.0",
43
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^11.5.0",
41
+ "@atlaskit/tmp-editor-statsig": "^11.9.0",
45
42
  "@babel/runtime": "^7.0.0",
46
43
  "@emotion/react": "^11.7.1"
47
44
  },
48
45
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^107.28.0",
46
+ "@atlaskit/editor-common": "^107.33.0",
50
47
  "react": "^18.2.0",
51
48
  "react-intl-next": "npm:react-intl@^5.18.1"
52
49
  },