@trackunit/react-map 0.2.42 → 0.2.43
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/index.cjs.js +8 -3
- package/index.esm.js +8 -3
- package/migrations/entry.js.map +1 -0
- package/package.json +1 -1
- package/src/panel/Panel.d.ts +2 -1
package/index.cjs.js
CHANGED
|
@@ -823,7 +823,8 @@ const PANEL_SCROLL_INTERNAL_CLASS_NAME = "flex flex-1 min-h-0 flex-col overflow-
|
|
|
823
823
|
* "" — element is in DOM (for Floating UI to measure) but hidden via
|
|
824
824
|
* CSS `visibility: hidden` so the pre-commit translate(0,0)
|
|
825
825
|
* position is never visible.
|
|
826
|
-
* "open" —
|
|
826
|
+
* "open" — appears instantly once placement is committed (no enter
|
|
827
|
+
* animation — see docs/adr/0027-instant-panel-first-paint.md).
|
|
827
828
|
* "closing" — fades out during the EXIT_DURATION_MS window before unmount.
|
|
828
829
|
*
|
|
829
830
|
* @internal
|
|
@@ -972,9 +973,9 @@ const Panel = ({ anchor, placement = DEFAULT_PLACEMENT$1, onDismiss, closeLabel
|
|
|
972
973
|
if (effectiveAnchor === null) {
|
|
973
974
|
return null;
|
|
974
975
|
}
|
|
975
|
-
// data-panel drives the CSS
|
|
976
|
+
// data-panel drives the CSS visibility state machine (Panel.css):
|
|
976
977
|
// "" — pre-commit: visibility:hidden so translate(0,0) is never seen
|
|
977
|
-
// "open" —
|
|
978
|
+
// "open" — instant appearance (no enter animation)
|
|
978
979
|
// "closing" — fade out before unmount
|
|
979
980
|
const panelState = isClosing ? "closing" : isCommitted ? "open" : "";
|
|
980
981
|
return (jsxRuntime.jsxs("div", { className: PANEL_SHELL_CLASS_NAME, "data-panel": panelState, ref: mergedShellRef, style: floatingStyles, ...getFloatingProps(), "aria-label": ariaLabel, children: [jsxRuntime.jsx("div", { className: PANEL_CHROME_CLASS_NAME, style: { maxHeight: `min(${PANEL_MAX_HEIGHT_PX}px, ${PANEL_MAX_HEIGHT_VH}vh)` }, children: jsxRuntime.jsx("div", { className: scrollSlotClassName, "data-testid": "panel-scroll-slot", ref: scrollRef, children: children }) }), onClickDismiss !== undefined ? (jsxRuntime.jsx("div", { className: "absolute right-0 top-0 z-10 -translate-y-1/2 translate-x-1/2 rounded-2xl border border-neutral-300 bg-white shadow-sm", children: jsxRuntime.jsx(PanelIconButton, { "aria-label": closeLabel, "data-testid": "panel-close-button", onClick: onClickDismiss, children: jsxRuntime.jsx(reactComponents.Icon, { ariaHidden: true, className: "text-neutral-700", name: "XMark", size: "small" }) }) })) : null] }));
|
|
@@ -2063,6 +2064,10 @@ const computePlacement = (triggerEl, containerEl) => {
|
|
|
2063
2064
|
const usePopoverPlacement = (triggerRef, containerRef, options = {}) => {
|
|
2064
2065
|
const { skip = false } = options;
|
|
2065
2066
|
const [placement, setPlacement] = react.useState(DEFAULT_PLACEMENT);
|
|
2067
|
+
// Post-paint measurement is sufficient: both callers invoke this hook where
|
|
2068
|
+
// the always-mounted trigger renders, so placement settles with the map —
|
|
2069
|
+
// long before a popover can open. A layout effect would only add pre-paint
|
|
2070
|
+
// measurement work during map load (SAGA-675 review).
|
|
2066
2071
|
react.useEffect(() => {
|
|
2067
2072
|
if (skip) {
|
|
2068
2073
|
return;
|
package/index.esm.js
CHANGED
|
@@ -822,7 +822,8 @@ const PANEL_SCROLL_INTERNAL_CLASS_NAME = "flex flex-1 min-h-0 flex-col overflow-
|
|
|
822
822
|
* "" — element is in DOM (for Floating UI to measure) but hidden via
|
|
823
823
|
* CSS `visibility: hidden` so the pre-commit translate(0,0)
|
|
824
824
|
* position is never visible.
|
|
825
|
-
* "open" —
|
|
825
|
+
* "open" — appears instantly once placement is committed (no enter
|
|
826
|
+
* animation — see docs/adr/0027-instant-panel-first-paint.md).
|
|
826
827
|
* "closing" — fades out during the EXIT_DURATION_MS window before unmount.
|
|
827
828
|
*
|
|
828
829
|
* @internal
|
|
@@ -971,9 +972,9 @@ const Panel = ({ anchor, placement = DEFAULT_PLACEMENT$1, onDismiss, closeLabel
|
|
|
971
972
|
if (effectiveAnchor === null) {
|
|
972
973
|
return null;
|
|
973
974
|
}
|
|
974
|
-
// data-panel drives the CSS
|
|
975
|
+
// data-panel drives the CSS visibility state machine (Panel.css):
|
|
975
976
|
// "" — pre-commit: visibility:hidden so translate(0,0) is never seen
|
|
976
|
-
// "open" —
|
|
977
|
+
// "open" — instant appearance (no enter animation)
|
|
977
978
|
// "closing" — fade out before unmount
|
|
978
979
|
const panelState = isClosing ? "closing" : isCommitted ? "open" : "";
|
|
979
980
|
return (jsxs("div", { className: PANEL_SHELL_CLASS_NAME, "data-panel": panelState, ref: mergedShellRef, style: floatingStyles, ...getFloatingProps(), "aria-label": ariaLabel, children: [jsx("div", { className: PANEL_CHROME_CLASS_NAME, style: { maxHeight: `min(${PANEL_MAX_HEIGHT_PX}px, ${PANEL_MAX_HEIGHT_VH}vh)` }, children: jsx("div", { className: scrollSlotClassName, "data-testid": "panel-scroll-slot", ref: scrollRef, children: children }) }), onClickDismiss !== undefined ? (jsx("div", { className: "absolute right-0 top-0 z-10 -translate-y-1/2 translate-x-1/2 rounded-2xl border border-neutral-300 bg-white shadow-sm", children: jsx(PanelIconButton, { "aria-label": closeLabel, "data-testid": "panel-close-button", onClick: onClickDismiss, children: jsx(Icon, { ariaHidden: true, className: "text-neutral-700", name: "XMark", size: "small" }) }) })) : null] }));
|
|
@@ -2062,6 +2063,10 @@ const computePlacement = (triggerEl, containerEl) => {
|
|
|
2062
2063
|
const usePopoverPlacement = (triggerRef, containerRef, options = {}) => {
|
|
2063
2064
|
const { skip = false } = options;
|
|
2064
2065
|
const [placement, setPlacement] = useState(DEFAULT_PLACEMENT);
|
|
2066
|
+
// Post-paint measurement is sufficient: both callers invoke this hook where
|
|
2067
|
+
// the always-mounted trigger renders, so placement settles with the map —
|
|
2068
|
+
// long before a popover can open. A layout effect would only add pre-paint
|
|
2069
|
+
// measurement work during map load (SAGA-675 review).
|
|
2065
2070
|
useEffect(() => {
|
|
2066
2071
|
if (skip) {
|
|
2067
2072
|
return;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/map/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}
|
package/package.json
CHANGED
package/src/panel/Panel.d.ts
CHANGED
|
@@ -56,7 +56,8 @@ export type PanelProps = Readonly<{
|
|
|
56
56
|
* "" — element is in DOM (for Floating UI to measure) but hidden via
|
|
57
57
|
* CSS `visibility: hidden` so the pre-commit translate(0,0)
|
|
58
58
|
* position is never visible.
|
|
59
|
-
* "open" —
|
|
59
|
+
* "open" — appears instantly once placement is committed (no enter
|
|
60
|
+
* animation — see docs/adr/0027-instant-panel-first-paint.md).
|
|
60
61
|
* "closing" — fades out during the EXIT_DURATION_MS window before unmount.
|
|
61
62
|
*
|
|
62
63
|
* @internal
|