@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 +6 -0
- package/dist/cjs/plugins/table/utils/snapping.js +2 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/utils/snapping.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/utils/snapping.js +3 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/utils/snapping.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/snapping.d.ts +1 -1
- package/package.json +1 -1
- package/src/plugins/table/utils/snapping.ts +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -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;
|
package/dist/cjs/version.json
CHANGED
|
@@ -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;
|
package/dist/es2019/version.json
CHANGED
|
@@ -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;
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
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 (
|
|
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;
|