@atlaskit/editor-plugin-paste-options-toolbar 2.1.5 → 3.0.1

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,54 @@
1
1
  # @atlaskit/editor-plugin-paste-options-toolbar
2
2
 
3
+ ## 3.0.1
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.0
13
+
14
+ ### Major Changes
15
+
16
+ - [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
17
+ [`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
18
+ Make `@atlaskit/editor-common` a peer dependency
19
+
20
+ **WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
21
+ all editor plugin packages.
22
+
23
+ **WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
24
+ consuming applications, preventing issues caused by multiple versions of singleton libraries (such
25
+ as context mismatches or duplicated state). This is especially important for packages that rely on
26
+ shared context or singletons.
27
+
28
+ **HOW TO ADJUST:**
29
+
30
+ - Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
31
+ any of these editor plugins.
32
+ - Ensure the version you install matches the version required by the plugins.
33
+ - You can use the
34
+ [`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
35
+ verify that all required peer dependencies are installed and compatible.
36
+ - Example install command:
37
+ ```
38
+ npm install @atlaskit/editor-common
39
+ ```
40
+ or
41
+ ```
42
+ yarn add @atlaskit/editor-common
43
+ ```
44
+
45
+ **Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
46
+ application level, you may see errors or unexpected behavior.
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies
51
+
3
52
  ## 2.1.5
4
53
 
5
54
  ### Patch Changes
@@ -6,19 +6,24 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.pasteOptionsToolbarPlugin = void 0;
7
7
  var _react = require("react");
8
8
  var _hooks = require("@atlaskit/editor-common/hooks");
9
- var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
10
9
  var _commands = require("./editor-commands/commands");
11
10
  var _main = require("./pm-plugins/main");
12
11
  var _types = require("./types/types");
13
12
  var _toolbar = require("./ui/toolbar");
14
13
  var useSharedPasteState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
15
- var lastContentPasted = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'paste.lastContentPasted');
14
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['paste'], function (states) {
15
+ var _states$pasteState;
16
+ return {
17
+ lastContentPasted: (_states$pasteState = states.pasteState) === null || _states$pasteState === void 0 ? void 0 : _states$pasteState.lastContentPasted
18
+ };
19
+ }),
20
+ lastContentPasted = _useSharedPluginState.lastContentPasted;
16
21
  return {
17
22
  lastContentPasted: lastContentPasted
18
23
  };
19
24
  }, function (api) {
20
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['paste']),
21
- pasteState = _useSharedPluginState.pasteState;
25
+ var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['paste']),
26
+ pasteState = _useSharedPluginState2.pasteState;
22
27
  return {
23
28
  lastContentPasted: pasteState === null || pasteState === void 0 ? void 0 : pasteState.lastContentPasted
24
29
  };
@@ -1,12 +1,18 @@
1
1
  import { useEffect } from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
3
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
2
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
3
  import { hideToolbar, showToolbar } from './editor-commands/commands';
5
4
  import { createPlugin } from './pm-plugins/main';
6
5
  import { pasteOptionsPluginKey, ToolbarDropdownOption } from './types/types';
7
6
  import { buildToolbar, isToolbarVisible } from './ui/toolbar';
8
7
  const useSharedPasteState = sharedPluginStateHookMigratorFactory(api => {
9
- const lastContentPasted = useSharedPluginStateSelector(api, 'paste.lastContentPasted');
8
+ const {
9
+ lastContentPasted
10
+ } = useSharedPluginStateWithSelector(api, ['paste'], states => {
11
+ var _states$pasteState;
12
+ return {
13
+ lastContentPasted: (_states$pasteState = states.pasteState) === null || _states$pasteState === void 0 ? void 0 : _states$pasteState.lastContentPasted
14
+ };
15
+ });
10
16
  return {
11
17
  lastContentPasted
12
18
  };
@@ -1,18 +1,23 @@
1
1
  import { useEffect } from 'react';
2
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
3
- import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
2
+ import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
3
  import { hideToolbar, showToolbar } from './editor-commands/commands';
5
4
  import { createPlugin } from './pm-plugins/main';
6
5
  import { pasteOptionsPluginKey, ToolbarDropdownOption } from './types/types';
7
6
  import { buildToolbar, isToolbarVisible } from './ui/toolbar';
8
7
  var useSharedPasteState = sharedPluginStateHookMigratorFactory(function (api) {
9
- var lastContentPasted = useSharedPluginStateSelector(api, 'paste.lastContentPasted');
8
+ var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['paste'], function (states) {
9
+ var _states$pasteState;
10
+ return {
11
+ lastContentPasted: (_states$pasteState = states.pasteState) === null || _states$pasteState === void 0 ? void 0 : _states$pasteState.lastContentPasted
12
+ };
13
+ }),
14
+ lastContentPasted = _useSharedPluginState.lastContentPasted;
10
15
  return {
11
16
  lastContentPasted: lastContentPasted
12
17
  };
13
18
  }, function (api) {
14
- var _useSharedPluginState = useSharedPluginState(api, ['paste']),
15
- pasteState = _useSharedPluginState.pasteState;
19
+ var _useSharedPluginState2 = useSharedPluginState(api, ['paste']),
20
+ pasteState = _useSharedPluginState2.pasteState;
16
21
  return {
17
22
  lastContentPasted: pasteState === null || pasteState === void 0 ? void 0 : pasteState.lastContentPasted
18
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste-options-toolbar",
3
- "version": "2.1.5",
3
+ "version": "3.0.1",
4
4
  "description": "Paste options toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "atlassian": {
11
11
  "team": "Editor: Core Experiences",
12
- "singleton": true,
13
- "runReact18": true
12
+ "singleton": true
14
13
  },
15
14
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
15
  "main": "dist/cjs/index.js",
@@ -34,19 +33,19 @@
34
33
  "./styles": "./src/ui/styles.ts"
35
34
  },
36
35
  "dependencies": {
37
- "@atlaskit/editor-common": "^107.0.0",
38
36
  "@atlaskit/editor-markdown-transformer": "^5.16.0",
39
- "@atlaskit/editor-plugin-analytics": "^2.3.0",
40
- "@atlaskit/editor-plugin-paste": "^3.3.0",
37
+ "@atlaskit/editor-plugin-analytics": "^3.0.0",
38
+ "@atlaskit/editor-plugin-paste": "^4.0.0",
41
39
  "@atlaskit/editor-prosemirror": "7.0.0",
42
40
  "@atlaskit/editor-shared-styles": "^3.4.0",
43
- "@atlaskit/icon": "^27.0.0",
44
- "@atlaskit/tokens": "^5.2.0",
41
+ "@atlaskit/icon": "^27.3.0",
42
+ "@atlaskit/tokens": "^5.4.0",
45
43
  "@babel/runtime": "^7.0.0",
46
44
  "@emotion/react": "^11.7.1",
47
45
  "react-intl-next": "npm:react-intl@^5.18.1"
48
46
  },
49
47
  "peerDependencies": {
48
+ "@atlaskit/editor-common": "^107.7.0",
50
49
  "react": "^18.2.0",
51
50
  "react-dom": "^18.2.0"
52
51
  },