@atlaskit/editor-plugin-table 25.0.3 → 25.0.4
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 +8 -0
- package/dist/cjs/ui/quick-insert/TableQuickInsertMenuItem.js +19 -30
- package/dist/cjs/ui/quick-insert/getTableQuickInsertComponents.js +1 -1
- package/dist/es2019/ui/quick-insert/TableQuickInsertMenuItem.js +18 -29
- package/dist/es2019/ui/quick-insert/getTableQuickInsertComponents.js +2 -2
- package/dist/esm/ui/quick-insert/TableQuickInsertMenuItem.js +19 -29
- package/dist/esm/ui/quick-insert/getTableQuickInsertComponents.js +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 25.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7087f393ec725`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7087f393ec725) -
|
|
8
|
+
Add the categorized registered Quick Insert browse experience with representative native elements
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 25.0.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
@@ -9,9 +8,9 @@ exports.TableQuickInsertMenuItem = void 0;
|
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _reactIntl = require("react-intl");
|
|
11
10
|
var _icons = require("@atlaskit/editor-common/icons");
|
|
11
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
|
-
var
|
|
14
|
-
var _buttonItem = _interopRequireDefault(require("@atlaskit/menu/button-item"));
|
|
13
|
+
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
15
14
|
var _insertTableFromQuickInsert = require("./insertTableFromQuickInsert");
|
|
16
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
16
|
var TableQuickInsertMenuItem = exports.TableQuickInsertMenuItem = function TableQuickInsertMenuItem(_ref) {
|
|
@@ -20,33 +19,23 @@ var TableQuickInsertMenuItem = exports.TableQuickInsertMenuItem = function Table
|
|
|
20
19
|
options = _ref.options;
|
|
21
20
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
22
21
|
formatMessage = _useIntl.formatMessage;
|
|
23
|
-
var
|
|
24
|
-
editorView =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
insert: insert,
|
|
35
|
-
isTableSelectorEnabled: isTableSelectorEnabled,
|
|
36
|
-
options: options,
|
|
37
|
-
state: editorView.state
|
|
38
|
-
});
|
|
22
|
+
var onSelect = (0, _react.useCallback)(function (_ref2) {
|
|
23
|
+
var editorView = _ref2.editorView,
|
|
24
|
+
insert = _ref2.insert,
|
|
25
|
+
source = _ref2.source;
|
|
26
|
+
return (0, _insertTableFromQuickInsert.insertTableFromQuickInsert)({
|
|
27
|
+
api: api,
|
|
28
|
+
inputMethod: source,
|
|
29
|
+
insert: insert,
|
|
30
|
+
isTableSelectorEnabled: isTableSelectorEnabled,
|
|
31
|
+
options: options,
|
|
32
|
+
state: editorView.state
|
|
39
33
|
});
|
|
40
|
-
}, [api,
|
|
41
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
42
|
-
onMouseMove: item === null || item === void 0 ? void 0 : item.onMouseMove
|
|
43
|
-
}, /*#__PURE__*/_react.default.createElement(_buttonItem.default, {
|
|
44
|
-
"aria-selected": item === null || item === void 0 ? void 0 : item.isSelected,
|
|
45
|
-
description: formatMessage(_messages.toolbarInsertBlockMessages.tableDescription),
|
|
34
|
+
}, [api, isTableSelectorEnabled, options]);
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
46
36
|
iconBefore: /*#__PURE__*/_react.default.createElement(_icons.IconTable, null),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, formatMessage(_messages.toolbarInsertBlockMessages.table)));
|
|
37
|
+
onSelect: onSelect,
|
|
38
|
+
shortcut: (0, _keymaps.tooltip)(_keymaps.toggleTable),
|
|
39
|
+
title: formatMessage(_messages.toolbarInsertBlockMessages.table)
|
|
40
|
+
});
|
|
52
41
|
};
|
|
@@ -18,7 +18,7 @@ var getTableQuickInsertComponents = exports.getTableQuickInsertComponents = func
|
|
|
18
18
|
options = _ref.options;
|
|
19
19
|
return [_objectSpread(_objectSpread({}, _keys.TABLE_MENU_ITEM), {}, {
|
|
20
20
|
parents: [_objectSpread(_objectSpread({}, _keys.STRUCTURE_SECTION), {}, {
|
|
21
|
-
rank: _rank.
|
|
21
|
+
rank: _rank.STRUCTURE_SECTION_RANK[_keys.TABLE_MENU_ITEM.key]
|
|
22
22
|
})],
|
|
23
23
|
component: function component() {
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement(_TableQuickInsertMenuItem.TableQuickInsertMenuItem, {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
4
|
+
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import {
|
|
6
|
-
import ButtonItem from '@atlaskit/menu/button-item';
|
|
6
|
+
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
7
7
|
import { insertTableFromQuickInsert } from './insertTableFromQuickInsert';
|
|
8
8
|
export const TableQuickInsertMenuItem = ({
|
|
9
9
|
api,
|
|
@@ -13,33 +13,22 @@ export const TableQuickInsertMenuItem = ({
|
|
|
13
13
|
const {
|
|
14
14
|
formatMessage
|
|
15
15
|
} = useIntl();
|
|
16
|
-
const {
|
|
16
|
+
const onSelect = useCallback(({
|
|
17
17
|
editorView,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
isTableSelectorEnabled,
|
|
30
|
-
options,
|
|
31
|
-
state: editorView.state
|
|
32
|
-
}));
|
|
33
|
-
}, [api, editorView, isTableSelectorEnabled, options, select]);
|
|
34
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
onMouseMove: item === null || item === void 0 ? void 0 : item.onMouseMove
|
|
36
|
-
}, /*#__PURE__*/React.createElement(ButtonItem, {
|
|
37
|
-
"aria-selected": item === null || item === void 0 ? void 0 : item.isSelected,
|
|
38
|
-
description: formatMessage(messages.tableDescription),
|
|
18
|
+
insert,
|
|
19
|
+
source
|
|
20
|
+
}) => insertTableFromQuickInsert({
|
|
21
|
+
api,
|
|
22
|
+
inputMethod: source,
|
|
23
|
+
insert,
|
|
24
|
+
isTableSelectorEnabled,
|
|
25
|
+
options,
|
|
26
|
+
state: editorView.state
|
|
27
|
+
}), [api, isTableSelectorEnabled, options]);
|
|
28
|
+
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
39
29
|
iconBefore: /*#__PURE__*/React.createElement(IconTable, null),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, formatMessage(messages.table)));
|
|
30
|
+
onSelect: onSelect,
|
|
31
|
+
shortcut: tooltip(toggleTable),
|
|
32
|
+
title: formatMessage(messages.table)
|
|
33
|
+
});
|
|
45
34
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { STRUCTURE_SECTION, TABLE_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
|
|
3
|
-
import {
|
|
3
|
+
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
4
4
|
import { TableQuickInsertMenuItem } from './TableQuickInsertMenuItem';
|
|
5
5
|
export const getTableQuickInsertComponents = ({
|
|
6
6
|
api,
|
|
@@ -10,7 +10,7 @@ export const getTableQuickInsertComponents = ({
|
|
|
10
10
|
...TABLE_MENU_ITEM,
|
|
11
11
|
parents: [{
|
|
12
12
|
...STRUCTURE_SECTION,
|
|
13
|
-
rank:
|
|
13
|
+
rank: STRUCTURE_SECTION_RANK[TABLE_MENU_ITEM.key]
|
|
14
14
|
}],
|
|
15
15
|
component: () => /*#__PURE__*/React.createElement(TableQuickInsertMenuItem, {
|
|
16
16
|
api: api,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
4
|
+
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import {
|
|
6
|
-
import ButtonItem from '@atlaskit/menu/button-item';
|
|
6
|
+
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
7
7
|
import { insertTableFromQuickInsert } from './insertTableFromQuickInsert';
|
|
8
8
|
export var TableQuickInsertMenuItem = function TableQuickInsertMenuItem(_ref) {
|
|
9
9
|
var api = _ref.api,
|
|
@@ -11,33 +11,23 @@ export var TableQuickInsertMenuItem = function TableQuickInsertMenuItem(_ref) {
|
|
|
11
11
|
options = _ref.options;
|
|
12
12
|
var _useIntl = useIntl(),
|
|
13
13
|
formatMessage = _useIntl.formatMessage;
|
|
14
|
-
var
|
|
15
|
-
editorView =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
insert: insert,
|
|
26
|
-
isTableSelectorEnabled: isTableSelectorEnabled,
|
|
27
|
-
options: options,
|
|
28
|
-
state: editorView.state
|
|
29
|
-
});
|
|
14
|
+
var onSelect = useCallback(function (_ref2) {
|
|
15
|
+
var editorView = _ref2.editorView,
|
|
16
|
+
insert = _ref2.insert,
|
|
17
|
+
source = _ref2.source;
|
|
18
|
+
return insertTableFromQuickInsert({
|
|
19
|
+
api: api,
|
|
20
|
+
inputMethod: source,
|
|
21
|
+
insert: insert,
|
|
22
|
+
isTableSelectorEnabled: isTableSelectorEnabled,
|
|
23
|
+
options: options,
|
|
24
|
+
state: editorView.state
|
|
30
25
|
});
|
|
31
|
-
}, [api,
|
|
32
|
-
return /*#__PURE__*/React.createElement(
|
|
33
|
-
onMouseMove: item === null || item === void 0 ? void 0 : item.onMouseMove
|
|
34
|
-
}, /*#__PURE__*/React.createElement(ButtonItem, {
|
|
35
|
-
"aria-selected": item === null || item === void 0 ? void 0 : item.isSelected,
|
|
36
|
-
description: formatMessage(messages.tableDescription),
|
|
26
|
+
}, [api, isTableSelectorEnabled, options]);
|
|
27
|
+
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
37
28
|
iconBefore: /*#__PURE__*/React.createElement(IconTable, null),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, formatMessage(messages.table)));
|
|
29
|
+
onSelect: onSelect,
|
|
30
|
+
shortcut: tooltip(toggleTable),
|
|
31
|
+
title: formatMessage(messages.table)
|
|
32
|
+
});
|
|
43
33
|
};
|
|
@@ -3,7 +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 React from 'react';
|
|
5
5
|
import { STRUCTURE_SECTION, TABLE_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
|
|
6
|
-
import {
|
|
6
|
+
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
7
7
|
import { TableQuickInsertMenuItem } from './TableQuickInsertMenuItem';
|
|
8
8
|
export var getTableQuickInsertComponents = function getTableQuickInsertComponents(_ref) {
|
|
9
9
|
var api = _ref.api,
|
|
@@ -11,7 +11,7 @@ export var getTableQuickInsertComponents = function getTableQuickInsertComponent
|
|
|
11
11
|
options = _ref.options;
|
|
12
12
|
return [_objectSpread(_objectSpread({}, TABLE_MENU_ITEM), {}, {
|
|
13
13
|
parents: [_objectSpread(_objectSpread({}, STRUCTURE_SECTION), {}, {
|
|
14
|
-
rank:
|
|
14
|
+
rank: STRUCTURE_SECTION_RANK[TABLE_MENU_ITEM.key]
|
|
15
15
|
})],
|
|
16
16
|
component: function component() {
|
|
17
17
|
return /*#__PURE__*/React.createElement(TableQuickInsertMenuItem, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.4",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@atlaskit/editor-tables": "^3.0.0",
|
|
44
44
|
"@atlaskit/editor-toolbar": "^2.4.0",
|
|
45
45
|
"@atlaskit/editor-ui-control-model": "^2.4.0",
|
|
46
|
-
"@atlaskit/icon": "^37.
|
|
47
|
-
"@atlaskit/icon-lab": "^7.
|
|
46
|
+
"@atlaskit/icon": "^37.3.0",
|
|
47
|
+
"@atlaskit/icon-lab": "^7.5.0",
|
|
48
48
|
"@atlaskit/insm": "^1.2.0",
|
|
49
49
|
"@atlaskit/menu": "^9.2.0",
|
|
50
50
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"uuid": "^3.1.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@atlaskit/editor-common": "^117.
|
|
71
|
+
"@atlaskit/editor-common": "^117.2.0",
|
|
72
72
|
"react": "^18.2.0 || ^19.2.0",
|
|
73
73
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
74
74
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|