@atlaskit/editor-plugin-table 2.5.1 → 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,17 @@
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
+
9
+ ## 2.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8b77d484c89`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8b77d484c89) - Change snap gap for tables guideline to 9px
14
+
3
15
  ## 2.5.1
4
16
 
5
17
  ### Patch Changes
@@ -143,7 +143,7 @@ var stickyRowOffsetTop = 8;
143
143
  exports.stickyRowOffsetTop = stickyRowOffsetTop;
144
144
  var stickyHeaderBorderBottomWidth = 1;
145
145
  exports.stickyHeaderBorderBottomWidth = stickyHeaderBorderBottomWidth;
146
- var TABLE_SNAP_GAP = 5;
146
+ var TABLE_SNAP_GAP = 9;
147
147
  exports.TABLE_SNAP_GAP = TABLE_SNAP_GAP;
148
148
  var TABLE_HIGHLIGHT_GAP = 10;
149
149
  exports.TABLE_HIGHLIGHT_GAP = TABLE_HIGHLIGHT_GAP;
@@ -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.1",
3
+ "version": "2.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -97,5 +97,5 @@ export const contextualMenuDropdownWidth = 180;
97
97
  export const stickyRowZIndex = resizeHandlerZIndex + 2;
98
98
  export const stickyRowOffsetTop = 8;
99
99
  export const stickyHeaderBorderBottomWidth = 1;
100
- export const TABLE_SNAP_GAP = 5;
100
+ export const TABLE_SNAP_GAP = 9;
101
101
  export const TABLE_HIGHLIGHT_GAP = 10;
@@ -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.1",
3
+ "version": "2.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -97,5 +97,5 @@ export var contextualMenuDropdownWidth = 180;
97
97
  export var stickyRowZIndex = resizeHandlerZIndex + 2;
98
98
  export var stickyRowOffsetTop = 8;
99
99
  export var stickyHeaderBorderBottomWidth = 1;
100
- export var TABLE_SNAP_GAP = 5;
100
+ export var TABLE_SNAP_GAP = 9;
101
101
  export var TABLE_HIGHLIGHT_GAP = 10;
@@ -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.1",
3
+ "version": "2.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -42,5 +42,5 @@ export declare const contextualMenuDropdownWidth = 180;
42
42
  export declare const stickyRowZIndex: number;
43
43
  export declare const stickyRowOffsetTop = 8;
44
44
  export declare const stickyHeaderBorderBottomWidth = 1;
45
- export declare const TABLE_SNAP_GAP = 5;
45
+ export declare const TABLE_SNAP_GAP = 9;
46
46
  export declare const TABLE_HIGHLIGHT_GAP = 10;
@@ -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
  */
@@ -42,5 +42,5 @@ export declare const contextualMenuDropdownWidth = 180;
42
42
  export declare const stickyRowZIndex: number;
43
43
  export declare const stickyRowOffsetTop = 8;
44
44
  export declare const stickyHeaderBorderBottomWidth = 1;
45
- export declare const TABLE_SNAP_GAP = 5;
45
+ export declare const TABLE_SNAP_GAP = 9;
46
46
  export declare const TABLE_HIGHLIGHT_GAP = 10;
@@ -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.1",
3
+ "version": "2.5.3",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -131,5 +131,5 @@ export const stickyRowZIndex = resizeHandlerZIndex + 2;
131
131
  export const stickyRowOffsetTop = 8;
132
132
  export const stickyHeaderBorderBottomWidth = 1;
133
133
 
134
- export const TABLE_SNAP_GAP = 5;
134
+ export const TABLE_SNAP_GAP = 9;
135
135
  export const TABLE_HIGHLIGHT_GAP = 10;
@@ -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;