@atlaskit/editor-plugin-hyperlink 18.1.3 → 18.1.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/hyperlinkPlugin.js +6 -6
- package/dist/cjs/pm-plugins/keymap.js +2 -2
- package/dist/cjs/ui/toolbar/Toolbar.js +2 -2
- package/dist/es2019/hyperlinkPlugin.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +1 -1
- package/dist/es2019/ui/toolbar/Toolbar.js +1 -1
- package/dist/esm/hyperlinkPlugin.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +1 -1
- package/dist/esm/ui/toolbar/Toolbar.js +1 -1
- package/package.json +3 -36
package/CHANGELOG.md
CHANGED
|
@@ -7,15 +7,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.hyperlinkPlugin = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var
|
|
10
|
+
var _link = require("@atlaskit/adf-schema/link");
|
|
11
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
12
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
13
|
-
var
|
|
13
|
+
var _link2 = require("@atlaskit/editor-common/link");
|
|
14
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
15
15
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
16
16
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
17
17
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
18
|
-
var
|
|
18
|
+
var _link3 = _interopRequireDefault(require("@atlaskit/icon/core/link"));
|
|
19
19
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
20
20
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
21
21
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
@@ -71,7 +71,7 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
|
|
|
71
71
|
marks: function marks() {
|
|
72
72
|
return [{
|
|
73
73
|
name: 'link',
|
|
74
|
-
mark:
|
|
74
|
+
mark: _link.link
|
|
75
75
|
}];
|
|
76
76
|
},
|
|
77
77
|
commands: {
|
|
@@ -176,7 +176,7 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
|
|
|
176
176
|
var _api$analytics6, _api$analytics6$attac;
|
|
177
177
|
var tr = insert(undefined);
|
|
178
178
|
tr.setMeta(_main.stateKey, {
|
|
179
|
-
type:
|
|
179
|
+
type: _link2.LinkAction.SHOW_INSERT_TOOLBAR,
|
|
180
180
|
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
181
181
|
});
|
|
182
182
|
var analyticsAttached = api === null || api === void 0 || (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 || (_api$analytics6 = _api$analytics6.actions) === null || _api$analytics6 === void 0 || (_api$analytics6$attac = _api$analytics6.attachAnalyticsEvent) === null || _api$analytics6$attac === void 0 ? void 0 : _api$analytics6$attac.call(_api$analytics6, {
|
|
@@ -212,7 +212,7 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
|
|
|
212
212
|
type: 'button',
|
|
213
213
|
disabled: !isEnabled,
|
|
214
214
|
testId: "".concat(selectionToolbarLinkButtonTestId),
|
|
215
|
-
icon:
|
|
215
|
+
icon: _link3.default,
|
|
216
216
|
title: title,
|
|
217
217
|
tooltipContent: (0, _keymaps.tooltip)(_keymaps.addLink, title),
|
|
218
218
|
showTitle: false,
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createKeymapPlugin = createKeymapPlugin;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _getLinkMatch = require("@atlaskit/adf-schema/get-link-match");
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _card = require("@atlaskit/editor-common/card");
|
|
11
11
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
@@ -61,7 +61,7 @@ var mayConvertLastWordToHyperlink = function mayConvertLastWordToHyperlink(edito
|
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
62
62
|
var words = nodeBefore.text.split(' ');
|
|
63
63
|
var lastWord = words[words.length - 1];
|
|
64
|
-
var match = (0,
|
|
64
|
+
var match = (0, _getLinkMatch.getLinkMatch)(lastWord);
|
|
65
65
|
if (match) {
|
|
66
66
|
if (!(0, _utils.shouldAutoLinkifyMatch)(match)) {
|
|
67
67
|
return false;
|
|
@@ -10,7 +10,7 @@ exports.getToolbarConfig = void 0;
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var
|
|
13
|
+
var _isSafeUrl = require("@atlaskit/adf-schema/is-safe-url");
|
|
14
14
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
15
15
|
var _card = require("@atlaskit/editor-common/card");
|
|
16
16
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
@@ -162,7 +162,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
|
|
|
162
162
|
return mark.type === state.schema.marks.link;
|
|
163
163
|
});
|
|
164
164
|
var link = linkMark[0] && linkMark[0].attrs.href;
|
|
165
|
-
var isValidUrl = (0,
|
|
165
|
+
var isValidUrl = (0, _isSafeUrl.isSafeUrl)(link);
|
|
166
166
|
var labelOpenLink = formatMessage(isValidUrl ? _messages.linkMessages.openLink : _messages.linkToolbarMessages.unableToOpenLink);
|
|
167
167
|
// TODO: ED-14403 - investigate why these are not translating?
|
|
168
168
|
var labelUnlink = formatMessage(_messages.linkToolbarMessages.unlink);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { link } from '@atlaskit/adf-schema';
|
|
2
|
+
import { link } from '@atlaskit/adf-schema/link';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { LinkAction } from '@atlaskit/editor-common/link';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getLinkMatch } from '@atlaskit/adf-schema';
|
|
1
|
+
import { getLinkMatch } from '@atlaskit/adf-schema/get-link-match';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
4
4
|
import { addLink, bindKeymapWithCommand, bindKeymapWithEditorCommand, enter, escape, insertNewLine } from '@atlaskit/editor-common/keymaps';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
2
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT_ID, INPUT_METHOD, buildVisitedLinkPayload } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
5
5
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
@@ -2,7 +2,7 @@ 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
4
|
import React from 'react';
|
|
5
|
-
import { link } from '@atlaskit/adf-schema';
|
|
5
|
+
import { link } from '@atlaskit/adf-schema/link';
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import { addLink, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
8
8
|
import { LinkAction } from '@atlaskit/editor-common/link';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getLinkMatch } from '@atlaskit/adf-schema';
|
|
1
|
+
import { getLinkMatch } from '@atlaskit/adf-schema/get-link-match';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
4
4
|
import { addLink, bindKeymapWithCommand, bindKeymapWithEditorCommand, enter, escape, insertNewLine } from '@atlaskit/editor-common/keymaps';
|
|
@@ -3,7 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
3
3
|
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; }
|
|
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
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
6
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
7
7
|
import { ACTION, ACTION_SUBJECT_ID, INPUT_METHOD, buildVisitedLinkPayload } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
9
9
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-hyperlink",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.5",
|
|
4
4
|
"description": "Hyperlink plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
42
42
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
43
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
43
|
+
"@atlaskit/tmp-editor-statsig": "^173.0.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1",
|
|
46
46
|
"uuid": "^3.1.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^120.
|
|
49
|
+
"@atlaskit/editor-common": "^120.11.0",
|
|
50
50
|
"react": "^18.2.0 || ^19.2.0",
|
|
51
51
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
52
52
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -59,39 +59,6 @@
|
|
|
59
59
|
"react-intl": "^7.0.0",
|
|
60
60
|
"wait-for-expect": "^1.2.0"
|
|
61
61
|
},
|
|
62
|
-
"techstack": {
|
|
63
|
-
"@atlassian/frontend": {
|
|
64
|
-
"import-structure": [
|
|
65
|
-
"atlassian-conventions"
|
|
66
|
-
],
|
|
67
|
-
"circular-dependencies": [
|
|
68
|
-
"file-and-folder-level"
|
|
69
|
-
],
|
|
70
|
-
"code-structure": [
|
|
71
|
-
"editor-plugin"
|
|
72
|
-
]
|
|
73
|
-
},
|
|
74
|
-
"@repo/internal": {
|
|
75
|
-
"dom-events": "use-bind-event-listener",
|
|
76
|
-
"analytics": [
|
|
77
|
-
"analytics-next"
|
|
78
|
-
],
|
|
79
|
-
"design-tokens": [
|
|
80
|
-
"color"
|
|
81
|
-
],
|
|
82
|
-
"theming": [
|
|
83
|
-
"react-context"
|
|
84
|
-
],
|
|
85
|
-
"ui-components": [
|
|
86
|
-
"lite-mode"
|
|
87
|
-
],
|
|
88
|
-
"deprecation": "no-deprecated-imports",
|
|
89
|
-
"styling": [
|
|
90
|
-
"emotion",
|
|
91
|
-
"emotion"
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
62
|
"platform-feature-flags": {
|
|
96
63
|
"platform_editor_use_preferences_plugin": {
|
|
97
64
|
"type": "boolean"
|