@@ -93,7 +93,7 @@ const Header = () => {
asChild
>
@@ -133,7 +133,7 @@ const Header = () => {
Demo
{
Installation
{
asChild
>
diff --git a/apps/site/src/components/HeroSection.tsx b/apps/site/src/components/HeroSection.tsx
index 7fa0c51..12c937a 100644
--- a/apps/site/src/components/HeroSection.tsx
+++ b/apps/site/src/components/HeroSection.tsx
@@ -58,7 +58,7 @@ const HeroSection = () => {
asChild
>
diff --git a/apps/site/src/components/InstallationSection.tsx b/apps/site/src/components/InstallationSection.tsx
index 6dff592..45eccc5 100644
--- a/apps/site/src/components/InstallationSection.tsx
+++ b/apps/site/src/components/InstallationSection.tsx
@@ -301,7 +301,7 @@ export default App`
asChild
>
@@ -314,7 +314,7 @@ export default App`
asChild
>
@@ -322,7 +322,7 @@ export default App`
{/*
-
+
Join Discord
*/}
diff --git a/packages/core/README.md b/packages/core/README.md
index 19e7cbb..8d89746 100644
--- a/packages/core/README.md
+++ b/packages/core/README.md
@@ -18,7 +18,7 @@
---
-
+
---
diff --git a/packages/core/package.json b/packages/core/package.json
index 4fbc59a..4677df3 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -21,23 +21,27 @@
],
"repository": {
"type": "git",
- "url": "https://github.com/xcode-studio/dynamix-layout.git",
+ "url": "git+https://github.com/xcode-studio/dynamix-layout.git",
"directory": "packages/core"
},
"bugs": {
"url": "https://github.com/xcode-studio/dynamix-layout/issues"
},
"homepage": "https://github.com/xcode-studio/dynamix-layout#readme",
- "main": "./dist/core.cjs.js",
+ "main": "./dist/core.cjs",
"module": "./dist/core.es.js",
- "browser": "./dist/core.iife.js",
"types": "./dist/types/index.d.ts",
"typings": "./dist/types/index.d.ts",
"exports": {
".": {
- "types": "./dist/types/index.d.ts",
- "import": "./dist/core.es.js",
- "require": "./dist/core.cjs.js"
+ "import": {
+ "types": "./dist/types/index.d.ts",
+ "default": "./dist/core.es.js"
+ },
+ "require": {
+ "types": "./dist/types/index.d.cts",
+ "default": "./dist/core.cjs"
+ }
}
},
"files": [
@@ -53,8 +57,7 @@
},
"type": "module",
"engines": {
- "node": ">=22.16.0",
- "pnpm": ">=10.13.1"
+ "node": ">=18"
},
"scripts": {
"dev": "vite build --watch",
diff --git a/packages/core/src/app/comparator.ts b/packages/core/src/app/comparator.ts
index 6bd38d3..0782fac 100644
--- a/packages/core/src/app/comparator.ts
+++ b/packages/core/src/app/comparator.ts
@@ -1,5 +1,6 @@
import type { NodeOptions } from '../type'
+/** @deprecated Internal; removed in 2.0. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export function areNodeOptionsMapEqual(
mapA: Map
,
mapB: Map
@@ -18,6 +19,7 @@ export function areNodeOptionsMapEqual(
return true
}
+/** @deprecated Internal; removed in 2.0. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export function areNodeOptionsEqual(a: NodeOptions, b: NodeOptions): boolean {
if (a.typNode !== b.typNode) return false
if (a.nodName !== b.nodName) return false
diff --git a/packages/core/src/app/dom.ts b/packages/core/src/app/dom.ts
index 7d5b305..3db119d 100644
--- a/packages/core/src/app/dom.ts
+++ b/packages/core/src/app/dom.ts
@@ -1,5 +1,6 @@
import type { Dimension } from '../type'
+/** @deprecated Replaced in 2.0 by `applyRect(element, rect)`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export function setElementRect(el: HTMLElement, { x, y, w, h }: Dimension) {
el.style.left = `${x}px`
el.style.top = `${y}px`
@@ -7,7 +8,10 @@ export function setElementRect(el: HTMLElement, { x, y, w, h }: Dimension) {
el.style.height = `${h}px`
}
-/** Area of a tabset below its tab bar; never negative when squeezed. */
+/**
+ * Area of a tabset below its tab bar; never negative when squeezed.
+ * @deprecated Replaced in 2.0 by `getTabContentRect(tabsetRect, tabBarHeight)`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md
+ */
export function getTabBodyRect(
tabset: Dimension,
tabbarHeight: number
diff --git a/packages/core/src/app/drop-preview.ts b/packages/core/src/app/drop-preview.ts
index 7c25fd9..cb206cc 100644
--- a/packages/core/src/app/drop-preview.ts
+++ b/packages/core/src/app/drop-preview.ts
@@ -22,6 +22,7 @@ const DEFAULT_TAB_GAP = 6
/**
* Splits a tabset into thirds: the outer thirds drop beside it, the middle
* drops into it as a tab.
+ * @deprecated Replaced in 2.0 by `layout.getDropTarget()` and `layout.getDropIndicatorRect()`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md
*/
export function getTabsetDropPreview(
rect: PreviewRect,
@@ -60,7 +61,10 @@ export function getTabsetDropPreview(
}
}
-/** The half of the whole layout a root-edge drop would take. */
+/**
+ * The half of the whole layout a root-edge drop would take.
+ * @deprecated Replaced in 2.0 by `layout.getDropTarget()` and `layout.getDropIndicatorRect()`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md
+ */
export function getRootSplitPreview(
container: Dimension,
side: RootSide
@@ -93,6 +97,7 @@ export function getRootSplitPreview(
/**
* Insertion marker between the tabs of a tab bar. `index` is the tab the
* marker sits next to. Returns null when the pointer is above or below the bar.
+ * @deprecated Replaced in 2.0 by `layout.getDropTarget()` and `layout.getDropIndicatorRect()`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md
*/
export function getNavbarDropPreview(
navbarRect: PreviewRect,
@@ -157,6 +162,7 @@ export function getNavbarDropPreview(
}
}
+/** @deprecated Replaced in 2.0 by `layout.getDropTarget()` and `layout.getDropIndicatorRect()`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export function isSameDropPreview(
a: Partial,
b: DropPreview
diff --git a/packages/core/src/app/dynamix.ts b/packages/core/src/app/dynamix.ts
index b593b90..55b8f87 100644
--- a/packages/core/src/app/dynamix.ts
+++ b/packages/core/src/app/dynamix.ts
@@ -17,6 +17,7 @@ import * as geometry from './geometry'
import * as slider from './slider'
import * as treeMutations from './tree-mutations'
+/** @deprecated Replaced in 2.0 by `createLayout(options)`, which returns an independent instance (no static state). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
class Layout {
static get _root(): Node {
return layoutState.root
diff --git a/packages/core/src/app/node.ts b/packages/core/src/app/node.ts
index 610c67e..d09276d 100644
--- a/packages/core/src/app/node.ts
+++ b/packages/core/src/app/node.ts
@@ -4,6 +4,7 @@ import { areNodeOptionsMapEqual } from './comparator'
import { layoutState } from './state'
import type { Dimension, LayoutTree, NodeCache, NodeOptions } from '../type'
+/** @deprecated Internal; removed in 2.0. Read layout state from `layout.getSnapshot()` / `subscribe()`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export class Node {
static cache: NodeCache = {
dimMins: new Map(),
@@ -207,6 +208,7 @@ export class Node {
}
}
+/** @deprecated Internal; removed in 2.0. Splitters are `snapshot.splitters`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export class Bond {
dims: Dimension = { w: 0, h: 0, x: 0, y: 0 }
unId: string = layoutState.createId()
diff --git a/packages/core/src/app/queue.ts b/packages/core/src/app/queue.ts
index a554db2..c0e7246 100644
--- a/packages/core/src/app/queue.ts
+++ b/packages/core/src/app/queue.ts
@@ -1,3 +1,4 @@
+/** @deprecated Internal; removed in 2.0. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
class Queue {
private buffer: (T | undefined)[]
private head: number = 0
diff --git a/packages/core/src/app/reactive-state.ts b/packages/core/src/app/reactive-state.ts
index d973953..f071f55 100644
--- a/packages/core/src/app/reactive-state.ts
+++ b/packages/core/src/app/reactive-state.ts
@@ -1,5 +1,6 @@
import type { ReactiveValue, ChangeListener } from '../type'
+/** @deprecated Internal; removed in 2.0. Use `layout.subscribe()`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
function createReactiveState(
initialValue: T,
comparator: (a: T, b: T) => boolean = (a, b) => a === b
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 3fab1b4..33546ca 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -35,7 +35,7 @@ declare const __LICENSE__: string
console.log(`%c${asciiArt}`, titleStyle)
console.log('%c A powerful, dynamic layout system 🚀', textStyle)
console.log(
- '%c ⚡ For docs and more info, \n ⚡ visit: https://github.com/akash-aman/dynamix-layout',
+ '%c ⚡ For docs and more info, \n ⚡ visit: https://github.com/xcode-studio/dynamix-layout',
linkStyle
)
console.log(`%c${__LICENSE__}`, licenseStyle)
diff --git a/packages/core/src/type/index.ts b/packages/core/src/type/index.ts
index 97b2845..002ca1b 100644
--- a/packages/core/src/type/index.ts
+++ b/packages/core/src/type/index.ts
@@ -1,5 +1,6 @@
import { Node, Bond } from '../app/dynamix'
+/** @deprecated Replaced in 2.0 by `Rect { x, y, width, height }`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export type Dimension = {
w: number
h: number
@@ -32,10 +33,12 @@ export interface BaseNode {
nodOpen?: string | boolean
}
+/** @deprecated Replaced in 2.0 by `LayoutJSON` (v1 trees load automatically; `LayoutTreeV1` describes this shape). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export type LayoutTree = Omit & {
nodKids?: LayoutTree[]
}
+/** @deprecated Replaced in 2.0 by `TabsetState`, `SplitterState`, `TabState` and `snapshot.rects`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export interface NodeOptions extends BaseNode {
nodKids?: BaseNode[]
}
diff --git a/packages/core/vite.config.ts b/packages/core/vite.config.ts
index 5d6ece5..81ceec5 100644
--- a/packages/core/vite.config.ts
+++ b/packages/core/vite.config.ts
@@ -16,13 +16,24 @@ export default defineConfig({
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'dynamix.layout.core',
- fileName: (format) => `core.${format}.js`,
+ // `.cjs` so Node loads the CommonJS build as CommonJS in this `"type": "module"` package.
+ fileName: (format) => (format === 'cjs' ? 'core.cjs' : `core.${format}.js`),
formats: ['cjs', 'es', 'iife', 'umd'],
},
},
plugins: [
dts({
outDir: 'dist/types',
+ // Types-only modules never reach the bundle graph; list sources explicitly.
+ include: ['src'],
+ // One self-contained declaration file (Node16 resolution can't follow
+ // extensionless imports), copied to index.d.cts for `require`.
+ rollupTypes: true,
+ afterBuild: () =>
+ fs.copyFileSync(
+ resolve(__dirname, 'dist/types/index.d.ts'),
+ resolve(__dirname, 'dist/types/index.d.cts')
+ ),
exclude: ['node_modules/**', 'src/test/**'],
}),
visualizer({
diff --git a/packages/react/README.md b/packages/react/README.md
index 0ebaaee..b35ab65 100644
--- a/packages/react/README.md
+++ b/packages/react/README.md
@@ -20,7 +20,7 @@
---
-
+
---
@@ -39,7 +39,7 @@ The easiest way to get started is by using the ` ` component. Pr
```jsx
import React from 'react'
import { DynamixLayout } from '@dynamix-layout/react'
-import '@dynamix-layout/react/dist/layout.css' // Don't forget to import the default styles
+import '@dynamix-layout/react/style.css' // Don't forget to import the default styles
function App() {
// 1. Define your tabs as an array of [id, component] tuples
@@ -180,7 +180,7 @@ The hook returns an object with everything you need to build your UI, including:
import { tabs } from './comp'
import { DynamixLayout } from '@dynamix-layout/react'
import type { LayoutTree } from '@dynamix-layout/core'
-import '@dynamix-layout/solid/style.css'
+import '@dynamix-layout/react/style.css'
function App() {
diff --git a/packages/react/package.json b/packages/react/package.json
index cbae04f..4e42df2 100644
--- a/packages/react/package.json
+++ b/packages/react/package.json
@@ -27,25 +27,32 @@
],
"repository": {
"type": "git",
- "url": "https://github.com/xcode-studio/dynamix-layout",
+ "url": "git+https://github.com/xcode-studio/dynamix-layout.git",
"directory": "packages/react"
},
"bugs": {
"url": "https://github.com/xcode-studio/dynamix-layout/issues"
},
"homepage": "https://github.com/xcode-studio/dynamix-layout#readme",
- "main": "./dist/index.cjs.js",
+ "main": "./dist/index.cjs",
"module": "./dist/index.es.js",
"types": "./dist/types/index.d.ts",
"typings": "./dist/types/index.d.ts",
"style": "./dist/index.css",
"exports": {
".": {
- "types": "./dist/types/index.d.ts",
- "import": "./dist/index.es.js",
- "require": "./dist/index.cjs.js"
+ "import": {
+ "types": "./dist/types/index.d.ts",
+ "default": "./dist/index.es.js"
+ },
+ "require": {
+ "types": "./dist/types/index.d.cts",
+ "default": "./dist/index.cjs"
+ }
},
- "./style.css": "./dist/index.css"
+ "./style.css": "./dist/index.css",
+ "./styles.css": "./dist/index.css",
+ "./package.json": "./package.json"
},
"files": [
"dist",
@@ -62,8 +69,7 @@
},
"type": "module",
"engines": {
- "node": ">=22.16.0",
- "pnpm": ">=10.13.1"
+ "node": ">=18"
},
"scripts": {
"dev": "vite build --watch",
@@ -78,8 +84,8 @@
"@dynamix-layout/core": "workspace:*"
},
"peerDependencies": {
- "react": "^0.0.1",
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
+ "react": "^18.0.0 || ^19.0.0",
+ "react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
diff --git a/packages/react/src/components/Default.tsx b/packages/react/src/components/Default.tsx
index c76e70d..ebb5bea 100644
--- a/packages/react/src/components/Default.tsx
+++ b/packages/react/src/components/Default.tsx
@@ -5,6 +5,7 @@ type DefaultWrapTabLabelProps = HTMLAttributes & {
children?: ReactNode
}
+/** @deprecated Renamed in 2.0 to `Tab` (pass it as `components.Tab`). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const DefaultWrapTabLabel = forwardRef<
HTMLDivElement,
DefaultWrapTabLabelProps
@@ -28,6 +29,7 @@ export const DefaultWrapTabLabel = forwardRef<
))
DefaultWrapTabLabel.displayName = 'DefaultWrapTabLabel'
+/** @deprecated Renamed in 2.0 to `TabContent` (pass it as `components.TabContent`). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const DefaultWrapTabBody = forwardRef<
HTMLDivElement,
{ children?: ReactNode } & HTMLAttributes
@@ -52,6 +54,7 @@ export const DefaultWrapTabBody = forwardRef<
))
DefaultWrapTabBody.displayName = 'DefaultWrapTabBody'
+/** @deprecated Renamed in 2.0 to `TabBar` (pass it as `components.TabBar`). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const DefaultWrapTabHead = forwardRef<
HTMLDivElement,
{ children?: ReactNode } & HTMLAttributes
@@ -83,6 +86,7 @@ export const DefaultWrapTabHead = forwardRef<
))
DefaultWrapTabHead.displayName = 'DefaultWrapTabHead'
+/** @deprecated Renamed in 2.0 to `Panel` (pass it as `components.Panel`). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const DefaultWrapTabPanel = forwardRef<
HTMLDivElement,
{ children?: ReactNode } & HTMLAttributes
@@ -106,6 +110,7 @@ export const DefaultWrapTabPanel = forwardRef<
))
DefaultWrapTabPanel.displayName = 'DefaultWrapTabPanel'
+/** @deprecated Renamed in 2.0 to `DropIndicator` (pass it as `components.DropIndicator`). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const DefaultHoverElement = forwardRef<
HTMLDivElement,
{ children?: ReactNode } & HTMLAttributes
@@ -141,6 +146,7 @@ type DefaultSliderElementProps = HTMLAttributes & {
direction?: boolean
}
+/** @deprecated Renamed in 2.0 to `Splitter` (pass it as `components.Splitter`). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const DefaultSliderElement = forwardRef<
HTMLDivElement,
DefaultSliderElementProps
@@ -216,6 +222,7 @@ export const DefaultSliderElement = forwardRef<
))
DefaultSliderElement.displayName = 'DefaultSliderElement'
+/** @deprecated Renamed in 2.0 to `RootDropZone` (pass it as `components.RootDropZone`). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const RootSplitterHoverEl = forwardRef<
HTMLDivElement,
{
diff --git a/packages/react/src/components/Layout.tsx b/packages/react/src/components/Layout.tsx
index 39dcb50..4200c7e 100644
--- a/packages/react/src/components/Layout.tsx
+++ b/packages/react/src/components/Layout.tsx
@@ -19,6 +19,7 @@ import {
} from './Default'
import './layout.css'
+/** @deprecated Internal; removed in 2.0 (tabs are objects with stable ids). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const getTabOutput = (input: TabInput): TabOutput => {
const keys: string[] = []
const maps: Map = new Map()
diff --git a/packages/react/src/hooks/useLayout.ts b/packages/react/src/hooks/useLayout.ts
index 65bbe6e..f8bcdab 100644
--- a/packages/react/src/hooks/useLayout.ts
+++ b/packages/react/src/hooks/useLayout.ts
@@ -16,6 +16,7 @@ import {
import React, { useState, useEffect } from 'react'
import { useDynamixLayoutOptions } from '../types'
+/** @deprecated Internal in 1.x. In 2.0 `useDynamixLayout` is a different, headless hook with prop getters. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export const useDynamixLayout = ({
tabOutput,
rootId,
diff --git a/packages/react/src/types/index.ts b/packages/react/src/types/index.ts
index 7477aa0..7985625 100644
--- a/packages/react/src/types/index.ts
+++ b/packages/react/src/types/index.ts
@@ -1,6 +1,7 @@
import type { ReactNode } from 'react'
import type { LayoutTree, Dimension } from '@dynamix-layout/core'
+/** @deprecated Unused; removed in 2.0 (the name is reused for the 2.0 component props). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export interface DynamixLayoutProps {
children?: ReactNode
layoutTree?: LayoutTree
@@ -9,11 +10,13 @@ export interface DynamixLayoutProps {
style?: React.CSSProperties
}
+/** @deprecated Unused; removed in 2.0. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export interface UseDynamixLayoutOptions {
initialLayoutTree?: LayoutTree
tabs?: string[]
}
+/** @deprecated Unused; removed in 2.0. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export interface UseDynamixLayoutResult {
layoutTree: LayoutTree | undefined
tabs: string[]
@@ -21,40 +24,59 @@ export interface UseDynamixLayoutResult {
setLayoutTree: (layoutTree: LayoutTree) => void
}
+/** @deprecated Removed in 2.0; slot components receive typed props. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export type DivFC = React.ForwardRefExoticComponent<
React.HTMLAttributes & React.RefAttributes
>
+/** @deprecated Internal; removed in 2.0. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export type TabEntry = {
uqid: string
name: string
node: React.ReactNode
}
+/** @deprecated Replaced in 2.0 by `TabItem[]` (`{ id, title, content }`). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export type TabInput = [string, React.ReactNode][]
+/** @deprecated Internal; removed in 2.0. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export type TabOutput = {
keys: string[]
maps: Map
name: Map
}
+/**
+ * Props of `` in 1.x. Most of them change in 2.0: each
+ * deprecated prop names its replacement, and the migration guide has the
+ * full list (saved layouts keep working): https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md
+ */
export interface LayoutProps {
tabs: [string, ReactNode][]
+ /** @deprecated Replaced in v2 by `showTabBar`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
enableTabbar?: boolean
+ /** @deprecated Replaced in v2 by `components.Panel`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
WrapTabPanel?: DivFC
+ /** @deprecated Replaced in v2 by `components.Tab`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
WrapTabLabel?: React.ForwardRefExoticComponent<
React.HTMLAttributes &
React.RefAttributes & { active?: boolean }
>
+ /** @deprecated Replaced in v2 by `components.TabBar`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
WrapTabHead?: DivFC
+ /** @deprecated Replaced in v2 by `components.TabContent`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
WrapTabBody?: DivFC
+ /** @deprecated Replaced in v2 by `components.DropIndicator`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
HoverElement?: DivFC
+ /** @deprecated Replaced in v2 by `components.Splitter`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
SliderElement?: React.ForwardRefExoticComponent<
React.HTMLAttributes &
React.RefAttributes & { direction?: boolean }
>
+ /** @deprecated Replaced in v2 by `tabBarHeight`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabHeadHeight?: number
+ /** @deprecated Replaced in v2 by `defaultLayout` (or `layout` for controlled mode). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
layoutTree?: LayoutTree
+ /** @deprecated Replaced in v2 by `padding: number | { top, right, bottom, left }`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
pad?: {
t: number
b: number
@@ -63,32 +85,57 @@ export interface LayoutProps {
}
className?: string
style?: React.CSSProperties
+ /** @deprecated Replaced in v2 by `splitterSize`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
bondWidth?: number
+ /** @deprecated Replaced in v2 by `minPanelSize: { width, height }`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
minTabHeight?: number
+ /** @deprecated Replaced in v2 by `minPanelSize: { width, height }`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
minTabWidth?: number
+ /** @deprecated Replaced in v2 by `onLayoutChange(layout, { reason })`, which receives v2 `LayoutJSON` and is not called on mount. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
updateJSON?: (layoutTree: LayoutTree) => void
+ /** @deprecated Replaced in v2 by nothing: splitters update once per animation frame. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
sliderUpdateTimeout?: number
+ /** @deprecated Replaced in v2 by `resizeThrottleMs`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
windowResizeTimeout?: number
+ /** @deprecated Replaced in v2 by nothing: splitters update once per animation frame. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
disableSliderTimeout?: boolean
+ /** @deprecated Replaced in v2 by `resizeThrottleMs`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
disableResizeTimeout?: boolean
+ /** @deprecated Replaced in v2 by `styles.dropIndicator`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
hoverElementStyles?: React.CSSProperties
+ /** @deprecated Replaced in v2 by `styles.splitter`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
sliderElementStyles?: React.CSSProperties
+ /** @deprecated Replaced in v2 by `styles.panel`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabPanelElementStyles?: React.CSSProperties
+ /** @deprecated Replaced in v2 by `styles.tabContent`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabBodyElementStyles?: React.CSSProperties
+ /** @deprecated Replaced in v2 by `styles.tabBar`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabHeadElementStyles?: React.CSSProperties
+ /** @deprecated Replaced in v2 by `styles.tab`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabLabelElementStyles?: React.CSSProperties
+ /** @deprecated Replaced in v2 by `styles.rootDropZone`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
RootSplitterHoverElStyles?: React.CSSProperties
+ /** @deprecated Replaced in v2 by `classNames.dropIndicator`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
hoverElementClass?: string
+ /** @deprecated Replaced in v2 by `classNames.splitter`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
sliderElementClass?: string
+ /** @deprecated Replaced in v2 by `classNames.panel`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabPanelElementClass?: string
+ /** @deprecated Replaced in v2 by `classNames.tabContent`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabBodyElementClass?: string
+ /** @deprecated Replaced in v2 by `classNames.tabBar`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabHeadElementClass?: string
+ /** @deprecated Replaced in v2 by `classNames.tab`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabLabelElementClass?: string
+ /** @deprecated Replaced in v2 by `classNames.rootDropZone`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
RootSplitterHoverElClass?: string
+ /** @deprecated Replaced in v2 by the standard `id` prop. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
rootId?: string
+ /** @deprecated Replaced in v2 by `tabs: { id, title, content }[]`. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
tabNames?: Map
}
+/** @deprecated Internal; removed in 2.0. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
export interface useDynamixLayoutOptions {
tabOutput: TabOutput
rootId?: string
diff --git a/packages/react/tsconfig.build.json b/packages/react/tsconfig.build.json
new file mode 100644
index 0000000..5a8c8d2
--- /dev/null
+++ b/packages/react/tsconfig.build.json
@@ -0,0 +1,9 @@
+{
+ // Declarations resolve @dynamix-layout/core from its built package, as users will.
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "paths": {},
+ "composite": false
+ },
+ "exclude": ["node_modules", "src/test"]
+}
diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts
index 13b7b10..327a94b 100644
--- a/packages/react/vite.config.ts
+++ b/packages/react/vite.config.ts
@@ -29,6 +29,20 @@ export default defineConfig({
plugins: [
dts({
outDir: 'dist/types',
+ tsconfigPath: './tsconfig.build.json',
+ // Types-only modules never reach the bundle graph; list sources explicitly.
+ include: ['src'],
+ // One self-contained declaration file (Node16 resolution can't follow
+ // extensionless imports), copied to index.d.cts for `require`.
+ rollupTypes: true,
+ afterBuild: () =>
+ fs.copyFileSync(
+ resolve(__dirname, 'dist/types/index.d.ts'),
+ resolve(__dirname, 'dist/types/index.d.cts')
+ ),
+ // Keep `@dynamix-layout/core` as a package import in the .d.ts files.
+ aliasesExclude: [/^@dynamix-layout\/core/],
+ pathsToAliases: false,
exclude: ['node_modules/**', 'src/test/**'],
staticImport: true,
}),
@@ -46,12 +60,14 @@ export default defineConfig({
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'dynamix.layout.react',
- fileName: (format) => `index.${format}.js`,
- formats: ['cjs', 'es', 'iife', 'umd'],
+ // `.cjs` so Node loads the CommonJS build as CommonJS in this `"type": "module"` package.
+ fileName: (format) => (format === 'cjs' ? 'index.cjs' : `index.${format}.js`),
+ formats: ['cjs', 'es'],
},
cssCodeSplit: true,
rollupOptions: {
- external: ['react', 'react-dom', '@dynamix-layout/core'],
+ // Subpaths too: bundling `react/jsx-runtime` tied the package to React 19.
+ external: [/^react($|\/)/, /^react-dom($|\/)/, /^@dynamix-layout\/core($|\/)/],
output: {
globals: {
react: 'React',
diff --git a/packages/solid/package.json b/packages/solid/package.json
index 827996c..7506a25 100644
--- a/packages/solid/package.json
+++ b/packages/solid/package.json
@@ -26,25 +26,32 @@
],
"repository": {
"type": "git",
- "url": "https://github.com/xcode-studio/dynamix-layout",
+ "url": "git+https://github.com/xcode-studio/dynamix-layout.git",
"directory": "packages/solid"
},
"bugs": {
"url": "https://github.com/xcode-studio/dynamix-layout/issues"
},
"homepage": "https://github.com/xcode-studio/dynamix-layout#readme",
- "main": "./dist/index.cjs.js",
+ "main": "./dist/index.cjs",
"module": "./dist/index.es.js",
"types": "./dist/types/index.d.ts",
"typings": "./dist/types/index.d.ts",
"style": "./dist/index.css",
"exports": {
".": {
- "types": "./dist/types/index.d.ts",
- "import": "./dist/index.es.js",
- "require": "./dist/index.cjs.js"
+ "import": {
+ "types": "./dist/types/index.d.ts",
+ "default": "./dist/index.es.js"
+ },
+ "require": {
+ "types": "./dist/types/index.d.cts",
+ "default": "./dist/index.cjs"
+ }
},
- "./style.css": "./dist/index.css"
+ "./style.css": "./dist/index.css",
+ "./styles.css": "./dist/index.css",
+ "./package.json": "./package.json"
},
"files": [
"dist",
@@ -61,8 +68,7 @@
},
"type": "module",
"engines": {
- "node": ">=22.16.0",
- "pnpm": ">=10.13.1"
+ "node": ">=18"
},
"scripts": {
"dev": "vite build --watch",
@@ -84,10 +90,13 @@
"typescript": "^5.9.3",
"vite": "^7.3.6",
"vite-plugin-solid": "2.11.14",
- "vitest": "^4.1.11"
+ "vitest": "^4.1.11",
+ "solid-js": "^1.9.15"
},
"dependencies": {
- "@dynamix-layout/core": "workspace:*",
- "solid-js": "^1.9.15"
+ "@dynamix-layout/core": "workspace:*"
+ },
+ "peerDependencies": {
+ "solid-js": "^1.8.0"
}
}
diff --git a/packages/solid/src/types/index.ts b/packages/solid/src/types/index.ts
index aa60099..a997dd8 100644
--- a/packages/solid/src/types/index.ts
+++ b/packages/solid/src/types/index.ts
@@ -68,11 +68,14 @@ export interface LayoutProps {
class?: string
style?: JSX.CSSProperties
bondWidth?: number
+ /** In 2.0 this receives the v2 `LayoutJSON` format instead of `LayoutTree` (v1 layouts passed to `layoutTree` keep loading). See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
updateJSON?: (layoutTree: LayoutTree) => void
minTabHeight?: number
minTabWidth?: number
+ /** @deprecated No effect in 2.0: splitters update once per animation frame. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
sliderUpdateTimeout?: number
windowResizeTimeout?: number
+ /** @deprecated No effect in 2.0: splitters update once per animation frame. See https://github.com/xcode-studio/dynamix-layout/blob/main/docs/migration-v1-to-v2.md */
disableSliderTimeout?: boolean
disableResizeTimeout?: boolean
hoverElementStyles?: JSX.CSSProperties
diff --git a/packages/solid/tsconfig.build.json b/packages/solid/tsconfig.build.json
new file mode 100644
index 0000000..5a8c8d2
--- /dev/null
+++ b/packages/solid/tsconfig.build.json
@@ -0,0 +1,9 @@
+{
+ // Declarations resolve @dynamix-layout/core from its built package, as users will.
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "paths": {},
+ "composite": false
+ },
+ "exclude": ["node_modules", "src/test"]
+}
diff --git a/packages/solid/vite.config.ts b/packages/solid/vite.config.ts
index dfa1b7c..1b69acb 100644
--- a/packages/solid/vite.config.ts
+++ b/packages/solid/vite.config.ts
@@ -32,6 +32,20 @@ export default defineConfig({
solidPlugin(),
dts({
outDir: 'dist/types',
+ tsconfigPath: './tsconfig.build.json',
+ // Types-only modules never reach the bundle graph; list sources explicitly.
+ include: ['src'],
+ // One self-contained declaration file (Node16 resolution can't follow
+ // extensionless imports), copied to index.d.cts for `require`.
+ rollupTypes: true,
+ afterBuild: () =>
+ fs.copyFileSync(
+ resolve(__dirname, 'dist/types/index.d.ts'),
+ resolve(__dirname, 'dist/types/index.d.cts')
+ ),
+ // Keep `@dynamix-layout/core` as a package import in the .d.ts files.
+ aliasesExclude: [/^@dynamix-layout\/core/],
+ pathsToAliases: false,
exclude: ['node_modules/**', 'src/test/**'],
staticImport: true,
}),
@@ -49,12 +63,13 @@ export default defineConfig({
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'dynamix.layout.solid',
- fileName: (format) => `index.${format}.js`,
+ // `.cjs` so Node loads the CommonJS build as CommonJS in this `"type": "module"` package.
+ fileName: (format) => (format === 'cjs' ? 'index.cjs' : `index.${format}.js`),
formats: ['es', 'cjs'],
},
cssCodeSplit: true,
rollupOptions: {
- external: ['solid-js', 'solid-js/web', '@dynamix-layout/core'],
+ external: [/^solid-js($|\/)/, /^@dynamix-layout\/core($|\/)/],
output: {
globals: {
'solid-js': 'solidJs',
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 74a57ee..42a584b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -580,9 +580,6 @@ importers:
'@dynamix-layout/core':
specifier: workspace:*
version: link:../core
- solid-js:
- specifier: ^1.9.15
- version: 1.9.15
devDependencies:
'@repo/eslint-config':
specifier: workspace:*
@@ -599,6 +596,9 @@ importers:
jsdom:
specifier: ^26.1.0
version: 26.1.0
+ solid-js:
+ specifier: ^1.9.15
+ version: 1.9.15
typescript:
specifier: ^5.9.3
version: 5.9.3