@atlaskit/editor-plugin-hyperlink 5.4.12 → 5.4.14

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-hyperlink
2
2
 
3
+ ## 5.4.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 5.4.13
10
+
11
+ ### Patch Changes
12
+
13
+ - [`a2cd8c46a3e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a2cd8c46a3e94) -
14
+ EDITOR-1442 Bump adf-schema
15
+ - [`ec65234ef4b55`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ec65234ef4b55) -
16
+ Tidy up FG platform_editor_usesharedpluginstatewithselector for highlight and hyperlink
17
+ - Updated dependencies
18
+
3
19
  ## 5.4.12
4
20
 
5
21
  ### Patch Changes
@@ -71,17 +71,6 @@ var selector = function selector(states) {
71
71
  searchSessionId: (_states$hyperlinkStat3 = states.hyperlinkState) === null || _states$hyperlinkStat3 === void 0 ? void 0 : _states$hyperlinkStat3.searchSessionId
72
72
  };
73
73
  };
74
- var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
75
- return (0, _hooks.useSharedPluginStateWithSelector)(api, ['hyperlink'], selector);
76
- }, function (api) {
77
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['hyperlink']),
78
- hyperlinkState = _useSharedPluginState.hyperlinkState;
79
- return {
80
- timesViewed: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.timesViewed,
81
- inputMethod: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.inputMethod,
82
- searchSessionId: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.searchSessionId
83
- };
84
- });
85
74
  function HyperlinkAddToolbarWithState(_ref) {
86
75
  var _pluginInjectionApi$c;
87
76
  var _ref$linkPickerOption = _ref.linkPickerOptions,
@@ -98,10 +87,10 @@ function HyperlinkAddToolbarWithState(_ref) {
98
87
  onEscapeCallback = _ref.onEscapeCallback,
99
88
  onClickAwayCallback = _ref.onClickAwayCallback,
100
89
  pluginInjectionApi = _ref.pluginInjectionApi;
101
- var _useSharedState = useSharedState(pluginInjectionApi),
102
- timesViewed = _useSharedState.timesViewed,
103
- inputMethod = _useSharedState.inputMethod,
104
- searchSessionId = _useSharedState.searchSessionId;
90
+ var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['hyperlink'], selector),
91
+ timesViewed = _useSharedPluginState.timesViewed,
92
+ inputMethod = _useSharedPluginState.inputMethod,
93
+ searchSessionId = _useSharedPluginState.searchSessionId;
105
94
 
106
95
  // This is constant rather than dynamic - because if someone's already got a hyperlink toolbar open,
107
96
  // we don't want to dynamically change it on them as this would cause data loss if they've already
@@ -2,7 +2,7 @@ import React, { useRef } from 'react';
2
2
  import { isSafeUrl } from '@atlaskit/adf-schema';
3
3
  import { ACTION, ACTION_SUBJECT_ID, INPUT_METHOD, buildVisitedLinkPayload } from '@atlaskit/editor-common/analytics';
4
4
  import { commandWithMetadata } from '@atlaskit/editor-common/card';
5
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
6
6
  import { HyperlinkAddToolbar } from '@atlaskit/editor-common/link';
7
7
  import { linkMessages, linkToolbarMessages as linkToolbarCommonMessages } from '@atlaskit/editor-common/messages';
8
8
  import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
@@ -56,18 +56,6 @@ const selector = states => {
56
56
  searchSessionId: (_states$hyperlinkStat3 = states.hyperlinkState) === null || _states$hyperlinkStat3 === void 0 ? void 0 : _states$hyperlinkStat3.searchSessionId
57
57
  };
58
58
  };
59
- const useSharedState = sharedPluginStateHookMigratorFactory(api => {
60
- return useSharedPluginStateWithSelector(api, ['hyperlink'], selector);
61
- }, api => {
62
- const {
63
- hyperlinkState
64
- } = useSharedPluginState(api, ['hyperlink']);
65
- return {
66
- timesViewed: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.timesViewed,
67
- inputMethod: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.inputMethod,
68
- searchSessionId: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.searchSessionId
69
- };
70
- });
71
59
  export function HyperlinkAddToolbarWithState({
72
60
  linkPickerOptions = {},
73
61
  onSubmit,
@@ -88,7 +76,7 @@ export function HyperlinkAddToolbarWithState({
88
76
  timesViewed,
89
77
  inputMethod,
90
78
  searchSessionId
91
- } = useSharedState(pluginInjectionApi);
79
+ } = useSharedPluginStateWithSelector(pluginInjectionApi, ['hyperlink'], selector);
92
80
 
93
81
  // This is constant rather than dynamic - because if someone's already got a hyperlink toolbar open,
94
82
  // we don't want to dynamically change it on them as this would cause data loss if they've already
@@ -6,7 +6,7 @@ import React, { useRef } from 'react';
6
6
  import { isSafeUrl } from '@atlaskit/adf-schema';
7
7
  import { ACTION, ACTION_SUBJECT_ID, INPUT_METHOD, buildVisitedLinkPayload } from '@atlaskit/editor-common/analytics';
8
8
  import { commandWithMetadata } from '@atlaskit/editor-common/card';
9
- import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
9
+ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
10
10
  import { HyperlinkAddToolbar } from '@atlaskit/editor-common/link';
11
11
  import { linkMessages, linkToolbarMessages as linkToolbarCommonMessages } from '@atlaskit/editor-common/messages';
12
12
  import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
@@ -62,17 +62,6 @@ var selector = function selector(states) {
62
62
  searchSessionId: (_states$hyperlinkStat3 = states.hyperlinkState) === null || _states$hyperlinkStat3 === void 0 ? void 0 : _states$hyperlinkStat3.searchSessionId
63
63
  };
64
64
  };
65
- var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
66
- return useSharedPluginStateWithSelector(api, ['hyperlink'], selector);
67
- }, function (api) {
68
- var _useSharedPluginState = useSharedPluginState(api, ['hyperlink']),
69
- hyperlinkState = _useSharedPluginState.hyperlinkState;
70
- return {
71
- timesViewed: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.timesViewed,
72
- inputMethod: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.inputMethod,
73
- searchSessionId: hyperlinkState === null || hyperlinkState === void 0 ? void 0 : hyperlinkState.searchSessionId
74
- };
75
- });
76
65
  export function HyperlinkAddToolbarWithState(_ref) {
77
66
  var _pluginInjectionApi$c;
78
67
  var _ref$linkPickerOption = _ref.linkPickerOptions,
@@ -89,10 +78,10 @@ export function HyperlinkAddToolbarWithState(_ref) {
89
78
  onEscapeCallback = _ref.onEscapeCallback,
90
79
  onClickAwayCallback = _ref.onClickAwayCallback,
91
80
  pluginInjectionApi = _ref.pluginInjectionApi;
92
- var _useSharedState = useSharedState(pluginInjectionApi),
93
- timesViewed = _useSharedState.timesViewed,
94
- inputMethod = _useSharedState.inputMethod,
95
- searchSessionId = _useSharedState.searchSessionId;
81
+ var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, ['hyperlink'], selector),
82
+ timesViewed = _useSharedPluginState.timesViewed,
83
+ inputMethod = _useSharedPluginState.inputMethod,
84
+ searchSessionId = _useSharedPluginState.searchSessionId;
96
85
 
97
86
  // This is constant rather than dynamic - because if someone's already got a hyperlink toolbar open,
98
87
  // we don't want to dynamically change it on them as this would cause data loss if they've already
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "5.4.12",
3
+ "version": "5.4.14",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,28 +29,28 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/adf-schema": "^50.2.2",
32
+ "@atlaskit/adf-schema": "^50.2.3",
33
33
  "@atlaskit/analytics-next": "^11.1.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
35
- "@atlaskit/editor-plugin-card": "^7.5.0",
35
+ "@atlaskit/editor-plugin-card": "^7.7.0",
36
36
  "@atlaskit/editor-plugin-connectivity": "^3.1.0",
37
37
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
38
38
  "@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
39
39
  "@atlaskit/editor-plugin-selection-toolbar": "^4.3.0",
40
40
  "@atlaskit/editor-plugin-toolbar": "^0.4.0",
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
- "@atlaskit/editor-toolbar": "^0.4.0",
43
- "@atlaskit/editor-toolbar-model": "^0.1.0",
42
+ "@atlaskit/editor-toolbar": "^0.6.0",
43
+ "@atlaskit/editor-toolbar-model": "^0.2.0",
44
44
  "@atlaskit/icon": "^28.1.0",
45
45
  "@atlaskit/platform-feature-flags": "^1.1.0",
46
46
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
47
- "@atlaskit/tmp-editor-statsig": "^11.8.0",
47
+ "@atlaskit/tmp-editor-statsig": "^11.11.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",
50
50
  "uuid": "^3.1.0"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^107.32.0",
53
+ "@atlaskit/editor-common": "^107.34.0",
54
54
  "react": "^18.2.0",
55
55
  "react-dom": "^18.2.0",
56
56
  "react-intl-next": "npm:react-intl@^5.18.1"