@wordpress/grid 0.6.0 → 0.7.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +44 -1
  3. package/build/dashboard-grid/grid-item.cjs +21 -7
  4. package/build/dashboard-grid/grid-item.cjs.map +2 -2
  5. package/build/dashboard-grid/index.cjs +107 -45
  6. package/build/dashboard-grid/index.cjs.map +2 -2
  7. package/build/dashboard-grid/resolve-fill-widths.cjs +68 -50
  8. package/build/dashboard-grid/resolve-fill-widths.cjs.map +2 -2
  9. package/build/dashboard-grid/types.cjs.map +1 -1
  10. package/build/dashboard-lanes/index.cjs +59 -17
  11. package/build/dashboard-lanes/index.cjs.map +2 -2
  12. package/build/dashboard-lanes/lanes-item.cjs +14 -6
  13. package/build/dashboard-lanes/lanes-item.cjs.map +2 -2
  14. package/build/dashboard-lanes/types.cjs.map +1 -1
  15. package/build/index.cjs.map +1 -1
  16. package/build/shared/array-move-with-pinned.cjs +49 -0
  17. package/build/shared/array-move-with-pinned.cjs.map +7 -0
  18. package/build/shared/resize-snap.cjs +91 -5
  19. package/build/shared/resize-snap.cjs.map +2 -2
  20. package/build/shared/types.cjs.map +1 -1
  21. package/build/shared/use-span-bounds.cjs +85 -0
  22. package/build/shared/use-span-bounds.cjs.map +7 -0
  23. package/build-module/dashboard-grid/grid-item.mjs +21 -7
  24. package/build-module/dashboard-grid/grid-item.mjs.map +2 -2
  25. package/build-module/dashboard-grid/index.mjs +108 -47
  26. package/build-module/dashboard-grid/index.mjs.map +2 -2
  27. package/build-module/dashboard-grid/resolve-fill-widths.mjs +68 -50
  28. package/build-module/dashboard-grid/resolve-fill-widths.mjs.map +2 -2
  29. package/build-module/dashboard-lanes/index.mjs +60 -19
  30. package/build-module/dashboard-lanes/index.mjs.map +2 -2
  31. package/build-module/dashboard-lanes/lanes-item.mjs +14 -6
  32. package/build-module/dashboard-lanes/lanes-item.mjs.map +2 -2
  33. package/build-module/index.mjs.map +1 -1
  34. package/build-module/shared/array-move-with-pinned.mjs +24 -0
  35. package/build-module/shared/array-move-with-pinned.mjs.map +7 -0
  36. package/build-module/shared/resize-snap.mjs +87 -4
  37. package/build-module/shared/resize-snap.mjs.map +2 -2
  38. package/build-module/shared/use-span-bounds.mjs +62 -0
  39. package/build-module/shared/use-span-bounds.mjs.map +7 -0
  40. package/build-types/dashboard-grid/grid-item.d.ts +1 -1
  41. package/build-types/dashboard-grid/grid-item.d.ts.map +1 -1
  42. package/build-types/dashboard-grid/index.d.ts.map +1 -1
  43. package/build-types/dashboard-grid/resolve-fill-widths.d.ts +12 -1
  44. package/build-types/dashboard-grid/resolve-fill-widths.d.ts.map +1 -1
  45. package/build-types/dashboard-grid/types.d.ts +43 -1
  46. package/build-types/dashboard-grid/types.d.ts.map +1 -1
  47. package/build-types/dashboard-lanes/index.d.ts.map +1 -1
  48. package/build-types/dashboard-lanes/lanes-item.d.ts +18 -1
  49. package/build-types/dashboard-lanes/lanes-item.d.ts.map +1 -1
  50. package/build-types/dashboard-lanes/types.d.ts +20 -1
  51. package/build-types/dashboard-lanes/types.d.ts.map +1 -1
  52. package/build-types/index.d.ts +1 -1
  53. package/build-types/index.d.ts.map +1 -1
  54. package/build-types/shared/array-move-with-pinned.d.ts +13 -0
  55. package/build-types/shared/array-move-with-pinned.d.ts.map +1 -0
  56. package/build-types/shared/resize-snap.d.ts +65 -2
  57. package/build-types/shared/resize-snap.d.ts.map +1 -1
  58. package/build-types/shared/types.d.ts +31 -0
  59. package/build-types/shared/types.d.ts.map +1 -1
  60. package/build-types/shared/use-span-bounds.d.ts +29 -0
  61. package/build-types/shared/use-span-bounds.d.ts.map +1 -0
  62. package/package.json +11 -11
  63. package/src/dashboard-grid/grid-item.tsx +21 -7
  64. package/src/dashboard-grid/index.tsx +154 -57
  65. package/src/dashboard-grid/resolve-fill-widths.ts +85 -62
  66. package/src/dashboard-grid/stories/index.story.tsx +154 -0
  67. package/src/dashboard-grid/test/item-interactions.jsdom.test.tsx +64 -0
  68. package/src/dashboard-grid/test/item-limits.jsdom.test.tsx +147 -0
  69. package/src/dashboard-grid/test/{keyboard-activation.test.tsx → keyboard-activation.jsdom.test.tsx} +4 -3
  70. package/src/dashboard-grid/test/resolve-fill-widths.test.ts +159 -0
  71. package/src/dashboard-grid/types.ts +50 -0
  72. package/src/dashboard-lanes/index.tsx +86 -24
  73. package/src/dashboard-lanes/lanes-item.tsx +34 -6
  74. package/src/dashboard-lanes/stories/index.story.tsx +119 -0
  75. package/src/dashboard-lanes/test/item-interactions.jsdom.test.tsx +64 -0
  76. package/src/dashboard-lanes/test/item-limits.jsdom.test.tsx +140 -0
  77. package/src/dashboard-lanes/test/{keyboard-activation.test.tsx → keyboard-activation.jsdom.test.tsx} +4 -3
  78. package/src/dashboard-lanes/test/lane-placement.test.ts +1 -0
  79. package/src/dashboard-lanes/test/{use-lane-placement.test.tsx → use-lane-placement.jsdom.test.tsx} +11 -10
  80. package/src/dashboard-lanes/types.ts +23 -0
  81. package/src/index.ts +2 -0
  82. package/src/shared/array-move-with-pinned.ts +36 -0
  83. package/src/shared/resize-snap.ts +161 -5
  84. package/src/shared/test/array-move-with-pinned.test.ts +40 -0
  85. package/src/shared/test/resize-snap.test.ts +171 -2
  86. package/src/shared/test/use-span-bounds.jsdom.test.ts +105 -0
  87. package/src/shared/types.ts +35 -0
  88. package/src/shared/use-span-bounds.ts +99 -0
@@ -118,6 +118,8 @@ function LanesItem({
118
118
  itemKey,
119
119
  placementStyle,
120
120
  disabled = false,
121
+ draggable = true,
122
+ resizable = true,
121
123
  interacting = false,
122
124
  children,
123
125
  actionableArea = null,
@@ -125,6 +127,7 @@ function LanesItem({
125
127
  onResizeEnd,
126
128
  resizeSnapPreview = null,
127
129
  minResizeWidthPx,
130
+ maxResizeWidthPx,
128
131
  renderResizeHandle,
129
132
  dragging = false
130
133
  }) {
@@ -134,6 +137,8 @@ function LanesItem({
134
137
  const [initialContentSize, setInitialContentSize] = useState(null);
135
138
  const itemRef = useRef(null);
136
139
  const contentRef = useRef(null);
140
+ const dragDisabled = disabled || !draggable;
141
+ const resizeDisabled = disabled || !resizable;
137
142
  const {
138
143
  attributes,
139
144
  listeners,
@@ -142,7 +147,7 @@ function LanesItem({
142
147
  isDragging
143
148
  } = useSortable({
144
149
  id: itemKey,
145
- disabled
150
+ disabled: dragDisabled
146
151
  });
147
152
  const mergedRef = useMergeRefs([itemRef, setNodeRef]);
148
153
  const contentMergedRef = useMergeRefs([contentRef]);
@@ -166,9 +171,12 @@ function LanesItem({
166
171
  }
167
172
  let clamped = { width: delta.width, height: 0 };
168
173
  if (baselineSize) {
169
- clamped = clampResizeDelta(clamped, baselineSize, {
170
- width: minResizeWidthPx
171
- });
174
+ clamped = clampResizeDelta(
175
+ clamped,
176
+ baselineSize,
177
+ { width: minResizeWidthPx },
178
+ { width: maxResizeWidthPx }
179
+ );
172
180
  }
173
181
  setResizeDelta(clamped);
174
182
  onResize(itemKey, clamped);
@@ -222,7 +230,7 @@ function LanesItem({
222
230
  ...listeners,
223
231
  style: {
224
232
  height: "100%",
225
- cursor: getItemCursor(disabled, interacting)
233
+ cursor: getItemCursor(dragDisabled, interacting)
226
234
  },
227
235
  children: [
228
236
  /* @__PURE__ */ jsxs(
@@ -233,7 +241,7 @@ function LanesItem({
233
241
  style: continuousContentStyle,
234
242
  children: [
235
243
  children,
236
- !disabled && /* @__PURE__ */ jsx(
244
+ !resizeDisabled && /* @__PURE__ */ jsx(
237
245
  ResizeHandle,
238
246
  {
239
247
  itemId: itemKey,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/dashboard-lanes/lanes-item.tsx", "../../../style-runtime/src/index.ts", "../../src/shared/actionable-area-slot.module.css", "../../src/dashboard-lanes/lanes-item.module.css"],
4
- "sourcesContent": ["import { useSortable } from '@dnd-kit/sortable';\nimport clsx from 'clsx';\nimport { useState, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport actionableAreaStyles from '../shared/actionable-area-slot.module.css';\nimport ResizeHandle from '../shared/resize-handle';\nimport { clampResizeDelta, type ResizeSnapSize } from '../shared/resize-snap';\nimport { GRID_ITEM_DATA_KEY } from '../shared/grid-item-key';\nimport type { ResizeDelta, ResizeHandleRenderProps } from '../shared/types';\nimport styles from './lanes-item.module.css';\n\nfunction getItemCursor(\n\tdisabled: boolean,\n\tinteracting: boolean\n): React.CSSProperties[ 'cursor' ] {\n\tif ( disabled ) {\n\t\treturn 'default';\n\t}\n\tif ( interacting ) {\n\t\treturn undefined;\n\t}\n\treturn 'grab';\n}\n\n/**\n * Props for the internal `<LanesItem />` wrapper.\n */\nexport type LanesItemProps = {\n\t/**\n\t * Item key. Forwarded to dnd-kit and emitted as the\n\t * `data-wp-grid-item-key` attribute the hook reads to map measured DOM\n\t * nodes back to logical items.\n\t */\n\titemKey: string;\n\n\t/**\n\t * Inline placement style produced by `useLanePlacement`. On native\n\t * (`display: grid-lanes`), only `gridColumn: span N`. While\n\t * polyfilling, also `gridColumnStart` / `gridRowStart` /\n\t * `gridRowEnd: span N`.\n\t */\n\tplacementStyle: React.CSSProperties;\n\n\t/**\n\t * Whether drag and resize interactions are disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether any tile in the surface is currently being dragged or\n\t * resized. Drives the drag activator cursor.\n\t */\n\tinteracting?: boolean;\n\n\t/**\n\t * Whether a tile drag is in progress. Mutes each tile's\n\t * `actionableArea` with `inert` so hovers on other tiles' controls\n\t * do not steal the gesture.\n\t *\n\t * @default false\n\t */\n\tdragging?: boolean;\n\n\tchildren: React.ReactNode;\n\n\tactionableArea?: React.ReactNode;\n\n\tonResize: ( id: string, delta: ResizeDelta ) => void;\n\n\t/**\n\t * Snapped column span in pixels for the resize-preview outline.\n\t */\n\tresizeSnapPreview?: ResizeSnapSize | null;\n\n\t/**\n\t * Minimum tile width while resizing, in pixels (one column track).\n\t */\n\tminResizeWidthPx: number;\n\n\tonResizeEnd: () => void;\n\n\trenderResizeHandle?: React.ComponentType< ResizeHandleRenderProps >;\n};\n\nexport function LanesItem( {\n\titemKey,\n\tplacementStyle,\n\tdisabled = false,\n\tinteracting = false,\n\tchildren,\n\tactionableArea = null,\n\tonResize,\n\tonResizeEnd,\n\tresizeSnapPreview = null,\n\tminResizeWidthPx,\n\trenderResizeHandle,\n\tdragging = false,\n}: LanesItemProps ) {\n\tconst [ resizeDelta, setResizeDelta ] = useState< ResizeDelta | null >(\n\t\tnull\n\t);\n\tconst [ initialContentSize, setInitialContentSize ] = useState< {\n\t\twidth: number;\n\t\theight: number;\n\t} | null >( null );\n\tconst itemRef = useRef< HTMLDivElement >( null );\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\n\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\tsetActivatorNodeRef,\n\t\tisDragging,\n\t} = useSortable( {\n\t\tid: itemKey,\n\t\tdisabled,\n\t} );\n\tconst mergedRef = useMergeRefs( [ itemRef, setNodeRef ] );\n\tconst contentMergedRef = useMergeRefs( [ contentRef ] );\n\n\tconst style: React.CSSProperties = {\n\t\t...placementStyle,\n\t\talignSelf: 'start',\n\t};\n\n\tconst isResizing = resizeDelta !== null;\n\tconst itemClassName = clsx(\n\t\tstyles.item,\n\t\tisDragging && styles[ 'is-dragging' ],\n\t\tisResizing && styles[ 'is-resizing' ]\n\t);\n\n\tconst handleResize = ( delta: ResizeDelta ) => {\n\t\tconst contentNode = contentRef.current;\n\t\tlet baselineSize = initialContentSize;\n\t\tif ( contentNode && ! baselineSize ) {\n\t\t\tconst { width, height } = contentNode.getBoundingClientRect();\n\t\t\tbaselineSize = { width, height };\n\t\t\tsetInitialContentSize( baselineSize );\n\t\t}\n\t\tlet clamped: ResizeDelta = { width: delta.width, height: 0 };\n\t\tif ( baselineSize ) {\n\t\t\tclamped = clampResizeDelta( clamped, baselineSize, {\n\t\t\t\twidth: minResizeWidthPx,\n\t\t\t} );\n\t\t}\n\t\tsetResizeDelta( clamped );\n\t\tonResize( itemKey, clamped );\n\t};\n\n\tconst handleResizeEnd = () => {\n\t\tsetResizeDelta( null );\n\t\tsetInitialContentSize( null );\n\t\tonResizeEnd();\n\t};\n\n\tconst continuousContentStyle: React.CSSProperties | undefined =\n\t\tresizeDelta && initialContentSize\n\t\t\t? {\n\t\t\t\t\twidth: initialContentSize.width + resizeDelta.width,\n\t\t\t }\n\t\t\t: undefined;\n\n\tconst previewOverlay = resizeSnapPreview ? (\n\t\t<div\n\t\t\tclassName={ styles[ 'preview-overlay' ] }\n\t\t\tstyle={ {\n\t\t\t\twidth: resizeSnapPreview.widthPx,\n\t\t\t\theight: resizeSnapPreview.heightPx ?? '100%',\n\t\t\t} }\n\t\t/>\n\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tref={ mergedRef }\n\t\t\tclassName={ itemClassName }\n\t\t\tstyle={ style }\n\t\t\t{ ...{ [ GRID_ITEM_DATA_KEY ]: itemKey } }\n\t\t\tdata-wp-grid-item-resizing={ isResizing || undefined }\n\t\t>\n\t\t\t{ actionableArea ? (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ actionableAreaStyles[ 'actionable-area-slot' ] }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={ { display: 'contents' } }\n\t\t\t\t\t\t{ ...( dragging ? { inert: '' } : {} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ actionableArea }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : null }\n\n\t\t\t<div\n\t\t\t\tref={ setActivatorNodeRef }\n\t\t\t\t{ ...attributes }\n\t\t\t\t{ ...listeners }\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tcursor: getItemCursor( disabled, interacting ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tref={ contentMergedRef }\n\t\t\t\t\tclassName={ styles[ 'item-content' ] }\n\t\t\t\t\tstyle={ continuousContentStyle }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t\t{ ! disabled && (\n\t\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\t\titemId={ itemKey }\n\t\t\t\t\t\t\tverticalResizable={ false }\n\t\t\t\t\t\t\tonResize={ handleResize }\n\t\t\t\t\t\t\tonResizeEnd={ handleResizeEnd }\n\t\t\t\t\t\t\trenderResizeHandle={ renderResizeHandle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t{ previewOverlay }\n\t\t\t</div>\n\t\t</div>\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(\"ac1094954c\", \"._1c54fe8165d3023e__actionable-area-slot{opacity:1}@media (prefers-reduced-motion:no-preference){._1c54fe8165d3023e__actionable-area-slot{transition:opacity var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1))}}[data-wp-grid-resizing] ._1c54fe8165d3023e__actionable-area-slot{opacity:0;pointer-events:none}\");\n}\nexport default {\"actionable-area-slot\":\"_1c54fe8165d3023e__actionable-area-slot\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"97a2a51c0b\", \"._0a62d9f1dff8c7d8__item{position:relative}._20c43fcd930d828a__item-content{height:100%;position:relative}._11928ee35f1a9519__is-resizing{overflow:visible;z-index:1}._11928ee35f1a9519__is-resizing ._20c43fcd930d828a__item-content{overflow:visible;position:relative;z-index:2}.b7fc83c8b16e9ee5__is-dragging{pointer-events:none}[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{animation:b026dda570d0eea0__wp-grid-item-placeholder-in 0ms linear var(--wpds-motion-duration-sm,.1s) forwards;opacity:1;outline-color:transparent;outline-style:var(--wp-grid-placeholder-outline-style,dashed);outline-width:0}@keyframes b026dda570d0eea0__wp-grid-item-placeholder-in{to{opacity:var(--wp-grid-placeholder-opacity,.4);outline-color:var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));outline-width:var(--wpds-border-width-sm,2px)}}}@media (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{opacity:var(--wp-grid-placeholder-opacity,.4);outline:var(--wpds-border-width-sm,2px) var(--wp-grid-placeholder-outline-style,dashed) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)))}}@media (forced-colors:active){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}.cd44faab32c27168__preview-overlay{background:transparent;border:var(--wpds-border-width-sm,2px) var(--wp-grid-resize-preview-outline-style,solid) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));box-sizing:border-box;inset-inline-start:0;pointer-events:none;position:absolute;top:0;z-index:0}@media (forced-colors:active){.cd44faab32c27168__preview-overlay{border-color:Highlight}}\");\n}\nexport default {\"item\":\"_0a62d9f1dff8c7d8__item\",\"item-content\":\"_20c43fcd930d828a__item-content\",\"is-resizing\":\"_11928ee35f1a9519__is-resizing\",\"is-dragging\":\"b7fc83c8b16e9ee5__is-dragging\",\"wp-grid-item-placeholder-in\":\"b026dda570d0eea0__wp-grid-item-placeholder-in\",\"preview-overlay\":\"c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AAA,wBACT,mBAAoB;AAAA,wBACpB,UAAW;AAAA,wBACX,aAAc;AAAA,wBACd;AAAA;AAAA,oBACD;AAAA;AAAA;AAAA,cAEF;AAAA,cACE;AAAA;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACD;AAEF;",
4
+ "sourcesContent": ["import { useSortable } from '@dnd-kit/sortable';\nimport clsx from 'clsx';\nimport { useState, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport actionableAreaStyles from '../shared/actionable-area-slot.module.css';\nimport ResizeHandle from '../shared/resize-handle';\nimport { clampResizeDelta, type ResizeSnapSize } from '../shared/resize-snap';\nimport { GRID_ITEM_DATA_KEY } from '../shared/grid-item-key';\nimport type { ResizeDelta, ResizeHandleRenderProps } from '../shared/types';\nimport styles from './lanes-item.module.css';\n\nfunction getItemCursor(\n\tdisabled: boolean,\n\tinteracting: boolean\n): React.CSSProperties[ 'cursor' ] {\n\tif ( disabled ) {\n\t\treturn 'default';\n\t}\n\tif ( interacting ) {\n\t\treturn undefined;\n\t}\n\treturn 'grab';\n}\n\n/**\n * Props for the internal `<LanesItem />` wrapper.\n */\nexport type LanesItemProps = {\n\t/**\n\t * Item key. Forwarded to dnd-kit and emitted as the\n\t * `data-wp-grid-item-key` attribute the hook reads to map measured DOM\n\t * nodes back to logical items.\n\t */\n\titemKey: string;\n\n\t/**\n\t * Inline placement style produced by `useLanePlacement`. On native\n\t * (`display: grid-lanes`), only `gridColumn: span N`. While\n\t * polyfilling, also `gridColumnStart` / `gridRowStart` /\n\t * `gridRowEnd: span N`.\n\t */\n\tplacementStyle: React.CSSProperties;\n\n\t/**\n\t * Whether drag and resize interactions are disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the item can be dragged. Combined with `disabled`.\n\t *\n\t * @default true\n\t */\n\tdraggable?: boolean;\n\n\t/**\n\t * Whether the item can be resized. Combined with `disabled`.\n\t *\n\t * @default true\n\t */\n\tresizable?: boolean;\n\n\t/**\n\t * Whether any tile in the surface is currently being dragged or\n\t * resized. Drives the drag activator cursor.\n\t */\n\tinteracting?: boolean;\n\n\t/**\n\t * Whether a tile drag is in progress. Mutes each tile's\n\t * `actionableArea` with `inert` so hovers on other tiles' controls\n\t * do not steal the gesture.\n\t *\n\t * @default false\n\t */\n\tdragging?: boolean;\n\n\tchildren: React.ReactNode;\n\n\tactionableArea?: React.ReactNode;\n\n\tonResize: ( id: string, delta: ResizeDelta ) => void;\n\n\t/**\n\t * Snapped column span in pixels for the resize-preview outline.\n\t */\n\tresizeSnapPreview?: ResizeSnapSize | null;\n\n\t/**\n\t * Minimum tile width while resizing, in pixels (one column track).\n\t */\n\tminResizeWidthPx: number;\n\n\t/**\n\t * Maximum tile width while resizing, in pixels. Omitted when the\n\t * item declares no width limit.\n\t */\n\tmaxResizeWidthPx?: number;\n\n\tonResizeEnd: () => void;\n\n\trenderResizeHandle?: React.ComponentType< ResizeHandleRenderProps >;\n};\n\nexport function LanesItem( {\n\titemKey,\n\tplacementStyle,\n\tdisabled = false,\n\tdraggable = true,\n\tresizable = true,\n\tinteracting = false,\n\tchildren,\n\tactionableArea = null,\n\tonResize,\n\tonResizeEnd,\n\tresizeSnapPreview = null,\n\tminResizeWidthPx,\n\tmaxResizeWidthPx,\n\trenderResizeHandle,\n\tdragging = false,\n}: LanesItemProps ) {\n\tconst [ resizeDelta, setResizeDelta ] = useState< ResizeDelta | null >(\n\t\tnull\n\t);\n\tconst [ initialContentSize, setInitialContentSize ] = useState< {\n\t\twidth: number;\n\t\theight: number;\n\t} | null >( null );\n\tconst itemRef = useRef< HTMLDivElement >( null );\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\n\tconst dragDisabled = disabled || ! draggable;\n\tconst resizeDisabled = disabled || ! resizable;\n\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\tsetActivatorNodeRef,\n\t\tisDragging,\n\t} = useSortable( {\n\t\tid: itemKey,\n\t\tdisabled: dragDisabled,\n\t} );\n\tconst mergedRef = useMergeRefs( [ itemRef, setNodeRef ] );\n\tconst contentMergedRef = useMergeRefs( [ contentRef ] );\n\n\tconst style: React.CSSProperties = {\n\t\t...placementStyle,\n\t\talignSelf: 'start',\n\t};\n\n\tconst isResizing = resizeDelta !== null;\n\tconst itemClassName = clsx(\n\t\tstyles.item,\n\t\tisDragging && styles[ 'is-dragging' ],\n\t\tisResizing && styles[ 'is-resizing' ]\n\t);\n\n\tconst handleResize = ( delta: ResizeDelta ) => {\n\t\tconst contentNode = contentRef.current;\n\t\tlet baselineSize = initialContentSize;\n\t\tif ( contentNode && ! baselineSize ) {\n\t\t\tconst { width, height } = contentNode.getBoundingClientRect();\n\t\t\tbaselineSize = { width, height };\n\t\t\tsetInitialContentSize( baselineSize );\n\t\t}\n\t\tlet clamped: ResizeDelta = { width: delta.width, height: 0 };\n\t\tif ( baselineSize ) {\n\t\t\tclamped = clampResizeDelta(\n\t\t\t\tclamped,\n\t\t\t\tbaselineSize,\n\t\t\t\t{ width: minResizeWidthPx },\n\t\t\t\t{ width: maxResizeWidthPx }\n\t\t\t);\n\t\t}\n\t\tsetResizeDelta( clamped );\n\t\tonResize( itemKey, clamped );\n\t};\n\n\tconst handleResizeEnd = () => {\n\t\tsetResizeDelta( null );\n\t\tsetInitialContentSize( null );\n\t\tonResizeEnd();\n\t};\n\n\tconst continuousContentStyle: React.CSSProperties | undefined =\n\t\tresizeDelta && initialContentSize\n\t\t\t? {\n\t\t\t\t\twidth: initialContentSize.width + resizeDelta.width,\n\t\t\t }\n\t\t\t: undefined;\n\n\tconst previewOverlay = resizeSnapPreview ? (\n\t\t<div\n\t\t\tclassName={ styles[ 'preview-overlay' ] }\n\t\t\tstyle={ {\n\t\t\t\twidth: resizeSnapPreview.widthPx,\n\t\t\t\theight: resizeSnapPreview.heightPx ?? '100%',\n\t\t\t} }\n\t\t/>\n\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tref={ mergedRef }\n\t\t\tclassName={ itemClassName }\n\t\t\tstyle={ style }\n\t\t\t{ ...{ [ GRID_ITEM_DATA_KEY ]: itemKey } }\n\t\t\tdata-wp-grid-item-resizing={ isResizing || undefined }\n\t\t>\n\t\t\t{ actionableArea ? (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ actionableAreaStyles[ 'actionable-area-slot' ] }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={ { display: 'contents' } }\n\t\t\t\t\t\t{ ...( dragging ? { inert: '' } : {} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ actionableArea }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : null }\n\n\t\t\t<div\n\t\t\t\tref={ setActivatorNodeRef }\n\t\t\t\t{ ...attributes }\n\t\t\t\t{ ...listeners }\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tcursor: getItemCursor( dragDisabled, interacting ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tref={ contentMergedRef }\n\t\t\t\t\tclassName={ styles[ 'item-content' ] }\n\t\t\t\t\tstyle={ continuousContentStyle }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t\t{ ! resizeDisabled && (\n\t\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\t\titemId={ itemKey }\n\t\t\t\t\t\t\tverticalResizable={ false }\n\t\t\t\t\t\t\tonResize={ handleResize }\n\t\t\t\t\t\t\tonResizeEnd={ handleResizeEnd }\n\t\t\t\t\t\t\trenderResizeHandle={ renderResizeHandle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t{ previewOverlay }\n\t\t\t</div>\n\t\t</div>\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(\"ac1094954c\", \"._1c54fe8165d3023e__actionable-area-slot{opacity:1}@media (prefers-reduced-motion:no-preference){._1c54fe8165d3023e__actionable-area-slot{transition:opacity var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1))}}[data-wp-grid-resizing] ._1c54fe8165d3023e__actionable-area-slot{opacity:0;pointer-events:none}\");\n}\nexport default {\"actionable-area-slot\":\"_1c54fe8165d3023e__actionable-area-slot\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"97a2a51c0b\", \"._0a62d9f1dff8c7d8__item{position:relative}._20c43fcd930d828a__item-content{height:100%;position:relative}._11928ee35f1a9519__is-resizing{overflow:visible;z-index:1}._11928ee35f1a9519__is-resizing ._20c43fcd930d828a__item-content{overflow:visible;position:relative;z-index:2}.b7fc83c8b16e9ee5__is-dragging{pointer-events:none}[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{animation:b026dda570d0eea0__wp-grid-item-placeholder-in 0ms linear var(--wpds-motion-duration-sm,.1s) forwards;opacity:1;outline-color:transparent;outline-style:var(--wp-grid-placeholder-outline-style,dashed);outline-width:0}@keyframes b026dda570d0eea0__wp-grid-item-placeholder-in{to{opacity:var(--wp-grid-placeholder-opacity,.4);outline-color:var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));outline-width:var(--wpds-border-width-sm,2px)}}}@media (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{opacity:var(--wp-grid-placeholder-opacity,.4);outline:var(--wpds-border-width-sm,2px) var(--wp-grid-placeholder-outline-style,dashed) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)))}}@media (forced-colors:active){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}.cd44faab32c27168__preview-overlay{background:transparent;border:var(--wpds-border-width-sm,2px) var(--wp-grid-resize-preview-outline-style,solid) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));box-sizing:border-box;inset-inline-start:0;pointer-events:none;position:absolute;top:0;z-index:0}@media (forced-colors:active){.cd44faab32c27168__preview-overlay{border-color:Highlight}}\");\n}\nexport default {\"item\":\"_0a62d9f1dff8c7d8__item\",\"item-content\":\"_20c43fcd930d828a__item-content\",\"is-resizing\":\"_11928ee35f1a9519__is-resizing\",\"is-dragging\":\"b7fc83c8b16e9ee5__is-dragging\",\"wp-grid-item-placeholder-in\":\"b026dda570d0eea0__wp-grid-item-placeholder-in\",\"preview-overlay\":\"cd44faab32c27168__preview-overlay\"};\n"],
5
+ "mappings": ";AAAA,SAAS,mBAAmB;AAC5B,OAAO,UAAU;AACjB,SAAS,UAAU,cAAc;AACjC,SAAS,oBAAoB;;;ACO7B,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,EAC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,OAAO,kBAAkB;AAAA,QACzB,QAAQ,kBAAkB,YAAY;AAAA,MACvC;AAAA;AAAA,EACD,IACG;AAEJ,SACC;AAAA,IAAC;AAAA;AAAA,MACA,KAAM;AAAA,MACN,WAAY;AAAA,MACZ;AAAA,MACE,GAAG,EAAE,CAAE,kBAAmB,GAAG,QAAQ;AAAA,MACvC,8BAA6B,cAAc;AAAA,MAEzC;AAAA,yBACD;AAAA,UAAC;AAAA;AAAA,YACA,WAAY,6BAAsB,sBAAuB;AAAA,YAEzD;AAAA,cAAC;AAAA;AAAA,gBACA,OAAQ,EAAE,SAAS,WAAW;AAAA,gBAC5B,GAAK,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;AAAA,gBAEjC;AAAA;AAAA,YACH;AAAA;AAAA,QACD,IACG;AAAA,QAEJ;AAAA,UAAC;AAAA;AAAA,YACA,KAAM;AAAA,YACJ,GAAG;AAAA,YACH,GAAG;AAAA,YACL,OAAQ;AAAA,cACP,QAAQ;AAAA,cACR,QAAQ,cAAe,cAAc,WAAY;AAAA,YAClD;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,KAAM;AAAA,kBACN,WAAY,mBAAQ,cAAe;AAAA,kBACnC,OAAQ;AAAA,kBAEN;AAAA;AAAA,oBACA,CAAE,kBACH;AAAA,sBAAC;AAAA;AAAA,wBACA,QAAS;AAAA,wBACT,mBAAoB;AAAA,wBACpB,UAAW;AAAA,wBACX,aAAc;AAAA,wBACd;AAAA;AAAA,oBACD;AAAA;AAAA;AAAA,cAEF;AAAA,cACE;AAAA;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export { DashboardGrid } from './dashboard-grid';\nexport { DashboardLanes } from './dashboard-lanes';\n\nexport type {\n\tDashboardGridLayoutItem,\n\tDashboardGridProps,\n} from './dashboard-grid/types';\nexport type {\n\tDashboardLanesLayoutItem,\n\tDashboardLanesProps,\n} from './dashboard-lanes/types';\nexport type {\n\tDragPreviewRenderProps,\n\tGridOverlayRenderProps,\n\tResizeDelta,\n\tResizeHandleRenderProps,\n} from './shared/types';\n"],
4
+ "sourcesContent": ["export { DashboardGrid } from './dashboard-grid';\nexport { DashboardLanes } from './dashboard-lanes';\n\nexport type {\n\tDashboardGridLayoutItem,\n\tDashboardGridProps,\n} from './dashboard-grid/types';\nexport type {\n\tDashboardLanesLayoutItem,\n\tDashboardLanesProps,\n} from './dashboard-lanes/types';\nexport type {\n\tDragPreviewRenderProps,\n\tGridItemLimits,\n\tGridItemWidthLimits,\n\tGridOverlayRenderProps,\n\tResizeDelta,\n\tResizeHandleRenderProps,\n} from './shared/types';\n"],
5
5
  "mappings": ";AAAA,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,24 @@
1
+ // packages/grid/src/shared/array-move-with-pinned.ts
2
+ import { arrayMove } from "@dnd-kit/sortable";
3
+ function arrayMoveWithPinned(items, from, to, isPinned) {
4
+ const pinned = new Set(items.filter(isPinned));
5
+ if (pinned.size === 0) {
6
+ return arrayMove(items, from, to);
7
+ }
8
+ const free = arrayMove(items, from, to).filter(
9
+ (item) => !pinned.has(item)
10
+ );
11
+ let nextFree = 0;
12
+ return items.map((item) => {
13
+ if (pinned.has(item)) {
14
+ return item;
15
+ }
16
+ const next = free[nextFree];
17
+ nextFree += 1;
18
+ return next;
19
+ });
20
+ }
21
+ export {
22
+ arrayMoveWithPinned
23
+ };
24
+ //# sourceMappingURL=array-move-with-pinned.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shared/array-move-with-pinned.ts"],
4
+ "sourcesContent": ["import { arrayMove } from '@dnd-kit/sortable';\n\n/**\n * Moves the item at `from` to `to` while pinned items hold their index:\n * the free items reorder among the remaining slots. Moving a pinned item\n * is a no-op.\n *\n * @param items Items in display order.\n * @param from Index of the moved item.\n * @param to Target index.\n * @param isPinned Whether an item holds its index.\n * @return The reordered items.\n */\nexport function arrayMoveWithPinned< T >(\n\titems: T[],\n\tfrom: number,\n\tto: number,\n\tisPinned: ( item: T ) => boolean\n): T[] {\n\tconst pinned = new Set( items.filter( isPinned ) );\n\tif ( pinned.size === 0 ) {\n\t\treturn arrayMove( items, from, to );\n\t}\n\tconst free = arrayMove( items, from, to ).filter(\n\t\t( item ) => ! pinned.has( item )\n\t);\n\tlet nextFree = 0;\n\treturn items.map( ( item ) => {\n\t\tif ( pinned.has( item ) ) {\n\t\t\treturn item;\n\t\t}\n\t\tconst next = free[ nextFree ];\n\t\tnextFree += 1;\n\t\treturn next;\n\t} );\n}\n"],
5
+ "mappings": ";AAAA,SAAS,iBAAiB;AAanB,SAAS,oBACf,OACA,MACA,IACA,UACM;AACN,QAAM,SAAS,IAAI,IAAK,MAAM,OAAQ,QAAS,CAAE;AACjD,MAAK,OAAO,SAAS,GAAI;AACxB,WAAO,UAAW,OAAO,MAAM,EAAG;AAAA,EACnC;AACA,QAAM,OAAO,UAAW,OAAO,MAAM,EAAG,EAAE;AAAA,IACzC,CAAE,SAAU,CAAE,OAAO,IAAK,IAAK;AAAA,EAChC;AACA,MAAI,WAAW;AACf,SAAO,MAAM,IAAK,CAAE,SAAU;AAC7B,QAAK,OAAO,IAAK,IAAK,GAAI;AACzB,aAAO;AAAA,IACR;AACA,UAAM,OAAO,KAAM,QAAS;AAC5B,gBAAY;AACZ,WAAO;AAAA,EACR,CAAE;AACH;",
6
+ "names": []
7
+ }
@@ -1,12 +1,18 @@
1
1
  // packages/grid/src/shared/resize-snap.ts
2
- function clampResizeDelta(delta, initialSize, minSize) {
2
+ function clampResizeDelta(delta, initialSize, minSize, maxSize) {
3
3
  const maxShrinkWidth = initialSize.width - minSize.width;
4
- const width = Math.max(delta.width, -maxShrinkWidth);
4
+ let width = Math.max(delta.width, -maxShrinkWidth);
5
+ if (maxSize?.width !== void 0) {
6
+ width = Math.min(width, maxSize.width - initialSize.width);
7
+ }
5
8
  if (minSize.height === void 0) {
6
9
  return { ...delta, width };
7
10
  }
8
11
  const maxShrinkHeight = initialSize.height - minSize.height;
9
- const height = Math.max(delta.height, -maxShrinkHeight);
12
+ let height = Math.max(delta.height, -maxShrinkHeight);
13
+ if (maxSize?.height !== void 0) {
14
+ height = Math.min(height, maxSize.height - initialSize.height);
15
+ }
10
16
  return { width, height };
11
17
  }
12
18
  function gridSpanToPixelSize(columnSpan, rowSpan, columnWidth, gapPx, rowHeightPx) {
@@ -14,8 +20,85 @@ function gridSpanToPixelSize(columnSpan, rowSpan, columnWidth, gapPx, rowHeightP
14
20
  const heightPx = rowHeightPx === null ? null : rowSpan * rowHeightPx + (rowSpan - 1) * gapPx;
15
21
  return { widthPx, heightPx };
16
22
  }
23
+ function pixelLimitsToSpanBounds(limits, columnWidth, gapPx, rowHeightPx, maxColumns) {
24
+ let minWidth = 1;
25
+ let maxWidth = maxColumns;
26
+ if (columnWidth > 0) {
27
+ const columnTrack = columnWidth + gapPx;
28
+ if (limits.minWidth) {
29
+ minWidth = Math.min(
30
+ Math.max(
31
+ 1,
32
+ Math.ceil((limits.minWidth + gapPx) / columnTrack)
33
+ ),
34
+ maxColumns
35
+ );
36
+ }
37
+ if (limits.maxWidth) {
38
+ maxWidth = Math.min(
39
+ Math.max(
40
+ 1,
41
+ Math.floor((limits.maxWidth + gapPx) / columnTrack)
42
+ ),
43
+ maxColumns
44
+ );
45
+ }
46
+ }
47
+ let minHeight = 1;
48
+ let maxHeight = Infinity;
49
+ if (rowHeightPx !== null && rowHeightPx > 0) {
50
+ const rowTrack = rowHeightPx + gapPx;
51
+ if (limits.minHeight) {
52
+ minHeight = Math.max(
53
+ 1,
54
+ Math.ceil((limits.minHeight + gapPx) / rowTrack)
55
+ );
56
+ }
57
+ if (limits.maxHeight) {
58
+ maxHeight = Math.max(
59
+ 1,
60
+ Math.floor((limits.maxHeight + gapPx) / rowTrack)
61
+ );
62
+ }
63
+ }
64
+ return {
65
+ minWidth,
66
+ minHeight,
67
+ maxWidth: Math.max(maxWidth, minWidth),
68
+ maxHeight: Math.max(maxHeight, minHeight)
69
+ };
70
+ }
71
+ function clampSpan(span, min, max) {
72
+ return Math.min(Math.max(span, min), max);
73
+ }
74
+ function spanBoundsToPixelLimits(bounds, columnWidth, gapPx, rowHeightPx) {
75
+ const min = gridSpanToPixelSize(
76
+ bounds.minWidth,
77
+ bounds.minHeight,
78
+ columnWidth,
79
+ gapPx,
80
+ rowHeightPx
81
+ );
82
+ const hasMaxHeight = Number.isFinite(bounds.maxHeight);
83
+ const max = gridSpanToPixelSize(
84
+ bounds.maxWidth,
85
+ hasMaxHeight ? bounds.maxHeight : 1,
86
+ columnWidth,
87
+ gapPx,
88
+ hasMaxHeight ? rowHeightPx : null
89
+ );
90
+ return {
91
+ minWidthPx: min.widthPx,
92
+ minHeightPx: min.heightPx,
93
+ maxWidthPx: max.widthPx,
94
+ maxHeightPx: max.heightPx
95
+ };
96
+ }
17
97
  export {
18
98
  clampResizeDelta,
19
- gridSpanToPixelSize
99
+ clampSpan,
100
+ gridSpanToPixelSize,
101
+ pixelLimitsToSpanBounds,
102
+ spanBoundsToPixelLimits
20
103
  };
21
104
  //# sourceMappingURL=resize-snap.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/shared/resize-snap.ts"],
4
- "sourcesContent": ["import type { ResizeDelta } from './types';\n\n/**\n * Pixel dimensions for the snapped resize preview outline.\n */\nexport type ResizeSnapSize = {\n\twidthPx: number;\n\t/** When `null`, the preview spans the item's content height (lanes). */\n\theightPx: number | null;\n};\n\n/**\n * Clamps a resize delta so the tile cannot shrink below the given\n * minimum width (and height when provided).\n *\n * @param delta Cursor offset from the gesture start in pixels.\n * @param initialSize Size captured at gesture start.\n * @param initialSize.width Initial width in pixels.\n * @param initialSize.height Initial height in pixels.\n * @param minSize Minimum tile size in pixels.\n * @param minSize.width Minimum width in pixels.\n * @param minSize.height Minimum height in pixels, when vertical resize applies.\n */\nexport function clampResizeDelta(\n\tdelta: ResizeDelta,\n\tinitialSize: { width: number; height: number },\n\tminSize: { width: number; height?: number }\n): ResizeDelta {\n\tconst maxShrinkWidth = initialSize.width - minSize.width;\n\tconst width = Math.max( delta.width, -maxShrinkWidth );\n\tif ( minSize.height === undefined ) {\n\t\treturn { ...delta, width };\n\t}\n\tconst maxShrinkHeight = initialSize.height - minSize.height;\n\tconst height = Math.max( delta.height, -maxShrinkHeight );\n\treturn { width, height };\n}\n\n/**\n * Converts grid spans to pixel width/height for the resize-preview\n * outline, using the same track math the surface uses for placement.\n *\n * @param columnSpan Number of columns the snap target spans.\n * @param rowSpan Number of rows the snap target spans.\n * @param columnWidth Width of one column track in pixels.\n * @param gapPx Gap between tracks in pixels.\n * @param rowHeightPx Row track height in pixels, or `null` when rows\n * are content-sized.\n */\nexport function gridSpanToPixelSize(\n\tcolumnSpan: number,\n\trowSpan: number,\n\tcolumnWidth: number,\n\tgapPx: number,\n\trowHeightPx: number | null\n): ResizeSnapSize {\n\tconst widthPx = columnSpan * columnWidth + ( columnSpan - 1 ) * gapPx;\n\tconst heightPx =\n\t\trowHeightPx === null\n\t\t\t? null\n\t\t\t: rowSpan * rowHeightPx + ( rowSpan - 1 ) * gapPx;\n\treturn { widthPx, heightPx };\n}\n"],
5
- "mappings": ";AAuBO,SAAS,iBACf,OACA,aACA,SACc;AACd,QAAM,iBAAiB,YAAY,QAAQ,QAAQ;AACnD,QAAM,QAAQ,KAAK,IAAK,MAAM,OAAO,CAAC,cAAe;AACrD,MAAK,QAAQ,WAAW,QAAY;AACnC,WAAO,EAAE,GAAG,OAAO,MAAM;AAAA,EAC1B;AACA,QAAM,kBAAkB,YAAY,SAAS,QAAQ;AACrD,QAAM,SAAS,KAAK,IAAK,MAAM,QAAQ,CAAC,eAAgB;AACxD,SAAO,EAAE,OAAO,OAAO;AACxB;AAaO,SAAS,oBACf,YACA,SACA,aACA,OACA,aACiB;AACjB,QAAM,UAAU,aAAa,eAAgB,aAAa,KAAM;AAChE,QAAM,WACL,gBAAgB,OACb,OACA,UAAU,eAAgB,UAAU,KAAM;AAC9C,SAAO,EAAE,SAAS,SAAS;AAC5B;",
4
+ "sourcesContent": ["import type { GridItemLimits, ResizeDelta } from './types';\n\n/**\n * Pixel dimensions for the snapped resize preview outline.\n */\nexport type ResizeSnapSize = {\n\twidthPx: number;\n\t/** When `null`, the preview spans the item's content height (lanes). */\n\theightPx: number | null;\n};\n\n/**\n * Clamps a resize delta so the tile cannot shrink below the given\n * minimum size, nor grow past the given maximum when one applies.\n *\n * @param delta Cursor offset from the gesture start in pixels.\n * @param initialSize Size captured at gesture start.\n * @param initialSize.width Initial width in pixels.\n * @param initialSize.height Initial height in pixels.\n * @param minSize Minimum tile size in pixels.\n * @param minSize.width Minimum width in pixels.\n * @param minSize.height Minimum height in pixels, when vertical resize applies.\n * @param maxSize Maximum tile size in pixels, when one applies.\n * @param maxSize.width Maximum width in pixels.\n * @param maxSize.height Maximum height in pixels, when vertical resize applies.\n */\nexport function clampResizeDelta(\n\tdelta: ResizeDelta,\n\tinitialSize: { width: number; height: number },\n\tminSize: { width: number; height?: number },\n\tmaxSize?: { width?: number; height?: number }\n): ResizeDelta {\n\tconst maxShrinkWidth = initialSize.width - minSize.width;\n\tlet width = Math.max( delta.width, -maxShrinkWidth );\n\tif ( maxSize?.width !== undefined ) {\n\t\twidth = Math.min( width, maxSize.width - initialSize.width );\n\t}\n\tif ( minSize.height === undefined ) {\n\t\treturn { ...delta, width };\n\t}\n\tconst maxShrinkHeight = initialSize.height - minSize.height;\n\tlet height = Math.max( delta.height, -maxShrinkHeight );\n\tif ( maxSize?.height !== undefined ) {\n\t\theight = Math.min( height, maxSize.height - initialSize.height );\n\t}\n\treturn { width, height };\n}\n\n/**\n * Converts grid spans to pixel width/height for the resize-preview\n * outline, using the same track math the surface uses for placement.\n *\n * @param columnSpan Number of columns the snap target spans.\n * @param rowSpan Number of rows the snap target spans.\n * @param columnWidth Width of one column track in pixels.\n * @param gapPx Gap between tracks in pixels.\n * @param rowHeightPx Row track height in pixels, or `null` when rows\n * are content-sized.\n */\nexport function gridSpanToPixelSize(\n\tcolumnSpan: number,\n\trowSpan: number,\n\tcolumnWidth: number,\n\tgapPx: number,\n\trowHeightPx: number | null\n): ResizeSnapSize {\n\tconst widthPx = columnSpan * columnWidth + ( columnSpan - 1 ) * gapPx;\n\tconst heightPx =\n\t\trowHeightPx === null\n\t\t\t? null\n\t\t\t: rowSpan * rowHeightPx + ( rowSpan - 1 ) * gapPx;\n\treturn { widthPx, heightPx };\n}\n\n/**\n * Span bounds derived from per-item pixel limits, in whole tracks.\n * Maximums are concrete: an undeclared width maximum resolves to the\n * column count, an undeclared or inapplicable height maximum to\n * `Infinity`.\n */\nexport type SpanBounds = {\n\tminWidth: number;\n\tminHeight: number;\n\tmaxWidth: number;\n\tmaxHeight: number;\n};\n\n/**\n * Converts per-item pixel limits to span bounds with the track math of\n * `gridSpanToPixelSize`. Minimums round up, maximums round down, every\n * bound stays at one track or more, and a minimum wins over a smaller\n * maximum. Width bounds saturate at the column count; height bounds\n * resolve to `1`/`Infinity` when rows are content-sized.\n *\n * @param limits Size limits in pixels.\n * @param columnWidth Width of one column track in pixels.\n * @param gapPx Gap between tracks in pixels.\n * @param rowHeightPx Row track height in pixels, or `null` when rows\n * are content-sized.\n * @param maxColumns Number of column tracks in the surface.\n */\nexport function pixelLimitsToSpanBounds(\n\tlimits: GridItemLimits,\n\tcolumnWidth: number,\n\tgapPx: number,\n\trowHeightPx: number | null,\n\tmaxColumns: number\n): SpanBounds {\n\tlet minWidth = 1;\n\tlet maxWidth = maxColumns;\n\tif ( columnWidth > 0 ) {\n\t\tconst columnTrack = columnWidth + gapPx;\n\t\tif ( limits.minWidth ) {\n\t\t\tminWidth = Math.min(\n\t\t\t\tMath.max(\n\t\t\t\t\t1,\n\t\t\t\t\tMath.ceil( ( limits.minWidth + gapPx ) / columnTrack )\n\t\t\t\t),\n\t\t\t\tmaxColumns\n\t\t\t);\n\t\t}\n\t\tif ( limits.maxWidth ) {\n\t\t\tmaxWidth = Math.min(\n\t\t\t\tMath.max(\n\t\t\t\t\t1,\n\t\t\t\t\tMath.floor( ( limits.maxWidth + gapPx ) / columnTrack )\n\t\t\t\t),\n\t\t\t\tmaxColumns\n\t\t\t);\n\t\t}\n\t}\n\n\tlet minHeight = 1;\n\tlet maxHeight = Infinity;\n\tif ( rowHeightPx !== null && rowHeightPx > 0 ) {\n\t\tconst rowTrack = rowHeightPx + gapPx;\n\t\tif ( limits.minHeight ) {\n\t\t\tminHeight = Math.max(\n\t\t\t\t1,\n\t\t\t\tMath.ceil( ( limits.minHeight + gapPx ) / rowTrack )\n\t\t\t);\n\t\t}\n\t\tif ( limits.maxHeight ) {\n\t\t\tmaxHeight = Math.max(\n\t\t\t\t1,\n\t\t\t\tMath.floor( ( limits.maxHeight + gapPx ) / rowTrack )\n\t\t\t);\n\t\t}\n\t}\n\n\treturn {\n\t\tminWidth,\n\t\tminHeight,\n\t\tmaxWidth: Math.max( maxWidth, minWidth ),\n\t\tmaxHeight: Math.max( maxHeight, minHeight ),\n\t};\n}\n\n/**\n * Clamps a span to the inclusive `[ min, max ]` range.\n *\n * @param span Span in tracks.\n * @param min Lowest allowed span.\n * @param max Highest allowed span.\n */\nexport function clampSpan( span: number, min: number, max: number ): number {\n\treturn Math.min( Math.max( span, min ), max );\n}\n\n/**\n * Pixel limits for the resize gesture, derived from span bounds.\n * Heights are `null` when rows are content-sized or the height\n * bound is open.\n */\nexport type ResizePixelLimits = {\n\tminWidthPx: number;\n\tminHeightPx: number | null;\n\tmaxWidthPx: number;\n\tmaxHeightPx: number | null;\n};\n\n/**\n * Converts span bounds back to pixel limits for the resize gesture,\n * using the same track math as `gridSpanToPixelSize`.\n *\n * @param bounds Span bounds in whole tracks.\n * @param columnWidth Width of one column track in pixels.\n * @param gapPx Gap between tracks in pixels.\n * @param rowHeightPx Row track height in pixels, or `null` when rows\n * are content-sized.\n */\nexport function spanBoundsToPixelLimits(\n\tbounds: SpanBounds,\n\tcolumnWidth: number,\n\tgapPx: number,\n\trowHeightPx: number | null\n): ResizePixelLimits {\n\tconst min = gridSpanToPixelSize(\n\t\tbounds.minWidth,\n\t\tbounds.minHeight,\n\t\tcolumnWidth,\n\t\tgapPx,\n\t\trowHeightPx\n\t);\n\tconst hasMaxHeight = Number.isFinite( bounds.maxHeight );\n\tconst max = gridSpanToPixelSize(\n\t\tbounds.maxWidth,\n\t\thasMaxHeight ? bounds.maxHeight : 1,\n\t\tcolumnWidth,\n\t\tgapPx,\n\t\thasMaxHeight ? rowHeightPx : null\n\t);\n\treturn {\n\t\tminWidthPx: min.widthPx,\n\t\tminHeightPx: min.heightPx,\n\t\tmaxWidthPx: max.widthPx,\n\t\tmaxHeightPx: max.heightPx,\n\t};\n}\n"],
5
+ "mappings": ";AA0BO,SAAS,iBACf,OACA,aACA,SACA,SACc;AACd,QAAM,iBAAiB,YAAY,QAAQ,QAAQ;AACnD,MAAI,QAAQ,KAAK,IAAK,MAAM,OAAO,CAAC,cAAe;AACnD,MAAK,SAAS,UAAU,QAAY;AACnC,YAAQ,KAAK,IAAK,OAAO,QAAQ,QAAQ,YAAY,KAAM;AAAA,EAC5D;AACA,MAAK,QAAQ,WAAW,QAAY;AACnC,WAAO,EAAE,GAAG,OAAO,MAAM;AAAA,EAC1B;AACA,QAAM,kBAAkB,YAAY,SAAS,QAAQ;AACrD,MAAI,SAAS,KAAK,IAAK,MAAM,QAAQ,CAAC,eAAgB;AACtD,MAAK,SAAS,WAAW,QAAY;AACpC,aAAS,KAAK,IAAK,QAAQ,QAAQ,SAAS,YAAY,MAAO;AAAA,EAChE;AACA,SAAO,EAAE,OAAO,OAAO;AACxB;AAaO,SAAS,oBACf,YACA,SACA,aACA,OACA,aACiB;AACjB,QAAM,UAAU,aAAa,eAAgB,aAAa,KAAM;AAChE,QAAM,WACL,gBAAg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AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA,QAAM,eAAe,OAAO,SAAU,OAAO,SAAU;AACvD,QAAM,MAAM;AAAA,IACX,OAAO;AAAA,IACP,eAAe,OAAO,YAAY;AAAA,IAClC;AAAA,IACA;AAAA,IACA,eAAe,cAAc;AAAA,EAC9B;AACA,SAAO;AAAA,IACN,YAAY,IAAI;AAAA,IAChB,aAAa,IAAI;AAAA,IACjB,YAAY,IAAI;AAAA,IAChB,aAAa,IAAI;AAAA,EAClB;AACD;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,62 @@
1
+ // packages/grid/src/shared/use-span-bounds.ts
2
+ import { useMemo } from "@wordpress/element";
3
+ import {
4
+ pixelLimitsToSpanBounds,
5
+ spanBoundsToPixelLimits
6
+ } from "./resize-snap.mjs";
7
+ var NO_BOUNDS = /* @__PURE__ */ new Map();
8
+ var NO_LIMITS = /* @__PURE__ */ new Map();
9
+ function useSpanBounds(itemLimits, columnWidth, gapPx, rowHeightPx, maxColumns) {
10
+ const computed = useMemo(() => {
11
+ if (!itemLimits) {
12
+ return NO_BOUNDS;
13
+ }
14
+ const map = /* @__PURE__ */ new Map();
15
+ for (const [key, limits] of Object.entries(itemLimits)) {
16
+ map.set(
17
+ key,
18
+ pixelLimitsToSpanBounds(
19
+ limits,
20
+ columnWidth,
21
+ gapPx,
22
+ rowHeightPx,
23
+ maxColumns
24
+ )
25
+ );
26
+ }
27
+ return map;
28
+ }, [itemLimits, columnWidth, gapPx, rowHeightPx, maxColumns]);
29
+ const signature = useMemo(() => {
30
+ let value = "";
31
+ for (const [key, bounds] of computed) {
32
+ value += `${key}:${bounds.minWidth}:${bounds.minHeight}:${bounds.maxWidth}:${bounds.maxHeight}|`;
33
+ }
34
+ return value;
35
+ }, [computed]);
36
+ return useMemo(() => computed, [signature]);
37
+ }
38
+ function useResizePixelLimits(spanBounds, columnWidth, gapPx, rowHeightPx) {
39
+ return useMemo(() => {
40
+ if (spanBounds.size === 0) {
41
+ return NO_LIMITS;
42
+ }
43
+ const map = /* @__PURE__ */ new Map();
44
+ for (const [key, bounds] of spanBounds) {
45
+ map.set(
46
+ key,
47
+ spanBoundsToPixelLimits(
48
+ bounds,
49
+ columnWidth,
50
+ gapPx,
51
+ rowHeightPx
52
+ )
53
+ );
54
+ }
55
+ return map;
56
+ }, [spanBounds, columnWidth, gapPx, rowHeightPx]);
57
+ }
58
+ export {
59
+ useResizePixelLimits,
60
+ useSpanBounds
61
+ };
62
+ //# sourceMappingURL=use-span-bounds.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shared/use-span-bounds.ts"],
4
+ "sourcesContent": ["import { useMemo } from '@wordpress/element';\nimport {\n\tpixelLimitsToSpanBounds,\n\tspanBoundsToPixelLimits,\n} from './resize-snap';\nimport type { ResizePixelLimits, SpanBounds } from './resize-snap';\nimport type { GridItemLimits } from './types';\n\nconst NO_BOUNDS: ReadonlyMap< string, SpanBounds > = new Map();\nconst NO_LIMITS: ReadonlyMap< string, ResizePixelLimits > = new Map();\n\n/**\n * Quantizes per-item pixel limits to span bounds for the current\n * geometry. The map keeps its identity while every bound is unchanged,\n * so container width ticks and fresh `itemLimits` objects do not\n * invalidate the layout memos or the sortable context downstream.\n *\n * @param itemLimits Per-item pixel limits, keyed by layout item key.\n * @param columnWidth Width of one column track in pixels.\n * @param gapPx Gap between tracks in pixels.\n * @param rowHeightPx Row track height in pixels, or `null` when rows\n * are content-sized.\n * @param maxColumns Number of column tracks in the surface.\n */\nexport function useSpanBounds(\n\titemLimits: Record< string, GridItemLimits > | undefined,\n\tcolumnWidth: number,\n\tgapPx: number,\n\trowHeightPx: number | null,\n\tmaxColumns: number\n): ReadonlyMap< string, SpanBounds > {\n\tconst computed = useMemo( () => {\n\t\tif ( ! itemLimits ) {\n\t\t\treturn NO_BOUNDS;\n\t\t}\n\t\tconst map = new Map< string, SpanBounds >();\n\t\tfor ( const [ key, limits ] of Object.entries( itemLimits ) ) {\n\t\t\tmap.set(\n\t\t\t\tkey,\n\t\t\t\tpixelLimitsToSpanBounds(\n\t\t\t\t\tlimits,\n\t\t\t\t\tcolumnWidth,\n\t\t\t\t\tgapPx,\n\t\t\t\t\trowHeightPx,\n\t\t\t\t\tmaxColumns\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn map;\n\t}, [ itemLimits, columnWidth, gapPx, rowHeightPx, maxColumns ] );\n\n\tconst signature = useMemo( () => {\n\t\tlet value = '';\n\t\tfor ( const [ key, bounds ] of computed ) {\n\t\t\tvalue += `${ key }:${ bounds.minWidth }:${ bounds.minHeight }:${ bounds.maxWidth }:${ bounds.maxHeight }|`;\n\t\t}\n\t\treturn value;\n\t}, [ computed ] );\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps -- `signature` encodes every bound; `computed` changes identity on geometry ticks that leave the bounds unchanged.\n\treturn useMemo( () => computed, [ signature ] );\n}\n\n/**\n * Pixel limits for the resize gesture of every bounded item. Tracks\n * the continuous geometry, but only recomputes when it changes, not on\n * every gesture frame.\n *\n * @param spanBounds Span bounds per item key.\n * @param columnWidth Width of one column track in pixels.\n * @param gapPx Gap between tracks in pixels.\n * @param rowHeightPx Row track height in pixels, or `null` when rows\n * are content-sized.\n */\nexport function useResizePixelLimits(\n\tspanBounds: ReadonlyMap< string, SpanBounds >,\n\tcolumnWidth: number,\n\tgapPx: number,\n\trowHeightPx: number | null\n): ReadonlyMap< string, ResizePixelLimits > {\n\treturn useMemo( () => {\n\t\tif ( spanBounds.size === 0 ) {\n\t\t\treturn NO_LIMITS;\n\t\t}\n\t\tconst map = new Map< string, ResizePixelLimits >();\n\t\tfor ( const [ key, bounds ] of spanBounds ) {\n\t\t\tmap.set(\n\t\t\t\tkey,\n\t\t\t\tspanBoundsToPixelLimits(\n\t\t\t\t\tbounds,\n\t\t\t\t\tcolumnWidth,\n\t\t\t\t\tgapPx,\n\t\t\t\t\trowHeightPx\n\t\t\t\t)\n\t\t\t);\n\t\t}\n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AAG,CAAE,YAAY,aAAa,OAAO,WAAY,CAAE;AACpD;",
6
+ "names": []
7
+ }
@@ -1,3 +1,3 @@
1
1
  import type { GridItemProps } from './types';
2
- export declare function GridItem({ item, maxColumns, disabled, verticalResizable, interacting, dragging, children, actionableArea, onResize, onResizeEnd, resizeSnapPreview, minResizeWidthPx, minResizeHeightPx, renderResizeHandle, }: GridItemProps): import("react").JSX.Element;
2
+ export declare function GridItem({ item, maxColumns, disabled, draggable, resizable, verticalResizable, interacting, dragging, children, actionableArea, onResize, onResizeEnd, resizeSnapPreview, minResizeWidthPx, minResizeHeightPx, maxResizeWidthPx, maxResizeHeightPx, renderResizeHandle, }: GridItemProps): import("react").JSX.Element;
3
3
  //# sourceMappingURL=grid-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid-item.d.ts","sourceRoot":"","sources":["../../src/dashboard-grid/grid-item.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAkB7C,wBAAgB,QAAQ,CAAE,EACzB,IAAI,EACJ,UAAU,EACV,QAAgB,EAChB,iBAAwB,EACxB,WAAmB,EACnB,QAAgB,EAChB,QAAQ,EACR,cAAqB,EACrB,QAAQ,EACR,WAAW,EACX,iBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GAClB,EAAE,aAAa,+BA2If"}
1
+ {"version":3,"file":"grid-item.d.ts","sourceRoot":"","sources":["../../src/dashboard-grid/grid-item.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAkB7C,wBAAgB,QAAQ,CAAE,EACzB,IAAI,EACJ,UAAU,EACV,QAAgB,EAChB,SAAgB,EAChB,SAAgB,EAChB,iBAAwB,EACxB,WAAmB,EACnB,QAAgB,EAChB,QAAQ,EACR,cAAqB,EACrB,QAAQ,EACR,WAAW,EACX,iBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GAClB,EAAE,aAAa,+BAqJf"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard-grid/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAA2B,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA8B3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,aAAa,+GA0lBzB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard-grid/index.tsx"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAA2B,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA8B3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,aAAa,+GA0rBzB,CAAC"}
@@ -14,10 +14,21 @@ import type { DashboardGridLayoutItem } from './types';
14
14
  * scanned (rows bounded by the sum of item heights), not only on
15
15
  * `maxColumns`.
16
16
  *
17
+ * Fill items honor per-item span bounds: the row plan reserves at least
18
+ * the fill's minimum span (wrapping it to the next free run when the
19
+ * current one is too narrow), and the resolved span never exceeds its
20
+ * maximum. A `'full'` item capped below the column count places like a
21
+ * fixed item of its capped width. Fixed-width items arrive already
22
+ * bounded by the caller.
23
+ *
17
24
  * @param sortedKeys - Item keys in display order.
18
25
  * @param layoutMap - Map of key to DashboardGridLayoutItem.
19
26
  * @param maxColumns - Total columns in the grid.
27
+ * @param itemBounds - Optional per-key span bounds for fill and full items.
20
28
  * @return Map of fill item keys to their resolved column spans.
21
29
  */
22
- export declare function resolveFillWidths(sortedKeys: string[], layoutMap: Map<string, DashboardGridLayoutItem>, maxColumns: number): Map<string, number>;
30
+ export declare function resolveFillWidths(sortedKeys: string[], layoutMap: Map<string, DashboardGridLayoutItem>, maxColumns: number, itemBounds?: ReadonlyMap<string, {
31
+ minWidth: number;
32
+ maxWidth: number;
33
+ }>): Map<string, number>;
23
34
  //# sourceMappingURL=resolve-fill-widths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-fill-widths.d.ts","sourceRoot":"","sources":["../../src/dashboard-grid/resolve-fill-widths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,GAAG,CAAE,MAAM,EAAE,uBAAuB,CAAE,EACjD,UAAU,EAAE,MAAM,GAChB,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE,CAkMvB"}
1
+ {"version":3,"file":"resolve-fill-widths.d.ts","sourceRoot":"","sources":["../../src/dashboard-grid/resolve-fill-widths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,MAAM,EAAE,EACpB,SAAS,EAAE,GAAG,CAAE,MAAM,EAAE,uBAAuB,CAAE,EACjD,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,WAAW,CAAE,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAE,GACxE,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE,CAgNvB"}
@@ -1,4 +1,4 @@
1
- import type { DragPreviewRenderProps, GridOverlayRenderProps, ResizeDelta, ResizeHandleRenderProps } from '../shared/types';
1
+ import type { DragPreviewRenderProps, GridItemLimits, GridOverlayRenderProps, ResizeDelta, ResizeHandleRenderProps } from '../shared/types';
2
2
  import type { ResizeSnapSize } from '../shared/resize-snap';
3
3
  /**
4
4
  * Dashboard grid layout item definition.
@@ -29,6 +29,20 @@ export type DashboardGridLayoutItem = {
29
29
  * omitted, the item falls back to its index in the `layout` array.
30
30
  */
31
31
  order?: number;
32
+ /**
33
+ * Whether the item can be dragged while the surface is in edit mode.
34
+ * When `false`, the item is pinned: it also holds its index while the
35
+ * other items reorder around it.
36
+ *
37
+ * @default true
38
+ */
39
+ draggable?: boolean;
40
+ /**
41
+ * Whether the item can be resized while the surface is in edit mode.
42
+ *
43
+ * @default true
44
+ */
45
+ resizable?: boolean;
32
46
  };
33
47
  /**
34
48
  * Props for the internal `<GridItem />` wrapper.
@@ -48,6 +62,18 @@ export type GridItemProps = {
48
62
  * @default false
49
63
  */
50
64
  disabled?: boolean;
65
+ /**
66
+ * Whether the item can be dragged. Combined with `disabled`.
67
+ *
68
+ * @default true
69
+ */
70
+ draggable?: boolean;
71
+ /**
72
+ * Whether the item can be resized. Combined with `disabled`.
73
+ *
74
+ * @default true
75
+ */
76
+ resizable?: boolean;
51
77
  /**
52
78
  * Whether the item can be resized vertically. Disabled when the
53
79
  * grid uses `rowHeight: 'auto'`, where row height is driven by
@@ -105,6 +131,16 @@ export type GridItemProps = {
105
131
  * Omitted when vertical resize is disabled.
106
132
  */
107
133
  minResizeHeightPx?: number;
134
+ /**
135
+ * Maximum tile width while resizing, in pixels. Omitted when the
136
+ * item declares no width limit.
137
+ */
138
+ maxResizeWidthPx?: number;
139
+ /**
140
+ * Maximum tile height while resizing, in pixels. Omitted when
141
+ * vertical resize is disabled or the item declares no height limit.
142
+ */
143
+ maxResizeHeightPx?: number;
108
144
  /**
109
145
  * Callback fired when the resize gesture ends.
110
146
  */
@@ -225,5 +261,11 @@ export interface DashboardGridProps extends Omit<React.ComponentPropsWithoutRef<
225
261
  * down to 1.
226
262
  */
227
263
  minColumnWidth?: number;
264
+ /**
265
+ * Per-item size limits in pixels, keyed by layout item key. Width
266
+ * bounds saturate at the column count; `'full'` and `'fill'` widths
267
+ * respect a maximum.
268
+ */
269
+ itemLimits?: Record<string, GridItemLimits>;
228
270
  }
229
271
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
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CAAC;IAEpE;;;;;;;;;;;;;;OAcG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,sBAAsB,CAAE,CAAC;IAElE;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,sBAAsB,CAAE,CAAC;IAElE;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAE,MAAM,EAAE,cAAc,CAAE,CAAC;CAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard-lanes/index.tsx"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAA4B,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAyB7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,cAAc,gHAqgB1B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard-lanes/index.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAA4B,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAyB7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,cAAc,gHAkkB1B,CAAC"}
@@ -21,6 +21,18 @@ export type LanesItemProps = {
21
21
  * Whether drag and resize interactions are disabled.
22
22
  */
23
23
  disabled?: boolean;
24
+ /**
25
+ * Whether the item can be dragged. Combined with `disabled`.
26
+ *
27
+ * @default true
28
+ */
29
+ draggable?: boolean;
30
+ /**
31
+ * Whether the item can be resized. Combined with `disabled`.
32
+ *
33
+ * @default true
34
+ */
35
+ resizable?: boolean;
24
36
  /**
25
37
  * Whether any tile in the surface is currently being dragged or
26
38
  * resized. Drives the drag activator cursor.
@@ -45,8 +57,13 @@ export type LanesItemProps = {
45
57
  * Minimum tile width while resizing, in pixels (one column track).
46
58
  */
47
59
  minResizeWidthPx: number;
60
+ /**
61
+ * Maximum tile width while resizing, in pixels. Omitted when the
62
+ * item declares no width limit.
63
+ */
64
+ maxResizeWidthPx?: number;
48
65
  onResizeEnd: () => void;
49
66
  renderResizeHandle?: React.ComponentType<ResizeHandleRenderProps>;
50
67
  };
51
- export declare function LanesItem({ itemKey, placementStyle, disabled, interacting, children, actionableArea, onResize, onResizeEnd, resizeSnapPreview, minResizeWidthPx, renderResizeHandle, dragging, }: LanesItemProps): import("react").JSX.Element;
68
+ export declare function LanesItem({ itemKey, placementStyle, disabled, draggable, resizable, interacting, children, actionableArea, onResize, onResizeEnd, resizeSnapPreview, minResizeWidthPx, maxResizeWidthPx, renderResizeHandle, dragging, }: LanesItemProps): import("react").JSX.Element;
52
69
  //# sourceMappingURL=lanes-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lanes-item.d.ts","sourceRoot":"","sources":["../../src/dashboard-lanes/lanes-item.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAgB5E;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEjC,QAAQ,EAAE,CAAE,EAAE,EAAE,MAAM,EAAE,KAAK,E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