@framesquared/layout 0.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Layout.ts","../src/AutoLayout.ts","../src/LayoutContext.ts","../src/LayoutRunner.ts","../src/box/BoxLayout.ts","../src/box/HBoxLayout.ts","../src/box/VBoxLayout.ts","../src/FitLayout.ts","../src/CardLayout.ts","../src/AnchorLayout.ts","../src/BorderLayout.ts","../src/ColumnLayout.ts","../src/TableLayout.ts","../src/AbsoluteLayout.ts","../src/AccordionLayout.ts","../src/ResponsivePlugin.ts","../src/ResponsiveColumnLayout.ts"],"sourcesContent":["/**\n * @framesquared/layout – Layout (base class)\n *\n * Abstract base for all layout managers. Manages the lifecycle\n * (beginLayout → calculate → completeLayout → afterLayout), size\n * policy determination, and item rendering into a target element.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport type { LayoutContext } from './LayoutContext.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface SizePolicy {\n width: 'shrinkWrap' | 'configured' | 'natural';\n height: 'shrinkWrap' | 'configured' | 'natural';\n}\n\nexport interface LayoutConfig {\n type?: string;\n [key: string]: unknown;\n}\n\n// ---------------------------------------------------------------------------\n// Layout\n// ---------------------------------------------------------------------------\n\nexport class Layout {\n readonly type: string;\n owner: Component | null = null;\n isRunning = false;\n needsLayout = true;\n\n constructor(config: LayoutConfig = {}) {\n this.type = config.type ?? 'auto';\n }\n\n /**\n * Sets the Container that owns this layout.\n */\n setOwner(owner: Component): void {\n this.owner = owner;\n }\n\n // -----------------------------------------------------------------------\n // Lifecycle\n // -----------------------------------------------------------------------\n\n /**\n * Called at the start of a layout run. Sets isRunning flag.\n * Override to gather initial measurements.\n */\n beginLayout(_context: LayoutContext): void {\n this.isRunning = true;\n }\n\n /**\n * Main calculation phase. Override in subclasses to compute\n * child sizes and positions.\n */\n calculate(_context: LayoutContext): void {\n // Base implementation is a no-op\n }\n\n /**\n * Called after calculation is complete. Clears flags.\n * Override to finalize DOM writes.\n */\n completeLayout(_context: LayoutContext): void {\n this.isRunning = false;\n this.needsLayout = false;\n }\n\n /**\n * Called after the entire layout pass is done.\n * Override for post-layout work (e.g., firing events).\n */\n afterLayout(): void {\n // Base implementation is a no-op\n }\n\n // -----------------------------------------------------------------------\n // Size policy\n // -----------------------------------------------------------------------\n\n /**\n * Returns the size policy for a child item.\n * 'configured' = the item has an explicit width/height config.\n * 'natural' = the item uses its natural content size.\n * 'shrinkWrap' = the item wraps its content.\n */\n getItemSizePolicy(item: Component): SizePolicy {\n const cfg = (item as any)._config ?? {};\n return {\n width: cfg.width !== undefined ? 'configured' : 'natural',\n height: cfg.height !== undefined ? 'configured' : 'natural',\n };\n }\n\n // -----------------------------------------------------------------------\n // Rendering\n // -----------------------------------------------------------------------\n\n /**\n * Renders child components into the target element.\n * Base implementation renders each item sequentially.\n */\n renderItems(items: Component[], target: Element): void {\n for (const item of items) {\n if (!item.rendered) {\n item.render(target);\n }\n }\n }\n}\n","/**\n * @framesquared/layout – AutoLayout\n *\n * The default layout. Renders items in DOM order with no special\n * positioning — items use their natural or configured sizes and\n * rely on normal CSS flow.\n *\n * Alias: 'auto'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { SizePolicy, LayoutConfig } from './Layout.js';\nimport type { LayoutContext } from './LayoutContext.js';\n\nexport class AutoLayout extends Layout {\n constructor(config: LayoutConfig = {}) {\n super({ ...config, type: 'auto' });\n }\n\n /**\n * Auto layout: no calculation needed — items use natural CSS flow.\n */\n override calculate(_context: LayoutContext): void {\n // No-op: items size themselves via CSS\n }\n\n /**\n * All items use natural sizing in auto layout.\n */\n override getItemSizePolicy(_item: Component): SizePolicy {\n return { width: 'natural', height: 'natural' };\n }\n}\n","/**\n * @framesquared/layout – LayoutContext\n *\n * Holds layout state during a layout run. Caches element measurements\n * to avoid layout thrashing (repeated reads/writes to the DOM).\n */\n\n// ---------------------------------------------------------------------------\n// LayoutContext\n// ---------------------------------------------------------------------------\n\nexport class LayoutContext {\n /** Generic property cache (layout-level state). */\n private props = new Map<string, number>();\n\n /** Per-element DOM measurement cache: element → (propName → value). */\n private domCache = new WeakMap<Element, Map<string, number>>();\n\n // -----------------------------------------------------------------------\n // Generic props\n // -----------------------------------------------------------------------\n\n /**\n * Gets a layout-level property value.\n */\n getProp(name: string): number | undefined {\n return this.props.get(name);\n }\n\n /**\n * Sets a layout-level property value.\n */\n setProp(name: string, value: number): void {\n this.props.set(name, value);\n }\n\n // -----------------------------------------------------------------------\n // DOM measurement caching\n // -----------------------------------------------------------------------\n\n /**\n * Gets a cached DOM measurement, or reads it via `readFn` and caches the result.\n * This prevents repeated layout-triggering reads on the same element.\n */\n getDomProp(name: string, element: Element, readFn: () => number): number {\n let cache = this.domCache.get(element);\n if (!cache) {\n cache = new Map();\n this.domCache.set(element, cache);\n }\n\n if (cache.has(name)) {\n return cache.get(name)!;\n }\n\n const value = readFn();\n cache.set(name, value);\n return value;\n }\n\n /**\n * Returns true if a DOM measurement has been cached for the given element+prop.\n */\n hasDomProp(name: string, element: Element): boolean {\n const cache = this.domCache.get(element);\n return cache?.has(name) ?? false;\n }\n\n // -----------------------------------------------------------------------\n // Flush\n // -----------------------------------------------------------------------\n\n /**\n * Clears all cached data. Called at the start of a new layout run.\n */\n flush(): void {\n this.props.clear();\n // WeakMap doesn't have a clear method, so replace it\n this.domCache = new WeakMap();\n }\n}\n","/**\n * @framesquared/layout – LayoutRunner\n *\n * Singleton that orchestrates layout runs. Collects invalidation\n * requests and processes them in batch. Detects and breaks layout\n * cycles to prevent infinite loops.\n *\n * Integrates with ResizeObserver to automatically invalidate\n * components when their container elements resize.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport { LayoutContext } from './LayoutContext.js';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\n/** Maximum iterations before declaring a cycle. */\nconst MAX_ITERATIONS = 10;\n\n// ---------------------------------------------------------------------------\n// LayoutRunner\n// ---------------------------------------------------------------------------\n\nexport class LayoutRunner {\n private static instance: LayoutRunner | null = null;\n\n /** Set of components that need a layout pass. */\n private pending = new Set<Component>();\n\n /** Whether a run is currently scheduled. */\n private scheduled = false;\n\n /** Map of element → { observer, component } for ResizeObserver tracking. */\n private observed = new Map<Element, { observer: ResizeObserver; component: Component }>();\n\n /** Component → ResizeObserver for cleanup. */\n private componentObservers = new Map<Component, { observer: ResizeObserver; element: Element }>();\n\n private constructor() {}\n\n static getInstance(): LayoutRunner {\n if (!LayoutRunner.instance) {\n LayoutRunner.instance = new LayoutRunner();\n }\n return LayoutRunner.instance;\n }\n\n // -----------------------------------------------------------------------\n // Public API\n // -----------------------------------------------------------------------\n\n /**\n * Marks a component for re-layout.\n */\n invalidate(component: Component): void {\n this.pending.add(component);\n }\n\n /**\n * Returns true if the component is in the pending queue.\n */\n isPending(component: Component): boolean {\n return this.pending.has(component);\n }\n\n /**\n * Performs a complete layout pass on all pending components.\n * Uses iterative processing with cycle detection.\n */\n run(): void {\n let iteration = 0;\n\n while (this.pending.size > 0 && iteration < MAX_ITERATIONS) {\n iteration++;\n\n // Snapshot current pending set and clear it\n const batch = [...this.pending];\n this.pending.clear();\n\n const ctx = new LayoutContext();\n\n for (const component of batch) {\n const layout = this.getLayout(component);\n if (!layout || !layout.needsLayout) continue;\n\n // Full lifecycle\n layout.beginLayout(ctx);\n layout.calculate(ctx);\n layout.completeLayout(ctx);\n layout.afterLayout();\n }\n }\n\n // If we hit MAX_ITERATIONS, clear remaining to prevent future infinite loops\n this.pending.clear();\n this.scheduled = false;\n }\n\n /**\n * Schedules a layout run on the next animation frame.\n * Multiple calls before the frame coalesce into a single run.\n */\n scheduleRun(): void {\n if (this.scheduled) return;\n this.scheduled = true;\n if (typeof requestAnimationFrame !== 'undefined') {\n requestAnimationFrame(() => this.run());\n } else {\n // Fallback for environments without rAF (e.g., tests)\n Promise.resolve().then(() => this.run());\n }\n }\n\n /**\n * Clears all pending items without running them.\n */\n clear(): void {\n this.pending.clear();\n this.scheduled = false;\n }\n\n // -----------------------------------------------------------------------\n // ResizeObserver integration\n // -----------------------------------------------------------------------\n\n /**\n * Starts watching an element for size changes.\n * When the element resizes, the associated component is invalidated.\n */\n observe(component: Component, element: Element): void {\n if (typeof ResizeObserver === 'undefined') return;\n\n // Don't double-observe the same component+element\n const existing = this.componentObservers.get(component);\n if (existing && existing.element === element) return;\n\n const observer = new ResizeObserver((_entries) => {\n this.invalidate(component);\n });\n\n observer.observe(element);\n this.observed.set(element, { observer, component });\n this.componentObservers.set(component, { observer, element });\n }\n\n /**\n * Stops watching an element for size changes.\n */\n unobserve(component: Component, element: Element): void {\n const entry = this.observed.get(element);\n if (entry && entry.component === component) {\n entry.observer.unobserve(element);\n entry.observer.disconnect();\n this.observed.delete(element);\n this.componentObservers.delete(component);\n }\n }\n\n // -----------------------------------------------------------------------\n // Internal\n // -----------------------------------------------------------------------\n\n private getLayout(component: Component): Layout | null {\n // The component stores its layout instance (set by Container integration)\n const layout = (component as any)._layoutInstance;\n if (layout instanceof Layout) return layout;\n return null;\n }\n}\n","/**\n * @framesquared/layout – BoxLayout (abstract base)\n *\n * Abstract base for HBox and VBox layouts. Uses CSS Flexbox under\n * the hood: sets display:flex on the container and translates\n * align/pack/gap/reverse/overflow to flex properties. Child items\n * with `flex` config get flex-grow; fixed-size items get flex-shrink:0.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from '../Layout.js';\nimport type { SizePolicy, LayoutConfig } from '../Layout.js';\nimport type { LayoutContext } from '../LayoutContext.js';\n\n// ---------------------------------------------------------------------------\n// Config\n// ---------------------------------------------------------------------------\n\nexport type BoxAlign = 'start' | 'center' | 'end' | 'stretch' | 'stretchmax';\nexport type BoxPack = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';\nexport type BoxOverflow = 'visible' | 'hidden' | 'scroll' | 'wrap';\n\nexport interface BoxLayoutConfig extends LayoutConfig {\n align?: BoxAlign;\n pack?: BoxPack;\n gap?: number;\n overflow?: BoxOverflow;\n reverse?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// CSS Flexbox mapping\n// ---------------------------------------------------------------------------\n\nconst ALIGN_MAP: Record<BoxAlign, string> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n stretch: 'stretch',\n stretchmax: 'stretch',\n};\n\nconst PACK_MAP: Record<BoxPack, string> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n 'space-between': 'space-between',\n 'space-around': 'space-around',\n 'space-evenly': 'space-evenly',\n};\n\n// ---------------------------------------------------------------------------\n// BoxLayout\n// ---------------------------------------------------------------------------\n\nexport abstract class BoxLayout extends Layout {\n protected align: BoxAlign;\n protected pack: BoxPack;\n protected gap: number;\n protected overflow: BoxOverflow;\n protected reverse: boolean;\n\n constructor(config: BoxLayoutConfig = {}) {\n super(config);\n this.align = config.align ?? 'stretch';\n this.pack = config.pack ?? 'start';\n this.gap = config.gap ?? 0;\n this.overflow = config.overflow ?? 'visible';\n this.reverse = config.reverse ?? false;\n }\n\n /**\n * The CSS flex-direction value. 'row' for HBox, 'column' for VBox.\n * Subclasses must implement this.\n */\n protected abstract getDirection(): string;\n\n /**\n * Returns the primary axis config name for checking fixed size.\n * 'width' for HBox, 'height' for VBox.\n */\n protected abstract getPrimaryAxisProp(): string;\n\n // -----------------------------------------------------------------------\n // Container configuration\n // -----------------------------------------------------------------------\n\n /**\n * Applies CSS Flexbox properties to the container element.\n */\n configureContainer(el: HTMLElement): void {\n el.style.display = 'flex';\n\n const dir = this.getDirection();\n el.style.flexDirection = this.reverse\n ? `${dir}-reverse` as any\n : dir;\n\n el.style.alignItems = ALIGN_MAP[this.align];\n el.style.justifyContent = PACK_MAP[this.pack];\n\n if (this.gap > 0) {\n el.style.gap = `${this.gap}px`;\n }\n\n // Overflow\n switch (this.overflow) {\n case 'wrap':\n el.style.flexWrap = 'wrap';\n break;\n case 'hidden':\n el.style.overflow = 'hidden';\n break;\n case 'scroll':\n el.style.overflow = 'auto';\n break;\n // 'visible' — no special handling\n }\n }\n\n // -----------------------------------------------------------------------\n // Item styles\n // -----------------------------------------------------------------------\n\n /**\n * Applies flex CSS properties to each child item based on its config.\n */\n applyItemStyles(items: Component[], _target: Element): void {\n const primaryProp = this.getPrimaryAxisProp();\n\n for (const item of items) {\n const el = item.el;\n if (!el) continue;\n const cfg = (item as any)._config ?? {};\n const flex = cfg.flex;\n\n if (flex !== undefined && flex > 0) {\n // Flex item: flex-grow proportional, basis 0 for equal distribution\n el.style.flexGrow = String(flex);\n el.style.flexShrink = '1';\n el.style.flexBasis = '0px';\n } else if (cfg[primaryProp] !== undefined) {\n // Fixed-size item: don't shrink\n el.style.flexShrink = '0';\n }\n\n // Constraints\n if (cfg.minWidth !== undefined) el.style.minWidth = `${cfg.minWidth}px`;\n if (cfg.maxWidth !== undefined) el.style.maxWidth = `${cfg.maxWidth}px`;\n if (cfg.minHeight !== undefined) el.style.minHeight = `${cfg.minHeight}px`;\n if (cfg.maxHeight !== undefined) el.style.maxHeight = `${cfg.maxHeight}px`;\n }\n }\n\n // -----------------------------------------------------------------------\n // Layout lifecycle overrides\n // -----------------------------------------------------------------------\n\n override renderItems(items: Component[], target: Element): void {\n // Ensure container is configured before rendering items\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n\n override calculate(_context: LayoutContext): void {\n // CSS Flexbox handles the actual sizing.\n // This method could be used for reading computed sizes back\n // into the LayoutContext if needed by other layouts.\n }\n\n // -----------------------------------------------------------------------\n // Size policy\n // -----------------------------------------------------------------------\n\n override getItemSizePolicy(item: Component): SizePolicy {\n const cfg = (item as any)._config ?? {};\n const primaryProp = this.getPrimaryAxisProp();\n\n const primaryPolicy = cfg.flex !== undefined\n ? 'shrinkWrap'\n : (cfg[primaryProp] !== undefined ? 'configured' : 'natural');\n\n const crossProp = primaryProp === 'width' ? 'height' : 'width';\n const crossPolicy = cfg[crossProp] !== undefined ? 'configured' : 'natural';\n\n if (primaryProp === 'width') {\n return { width: primaryPolicy, height: crossPolicy };\n }\n return { width: crossPolicy, height: primaryPolicy };\n }\n}\n","/**\n * @framesquared/layout – HBoxLayout\n *\n * Horizontal box layout. Children are arranged left-to-right\n * (or right-to-left when reverse=true). Uses CSS Flexbox with\n * flex-direction: row.\n *\n * Alias: 'hbox'\n */\n\nimport { BoxLayout } from './BoxLayout.js';\nimport type { BoxLayoutConfig } from './BoxLayout.js';\n\nexport class HBoxLayout extends BoxLayout {\n constructor(config: BoxLayoutConfig = {}) {\n super({ ...config, type: 'hbox' });\n }\n\n protected getDirection(): string {\n return 'row';\n }\n\n protected getPrimaryAxisProp(): string {\n return 'width';\n }\n}\n","/**\n * @framesquared/layout – VBoxLayout\n *\n * Vertical box layout. Children are arranged top-to-bottom\n * (or bottom-to-top when reverse=true). Uses CSS Flexbox with\n * flex-direction: column.\n *\n * Alias: 'vbox'\n */\n\nimport { BoxLayout } from './BoxLayout.js';\nimport type { BoxLayoutConfig } from './BoxLayout.js';\n\nexport class VBoxLayout extends BoxLayout {\n constructor(config: BoxLayoutConfig = {}) {\n super({ ...config, type: 'vbox' });\n }\n\n protected getDirection(): string {\n return 'column';\n }\n\n protected getPrimaryAxisProp(): string {\n return 'height';\n }\n}\n","/**\n * @framesquared/layout – FitLayout\n *\n * Single child fills the entire container. If multiple children\n * are present, only the first is visible.\n *\n * Alias: 'fit'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\nexport class FitLayout extends Layout {\n constructor(config: LayoutConfig = {}) {\n super({ ...config, type: 'fit' });\n }\n\n configureContainer(el: HTMLElement): void {\n el.style.position = 'relative';\n el.style.overflow = 'hidden';\n }\n\n applyItemStyles(items: Component[], _target: Element): void {\n for (let i = 0; i < items.length; i++) {\n const el = items[i].el;\n if (!el) continue;\n if (i === 0) {\n el.style.width = '100%';\n el.style.height = '100%';\n el.style.boxSizing = 'border-box';\n } else {\n el.style.display = 'none';\n }\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n}\n","/**\n * @framesquared/layout – CardLayout\n *\n * Like FitLayout but supports multiple children — only one is visible\n * at a time. Provides next/prev navigation and fires activate/deactivate.\n *\n * Alias: 'card'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\nexport interface CardLayoutConfig extends LayoutConfig {\n activeItem?: number;\n}\n\nexport class CardLayout extends Layout {\n private activeIndex = 0;\n private listeners = new Map<string, Set<Function>>();\n\n constructor(config: CardLayoutConfig = {}) {\n super({ ...config, type: 'card' });\n this.activeIndex = config.activeItem ?? 0;\n }\n\n /** Subscribe to events. */\n on(event: string, fn: Function): void {\n let set = this.listeners.get(event);\n if (!set) { set = new Set(); this.listeners.set(event, set); }\n set.add(fn);\n }\n\n /** Unsubscribe. */\n un(event: string, fn: Function): void {\n this.listeners.get(event)?.delete(fn);\n }\n\n private fire(name: string, ...args: unknown[]): void {\n const fns = this.listeners.get(name);\n if (fns) for (const fn of fns) fn(...args);\n }\n\n configureContainer(el: HTMLElement): void {\n el.style.position = 'relative';\n el.style.overflow = 'hidden';\n }\n\n applyItemStyles(items: Component[], _target: Element): void {\n for (let i = 0; i < items.length; i++) {\n const el = items[i].el;\n if (!el) continue;\n el.style.width = '100%';\n el.style.height = '100%';\n el.style.boxSizing = 'border-box';\n el.style.display = i === this.activeIndex ? '' : 'none';\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n\n // -- Navigation --\n\n getActiveItem(): Component | undefined {\n return this.getOwnerItems()[this.activeIndex];\n }\n\n setActiveItem(item: number | Component): void {\n const items = this.getOwnerItems();\n const newIndex = typeof item === 'number' ? item : items.indexOf(item);\n if (newIndex < 0 || newIndex >= items.length || newIndex === this.activeIndex) return;\n\n const oldItem = items[this.activeIndex];\n const newItem = items[newIndex];\n\n this.fire('deactivate', oldItem, this);\n if (oldItem.el) oldItem.el.style.display = 'none';\n\n this.activeIndex = newIndex;\n if (newItem.el) newItem.el.style.display = '';\n this.fire('activate', newItem, this);\n }\n\n next(): Component {\n const items = this.getOwnerItems();\n const next = (this.activeIndex + 1) % items.length;\n this.setActiveItem(next);\n return items[next];\n }\n\n prev(): Component {\n const items = this.getOwnerItems();\n const prev = (this.activeIndex - 1 + items.length) % items.length;\n this.setActiveItem(prev);\n return items[prev];\n }\n\n private getOwnerItems(): Component[] {\n return (this.owner as any)?.getItems?.() ?? [];\n }\n}\n","/**\n * @framesquared/layout – AnchorLayout\n *\n * Children sized relative to container using anchor strings:\n * '100% 50%' → 100% width, 50% height\n * '-50 -100' → calc(100% - 50px), calc(100% - 100px)\n * '-50' → width offset only\n *\n * Alias: 'anchor'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\nexport class AnchorLayout extends Layout {\n constructor(config: LayoutConfig = {}) {\n super({ ...config, type: 'anchor' });\n }\n\n configureContainer(el: HTMLElement): void {\n el.style.position = 'relative';\n }\n\n applyItemStyles(items: Component[], _target: Element): void {\n for (const item of items) {\n const el = item.el;\n if (!el) continue;\n const anchor = (item as any)._config?.anchor as string | undefined;\n if (!anchor) continue;\n\n const parts = anchor.trim().split(/\\s+/);\n const w = parts[0];\n const h = parts[1];\n\n if (w) el.style.width = parseAnchorValue(w);\n if (h) el.style.height = parseAnchorValue(h);\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n}\n\nfunction parseAnchorValue(val: string): string {\n if (val.endsWith('%')) return val;\n // Negative offset: -50 → calc(100% - 50px)\n const n = parseInt(val, 10);\n if (!isNaN(n) && n < 0) return `calc(100% - ${Math.abs(n)}px)`;\n if (!isNaN(n) && n > 0) return `${n}px`;\n return val;\n}\n","/**\n * @framesquared/layout – BorderLayout\n *\n * Classic border layout with 5 regions: north, south, east, west, center.\n * Uses CSS Grid under the hood. Center is required and fills remaining space.\n *\n * Alias: 'border'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\nexport interface BorderLayoutConfig extends LayoutConfig {\n split?: boolean;\n}\n\ntype Region = 'north' | 'south' | 'east' | 'west' | 'center';\n\nexport class BorderLayout extends Layout {\n constructor(config: BorderLayoutConfig = {}) {\n super({ ...config, type: 'border' });\n }\n\n configureContainer(el: HTMLElement): void {\n el.style.display = 'grid';\n el.style.width = '100%';\n el.style.height = '100%';\n }\n\n applyItemStyles(items: Component[], target: Element): void {\n // Determine which regions exist\n const regions = new Map<Region, Component>();\n for (const item of items) {\n const region = (item as any)._config?.region as Region | undefined;\n if (region) regions.set(region, item);\n }\n\n // Build grid template\n const rows: string[] = [];\n const areas: string[][] = [];\n\n const hasNorth = regions.has('north');\n const hasSouth = regions.has('south');\n const hasWest = regions.has('west');\n const hasEast = regions.has('east');\n\n // Determine column sizes\n const colSizes: string[] = [];\n if (hasWest) {\n const w = (regions.get('west') as any)?._config?.width;\n colSizes.push(w ? `${w}px` : '200px');\n }\n colSizes.push('1fr'); // center\n if (hasEast) {\n const w = (regions.get('east') as any)?._config?.width;\n colSizes.push(w ? `${w}px` : '200px');\n }\n\n const cols = colSizes.length;\n\n // North row\n if (hasNorth) {\n const h = (regions.get('north') as any)?._config?.height;\n rows.push(h ? `${h}px` : 'auto');\n areas.push(Array(cols).fill('north'));\n }\n\n // Middle row (west / center / east)\n rows.push('1fr');\n const middleRow: string[] = [];\n if (hasWest) middleRow.push('west');\n middleRow.push('center');\n if (hasEast) middleRow.push('east');\n areas.push(middleRow);\n\n // South row\n if (hasSouth) {\n const h = (regions.get('south') as any)?._config?.height;\n rows.push(h ? `${h}px` : 'auto');\n areas.push(Array(cols).fill('south'));\n }\n\n const el = target as HTMLElement;\n el.style.gridTemplateRows = rows.join(' ');\n el.style.gridTemplateColumns = colSizes.join(' ');\n el.style.gridTemplateAreas = areas.map(r => `\"${r.join(' ')}\"`).join(' ');\n\n // Apply grid-area to each child\n for (const item of items) {\n const itemEl = item.el;\n if (!itemEl) continue;\n const region = (item as any)._config?.region as Region | undefined;\n if (region) {\n itemEl.style.gridArea = region;\n }\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n}\n","/**\n * @framesquared/layout – ColumnLayout\n *\n * Arranges children in columns. Items with `columnWidth` (0–1)\n * get a percentage of the container width. Fixed-width items\n * keep their configured width. Uses CSS Flexbox with wrap.\n *\n * Alias: 'column'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\nexport class ColumnLayout extends Layout {\n constructor(config: LayoutConfig = {}) {\n super({ ...config, type: 'column' });\n }\n\n configureContainer(el: HTMLElement): void {\n el.style.display = 'flex';\n el.style.flexWrap = 'wrap';\n el.style.alignItems = 'flex-start';\n }\n\n applyItemStyles(items: Component[], _target: Element): void {\n for (const item of items) {\n const el = item.el;\n if (!el) continue;\n const cfg = (item as any)._config ?? {};\n const cw = cfg.columnWidth as number | undefined;\n\n if (cw !== undefined && cw > 0 && cw <= 1) {\n el.style.width = `${(cw * 100)}%`;\n el.style.boxSizing = 'border-box';\n } else if (cfg.width !== undefined) {\n el.style.flexShrink = '0';\n }\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n}\n","/**\n * @framesquared/layout – TableLayout\n *\n * Renders children in a grid structure using CSS Grid.\n * Supports `columns`, `colspan`, and `rowspan` on items.\n *\n * Alias: 'table'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\nexport interface TableLayoutConfig extends LayoutConfig {\n columns?: number;\n}\n\nexport class TableLayout extends Layout {\n private columns: number;\n\n constructor(config: TableLayoutConfig = {}) {\n super({ ...config, type: 'table' });\n this.columns = config.columns ?? 1;\n }\n\n configureContainer(el: HTMLElement): void {\n el.style.display = 'grid';\n el.style.gridTemplateColumns = `repeat(${this.columns}, 1fr)`;\n }\n\n applyItemStyles(items: Component[], _target: Element): void {\n for (const item of items) {\n const el = item.el;\n if (!el) continue;\n const cfg = (item as any)._config ?? {};\n\n if (cfg.colspan && cfg.colspan > 1) {\n el.style.gridColumn = `span ${cfg.colspan}`;\n }\n if (cfg.rowspan && cfg.rowspan > 1) {\n el.style.gridRow = `span ${cfg.rowspan}`;\n }\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n}\n","/**\n * @framesquared/layout – AbsoluteLayout\n *\n * Positions children absolutely within the container using x/y configs.\n *\n * Alias: 'absolute'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\nexport class AbsoluteLayout extends Layout {\n constructor(config: LayoutConfig = {}) {\n super({ ...config, type: 'absolute' });\n }\n\n configureContainer(el: HTMLElement): void {\n el.style.position = 'relative';\n }\n\n applyItemStyles(items: Component[], _target: Element): void {\n for (const item of items) {\n const el = item.el;\n if (!el) continue;\n const cfg = (item as any)._config ?? {};\n\n el.style.position = 'absolute';\n el.style.left = `${cfg.x ?? 0}px`;\n el.style.top = `${cfg.y ?? 0}px`;\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n}\n","/**\n * @framesquared/layout – AccordionLayout\n *\n * Vertical stack where only one item is expanded at a time\n * (or multiple with multi:true). Expanded items get flex:1\n * when fill:true. Collapsed items show only their header.\n *\n * Alias: 'accordion'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\nexport interface AccordionLayoutConfig extends LayoutConfig {\n multi?: boolean;\n fill?: boolean;\n animate?: boolean;\n}\n\nexport class AccordionLayout extends Layout {\n private multi: boolean;\n private fill: boolean;\n private expandedSet = new WeakSet<Component>();\n\n constructor(config: AccordionLayoutConfig = {}) {\n super({ ...config, type: 'accordion' });\n this.multi = config.multi ?? false;\n this.fill = config.fill ?? true;\n }\n\n configureContainer(el: HTMLElement): void {\n el.style.display = 'flex';\n el.style.flexDirection = 'column';\n el.style.overflow = 'hidden';\n }\n\n applyItemStyles(items: Component[], _target: Element): void {\n // Expand first item by default if none expanded\n if (items.length > 0 && !items.some(i => this.expandedSet.has(i))) {\n this.expandedSet.add(items[0]);\n }\n\n for (const item of items) {\n this.applyExpansionState(item);\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n\n // -- Public API --\n\n isExpanded(item: Component): boolean {\n return this.expandedSet.has(item);\n }\n\n expand(item: Component): void {\n if (!this.multi) {\n // Collapse all others\n for (const other of this.getOwnerItems()) {\n if (other !== item) {\n this.expandedSet.delete(other);\n this.applyExpansionState(other);\n }\n }\n }\n this.expandedSet.add(item);\n this.applyExpansionState(item);\n }\n\n collapse(item: Component): void {\n this.expandedSet.delete(item);\n this.applyExpansionState(item);\n }\n\n toggle(item: Component): void {\n if (this.isExpanded(item)) {\n this.collapse(item);\n } else {\n this.expand(item);\n }\n }\n\n // -- Internal --\n\n private applyExpansionState(item: Component): void {\n const el = item.el;\n if (!el) return;\n const expanded = this.expandedSet.has(item);\n\n if (expanded) {\n el.style.flexGrow = this.fill ? '1' : '0';\n el.style.flexShrink = '0';\n el.style.overflow = '';\n el.classList.remove('x-accordion-collapsed');\n el.classList.add('x-accordion-expanded');\n } else {\n el.style.flexGrow = '0';\n el.style.flexShrink = '0';\n el.style.overflow = 'hidden';\n el.classList.remove('x-accordion-expanded');\n el.classList.add('x-accordion-collapsed');\n }\n }\n\n private getOwnerItems(): Component[] {\n return (this.owner as any)?.getItems?.() ?? [];\n }\n}\n","/**\n * @framesquared/layout – ResponsivePlugin\n *\n * Monitors viewport size using window.matchMedia() and applies\n * different component configs at different breakpoints.\n *\n * Supports both standard media queries and shorthand expressions:\n * '(max-width: 599px)' → standard CSS media query\n * 'width < 600' → parsed to (max-width: 599px)\n * 'width >= 600 && width < 1024' → parsed to (min-width: 600px) and (max-width: 1023px)\n * 'width >= 1024' → parsed to (min-width: 1024px)\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface ResponsiveConfig {\n responsiveConfig: Record<string, Record<string, unknown>>;\n}\n\ninterface MediaEntry {\n query: string;\n mql: MediaQueryList;\n config: Record<string, unknown>;\n handler: (e: { matches: boolean }) => void;\n}\n\n// ---------------------------------------------------------------------------\n// Expression → media query conversion\n// ---------------------------------------------------------------------------\n\nfunction toMediaQuery(expr: string): string {\n // Already a media query (starts with '(' or '@media')\n if (expr.startsWith('(') || expr.startsWith('@media')) return expr;\n\n // Parse shorthand: 'width < 600', 'width >= 600 && width < 1024', etc.\n const parts = expr.split('&&').map(s => s.trim());\n const conditions: string[] = [];\n\n for (const part of parts) {\n const m = part.match(/^width\\s*(>=?|<=?|==)\\s*(\\d+)$/);\n if (!m) {\n // Pass through as-is wrapped in parens\n conditions.push(`(${part})`);\n continue;\n }\n const op = m[1];\n const val = parseInt(m[2], 10);\n\n switch (op) {\n case '<': conditions.push(`(max-width: ${val - 1}px)`); break;\n case '<=': conditions.push(`(max-width: ${val}px)`); break;\n case '>': conditions.push(`(min-width: ${val + 1}px)`); break;\n case '>=': conditions.push(`(min-width: ${val}px)`); break;\n case '==': conditions.push(`(width: ${val}px)`); break;\n }\n }\n\n return conditions.join(' and ');\n}\n\n// ---------------------------------------------------------------------------\n// Applying config to a component\n// ---------------------------------------------------------------------------\n\nfunction applyConfig(owner: Component, config: Record<string, unknown>): void {\n for (const [key, value] of Object.entries(config)) {\n switch (key) {\n case 'cls':\n if (typeof value === 'string') owner.addCls(value);\n break;\n case 'hidden':\n if (value) owner.hide(); else owner.show();\n break;\n case 'disabled':\n if (value) owner.disable(); else owner.enable();\n break;\n case 'width':\n if (typeof value === 'number' || typeof value === 'string') owner.setWidth(value);\n break;\n case 'height':\n if (typeof value === 'number' || typeof value === 'string') owner.setHeight(value);\n break;\n default:\n // Store on _config for layouts / queries to read\n (owner as any)._config[key] = value;\n break;\n }\n }\n}\n\n// ---------------------------------------------------------------------------\n// Remove previously applied cls\n// ---------------------------------------------------------------------------\n\nfunction removeClsConfig(owner: Component, config: Record<string, unknown>): void {\n if (config.cls && typeof config.cls === 'string') {\n owner.removeCls(config.cls);\n }\n}\n\n// ---------------------------------------------------------------------------\n// ResponsivePlugin\n// ---------------------------------------------------------------------------\n\nexport class ResponsivePlugin {\n private config: ResponsiveConfig;\n private owner: Component | null = null;\n private entries: MediaEntry[] = [];\n private activeConfigs = new Set<Record<string, unknown>>();\n\n constructor(config: ResponsiveConfig) {\n this.config = config;\n }\n\n getOwner(): Component | null {\n return this.owner;\n }\n\n /**\n * Initialise the plugin with its owner component.\n * Sets up matchMedia listeners and applies initial state.\n */\n init(owner: Component): void {\n this.owner = owner;\n\n for (const [expr, cfg] of Object.entries(this.config.responsiveConfig)) {\n const query = toMediaQuery(expr);\n const mql = window.matchMedia(query);\n\n const handler = (e: { matches: boolean }) => {\n if (e.matches) {\n applyConfig(owner, cfg);\n this.activeConfigs.add(cfg);\n } else {\n removeClsConfig(owner, cfg);\n this.activeConfigs.delete(cfg);\n }\n };\n\n this.entries.push({ query, mql, config: cfg, handler });\n mql.addEventListener('change', handler as any);\n\n // Apply initial state\n if (mql.matches) {\n applyConfig(owner, cfg);\n this.activeConfigs.add(cfg);\n }\n }\n }\n\n /**\n * Clean up all media query listeners.\n */\n destroy(): void {\n for (const entry of this.entries) {\n entry.mql.removeEventListener('change', entry.handler as any);\n }\n this.entries.length = 0;\n this.activeConfigs.clear();\n this.owner = null;\n }\n}\n","/**\n * @framesquared/layout – ResponsiveColumnLayout\n *\n * Columns that automatically reflow based on container width.\n * Uses CSS Grid with auto-fill and minmax() for responsive columns\n * without JavaScript resize calculation.\n *\n * Config:\n * minColumnWidth — minimum width of each column\n * gap — spacing between items\n * maxColumns — optional maximum number of columns\n *\n * Items with `columnSpan: N` span multiple grid columns.\n *\n * Alias: 'responsivecolumn'\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from '@framesquared/component';\nimport { Layout } from './Layout.js';\nimport type { LayoutConfig } from './Layout.js';\n\n// ---------------------------------------------------------------------------\n// Config\n// ---------------------------------------------------------------------------\n\nexport interface ResponsiveColumnLayoutConfig extends LayoutConfig {\n minColumnWidth: number;\n gap?: number;\n maxColumns?: number;\n}\n\n// ---------------------------------------------------------------------------\n// ResponsiveColumnLayout\n// ---------------------------------------------------------------------------\n\nexport class ResponsiveColumnLayout extends Layout {\n private minColumnWidth: number;\n private gap: number;\n private maxColumns: number | undefined;\n\n constructor(config: ResponsiveColumnLayoutConfig) {\n super({ ...config, type: 'responsivecolumn' });\n this.minColumnWidth = config.minColumnWidth;\n this.gap = config.gap ?? 0;\n this.maxColumns = config.maxColumns;\n }\n\n /**\n * Configures the container element with CSS Grid responsive columns.\n */\n configureContainer(el: HTMLElement): void {\n el.style.display = 'grid';\n\n if (this.maxColumns) {\n // With maxColumns: use repeat(maxColumns, minmax(min, 1fr))\n el.style.gridTemplateColumns =\n `repeat(auto-fill, minmax(min(${this.minColumnWidth}px, 100%), ${Math.floor(100 / this.maxColumns)}%))`;\n } else {\n // Without maxColumns: use auto-fill with minmax\n el.style.gridTemplateColumns =\n `repeat(auto-fill, minmax(${this.minColumnWidth}px, 1fr))`;\n }\n\n if (this.gap > 0) {\n el.style.gap = `${this.gap}px`;\n }\n }\n\n /**\n * Applies columnSpan to items that need to span multiple columns.\n */\n applyItemStyles(items: Component[], _target: Element): void {\n for (const item of items) {\n const el = item.el;\n if (!el) continue;\n const span = (item as any)._config?.columnSpan as number | undefined;\n if (span && span > 1) {\n el.style.gridColumn = `span ${span}`;\n }\n }\n }\n\n override renderItems(items: Component[], target: Element): void {\n this.configureContainer(target as HTMLElement);\n super.renderItems(items, target);\n this.applyItemStyles(items, target);\n }\n}\n"],"mappings":";AA+BO,IAAM,SAAN,MAAa;AAAA,EACT;AAAA,EACT,QAA0B;AAAA,EAC1B,YAAY;AAAA,EACZ,cAAc;AAAA,EAEd,YAAY,SAAuB,CAAC,GAAG;AACrC,SAAK,OAAO,OAAO,QAAQ;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,OAAwB;AAC/B,SAAK,QAAQ;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,YAAY,UAA+B;AACzC,SAAK,YAAY;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAU,UAA+B;AAAA,EAEzC;AAAA;AAAA;AAAA;AAAA;AA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AC7C,SAAK,iBAAiB,OAAO;AAC7B,SAAK,MAAM,OAAO,OAAO;AACzB,SAAK,aAAa,OAAO;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA,EAKA,mBAAmB,IAAuB;AACxC,OAAG,MAAM,UAAU;AAEnB,QAAI,KAAK,YAAY;AAEnB,SAAG,MAAM,sBACP,gCAAgC,KAAK,cAAc,cAAc,KAAK,MAAM,MAAM,KAAK,UAAU,CAAC;AAAA,IACtG,OAAO;AAEL,SAAG,MAAM,sBACP,4BAA4B,KAAK,cAAc;AAAA,IACnD;AAEA,QAAI,KAAK,MAAM,GAAG;AAChB,SAAG,MAAM,MAAM,GAAG,KAAK,GAAG;AAAA,IAC5B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,gBAAgB,OAAoB,SAAwB;AAC1D,eAAW,QAAQ,OAAO;AACxB,YAAM,KAAK,KAAK;AAChB,UAAI,CAAC,GAAI;AACT,YAAM,OAAQ,KAAa,SAAS;AACpC,UAAI,QAAQ,OAAO,GAAG;AACpB,WAAG,MAAM,aAAa,QAAQ,IAAI;AAAA,MACpC;AAAA,IACF;AAAA,EACF;AAAA,EAES,YAAY,OAAoB,QAAuB;AAC9D,SAAK,mBAAmB,MAAqB;AAC7C,UAAM,YAAY,OAAO,MAAM;AAC/B,SAAK,gBAAgB,OAAO,MAAM;AAAA,EACpC;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@framesquared/layout",
3
+ "version": "0.1.0",
4
+ "description": "Layout managers",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "dependencies": {
18
+ "@framesquared/core": "0.1.0",
19
+ "@framesquared/component": "0.1.0"
20
+ },
21
+ "scripts": {
22
+ "build": "tsup",
23
+ "test": "vitest run",
24
+ "clean": "rm -rf dist",
25
+ "typecheck": "tsc --noEmit --project tsconfig.build.json"
26
+ }
27
+ }