@atlaskit/editor-plugin-table 7.5.1 → 7.5.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 +12 -0
- package/dist/cjs/commands-with-analytics.js +65 -38
- package/dist/cjs/nodeviews/ExternalDropTargets.js +2 -2
- package/dist/cjs/nodeviews/TableCell.js +1 -1
- package/dist/cjs/nodeviews/TableComponent.js +1 -1
- package/dist/cjs/nodeviews/TableContainer.js +2 -2
- package/dist/cjs/nodeviews/TableResizer.js +2 -2
- package/dist/cjs/nodeviews/TableRow.js +1 -1
- package/dist/cjs/nodeviews/table.js +1 -1
- package/dist/cjs/pm-plugins/keymap.js +2 -2
- package/dist/cjs/pm-plugins/table-analytics.js +2 -2
- package/dist/cjs/pm-plugins/table-local-id.js +11 -11
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +16 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +0 -1
- package/dist/cjs/reducer.js +0 -2
- package/dist/cjs/toolbar.js +2 -2
- package/dist/cjs/ui/DragHandle/index.js +2 -2
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
- package/dist/cjs/ui/FloatingDeleteButton/index.js +3 -3
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +2 -2
- package/dist/cjs/ui/FloatingInsertButton/index.js +3 -3
- package/dist/cjs/ui/LayoutButton/index.js +3 -3
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +2 -2
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +3 -3
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +3 -3
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +3 -3
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/RowDropTarget/index.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/index.js +3 -3
- package/dist/cjs/utils/decoration.js +0 -4
- package/dist/cjs/utils/merged-cells.js +7 -3
- package/dist/es2019/commands-with-analytics.js +27 -0
- package/dist/es2019/pm-plugins/keymap.js +4 -4
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +17 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +0 -1
- package/dist/es2019/reducer.js +0 -2
- package/dist/es2019/utils/decoration.js +0 -4
- package/dist/es2019/utils/merged-cells.js +7 -3
- package/dist/esm/commands-with-analytics.js +64 -37
- package/dist/esm/nodeviews/TableCell.js +1 -1
- package/dist/esm/nodeviews/TableComponent.js +1 -1
- package/dist/esm/nodeviews/TableRow.js +1 -1
- package/dist/esm/nodeviews/table.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +4 -4
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +17 -2
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +0 -1
- package/dist/esm/reducer.js +0 -2
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
- package/dist/esm/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/ui/LayoutButton/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/index.js +1 -1
- package/dist/esm/utils/decoration.js +0 -4
- package/dist/esm/utils/merged-cells.js +7 -3
- package/dist/types/commands-with-analytics.d.ts +1 -0
- package/dist/types-ts4.5/commands-with-analytics.d.ts +1 -0
- package/package.json +2 -2
- package/src/commands-with-analytics.ts +39 -0
- package/src/pm-plugins/keymap.ts +13 -3
- package/src/pm-plugins/table-resizing/event-handlers.ts +20 -1
- package/src/utils/merged-cells.ts +7 -3
|
@@ -29,10 +29,10 @@ var _types = require("../../types");
|
|
|
29
29
|
var _utils4 = require("../../utils");
|
|
30
30
|
var _getPopupOptions = _interopRequireDefault(require("./getPopupOptions"));
|
|
31
31
|
var _InsertButton = _interopRequireWildcard(require("./InsertButton"));
|
|
32
|
-
function _getRequireWildcardCache(
|
|
33
|
-
function _interopRequireWildcard(
|
|
32
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
33
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
34
34
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
|
-
function _isNativeReflectConstruct() {
|
|
35
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
36
36
|
var FloatingInsertButton = exports.FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
37
37
|
(0, _inherits2.default)(FloatingInsertButton, _React$Component);
|
|
38
38
|
var _super = _createSuper(FloatingInsertButton);
|
|
@@ -24,10 +24,10 @@ var _collapse = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/coll
|
|
|
24
24
|
var _expand = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/expand"));
|
|
25
25
|
var _commandsWithAnalytics = require("../../commands-with-analytics");
|
|
26
26
|
var _types = require("../../types");
|
|
27
|
-
function _getRequireWildcardCache(
|
|
28
|
-
function _interopRequireWildcard(
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
|
-
function _isNativeReflectConstruct() {
|
|
30
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
31
|
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; }
|
|
32
32
|
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; }
|
|
33
33
|
var addPopupOffset = function addPopupOffset(pos) {
|
|
@@ -15,8 +15,8 @@ var _commands2 = require("../../../pm-plugins/drag-and-drop/commands");
|
|
|
15
15
|
var _types = require("../../../types");
|
|
16
16
|
var _utils2 = require("../../../utils");
|
|
17
17
|
var _DragHandle = require("../../DragHandle");
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
20
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
21
21
|
|
|
22
22
|
var getSelectedColumns = function getSelectedColumns(selection) {
|
|
@@ -8,8 +8,8 @@ exports.ColumnDropTarget = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
|
|
10
10
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
var ColumnDropTarget = exports.ColumnDropTarget = function ColumnDropTarget(_ref) {
|
|
14
14
|
var index = _ref.index,
|
|
15
15
|
localId = _ref.localId,
|
|
@@ -8,8 +8,8 @@ exports.ColumnDropTargets = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _types = require("../../../types");
|
|
10
10
|
var _ColumnDropTarget = require("./ColumnDropTarget");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
var ColumnDropTargets = exports.ColumnDropTargets = function ColumnDropTargets(_ref) {
|
|
14
14
|
var tableRef = _ref.tableRef,
|
|
15
15
|
tableHeight = _ref.tableHeight,
|
|
@@ -13,8 +13,8 @@ var _types = require("../../types");
|
|
|
13
13
|
var _utils = require("../../utils");
|
|
14
14
|
var _ColumnControls = require("./ColumnControls");
|
|
15
15
|
var _ColumnDropTargets = require("./ColumnDropTargets");
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
19
19
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
20
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -21,10 +21,10 @@ var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
|
21
21
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
22
22
|
var _commands = require("../../../commands");
|
|
23
23
|
var _types = require("../../../types");
|
|
24
|
-
function _getRequireWildcardCache(
|
|
25
|
-
function _interopRequireWildcard(
|
|
24
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
26
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
|
-
function _isNativeReflectConstruct() {
|
|
27
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
28
|
var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
29
29
|
(0, _inherits2.default)(CornerControlComponent, _Component);
|
|
30
30
|
var _super = _createSuper(CornerControlComponent);
|
|
@@ -13,8 +13,8 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
13
13
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
14
14
|
var _commands = require("../../../commands");
|
|
15
15
|
var _types = require("../../../types");
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var DragCornerControlsComponent = function DragCornerControlsComponent(_ref) {
|
|
19
19
|
var editorView = _ref.editorView,
|
|
20
20
|
isInDanger = _ref.isInDanger,
|
|
@@ -21,10 +21,10 @@ var _commands = require("../../../commands");
|
|
|
21
21
|
var _types = require("../../../types");
|
|
22
22
|
var _utils2 = require("../../../utils");
|
|
23
23
|
var _consts = require("../../consts");
|
|
24
|
-
function _getRequireWildcardCache(
|
|
25
|
-
function _interopRequireWildcard(
|
|
24
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
26
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
|
-
function _isNativeReflectConstruct() {
|
|
27
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
28
|
var NumberColumn = exports.default = /*#__PURE__*/function (_Component) {
|
|
29
29
|
(0, _inherits2.default)(NumberColumn, _Component);
|
|
30
30
|
var _super = _createSuper(NumberColumn);
|
|
@@ -20,10 +20,10 @@ var _commands = require("../../../commands");
|
|
|
20
20
|
var _types = require("../../../types");
|
|
21
21
|
var _utils = require("../../../utils");
|
|
22
22
|
var _consts = require("../../consts");
|
|
23
|
-
function _getRequireWildcardCache(
|
|
24
|
-
function _interopRequireWildcard(
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
26
|
-
function _isNativeReflectConstruct() {
|
|
26
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
27
|
var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
28
28
|
(0, _inherits2.default)(RowControlsComponent, _Component);
|
|
29
29
|
var _super = _createSuper(RowControlsComponent);
|
|
@@ -20,8 +20,8 @@ var _utils2 = require("../../../utils");
|
|
|
20
20
|
var _consts = require("../../consts");
|
|
21
21
|
var _DragHandle = require("../../DragHandle");
|
|
22
22
|
var _RowDropTarget = _interopRequireDefault(require("../RowDropTarget"));
|
|
23
|
-
function _getRequireWildcardCache(
|
|
24
|
-
function _interopRequireWildcard(
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
25
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
26
26
|
|
|
27
27
|
var getSelectedRows = function getSelectedRows(selection) {
|
|
@@ -8,8 +8,8 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
|
|
10
10
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
var RowDropTarget = function RowDropTarget(_ref) {
|
|
14
14
|
var index = _ref.index,
|
|
15
15
|
localId = _ref.localId,
|
|
@@ -21,13 +21,13 @@ var _utils2 = require("../../utils");
|
|
|
21
21
|
var _CornerControls = require("./CornerControls");
|
|
22
22
|
var _NumberColumn = _interopRequireDefault(require("./NumberColumn"));
|
|
23
23
|
var _RowControls = require("./RowControls");
|
|
24
|
-
function _getRequireWildcardCache(
|
|
25
|
-
function _interopRequireWildcard(
|
|
24
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
26
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
27
27
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
28
28
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
29
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
|
-
function _isNativeReflectConstruct() {
|
|
30
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
31
|
var TableFloatingControls = exports.default = /*#__PURE__*/function (_Component) {
|
|
32
32
|
(0, _inherits2.default)(TableFloatingControls, _Component);
|
|
33
33
|
var _super = _createSuper(TableFloatingControls);
|
|
@@ -437,11 +437,9 @@ var createColumnLineResize = exports.createColumnLineResize = function createCol
|
|
|
437
437
|
if (isLastColumn) {
|
|
438
438
|
return true; // If is the last column no filter applied
|
|
439
439
|
}
|
|
440
|
-
|
|
441
440
|
var nextPosition = map.map[map.width * rowIndex + columnIndex - 1];
|
|
442
441
|
return cellPosition !== nextPosition; // Removed it if next position is merged
|
|
443
442
|
});
|
|
444
|
-
|
|
445
443
|
var cells = cellPositions.map(function (pos) {
|
|
446
444
|
return {
|
|
447
445
|
pos: pos + table.start,
|
|
@@ -482,11 +480,9 @@ var createColumnInsertLine = exports.createColumnInsertLine = function createCol
|
|
|
482
480
|
if (isLastColumn) {
|
|
483
481
|
return true; // If is the last column no filter applied
|
|
484
482
|
}
|
|
485
|
-
|
|
486
483
|
var nextPosition = map.map[map.width * rowIndex + columnIndex - 1];
|
|
487
484
|
return cellPosition !== nextPosition; // Removed it if next position is merged
|
|
488
485
|
});
|
|
489
|
-
|
|
490
486
|
var cells = cellPositions.map(function (pos) {
|
|
491
487
|
return {
|
|
492
488
|
pos: pos + table.start,
|
|
@@ -125,7 +125,6 @@ var hasMergedCellsInBetween = exports.hasMergedCellsInBetween = function hasMerg
|
|
|
125
125
|
return !cells.includes(nodePos) // cell exists in Rect but not show in the map.cellsInRect list => merged cell
|
|
126
126
|
? true : mergedCells.has(nodePos); // cell includes in mergedCells => merged cell
|
|
127
127
|
});
|
|
128
|
-
|
|
129
128
|
return (0, _toConsumableArray2.default)(new Set(mergedCell));
|
|
130
129
|
};
|
|
131
130
|
var mergedCellsInRectArr = indexes.map(function (index) {
|
|
@@ -234,8 +233,13 @@ var checkEdgeHasMergedCells = exports.checkEdgeHasMergedCells = function checkEd
|
|
|
234
233
|
var maxIndex = Math.max.apply(Math, (0, _toConsumableArray2.default)(indexes));
|
|
235
234
|
var isTopSideHaveMergedCells = false;
|
|
236
235
|
var isBottomSideHaveMergedCells = false;
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* this is to check if the cell position from last focused table is overflow. since if you selection from a cell in 6th row and 7th column cell in a 7x8 table to 3x3 table, the cell position will be overflow because new table dont have this cell at all.
|
|
239
|
+
TODO: ED-22335 this should better called only when hover over the drag handle.
|
|
240
|
+
*/
|
|
241
|
+
var isOldMinIndex = !map[minIndex - 1] || !map[minIndex];
|
|
242
|
+
var isOldMaxIndex = !map[maxIndex + 1] || !map[maxIndex];
|
|
239
243
|
if (minIndex > 0 && !isOldMinIndex) {
|
|
240
244
|
var prevSelectionSet = map[minIndex - 1];
|
|
241
245
|
var minSelectionSet = map[minIndex];
|
|
@@ -4,6 +4,7 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
4
4
|
import { findCellClosestToPos, findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { clearMultipleCells } from './commands/clear';
|
|
6
6
|
import { wrapTableInExpand } from './commands/collapse';
|
|
7
|
+
import { changeColumnWidthByStep } from './commands/column-resize';
|
|
7
8
|
import { deleteColumnsCommand } from './commands/delete';
|
|
8
9
|
import { insertColumn, insertRow } from './commands/insert';
|
|
9
10
|
import { deleteTable, deleteTableIfSelected, getTableSelectionType, setMultipleCellAttrs } from './commands/misc';
|
|
@@ -167,6 +168,32 @@ export const insertRowWithAnalytics = editorAnalyticsAPI => (inputMethod, option
|
|
|
167
168
|
eventType: EVENT_TYPE.TRACK
|
|
168
169
|
};
|
|
169
170
|
})(editorAnalyticsAPI)(insertRow(options.index, options.moveCursorToInsertedRow));
|
|
171
|
+
export const changeColumnWidthByStepWithAnalytics = editorAnalyticsAPI => (stepSize, getEditorContainerWidth, tablePreserveWidth, inputMethod) => withEditorAnalyticsAPI(state => {
|
|
172
|
+
const {
|
|
173
|
+
table,
|
|
174
|
+
totalRowCount,
|
|
175
|
+
totalColumnCount
|
|
176
|
+
} = getSelectedTableInfo(state.selection);
|
|
177
|
+
const {
|
|
178
|
+
hoveredCell: {
|
|
179
|
+
colIndex
|
|
180
|
+
}
|
|
181
|
+
} = getPluginState(state);
|
|
182
|
+
return {
|
|
183
|
+
action: TABLE_ACTION.COLUMN_RESIZED,
|
|
184
|
+
actionSubject: ACTION_SUBJECT.TABLE,
|
|
185
|
+
eventType: EVENT_TYPE.TRACK,
|
|
186
|
+
attributes: {
|
|
187
|
+
colIndex,
|
|
188
|
+
resizedDelta: stepSize,
|
|
189
|
+
isLastColumn: colIndex === totalColumnCount - 1,
|
|
190
|
+
tableWidth: table === null || table === void 0 ? void 0 : table.node.attrs.width,
|
|
191
|
+
inputMethod,
|
|
192
|
+
totalRowCount,
|
|
193
|
+
totalColumnCount
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
})(editorAnalyticsAPI)(changeColumnWidthByStep(stepSize, getEditorContainerWidth, tablePreserveWidth));
|
|
170
197
|
export const insertColumnWithAnalytics = (getEditorContainerWidth, editorAnalyticsAPI, tablePreserveWidth = false) => (inputMethod, position) => withEditorAnalyticsAPI(state => {
|
|
171
198
|
const {
|
|
172
199
|
totalRowCount,
|
|
@@ -4,8 +4,8 @@ import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
|
4
4
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
5
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { createTable, goToNextCell, moveCursorBackward } from '../commands';
|
|
7
|
-
import { addRowAroundSelection, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
8
|
-
import { activateNextResizeArea,
|
|
7
|
+
import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
8
|
+
import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
9
9
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand } from '../commands/insert';
|
|
10
10
|
import { moveSourceWithAnalyticsViaShortcut } from '../pm-plugins/drag-and-drop/commands-with-analytics';
|
|
11
11
|
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
@@ -56,8 +56,8 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, getEdi
|
|
|
56
56
|
bindKeymapWithCommand(startColumnResizing.common, initiateKeyboardColumnResizing, list);
|
|
57
57
|
bindKeymapWithCommand(moveRight.common, activateNextResizeArea(1), list);
|
|
58
58
|
bindKeymapWithCommand(moveLeft.common, activateNextResizeArea(-1), list);
|
|
59
|
-
bindKeymapWithCommand(decreaseMediaSize.common,
|
|
60
|
-
bindKeymapWithCommand(increaseMediaSize.common,
|
|
59
|
+
bindKeymapWithCommand(decreaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI)(-10, getEditorContainerWidth, tablePreserveWidth, INPUT_METHOD.SHORTCUT), list);
|
|
60
|
+
bindKeymapWithCommand(increaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI)(10, getEditorContainerWidth, tablePreserveWidth, INPUT_METHOD.SHORTCUT), list);
|
|
61
61
|
bindKeymapWithCommand(escape.common, stopKeyboardColumnResizing(), list);
|
|
62
62
|
}
|
|
63
63
|
return keymap(list);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
|
|
3
3
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
@@ -154,6 +154,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
154
154
|
// only selected (or selected - 1) columns should be distributed
|
|
155
155
|
const resizingSelectedColumns = selectedColumns.indexOf(colIndex) > -1 || selectedColumns.indexOf(colIndex + 1) > -1;
|
|
156
156
|
const newResizeState = resizeColumn(resizeState, colIndex, clientX - startX, dom, resizingSelectedColumns ? selectedColumns : undefined, tablePreserveWidth);
|
|
157
|
+
const resizedDelta = clientX - startX;
|
|
157
158
|
tr = updateColumnWidths(newResizeState, table, start)(tr);
|
|
158
159
|
if (colIndex === map.width - 1) {
|
|
159
160
|
const mouseUpTime = event.timeStamp;
|
|
@@ -165,11 +166,25 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
165
166
|
type: 'table-border',
|
|
166
167
|
position: 'right',
|
|
167
168
|
duration: mouseUpTime - mouseDownTime,
|
|
168
|
-
delta: Math.abs(
|
|
169
|
+
delta: Math.abs(resizedDelta)
|
|
169
170
|
},
|
|
170
171
|
eventType: EVENT_TYPE.UI
|
|
171
172
|
})(tr);
|
|
172
173
|
}
|
|
174
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
175
|
+
action: TABLE_ACTION.COLUMN_RESIZED,
|
|
176
|
+
actionSubject: ACTION_SUBJECT.TABLE,
|
|
177
|
+
eventType: EVENT_TYPE.TRACK,
|
|
178
|
+
attributes: {
|
|
179
|
+
colIndex: colIndex,
|
|
180
|
+
resizedDelta,
|
|
181
|
+
isLastColumn: colIndex === map.width - 1,
|
|
182
|
+
tableWidth: table.attrs.width,
|
|
183
|
+
inputMethod: INPUT_METHOD.MOUSE,
|
|
184
|
+
totalRowCount: map.height,
|
|
185
|
+
totalColumnCount: map.width
|
|
186
|
+
}
|
|
187
|
+
})(tr);
|
|
173
188
|
}
|
|
174
189
|
if (getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
175
190
|
if (isKeyboardResize || !isTableHovered) {
|
|
@@ -39,7 +39,6 @@ export const getResizeState = ({
|
|
|
39
39
|
// Getting the resize state from DOM
|
|
40
40
|
const colgroupChildren = insertColgroupFromNode(tableRef, table, tablePreserveWidth, shouldReinsertColgroup // don't reinsert colgroup when preserving table width - this causes widths to jump
|
|
41
41
|
);
|
|
42
|
-
|
|
43
42
|
const cols = Array.from(colgroupChildren).map((_, index) => {
|
|
44
43
|
// If the table hasn't been resized and we have a table width attribute, we can use it
|
|
45
44
|
// to calculate the widths of the columns
|
package/dist/es2019/reducer.js
CHANGED
|
@@ -48,7 +48,6 @@ export default ((pluginState, action) => {
|
|
|
48
48
|
...action.data,
|
|
49
49
|
insertColumnButtonIndex: undefined // We need to assure that column is not shown
|
|
50
50
|
};
|
|
51
|
-
|
|
52
51
|
case 'SHOW_INSERT_COLUMN_BUTTON':
|
|
53
52
|
if (action.data.insertColumnButtonIndex === pluginState.insertColumnButtonIndex) {
|
|
54
53
|
return pluginState;
|
|
@@ -58,7 +57,6 @@ export default ((pluginState, action) => {
|
|
|
58
57
|
...action.data,
|
|
59
58
|
insertRowButtonIndex: undefined // We need to assure that row is not shown
|
|
60
59
|
};
|
|
61
|
-
|
|
62
60
|
case 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON':
|
|
63
61
|
if (pluginState.insertRowButtonIndex !== undefined || pluginState.insertColumnButtonIndex !== undefined) {
|
|
64
62
|
return {
|
|
@@ -406,11 +406,9 @@ export const createColumnLineResize = (selection, cellColumnPositioning) => {
|
|
|
406
406
|
if (isLastColumn) {
|
|
407
407
|
return true; // If is the last column no filter applied
|
|
408
408
|
}
|
|
409
|
-
|
|
410
409
|
const nextPosition = map.map[map.width * rowIndex + columnIndex - 1];
|
|
411
410
|
return cellPosition !== nextPosition; // Removed it if next position is merged
|
|
412
411
|
});
|
|
413
|
-
|
|
414
412
|
const cells = cellPositions.map(pos => ({
|
|
415
413
|
pos: pos + table.start,
|
|
416
414
|
node: table.node.nodeAt(pos)
|
|
@@ -447,11 +445,9 @@ export const createColumnInsertLine = (columnIndex, selection, hasMergedCells) =
|
|
|
447
445
|
if (isLastColumn) {
|
|
448
446
|
return true; // If is the last column no filter applied
|
|
449
447
|
}
|
|
450
|
-
|
|
451
448
|
const nextPosition = map.map[map.width * rowIndex + columnIndex - 1];
|
|
452
449
|
return cellPosition !== nextPosition; // Removed it if next position is merged
|
|
453
450
|
});
|
|
454
|
-
|
|
455
451
|
const cells = cellPositions.map(pos => ({
|
|
456
452
|
pos: pos + table.start,
|
|
457
453
|
node: table.node.nodeAt(pos)
|
|
@@ -100,7 +100,6 @@ export const hasMergedCellsInBetween = (indexes, type) => selection => {
|
|
|
100
100
|
return !cells.includes(nodePos) // cell exists in Rect but not show in the map.cellsInRect list => merged cell
|
|
101
101
|
? true : mergedCells.has(nodePos); // cell includes in mergedCells => merged cell
|
|
102
102
|
});
|
|
103
|
-
|
|
104
103
|
return [...new Set(mergedCell)];
|
|
105
104
|
};
|
|
106
105
|
const mergedCellsInRectArr = indexes.map(index => getMergedCellsInRect(index, type));
|
|
@@ -212,8 +211,13 @@ export const checkEdgeHasMergedCells = (indexes, tableMap, direction) => {
|
|
|
212
211
|
let maxIndex = Math.max(...indexes);
|
|
213
212
|
let isTopSideHaveMergedCells = false;
|
|
214
213
|
let isBottomSideHaveMergedCells = false;
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* this is to check if the cell position from last focused table is overflow. since if you selection from a cell in 6th row and 7th column cell in a 7x8 table to 3x3 table, the cell position will be overflow because new table dont have this cell at all.
|
|
217
|
+
TODO: ED-22335 this should better called only when hover over the drag handle.
|
|
218
|
+
*/
|
|
219
|
+
let isOldMinIndex = !map[minIndex - 1] || !map[minIndex];
|
|
220
|
+
let isOldMaxIndex = !map[maxIndex + 1] || !map[maxIndex];
|
|
217
221
|
if (minIndex > 0 && !isOldMinIndex) {
|
|
218
222
|
const prevSelectionSet = map[minIndex - 1];
|
|
219
223
|
const minSelectionSet = map[minIndex];
|