|
3 | 3 | import { flip } from "svelte/animate" |
4 | 4 |
|
5 | 5 | import CopyButton from "$components/CopyButton.svelte" |
| 6 | + import TreeItem from "$components/TreeItem.svelte" |
6 | 7 | import InspectButton from "$components/InspectButton.svelte" |
7 | 8 | import ScrollIntoViewButton from "$components/ScrollIntoViewButton.svelte" |
8 | 9 | import IconButton from "$uikit/IconButton.svelte" |
|
145 | 146 | </div> |
146 | 147 |
|
147 | 148 | <div class="stimulus-instance-second-column"> |
148 | | - <div class="me-3 overflow-x-auto scrollbar-none"><HTMLRenderer htmlString={instance.serializedTag} /></div> |
| 149 | + <div class="me-3 overflow-x-auto scrollbar-none"> |
| 150 | + <InspectButton class="btn-hoverable me-2" selector={`[data-hotwire-dev-tools-uuid="${instance.uuid}"]`}></InspectButton> |
| 151 | + <HTMLRenderer htmlString={instance.serializedTag} /> |
| 152 | + </div> |
149 | 153 | </div> |
150 | 154 | </div> |
151 | 155 | </div> |
|
165 | 169 | <div class="card-body"> |
166 | 170 | {#if selected.controller} |
167 | 171 | <div class="d-flex flex-column h-100"> |
168 | | - <div class="scrollable-list flow"> |
| 172 | + <div class="scrollable-list"> |
169 | 173 | <div class="pane-section-heading">Values</div> |
170 | | - <table class="table table-sm w-100 turbo-table"> |
171 | | - <tbody> |
172 | | - {#each Object.entries(selected.controller.values) as [_key, object]} |
173 | | - {#each Object.entries(object) as [key, value]} |
174 | | - <tr> |
175 | | - <td><div class="code-keyword">{key}</div></td> |
176 | | - <td>{value}</td> |
177 | | - </tr> |
178 | | - {/each} |
179 | | - {/each} |
180 | | - </tbody> |
181 | | - </table> |
| 174 | + {#each Object.entries(selected.controller.values) as [_key, valueObject]} |
| 175 | + <div class="d-flex gap-2"> |
| 176 | + {#if typeof valueObject.value === "object" && valueObject.value !== null} |
| 177 | + <wa-tree> |
| 178 | + <wa-tree-item expanded> |
| 179 | + {valueObject.name} |
| 180 | + {#each Object.entries(valueObject.value) as [label, children]} |
| 181 | + <TreeItem {label} {children} /> |
| 182 | + {/each} |
| 183 | + </wa-tree-item> |
| 184 | + </wa-tree> |
| 185 | + {:else} |
| 186 | + <span class="code-key">{valueObject.name}:</span> |
| 187 | + <span class="code-value"> |
| 188 | + {valueObject.value} |
| 189 | + </span> |
| 190 | + {/if} |
| 191 | + <wa-button id={`rich-tooltip-${valueObject.key}`} variant="neutral" appearance="plain" size="small" class="small-icon-button"> |
| 192 | + <wa-icon name="copy" label="Home"></wa-icon> |
| 193 | + </wa-button> |
| 194 | + <wa-tooltip for={`rich-tooltip-${valueObject.key}`} trigger="click" style="--max-width: 100%;"> |
| 195 | + <div class=""> |
| 196 | + <div class="flex-center">Type: {valueObject.type}</div> |
| 197 | + <div class="d-flex justify-content-between align-items-center"> |
| 198 | + <span>{`data-${selected.identifier}-${valueObject.key}`}</span> |
| 199 | + <CopyButton value={`data-${selected.identifier}-${valueObject.key}`} /> |
| 200 | + </div> |
| 201 | + |
| 202 | + <div class="d-flex justify-content-between align-items-center"> |
| 203 | + <span>{`this.${valueObject.name}`}</span> |
| 204 | + <CopyButton value={`this.${valueObject.name}`} /> |
| 205 | + </div> |
| 206 | + |
| 207 | + <div class="d-flex justify-content-between align-items-center"> |
| 208 | + <span>{`this.${valueObject.name}s`}</span> |
| 209 | + <CopyButton value={`this.${valueObject.name}s`} /> |
| 210 | + </div> |
| 211 | + |
| 212 | + <div class="d-flex justify-content-between align-items-center"> |
| 213 | + <span>{`this.has${valueObject.name[0].toUpperCase() + valueObject.name.slice(1)}`}</span> |
| 214 | + <CopyButton value={`this.has${valueObject.name[0].toUpperCase() + valueObject.name.slice(1)}`} /> |
| 215 | + </div> |
| 216 | + </div> |
| 217 | + </wa-tooltip> |
| 218 | + </div> |
| 219 | + {/each} |
182 | 220 | </div> |
183 | 221 | </div> |
184 | 222 | {:else} |
|
0 commit comments