@atlaskit/editor-plugin-hyperlink 0.3.4 → 0.4.0
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 +40 -0
- package/README.md +25 -2
- package/dist/cjs/Toolbar.js +4 -4
- package/dist/cjs/commands.js +2 -2
- package/dist/cjs/plugin.js +27 -22
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/es2019/Toolbar.js +2 -2
- package/dist/es2019/plugin.js +20 -13
- package/dist/esm/Toolbar.js +4 -4
- package/dist/esm/commands.js +2 -2
- package/dist/esm/plugin.js +27 -22
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/types/plugin.d.ts +5 -1
- package/dist/types-ts4.5/plugin.d.ts +5 -1
- package/package.json +5 -5
- package/report.api.md +1 -1
- package/tmp/api-report-tmp.d.ts +81 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-hyperlink
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating all plugins with minor version to correct issue with semver.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 0.3.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
|
|
18
|
+
signature of `NextEditorPlugin`.
|
|
19
|
+
|
|
20
|
+
Previously a `NextEditorPlugin` would be consumed as so:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
const plugin: NextEditorPlugin< ... > = (config, api) => {
|
|
24
|
+
// Can use api like so:
|
|
25
|
+
api.dependencies.core.actions.execute( ... )
|
|
26
|
+
return { ... }
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Now these have become named parameters like so and the `pluginInjectionAPI` is used
|
|
31
|
+
without the `dependencies` prop:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const plugin: NextEditorPlugin< ... > = ({ config, api }) => {
|
|
35
|
+
// Can use api like so:
|
|
36
|
+
api.core.actions.execute( ... )
|
|
37
|
+
return { ... }
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
3
43
|
## 0.3.4
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Editor plugin hyperlink
|
|
2
2
|
|
|
3
3
|
Hyperlink plugin for @atlaskit/editor-core
|
|
4
4
|
|
|
5
|
+
**Note:** This component is designed for internal Atlassian development.
|
|
6
|
+
External contributors will be able to use this component but will not be able to submit issues.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
---
|
|
10
|
+
- **Install** - *yarn add @atlaskit/editor-plugin-hyperlink*
|
|
11
|
+
- **npm** - [@atlaskit/editor-plugin-hyperlink](https://www.npmjs.com/package/@atlaskit/editor-plugin-hyperlink)
|
|
12
|
+
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-hyperlink)
|
|
13
|
+
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-hyperlink/dist/)
|
|
14
|
+
|
|
5
15
|
## Usage
|
|
16
|
+
---
|
|
17
|
+
**Internal use only**
|
|
18
|
+
|
|
19
|
+
@atlaskit/editor-plugin-hyperlink is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.
|
|
20
|
+
|
|
21
|
+
Direct use of this component is not supported.
|
|
22
|
+
|
|
23
|
+
Please see [Atlaskit - Editor plugin hyperlink](https://atlaskit.atlassian.com/packages/editor/editor-plugin-hyperlink) for documentation and examples for this package.
|
|
6
24
|
|
|
7
|
-
|
|
25
|
+
## Support
|
|
26
|
+
---
|
|
27
|
+
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
|
+
## License
|
|
29
|
+
---
|
|
30
|
+
Please see [Atlassian Frontend - License](https://developer.atlassian.com/cloud/framework/atlassian-frontend/#license) for more licensing information.
|
package/dist/cjs/Toolbar.js
CHANGED
|
@@ -23,8 +23,8 @@ var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"))
|
|
|
23
23
|
var _commands = require("./commands");
|
|
24
24
|
var _main = require("./pm-plugins/main");
|
|
25
25
|
var _toolbarButtons = require("./pm-plugins/toolbar-buttons");
|
|
26
|
-
function ownKeys(
|
|
27
|
-
function _objectSpread(
|
|
26
|
+
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; }
|
|
27
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
28
28
|
/* type guard for edit links */
|
|
29
29
|
function isEditLink(linkMark) {
|
|
30
30
|
return linkMark.pos !== undefined;
|
|
@@ -111,10 +111,10 @@ var getSettingsButtonGroup = function getSettingsButtonGroup(state, intl, featur
|
|
|
111
111
|
};
|
|
112
112
|
var getToolbarConfig = function getToolbarConfig(options, featureFlags, pluginInjectionApi) {
|
|
113
113
|
return function (state, intl, providerFactory) {
|
|
114
|
-
var _pluginInjectionApi$
|
|
114
|
+
var _pluginInjectionApi$a;
|
|
115
115
|
var formatMessage = intl.formatMessage;
|
|
116
116
|
var linkState = _main.stateKey.getState(state);
|
|
117
|
-
var editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
117
|
+
var editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
120
|
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
package/dist/cjs/commands.js
CHANGED
|
@@ -23,8 +23,8 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
23
23
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
24
|
var _main = require("./pm-plugins/main");
|
|
25
25
|
var _toolbarButtons = require("./pm-plugins/toolbar-buttons");
|
|
26
|
-
function ownKeys(
|
|
27
|
-
function _objectSpread(
|
|
26
|
+
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; }
|
|
27
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
28
28
|
function setLinkHref(href, pos, editorAnalyticsApi, to, isTabPressed) {
|
|
29
29
|
return (0, _utils.filterCommand)((0, _link.isTextAtPos)(pos), function (state, dispatch) {
|
|
30
30
|
var $pos = state.doc.resolve(pos);
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -19,11 +19,16 @@ var _keymap = require("./pm-plugins/keymap");
|
|
|
19
19
|
var _main = require("./pm-plugins/main");
|
|
20
20
|
var _toolbarButtons = require("./pm-plugins/toolbar-buttons");
|
|
21
21
|
var _Toolbar = require("./Toolbar");
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Hyperlink plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
24
|
+
* from `@atlaskit/editor-core`.
|
|
25
|
+
*/
|
|
26
|
+
var hyperlinkPlugin = function hyperlinkPlugin(_ref) {
|
|
27
|
+
var _api$featureFlags;
|
|
28
|
+
var _ref$config = _ref.config,
|
|
29
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
30
|
+
api = _ref.api;
|
|
31
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
27
32
|
return {
|
|
28
33
|
name: 'hyperlink',
|
|
29
34
|
marks: function marks() {
|
|
@@ -34,19 +39,19 @@ var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
34
39
|
},
|
|
35
40
|
commands: {
|
|
36
41
|
showLinkToolbar: function showLinkToolbar() {
|
|
37
|
-
var _api$
|
|
42
|
+
var _api$analytics;
|
|
38
43
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
39
|
-
return (0, _commands.showLinkToolbar)(inputMethod, api === null || api === void 0 ? void 0 : (_api$
|
|
44
|
+
return (0, _commands.showLinkToolbar)(inputMethod, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
40
45
|
}
|
|
41
46
|
},
|
|
42
47
|
actions: {
|
|
43
48
|
prependToolbarButtons: _toolbarButtons.prependToolbarButtons,
|
|
44
49
|
hideLinkToolbar: _commands.hideLinkToolbarSetMeta,
|
|
45
50
|
insertLink: function insertLink(inputMethod, from, to, href, title, displayText) {
|
|
46
|
-
var _api$
|
|
51
|
+
var _api$analytics2;
|
|
47
52
|
var cardsAvailable = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
48
53
|
var sourceEvent = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : undefined;
|
|
49
|
-
return (0, _commands.insertLinkWithAnalytics)(inputMethod, from, to, href, api === null || api === void 0 ? void 0 : (_api$
|
|
54
|
+
return (0, _commands.insertLinkWithAnalytics)(inputMethod, from, to, href, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, title, displayText, cardsAvailable, sourceEvent);
|
|
50
55
|
},
|
|
51
56
|
updateLink: _commands.updateLink
|
|
52
57
|
},
|
|
@@ -63,8 +68,8 @@ var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
63
68
|
var skipAnalytics = !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider);
|
|
64
69
|
return [{
|
|
65
70
|
name: 'hyperlink',
|
|
66
|
-
plugin: function plugin(
|
|
67
|
-
var dispatch =
|
|
71
|
+
plugin: function plugin(_ref2) {
|
|
72
|
+
var dispatch = _ref2.dispatch;
|
|
68
73
|
return (0, _main.plugin)(dispatch, options === null || options === void 0 ? void 0 : options.editorAppearance);
|
|
69
74
|
}
|
|
70
75
|
}, {
|
|
@@ -74,17 +79,17 @@ var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
74
79
|
}
|
|
75
80
|
}, {
|
|
76
81
|
name: 'hyperlinkInputRule',
|
|
77
|
-
plugin: function plugin(
|
|
78
|
-
var _api$
|
|
79
|
-
var schema =
|
|
80
|
-
featureFlags =
|
|
81
|
-
return (0, _inputRule.createInputRulePlugin)(schema, skipAnalytics, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
82
|
+
plugin: function plugin(_ref3) {
|
|
83
|
+
var _api$analytics3;
|
|
84
|
+
var schema = _ref3.schema,
|
|
85
|
+
featureFlags = _ref3.featureFlags;
|
|
86
|
+
return (0, _inputRule.createInputRulePlugin)(schema, skipAnalytics, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
82
87
|
}
|
|
83
88
|
}, {
|
|
84
89
|
name: 'hyperlinkKeymap',
|
|
85
90
|
plugin: function plugin() {
|
|
86
|
-
var _api$
|
|
87
|
-
return (0, _keymap.createKeymapPlugin)(skipAnalytics, api === null || api === void 0 ? void 0 : (_api$
|
|
91
|
+
var _api$analytics4;
|
|
92
|
+
return (0, _keymap.createKeymapPlugin)(skipAnalytics, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions);
|
|
88
93
|
}
|
|
89
94
|
}, {
|
|
90
95
|
name: 'hyperlinkToolbarButtons',
|
|
@@ -92,8 +97,8 @@ var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
92
97
|
}];
|
|
93
98
|
},
|
|
94
99
|
pluginsOptions: {
|
|
95
|
-
quickInsert: function quickInsert(
|
|
96
|
-
var formatMessage =
|
|
100
|
+
quickInsert: function quickInsert(_ref4) {
|
|
101
|
+
var formatMessage = _ref4.formatMessage;
|
|
97
102
|
return [{
|
|
98
103
|
id: 'hyperlink',
|
|
99
104
|
title: formatMessage(_messages.toolbarInsertBlockMessages.link),
|
|
@@ -105,13 +110,13 @@ var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
105
110
|
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconLink, null);
|
|
106
111
|
},
|
|
107
112
|
action: function action(insert, state) {
|
|
108
|
-
var _api$
|
|
113
|
+
var _api$analytics5, _api$analytics5$actio, _api$analytics5$actio2;
|
|
109
114
|
var tr = insert(undefined);
|
|
110
115
|
tr.setMeta(_main.stateKey, {
|
|
111
116
|
type: _link.LinkAction.SHOW_INSERT_TOOLBAR,
|
|
112
117
|
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
113
118
|
});
|
|
114
|
-
var analyticsAttached = api === null || api === void 0 ? void 0 : (_api$
|
|
119
|
+
var analyticsAttached = api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : (_api$analytics5$actio = _api$analytics5.actions) === null || _api$analytics5$actio === void 0 ? void 0 : (_api$analytics5$actio2 = _api$analytics5$actio.attachAnalyticsEvent) === null || _api$analytics5$actio2 === void 0 ? void 0 : _api$analytics5$actio2.call(_api$analytics5$actio, {
|
|
115
120
|
action: _analytics.ACTION.INVOKED,
|
|
116
121
|
actionSubject: _analytics.ACTION_SUBJECT.TYPEAHEAD,
|
|
117
122
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TYPEAHEAD_LINK,
|
|
@@ -11,8 +11,8 @@ var _link3 = require("@atlaskit/editor-common/link");
|
|
|
11
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
|
-
function ownKeys(
|
|
15
|
-
function _objectSpread(
|
|
14
|
+
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; }
|
|
15
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
16
16
|
var isSelectionInsideLink = function isSelectionInsideLink(state) {
|
|
17
17
|
return !!state.doc.type.schema.marks.link.isInSet(state.selection.$from.marks());
|
|
18
18
|
};
|
package/dist/es2019/Toolbar.js
CHANGED
|
@@ -97,12 +97,12 @@ const getSettingsButtonGroup = (state, intl, featureFlags, editorAnalyticsApi) =
|
|
|
97
97
|
}] : [];
|
|
98
98
|
};
|
|
99
99
|
export const getToolbarConfig = (options, featureFlags, pluginInjectionApi) => (state, intl, providerFactory) => {
|
|
100
|
-
var _pluginInjectionApi$
|
|
100
|
+
var _pluginInjectionApi$a;
|
|
101
101
|
const {
|
|
102
102
|
formatMessage
|
|
103
103
|
} = intl;
|
|
104
104
|
const linkState = stateKey.getState(state);
|
|
105
|
-
const editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
105
|
+
const editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -12,9 +12,16 @@ import { createKeymapPlugin } from './pm-plugins/keymap';
|
|
|
12
12
|
import { plugin, stateKey } from './pm-plugins/main';
|
|
13
13
|
import { prependToolbarButtons, toolbarButtonsPlugin } from './pm-plugins/toolbar-buttons';
|
|
14
14
|
import { getToolbarConfig } from './Toolbar';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Hyperlink plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
17
|
+
* from `@atlaskit/editor-core`.
|
|
18
|
+
*/
|
|
19
|
+
export const hyperlinkPlugin = ({
|
|
20
|
+
config: options = {},
|
|
21
|
+
api
|
|
22
|
+
}) => {
|
|
23
|
+
var _api$featureFlags;
|
|
24
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
18
25
|
return {
|
|
19
26
|
name: 'hyperlink',
|
|
20
27
|
marks() {
|
|
@@ -25,16 +32,16 @@ export const hyperlinkPlugin = (options = {}, api) => {
|
|
|
25
32
|
},
|
|
26
33
|
commands: {
|
|
27
34
|
showLinkToolbar: (inputMethod = INPUT_METHOD.TOOLBAR) => {
|
|
28
|
-
var _api$
|
|
29
|
-
return showLinkToolbar(inputMethod, api === null || api === void 0 ? void 0 : (_api$
|
|
35
|
+
var _api$analytics;
|
|
36
|
+
return showLinkToolbar(inputMethod, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
30
37
|
}
|
|
31
38
|
},
|
|
32
39
|
actions: {
|
|
33
40
|
prependToolbarButtons,
|
|
34
41
|
hideLinkToolbar: hideLinkToolbarSetMeta,
|
|
35
42
|
insertLink: (inputMethod, from, to, href, title, displayText, cardsAvailable = false, sourceEvent = undefined) => {
|
|
36
|
-
var _api$
|
|
37
|
-
return insertLinkWithAnalytics(inputMethod, from, to, href, api === null || api === void 0 ? void 0 : (_api$
|
|
43
|
+
var _api$analytics2;
|
|
44
|
+
return insertLinkWithAnalytics(inputMethod, from, to, href, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, title, displayText, cardsAvailable, sourceEvent);
|
|
38
45
|
},
|
|
39
46
|
updateLink: updateLink
|
|
40
47
|
},
|
|
@@ -63,14 +70,14 @@ export const hyperlinkPlugin = (options = {}, api) => {
|
|
|
63
70
|
schema,
|
|
64
71
|
featureFlags
|
|
65
72
|
}) => {
|
|
66
|
-
var _api$
|
|
67
|
-
return createInputRulePlugin(schema, skipAnalytics, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
73
|
+
var _api$analytics3;
|
|
74
|
+
return createInputRulePlugin(schema, skipAnalytics, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
68
75
|
}
|
|
69
76
|
}, {
|
|
70
77
|
name: 'hyperlinkKeymap',
|
|
71
78
|
plugin: () => {
|
|
72
|
-
var _api$
|
|
73
|
-
return createKeymapPlugin(skipAnalytics, api === null || api === void 0 ? void 0 : (_api$
|
|
79
|
+
var _api$analytics4;
|
|
80
|
+
return createKeymapPlugin(skipAnalytics, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions);
|
|
74
81
|
}
|
|
75
82
|
}, {
|
|
76
83
|
name: 'hyperlinkToolbarButtons',
|
|
@@ -89,13 +96,13 @@ export const hyperlinkPlugin = (options = {}, api) => {
|
|
|
89
96
|
keyshortcut: tooltip(addLink),
|
|
90
97
|
icon: () => /*#__PURE__*/React.createElement(IconLink, null),
|
|
91
98
|
action(insert, state) {
|
|
92
|
-
var _api$
|
|
99
|
+
var _api$analytics5, _api$analytics5$actio, _api$analytics5$actio2;
|
|
93
100
|
const tr = insert(undefined);
|
|
94
101
|
tr.setMeta(stateKey, {
|
|
95
102
|
type: LinkAction.SHOW_INSERT_TOOLBAR,
|
|
96
103
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
97
104
|
});
|
|
98
|
-
const analyticsAttached = api === null || api === void 0 ? void 0 : (_api$
|
|
105
|
+
const analyticsAttached = api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : (_api$analytics5$actio = _api$analytics5.actions) === null || _api$analytics5$actio === void 0 ? void 0 : (_api$analytics5$actio2 = _api$analytics5$actio.attachAnalyticsEvent) === null || _api$analytics5$actio2 === void 0 ? void 0 : _api$analytics5$actio2.call(_api$analytics5$actio, {
|
|
99
106
|
action: ACTION.INVOKED,
|
|
100
107
|
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
101
108
|
actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_LINK,
|
package/dist/esm/Toolbar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
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
|
+
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
7
|
import { ACTION, ACTION_SUBJECT_ID, buildOpenedSettingsPayload, buildVisitedLinkPayload, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -103,10 +103,10 @@ var getSettingsButtonGroup = function getSettingsButtonGroup(state, intl, featur
|
|
|
103
103
|
};
|
|
104
104
|
export var getToolbarConfig = function getToolbarConfig(options, featureFlags, pluginInjectionApi) {
|
|
105
105
|
return function (state, intl, providerFactory) {
|
|
106
|
-
var _pluginInjectionApi$
|
|
106
|
+
var _pluginInjectionApi$a;
|
|
107
107
|
var formatMessage = intl.formatMessage;
|
|
108
108
|
var linkState = stateKey.getState(state);
|
|
109
|
-
var editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
109
|
+
var editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
package/dist/esm/commands.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
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
|
+
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 { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, buildEditLinkPayload, EVENT_TYPE, INPUT_METHOD, unlinkPayload } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { addLinkMetadata, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
6
6
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
package/dist/esm/plugin.js
CHANGED
|
@@ -12,11 +12,16 @@ import { createKeymapPlugin } from './pm-plugins/keymap';
|
|
|
12
12
|
import { plugin as _plugin, stateKey } from './pm-plugins/main';
|
|
13
13
|
import { prependToolbarButtons, toolbarButtonsPlugin } from './pm-plugins/toolbar-buttons';
|
|
14
14
|
import { getToolbarConfig } from './Toolbar';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Hyperlink plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
17
|
+
* from `@atlaskit/editor-core`.
|
|
18
|
+
*/
|
|
19
|
+
export var hyperlinkPlugin = function hyperlinkPlugin(_ref) {
|
|
20
|
+
var _api$featureFlags;
|
|
21
|
+
var _ref$config = _ref.config,
|
|
22
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
23
|
+
api = _ref.api;
|
|
24
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
20
25
|
return {
|
|
21
26
|
name: 'hyperlink',
|
|
22
27
|
marks: function marks() {
|
|
@@ -27,19 +32,19 @@ export var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
27
32
|
},
|
|
28
33
|
commands: {
|
|
29
34
|
showLinkToolbar: function showLinkToolbar() {
|
|
30
|
-
var _api$
|
|
35
|
+
var _api$analytics;
|
|
31
36
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.TOOLBAR;
|
|
32
|
-
return _showLinkToolbar(inputMethod, api === null || api === void 0 ? void 0 : (_api$
|
|
37
|
+
return _showLinkToolbar(inputMethod, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
33
38
|
}
|
|
34
39
|
},
|
|
35
40
|
actions: {
|
|
36
41
|
prependToolbarButtons: prependToolbarButtons,
|
|
37
42
|
hideLinkToolbar: hideLinkToolbarSetMeta,
|
|
38
43
|
insertLink: function insertLink(inputMethod, from, to, href, title, displayText) {
|
|
39
|
-
var _api$
|
|
44
|
+
var _api$analytics2;
|
|
40
45
|
var cardsAvailable = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
41
46
|
var sourceEvent = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : undefined;
|
|
42
|
-
return insertLinkWithAnalytics(inputMethod, from, to, href, api === null || api === void 0 ? void 0 : (_api$
|
|
47
|
+
return insertLinkWithAnalytics(inputMethod, from, to, href, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, title, displayText, cardsAvailable, sourceEvent);
|
|
43
48
|
},
|
|
44
49
|
updateLink: updateLink
|
|
45
50
|
},
|
|
@@ -56,8 +61,8 @@ export var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
56
61
|
var skipAnalytics = !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider);
|
|
57
62
|
return [{
|
|
58
63
|
name: 'hyperlink',
|
|
59
|
-
plugin: function plugin(
|
|
60
|
-
var dispatch =
|
|
64
|
+
plugin: function plugin(_ref2) {
|
|
65
|
+
var dispatch = _ref2.dispatch;
|
|
61
66
|
return _plugin(dispatch, options === null || options === void 0 ? void 0 : options.editorAppearance);
|
|
62
67
|
}
|
|
63
68
|
}, {
|
|
@@ -67,17 +72,17 @@ export var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
67
72
|
}
|
|
68
73
|
}, {
|
|
69
74
|
name: 'hyperlinkInputRule',
|
|
70
|
-
plugin: function plugin(
|
|
71
|
-
var _api$
|
|
72
|
-
var schema =
|
|
73
|
-
featureFlags =
|
|
74
|
-
return createInputRulePlugin(schema, skipAnalytics, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
75
|
+
plugin: function plugin(_ref3) {
|
|
76
|
+
var _api$analytics3;
|
|
77
|
+
var schema = _ref3.schema,
|
|
78
|
+
featureFlags = _ref3.featureFlags;
|
|
79
|
+
return createInputRulePlugin(schema, skipAnalytics, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
75
80
|
}
|
|
76
81
|
}, {
|
|
77
82
|
name: 'hyperlinkKeymap',
|
|
78
83
|
plugin: function plugin() {
|
|
79
|
-
var _api$
|
|
80
|
-
return createKeymapPlugin(skipAnalytics, api === null || api === void 0 ? void 0 : (_api$
|
|
84
|
+
var _api$analytics4;
|
|
85
|
+
return createKeymapPlugin(skipAnalytics, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions);
|
|
81
86
|
}
|
|
82
87
|
}, {
|
|
83
88
|
name: 'hyperlinkToolbarButtons',
|
|
@@ -85,8 +90,8 @@ export var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
85
90
|
}];
|
|
86
91
|
},
|
|
87
92
|
pluginsOptions: {
|
|
88
|
-
quickInsert: function quickInsert(
|
|
89
|
-
var formatMessage =
|
|
93
|
+
quickInsert: function quickInsert(_ref4) {
|
|
94
|
+
var formatMessage = _ref4.formatMessage;
|
|
90
95
|
return [{
|
|
91
96
|
id: 'hyperlink',
|
|
92
97
|
title: formatMessage(messages.link),
|
|
@@ -98,13 +103,13 @@ export var hyperlinkPlugin = function hyperlinkPlugin() {
|
|
|
98
103
|
return /*#__PURE__*/React.createElement(IconLink, null);
|
|
99
104
|
},
|
|
100
105
|
action: function action(insert, state) {
|
|
101
|
-
var _api$
|
|
106
|
+
var _api$analytics5, _api$analytics5$actio, _api$analytics5$actio2;
|
|
102
107
|
var tr = insert(undefined);
|
|
103
108
|
tr.setMeta(stateKey, {
|
|
104
109
|
type: LinkAction.SHOW_INSERT_TOOLBAR,
|
|
105
110
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
106
111
|
});
|
|
107
|
-
var analyticsAttached = api === null || api === void 0 ? void 0 : (_api$
|
|
112
|
+
var analyticsAttached = api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : (_api$analytics5$actio = _api$analytics5.actions) === null || _api$analytics5$actio === void 0 ? void 0 : (_api$analytics5$actio2 = _api$analytics5$actio.attachAnalyticsEvent) === null || _api$analytics5$actio2 === void 0 ? void 0 : _api$analytics5$actio2.call(_api$analytics5$actio, {
|
|
108
113
|
action: ACTION.INVOKED,
|
|
109
114
|
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
110
115
|
actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_LINK,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
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
|
+
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 uuid from 'uuid';
|
|
5
5
|
import { InsertStatus, LinkAction } from '@atlaskit/editor-common/link';
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export type HyperlinkPlugin = NextEditorPlugin<'hyperlink', {
|
|
|
28
28
|
* Example:
|
|
29
29
|
*
|
|
30
30
|
* ```
|
|
31
|
-
* const newTr = pluginInjectionApi?.
|
|
31
|
+
* const newTr = pluginInjectionApi?.hyperlink.commands.showLinkToolbar(
|
|
32
32
|
* inputMethod
|
|
33
33
|
* )({ tr })
|
|
34
34
|
* ```
|
|
@@ -37,4 +37,8 @@ export type HyperlinkPlugin = NextEditorPlugin<'hyperlink', {
|
|
|
37
37
|
};
|
|
38
38
|
sharedState: HyperlinkState | undefined;
|
|
39
39
|
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Hyperlink plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
42
|
+
* from `@atlaskit/editor-core`.
|
|
43
|
+
*/
|
|
40
44
|
export declare const hyperlinkPlugin: HyperlinkPlugin;
|
|
@@ -31,7 +31,7 @@ export type HyperlinkPlugin = NextEditorPlugin<'hyperlink', {
|
|
|
31
31
|
* Example:
|
|
32
32
|
*
|
|
33
33
|
* ```
|
|
34
|
-
* const newTr = pluginInjectionApi?.
|
|
34
|
+
* const newTr = pluginInjectionApi?.hyperlink.commands.showLinkToolbar(
|
|
35
35
|
* inputMethod
|
|
36
36
|
* )({ tr })
|
|
37
37
|
* ```
|
|
@@ -40,4 +40,8 @@ export type HyperlinkPlugin = NextEditorPlugin<'hyperlink', {
|
|
|
40
40
|
};
|
|
41
41
|
sharedState: HyperlinkState | undefined;
|
|
42
42
|
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Hyperlink plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
45
|
+
* from `@atlaskit/editor-core`.
|
|
46
|
+
*/
|
|
43
47
|
export declare const hyperlinkPlugin: HyperlinkPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-hyperlink",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Hyperlink plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
|
-
"team": "Editor",
|
|
11
|
+
"team": "Editor: Media Experience Porygon",
|
|
12
12
|
"singleton": true,
|
|
13
13
|
"releaseModel": "continuous"
|
|
14
14
|
},
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "28.1.2",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/editor-common": "^74.
|
|
37
|
-
"@atlaskit/editor-plugin-analytics": "^0.
|
|
38
|
-
"@atlaskit/editor-plugin-feature-flags": "^0.
|
|
36
|
+
"@atlaskit/editor-common": "^74.55.0",
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
38
|
+
"@atlaskit/editor-plugin-feature-flags": "^0.2.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
40
40
|
"@atlaskit/icon": "^21.12.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
package/report.api.md
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
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: [FeatureFlagsPlugin, OptionalPlugin<AnalyticsPlugin>];
|
|
36
|
+
actions: {
|
|
37
|
+
prependToolbarButtons: PrependToolbarButtons;
|
|
38
|
+
hideLinkToolbar: HideLinkToolbar;
|
|
39
|
+
insertLink: InsertLink;
|
|
40
|
+
updateLink: UpdateLink;
|
|
41
|
+
};
|
|
42
|
+
commands: {
|
|
43
|
+
showLinkToolbar: ShowLinkToolbar;
|
|
44
|
+
};
|
|
45
|
+
sharedState: HyperlinkState | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
|
|
48
|
+
// @public
|
|
49
|
+
export const hyperlinkPlugin: HyperlinkPlugin;
|
|
50
|
+
|
|
51
|
+
// @public (undocumented)
|
|
52
|
+
type HyperlinkToolbarItemsState = {
|
|
53
|
+
items: GetToolbarItems;
|
|
54
|
+
onEscapeCallback: ((tr: Transaction) => Transaction) | undefined;
|
|
55
|
+
onInsertLinkCallback: QueueCardsFromTransactionAction | undefined;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// @public (undocumented)
|
|
59
|
+
type InputMethod = INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TOOLBAR;
|
|
60
|
+
|
|
61
|
+
// @public (undocumented)
|
|
62
|
+
export type InsertLink = (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string, cardsAvailable?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command;
|
|
63
|
+
|
|
64
|
+
// @public (undocumented)
|
|
65
|
+
export type PrependToolbarButtons = (props: PrependToolbarButtonsProps) => void;
|
|
66
|
+
|
|
67
|
+
// @public (undocumented)
|
|
68
|
+
interface PrependToolbarButtonsProps extends HyperlinkToolbarItemsState {
|
|
69
|
+
// (undocumented)
|
|
70
|
+
view: EditorView;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// @public (undocumented)
|
|
74
|
+
export type ShowLinkToolbar = (inputMethod: InputMethod) => EditorCommand;
|
|
75
|
+
|
|
76
|
+
// @public (undocumented)
|
|
77
|
+
export type UpdateLink = (href: string, text: string, pos: number, to?: number) => Command;
|
|
78
|
+
|
|
79
|
+
// (No @packageDocumentation comment for this package)
|
|
80
|
+
|
|
81
|
+
```
|