@atlaskit/editor-plugin-hyperlink 4.4.11 → 4.5.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,23 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 4.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 4.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#158546](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/158546)
14
+ [`b7fe4e6f226f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b7fe4e6f226f3) -
15
+ ED-27284 use user preferences plugin in editor preset.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 4.4.11
4
22
 
5
23
  ### Patch Changes
@@ -15,6 +15,7 @@ var _preset = require("@atlaskit/editor-common/preset");
15
15
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
16
16
  var _utils = require("@atlaskit/editor-common/utils");
17
17
  var _linkEditorLink = _interopRequireDefault(require("@atlaskit/icon/core/migration/link--editor-link"));
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
19
20
  var _commands = require("./editor-commands/commands");
20
21
  var _fakeCursorForToolbar = _interopRequireDefault(require("./pm-plugins/fake-cursor-for-toolbar"));
@@ -174,9 +175,10 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
174
175
  },
175
176
  floatingToolbar: (0, _Toolbar.getToolbarConfig)(options, api),
176
177
  selectionToolbar: function selectionToolbar(state, _ref5) {
177
- var _api$selectionToolbar;
178
+ var _api$userPreferences, _api$selectionToolbar;
178
179
  var formatMessage = _ref5.formatMessage;
179
- if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'none' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
180
+ var toolbarDocking = (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.preferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
181
+ if (toolbarDocking === 'none' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
180
182
  exposure: true
181
183
  })) {
182
184
  var toolbarButton = function toolbarButton() {
@@ -8,6 +8,7 @@ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
8
8
  import { IconLink } from '@atlaskit/editor-common/quick-insert';
9
9
  import { canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
10
10
  import LinkIcon from '@atlaskit/icon/core/migration/link--editor-link';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
12
13
  import { hideLinkToolbarSetMeta, insertLinkWithAnalytics, removeLinkEditorCommand, showLinkToolbar, updateLink, updateLinkEditorCommand } from './editor-commands/commands';
13
14
  import fakeCursorToolbarPlugin from './pm-plugins/fake-cursor-for-toolbar';
@@ -156,8 +157,9 @@ export const hyperlinkPlugin = ({
156
157
  selectionToolbar: (state, {
157
158
  formatMessage
158
159
  }) => {
159
- var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
160
- if ((api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking) === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
160
+ var _api$userPreferences, _api$userPreferences$, _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
161
+ const toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 ? void 0 : (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 ? void 0 : (_api$userPreferences$ = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences$ === void 0 ? void 0 : _api$userPreferences$.preferences.toolbarDockingPosition : api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking;
162
+ if (toolbarDocking === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
161
163
  exposure: true
162
164
  })) {
163
165
  const toolbarButton = () => {
@@ -8,6 +8,7 @@ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
8
8
  import { IconLink } from '@atlaskit/editor-common/quick-insert';
9
9
  import { canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
10
10
  import LinkIcon from '@atlaskit/icon/core/migration/link--editor-link';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
12
13
  import { hideLinkToolbarSetMeta, insertLinkWithAnalytics, removeLinkEditorCommand, showLinkToolbar as _showLinkToolbar, updateLink, updateLinkEditorCommand } from './editor-commands/commands';
13
14
  import fakeCursorToolbarPlugin from './pm-plugins/fake-cursor-for-toolbar';
@@ -167,9 +168,10 @@ export var hyperlinkPlugin = function hyperlinkPlugin(_ref) {
167
168
  },
168
169
  floatingToolbar: getToolbarConfig(options, api),
169
170
  selectionToolbar: function selectionToolbar(state, _ref5) {
170
- var _api$selectionToolbar;
171
+ var _api$userPreferences, _api$selectionToolbar;
171
172
  var formatMessage = _ref5.formatMessage;
172
- if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
173
+ var toolbarDocking = fg('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.preferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
174
+ if (toolbarDocking === 'none' && editorExperiment('platform_editor_controls', 'variant1', {
173
175
  exposure: true
174
176
  })) {
175
177
  var toolbarButton = function toolbarButton() {
@@ -6,6 +6,7 @@ import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
6
  import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
7
7
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
8
8
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
9
+ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
9
10
  import type { HideLinkToolbar, InsertLink, ShowLinkToolbar, UpdateLink } from './editor-commands/commands';
10
11
  type HyperlinkPluginCommands = {
11
12
  /**
@@ -51,7 +52,8 @@ export type HyperlinkPluginDependencies = [
51
52
  OptionalPlugin<EditorViewModePlugin>,
52
53
  OptionalPlugin<ConnectivityPlugin>,
53
54
  OptionalPlugin<PrimaryToolbarPlugin>,
54
- OptionalPlugin<SelectionToolbarPlugin>
55
+ OptionalPlugin<SelectionToolbarPlugin>,
56
+ OptionalPlugin<UserPreferencesPlugin>
55
57
  ];
56
58
  export type HyperlinkPluginActions = {
57
59
  hideLinkToolbar: HideLinkToolbar;
@@ -6,6 +6,7 @@ import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
6
  import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
7
7
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
8
8
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
9
+ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
9
10
  import type { HideLinkToolbar, InsertLink, ShowLinkToolbar, UpdateLink } from './editor-commands/commands';
10
11
  type HyperlinkPluginCommands = {
11
12
  /**
@@ -51,7 +52,8 @@ export type HyperlinkPluginDependencies = [
51
52
  OptionalPlugin<EditorViewModePlugin>,
52
53
  OptionalPlugin<ConnectivityPlugin>,
53
54
  OptionalPlugin<PrimaryToolbarPlugin>,
54
- OptionalPlugin<SelectionToolbarPlugin>
55
+ OptionalPlugin<SelectionToolbarPlugin>,
56
+ OptionalPlugin<UserPreferencesPlugin>
55
57
  ];
56
58
  export type HyperlinkPluginActions = {
57
59
  hideLinkToolbar: HideLinkToolbar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "4.4.11",
3
+ "version": "4.5.1",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,18 +35,18 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
37
  "@atlaskit/analytics-next": "^11.1.0",
38
- "@atlaskit/editor-common": "^106.6.0",
38
+ "@atlaskit/editor-common": "^106.9.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
40
40
  "@atlaskit/editor-plugin-card": "^6.6.0",
41
41
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
42
42
  "@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
43
43
  "@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
44
- "@atlaskit/editor-plugin-selection-toolbar": "^3.6.0",
44
+ "@atlaskit/editor-plugin-selection-toolbar": "^3.7.0",
45
45
  "@atlaskit/editor-prosemirror": "7.0.0",
46
- "@atlaskit/icon": "^26.4.0",
46
+ "@atlaskit/icon": "^27.0.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
49
- "@atlaskit/tmp-editor-statsig": "^7.0.0",
49
+ "@atlaskit/tmp-editor-statsig": "^7.1.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",
52
52
  "uuid": "^3.1.0"
@@ -105,6 +105,9 @@
105
105
  "linking_platform_smart_links_in_live_pages": {
106
106
  "type": "boolean"
107
107
  },
108
+ "platform_editor_use_preferences_plugin": {
109
+ "type": "boolean"
110
+ },
108
111
  "platform_editor_controls_patch_3": {
109
112
  "type": "boolean"
110
113
  }