@atlaskit/editor-plugin-hyperlink 2.9.30 → 3.0.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 +23 -0
- package/dist/cjs/Toolbar.js +1 -22
- package/dist/es2019/Toolbar.js +3 -20
- package/dist/esm/Toolbar.js +3 -24
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-hyperlink
|
|
2
2
|
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [#149599](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/149599)
|
|
14
|
+
[`9c110fa4b038c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9c110fa4b038c) -
|
|
15
|
+
The hyperlink floating toolbar no longer includes a settings button by default, now requires card
|
|
16
|
+
plugin to be provided to include the settings button in the hyperlink floating toolbar (via ff
|
|
17
|
+
cleanup platform.editor.card.inject-settings-button).
|
|
18
|
+
|
|
19
|
+
Upgrade requires only checking compatible versions of `@atlaskit/editor-plugin-card` and
|
|
20
|
+
`@atlaskit/editor-plugin-hyperlink` as both packages are affected by feature flag change.
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 2.9.30
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/cjs/Toolbar.js
CHANGED
|
@@ -17,10 +17,8 @@ var _link2 = require("@atlaskit/editor-common/link");
|
|
|
17
17
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
19
19
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
|
-
var _settings = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/settings"));
|
|
21
20
|
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
22
21
|
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
23
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
22
|
var _commands = require("./commands");
|
|
25
23
|
var _main = require("./pm-plugins/main");
|
|
26
24
|
var _toolbarButtons = require("./pm-plugins/toolbar-buttons");
|
|
@@ -43,12 +41,6 @@ var visitHyperlink = function visitHyperlink(editorAnalyticsApi) {
|
|
|
43
41
|
return true;
|
|
44
42
|
};
|
|
45
43
|
};
|
|
46
|
-
var openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
47
|
-
return function (state, dispatch) {
|
|
48
|
-
dispatchAnalytics(dispatch, state, _analytics.buildOpenedSettingsPayload, editorAnalyticsApi);
|
|
49
|
-
return true;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
44
|
function getLinkText(activeLinkMark, state) {
|
|
53
45
|
if (!activeLinkMark.node) {
|
|
54
46
|
return undefined;
|
|
@@ -98,19 +90,6 @@ function HyperlinkAddToolbarWithState(_ref) {
|
|
|
98
90
|
searchSessionId: hyperlinkState.searchSessionId
|
|
99
91
|
});
|
|
100
92
|
}
|
|
101
|
-
var getSettingsButtonGroup = function getSettingsButtonGroup(intl, editorAnalyticsApi) {
|
|
102
|
-
return [{
|
|
103
|
-
type: 'separator'
|
|
104
|
-
}, {
|
|
105
|
-
id: 'editor.link.settings',
|
|
106
|
-
type: 'button',
|
|
107
|
-
icon: _settings.default,
|
|
108
|
-
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
109
|
-
onClick: openLinkSettings(editorAnalyticsApi),
|
|
110
|
-
href: (0, _link2.getLinkPreferencesURLFromENV)(),
|
|
111
|
-
target: '_blank'
|
|
112
|
-
}];
|
|
113
|
-
};
|
|
114
93
|
var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(options, pluginInjectionApi) {
|
|
115
94
|
return function (state, intl, providerFactory) {
|
|
116
95
|
var _pluginInjectionApi$c, _pluginInjectionApi$a, _options$lpLinkPicker;
|
|
@@ -202,7 +181,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
|
|
|
202
181
|
formatMessage: formatMessage,
|
|
203
182
|
markType: state.schema.marks.link
|
|
204
183
|
}]
|
|
205
|
-
}], (0, _toConsumableArray2.default)((_cardActions$getEndin = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getEndingToolbarItems(intl, link)) !== null && _cardActions$getEndin !== void 0 ? _cardActions$getEndin : [])
|
|
184
|
+
}], (0, _toConsumableArray2.default)((_cardActions$getEndin = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getEndingToolbarItems(intl, link)) !== null && _cardActions$getEndin !== void 0 ? _cardActions$getEndin : []));
|
|
206
185
|
return _objectSpread(_objectSpread({}, hyperLinkToolbar), {}, {
|
|
207
186
|
height: 32,
|
|
208
187
|
width: 250,
|
package/dist/es2019/Toolbar.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT_ID,
|
|
3
|
+
import { ACTION, ACTION_SUBJECT_ID, buildVisitedLinkPayload, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
5
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
|
-
import {
|
|
6
|
+
import { HyperlinkAddToolbar } from '@atlaskit/editor-common/link';
|
|
7
7
|
import { linkMessages, linkToolbarMessages as linkToolbarCommonMessages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
10
|
-
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
11
10
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
12
11
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
12
|
import { editInsertedLink, insertLinkWithAnalytics, onClickAwayCallback, onEscapeCallback, removeLink, updateLink } from './commands';
|
|
15
13
|
import { stateKey } from './pm-plugins/main';
|
|
16
14
|
import { toolbarKey } from './pm-plugins/toolbar-buttons';
|
|
@@ -31,10 +29,6 @@ const visitHyperlink = editorAnalyticsApi => (state, dispatch) => {
|
|
|
31
29
|
dispatchAnalytics(dispatch, state, buildVisitedLinkPayload, editorAnalyticsApi);
|
|
32
30
|
return true;
|
|
33
31
|
};
|
|
34
|
-
const openLinkSettings = editorAnalyticsApi => (state, dispatch) => {
|
|
35
|
-
dispatchAnalytics(dispatch, state, buildOpenedSettingsPayload, editorAnalyticsApi);
|
|
36
|
-
return true;
|
|
37
|
-
};
|
|
38
32
|
function getLinkText(activeLinkMark, state) {
|
|
39
33
|
if (!activeLinkMark.node) {
|
|
40
34
|
return undefined;
|
|
@@ -83,17 +77,6 @@ export function HyperlinkAddToolbarWithState({
|
|
|
83
77
|
searchSessionId: hyperlinkState.searchSessionId
|
|
84
78
|
});
|
|
85
79
|
}
|
|
86
|
-
const getSettingsButtonGroup = (intl, editorAnalyticsApi) => [{
|
|
87
|
-
type: 'separator'
|
|
88
|
-
}, {
|
|
89
|
-
id: 'editor.link.settings',
|
|
90
|
-
type: 'button',
|
|
91
|
-
icon: CogIcon,
|
|
92
|
-
title: intl.formatMessage(linkToolbarCommonMessages.settingsLink),
|
|
93
|
-
onClick: openLinkSettings(editorAnalyticsApi),
|
|
94
|
-
href: getLinkPreferencesURLFromENV(),
|
|
95
|
-
target: '_blank'
|
|
96
|
-
}];
|
|
97
80
|
export const getToolbarConfig = (options, pluginInjectionApi) => (state, intl, providerFactory) => {
|
|
98
81
|
var _pluginInjectionApi$c, _pluginInjectionApi$a, _options$lpLinkPicker;
|
|
99
82
|
if (options.disableFloatingToolbar) {
|
|
@@ -186,7 +169,7 @@ export const getToolbarConfig = (options, pluginInjectionApi) => (state, intl, p
|
|
|
186
169
|
formatMessage: formatMessage,
|
|
187
170
|
markType: state.schema.marks.link
|
|
188
171
|
}]
|
|
189
|
-
}, ...((_cardActions$getEndin = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getEndingToolbarItems(intl, link)) !== null && _cardActions$getEndin !== void 0 ? _cardActions$getEndin : [])
|
|
172
|
+
}, ...((_cardActions$getEndin = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getEndingToolbarItems(intl, link)) !== null && _cardActions$getEndin !== void 0 ? _cardActions$getEndin : [])];
|
|
190
173
|
return {
|
|
191
174
|
...hyperLinkToolbar,
|
|
192
175
|
height: 32,
|
package/dist/esm/Toolbar.js
CHANGED
|
@@ -4,17 +4,15 @@ 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 from 'react';
|
|
6
6
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT_ID,
|
|
7
|
+
import { ACTION, ACTION_SUBJECT_ID, buildVisitedLinkPayload, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
9
9
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
10
|
-
import {
|
|
10
|
+
import { HyperlinkAddToolbar } from '@atlaskit/editor-common/link';
|
|
11
11
|
import { linkMessages, linkToolbarMessages as linkToolbarCommonMessages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
14
|
-
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
15
14
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
16
15
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
17
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
16
|
import { editInsertedLink, insertLinkWithAnalytics, onClickAwayCallback, onEscapeCallback, removeLink, updateLink } from './commands';
|
|
19
17
|
import { stateKey } from './pm-plugins/main';
|
|
20
18
|
import { toolbarKey } from './pm-plugins/toolbar-buttons';
|
|
@@ -35,12 +33,6 @@ var visitHyperlink = function visitHyperlink(editorAnalyticsApi) {
|
|
|
35
33
|
return true;
|
|
36
34
|
};
|
|
37
35
|
};
|
|
38
|
-
var openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
39
|
-
return function (state, dispatch) {
|
|
40
|
-
dispatchAnalytics(dispatch, state, buildOpenedSettingsPayload, editorAnalyticsApi);
|
|
41
|
-
return true;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
36
|
function getLinkText(activeLinkMark, state) {
|
|
45
37
|
if (!activeLinkMark.node) {
|
|
46
38
|
return undefined;
|
|
@@ -90,19 +82,6 @@ export function HyperlinkAddToolbarWithState(_ref) {
|
|
|
90
82
|
searchSessionId: hyperlinkState.searchSessionId
|
|
91
83
|
});
|
|
92
84
|
}
|
|
93
|
-
var getSettingsButtonGroup = function getSettingsButtonGroup(intl, editorAnalyticsApi) {
|
|
94
|
-
return [{
|
|
95
|
-
type: 'separator'
|
|
96
|
-
}, {
|
|
97
|
-
id: 'editor.link.settings',
|
|
98
|
-
type: 'button',
|
|
99
|
-
icon: CogIcon,
|
|
100
|
-
title: intl.formatMessage(linkToolbarCommonMessages.settingsLink),
|
|
101
|
-
onClick: openLinkSettings(editorAnalyticsApi),
|
|
102
|
-
href: getLinkPreferencesURLFromENV(),
|
|
103
|
-
target: '_blank'
|
|
104
|
-
}];
|
|
105
|
-
};
|
|
106
85
|
export var getToolbarConfig = function getToolbarConfig(options, pluginInjectionApi) {
|
|
107
86
|
return function (state, intl, providerFactory) {
|
|
108
87
|
var _pluginInjectionApi$c, _pluginInjectionApi$a, _options$lpLinkPicker;
|
|
@@ -194,7 +173,7 @@ export var getToolbarConfig = function getToolbarConfig(options, pluginInjection
|
|
|
194
173
|
formatMessage: formatMessage,
|
|
195
174
|
markType: state.schema.marks.link
|
|
196
175
|
}]
|
|
197
|
-
}], _toConsumableArray((_cardActions$getEndin = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getEndingToolbarItems(intl, link)) !== null && _cardActions$getEndin !== void 0 ? _cardActions$getEndin : [])
|
|
176
|
+
}], _toConsumableArray((_cardActions$getEndin = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getEndingToolbarItems(intl, link)) !== null && _cardActions$getEndin !== void 0 ? _cardActions$getEndin : []));
|
|
198
177
|
return _objectSpread(_objectSpread({}, hyperLinkToolbar), {}, {
|
|
199
178
|
height: 32,
|
|
200
179
|
width: 250,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-hyperlink",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Hyperlink plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
36
36
|
"@atlaskit/editor-common": "^93.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
38
|
-
"@atlaskit/editor-plugin-card": "
|
|
38
|
+
"@atlaskit/editor-plugin-card": "4.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
41
|
-
"@atlaskit/icon": "^22.
|
|
41
|
+
"@atlaskit/icon": "^22.22.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
43
43
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
@@ -92,9 +92,6 @@
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
"platform-feature-flags": {
|
|
95
|
-
"platform.editor.card.inject-settings-button": {
|
|
96
|
-
"type": "boolean"
|
|
97
|
-
},
|
|
98
95
|
"linking_platform_smart_links_in_live_pages": {
|
|
99
96
|
"type": "boolean"
|
|
100
97
|
}
|