@atlaskit/editor-plugin-mentions 5.2.10 → 5.2.12

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,21 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 5.2.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8497783928a16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8497783928a16) -
8
+ ED-29110: clean up sharedPluginStateHookMigratorFactory in media, mentions and paste options
9
+ - Updated dependencies
10
+
11
+ ## 5.2.11
12
+
13
+ ### Patch Changes
14
+
15
+ - [`a2cd8c46a3e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a2cd8c46a3e94) -
16
+ EDITOR-1442 Bump adf-schema
17
+ - Updated dependencies
18
+
3
19
  ## 5.2.10
4
20
 
5
21
  ### Patch Changes
@@ -23,7 +23,7 @@ var ACTIONS = exports.ACTIONS = {
23
23
  SET_PROVIDER: 'SET_PROVIDER'
24
24
  };
25
25
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
26
- var PACKAGE_VERSION = "5.2.9";
26
+ var PACKAGE_VERSION = "5.2.11";
27
27
  var setProvider = function setProvider(provider) {
28
28
  return function (state, dispatch) {
29
29
  if (dispatch) {
@@ -17,23 +17,14 @@ var selector = function selector(states) {
17
17
  mentionProvider: (_states$mentionState = states.mentionState) === null || _states$mentionState === void 0 ? void 0 : _states$mentionState.mentionProvider
18
18
  };
19
19
  };
20
- var useSharedMentionState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
21
- return (0, _hooks.useSharedPluginStateWithSelector)(api, ['mention'], selector);
22
- }, function (api) {
23
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['mention']),
24
- mentionState = _useSharedPluginState.mentionState;
25
- return {
26
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider
27
- };
28
- });
29
20
  function SecondaryToolbarComponent(_ref) {
30
21
  var _api$typeAhead2;
31
22
  var editorView = _ref.editorView,
32
23
  api = _ref.api,
33
24
  typeAhead = _ref.typeAhead,
34
25
  disabled = _ref.disabled;
35
- var _useSharedMentionStat = useSharedMentionState(api),
36
- mentionProvider = _useSharedMentionStat.mentionProvider;
26
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['mention'], selector),
27
+ mentionProvider = _useSharedPluginState.mentionProvider;
37
28
  var openMentionTypeAhead = (0, _react.useCallback)(function () {
38
29
  var _api$typeAhead;
39
30
  api === null || api === void 0 || (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 || (_api$typeAhead = _api$typeAhead.actions) === null || _api$typeAhead === void 0 || _api$typeAhead.open({
@@ -12,7 +12,7 @@ export const ACTIONS = {
12
12
  SET_PROVIDER: 'SET_PROVIDER'
13
13
  };
14
14
  const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
15
- const PACKAGE_VERSION = "5.2.9";
15
+ const PACKAGE_VERSION = "5.2.11";
16
16
  const setProvider = provider => (state, dispatch) => {
17
17
  if (dispatch) {
18
18
  dispatch(state.tr.setMeta(mentionPluginKey, {
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import ToolbarMention from './ToolbarMention';
5
5
  const selector = states => {
6
6
  var _states$mentionState;
@@ -8,16 +8,6 @@ const selector = states => {
8
8
  mentionProvider: (_states$mentionState = states.mentionState) === null || _states$mentionState === void 0 ? void 0 : _states$mentionState.mentionProvider
9
9
  };
10
10
  };
11
- const useSharedMentionState = sharedPluginStateHookMigratorFactory(api => {
12
- return useSharedPluginStateWithSelector(api, ['mention'], selector);
13
- }, api => {
14
- const {
15
- mentionState
16
- } = useSharedPluginState(api, ['mention']);
17
- return {
18
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider
19
- };
20
- });
21
11
  export function SecondaryToolbarComponent({
22
12
  editorView,
23
13
  api,
@@ -27,7 +17,7 @@ export function SecondaryToolbarComponent({
27
17
  var _api$typeAhead2;
28
18
  const {
29
19
  mentionProvider
30
- } = useSharedMentionState(api);
20
+ } = useSharedPluginStateWithSelector(api, ['mention'], selector);
31
21
  const openMentionTypeAhead = useCallback(() => {
32
22
  var _api$typeAhead, _api$typeAhead$action;
33
23
  api === null || api === void 0 ? void 0 : (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 ? void 0 : (_api$typeAhead$action = _api$typeAhead.actions) === null || _api$typeAhead$action === void 0 ? void 0 : _api$typeAhead$action.open({
@@ -15,7 +15,7 @@ export var ACTIONS = {
15
15
  SET_PROVIDER: 'SET_PROVIDER'
16
16
  };
17
17
  var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
18
- var PACKAGE_VERSION = "5.2.9";
18
+ var PACKAGE_VERSION = "5.2.11";
19
19
  var setProvider = function setProvider(provider) {
20
20
  return function (state, dispatch) {
21
21
  if (dispatch) {
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import ToolbarMention from './ToolbarMention';
5
5
  var selector = function selector(states) {
6
6
  var _states$mentionState;
@@ -8,23 +8,14 @@ var selector = function selector(states) {
8
8
  mentionProvider: (_states$mentionState = states.mentionState) === null || _states$mentionState === void 0 ? void 0 : _states$mentionState.mentionProvider
9
9
  };
10
10
  };
11
- var useSharedMentionState = sharedPluginStateHookMigratorFactory(function (api) {
12
- return useSharedPluginStateWithSelector(api, ['mention'], selector);
13
- }, function (api) {
14
- var _useSharedPluginState = useSharedPluginState(api, ['mention']),
15
- mentionState = _useSharedPluginState.mentionState;
16
- return {
17
- mentionProvider: mentionState === null || mentionState === void 0 ? void 0 : mentionState.mentionProvider
18
- };
19
- });
20
11
  export function SecondaryToolbarComponent(_ref) {
21
12
  var _api$typeAhead2;
22
13
  var editorView = _ref.editorView,
23
14
  api = _ref.api,
24
15
  typeAhead = _ref.typeAhead,
25
16
  disabled = _ref.disabled;
26
- var _useSharedMentionStat = useSharedMentionState(api),
27
- mentionProvider = _useSharedMentionStat.mentionProvider;
17
+ var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['mention'], selector),
18
+ mentionProvider = _useSharedPluginState.mentionProvider;
28
19
  var openMentionTypeAhead = useCallback(function () {
29
20
  var _api$typeAhead;
30
21
  api === null || api === void 0 || (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 || (_api$typeAhead = _api$typeAhead.actions) === null || _api$typeAhead === void 0 || _api$typeAhead.open({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "5.2.10",
3
+ "version": "5.2.12",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,11 +28,8 @@
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
- "@atlaskit/adf-schema": "^50.2.2",
32
+ "@atlaskit/adf-schema": "^50.2.3",
36
33
  "@atlaskit/css": "^0.12.0",
37
34
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
38
35
  "@atlaskit/editor-plugin-base": "^4.1.0",
@@ -48,7 +45,7 @@
48
45
  "@atlaskit/portal": "^5.1.0",
49
46
  "@atlaskit/profilecard": "^24.7.0",
50
47
  "@atlaskit/theme": "^20.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^11.8.0",
48
+ "@atlaskit/tmp-editor-statsig": "^11.9.0",
52
49
  "@atlaskit/tokens": "^6.1.0",
53
50
  "@babel/runtime": "^7.0.0",
54
51
  "@compiled/react": "^0.18.3",
@@ -57,7 +54,7 @@
57
54
  "uuid": "^3.1.0"
58
55
  },
59
56
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^107.31.0",
57
+ "@atlaskit/editor-common": "^107.33.0",
61
58
  "react": "^18.2.0",
62
59
  "react-dom": "^18.2.0",
63
60
  "react-intl-next": "npm:react-intl@^5.18.1"