@atlaskit/editor-plugin-hyperlink 18.1.9 → 18.1.11
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 +16 -0
- package/dist/cjs/pm-plugins/main.js +0 -4
- package/dist/es2019/pm-plugins/main.js +0 -4
- package/dist/esm/pm-plugins/main.js +0 -4
- package/package.json +2 -2
- package/dist/cjs/pm-plugins/decorations.js +0 -55
- package/dist/es2019/pm-plugins/decorations.js +0 -49
- package/dist/esm/pm-plugins/decorations.js +0 -48
- package/dist/types/pm-plugins/decorations.d.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-hyperlink
|
|
2
2
|
|
|
3
|
+
## 18.1.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`789d7f32d0d43`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/789d7f32d0d43) -
|
|
8
|
+
Remove the orphaned `ButtonWrapper` configure-link overlay wrapper
|
|
9
|
+
(`src/pm-plugins/decorations.tsx`). It had no importers and was not reachable through the
|
|
10
|
+
package's entry points — the plugin's ProseMirror `decorations` prop returns an empty
|
|
11
|
+
`DecorationSet` — so this is an internal dead-code removal with no behaviour or API change.
|
|
12
|
+
|
|
13
|
+
## 18.1.10
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 18.1.9
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -11,7 +11,6 @@ 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
|
-
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
15
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; }
|
|
16
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; } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
17
16
|
var mapTransactionToState = function mapTransactionToState(state, tr) {
|
|
@@ -197,9 +196,6 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance,
|
|
|
197
196
|
},
|
|
198
197
|
key: stateKey,
|
|
199
198
|
props: {
|
|
200
|
-
decorations: function decorations() {
|
|
201
|
-
return _view.DecorationSet.empty;
|
|
202
|
-
},
|
|
203
199
|
handleDOMEvents: {
|
|
204
200
|
// Ignored via go/ees005
|
|
205
201
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -4,7 +4,6 @@ import { InsertStatus, LinkAction, getActiveLinkMark } from '@atlaskit/editor-co
|
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { canLinkBeCreatedInRange, shallowEqual } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
7
|
const mapTransactionToState = (state, tr) => {
|
|
9
8
|
if (!state) {
|
|
10
9
|
return undefined;
|
|
@@ -196,9 +195,6 @@ export const plugin = (dispatch, intl, editorAppearance, _pluginInjectionApi, _o
|
|
|
196
195
|
},
|
|
197
196
|
key: stateKey,
|
|
198
197
|
props: {
|
|
199
|
-
decorations: () => {
|
|
200
|
-
return DecorationSet.empty;
|
|
201
|
-
},
|
|
202
198
|
handleDOMEvents: {
|
|
203
199
|
// Ignored via go/ees005
|
|
204
200
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -7,7 +7,6 @@ import { InsertStatus, LinkAction, getActiveLinkMark } from '@atlaskit/editor-co
|
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
8
|
import { canLinkBeCreatedInRange, shallowEqual } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
11
10
|
var mapTransactionToState = function mapTransactionToState(state, tr) {
|
|
12
11
|
if (!state) {
|
|
13
12
|
return undefined;
|
|
@@ -191,9 +190,6 @@ export var plugin = function plugin(dispatch, intl, editorAppearance, _pluginInj
|
|
|
191
190
|
},
|
|
192
191
|
key: stateKey,
|
|
193
192
|
props: {
|
|
194
|
-
decorations: function decorations() {
|
|
195
|
-
return DecorationSet.empty;
|
|
196
|
-
},
|
|
197
193
|
handleDOMEvents: {
|
|
198
194
|
// Ignored via go/ees005
|
|
199
195
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
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.11",
|
|
4
4
|
"description": "Hyperlink plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
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": "^177.0.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1",
|
|
46
46
|
"uuid": "^11.1.1"
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ButtonWrapper = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactDom = require("react-dom");
|
|
10
|
-
var _client = require("react-dom/client");
|
|
11
|
-
var _reactIntl = require("react-intl");
|
|
12
|
-
var _link = require("@atlaskit/editor-common/link");
|
|
13
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
14
|
-
var reactRoots = new WeakMap();
|
|
15
|
-
|
|
16
|
-
/** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
|
|
17
|
-
var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
|
|
18
|
-
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_react19_migration')) {
|
|
19
|
-
var root = reactRoots.get(mountPoint);
|
|
20
|
-
if (!root) {
|
|
21
|
-
root = (0, _client.createRoot)(mountPoint);
|
|
22
|
-
reactRoots.set(mountPoint, root);
|
|
23
|
-
}
|
|
24
|
-
root.render(element);
|
|
25
|
-
} else {
|
|
26
|
-
(0, _reactDom.render)(element, mountPoint);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var ButtonWrapper = exports.ButtonWrapper = function ButtonWrapper(_ref) {
|
|
30
|
-
var editorView = _ref.editorView,
|
|
31
|
-
pos = _ref.pos,
|
|
32
|
-
stateKey = _ref.stateKey,
|
|
33
|
-
intl = _ref.intl,
|
|
34
|
-
onOpenLinkClick = _ref.onOpenLinkClick;
|
|
35
|
-
var wrapper = document.createElement('span');
|
|
36
|
-
wrapper.style.position = 'relative';
|
|
37
|
-
var nonBreakingCharacter = "\u2060";
|
|
38
|
-
var onDropdownChange = function onDropdownChange(isOpen) {
|
|
39
|
-
editorView.dispatch(editorView.state.tr.setMeta(stateKey, {
|
|
40
|
-
type: _link.LinkAction.SET_CONFIGURE_DROPDOWN_OPEN,
|
|
41
|
-
isOpen: isOpen
|
|
42
|
-
}));
|
|
43
|
-
};
|
|
44
|
-
renderToMountPoint( /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
|
|
45
|
-
locale: intl.locale || 'en',
|
|
46
|
-
messages: intl.messages,
|
|
47
|
-
formats: intl.formats
|
|
48
|
-
}, /*#__PURE__*/_react.default.createElement(_link.OverlayButton, {
|
|
49
|
-
targetElementPos: pos,
|
|
50
|
-
editorView: editorView,
|
|
51
|
-
onDropdownChange: onDropdownChange,
|
|
52
|
-
onOpenLinkClick: onOpenLinkClick
|
|
53
|
-
}), nonBreakingCharacter), wrapper);
|
|
54
|
-
return wrapper;
|
|
55
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from 'react-dom';
|
|
3
|
-
import { createRoot } from 'react-dom/client';
|
|
4
|
-
import { IntlProvider } from 'react-intl';
|
|
5
|
-
import { LinkAction, OverlayButton } from '@atlaskit/editor-common/link';
|
|
6
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
|
-
const reactRoots = new WeakMap();
|
|
8
|
-
|
|
9
|
-
/** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
|
|
10
|
-
const renderToMountPoint = (element, mountPoint) => {
|
|
11
|
-
if (isExperimentEnabled('platform_editor_react19_migration')) {
|
|
12
|
-
let root = reactRoots.get(mountPoint);
|
|
13
|
-
if (!root) {
|
|
14
|
-
root = createRoot(mountPoint);
|
|
15
|
-
reactRoots.set(mountPoint, root);
|
|
16
|
-
}
|
|
17
|
-
root.render(element);
|
|
18
|
-
} else {
|
|
19
|
-
render(element, mountPoint);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export const ButtonWrapper = ({
|
|
23
|
-
editorView,
|
|
24
|
-
pos,
|
|
25
|
-
stateKey,
|
|
26
|
-
intl,
|
|
27
|
-
onOpenLinkClick
|
|
28
|
-
}) => {
|
|
29
|
-
const wrapper = document.createElement('span');
|
|
30
|
-
wrapper.style.position = 'relative';
|
|
31
|
-
const nonBreakingCharacter = '\u2060';
|
|
32
|
-
const onDropdownChange = isOpen => {
|
|
33
|
-
editorView.dispatch(editorView.state.tr.setMeta(stateKey, {
|
|
34
|
-
type: LinkAction.SET_CONFIGURE_DROPDOWN_OPEN,
|
|
35
|
-
isOpen
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
renderToMountPoint( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
39
|
-
locale: intl.locale || 'en',
|
|
40
|
-
messages: intl.messages,
|
|
41
|
-
formats: intl.formats
|
|
42
|
-
}, /*#__PURE__*/React.createElement(OverlayButton, {
|
|
43
|
-
targetElementPos: pos,
|
|
44
|
-
editorView: editorView,
|
|
45
|
-
onDropdownChange: onDropdownChange,
|
|
46
|
-
onOpenLinkClick: onOpenLinkClick
|
|
47
|
-
}), nonBreakingCharacter), wrapper);
|
|
48
|
-
return wrapper;
|
|
49
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from 'react-dom';
|
|
3
|
-
import { createRoot } from 'react-dom/client';
|
|
4
|
-
import { IntlProvider } from 'react-intl';
|
|
5
|
-
import { LinkAction, OverlayButton } from '@atlaskit/editor-common/link';
|
|
6
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
|
-
var reactRoots = new WeakMap();
|
|
8
|
-
|
|
9
|
-
/** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
|
|
10
|
-
var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
|
|
11
|
-
if (isExperimentEnabled('platform_editor_react19_migration')) {
|
|
12
|
-
var root = reactRoots.get(mountPoint);
|
|
13
|
-
if (!root) {
|
|
14
|
-
root = createRoot(mountPoint);
|
|
15
|
-
reactRoots.set(mountPoint, root);
|
|
16
|
-
}
|
|
17
|
-
root.render(element);
|
|
18
|
-
} else {
|
|
19
|
-
render(element, mountPoint);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export var ButtonWrapper = function ButtonWrapper(_ref) {
|
|
23
|
-
var editorView = _ref.editorView,
|
|
24
|
-
pos = _ref.pos,
|
|
25
|
-
stateKey = _ref.stateKey,
|
|
26
|
-
intl = _ref.intl,
|
|
27
|
-
onOpenLinkClick = _ref.onOpenLinkClick;
|
|
28
|
-
var wrapper = document.createElement('span');
|
|
29
|
-
wrapper.style.position = 'relative';
|
|
30
|
-
var nonBreakingCharacter = "\u2060";
|
|
31
|
-
var onDropdownChange = function onDropdownChange(isOpen) {
|
|
32
|
-
editorView.dispatch(editorView.state.tr.setMeta(stateKey, {
|
|
33
|
-
type: LinkAction.SET_CONFIGURE_DROPDOWN_OPEN,
|
|
34
|
-
isOpen: isOpen
|
|
35
|
-
}));
|
|
36
|
-
};
|
|
37
|
-
renderToMountPoint( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
38
|
-
locale: intl.locale || 'en',
|
|
39
|
-
messages: intl.messages,
|
|
40
|
-
formats: intl.formats
|
|
41
|
-
}, /*#__PURE__*/React.createElement(OverlayButton, {
|
|
42
|
-
targetElementPos: pos,
|
|
43
|
-
editorView: editorView,
|
|
44
|
-
onDropdownChange: onDropdownChange,
|
|
45
|
-
onOpenLinkClick: onOpenLinkClick
|
|
46
|
-
}), nonBreakingCharacter), wrapper);
|
|
47
|
-
return wrapper;
|
|
48
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type MouseEvent } from 'react';
|
|
2
|
-
import { type IntlShape } from 'react-intl';
|
|
3
|
-
import { type HyperlinkState } from '@atlaskit/editor-common/link';
|
|
4
|
-
import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
export declare const ButtonWrapper: ({ editorView, pos, stateKey, intl, onOpenLinkClick, }: {
|
|
7
|
-
editorView: EditorView;
|
|
8
|
-
intl: IntlShape;
|
|
9
|
-
/** Callback fired when the Open Link dropdown item is clicked */
|
|
10
|
-
onOpenLinkClick: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
11
|
-
pos?: number;
|
|
12
|
-
stateKey: PluginKey<HyperlinkState>;
|
|
13
|
-
}) => HTMLSpanElement;
|