@atlaskit/editor-plugin-hyperlink 28.0.3 → 28.0.5
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 +12 -0
- package/dist/cjs/editor-commands/commands.js +27 -24
- package/dist/cjs/hyperlinkPlugin.js +16 -16
- package/dist/cjs/pm-plugins/input-rule.js +12 -10
- package/dist/cjs/pm-plugins/keymap.js +9 -8
- package/dist/cjs/pm-plugins/main.js +10 -9
- package/dist/cjs/ui/PrimaryToolbarComponent.js +6 -6
- package/dist/cjs/ui/quick-insert/HyperlinkQuickInsertMenuItem.js +12 -12
- package/dist/cjs/ui/quick-insert/getHyperlinkQuickInsertComponents.js +3 -3
- package/dist/cjs/ui/toolbar/LinkButton.js +13 -11
- package/dist/cjs/ui/toolbar/Toolbar.js +29 -27
- package/dist/cjs/ui/toolbar-components.js +12 -11
- package/dist/es2019/editor-commands/commands.js +8 -5
- package/dist/es2019/hyperlinkPlugin.js +4 -4
- package/dist/es2019/pm-plugins/input-rule.js +5 -3
- package/dist/es2019/pm-plugins/keymap.js +3 -2
- package/dist/es2019/pm-plugins/main.js +2 -1
- package/dist/es2019/ui/PrimaryToolbarComponent.js +3 -3
- package/dist/es2019/ui/quick-insert/HyperlinkQuickInsertMenuItem.js +2 -2
- package/dist/es2019/ui/quick-insert/getHyperlinkQuickInsertComponents.js +1 -1
- package/dist/es2019/ui/toolbar/LinkButton.js +6 -4
- package/dist/es2019/ui/toolbar/Toolbar.js +10 -8
- package/dist/es2019/ui/toolbar-components.js +2 -1
- package/dist/esm/editor-commands/commands.js +8 -5
- package/dist/esm/hyperlinkPlugin.js +4 -4
- package/dist/esm/pm-plugins/input-rule.js +5 -3
- package/dist/esm/pm-plugins/keymap.js +3 -2
- package/dist/esm/pm-plugins/main.js +2 -1
- package/dist/esm/ui/PrimaryToolbarComponent.js +3 -3
- package/dist/esm/ui/quick-insert/HyperlinkQuickInsertMenuItem.js +2 -2
- package/dist/esm/ui/quick-insert/getHyperlinkQuickInsertComponents.js +1 -1
- package/dist/esm/ui/toolbar/LinkButton.js +6 -4
- package/dist/esm/ui/toolbar/Toolbar.js +10 -8
- package/dist/esm/ui/toolbar-components.js +2 -1
- package/dist/types/editor-commands/commands.d.ts +7 -5
- package/dist/types/hyperlinkPluginType.d.ts +12 -10
- package/dist/types/pm-plugins/input-rule.d.ts +2 -2
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +4 -3
- package/dist/types/ui/PrimaryToolbarComponent.d.ts +2 -2
- package/dist/types/ui/quick-insert/HyperlinkQuickInsertMenuItem.d.ts +1 -1
- package/dist/types/ui/quick-insert/getHyperlinkQuickInsertComponents.d.ts +1 -1
- package/dist/types/ui/toolbar/LinkButton.d.ts +1 -1
- package/dist/types/ui/toolbar/Toolbar.d.ts +4 -2
- package/dist/types/ui/toolbar-components.d.ts +2 -2
- package/package.json +2 -2
|
@@ -11,18 +11,20 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _isSafeUrl = require("@atlaskit/adf-schema/is-safe-url");
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
14
|
+
var _linkingUtils = require("@atlaskit/editor-common/analytics/linking-utils");
|
|
15
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
16
|
+
var _utils = require("@atlaskit/editor-common/card/utils");
|
|
17
|
+
var _isOfflineMode = require("@atlaskit/editor-common/connectivity/isOfflineMode");
|
|
18
|
+
var _linkSearchConstants = require("@atlaskit/editor-common/link-search-constants");
|
|
19
|
+
var _HyperlinkAddToolbar = require("@atlaskit/editor-common/link/HyperlinkAddToolbar");
|
|
20
|
+
var _link2 = require("@atlaskit/editor-common/messages/link");
|
|
21
|
+
var _linkToolbar = require("@atlaskit/editor-common/messages/link-toolbar");
|
|
19
22
|
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
23
|
+
var _UserIntentPopupWrapper = require("@atlaskit/editor-common/UserIntentPopupWrapper");
|
|
24
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
25
|
+
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
24
26
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
25
|
-
var
|
|
27
|
+
var _utils3 = require("@atlaskit/editor-prosemirror/utils");
|
|
26
28
|
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
|
|
27
29
|
var _linkBroken = _interopRequireDefault(require("@atlaskit/icon/core/link-broken"));
|
|
28
30
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
@@ -40,13 +42,13 @@ function isEditLink(linkMark) {
|
|
|
40
42
|
var dispatchAnalytics = function dispatchAnalytics(dispatch, state, analyticsBuilder, editorAnalyticsApi) {
|
|
41
43
|
if (dispatch) {
|
|
42
44
|
var tr = state.tr;
|
|
43
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent(analyticsBuilder(
|
|
45
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent(analyticsBuilder(_enums.ACTION_SUBJECT_ID.HYPERLINK))(tr);
|
|
44
46
|
dispatch(tr);
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
var visitHyperlink = function visitHyperlink(editorAnalyticsApi) {
|
|
48
50
|
return function (state, dispatch) {
|
|
49
|
-
dispatchAnalytics(dispatch, state,
|
|
51
|
+
dispatchAnalytics(dispatch, state, _linkingUtils.buildVisitedLinkPayload, editorAnalyticsApi);
|
|
50
52
|
return true;
|
|
51
53
|
};
|
|
52
54
|
};
|
|
@@ -54,7 +56,7 @@ function getLinkText(activeLinkMark, state) {
|
|
|
54
56
|
if (!activeLinkMark.node) {
|
|
55
57
|
return undefined;
|
|
56
58
|
}
|
|
57
|
-
var textToUrl = (0,
|
|
59
|
+
var textToUrl = (0, _utils2.normalizeUrl)(activeLinkMark.node.text);
|
|
58
60
|
var linkMark = activeLinkMark.node.marks.find(function (mark) {
|
|
59
61
|
return mark.type === state.schema.marks.link;
|
|
60
62
|
});
|
|
@@ -88,7 +90,7 @@ function HyperlinkAddToolbarWithState(_ref) {
|
|
|
88
90
|
onEscapeCallback = _ref.onEscapeCallback,
|
|
89
91
|
onClickAwayCallback = _ref.onClickAwayCallback,
|
|
90
92
|
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
91
|
-
var _useSharedPluginState = (0,
|
|
93
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(pluginInjectionApi, ['hyperlink'], selector),
|
|
92
94
|
timesViewed = _useSharedPluginState.timesViewed,
|
|
93
95
|
inputMethod = _useSharedPluginState.inputMethod,
|
|
94
96
|
searchSessionId = _useSharedPluginState.searchSessionId;
|
|
@@ -96,8 +98,8 @@ function HyperlinkAddToolbarWithState(_ref) {
|
|
|
96
98
|
// This is constant rather than dynamic - because if someone's already got a hyperlink toolbar open,
|
|
97
99
|
// we don't want to dynamically change it on them as this would cause data loss if they've already
|
|
98
100
|
// started typing in the fields.
|
|
99
|
-
var isOffline = (0, _react.useRef)((0,
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
101
|
+
var isOffline = (0, _react.useRef)((0, _isOfflineMode.isOfflineMode)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.connectivity) === null || _pluginInjectionApi$c === void 0 || (_pluginInjectionApi$c = _pluginInjectionApi$c.sharedState.currentState()) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.mode));
|
|
102
|
+
return /*#__PURE__*/_react.default.createElement(_HyperlinkAddToolbar.HyperlinkAddToolbar, {
|
|
101
103
|
linkPickerOptions: linkPickerOptions,
|
|
102
104
|
onSubmit: onSubmit,
|
|
103
105
|
displayText: displayText,
|
|
@@ -148,7 +150,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
|
|
|
148
150
|
// However, when the user clicks in right after the link the view.state.selection.from references to the dom after the selection.
|
|
149
151
|
// So instead we want to use the activeLinkMark.pos which has been calculated as the position before the click so that would be the link node
|
|
150
152
|
getDomRef: activeLinkMark && (activeLinkMark.type === 'EDIT_INSERTED' || activeLinkMark.type === 'EDIT') && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? function (view) {
|
|
151
|
-
var domRef = (0,
|
|
153
|
+
var domRef = (0, _utils3.findDomRefAtPos)(activeLinkMark.pos, view.domAtPos.bind(view));
|
|
152
154
|
return domRef instanceof HTMLElement ? domRef : undefined;
|
|
153
155
|
} : undefined
|
|
154
156
|
};
|
|
@@ -163,10 +165,10 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
|
|
|
163
165
|
});
|
|
164
166
|
var link = linkMark[0] && linkMark[0].attrs.href;
|
|
165
167
|
var isValidUrl = (0, _isSafeUrl.isSafeUrl)(link);
|
|
166
|
-
var labelOpenLink = formatMessage(isValidUrl ?
|
|
168
|
+
var labelOpenLink = formatMessage(isValidUrl ? _link2.linkMessages.openLink : _linkToolbar.linkToolbarMessages.unableToOpenLink);
|
|
167
169
|
// TODO: ED-14403 - investigate why these are not translating?
|
|
168
|
-
var labelUnlink = formatMessage(
|
|
169
|
-
var editLink = formatMessage(
|
|
170
|
+
var labelUnlink = formatMessage(_linkToolbar.linkToolbarMessages.unlink);
|
|
171
|
+
var editLink = formatMessage(_linkToolbar.linkToolbarMessages.editLink);
|
|
170
172
|
var metadata = {
|
|
171
173
|
url: link,
|
|
172
174
|
title: ''
|
|
@@ -206,8 +208,8 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
|
|
|
206
208
|
id: 'editor.link.unlink',
|
|
207
209
|
testId: 'editor.link.unlink',
|
|
208
210
|
type: 'button',
|
|
209
|
-
onClick: (0,
|
|
210
|
-
inputMethod:
|
|
211
|
+
onClick: (0, _utils.commandWithMetadata)((0, _commands.removeLink)(pos, editorAnalyticsApi), {
|
|
212
|
+
inputMethod: _enums.INPUT_METHOD.FLOATING_TB
|
|
211
213
|
}),
|
|
212
214
|
title: labelUnlink,
|
|
213
215
|
icon: _linkBroken.default,
|
|
@@ -250,8 +252,8 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
|
|
|
250
252
|
_link = _linkMark[0] && _linkMark[0].attrs.href;
|
|
251
253
|
}
|
|
252
254
|
var displayText = isEditLink(activeLinkMark) ? getLinkText(activeLinkMark, state) : linkState.activeText;
|
|
253
|
-
var popupHeight = (_options$linkPicker$p = options === null || options === void 0 || (_options$linkPicker = options.linkPicker) === null || _options$linkPicker === void 0 ? void 0 : _options$linkPicker.popupHeight) !== null && _options$linkPicker$p !== void 0 ? _options$linkPicker$p : lpLinkPicker ?
|
|
254
|
-
var popupWidth = (_options$linkPicker$p2 = options === null || options === void 0 || (_options$linkPicker2 = options.linkPicker) === null || _options$linkPicker2 === void 0 ? void 0 : _options$linkPicker2.popupWidth) !== null && _options$linkPicker$p2 !== void 0 ? _options$linkPicker$p2 : !lpLinkPicker ? undefined :
|
|
255
|
+
var popupHeight = (_options$linkPicker$p = options === null || options === void 0 || (_options$linkPicker = options.linkPicker) === null || _options$linkPicker === void 0 ? void 0 : _options$linkPicker.popupHeight) !== null && _options$linkPicker$p !== void 0 ? _options$linkPicker$p : lpLinkPicker ? _linkSearchConstants.LINKPICKER_HEIGHT_IN_PX : _linkSearchConstants.RECENT_SEARCH_HEIGHT_IN_PX;
|
|
256
|
+
var popupWidth = (_options$linkPicker$p2 = options === null || options === void 0 || (_options$linkPicker2 = options.linkPicker) === null || _options$linkPicker2 === void 0 ? void 0 : _options$linkPicker2.popupWidth) !== null && _options$linkPicker$p2 !== void 0 ? _options$linkPicker$p2 : !lpLinkPicker ? undefined : _linkSearchConstants.RECENT_SEARCH_WIDTH_IN_PX;
|
|
255
257
|
return _objectSpread(_objectSpread({}, hyperLinkToolbar), {}, {
|
|
256
258
|
preventPopupOverflow: true,
|
|
257
259
|
height: popupHeight,
|
|
@@ -291,9 +293,9 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
|
|
|
291
293
|
var analytic = arguments.length > 4 ? arguments[4] : undefined;
|
|
292
294
|
var appearance = arguments.length > 5 ? arguments[5] : undefined;
|
|
293
295
|
var isEdit = isEditLink(activeLinkMark);
|
|
294
|
-
var action = isEdit ?
|
|
296
|
+
var action = isEdit ? _enums.ACTION.UPDATED : _enums.ACTION.INSERTED;
|
|
295
297
|
var skipAnalytics = (_toolbarKey$getState$ = (_toolbarKey$getState = _toolbarButtons.toolbarKey.getState(state)) === null || _toolbarKey$getState === void 0 ? void 0 : _toolbarKey$getState.skipAnalytics) !== null && _toolbarKey$getState$ !== void 0 ? _toolbarKey$getState$ : false;
|
|
296
|
-
var command = isEdit ? (0,
|
|
298
|
+
var command = isEdit ? (0, _utils.commandWithMetadata)((0, _commands.updateLink)(href, displayText || title, activeLinkMark.pos), {
|
|
297
299
|
action: action,
|
|
298
300
|
inputMethod: inputMethod,
|
|
299
301
|
sourceEvent: analytic
|
|
@@ -302,7 +304,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
|
|
|
302
304
|
view.focus();
|
|
303
305
|
}
|
|
304
306
|
});
|
|
305
|
-
return isToolbarAIFCEnabled ? /*#__PURE__*/_react.default.createElement(
|
|
307
|
+
return isToolbarAIFCEnabled ? /*#__PURE__*/_react.default.createElement(_UserIntentPopupWrapper.UserIntentPopupWrapper, {
|
|
306
308
|
api: pluginInjectionApi
|
|
307
309
|
}, Toolbar) : Toolbar;
|
|
308
310
|
}
|
|
@@ -6,24 +6,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getToolbarComponents = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _keys = require("@atlaskit/editor-common/toolbar/keys");
|
|
10
|
+
var _rank = require("@atlaskit/editor-common/toolbar/rank");
|
|
10
11
|
var _LinkButton = require("./toolbar/LinkButton");
|
|
11
12
|
var getToolbarComponents = exports.getToolbarComponents = function getToolbarComponents(api) {
|
|
12
13
|
var toolbarComponents = [{
|
|
13
|
-
type:
|
|
14
|
-
key:
|
|
14
|
+
type: _keys.LINKING_GROUP.type,
|
|
15
|
+
key: _keys.LINKING_GROUP.key,
|
|
15
16
|
parents: [{
|
|
16
|
-
type:
|
|
17
|
-
key:
|
|
18
|
-
rank:
|
|
17
|
+
type: _keys.LINKING_SECTION.type,
|
|
18
|
+
key: _keys.LINKING_SECTION.key,
|
|
19
|
+
rank: _rank.LINKING_SECTION_RANK[_keys.LINKING_GROUP.key]
|
|
19
20
|
}]
|
|
20
21
|
}, {
|
|
21
|
-
type:
|
|
22
|
-
key:
|
|
22
|
+
type: _keys.LINKING_BUTTON.type,
|
|
23
|
+
key: _keys.LINKING_BUTTON.key,
|
|
23
24
|
parents: [{
|
|
24
|
-
type:
|
|
25
|
-
key:
|
|
26
|
-
rank:
|
|
25
|
+
type: _keys.LINKING_GROUP.type,
|
|
26
|
+
key: _keys.LINKING_GROUP.key,
|
|
27
|
+
rank: _rank.LINKING_GROUP_RANK[_keys.LINKING_BUTTON.key]
|
|
27
28
|
}],
|
|
28
29
|
component: function component() {
|
|
29
30
|
return /*#__PURE__*/_react.default.createElement(_LinkButton.LinkButton, {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { buildEditLinkPayload, unlinkPayload } from '@atlaskit/editor-common/analytics/linking-utils';
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
+
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
4
|
+
import { commandWithMetadata } from '@atlaskit/editor-common/card/utils';
|
|
4
5
|
import { isTextAtPos, LinkAction } from '@atlaskit/editor-common/link';
|
|
5
|
-
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
6
|
-
import {
|
|
6
|
+
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset/editor-commands';
|
|
7
|
+
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
8
|
+
import { getLinkCreationAnalyticsEvent } from '@atlaskit/editor-common/utils/hyperlink';
|
|
9
|
+
import { withAnalytics } from '@atlaskit/editor-common/withAnalytics';
|
|
7
10
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
8
11
|
import { stateKey } from '../pm-plugins/main';
|
|
9
12
|
function setLinkHrefEditorCommand(href, pos, editorAnalyticsApi, to, isTabPressed) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { link } from '@atlaskit/adf-schema/link';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import { IconLink } from '@atlaskit/editor-common/assets';
|
|
4
5
|
import { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
6
|
import { LinkAction } from '@atlaskit/editor-common/link';
|
|
6
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
8
|
-
import { IconLink } from '@atlaskit/editor-common/quick-insert';
|
|
7
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
8
|
+
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset/editor-commands';
|
|
9
9
|
import { canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
11
11
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import { createRule,
|
|
5
|
-
import {
|
|
4
|
+
import { createRule, LinkMatcher, normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { findFilepaths, getLinkCreationAnalyticsEvent, isLinkInMatches } from '@atlaskit/editor-common/utils/hyperlink';
|
|
6
|
+
import { shouldAutoLinkifyMatch } from '@atlaskit/editor-common/utils/should-auto-linkify-tld';
|
|
7
|
+
import { createPlugin } from '@atlaskit/prosemirror-input-rules/utils';
|
|
6
8
|
import { toolbarKey } from './toolbar-buttons';
|
|
7
9
|
|
|
8
10
|
// [something](link) should convert to a hyperlink
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getLinkMatch } from '@atlaskit/adf-schema/get-link-match';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
4
4
|
import { addLink, bindKeymapWithCommand, bindKeymapWithEditorCommand, enter, escape, insertNewLine } from '@atlaskit/editor-common/keymaps';
|
|
5
|
-
import { findFilepaths, getLinkCreationAnalyticsEvent, isLinkInMatches
|
|
5
|
+
import { findFilepaths, getLinkCreationAnalyticsEvent, isLinkInMatches } from '@atlaskit/editor-common/utils/hyperlink';
|
|
6
|
+
import { shouldAutoLinkifyMatch } from '@atlaskit/editor-common/utils/should-auto-linkify-tld';
|
|
6
7
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
7
8
|
import { hideLinkToolbar, showLinkToolbar } from '../editor-commands/commands';
|
|
8
9
|
import { stateKey } from '../pm-plugins/main';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
2
|
import { v4 as uuid } from 'uuid';
|
|
3
3
|
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
4
|
-
import { InsertStatus, LinkAction
|
|
4
|
+
import { InsertStatus, LinkAction } from '@atlaskit/editor-common/link';
|
|
5
|
+
import { getActiveLinkMark } from '@atlaskit/editor-common/link/utils';
|
|
5
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
7
|
import { canLinkBeCreatedInRange, shallowEqual } from '@atlaskit/editor-common/utils';
|
|
7
8
|
import { PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -9,10 +9,10 @@ import { useCallback } from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { jsx } from '@emotion/react';
|
|
11
11
|
import { injectIntl } from 'react-intl';
|
|
12
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
13
13
|
import { addLink, getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
14
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
|
-
import
|
|
14
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
15
|
+
import ToolbarButton from '@atlaskit/editor-common/ui-menu/ToolbarButton';
|
|
16
16
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
17
17
|
const PrimaryToolbarComponentWithIntl = ({
|
|
18
18
|
api,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
4
|
import { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { LinkAction } from '@atlaskit/editor-common/link';
|
|
6
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
7
7
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
8
8
|
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
9
9
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
3
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
4
4
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
5
5
|
import { HYPERLINK_MENU_ITEM, MEDIA_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
|
|
6
6
|
import { MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
5
4
|
import { ToolTipContent, addLink } from '@atlaskit/editor-common/keymaps';
|
|
6
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import {
|
|
5
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
6
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
7
|
+
import { LinkIcon } from '@atlaskit/editor-toolbar/link-icon';
|
|
8
|
+
import { ToolbarButton } from '@atlaskit/editor-toolbar/toolbar-button';
|
|
9
|
+
import { ToolbarTooltip } from '@atlaskit/editor-toolbar/toolbar-tooltip';
|
|
8
10
|
export const LinkButton = ({
|
|
9
11
|
api
|
|
10
12
|
}) => {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { buildVisitedLinkPayload } from '@atlaskit/editor-common/analytics/linking-utils';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT_ID, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
5
|
+
import { commandWithMetadata } from '@atlaskit/editor-common/card/utils';
|
|
6
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
7
|
+
import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/link-search-constants';
|
|
8
|
+
import { HyperlinkAddToolbar } from '@atlaskit/editor-common/link/HyperlinkAddToolbar';
|
|
9
|
+
import { linkMessages } from '@atlaskit/editor-common/messages/link';
|
|
10
|
+
import { linkToolbarMessages as linkToolbarCommonMessages } from '@atlaskit/editor-common/messages/link-toolbar';
|
|
8
11
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
12
|
+
import { UserIntentPopupWrapper } from '@atlaskit/editor-common/UserIntentPopupWrapper';
|
|
13
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
11
14
|
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
12
|
-
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
13
15
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
16
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
15
17
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { LINKING_BUTTON, LINKING_GROUP,
|
|
2
|
+
import { LINKING_BUTTON, LINKING_GROUP, LINKING_SECTION } from '@atlaskit/editor-common/toolbar/keys';
|
|
3
|
+
import { LINKING_GROUP_RANK, LINKING_SECTION_RANK } from '@atlaskit/editor-common/toolbar/rank';
|
|
3
4
|
import { LinkButton } from './toolbar/LinkButton';
|
|
4
5
|
export const getToolbarComponents = api => {
|
|
5
6
|
const toolbarComponents = [{
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { buildEditLinkPayload, unlinkPayload } from '@atlaskit/editor-common/analytics/linking-utils';
|
|
5
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
6
|
+
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
7
|
+
import { commandWithMetadata } from '@atlaskit/editor-common/card/utils';
|
|
7
8
|
import { isTextAtPos, LinkAction } from '@atlaskit/editor-common/link';
|
|
8
|
-
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
9
|
-
import {
|
|
9
|
+
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset/editor-commands';
|
|
10
|
+
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
11
|
+
import { getLinkCreationAnalyticsEvent } from '@atlaskit/editor-common/utils/hyperlink';
|
|
12
|
+
import { withAnalytics } from '@atlaskit/editor-common/withAnalytics';
|
|
10
13
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
11
14
|
import { stateKey } from '../pm-plugins/main';
|
|
12
15
|
function setLinkHrefEditorCommand(href, pos, editorAnalyticsApi, to, isTabPressed) {
|
|
@@ -3,12 +3,12 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { link } from '@atlaskit/adf-schema/link';
|
|
6
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
7
|
+
import { IconLink } from '@atlaskit/editor-common/assets';
|
|
7
8
|
import { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
8
9
|
import { LinkAction } from '@atlaskit/editor-common/link';
|
|
9
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
10
|
-
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
11
|
-
import { IconLink } from '@atlaskit/editor-common/quick-insert';
|
|
10
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
11
|
+
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset/editor-commands';
|
|
12
12
|
import { canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
14
14
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
-
import { createRule,
|
|
6
|
-
import {
|
|
5
|
+
import { createRule, LinkMatcher, normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { findFilepaths, getLinkCreationAnalyticsEvent, isLinkInMatches } from '@atlaskit/editor-common/utils/hyperlink';
|
|
7
|
+
import { shouldAutoLinkifyMatch } from '@atlaskit/editor-common/utils/should-auto-linkify-tld';
|
|
8
|
+
import { createPlugin } from '@atlaskit/prosemirror-input-rules/utils';
|
|
7
9
|
import { toolbarKey } from './toolbar-buttons';
|
|
8
10
|
|
|
9
11
|
// [something](link) should convert to a hyperlink
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getLinkMatch } from '@atlaskit/adf-schema/get-link-match';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
4
4
|
import { addLink, bindKeymapWithCommand, bindKeymapWithEditorCommand, enter, escape, insertNewLine } from '@atlaskit/editor-common/keymaps';
|
|
5
|
-
import { findFilepaths, getLinkCreationAnalyticsEvent, isLinkInMatches
|
|
5
|
+
import { findFilepaths, getLinkCreationAnalyticsEvent, isLinkInMatches } from '@atlaskit/editor-common/utils/hyperlink';
|
|
6
|
+
import { shouldAutoLinkifyMatch } from '@atlaskit/editor-common/utils/should-auto-linkify-tld';
|
|
6
7
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
7
8
|
import { hideLinkToolbar, showLinkToolbar } from '../editor-commands/commands';
|
|
8
9
|
import { stateKey } from '../pm-plugins/main';
|
|
@@ -4,7 +4,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
5
5
|
import { v4 as uuid } from 'uuid';
|
|
6
6
|
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
7
|
-
import { InsertStatus, LinkAction
|
|
7
|
+
import { InsertStatus, LinkAction } from '@atlaskit/editor-common/link';
|
|
8
|
+
import { getActiveLinkMark } from '@atlaskit/editor-common/link/utils';
|
|
8
9
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
10
|
import { canLinkBeCreatedInRange, shallowEqual } from '@atlaskit/editor-common/utils';
|
|
10
11
|
import { PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -9,10 +9,10 @@ import { useCallback } from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { jsx } from '@emotion/react';
|
|
11
11
|
import { injectIntl } from 'react-intl';
|
|
12
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
13
13
|
import { addLink, getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
14
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
|
-
import
|
|
14
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
15
|
+
import ToolbarButton from '@atlaskit/editor-common/ui-menu/ToolbarButton';
|
|
16
16
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
17
17
|
var PrimaryToolbarComponentWithIntl = function PrimaryToolbarComponentWithIntl(_ref) {
|
|
18
18
|
var api = _ref.api,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
4
|
import { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { LinkAction } from '@atlaskit/editor-common/link';
|
|
6
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
7
7
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
8
8
|
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
9
9
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
3
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
4
4
|
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
|
|
5
5
|
import { HYPERLINK_MENU_ITEM, MEDIA_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
|
|
6
6
|
import { MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
5
4
|
import { ToolTipContent, addLink } from '@atlaskit/editor-common/keymaps';
|
|
6
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import {
|
|
5
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
6
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
7
|
+
import { LinkIcon } from '@atlaskit/editor-toolbar/link-icon';
|
|
8
|
+
import { ToolbarButton } from '@atlaskit/editor-toolbar/toolbar-button';
|
|
9
|
+
import { ToolbarTooltip } from '@atlaskit/editor-toolbar/toolbar-tooltip';
|
|
8
10
|
export var LinkButton = function LinkButton(_ref) {
|
|
9
11
|
var api = _ref.api;
|
|
10
12
|
var _useIntl = useIntl(),
|
|
@@ -4,16 +4,18 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import React, { useRef } from 'react';
|
|
6
6
|
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { buildVisitedLinkPayload } from '@atlaskit/editor-common/analytics/linking-utils';
|
|
8
|
+
import { ACTION, ACTION_SUBJECT_ID, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
9
|
+
import { commandWithMetadata } from '@atlaskit/editor-common/card/utils';
|
|
10
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
11
|
+
import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/link-search-constants';
|
|
12
|
+
import { HyperlinkAddToolbar } from '@atlaskit/editor-common/link/HyperlinkAddToolbar';
|
|
13
|
+
import { linkMessages } from '@atlaskit/editor-common/messages/link';
|
|
14
|
+
import { linkToolbarMessages as linkToolbarCommonMessages } from '@atlaskit/editor-common/messages/link-toolbar';
|
|
12
15
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
16
|
+
import { UserIntentPopupWrapper } from '@atlaskit/editor-common/UserIntentPopupWrapper';
|
|
17
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
15
18
|
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
16
|
-
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
17
19
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
18
20
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
19
21
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { LINKING_BUTTON, LINKING_GROUP,
|
|
2
|
+
import { LINKING_BUTTON, LINKING_GROUP, LINKING_SECTION } from '@atlaskit/editor-common/toolbar/keys';
|
|
3
|
+
import { LINKING_GROUP_RANK, LINKING_SECTION_RANK } from '@atlaskit/editor-common/toolbar/rank';
|
|
3
4
|
import { LinkButton } from './toolbar/LinkButton';
|
|
4
5
|
export var getToolbarComponents = function getToolbarComponents(api) {
|
|
5
6
|
var toolbarComponents = [{
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
2
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import {
|
|
5
|
-
import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
-
import type { Command
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics/api';
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
+
import type { CardPluginActions } from '@atlaskit/editor-common/card/types';
|
|
5
|
+
import type { CardAppearance } from '@atlaskit/editor-common/provider-factory/card-provider';
|
|
6
|
+
import type { Command } from '@atlaskit/editor-common/types/command';
|
|
7
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
|
|
8
|
+
import type { LinkInputType } from '@atlaskit/editor-common/types/hyperlink';
|
|
7
9
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
8
10
|
export declare function setLinkHref(href: string, pos: number, editorAnalyticsApi: EditorAnalyticsAPI | undefined, to?: number, isTabPressed?: boolean): Command;
|
|
9
11
|
export type UpdateLink = (href: string, text: string, pos: number, to?: number) => Command;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import type { HyperlinkState } from '@atlaskit/editor-common/link';
|
|
2
|
-
import type { EditorCommand
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { HyperlinkState } from '@atlaskit/editor-common/link/types';
|
|
2
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
|
|
3
|
+
import type { HyperlinkPluginOptions as CommonHyperlinkPluginOptions } from '@atlaskit/editor-common/types/hyperlink';
|
|
4
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
5
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics/analyticsPluginType';
|
|
6
|
+
import type { CardPlugin } from '@atlaskit/editor-plugin-card/cardPluginType';
|
|
5
7
|
import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity/connectivityPluginType';
|
|
6
|
-
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
7
|
-
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
8
|
-
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
|
|
9
|
-
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
8
|
+
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode/editorViewmodePluginType';
|
|
9
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar/primary-toolbar-plugin-type';
|
|
10
|
+
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar/selection-toolbar-plugin-type';
|
|
11
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar/toolbar-plugin-type';
|
|
10
12
|
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry/ui-control-registry-plugin-type';
|
|
11
|
-
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
12
|
-
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
|
|
13
|
+
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent/user-intent-plugin-type';
|
|
14
|
+
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences/user-preferences-plugin-type';
|
|
13
15
|
import type { HideLinkToolbar, InsertLink, ShowLinkToolbar, UpdateLink } from './editor-commands/commands';
|
|
14
16
|
type HyperlinkPluginCommands = {
|
|
15
17
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics/api';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import type { InputRuleWrapper } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { InputRuleWrapper } from '@atlaskit/editor-common/types/input-rules';
|
|
4
4
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
/**
|
|
6
6
|
* Called when space after link, but not on enter
|