@witchcraft/layout 0.0.6 → 0.0.7

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@witchcraft/layout",
3
3
  "configKey": "witchcraftLayout",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -1,16 +1,6 @@
1
- import { type Direction, type LayoutFrame, type Point, type Size } from "../types/index.js";
1
+ import { type Direction, LAYOUT_ERROR, type LayoutFrame, type Point, type Size } from "../types/index.js";
2
2
  import { KnownError } from "../utils/KnownError.js";
3
- export declare function getFrameSplitInfo(frame: LayoutFrame, dir: Direction, dragPointOrPosition?: Point | number | "midpoint", minSize?: Size, snapAmount?: Point): KnownError<"CANT_SPLIT_FRAME_TOO_SMALL", {
4
- frame: LayoutFrame;
5
- newSize: number;
6
- minSize: number;
7
- }> | {
3
+ export declare function getFrameSplitInfo(frame: LayoutFrame, dir: Direction, dragPointOrPosition?: Point | number | "midpoint", minSize?: Size, snapAmount?: Point): {
8
4
  splitFrame: LayoutFrame;
9
- newFrame: {
10
- width: number;
11
- height: number;
12
- x: number;
13
- y: number;
14
- id: import("../types/index.js").FrameId;
15
- };
16
- };
5
+ newFrame: LayoutFrame;
6
+ } | KnownError<typeof LAYOUT_ERROR.CANT_SPLIT_FRAME_TOO_SMALL>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@witchcraft/layout",
3
3
  "description": "Headless layout manager.",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "main": "./dist/runtime/index.js",
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -18,7 +18,10 @@ export function getFrameSplitInfo(
18
18
  dragPointOrPosition: Point | number | "midpoint" = "midpoint",
19
19
  minSize: Size = getMarginSize(),
20
20
  snapAmount: Point = getSnapPoint()
21
- ) {
21
+ ): {
22
+ splitFrame: LayoutFrame
23
+ newFrame: LayoutFrame
24
+ } | KnownError<typeof LAYOUT_ERROR.CANT_SPLIT_FRAME_TOO_SMALL> {
22
25
  frame = cloneFrame(frame)
23
26
  let newFrame = { ...frame }
24
27
  const isHorz = dir === "left" || dir === "right"