From e64e3b75c74891550c754bf117ca051cd94adeb3 Mon Sep 17 00:00:00 2001 From: felix Date: Sat, 15 Jun 2024 19:27:19 +0200 Subject: [PATCH] chore(): add missing main file --- package.json | 4 +++- src/algo.ts | 8 ++------ src/style.ts | 3 --- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 8e4e970..e8f54f1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@heliks/flex", "description": "Implementation of flexbox algorithm in typescript", - "version": "0.0.1", + "version": "0.0.2", "devDependencies": { "@types/jest": "29.0.1", "@types/node": "^20.14.2", @@ -9,6 +9,8 @@ "ts-jest": "29.0.0", "typescript": "^4.9.5" }, + "main": "lib/index.js", + "types": "lib/index.d.ts", "scripts": { "build": "tsc", "build:watch": "tsc -w", diff --git a/src/algo.ts b/src/algo.ts index 1addf5f..e1b8884 100644 --- a/src/algo.ts +++ b/src/algo.ts @@ -273,7 +273,7 @@ function getBaseSizeSpace(node: Node): Rect { // During the base size calculation, the child will use the available space to resolve // percentages. Percentages should not contribute to the base size calculation of an // auto sized child, therefore, if the node size is not yet determined, the child does - // not have a definite size, and therefore, the available space in that axis is 0. + // not have a definite size. The available space in that axis is 0. if (main === undefined) { main = 0; } @@ -362,7 +362,6 @@ function resolveFlexibleLengths(node: Node, line: Line): void { // their outer target main size; for other items, use their outer flex base size. node.constants.initialFreeSpace = innerMainSize; - for (const child of line.nodes) { const inner = child.constants.hypotheticalInnerSize.main(node.constants.isRow); @@ -383,9 +382,6 @@ function resolveFlexibleLengths(node: Node, line: Line): void { } } - // console.log('IFS', node.id, node.constants.initialFreeSpace, node.children.length) - - // 4. Loop while (true) { // A. Check for flexible items. If all the flex items on the line are frozen, @@ -538,7 +534,7 @@ function determineItemCrossSizes(node: Node): void { * as both the main and cross axis for the given `node` are determined. Performing layout * on flex item is skipped if possible. * @param known (optional) Dimensions of the node that are already known. If this is set, - * the node will use this size no matter. + * the node will use this size regardless of its styling. */ export function compute(node: Node, space: Rect, measure = false, known?: ImmutableRect>): Rect { setupConstants(node, space, known); diff --git a/src/style.ts b/src/style.ts index edba99e..8bc140b 100644 --- a/src/style.ts +++ b/src/style.ts @@ -77,9 +77,6 @@ export enum AlignContent { } -/** Alignment modes for justify-content. */ -export type AlignContent2 = AlignContent.Start | AlignContent.Center | AlignContent.End; - /** Defines the layout used for an item. */ export enum Display {