Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/cozy-shrimps-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/form-devtools': patch
---

Fix to cloudflairs workerd enviroment, solid pulling in dom functions
20 changes: 3 additions & 17 deletions packages/form-devtools/src/components/DetailsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,11 @@ export function DetailsPanel({ selectedKey }: DetailsPanelProps) {
<div class={styles().detailSection}>
<div class={styles().detailSectionHeader}>Individual Fields</div>

<div
style={{
display: 'flex',
'flex-wrap': 'wrap',
gap: '8px',
}}
>
<div class={styles().fieldWrapper}>
<For each={Object.entries(individualFields())}>
{([fieldName, fieldData]) => (
<div
class={styles().stateContent}
style={{ 'margin-bottom': '16px' }}
>
<div
style={{
'font-weight': 'bold',
'margin-bottom': '4px',
}}
>
<div class={`${styles().stateContent} ${styles().fieldItem}`}>
<div class={styles().fieldName}>
{fieldName}
</div>
<JsonTree copyable value={fieldData} />
Expand Down
8 changes: 2 additions & 6 deletions packages/form-devtools/src/components/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ export function Shell() {
<div class={styles().mainContainer}>
<div
class={styles().leftPanel}
style={{
width: `${leftPanelWidth()}px`,
'min-width': '150px',
'max-width': '800px',
}}
style={`--left-panel-width: ${leftPanelWidth()}px`}
>
<UtilList selectedKey={selectedKey} setSelectedKey={setSelectedKey} />
</div>
Expand All @@ -84,7 +80,7 @@ export function Shell() {
onMouseDown={handleMouseDown}
/>

<div class={styles().rightPanel} style={{ flex: 1 }}>
<div class={styles().rightPanel}>
<Show when={selectedKey() != null}>
<div class={styles().panelHeader}>Details</div>
<DetailsPanel selectedKey={selectedKey as Accessor<string>} />
Expand Down
2 changes: 1 addition & 1 deletion packages/form-devtools/src/components/StateHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function StateHeader(props: StateHeaderProps) {
return (
<div class={styles().stateHeader}>
<div class={styles().stateTitle}>Form state</div>
<div style={{ display: 'flex', 'align-items': 'center', gap: '16px' }}>
<div class={styles().stateHeaderRow}>
<div class={styles().infoGrid}>
<div class={styles().infoLabel}>Key</div>
<div class={styles().infoValueMono}>{state()!.id}</div>
Expand Down
20 changes: 20 additions & 0 deletions packages/form-devtools/src/styles/use-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ const stylesFactory = (theme: 'light' | 'dark') => {
overflow: hidden;
min-height: 0;
flex-shrink: 0;
width: var(--left-panel-width, 300px);
min-width: 150px;
max-width: 800px;
`,
rightPanel: css`
background: ${t(colors.gray[100], colors.darkGray[800])};
Expand Down Expand Up @@ -349,6 +352,23 @@ const stylesFactory = (theme: 'light' | 'dark') => {
box-shadow 0.3s,
background 0.3s;
`,
fieldWrapper: css`
display: flex;
flex-wrap: wrap;
gap: 8px;
`,
fieldItem: css`
margin-bottom: 16px;
`,
fieldName: css`
font-weight: bold;
margin-bottom: 4px;
`,
stateHeaderRow: css`
display: flex;
align-items: center;
gap: 16px;
`,
}
}

Expand Down
Loading