@atlaskit/editor-plugin-selection-extension 2.1.1 → 2.1.3
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 +15 -0
- package/dist/cjs/pm-plugins/main.js +3 -2
- package/dist/cjs/selectionExtensionPlugin.js +10 -0
- package/dist/cjs/types/index.js +8 -1
- package/dist/cjs/ui/toolbar/SelectionExtensionDropdownMenu.js +2 -0
- package/dist/cjs/ui/toolbar/SelectionExtensionDropdownMenuButton.js +19 -3
- package/dist/es2019/pm-plugins/main.js +3 -2
- package/dist/es2019/selectionExtensionPlugin.js +10 -0
- package/dist/es2019/types/index.js +6 -1
- package/dist/es2019/ui/toolbar/SelectionExtensionDropdownMenu.js +2 -0
- package/dist/es2019/ui/toolbar/SelectionExtensionDropdownMenuButton.js +19 -3
- package/dist/esm/pm-plugins/main.js +3 -2
- package/dist/esm/selectionExtensionPlugin.js +10 -0
- package/dist/esm/types/index.js +6 -1
- package/dist/esm/ui/toolbar/SelectionExtensionDropdownMenu.js +2 -0
- package/dist/esm/ui/toolbar/SelectionExtensionDropdownMenuButton.js +19 -3
- package/dist/types/types/index.d.ts +8 -3
- package/dist/types-ts4.5/types/index.d.ts +8 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-extension
|
|
2
2
|
|
|
3
|
+
## 2.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#120385](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120385)
|
|
14
|
+
[`0974c164df21e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0974c164df21e) -
|
|
15
|
+
[ux] ED-26440 minor cosmetic updates to selection extension plugin
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 2.1.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -8,6 +8,7 @@ exports.selectionExtensionPluginKey = exports.createPlugin = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
+
var _types = require("../types");
|
|
11
12
|
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; }
|
|
12
13
|
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; }
|
|
13
14
|
var selectionExtensionPluginKey = exports.selectionExtensionPluginKey = new _state.PluginKey('selectionExtensionPlugin');
|
|
@@ -23,11 +24,11 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
23
24
|
apply: function apply(tr, pluginState) {
|
|
24
25
|
var meta = tr.getMeta(selectionExtensionPluginKey);
|
|
25
26
|
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
26
|
-
case
|
|
27
|
+
case _types.SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION:
|
|
27
28
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
28
29
|
activeExtension: meta.extension
|
|
29
30
|
});
|
|
30
|
-
case
|
|
31
|
+
case _types.SelectionExtensionActionTypes.CLEAR_ACTIVE_EXTENSION:
|
|
31
32
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
32
33
|
activeExtension: undefined
|
|
33
34
|
});
|
|
@@ -89,6 +89,16 @@ var selectionExtensionPlugin = exports.selectionExtensionPlugin = function selec
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Active Extension
|
|
95
|
+
*
|
|
96
|
+
* Check if there is an active extension and hide the selection extension dropdown
|
|
97
|
+
*/
|
|
98
|
+
var selectionExtensionState = _main.selectionExtensionPluginKey.getState(state);
|
|
99
|
+
if (selectionExtensionState !== null && selectionExtensionState !== void 0 && selectionExtensionState.activeExtension) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
92
102
|
var handleOnExtensionClick = function handleOnExtensionClick(view) {
|
|
93
103
|
return function (extension) {
|
|
94
104
|
var currentSelection = state.selection;
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -2,4 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
5
|
+
});
|
|
6
|
+
exports.SelectionExtensionActionTypes = void 0;
|
|
7
|
+
var SelectionExtensionActionTypes = exports.SelectionExtensionActionTypes = /*#__PURE__*/function (SelectionExtensionActionTypes) {
|
|
8
|
+
SelectionExtensionActionTypes["SET_ACTIVE_EXTENSION"] = "set-active-extension";
|
|
9
|
+
SelectionExtensionActionTypes["UPDATE_ACTIVE_EXTENSION_COORDS"] = "update-active-extension-coords";
|
|
10
|
+
SelectionExtensionActionTypes["CLEAR_ACTIVE_EXTENSION"] = "clear-active-extension";
|
|
11
|
+
return SelectionExtensionActionTypes;
|
|
12
|
+
}({});
|
|
@@ -33,6 +33,8 @@ var SelectionExtensionDropdownMenuComponent = /*#__PURE__*/_react.default.memo(f
|
|
|
33
33
|
onItemActivated: onItemActivated,
|
|
34
34
|
"data-testid": "selection-extension-dropdown-menu"
|
|
35
35
|
}, /*#__PURE__*/_react.default.createElement(_SelectionExtensionDropdownMenuButton.SelectionExtensionDropdownMenuButton, {
|
|
36
|
+
"aria-expanded": isMenuOpen,
|
|
37
|
+
selected: isMenuOpen,
|
|
36
38
|
onClick: function onClick() {
|
|
37
39
|
return setIsMenuOpen(function (prevIsMenuOpen) {
|
|
38
40
|
var nextIsMenuOpen = !prevIsMenuOpen;
|
|
@@ -7,15 +7,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.SelectionExtensionDropdownMenuButton = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
10
11
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
11
12
|
var _apps = _interopRequireDefault(require("@atlaskit/icon/core/apps"));
|
|
13
|
+
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
|
|
12
14
|
var SelectionExtensionDropdownMenuButtonComponent = function SelectionExtensionDropdownMenuButtonComponent(_ref) {
|
|
13
|
-
var onClick = _ref.onClick
|
|
15
|
+
var onClick = _ref.onClick,
|
|
16
|
+
selected = _ref.selected,
|
|
17
|
+
ariaExpanded = _ref['aria-expanded'],
|
|
18
|
+
intl = _ref.intl;
|
|
14
19
|
return /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarButton, {
|
|
15
20
|
testId: "selection-extension-dropdown-button",
|
|
16
|
-
|
|
21
|
+
"aria-label": intl.formatMessage(_messages.selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
22
|
+
"aria-haspopup": "true",
|
|
23
|
+
spacing: "compact",
|
|
24
|
+
title: intl.formatMessage(_messages.selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
25
|
+
onClick: onClick,
|
|
26
|
+
"aria-expanded": ariaExpanded,
|
|
27
|
+
selected: selected,
|
|
28
|
+
iconAfter: /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
|
|
29
|
+
spacing: "none",
|
|
30
|
+
label: intl.formatMessage(_messages.selectionExtensionMessages.selectionExtensionDropdownButtonLabel)
|
|
31
|
+
})
|
|
17
32
|
}, /*#__PURE__*/_react.default.createElement(_apps.default, {
|
|
18
|
-
label:
|
|
33
|
+
label: intl.formatMessage(_messages.selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
34
|
+
spacing: "none"
|
|
19
35
|
}));
|
|
20
36
|
};
|
|
21
37
|
var SelectionExtensionDropdownMenuButton = exports.SelectionExtensionDropdownMenuButton = (0, _reactIntlNext.injectIntl)(SelectionExtensionDropdownMenuButtonComponent);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { SelectionExtensionActionTypes } from '../types';
|
|
3
4
|
export const selectionExtensionPluginKey = new PluginKey('selectionExtensionPlugin');
|
|
4
5
|
export const createPlugin = () => {
|
|
5
6
|
return new SafePlugin({
|
|
@@ -13,12 +14,12 @@ export const createPlugin = () => {
|
|
|
13
14
|
apply: (tr, pluginState) => {
|
|
14
15
|
const meta = tr.getMeta(selectionExtensionPluginKey);
|
|
15
16
|
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
16
|
-
case
|
|
17
|
+
case SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION:
|
|
17
18
|
return {
|
|
18
19
|
...pluginState,
|
|
19
20
|
activeExtension: meta.extension
|
|
20
21
|
};
|
|
21
|
-
case
|
|
22
|
+
case SelectionExtensionActionTypes.CLEAR_ACTIVE_EXTENSION:
|
|
22
23
|
return {
|
|
23
24
|
...pluginState,
|
|
24
25
|
activeExtension: undefined
|
|
@@ -84,6 +84,16 @@ export const selectionExtensionPlugin = ({
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Active Extension
|
|
90
|
+
*
|
|
91
|
+
* Check if there is an active extension and hide the selection extension dropdown
|
|
92
|
+
*/
|
|
93
|
+
const selectionExtensionState = selectionExtensionPluginKey.getState(state);
|
|
94
|
+
if (selectionExtensionState !== null && selectionExtensionState !== void 0 && selectionExtensionState.activeExtension) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
87
97
|
const handleOnExtensionClick = view => extension => {
|
|
88
98
|
const {
|
|
89
99
|
selection: currentSelection
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export let SelectionExtensionActionTypes = /*#__PURE__*/function (SelectionExtensionActionTypes) {
|
|
2
|
+
SelectionExtensionActionTypes["SET_ACTIVE_EXTENSION"] = "set-active-extension";
|
|
3
|
+
SelectionExtensionActionTypes["UPDATE_ACTIVE_EXTENSION_COORDS"] = "update-active-extension-coords";
|
|
4
|
+
SelectionExtensionActionTypes["CLEAR_ACTIVE_EXTENSION"] = "clear-active-extension";
|
|
5
|
+
return SelectionExtensionActionTypes;
|
|
6
|
+
}({});
|
|
@@ -20,6 +20,8 @@ const SelectionExtensionDropdownMenuComponent = /*#__PURE__*/React.memo(({
|
|
|
20
20
|
onItemActivated: onItemActivated,
|
|
21
21
|
"data-testid": "selection-extension-dropdown-menu"
|
|
22
22
|
}, /*#__PURE__*/React.createElement(SelectionExtensionDropdownMenuButton, {
|
|
23
|
+
"aria-expanded": isMenuOpen,
|
|
24
|
+
selected: isMenuOpen,
|
|
23
25
|
onClick: () => setIsMenuOpen(prevIsMenuOpen => {
|
|
24
26
|
const nextIsMenuOpen = !prevIsMenuOpen;
|
|
25
27
|
if (editorAnalyticsAPI) {
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
+
import { selectionExtensionMessages } from '@atlaskit/editor-common/messages';
|
|
3
4
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
4
5
|
import AppsIcon from '@atlaskit/icon/core/apps';
|
|
6
|
+
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
5
7
|
const SelectionExtensionDropdownMenuButtonComponent = ({
|
|
6
|
-
onClick
|
|
8
|
+
onClick,
|
|
9
|
+
selected,
|
|
10
|
+
'aria-expanded': ariaExpanded,
|
|
11
|
+
intl
|
|
7
12
|
}) => {
|
|
8
13
|
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
9
14
|
testId: "selection-extension-dropdown-button",
|
|
10
|
-
|
|
15
|
+
"aria-label": intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
16
|
+
"aria-haspopup": "true",
|
|
17
|
+
spacing: "compact",
|
|
18
|
+
title: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
19
|
+
onClick: onClick,
|
|
20
|
+
"aria-expanded": ariaExpanded,
|
|
21
|
+
selected: selected,
|
|
22
|
+
iconAfter: /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
23
|
+
spacing: "none",
|
|
24
|
+
label: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel)
|
|
25
|
+
})
|
|
11
26
|
}, /*#__PURE__*/React.createElement(AppsIcon, {
|
|
12
|
-
label:
|
|
27
|
+
label: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
28
|
+
spacing: "none"
|
|
13
29
|
}));
|
|
14
30
|
};
|
|
15
31
|
export const SelectionExtensionDropdownMenuButton = injectIntl(SelectionExtensionDropdownMenuButtonComponent);
|
|
@@ -3,6 +3,7 @@ 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 { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { SelectionExtensionActionTypes } from '../types';
|
|
6
7
|
export var selectionExtensionPluginKey = new PluginKey('selectionExtensionPlugin');
|
|
7
8
|
export var createPlugin = function createPlugin() {
|
|
8
9
|
return new SafePlugin({
|
|
@@ -16,11 +17,11 @@ export var createPlugin = function createPlugin() {
|
|
|
16
17
|
apply: function apply(tr, pluginState) {
|
|
17
18
|
var meta = tr.getMeta(selectionExtensionPluginKey);
|
|
18
19
|
switch (meta === null || meta === void 0 ? void 0 : meta.type) {
|
|
19
|
-
case
|
|
20
|
+
case SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION:
|
|
20
21
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
21
22
|
activeExtension: meta.extension
|
|
22
23
|
});
|
|
23
|
-
case
|
|
24
|
+
case SelectionExtensionActionTypes.CLEAR_ACTIVE_EXTENSION:
|
|
24
25
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
25
26
|
activeExtension: undefined
|
|
26
27
|
});
|
|
@@ -82,6 +82,16 @@ export var selectionExtensionPlugin = function selectionExtensionPlugin(_ref) {
|
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Active Extension
|
|
88
|
+
*
|
|
89
|
+
* Check if there is an active extension and hide the selection extension dropdown
|
|
90
|
+
*/
|
|
91
|
+
var selectionExtensionState = selectionExtensionPluginKey.getState(state);
|
|
92
|
+
if (selectionExtensionState !== null && selectionExtensionState !== void 0 && selectionExtensionState.activeExtension) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
85
95
|
var handleOnExtensionClick = function handleOnExtensionClick(view) {
|
|
86
96
|
return function (extension) {
|
|
87
97
|
var currentSelection = state.selection;
|
package/dist/esm/types/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export var SelectionExtensionActionTypes = /*#__PURE__*/function (SelectionExtensionActionTypes) {
|
|
2
|
+
SelectionExtensionActionTypes["SET_ACTIVE_EXTENSION"] = "set-active-extension";
|
|
3
|
+
SelectionExtensionActionTypes["UPDATE_ACTIVE_EXTENSION_COORDS"] = "update-active-extension-coords";
|
|
4
|
+
SelectionExtensionActionTypes["CLEAR_ACTIVE_EXTENSION"] = "clear-active-extension";
|
|
5
|
+
return SelectionExtensionActionTypes;
|
|
6
|
+
}({});
|
|
@@ -23,6 +23,8 @@ var SelectionExtensionDropdownMenuComponent = /*#__PURE__*/React.memo(function (
|
|
|
23
23
|
onItemActivated: onItemActivated,
|
|
24
24
|
"data-testid": "selection-extension-dropdown-menu"
|
|
25
25
|
}, /*#__PURE__*/React.createElement(SelectionExtensionDropdownMenuButton, {
|
|
26
|
+
"aria-expanded": isMenuOpen,
|
|
27
|
+
selected: isMenuOpen,
|
|
26
28
|
onClick: function onClick() {
|
|
27
29
|
return setIsMenuOpen(function (prevIsMenuOpen) {
|
|
28
30
|
var nextIsMenuOpen = !prevIsMenuOpen;
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
+
import { selectionExtensionMessages } from '@atlaskit/editor-common/messages';
|
|
3
4
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
4
5
|
import AppsIcon from '@atlaskit/icon/core/apps';
|
|
6
|
+
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
5
7
|
var SelectionExtensionDropdownMenuButtonComponent = function SelectionExtensionDropdownMenuButtonComponent(_ref) {
|
|
6
|
-
var onClick = _ref.onClick
|
|
8
|
+
var onClick = _ref.onClick,
|
|
9
|
+
selected = _ref.selected,
|
|
10
|
+
ariaExpanded = _ref['aria-expanded'],
|
|
11
|
+
intl = _ref.intl;
|
|
7
12
|
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
8
13
|
testId: "selection-extension-dropdown-button",
|
|
9
|
-
|
|
14
|
+
"aria-label": intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
15
|
+
"aria-haspopup": "true",
|
|
16
|
+
spacing: "compact",
|
|
17
|
+
title: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
18
|
+
onClick: onClick,
|
|
19
|
+
"aria-expanded": ariaExpanded,
|
|
20
|
+
selected: selected,
|
|
21
|
+
iconAfter: /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
22
|
+
spacing: "none",
|
|
23
|
+
label: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel)
|
|
24
|
+
})
|
|
10
25
|
}, /*#__PURE__*/React.createElement(AppsIcon, {
|
|
11
|
-
label:
|
|
26
|
+
label: intl.formatMessage(selectionExtensionMessages.selectionExtensionDropdownButtonLabel),
|
|
27
|
+
spacing: "none"
|
|
12
28
|
}));
|
|
13
29
|
};
|
|
14
30
|
export var SelectionExtensionDropdownMenuButton = injectIntl(SelectionExtensionDropdownMenuButtonComponent);
|
|
@@ -32,14 +32,19 @@ export type SelectionExtensionCoords = {
|
|
|
32
32
|
top: number;
|
|
33
33
|
bottom: number;
|
|
34
34
|
};
|
|
35
|
+
export declare enum SelectionExtensionActionTypes {
|
|
36
|
+
SET_ACTIVE_EXTENSION = "set-active-extension",
|
|
37
|
+
UPDATE_ACTIVE_EXTENSION_COORDS = "update-active-extension-coords",
|
|
38
|
+
CLEAR_ACTIVE_EXTENSION = "clear-active-extension"
|
|
39
|
+
}
|
|
35
40
|
export type UpdateActiveExtensionAction = {
|
|
36
|
-
type:
|
|
41
|
+
type: SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION;
|
|
37
42
|
extension: SelectionExtensionContract;
|
|
38
43
|
} | {
|
|
39
|
-
type:
|
|
44
|
+
type: SelectionExtensionActionTypes.UPDATE_ACTIVE_EXTENSION_COORDS;
|
|
40
45
|
coords: SelectionExtensionCoords;
|
|
41
46
|
} | {
|
|
42
|
-
type:
|
|
47
|
+
type: SelectionExtensionActionTypes.CLEAR_ACTIVE_EXTENSION;
|
|
43
48
|
};
|
|
44
49
|
export type SelectionExtensionPluginState = {
|
|
45
50
|
activeExtension?: {
|
|
@@ -32,14 +32,19 @@ export type SelectionExtensionCoords = {
|
|
|
32
32
|
top: number;
|
|
33
33
|
bottom: number;
|
|
34
34
|
};
|
|
35
|
+
export declare enum SelectionExtensionActionTypes {
|
|
36
|
+
SET_ACTIVE_EXTENSION = "set-active-extension",
|
|
37
|
+
UPDATE_ACTIVE_EXTENSION_COORDS = "update-active-extension-coords",
|
|
38
|
+
CLEAR_ACTIVE_EXTENSION = "clear-active-extension"
|
|
39
|
+
}
|
|
35
40
|
export type UpdateActiveExtensionAction = {
|
|
36
|
-
type:
|
|
41
|
+
type: SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION;
|
|
37
42
|
extension: SelectionExtensionContract;
|
|
38
43
|
} | {
|
|
39
|
-
type:
|
|
44
|
+
type: SelectionExtensionActionTypes.UPDATE_ACTIVE_EXTENSION_COORDS;
|
|
40
45
|
coords: SelectionExtensionCoords;
|
|
41
46
|
} | {
|
|
42
|
-
type:
|
|
47
|
+
type: SelectionExtensionActionTypes.CLEAR_ACTIVE_EXTENSION;
|
|
43
48
|
};
|
|
44
49
|
export type SelectionExtensionPluginState = {
|
|
45
50
|
activeExtension?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
".": "./src/index.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@atlaskit/editor-common": "^
|
|
40
|
-
"@atlaskit/editor-plugin-analytics": "^2.
|
|
39
|
+
"@atlaskit/editor-common": "^101.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-analytics": "^2.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-selection-toolbar": "^2.0.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|