@atlaskit/editor-plugin-table 25.0.3 → 25.0.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 25.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 25.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`7087f393ec725`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7087f393ec725) -
14
+ Add the categorized registered Quick Insert browse experience with representative native elements
15
+ - Updated dependencies
16
+
3
17
  ## 25.0.3
4
18
 
5
19
  ### 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 _useQuickInsertContext = require("@atlaskit/editor-common/quick-insert/use-quick-insert-context");
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 _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
24
- editorView = _useQuickInsertContex.editorView,
25
- item = _useQuickInsertContex.item,
26
- select = _useQuickInsertContex.select;
27
- var onClick = (0, _react.useCallback)(function () {
28
- select(function (_ref2) {
29
- var insert = _ref2.insert,
30
- source = _ref2.source;
31
- return (0, _insertTableFromQuickInsert.insertTableFromQuickInsert)({
32
- api: api,
33
- inputMethod: source,
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, editorView, isTableSelectorEnabled, options, select]);
41
- return /*#__PURE__*/_react.default.createElement("div", {
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
- id: item === null || item === void 0 ? void 0 : item.id,
48
- isSelected: item === null || item === void 0 ? void 0 : item.isSelected,
49
- onClick: onClick,
50
- role: "option"
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.QUICK_INSERT_STRUCTURE_SECTION_RANK[_keys.TABLE_MENU_ITEM.key]
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 { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
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
- item,
19
- select
20
- } = useQuickInsertContext();
21
- const onClick = useCallback(() => {
22
- select(({
23
- insert,
24
- source
25
- }) => insertTableFromQuickInsert({
26
- api,
27
- inputMethod: source,
28
- insert,
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
- id: item === null || item === void 0 ? void 0 : item.id,
41
- isSelected: item === null || item === void 0 ? void 0 : item.isSelected,
42
- onClick: onClick,
43
- role: "option"
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 { QUICK_INSERT_STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
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: QUICK_INSERT_STRUCTURE_SECTION_RANK[TABLE_MENU_ITEM.key]
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 { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
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 _useQuickInsertContex = useQuickInsertContext(),
15
- editorView = _useQuickInsertContex.editorView,
16
- item = _useQuickInsertContex.item,
17
- select = _useQuickInsertContex.select;
18
- var onClick = useCallback(function () {
19
- select(function (_ref2) {
20
- var insert = _ref2.insert,
21
- source = _ref2.source;
22
- return insertTableFromQuickInsert({
23
- api: api,
24
- inputMethod: source,
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, editorView, isTableSelectorEnabled, options, select]);
32
- return /*#__PURE__*/React.createElement("div", {
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
- id: item === null || item === void 0 ? void 0 : item.id,
39
- isSelected: item === null || item === void 0 ? void 0 : item.isSelected,
40
- onClick: onClick,
41
- role: "option"
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 { QUICK_INSERT_STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
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: QUICK_INSERT_STRUCTURE_SECTION_RANK[TABLE_MENU_ITEM.key]
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",
3
+ "version": "25.0.5",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/editor-plugin-batch-attribute-updates": "^13.0.0",
30
30
  "@atlaskit/editor-plugin-content-insertion": "^13.0.0",
31
31
  "@atlaskit/editor-plugin-editor-viewmode": "^15.0.0",
32
- "@atlaskit/editor-plugin-extension": "16.0.2",
32
+ "@atlaskit/editor-plugin-extension": "16.0.3",
33
33
  "@atlaskit/editor-plugin-guideline": "^13.0.0",
34
34
  "@atlaskit/editor-plugin-interaction": "^24.0.0",
35
35
  "@atlaskit/editor-plugin-limited-mode": "^10.0.0",
@@ -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.2.0",
47
- "@atlaskit/icon-lab": "^7.4.0",
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",
@@ -53,7 +53,7 @@
53
53
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
55
55
  "@atlaskit/primitives": "^22.2.0",
56
- "@atlaskit/tmp-editor-statsig": "^139.0.0",
56
+ "@atlaskit/tmp-editor-statsig": "^140.0.0",
57
57
  "@atlaskit/toggle": "^17.1.0",
58
58
  "@atlaskit/tokens": "^16.3.0",
59
59
  "@atlaskit/tooltip": "^24.0.0",
@@ -68,7 +68,7 @@
68
68
  "uuid": "^3.1.0"
69
69
  },
70
70
  "peerDependencies": {
71
- "@atlaskit/editor-common": "^117.0.0",
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"