@graphenedata/cli 0.0.14 → 0.0.16
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.
- package/LICENSE.md +3 -3
- package/README.md +138 -0
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/bin.js +2 -2
- package/dist/cli/bigQuery-I3F46SC6.js +75 -0
- package/dist/cli/bigQuery-I3F46SC6.js.map +7 -0
- package/dist/cli/chunk-OVWODUTJ.js +12849 -0
- package/dist/cli/chunk-OVWODUTJ.js.map +7 -0
- package/dist/cli/chunk-QAXEOZ43.js +53 -0
- package/dist/cli/chunk-QAXEOZ43.js.map +7 -0
- package/dist/cli/cli.js +245 -10290
- package/dist/cli/clickhouse-ZN5AN2UL.js +64 -0
- package/dist/cli/clickhouse-ZN5AN2UL.js.map +7 -0
- package/dist/cli/duckdb-IYBIO5KJ.js +87 -0
- package/dist/cli/duckdb-IYBIO5KJ.js.map +7 -0
- package/dist/cli/serve2-TNN5EROW.js +447 -0
- package/dist/cli/serve2-TNN5EROW.js.map +7 -0
- package/dist/cli/snowflake-MOQB5GA4.js +128 -0
- package/dist/cli/snowflake-MOQB5GA4.js.map +7 -0
- package/dist/index.d.ts +63 -0
- package/dist/lang/index.d.ts +63 -0
- package/dist/skills/graphene/SKILL.md +235 -0
- package/dist/skills/graphene/references/big-value.md +20 -0
- package/dist/skills/graphene/references/date-range.md +64 -0
- package/dist/skills/graphene/references/dropdown.md +62 -0
- package/dist/skills/graphene/references/echarts.md +162 -0
- package/dist/skills/graphene/references/gsql.md +393 -0
- package/dist/skills/graphene/references/model-gsql.md +72 -0
- package/dist/skills/graphene/references/table.md +143 -0
- package/dist/skills/graphene/references/text-input.md +29 -0
- package/dist/ui/app.css +263 -299
- package/dist/ui/component-utilities/dataShaping.ts +484 -0
- package/dist/ui/component-utilities/dataSummary.ts +57 -0
- package/dist/ui/component-utilities/enrich.ts +763 -0
- package/dist/ui/component-utilities/format.ts +177 -0
- package/dist/ui/component-utilities/inputUtils.ts +48 -9
- package/dist/ui/component-utilities/theme.ts +200 -0
- package/dist/ui/component-utilities/themeStores.ts +26 -21
- package/dist/ui/component-utilities/types.ts +70 -0
- package/dist/ui/components/AreaChart.svelte +57 -105
- package/dist/ui/components/BarChart.svelte +71 -129
- package/dist/ui/components/BigValue.svelte +24 -40
- package/dist/ui/components/Column.svelte +11 -19
- package/dist/ui/components/DateRange.svelte +71 -34
- package/dist/ui/components/Dropdown.svelte +82 -49
- package/dist/ui/components/DropdownOption.svelte +1 -2
- package/dist/ui/components/ECharts.svelte +179 -60
- package/dist/ui/components/InlineDelta.svelte +51 -32
- package/dist/ui/components/LineChart.svelte +54 -125
- package/dist/ui/components/PieChart.svelte +27 -37
- package/dist/ui/components/QueryLoad.svelte +78 -44
- package/dist/ui/components/Row.svelte +2 -1
- package/dist/ui/components/ScatterPlot.svelte +52 -0
- package/dist/ui/components/Skeleton.svelte +32 -0
- package/dist/ui/components/Table.svelte +3 -2
- package/dist/ui/components/TableGroupRow.svelte +28 -36
- package/dist/ui/components/TableHarness.svelte +32 -0
- package/dist/ui/components/TableHeader.svelte +34 -59
- package/dist/ui/components/TableRow.svelte +15 -39
- package/dist/ui/components/TableSubtotalRow.svelte +26 -21
- package/dist/ui/components/TableTotalRow.svelte +27 -37
- package/dist/ui/components/TextInput.svelte +17 -14
- package/dist/ui/components/Value.svelte +25 -0
- package/dist/ui/components/_Table.svelte +80 -76
- package/dist/ui/internal/ChartGallery.svelte +527 -0
- package/dist/ui/internal/ErrorDisplay.svelte +60 -0
- package/dist/ui/internal/LocalApp.svelte +87 -19
- package/dist/ui/internal/PageNavGroup.svelte +269 -0
- package/dist/ui/internal/Sidebar.svelte +178 -0
- package/dist/ui/internal/SidebarToggle.svelte +47 -0
- package/dist/ui/internal/StyleGallery.svelte +244 -0
- package/dist/ui/internal/clientCache.ts +15 -13
- package/dist/ui/internal/pageInputs.svelte.js +292 -0
- package/dist/ui/internal/queryEngine.ts +124 -132
- package/dist/ui/internal/runSocket.ts +59 -0
- package/dist/ui/internal/sidebar.svelte.js +18 -0
- package/dist/ui/internal/telemetry.ts +52 -17
- package/dist/ui/internal/types.d.ts +7 -0
- package/dist/ui/web.js +55 -13
- package/package.json +40 -41
- package/dist/docs/agent-instructions.md +0 -18
- package/dist/docs/base.md +0 -98
- package/dist/docs/cli.md +0 -22
- package/dist/docs/graphene.md +0 -1462
- package/dist/ui/component-utilities/autoFormatting.js +0 -301
- package/dist/ui/component-utilities/builtInFormats.js +0 -482
- package/dist/ui/component-utilities/chartContext.js +0 -12
- package/dist/ui/component-utilities/chartWindowDebug.js +0 -21
- package/dist/ui/component-utilities/checkInputs.js +0 -95
- package/dist/ui/component-utilities/convert.js +0 -15
- package/dist/ui/component-utilities/dateParsing.js +0 -57
- package/dist/ui/component-utilities/dropdownContext.ts +0 -1
- package/dist/ui/component-utilities/echarts.js +0 -272
- package/dist/ui/component-utilities/echartsThemes.js +0 -453
- package/dist/ui/component-utilities/formatTitle.js +0 -24
- package/dist/ui/component-utilities/formatting.js +0 -250
- package/dist/ui/component-utilities/getColumnExtents.js +0 -79
- package/dist/ui/component-utilities/getColumnSummary.js +0 -67
- package/dist/ui/component-utilities/getCompletedData.js +0 -114
- package/dist/ui/component-utilities/getDistinctCount.js +0 -7
- package/dist/ui/component-utilities/getDistinctValues.js +0 -15
- package/dist/ui/component-utilities/getSeriesConfig.js +0 -237
- package/dist/ui/component-utilities/getSortedData.js +0 -7
- package/dist/ui/component-utilities/getStackPercentages.js +0 -43
- package/dist/ui/component-utilities/getStackedData.js +0 -17
- package/dist/ui/component-utilities/getYAxisIndex.js +0 -15
- package/dist/ui/component-utilities/globalContexts.js +0 -1
- package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +0 -119
- package/dist/ui/component-utilities/replaceNulls.js +0 -14
- package/dist/ui/component-utilities/tableUtils.ts +0 -120
- package/dist/ui/components/Area.svelte +0 -214
- package/dist/ui/components/Bar.svelte +0 -350
- package/dist/ui/components/Chart.svelte +0 -989
- package/dist/ui/components/ErrorChart.svelte +0 -118
- package/dist/ui/components/Line.svelte +0 -227
- package/dist/ui/internal/NavSidebar.svelte +0 -396
- package/dist/ui/internal/PageError.svelte +0 -23
- package/dist/ui/internal/checkSocket.ts +0 -48
- package/dist/ui/internal/theme.ts +0 -88
- package/dist/ui/public/inter-latin-ext.woff2 +0 -0
- package/dist/ui/public/inter-latin.woff2 +0 -0
|
@@ -1,396 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {SvelteSet, SvelteMap} from 'svelte/reactivity'
|
|
3
|
-
|
|
4
|
-
/** @type {string} */
|
|
5
|
-
let {currentFile = '', files = [], onNavigate = undefined, baseRoute = ''} = $props()
|
|
6
|
-
|
|
7
|
-
let tree = $state([])
|
|
8
|
-
let flatNodes = $state([])
|
|
9
|
-
// eslint-disable-next-line svelte/no-unnecessary-state-wrap -- openFolders is reassigned, needs $state
|
|
10
|
-
let openFolders = $state(new SvelteSet())
|
|
11
|
-
let treeSignature = $state('')
|
|
12
|
-
let lastCurrent = $state('')
|
|
13
|
-
|
|
14
|
-
let normalizedFiles = $derived((files || [])
|
|
15
|
-
.map((file) => file.replace(/^\.\//, '').replace(/\\/g, '/')))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let normalizedCurrent = $derived(deriveCurrentFile(currentFile, normalizedFiles, baseRoute))
|
|
19
|
-
let currentRoute = $derived(normalizedCurrent ? pathToRoute(normalizedCurrent) : '/')
|
|
20
|
-
|
|
21
|
-
function deriveCurrentFile (_currentFile, _normalizedFiles, _baseRoute) {
|
|
22
|
-
let fromProp = normalizeFilePath(currentFile)
|
|
23
|
-
let route = getLocationRoute()
|
|
24
|
-
if (route && normalizedFiles) {
|
|
25
|
-
let match = normalizedFiles.find((file) => pathToRoute(file) === route)
|
|
26
|
-
if (match) return match
|
|
27
|
-
}
|
|
28
|
-
return fromProp
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function normalizeFilePath (filePath) {
|
|
32
|
-
return (filePath || '').replace(/^\.\//, '').replace(/\\/g, '/')
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getLocationRoute () {
|
|
36
|
-
if (typeof window === 'undefined') return null
|
|
37
|
-
let route = window.location.pathname || '/'
|
|
38
|
-
route = route.replace(/\/+$/, '') || '/'
|
|
39
|
-
return route
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
$effect(() => {
|
|
43
|
-
let nextSignature = normalizedFiles.join('|')
|
|
44
|
-
if (nextSignature !== treeSignature) {
|
|
45
|
-
treeSignature = nextSignature
|
|
46
|
-
tree = buildTree(normalizedFiles)
|
|
47
|
-
flatNodes = flattenTree(tree)
|
|
48
|
-
openFolders = createDefaultOpenFolders(tree, normalizedCurrent)
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
$effect(() => {
|
|
53
|
-
if (normalizedCurrent !== lastCurrent) {
|
|
54
|
-
openFolders = mergeAncestorFolders(openFolders, normalizedCurrent)
|
|
55
|
-
lastCurrent = normalizedCurrent
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
function toggleFolder (path) {
|
|
60
|
-
if (!path) return
|
|
61
|
-
let next = new SvelteSet(openFolders)
|
|
62
|
-
if (next.has(path)) next.delete(path)
|
|
63
|
-
else next.add(path)
|
|
64
|
-
openFolders = next
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function handleFolderRowKey (event, path) {
|
|
68
|
-
if (event.key !== 'Enter' && event.key !== ' ') return
|
|
69
|
-
event.preventDefault()
|
|
70
|
-
toggleFolder(path)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function isOpen (path, openSet = openFolders) {
|
|
74
|
-
if (!path) return true
|
|
75
|
-
return openSet.has(path)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function isVisible (node, openSet = openFolders) {
|
|
79
|
-
return node.ancestors.every((path) => isOpen(path, openSet))
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function buildTree (paths) {
|
|
83
|
-
let root = []
|
|
84
|
-
let folderMap = new SvelteMap()
|
|
85
|
-
|
|
86
|
-
for (let filePath of paths) {
|
|
87
|
-
let cleanPath = filePath.replace(/^\.\//, '').replace(/^\//, '')
|
|
88
|
-
let segments = cleanPath.split('/')
|
|
89
|
-
if (!segments.length) continue
|
|
90
|
-
let fileName = segments.pop()
|
|
91
|
-
let parentChildren = root
|
|
92
|
-
let parentPath = ''
|
|
93
|
-
|
|
94
|
-
for (let segment of segments) {
|
|
95
|
-
parentPath = parentPath ? `${parentPath}/${segment}` : segment
|
|
96
|
-
if (!folderMap.has(parentPath)) {
|
|
97
|
-
let folderNode = {
|
|
98
|
-
type: 'folder',
|
|
99
|
-
name: segment,
|
|
100
|
-
label: formatLabel(segment, 'folder'),
|
|
101
|
-
path: parentPath,
|
|
102
|
-
children: [],
|
|
103
|
-
route: null,
|
|
104
|
-
}
|
|
105
|
-
folderMap.set(parentPath, folderNode)
|
|
106
|
-
parentChildren.push(folderNode)
|
|
107
|
-
}
|
|
108
|
-
parentChildren = folderMap.get(parentPath).children
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (!fileName) continue
|
|
112
|
-
let fullPath = parentPath ? `${parentPath}/${fileName}` : fileName
|
|
113
|
-
|
|
114
|
-
if (fileName.toLowerCase() === 'index.md' && parentPath) {
|
|
115
|
-
let folderNode = folderMap.get(parentPath)
|
|
116
|
-
if (folderNode) folderNode.route = pathToRoute(fullPath)
|
|
117
|
-
continue
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
let exists = parentChildren.find((node) => node.path === fullPath)
|
|
121
|
-
if (exists) continue
|
|
122
|
-
parentChildren.push({
|
|
123
|
-
type: 'file',
|
|
124
|
-
name: fileName,
|
|
125
|
-
label: formatLabel(fileName, 'file'),
|
|
126
|
-
path: fullPath,
|
|
127
|
-
route: pathToRoute(fullPath),
|
|
128
|
-
})
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return sortNodes(root)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function sortNodes (nodes) {
|
|
135
|
-
return nodes
|
|
136
|
-
.map((node) => {
|
|
137
|
-
if (node.type === 'folder' && node.children?.length) {
|
|
138
|
-
return {...node, children: sortNodes(node.children)}
|
|
139
|
-
}
|
|
140
|
-
return node
|
|
141
|
-
})
|
|
142
|
-
.sort((a, b) => {
|
|
143
|
-
if (a.label === 'Home') return -1
|
|
144
|
-
if (b.label === 'Home') return 1
|
|
145
|
-
if (a.type !== b.type) return a.type === 'folder' ? -1 : 1
|
|
146
|
-
return a.label.localeCompare(b.label)
|
|
147
|
-
})
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function flattenTree (nodes, depth = 0, ancestors = []) {
|
|
151
|
-
let list = []
|
|
152
|
-
for (let node of nodes) {
|
|
153
|
-
if (node.type === 'folder') {
|
|
154
|
-
let entry = {...node, depth, ancestors}
|
|
155
|
-
list.push(entry)
|
|
156
|
-
if (node.children?.length) {
|
|
157
|
-
list.push(...flattenTree(node.children, depth + 1, [...ancestors, node.path]))
|
|
158
|
-
}
|
|
159
|
-
continue
|
|
160
|
-
}
|
|
161
|
-
list.push({...node, depth, ancestors})
|
|
162
|
-
}
|
|
163
|
-
return list
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function createDefaultOpenFolders (_treeNodes, currentPath) {
|
|
167
|
-
let next = new SvelteSet()
|
|
168
|
-
return mergeAncestorFolders(next, currentPath)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function mergeAncestorFolders (openSet, filePath) {
|
|
172
|
-
if (!filePath) return new SvelteSet(openSet)
|
|
173
|
-
let parts = filePath.split('/')
|
|
174
|
-
parts.pop()
|
|
175
|
-
let aggregate = []
|
|
176
|
-
let next = new SvelteSet(openSet)
|
|
177
|
-
for (let part of parts) {
|
|
178
|
-
aggregate.push(part)
|
|
179
|
-
next.add(aggregate.join('/'))
|
|
180
|
-
}
|
|
181
|
-
return next
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function formatLabel (value, type) {
|
|
185
|
-
let cleaned = type === 'file' ? value.replace(/\.md$/, '') : value
|
|
186
|
-
if (cleaned.toLowerCase() === 'index') return 'Home'
|
|
187
|
-
return cleaned
|
|
188
|
-
.split(/[\s_-]+/)
|
|
189
|
-
.filter(Boolean)
|
|
190
|
-
.map((chunk) => chunk.charAt(0).toUpperCase() + chunk.slice(1))
|
|
191
|
-
.join(' ')
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function pathToRoute (path) {
|
|
195
|
-
let clean = path.replace(/\.md$/, '')
|
|
196
|
-
let prefix = baseRoute ? '/' + baseRoute : ''
|
|
197
|
-
if (!clean || clean === 'index') return prefix || '/'
|
|
198
|
-
return prefix + '/' + clean
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function handleLinkClick (event, href) {
|
|
202
|
-
if (!onNavigate) return
|
|
203
|
-
if (href.startsWith('http') || href.startsWith('//')) return
|
|
204
|
-
event.preventDefault()
|
|
205
|
-
onNavigate(href)
|
|
206
|
-
}
|
|
207
|
-
</script>
|
|
208
|
-
|
|
209
|
-
<ul>
|
|
210
|
-
{#each flatNodes as node (node.path)}
|
|
211
|
-
{#if node.type === 'folder'}
|
|
212
|
-
<li class={isVisible(node, openFolders) ? '' : 'hidden'} style={`--depth:${node.depth}`} data-folder={node.path}>
|
|
213
|
-
<div
|
|
214
|
-
class={node.route ? 'folder-row' : 'folder-row clickable'}
|
|
215
|
-
role={node.route ? undefined : 'button'}
|
|
216
|
-
aria-expanded={node.route ? undefined : String(isOpen(node.path, openFolders))}
|
|
217
|
-
onclick={node.route ? undefined : () => toggleFolder(node.path)}
|
|
218
|
-
onkeydown={node.route ? undefined : (event) => handleFolderRowKey(event, node.path)}
|
|
219
|
-
>
|
|
220
|
-
<button
|
|
221
|
-
class="toggle"
|
|
222
|
-
type="button"
|
|
223
|
-
data-folder-toggle={node.path}
|
|
224
|
-
aria-expanded={isOpen(node.path, openFolders)}
|
|
225
|
-
onclick={(event) => { event.stopPropagation(); toggleFolder(node.path) }}
|
|
226
|
-
aria-label={(isOpen(node.path, openFolders) ? 'Collapse' : 'Expand') + ' ' + node.label}
|
|
227
|
-
>
|
|
228
|
-
<span class={isOpen(node.path, openFolders) ? 'chevron open' : 'chevron'}>▸</span>
|
|
229
|
-
</button>
|
|
230
|
-
{#if node.route}
|
|
231
|
-
<a
|
|
232
|
-
href={node.route}
|
|
233
|
-
class={node.route === currentRoute ? 'active' : ''}
|
|
234
|
-
aria-current={node.route === currentRoute ? 'page' : undefined}
|
|
235
|
-
onclick={(e) => handleLinkClick(e, node.route)}
|
|
236
|
-
>
|
|
237
|
-
{node.label}
|
|
238
|
-
</a>
|
|
239
|
-
{:else}
|
|
240
|
-
<span class="label">{node.label}</span>
|
|
241
|
-
{/if}
|
|
242
|
-
</div>
|
|
243
|
-
</li>
|
|
244
|
-
{:else}
|
|
245
|
-
<li class={isVisible(node, openFolders) ? 'file' : 'file hidden'} style={`--depth:${node.depth}`}>
|
|
246
|
-
<a
|
|
247
|
-
href={node.route}
|
|
248
|
-
class={node.path === normalizedCurrent ? 'active' : ''}
|
|
249
|
-
aria-current={node.path === normalizedCurrent ? 'page' : undefined}
|
|
250
|
-
onclick={(e) => handleLinkClick(e, node.route)}
|
|
251
|
-
>
|
|
252
|
-
<span>{node.label}</span>
|
|
253
|
-
</a>
|
|
254
|
-
</li>
|
|
255
|
-
{/if}
|
|
256
|
-
{/each}
|
|
257
|
-
</ul>
|
|
258
|
-
|
|
259
|
-
<style>
|
|
260
|
-
ul {
|
|
261
|
-
list-style: none;
|
|
262
|
-
padding: 0 0.5rem 0 0;
|
|
263
|
-
margin: 0;
|
|
264
|
-
display: flex;
|
|
265
|
-
flex-direction: column;
|
|
266
|
-
gap: 0.1rem;
|
|
267
|
-
overflow: hidden;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
li {
|
|
271
|
-
--indent: calc(var(--depth, 0) * 1rem);
|
|
272
|
-
padding-left: var(--indent);
|
|
273
|
-
width: 100%;
|
|
274
|
-
box-sizing: border-box;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
li.file {
|
|
278
|
-
padding-left: calc(var(--indent) + 1.5rem);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
li.hidden {
|
|
282
|
-
display: none;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.folder-row {
|
|
286
|
-
display: flex;
|
|
287
|
-
align-items: center;
|
|
288
|
-
padding: 0.1rem 0.15rem;
|
|
289
|
-
border-radius: 4px;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.folder-row.clickable {
|
|
293
|
-
cursor: pointer;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.folder-row.clickable:focus-visible {
|
|
297
|
-
outline: 2px solid rgba(15, 23, 42, 0.2);
|
|
298
|
-
outline-offset: 2px;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.toggle {
|
|
302
|
-
display: inline-flex;
|
|
303
|
-
align-items: center;
|
|
304
|
-
justify-content: center;
|
|
305
|
-
width: 1.5rem;
|
|
306
|
-
height: 1.5rem;
|
|
307
|
-
color: var(--base-heading);
|
|
308
|
-
background: transparent;
|
|
309
|
-
border: none;
|
|
310
|
-
cursor: pointer;
|
|
311
|
-
border-radius: 4px;
|
|
312
|
-
opacity: 0;
|
|
313
|
-
pointer-events: none;
|
|
314
|
-
transition: opacity 120ms ease;
|
|
315
|
-
visibility: hidden;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.folder-row:hover .toggle,
|
|
319
|
-
.folder-row:focus-within .toggle,
|
|
320
|
-
.toggle:focus-visible {
|
|
321
|
-
opacity: 1;
|
|
322
|
-
pointer-events: auto;
|
|
323
|
-
visibility: visible;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.toggle:hover,
|
|
327
|
-
.toggle:focus-visible {
|
|
328
|
-
background: rgba(15, 23, 42, 0.1);
|
|
329
|
-
outline: none;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.chevron {
|
|
333
|
-
display: inline-block;
|
|
334
|
-
transition: transform 150ms ease;
|
|
335
|
-
font-size: 0.7rem;
|
|
336
|
-
color: var(--base-content-muted);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.chevron.open {
|
|
340
|
-
transform: rotate(90deg);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.label {
|
|
344
|
-
font-size: 0.85rem;
|
|
345
|
-
padding: 0.2rem 0.35rem;
|
|
346
|
-
white-space: nowrap;
|
|
347
|
-
overflow: hidden;
|
|
348
|
-
text-overflow: ellipsis;
|
|
349
|
-
color: var(--base-heading);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.folder-row a {
|
|
353
|
-
flex: 1;
|
|
354
|
-
display: block;
|
|
355
|
-
font-size: 0.85rem;
|
|
356
|
-
padding: 0.2rem 0.35rem;
|
|
357
|
-
border-radius: 4px;
|
|
358
|
-
color: var(--base-heading);
|
|
359
|
-
text-decoration: none;
|
|
360
|
-
white-space: nowrap;
|
|
361
|
-
overflow: hidden;
|
|
362
|
-
text-overflow: ellipsis;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.folder-row a:hover,
|
|
366
|
-
.folder-row a:focus-visible {
|
|
367
|
-
background: rgba(15, 23, 42, 0.05);
|
|
368
|
-
outline: none;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
li.file a {
|
|
372
|
-
display: flex;
|
|
373
|
-
align-items: center;
|
|
374
|
-
font-size: 0.85rem;
|
|
375
|
-
padding: 0.2rem 0.5rem;
|
|
376
|
-
border-radius: 4px;
|
|
377
|
-
color: var(--base-heading);
|
|
378
|
-
text-decoration: none;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
li.file a span {
|
|
382
|
-
white-space: nowrap;
|
|
383
|
-
overflow: hidden;
|
|
384
|
-
text-overflow: ellipsis;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
li.file a:hover,
|
|
388
|
-
li.file a:focus-visible {
|
|
389
|
-
background: rgba(15, 23, 42, 0.05);
|
|
390
|
-
outline: none;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
a.active {
|
|
394
|
-
color: var(--base-900, #0f172a);
|
|
395
|
-
}
|
|
396
|
-
</style>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
let {error} = $props()
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<h1>Error loading page</h1>
|
|
6
|
-
<p class="message">{error.message}</p>
|
|
7
|
-
{#if error.frame}<pre>{error.frame}</pre>{/if}
|
|
8
|
-
{#if error.file}<p class="file">{error.file}</p>{/if}
|
|
9
|
-
|
|
10
|
-
<style>
|
|
11
|
-
h1 { margin-top: 0; }
|
|
12
|
-
.message { color: var(--red-700); }
|
|
13
|
-
pre {
|
|
14
|
-
background: var(--grey-100);
|
|
15
|
-
border: 1px solid var(--grey-200);
|
|
16
|
-
border-radius: 4px;
|
|
17
|
-
padding: 1rem;
|
|
18
|
-
overflow-x: auto;
|
|
19
|
-
font-size: 0.875rem;
|
|
20
|
-
line-height: 1.6;
|
|
21
|
-
}
|
|
22
|
-
.file { color: var(--grey-500); font-size: 0.875rem; }
|
|
23
|
-
</style>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// WebSocket connection for the `graphene check` command.
|
|
2
|
-
// Listens for check requests, waits for queries to finish, captures screenshots, and reports errors.
|
|
3
|
-
|
|
4
|
-
import {getErrors} from './telemetry.ts'
|
|
5
|
-
import {isLoading} from './queryEngine.ts'
|
|
6
|
-
|
|
7
|
-
let socket: WebSocket | null = null
|
|
8
|
-
connect()
|
|
9
|
-
|
|
10
|
-
function captureChart (chartTitle: string) {
|
|
11
|
-
let escaped = window.CSS.escape(chartTitle)
|
|
12
|
-
let canvas = document.querySelector(`[data-chart-title="${escaped}"] canvas`) as HTMLCanvasElement | null
|
|
13
|
-
return canvas?.toDataURL('image/png')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async function takeScreenshot () {
|
|
17
|
-
if (!(window as any).html2canvas) {
|
|
18
|
-
let html2canvas = await import('@graphenedata/html2canvas')
|
|
19
|
-
;(window as any).html2canvas = html2canvas.default
|
|
20
|
-
}
|
|
21
|
-
let canvas = await (window as any).html2canvas(document.body, {useCORS: true, allowTaint: true, scale: 1, liveDOM: true})
|
|
22
|
-
return canvas?.toDataURL('image/png')
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function waitForQueriesToFinish () {
|
|
26
|
-
let startTime = Date.now()
|
|
27
|
-
while (isLoading() && Date.now() - startTime < 20_000) {
|
|
28
|
-
await new Promise(resolve => setTimeout(resolve, 100))
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function connect () {
|
|
33
|
-
let wsUrl = `ws://${window.location.host}/_api/ws`
|
|
34
|
-
socket = new WebSocket(wsUrl)
|
|
35
|
-
socket.onclose = () => setTimeout(connect, 2000)
|
|
36
|
-
socket.onopen = () => socket!.send(JSON.stringify({type: 'register', url: window.location.href}))
|
|
37
|
-
|
|
38
|
-
socket.onmessage = async (event) => {
|
|
39
|
-
let {type, requestId, chart} = JSON.parse(event.data)
|
|
40
|
-
if (type !== 'check') return
|
|
41
|
-
|
|
42
|
-
await waitForQueriesToFinish()
|
|
43
|
-
let errors = getErrors().map((e: any) => ({type: e.type, message: e.message, id: e.id, file: e.file, line: e.loc?.line, frame: e.frame, from: e.from, to: e.to}))
|
|
44
|
-
let stillLoading = isLoading()
|
|
45
|
-
let screenshot = chart ? captureChart(chart) : await takeScreenshot()
|
|
46
|
-
socket!.send(JSON.stringify({type: 'checkResponse', requestId, errors, stillLoading, screenshot}))
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Evidence has a complex theme loading system that we don't really want to keep.
|
|
2
|
-
// This was generated by copying the runtime export of $evidence/themes from the evidence sample app.
|
|
3
|
-
export const themes = {
|
|
4
|
-
'light': {
|
|
5
|
-
'colors': {
|
|
6
|
-
'primary': '#2563eb',
|
|
7
|
-
'accent': '#c2410c',
|
|
8
|
-
'base-100': '#ffffff',
|
|
9
|
-
'info': '#0284c7',
|
|
10
|
-
'positive': '#16a34a',
|
|
11
|
-
'warning': '#f8c900',
|
|
12
|
-
'negative': '#dc2626',
|
|
13
|
-
'primary-content': '#f6f8fb',
|
|
14
|
-
'accent-content': '#fbf7f6',
|
|
15
|
-
'base-200': '#f7f7f7',
|
|
16
|
-
'base-300': '#d6d6d6',
|
|
17
|
-
'base-heading': '#060606',
|
|
18
|
-
'base-content': '#2c2c2c',
|
|
19
|
-
'base-content-muted': '#717171',
|
|
20
|
-
'info-content': '#030709',
|
|
21
|
-
'positive-content': '#040906',
|
|
22
|
-
'negative-content': '#fbf6f6',
|
|
23
|
-
'warning-content': '#0a0803',
|
|
24
|
-
},
|
|
25
|
-
'colorPalettes': {
|
|
26
|
-
'default': [
|
|
27
|
-
'#236aa4',
|
|
28
|
-
'#45a1bf',
|
|
29
|
-
'#a5cdee',
|
|
30
|
-
'#8dacbf',
|
|
31
|
-
'#85c7c6',
|
|
32
|
-
'#d2c6ac',
|
|
33
|
-
'#f4b548',
|
|
34
|
-
'#8f3d56',
|
|
35
|
-
'#71b9f4',
|
|
36
|
-
'#46a485',
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
'colorScales': {
|
|
40
|
-
'default': [
|
|
41
|
-
'#ADD8E6',
|
|
42
|
-
'#00008B',
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
'dark': {
|
|
47
|
-
'colors': {
|
|
48
|
-
'primary': '#3b82f6',
|
|
49
|
-
'accent': '#fdba74',
|
|
50
|
-
'base-100': '#09090b',
|
|
51
|
-
'info': '#38bdf8',
|
|
52
|
-
'positive': '#4ade80',
|
|
53
|
-
'warning': '#fbbf24',
|
|
54
|
-
'negative': '#f87171',
|
|
55
|
-
'primary-content': '#030609',
|
|
56
|
-
'accent-content': '#090603',
|
|
57
|
-
'base-200': '#111113',
|
|
58
|
-
'base-300': '#29292b',
|
|
59
|
-
'base-heading': '#f8f8f9',
|
|
60
|
-
'base-content': '#cacacb',
|
|
61
|
-
'base-content-muted': '#7b7b7c',
|
|
62
|
-
'info-content': '#030809',
|
|
63
|
-
'positive-content': '#040906',
|
|
64
|
-
'negative-content': '#090303',
|
|
65
|
-
'warning-content': '#090803',
|
|
66
|
-
},
|
|
67
|
-
'colorPalettes': {
|
|
68
|
-
'default': [
|
|
69
|
-
'#236aa4',
|
|
70
|
-
'#45a1bf',
|
|
71
|
-
'#a5cdee',
|
|
72
|
-
'#8dacbf',
|
|
73
|
-
'#85c7c6',
|
|
74
|
-
'#d2c6ac',
|
|
75
|
-
'#f4b548',
|
|
76
|
-
'#8f3d56',
|
|
77
|
-
'#71b9f4',
|
|
78
|
-
'#46a485',
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
'colorScales': {
|
|
82
|
-
'default': [
|
|
83
|
-
'#ADD8E6',
|
|
84
|
-
'#00008B',
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
}
|
|
Binary file
|
|
Binary file
|