sonance-brand-mcp 1.3.77 → 1.3.78
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.
|
@@ -126,6 +126,34 @@ export function SonanceDevTools() {
|
|
|
126
126
|
const dragOffsetRef = useRef({ x: 0, y: 0 });
|
|
127
127
|
const panelRef = useRef<HTMLDivElement>(null);
|
|
128
128
|
|
|
129
|
+
// Portal container state - ensures DevTool is always on top of modals
|
|
130
|
+
const [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);
|
|
131
|
+
|
|
132
|
+
// Create and manage dedicated portal container that stays on top
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
// Create container if it doesn't exist
|
|
135
|
+
let container = document.getElementById('sonance-devtools-root');
|
|
136
|
+
if (!container) {
|
|
137
|
+
container = document.createElement('div');
|
|
138
|
+
container.id = 'sonance-devtools-root';
|
|
139
|
+
container.style.cssText = 'position: fixed; inset: 0; pointer-events: none; z-index: 2147483647; isolation: isolate;';
|
|
140
|
+
document.body.appendChild(container);
|
|
141
|
+
}
|
|
142
|
+
setPortalContainer(container);
|
|
143
|
+
|
|
144
|
+
// MutationObserver to keep container as last child of body
|
|
145
|
+
// This ensures DevTool stays on top even when modals are dynamically added
|
|
146
|
+
const observer = new MutationObserver(() => {
|
|
147
|
+
if (container && container.nextSibling) {
|
|
148
|
+
document.body.appendChild(container);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
observer.observe(document.body, { childList: true });
|
|
153
|
+
|
|
154
|
+
return () => observer.disconnect();
|
|
155
|
+
}, []);
|
|
156
|
+
|
|
129
157
|
// Component-specific style overrides (for scalable, project-agnostic styling)
|
|
130
158
|
// Key: component type (e.g., "card", "button-primary", "card:variant123"), Value: style overrides
|
|
131
159
|
const [componentOverrides, setComponentOverrides] = useState<Record<string, ComponentStyle>>({});
|
|
@@ -2384,7 +2412,7 @@ export function SonanceDevTools() {
|
|
|
2384
2412
|
<button
|
|
2385
2413
|
onClick={() => setIsOpen(true)}
|
|
2386
2414
|
className={cn(
|
|
2387
|
-
"fixed bottom-6 right-6 z-[2147483646]",
|
|
2415
|
+
"fixed bottom-6 right-6 z-[2147483646] pointer-events-auto",
|
|
2388
2416
|
"flex h-14 w-14 items-center justify-center",
|
|
2389
2417
|
"rounded-full bg-[#333F48] text-white shadow-lg",
|
|
2390
2418
|
"hover:scale-105 hover:shadow-xl",
|
|
@@ -2403,7 +2431,7 @@ export function SonanceDevTools() {
|
|
|
2403
2431
|
ref={panelRef}
|
|
2404
2432
|
data-sonance-devtools="true"
|
|
2405
2433
|
className={cn(
|
|
2406
|
-
"fixed bottom-6 right-6 z-[2147483647]",
|
|
2434
|
+
"fixed bottom-6 right-6 z-[2147483647] pointer-events-auto",
|
|
2407
2435
|
"w-[360px] max-h-[80vh]",
|
|
2408
2436
|
"bg-white rounded-lg shadow-2xl border border-gray-200",
|
|
2409
2437
|
"flex flex-col overflow-hidden",
|
|
@@ -2637,6 +2665,9 @@ export function SonanceDevTools() {
|
|
|
2637
2665
|
</div>
|
|
2638
2666
|
);
|
|
2639
2667
|
|
|
2668
|
+
// Wait for portal container to be ready
|
|
2669
|
+
if (!portalContainer) return null;
|
|
2670
|
+
|
|
2640
2671
|
return createPortal(
|
|
2641
2672
|
<>
|
|
2642
2673
|
{trigger}
|
|
@@ -2677,6 +2708,6 @@ export function SonanceDevTools() {
|
|
|
2677
2708
|
/>
|
|
2678
2709
|
)}
|
|
2679
2710
|
</>,
|
|
2680
|
-
|
|
2711
|
+
portalContainer
|
|
2681
2712
|
);
|
|
2682
2713
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonance-brand-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.78",
|
|
4
4
|
"description": "MCP Server for Sonance Brand Guidelines and Component Library - gives Claude instant access to brand colors, typography, and UI components.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|