@wordpress/grid 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +35 -14
  2. package/build/dashboard-grid/grid-item.cjs +232 -295
  3. package/build/dashboard-grid/grid-item.cjs.map +1 -7
  4. package/build/dashboard-grid/index.cjs +526 -633
  5. package/build/dashboard-grid/index.cjs.map +1 -7
  6. package/build/dashboard-grid/resolve-fill-widths.cjs +159 -203
  7. package/build/dashboard-grid/resolve-fill-widths.cjs.map +1 -7
  8. package/build/dashboard-grid/types.cjs +4 -18
  9. package/build/dashboard-lanes/index.cjs +495 -577
  10. package/build/dashboard-lanes/index.cjs.map +1 -7
  11. package/build/dashboard-lanes/lane-placement.cjs +77 -100
  12. package/build/dashboard-lanes/lane-placement.cjs.map +1 -7
  13. package/build/dashboard-lanes/lanes-item.cjs +222 -278
  14. package/build/dashboard-lanes/lanes-item.cjs.map +1 -7
  15. package/build/dashboard-lanes/types.cjs +4 -18
  16. package/build/dashboard-lanes/use-lane-placement.cjs +172 -198
  17. package/build/dashboard-lanes/use-lane-placement.cjs.map +1 -7
  18. package/build/index.cjs +16 -31
  19. package/build/shared/array-move-with-pinned.cjs +29 -45
  20. package/build/shared/array-move-with-pinned.cjs.map +1 -7
  21. package/build/shared/column-policy.cjs +58 -0
  22. package/build/shared/column-policy.cjs.map +1 -0
  23. package/build/shared/drag-overlay-drop-animation.cjs +40 -66
  24. package/build/shared/drag-overlay-drop-animation.cjs.map +1 -7
  25. package/build/shared/grid-item-key.cjs +12 -29
  26. package/build/shared/grid-item-key.cjs.map +1 -7
  27. package/build/shared/grid-overlay.cjs +163 -164
  28. package/build/shared/grid-overlay.cjs.map +1 -7
  29. package/build/shared/item-exit-overlay.cjs +132 -134
  30. package/build/shared/item-exit-overlay.cjs.map +1 -7
  31. package/build/shared/resize-handle.cjs +213 -197
  32. package/build/shared/resize-handle.cjs.map +1 -7
  33. package/build/shared/resize-snap.cjs +116 -121
  34. package/build/shared/resize-snap.cjs.map +1 -7
  35. package/build/shared/types.cjs +4 -18
  36. package/build/shared/use-item-exit-animation.cjs +96 -143
  37. package/build/shared/use-item-exit-animation.cjs.map +1 -7
  38. package/build/shared/use-layout-shift-animation.cjs +121 -150
  39. package/build/shared/use-layout-shift-animation.cjs.map +1 -7
  40. package/build/shared/use-span-bounds.cjs +65 -79
  41. package/build/shared/use-span-bounds.cjs.map +1 -7
  42. package/build-module/dashboard-grid/grid-item.mjs +209 -265
  43. package/build-module/dashboard-grid/grid-item.mjs.map +1 -7
  44. package/build-module/dashboard-grid/index.mjs +502 -623
  45. package/build-module/dashboard-grid/index.mjs.map +1 -7
  46. package/build-module/dashboard-grid/resolve-fill-widths.mjs +155 -179
  47. package/build-module/dashboard-grid/resolve-fill-widths.mjs.map +1 -7
  48. package/build-module/dashboard-grid/types.mjs +0 -1
  49. package/build-module/dashboard-lanes/index.mjs +470 -567
  50. package/build-module/dashboard-lanes/index.mjs.map +1 -7
  51. package/build-module/dashboard-lanes/lane-placement.mjs +73 -76
  52. package/build-module/dashboard-lanes/lane-placement.mjs.map +1 -7
  53. package/build-module/dashboard-lanes/lanes-item.mjs +199 -248
  54. package/build-module/dashboard-lanes/lanes-item.mjs.map +1 -7
  55. package/build-module/dashboard-lanes/types.mjs +0 -1
  56. package/build-module/dashboard-lanes/use-lane-placement.mjs +167 -173
  57. package/build-module/dashboard-lanes/use-lane-placement.mjs.map +1 -7
  58. package/build-module/index.mjs +1 -6
  59. package/build-module/shared/array-move-with-pinned.mjs +25 -21
  60. package/build-module/shared/array-move-with-pinned.mjs.map +1 -7
  61. package/build-module/shared/column-policy.mjs +52 -0
  62. package/build-module/shared/column-policy.mjs.map +1 -0
  63. package/build-module/shared/drag-overlay-drop-animation.mjs +35 -44
  64. package/build-module/shared/drag-overlay-drop-animation.mjs.map +1 -7
  65. package/build-module/shared/grid-item-key.mjs +8 -5
  66. package/build-module/shared/grid-item-key.mjs.map +1 -7
  67. package/build-module/shared/grid-overlay.mjs +143 -136
  68. package/build-module/shared/grid-overlay.mjs.map +1 -7
  69. package/build-module/shared/item-exit-overlay.mjs +128 -110
  70. package/build-module/shared/item-exit-overlay.mjs.map +1 -7
  71. package/build-module/shared/resize-handle.mjs +191 -171
  72. package/build-module/shared/resize-handle.mjs.map +1 -7
  73. package/build-module/shared/resize-snap.mjs +108 -93
  74. package/build-module/shared/resize-snap.mjs.map +1 -7
  75. package/build-module/shared/types.mjs +0 -1
  76. package/build-module/shared/use-item-exit-animation.mjs +92 -124
  77. package/build-module/shared/use-item-exit-animation.mjs.map +1 -7
  78. package/build-module/shared/use-layout-shift-animation.mjs +114 -123
  79. package/build-module/shared/use-layout-shift-animation.mjs.map +1 -7
  80. package/build-module/shared/use-span-bounds.mjs +60 -57
  81. package/build-module/shared/use-span-bounds.mjs.map +1 -7
  82. package/build-types/dashboard-grid/index.d.ts.map +1 -1
  83. package/build-types/dashboard-grid/types.d.ts +9 -5
  84. package/build-types/dashboard-grid/types.d.ts.map +1 -1
  85. package/build-types/dashboard-lanes/index.d.ts.map +1 -1
  86. package/build-types/dashboard-lanes/types.d.ts +9 -5
  87. package/build-types/dashboard-lanes/types.d.ts.map +1 -1
  88. package/build-types/index.d.ts +1 -0
  89. package/build-types/index.d.ts.map +1 -1
  90. package/build-types/shared/column-policy.d.ts +43 -0
  91. package/build-types/shared/column-policy.d.ts.map +1 -0
  92. package/package.json +14 -12
  93. package/src/dashboard-grid/grid-item.tsx +1 -1
  94. package/src/dashboard-grid/{grid.module.css → grid.module.scss} +10 -19
  95. package/src/dashboard-grid/index.tsx +12 -13
  96. package/src/dashboard-grid/stories/index.story.tsx +129 -50
  97. package/src/dashboard-grid/test/item-interactions.browser.test.tsx +1 -1
  98. package/src/dashboard-grid/types.ts +9 -5
  99. package/src/dashboard-lanes/index.tsx +13 -13
  100. package/src/dashboard-lanes/lanes-item.tsx +1 -1
  101. package/src/dashboard-lanes/{lanes.module.css → lanes.module.scss} +10 -19
  102. package/src/dashboard-lanes/stories/index.story.tsx +124 -28
  103. package/src/dashboard-lanes/test/item-interactions.browser.test.tsx +1 -1
  104. package/src/dashboard-lanes/types.ts +9 -5
  105. package/src/index.ts +1 -0
  106. package/src/shared/column-policy.ts +100 -0
  107. package/src/shared/test/column-policy.test.ts +215 -0
  108. package/src/shared/test/sortable-semantics.browser.test.tsx +122 -0
  109. package/build/dashboard-grid/types.cjs.map +0 -7
  110. package/build/dashboard-lanes/types.cjs.map +0 -7
  111. package/build/index.cjs.map +0 -7
  112. package/build/shared/types.cjs.map +0 -7
  113. package/build-module/dashboard-grid/types.mjs.map +0 -7
  114. package/build-module/dashboard-lanes/types.mjs.map +0 -7
  115. package/build-module/index.mjs.map +0 -7
  116. package/build-module/shared/types.mjs.map +0 -7
@@ -1,304 +1,248 @@
1
1
  "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ // \0rolldown/runtime.js
2
7
  var __create = Object.create;
3
8
  var __defProp = Object.defineProperty;
4
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
10
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
11
  var __getProtoOf = Object.getPrototypeOf;
7
12
  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
13
  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;
14
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
19
22
  };
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
- var import_react_inert_value = require("@wordpress/react-inert-value");
41
-
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ let _dnd_kit_sortable = require("@dnd-kit/sortable");
28
+ let clsx = require("clsx");
29
+ clsx = __toESM(clsx);
30
+ let _wordpress_element = require("@wordpress/element");
31
+ let _wordpress_compose = require("@wordpress/compose");
32
+ let _wordpress_react_inert_value = require("@wordpress/react-inert-value");
33
+ let ___shared_resize_handle_tsx = require("../shared/resize-handle.cjs");
34
+ ___shared_resize_handle_tsx = __toESM(___shared_resize_handle_tsx);
35
+ let ___shared_resize_snap_ts = require("../shared/resize-snap.cjs");
36
+ let ___shared_grid_item_key_ts = require("../shared/grid-item-key.cjs");
37
+ let react_jsx_runtime = require("react/jsx-runtime");
42
38
  // packages/style-runtime/src/index.ts
43
- var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
39
+ const STYLE_HASH_ATTRIBUTE = "data-wp-hash";
40
+ /**
41
+ * Returns the shared style runtime registry.
42
+ *
43
+ * The registry is stored on `globalThis` so separately bundled copies of this
44
+ * package can coordinate through the same document and style maps.
45
+ *
46
+ * @return The shared runtime registry.
47
+ */
44
48
  function getRuntime() {
45
- const globalScope = globalThis;
46
- if (globalScope.__wpStyleRuntime) {
47
- return globalScope.__wpStyleRuntime;
48
- }
49
- globalScope.__wpStyleRuntime = {
50
- documents: /* @__PURE__ */ new Map(),
51
- styles: /* @__PURE__ */ new Map(),
52
- injectedStyles: /* @__PURE__ */ new WeakMap()
53
- };
54
- if (typeof document !== "undefined") {
55
- registerDocument(document);
56
- }
57
- return globalScope.__wpStyleRuntime;
49
+ const globalScope = globalThis;
50
+ if (globalScope.__wpStyleRuntime) return globalScope.__wpStyleRuntime;
51
+ globalScope.__wpStyleRuntime = {
52
+ documents: /* @__PURE__ */ new Map(),
53
+ styles: /* @__PURE__ */ new Map(),
54
+ injectedStyles: /* @__PURE__ */ new WeakMap()
55
+ };
56
+ if (typeof document !== "undefined") registerDocument(document);
57
+ return globalScope.__wpStyleRuntime;
58
58
  }
59
+ /**
60
+ * Checks whether a document already contains a style tag for a hash.
61
+ *
62
+ * @param targetDocument Document to inspect.
63
+ * @param hash Stable hash for the transformed CSS.
64
+ *
65
+ * @return Whether the style hash already exists in the document.
66
+ */
59
67
  function documentContainsStyleHash(targetDocument, hash) {
60
- if (!targetDocument.head) {
61
- return false;
62
- }
63
- for (const style of targetDocument.head.querySelectorAll(
64
- `style[${STYLE_HASH_ATTRIBUTE}]`
65
- )) {
66
- if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
67
- return true;
68
- }
69
- }
70
- return false;
68
+ if (!targetDocument.head) return false;
69
+ for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) return true;
70
+ return false;
71
71
  }
72
+ /**
73
+ * Injects a registered style into a document, unless that document already
74
+ * contains a style tag for the same hash.
75
+ *
76
+ * @param targetDocument Document to inject the style into.
77
+ * @param hash Stable hash for the transformed CSS.
78
+ * @param css CSS text to inject.
79
+ */
72
80
  function injectStyle(targetDocument, hash, css) {
73
- if (!targetDocument.head) {
74
- return;
75
- }
76
- const runtime = getRuntime();
77
- let injectedStyles = runtime.injectedStyles.get(targetDocument);
78
- if (!injectedStyles) {
79
- injectedStyles = /* @__PURE__ */ new Set();
80
- runtime.injectedStyles.set(targetDocument, injectedStyles);
81
- }
82
- if (injectedStyles.has(hash)) {
83
- return;
84
- }
85
- if (documentContainsStyleHash(targetDocument, hash)) {
86
- injectedStyles.add(hash);
87
- return;
88
- }
89
- const style = targetDocument.createElement("style");
90
- style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
91
- style.appendChild(targetDocument.createTextNode(css));
92
- targetDocument.head.appendChild(style);
93
- injectedStyles.add(hash);
81
+ if (!targetDocument.head) return;
82
+ const runtime = getRuntime();
83
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
84
+ if (!injectedStyles) {
85
+ injectedStyles = /* @__PURE__ */ new Set();
86
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
87
+ }
88
+ if (injectedStyles.has(hash)) return;
89
+ if (documentContainsStyleHash(targetDocument, hash)) {
90
+ injectedStyles.add(hash);
91
+ return;
92
+ }
93
+ const style = targetDocument.createElement("style");
94
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
95
+ style.appendChild(targetDocument.createTextNode(css));
96
+ targetDocument.head.appendChild(style);
97
+ injectedStyles.add(hash);
94
98
  }
99
+ /**
100
+ * Registers a document as a style injection target.
101
+ *
102
+ * Existing registered styles are replayed into the document immediately.
103
+ * Documents are reference-counted so multiple providers can safely register the
104
+ * same document without one cleanup removing it while another registration is
105
+ * still active.
106
+ *
107
+ * @param targetDocument Document to receive registered styles.
108
+ * @return Cleanup function that unregisters this document registration.
109
+ */
95
110
  function registerDocument(targetDocument) {
96
- const runtime = getRuntime();
97
- runtime.documents.set(
98
- targetDocument,
99
- (runtime.documents.get(targetDocument) ?? 0) + 1
100
- );
101
- for (const [hash, css] of runtime.styles) {
102
- injectStyle(targetDocument, hash, css);
103
- }
104
- return () => {
105
- const count = runtime.documents.get(targetDocument);
106
- if (count === void 0) {
107
- return;
108
- }
109
- if (count <= 1) {
110
- runtime.documents.delete(targetDocument);
111
- return;
112
- }
113
- runtime.documents.set(targetDocument, count - 1);
114
- };
111
+ const runtime = getRuntime();
112
+ runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);
113
+ for (const [hash, css] of runtime.styles) injectStyle(targetDocument, hash, css);
114
+ return () => {
115
+ const count = runtime.documents.get(targetDocument);
116
+ if (count === void 0) return;
117
+ if (count <= 1) {
118
+ runtime.documents.delete(targetDocument);
119
+ return;
120
+ }
121
+ runtime.documents.set(targetDocument, count - 1);
122
+ };
115
123
  }
124
+ /**
125
+ * Registers a style and injects it into all registered documents.
126
+ *
127
+ * The hash is used as the deduplication key, so calling this repeatedly with
128
+ * the same hash will not add duplicate style tags to a document.
129
+ * Registered styles are retained for the lifetime of the page so they can be
130
+ * replayed into documents that are registered later.
131
+ *
132
+ * @param hash Stable hash for the transformed CSS.
133
+ * @param css CSS text to inject.
134
+ */
116
135
  function registerStyle(hash, css) {
117
- const runtime = getRuntime();
118
- runtime.styles.set(hash, css);
119
- for (const targetDocument of runtime.documents.keys()) {
120
- injectStyle(targetDocument, hash, css);
121
- }
136
+ const runtime = getRuntime();
137
+ runtime.styles.set(hash, css);
138
+ for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
122
139
  }
123
-
124
140
  // packages/grid/src/shared/actionable-area-slot.module.css
125
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
126
- 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}");
127
- }
128
- var actionable_area_slot_default = { "actionable-area-slot": "_1c54fe8165d3023e__actionable-area-slot" };
129
-
130
- // packages/grid/src/dashboard-lanes/lanes-item.tsx
131
- var import_resize_handle = __toESM(require("../shared/resize-handle.cjs"));
132
- var import_resize_snap = require("../shared/resize-snap.cjs");
133
- var import_grid_item_key = require("../shared/grid-item-key.cjs");
134
-
141
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("36a7a084ce", "._0a2b470abcf47e5b__actionable-area-slot{opacity:1}@media (prefers-reduced-motion:no-preference){._0a2b470abcf47e5b__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] ._0a2b470abcf47e5b__actionable-area-slot{opacity:0;pointer-events:none}");
142
+ var actionable_area_slot_module_default = { "actionable-area-slot": "_0a2b470abcf47e5b__actionable-area-slot" };
135
143
  // packages/grid/src/dashboard-lanes/lanes-item.module.css
136
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
137
- 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}}");
138
- }
139
- 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" };
140
-
144
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("0fa64ddd95", "._31c3cc93e2ae64fa__item{position:relative}._3f7297c1fa9fef39__item-content{height:100%;position:relative}.e1dfe63167e7d0b8__is-resizing{overflow:visible;z-index:1}.e1dfe63167e7d0b8__is-resizing ._3f7297c1fa9fef39__item-content{overflow:visible;position:relative;z-index:2}._28d819356520d8d1__is-dragging{pointer-events:none}[data-wp-grid-dragging] ._28d819356520d8d1__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] ._28d819356520d8d1__is-dragging{animation:ad99d2d1d0017024__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 ad99d2d1d0017024__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] ._28d819356520d8d1__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] ._28d819356520d8d1__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}._126192ec000c65e5__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){._126192ec000c65e5__preview-overlay{border-color:Highlight}}");
145
+ var lanes_item_module_default = {
146
+ "item": "_31c3cc93e2ae64fa__item",
147
+ "item-content": "_3f7297c1fa9fef39__item-content",
148
+ "is-resizing": "e1dfe63167e7d0b8__is-resizing",
149
+ "is-dragging": "_28d819356520d8d1__is-dragging",
150
+ "wp-grid-item-placeholder-in": "ad99d2d1d0017024__wp-grid-item-placeholder-in",
151
+ "preview-overlay": "_126192ec000c65e5__preview-overlay"
152
+ };
141
153
  // packages/grid/src/dashboard-lanes/lanes-item.tsx
142
- var import_jsx_runtime = require("react/jsx-runtime");
143
154
  function getItemCursor(disabled, interacting) {
144
- if (disabled) {
145
- return "default";
146
- }
147
- if (interacting) {
148
- return void 0;
149
- }
150
- return "grab";
155
+ if (disabled) return "default";
156
+ if (interacting) return;
157
+ return "grab";
151
158
  }
152
- function LanesItem({
153
- itemKey,
154
- placementStyle,
155
- disabled = false,
156
- draggable = true,
157
- resizable = true,
158
- interacting = false,
159
- children,
160
- actionableArea = null,
161
- onResize,
162
- onResizeEnd,
163
- resizeSnapPreview = null,
164
- minResizeWidthPx,
165
- maxResizeWidthPx,
166
- renderResizeHandle,
167
- dragging = false
168
- }) {
169
- const [resizeDelta, setResizeDelta] = (0, import_element.useState)(
170
- null
171
- );
172
- const [initialContentSize, setInitialContentSize] = (0, import_element.useState)(null);
173
- const itemRef = (0, import_element.useRef)(null);
174
- const contentRef = (0, import_element.useRef)(null);
175
- const dragDisabled = disabled || !draggable;
176
- const resizeDisabled = disabled || !resizable;
177
- const {
178
- attributes,
179
- listeners,
180
- setNodeRef,
181
- setActivatorNodeRef,
182
- isDragging
183
- } = (0, import_sortable.useSortable)({
184
- id: itemKey,
185
- disabled: dragDisabled
186
- });
187
- const mergedRef = (0, import_compose.useMergeRefs)([itemRef, setNodeRef]);
188
- const contentMergedRef = (0, import_compose.useMergeRefs)([contentRef]);
189
- const style = {
190
- ...placementStyle,
191
- alignSelf: "start"
192
- };
193
- const isResizing = resizeDelta !== null;
194
- const itemClassName = (0, import_clsx.default)(
195
- lanes_item_default.item,
196
- isDragging && lanes_item_default["is-dragging"],
197
- isResizing && lanes_item_default["is-resizing"]
198
- );
199
- const handleResize = (delta) => {
200
- const contentNode = contentRef.current;
201
- let baselineSize = initialContentSize;
202
- if (contentNode && !baselineSize) {
203
- const { width, height } = contentNode.getBoundingClientRect();
204
- baselineSize = { width, height };
205
- setInitialContentSize(baselineSize);
206
- }
207
- let clamped = { width: delta.width, height: 0 };
208
- if (baselineSize) {
209
- clamped = (0, import_resize_snap.clampResizeDelta)(
210
- clamped,
211
- baselineSize,
212
- { width: minResizeWidthPx },
213
- { width: maxResizeWidthPx }
214
- );
215
- }
216
- setResizeDelta(clamped);
217
- onResize(itemKey, clamped);
218
- };
219
- const handleResizeEnd = () => {
220
- setResizeDelta(null);
221
- setInitialContentSize(null);
222
- onResizeEnd();
223
- };
224
- const continuousContentStyle = resizeDelta && initialContentSize ? {
225
- width: initialContentSize.width + resizeDelta.width
226
- } : void 0;
227
- const previewOverlay = resizeSnapPreview ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
228
- "div",
229
- {
230
- className: lanes_item_default["preview-overlay"],
231
- style: {
232
- width: resizeSnapPreview.widthPx,
233
- height: resizeSnapPreview.heightPx ?? "100%"
234
- }
235
- }
236
- ) : null;
237
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
238
- "div",
239
- {
240
- ref: mergedRef,
241
- className: itemClassName,
242
- style,
243
- ...{ [import_grid_item_key.GRID_ITEM_DATA_KEY]: itemKey },
244
- "data-wp-grid-item-resizing": isResizing || void 0,
245
- children: [
246
- actionableArea ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
247
- "div",
248
- {
249
- className: actionable_area_slot_default["actionable-area-slot"],
250
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
251
- "div",
252
- {
253
- style: { display: "contents" },
254
- inert: (0, import_react_inert_value.inertValue)(dragging),
255
- children: actionableArea
256
- }
257
- )
258
- }
259
- ) : null,
260
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
261
- "div",
262
- {
263
- ref: setActivatorNodeRef,
264
- ...attributes,
265
- ...listeners,
266
- style: {
267
- height: "100%",
268
- cursor: getItemCursor(dragDisabled, interacting)
269
- },
270
- children: [
271
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
272
- "div",
273
- {
274
- ref: contentMergedRef,
275
- className: lanes_item_default["item-content"],
276
- style: continuousContentStyle,
277
- children: [
278
- children,
279
- !resizeDisabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
280
- import_resize_handle.default,
281
- {
282
- itemId: itemKey,
283
- verticalResizable: false,
284
- onResize: handleResize,
285
- onResizeEnd: handleResizeEnd,
286
- renderResizeHandle
287
- }
288
- )
289
- ]
290
- }
291
- ),
292
- previewOverlay
293
- ]
294
- }
295
- )
296
- ]
297
- }
298
- );
159
+ function LanesItem({ itemKey, placementStyle, disabled = false, draggable = true, resizable = true, interacting = false, children, actionableArea = null, onResize, onResizeEnd, resizeSnapPreview = null, minResizeWidthPx, maxResizeWidthPx, renderResizeHandle, dragging = false }) {
160
+ const [resizeDelta, setResizeDelta] = (0, _wordpress_element.useState)(null);
161
+ const [initialContentSize, setInitialContentSize] = (0, _wordpress_element.useState)(null);
162
+ const itemRef = (0, _wordpress_element.useRef)(null);
163
+ const contentRef = (0, _wordpress_element.useRef)(null);
164
+ const dragDisabled = disabled || !draggable;
165
+ const resizeDisabled = disabled || !resizable;
166
+ const { attributes, listeners, setNodeRef, setActivatorNodeRef, isDragging } = (0, _dnd_kit_sortable.useSortable)({
167
+ id: itemKey,
168
+ disabled: dragDisabled
169
+ });
170
+ const mergedRef = (0, _wordpress_compose.useMergeRefs)([itemRef, setNodeRef]);
171
+ const contentMergedRef = (0, _wordpress_compose.useMergeRefs)([contentRef]);
172
+ const style = {
173
+ ...placementStyle,
174
+ alignSelf: "start"
175
+ };
176
+ const isResizing = resizeDelta !== null;
177
+ const itemClassName = (0, clsx.default)(lanes_item_module_default.item, isDragging && lanes_item_module_default["is-dragging"], isResizing && lanes_item_module_default["is-resizing"]);
178
+ const handleResize = (delta) => {
179
+ const contentNode = contentRef.current;
180
+ let baselineSize = initialContentSize;
181
+ if (contentNode && !baselineSize) {
182
+ const { width, height } = contentNode.getBoundingClientRect();
183
+ baselineSize = {
184
+ width,
185
+ height
186
+ };
187
+ setInitialContentSize(baselineSize);
188
+ }
189
+ let clamped = {
190
+ width: delta.width,
191
+ height: 0
192
+ };
193
+ if (baselineSize) clamped = (0, ___shared_resize_snap_ts.clampResizeDelta)(clamped, baselineSize, { width: minResizeWidthPx }, { width: maxResizeWidthPx });
194
+ setResizeDelta(clamped);
195
+ onResize(itemKey, clamped);
196
+ };
197
+ const handleResizeEnd = () => {
198
+ setResizeDelta(null);
199
+ setInitialContentSize(null);
200
+ onResizeEnd();
201
+ };
202
+ const continuousContentStyle = resizeDelta && initialContentSize ? { width: initialContentSize.width + resizeDelta.width } : void 0;
203
+ const previewOverlay = resizeSnapPreview ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
204
+ className: lanes_item_module_default["preview-overlay"],
205
+ style: {
206
+ width: resizeSnapPreview.widthPx,
207
+ height: resizeSnapPreview.heightPx ?? "100%"
208
+ }
209
+ }) : null;
210
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
211
+ ref: mergedRef,
212
+ className: itemClassName,
213
+ style,
214
+ [___shared_grid_item_key_ts.GRID_ITEM_DATA_KEY]: itemKey,
215
+ "data-wp-grid-item-resizing": isResizing || void 0,
216
+ children: [actionableArea ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
217
+ className: actionable_area_slot_module_default["actionable-area-slot"],
218
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
219
+ style: { display: "contents" },
220
+ inert: (0, _wordpress_react_inert_value.inertValue)(dragging),
221
+ children: actionableArea
222
+ })
223
+ }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
224
+ ref: setActivatorNodeRef,
225
+ ...dragDisabled ? {} : attributes,
226
+ ...listeners,
227
+ style: {
228
+ height: "100%",
229
+ cursor: getItemCursor(dragDisabled, interacting)
230
+ },
231
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
232
+ ref: contentMergedRef,
233
+ className: lanes_item_module_default["item-content"],
234
+ style: continuousContentStyle,
235
+ children: [children, !resizeDisabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___shared_resize_handle_tsx.default, {
236
+ itemId: itemKey,
237
+ verticalResizable: false,
238
+ onResize: handleResize,
239
+ onResizeEnd: handleResizeEnd,
240
+ renderResizeHandle
241
+ })]
242
+ }), previewOverlay]
243
+ })]
244
+ });
299
245
  }
300
- // Annotate the CommonJS export names for ESM import in node:
301
- 0 && (module.exports = {
302
- LanesItem
303
- });
304
- //# sourceMappingURL=lanes-item.cjs.map
246
+ exports.LanesItem = LanesItem;
247
+
248
+ //# sourceMappingURL=lanes-item.cjs.map
@@ -1,7 +1 @@
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": ["import { useSortable } from '@dnd-kit/sortable';\nimport clsx from 'clsx';\nimport { useState, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { inertValue } from '@wordpress/react-inert-value';\nimport actionableAreaStyles from '../shared/actionable-area-slot.module.css';\nimport ResizeHandle from '../shared/resize-handle';\nimport { clampResizeDelta, type ResizeSnapSize } from '../shared/resize-snap';\nimport { GRID_ITEM_DATA_KEY } from '../shared/grid-item-key';\nimport type { ResizeDelta, ResizeHandleRenderProps } from '../shared/types';\nimport styles from './lanes-item.module.css';\n\nfunction getItemCursor(\n\tdisabled: boolean,\n\tinteracting: boolean\n): React.CSSProperties[ 'cursor' ] {\n\tif ( disabled ) {\n\t\treturn 'default';\n\t}\n\tif ( interacting ) {\n\t\treturn undefined;\n\t}\n\treturn 'grab';\n}\n\n/**\n * Props for the internal `<LanesItem />` wrapper.\n */\nexport type LanesItemProps = {\n\t/**\n\t * Item key. Forwarded to dnd-kit and emitted as the\n\t * `data-wp-grid-item-key` attribute the hook reads to map measured DOM\n\t * nodes back to logical items.\n\t */\n\titemKey: string;\n\n\t/**\n\t * Inline placement style produced by `useLanePlacement`. On native\n\t * (`display: grid-lanes`), only `gridColumn: span N`. While\n\t * polyfilling, also `gridColumnStart` / `gridRowStart` /\n\t * `gridRowEnd: span N`.\n\t */\n\tplacementStyle: React.CSSProperties;\n\n\t/**\n\t * Whether drag and resize interactions are disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the item can be dragged. Combined with `disabled`.\n\t *\n\t * @default true\n\t */\n\tdraggable?: boolean;\n\n\t/**\n\t * Whether the item can be resized. Combined with `disabled`.\n\t *\n\t * @default true\n\t */\n\tresizable?: boolean;\n\n\t/**\n\t * Whether any tile in the surface is currently being dragged or\n\t * resized. Drives the drag activator cursor.\n\t */\n\tinteracting?: boolean;\n\n\t/**\n\t * Whether a tile drag is in progress. Mutes each tile's\n\t * `actionableArea` with `inert` so hovers on other tiles' controls\n\t * do not steal the gesture.\n\t *\n\t * @default false\n\t */\n\tdragging?: boolean;\n\n\tchildren: React.ReactNode;\n\n\tactionableArea?: React.ReactNode;\n\n\tonResize: ( id: string, delta: ResizeDelta ) => void;\n\n\t/**\n\t * Snapped column span in pixels for the resize-preview outline.\n\t */\n\tresizeSnapPreview?: ResizeSnapSize | null;\n\n\t/**\n\t * Minimum tile width while resizing, in pixels (one column track).\n\t */\n\tminResizeWidthPx: number;\n\n\t/**\n\t * Maximum tile width while resizing, in pixels. Omitted when the\n\t * item declares no width limit.\n\t */\n\tmaxResizeWidthPx?: number;\n\n\tonResizeEnd: () => void;\n\n\trenderResizeHandle?: React.ComponentType< ResizeHandleRenderProps >;\n};\n\nexport function LanesItem( {\n\titemKey,\n\tplacementStyle,\n\tdisabled = false,\n\tdraggable = true,\n\tresizable = true,\n\tinteracting = false,\n\tchildren,\n\tactionableArea = null,\n\tonResize,\n\tonResizeEnd,\n\tresizeSnapPreview = null,\n\tminResizeWidthPx,\n\tmaxResizeWidthPx,\n\trenderResizeHandle,\n\tdragging = false,\n}: LanesItemProps ) {\n\tconst [ resizeDelta, setResizeDelta ] = useState< ResizeDelta | null >(\n\t\tnull\n\t);\n\tconst [ initialContentSize, setInitialContentSize ] = useState< {\n\t\twidth: number;\n\t\theight: number;\n\t} | null >( null );\n\tconst itemRef = useRef< HTMLDivElement >( null );\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\n\tconst dragDisabled = disabled || ! draggable;\n\tconst resizeDisabled = disabled || ! resizable;\n\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\tsetActivatorNodeRef,\n\t\tisDragging,\n\t} = useSortable( {\n\t\tid: itemKey,\n\t\tdisabled: dragDisabled,\n\t} );\n\tconst mergedRef = useMergeRefs( [ itemRef, setNodeRef ] );\n\tconst contentMergedRef = useMergeRefs( [ contentRef ] );\n\n\tconst style: React.CSSProperties = {\n\t\t...placementStyle,\n\t\talignSelf: 'start',\n\t};\n\n\tconst isResizing = resizeDelta !== null;\n\tconst itemClassName = clsx(\n\t\tstyles.item,\n\t\tisDragging && styles[ 'is-dragging' ],\n\t\tisResizing && styles[ 'is-resizing' ]\n\t);\n\n\tconst handleResize = ( delta: ResizeDelta ) => {\n\t\tconst contentNode = contentRef.current;\n\t\tlet baselineSize = initialContentSize;\n\t\tif ( contentNode && ! baselineSize ) {\n\t\t\tconst { width, height } = contentNode.getBoundingClientRect();\n\t\t\tbaselineSize = { width, height };\n\t\t\tsetInitialContentSize( baselineSize );\n\t\t}\n\t\tlet clamped: ResizeDelta = { width: delta.width, height: 0 };\n\t\tif ( baselineSize ) {\n\t\t\tclamped = clampResizeDelta(\n\t\t\t\tclamped,\n\t\t\t\tbaselineSize,\n\t\t\t\t{ width: minResizeWidthPx },\n\t\t\t\t{ width: maxResizeWidthPx }\n\t\t\t);\n\t\t}\n\t\tsetResizeDelta( clamped );\n\t\tonResize( itemKey, clamped );\n\t};\n\n\tconst handleResizeEnd = () => {\n\t\tsetResizeDelta( null );\n\t\tsetInitialContentSize( null );\n\t\tonResizeEnd();\n\t};\n\n\tconst continuousContentStyle: React.CSSProperties | undefined =\n\t\tresizeDelta && initialContentSize\n\t\t\t? {\n\t\t\t\t\twidth: initialContentSize.width + resizeDelta.width,\n\t\t\t\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\tinert={ inertValue( dragging ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ actionableArea }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t) : null }\n\n\t\t\t<div\n\t\t\t\tref={ setActivatorNodeRef }\n\t\t\t\t{ ...attributes }\n\t\t\t\t{ ...listeners }\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tcursor: getItemCursor( dragDisabled, interacting ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tref={ contentMergedRef }\n\t\t\t\t\tclassName={ styles[ 'item-content' ] }\n\t\t\t\t\tstyle={ continuousContentStyle }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t\t{ ! resizeDisabled && (\n\t\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\t\titemId={ itemKey }\n\t\t\t\t\t\t\tverticalResizable={ false }\n\t\t\t\t\t\t\tonResize={ handleResize }\n\t\t\t\t\t\t\tonResizeEnd={ handleResizeEnd }\n\t\t\t\t\t\t\trenderResizeHandle={ renderResizeHandle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t{ previewOverlay }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"ac1094954c\", \"._1c54fe8165d3023e__actionable-area-slot{opacity:1}@media (prefers-reduced-motion:no-preference){._1c54fe8165d3023e__actionable-area-slot{transition:opacity var(--wpds-motion-duration-md,.2s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1))}}[data-wp-grid-resizing] ._1c54fe8165d3023e__actionable-area-slot{opacity:0;pointer-events:none}\");\n}\nexport default {\"actionable-area-slot\":\"_1c54fe8165d3023e__actionable-area-slot\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"97a2a51c0b\", \"._0a62d9f1dff8c7d8__item{position:relative}._20c43fcd930d828a__item-content{height:100%;position:relative}._11928ee35f1a9519__is-resizing{overflow:visible;z-index:1}._11928ee35f1a9519__is-resizing ._20c43fcd930d828a__item-content{overflow:visible;position:relative;z-index:2}.b7fc83c8b16e9ee5__is-dragging{pointer-events:none}[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{animation:b026dda570d0eea0__wp-grid-item-placeholder-in 0ms linear var(--wpds-motion-duration-sm,.1s) forwards;opacity:1;outline-color:transparent;outline-style:var(--wp-grid-placeholder-outline-style,dashed);outline-width:0}@keyframes b026dda570d0eea0__wp-grid-item-placeholder-in{to{opacity:var(--wp-grid-placeholder-opacity,.4);outline-color:var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));outline-width:var(--wpds-border-width-sm,2px)}}}@media (prefers-reduced-motion:reduce){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{opacity:var(--wp-grid-placeholder-opacity,.4);outline:var(--wpds-border-width-sm,2px) var(--wp-grid-placeholder-outline-style,dashed) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)))}}@media (forced-colors:active){[data-wp-grid-dragging] .b7fc83c8b16e9ee5__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}.cd44faab32c27168__preview-overlay{background:transparent;border:var(--wpds-border-width-sm,2px) var(--wp-grid-resize-preview-outline-style,solid) var(--wp-grid-placeholder-outline-color,var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9)));box-sizing:border-box;inset-inline-start:0;pointer-events:none;position:absolute;top:0;z-index:0}@media (forced-colors:active){.cd44faab32c27168__preview-overlay{border-color:Highlight}}\");\n}\nexport default {\"item\":\"_0a62d9f1dff8c7d8__item\",\"item-content\":\"_20c43fcd930d828a__item-content\",\"is-resizing\":\"_11928ee35f1a9519__is-resizing\",\"is-dragging\":\"b7fc83c8b16e9ee5__is-dragging\",\"wp-grid-item-placeholder-in\":\"b026dda570d0eea0__wp-grid-item-placeholder-in\",\"preview-overlay\":\"cd44faab32c27168__preview-overlay\"};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;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AAY,mBAAQ,cAAe;AAAA,kBACnC,OAAQ;AAAA,kBAEN;AAAA;AAAA,oBACA,CAAE,kBACH;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
- }
1
+ {"version":3,"file":"lanes-item.cjs","names":["useState","useRef","useSortable","useMergeRefs","styles","clampResizeDelta","GRID_ITEM_DATA_KEY","actionableAreaStyles","inertValue","ResizeHandle"],"sources":["../../../style-runtime/src/index.ts","../../src/shared/actionable-area-slot.module.css","../../src/dashboard-lanes/lanes-item.module.css","../../src/dashboard-lanes/lanes-item.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"36a7a084ce\", \"._0a2b470abcf47e5b__actionable-area-slot{opacity:1}@media (prefers-reduced-motion:no-preference){._0a2b470abcf47e5b__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] ._0a2b470abcf47e5b__actionable-area-slot{opacity:0;pointer-events:none}\");\n}\nexport default {\"actionable-area-slot\":\"_0a2b470abcf47e5b__actionable-area-slot\"};\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"0fa64ddd95\", \"._31c3cc93e2ae64fa__item{position:relative}._3f7297c1fa9fef39__item-content{height:100%;position:relative}.e1dfe63167e7d0b8__is-resizing{overflow:visible;z-index:1}.e1dfe63167e7d0b8__is-resizing ._3f7297c1fa9fef39__item-content{overflow:visible;position:relative;z-index:2}._28d819356520d8d1__is-dragging{pointer-events:none}[data-wp-grid-dragging] ._28d819356520d8d1__is-dragging{border-radius:var(--wp-grid-placeholder-radius,0)}@media not (prefers-reduced-motion:reduce){[data-wp-grid-dragging] ._28d819356520d8d1__is-dragging{animation:ad99d2d1d0017024__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 ad99d2d1d0017024__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] ._28d819356520d8d1__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] ._28d819356520d8d1__is-dragging{--wp-grid-placeholder-outline-color:Highlight}}._126192ec000c65e5__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){._126192ec000c65e5__preview-overlay{border-color:Highlight}}\");\n}\nexport default {\"item\":\"_31c3cc93e2ae64fa__item\",\"item-content\":\"_3f7297c1fa9fef39__item-content\",\"is-resizing\":\"e1dfe63167e7d0b8__is-resizing\",\"is-dragging\":\"_28d819356520d8d1__is-dragging\",\"wp-grid-item-placeholder-in\":\"ad99d2d1d0017024__wp-grid-item-placeholder-in\",\"preview-overlay\":\"_126192ec000c65e5__preview-overlay\"};\n","import { useSortable } from '@dnd-kit/sortable';\nimport clsx from 'clsx';\nimport { useState, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { inertValue } from '@wordpress/react-inert-value';\nimport actionableAreaStyles from '../shared/actionable-area-slot.module.css';\nimport ResizeHandle from '../shared/resize-handle';\nimport { clampResizeDelta, type ResizeSnapSize } from '../shared/resize-snap';\nimport { GRID_ITEM_DATA_KEY } from '../shared/grid-item-key';\nimport type { ResizeDelta, ResizeHandleRenderProps } from '../shared/types';\nimport styles from './lanes-item.module.css';\n\nfunction getItemCursor(\n\tdisabled: boolean,\n\tinteracting: boolean\n): React.CSSProperties[ 'cursor' ] {\n\tif ( disabled ) {\n\t\treturn 'default';\n\t}\n\tif ( interacting ) {\n\t\treturn undefined;\n\t}\n\treturn 'grab';\n}\n\n/**\n * Props for the internal `<LanesItem />` wrapper.\n */\nexport type LanesItemProps = {\n\t/**\n\t * Item key. Forwarded to dnd-kit and emitted as the\n\t * `data-wp-grid-item-key` attribute the hook reads to map measured DOM\n\t * nodes back to logical items.\n\t */\n\titemKey: string;\n\n\t/**\n\t * Inline placement style produced by `useLanePlacement`. On native\n\t * (`display: grid-lanes`), only `gridColumn: span N`. While\n\t * polyfilling, also `gridColumnStart` / `gridRowStart` /\n\t * `gridRowEnd: span N`.\n\t */\n\tplacementStyle: React.CSSProperties;\n\n\t/**\n\t * Whether drag and resize interactions are disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the item can be dragged. Combined with `disabled`.\n\t *\n\t * @default true\n\t */\n\tdraggable?: boolean;\n\n\t/**\n\t * Whether the item can be resized. Combined with `disabled`.\n\t *\n\t * @default true\n\t */\n\tresizable?: boolean;\n\n\t/**\n\t * Whether any tile in the surface is currently being dragged or\n\t * resized. Drives the drag activator cursor.\n\t */\n\tinteracting?: boolean;\n\n\t/**\n\t * Whether a tile drag is in progress. Mutes each tile's\n\t * `actionableArea` with `inert` so hovers on other tiles' controls\n\t * do not steal the gesture.\n\t *\n\t * @default false\n\t */\n\tdragging?: boolean;\n\n\tchildren: React.ReactNode;\n\n\tactionableArea?: React.ReactNode;\n\n\tonResize: ( id: string, delta: ResizeDelta ) => void;\n\n\t/**\n\t * Snapped column span in pixels for the resize-preview outline.\n\t */\n\tresizeSnapPreview?: ResizeSnapSize | null;\n\n\t/**\n\t * Minimum tile width while resizing, in pixels (one column track).\n\t */\n\tminResizeWidthPx: number;\n\n\t/**\n\t * Maximum tile width while resizing, in pixels. Omitted when the\n\t * item declares no width limit.\n\t */\n\tmaxResizeWidthPx?: number;\n\n\tonResizeEnd: () => void;\n\n\trenderResizeHandle?: React.ComponentType< ResizeHandleRenderProps >;\n};\n\nexport function LanesItem( {\n\titemKey,\n\tplacementStyle,\n\tdisabled = false,\n\tdraggable = true,\n\tresizable = true,\n\tinteracting = false,\n\tchildren,\n\tactionableArea = null,\n\tonResize,\n\tonResizeEnd,\n\tresizeSnapPreview = null,\n\tminResizeWidthPx,\n\tmaxResizeWidthPx,\n\trenderResizeHandle,\n\tdragging = false,\n}: LanesItemProps ) {\n\tconst [ resizeDelta, setResizeDelta ] = useState< ResizeDelta | null >(\n\t\tnull\n\t);\n\tconst [ initialContentSize, setInitialContentSize ] = useState< {\n\t\twidth: number;\n\t\theight: number;\n\t} | null >( null );\n\tconst itemRef = useRef< HTMLDivElement >( null );\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\n\tconst dragDisabled = disabled || ! draggable;\n\tconst resizeDisabled = disabled || ! resizable;\n\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\tsetActivatorNodeRef,\n\t\tisDragging,\n\t} = useSortable( {\n\t\tid: itemKey,\n\t\tdisabled: dragDisabled,\n\t} );\n\tconst mergedRef = useMergeRefs( [ itemRef, setNodeRef ] );\n\tconst contentMergedRef = useMergeRefs( [ contentRef ] );\n\n\tconst style: React.CSSProperties = {\n\t\t...placementStyle,\n\t\talignSelf: 'start',\n\t};\n\n\tconst isResizing = resizeDelta !== null;\n\tconst itemClassName = clsx(\n\t\tstyles.item,\n\t\tisDragging && styles[ 'is-dragging' ],\n\t\tisResizing && styles[ 'is-resizing' ]\n\t);\n\n\tconst handleResize = ( delta: ResizeDelta ) => {\n\t\tconst contentNode = contentRef.current;\n\t\tlet baselineSize = initialContentSize;\n\t\tif ( contentNode && ! baselineSize ) {\n\t\t\tconst { width, height } = contentNode.getBoundingClientRect();\n\t\t\tbaselineSize = { width, height };\n\t\t\tsetInitialContentSize( baselineSize );\n\t\t}\n\t\tlet clamped: ResizeDelta = { width: delta.width, height: 0 };\n\t\tif ( baselineSize ) {\n\t\t\tclamped = clampResizeDelta(\n\t\t\t\tclamped,\n\t\t\t\tbaselineSize,\n\t\t\t\t{ width: minResizeWidthPx },\n\t\t\t\t{ width: maxResizeWidthPx }\n\t\t\t);\n\t\t}\n\t\tsetResizeDelta( clamped );\n\t\tonResize( itemKey, clamped );\n\t};\n\n\tconst handleResizeEnd = () => {\n\t\tsetResizeDelta( null );\n\t\tsetInitialContentSize( null );\n\t\tonResizeEnd();\n\t};\n\n\tconst continuousContentStyle: React.CSSProperties | undefined =\n\t\tresizeDelta && initialContentSize\n\t\t\t? {\n\t\t\t\t\twidth: initialContentSize.width + resizeDelta.width,\n\t\t\t\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\tinert={ inertValue( dragging ) }\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{ ...( dragDisabled ? {} : attributes ) }\n\t\t\t\t{ ...listeners }\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: '100%',\n\t\t\t\t\tcursor: getItemCursor( dragDisabled, interacting ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tref={ contentMergedRef }\n\t\t\t\t\tclassName={ styles[ 'item-content' ] }\n\t\t\t\t\tstyle={ continuousContentStyle }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t\t{ ! resizeDisabled && (\n\t\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\t\titemId={ itemKey }\n\t\t\t\t\t\t\tverticalResizable={ false }\n\t\t\t\t\t\t\tonResize={ handleResize }\n\t\t\t\t\t\t\tonResizeEnd={ handleResizeEnd }\n\t\t\t\t\t\t\trenderResizeHandle={ renderResizeHandle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t{ previewOverlay }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,a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