@atlaskit/editor-plugin-table 2.5.2 → 2.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 2.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e8885f55db6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e8885f55db6) - Fixed type issue
8
+
3
9
  ## 2.5.2
4
10
 
5
11
  ### Patch Changes
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.findClosestSnap = void 0;
7
+ var _guideline = require("@atlaskit/editor-common/guideline");
7
8
  /**
8
9
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
9
10
  */
@@ -19,7 +20,7 @@ var findClosestSnap = function findClosestSnap(currentWidth, snapWidths, guideli
19
20
  // NOTE: The snap points are based on the guidelines, however their formatted as a length value whereas the guidelines
20
21
  // are point based. The point base x coords are calculated by halving the lengths. This means we can convert the
21
22
  // point base position to length by simply multiplying by 2.
22
- if (Math.round(Math.abs(guideline.position.x) * 2) === snappingWidth) {
23
+ if ((0, _guideline.isVerticalPosition)(guideline.position) && Math.round(Math.abs(guideline.position.x) * 2) === snappingWidth) {
23
24
  acc.push(guideline.key);
24
25
  }
25
26
  return acc;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,5 @@
1
+ import { isVerticalPosition } from '@atlaskit/editor-common/guideline';
2
+
1
3
  /**
2
4
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
3
5
  */
@@ -10,7 +12,7 @@ export const findClosestSnap = (currentWidth, snapWidths, guidelines, snapGap =
10
12
  // NOTE: The snap points are based on the guidelines, however their formatted as a length value whereas the guidelines
11
13
  // are point based. The point base x coords are calculated by halving the lengths. This means we can convert the
12
14
  // point base position to length by simply multiplying by 2.
13
- if (Math.round(Math.abs(guideline.position.x) * 2) === snappingWidth) {
15
+ if (isVerticalPosition(guideline.position) && Math.round(Math.abs(guideline.position.x) * 2) === snappingWidth) {
14
16
  acc.push(guideline.key);
15
17
  }
16
18
  return acc;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,5 @@
1
+ import { isVerticalPosition } from '@atlaskit/editor-common/guideline';
2
+
1
3
  /**
2
4
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
3
5
  */
@@ -13,7 +15,7 @@ export var findClosestSnap = function findClosestSnap(currentWidth, snapWidths,
13
15
  // NOTE: The snap points are based on the guidelines, however their formatted as a length value whereas the guidelines
14
16
  // are point based. The point base x coords are calculated by halving the lengths. This means we can convert the
15
17
  // point base position to length by simply multiplying by 2.
16
- if (Math.round(Math.abs(guideline.position.x) * 2) === snappingWidth) {
18
+ if (isVerticalPosition(guideline.position) && Math.round(Math.abs(guideline.position.x) * 2) === snappingWidth) {
17
19
  acc.push(guideline.key);
18
20
  }
19
21
  return acc;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
1
+ import { type GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  /**
3
3
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
1
+ import { type GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  /**
3
3
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,4 +1,7 @@
1
- import type { GuidelineConfig } from '@atlaskit/editor-plugin-guideline';
1
+ import {
2
+ type GuidelineConfig,
3
+ isVerticalPosition,
4
+ } from '@atlaskit/editor-common/guideline';
2
5
 
3
6
  /**
4
7
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
@@ -23,7 +26,10 @@ export const findClosestSnap = (
23
26
  // NOTE: The snap points are based on the guidelines, however their formatted as a length value whereas the guidelines
24
27
  // are point based. The point base x coords are calculated by halving the lengths. This means we can convert the
25
28
  // point base position to length by simply multiplying by 2.
26
- if (Math.round(Math.abs(guideline.position.x) * 2) === snappingWidth) {
29
+ if (
30
+ isVerticalPosition(guideline.position) &&
31
+ Math.round(Math.abs(guideline.position.x) * 2) === snappingWidth
32
+ ) {
27
33
  acc.push(guideline.key);
28
34
  }
29
35
  return acc;