@wordpress/grid 0.1.1-next.v.202606191442.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 (158) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE.md +788 -0
  3. package/README.md +534 -0
  4. package/build/dashboard-grid/grid-item.cjs +308 -0
  5. package/build/dashboard-grid/grid-item.cjs.map +7 -0
  6. package/build/dashboard-grid/index.cjs +591 -0
  7. package/build/dashboard-grid/index.cjs.map +7 -0
  8. package/build/dashboard-grid/resolve-fill-widths.cjs +189 -0
  9. package/build/dashboard-grid/resolve-fill-widths.cjs.map +7 -0
  10. package/build/dashboard-grid/types.cjs +19 -0
  11. package/build/dashboard-grid/types.cjs.map +7 -0
  12. package/build/dashboard-lanes/index.cjs +558 -0
  13. package/build/dashboard-lanes/index.cjs.map +7 -0
  14. package/build/dashboard-lanes/lane-placement.cjs +110 -0
  15. package/build/dashboard-lanes/lane-placement.cjs.map +7 -0
  16. package/build/dashboard-lanes/lanes-item.cjs +295 -0
  17. package/build/dashboard-lanes/lanes-item.cjs.map +7 -0
  18. package/build/dashboard-lanes/types.cjs +19 -0
  19. package/build/dashboard-lanes/types.cjs.map +7 -0
  20. package/build/dashboard-lanes/use-lane-placement.cjs +206 -0
  21. package/build/dashboard-lanes/use-lane-placement.cjs.map +7 -0
  22. package/build/index.cjs +34 -0
  23. package/build/index.cjs.map +7 -0
  24. package/build/shared/drag-overlay-drop-animation.cjs +70 -0
  25. package/build/shared/drag-overlay-drop-animation.cjs.map +7 -0
  26. package/build/shared/grid-item-key.cjs +31 -0
  27. package/build/shared/grid-item-key.cjs.map +7 -0
  28. package/build/shared/grid-overlay.cjs +187 -0
  29. package/build/shared/grid-overlay.cjs.map +7 -0
  30. package/build/shared/item-exit-overlay.cjs +150 -0
  31. package/build/shared/item-exit-overlay.cjs.map +7 -0
  32. package/build/shared/resize-handle.cjs +224 -0
  33. package/build/shared/resize-handle.cjs.map +7 -0
  34. package/build/shared/resize-snap.cjs +47 -0
  35. package/build/shared/resize-snap.cjs.map +7 -0
  36. package/build/shared/types.cjs +19 -0
  37. package/build/shared/types.cjs.map +7 -0
  38. package/build/shared/use-item-exit-animation.cjs +148 -0
  39. package/build/shared/use-item-exit-animation.cjs.map +7 -0
  40. package/build/shared/use-layout-shift-animation.cjs +167 -0
  41. package/build/shared/use-layout-shift-animation.cjs.map +7 -0
  42. package/build-module/dashboard-grid/grid-item.mjs +273 -0
  43. package/build-module/dashboard-grid/grid-item.mjs.map +7 -0
  44. package/build-module/dashboard-grid/index.mjs +579 -0
  45. package/build-module/dashboard-grid/index.mjs.map +7 -0
  46. package/build-module/dashboard-grid/resolve-fill-widths.mjs +164 -0
  47. package/build-module/dashboard-grid/resolve-fill-widths.mjs.map +7 -0
  48. package/build-module/dashboard-grid/types.mjs +1 -0
  49. package/build-module/dashboard-grid/types.mjs.map +7 -0
  50. package/build-module/dashboard-lanes/index.mjs +547 -0
  51. package/build-module/dashboard-lanes/index.mjs.map +7 -0
  52. package/build-module/dashboard-lanes/lane-placement.mjs +85 -0
  53. package/build-module/dashboard-lanes/lane-placement.mjs.map +7 -0
  54. package/build-module/dashboard-lanes/lanes-item.mjs +260 -0
  55. package/build-module/dashboard-lanes/lanes-item.mjs.map +7 -0
  56. package/build-module/dashboard-lanes/types.mjs +1 -0
  57. package/build-module/dashboard-lanes/types.mjs.map +7 -0
  58. package/build-module/dashboard-lanes/use-lane-placement.mjs +181 -0
  59. package/build-module/dashboard-lanes/use-lane-placement.mjs.map +7 -0
  60. package/build-module/index.mjs +8 -0
  61. package/build-module/index.mjs.map +7 -0
  62. package/build-module/shared/drag-overlay-drop-animation.mjs +47 -0
  63. package/build-module/shared/drag-overlay-drop-animation.mjs.map +7 -0
  64. package/build-module/shared/grid-item-key.mjs +6 -0
  65. package/build-module/shared/grid-item-key.mjs.map +7 -0
  66. package/build-module/shared/grid-overlay.mjs +152 -0
  67. package/build-module/shared/grid-overlay.mjs.map +7 -0
  68. package/build-module/shared/item-exit-overlay.mjs +125 -0
  69. package/build-module/shared/item-exit-overlay.mjs.map +7 -0
  70. package/build-module/shared/resize-handle.mjs +193 -0
  71. package/build-module/shared/resize-handle.mjs.map +7 -0
  72. package/build-module/shared/resize-snap.mjs +21 -0
  73. package/build-module/shared/resize-snap.mjs.map +7 -0
  74. package/build-module/shared/types.mjs +1 -0
  75. package/build-module/shared/types.mjs.map +7 -0
  76. package/build-module/shared/use-item-exit-animation.mjs +128 -0
  77. package/build-module/shared/use-item-exit-animation.mjs.map +7 -0
  78. package/build-module/shared/use-layout-shift-animation.mjs +140 -0
  79. package/build-module/shared/use-layout-shift-animation.mjs.map +7 -0
  80. package/build-types/dashboard-grid/grid-item.d.ts +3 -0
  81. package/build-types/dashboard-grid/grid-item.d.ts.map +1 -0
  82. package/build-types/dashboard-grid/index.d.ts +35 -0
  83. package/build-types/dashboard-grid/index.d.ts.map +1 -0
  84. package/build-types/dashboard-grid/resolve-fill-widths.d.ts +26 -0
  85. package/build-types/dashboard-grid/resolve-fill-widths.d.ts.map +1 -0
  86. package/build-types/dashboard-grid/stories/index.story.d.ts +98 -0
  87. package/build-types/dashboard-grid/stories/index.story.d.ts.map +1 -0
  88. package/build-types/dashboard-grid/types.d.ts +232 -0
  89. package/build-types/dashboard-grid/types.d.ts.map +1 -0
  90. package/build-types/dashboard-lanes/index.d.ts +40 -0
  91. package/build-types/dashboard-lanes/index.d.ts.map +1 -0
  92. package/build-types/dashboard-lanes/lane-placement.d.ts +126 -0
  93. package/build-types/dashboard-lanes/lane-placement.d.ts.map +1 -0
  94. package/build-types/dashboard-lanes/lanes-item.d.ts +52 -0
  95. package/build-types/dashboard-lanes/lanes-item.d.ts.map +1 -0
  96. package/build-types/dashboard-lanes/stories/index.story.d.ts +64 -0
  97. package/build-types/dashboard-lanes/stories/index.story.d.ts.map +1 -0
  98. package/build-types/dashboard-lanes/types.d.ts +151 -0
  99. package/build-types/dashboard-lanes/types.d.ts.map +1 -0
  100. package/build-types/dashboard-lanes/use-lane-placement.d.ts +74 -0
  101. package/build-types/dashboard-lanes/use-lane-placement.d.ts.map +1 -0
  102. package/build-types/index.d.ts +6 -0
  103. package/build-types/index.d.ts.map +1 -0
  104. package/build-types/shared/drag-overlay-drop-animation.d.ts +13 -0
  105. package/build-types/shared/drag-overlay-drop-animation.d.ts.map +1 -0
  106. package/build-types/shared/grid-item-key.d.ts +6 -0
  107. package/build-types/shared/grid-item-key.d.ts.map +1 -0
  108. package/build-types/shared/grid-overlay.d.ts +19 -0
  109. package/build-types/shared/grid-overlay.d.ts.map +1 -0
  110. package/build-types/shared/item-exit-overlay.d.ts +20 -0
  111. package/build-types/shared/item-exit-overlay.d.ts.map +1 -0
  112. package/build-types/shared/resize-handle.d.ts +23 -0
  113. package/build-types/shared/resize-handle.d.ts.map +1 -0
  114. package/build-types/shared/resize-snap.d.ts +41 -0
  115. package/build-types/shared/resize-snap.d.ts.map +1 -0
  116. package/build-types/shared/types.d.ts +144 -0
  117. package/build-types/shared/types.d.ts.map +1 -0
  118. package/build-types/shared/use-item-exit-animation.d.ts +37 -0
  119. package/build-types/shared/use-item-exit-animation.d.ts.map +1 -0
  120. package/build-types/shared/use-layout-shift-animation.d.ts +77 -0
  121. package/build-types/shared/use-layout-shift-animation.d.ts.map +1 -0
  122. package/package.json +80 -0
  123. package/src/dashboard-grid/grid-item.module.css +94 -0
  124. package/src/dashboard-grid/grid-item.tsx +205 -0
  125. package/src/dashboard-grid/grid.module.css +134 -0
  126. package/src/dashboard-grid/index.tsx +713 -0
  127. package/src/dashboard-grid/resolve-fill-widths.ts +224 -0
  128. package/src/dashboard-grid/stories/index.story.tsx +930 -0
  129. package/src/dashboard-grid/test/keyboard-activation.test.tsx +76 -0
  130. package/src/dashboard-grid/test/resolve-fill-widths.test.ts +250 -0
  131. package/src/dashboard-grid/types.ts +271 -0
  132. package/src/dashboard-lanes/index.tsx +629 -0
  133. package/src/dashboard-lanes/lane-placement.ts +245 -0
  134. package/src/dashboard-lanes/lanes-item.module.css +93 -0
  135. package/src/dashboard-lanes/lanes-item.tsx +236 -0
  136. package/src/dashboard-lanes/lanes.module.css +152 -0
  137. package/src/dashboard-lanes/stories/index.story.tsx +518 -0
  138. package/src/dashboard-lanes/test/keyboard-activation.test.tsx +71 -0
  139. package/src/dashboard-lanes/test/lane-placement.test.ts +442 -0
  140. package/src/dashboard-lanes/test/use-lane-placement.test.tsx +358 -0
  141. package/src/dashboard-lanes/types.ts +176 -0
  142. package/src/dashboard-lanes/use-lane-placement.ts +313 -0
  143. package/src/index.ts +17 -0
  144. package/src/shared/actionable-area-slot.module.css +16 -0
  145. package/src/shared/drag-overlay-drop-animation.ts +66 -0
  146. package/src/shared/grid-item-key.ts +5 -0
  147. package/src/shared/grid-overlay.module.css +82 -0
  148. package/src/shared/grid-overlay.tsx +93 -0
  149. package/src/shared/item-exit-animation.module.css +49 -0
  150. package/src/shared/item-exit-overlay.tsx +57 -0
  151. package/src/shared/layout-shift-animation.module.css +16 -0
  152. package/src/shared/resize-handle.module.css +88 -0
  153. package/src/shared/resize-handle.tsx +163 -0
  154. package/src/shared/resize-snap.ts +63 -0
  155. package/src/shared/test/resize-snap.test.ts +35 -0
  156. package/src/shared/types.ts +164 -0
  157. package/src/shared/use-item-exit-animation.ts +199 -0
  158. package/src/shared/use-layout-shift-animation.ts +284 -0
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/grid/src/dashboard-lanes/lane-placement.ts
21
+ var lane_placement_exports = {};
22
+ __export(lane_placement_exports, {
23
+ computeLanePlacements: () => computeLanePlacements
24
+ });
25
+ module.exports = __toCommonJS(lane_placement_exports);
26
+ function clampSpan(span, lanes) {
27
+ if (!Number.isFinite(span)) {
28
+ return 1;
29
+ }
30
+ return Math.max(1, Math.min(Math.floor(span), lanes));
31
+ }
32
+ function clampLane(lane, span, lanes) {
33
+ if (!Number.isFinite(lane)) {
34
+ return 0;
35
+ }
36
+ return Math.max(0, Math.min(Math.floor(lane), lanes - span));
37
+ }
38
+ function maxBaselineAcross(laneBottoms, startLane, span) {
39
+ let maxBaseline = 0;
40
+ for (let i = startLane; i < startLane + span; i++) {
41
+ if (laneBottoms[i] > maxBaseline) {
42
+ maxBaseline = laneBottoms[i];
43
+ }
44
+ }
45
+ return maxBaseline;
46
+ }
47
+ function computeLanePlacements(input) {
48
+ const lanes = Math.max(1, Math.floor(input.lanes));
49
+ const gap = Math.max(0, input.gap);
50
+ const tolerance = Math.max(0, input.flowTolerance);
51
+ const laneBottoms = new Array(lanes).fill(0);
52
+ const placements = /* @__PURE__ */ new Map();
53
+ const explicitItems = [];
54
+ const autoItems = [];
55
+ for (const item of input.items) {
56
+ if (item.lane !== void 0) {
57
+ explicitItems.push(item);
58
+ } else {
59
+ autoItems.push(item);
60
+ }
61
+ }
62
+ for (const item of explicitItems) {
63
+ const span = clampSpan(item.span, lanes);
64
+ const lane = clampLane(item.lane, span, lanes);
65
+ const baseline = maxBaselineAcross(laneBottoms, lane, span);
66
+ const top = baseline === 0 ? 0 : baseline + gap;
67
+ const height = Math.max(0, item.height);
68
+ placements.set(item.key, { key: item.key, lane, top, span });
69
+ const newBottom = top + height;
70
+ for (let i = lane; i < lane + span; i++) {
71
+ laneBottoms[i] = newBottom;
72
+ }
73
+ }
74
+ for (const item of autoItems) {
75
+ const span = clampSpan(item.span, lanes);
76
+ let bestLane = 0;
77
+ let bestBaseline = Infinity;
78
+ for (let candidate = 0; candidate <= lanes - span; candidate++) {
79
+ const baseline = maxBaselineAcross(laneBottoms, candidate, span);
80
+ if (bestBaseline - baseline > tolerance) {
81
+ bestBaseline = baseline;
82
+ bestLane = candidate;
83
+ }
84
+ }
85
+ const top = bestBaseline === 0 ? 0 : bestBaseline + gap;
86
+ const height = Math.max(0, item.height);
87
+ placements.set(item.key, {
88
+ key: item.key,
89
+ lane: bestLane,
90
+ top,
91
+ span
92
+ });
93
+ const newBottom = top + height;
94
+ for (let i = bestLane; i < bestLane + span; i++) {
95
+ laneBottoms[i] = newBottom;
96
+ }
97
+ }
98
+ let totalHeight = 0;
99
+ for (const bottom of laneBottoms) {
100
+ if (bottom > totalHeight) {
101
+ totalHeight = bottom;
102
+ }
103
+ }
104
+ return { placements, totalHeight };
105
+ }
106
+ // Annotate the CommonJS export names for ESM import in node:
107
+ 0 && (module.exports = {
108
+ computeLanePlacements
109
+ });
110
+ //# sourceMappingURL=lane-placement.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dashboard-lanes/lane-placement.ts"],
4
+ "sourcesContent": ["/**\n * Lane placement algorithm for `display: grid-lanes` polyfill.\n *\n * Implements the source-ordered, shortest-lane placement described in\n * https://webkit.org/blog/17660/introducing-css-grid-lanes/.\n *\n * The skyline + tolerance core is adapted from the CSS Grid Lanes\n * Polyfill by Simon Willison (MIT,\n * https://tools.simonwillison.net/grid-lanes-polyfill.js). The rest\n * of this module is a pure function suitable for unit testing in\n * isolation from any DOM.\n *\n * Concepts:\n * - \"Lane\" is the cross-axis track: a column in waterfall mode, a row\n * in brick mode. The algorithm is axis-agnostic; the renderer maps\n * the chosen lane index plus offset to `grid-column-start` /\n * `grid-row-start` (or vice versa).\n * - Items are placed in source order. Explicit-lane items are placed\n * first so auto-placed items can flow around them.\n * - `flowTolerance` is a length: when two candidate lanes differ in\n * baseline by no more than this, the earlier lane wins (preserves\n * reading order).\n */\n\n/**\n * A single item to place. Heights are pre-measured by the caller.\n */\nexport type LanePlacementItem = {\n\t/**\n\t * Stable identity. Returned in the result map.\n\t */\n\tkey: string;\n\n\t/**\n\t * Number of contiguous lanes this item occupies. Clamped to\n\t * `[ 1, lanes ]` by the algorithm.\n\t */\n\tspan: number;\n\n\t/**\n\t * Measured cross-axis size (typically pixels). The algorithm only\n\t * adds and compares heights; the unit is whatever the caller uses,\n\t * as long as `gap` and `flowTolerance` use the same one.\n\t */\n\theight: number;\n\n\t/**\n\t * Explicit 0-indexed starting lane. When set, the item bypasses\n\t * the skyline lookup and is placed at this lane regardless of\n\t * source order. Out-of-range values are clamped.\n\t */\n\tlane?: number;\n};\n\n/**\n * Algorithm input.\n */\nexport type LanePlacementInput = {\n\t/**\n\t * Items in source order.\n\t */\n\titems: ReadonlyArray< LanePlacementItem >;\n\n\t/**\n\t * Total number of lanes. Clamped to `>= 1`.\n\t */\n\tlanes: number;\n\n\t/**\n\t * Gap between items in the same lane. Same unit as `height`.\n\t */\n\tgap: number;\n\n\t/**\n\t * Tolerance for source-order tiebreaking. When two candidate\n\t * lanes have baselines within this amount, the earlier lane wins.\n\t * Defaults to `0` if a negative value is passed.\n\t */\n\tflowTolerance: number;\n};\n\n/**\n * Resolved position for a single item.\n */\nexport type LanePlacement = {\n\t/**\n\t * Mirrors the input key.\n\t */\n\tkey: string;\n\n\t/**\n\t * 0-indexed starting lane. The renderer adds 1 for\n\t * `grid-column-start`.\n\t */\n\tlane: number;\n\n\t/**\n\t * Cross-axis offset from the container's start edge, in the same\n\t * unit as the input heights. Use as the item's start position\n\t * (e.g. `top`, or `grid-row-start` after dividing by a row unit).\n\t */\n\ttop: number;\n\n\t/**\n\t * Effective span after clamping. Useful for the renderer when the\n\t * input span exceeded the lane count.\n\t */\n\tspan: number;\n};\n\n/**\n * Algorithm output.\n */\nexport type LanePlacementResult = {\n\t/**\n\t * Per-key placement. Insertion-ordered: the first iteration yields\n\t * the explicit items in source order, then the auto items in\n\t * source order.\n\t */\n\tplacements: Map< string, LanePlacement >;\n\n\t/**\n\t * Sum of the tallest lane after all items are placed. The renderer\n\t * applies this as the container's intrinsic height.\n\t */\n\ttotalHeight: number;\n};\n\nfunction clampSpan( span: number, lanes: number ): number {\n\tif ( ! Number.isFinite( span ) ) {\n\t\treturn 1;\n\t}\n\treturn Math.max( 1, Math.min( Math.floor( span ), lanes ) );\n}\n\nfunction clampLane( lane: number, span: number, lanes: number ): number {\n\tif ( ! Number.isFinite( lane ) ) {\n\t\treturn 0;\n\t}\n\treturn Math.max( 0, Math.min( Math.floor( lane ), lanes - span ) );\n}\n\nfunction maxBaselineAcross(\n\tlaneBottoms: ReadonlyArray< number >,\n\tstartLane: number,\n\tspan: number\n): number {\n\tlet maxBaseline = 0;\n\tfor ( let i = startLane; i < startLane + span; i++ ) {\n\t\tif ( laneBottoms[ i ] > maxBaseline ) {\n\t\t\tmaxBaseline = laneBottoms[ i ];\n\t\t}\n\t}\n\treturn maxBaseline;\n}\n\n/**\n * Places all items into a fixed lane count using the grid-lanes\n * algorithm: explicit items first, then auto items chosen by the\n * shortest-lane skyline with a tolerance for source order.\n *\n * Pure: no DOM access, no mutation of inputs. Safe to call from a\n * worker or during SSR.\n *\n * @param input Items, lane count, gap, and tolerance.\n * @return Per-key placements plus the resulting total height.\n */\nexport function computeLanePlacements(\n\tinput: LanePlacementInput\n): LanePlacementResult {\n\tconst lanes = Math.max( 1, Math.floor( input.lanes ) );\n\tconst gap = Math.max( 0, input.gap );\n\tconst tolerance = Math.max( 0, input.flowTolerance );\n\n\tconst laneBottoms = new Array< number >( lanes ).fill( 0 );\n\tconst placements = new Map< string, LanePlacement >();\n\n\tconst explicitItems: LanePlacementItem[] = [];\n\tconst autoItems: LanePlacementItem[] = [];\n\tfor ( const item of input.items ) {\n\t\tif ( item.lane !== undefined ) {\n\t\t\texplicitItems.push( item );\n\t\t} else {\n\t\t\tautoItems.push( item );\n\t\t}\n\t}\n\n\tfor ( const item of explicitItems ) {\n\t\tconst span = clampSpan( item.span, lanes );\n\t\tconst lane = clampLane( item.lane as number, span, lanes );\n\t\tconst baseline = maxBaselineAcross( laneBottoms, lane, span );\n\t\tconst top = baseline === 0 ? 0 : baseline + gap;\n\t\tconst height = Math.max( 0, item.height );\n\n\t\tplacements.set( item.key, { key: item.key, lane, top, span } );\n\n\t\tconst newBottom = top + height;\n\t\tfor ( let i = lane; i < lane + span; i++ ) {\n\t\t\tlaneBottoms[ i ] = newBottom;\n\t\t}\n\t}\n\n\tfor ( const item of autoItems ) {\n\t\tconst span = clampSpan( item.span, lanes );\n\t\tlet bestLane = 0;\n\t\tlet bestBaseline = Infinity;\n\n\t\tfor ( let candidate = 0; candidate <= lanes - span; candidate++ ) {\n\t\t\tconst baseline = maxBaselineAcross( laneBottoms, candidate, span );\n\n\t\t\t// Only take a lane that is strictly shorter beyond\n\t\t\t// tolerance. Within-tolerance ties keep the earlier lane\n\t\t\t// because candidates iterate in lane order, so the first\n\t\t\t// acceptable baseline wins.\n\t\t\tif ( bestBaseline - baseline > tolerance ) {\n\t\t\t\tbestBaseline = baseline;\n\t\t\t\tbestLane = candidate;\n\t\t\t}\n\t\t}\n\n\t\tconst top = bestBaseline === 0 ? 0 : bestBaseline + gap;\n\t\tconst height = Math.max( 0, item.height );\n\n\t\tplacements.set( item.key, {\n\t\t\tkey: item.key,\n\t\t\tlane: bestLane,\n\t\t\ttop,\n\t\t\tspan,\n\t\t} );\n\n\t\tconst newBottom = top + height;\n\t\tfor ( let i = bestLane; i < bestLane + span; i++ ) {\n\t\t\tlaneBottoms[ i ] = newBottom;\n\t\t}\n\t}\n\n\tlet totalHeight = 0;\n\tfor ( const bottom of laneBottoms ) {\n\t\tif ( bottom > totalHeight ) {\n\t\t\ttotalHeight = bottom;\n\t\t}\n\t}\n\n\treturn { plac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AAW,KAAK,MAAgB,MAAM,KAAM;AACzD,UAAM,WAAW,kBAAmB,aAAa,MAAM,IAAK;AAC5D,UAAM,MAAM,aAAa,IAAI,IAAI,WAAW;AAC5C,UAAM,SAAS,KAAK,IAAK,GAAG,KAAK,MAAO;AAExC,eAAW,IAAK,KAAK,KAAK,EAAE,KAAK,KAAK,KAAK,MAAM,KAAK,KAAK,CAAE;AAE7D,UAAM,YAAY,MAAM;AACxB,aAAU,IAAI,MAAM,IAAI,OAAO,MAAM,KAAM;AAC1C,kBAAa,CAAE,IAAI;AAAA,IACpB;AAAA,EACD;AAEA,aAAY,QAAQ,WAAY;AAC/B,UAAM,OAAO,UAAW,KAAK,MAAM,KAAM;AACzC,QAAI,WAAW;AACf,QAAI,eAAe;AAEnB,aAAU,YAAY,GAAG,aAAa,QAAQ,MAAM,aAAc;AACjE,YAAM,WAAW,kBAAmB,aAAa,WAAW,IAAK;AAMjE,UAAK,eAAe,WAAW,WAAY;AAC1C,uBAAe;AACf,mBAAW;AAAA,MACZ;AAAA,IACD;AAEA,UAAM,MAAM,iBAAiB,IAAI,IAAI,eAAe;AACpD,UAAM,SAAS,KAAK,IAAK,GAAG,KAAK,MAAO;AAExC,eAAW,IAAK,KAAK,KAAK;AAAA,MACzB,KAAK,KAAK;AAAA,MACV,MAAM;AAAA,MACN;AAAA,MACA;AAAA,IACD,CAAE;AAEF,UAAM,YAAY,MAAM;AACxB,aAAU,IAAI,UAAU,IAAI,WAAW,MAAM,KAAM;AAClD,kBAAa,CAAE,IAAI;AAAA,IACpB;AAAA,EACD;AAEA,MAAI,cAAc;AAClB,aAAY,UAAU,aAAc;AACnC,QAAK,SAAS,aAAc;AAC3B,oBAAc;AAAA,IACf;AAAA,EACD;AAEA,SAAO,EAAE,YAAY,YAAY;AAClC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,295 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/grid/src/dashboard-lanes/lanes-item.tsx
31
+ var lanes_item_exports = {};
32
+ __export(lanes_item_exports, {
33
+ LanesItem: () => LanesItem
34
+ });
35
+ module.exports = __toCommonJS(lanes_item_exports);
36
+ var import_sortable = require("@dnd-kit/sortable");
37
+ var import_clsx = __toESM(require("clsx"));
38
+ var import_element = require("@wordpress/element");
39
+ var import_compose = require("@wordpress/compose");
40
+
41
+ // packages/style-runtime/src/index.ts
42
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
43
+ function getRuntime() {
44
+ const globalScope = globalThis;
45
+ if (globalScope.__wpStyleRuntime) {
46
+ return globalScope.__wpStyleRuntime;
47
+ }
48
+ globalScope.__wpStyleRuntime = {
49
+ documents: /* @__PURE__ */ new Map(),
50
+ styles: /* @__PURE__ */ new Map(),
51
+ injectedStyles: /* @__PURE__ */ new WeakMap()
52
+ };
53
+ if (typeof document !== "undefined") {
54
+ registerDocument(document);
55
+ }
56
+ return globalScope.__wpStyleRuntime;
57
+ }
58
+ function documentContainsStyleHash(targetDocument, hash) {
59
+ if (!targetDocument.head) {
60
+ return false;
61
+ }
62
+ for (const style of targetDocument.head.querySelectorAll(
63
+ `style[${STYLE_HASH_ATTRIBUTE}]`
64
+ )) {
65
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
66
+ return true;
67
+ }
68
+ }
69
+ return false;
70
+ }
71
+ function injectStyle(targetDocument, hash, css) {
72
+ if (!targetDocument.head) {
73
+ return;
74
+ }
75
+ const runtime = getRuntime();
76
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
77
+ if (!injectedStyles) {
78
+ injectedStyles = /* @__PURE__ */ new Set();
79
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
80
+ }
81
+ if (injectedStyles.has(hash)) {
82
+ return;
83
+ }
84
+ if (documentContainsStyleHash(targetDocument, hash)) {
85
+ injectedStyles.add(hash);
86
+ return;
87
+ }
88
+ const style = targetDocument.createElement("style");
89
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
90
+ style.appendChild(targetDocument.createTextNode(css));
91
+ targetDocument.head.appendChild(style);
92
+ injectedStyles.add(hash);
93
+ }
94
+ function registerDocument(targetDocument) {
95
+ const runtime = getRuntime();
96
+ runtime.documents.set(
97
+ targetDocument,
98
+ (runtime.documents.get(targetDocument) ?? 0) + 1
99
+ );
100
+ for (const [hash, css] of runtime.styles) {
101
+ injectStyle(targetDocument, hash, css);
102
+ }
103
+ return () => {
104
+ const count = runtime.documents.get(targetDocument);
105
+ if (count === void 0) {
106
+ return;
107
+ }
108
+ if (count <= 1) {
109
+ runtime.documents.delete(targetDocument);
110
+ return;
111
+ }
112
+ runtime.documents.set(targetDocument, count - 1);
113
+ };
114
+ }
115
+ function registerStyle(hash, css) {
116
+ const runtime = getRuntime();
117
+ runtime.styles.set(hash, css);
118
+ for (const targetDocument of runtime.documents.keys()) {
119
+ injectStyle(targetDocument, hash, css);
120
+ }
121
+ }
122
+
123
+ // packages/grid/src/shared/actionable-area-slot.module.css
124
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
125
+ registerStyle("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}");
126
+ }
127
+ var actionable_area_slot_default = { "actionable-area-slot": "_1c54fe8165d3023e__actionable-area-slot" };
128
+
129
+ // packages/grid/src/dashboard-lanes/lanes-item.tsx
130
+ var import_resize_handle = __toESM(require("../shared/resize-handle.cjs"));
131
+ var import_resize_snap = require("../shared/resize-snap.cjs");
132
+ var import_grid_item_key = require("../shared/grid-item-key.cjs");
133
+
134
+ // packages/grid/src/dashboard-lanes/lanes-item.module.css
135
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
136
+ registerStyle("97a2a51c0b", "._0a62d9f1dff8c7d8__item{position:relative}._20c43fcd930d828a__item-content{height:100%;position:relative}._11928ee35f1a9519__is-resizing{overflow:visible;z-index:1}._11928ee35f1a9519__is-resizing ._20c43fcd930d828a__item-content{overflow:visible;position:relative;z-index:2}.b7fc83c8b16e9ee5__is-dragging{pointer-events:none}[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{animation:b026dda570d0eea0__wp-grid-item-placeholder-in 0ms linear var(--wpds-motion-duration-sm,.1s) forwards;opacity:1;outline-color:transparent;outline-style:var(--wp-grid-placeholder-outline-style,dashed);outline-width:0}@keyframes b026dda570d0eea0__wp-grid-item-placeholder-in{to{opacity:var(--wp-grid-placeholder-opacity,.4);outline-color:var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));outline-width:var(--wpds-border-width-sm,2px)}}}@media (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{opacity:var(--wp-grid-placeholder-opacity,.4);outline:var(--wpds-border-width-sm,2px) var(--wp-grid-placeholder-outline-style,dashed) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)))}}@media (forced-colors:active){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}.cd44faab32c27168__preview-overlay{background:transparent;border:var(--wpds-border-width-sm,2px) var(--wp-grid-resize-preview-outline-style,solid) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));box-sizing:border-box;inset-inline-start:0;pointer-events:none;position:absolute;top:0;z-index:0}@media (forced-colors:active){.cd44faab32c27168__preview-overlay{border-color:Highlight}}");
137
+ }
138
+ var lanes_item_default = { "item": "_0a62d9f1dff8c7d8__item", "item-content": "_20c43fcd930d828a__item-content", "is-resizing": "_11928ee35f1a9519__is-resizing", "is-dragging": "b7fc83c8b16e9ee5__is-dragging", "wp-grid-item-placeholder-in": "b026dda570d0eea0__wp-grid-item-placeholder-in", "preview-overlay": "cd44faab32c27168__preview-overlay" };
139
+
140
+ // packages/grid/src/dashboard-lanes/lanes-item.tsx
141
+ var import_jsx_runtime = require("react/jsx-runtime");
142
+ function getItemCursor(disabled, interacting) {
143
+ if (disabled) {
144
+ return "default";
145
+ }
146
+ if (interacting) {
147
+ return void 0;
148
+ }
149
+ return "grab";
150
+ }
151
+ function LanesItem({
152
+ itemKey,
153
+ placementStyle,
154
+ disabled = false,
155
+ interacting = false,
156
+ children,
157
+ actionableArea = null,
158
+ onResize,
159
+ onResizeEnd,
160
+ resizeSnapPreview = null,
161
+ minResizeWidthPx,
162
+ renderResizeHandle,
163
+ dragging = false
164
+ }) {
165
+ const [resizeDelta, setResizeDelta] = (0, import_element.useState)(
166
+ null
167
+ );
168
+ const [initialContentSize, setInitialContentSize] = (0, import_element.useState)(null);
169
+ const itemRef = (0, import_element.useRef)(null);
170
+ const contentRef = (0, import_element.useRef)(null);
171
+ const {
172
+ attributes,
173
+ listeners,
174
+ setNodeRef,
175
+ setActivatorNodeRef,
176
+ isDragging
177
+ } = (0, import_sortable.useSortable)({
178
+ id: itemKey,
179
+ disabled
180
+ });
181
+ const mergedRef = (0, import_compose.useMergeRefs)([itemRef, setNodeRef]);
182
+ const contentMergedRef = (0, import_compose.useMergeRefs)([contentRef]);
183
+ const style = {
184
+ ...placementStyle,
185
+ alignSelf: "start"
186
+ };
187
+ const isResizing = resizeDelta !== null;
188
+ const itemClassName = (0, import_clsx.default)(
189
+ lanes_item_default.item,
190
+ isDragging && lanes_item_default["is-dragging"],
191
+ isResizing && lanes_item_default["is-resizing"]
192
+ );
193
+ const handleResize = (delta) => {
194
+ const contentNode = contentRef.current;
195
+ let baselineSize = initialContentSize;
196
+ if (contentNode && !baselineSize) {
197
+ const { width, height } = contentNode.getBoundingClientRect();
198
+ baselineSize = { width, height };
199
+ setInitialContentSize(baselineSize);
200
+ }
201
+ let clamped = { width: delta.width, height: 0 };
202
+ if (baselineSize) {
203
+ clamped = (0, import_resize_snap.clampResizeDelta)(clamped, baselineSize, {
204
+ width: minResizeWidthPx
205
+ });
206
+ }
207
+ setResizeDelta(clamped);
208
+ onResize(itemKey, clamped);
209
+ };
210
+ const handleResizeEnd = () => {
211
+ setResizeDelta(null);
212
+ setInitialContentSize(null);
213
+ onResizeEnd();
214
+ };
215
+ const continuousContentStyle = resizeDelta && initialContentSize ? {
216
+ width: initialContentSize.width + resizeDelta.width
217
+ } : void 0;
218
+ const previewOverlay = resizeSnapPreview ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
219
+ "div",
220
+ {
221
+ className: lanes_item_default["preview-overlay"],
222
+ style: {
223
+ width: resizeSnapPreview.widthPx,
224
+ height: resizeSnapPreview.heightPx ?? "100%"
225
+ }
226
+ }
227
+ ) : null;
228
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
229
+ "div",
230
+ {
231
+ ref: mergedRef,
232
+ className: itemClassName,
233
+ style,
234
+ ...{ [import_grid_item_key.GRID_ITEM_DATA_KEY]: itemKey },
235
+ "data-wp-grid-item-resizing": isResizing || void 0,
236
+ children: [
237
+ actionableArea ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
238
+ "div",
239
+ {
240
+ className: actionable_area_slot_default["actionable-area-slot"],
241
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
242
+ "div",
243
+ {
244
+ style: { display: "contents" },
245
+ ...dragging ? { inert: "" } : {},
246
+ children: actionableArea
247
+ }
248
+ )
249
+ }
250
+ ) : null,
251
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
252
+ "div",
253
+ {
254
+ ref: setActivatorNodeRef,
255
+ ...attributes,
256
+ ...listeners,
257
+ style: {
258
+ height: "100%",
259
+ cursor: getItemCursor(disabled, interacting)
260
+ },
261
+ children: [
262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
263
+ "div",
264
+ {
265
+ ref: contentMergedRef,
266
+ className: lanes_item_default["item-content"],
267
+ style: continuousContentStyle,
268
+ children: [
269
+ children,
270
+ !disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
271
+ import_resize_handle.default,
272
+ {
273
+ itemId: itemKey,
274
+ verticalResizable: false,
275
+ onResize: handleResize,
276
+ onResizeEnd: handleResizeEnd,
277
+ renderResizeHandle
278
+ }
279
+ )
280
+ ]
281
+ }
282
+ ),
283
+ previewOverlay
284
+ ]
285
+ }
286
+ )
287
+ ]
288
+ }
289
+ );
290
+ }
291
+ // Annotate the CommonJS export names for ESM import in node:
292
+ 0 && (module.exports = {
293
+ LanesItem
294
+ });
295
+ //# sourceMappingURL=lanes-item.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dashboard-lanes/lanes-item.tsx", "../../../style-runtime/src/index.ts", "../../src/shared/actionable-area-slot.module.css", "../../src/dashboard-lanes/lanes-item.module.css"],
4
+ "sourcesContent": ["/**\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 ResizeHandle from '../shared/resize-handle';\nimport { clampResizeDelta, type ResizeSnapSize } from '../shared/resize-snap';\nimport { GRID_ITEM_DATA_KEY } from '../shared/grid-item-key';\nimport type { ResizeDelta, ResizeHandleRenderProps } from '../shared/types';\nimport styles from './lanes-item.module.css';\n\nfunction getItemCursor(\n\tdisabled: boolean,\n\tinteracting: boolean\n): React.CSSProperties[ 'cursor' ] {\n\tif ( disabled ) {\n\t\treturn 'default';\n\t}\n\tif ( interacting ) {\n\t\treturn undefined;\n\t}\n\treturn 'grab';\n}\n\n/**\n * Props for the internal `<LanesItem />` wrapper.\n */\nexport type LanesItemProps = {\n\t/**\n\t * Item key. Forwarded to dnd-kit and emitted as the\n\t * `data-wp-grid-item-key` attribute the hook reads to map measured DOM\n\t * nodes back to logical items.\n\t */\n\titemKey: string;\n\n\t/**\n\t * Inline placement style produced by `useLanePlacement`. On native\n\t * (`display: grid-lanes`), only `gridColumn: span N`. While\n\t * polyfilling, also `gridColumnStart` / `gridRowStart` /\n\t * `gridRowEnd: span N`.\n\t */\n\tplacementStyle: React.CSSProperties;\n\n\t/**\n\t * Whether drag and resize interactions are disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether any tile in the surface is currently being dragged or\n\t * resized. Drives the drag activator cursor.\n\t */\n\tinteracting?: boolean;\n\n\t/**\n\t * Whether a tile drag is in progress. Mutes each tile's\n\t * `actionableArea` with `inert` so hovers on other tiles' controls\n\t * do not steal the gesture.\n\t *\n\t * @default false\n\t */\n\tdragging?: boolean;\n\n\tchildren: React.ReactNode;\n\n\tactionableArea?: React.ReactNode;\n\n\tonResize: ( id: string, delta: ResizeDelta ) => void;\n\n\t/**\n\t * Snapped column span in pixels for the resize-preview outline.\n\t */\n\tresizeSnapPreview?: ResizeSnapSize | null;\n\n\t/**\n\t * Minimum tile width while resizing, in pixels (one column track).\n\t */\n\tminResizeWidthPx: number;\n\n\tonResizeEnd: () => void;\n\n\trenderResizeHandle?: React.ComponentType< ResizeHandleRenderProps >;\n};\n\nexport function LanesItem( {\n\titemKey,\n\tplacementStyle,\n\tdisabled = false,\n\tinteracting = false,\n\tchildren,\n\tactionableArea = null,\n\tonResize,\n\tonResizeEnd,\n\tresizeSnapPreview = null,\n\tminResizeWidthPx,\n\trenderResizeHandle,\n\tdragging = false,\n}: LanesItemProps ) {\n\tconst [ resizeDelta, setResizeDelta ] = useState< ResizeDelta | null >(\n\t\tnull\n\t);\n\tconst [ initialContentSize, setInitialContentSize ] = useState< {\n\t\twidth: number;\n\t\theight: number;\n\t} | null >( null );\n\tconst itemRef = useRef< HTMLDivElement >( null );\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\n\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\tsetActivatorNodeRef,\n\t\tisDragging,\n\t} = useSortable( {\n\t\tid: itemKey,\n\t\tdisabled,\n\t} );\n\tconst mergedRef = useMergeRefs( [ itemRef, setNodeRef ] );\n\tconst contentMergedRef = useMergeRefs( [ contentRef ] );\n\n\tconst style: React.CSSProperties = {\n\t\t...placementStyle,\n\t\talignSelf: 'start',\n\t};\n\n\tconst isResizing = resizeDelta !== null;\n\tconst itemClassName = clsx(\n\t\tstyles.item,\n\t\tisDragging && styles[ 'is-dragging' ],\n\t\tisResizing && styles[ 'is-resizing' ]\n\t);\n\n\tconst handleResize = ( delta: ResizeDelta ) => {\n\t\tconst contentNode = contentRef.current;\n\t\tlet baselineSize = initialContentSize;\n\t\tif ( contentNode && ! baselineSize ) {\n\t\t\tconst { width, height } = contentNode.getBoundingClientRect();\n\t\t\tbaselineSize = { width, height };\n\t\t\tsetInitialContentSize( baselineSize );\n\t\t}\n\t\tlet clamped: ResizeDelta = { width: delta.width, height: 0 };\n\t\tif ( baselineSize ) {\n\t\t\tclamped = clampResizeDelta( clamped, baselineSize, {\n\t\t\t\twidth: minResizeWidthPx,\n\t\t\t} );\n\t\t}\n\t\tsetResizeDelta( clamped );\n\t\tonResize( itemKey, clamped );\n\t};\n\n\tconst handleResizeEnd = () => {\n\t\tsetResizeDelta( null );\n\t\tsetInitialContentSize( null );\n\t\tonResizeEnd();\n\t};\n\n\tconst continuousContentStyle: React.CSSProperties | undefined =\n\t\tresizeDelta && initialContentSize\n\t\t\t? {\n\t\t\t\t\twidth: initialContentSize.width + resizeDelta.width,\n\t\t\t }\n\t\t\t: undefined;\n\n\tconst previewOverlay = resizeSnapPreview ? (\n\t\t<div\n\t\t\tclassName={ styles[ 'preview-overlay' ] }\n\t\t\tstyle={ {\n\t\t\t\twidth: resizeSnapPreview.widthPx,\n\t\t\t\theight: resizeSnapPreview.heightPx ?? '100%',\n\t\t\t} }\n\t\t/>\n\t) : null;\n\n\treturn (\n\t\t<div\n\t\t\tref={ mergedRef }\n\t\t\tclassName={ itemClassName }\n\t\t\tstyle={ style }\n\t\t\t{ ...{ [ GRID_ITEM_DATA_KEY ]: itemKey } }\n\t\t\tdata-wp-grid-item-resizing={ isResizing || undefined }\n\t\t>\n\t\t\t{ actionableArea ? (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ actionableAreaStyles[ 'actionable-area-slot' ] }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={ { display: 'contents' } }\n\t\t\t\t\t\t{ ...( dragging ? { inert: '' } : {} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ actionableArea }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : null }\n\n\t\t\t<div\n\t\t\t\tref={ setActivatorNodeRef }\n\t\t\t\t{ ...attributes }\n\t\t\t\t{ ...listeners }\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tcursor: getItemCursor( disabled, interacting ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tref={ contentMergedRef }\n\t\t\t\t\tclassName={ styles[ 'item-content' ] }\n\t\t\t\t\tstyle={ continuousContentStyle }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t\t{ ! disabled && (\n\t\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\t\titemId={ itemKey }\n\t\t\t\t\t\t\tverticalResizable={ false }\n\t\t\t\t\t\t\tonResize={ handleResize }\n\t\t\t\t\t\t\tonResizeEnd={ handleResizeEnd }\n\t\t\t\t\t\t\trenderResizeHandle={ renderResizeHandle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t{ previewOverlay }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"ac1094954c\", \"._1c54fe8165d3023e__actionable-area-slot{opacity:1}@media (prefers-reduced-motion:no-preference){._1c54fe8165d3023e__actionable-area-slot{transition:opacity var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1))}}[data-wp-grid-resizing] ._1c54fe8165d3023e__actionable-area-slot{opacity:0;pointer-events:none}\");\n}\nexport default {\"actionable-area-slot\":\"_1c54fe8165d3023e__actionable-area-slot\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"97a2a51c0b\", \"._0a62d9f1dff8c7d8__item{position:relative}._20c43fcd930d828a__item-content{height:100%;position:relative}._11928ee35f1a9519__is-resizing{overflow:visible;z-index:1}._11928ee35f1a9519__is-resizing ._20c43fcd930d828a__item-content{overflow:visible;position:relative;z-index:2}.b7fc83c8b16e9ee5__is-dragging{pointer-events:none}[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{animation:b026dda570d0eea0__wp-grid-item-placeholder-in 0ms linear var(--wpds-motion-duration-sm,.1s) forwards;opacity:1;outline-color:transparent;outline-style:var(--wp-grid-placeholder-outline-style,dashed);outline-width:0}@keyframes b026dda570d0eea0__wp-grid-item-placeholder-in{to{opacity:var(--wp-grid-placeholder-opacity,.4);outline-color:var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));outline-width:var(--wpds-border-width-sm,2px)}}}@media (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{opacity:var(--wp-grid-placeholder-opacity,.4);outline:var(--wpds-border-width-sm,2px) var(--wp-grid-placeholder-outline-style,dashed) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)))}}@media (forced-colors:active){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}.cd44faab32c27168__preview-overlay{background:transparent;border:var(--wpds-border-width-sm,2px) var(--wp-grid-resize-preview-outline-style,solid) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));box-sizing:border-box;inset-inline-start:0;pointer-events:none;position:absolute;top:0;z-index:0}@media (forced-colors:active){.cd44faab32c27168__preview-overlay{border-color:Highlight}}\");\n}\nexport default {\"item\":\"_0a62d9f1dff8c7d8__item\",\"item-content\":\"_20c43fcd930d828a__item-content\",\"is-resizing\":\"_11928ee35f1a9519__is-resizing\",\"is-dragging\":\"b7fc83c8b16e9ee5__is-dragging\",\"wp-grid-item-placeholder-in\":\"b026dda570d0eea0__wp-grid-item-placeholder-in\",\"preview-overlay\":\"cd44faab32c27168__preview-overlay\"};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAA4B;AAC5B,kBAAiB;AAKjB,qBAAiC;AACjC,qBAA6B;;;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,MAAO;AAC1D,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;AAC3E,MAAK,CAAE,eAAe,M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AE,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,mBAAQ,cAAe;AAAA,kBACnC,OAAQ;AAAA,kBAEN;AAAA;AAAA,oBACA,CAAE,YACH;AAAA,sBAAC,qBAAAC;AAAA,sBAAA;AAAA,wBACA,QAAS;AAAA,wBACT,mBAAoB;AAAA,wBACpB,UAAW;AAAA,wBACX,aAAc;AAAA,wBACd;AAAA;AAAA,oBACD;AAAA;AAAA;AAAA,cAEF;AAAA,cACE;AAAA;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACD;AAEF;",
6
+ "names": ["clsx", "ResizeHandle"]
7
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/grid/src/dashboard-lanes/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dashboard-lanes/types.ts"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type {\n\tDragPreviewRenderProps,\n\tGridOverlayRenderProps,\n\tResizeHandleRenderProps,\n} from '../shared/types';\n\n/**\n * Lanes layout item definition.\n *\n * Mirrors the public surface of `display: grid-lanes`: column span,\n * an optional pinned lane, and an optional source order. Heights are\n * content-driven; there is no `height` field. There is no `'fill'`\n * (lanes pack their items by skyline; nothing is \"left over\").\n * `'full'` is expressed by setting `width` to the lane count.\n */\nexport type DashboardLanesLayoutItem = {\n\t/**\n\t * Unique key that matches a child component key.\n\t */\n\tkey: string;\n\n\t/**\n\t * Number of lanes this item spans (`grid-column: span N`). Clamped\n\t * to the surface's lane count.\n\t *\n\t * @default 1\n\t */\n\twidth?: number;\n\n\t/**\n\t * Pin the item to a specific 0-indexed lane. Pinned items are\n\t * placed before auto items, so the auto flow runs around them.\n\t * Out-of-range values (negative, or beyond `columns - width`) are\n\t * clamped to the available range.\n\t */\n\tlane?: number;\n\n\t/**\n\t * Display order. Lower values render first. When omitted, the\n\t * item falls back to its index in the `layout` array.\n\t */\n\torder?: number;\n};\n\n/**\n * Props for `DashboardLanes`.\n *\n * `columns` and `minColumnWidth` compose as a layered model:\n * - `columns` alone: fixed N lanes; tiles scale with the container.\n * - `minColumnWidth` alone: lane count derives from container width,\n * floored by the per-tile minimum, down to 1.\n * - Both together: `columns` caps the count, `minColumnWidth` enforces\n * a per-tile width floor that can reduce the count below the cap.\n */\nexport interface DashboardLanesProps\n\textends Omit<\n\t\tReact.ComponentPropsWithoutRef< 'div' >,\n\t\t'children' | 'className' | 'style'\n\t> {\n\t/**\n\t * Array of layout items.\n\t */\n\tlayout: DashboardLanesLayoutItem[];\n\n\t/**\n\t * Surface children. Each child must carry a `key` matching an\n\t * entry in `layout`; children without a match render at the end\n\t * of the surface without explicit placement and fall through the\n\t * lanes auto-flow.\n\t */\n\tchildren: React.ReactNode;\n\n\t/**\n\t * Additional CSS class on the surface root.\n\t */\n\tclassName?: string;\n\n\t/**\n\t * Inline styles on the surface root. Merged underneath the\n\t * surface's own layout styles, so `display` and\n\t * `gridTemplateColumns` always win. The gap between tiles is\n\t * owned by the design-system gap token and is not configurable\n\t * per instance; override it via a theme or density change.\n\t */\n\tstyle?: React.CSSProperties;\n\n\t/**\n\t * `flow-tolerance` value in pixels. When two candidate lanes\n\t * differ in baseline by no more than this, the earlier lane wins\n\t * to preserve source order. Larger values keep tiles closer to\n\t * reading order at the cost of bigger empty regions.\n\t *\n\t * @default 16\n\t */\n\tflowTolerance?: number;\n\n\t/**\n\t * Snap unit for the polyfill's `grid-row-start` / `grid-row-end:\n\t * span N` math. Smaller values produce sharper placement at the\n\t * cost of a larger implicit row count. Ignored on browsers with\n\t * native `display: grid-lanes` support.\n\t *\n\t * @default 4\n\t */\n\trowUnit?: number;\n\n\t/**\n\t * Whether the surface is in edit mode (drag-to-reorder, resize).\n\t *\n\t * @default false\n\t */\n\teditMode?: boolean;\n\n\t/**\n\t * Fired when the user commits a drag or resize.\n\t */\n\tonChangeLayout?: ( newLayout: DashboardLanesLayoutItem[] ) => void;\n\n\t/**\n\t * Fired continuously during a gesture with the in-progress\n\t * layout. The committed result still emits via `onChangeLayout`.\n\t */\n\tonPreviewLayout?: ( previewLayout: DashboardLanesLayoutItem[] ) => void;\n\n\t/**\n\t * Override the default corner resize handle. See `DashboardGrid`\n\t * for the full contract; on lanes the handle is horizontal-only\n\t * because heights are content-driven.\n\t */\n\trenderResizeHandle?: React.ComponentType< ResizeHandleRenderProps >;\n\n\t/**\n\t * Custom wrapper for the dragged-clone visual mounted inside\n\t * `<DragOverlay>`. The surface always wraps the clone with a thin\n\t * functional frame (lift scale, grabbing cursor, pointer pass-\n\t * through) and mounts this component inside it; the consumer\n\t * owns the visual chrome (shadow, radius, padding).\n\t *\n\t * When omitted, the cloned children render directly inside the\n\t * functional frame so any chrome the consumer applied to the\n\t * persistent tile carries through unchanged.\n\t *\n\t * Token-only adjustments (lift scale, placeholder opacity,\n\t * outline color, placeholder radius) flow through CSS custom\n\t * properties documented in the README.\n\t */\n\trenderDragPreview?: React.ComponentType< DragPreviewRenderProps >;\n\n\t/**\n\t * Override the default edit-mode overlay (empty column tracks) with\n\t * a custom component. Lanes are content-driven vertically, so no\n\t * `rowHeight` or `rows` is supplied and the default visual paints\n\t * columns only.\n\t *\n\t * The overlay only renders when `editMode` is true. When omitted,\n\t * the package's default visual is used.\n\t */\n\trenderGridOverlay?: React.ComponentType< GridOverlayRenderProps >;\n\n\t/**\n\t * Target lane count, used as a cap. Defaults to six when neither\n\t * `columns` nor `minColumnWidth` is set; with `minColumnWidth` set\n\t * it can resolve lower on narrow containers.\n\t */\n\tcolumns?: number;\n\n\t/**\n\t * Per-tile minimum width in pixels. Enables responsive mode: the\n\t * lane count derives from container width, floored by this value,\n\t * down to 1.\n\t */\n\tminColumnWidth?: number;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }