@atlaskit/editor-plugin-hyperlink 0.6.1 → 0.6.3

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,17 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 0.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#56790](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56790) [`ff577a7969d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ff577a7969d4) - ED-21266: Updated @atlaskit/adf-schema to 34.0.1
8
+
9
+ ## 0.6.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42839](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42839) [`7324375d4fa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7324375d4fa) - [ux] Cleansup feature flag `prevent-popup-overflow` so that it is permanently enabled when `lp-link-picker` flag is enabled, improving the positioning of the link picker.
14
+
3
15
  ## 0.6.1
4
16
 
5
17
  ### Patch Changes
@@ -114,8 +114,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
114
114
  var formatMessage = intl.formatMessage;
115
115
  var linkState = _main.stateKey.getState(state);
116
116
  var editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
117
- var lpLinkPicker = featureFlags.lpLinkPicker,
118
- preventPopupOverflow = featureFlags.preventPopupOverflow;
117
+ var lpLinkPicker = featureFlags.lpLinkPicker;
119
118
  if (linkState && linkState.activeLinkMark) {
120
119
  var activeLinkMark = linkState.activeLinkMark;
121
120
  var hyperLinkToolbar = {
@@ -213,7 +212,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
213
212
  var displayText = isEditLink(activeLinkMark) ? getLinkText(activeLinkMark, state) : linkState.activeText;
214
213
  var popupHeight = lpLinkPicker ? _ui.LINKPICKER_HEIGHT_IN_PX : _ui.RECENT_SEARCH_HEIGHT_IN_PX;
215
214
  return _objectSpread(_objectSpread({}, hyperLinkToolbar), {}, {
216
- preventPopupOverflow: preventPopupOverflow,
215
+ preventPopupOverflow: !!lpLinkPicker,
217
216
  height: popupHeight,
218
217
  width: _ui.RECENT_SEARCH_WIDTH_IN_PX,
219
218
  items: [{
@@ -99,8 +99,7 @@ export const getToolbarConfig = (options, featureFlags, pluginInjectionApi) => (
99
99
  const linkState = stateKey.getState(state);
100
100
  const editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
101
101
  const {
102
- lpLinkPicker,
103
- preventPopupOverflow
102
+ lpLinkPicker
104
103
  } = featureFlags;
105
104
  if (linkState && linkState.activeLinkMark) {
106
105
  const {
@@ -199,7 +198,7 @@ export const getToolbarConfig = (options, featureFlags, pluginInjectionApi) => (
199
198
  const popupHeight = lpLinkPicker ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX;
200
199
  return {
201
200
  ...hyperLinkToolbar,
202
- preventPopupOverflow,
201
+ preventPopupOverflow: !!lpLinkPicker,
203
202
  height: popupHeight,
204
203
  width: RECENT_SEARCH_WIDTH_IN_PX,
205
204
  items: [{
@@ -106,8 +106,7 @@ export var getToolbarConfig = function getToolbarConfig(options, featureFlags, p
106
106
  var formatMessage = intl.formatMessage;
107
107
  var linkState = stateKey.getState(state);
108
108
  var editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
109
- var lpLinkPicker = featureFlags.lpLinkPicker,
110
- preventPopupOverflow = featureFlags.preventPopupOverflow;
109
+ var lpLinkPicker = featureFlags.lpLinkPicker;
111
110
  if (linkState && linkState.activeLinkMark) {
112
111
  var activeLinkMark = linkState.activeLinkMark;
113
112
  var hyperLinkToolbar = {
@@ -205,7 +204,7 @@ export var getToolbarConfig = function getToolbarConfig(options, featureFlags, p
205
204
  var displayText = isEditLink(activeLinkMark) ? getLinkText(activeLinkMark, state) : linkState.activeText;
206
205
  var popupHeight = lpLinkPicker ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX;
207
206
  return _objectSpread(_objectSpread({}, hyperLinkToolbar), {}, {
208
- preventPopupOverflow: preventPopupOverflow,
207
+ preventPopupOverflow: !!lpLinkPicker,
209
208
  height: popupHeight,
210
209
  width: RECENT_SEARCH_WIDTH_IN_PX,
211
210
  items: [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,9 +31,9 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/adf-schema": "^34.0.0",
34
+ "@atlaskit/adf-schema": "^34.0.1",
35
35
  "@atlaskit/analytics-next": "^9.1.0",
36
- "@atlaskit/editor-common": "^76.22.0",
36
+ "@atlaskit/editor-common": "^76.23.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^0.3.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
39
39
  "@atlaskit/editor-prosemirror": "1.1.0",
@@ -1,84 +0,0 @@
1
- ## API Report File for "@atlaskit/editor-plugin-hyperlink"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
- import type { Command } from '@atlaskit/editor-common/types';
9
- import type { EditorCommand } from '@atlaskit/editor-common/types';
10
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
11
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
12
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
13
- import type { FloatingToolbarItem } from '@atlaskit/editor-common/types';
14
- import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
15
- import type { HyperlinkState } from '@atlaskit/editor-common/link';
16
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
17
- import type { IntlShape } from 'react-intl-next';
18
- import type { LinkInputType } from '@atlaskit/editor-common/types';
19
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
20
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
21
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
22
- import type { QueueCardsFromTransactionAction } from '@atlaskit/editor-common/card';
23
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
24
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
25
-
26
- // @public (undocumented)
27
- type GetToolbarItems = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory, link: string) => FloatingToolbarItem<any>[];
28
-
29
- // @public (undocumented)
30
- export type HideLinkToolbar = (tr: Transaction) => Transaction;
31
-
32
- // @public (undocumented)
33
- export type HyperlinkPlugin = NextEditorPlugin<'hyperlink', {
34
- pluginConfiguration: HyperlinkPluginOptions | undefined;
35
- dependencies: [
36
- OptionalPlugin<FeatureFlagsPlugin>,
37
- OptionalPlugin<AnalyticsPlugin>
38
- ];
39
- actions: {
40
- prependToolbarButtons: PrependToolbarButtons;
41
- hideLinkToolbar: HideLinkToolbar;
42
- insertLink: InsertLink;
43
- updateLink: UpdateLink;
44
- };
45
- commands: {
46
- showLinkToolbar: ShowLinkToolbar;
47
- };
48
- sharedState: HyperlinkState | undefined;
49
- }>;
50
-
51
- // @public
52
- export const hyperlinkPlugin: HyperlinkPlugin;
53
-
54
- // @public (undocumented)
55
- type HyperlinkToolbarItemsState = {
56
- items: GetToolbarItems;
57
- onEscapeCallback: ((tr: Transaction) => Transaction) | undefined;
58
- onInsertLinkCallback: QueueCardsFromTransactionAction | undefined;
59
- };
60
-
61
- // @public (undocumented)
62
- type InputMethod = INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TOOLBAR;
63
-
64
- // @public (undocumented)
65
- export type InsertLink = (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string, cardsAvailable?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command;
66
-
67
- // @public (undocumented)
68
- export type PrependToolbarButtons = (props: PrependToolbarButtonsProps) => void;
69
-
70
- // @public (undocumented)
71
- interface PrependToolbarButtonsProps extends HyperlinkToolbarItemsState {
72
- // (undocumented)
73
- view: EditorView;
74
- }
75
-
76
- // @public (undocumented)
77
- export type ShowLinkToolbar = (inputMethod: InputMethod) => EditorCommand;
78
-
79
- // @public (undocumented)
80
- export type UpdateLink = (href: string, text: string, pos: number, to?: number) => Command;
81
-
82
- // (No @packageDocumentation comment for this package)
83
-
84
- ```