Skip to content

Commit

Permalink
chore(): add missing main file
Browse files Browse the repository at this point in the history
  • Loading branch information
Heliks committed Jun 15, 2024
1 parent 4df4d26 commit e64e3b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"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",
"jest": "29.0.3",
"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",
Expand Down
8 changes: 2 additions & 6 deletions src/algo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);

Expand All @@ -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,
Expand Down Expand Up @@ -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<Option<number>>): Rect {
setupConstants(node, space, known);
Expand Down
3 changes: 0 additions & 3 deletions src/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit e64e3b7

Please sign in to comment.