@primer/react 0.0.0-20260327015143 → 0.0.0-20260327124113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paneUtils.d.ts","sourceRoot":"","sources":["../../src/PageLayout/paneUtils.ts"],"names":[],"mappings":"AAAA,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;IAC1B,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IACxB,cAAc,EAAE,WAAW,GAAG,IAAI,CAAA;CACnC,CAAA;AAID,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAC,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"paneUtils.d.ts","sourceRoot":"","sources":["../../src/PageLayout/paneUtils.ts"],"names":[],"mappings":"AAAA,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;IAC1B,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IACxB,cAAc,EAAE,WAAW,GAAG,IAAI,CAAA;CACnC,CAAA;AAID,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAC,EAAE,oBAAoB,QAuBrF;AAED,kDAAkD;AAClD,wBAAgB,oBAAoB,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAC,EAAE,oBAAoB,QAWxF"}
|
|
@@ -13,6 +13,18 @@ function setDraggingStyles({
|
|
|
13
13
|
handle === null || handle === void 0 ? void 0 : handle.style.setProperty('--draggable-handle--drag-opacity', '1');
|
|
14
14
|
handle === null || handle === void 0 ? void 0 : handle.style.setProperty('--draggable-handle--transition', 'none');
|
|
15
15
|
|
|
16
|
+
// Capture current dimensions and set contain-intrinsic-size BEFORE setting data-dragging
|
|
17
|
+
// This ensures the element maintains its size when content-visibility: auto is applied
|
|
18
|
+
// Use 'auto' for width since it changes during drag, allowing browser to track actual size
|
|
19
|
+
if (pane) {
|
|
20
|
+
const rect = pane.getBoundingClientRect();
|
|
21
|
+
pane.style.setProperty('contain-intrinsic-size', `auto ${rect.width}px auto ${rect.height}px`);
|
|
22
|
+
}
|
|
23
|
+
if (contentWrapper) {
|
|
24
|
+
const rect = contentWrapper.getBoundingClientRect();
|
|
25
|
+
contentWrapper.style.setProperty('contain-intrinsic-size', `auto ${rect.width}px auto ${rect.height}px`);
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
// Set attribute for CSS containment (O(1) direct selector, not descendant)
|
|
17
29
|
pane === null || pane === void 0 ? void 0 : pane.setAttribute(DATA_DRAGGING_ATTR, 'true');
|
|
18
30
|
contentWrapper === null || contentWrapper === void 0 ? void 0 : contentWrapper.setAttribute(DATA_DRAGGING_ATTR, 'true');
|
|
@@ -29,6 +41,10 @@ function removeDraggingStyles({
|
|
|
29
41
|
handle === null || handle === void 0 ? void 0 : handle.style.removeProperty('--draggable-handle--transition');
|
|
30
42
|
pane === null || pane === void 0 ? void 0 : pane.removeAttribute(DATA_DRAGGING_ATTR);
|
|
31
43
|
contentWrapper === null || contentWrapper === void 0 ? void 0 : contentWrapper.removeAttribute(DATA_DRAGGING_ATTR);
|
|
44
|
+
|
|
45
|
+
// Remove contain-intrinsic-size after removing data-dragging
|
|
46
|
+
pane === null || pane === void 0 ? void 0 : pane.style.removeProperty('contain-intrinsic-size');
|
|
47
|
+
contentWrapper === null || contentWrapper === void 0 ? void 0 : contentWrapper.style.removeProperty('contain-intrinsic-size');
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
export { removeDraggingStyles, setDraggingStyles };
|
package/package.json
CHANGED