masua 0.11.6 → 0.11.8

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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Matthias Giger, 2017 Spope
3
+ Copyright (c) 2025 Matthias Giger, 2017 Spope
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/index.ts CHANGED
@@ -40,6 +40,7 @@ interface NumberConfiguration extends Configuration {
40
40
  singleColumnGutter: number
41
41
  }
42
42
 
43
+ // biome-ignore lint/suspicious/noConsole: User feedback.
43
44
  const log = (message: string, type: 'log' | 'error' = 'log') => console[type](`masua: ${message}.`)
44
45
 
45
46
  function getCount(state: State) {
@@ -182,6 +183,8 @@ function layout(state: State) {
182
183
 
183
184
  if (state.columns[nextColumn]) {
184
185
  state.columns[nextColumn] += (state.sizes[index] ?? 0) + (state.count > 1 ? state.gutterY : state.singleColumnGutter) // margin-bottom
186
+ } else {
187
+ state.columns[nextColumn] = (state.sizes[index] ?? 0) + (state.count > 1 ? state.gutterY : state.singleColumnGutter) // margin-bottom
185
188
  }
186
189
  }
187
190
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "masua",
3
3
  "description": "Simple masonry layout library in TypeScript.",
4
- "version": "0.11.6",
4
+ "version": "0.11.8",
5
5
  "repository": "github:tobua/masua",
6
6
  "homepage": "https://tobua.github.io/masua",
7
7
  "license": "MIT",
@@ -14,11 +14,11 @@
14
14
  "types": "tsc"
15
15
  },
16
16
  "devDependencies": {
17
- "@biomejs/biome": "^1.8.3",
18
- "@types/bun": "^1.1.6",
19
- "@types/react": "^18.3.3",
20
- "typescript": "^5.5.3",
21
- "zero-configuration": "^0.17.0"
17
+ "@biomejs/biome": "^2.1.4",
18
+ "@types/bun": "^1.2.19",
19
+ "@types/react": "^19.1.9",
20
+ "typescript": "^5.9.2",
21
+ "zero-configuration": "^1.0.5"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">= 18",
@@ -90,8 +90,9 @@
90
90
  "biome": {
91
91
  "extends": "recommended",
92
92
  "files": {
93
- "ignore": [
94
- "demo"
93
+ "includes": [
94
+ "**/*",
95
+ "!demo/**"
95
96
  ]
96
97
  }
97
98
  }
package/react.tsx CHANGED
@@ -1,5 +1,6 @@
1
1
  import { type Configuration, grid } from 'masua'
2
- import { type JSX, useEffect, useRef } from 'react'
2
+ import type React from 'react'
3
+ import { useEffect, useRef } from 'react'
3
4
 
4
5
  interface ReactConfiguration extends Configuration {
5
6
  disabled: boolean
@@ -17,11 +18,11 @@ const configurationProperties = [
17
18
  'wedge',
18
19
  ]
19
20
 
20
- export function Grid({ disabled = false, children, ...props }: JSX.IntrinsicElements['div'] & Partial<ReactConfiguration>) {
21
+ export function Grid({ disabled = false, children, ...props }: React.JSX.IntrinsicElements['div'] & Partial<ReactConfiguration>) {
21
22
  const gridRef = useRef(null)
22
23
  const instance = useRef<ReturnType<typeof grid> | null>(null)
23
24
  // TODO props changes on every render, cannot be memoized, should do deep compare.
24
- const configurationProps = Object.entries(props).reduce((result: { [key: string]: string }, [key, value]) => {
25
+ const configurationProps = Object.entries(props).reduce((result: { [resultKey: string]: string }, [key, value]) => {
25
26
  if (configurationProperties.includes(key)) {
26
27
  result[key] = value
27
28
  // @ts-ignore