@wordpress/grid 0.4.0 → 0.6.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 (95) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/dashboard-grid/grid-item.cjs.map +2 -2
  3. package/build/dashboard-grid/index.cjs +3 -3
  4. package/build/dashboard-grid/index.cjs.map +2 -2
  5. package/build/dashboard-grid/resolve-fill-widths.cjs.map +2 -2
  6. package/build/dashboard-grid/types.cjs.map +1 -1
  7. package/build/dashboard-lanes/index.cjs +3 -3
  8. package/build/dashboard-lanes/index.cjs.map +2 -2
  9. package/build/dashboard-lanes/lanes-item.cjs.map +2 -2
  10. package/build/dashboard-lanes/types.cjs.map +1 -1
  11. package/build/dashboard-lanes/use-lane-placement.cjs.map +2 -2
  12. package/build/shared/drag-overlay-drop-animation.cjs.map +2 -2
  13. package/build/shared/grid-overlay.cjs.map +2 -2
  14. package/build/shared/item-exit-overlay.cjs.map +2 -2
  15. package/build/shared/resize-handle.cjs.map +2 -2
  16. package/build/shared/types.cjs.map +1 -1
  17. package/build/shared/use-item-exit-animation.cjs.map +2 -2
  18. package/build/shared/use-layout-shift-animation.cjs.map +2 -2
  19. package/build-module/dashboard-grid/grid-item.mjs.map +2 -2
  20. package/build-module/dashboard-grid/index.mjs +3 -3
  21. package/build-module/dashboard-grid/index.mjs.map +2 -2
  22. package/build-module/dashboard-grid/resolve-fill-widths.mjs.map +2 -2
  23. package/build-module/dashboard-lanes/index.mjs +3 -3
  24. package/build-module/dashboard-lanes/index.mjs.map +2 -2
  25. package/build-module/dashboard-lanes/lanes-item.mjs.map +2 -2
  26. package/build-module/dashboard-lanes/use-lane-placement.mjs.map +2 -2
  27. package/build-module/shared/drag-overlay-drop-animation.mjs.map +2 -2
  28. package/build-module/shared/grid-overlay.mjs.map +2 -2
  29. package/build-module/shared/item-exit-overlay.mjs.map +2 -2
  30. package/build-module/shared/resize-handle.mjs.map +2 -2
  31. package/build-module/shared/use-item-exit-animation.mjs.map +2 -2
  32. package/build-module/shared/use-layout-shift-animation.mjs.map +2 -2
  33. package/build-types/dashboard-grid/grid-item.d.ts.map +1 -1
  34. package/build-types/dashboard-grid/index.d.ts.map +1 -1
  35. package/build-types/dashboard-grid/resolve-fill-widths.d.ts +0 -3
  36. package/build-types/dashboard-grid/resolve-fill-widths.d.ts.map +1 -1
  37. package/build-types/dashboard-grid/types.d.ts +0 -3
  38. package/build-types/dashboard-grid/types.d.ts.map +1 -1
  39. package/build-types/dashboard-lanes/index.d.ts.map +1 -1
  40. package/build-types/dashboard-lanes/lanes-item.d.ts.map +1 -1
  41. package/build-types/dashboard-lanes/types.d.ts +0 -3
  42. package/build-types/dashboard-lanes/types.d.ts.map +1 -1
  43. package/build-types/dashboard-lanes/use-lane-placement.d.ts.map +1 -1
  44. package/build-types/shared/drag-overlay-drop-animation.d.ts.map +1 -1
  45. package/build-types/shared/grid-overlay.d.ts +0 -3
  46. package/build-types/shared/grid-overlay.d.ts.map +1 -1
  47. package/build-types/shared/item-exit-overlay.d.ts.map +1 -1
  48. package/build-types/shared/resize-handle.d.ts +0 -3
  49. package/build-types/shared/resize-handle.d.ts.map +1 -1
  50. package/build-types/shared/types.d.ts +0 -3
  51. package/build-types/shared/types.d.ts.map +1 -1
  52. package/build-types/shared/use-item-exit-animation.d.ts +0 -3
  53. package/build-types/shared/use-item-exit-animation.d.ts.map +1 -1
  54. package/build-types/shared/use-layout-shift-animation.d.ts.map +1 -1
  55. package/package.json +10 -9
  56. package/src/dashboard-grid/grid-item.tsx +0 -11
  57. package/src/dashboard-grid/grid.module.css +6 -6
  58. package/src/dashboard-grid/index.tsx +1 -12
  59. package/src/dashboard-grid/resolve-fill-widths.ts +0 -3
  60. package/src/dashboard-grid/stories/index.story.tsx +15 -11
  61. package/src/dashboard-grid/test/keyboard-activation.test.tsx +0 -7
  62. package/src/dashboard-grid/test/resolve-fill-widths.test.ts +0 -3
  63. package/src/dashboard-grid/types.ts +0 -3
  64. package/src/dashboard-lanes/index.tsx +1 -12
  65. package/src/dashboard-lanes/lanes-item.tsx +0 -11
  66. package/src/dashboard-lanes/lanes.module.css +6 -6
  67. package/src/dashboard-lanes/stories/index.story.tsx +25 -11
  68. package/src/dashboard-lanes/test/keyboard-activation.test.tsx +0 -7
  69. package/src/dashboard-lanes/test/lane-placement.test.ts +0 -3
  70. package/src/dashboard-lanes/test/use-lane-placement.test.tsx +10 -14
  71. package/src/dashboard-lanes/types.ts +0 -3
  72. package/src/dashboard-lanes/use-lane-placement.ts +0 -7
  73. package/src/shared/drag-overlay-drop-animation.ts +0 -3
  74. package/src/shared/grid-overlay.tsx +0 -11
  75. package/src/shared/item-exit-overlay.tsx +0 -3
  76. package/src/shared/resize-handle.tsx +0 -11
  77. package/src/shared/types.ts +0 -3
  78. package/src/shared/use-item-exit-animation.ts +0 -7
  79. package/src/shared/use-layout-shift-animation.ts +0 -7
  80. package/build-types/dashboard-grid/stories/index.story.d.ts +0 -98
  81. package/build-types/dashboard-grid/stories/index.story.d.ts.map +0 -1
  82. package/build-types/dashboard-lanes/stories/index.story.d.ts +0 -64
  83. package/build-types/dashboard-lanes/stories/index.story.d.ts.map +0 -1
  84. package/build-types/grid-item.d.ts +0 -3
  85. package/build-types/grid-item.d.ts.map +0 -1
  86. package/build-types/grid.d.ts +0 -34
  87. package/build-types/grid.d.ts.map +0 -1
  88. package/build-types/resize-handle.d.ts +0 -23
  89. package/build-types/resize-handle.d.ts.map +0 -1
  90. package/build-types/resolve-fill-widths.d.ts +0 -26
  91. package/build-types/resolve-fill-widths.d.ts.map +0 -1
  92. package/build-types/stories/index.story.d.ts +0 -50
  93. package/build-types/stories/index.story.d.ts.map +0 -1
  94. package/build-types/types.d.ts +0 -266
  95. package/build-types/types.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/shared/resize-handle.tsx", "../../../style-runtime/src/index.ts", "../../src/shared/resize-handle.module.css"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { DndContext, useDraggable } from '@dnd-kit/core';\nimport type { DragMoveEvent } from '@dnd-kit/core';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { useMergeRefs, useThrottle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { ResizeDelta, ResizeHandleProps } from './types';\nimport styles from './resize-handle.module.css';\n\n/**\n * Sets `document.documentElement.style.cursor` for the duration of a drag\n * and restores it on cleanup. Lives outside the component so cursor writes\n * are not analyzed as mutating values derived from refs in the component\n * body (react-hooks/immutability).\n *\n * @param getDocument Returns the document whose root element should receive\n * the cursor (handle owner, or global `document`).\n * @param cursor CSS cursor value while active.\n * @return Cleanup that restores the previous cursor.\n */\nfunction lockDocumentCursorWhileActive(\n\tgetDocument: () => Document,\n\tcursor: string\n): () => void {\n\tconst root = getDocument().documentElement;\n\tconst previous = root.style.cursor;\n\troot.style.cursor = cursor;\n\treturn () => {\n\t\troot.style.cursor = previous;\n\t};\n}\n\nfunction ResizeHandle( {\n\titemId,\n\tverticalResizable = true,\n\trenderResizeHandle,\n}: ResizeHandleProps ) {\n\tconst { attributes, listeners, setNodeRef, isDragging } = useDraggable( {\n\t\tid: 'draggable',\n\t\tdata: { itemId },\n\t} );\n\n\t// Snapshot owner document on mount/update via ref callback so the\n\t// cursor-lock effect can resolve the correct document in an iframe.\n\tconst ownerDocumentRef = useRef< Document | null >( null );\n\tconst setOwnerDocumentRef = useCallback( ( node: HTMLElement | null ) => {\n\t\townerDocumentRef.current = node?.ownerDocument ?? null;\n\t}, [] );\n\tconst mergedRef = useMergeRefs( [ setOwnerDocumentRef, setNodeRef ] );\n\n\t// Lock the document cursor while the gesture is active. Without\n\t// this, the OS pointer reverts to the default arrow as soon as it\n\t// leaves the handle's hit area, even though the resize is still\n\t// in progress.\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\treturn;\n\t\t}\n\t\tconst cursor = verticalResizable ? 'nwse-resize' : 'ew-resize';\n\t\treturn lockDocumentCursorWhileActive(\n\t\t\t() => ownerDocumentRef.current ?? document,\n\t\t\tcursor\n\t\t);\n\t}, [ isDragging, verticalResizable ] );\n\n\tif ( renderResizeHandle ) {\n\t\tconst RenderResizeHandle = renderResizeHandle;\n\t\treturn (\n\t\t\t<RenderResizeHandle\n\t\t\t\tref={ mergedRef }\n\t\t\t\tlisteners={ listeners }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tverticalResizable={ verticalResizable }\n\t\t\t\tisResizing={ isDragging }\n\t\t\t\titemId={ itemId }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={ mergedRef }\n\t\t\tclassName={ clsx(\n\t\t\t\tstyles[ 'resize-handle' ],\n\t\t\t\t! verticalResizable && styles[ 'is-horizontal-only' ]\n\t\t\t) }\n\t\t\t{ ...listeners }\n\t\t\t{ ...attributes }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a corner resize handle inside an isolated `<DndContext>`.\n * Reports the cursor offset since the gesture started (in pixels)\n * via `onResize`, throttled to one animation frame so the grid\n * commit loop runs at most once per paint.\n *\n * Auto-scroll is enabled with a tight trigger zone and a low\n * acceleration so a resize gesture near the viewport edge scrolls\n * the page only when the user deliberately pushes against the very\n * edge, and even then at a pace the user can interrupt by releasing.\n * Default tuning would otherwise produce a runaway loop where the\n * page scrolls fast, dnd-kit's document-coordinate `delta` inflates\n * with the scroll, and the tile keeps growing without further user\n * input.\n *\n * @param props Component props.\n */\nexport default function ResizeHandleWrapper( props: ResizeHandleProps ) {\n\tconst throttleDelay = 16;\n\tconst throttledResize = useThrottle( ( delta: ResizeDelta ) => {\n\t\tif ( props.onResize ) {\n\t\t\tprops.onResize( delta );\n\t\t}\n\t}, throttleDelay );\n\n\t// `event.delta` is the cursor offset from the gesture start —\n\t// not from the handle's current position — so it stays stable\n\t// even when the tile (and therefore the handle) jumps a column.\n\t// The grid's resize logic snapshots the start width and adds\n\t// `delta`, so the two must share the same frame of reference.\n\tconst handleDragMove = ( event: DragMoveEvent ) => {\n\t\tif ( event.active.id !== 'draggable' ) {\n\t\t\treturn;\n\t\t}\n\t\tthrottledResize( {\n\t\t\twidth: event.delta.x,\n\t\t\theight: event.delta.y,\n\t\t} );\n\t};\n\n\tconst handleDragEnd = () => {\n\t\tif ( props.onResizeEnd ) {\n\t\t\tprops.onResizeEnd();\n\t\t}\n\t};\n\n\treturn (\n\t\t<DndContext\n\t\t\tautoScroll={ {\n\t\t\t\tthreshold: { x: 0.005, y: 0.005 },\n\t\t\t\tacceleration: 1,\n\t\t\t} }\n\t\t\tonDragMove={ handleDragMove }\n\t\t\tonDragEnd={ handleDragEnd }\n\t\t>\n\t\t\t<div className={ styles[ 'resize-handle-slot' ] }>\n\t\t\t\t<ResizeHandle { ...props } />\n\t\t\t</div>\n\t\t</DndContext>\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(\"13645360b3\", \"._91523dc3a37aecb8__resize-handle-slot{opacity:1}@media (prefers-reduced-motion:no-preference){._91523dc3a37aecb8__resize-handle-slot{transition:opacity var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1))}}[data-wp-grid-dragging] ._91523dc3a37aecb8__resize-handle-slot,[data-wp-grid-resizing] ._91523dc3a37aecb8__resize-handle-slot{opacity:0;pointer-events:none}[data-wp-grid-resizing]\\n[data-wp-grid-item-resizing]\\n._91523dc3a37aecb8__resize-handle-slot{opacity:1;pointer-events:auto}._4da787f72dc00d8b__resize-handle{border-block-end:12px solid var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));border-inline-start:12px solid transparent;bottom:0;cursor:nwse-resize;height:0;inset-inline-end:0;position:absolute;width:0;z-index:1}._885412b44a137da0__is-horizontal-only{align-items:center;background:transparent;border-style:none;bottom:auto;cursor:ew-resize;display:flex;height:40px;justify-content:center;top:50%;transform:translateY(-50%);width:16px}._885412b44a137da0__is-horizontal-only:before{background-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));border-radius:2px;content:\\\"\\\";height:24px;width:4px}@media (forced-colors:active){._885412b44a137da0__is-horizontal-only:before{background-color:Highlight}}\");\n}\nexport default {\"resize-handle-slot\":\"_91523dc3a37aecb8__resize-handle-slot\",\"resize-handle\":\"_4da787f72dc00d8b__resize-handle\",\"is-horizontal-only\":\"_885412b44a137da0__is-horizontal-only\"};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAyC;AAEzC,kBAAiB;AAKjB,qBAA+C;AAC/C,qBAA0C;;;ACD1C,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;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KAAM;AAAA,MACN,eAAY,YAAAA;AAAA,QACX,sBAAQ,eAAgB;AAAA,QACxB,CAAE,qBAAqB,sBAAQ,oBAAqB;AAAA,MACrD;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA;AAAA,EACN;AAEF;AAmBe,SAAR,oBAAsC,OAA2B;AACvE,QAAM,gBAAgB;AACtB,QAAM,sBAAkB,4BAAa,CAAE,UAAwB;AAC9D,QAAK,MAAM,UAAW;AACrB,YAAM,SAAU,KAAM;AAAA,IACvB;AAAA,EACD,GAAG,aAAc;AAOjB,QAAM,iBAAiB,CAAE,UAA0B;AAClD,QAAK,MAAM,OAAO,OAAO,aAAc;AACtC;AAAA,IACD;AACA,oBAAiB;AAAA,MAChB,OAAO,MAAM,MAAM;AAAA,MACnB,QAAQ,MAAM,MAAM;AAAA,IACrB,CAAE;AAAA,EACH;AAEA,QAAM,gBAAgB,MAAM;AAC3B,QAAK,MAAM,aAAc;AACxB,YAAM,YAAY;AAAA,IACnB;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,YAAa;AAAA,QACZ,WAAW,EAAE,GAAG,MAAO,GAAG,KAAM;AAAA,QAChC,cAAc;AAAA,MACf;AAAA,MACA,YAAa;AAAA,MACb,WAAY;AAAA,MAEZ,sDAAC,SAAI,WAAY,sBAAQ,oBAAqB,GAC7C,sDAAC,gBAAe,GAAG,OAAQ,GAC5B;AAAA;AAAA,EACD;AAEF;",
4
+ "sourcesContent": ["import { DndContext, useDraggable } from '@dnd-kit/core';\nimport type { DragMoveEvent } from '@dnd-kit/core';\nimport clsx from 'clsx';\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { useMergeRefs, useThrottle } from '@wordpress/compose';\nimport type { ResizeDelta, ResizeHandleProps } from './types';\nimport styles from './resize-handle.module.css';\n\n/**\n * Sets `document.documentElement.style.cursor` for the duration of a drag\n * and restores it on cleanup. Lives outside the component so cursor writes\n * are not analyzed as mutating values derived from refs in the component\n * body (react-hooks/immutability).\n *\n * @param getDocument Returns the document whose root element should receive\n * the cursor (handle owner, or global `document`).\n * @param cursor CSS cursor value while active.\n * @return Cleanup that restores the previous cursor.\n */\nfunction lockDocumentCursorWhileActive(\n\tgetDocument: () => Document,\n\tcursor: string\n): () => void {\n\tconst root = getDocument().documentElement;\n\tconst previous = root.style.cursor;\n\troot.style.cursor = cursor;\n\treturn () => {\n\t\troot.style.cursor = previous;\n\t};\n}\n\nfunction ResizeHandle( {\n\titemId,\n\tverticalResizable = true,\n\trenderResizeHandle,\n}: ResizeHandleProps ) {\n\tconst { attributes, listeners, setNodeRef, isDragging } = useDraggable( {\n\t\tid: 'draggable',\n\t\tdata: { itemId },\n\t} );\n\n\t// Snapshot owner document on mount/update via ref callback so the\n\t// cursor-lock effect can resolve the correct document in an iframe.\n\tconst ownerDocumentRef = useRef< Document | null >( null );\n\tconst setOwnerDocumentRef = useCallback( ( node: HTMLElement | null ) => {\n\t\townerDocumentRef.current = node?.ownerDocument ?? null;\n\t}, [] );\n\tconst mergedRef = useMergeRefs( [ setOwnerDocumentRef, setNodeRef ] );\n\n\t// Lock the document cursor while the gesture is active. Without\n\t// this, the OS pointer reverts to the default arrow as soon as it\n\t// leaves the handle's hit area, even though the resize is still\n\t// in progress.\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\treturn;\n\t\t}\n\t\tconst cursor = verticalResizable ? 'nwse-resize' : 'ew-resize';\n\t\treturn lockDocumentCursorWhileActive(\n\t\t\t() => ownerDocumentRef.current ?? document,\n\t\t\tcursor\n\t\t);\n\t}, [ isDragging, verticalResizable ] );\n\n\tif ( renderResizeHandle ) {\n\t\tconst RenderResizeHandle = renderResizeHandle;\n\t\treturn (\n\t\t\t<RenderResizeHandle\n\t\t\t\tref={ mergedRef }\n\t\t\t\tlisteners={ listeners }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tverticalResizable={ verticalResizable }\n\t\t\t\tisResizing={ isDragging }\n\t\t\t\titemId={ itemId }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tref={ mergedRef }\n\t\t\tclassName={ clsx(\n\t\t\t\tstyles[ 'resize-handle' ],\n\t\t\t\t! verticalResizable && styles[ 'is-horizontal-only' ]\n\t\t\t) }\n\t\t\t{ ...listeners }\n\t\t\t{ ...attributes }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a corner resize handle inside an isolated `<DndContext>`.\n * Reports the cursor offset since the gesture started (in pixels)\n * via `onResize`, throttled to one animation frame so the grid\n * commit loop runs at most once per paint.\n *\n * Auto-scroll is enabled with a tight trigger zone and a low\n * acceleration so a resize gesture near the viewport edge scrolls\n * the page only when the user deliberately pushes against the very\n * edge, and even then at a pace the user can interrupt by releasing.\n * Default tuning would otherwise produce a runaway loop where the\n * page scrolls fast, dnd-kit's document-coordinate `delta` inflates\n * with the scroll, and the tile keeps growing without further user\n * input.\n *\n * @param props Component props.\n */\nexport default function ResizeHandleWrapper( props: ResizeHandleProps ) {\n\tconst throttleDelay = 16;\n\tconst throttledResize = useThrottle( ( delta: ResizeDelta ) => {\n\t\tif ( props.onResize ) {\n\t\t\tprops.onResize( delta );\n\t\t}\n\t}, throttleDelay );\n\n\t// `event.delta` is the cursor offset from the gesture start —\n\t// not from the handle's current position — so it stays stable\n\t// even when the tile (and therefore the handle) jumps a column.\n\t// The grid's resize logic snapshots the start width and adds\n\t// `delta`, so the two must share the same frame of reference.\n\tconst handleDragMove = ( event: DragMoveEvent ) => {\n\t\tif ( event.active.id !== 'draggable' ) {\n\t\t\treturn;\n\t\t}\n\t\tthrottledResize( {\n\t\t\twidth: event.delta.x,\n\t\t\theight: event.delta.y,\n\t\t} );\n\t};\n\n\tconst handleDragEnd = () => {\n\t\tif ( props.onResizeEnd ) {\n\t\t\tprops.onResizeEnd();\n\t\t}\n\t};\n\n\treturn (\n\t\t<DndContext\n\t\t\tautoScroll={ {\n\t\t\t\tthreshold: { x: 0.005, y: 0.005 },\n\t\t\t\tacceleration: 1,\n\t\t\t} }\n\t\t\tonDragMove={ handleDragMove }\n\t\t\tonDragEnd={ handleDragEnd }\n\t\t>\n\t\t\t<div className={ styles[ 'resize-handle-slot' ] }>\n\t\t\t\t<ResizeHandle { ...props } />\n\t\t\t</div>\n\t\t</DndContext>\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(\"13645360b3\", \"._91523dc3a37aecb8__resize-handle-slot{opacity:1}@media (prefers-reduced-motion:no-preference){._91523dc3a37aecb8__resize-handle-slot{transition:opacity var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1))}}[data-wp-grid-dragging] ._91523dc3a37aecb8__resize-handle-slot,[data-wp-grid-resizing] ._91523dc3a37aecb8__resize-handle-slot{opacity:0;pointer-events:none}[data-wp-grid-resizing]\\n[data-wp-grid-item-resizing]\\n._91523dc3a37aecb8__resize-handle-slot{opacity:1;pointer-events:auto}._4da787f72dc00d8b__resize-handle{border-block-end:12px solid var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));border-inline-start:12px solid transparent;bottom:0;cursor:nwse-resize;height:0;inset-inline-end:0;position:absolute;width:0;z-index:1}._885412b44a137da0__is-horizontal-only{align-items:center;background:transparent;border-style:none;bottom:auto;cursor:ew-resize;display:flex;height:40px;justify-content:center;top:50%;transform:translateY(-50%);width:16px}._885412b44a137da0__is-horizontal-only:before{background-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));border-radius:2px;content:\\\"\\\";height:24px;width:4px}@media (forced-colors:active){._885412b44a137da0__is-horizontal-only:before{background-color:Highlight}}\");\n}\nexport default {\"resize-handle-slot\":\"_91523dc3a37aecb8__resize-handle-slot\",\"resize-handle\":\"_4da787f72dc00d8b__resize-handle\",\"is-horizontal-only\":\"_885412b44a137da0__is-horizontal-only\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAyC;AAEzC,kBAAiB;AACjB,qBAA+C;AAC/C,qBAA0C;;;ACM1C,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,KAAc;AAC3E,MAAK,CAAE,eAAe,MAAO;AAC5B;AAAA,EACD;AAEA,QAAM,UAAU,WAAW;AAC3B,MAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;AAEhE,MAAK,CAAE,gBAAiB;AACvB,qBAAiB,oBAAI,IAAI;AACzB,YAAQ,eAAe,IAAK,gBAAgB,cAAe;AAAA,EAC5D;AAEA,MAAK,eAAe,IAAK,IAAK,GAAI;AACjC;AAAA,EACD;AAKA,MAAK,0BAA2B,gBAAgB,IAAK,GA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OAAO,OAAO,aAAc;AACtC;AAAA,IACD;AACA,oBAAiB;AAAA,MAChB,OAAO,MAAM,MAAM;AAAA,MACnB,QAAQ,MAAM,MAAM;AAAA,IACrB,CAAE;AAAA,EACH;AAEA,QAAM,gBAAgB,MAAM;AAC3B,QAAK,MAAM,aAAc;AACxB,YAAM,YAAY;AAAA,IACnB;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,YAAa;AAAA,QACZ,WAAW,EAAE,GAAG,MAAO,GAAG,KAAM;AAAA,QAChC,cAAc;AAAA,MACf;AAAA,MACA,YAAa;AAAA,MACb,WAAY;AAAA,MAEZ,sDAAC,SAAI,WAAY,sBAAQ,oBAAqB,GAC7C,sDAAC,gBAAe,GAAG,OAAQ,GAC5B;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": ["clsx"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/shared/types.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport type { useDraggable } from '@dnd-kit/core';\n\n// `useDraggable`'s `listeners` and `attributes` types are not exported\n// from `@dnd-kit/core`'s public surface, so derive them from the hook\n// itself rather than via a deep import.\ntype DraggableBindings = ReturnType< typeof useDraggable >;\n\n/**\n * Cursor offset reported by the resize handle, in pixels relative to\n * the gesture start. Width and height are independent so the surface\n * can step columns and rows separately.\n */\nexport type ResizeDelta = {\n\twidth: number;\n\theight: number;\n};\n\n/**\n * Props received by a custom resize handle component. Spread `listeners`\n * and `attributes` onto the element that should respond to the gesture,\n * and assign `ref` to the same element so dnd-kit can track it.\n */\nexport interface ResizeHandleRenderProps {\n\t/**\n\t * Ref callback to attach to the gesture-bearing element.\n\t */\n\tref: DraggableBindings[ 'setNodeRef' ];\n\n\t/**\n\t * Pointer/keyboard event listeners that initiate the drag.\n\t */\n\tlisteners: DraggableBindings[ 'listeners' ];\n\n\t/**\n\t * Accessibility and dnd-kit attributes (role, aria-*, tabIndex…).\n\t */\n\tattributes: DraggableBindings[ 'attributes' ];\n\n\t/**\n\t * Whether vertical resizing is allowed for this tile. Useful for\n\t * adapting the cursor or visual cue.\n\t */\n\tverticalResizable: boolean;\n\n\t/**\n\t * True while the user is actively dragging this handle. Use it to\n\t * swap colors, icons, or transforms during the gesture.\n\t */\n\tisResizing: boolean;\n\n\t/**\n\t * Owning item's `key`. Available so consumers can render per-tile\n\t * content if needed.\n\t */\n\titemId?: string;\n}\n\n/**\n * Props received by a custom drag-preview component. The surface mounts\n * the component inside `<DragOverlay>` and supplies the active tile's\n * cloned children plus its `key`. The component is responsible for the\n * visual chrome of the dragged clone (shadow, radius, padding); the\n * surface keeps a thin functional wrapper around it that owns the lift\n * cue, the cursor, and pointer pass-through during the gesture.\n */\nexport interface DragPreviewRenderProps {\n\t/**\n\t * The cloned tile content the surface mounts inside the\n\t * `<DragOverlay>` portal. Render it where the visual wrapper\n\t * expects the tile body.\n\t */\n\tchildren: React.ReactNode;\n\n\t/**\n\t * Owning tile's `key`. Useful when the visual chrome needs to\n\t * vary by which tile is being dragged.\n\t */\n\titemId: string;\n}\n\n/**\n * Props received by a custom grid overlay component. The overlay\n * paints behind the tiles in edit mode to visualize the column tracks\n * and (when `rowHeight` is defined) the row tracks. Receives a\n * snapshot of the surface's resolved layout parameters so the visual\n * can reproduce the tracks pixel-accurately without re-deriving them.\n *\n * Reused by both `DashboardGrid` and `DashboardLanes`: lanes pass no\n * `rowHeight` because heights are content-driven.\n */\nexport interface GridOverlayRenderProps {\n\t/**\n\t * Number of column tracks in the active surface. In responsive\n\t * mode (`minColumnWidth`), this is the count derived from the\n\t * container width, not the prop value.\n\t */\n\tcolumns: number;\n\n\t/**\n\t * Row height in pixels for surfaces with uniform rows. Omitted on\n\t * surfaces with content-driven heights (lanes) or when row height\n\t * is `'auto'`; in those cases row markers are omitted.\n\t */\n\trowHeight?: number;\n\n\t/**\n\t * Number of row tracks to mirror in each column. Derived from the\n\t * grid container height when `rowHeight` is numeric; omitted when\n\t * row height is unknown.\n\t */\n\trows?: number;\n\n\t/**\n\t * Whether the overlay should be visible. Surfaces render the\n\t * overlay even when `false` so the implementation can transition\n\t * opacity in and out; while `false`, the overlay must hide itself\n\t * (and ideally release paint cost via `visibility: hidden` or an\n\t * equivalent).\n\t */\n\tisActive: boolean;\n}\n\n/**\n * Props for the internal `<ResizeHandle />` wrapper.\n */\nexport interface ResizeHandleProps {\n\t/**\n\t * Owning item's `key`. Forwarded as `data.itemId` on the draggable\n\t * so the parent can correlate the gesture with a tile if needed.\n\t */\n\titemId?: string;\n\n\t/**\n\t * Whether the handle should track vertical movement. When false,\n\t * the handle still appears but only emits horizontal deltas, and\n\t * the cursor is constrained to the column resize axis.\n\t *\n\t * @default true\n\t */\n\tverticalResizable?: boolean;\n\n\t/**\n\t * Callback fired while the handle is being dragged. Receives the\n\t * cursor offset from the gesture start in pixels.\n\t */\n\tonResize?: ( delta: ResizeDelta ) => void;\n\n\t/**\n\t * Callback fired when the gesture ends.\n\t */\n\tonResizeEnd?: () => void;\n\n\t/**\n\t * Component that overrides the default corner triangle with a\n\t * custom element. Receives gesture wiring (`ref`, `listeners`,\n\t * `attributes`) plus context. The surface keeps ownership of the\n\t * `<DndContext>` and the throttled delta loop; consumers are only\n\t * responsible for the visual.\n\t */\n\trenderResizeHandle?: React.ComponentType< ResizeHandleRenderProps >;\n}\n"],
4
+ "sourcesContent": ["import type { useDraggable } from '@dnd-kit/core';\n\n// `useDraggable`'s `listeners` and `attributes` types are not exported\n// from `@dnd-kit/core`'s public surface, so derive them from the hook\n// itself rather than via a deep import.\ntype DraggableBindings = ReturnType< typeof useDraggable >;\n\n/**\n * Cursor offset reported by the resize handle, in pixels relative to\n * the gesture start. Width and height are independent so the surface\n * can step columns and rows separately.\n */\nexport type ResizeDelta = {\n\twidth: number;\n\theight: number;\n};\n\n/**\n * Props received by a custom resize handle component. Spread `listeners`\n * and `attributes` onto the element that should respond to the gesture,\n * and assign `ref` to the same element so dnd-kit can track it.\n */\nexport interface ResizeHandleRenderProps {\n\t/**\n\t * Ref callback to attach to the gesture-bearing element.\n\t */\n\tref: DraggableBindings[ 'setNodeRef' ];\n\n\t/**\n\t * Pointer/keyboard event listeners that initiate the drag.\n\t */\n\tlisteners: DraggableBindings[ 'listeners' ];\n\n\t/**\n\t * Accessibility and dnd-kit attributes (role, aria-*, tabIndex…).\n\t */\n\tattributes: DraggableBindings[ 'attributes' ];\n\n\t/**\n\t * Whether vertical resizing is allowed for this tile. Useful for\n\t * adapting the cursor or visual cue.\n\t */\n\tverticalResizable: boolean;\n\n\t/**\n\t * True while the user is actively dragging this handle. Use it to\n\t * swap colors, icons, or transforms during the gesture.\n\t */\n\tisResizing: boolean;\n\n\t/**\n\t * Owning item's `key`. Available so consumers can render per-tile\n\t * content if needed.\n\t */\n\titemId?: string;\n}\n\n/**\n * Props received by a custom drag-preview component. The surface mounts\n * the component inside `<DragOverlay>` and supplies the active tile's\n * cloned children plus its `key`. The component is responsible for the\n * visual chrome of the dragged clone (shadow, radius, padding); the\n * surface keeps a thin functional wrapper around it that owns the lift\n * cue, the cursor, and pointer pass-through during the gesture.\n */\nexport interface DragPreviewRenderProps {\n\t/**\n\t * The cloned tile content the surface mounts inside the\n\t * `<DragOverlay>` portal. Render it where the visual wrapper\n\t * expects the tile body.\n\t */\n\tchildren: React.ReactNode;\n\n\t/**\n\t * Owning tile's `key`. Useful when the visual chrome needs to\n\t * vary by which tile is being dragged.\n\t */\n\titemId: string;\n}\n\n/**\n * Props received by a custom grid overlay component. The overlay\n * paints behind the tiles in edit mode to visualize the column tracks\n * and (when `rowHeight` is defined) the row tracks. Receives a\n * snapshot of the surface's resolved layout parameters so the visual\n * can reproduce the tracks pixel-accurately without re-deriving them.\n *\n * Reused by both `DashboardGrid` and `DashboardLanes`: lanes pass no\n * `rowHeight` because heights are content-driven.\n */\nexport interface GridOverlayRenderProps {\n\t/**\n\t * Number of column tracks in the active surface. In responsive\n\t * mode (`minColumnWidth`), this is the count derived from the\n\t * container width, not the prop value.\n\t */\n\tcolumns: number;\n\n\t/**\n\t * Row height in pixels for surfaces with uniform rows. Omitted on\n\t * surfaces with content-driven heights (lanes) or when row height\n\t * is `'auto'`; in those cases row markers are omitted.\n\t */\n\trowHeight?: number;\n\n\t/**\n\t * Number of row tracks to mirror in each column. Derived from the\n\t * grid container height when `rowHeight` is numeric; omitted when\n\t * row height is unknown.\n\t */\n\trows?: number;\n\n\t/**\n\t * Whether the overlay should be visible. Surfaces render the\n\t * overlay even when `false` so the implementation can transition\n\t * opacity in and out; while `false`, the overlay must hide itself\n\t * (and ideally release paint cost via `visibility: hidden` or an\n\t * equivalent).\n\t */\n\tisActive: boolean;\n}\n\n/**\n * Props for the internal `<ResizeHandle />` wrapper.\n */\nexport interface ResizeHandleProps {\n\t/**\n\t * Owning item's `key`. Forwarded as `data.itemId` on the draggable\n\t * so the parent can correlate the gesture with a tile if needed.\n\t */\n\titemId?: string;\n\n\t/**\n\t * Whether the handle should track vertical movement. When false,\n\t * the handle still appears but only emits horizontal deltas, and\n\t * the cursor is constrained to the column resize axis.\n\t *\n\t * @default true\n\t */\n\tverticalResizable?: boolean;\n\n\t/**\n\t * Callback fired while the handle is being dragged. Receives the\n\t * cursor offset from the gesture start in pixels.\n\t */\n\tonResize?: ( delta: ResizeDelta ) => void;\n\n\t/**\n\t * Callback fired when the gesture ends.\n\t */\n\tonResizeEnd?: () => void;\n\n\t/**\n\t * Component that overrides the default corner triangle with a\n\t * custom element. Receives gesture wiring (`ref`, `listeners`,\n\t * `attributes`) plus context. The surface keeps ownership of the\n\t * `<DndContext>` and the throttled delta loop; consumers are only\n\t * responsible for the visual.\n\t */\n\trenderResizeHandle?: React.ComponentType< ResizeHandleRenderProps >;\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/shared/use-item-exit-animation.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tuseCallback,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ItemExitOverlayRect } from './item-exit-overlay';\nimport type { RectSnapshot } from './use-layout-shift-animation';\n\n/*\n * Last-resort cleanup if `animationend` never fires (the overlay's\n * `onAnimationEnd` is the primary path). Kept well above the motion\n * token durations so the timeout can never clip the exit animation.\n */\nconst EXIT_SAFETY_TIMEOUT_MS = 1000;\n\nexport type ExitingGridItem = {\n\tkey: string;\n\trect: ItemExitOverlayRect;\n\tchild: React.ReactElement;\n};\n\ntype UseItemExitAnimationOptions = {\n\tcontainer: HTMLElement | null;\n\tenabled: boolean;\n\tlayoutKeys: ReadonlySet< string >;\n\tgetPositionsBeforeLastChange: () => ReadonlyMap<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null;\n\tchildrenCacheRef: React.MutableRefObject<\n\t\tMap< string, React.ReactElement >\n\t>;\n};\n\ntype UseItemExitAnimationResult = {\n\texitingItems: ExitingGridItem[];\n\thasExitingItems: boolean;\n\tclearExitingItem: ( key: string ) => void;\n};\n\nfunction prefersReducedMotion(): boolean {\n\treturn (\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.matchMedia( '(prefers-reduced-motion: reduce)' ).matches\n\t);\n}\n\n/**\n * When `layout` loses keys in edit mode, keeps a short-lived overlay at\n * the removed tile's last position (scale + fade) while siblings FLIP.\n *\n * @param root0 Hook options.\n * @param root0.container Surface root that contains grid tiles.\n * @param root0.enabled When false, exiting state is cleared.\n * @param root0.layoutKeys Keys in the committed `layout` prop.\n * @param root0.getPositionsBeforeLastChange Container-relative rects before the latest layout commit.\n * @param root0.childrenCacheRef Last rendered children keyed by tile id.\n * @return Exiting overlays and a callback to dismiss one by key.\n */\nexport function useItemExitAnimation( {\n\tcontainer,\n\tenabled,\n\tlayoutKeys,\n\tgetPositionsBeforeLastChange,\n\tchildrenCacheRef,\n}: UseItemExitAnimationOptions ): UseItemExitAnimationResult {\n\tconst [ exitingItems, setExitingItems ] = useState< ExitingGridItem[] >(\n\t\t[]\n\t);\n\tconst prevLayoutKeysRef = useRef< Set< string > >( new Set() );\n\tconst exitTimeoutsRef = useRef<\n\t\tMap< string, ReturnType< typeof setTimeout > >\n\t>( new Map() );\n\n\tconst clearExitingItem = useCallback(\n\t\t( key: string ) => {\n\t\t\tconst timeout = exitTimeoutsRef.current.get( key );\n\t\t\tif ( timeout ) {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t\texitTimeoutsRef.current.delete( key );\n\t\t\t}\n\t\t\tsetExitingItems( ( current ) =>\n\t\t\t\tcurrent.filter( ( item ) => item.key !== key )\n\t\t\t);\n\t\t\tchildrenCacheRef.current.delete( key );\n\t\t},\n\t\t[ childrenCacheRef ]\n\t);\n\n\tconst scheduleExitComplete = useCallback(\n\t\t( key: string ) => {\n\t\t\tif ( exitTimeoutsRef.current.has( key ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst timeout = setTimeout( () => {\n\t\t\t\texitTimeoutsRef.current.delete( key );\n\t\t\t\tclearExitingItem( key );\n\t\t\t}, EXIT_SAFETY_TIMEOUT_MS );\n\t\t\texitTimeoutsRef.current.set( key, timeout );\n\t\t},\n\t\t[ clearExitingItem ]\n\t);\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! enabled || ! container ) {\n\t\t\tprevLayoutKeysRef.current = new Set( layoutKeys );\n\t\t\tfor ( const timeout of exitTimeoutsRef.current.values() ) {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t}\n\t\t\texitTimeoutsRef.current.clear();\n\t\t\tsetExitingItems( [] );\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevKeys = prevLayoutKeysRef.current;\n\t\tconst removed: string[] = [];\n\t\tfor ( const key of prevKeys ) {\n\t\t\tif ( ! layoutKeys.has( key ) ) {\n\t\t\t\tremoved.push( key );\n\t\t\t}\n\t\t}\n\t\tprevLayoutKeysRef.current = new Set( layoutKeys );\n\n\t\tif ( removed.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lastPositions = getPositionsBeforeLastChange();\n\t\tif ( ! lastPositions ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextExiting: ExitingGridItem[] = [];\n\t\tfor ( const key of removed ) {\n\t\t\tconst position = lastPositions.get( key );\n\t\t\tconst child = childrenCacheRef.current.get( key );\n\t\t\tif ( ! position || ! child ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnextExiting.push( {\n\t\t\t\tkey,\n\t\t\t\trect: position,\n\t\t\t\tchild,\n\t\t\t} );\n\t\t}\n\n\t\tif ( nextExiting.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( prefersReducedMotion() ) {\n\t\t\t// Siblings snap into place via the layout-shift hook; skip the\n\t\t\t// exit ghost (and its synchronous mount) entirely.\n\t\t\tfor ( const { key } of nextExiting ) {\n\t\t\t\tchildrenCacheRef.current.delete( key );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// A state update inside a layout effect is flushed before paint,\n\t\t// so the ghost mounts in the same frame the tile is removed.\n\t\tsetExitingItems( ( current ) => [ ...current, ...nextExiting ] );\n\n\t\tfor ( const { key } of nextExiting ) {\n\t\t\tscheduleExitComplete( key );\n\t\t}\n\t}, [\n\t\tcontainer,\n\t\tenabled,\n\t\tgetPositionsBeforeLastChange,\n\t\tlayoutKeys,\n\t\tchildrenCacheRef,\n\t\tscheduleExitComplete,\n\t] );\n\n\tuseLayoutEffect( () => {\n\t\tconst exitTimeouts = exitTimeoutsRef.current;\n\t\treturn () => {\n\t\t\tfor ( const timeout of exitTimeouts.values() ) {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t}\n\t\t\texitTimeouts.clear();\n\t\t};\n\t}, [] );\n\n\treturn {\n\t\texitingItems,\n\t\thasExitingItems: exitingItems.length > 0,\n\t\tclearExitingItem,\n\t};\n}\n"],
5
- "mappings": ";;;;;;;;;;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B;AACA,mBAAa,MAAM;AAAA,IACpB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SAAO;AAAA,IACN;AAAA,IACA,iBAAiB,aAAa,SAAS;AAAA,IACvC;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["import {\n\tuseCallback,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport type { ItemExitOverlayRect } from './item-exit-overlay';\nimport type { RectSnapshot } from './use-layout-shift-animation';\n\n/*\n * Last-resort cleanup if `animationend` never fires (the overlay's\n * `onAnimationEnd` is the primary path). Kept well above the motion\n * token durations so the timeout can never clip the exit animation.\n */\nconst EXIT_SAFETY_TIMEOUT_MS = 1000;\n\nexport type ExitingGridItem = {\n\tkey: string;\n\trect: ItemExitOverlayRect;\n\tchild: React.ReactElement;\n};\n\ntype UseItemExitAnimationOptions = {\n\tcontainer: HTMLElement | null;\n\tenabled: boolean;\n\tlayoutKeys: ReadonlySet< string >;\n\tgetPositionsBeforeLastChange: () => ReadonlyMap<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null;\n\tchildrenCacheRef: React.MutableRefObject<\n\t\tMap< string, React.ReactElement >\n\t>;\n};\n\ntype UseItemExitAnimationResult = {\n\texitingItems: ExitingGridItem[];\n\thasExitingItems: boolean;\n\tclearExitingItem: ( key: string ) => void;\n};\n\nfunction prefersReducedMotion(): boolean {\n\treturn (\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.matchMedia( '(prefers-reduced-motion: reduce)' ).matches\n\t);\n}\n\n/**\n * When `layout` loses keys in edit mode, keeps a short-lived overlay at\n * the removed tile's last position (scale + fade) while siblings FLIP.\n *\n * @param root0 Hook options.\n * @param root0.container Surface root that contains grid tiles.\n * @param root0.enabled When false, exiting state is cleared.\n * @param root0.layoutKeys Keys in the committed `layout` prop.\n * @param root0.getPositionsBeforeLastChange Container-relative rects before the latest layout commit.\n * @param root0.childrenCacheRef Last rendered children keyed by tile id.\n * @return Exiting overlays and a callback to dismiss one by key.\n */\nexport function useItemExitAnimation( {\n\tcontainer,\n\tenabled,\n\tlayoutKeys,\n\tgetPositionsBeforeLastChange,\n\tchildrenCacheRef,\n}: UseItemExitAnimationOptions ): UseItemExitAnimationResult {\n\tconst [ exitingItems, setExitingItems ] = useState< ExitingGridItem[] >(\n\t\t[]\n\t);\n\tconst prevLayoutKeysRef = useRef< Set< string > >( new Set() );\n\tconst exitTimeoutsRef = useRef<\n\t\tMap< string, ReturnType< typeof setTimeout > >\n\t>( new Map() );\n\n\tconst clearExitingItem = useCallback(\n\t\t( key: string ) => {\n\t\t\tconst timeout = exitTimeoutsRef.current.get( key );\n\t\t\tif ( timeout ) {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t\texitTimeoutsRef.current.delete( key );\n\t\t\t}\n\t\t\tsetExitingItems( ( current ) =>\n\t\t\t\tcurrent.filter( ( item ) => item.key !== key )\n\t\t\t);\n\t\t\tchildrenCacheRef.current.delete( key );\n\t\t},\n\t\t[ childrenCacheRef ]\n\t);\n\n\tconst scheduleExitComplete = useCallback(\n\t\t( key: string ) => {\n\t\t\tif ( exitTimeoutsRef.current.has( key ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst timeout = setTimeout( () => {\n\t\t\t\texitTimeoutsRef.current.delete( key );\n\t\t\t\tclearExitingItem( key );\n\t\t\t}, EXIT_SAFETY_TIMEOUT_MS );\n\t\t\texitTimeoutsRef.current.set( key, timeout );\n\t\t},\n\t\t[ clearExitingItem ]\n\t);\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! enabled || ! container ) {\n\t\t\tprevLayoutKeysRef.current = new Set( layoutKeys );\n\t\t\tfor ( const timeout of exitTimeoutsRef.current.values() ) {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t}\n\t\t\texitTimeoutsRef.current.clear();\n\t\t\tsetExitingItems( [] );\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevKeys = prevLayoutKeysRef.current;\n\t\tconst removed: string[] = [];\n\t\tfor ( const key of prevKeys ) {\n\t\t\tif ( ! layoutKeys.has( key ) ) {\n\t\t\t\tremoved.push( key );\n\t\t\t}\n\t\t}\n\t\tprevLayoutKeysRef.current = new Set( layoutKeys );\n\n\t\tif ( removed.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lastPositions = getPositionsBeforeLastChange();\n\t\tif ( ! lastPositions ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextExiting: ExitingGridItem[] = [];\n\t\tfor ( const key of removed ) {\n\t\t\tconst position = lastPositions.get( key );\n\t\t\tconst child = childrenCacheRef.current.get( key );\n\t\t\tif ( ! position || ! child ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnextExiting.push( {\n\t\t\t\tkey,\n\t\t\t\trect: position,\n\t\t\t\tchild,\n\t\t\t} );\n\t\t}\n\n\t\tif ( nextExiting.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( prefersReducedMotion() ) {\n\t\t\t// Siblings snap into place via the layout-shift hook; skip the\n\t\t\t// exit ghost (and its synchronous mount) entirely.\n\t\t\tfor ( const { key } of nextExiting ) {\n\t\t\t\tchildrenCacheRef.current.delete( key );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// A state update inside a layout effect is flushed before paint,\n\t\t// so the ghost mounts in the same frame the tile is removed.\n\t\tsetExitingItems( ( current ) => [ ...current, ...nextExiting ] );\n\n\t\tfor ( const { key } of nextExiting ) {\n\t\t\tscheduleExitComplete( key );\n\t\t}\n\t}, [\n\t\tcontainer,\n\t\tenabled,\n\t\tgetPositionsBeforeLastChange,\n\t\tlayoutKeys,\n\t\tchildrenCacheRef,\n\t\tscheduleExitComplete,\n\t] );\n\n\tuseLayoutEffect( () => {\n\t\tconst exitTimeouts = exitTimeoutsRef.current;\n\t\treturn () => {\n\t\t\tfor ( const timeout of exitTimeouts.values() ) {\n\t\t\t\tclearTimeout( timeout );\n\t\t\t}\n\t\t\texitTimeouts.clear();\n\t\t};\n\t}, []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B,UAAM,eAAe,gBAAgB;AACrC,WAAO,MAAM;AACZ,iBAAY,WAAW,aAAa,OAAO,GAAI;AAC9C,qBAAc,OAAQ;AAAA,MACvB;AACA,mBAAa,MAAM;AAAA,IACpB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SAAO;AAAA,IACN;AAAA,IACA,iBAAiB,aAAa,SAAS;AAAA,IACvC;AAAA,EACD;AACD;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/shared/use-layout-shift-animation.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback, useLayoutEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { GRID_ITEM_DATA_KEY } from './grid-item-key';\n\n/* `left`/`top` are relative to the grid container, not the viewport. */\nexport type RectSnapshot = {\n\tleft: number;\n\ttop: number;\n\twidth: number;\n\theight: number;\n};\n\ntype UseLayoutShiftAnimationOptions = {\n\t/**\n\t * Surface root that contains grid tiles.\n\t */\n\tcontainer: HTMLElement | null;\n\n\t/**\n\t * When false, snapshots are cleared and no transforms run.\n\t */\n\tenabled: boolean;\n\n\t/**\n\t * Serialized layout/placement state. The hook runs FLIP when this\n\t * value changes while `enabled` is true.\n\t */\n\tlayoutFingerprint: string;\n\n\t/**\n\t * Item key to skip (the tile being dragged or resized).\n\t */\n\texcludeItemKey?: string | null;\n};\n\ntype UseLayoutShiftAnimationResult = {\n\t/**\n\t * Capture tile positions synchronously **before** a layout update\n\t * (call immediately before `setTemporaryLayout` / similar).\n\t */\n\tcaptureLayoutSnapshot: () => void;\n\n\t/**\n\t * Container-relative rects from the last committed paint (settled, no\n\t * FLIP invert transforms).\n\t */\n\tgetLastPositions: () => ReadonlyMap< string, RectSnapshot > | null;\n\n\t/**\n\t * Tile positions immediately before the latest layout commit. Used\n\t * by item-exit animation when keys drop out of `layout`.\n\t */\n\tgetPositionsBeforeLastChange: () => ReadonlyMap<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null;\n};\n\nfunction queryGridItems( container: HTMLElement ): HTMLElement[] {\n\treturn Array.from(\n\t\tcontainer.querySelectorAll< HTMLElement >(\n\t\t\t`[${ GRID_ITEM_DATA_KEY }]:not([data-wp-grid-item-exiting])`\n\t\t)\n\t);\n}\n\nfunction readItemKey( element: HTMLElement ): string | null {\n\treturn element.getAttribute( GRID_ITEM_DATA_KEY );\n}\n\nfunction snapshotPositions(\n\tcontainer: HTMLElement\n): Map< string, RectSnapshot > {\n\t// Measure relative to the container so positions stay valid even if the\n\t// page scroll shifts between capture and use (e.g. the document reflowing\n\t// shorter after a tile is removed).\n\tconst base = container.getBoundingClientRect();\n\tconst positions = new Map< string, RectSnapshot >();\n\tfor ( const element of queryGridItems( container ) ) {\n\t\tconst key = readItemKey( element );\n\t\tif ( ! key ) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst { left, top, width, height } = element.getBoundingClientRect();\n\t\tpositions.set( key, {\n\t\t\tleft: left - base.left,\n\t\t\ttop: top - base.top,\n\t\t\twidth,\n\t\t\theight,\n\t\t} );\n\t}\n\treturn positions;\n}\n\nfunction clearLayoutShiftStyles( element: HTMLElement ): void {\n\telement.style.removeProperty( 'transform' );\n\telement.style.removeProperty( 'transition' );\n}\n\nfunction playLayoutShift(\n\telement: HTMLElement,\n\tdeltaX: number,\n\tdeltaY: number\n): void {\n\tif ( deltaX === 0 && deltaY === 0 ) {\n\t\treturn;\n\t}\n\n\t// Invert: show the tile where it was before the layout change.\n\telement.style.transition = 'none';\n\telement.style.transform = `translate(${ deltaX }px, ${ deltaY }px)`;\n\tvoid element.offsetHeight;\n\n\t// Play on the next frame so the inverted transform paints before\n\t// the transition back to the committed grid position.\n\trequestAnimationFrame( () => {\n\t\telement.style.removeProperty( 'transition' );\n\t\telement.style.transform = '';\n\n\t\tconst onTransitionEnd = ( event: TransitionEvent ) => {\n\t\t\tif ( event.propertyName !== 'transform' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.removeEventListener( 'transitionend', onTransitionEnd );\n\t\t\tclearLayoutShiftStyles( element );\n\t\t};\n\t\telement.addEventListener( 'transitionend', onTransitionEnd );\n\t} );\n}\n\n/**\n * Animates sibling tiles when grid layout reflows during drag or resize\n * using a FLIP transform (see `layout-shift-animation.module.css`).\n *\n * @param root0 Hook options.\n * @param root0.container Surface root that contains grid tiles.\n * @param root0.enabled When false, snapshots are cleared and no transforms run.\n * @param root0.layoutFingerprint Serialized layout/placement state.\n * @param root0.excludeItemKey Item key to skip (the tile being dragged or resized).\n * @return Snapshot capture callback for use before layout updates.\n */\nexport function useLayoutShiftAnimation( {\n\tcontainer,\n\tenabled,\n\tlayoutFingerprint,\n\texcludeItemKey = null,\n}: UseLayoutShiftAnimationOptions ): UseLayoutShiftAnimationResult {\n\tconst snapshotBeforeChangeRef = useRef< Map<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null >( null );\n\tconst lastRenderedPositionsRef = useRef< Map<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null >( null );\n\tconst positionsBeforeLastChangeRef = useRef< Map<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null >( null );\n\n\tconst captureLayoutSnapshot = useCallback( () => {\n\t\tif ( container ) {\n\t\t\tsnapshotBeforeChangeRef.current = snapshotPositions( container );\n\t\t}\n\t}, [ container ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! container || ! enabled ) {\n\t\t\tsnapshotBeforeChangeRef.current = null;\n\t\t\tlastRenderedPositionsRef.current = null;\n\t\t\tpositionsBeforeLastChangeRef.current = null;\n\t\t\tif ( container ) {\n\t\t\t\tfor ( const element of queryGridItems( container ) ) {\n\t\t\t\t\tclearLayoutShiftStyles( element );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( const element of queryGridItems( container ) ) {\n\t\t\tclearLayoutShiftStyles( element );\n\t\t}\n\n\t\tconst previous =\n\t\t\tsnapshotBeforeChangeRef.current ?? lastRenderedPositionsRef.current;\n\t\tsnapshotBeforeChangeRef.current = null;\n\n\t\tpositionsBeforeLastChangeRef.current = previous\n\t\t\t? new Map( previous )\n\t\t\t: null;\n\n\t\t// Record settled grid positions for the next FLIP. Must run before\n\t\t// invert transforms — measuring after `playLayoutShift` would bake\n\t\t// translate offsets into the baseline and skew the next animation.\n\t\tlastRenderedPositionsRef.current = snapshotPositions( container );\n\n\t\tif ( previous ) {\n\t\t\tconst base = container.getBoundingClientRect();\n\t\t\tfor ( const element of queryGridItems( container ) ) {\n\t\t\t\tconst key = readItemKey( element );\n\t\t\t\tif ( ! key || key === excludeItemKey ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst old = previous.get( key );\n\t\t\t\tif ( ! old ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst { left, top } = element.getBoundingClientRect();\n\t\t\t\tconst deltaX = old.left - ( left - base.left );\n\t\t\t\tconst deltaY = old.top - ( top - base.top );\n\t\t\t\tplayLayoutShift( element, deltaX, deltaY );\n\t\t\t}\n\t\t}\n\t}, [ container, enabled, layoutFingerprint, excludeItemKey ] );\n\n\tconst getLastPositions = useCallback( () => {\n\t\treturn lastRenderedPositionsRef.current;\n\t}, [] );\n\n\tconst getPositionsBeforeLastChange = useCallback( () => {\n\t\treturn positionsBeforeLastChangeRef.current;\n\t}, [] );\n\n\treturn {\n\t\tcaptureLayoutSnapshot,\n\t\tgetLastPositions,\n\t\tgetPositionsBeforeLastChange,\n\t};\n}\n\n/**\n * Stable fingerprint for {@link useLayoutShiftAnimation}. Width/height\n * values may be numbers or layout keywords (`'fill'`, `'full'`).\n *\n * @param layout Layout items to serialize.\n * @return Fingerprint string.\n */\nexport function getLayoutFingerprint(\n\tlayout: ReadonlyArray< {\n\t\tkey: string;\n\t\twidth?: number | string;\n\t\theight?: number;\n\t\torder?: number;\n\t\tlane?: number;\n\t} >\n): string {\n\treturn layout\n\t\t.map(\n\t\t\t( item ) =>\n\t\t\t\t`${ item.key }:${ String( item.width ?? '' ) }:${\n\t\t\t\t\titem.height ?? 1\n\t\t\t\t}:${ item.order ?? '' }:${ item.lane ?? '' }`\n\t\t)\n\t\t.join( '|' );\n}\n\n/**\n * Placement fingerprint for lanes polyfill / explicit grid positions.\n *\n * @param itemStyles Per-item inline placement styles.\n * @return Fingerprint string.\n */\nexport function getPlacementFingerprint(\n\titemStyles: Map< string, React.CSSProperties >\n): string {\n\treturn [ ...itemStyles.entries() ]\n\t\t.sort( ( [ a ], [ b ] ) => a.localeCompare( b ) )\n\t\t.map( ( [ key, style ] ) => {\n\t\t\tconst column = style.gridColumn ?? '';\n\t\t\tconst columnStart = style.gridColumnStart ?? '';\n\t\t\tconst rowStart = style.gridRowStart ?? '';\n\t\t\tconst rowEnd = style.gridRowEnd ?? '';\n\t\t\treturn `${ key }:${ String( column ) }:${ String(\n\t\t\t\tcolumnStart\n\t\t\t) }:${ String( rowStart ) }:${ String( rowEnd ) }`;\n\t\t} )\n\t\t.join( '|' );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAqD;AAKrD,2BAAmC;AAwDnC,SAAS,eAAgB,WAAwC;AAChE,SAAO,MAAM;AAAA,IACZ,UAAU;AAAA,MACT,IAAK,uCAAmB;AAAA,IACzB;AAAA,EACD;AACD;AAEA,SAAS,YAAa,SAAsC;AAC3D,SAAO,QAAQ,aAAc,uCAAmB;AACjD;AAEA,SAAS,kBACR,WAC8B;AAI9B,QAAM,OAAO,UAAU,sBAAsB;AAC7C,QAAM,YAAY,oBAAI,IAA4B;AAClD,aAAY,WAAW,eAAgB,SAAU,GAAI;AACpD,UAAM,MAAM,YAAa,OAAQ;AACjC,QAAK,CAAE,KAAM;AACZ;AAAA,IACD;AACA,UAAM,EAAE,MAAM,KAAK,OAAO,OAAO,IAAI,QAAQ,sBAAsB;AACnE,cAAU,IAAK,KAAK;AAAA,MACnB,M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AO,CAAE,GAAG,WAAW,QAAQ,CAAE,EAC/B,KAAM,CAAE,CAAE,CAAE,GAAG,CAAE,CAAE,MAAO,EAAE,cAAe,CAAE,CAAE,EAC/C,IAAK,CAAE,CAAE,KAAK,KAAM,MAAO;AAC3B,UAAM,SAAS,MAAM,cAAc;AACnC,UAAM,cAAc,MAAM,mBAAmB;AAC7C,UAAM,WAAW,MAAM,gBAAgB;AACvC,UAAM,SAAS,MAAM,cAAc;AACnC,WAAO,GAAI,GAAI,IAAK,OAAQ,MAAO,CAAE,IAAK;AAAA,MACzC;AAAA,IACD,CAAE,IAAK,OAAQ,QAAS,CAAE,IAAK,OAAQ,MAAO,CAAE;AAAA,EACjD,CAAE,EACD,KAAM,GAAI;AACb;",
4
+ "sourcesContent": ["import { useCallback, useLayoutEffect, useRef } from '@wordpress/element';\nimport { GRID_ITEM_DATA_KEY } from './grid-item-key';\n\n/* `left`/`top` are relative to the grid container, not the viewport. */\nexport type RectSnapshot = {\n\tleft: number;\n\ttop: number;\n\twidth: number;\n\theight: number;\n};\n\ntype UseLayoutShiftAnimationOptions = {\n\t/**\n\t * Surface root that contains grid tiles.\n\t */\n\tcontainer: HTMLElement | null;\n\n\t/**\n\t * When false, snapshots are cleared and no transforms run.\n\t */\n\tenabled: boolean;\n\n\t/**\n\t * Serialized layout/placement state. The hook runs FLIP when this\n\t * value changes while `enabled` is true.\n\t */\n\tlayoutFingerprint: string;\n\n\t/**\n\t * Item key to skip (the tile being dragged or resized).\n\t */\n\texcludeItemKey?: string | null;\n};\n\ntype UseLayoutShiftAnimationResult = {\n\t/**\n\t * Capture tile positions synchronously **before** a layout update\n\t * (call immediately before `setTemporaryLayout` / similar).\n\t */\n\tcaptureLayoutSnapshot: () => void;\n\n\t/**\n\t * Container-relative rects from the last committed paint (settled, no\n\t * FLIP invert transforms).\n\t */\n\tgetLastPositions: () => ReadonlyMap< string, RectSnapshot > | null;\n\n\t/**\n\t * Tile positions immediately before the latest layout commit. Used\n\t * by item-exit animation when keys drop out of `layout`.\n\t */\n\tgetPositionsBeforeLastChange: () => ReadonlyMap<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null;\n};\n\nfunction queryGridItems( container: HTMLElement ): HTMLElement[] {\n\treturn Array.from(\n\t\tcontainer.querySelectorAll< HTMLElement >(\n\t\t\t`[${ GRID_ITEM_DATA_KEY }]:not([data-wp-grid-item-exiting])`\n\t\t)\n\t);\n}\n\nfunction readItemKey( element: HTMLElement ): string | null {\n\treturn element.getAttribute( GRID_ITEM_DATA_KEY );\n}\n\nfunction snapshotPositions(\n\tcontainer: HTMLElement\n): Map< string, RectSnapshot > {\n\t// Measure relative to the container so positions stay valid even if the\n\t// page scroll shifts between capture and use (e.g. the document reflowing\n\t// shorter after a tile is removed).\n\tconst base = container.getBoundingClientRect();\n\tconst positions = new Map< string, RectSnapshot >();\n\tfor ( const element of queryGridItems( container ) ) {\n\t\tconst key = readItemKey( element );\n\t\tif ( ! key ) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst { left, top, width, height } = element.getBoundingClientRect();\n\t\tpositions.set( key, {\n\t\t\tleft: left - base.left,\n\t\t\ttop: top - base.top,\n\t\t\twidth,\n\t\t\theight,\n\t\t} );\n\t}\n\treturn positions;\n}\n\nfunction clearLayoutShiftStyles( element: HTMLElement ): void {\n\telement.style.removeProperty( 'transform' );\n\telement.style.removeProperty( 'transition' );\n}\n\nfunction playLayoutShift(\n\telement: HTMLElement,\n\tdeltaX: number,\n\tdeltaY: number\n): void {\n\tif ( deltaX === 0 && deltaY === 0 ) {\n\t\treturn;\n\t}\n\n\t// Invert: show the tile where it was before the layout change.\n\telement.style.transition = 'none';\n\telement.style.transform = `translate(${ deltaX }px, ${ deltaY }px)`;\n\tvoid element.offsetHeight;\n\n\t// Play on the next frame so the inverted transform paints before\n\t// the transition back to the committed grid position.\n\trequestAnimationFrame( () => {\n\t\telement.style.removeProperty( 'transition' );\n\t\telement.style.transform = '';\n\n\t\tconst onTransitionEnd = ( event: TransitionEvent ) => {\n\t\t\tif ( event.propertyName !== 'transform' ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.removeEventListener( 'transitionend', onTransitionEnd );\n\t\t\tclearLayoutShiftStyles( element );\n\t\t};\n\t\telement.addEventListener( 'transitionend', onTransitionEnd );\n\t} );\n}\n\n/**\n * Animates sibling tiles when grid layout reflows during drag or resize\n * using a FLIP transform (see `layout-shift-animation.module.css`).\n *\n * @param root0 Hook options.\n * @param root0.container Surface root that contains grid tiles.\n * @param root0.enabled When false, snapshots are cleared and no transforms run.\n * @param root0.layoutFingerprint Serialized layout/placement state.\n * @param root0.excludeItemKey Item key to skip (the tile being dragged or resized).\n * @return Snapshot capture callback for use before layout updates.\n */\nexport function useLayoutShiftAnimation( {\n\tcontainer,\n\tenabled,\n\tlayoutFingerprint,\n\texcludeItemKey = null,\n}: UseLayoutShiftAnimationOptions ): UseLayoutShiftAnimationResult {\n\tconst snapshotBeforeChangeRef = useRef< Map<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null >( null );\n\tconst lastRenderedPositionsRef = useRef< Map<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null >( null );\n\tconst positionsBeforeLastChangeRef = useRef< Map<\n\t\tstring,\n\t\tRectSnapshot\n\t> | null >( null );\n\n\tconst captureLayoutSnapshot = useCallback( () => {\n\t\tif ( container ) {\n\t\t\tsnapshotBeforeChangeRef.current = snapshotPositions( container );\n\t\t}\n\t}, [ container ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! container || ! enabled ) {\n\t\t\tsnapshotBeforeChangeRef.current = null;\n\t\t\tlastRenderedPositionsRef.current = null;\n\t\t\tpositionsBeforeLastChangeRef.current = null;\n\t\t\tif ( container ) {\n\t\t\t\tfor ( const element of queryGridItems( container ) ) {\n\t\t\t\t\tclearLayoutShiftStyles( element );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( const element of queryGridItems( container ) ) {\n\t\t\tclearLayoutShiftStyles( element );\n\t\t}\n\n\t\tconst previous =\n\t\t\tsnapshotBeforeChangeRef.current ?? lastRenderedPositionsRef.current;\n\t\tsnapshotBeforeChangeRef.current = null;\n\n\t\tpositionsBeforeLastChangeRef.current = previous\n\t\t\t? new Map( previous )\n\t\t\t: null;\n\n\t\t// Record settled grid positions for the next FLIP. Must run before\n\t\t// invert transforms — measuring after `playLayoutShift` would bake\n\t\t// translate offsets into the baseline and skew the next animation.\n\t\tlastRenderedPositionsRef.current = snapshotPositions( container );\n\n\t\tif ( previous ) {\n\t\t\tconst base = container.getBoundingClientRect();\n\t\t\tfor ( const element of queryGridItems( container ) ) {\n\t\t\t\tconst key = readItemKey( element );\n\t\t\t\tif ( ! key || key === excludeItemKey ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst old = previous.get( key );\n\t\t\t\tif ( ! old ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst { left, top } = element.getBoundingClientRect();\n\t\t\t\tconst deltaX = old.left - ( left - base.left );\n\t\t\t\tconst deltaY = old.top - ( top - base.top );\n\t\t\t\tplayLayoutShift( element, deltaX, deltaY );\n\t\t\t}\n\t\t}\n\t}, [ container, enabled, layoutFingerprint, excludeItemKey ] );\n\n\tconst getLastPositions = useCallback( () => {\n\t\treturn lastRenderedPositionsRef.current;\n\t}, [] );\n\n\tconst getPositionsBeforeLastChange = useCallback( () => {\n\t\treturn positionsBeforeLastChangeRef.current;\n\t}, [] );\n\n\treturn {\n\t\tcaptureLayoutSnapshot,\n\t\tgetLastPositions,\n\t\tgetPositionsBeforeLastChange,\n\t};\n}\n\n/**\n * Stable fingerprint for {@link useLayoutShiftAnimation}. Width/height\n * values may be numbers or layout keywords (`'fill'`, `'full'`).\n *\n * @param layout Layout items to serialize.\n * @return Fingerprint string.\n */\nexport function getLayoutFingerprint(\n\tlayout: ReadonlyArray< {\n\t\tkey: string;\n\t\twidth?: number | string;\n\t\theight?: number;\n\t\torder?: number;\n\t\tlane?: number;\n\t} >\n): string {\n\treturn layout\n\t\t.map(\n\t\t\t( item ) =>\n\t\t\t\t`${ item.key }:${ String( item.width ?? '' ) }:${\n\t\t\t\t\titem.height ?? 1\n\t\t\t\t}:${ item.order ?? '' }:${ item.lane ?? '' }`\n\t\t)\n\t\t.join( '|' );\n}\n\n/**\n * Placement fingerprint for lanes polyfill / explicit grid positions.\n *\n * @param itemStyles Per-item inline placement styles.\n * @return Fingerprint string.\n */\nexport function getPlacementFingerprint(\n\titemStyles: Map< string, React.CSSProperties >\n): string {\n\treturn [ ...itemStyles.entries() ]\n\t\t.sort( ( [ a ], [ b ] ) => a.localeCompare( b ) )\n\t\t.map( ( [ key, style ] ) => {\n\t\t\tconst column = style.gridColumn ?? '';\n\t\t\tconst columnStart = style.gridColumnStart ?? '';\n\t\t\tconst rowStart = style.gridRowStart ?? '';\n\t\t\tconst rowEnd = style.gridRowEnd ?? '';\n\t\t\treturn `${ key }:${ String( column ) }:${ String(\n\t\t\t\tcolumnStart\n\t\t\t) }:${ String( rowStart ) }:${ String( rowEnd ) }`;\n\t\t} )\n\t\t.join( '|' );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAqD;AACrD,2BAAmC;AAwDnC,SAAS,eAAgB,WAAwC;AAChE,SAAO,MAAM;AAAA,IACZ,UAAU;AAAA,MACT,IAAK,uCAAmB;AAAA,IACzB;AAAA,EACD;AACD;AAEA,SAAS,YAAa,SAAsC;AAC3D,SAAO,QAAQ,aAAc,uCAAmB;AACjD;AAEA,SAAS,kBACR,WAC8B;AAI9B,QAAM,OAAO,UAAU,sBAAsB;AAC7C,QAAM,YAAY,oBAAI,IAA4B;AAClD,aAAY,WAAW,eAAgB,SAAU,GAAI;AACpD,UAAM,MAAM,YAAa,OAAQ;AACjC,QAAK,CAAE,KAAM;AACZ;AAAA,IACD;AACA,UAAM,EAAE,MAAM,KAAK,OAAO,OAAO,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EAC7C,EACC,KAAM,GAAI;AACb;AAQO,SAAS,wBACf,YACS;AACT,SAAO,CAAE,GAAG,WAAW,QAAQ,CAAE,EAC/B,KAAM,CAAE,CAAE,CAAE,GAAG,CAAE,CAAE,MAAO,EAAE,cAAe,CAAE,CAAE,EAC/C,IAAK,CAAE,CAAE,KAAK,KAAM,MAAO;AAC3B,UAAM,SAAS,MAAM,cAAc;AACnC,UAAM,cAAc,MAAM,mBAAmB;AAC7C,UAAM,WAAW,MAAM,gBAAgB;AACvC,UAAM,SAAS,MAAM,cAAc;AACnC,WAAO,GAAI,GAAI,IAAK,OAAQ,MAAO,CAAE,IAAK;AAAA,MACzC;AAAA,IACD,CAAE,IAAK,OAAQ,QAAS,CAAE,IAAK,OAAQ,MAAO,CAAE;AAAA,EACjD,CAAE,EACD,KAAM,GAAI;AACb;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/dashboard-grid/grid-item.tsx", "../../../style-runtime/src/index.ts", "../../src/shared/actionable-area-slot.module.css", "../../src/dashboard-grid/grid-item.module.css"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { useSortable } from '@dnd-kit/sortable';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport actionableAreaStyles from '../shared/actionable-area-slot.module.css';\nimport { GRID_ITEM_DATA_KEY } from '../shared/grid-item-key';\nimport ResizeHandle from '../shared/resize-handle';\nimport { clampResizeDelta, type ResizeSnapSize } from '../shared/resize-snap';\nimport type { ResizeDelta } from '../shared/types';\nimport type { GridItemProps } from './types';\nimport styles from './grid-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\n\tif ( interacting ) {\n\t\treturn undefined;\n\t}\n\n\treturn 'grab';\n}\n\nexport function GridItem( {\n\titem,\n\tmaxColumns,\n\tdisabled = false,\n\tverticalResizable = true,\n\tinteracting = false,\n\tdragging = false,\n\tchildren,\n\tactionableArea = null,\n\tonResize,\n\tonResizeEnd,\n\tresizeSnapPreview = null,\n\tminResizeWidthPx,\n\tminResizeHeightPx,\n\trenderResizeHandle,\n}: GridItemProps ) {\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\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\tsetActivatorNodeRef,\n\t\tisDragging,\n\t} = useSortable( {\n\t\tid: item.key,\n\t\tdisabled,\n\t} );\n\tconst mergedRef = useMergeRefs( [ itemRef, setNodeRef ] );\n\tconst contentMergedRef = useMergeRefs( [ contentRef ] );\n\t/*\n\t * With `<DragOverlay>` handling the cursor-following clone, the\n\t * sortable item stays put in its grid cell and acts as a\n\t * placeholder. No `transform` is applied here — applying one\n\t * would double-move the placeholder alongside the overlay.\n\t */\n\tconst style = {\n\t\tgridColumnEnd: `span ${\n\t\t\titem.width === 'full'\n\t\t\t\t? maxColumns\n\t\t\t\t: Math.min(\n\t\t\t\t\t\ttypeof item.width === 'number' ? item.width : 1,\n\t\t\t\t\t\tmaxColumns\n\t\t\t\t )\n\t\t}`,\n\t\tgridRowEnd: `span ${ item.height || 1 }`,\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 = {\n\t\t\twidth: delta.width,\n\t\t\theight: verticalResizable ? delta.height : 0,\n\t\t};\n\t\tif ( baselineSize ) {\n\t\t\tclamped = clampResizeDelta( clamped, baselineSize, {\n\t\t\t\twidth: minResizeWidthPx,\n\t\t\t\theight: verticalResizable ? minResizeHeightPx : undefined,\n\t\t\t} );\n\t\t}\n\t\tsetResizeDelta( clamped );\n\t\tonResize( item.key, 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\t\theight: verticalResizable\n\t\t\t\t\t\t? initialContentSize.height + resizeDelta.height\n\t\t\t\t\t\t: undefined,\n\t\t\t }\n\t\t\t: undefined;\n\n\tconst previewOverlay = resizeSnapPreview ? (\n\t\t<SnapPreviewOverlay snap={ resizeSnapPreview } />\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 ]: item.key } }\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={ item.key }\n\t\t\t\t\t\t\tverticalResizable={ verticalResizable }\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\nfunction SnapPreviewOverlay( { snap }: { snap: ResizeSnapSize } ) {\n\treturn (\n\t\t<div\n\t\t\tclassName={ styles[ 'preview-overlay' ] }\n\t\t\tstyle={ {\n\t\t\t\twidth: snap.widthPx,\n\t\t\t\theight: snap.heightPx ?? '100%',\n\t\t\t} }\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(\"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(\"62860ded21\", \"._5d1abcb332a18701__item{position:relative}._54de57c12d3ce67e__item-content{height:100%;position:relative}._3e086aa073b9bbd9__is-resizing{overflow:visible;z-index:1}._3e086aa073b9bbd9__is-resizing ._54de57c12d3ce67e__item-content{overflow:visible;position:relative;z-index:2}._81d4e1a6c979f1e4__is-dragging{pointer-events:none}[data-wp-grid-dragging] ._81d4e1a6c979f1e4__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] ._81d4e1a6c979f1e4__is-dragging{animation:_0447be8a7068a873__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 _0447be8a7068a873__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] ._81d4e1a6c979f1e4__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] ._81d4e1a6c979f1e4__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}._2028fc095dbc5cb2__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)));border-radius:var(--wp-grid-placeholder-radius,0);box-sizing:border-box;inset-inline-start:0;pointer-events:none;position:absolute;top:0;z-index:0}@media (forced-colors:active){._2028fc095dbc5cb2__preview-overlay{border-color:Highlight}}\");\n}\nexport default {\"item\":\"_5d1abcb332a18701__item\",\"item-content\":\"_54de57c12d3ce67e__item-content\",\"is-resizing\":\"_3e086aa073b9bbd9__is-resizing\",\"is-dragging\":\"_81d4e1a6c979f1e4__is-dragging\",\"wp-grid-item-placeholder-in\":\"_0447be8a7068a873__wp-grid-item-placeholder-in\",\"preview-overlay\":\"_2028fc095dbc5cb2__preview-overlay\"};\n"],
5
- "mappings": ";AAGA,SAAS,mBAAmB;AAC5B,OAAO,UAAU;AAKjB,SAAS,UAAU,cAAc;AACjC,SAAS,oBAAoB;;;ACA7B,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,MAA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AAC;AAAA;AAAA,MACA,KAAM;AAAA,MACN,WAAY;AAAA,MACZ;AAAA,MACE,GAAG,EAAE,CAAE,kBAAmB,GAAG,KAAK,IAAI;AAAA,MACxC,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,UAAU,WAAY;AAAA,YAC9C;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,KAAM;AAAA,kBACN,WAAY,kBAAQ,cAAe;AAAA,kBACnC,OAAQ;AAAA,kBAEN;AAAA;AAAA,oBACA,CAAE,YACH;AAAA,sBAAC;AAAA;AAAA,wBACA,QAAS,KAAK;AAAA,wBACd;AAAA,wBACA,UAAW;AAAA,wBACX,aAAc;AAAA,wBACd;AAAA;AAAA,oBACD;AAAA;AAAA;AAAA,cAEF;AAAA,cACE;AAAA;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,mBAAoB,EAAE,KAAK,GAA8B;AACjE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAY,kBAAQ,iBAAkB;AAAA,MACtC,OAAQ;AAAA,QACP,OAAO,KAAK;AAAA,QACZ,QAAQ,KAAK,YAAY;AAAA,MAC1B;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 { GRID_ITEM_DATA_KEY } from '../shared/grid-item-key';\nimport ResizeHandle from '../shared/resize-handle';\nimport { clampResizeDelta, type ResizeSnapSize } from '../shared/resize-snap';\nimport type { ResizeDelta } from '../shared/types';\nimport type { GridItemProps } from './types';\nimport styles from './grid-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\n\tif ( interacting ) {\n\t\treturn undefined;\n\t}\n\n\treturn 'grab';\n}\n\nexport function GridItem( {\n\titem,\n\tmaxColumns,\n\tdisabled = false,\n\tverticalResizable = true,\n\tinteracting = false,\n\tdragging = false,\n\tchildren,\n\tactionableArea = null,\n\tonResize,\n\tonResizeEnd,\n\tresizeSnapPreview = null,\n\tminResizeWidthPx,\n\tminResizeHeightPx,\n\trenderResizeHandle,\n}: GridItemProps ) {\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\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\tsetActivatorNodeRef,\n\t\tisDragging,\n\t} = useSortable( {\n\t\tid: item.key,\n\t\tdisabled,\n\t} );\n\tconst mergedRef = useMergeRefs( [ itemRef, setNodeRef ] );\n\tconst contentMergedRef = useMergeRefs( [ contentRef ] );\n\t/*\n\t * With `<DragOverlay>` handling the cursor-following clone, the\n\t * sortable item stays put in its grid cell and acts as a\n\t * placeholder. No `transform` is applied here — applying one\n\t * would double-move the placeholder alongside the overlay.\n\t */\n\tconst style = {\n\t\tgridColumnEnd: `span ${\n\t\t\titem.width === 'full'\n\t\t\t\t? maxColumns\n\t\t\t\t: Math.min(\n\t\t\t\t\t\ttypeof item.width === 'number' ? item.width : 1,\n\t\t\t\t\t\tmaxColumns\n\t\t\t\t )\n\t\t}`,\n\t\tgridRowEnd: `span ${ item.height || 1 }`,\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 = {\n\t\t\twidth: delta.width,\n\t\t\theight: verticalResizable ? delta.height : 0,\n\t\t};\n\t\tif ( baselineSize ) {\n\t\t\tclamped = clampResizeDelta( clamped, baselineSize, {\n\t\t\t\twidth: minResizeWidthPx,\n\t\t\t\theight: verticalResizable ? minResizeHeightPx : undefined,\n\t\t\t} );\n\t\t}\n\t\tsetResizeDelta( clamped );\n\t\tonResize( item.key, 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\t\theight: verticalResizable\n\t\t\t\t\t\t? initialContentSize.height + resizeDelta.height\n\t\t\t\t\t\t: undefined,\n\t\t\t }\n\t\t\t: undefined;\n\n\tconst previewOverlay = resizeSnapPreview ? (\n\t\t<SnapPreviewOverlay snap={ resizeSnapPreview } />\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 ]: item.key } }\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={ item.key }\n\t\t\t\t\t\t\tverticalResizable={ verticalResizable }\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\nfunction SnapPreviewOverlay( { snap }: { snap: ResizeSnapSize } ) {\n\treturn (\n\t\t<div\n\t\t\tclassName={ styles[ 'preview-overlay' ] }\n\t\t\tstyle={ {\n\t\t\t\twidth: snap.widthPx,\n\t\t\t\theight: snap.heightPx ?? '100%',\n\t\t\t} }\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(\"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(\"62860ded21\", \"._5d1abcb332a18701__item{position:relative}._54de57c12d3ce67e__item-content{height:100%;position:relative}._3e086aa073b9bbd9__is-resizing{overflow:visible;z-index:1}._3e086aa073b9bbd9__is-resizing ._54de57c12d3ce67e__item-content{overflow:visible;position:relative;z-index:2}._81d4e1a6c979f1e4__is-dragging{pointer-events:none}[data-wp-grid-dragging] ._81d4e1a6c979f1e4__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] ._81d4e1a6c979f1e4__is-dragging{animation:_0447be8a7068a873__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 _0447be8a7068a873__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] ._81d4e1a6c979f1e4__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] ._81d4e1a6c979f1e4__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}._2028fc095dbc5cb2__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)));border-radius:var(--wp-grid-placeholder-radius,0);box-sizing:border-box;inset-inline-start:0;pointer-events:none;position:absolute;top:0;z-index:0}@media (forced-colors:active){._2028fc095dbc5cb2__preview-overlay{border-color:Highlight}}\");\n}\nexport default {\"item\":\"_5d1abcb332a18701__item\",\"item-content\":\"_54de57c12d3ce67e__item-content\",\"is-resizing\":\"_3e086aa073b9bbd9__is-resizing\",\"is-dragging\":\"_81d4e1a6c979f1e4__is-dragging\",\"wp-grid-item-placeholder-in\":\"_0447be8a7068a873__wp-grid-item-placeholder-in\",\"preview-overlay\":\"_2028fc095dbc5cb2__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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AA,cACE;AAAA;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,mBAAoB,EAAE,KAAK,GAA8B;AACjE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAY,kBAAQ,iBAAkB;AAAA,MACtC,OAAQ;AAAA,QACP,OAAO,KAAK;AAAA,QACZ,QAAQ,KAAK,YAAY;AAAA,MAC1B;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -128,15 +128,15 @@ import { createDashboardDragDropAnimation } from "../shared/drag-overlay-drop-an
128
128
 
129
129
  // packages/grid/src/dashboard-grid/grid.module.css
130
130
  if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
131
- registerStyle("00b2523700", "._960c435c33759f46__grid{display:grid;gap:var(--wp-grid-gap,var(--wpds-dimension-gap-xl,24px));position:relative}._48e8cd4225dcb813__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}._4b471bf24f891d2d__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){._48e8cd4225dcb813__drag-preview-frame{animation:_08fdf90ef86c4706__wp-grid-drag-preview-shadow-enter var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) both}._4b471bf24f891d2d__drag-preview-frame__lift{animation:_8aaeb335436989f9__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 _08fdf90ef86c4706__wp-grid-drag-preview-shadow-enter{0%{box-shadow:var(--_wp-grid-elevation-xs)}to{box-shadow:var(--_wp-grid-elevation-md)}}@keyframes _8aaeb335436989f9__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){._48e8cd4225dcb813__drag-preview-frame._66b0aefb2bc02eb9__dragPreviewFrameExiting{animation:a7ead84bfd25ff8a__wp-grid-drag-preview-shadow-exit var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) forwards}._48e8cd4225dcb813__drag-preview-frame._66b0aefb2bc02eb9__dragPreviewFrameExiting ._4b471bf24f891d2d__drag-preview-frame__lift{animation:_234ccad5c20d49f8__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 a7ead84bfd25ff8a__wp-grid-drag-preview-shadow-exit{0%{box-shadow:var(--_wp-grid-elevation-md)}to{box-shadow:var(--_wp-grid-elevation-xs)}}@keyframes _234ccad5c20d49f8__wp-grid-drag-preview-scale-exit{0%{transform:scale(var(--wp-grid-drag-preview-scale,1.05))}to{transform:scale(1)}}}._48e8cd4225dcb813__drag-preview-frame._66b0aefb2bc02eb9__dragPreviewFrameExiting{box-shadow:var(--_wp-grid-elevation-xs)}._48e8cd4225dcb813__drag-preview-frame._66b0aefb2bc02eb9__dragPreviewFrameExiting ._4b471bf24f891d2d__drag-preview-frame__lift{transform:scale(1)}@media (prefers-reduced-motion:reduce){._48e8cd4225dcb813__drag-preview-frame{box-shadow:var(--_wp-grid-elevation-md)}._4b471bf24f891d2d__drag-preview-frame__lift{transform:none}._48e8cd4225dcb813__drag-preview-frame._66b0aefb2bc02eb9__dragPreviewFrameExiting{box-shadow:var(--_wp-grid-elevation-xs);transition:none}._48e8cd4225dcb813__drag-preview-frame._66b0aefb2bc02eb9__dragPreviewFrameExiting ._4b471bf24f891d2d__drag-preview-frame__lift{transition:none}}");
131
+ registerStyle("9b45a626c9", "._960c435c33759f46__grid{display:grid;gap:var(--wp-grid-gap,var(--wpds-dimension-gap-xl,24px));position:relative}._48e8cd4225dcb813__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}._4b471bf24f891d2d__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){._48e8cd4225dcb813__drag-preview-frame{animation:_08fdf90ef86c4706__wp-grid-drag-preview-shadow-enter var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) both}._4b471bf24f891d2d__drag-preview-frame__lift{animation:_8aaeb335436989f9__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 _08fdf90ef86c4706__wp-grid-drag-preview-shadow-enter{0%{box-shadow:var(--_wp-grid-elevation-xs)}to{box-shadow:var(--_wp-grid-elevation-md)}}@keyframes _8aaeb335436989f9__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){._48e8cd4225dcb813__drag-preview-frame.cf64ad2b878ad478__is-exiting{animation:a7ead84bfd25ff8a__wp-grid-drag-preview-shadow-exit var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-balanced,cubic-bezier(.4,0,.2,1)) forwards}._48e8cd4225dcb813__drag-preview-frame.cf64ad2b878ad478__is-exiting ._4b471bf24f891d2d__drag-preview-frame__lift{animation:_234ccad5c20d49f8__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 a7ead84bfd25ff8a__wp-grid-drag-preview-shadow-exit{0%{box-shadow:var(--_wp-grid-elevation-md)}to{box-shadow:var(--_wp-grid-elevation-xs)}}@keyframes _234ccad5c20d49f8__wp-grid-drag-preview-scale-exit{0%{transform:scale(var(--wp-grid-drag-preview-scale,1.05))}to{transform:scale(1)}}}._48e8cd4225dcb813__drag-preview-frame.cf64ad2b878ad478__is-exiting{box-shadow:var(--_wp-grid-elevation-xs)}._48e8cd4225dcb813__drag-preview-frame.cf64ad2b878ad478__is-exiting ._4b471bf24f891d2d__drag-preview-frame__lift{transform:scale(1)}@media (prefers-reduced-motion:reduce){._48e8cd4225dcb813__drag-preview-frame{box-shadow:var(--_wp-grid-elevation-md)}._4b471bf24f891d2d__drag-preview-frame__lift{transform:none}._48e8cd4225dcb813__drag-preview-frame.cf64ad2b878ad478__is-exiting{box-shadow:var(--_wp-grid-elevation-xs);transition:none}._48e8cd4225dcb813__drag-preview-frame.cf64ad2b878ad478__is-exiting ._4b471bf24f891d2d__drag-preview-frame__lift{transition:none}}");
132
132
  }
133
- var grid_default = { "grid": "_960c435c33759f46__grid", "drag-preview-frame": "_48e8cd4225dcb813__drag-preview-frame", "drag-preview-frame__lift": "_4b471bf24f891d2d__drag-preview-frame__lift", "wp-grid-drag-preview-shadow-enter": "_08fdf90ef86c4706__wp-grid-drag-preview-shadow-enter", "wp-grid-drag-preview-scale-enter": "_8aaeb335436989f9__wp-grid-drag-preview-scale-enter", "dragPreviewFrameExiting": "_66b0aefb2bc02eb9__dragPreviewFrameExiting", "wp-grid-drag-preview-shadow-exit": "a7ead84bfd25ff8a__wp-grid-drag-preview-shadow-exit", "wp-grid-drag-preview-scale-exit": "_234ccad5c20d49f8__wp-grid-drag-preview-scale-exit" };
133
+ var grid_default = { "grid": "_960c435c33759f46__grid", "drag-preview-frame": "_48e8cd4225dcb813__drag-preview-frame", "drag-preview-frame__lift": "_4b471bf24f891d2d__drag-preview-frame__lift", "wp-grid-drag-preview-shadow-enter": "_08fdf90ef86c4706__wp-grid-drag-preview-shadow-enter", "wp-grid-drag-preview-scale-enter": "_8aaeb335436989f9__wp-grid-drag-preview-scale-enter", "is-exiting": "cf64ad2b878ad478__is-exiting", "wp-grid-drag-preview-shadow-exit": "a7ead84bfd25ff8a__wp-grid-drag-preview-shadow-exit", "wp-grid-drag-preview-scale-exit": "_234ccad5c20d49f8__wp-grid-drag-preview-scale-exit" };
134
134
 
135
135
  // packages/grid/src/dashboard-grid/index.tsx
136
136
  import { jsx, jsxs } from "react/jsx-runtime";
137
137
  var dashboardDragDropAnimation = createDashboardDragDropAnimation(
138
138
  grid_default["drag-preview-frame"],
139
- grid_default.dragPreviewFrameExiting
139
+ grid_default["is-exiting"]
140
140
  );
141
141
  var FALLBACK_GAP_PX = 24;
142
142
  var DEFAULT_COLUMNS = 6;