@atlaskit/editor-plugin-hyperlink 2.4.0 → 2.4.2

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,20 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 2.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#122063](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122063)
14
+ [`c136e556d086d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c136e556d086d) -
15
+ [ux] Apply live page and check for live view in card and hyperlink plugin
16
+ - Updated dependencies
17
+
3
18
  ## 2.4.0
4
19
 
5
20
  ### Minor Changes
@@ -100,7 +100,10 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
100
100
  plugin: function plugin(_ref2) {
101
101
  var dispatch = _ref2.dispatch,
102
102
  getIntl = _ref2.getIntl;
103
- return (0, _main.plugin)(dispatch, getIntl(), options === null || options === void 0 ? void 0 : options.editorAppearance);
103
+ return (
104
+ // @ts-ignore Temporary solution to check for Live Page editor.
105
+ (0, _main.plugin)(dispatch, getIntl(), options === null || options === void 0 ? void 0 : options.editorAppearance, api, options.__livePage)
106
+ );
104
107
  }
105
108
  }, {
106
109
  name: 'fakeCursorToolbarPlugin',
@@ -158,7 +158,7 @@ var getActiveText = function getActiveText(selection) {
158
158
  return;
159
159
  };
160
160
  var stateKey = exports.stateKey = new _state.PluginKey('hyperlinkPlugin');
161
- var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance) {
161
+ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance, pluginInjectionApi, __livePage) {
162
162
  return new _safePlugin.SafePlugin({
163
163
  state: {
164
164
  init: function init(_, state) {
@@ -193,7 +193,7 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance)
193
193
  timesViewed: state.timesViewed,
194
194
  searchSessionId: state.searchSessionId
195
195
  };
196
- state = _objectSpread(_objectSpread({}, (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages') && state), {}, {
196
+ state = _objectSpread(_objectSpread({}, __livePage && (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages') && state), {}, {
197
197
  activeText: state.activeText,
198
198
  canInsertLink: state.canInsertLink,
199
199
  inputMethod: inputMethod,
@@ -201,39 +201,43 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance)
201
201
  editorAppearance: editorAppearance
202
202
  }, stateForAnalytics);
203
203
  if ((0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages')) {
204
- if (action === _link3.LinkAction.SET_CONFIGURE_DROPDOWN_OPEN) {
205
- var configureDropdownOpen = tr.getMeta(stateKey).isOpen;
206
- // Hide overlay when the dropdown is closed (state is updated to false)
207
- var decorations = configureDropdownOpen ? {} : {
208
- decorations: _view.DecorationSet.empty
209
- };
210
- state = _objectSpread(_objectSpread(_objectSpread({}, state), decorations), {}, {
211
- configureDropdownOpen: configureDropdownOpen
212
- });
213
- }
214
- if (action === _link3.LinkAction.SET_CONFIGURE_BUTTON_TARGET_POS) {
215
- var configureButtonTargetPos = tr.getMeta(stateKey).pos;
216
- var targetPosHasChanged = pluginState.configureButtonTargetPos !== configureButtonTargetPos;
217
- var _decorations = pluginState.decorations;
218
- if (targetPosHasChanged && state.configureDropdownOpen !== true) {
219
- if (configureButtonTargetPos === undefined) {
220
- _decorations = _view.DecorationSet.empty;
221
- } else {
222
- var decoration = _view.Decoration.widget(configureButtonTargetPos, function (view) {
223
- return (0, _decorations2.ButtonWrapper)({
224
- editorView: view,
225
- pos: configureButtonTargetPos,
226
- stateKey: stateKey,
227
- intl: intl
204
+ var _pluginInjectionApi$e;
205
+ var isViewMode = (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode) === 'view';
206
+ if (__livePage && !isViewMode) {
207
+ if (action === _link3.LinkAction.SET_CONFIGURE_DROPDOWN_OPEN) {
208
+ var configureDropdownOpen = tr.getMeta(stateKey).isOpen;
209
+ // Hide overlay when the dropdown is closed (state is updated to false)
210
+ var decorations = configureDropdownOpen ? {} : {
211
+ decorations: _view.DecorationSet.empty
212
+ };
213
+ state = _objectSpread(_objectSpread(_objectSpread({}, state), decorations), {}, {
214
+ configureDropdownOpen: configureDropdownOpen
215
+ });
216
+ }
217
+ if (action === _link3.LinkAction.SET_CONFIGURE_BUTTON_TARGET_POS) {
218
+ var configureButtonTargetPos = tr.getMeta(stateKey).pos;
219
+ var targetPosHasChanged = pluginState.configureButtonTargetPos !== configureButtonTargetPos;
220
+ var _decorations = pluginState.decorations;
221
+ if (targetPosHasChanged && state.configureDropdownOpen !== true) {
222
+ if (configureButtonTargetPos === undefined) {
223
+ _decorations = _view.DecorationSet.empty;
224
+ } else {
225
+ var decoration = _view.Decoration.widget(configureButtonTargetPos, function (view) {
226
+ return (0, _decorations2.ButtonWrapper)({
227
+ editorView: view,
228
+ pos: configureButtonTargetPos,
229
+ stateKey: stateKey,
230
+ intl: intl
231
+ });
228
232
  });
229
- });
230
- _decorations = _view.DecorationSet.create(newState.doc, [decoration]);
233
+ _decorations = _view.DecorationSet.create(newState.doc, [decoration]);
234
+ }
231
235
  }
236
+ state = _objectSpread(_objectSpread({}, state), {}, {
237
+ configureButtonTargetPos: configureButtonTargetPos,
238
+ decorations: _decorations
239
+ });
232
240
  }
233
- state = _objectSpread(_objectSpread({}, state), {}, {
234
- configureButtonTargetPos: configureButtonTargetPos,
235
- decorations: _decorations
236
- });
237
241
  }
238
242
  }
239
243
  }
@@ -258,7 +262,7 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance)
258
262
  key: stateKey,
259
263
  props: _objectSpread({
260
264
  decorations: function decorations(state) {
261
- if ((0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages')) {
265
+ if (__livePage && (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages')) {
262
266
  var _stateKey$getState;
263
267
  var _ref = (_stateKey$getState = stateKey.getState(state)) !== null && _stateKey$getState !== void 0 ? _stateKey$getState : {},
264
268
  decorations = _ref.decorations;
@@ -297,7 +301,7 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance)
297
301
  return false;
298
302
  }
299
303
  }
300
- }, (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages') && {
304
+ }, __livePage && (0, _platformFeatureFlags.fg)('platform.linking-platform.smart-links-in-live-pages') && {
301
305
  markViews: {
302
306
  link: function link(mark, view, inline) {
303
307
  var toDOM = mark.type.spec.toDOM;
@@ -85,7 +85,9 @@ export const hyperlinkPlugin = ({
85
85
  plugin: ({
86
86
  dispatch,
87
87
  getIntl
88
- }) => plugin(dispatch, getIntl(), options === null || options === void 0 ? void 0 : options.editorAppearance)
88
+ }) =>
89
+ // @ts-ignore Temporary solution to check for Live Page editor.
90
+ plugin(dispatch, getIntl(), options === null || options === void 0 ? void 0 : options.editorAppearance, api, options.__livePage)
89
91
  }, {
90
92
  name: 'fakeCursorToolbarPlugin',
91
93
  plugin: () => fakeCursorToolbarPlugin
@@ -159,7 +159,7 @@ const getActiveText = selection => {
159
159
  return;
160
160
  };
161
161
  export const stateKey = new PluginKey('hyperlinkPlugin');
162
- export const plugin = (dispatch, intl, editorAppearance) => new SafePlugin({
162
+ export const plugin = (dispatch, intl, editorAppearance, pluginInjectionApi, __livePage) => new SafePlugin({
163
163
  state: {
164
164
  init(_, state) {
165
165
  const canInsertLink = canLinkBeCreatedInRange(state.selection.from, state.selection.to)(state);
@@ -194,7 +194,7 @@ export const plugin = (dispatch, intl, editorAppearance) => new SafePlugin({
194
194
  searchSessionId: state.searchSessionId
195
195
  };
196
196
  state = {
197
- ...(fg('platform.linking-platform.smart-links-in-live-pages') && state),
197
+ ...(__livePage && fg('platform.linking-platform.smart-links-in-live-pages') && state),
198
198
  activeText: state.activeText,
199
199
  canInsertLink: state.canInsertLink,
200
200
  inputMethod,
@@ -203,42 +203,46 @@ export const plugin = (dispatch, intl, editorAppearance) => new SafePlugin({
203
203
  ...stateForAnalytics
204
204
  };
205
205
  if (fg('platform.linking-platform.smart-links-in-live-pages')) {
206
- if (action === LinkAction.SET_CONFIGURE_DROPDOWN_OPEN) {
207
- const configureDropdownOpen = tr.getMeta(stateKey).isOpen;
208
- // Hide overlay when the dropdown is closed (state is updated to false)
209
- const decorations = configureDropdownOpen ? {} : {
210
- decorations: DecorationSet.empty
211
- };
212
- state = {
213
- ...state,
214
- ...decorations,
215
- configureDropdownOpen
216
- };
217
- }
218
- if (action === LinkAction.SET_CONFIGURE_BUTTON_TARGET_POS) {
219
- const configureButtonTargetPos = tr.getMeta(stateKey).pos;
220
- const targetPosHasChanged = pluginState.configureButtonTargetPos !== configureButtonTargetPos;
221
- let decorations = pluginState.decorations;
222
- if (targetPosHasChanged && state.configureDropdownOpen !== true) {
223
- if (configureButtonTargetPos === undefined) {
224
- decorations = DecorationSet.empty;
225
- } else {
226
- const decoration = Decoration.widget(configureButtonTargetPos, view => {
227
- return ButtonWrapper({
228
- editorView: view,
229
- pos: configureButtonTargetPos,
230
- stateKey,
231
- intl
206
+ var _pluginInjectionApi$e, _pluginInjectionApi$e2;
207
+ const isViewMode = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 ? void 0 : (_pluginInjectionApi$e2 = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) === 'view';
208
+ if (__livePage && !isViewMode) {
209
+ if (action === LinkAction.SET_CONFIGURE_DROPDOWN_OPEN) {
210
+ const configureDropdownOpen = tr.getMeta(stateKey).isOpen;
211
+ // Hide overlay when the dropdown is closed (state is updated to false)
212
+ const decorations = configureDropdownOpen ? {} : {
213
+ decorations: DecorationSet.empty
214
+ };
215
+ state = {
216
+ ...state,
217
+ ...decorations,
218
+ configureDropdownOpen
219
+ };
220
+ }
221
+ if (action === LinkAction.SET_CONFIGURE_BUTTON_TARGET_POS) {
222
+ const configureButtonTargetPos = tr.getMeta(stateKey).pos;
223
+ const targetPosHasChanged = pluginState.configureButtonTargetPos !== configureButtonTargetPos;
224
+ let decorations = pluginState.decorations;
225
+ if (targetPosHasChanged && state.configureDropdownOpen !== true) {
226
+ if (configureButtonTargetPos === undefined) {
227
+ decorations = DecorationSet.empty;
228
+ } else {
229
+ const decoration = Decoration.widget(configureButtonTargetPos, view => {
230
+ return ButtonWrapper({
231
+ editorView: view,
232
+ pos: configureButtonTargetPos,
233
+ stateKey,
234
+ intl
235
+ });
232
236
  });
233
- });
234
- decorations = DecorationSet.create(newState.doc, [decoration]);
237
+ decorations = DecorationSet.create(newState.doc, [decoration]);
238
+ }
235
239
  }
240
+ state = {
241
+ ...state,
242
+ configureButtonTargetPos,
243
+ decorations
244
+ };
236
245
  }
237
- state = {
238
- ...state,
239
- configureButtonTargetPos,
240
- decorations
241
- };
242
246
  }
243
247
  }
244
248
  }
@@ -263,7 +267,7 @@ export const plugin = (dispatch, intl, editorAppearance) => new SafePlugin({
263
267
  key: stateKey,
264
268
  props: {
265
269
  decorations: state => {
266
- if (fg('platform.linking-platform.smart-links-in-live-pages')) {
270
+ if (__livePage && fg('platform.linking-platform.smart-links-in-live-pages')) {
267
271
  var _stateKey$getState;
268
272
  const {
269
273
  decorations
@@ -309,7 +313,7 @@ export const plugin = (dispatch, intl, editorAppearance) => new SafePlugin({
309
313
  return false;
310
314
  }
311
315
  },
312
- ...(fg('platform.linking-platform.smart-links-in-live-pages') && {
316
+ ...(__livePage && fg('platform.linking-platform.smart-links-in-live-pages') && {
313
317
  markViews: {
314
318
  link: (mark, view, inline) => {
315
319
  const toDOM = mark.type.spec.toDOM;
@@ -93,7 +93,10 @@ export var hyperlinkPlugin = function hyperlinkPlugin(_ref) {
93
93
  plugin: function plugin(_ref2) {
94
94
  var dispatch = _ref2.dispatch,
95
95
  getIntl = _ref2.getIntl;
96
- return _plugin(dispatch, getIntl(), options === null || options === void 0 ? void 0 : options.editorAppearance);
96
+ return (
97
+ // @ts-ignore Temporary solution to check for Live Page editor.
98
+ _plugin(dispatch, getIntl(), options === null || options === void 0 ? void 0 : options.editorAppearance, api, options.__livePage)
99
+ );
97
100
  }
98
101
  }, {
99
102
  name: 'fakeCursorToolbarPlugin',
@@ -151,7 +151,7 @@ var getActiveText = function getActiveText(selection) {
151
151
  return;
152
152
  };
153
153
  export var stateKey = new PluginKey('hyperlinkPlugin');
154
- export var plugin = function plugin(dispatch, intl, editorAppearance) {
154
+ export var plugin = function plugin(dispatch, intl, editorAppearance, pluginInjectionApi, __livePage) {
155
155
  return new SafePlugin({
156
156
  state: {
157
157
  init: function init(_, state) {
@@ -186,7 +186,7 @@ export var plugin = function plugin(dispatch, intl, editorAppearance) {
186
186
  timesViewed: state.timesViewed,
187
187
  searchSessionId: state.searchSessionId
188
188
  };
189
- state = _objectSpread(_objectSpread({}, fg('platform.linking-platform.smart-links-in-live-pages') && state), {}, {
189
+ state = _objectSpread(_objectSpread({}, __livePage && fg('platform.linking-platform.smart-links-in-live-pages') && state), {}, {
190
190
  activeText: state.activeText,
191
191
  canInsertLink: state.canInsertLink,
192
192
  inputMethod: inputMethod,
@@ -194,39 +194,43 @@ export var plugin = function plugin(dispatch, intl, editorAppearance) {
194
194
  editorAppearance: editorAppearance
195
195
  }, stateForAnalytics);
196
196
  if (fg('platform.linking-platform.smart-links-in-live-pages')) {
197
- if (action === LinkAction.SET_CONFIGURE_DROPDOWN_OPEN) {
198
- var configureDropdownOpen = tr.getMeta(stateKey).isOpen;
199
- // Hide overlay when the dropdown is closed (state is updated to false)
200
- var decorations = configureDropdownOpen ? {} : {
201
- decorations: DecorationSet.empty
202
- };
203
- state = _objectSpread(_objectSpread(_objectSpread({}, state), decorations), {}, {
204
- configureDropdownOpen: configureDropdownOpen
205
- });
206
- }
207
- if (action === LinkAction.SET_CONFIGURE_BUTTON_TARGET_POS) {
208
- var configureButtonTargetPos = tr.getMeta(stateKey).pos;
209
- var targetPosHasChanged = pluginState.configureButtonTargetPos !== configureButtonTargetPos;
210
- var _decorations = pluginState.decorations;
211
- if (targetPosHasChanged && state.configureDropdownOpen !== true) {
212
- if (configureButtonTargetPos === undefined) {
213
- _decorations = DecorationSet.empty;
214
- } else {
215
- var decoration = Decoration.widget(configureButtonTargetPos, function (view) {
216
- return ButtonWrapper({
217
- editorView: view,
218
- pos: configureButtonTargetPos,
219
- stateKey: stateKey,
220
- intl: intl
197
+ var _pluginInjectionApi$e;
198
+ var isViewMode = (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode) === 'view';
199
+ if (__livePage && !isViewMode) {
200
+ if (action === LinkAction.SET_CONFIGURE_DROPDOWN_OPEN) {
201
+ var configureDropdownOpen = tr.getMeta(stateKey).isOpen;
202
+ // Hide overlay when the dropdown is closed (state is updated to false)
203
+ var decorations = configureDropdownOpen ? {} : {
204
+ decorations: DecorationSet.empty
205
+ };
206
+ state = _objectSpread(_objectSpread(_objectSpread({}, state), decorations), {}, {
207
+ configureDropdownOpen: configureDropdownOpen
208
+ });
209
+ }
210
+ if (action === LinkAction.SET_CONFIGURE_BUTTON_TARGET_POS) {
211
+ var configureButtonTargetPos = tr.getMeta(stateKey).pos;
212
+ var targetPosHasChanged = pluginState.configureButtonTargetPos !== configureButtonTargetPos;
213
+ var _decorations = pluginState.decorations;
214
+ if (targetPosHasChanged && state.configureDropdownOpen !== true) {
215
+ if (configureButtonTargetPos === undefined) {
216
+ _decorations = DecorationSet.empty;
217
+ } else {
218
+ var decoration = Decoration.widget(configureButtonTargetPos, function (view) {
219
+ return ButtonWrapper({
220
+ editorView: view,
221
+ pos: configureButtonTargetPos,
222
+ stateKey: stateKey,
223
+ intl: intl
224
+ });
221
225
  });
222
- });
223
- _decorations = DecorationSet.create(newState.doc, [decoration]);
226
+ _decorations = DecorationSet.create(newState.doc, [decoration]);
227
+ }
224
228
  }
229
+ state = _objectSpread(_objectSpread({}, state), {}, {
230
+ configureButtonTargetPos: configureButtonTargetPos,
231
+ decorations: _decorations
232
+ });
225
233
  }
226
- state = _objectSpread(_objectSpread({}, state), {}, {
227
- configureButtonTargetPos: configureButtonTargetPos,
228
- decorations: _decorations
229
- });
230
234
  }
231
235
  }
232
236
  }
@@ -251,7 +255,7 @@ export var plugin = function plugin(dispatch, intl, editorAppearance) {
251
255
  key: stateKey,
252
256
  props: _objectSpread({
253
257
  decorations: function decorations(state) {
254
- if (fg('platform.linking-platform.smart-links-in-live-pages')) {
258
+ if (__livePage && fg('platform.linking-platform.smart-links-in-live-pages')) {
255
259
  var _stateKey$getState;
256
260
  var _ref = (_stateKey$getState = stateKey.getState(state)) !== null && _stateKey$getState !== void 0 ? _stateKey$getState : {},
257
261
  decorations = _ref.decorations;
@@ -290,7 +294,7 @@ export var plugin = function plugin(dispatch, intl, editorAppearance) {
290
294
  return false;
291
295
  }
292
296
  }
293
- }, fg('platform.linking-platform.smart-links-in-live-pages') && {
297
+ }, __livePage && fg('platform.linking-platform.smart-links-in-live-pages') && {
294
298
  markViews: {
295
299
  link: function link(mark, view, inline) {
296
300
  var toDOM = mark.type.spec.toDOM;
@@ -2,10 +2,15 @@ import type { HyperlinkState } from '@atlaskit/editor-common/link';
2
2
  import type { EditorCommand, HyperlinkPluginOptions, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
3
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
4
  import type { CardPlugin } from '@atlaskit/editor-plugin-card';
5
+ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
5
6
  import type { HideLinkToolbar, InsertLink, ShowLinkToolbar, UpdateLink } from './commands';
6
7
  export type HyperlinkPlugin = NextEditorPlugin<'hyperlink', {
7
8
  pluginConfiguration: HyperlinkPluginOptions | undefined;
8
- dependencies: [OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<CardPlugin>];
9
+ dependencies: [
10
+ OptionalPlugin<AnalyticsPlugin>,
11
+ OptionalPlugin<CardPlugin>,
12
+ OptionalPlugin<EditorViewModePlugin>
13
+ ];
9
14
  actions: {
10
15
  hideLinkToolbar: HideLinkToolbar;
11
16
  insertLink: InsertLink;
@@ -2,7 +2,8 @@ import { type IntlShape } from 'react-intl-next';
2
2
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import type { HyperlinkState } from '@atlaskit/editor-common/link';
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
- import type { EditorAppearance } from '@atlaskit/editor-common/types';
5
+ import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
+ import type { HyperlinkPlugin } from '../plugin';
7
8
  export declare const stateKey: PluginKey<HyperlinkState>;
8
- export declare const plugin: (dispatch: Dispatch, intl: IntlShape, editorAppearance?: EditorAppearance) => SafePlugin<HyperlinkState>;
9
+ export declare const plugin: (dispatch: Dispatch, intl: IntlShape, editorAppearance?: EditorAppearance, pluginInjectionApi?: ExtractInjectionAPI<HyperlinkPlugin> | undefined, __livePage?: boolean) => SafePlugin<HyperlinkState>;
@@ -2,12 +2,14 @@ import type { HyperlinkState } from '@atlaskit/editor-common/link';
2
2
  import type { EditorCommand, HyperlinkPluginOptions, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
3
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
4
  import type { CardPlugin } from '@atlaskit/editor-plugin-card';
5
+ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
5
6
  import type { HideLinkToolbar, InsertLink, ShowLinkToolbar, UpdateLink } from './commands';
6
7
  export type HyperlinkPlugin = NextEditorPlugin<'hyperlink', {
7
8
  pluginConfiguration: HyperlinkPluginOptions | undefined;
8
9
  dependencies: [
9
10
  OptionalPlugin<AnalyticsPlugin>,
10
- OptionalPlugin<CardPlugin>
11
+ OptionalPlugin<CardPlugin>,
12
+ OptionalPlugin<EditorViewModePlugin>
11
13
  ];
12
14
  actions: {
13
15
  hideLinkToolbar: HideLinkToolbar;
@@ -2,7 +2,8 @@ import { type IntlShape } from 'react-intl-next';
2
2
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import type { HyperlinkState } from '@atlaskit/editor-common/link';
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
- import type { EditorAppearance } from '@atlaskit/editor-common/types';
5
+ import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
+ import type { HyperlinkPlugin } from '../plugin';
7
8
  export declare const stateKey: PluginKey<HyperlinkState>;
8
- export declare const plugin: (dispatch: Dispatch, intl: IntlShape, editorAppearance?: EditorAppearance) => SafePlugin<HyperlinkState>;
9
+ export declare const plugin: (dispatch: Dispatch, intl: IntlShape, editorAppearance?: EditorAppearance, pluginInjectionApi?: ExtractInjectionAPI<HyperlinkPlugin> | undefined, __livePage?: boolean) => SafePlugin<HyperlinkState>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,11 +34,12 @@
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^39.0.3",
36
36
  "@atlaskit/analytics-next": "^9.3.0",
37
- "@atlaskit/editor-common": "^86.2.0",
37
+ "@atlaskit/editor-common": "^86.4.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
39
- "@atlaskit/editor-plugin-card": "2.6.3",
39
+ "@atlaskit/editor-plugin-card": "2.6.5",
40
+ "@atlaskit/editor-plugin-editor-viewmode": "^2.0.0",
40
41
  "@atlaskit/editor-prosemirror": "4.0.1",
41
- "@atlaskit/icon": "^22.6.0",
42
+ "@atlaskit/icon": "^22.7.0",
42
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
43
44
  "@atlaskit/prosemirror-input-rules": "^3.1.0",
44
45
  "@babel/runtime": "^7.0.0",