Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/DeckardSchema.styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
/* Border Radius Variables */
--schema-radius-sm: 0.25rem;
--schema-radius-md: 0.375rem;
--schema-radius-lg: 0.75rem;

/* Font Variables */
--schema-font-mono: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
Expand All @@ -62,10 +63,13 @@
line-height: 1.6;
color: var(--schema-text);
background: var(--schema-bg);
max-width: none;
max-width: 100%;
width: 100%;
margin: 0;
padding: 0;
box-sizing: border-box;
overflow-x: auto;
container-type: inline-size;
}

/* Dark mode adjustments */
Expand Down Expand Up @@ -227,13 +231,15 @@
}

.schema-container .properties-list {
overflow: visible;
background: transparent;
width: 100%;
max-width: 100%;
min-width: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
overflow-wrap: break-word;
word-break: break-word;
}

/* ===== DEFINITIONS SECTION ===== */
Expand Down
322 changes: 0 additions & 322 deletions src/DeckardSchema.styles.ts

This file was deleted.

22 changes: 2 additions & 20 deletions src/DeckardSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ export const DeckardSchema: React.FC<DeckardSchemaProps> = ({
setPropertyStates(newStates);
}, [schema, autoExpand]);

// Handle URL hash navigation - only on mount
// Handle URL hash navigation - only on mount
useEffect(() => {
const hash = typeof window !== 'undefined' ? window.location.hash : '';
Expand Down Expand Up @@ -533,27 +534,8 @@ export const DeckardSchema: React.FC<DeckardSchemaProps> = ({

// Set the focused property state for proper styling
setFocusedProperty(fieldKey);

// Focus and scroll to the target property after React renders
setTimeout(() => {
if (typeof document !== 'undefined') {
const targetElement = document.getElementById(
propertyKeyToHash(fieldKey)
);
if (
targetElement &&
typeof targetElement.scrollIntoView === 'function'
) {
targetElement.scrollIntoView({
behavior: 'smooth',
block: 'start',
});
targetElement.focus({ preventScroll: true });
}
}
}, 100);
}
}, []); // Empty dependency array - only run on mount
}, []);

// Update search results
useEffect(() => {
Expand Down
Loading