@wordpress/grid 0.10.0 → 0.12.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.
- package/README.md +35 -14
- package/build/dashboard-grid/grid-item.cjs +232 -295
- package/build/dashboard-grid/grid-item.cjs.map +1 -7
- package/build/dashboard-grid/index.cjs +526 -633
- package/build/dashboard-grid/index.cjs.map +1 -7
- package/build/dashboard-grid/resolve-fill-widths.cjs +159 -203
- package/build/dashboard-grid/resolve-fill-widths.cjs.map +1 -7
- package/build/dashboard-grid/types.cjs +4 -18
- package/build/dashboard-lanes/index.cjs +495 -577
- package/build/dashboard-lanes/index.cjs.map +1 -7
- package/build/dashboard-lanes/lane-placement.cjs +77 -100
- package/build/dashboard-lanes/lane-placement.cjs.map +1 -7
- package/build/dashboard-lanes/lanes-item.cjs +222 -278
- package/build/dashboard-lanes/lanes-item.cjs.map +1 -7
- package/build/dashboard-lanes/types.cjs +4 -18
- package/build/dashboard-lanes/use-lane-placement.cjs +172 -198
- package/build/dashboard-lanes/use-lane-placement.cjs.map +1 -7
- package/build/index.cjs +16 -31
- package/build/shared/array-move-with-pinned.cjs +29 -45
- package/build/shared/array-move-with-pinned.cjs.map +1 -7
- package/build/shared/column-policy.cjs +58 -0
- package/build/shared/column-policy.cjs.map +1 -0
- package/build/shared/drag-overlay-drop-animation.cjs +40 -66
- package/build/shared/drag-overlay-drop-animation.cjs.map +1 -7
- package/build/shared/grid-item-key.cjs +12 -29
- package/build/shared/grid-item-key.cjs.map +1 -7
- package/build/shared/grid-overlay.cjs +163 -164
- package/build/shared/grid-overlay.cjs.map +1 -7
- package/build/shared/item-exit-overlay.cjs +132 -134
- package/build/shared/item-exit-overlay.cjs.map +1 -7
- package/build/shared/resize-handle.cjs +213 -197
- package/build/shared/resize-handle.cjs.map +1 -7
- package/build/shared/resize-snap.cjs +116 -121
- package/build/shared/resize-snap.cjs.map +1 -7
- package/build/shared/types.cjs +4 -18
- package/build/shared/use-item-exit-animation.cjs +96 -143
- package/build/shared/use-item-exit-animation.cjs.map +1 -7
- package/build/shared/use-layout-shift-animation.cjs +121 -150
- package/build/shared/use-layout-shift-animation.cjs.map +1 -7
- package/build/shared/use-span-bounds.cjs +65 -79
- package/build/shared/use-span-bounds.cjs.map +1 -7
- package/build-module/dashboard-grid/grid-item.mjs +209 -265
- package/build-module/dashboard-grid/grid-item.mjs.map +1 -7
- package/build-module/dashboard-grid/index.mjs +502 -623
- package/build-module/dashboard-grid/index.mjs.map +1 -7
- package/build-module/dashboard-grid/resolve-fill-widths.mjs +155 -179
- package/build-module/dashboard-grid/resolve-fill-widths.mjs.map +1 -7
- package/build-module/dashboard-grid/types.mjs +0 -1
- package/build-module/dashboard-lanes/index.mjs +470 -567
- package/build-module/dashboard-lanes/index.mjs.map +1 -7
- package/build-module/dashboard-lanes/lane-placement.mjs +73 -76
- package/build-module/dashboard-lanes/lane-placement.mjs.map +1 -7
- package/build-module/dashboard-lanes/lanes-item.mjs +199 -248
- package/build-module/dashboard-lanes/lanes-item.mjs.map +1 -7
- package/build-module/dashboard-lanes/types.mjs +0 -1
- package/build-module/dashboard-lanes/use-lane-placement.mjs +167 -173
- package/build-module/dashboard-lanes/use-lane-placement.mjs.map +1 -7
- package/build-module/index.mjs +1 -6
- package/build-module/shared/array-move-with-pinned.mjs +25 -21
- package/build-module/shared/array-move-with-pinned.mjs.map +1 -7
- package/build-module/shared/column-policy.mjs +52 -0
- package/build-module/shared/column-policy.mjs.map +1 -0
- package/build-module/shared/drag-overlay-drop-animation.mjs +35 -44
- package/build-module/shared/drag-overlay-drop-animation.mjs.map +1 -7
- package/build-module/shared/grid-item-key.mjs +8 -5
- package/build-module/shared/grid-item-key.mjs.map +1 -7
- package/build-module/shared/grid-overlay.mjs +143 -136
- package/build-module/shared/grid-overlay.mjs.map +1 -7
- package/build-module/shared/item-exit-overlay.mjs +128 -110
- package/build-module/shared/item-exit-overlay.mjs.map +1 -7
- package/build-module/shared/resize-handle.mjs +191 -171
- package/build-module/shared/resize-handle.mjs.map +1 -7
- package/build-module/shared/resize-snap.mjs +108 -93
- package/build-module/shared/resize-snap.mjs.map +1 -7
- package/build-module/shared/types.mjs +0 -1
- package/build-module/shared/use-item-exit-animation.mjs +92 -124
- package/build-module/shared/use-item-exit-animation.mjs.map +1 -7
- package/build-module/shared/use-layout-shift-animation.mjs +114 -123
- package/build-module/shared/use-layout-shift-animation.mjs.map +1 -7
- package/build-module/shared/use-span-bounds.mjs +60 -57
- package/build-module/shared/use-span-bounds.mjs.map +1 -7
- package/build-types/dashboard-grid/index.d.ts.map +1 -1
- package/build-types/dashboard-grid/types.d.ts +9 -5
- package/build-types/dashboard-grid/types.d.ts.map +1 -1
- package/build-types/dashboard-lanes/index.d.ts.map +1 -1
- package/build-types/dashboard-lanes/types.d.ts +9 -5
- package/build-types/dashboard-lanes/types.d.ts.map +1 -1
- package/build-types/index.d.ts +1 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/shared/column-policy.d.ts +43 -0
- package/build-types/shared/column-policy.d.ts.map +1 -0
- package/package.json +14 -12
- package/src/dashboard-grid/grid-item.tsx +1 -1
- package/src/dashboard-grid/{grid.module.css → grid.module.scss} +10 -19
- package/src/dashboard-grid/index.tsx +12 -13
- package/src/dashboard-grid/stories/index.story.tsx +129 -50
- package/src/dashboard-grid/test/item-interactions.browser.test.tsx +1 -1
- package/src/dashboard-grid/types.ts +9 -5
- package/src/dashboard-lanes/index.tsx +13 -13
- package/src/dashboard-lanes/lanes-item.tsx +1 -1
- package/src/dashboard-lanes/{lanes.module.css → lanes.module.scss} +10 -19
- package/src/dashboard-lanes/stories/index.story.tsx +124 -28
- package/src/dashboard-lanes/test/item-interactions.browser.test.tsx +1 -1
- package/src/dashboard-lanes/types.ts +9 -5
- package/src/index.ts +1 -0
- package/src/shared/column-policy.ts +100 -0
- package/src/shared/test/column-policy.test.ts +215 -0
- package/src/shared/test/sortable-semantics.browser.test.tsx +122 -0
- package/build/dashboard-grid/types.cjs.map +0 -7
- package/build/dashboard-lanes/types.cjs.map +0 -7
- package/build/index.cjs.map +0 -7
- package/build/shared/types.cjs.map +0 -7
- package/build-module/dashboard-grid/types.mjs.map +0 -7
- package/build-module/dashboard-lanes/types.mjs.map +0 -7
- package/build-module/index.mjs.map +0 -7
- package/build-module/shared/types.mjs.map +0 -7
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/dashboard-lanes/index.tsx", "../../../style-runtime/src/index.ts", "../../src/shared/layout-shift-animation.module.css", "../../src/dashboard-lanes/lanes.module.css"],
|
|
4
|
-
"sourcesContent": ["import {\n\tDndContext,\n\tDragOverlay,\n\tKeyboardSensor,\n\tPointerSensor,\n\tuseSensor,\n\tuseSensors,\n} from '@dnd-kit/core';\nimport {\n\tSortableContext,\n\tsortableKeyboardCoordinates,\n} from '@dnd-kit/sortable';\nimport type { DragMoveEvent, DragStartEvent } from '@dnd-kit/core';\nimport clsx from 'clsx';\nimport { useResizeObserver, useEvent, useMergeRefs } from '@wordpress/compose';\nimport {\n\tforwardRef,\n\tuseMemo,\n\tChildren,\n\tcloneElement,\n\tisValidElement,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { LanesItem } from './lanes-item';\nimport { useLanePlacement } from './use-lane-placement';\nimport { arrayMoveWithPinned } from '../shared/array-move-with-pinned';\nimport { GridOverlay } from '../shared/grid-overlay';\nimport { clampSpan, gridSpanToPixelSize } from '../shared/resize-snap';\nimport { useResizePixelLimits, useSpanBounds } from '../shared/use-span-bounds';\nimport layoutAnimationStyles from '../shared/layout-shift-animation.module.css';\nimport { ItemExitOverlay } from '../shared/item-exit-overlay';\nimport {\n\tgetLayoutFingerprint,\n\tgetPlacementFingerprint,\n\tuseLayoutShiftAnimation,\n} from '../shared/use-layout-shift-animation';\nimport { useItemExitAnimation } from '../shared/use-item-exit-animation';\nimport type { DashboardLanesLayoutItem, DashboardLanesProps } from './types';\nimport type { ResizeSnapSize } from '../shared/resize-snap';\nimport type { ResizeDelta } from '../shared/types';\nimport { createDashboardDragDropAnimation } from '../shared/drag-overlay-drop-animation';\nimport styles from './lanes.module.css';\n\nconst dashboardDragDropAnimation = createDashboardDragDropAnimation(\n\tstyles[ 'drag-preview-frame' ],\n\tstyles[ 'is-exiting' ]\n);\n\n// Fallback gap in pixels for math that runs before the computed gap\n// can be read from the DOM. Matches the `'xl'` step the surface\n// resolves to in CSS (`--wpds-dimension-gap-xl`); the next layout\n// effect overwrites this with the actual computed value.\nconst FALLBACK_GAP_PX = 24;\n\n// Default lane cap when no explicit `columns` or `minColumnWidth` is\n// supplied. Layered semantics: `columns` acts as a cap and\n// `minColumnWidth` as a per-tile floor; if neither is set we still\n// need a finite count to render against.\nconst DEFAULT_COLUMNS = 6;\n\nconst NO_SORT_STRATEGY = () => null;\n\n/**\n * Masonry-style surface aligned with `display: grid-lanes`. Items\n * declare a column span; heights are driven by content; placement\n * follows the source-ordered, shortest-lane algorithm with\n * `flow-tolerance` tiebreaking.\n *\n * On browsers that support `display: grid-lanes` natively, the\n * component emits the spec's CSS and lets the engine handle layout.\n * Otherwise, `useLanePlacement` measures item heights and assigns\n * explicit `grid-column-start` / `grid-row-start` values that\n * approximate the same result inside CSS Grid.\n *\n * Each child's `key` must match an entry in the `layout` array;\n * children without a match render at the end of the surface without\n * explicit placement and fall through the lanes auto-flow.\n *\n * @example\n * ```jsx\n * <DashboardLanes\n * layout={ [\n * { key: 'a' },\n * { key: 'b', width: 2 },\n * { key: 'c' },\n * ] }\n * columns={ 3 }\n * editMode\n * onChangeLayout={ setLayout }\n * >\n * <Tile key=\"a\">A</Tile>\n * <Tile key=\"b\">B</Tile>\n * <Tile key=\"c\">C</Tile>\n * </DashboardLanes>\n * ```\n *\n * @param props Component props.\n * @param ref Forwarded to the surface's root `<div>`.\n */\nexport const DashboardLanes = forwardRef< HTMLDivElement, DashboardLanesProps >(\n\tfunction UnforwardedDashboardLanes( props, ref ) {\n\t\tconst {\n\t\t\tlayout,\n\t\t\tcolumns,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\tflowTolerance = 16,\n\t\t\trowUnit = 4,\n\t\t\tminColumnWidth,\n\t\t\titemLimits,\n\t\t\teditMode = false,\n\t\t\tonChangeLayout,\n\t\t\tonPreviewLayout,\n\t\t\trenderResizeHandle,\n\t\t\trenderDragPreview,\n\t\t\trenderGridOverlay,\n\t\t\t...divProps\n\t\t} = props;\n\n\t\tconst [ temporaryLayout, setTemporaryLayout ] = useState<\n\t\t\tDashboardLanesLayoutItem[] | undefined\n\t\t>();\n\t\tconst [ activeId, setActiveId ] = useState< string | null >( null );\n\t\tconst [ isResizing, setIsResizing ] = useState( false );\n\t\tconst [ resizeSnapPreview, setResizeSnapPreview ] = useState< {\n\t\t\tid: string;\n\t\t\tsnap: ResizeSnapSize;\n\t\t} | null >( null );\n\t\tconst latestLayoutRef = useRef<\n\t\t\tDashboardLanesLayoutItem[] | undefined\n\t\t>( undefined );\n\t\tconst lastReorderCursorRef = useRef< {\n\t\t\tx: number;\n\t\t\ty: number;\n\t\t} | null >( null );\n\t\tconst resizeBaselineRef = useRef< number | null >( null );\n\t\tconst captureLayoutSnapshotRef = useRef< () => void >( () => {} );\n\t\tconst childrenCacheRef = useRef< Map< string, React.ReactElement > >(\n\t\t\tnew Map()\n\t\t);\n\t\tconst activeLayout = temporaryLayout ?? layout;\n\n\t\tconst [ container, setContainer ] = useState< HTMLDivElement | null >(\n\t\t\tnull\n\t\t);\n\t\tconst [ containerWidth, setContainerWidth ] = useState( 0 );\n\t\tconst [ gapPx, setGapPx ] = useState( FALLBACK_GAP_PX );\n\t\tconst resizeObserverRef = useResizeObserver(\n\t\t\t( [ { contentRect } ] ) => {\n\t\t\t\tsetContainerWidth( contentRect.width );\n\t\t\t}\n\t\t);\n\t\tconst mergedRootRef = useMergeRefs( [\n\t\t\tsetContainer,\n\t\t\tresizeObserverRef,\n\t\t\tref,\n\t\t] );\n\n\t\t// Measure synchronously before paint and snapshot the computed\n\t\t// `column-gap` so the placement math tracks the design-system\n\t\t// token under any density.\n\t\tuseLayoutEffect( () => {\n\t\t\tif ( ! container ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { width } = container.getBoundingClientRect();\n\t\t\tif ( width > 0 ) {\n\t\t\t\tsetContainerWidth( width );\n\t\t\t}\n\t\t\tconst parsed = Number.parseFloat(\n\t\t\t\twindow.getComputedStyle( container ).columnGap\n\t\t\t);\n\t\t\tif ( Number.isFinite( parsed ) && parsed > 0 ) {\n\t\t\t\tsetGapPx( parsed );\n\t\t\t}\n\t\t}, [ container ] );\n\t\tconst effectiveColumns = useMemo( () => {\n\t\t\tif ( ! minColumnWidth ) {\n\t\t\t\treturn columns ?? DEFAULT_COLUMNS;\n\t\t\t}\n\t\t\tconst totalWidthPerColumn = minColumnWidth + gapPx;\n\t\t\tconst maxFit = Math.max(\n\t\t\t\t1,\n\t\t\t\tMath.floor( ( containerWidth + gapPx ) / totalWidthPerColumn )\n\t\t\t);\n\t\t\treturn columns !== undefined ? Math.min( columns, maxFit ) : maxFit;\n\t\t}, [ minColumnWidth, gapPx, containerWidth, columns ] );\n\t\tconst columnWidth =\n\t\t\t( containerWidth - ( effectiveColumns - 1 ) * gapPx ) /\n\t\t\teffectiveColumns;\n\t\tconst minResizeWidthPx = gridSpanToPixelSize(\n\t\t\t1,\n\t\t\t1,\n\t\t\tcolumnWidth,\n\t\t\tgapPx,\n\t\t\tnull\n\t\t).widthPx;\n\n\t\t// Height limits do not apply: lane heights are content-driven.\n\t\tconst widthBoundsByKey = useSpanBounds(\n\t\t\titemLimits,\n\t\t\tcolumnWidth,\n\t\t\tgapPx,\n\t\t\tnull,\n\t\t\teffectiveColumns\n\t\t);\n\t\tconst resizeLimitsByKey = useResizePixelLimits(\n\t\t\twidthBoundsByKey,\n\t\t\tcolumnWidth,\n\t\t\tgapPx,\n\t\t\tnull\n\t\t);\n\n\t\tconst layoutMap = useMemo( () => {\n\t\t\tconst map = new Map< string, DashboardLanesLayoutItem >();\n\t\t\tactiveLayout.forEach( ( item ) => map.set( item.key, item ) );\n\t\t\treturn map;\n\t\t}, [ activeLayout ] );\n\n\t\t// Stable-identity key set for the children walk (see grid.tsx).\n\t\tconst layoutKeys = useMemo(\n\t\t\t() => new Set( layout.map( ( item ) => item.key ) ),\n\t\t\t[ layout ]\n\t\t);\n\n\t\t// Sorted item keys, identity-stable when the resulting sequence\n\t\t// is unchanged (avoids invalidating SortableContext).\n\t\tconst sortedItems = useMemo(\n\t\t\t() =>\n\t\t\t\tactiveLayout\n\t\t\t\t\t.map( ( item, index ) => ( { item, index } ) )\n\t\t\t\t\t.sort(\n\t\t\t\t\t\t( a, b ) =>\n\t\t\t\t\t\t\t( a.item.order ?? a.index ) -\n\t\t\t\t\t\t\t( b.item.order ?? b.index )\n\t\t\t\t\t)\n\t\t\t\t\t.map( ( { item } ) => item.key ),\n\t\t\t[ activeLayout ]\n\t\t);\n\t\tconst items = sortedItems;\n\n\t\t// Span each item renders at: the stored width clamped to the lane\n\t\t// count and to the item's width bounds. Placement, the resize\n\t\t// baseline, and the commit check all read it, so a gesture starts\n\t\t// from the span on screen and commits nothing until it leaves it.\n\t\tconst renderedSpanByKey = useMemo( () => {\n\t\t\tconst map = new Map< string, number >();\n\t\t\tfor ( const [ key, item ] of layoutMap ) {\n\t\t\t\tconst span =\n\t\t\t\t\ttypeof item.width === 'number'\n\t\t\t\t\t\t? Math.max(\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\tMath.min( item.width, effectiveColumns )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: 1;\n\t\t\t\tconst bounds = widthBoundsByKey.get( key );\n\t\t\t\tmap.set(\n\t\t\t\t\tkey,\n\t\t\t\t\tbounds\n\t\t\t\t\t\t? clampSpan( span, bounds.minWidth, bounds.maxWidth )\n\t\t\t\t\t\t: span\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn map;\n\t\t}, [ layoutMap, effectiveColumns, widthBoundsByKey ] );\n\n\t\t// Placement input for the hook: each item with its rendered span\n\t\t// in source (sorted) order. `lane` forwards the optional explicit\n\t\t// pin from the layout item; the algorithm clamps out-of-range\n\t\t// values, so no surface-level guard is needed.\n\t\tconst placementItems = useMemo( () => {\n\t\t\treturn items.map( ( key ) => ( {\n\t\t\t\tkey,\n\t\t\t\tspan: renderedSpanByKey.get( key ) ?? 1,\n\t\t\t\tlane: layoutMap.get( key )?.lane,\n\t\t\t} ) );\n\t\t}, [ items, layoutMap, renderedSpanByKey ] );\n\n\t\tconst { itemStyles } = useLanePlacement( container, {\n\t\t\titems: placementItems,\n\t\t\tlanes: effectiveColumns,\n\t\t\tgap: gapPx,\n\t\t\tflowTolerance,\n\t\t\trowUnit,\n\t\t} );\n\n\t\tconst [ childrenMap, actionableAreaMap, remaining, renderedByKey ] =\n\t\t\tuseMemo( () => {\n\t\t\t\tconst childMap = new Map< string, React.ReactElement >();\n\t\t\t\tconst actionableMap = new Map< string, React.ReactNode >();\n\t\t\t\tconst rest: React.ReactNode[] = [];\n\t\t\t\tconst byKey = new Map< string, React.ReactElement >();\n\n\t\t\t\tChildren.forEach( children, ( child ) => {\n\t\t\t\t\tif ( ! isValidElement( child ) ) {\n\t\t\t\t\t\trest.push( child );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst key = child.key?.toString();\n\t\t\t\t\tif ( ! key ) {\n\t\t\t\t\t\trest.push( child );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Strip `actionableArea` so it does not leak to the DOM;\n\t\t\t\t\t// the grid lifts it to a slot separately.\n\t\t\t\t\tconst { actionableArea } = child.props as {\n\t\t\t\t\t\tactionableArea?: React.ReactNode;\n\t\t\t\t\t};\n\t\t\t\t\tconst stripped =\n\t\t\t\t\t\tactionableArea !== undefined\n\t\t\t\t\t\t\t? cloneElement(\n\t\t\t\t\t\t\t\t\tchild as React.ReactElement< {\n\t\t\t\t\t\t\t\t\t\tactionableArea?: React.ReactNode;\n\t\t\t\t\t\t\t\t\t} >,\n\t\t\t\t\t\t\t\t\t{ actionableArea: undefined }\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: ( child as React.ReactElement );\n\n\t\t\t\t\tbyKey.set( key, stripped );\n\n\t\t\t\t\tif ( layoutKeys.has( key ) ) {\n\t\t\t\t\t\tif ( actionableArea !== undefined ) {\n\t\t\t\t\t\t\tactionableMap.set( key, actionableArea );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchildMap.set( key, stripped );\n\t\t\t\t\t} else {\n\t\t\t\t\t\trest.push( child );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\treturn [ childMap, actionableMap, rest, byKey ];\n\t\t\t}, [ children, layoutKeys ] );\n\n\t\t// Persist the latest rendered children so a removed tile's content\n\t\t// is still available for its exit overlay. Filled from an effect so a\n\t\t// discarded render never writes to the cache.\n\t\tuseLayoutEffect( () => {\n\t\t\tfor ( const [ key, child ] of renderedByKey ) {\n\t\t\t\tchildrenCacheRef.current.set( key, child );\n\t\t\t}\n\t\t}, [ renderedByKey ] );\n\n\t\tconst sensors = useSensors(\n\t\t\tuseSensor( PointerSensor ),\n\t\t\tuseSensor( KeyboardSensor, {\n\t\t\t\tcoordinateGetter: sortableKeyboardCoordinates,\n\t\t\t} )\n\t\t);\n\n\t\tconst handleDragStart = useEvent( ( event: DragStartEvent ) => {\n\t\t\tsetActiveId( String( event.active.id ) );\n\t\t\tlastReorderCursorRef.current = null;\n\t\t} );\n\n\t\tconst handleDragCancel = useEvent( () => {\n\t\t\tsetActiveId( null );\n\t\t\tlatestLayoutRef.current = undefined;\n\t\t\tlastReorderCursorRef.current = null;\n\t\t\tresizeBaselineRef.current = null;\n\t\t\tsetIsResizing( false );\n\t\t\tsetResizeSnapPreview( null );\n\t\t\tsetTemporaryLayout( undefined );\n\t\t} );\n\n\t\tconst handleDragMove = useEvent( ( event: DragMoveEvent ) => {\n\t\t\tconst { active, over } = event;\n\t\t\tif ( ! over || active.id === over.id ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst activeRect = active.rect.current.translated;\n\t\t\tif ( ! activeRect ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst activeCenterX = activeRect.left + activeRect.width / 2;\n\t\t\tconst activeCenterY = activeRect.top + activeRect.height / 2;\n\n\t\t\tconst lastCursor = lastReorderCursorRef.current;\n\t\t\tif ( lastCursor ) {\n\t\t\t\tconst dx = activeCenterX - lastCursor.x;\n\t\t\t\tconst dy = activeCenterY - lastCursor.y;\n\t\t\t\tif ( dx * dx + dy * dy < 100 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst overCenterX = over.rect.left + over.rect.width / 2;\n\t\t\tconst insertAfter = activeCenterX > overCenterX;\n\n\t\t\tconst currentIndex = items.indexOf( String( active.id ) );\n\t\t\tconst overIndex = items.indexOf( String( over.id ) );\n\t\t\tlet newIndex: number;\n\t\t\tif ( insertAfter ) {\n\t\t\t\tnewIndex = currentIndex > overIndex ? overIndex + 1 : overIndex;\n\t\t\t} else {\n\t\t\t\tnewIndex = currentIndex > overIndex ? overIndex : overIndex - 1;\n\t\t\t}\n\t\t\tnewIndex = Math.max( 0, Math.min( newIndex, items.length - 1 ) );\n\n\t\t\tif ( newIndex === currentIndex ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Non-draggable items are pinned: they hold their index while\n\t\t\t// the others reorder around them.\n\t\t\tconst updatedItems = arrayMoveWithPinned(\n\t\t\t\titems,\n\t\t\t\tcurrentIndex,\n\t\t\t\tnewIndex,\n\t\t\t\t( key ) => layoutMap.get( key )?.draggable === false\n\t\t\t);\n\t\t\tif (\n\t\t\t\tupdatedItems.every( ( key, index ) => key === items[ index ] )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Build a key→index lookup so the .map below is O(n)\n\t\t\t// instead of O(n²) from per-item `indexOf` calls.\n\t\t\tconst orderByKey = new Map< string, number >();\n\t\t\tupdatedItems.forEach( ( key, index ) => {\n\t\t\t\torderByKey.set( key, index );\n\t\t\t} );\n\t\t\tconst updatedLayout = activeLayout.map( ( item ) => ( {\n\t\t\t\t...item,\n\t\t\t\torder: orderByKey.get( item.key ) ?? 0,\n\t\t\t} ) );\n\n\t\t\tlastReorderCursorRef.current = {\n\t\t\t\tx: activeCenterX,\n\t\t\t\ty: activeCenterY,\n\t\t\t};\n\t\t\tlatestLayoutRef.current = updatedLayout;\n\t\t\tcaptureLayoutSnapshotRef.current();\n\t\t\tsetTemporaryLayout( updatedLayout );\n\t\t\tonPreviewLayout?.( updatedLayout );\n\t\t} );\n\n\t\tconst persistTemporaryLayout = useEvent( () => {\n\t\t\tconst latest = latestLayoutRef.current;\n\t\t\tlatestLayoutRef.current = undefined;\n\t\t\tresizeBaselineRef.current = null;\n\t\t\tsetIsResizing( false );\n\t\t\tsetResizeSnapPreview( null );\n\t\t\tif ( ! onChangeLayout || ! latest ) {\n\t\t\t\tsetTemporaryLayout( undefined );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonChangeLayout( latest );\n\t\t\tsetTemporaryLayout( undefined );\n\t\t} );\n\n\t\tconst handleResize = useEvent( ( id: string, delta: ResizeDelta ) => {\n\t\t\tif ( ! editMode ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( ! isResizing ) {\n\t\t\t\tsetIsResizing( true );\n\t\t\t}\n\n\t\t\tconst relativeDelta = Math.round(\n\t\t\t\tdelta.width / ( columnWidth + gapPx )\n\t\t\t);\n\n\t\t\tif ( resizeBaselineRef.current === null ) {\n\t\t\t\tresizeBaselineRef.current = renderedSpanByKey.get( id ) ?? 1;\n\t\t\t}\n\t\t\tconst baseline = resizeBaselineRef.current;\n\t\t\tconst bounds = widthBoundsByKey.get( id );\n\t\t\tconst newWidth = clampSpan(\n\t\t\t\tbaseline + relativeDelta,\n\t\t\t\tbounds?.minWidth ?? 1,\n\t\t\t\tbounds?.maxWidth ?? effectiveColumns\n\t\t\t);\n\n\t\t\tsetResizeSnapPreview( {\n\t\t\t\tid,\n\t\t\t\tsnap: gridSpanToPixelSize(\n\t\t\t\t\tnewWidth,\n\t\t\t\t\t1,\n\t\t\t\t\tcolumnWidth,\n\t\t\t\t\tgapPx,\n\t\t\t\t\tnull\n\t\t\t\t),\n\t\t\t} );\n\n\t\t\t// Bail when the snap target matches the span staged for commit,\n\t\t\t// or the rendered span while nothing is staged.\n\t\t\tconst pendingItem = latestLayoutRef.current?.find(\n\t\t\t\t( item ) => item.key === id\n\t\t\t);\n\t\t\tconst currentWidth =\n\t\t\t\tpendingItem?.width ?? renderedSpanByKey.get( id );\n\t\t\tif ( currentWidth === newWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst updatedLayout = activeLayout.map( ( item ) =>\n\t\t\t\titem.key === id ? { ...item, width: newWidth } : item\n\t\t\t);\n\n\t\t\tlatestLayoutRef.current = updatedLayout;\n\t\t\tcaptureLayoutSnapshotRef.current();\n\t\t\tsetTemporaryLayout( updatedLayout );\n\t\t\tonPreviewLayout?.( updatedLayout );\n\t\t} );\n\n\t\tconst interacting = activeId !== null || isResizing;\n\n\t\t// Drag-overlay clone composition: the surface always wraps with a\n\t\t// thin functional frame (lift, cursor, pointer pass-through). When\n\t\t// `renderDragPreview` is supplied, the consumer's wrapper sits\n\t\t// inside the frame around the cloned children; otherwise the\n\t\t// cloned children render directly so any persistent chrome on\n\t\t// them carries through unchanged.\n\t\tconst activeClone = activeId ? childrenMap.get( activeId ) : null;\n\t\tconst DragPreview = renderDragPreview;\n\t\tconst dragOverlayContent =\n\t\t\tactiveId && activeClone ? (\n\t\t\t\t<div className={ styles[ 'drag-preview-frame' ] }>\n\t\t\t\t\t<div className={ styles[ 'drag-preview-frame__lift' ] }>\n\t\t\t\t\t\t{ DragPreview ? (\n\t\t\t\t\t\t\t<DragPreview itemId={ activeId }>\n\t\t\t\t\t\t\t\t{ activeClone }\n\t\t\t\t\t\t\t</DragPreview>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tactiveClone\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : null;\n\n\t\t// Edit-mode background. Lanes are content-driven vertically, so\n\t\t// the overlay mirrors columns only. Rendered unconditionally so\n\t\t// it can cross-fade on edit-mode toggles (`isActive` drives the\n\t\t// transition); memoized so drag/resize re-renders skip it.\n\t\tconst Overlay = renderGridOverlay ?? GridOverlay;\n\t\tconst gridOverlay = useMemo(\n\t\t\t() => (\n\t\t\t\t<Overlay columns={ effectiveColumns } isActive={ editMode } />\n\t\t\t),\n\t\t\t[ Overlay, editMode, effectiveColumns ]\n\t\t);\n\n\t\tconst layoutFingerprint = useMemo( () => {\n\t\t\tconst layoutSig = getLayoutFingerprint( activeLayout );\n\t\t\tconst placementSig = getPlacementFingerprint( itemStyles );\n\t\t\treturn `${ layoutSig }\\0${ placementSig }`;\n\t\t}, [ activeLayout, itemStyles ] );\n\t\tconst excludeLayoutAnimationKey =\n\t\t\tactiveId ?? ( isResizing ? resizeSnapPreview?.id : null );\n\t\tconst { captureLayoutSnapshot, getPositionsBeforeLastChange } =\n\t\t\tuseLayoutShiftAnimation( {\n\t\t\t\tcontainer,\n\t\t\t\tenabled: editMode,\n\t\t\t\tlayoutFingerprint,\n\t\t\t\texcludeItemKey: excludeLayoutAnimationKey,\n\t\t\t} );\n\t\tconst { exitingItems, clearExitingItem } = useItemExitAnimation( {\n\t\t\tcontainer,\n\t\t\tenabled: editMode,\n\t\t\tlayoutKeys,\n\t\t\tgetPositionsBeforeLastChange,\n\t\t\tchildrenCacheRef,\n\t\t} );\n\t\tconst layoutAnimating = editMode;\n\t\tuseLayoutEffect( () => {\n\t\t\tcaptureLayoutSnapshotRef.current = captureLayoutSnapshot;\n\t\t}, [ captureLayoutSnapshot ] );\n\n\t\treturn (\n\t\t\t<DndContext\n\t\t\t\tsensors={ sensors }\n\t\t\t\tonDragStart={ handleDragStart }\n\t\t\t\tonDragCancel={ handleDragCancel }\n\t\t\t\tonDragMove={ handleDragMove }\n\t\t\t\tonDragEnd={ () => {\n\t\t\t\t\tpersistTemporaryLayout();\n\t\t\t\t\tlastReorderCursorRef.current = null;\n\t\t\t\t\tsetActiveId( null );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<SortableContext items={ items } strategy={ NO_SORT_STRATEGY }>\n\t\t\t\t\t<div\n\t\t\t\t\t\t{ ...divProps }\n\t\t\t\t\t\tref={ mergedRootRef }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tstyles.lanes,\n\t\t\t\t\t\t\tlayoutAnimating &&\n\t\t\t\t\t\t\t\tlayoutAnimationStyles[ 'layout-animating' ],\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tdata-wp-grid-dragging={ activeId || undefined }\n\t\t\t\t\t\tdata-wp-grid-resizing={ isResizing || undefined }\n\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\t\tgridTemplateColumns: `repeat(${ effectiveColumns }, minmax(0, 1fr))`,\n\t\t\t\t\t\t\t\t// `column-gap` and `row-gap` are set in\n\t\t\t\t\t\t\t\t// `lanes.module.css` from the\n\t\t\t\t\t\t\t\t// design-system gap token, with an\n\t\t\t\t\t\t\t\t// `@supports` block that zeroes `row-gap`\n\t\t\t\t\t\t\t\t// in polyfill mode (the skyline already\n\t\t\t\t\t\t\t\t// encodes vertical spacing in each tile's\n\t\t\t\t\t\t\t\t// `top`). Driving the toggle from CSS\n\t\t\t\t\t\t\t\t// keeps SSR and client output identical\n\t\t\t\t\t\t\t\t// regardless of native support.\n\t\t\t\t\t\t\t\t'--wp-grid-lane-row-unit': `${ Math.max(\n\t\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t\trowUnit\n\t\t\t\t\t\t\t\t) }px`,\n\t\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ gridOverlay }\n\t\t\t\t\t\t{ items.map( ( id ) => {\n\t\t\t\t\t\t\tconst child = childrenMap.get( id );\n\t\t\t\t\t\t\tif ( ! child ) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst limitsPx = resizeLimitsByKey.get( id );\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<LanesItem\n\t\t\t\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\t\t\t\titemKey={ id }\n\t\t\t\t\t\t\t\t\tplacementStyle={\n\t\t\t\t\t\t\t\t\t\titemStyles.get( id ) ?? {}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdisabled={ ! editMode }\n\t\t\t\t\t\t\t\t\tdraggable={\n\t\t\t\t\t\t\t\t\t\tlayoutMap.get( id )?.draggable !== false\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tresizable={\n\t\t\t\t\t\t\t\t\t\tlayoutMap.get( id )?.resizable !== false\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tinteracting={ interacting }\n\t\t\t\t\t\t\t\t\tdragging={ activeId !== null }\n\t\t\t\t\t\t\t\t\tonResize={ handleResize }\n\t\t\t\t\t\t\t\t\tonResizeEnd={ persistTemporaryLayout }\n\t\t\t\t\t\t\t\t\tresizeSnapPreview={\n\t\t\t\t\t\t\t\t\t\tresizeSnapPreview?.id === id\n\t\t\t\t\t\t\t\t\t\t\t? resizeSnapPreview.snap\n\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tminResizeWidthPx={\n\t\t\t\t\t\t\t\t\t\tlimitsPx?.minWidthPx ?? minResizeWidthPx\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmaxResizeWidthPx={ limitsPx?.maxWidthPx }\n\t\t\t\t\t\t\t\t\tactionableArea={ actionableAreaMap.get(\n\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\trenderResizeHandle={ renderResizeHandle }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ child }\n\t\t\t\t\t\t\t\t</LanesItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t{ remaining }\n\t\t\t\t\t\t{ exitingItems.map( ( { key, rect, child } ) => (\n\t\t\t\t\t\t\t<ItemExitOverlay\n\t\t\t\t\t\t\t\tkey={ `exiting-${ key }` }\n\t\t\t\t\t\t\t\titemKey={ key }\n\t\t\t\t\t\t\t\trect={ rect }\n\t\t\t\t\t\t\t\tonAnimationEnd={ () => clearExitingItem( key ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ child }\n\t\t\t\t\t\t\t</ItemExitOverlay>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t</SortableContext>\n\t\t\t\t<DragOverlay dropAnimation={ dashboardDragDropAnimation }>\n\t\t\t\t\t{ dragOverlayContent }\n\t\t\t\t</DragOverlay>\n\t\t\t</DndContext>\n\t\t);\n\t}\n);\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"9e5573e51f\", \"._2db63116caa90ae9__layout-animating [data-wp-grid-item-key]{transition:transform var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1))}@media (prefers-reduced-motion:reduce){._2db63116caa90ae9__layout-animating [data-wp-grid-item-key]{transition:none}}\");\n}\nexport default {\"layout-animating\":\"_2db63116caa90ae9__layout-animating\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"7b851be8c0\", \"._8cc368bc6c2d79c6__lanes{column-gap:var(--wp-grid-gap,var(--wpds-dimension-gap-xl,24px));display:grid-lanes;position:relative;row-gap:var(--wp-grid-gap,var(--wpds-dimension-gap-xl,24px))}@supports not (display:grid-lanes){._8cc368bc6c2d79c6__lanes{display:grid;grid-auto-flow:dense;grid-auto-rows:var(--wp-grid-lane-row-unit,4px);row-gap:0}}._1bfa908a532e32a4__drag-preview-frame{--_wp-grid-elevation-xs:0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01);--_wp-grid-elevation-md:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);border-radius:var(--wp-grid-drag-preview-radius,0);box-shadow:var(--_wp-grid-elevation-md);cursor:grabbing;height:100%;pointer-events:none}.bd684ee9f92388ed__drag-preview-frame__lift{height:100%;transform:scale(var(--wp-grid-drag-preview-scale,1.05));transform-origin:center}@media not (prefers-reduced-motion:reduce){._1bfa908a532e32a4__drag-preview-frame{animation:_5f4a1718cb7927ee__wp-grid-drag-preview-shadow-enter var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) both}.bd684ee9f92388ed__drag-preview-frame__lift{animation:_29f7f02d4f227b1e__wp-grid-drag-preview-scale-enter var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) both}}@media not (prefers-reduced-motion:reduce){@keyframes _5f4a1718cb7927ee__wp-grid-drag-preview-shadow-enter{0%{box-shadow:var(--_wp-grid-elevation-xs)}to{box-shadow:var(--_wp-grid-elevation-md)}}@keyframes _29f7f02d4f227b1e__wp-grid-drag-preview-scale-enter{0%{transform:scale(1)}to{transform:scale(var(--wp-grid-drag-preview-scale,1.05))}}}@media not (prefers-reduced-motion:reduce){._1bfa908a532e32a4__drag-preview-frame._4e3613427755609c__is-exiting{animation:_6883de14c5fb8559__wp-grid-drag-preview-shadow-exit var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) forwards}._1bfa908a532e32a4__drag-preview-frame._4e3613427755609c__is-exiting .bd684ee9f92388ed__drag-preview-frame__lift{animation:_0de4da1cd817e536__wp-grid-drag-preview-scale-exit var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) forwards}@keyframes _6883de14c5fb8559__wp-grid-drag-preview-shadow-exit{0%{box-shadow:var(--_wp-grid-elevation-md)}to{box-shadow:var(--_wp-grid-elevation-xs)}}@keyframes _0de4da1cd817e536__wp-grid-drag-preview-scale-exit{0%{transform:scale(var(--wp-grid-drag-preview-scale,1.05))}to{transform:scale(1)}}}._1bfa908a532e32a4__drag-preview-frame._4e3613427755609c__is-exiting{box-shadow:var(--_wp-grid-elevation-xs)}._1bfa908a532e32a4__drag-preview-frame._4e3613427755609c__is-exiting .bd684ee9f92388ed__drag-preview-frame__lift{transform:scale(1)}@media (prefers-reduced-motion:reduce){._1bfa908a532e32a4__drag-preview-frame{box-shadow:var(--_wp-grid-elevation-md)}.bd684ee9f92388ed__drag-preview-frame__lift{transform:none}._1bfa908a532e32a4__drag-preview-frame._4e3613427755609c__is-exiting{box-shadow:var(--_wp-grid-elevation-xs);transition:none}._1bfa908a532e32a4__drag-preview-frame._4e3613427755609c__is-exiting .bd684ee9f92388ed__drag-preview-frame__lift{transition:none}}\");\n}\nexport default {\"lanes\":\"_8cc368bc6c2d79c6__lanes\",\"drag-preview-frame\":\"_1bfa908a532e32a4__drag-preview-frame\",\"drag-preview-frame__lift\":\"bd684ee9f92388ed__drag-preview-frame__lift\",\"wp-grid-drag-preview-shadow-enter\":\"_5f4a1718cb7927ee__wp-grid-drag-preview-shadow-enter\",\"wp-grid-drag-preview-scale-enter\":\"_29f7f02d4f227b1e__wp-grid-drag-preview-scale-enter\",\"is-exiting\":\"_4e3613427755609c__is-exiting\",\"wp-grid-drag-preview-shadow-exit\":\"_6883de14c5fb8559__wp-grid-drag-preview-shadow-exit\",\"wp-grid-drag-preview-scale-exit\":\"_0de4da1cd817e536__wp-grid-drag-preview-scale-exit\"};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAOO;AACP,sBAGO;AAEP,kBAAiB;AACjB,qBAA0D;AAC1D,qBASO;AACP,wBAA0B;AAC1B,gCAAiC;AACjC,oCAAoC;AACpC,0BAA4B;AAC5B,yBAA+C;AAC/C,6BAAoD;;;ACpBpD,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,MAAO;AAC1D,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,SAAS,YAAa,gBAA0B,MAAc,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A,IACD;AAAA,EAEF;AACD;",
|
|
6
|
-
"names": ["clsx"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["createDashboardDragDropAnimation","styles","forwardRef","useState","useRef","useResizeObserver","useMergeRefs","useMemo","resolveColumnCount","gridSpanToPixelSize","useSpanBounds","useResizePixelLimits","clampSpan","useLanePlacement","isValidElement","cloneElement","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","useEvent","arrayMoveWithPinned","GridOverlay","getLayoutFingerprint","getPlacementFingerprint","useLayoutShiftAnimation","useItemExitAnimation","DndContext","SortableContext","layoutAnimationStyles","LanesItem","ItemExitOverlay","DragOverlay"],"sources":["../../../style-runtime/src/index.ts","../../src/shared/layout-shift-animation.module.css","../../src/dashboard-lanes/lanes.module.scss","../../src/dashboard-lanes/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"5d10111ab0\", \".c68bb75eb6bf717a__layout-animating [data-wp-grid-item-key]{transition:transform var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1))}@media (prefers-reduced-motion:reduce){.c68bb75eb6bf717a__layout-animating [data-wp-grid-item-key]{transition:none}}\");\n}\nexport default {\"layout-animating\":\"c68bb75eb6bf717a__layout-animating\"};\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"25b095c2e7\", \"._23779dfdf51c5e50__lanes{column-gap:var(--wp-grid-gap,var(--wpds-dimension-gap-xl,24px));display:grid-lanes;position:relative;row-gap:var(--wp-grid-gap,var(--wpds-dimension-gap-xl,24px))}@supports not (display:grid-lanes){._23779dfdf51c5e50__lanes{display:grid;grid-auto-flow:dense;grid-auto-rows:var(--wp-grid-lane-row-unit,4px);row-gap:0}}.d7e03cc9b910fc7e__drag-preview-frame{border-radius:var(--wp-grid-drag-preview-radius,0);box-shadow:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02);cursor:grabbing;height:100%;pointer-events:none}._4425b9a6fa30579d__drag-preview-frame__lift{height:100%;transform:scale(var(--wp-grid-drag-preview-scale,1.05));transform-origin:center}@media not (prefers-reduced-motion:reduce){.d7e03cc9b910fc7e__drag-preview-frame{animation:ff9e5dccc1f34f49__wp-grid-drag-preview-shadow-enter var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) both}._4425b9a6fa30579d__drag-preview-frame__lift{animation:_2592bed08e4f30e4__wp-grid-drag-preview-scale-enter var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) both}}@media not (prefers-reduced-motion:reduce){@keyframes ff9e5dccc1f34f49__wp-grid-drag-preview-shadow-enter{0%{box-shadow:0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01)}to{box-shadow:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02)}}@keyframes _2592bed08e4f30e4__wp-grid-drag-preview-scale-enter{0%{transform:scale(1)}to{transform:scale(var(--wp-grid-drag-preview-scale,1.05))}}}@media not (prefers-reduced-motion:reduce){.d7e03cc9b910fc7e__drag-preview-frame._6348e3778fd237bf__is-exiting{animation:_4eb7799009ff2eea__wp-grid-drag-preview-shadow-exit var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) forwards}.d7e03cc9b910fc7e__drag-preview-frame._6348e3778fd237bf__is-exiting ._4425b9a6fa30579d__drag-preview-frame__lift{animation:_58b3144e745d3a6e__wp-grid-drag-preview-scale-exit var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) forwards}@keyframes _4eb7799009ff2eea__wp-grid-drag-preview-shadow-exit{0%{box-shadow:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02)}to{box-shadow:0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01)}}@keyframes _58b3144e745d3a6e__wp-grid-drag-preview-scale-exit{0%{transform:scale(var(--wp-grid-drag-preview-scale,1.05))}to{transform:scale(1)}}}.d7e03cc9b910fc7e__drag-preview-frame._6348e3778fd237bf__is-exiting{box-shadow:0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01)}.d7e03cc9b910fc7e__drag-preview-frame._6348e3778fd237bf__is-exiting ._4425b9a6fa30579d__drag-preview-frame__lift{transform:scale(1)}@media (prefers-reduced-motion:reduce){.d7e03cc9b910fc7e__drag-preview-frame{box-shadow:0 2px 3px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.04),0 12px 12px rgba(0,0,0,.03),0 16px 16px rgba(0,0,0,.02)}._4425b9a6fa30579d__drag-preview-frame__lift{transform:none}.d7e03cc9b910fc7e__drag-preview-frame._6348e3778fd237bf__is-exiting{box-shadow:0 1px 1px rgba(0,0,0,.03),0 1px 2px rgba(0,0,0,.02),0 3px 3px rgba(0,0,0,.02),0 4px 4px rgba(0,0,0,.01);transition:none}.d7e03cc9b910fc7e__drag-preview-frame._6348e3778fd237bf__is-exiting ._4425b9a6fa30579d__drag-preview-frame__lift{transition:none}}\");\n}\nexport default {\"lanes\":\"_23779dfdf51c5e50__lanes\",\"drag-preview-frame\":\"d7e03cc9b910fc7e__drag-preview-frame\",\"drag-preview-frame__lift\":\"_4425b9a6fa30579d__drag-preview-frame__lift\",\"wp-grid-drag-preview-shadow-enter\":\"ff9e5dccc1f34f49__wp-grid-drag-preview-shadow-enter\",\"wp-grid-drag-preview-scale-enter\":\"_2592bed08e4f30e4__wp-grid-drag-preview-scale-enter\",\"is-exiting\":\"_6348e3778fd237bf__is-exiting\",\"wp-grid-drag-preview-shadow-exit\":\"_4eb7799009ff2eea__wp-grid-drag-preview-shadow-exit\",\"wp-grid-drag-preview-scale-exit\":\"_58b3144e745d3a6e__wp-grid-drag-preview-scale-exit\"};\n","import {\n\tDndContext,\n\tDragOverlay,\n\tKeyboardSensor,\n\tPointerSensor,\n\tuseSensor,\n\tuseSensors,\n} from '@dnd-kit/core';\nimport {\n\tSortableContext,\n\tsortableKeyboardCoordinates,\n} from '@dnd-kit/sortable';\nimport type { DragMoveEvent, DragStartEvent } from '@dnd-kit/core';\nimport clsx from 'clsx';\nimport { useResizeObserver, useEvent, useMergeRefs } from '@wordpress/compose';\nimport {\n\tforwardRef,\n\tuseMemo,\n\tChildren,\n\tcloneElement,\n\tisValidElement,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { LanesItem } from './lanes-item';\nimport { useLanePlacement } from './use-lane-placement';\nimport { arrayMoveWithPinned } from '../shared/array-move-with-pinned';\nimport { resolveColumnCount } from '../shared/column-policy';\nimport { GridOverlay } from '../shared/grid-overlay';\nimport { clampSpan, gridSpanToPixelSize } from '../shared/resize-snap';\nimport { useResizePixelLimits, useSpanBounds } from '../shared/use-span-bounds';\nimport layoutAnimationStyles from '../shared/layout-shift-animation.module.css';\nimport { ItemExitOverlay } from '../shared/item-exit-overlay';\nimport {\n\tgetLayoutFingerprint,\n\tgetPlacementFingerprint,\n\tuseLayoutShiftAnimation,\n} from '../shared/use-layout-shift-animation';\nimport { useItemExitAnimation } from '../shared/use-item-exit-animation';\nimport type { DashboardLanesLayoutItem, DashboardLanesProps } from './types';\nimport type { ResizeSnapSize } from '../shared/resize-snap';\nimport type { ResizeDelta } from '../shared/types';\nimport { createDashboardDragDropAnimation } from '../shared/drag-overlay-drop-animation';\nimport styles from './lanes.module.scss';\n\nconst dashboardDragDropAnimation = createDashboardDragDropAnimation(\n\tstyles[ 'drag-preview-frame' ],\n\tstyles[ 'is-exiting' ]\n);\n\n// Fallback gap in pixels for math that runs before the computed gap\n// can be read from the DOM. Matches the `'xl'` step the surface\n// resolves to in CSS (`--wpds-dimension-gap-xl`); the next layout\n// effect overwrites this with the actual computed value.\nconst FALLBACK_GAP_PX = 24;\n\n// Default lane cap when no explicit `columns` or `minColumnWidth` is\n// supplied. Layered semantics: `columns` acts as a cap and\n// `minColumnWidth` as a per-tile floor; if neither is set we still\n// need a finite count to render against.\nconst DEFAULT_COLUMNS = 6;\n\nconst NO_SORT_STRATEGY = () => null;\n\n/**\n * Masonry-style surface aligned with `display: grid-lanes`. Items\n * declare a column span; heights are driven by content; placement\n * follows the source-ordered, shortest-lane algorithm with\n * `flow-tolerance` tiebreaking.\n *\n * On browsers that support `display: grid-lanes` natively, the\n * component emits the spec's CSS and lets the engine handle layout.\n * Otherwise, `useLanePlacement` measures item heights and assigns\n * explicit `grid-column-start` / `grid-row-start` values that\n * approximate the same result inside CSS Grid.\n *\n * Each child's `key` must match an entry in the `layout` array;\n * children without a match render at the end of the surface without\n * explicit placement and fall through the lanes auto-flow.\n *\n * @example\n * ```jsx\n * <DashboardLanes\n * layout={ [\n * { key: 'a' },\n * { key: 'b', width: 2 },\n * { key: 'c' },\n * ] }\n * columns={ 3 }\n * editMode\n * onChangeLayout={ setLayout }\n * >\n * <Tile key=\"a\">A</Tile>\n * <Tile key=\"b\">B</Tile>\n * <Tile key=\"c\">C</Tile>\n * </DashboardLanes>\n * ```\n *\n * @param props Component props.\n * @param ref Forwarded to the surface's root `<div>`.\n */\nexport const DashboardLanes = forwardRef< HTMLDivElement, DashboardLanesProps >(\n\tfunction UnforwardedDashboardLanes( props, ref ) {\n\t\tconst {\n\t\t\tlayout,\n\t\t\tcolumns,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tstyle,\n\t\t\tflowTolerance = 16,\n\t\t\trowUnit = 4,\n\t\t\tminColumnWidth,\n\t\t\titemLimits,\n\t\t\teditMode = false,\n\t\t\tonChangeLayout,\n\t\t\tonPreviewLayout,\n\t\t\trenderResizeHandle,\n\t\t\trenderDragPreview,\n\t\t\trenderGridOverlay,\n\t\t\t...divProps\n\t\t} = props;\n\n\t\tconst [ temporaryLayout, setTemporaryLayout ] = useState<\n\t\t\tDashboardLanesLayoutItem[] | undefined\n\t\t>();\n\t\tconst [ activeId, setActiveId ] = useState< string | null >( null );\n\t\tconst [ isResizing, setIsResizing ] = useState( false );\n\t\tconst [ resizeSnapPreview, setResizeSnapPreview ] = useState< {\n\t\t\tid: string;\n\t\t\tsnap: ResizeSnapSize;\n\t\t} | null >( null );\n\t\tconst latestLayoutRef = useRef<\n\t\t\tDashboardLanesLayoutItem[] | undefined\n\t\t>( undefined );\n\t\tconst lastReorderCursorRef = useRef< {\n\t\t\tx: number;\n\t\t\ty: number;\n\t\t} | null >( null );\n\t\tconst resizeBaselineRef = useRef< number | null >( null );\n\t\tconst captureLayoutSnapshotRef = useRef< () => void >( () => {} );\n\t\tconst childrenCacheRef = useRef< Map< string, React.ReactElement > >(\n\t\t\tnew Map()\n\t\t);\n\t\tconst activeLayout = temporaryLayout ?? layout;\n\n\t\tconst [ container, setContainer ] = useState< HTMLDivElement | null >(\n\t\t\tnull\n\t\t);\n\t\tconst [ containerWidth, setContainerWidth ] = useState( 0 );\n\t\tconst [ gapPx, setGapPx ] = useState( FALLBACK_GAP_PX );\n\t\tconst resizeObserverRef = useResizeObserver(\n\t\t\t( [ { contentRect } ] ) => {\n\t\t\t\tsetContainerWidth( contentRect.width );\n\t\t\t}\n\t\t);\n\t\tconst mergedRootRef = useMergeRefs( [\n\t\t\tsetContainer,\n\t\t\tresizeObserverRef,\n\t\t\tref,\n\t\t] );\n\n\t\t// Measure synchronously before paint and snapshot the computed\n\t\t// `column-gap` so the placement math tracks the design-system\n\t\t// token under any density.\n\t\tuseLayoutEffect( () => {\n\t\t\tif ( ! container ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { width } = container.getBoundingClientRect();\n\t\t\tif ( width > 0 ) {\n\t\t\t\tsetContainerWidth( width );\n\t\t\t}\n\t\t\tconst parsed = Number.parseFloat(\n\t\t\t\twindow.getComputedStyle( container ).columnGap\n\t\t\t);\n\t\t\tif ( Number.isFinite( parsed ) && parsed > 0 ) {\n\t\t\t\tsetGapPx( parsed );\n\t\t\t}\n\t\t}, [ container ] );\n\t\tconst effectiveColumns = useMemo(\n\t\t\t() =>\n\t\t\t\tresolveColumnCount(\n\t\t\t\t\t{ columns, minColumnWidth },\n\t\t\t\t\tcontainerWidth,\n\t\t\t\t\tgapPx,\n\t\t\t\t\tDEFAULT_COLUMNS\n\t\t\t\t),\n\t\t\t[ minColumnWidth, gapPx, containerWidth, columns ]\n\t\t);\n\t\tconst columnWidth =\n\t\t\t( containerWidth - ( effectiveColumns - 1 ) * gapPx ) /\n\t\t\teffectiveColumns;\n\t\tconst minResizeWidthPx = gridSpanToPixelSize(\n\t\t\t1,\n\t\t\t1,\n\t\t\tcolumnWidth,\n\t\t\tgapPx,\n\t\t\tnull\n\t\t).widthPx;\n\n\t\t// Height limits do not apply: lane heights are content-driven.\n\t\tconst widthBoundsByKey = useSpanBounds(\n\t\t\titemLimits,\n\t\t\tcolumnWidth,\n\t\t\tgapPx,\n\t\t\tnull,\n\t\t\teffectiveColumns\n\t\t);\n\t\tconst resizeLimitsByKey = useResizePixelLimits(\n\t\t\twidthBoundsByKey,\n\t\t\tcolumnWidth,\n\t\t\tgapPx,\n\t\t\tnull\n\t\t);\n\n\t\tconst layoutMap = useMemo( () => {\n\t\t\tconst map = new Map< string, DashboardLanesLayoutItem >();\n\t\t\tactiveLayout.forEach( ( item ) => map.set( item.key, item ) );\n\t\t\treturn map;\n\t\t}, [ activeLayout ] );\n\n\t\t// Stable-identity key set for the children walk (see grid.tsx).\n\t\tconst layoutKeys = useMemo(\n\t\t\t() => new Set( layout.map( ( item ) => item.key ) ),\n\t\t\t[ layout ]\n\t\t);\n\n\t\t// Sorted item keys, identity-stable when the resulting sequence\n\t\t// is unchanged (avoids invalidating SortableContext).\n\t\tconst sortedItems = useMemo(\n\t\t\t() =>\n\t\t\t\tactiveLayout\n\t\t\t\t\t.map( ( item, index ) => ( { item, index } ) )\n\t\t\t\t\t.sort(\n\t\t\t\t\t\t( a, b ) =>\n\t\t\t\t\t\t\t( a.item.order ?? a.index ) -\n\t\t\t\t\t\t\t( b.item.order ?? b.index )\n\t\t\t\t\t)\n\t\t\t\t\t.map( ( { item } ) => item.key ),\n\t\t\t[ activeLayout ]\n\t\t);\n\t\tconst items = sortedItems;\n\n\t\t// Span each item renders at: the stored width clamped to the lane\n\t\t// count and to the item's width bounds. Placement, the resize\n\t\t// baseline, and the commit check all read it, so a gesture starts\n\t\t// from the span on screen and commits nothing until it leaves it.\n\t\tconst renderedSpanByKey = useMemo( () => {\n\t\t\tconst map = new Map< string, number >();\n\t\t\tfor ( const [ key, item ] of layoutMap ) {\n\t\t\t\tconst span =\n\t\t\t\t\ttypeof item.width === 'number'\n\t\t\t\t\t\t? Math.max(\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\tMath.min( item.width, effectiveColumns )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: 1;\n\t\t\t\tconst bounds = widthBoundsByKey.get( key );\n\t\t\t\tmap.set(\n\t\t\t\t\tkey,\n\t\t\t\t\tbounds\n\t\t\t\t\t\t? clampSpan( span, bounds.minWidth, bounds.maxWidth )\n\t\t\t\t\t\t: span\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn map;\n\t\t}, [ layoutMap, effectiveColumns, widthBoundsByKey ] );\n\n\t\t// Placement input for the hook: each item with its rendered span\n\t\t// in source (sorted) order. `lane` forwards the optional explicit\n\t\t// pin from the layout item; the algorithm clamps out-of-range\n\t\t// values, so no surface-level guard is needed.\n\t\tconst placementItems = useMemo( () => {\n\t\t\treturn items.map( ( key ) => ( {\n\t\t\t\tkey,\n\t\t\t\tspan: renderedSpanByKey.get( key ) ?? 1,\n\t\t\t\tlane: layoutMap.get( key )?.lane,\n\t\t\t} ) );\n\t\t}, [ items, layoutMap, renderedSpanByKey ] );\n\n\t\tconst { itemStyles } = useLanePlacement( container, {\n\t\t\titems: placementItems,\n\t\t\tlanes: effectiveColumns,\n\t\t\tgap: gapPx,\n\t\t\tflowTolerance,\n\t\t\trowUnit,\n\t\t} );\n\n\t\tconst [ childrenMap, actionableAreaMap, remaining, renderedByKey ] =\n\t\t\tuseMemo( () => {\n\t\t\t\tconst childMap = new Map< string, React.ReactElement >();\n\t\t\t\tconst actionableMap = new Map< string, React.ReactNode >();\n\t\t\t\tconst rest: React.ReactNode[] = [];\n\t\t\t\tconst byKey = new Map< string, React.ReactElement >();\n\n\t\t\t\tChildren.forEach( children, ( child ) => {\n\t\t\t\t\tif ( ! isValidElement( child ) ) {\n\t\t\t\t\t\trest.push( child );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst key = child.key?.toString();\n\t\t\t\t\tif ( ! key ) {\n\t\t\t\t\t\trest.push( child );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Strip `actionableArea` so it does not leak to the DOM;\n\t\t\t\t\t// the grid lifts it to a slot separately.\n\t\t\t\t\tconst { actionableArea } = child.props as {\n\t\t\t\t\t\tactionableArea?: React.ReactNode;\n\t\t\t\t\t};\n\t\t\t\t\tconst stripped =\n\t\t\t\t\t\tactionableArea !== undefined\n\t\t\t\t\t\t\t? cloneElement(\n\t\t\t\t\t\t\t\t\tchild as React.ReactElement< {\n\t\t\t\t\t\t\t\t\t\tactionableArea?: React.ReactNode;\n\t\t\t\t\t\t\t\t\t} >,\n\t\t\t\t\t\t\t\t\t{ actionableArea: undefined }\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: ( child as React.ReactElement );\n\n\t\t\t\t\tbyKey.set( key, stripped );\n\n\t\t\t\t\tif ( layoutKeys.has( key ) ) {\n\t\t\t\t\t\tif ( actionableArea !== undefined ) {\n\t\t\t\t\t\t\tactionableMap.set( key, actionableArea );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchildMap.set( key, stripped );\n\t\t\t\t\t} else {\n\t\t\t\t\t\trest.push( child );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\treturn [ childMap, actionableMap, rest, byKey ];\n\t\t\t}, [ children, layoutKeys ] );\n\n\t\t// Persist the latest rendered children so a removed tile's content\n\t\t// is still available for its exit overlay. Filled from an effect so a\n\t\t// discarded render never writes to the cache.\n\t\tuseLayoutEffect( () => {\n\t\t\tfor ( const [ key, child ] of renderedByKey ) {\n\t\t\t\tchildrenCacheRef.current.set( key, child );\n\t\t\t}\n\t\t}, [ renderedByKey ] );\n\n\t\tconst sensors = useSensors(\n\t\t\tuseSensor( PointerSensor ),\n\t\t\tuseSensor( KeyboardSensor, {\n\t\t\t\tcoordinateGetter: sortableKeyboardCoordinates,\n\t\t\t} )\n\t\t);\n\n\t\tconst handleDragStart = useEvent( ( event: DragStartEvent ) => {\n\t\t\tsetActiveId( String( event.active.id ) );\n\t\t\tlastReorderCursorRef.current = null;\n\t\t} );\n\n\t\tconst handleDragCancel = useEvent( () => {\n\t\t\tsetActiveId( null );\n\t\t\tlatestLayoutRef.current = undefined;\n\t\t\tlastReorderCursorRef.current = null;\n\t\t\tresizeBaselineRef.current = null;\n\t\t\tsetIsResizing( false );\n\t\t\tsetResizeSnapPreview( null );\n\t\t\tsetTemporaryLayout( undefined );\n\t\t} );\n\n\t\tconst handleDragMove = useEvent( ( event: DragMoveEvent ) => {\n\t\t\tconst { active, over } = event;\n\t\t\tif ( ! over || active.id === over.id ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst activeRect = active.rect.current.translated;\n\t\t\tif ( ! activeRect ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst activeCenterX = activeRect.left + activeRect.width / 2;\n\t\t\tconst activeCenterY = activeRect.top + activeRect.height / 2;\n\n\t\t\tconst lastCursor = lastReorderCursorRef.current;\n\t\t\tif ( lastCursor ) {\n\t\t\t\tconst dx = activeCenterX - lastCursor.x;\n\t\t\t\tconst dy = activeCenterY - lastCursor.y;\n\t\t\t\tif ( dx * dx + dy * dy < 100 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst overCenterX = over.rect.left + over.rect.width / 2;\n\t\t\tconst insertAfter = activeCenterX > overCenterX;\n\n\t\t\tconst currentIndex = items.indexOf( String( active.id ) );\n\t\t\tconst overIndex = items.indexOf( String( over.id ) );\n\t\t\tlet newIndex: number;\n\t\t\tif ( insertAfter ) {\n\t\t\t\tnewIndex = currentIndex > overIndex ? overIndex + 1 : overIndex;\n\t\t\t} else {\n\t\t\t\tnewIndex = currentIndex > overIndex ? overIndex : overIndex - 1;\n\t\t\t}\n\t\t\tnewIndex = Math.max( 0, Math.min( newIndex, items.length - 1 ) );\n\n\t\t\tif ( newIndex === currentIndex ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Non-draggable items are pinned: they hold their index while\n\t\t\t// the others reorder around them.\n\t\t\tconst updatedItems = arrayMoveWithPinned(\n\t\t\t\titems,\n\t\t\t\tcurrentIndex,\n\t\t\t\tnewIndex,\n\t\t\t\t( key ) => layoutMap.get( key )?.draggable === false\n\t\t\t);\n\t\t\tif (\n\t\t\t\tupdatedItems.every( ( key, index ) => key === items[ index ] )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Build a key→index lookup so the .map below is O(n)\n\t\t\t// instead of O(n²) from per-item `indexOf` calls.\n\t\t\tconst orderByKey = new Map< string, number >();\n\t\t\tupdatedItems.forEach( ( key, index ) => {\n\t\t\t\torderByKey.set( key, index );\n\t\t\t} );\n\t\t\tconst updatedLayout = activeLayout.map( ( item ) => ( {\n\t\t\t\t...item,\n\t\t\t\torder: orderByKey.get( item.key ) ?? 0,\n\t\t\t} ) );\n\n\t\t\tlastReorderCursorRef.current = {\n\t\t\t\tx: activeCenterX,\n\t\t\t\ty: activeCenterY,\n\t\t\t};\n\t\t\tlatestLayoutRef.current = updatedLayout;\n\t\t\tcaptureLayoutSnapshotRef.current();\n\t\t\tsetTemporaryLayout( updatedLayout );\n\t\t\tonPreviewLayout?.( updatedLayout );\n\t\t} );\n\n\t\tconst persistTemporaryLayout = useEvent( () => {\n\t\t\tconst latest = latestLayoutRef.current;\n\t\t\tlatestLayoutRef.current = undefined;\n\t\t\tresizeBaselineRef.current = null;\n\t\t\tsetIsResizing( false );\n\t\t\tsetResizeSnapPreview( null );\n\t\t\tif ( ! onChangeLayout || ! latest ) {\n\t\t\t\tsetTemporaryLayout( undefined );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonChangeLayout( latest );\n\t\t\tsetTemporaryLayout( undefined );\n\t\t} );\n\n\t\tconst handleResize = useEvent( ( id: string, delta: ResizeDelta ) => {\n\t\t\tif ( ! editMode ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( ! isResizing ) {\n\t\t\t\tsetIsResizing( true );\n\t\t\t}\n\n\t\t\tconst relativeDelta = Math.round(\n\t\t\t\tdelta.width / ( columnWidth + gapPx )\n\t\t\t);\n\n\t\t\tif ( resizeBaselineRef.current === null ) {\n\t\t\t\tresizeBaselineRef.current = renderedSpanByKey.get( id ) ?? 1;\n\t\t\t}\n\t\t\tconst baseline = resizeBaselineRef.current;\n\t\t\tconst bounds = widthBoundsByKey.get( id );\n\t\t\tconst newWidth = clampSpan(\n\t\t\t\tbaseline + relativeDelta,\n\t\t\t\tbounds?.minWidth ?? 1,\n\t\t\t\tbounds?.maxWidth ?? effectiveColumns\n\t\t\t);\n\n\t\t\tsetResizeSnapPreview( {\n\t\t\t\tid,\n\t\t\t\tsnap: gridSpanToPixelSize(\n\t\t\t\t\tnewWidth,\n\t\t\t\t\t1,\n\t\t\t\t\tcolumnWidth,\n\t\t\t\t\tgapPx,\n\t\t\t\t\tnull\n\t\t\t\t),\n\t\t\t} );\n\n\t\t\t// Bail when the snap target matches the span staged for commit,\n\t\t\t// or the rendered span while nothing is staged.\n\t\t\tconst pendingItem = latestLayoutRef.current?.find(\n\t\t\t\t( item ) => item.key === id\n\t\t\t);\n\t\t\tconst currentWidth =\n\t\t\t\tpendingItem?.width ?? renderedSpanByKey.get( id );\n\t\t\tif ( currentWidth === newWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst updatedLayout = activeLayout.map( ( item ) =>\n\t\t\t\titem.key === id ? { ...item, width: newWidth } : item\n\t\t\t);\n\n\t\t\tlatestLayoutRef.current = updatedLayout;\n\t\t\tcaptureLayoutSnapshotRef.current();\n\t\t\tsetTemporaryLayout( updatedLayout );\n\t\t\tonPreviewLayout?.( updatedLayout );\n\t\t} );\n\n\t\tconst interacting = activeId !== null || isResizing;\n\n\t\t// Drag-overlay clone composition: the surface always wraps with a\n\t\t// thin functional frame (lift, cursor, pointer pass-through). When\n\t\t// `renderDragPreview` is supplied, the consumer's wrapper sits\n\t\t// inside the frame around the cloned children; otherwise the\n\t\t// cloned children render directly so any persistent chrome on\n\t\t// them carries through unchanged.\n\t\tconst activeClone = activeId ? childrenMap.get( activeId ) : null;\n\t\tconst DragPreview = renderDragPreview;\n\t\tconst dragOverlayContent =\n\t\t\tactiveId && activeClone ? (\n\t\t\t\t<div className={ styles[ 'drag-preview-frame' ] }>\n\t\t\t\t\t<div className={ styles[ 'drag-preview-frame__lift' ] }>\n\t\t\t\t\t\t{ DragPreview ? (\n\t\t\t\t\t\t\t<DragPreview itemId={ activeId }>\n\t\t\t\t\t\t\t\t{ activeClone }\n\t\t\t\t\t\t\t</DragPreview>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tactiveClone\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : null;\n\n\t\t// Edit-mode background. Lanes are content-driven vertically, so\n\t\t// the overlay mirrors columns only. Rendered unconditionally so\n\t\t// it can cross-fade on edit-mode toggles (`isActive` drives the\n\t\t// transition); memoized so drag/resize re-renders skip it.\n\t\tconst Overlay = renderGridOverlay ?? GridOverlay;\n\t\tconst gridOverlay = useMemo(\n\t\t\t() => (\n\t\t\t\t<Overlay columns={ effectiveColumns } isActive={ editMode } />\n\t\t\t),\n\t\t\t[ Overlay, editMode, effectiveColumns ]\n\t\t);\n\n\t\tconst layoutFingerprint = useMemo( () => {\n\t\t\tconst layoutSig = getLayoutFingerprint( activeLayout );\n\t\t\tconst placementSig = getPlacementFingerprint( itemStyles );\n\t\t\treturn `${ layoutSig }\\0${ placementSig }`;\n\t\t}, [ activeLayout, itemStyles ] );\n\t\tconst excludeLayoutAnimationKey =\n\t\t\tactiveId ?? ( isResizing ? resizeSnapPreview?.id : null );\n\t\tconst { captureLayoutSnapshot, getPositionsBeforeLastChange } =\n\t\t\tuseLayoutShiftAnimation( {\n\t\t\t\tcontainer,\n\t\t\t\tenabled: editMode,\n\t\t\t\tlayoutFingerprint,\n\t\t\t\texcludeItemKey: excludeLayoutAnimationKey,\n\t\t\t} );\n\t\tconst { exitingItems, clearExitingItem } = useItemExitAnimation( {\n\t\t\tcontainer,\n\t\t\tenabled: editMode,\n\t\t\tlayoutKeys,\n\t\t\tgetPositionsBeforeLastChange,\n\t\t\tchildrenCacheRef,\n\t\t} );\n\t\tconst layoutAnimating = editMode;\n\t\tuseLayoutEffect( () => {\n\t\t\tcaptureLayoutSnapshotRef.current = captureLayoutSnapshot;\n\t\t}, [ captureLayoutSnapshot ] );\n\n\t\treturn (\n\t\t\t<DndContext\n\t\t\t\tsensors={ sensors }\n\t\t\t\tonDragStart={ handleDragStart }\n\t\t\t\tonDragCancel={ handleDragCancel }\n\t\t\t\tonDragMove={ handleDragMove }\n\t\t\t\tonDragEnd={ () => {\n\t\t\t\t\tpersistTemporaryLayout();\n\t\t\t\t\tlastReorderCursorRef.current = null;\n\t\t\t\t\tsetActiveId( null );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<SortableContext items={ items } strategy={ NO_SORT_STRATEGY }>\n\t\t\t\t\t<div\n\t\t\t\t\t\t{ ...divProps }\n\t\t\t\t\t\tref={ mergedRootRef }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tstyles.lanes,\n\t\t\t\t\t\t\tlayoutAnimating &&\n\t\t\t\t\t\t\t\tlayoutAnimationStyles[ 'layout-animating' ],\n\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tdata-wp-grid-dragging={ activeId || undefined }\n\t\t\t\t\t\tdata-wp-grid-resizing={ isResizing || undefined }\n\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\t\tgridTemplateColumns: `repeat(${ effectiveColumns }, minmax(0, 1fr))`,\n\t\t\t\t\t\t\t\t// `column-gap` and `row-gap` are set in\n\t\t\t\t\t\t\t\t// `lanes.module.scss` from the\n\t\t\t\t\t\t\t\t// design-system gap token, with an\n\t\t\t\t\t\t\t\t// `@supports` block that zeroes `row-gap`\n\t\t\t\t\t\t\t\t// in polyfill mode (the skyline already\n\t\t\t\t\t\t\t\t// encodes vertical spacing in each tile's\n\t\t\t\t\t\t\t\t// `top`). Driving the toggle from CSS\n\t\t\t\t\t\t\t\t// keeps SSR and client output identical\n\t\t\t\t\t\t\t\t// regardless of native support.\n\t\t\t\t\t\t\t\t'--wp-grid-lane-row-unit': `${ Math.max(\n\t\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t\trowUnit\n\t\t\t\t\t\t\t\t) }px`,\n\t\t\t\t\t\t\t} as React.CSSProperties\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ gridOverlay }\n\t\t\t\t\t\t{ items.map( ( id ) => {\n\t\t\t\t\t\t\tconst child = childrenMap.get( id );\n\t\t\t\t\t\t\tif ( ! child ) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst limitsPx = resizeLimitsByKey.get( id );\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<LanesItem\n\t\t\t\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\t\t\t\titemKey={ id }\n\t\t\t\t\t\t\t\t\tplacementStyle={\n\t\t\t\t\t\t\t\t\t\titemStyles.get( id ) ?? {}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdisabled={ ! editMode }\n\t\t\t\t\t\t\t\t\tdraggable={\n\t\t\t\t\t\t\t\t\t\tlayoutMap.get( id )?.draggable !== false\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tresizable={\n\t\t\t\t\t\t\t\t\t\tlayoutMap.get( id )?.resizable !== false\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tinteracting={ interacting }\n\t\t\t\t\t\t\t\t\tdragging={ activeId !== null }\n\t\t\t\t\t\t\t\t\tonResize={ handleResize }\n\t\t\t\t\t\t\t\t\tonResizeEnd={ persistTemporaryLayout }\n\t\t\t\t\t\t\t\t\tresizeSnapPreview={\n\t\t\t\t\t\t\t\t\t\tresizeSnapPreview?.id === id\n\t\t\t\t\t\t\t\t\t\t\t? resizeSnapPreview.snap\n\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tminResizeWidthPx={\n\t\t\t\t\t\t\t\t\t\tlimitsPx?.minWidthPx ?? minResizeWidthPx\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmaxResizeWidthPx={ limitsPx?.maxWidthPx }\n\t\t\t\t\t\t\t\t\tactionableArea={ actionableAreaMap.get(\n\t\t\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\trenderResizeHandle={ renderResizeHandle }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ child }\n\t\t\t\t\t\t\t\t</LanesItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t{ remaining }\n\t\t\t\t\t\t{ exitingItems.map( ( { key, rect, child } ) => (\n\t\t\t\t\t\t\t<ItemExitOverlay\n\t\t\t\t\t\t\t\tkey={ `exiting-${ key }` }\n\t\t\t\t\t\t\t\titemKey={ key }\n\t\t\t\t\t\t\t\trect={ rect }\n\t\t\t\t\t\t\t\tonAnimationEnd={ () => clearExitingItem( key ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ child }\n\t\t\t\t\t\t\t</ItemExitOverlay>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t</SortableContext>\n\t\t\t\t<DragOverlay dropAnimation={ dashboardDragDropAnimation }>\n\t\t\t\t\t{ dragOverlayContent }\n\t\t\t\t</DragOverlay>\n\t\t\t</DndContext>\n\t\t);\n\t}\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ,IAAI,IAAI;EAChB,gCAAgB,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAAS;CAG5B,OAAO,YAAY;AACpB;;;;;;;;;AAUA,SAAS,0BACR,gBACA,MACU;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AC;OAE1B,UAAW,CAAE;OACb,WACC,UAAU,IAAK,EAAG,CAAC,EAAE,cAAc;OAEpC,WACC,UAAU,IAAK,EAAG,CAAC,EAAE,cAAc;OAEtB;OACd,UAAW,aAAa;OACxB,UAAW;OACX,aAAc;OACd,mBACC,mBAAmB,OAAO,KACvB,kBAAkB,OAClB;OAEJ,kBACC,UAAU,cAAc;OAEzB,kBAAmB,UAAU;OAC7B,gBAAiB,kBAAkB,IAClC,EACD;OACqB;OAEnB,UAAA;MACQ,GA/BJ,EA+BI;KAEb,CAAE;KACA;KACA,aAAa,KAAO,EAAE,KAAK,MAAM,YAClC,iBAAA,GAAA,kBAAA,IAAA,CAACC,gCAAAA,iBAAD;MAEC,SAAU;MACH;MACP,sBAAuB,iBAAkB,GAAI;MAE3C,UAAA;KACc,GANV,WAAY,KAMF,CAChB;IACE;;EACW,CAAA,GACjB,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,aAAD;GAAa,eAAgB;GAC1B,UAAA;EACU,CAAA,CACF;;AAEd,CACD"}
|
|
@@ -1,110 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/grid/src/dashboard-lanes/lane-placement.ts
|
|
21
|
-
var lane_placement_exports = {};
|
|
22
|
-
__export(lane_placement_exports, {
|
|
23
|
-
computeLanePlacements: () => computeLanePlacements
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
24
5
|
});
|
|
25
|
-
|
|
6
|
+
// packages/grid/src/dashboard-lanes/lane-placement.ts
|
|
26
7
|
function clampSpan(span, lanes) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
return Math.max(1, Math.min(Math.floor(span), lanes));
|
|
8
|
+
if (!Number.isFinite(span)) return 1;
|
|
9
|
+
return Math.max(1, Math.min(Math.floor(span), lanes));
|
|
31
10
|
}
|
|
32
11
|
function clampLane(lane, span, lanes) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
return Math.max(0, Math.min(Math.floor(lane), lanes - span));
|
|
12
|
+
if (!Number.isFinite(lane)) return 0;
|
|
13
|
+
return Math.max(0, Math.min(Math.floor(lane), lanes - span));
|
|
37
14
|
}
|
|
38
15
|
function maxBaselineAcross(laneBottoms, startLane, span) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
maxBaseline = laneBottoms[i];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return maxBaseline;
|
|
16
|
+
let maxBaseline = 0;
|
|
17
|
+
for (let i = startLane; i < startLane + span; i++) if (laneBottoms[i] > maxBaseline) maxBaseline = laneBottoms[i];
|
|
18
|
+
return maxBaseline;
|
|
46
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Places all items into a fixed lane count using the grid-lanes
|
|
22
|
+
* algorithm: explicit items first, then auto items chosen by the
|
|
23
|
+
* shortest-lane skyline with a tolerance for source order.
|
|
24
|
+
*
|
|
25
|
+
* Pure: no DOM access, no mutation of inputs. Safe to call from a
|
|
26
|
+
* worker or during SSR.
|
|
27
|
+
*
|
|
28
|
+
* @param input Items, lane count, gap, and tolerance.
|
|
29
|
+
* @return Per-key placements plus the resulting total height.
|
|
30
|
+
*/
|
|
47
31
|
function computeLanePlacements(input) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (bottom > totalHeight) {
|
|
101
|
-
totalHeight = bottom;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return { placements, totalHeight };
|
|
32
|
+
const lanes = Math.max(1, Math.floor(input.lanes));
|
|
33
|
+
const gap = Math.max(0, input.gap);
|
|
34
|
+
const tolerance = Math.max(0, input.flowTolerance);
|
|
35
|
+
const laneBottoms = new Array(lanes).fill(0);
|
|
36
|
+
const placements = /* @__PURE__ */ new Map();
|
|
37
|
+
const explicitItems = [];
|
|
38
|
+
const autoItems = [];
|
|
39
|
+
for (const item of input.items) if (item.lane !== void 0) explicitItems.push(item);
|
|
40
|
+
else autoItems.push(item);
|
|
41
|
+
for (const item of explicitItems) {
|
|
42
|
+
const span = clampSpan(item.span, lanes);
|
|
43
|
+
const lane = clampLane(item.lane, span, lanes);
|
|
44
|
+
const baseline = maxBaselineAcross(laneBottoms, lane, span);
|
|
45
|
+
const top = baseline === 0 ? 0 : baseline + gap;
|
|
46
|
+
const height = Math.max(0, item.height);
|
|
47
|
+
placements.set(item.key, {
|
|
48
|
+
key: item.key,
|
|
49
|
+
lane,
|
|
50
|
+
top,
|
|
51
|
+
span
|
|
52
|
+
});
|
|
53
|
+
const newBottom = top + height;
|
|
54
|
+
for (let i = lane; i < lane + span; i++) laneBottoms[i] = newBottom;
|
|
55
|
+
}
|
|
56
|
+
for (const item of autoItems) {
|
|
57
|
+
const span = clampSpan(item.span, lanes);
|
|
58
|
+
let bestLane = 0;
|
|
59
|
+
let bestBaseline = Infinity;
|
|
60
|
+
for (let candidate = 0; candidate <= lanes - span; candidate++) {
|
|
61
|
+
const baseline = maxBaselineAcross(laneBottoms, candidate, span);
|
|
62
|
+
if (bestBaseline - baseline > tolerance) {
|
|
63
|
+
bestBaseline = baseline;
|
|
64
|
+
bestLane = candidate;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const top = bestBaseline === 0 ? 0 : bestBaseline + gap;
|
|
68
|
+
const height = Math.max(0, item.height);
|
|
69
|
+
placements.set(item.key, {
|
|
70
|
+
key: item.key,
|
|
71
|
+
lane: bestLane,
|
|
72
|
+
top,
|
|
73
|
+
span
|
|
74
|
+
});
|
|
75
|
+
const newBottom = top + height;
|
|
76
|
+
for (let i = bestLane; i < bestLane + span; i++) laneBottoms[i] = newBottom;
|
|
77
|
+
}
|
|
78
|
+
let totalHeight = 0;
|
|
79
|
+
for (const bottom of laneBottoms) if (bottom > totalHeight) totalHeight = bottom;
|
|
80
|
+
return {
|
|
81
|
+
placements,
|
|
82
|
+
totalHeight
|
|
83
|
+
};
|
|
105
84
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
//# sourceMappingURL=lane-placement.cjs.map
|
|
85
|
+
exports.computeLanePlacements = computeLanePlacements;
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=lane-placement.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/dashboard-lanes/lane-placement.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Lane placement algorithm for `display: grid-lanes` polyfill.\n *\n * Implements the source-ordered, shortest-lane placement described in\n * https://webkit.org/blog/17660/introducing-css-grid-lanes/.\n *\n * The skyline + tolerance core is adapted from the CSS Grid Lanes\n * Polyfill by Simon Willison (MIT,\n * https://tools.simonwillison.net/grid-lanes-polyfill.js). The rest\n * of this module is a pure function suitable for unit testing in\n * isolation from any DOM.\n *\n * Concepts:\n * - \"Lane\" is the cross-axis track: a column in waterfall mode, a row\n * in brick mode. The algorithm is axis-agnostic; the renderer maps\n * the chosen lane index plus offset to `grid-column-start` /\n * `grid-row-start` (or vice versa).\n * - Items are placed in source order. Explicit-lane items are placed\n * first so auto-placed items can flow around them.\n * - `flowTolerance` is a length: when two candidate lanes differ in\n * baseline by no more than this, the earlier lane wins (preserves\n * reading order).\n */\n\n/**\n * A single item to place. Heights are pre-measured by the caller.\n */\nexport type LanePlacementItem = {\n\t/**\n\t * Stable identity. Returned in the result map.\n\t */\n\tkey: string;\n\n\t/**\n\t * Number of contiguous lanes this item occupies. Clamped to\n\t * `[ 1, lanes ]` by the algorithm.\n\t */\n\tspan: number;\n\n\t/**\n\t * Measured cross-axis size (typically pixels). The algorithm only\n\t * adds and compares heights; the unit is whatever the caller uses,\n\t * as long as `gap` and `flowTolerance` use the same one.\n\t */\n\theight: number;\n\n\t/**\n\t * Explicit 0-indexed starting lane. When set, the item bypasses\n\t * the skyline lookup and is placed at this lane regardless of\n\t * source order. Out-of-range values are clamped.\n\t */\n\tlane?: number;\n};\n\n/**\n * Algorithm input.\n */\nexport type LanePlacementInput = {\n\t/**\n\t * Items in source order.\n\t */\n\titems: ReadonlyArray< LanePlacementItem >;\n\n\t/**\n\t * Total number of lanes. Clamped to `>= 1`.\n\t */\n\tlanes: number;\n\n\t/**\n\t * Gap between items in the same lane. Same unit as `height`.\n\t */\n\tgap: number;\n\n\t/**\n\t * Tolerance for source-order tiebreaking. When two candidate\n\t * lanes have baselines within this amount, the earlier lane wins.\n\t * Defaults to `0` if a negative value is passed.\n\t */\n\tflowTolerance: number;\n};\n\n/**\n * Resolved position for a single item.\n */\nexport type LanePlacement = {\n\t/**\n\t * Mirrors the input key.\n\t */\n\tkey: string;\n\n\t/**\n\t * 0-indexed starting lane. The renderer adds 1 for\n\t * `grid-column-start`.\n\t */\n\tlane: number;\n\n\t/**\n\t * Cross-axis offset from the container's start edge, in the same\n\t * unit as the input heights. Use as the item's start position\n\t * (e.g. `top`, or `grid-row-start` after dividing by a row unit).\n\t */\n\ttop: number;\n\n\t/**\n\t * Effective span after clamping. Useful for the renderer when the\n\t * input span exceeded the lane count.\n\t */\n\tspan: number;\n};\n\n/**\n * Algorithm output.\n */\nexport type LanePlacementResult = {\n\t/**\n\t * Per-key placement. Insertion-ordered: the first iteration yields\n\t * the explicit items in source order, then the auto items in\n\t * source order.\n\t */\n\tplacements: Map< string, LanePlacement >;\n\n\t/**\n\t * Sum of the tallest lane after all items are placed. The renderer\n\t * applies this as the container's intrinsic height.\n\t */\n\ttotalHeight: number;\n};\n\nfunction clampSpan( span: number, lanes: number ): number {\n\tif ( ! Number.isFinite( span ) ) {\n\t\treturn 1;\n\t}\n\treturn Math.max( 1, Math.min( Math.floor( span ), lanes ) );\n}\n\nfunction clampLane( lane: number, span: number, lanes: number ): number {\n\tif ( ! Number.isFinite( lane ) ) {\n\t\treturn 0;\n\t}\n\treturn Math.max( 0, Math.min( Math.floor( lane ), lanes - span ) );\n}\n\nfunction maxBaselineAcross(\n\tlaneBottoms: ReadonlyArray< number >,\n\tstartLane: number,\n\tspan: number\n): number {\n\tlet maxBaseline = 0;\n\tfor ( let i = startLane; i < startLane + span; i++ ) {\n\t\tif ( laneBottoms[ i ] > maxBaseline ) {\n\t\t\tmaxBaseline = laneBottoms[ i ];\n\t\t}\n\t}\n\treturn maxBaseline;\n}\n\n/**\n * Places all items into a fixed lane count using the grid-lanes\n * algorithm: explicit items first, then auto items chosen by the\n * shortest-lane skyline with a tolerance for source order.\n *\n * Pure: no DOM access, no mutation of inputs. Safe to call from a\n * worker or during SSR.\n *\n * @param input Items, lane count, gap, and tolerance.\n * @return Per-key placements plus the resulting total height.\n */\nexport function computeLanePlacements(\n\tinput: LanePlacementInput\n): LanePlacementResult {\n\tconst lanes = Math.max( 1, Math.floor( input.lanes ) );\n\tconst gap = Math.max( 0, input.gap );\n\tconst tolerance = Math.max( 0, input.flowTolerance );\n\n\tconst laneBottoms = new Array< number >( lanes ).fill( 0 );\n\tconst placements = new Map< string, LanePlacement >();\n\n\tconst explicitItems: LanePlacementItem[] = [];\n\tconst autoItems: LanePlacementItem[] = [];\n\tfor ( const item of input.items ) {\n\t\tif ( item.lane !== undefined ) {\n\t\t\texplicitItems.push( item );\n\t\t} else {\n\t\t\tautoItems.push( item );\n\t\t}\n\t}\n\n\tfor ( const item of explicitItems ) {\n\t\tconst span = clampSpan( item.span, lanes );\n\t\tconst lane = clampLane( item.lane as number, span, lanes );\n\t\tconst baseline = maxBaselineAcross( laneBottoms, lane, span );\n\t\tconst top = baseline === 0 ? 0 : baseline + gap;\n\t\tconst height = Math.max( 0, item.height );\n\n\t\tplacements.set( item.key, { key: item.key, lane, top, span } );\n\n\t\tconst newBottom = top + height;\n\t\tfor ( let i = lane; i < lane + span; i++ ) {\n\t\t\tlaneBottoms[ i ] = newBottom;\n\t\t}\n\t}\n\n\tfor ( const item of autoItems ) {\n\t\tconst span = clampSpan( item.span, lanes );\n\t\tlet bestLane = 0;\n\t\tlet bestBaseline = Infinity;\n\n\t\tfor ( let candidate = 0; candidate <= lanes - span; candidate++ ) {\n\t\t\tconst baseline = maxBaselineAcross( laneBottoms, candidate, span );\n\n\t\t\t// Only take a lane that is strictly shorter beyond\n\t\t\t// tolerance. Within-tolerance ties keep the earlier lane\n\t\t\t// because candidates iterate in lane order, so the first\n\t\t\t// acceptable baseline wins.\n\t\t\tif ( bestBaseline - baseline > tolerance ) {\n\t\t\t\tbestBaseline = baseline;\n\t\t\t\tbestLane = candidate;\n\t\t\t}\n\t\t}\n\n\t\tconst top = bestBaseline === 0 ? 0 : bestBaseline + gap;\n\t\tconst height = Math.max( 0, item.height );\n\n\t\tplacements.set( item.key, {\n\t\t\tkey: item.key,\n\t\t\tlane: bestLane,\n\t\t\ttop,\n\t\t\tspan,\n\t\t} );\n\n\t\tconst newBottom = top + height;\n\t\tfor ( let i = bestLane; i < bestLane + span; i++ ) {\n\t\t\tlaneBottoms[ i ] = newBottom;\n\t\t}\n\t}\n\n\tlet totalHeight = 0;\n\tfor ( const bottom of laneBottoms ) {\n\t\tif ( bottom > totalHeight ) {\n\t\t\ttotalHeight = bottom;\n\t\t}\n\t}\n\n\treturn { placements, totalHeight };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgIA,SAAS,UAAW,MAAc,OAAwB;AACzD,MAAK,CAAE,OAAO,SAAU,IAAK,GAAI;AAChC,WAAO;AAAA,EACR;AACA,SAAO,KAAK,IAAK,GAAG,KAAK,IAAK,KAAK,MAAO,IAAK,GAAG,KAAM,CAAE;AAC3D;AAEA,SAAS,UAAW,MAAc,MAAc,OAAwB;AACvE,MAAK,CAAE,OAAO,SAAU,IAAK,GAAI;AAChC,WAAO;AAAA,EACR;AACA,SAAO,KAAK,IAAK,GAAG,KAAK,IAAK,KAAK,MAAO,IAAK,GAAG,QAAQ,IAAK,CAAE;AAClE;AAEA,SAAS,kBACR,aACA,WACA,MACS;AACT,MAAI,cAAc;AAClB,WAAU,IAAI,WAAW,IAAI,YAAY,MAAM,KAAM;AACpD,QAAK,YAAa,CAAE,IAAI,aAAc;AACrC,oBAAc,YAAa,C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ACf,mBAAW;AAAA,MACZ;AAAA,IACD;AAEA,UAAM,MAAM,iBAAiB,IAAI,IAAI,eAAe;AACpD,UAAM,SAAS,KAAK,IAAK,GAAG,KAAK,MAAO;AAExC,eAAW,IAAK,KAAK,KAAK;AAAA,MACzB,KAAK,KAAK;AAAA,MACV,MAAM;AAAA,MACN;AAAA,MACA;AAAA,IACD,CAAE;AAEF,UAAM,YAAY,MAAM;AACxB,aAAU,IAAI,UAAU,IAAI,WAAW,MAAM,KAAM;AAClD,kBAAa,CAAE,IAAI;AAAA,IACpB;AAAA,EACD;AAEA,MAAI,cAAc;AAClB,aAAY,UAAU,aAAc;AACnC,QAAK,SAAS,aAAc;AAC3B,oBAAc;AAAA,IACf;AAAA,EACD;AAEA,SAAO,EAAE,YAAY,YAAY;AAClC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"lane-placement.cjs","names":[],"sources":["../../src/dashboard-lanes/lane-placement.ts"],"sourcesContent":["/**\n * Lane placement algorithm for `display: grid-lanes` polyfill.\n *\n * Implements the source-ordered, shortest-lane placement described in\n * https://webkit.org/blog/17660/introducing-css-grid-lanes/.\n *\n * The skyline + tolerance core is adapted from the CSS Grid Lanes\n * Polyfill by Simon Willison (MIT,\n * https://tools.simonwillison.net/grid-lanes-polyfill.js). The rest\n * of this module is a pure function suitable for unit testing in\n * isolation from any DOM.\n *\n * Concepts:\n * - \"Lane\" is the cross-axis track: a column in waterfall mode, a row\n * in brick mode. The algorithm is axis-agnostic; the renderer maps\n * the chosen lane index plus offset to `grid-column-start` /\n * `grid-row-start` (or vice versa).\n * - Items are placed in source order. Explicit-lane items are placed\n * first so auto-placed items can flow around them.\n * - `flowTolerance` is a length: when two candidate lanes differ in\n * baseline by no more than this, the earlier lane wins (preserves\n * reading order).\n */\n\n/**\n * A single item to place. Heights are pre-measured by the caller.\n */\nexport type LanePlacementItem = {\n\t/**\n\t * Stable identity. Returned in the result map.\n\t */\n\tkey: string;\n\n\t/**\n\t * Number of contiguous lanes this item occupies. Clamped to\n\t * `[ 1, lanes ]` by the algorithm.\n\t */\n\tspan: number;\n\n\t/**\n\t * Measured cross-axis size (typically pixels). The algorithm only\n\t * adds and compares heights; the unit is whatever the caller uses,\n\t * as long as `gap` and `flowTolerance` use the same one.\n\t */\n\theight: number;\n\n\t/**\n\t * Explicit 0-indexed starting lane. When set, the item bypasses\n\t * the skyline lookup and is placed at this lane regardless of\n\t * source order. Out-of-range values are clamped.\n\t */\n\tlane?: number;\n};\n\n/**\n * Algorithm input.\n */\nexport type LanePlacementInput = {\n\t/**\n\t * Items in source order.\n\t */\n\titems: ReadonlyArray< LanePlacementItem >;\n\n\t/**\n\t * Total number of lanes. Clamped to `>= 1`.\n\t */\n\tlanes: number;\n\n\t/**\n\t * Gap between items in the same lane. Same unit as `height`.\n\t */\n\tgap: number;\n\n\t/**\n\t * Tolerance for source-order tiebreaking. When two candidate\n\t * lanes have baselines within this amount, the earlier lane wins.\n\t * Defaults to `0` if a negative value is passed.\n\t */\n\tflowTolerance: number;\n};\n\n/**\n * Resolved position for a single item.\n */\nexport type LanePlacement = {\n\t/**\n\t * Mirrors the input key.\n\t */\n\tkey: string;\n\n\t/**\n\t * 0-indexed starting lane. The renderer adds 1 for\n\t * `grid-column-start`.\n\t */\n\tlane: number;\n\n\t/**\n\t * Cross-axis offset from the container's start edge, in the same\n\t * unit as the input heights. Use as the item's start position\n\t * (e.g. `top`, or `grid-row-start` after dividing by a row unit).\n\t */\n\ttop: number;\n\n\t/**\n\t * Effective span after clamping. Useful for the renderer when the\n\t * input span exceeded the lane count.\n\t */\n\tspan: number;\n};\n\n/**\n * Algorithm output.\n */\nexport type LanePlacementResult = {\n\t/**\n\t * Per-key placement. Insertion-ordered: the first iteration yields\n\t * the explicit items in source order, then the auto items in\n\t * source order.\n\t */\n\tplacements: Map< string, LanePlacement >;\n\n\t/**\n\t * Sum of the tallest lane after all items are placed. The renderer\n\t * applies this as the container's intrinsic height.\n\t */\n\ttotalHeight: number;\n};\n\nfunction clampSpan( span: number, lanes: number ): number {\n\tif ( ! Number.isFinite( span ) ) {\n\t\treturn 1;\n\t}\n\treturn Math.max( 1, Math.min( Math.floor( span ), lanes ) );\n}\n\nfunction clampLane( lane: number, span: number, lanes: number ): number {\n\tif ( ! Number.isFinite( lane ) ) {\n\t\treturn 0;\n\t}\n\treturn Math.max( 0, Math.min( Math.floor( lane ), lanes - span ) );\n}\n\nfunction maxBaselineAcross(\n\tlaneBottoms: ReadonlyArray< number >,\n\tstartLane: number,\n\tspan: number\n): number {\n\tlet maxBaseline = 0;\n\tfor ( let i = startLane; i < startLane + span; i++ ) {\n\t\tif ( laneBottoms[ i ] > maxBaseline ) {\n\t\t\tmaxBaseline = laneBottoms[ i ];\n\t\t}\n\t}\n\treturn maxBaseline;\n}\n\n/**\n * Places all items into a fixed lane count using the grid-lanes\n * algorithm: explicit items first, then auto items chosen by the\n * shortest-lane skyline with a tolerance for source order.\n *\n * Pure: no DOM access, no mutation of inputs. Safe to call from a\n * worker or during SSR.\n *\n * @param input Items, lane count, gap, and tolerance.\n * @return Per-key placements plus the resulting total height.\n */\nexport function computeLanePlacements(\n\tinput: LanePlacementInput\n): LanePlacementResult {\n\tconst lanes = Math.max( 1, Math.floor( input.lanes ) );\n\tconst gap = Math.max( 0, input.gap );\n\tconst tolerance = Math.max( 0, input.flowTolerance );\n\n\tconst laneBottoms = new Array< number >( lanes ).fill( 0 );\n\tconst placements = new Map< string, LanePlacement >();\n\n\tconst explicitItems: LanePlacementItem[] = [];\n\tconst autoItems: LanePlacementItem[] = [];\n\tfor ( const item of input.items ) {\n\t\tif ( item.lane !== undefined ) {\n\t\t\texplicitItems.push( item );\n\t\t} else {\n\t\t\tautoItems.push( item );\n\t\t}\n\t}\n\n\tfor ( const item of explicitItems ) {\n\t\tconst span = clampSpan( item.span, lanes );\n\t\tconst lane = clampLane( item.lane as number, span, lanes );\n\t\tconst baseline = maxBaselineAcross( laneBottoms, lane, span );\n\t\tconst top = baseline === 0 ? 0 : baseline + gap;\n\t\tconst height = Math.max( 0, item.height );\n\n\t\tplacements.set( item.key, { key: item.key, lane, top, span } );\n\n\t\tconst newBottom = top + height;\n\t\tfor ( let i = lane; i < lane + span; i++ ) {\n\t\t\tlaneBottoms[ i ] = newBottom;\n\t\t}\n\t}\n\n\tfor ( const item of autoItems ) {\n\t\tconst span = clampSpan( item.span, lanes );\n\t\tlet bestLane = 0;\n\t\tlet bestBaseline = Infinity;\n\n\t\tfor ( let candidate = 0; candidate <= lanes - span; candidate++ ) {\n\t\t\tconst baseline = maxBaselineAcross( laneBottoms, candidate, span );\n\n\t\t\t// Only take a lane that is strictly shorter beyond\n\t\t\t// tolerance. Within-tolerance ties keep the earlier lane\n\t\t\t// because candidates iterate in lane order, so the first\n\t\t\t// acceptable baseline wins.\n\t\t\tif ( bestBaseline - baseline > tolerance ) {\n\t\t\t\tbestBaseline = baseline;\n\t\t\t\tbestLane = candidate;\n\t\t\t}\n\t\t}\n\n\t\tconst top = bestBaseline === 0 ? 0 : bestBaseline + gap;\n\t\tconst height = Math.max( 0, item.height );\n\n\t\tplacements.set( item.key, {\n\t\t\tkey: item.key,\n\t\t\tlane: bestLane,\n\t\t\ttop,\n\t\t\tspan,\n\t\t} );\n\n\t\tconst newBottom = top + height;\n\t\tfor ( let i = bestLane; i < bestLane + span; i++ ) {\n\t\t\tlaneBottoms[ i ] = newBottom;\n\t\t}\n\t}\n\n\tlet totalHeight = 0;\n\tfor ( const bottom of laneBottoms ) {\n\t\tif ( bottom > totalHeight ) {\n\t\t\ttotalHeight = bottom;\n\t\t}\n\t}\n\n\treturn { placements, totalHeight };\n}\n"],"mappings":";;;;;;AAgIA,SAAS,UAAW,MAAc,OAAwB;CACzD,IAAK,CAAE,OAAO,SAAU,IAAK,GAC5B,OAAO;CAER,OAAO,KAAK,IAAK,GAAG,KAAK,IAAK,KAAK,MAAO,IAAK,GAAG,KAAM,CAAE;AAC3D;AAEA,SAAS,UAAW,MAAc,MAA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