myoperator-mcp 0.2.157 → 0.2.158

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 (2) hide show
  1. package/dist/index.js +29 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2310,12 +2310,37 @@ const hasDialogDescription = (children: React.ReactNode): boolean => {
2310
2310
  const DialogContent = React.forwardRef(({ className, children, size, hideCloseButton = false, ...props }: DialogContentProps, ref: React.Ref<React.ElementRef<typeof DialogPrimitive.Content>>) => {
2311
2311
  const hasDescription = hasDialogDescription(children);
2312
2312
 
2313
- // Lock body scroll when dialog is open \u2014 works regardless of host app CSS overrides
2313
+ // Lock ALL scroll when dialog is open \u2014 position:fixed on body prevents scroll
2314
+ // regardless of whether the host app scrolls on <body>, <html>, or a wrapper div.
2315
+ // Only activates when dialog is truly open (has role="dialog" in DOM), not in
2316
+ // Storybook static renders.
2314
2317
  React.useEffect(() => {
2315
- const originalOverflow = document.body.style.overflow;
2316
- document.body.style.overflow = "hidden";
2318
+ const dialogEl = document.querySelector("[role='dialog'][data-state='open']");
2319
+ if (!dialogEl) return;
2320
+
2321
+ const scrollY = window.scrollY;
2322
+ const body = document.body;
2323
+ const html = document.documentElement;
2324
+
2325
+ const originalBodyPosition = body.style.position;
2326
+ const originalBodyTop = body.style.top;
2327
+ const originalBodyWidth = body.style.width;
2328
+ const originalBodyOverflow = body.style.overflow;
2329
+ const originalHtmlOverflow = html.style.overflow;
2330
+
2331
+ body.style.position = "fixed";
2332
+ body.style.top = \`-\${scrollY}px\`;
2333
+ body.style.width = "100%";
2334
+ body.style.overflow = "hidden";
2335
+ html.style.overflow = "hidden";
2336
+
2317
2337
  return () => {
2318
- document.body.style.overflow = originalOverflow;
2338
+ body.style.position = originalBodyPosition;
2339
+ body.style.top = originalBodyTop;
2340
+ body.style.width = originalBodyWidth;
2341
+ body.style.overflow = originalBodyOverflow;
2342
+ html.style.overflow = originalHtmlOverflow;
2343
+ window.scrollTo(0, scrollY);
2319
2344
  };
2320
2345
  }, []);
2321
2346
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-mcp",
3
- "version": "0.2.157",
3
+ "version": "0.2.158",
4
4
  "description": "MCP server for myOperator UI components - enables AI assistants to access component metadata, examples, and design tokens",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",