@atlaskit/editor-plugin-grid 1.0.1 → 1.0.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-grid
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
8
+
9
+ ## 1.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#81801](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81801) [`3afc1428a56a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3afc1428a56a) - Small refactor in the `overflowHighlight` utility function to improve compatibility with TypeScript 5
14
+
3
15
  ## 1.0.1
4
16
 
5
17
  ### Patch Changes
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.gridPlugin = exports.GRID_SIZE = void 0;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _react2 = require("@emotion/react");
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -30,12 +30,11 @@ var overflowHighlight = function overflowHighlight(highlights, side, start, size
30
30
  if (!highlights.length) {
31
31
  return false;
32
32
  }
33
- var minHighlight = highlights.reduce(function (prev, cur) {
34
- return Math.min(prev, cur);
35
- });
36
- var maxHighlight = highlights.reduce(function (prev, cur) {
37
- return Math.max(prev, cur);
33
+ var numericHighlights = highlights.filter(function (highlight) {
34
+ return typeof highlight === 'number';
38
35
  });
36
+ var minHighlight = Math.min.apply(Math, (0, _toConsumableArray2.default)(numericHighlights));
37
+ var maxHighlight = Math.max.apply(Math, (0, _toConsumableArray2.default)(numericHighlights));
39
38
  if (side === 'left') {
40
39
  return minHighlight < 0 && minHighlight <= -start && (typeof size === 'number' ? minHighlight >= -(start + size) : true);
41
40
  } else {
@@ -21,8 +21,9 @@ const overflowHighlight = (highlights, side, start, size) => {
21
21
  if (!highlights.length) {
22
22
  return false;
23
23
  }
24
- const minHighlight = highlights.reduce((prev, cur) => Math.min(prev, cur));
25
- const maxHighlight = highlights.reduce((prev, cur) => Math.max(prev, cur));
24
+ const numericHighlights = highlights.filter(highlight => typeof highlight === 'number');
25
+ const minHighlight = Math.min(...numericHighlights);
26
+ const maxHighlight = Math.max(...numericHighlights);
26
27
  if (side === 'left') {
27
28
  return minHighlight < 0 && minHighlight <= -start && (typeof size === 'number' ? minHighlight >= -(start + size) : true);
28
29
  } else {
@@ -1,5 +1,5 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import React from 'react';
4
4
  import { withTheme } from '@emotion/react';
5
5
  import classnames from 'classnames';
@@ -23,12 +23,11 @@ var overflowHighlight = function overflowHighlight(highlights, side, start, size
23
23
  if (!highlights.length) {
24
24
  return false;
25
25
  }
26
- var minHighlight = highlights.reduce(function (prev, cur) {
27
- return Math.min(prev, cur);
28
- });
29
- var maxHighlight = highlights.reduce(function (prev, cur) {
30
- return Math.max(prev, cur);
26
+ var numericHighlights = highlights.filter(function (highlight) {
27
+ return typeof highlight === 'number';
31
28
  });
29
+ var minHighlight = Math.min.apply(Math, _toConsumableArray(numericHighlights));
30
+ var maxHighlight = Math.max.apply(Math, _toConsumableArray(numericHighlights));
32
31
  if (side === 'left') {
33
32
  return minHighlight < 0 && minHighlight <= -start && (typeof size === 'number' ? minHighlight >= -(start + size) : true);
34
33
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-grid",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Grid plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -24,7 +24,7 @@
24
24
  ".": "./src/index.ts"
25
25
  },
26
26
  "dependencies": {
27
- "@atlaskit/editor-common": "^78.0.0",
27
+ "@atlaskit/editor-common": "^78.17.0",
28
28
  "@atlaskit/editor-plugin-width": "^1.0.0",
29
29
  "@atlaskit/editor-prosemirror": "3.0.0",
30
30
  "@atlaskit/editor-shared-styles": "^2.9.0",
@@ -39,7 +39,7 @@
39
39
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
40
40
  "@testing-library/react": "^12.1.5",
41
41
  "react-dom": "^16.8.0",
42
- "typescript": "~4.9.5",
42
+ "typescript": "~5.4.2",
43
43
  "wait-for-expect": "^1.2.0"
44
44
  },
45
45
  "techstack": {
@@ -65,14 +65,12 @@
65
65
  "ui-components": [
66
66
  "lite-mode"
67
67
  ],
68
- "deprecation": [
69
- "no-deprecated-imports"
70
- ],
68
+ "deprecation": "no-deprecated-imports",
71
69
  "styling": [
72
- "static",
70
+ "emotion",
73
71
  "emotion"
74
72
  ]
75
73
  }
76
74
  },
77
75
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
78
- }
76
+ }