windmill-components 1.352.5 → 1.352.7
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/package/assets/app.css +52 -58
- package/package/components/DisplayResult.svelte +2 -0
- package/package/components/EditableSchemaForm.svelte +42 -40
- package/package/components/EditableSchemaForm.svelte.d.ts +1 -0
- package/package/components/EditorBar.svelte +2 -2
- package/package/components/FlowGraphViewerStep.svelte +3 -0
- package/package/components/FlowViewer.svelte +3 -0
- package/package/components/HighlightCode.svelte +3 -0
- package/package/components/HighlightTheme.svelte +318 -0
- package/package/components/HighlightTheme.svelte.d.ts +14 -0
- package/package/components/JobArgs.svelte +3 -0
- package/package/components/ResourceEditor.svelte +138 -141
- package/package/components/ResourceEditor.svelte.d.ts +9 -2
- package/package/components/ResourceEditorDrawer.svelte +45 -0
- package/package/components/ResourceEditorDrawer.svelte.d.ts +21 -0
- package/package/components/ResourcePicker.svelte +2 -2
- package/package/components/RunChart.svelte +6 -2
- package/package/components/SchemaViewer.svelte +3 -0
- package/package/components/SupabaseConnect.svelte +3 -0
- package/package/components/apps/editor/AppExportButton.svelte +3 -0
- package/package/components/apps/editor/componentsPanel/ThemeDrawer.svelte +3 -0
- package/package/components/apps/editor/settingsPanel/CSSMigrationModal.svelte +3 -0
- package/package/components/apps/editor/settingsPanel/ComponentControl.svelte +3 -0
- package/package/components/details/DetailPageDetailPanel.svelte +3 -0
- package/package/components/details/WebhooksPanel.svelte +3 -0
- package/package.json +17 -1
- package/package/components/ChartHighlightTheme.svelte +0 -65
- package/package/components/ChartHighlightTheme.svelte.d.ts +0 -14
|
@@ -1,58 +1,66 @@
|
|
|
1
1
|
<script>import { ResourceService } from '../gen';
|
|
2
2
|
import { canWrite, emptyString, isOwner, urlize } from '../utils';
|
|
3
3
|
import { createEventDispatcher } from 'svelte';
|
|
4
|
-
import { Alert,
|
|
4
|
+
import { Alert, Skeleton } from './common';
|
|
5
5
|
import Path from './Path.svelte';
|
|
6
6
|
import Required from './Required.svelte';
|
|
7
7
|
import { userStore, workspaceStore } from '../stores';
|
|
8
|
-
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
9
8
|
import SchemaForm from './SchemaForm.svelte';
|
|
10
9
|
import SimpleEditor from './SimpleEditor.svelte';
|
|
11
10
|
import Toggle from './Toggle.svelte';
|
|
12
11
|
import { sendUserToast } from '../toast';
|
|
13
12
|
import TestConnection from './TestConnection.svelte';
|
|
14
|
-
import { Pen
|
|
13
|
+
import { Pen } from 'lucide-svelte';
|
|
15
14
|
import Markdown from 'svelte-exmarkdown';
|
|
16
15
|
import autosize from '../autosize';
|
|
17
16
|
import GfmMarkdown from './GfmMarkdown.svelte';
|
|
18
|
-
let
|
|
19
|
-
let
|
|
20
|
-
let
|
|
17
|
+
export let canSave = true;
|
|
18
|
+
export let resource_type = undefined;
|
|
19
|
+
export let path = '';
|
|
20
|
+
export let newResource = false;
|
|
21
|
+
export let hidePath = false;
|
|
22
|
+
let isValid = true;
|
|
23
|
+
let jsonError = '';
|
|
24
|
+
let can_write = true;
|
|
25
|
+
$: canSave = can_write && isValid && jsonError == '';
|
|
26
|
+
let initialPath = path;
|
|
27
|
+
let resourceToEdit = undefined;
|
|
21
28
|
let description = '';
|
|
22
29
|
let DESCRIPTION_PLACEHOLDER = `Describe what this resource is for`;
|
|
23
|
-
let
|
|
24
|
-
let resourceSchema;
|
|
30
|
+
let resourceSchema = undefined;
|
|
25
31
|
let args = {};
|
|
26
|
-
let
|
|
27
|
-
let loadingSchema = false;
|
|
32
|
+
let loadingSchema = true;
|
|
28
33
|
let linkedVars = [];
|
|
29
|
-
let drawer;
|
|
30
34
|
let resourceTypeInfo = undefined;
|
|
31
|
-
let
|
|
35
|
+
let editDescription = false;
|
|
36
|
+
let viewJsonSchema = false;
|
|
32
37
|
let rawCode = undefined;
|
|
33
38
|
const dispatch = createEventDispatcher();
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
path = p;
|
|
37
|
-
resourceToEdit = undefined;
|
|
38
|
-
resourceSchema = undefined;
|
|
39
|
-
viewJsonSchema = false;
|
|
40
|
-
loadingSchema = true;
|
|
41
|
-
drawer.openDrawer?.();
|
|
42
|
-
resourceToEdit = await ResourceService.getResource({ workspace: $workspaceStore, path: p });
|
|
39
|
+
async function initEdit() {
|
|
40
|
+
resourceToEdit = await ResourceService.getResource({ workspace: $workspaceStore, path });
|
|
43
41
|
description = resourceToEdit.description ?? '';
|
|
44
|
-
|
|
42
|
+
resource_type = resourceToEdit.resource_type;
|
|
43
|
+
args = resourceToEdit?.value ?? {};
|
|
45
44
|
loadResourceType();
|
|
46
|
-
args = resourceToEdit.value;
|
|
47
45
|
can_write =
|
|
48
46
|
resourceToEdit.workspace_id == $workspaceStore &&
|
|
49
|
-
canWrite(
|
|
47
|
+
canWrite(path, resourceToEdit.extra_perms ?? {}, $userStore);
|
|
50
48
|
linkedVars = Object.entries(args)
|
|
51
49
|
.filter(([_, v]) => typeof v == 'string' && v == `$var:${initialPath}`)
|
|
52
50
|
.map(([k, _]) => k);
|
|
53
|
-
renderDescription = false;
|
|
54
51
|
}
|
|
55
|
-
|
|
52
|
+
if (!newResource) {
|
|
53
|
+
initEdit();
|
|
54
|
+
}
|
|
55
|
+
else if (resource_type) {
|
|
56
|
+
loadResourceType();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
sendUserToast('Resource type cannot be undefined for new resource creation', true);
|
|
60
|
+
}
|
|
61
|
+
$: rawCode && parseJson();
|
|
62
|
+
$: linkedVars.length > 0 && path && updateArgsFromLinkedVars();
|
|
63
|
+
export async function editResource() {
|
|
56
64
|
if (resourceToEdit) {
|
|
57
65
|
await ResourceService.updateResource({
|
|
58
66
|
workspace: $workspaceStore,
|
|
@@ -61,18 +69,25 @@ async function editResource() {
|
|
|
61
69
|
});
|
|
62
70
|
sendUserToast(`Updated resource at ${path}`);
|
|
63
71
|
dispatch('refresh', path);
|
|
64
|
-
drawer.closeDrawer?.();
|
|
65
72
|
}
|
|
66
73
|
else {
|
|
67
74
|
throw Error('Cannot edit undefined resourceToEdit');
|
|
68
75
|
}
|
|
69
76
|
}
|
|
77
|
+
export async function createResource() {
|
|
78
|
+
await ResourceService.createResource({
|
|
79
|
+
workspace: $workspaceStore,
|
|
80
|
+
requestBody: { path, value: args, description, resource_type: resource_type }
|
|
81
|
+
});
|
|
82
|
+
sendUserToast(`Updated resource at ${path}`);
|
|
83
|
+
dispatch('refresh', path);
|
|
84
|
+
}
|
|
70
85
|
async function loadResourceType() {
|
|
71
|
-
if (
|
|
86
|
+
if (resource_type) {
|
|
72
87
|
try {
|
|
73
88
|
const resourceType = await ResourceService.getResourceType({
|
|
74
89
|
workspace: $workspaceStore,
|
|
75
|
-
path:
|
|
90
|
+
path: resource_type
|
|
76
91
|
});
|
|
77
92
|
resourceTypeInfo = resourceType;
|
|
78
93
|
if (resourceType.schema) {
|
|
@@ -90,9 +105,6 @@ async function loadResourceType() {
|
|
|
90
105
|
}
|
|
91
106
|
loadingSchema = false;
|
|
92
107
|
}
|
|
93
|
-
let isValid = true;
|
|
94
|
-
let jsonError = '';
|
|
95
|
-
$: rawCode && parseJson();
|
|
96
108
|
function parseJson() {
|
|
97
109
|
try {
|
|
98
110
|
args = JSON.parse(rawCode ?? '');
|
|
@@ -102,13 +114,11 @@ function parseJson() {
|
|
|
102
114
|
jsonError = e.message;
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
|
-
$: linkedVars.length > 0 && path && updateArgsFromLinkedVars();
|
|
106
117
|
function updateArgsFromLinkedVars() {
|
|
107
118
|
linkedVars.forEach((k) => {
|
|
108
119
|
args[k] = `$var:${path}`;
|
|
109
120
|
});
|
|
110
121
|
}
|
|
111
|
-
let viewJsonSchema = false;
|
|
112
122
|
function switchTab(asJson) {
|
|
113
123
|
viewJsonSchema = asJson;
|
|
114
124
|
if (asJson) {
|
|
@@ -120,118 +130,105 @@ function switchTab(asJson) {
|
|
|
120
130
|
}
|
|
121
131
|
</script>
|
|
122
132
|
|
|
123
|
-
<
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<div class="m-2">
|
|
133
|
-
<Alert type="warning" title="Only read access">
|
|
134
|
-
You only have read access to this resource and cannot edit it
|
|
135
|
-
</Alert>
|
|
136
|
-
</div>
|
|
137
|
-
{/if}
|
|
138
|
-
<Path
|
|
139
|
-
disabled={initialPath != '' && !isOwner(initialPath, $userStore, $workspaceStore)}
|
|
140
|
-
bind:path
|
|
141
|
-
{initialPath}
|
|
142
|
-
namePlaceholder="resource"
|
|
143
|
-
kind="resource"
|
|
144
|
-
/>
|
|
145
|
-
</div>
|
|
146
|
-
{#if !emptyString(resourceTypeInfo?.description)}
|
|
147
|
-
<h4 class="mt-4 mb-2">{resourceTypeInfo?.name} description</h4>
|
|
148
|
-
<div class="text-sm">
|
|
149
|
-
<Markdown md={urlize(resourceTypeInfo?.description ?? '', 'md')} />
|
|
133
|
+
<div>
|
|
134
|
+
<div class="flex flex-col gap-3 py-3">
|
|
135
|
+
{#if !hidePath}
|
|
136
|
+
<div>
|
|
137
|
+
{#if !can_write}
|
|
138
|
+
<div class="m-2">
|
|
139
|
+
<Alert type="warning" title="Only read access">
|
|
140
|
+
You only have read access to this resource and cannot edit it
|
|
141
|
+
</Alert>
|
|
150
142
|
</div>
|
|
151
143
|
{/if}
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
144
|
+
<Path
|
|
145
|
+
disabled={initialPath != '' && !isOwner(initialPath, $userStore, $workspaceStore)}
|
|
146
|
+
bind:path
|
|
147
|
+
{initialPath}
|
|
148
|
+
namePlaceholder="resource"
|
|
149
|
+
kind="resource"
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
{/if}
|
|
161
153
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
154
|
+
{#if !emptyString(resourceTypeInfo?.description)}
|
|
155
|
+
<h4 class="mt-4 mb-2">{resourceTypeInfo?.name} description</h4>
|
|
156
|
+
<div class="text-sm">
|
|
157
|
+
<Markdown md={urlize(resourceTypeInfo?.description ?? '', 'md')} />
|
|
158
|
+
</div>
|
|
159
|
+
{/if}
|
|
160
|
+
<h4 class="mt-4 inline-flex items-center gap-4"
|
|
161
|
+
>Resource description <Required required={false} />
|
|
162
|
+
{#if can_write}
|
|
163
|
+
<div class="flex gap-1 items-center">
|
|
164
|
+
<Toggle size="xs" bind:checked={editDescription} />
|
|
165
|
+
<Pen size={14} />
|
|
166
|
+
</div>
|
|
167
|
+
{/if}</h4
|
|
168
|
+
>
|
|
176
169
|
|
|
177
|
-
|
|
170
|
+
{#if can_write && editDescription}
|
|
171
|
+
<div>
|
|
172
|
+
<div class="flex flex-row-reverse text-2xs text-tertiary -mt-1">GH Markdown</div>
|
|
173
|
+
<textarea
|
|
174
|
+
disabled={!can_write}
|
|
175
|
+
use:autosize
|
|
176
|
+
bind:value={description}
|
|
177
|
+
placeholder={DESCRIPTION_PLACEHOLDER}
|
|
178
|
+
/>
|
|
179
|
+
</div>
|
|
180
|
+
{:else if description == undefined || description == ''}
|
|
181
|
+
<div class="text-sm text-tertiary">No description provided</div>
|
|
182
|
+
{:else}
|
|
183
|
+
<div class="mt-2" />
|
|
184
|
+
|
|
185
|
+
<GfmMarkdown md={description} />
|
|
186
|
+
{/if}
|
|
187
|
+
<div class="flex w-full justify-between max-w-lg items-center mt-4">
|
|
188
|
+
<Toggle
|
|
189
|
+
on:change={(e) => switchTab(e.detail)}
|
|
190
|
+
options={{
|
|
191
|
+
right: 'As JSON'
|
|
192
|
+
}}
|
|
193
|
+
/>
|
|
194
|
+
<TestConnection resourceType={resourceToEdit?.resource_type} {args} />
|
|
195
|
+
</div>
|
|
196
|
+
<div class="text-sm">
|
|
197
|
+
{#if loadingSchema}
|
|
198
|
+
<Skeleton layout={[[4]]} />
|
|
199
|
+
{:else if !viewJsonSchema && resourceSchema && resourceSchema?.properties}
|
|
200
|
+
<SchemaForm
|
|
201
|
+
onlyMaskPassword
|
|
202
|
+
noDelete
|
|
203
|
+
disabled={!can_write}
|
|
204
|
+
compact
|
|
205
|
+
schema={resourceSchema}
|
|
206
|
+
bind:args
|
|
207
|
+
bind:isValid
|
|
208
|
+
/>
|
|
209
|
+
{:else if !can_write}
|
|
210
|
+
<input type="text" disabled value={rawCode} />
|
|
211
|
+
{:else}
|
|
212
|
+
{#if !viewJsonSchema}
|
|
213
|
+
<p class="italic text-secondary text-xs mb-4">
|
|
214
|
+
No corresponding resource type found in your workspace for {resource_type}. Define the
|
|
215
|
+
value in JSON directly
|
|
216
|
+
</p>
|
|
178
217
|
{/if}
|
|
179
|
-
<div class="flex w-full justify-between max-w-lg items-center mt-4">
|
|
180
|
-
<Toggle
|
|
181
|
-
on:change={(e) => switchTab(e.detail)}
|
|
182
|
-
options={{
|
|
183
|
-
right: 'As JSON'
|
|
184
|
-
}}
|
|
185
|
-
/>
|
|
186
|
-
<TestConnection resourceType={resourceToEdit?.resource_type} {args} />
|
|
187
|
-
</div>
|
|
188
|
-
<div class="text-sm">
|
|
189
|
-
{#if loadingSchema}
|
|
190
|
-
<Skeleton layout={[[4]]} />
|
|
191
|
-
{:else if !viewJsonSchema && resourceSchema && resourceSchema?.properties}
|
|
192
|
-
<SchemaForm
|
|
193
|
-
onlyMaskPassword
|
|
194
|
-
noDelete
|
|
195
|
-
disabled={!can_write}
|
|
196
|
-
compact
|
|
197
|
-
schema={resourceSchema}
|
|
198
|
-
bind:args
|
|
199
|
-
bind:isValid
|
|
200
|
-
/>
|
|
201
|
-
{:else if !can_write}
|
|
202
|
-
<input type="text" disabled value={rawCode} />
|
|
203
|
-
{:else}
|
|
204
|
-
{#if !viewJsonSchema}
|
|
205
|
-
<p class="italic text-secondary text-xs mb-4">
|
|
206
|
-
No corresponding resource type found in your workspace for {selectedResourceType}.
|
|
207
|
-
Define the value in JSON directly
|
|
208
|
-
</p>
|
|
209
|
-
{/if}
|
|
210
218
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
</div>
|
|
223
|
-
{/if}
|
|
219
|
+
{#if !emptyString(jsonError)}<span class="text-red-400 text-xs mb-1 flex flex-row-reverse"
|
|
220
|
+
>{jsonError}</span
|
|
221
|
+
>{:else}<div class="py-2" />{/if}
|
|
222
|
+
<div class="h-full w-full border p-1 rounded">
|
|
223
|
+
<SimpleEditor
|
|
224
|
+
autoHeight
|
|
225
|
+
class="editor"
|
|
226
|
+
lang="json"
|
|
227
|
+
bind:code={rawCode}
|
|
228
|
+
fixedOverflowWidgets={false}
|
|
229
|
+
/>
|
|
224
230
|
</div>
|
|
225
|
-
|
|
231
|
+
{/if}
|
|
226
232
|
</div>
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
startIcon={{ icon: Save }}
|
|
230
|
-
on:click={editResource}
|
|
231
|
-
disabled={!can_write || !isValid || jsonError != ''}
|
|
232
|
-
>
|
|
233
|
-
Save
|
|
234
|
-
</Button>
|
|
235
|
-
</svelte:fragment>
|
|
236
|
-
</DrawerContent>
|
|
237
|
-
</Drawer>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
|
|
4
|
+
canSave?: boolean | undefined;
|
|
5
|
+
resource_type?: string | undefined;
|
|
6
|
+
path?: string | undefined;
|
|
7
|
+
newResource?: boolean | undefined;
|
|
8
|
+
hidePath?: boolean | undefined;
|
|
9
|
+
editResource?: (() => Promise<void>) | undefined;
|
|
10
|
+
createResource?: (() => Promise<void>) | undefined;
|
|
5
11
|
};
|
|
6
12
|
events: {
|
|
7
13
|
refresh: CustomEvent<any>;
|
|
@@ -14,6 +20,7 @@ export type ResourceEditorProps = typeof __propDef.props;
|
|
|
14
20
|
export type ResourceEditorEvents = typeof __propDef.events;
|
|
15
21
|
export type ResourceEditorSlots = typeof __propDef.slots;
|
|
16
22
|
export default class ResourceEditor extends SvelteComponent<ResourceEditorProps, ResourceEditorEvents, ResourceEditorSlots> {
|
|
17
|
-
get
|
|
23
|
+
get editResource(): () => Promise<void>;
|
|
24
|
+
get createResource(): () => Promise<void>;
|
|
18
25
|
}
|
|
19
26
|
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script>import ResourceEditor from './ResourceEditor.svelte';
|
|
2
|
+
import { Button, Drawer } from './common';
|
|
3
|
+
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
4
|
+
import { Save } from 'lucide-svelte';
|
|
5
|
+
let drawer;
|
|
6
|
+
let canSave = true;
|
|
7
|
+
let resource_type = undefined;
|
|
8
|
+
let resourceEditor = undefined;
|
|
9
|
+
let path = undefined;
|
|
10
|
+
export async function initEdit(p) {
|
|
11
|
+
resource_type = undefined;
|
|
12
|
+
path = p;
|
|
13
|
+
drawer.openDrawer?.();
|
|
14
|
+
}
|
|
15
|
+
export async function initNew(resourceType) {
|
|
16
|
+
path = undefined;
|
|
17
|
+
resource_type = resourceType;
|
|
18
|
+
drawer.openDrawer?.();
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Drawer bind:this={drawer} size="800px">
|
|
23
|
+
<DrawerContent title={path ? 'Edit ' + path : 'Add a resource'} on:close={drawer.closeDrawer}>
|
|
24
|
+
<ResourceEditor
|
|
25
|
+
newResource
|
|
26
|
+
{path}
|
|
27
|
+
{resource_type}
|
|
28
|
+
on:refresh
|
|
29
|
+
bind:this={resourceEditor}
|
|
30
|
+
bind:canSave
|
|
31
|
+
/>
|
|
32
|
+
<svelte:fragment slot="actions">
|
|
33
|
+
<Button
|
|
34
|
+
startIcon={{ icon: Save }}
|
|
35
|
+
on:click={() => {
|
|
36
|
+
resourceEditor?.editResource()
|
|
37
|
+
drawer.closeDrawer()
|
|
38
|
+
}}
|
|
39
|
+
disabled={!canSave}
|
|
40
|
+
>
|
|
41
|
+
Save
|
|
42
|
+
</Button>
|
|
43
|
+
</svelte:fragment>
|
|
44
|
+
</DrawerContent>
|
|
45
|
+
</Drawer>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
initEdit?: ((p: string) => Promise<void>) | undefined;
|
|
5
|
+
initNew?: ((resourceType: string) => Promise<void>) | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
refresh: CustomEvent<any>;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export type ResourceEditorDrawerProps = typeof __propDef.props;
|
|
15
|
+
export type ResourceEditorDrawerEvents = typeof __propDef.events;
|
|
16
|
+
export type ResourceEditorDrawerSlots = typeof __propDef.slots;
|
|
17
|
+
export default class ResourceEditorDrawer extends SvelteComponent<ResourceEditorDrawerProps, ResourceEditorDrawerEvents, ResourceEditorDrawerSlots> {
|
|
18
|
+
get initEdit(): (p: string) => Promise<void>;
|
|
19
|
+
get initNew(): (resourceType: string) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -5,10 +5,10 @@ import Select from './apps/svelte-select/lib/index';
|
|
|
5
5
|
import { SELECT_INPUT_DEFAULT_STYLE } from '../defaults';
|
|
6
6
|
import AppConnect from './AppConnectDrawer.svelte';
|
|
7
7
|
import { Button } from './common';
|
|
8
|
-
import ResourceEditor from './ResourceEditor.svelte';
|
|
9
8
|
import DBSchemaExplorer from './DBSchemaExplorer.svelte';
|
|
10
9
|
import DarkModeObserver from './DarkModeObserver.svelte';
|
|
11
10
|
import { Pen, Plus, RotateCw } from 'lucide-svelte';
|
|
11
|
+
import ResourceEditorDrawer from './ResourceEditorDrawer.svelte';
|
|
12
12
|
const dispatch = createEventDispatcher();
|
|
13
13
|
export let initialValue = undefined;
|
|
14
14
|
export let value = initialValue;
|
|
@@ -73,7 +73,7 @@ let darkMode = false;
|
|
|
73
73
|
bind:this={appConnect}
|
|
74
74
|
/>
|
|
75
75
|
|
|
76
|
-
<
|
|
76
|
+
<ResourceEditorDrawer
|
|
77
77
|
bind:this={resourceEditor}
|
|
78
78
|
on:refresh={async (e) => {
|
|
79
79
|
await loadResources(resourceType)
|
|
@@ -70,9 +70,13 @@ const zoomOptions = {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
+
function isDark() {
|
|
74
|
+
return document.documentElement.classList.contains('dark');
|
|
75
|
+
}
|
|
76
|
+
ChartJS.defaults.color = isDark() ? '#ccc' : '#666';
|
|
77
|
+
ChartJS.defaults.borderColor = isDark() ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)';
|
|
73
78
|
function getBackgorundColor() {
|
|
74
|
-
|
|
75
|
-
return isDark ? '#2e3440' : '#ffffff';
|
|
79
|
+
return isDark() ? '#2e3440' : '#ffffff';
|
|
76
80
|
}
|
|
77
81
|
function hexToRgb(hexColor) {
|
|
78
82
|
hexColor = hexColor.replace(/^#/, '');
|
|
@@ -6,6 +6,7 @@ import Tab from './common/tabs/Tab.svelte';
|
|
|
6
6
|
import TabContent from './common/tabs/TabContent.svelte';
|
|
7
7
|
import Tabs from './common/tabs/Tabs.svelte';
|
|
8
8
|
import { Badge } from './common';
|
|
9
|
+
import HighlightTheme from './HighlightTheme.svelte';
|
|
9
10
|
export let schema = emptySchema();
|
|
10
11
|
function getProperties(schema) {
|
|
11
12
|
if (schema.properties) {
|
|
@@ -15,6 +16,8 @@ function getProperties(schema) {
|
|
|
15
16
|
}
|
|
16
17
|
</script>
|
|
17
18
|
|
|
19
|
+
<HighlightTheme />
|
|
20
|
+
|
|
18
21
|
<div class="w-full">
|
|
19
22
|
<Tabs selected="arguments">
|
|
20
23
|
<Tab value="arguments">Arguments</Tab>
|
|
@@ -10,6 +10,7 @@ import { ResourceService, VariableService } from '../gen';
|
|
|
10
10
|
import { oauthStore, workspaceStore } from '../stores';
|
|
11
11
|
import Password from './Password.svelte';
|
|
12
12
|
import { createEventDispatcher } from 'svelte';
|
|
13
|
+
import HighlightTheme from './HighlightTheme.svelte';
|
|
13
14
|
let drawer;
|
|
14
15
|
let token = undefined;
|
|
15
16
|
export async function open() {
|
|
@@ -81,6 +82,8 @@ async function save() {
|
|
|
81
82
|
}
|
|
82
83
|
</script>
|
|
83
84
|
|
|
85
|
+
<HighlightTheme />
|
|
86
|
+
|
|
84
87
|
<Drawer bind:this={drawer} size="800px">
|
|
85
88
|
<DrawerContent title="Add a Supabase Database" on:close={drawer.closeDrawer}>
|
|
86
89
|
{#if step === 'init' || selectedDatabase == undefined}
|
|
@@ -9,6 +9,7 @@ import { yaml } from 'svelte-highlight/languages';
|
|
|
9
9
|
import YAML from 'yaml';
|
|
10
10
|
import Tabs from '../../common/tabs/Tabs.svelte';
|
|
11
11
|
import Tab from '../../common/tabs/Tab.svelte';
|
|
12
|
+
import HighlightTheme from '../../HighlightTheme.svelte';
|
|
12
13
|
let jsonViewerDrawer;
|
|
13
14
|
let app = undefined;
|
|
14
15
|
let rawType = 'yaml';
|
|
@@ -18,6 +19,8 @@ export function open(app_l) {
|
|
|
18
19
|
}
|
|
19
20
|
</script>
|
|
20
21
|
|
|
22
|
+
<HighlightTheme />
|
|
23
|
+
|
|
21
24
|
<Drawer bind:this={jsonViewerDrawer} size="800px">
|
|
22
25
|
<DrawerContent title="App Export" on:close={() => jsonViewerDrawer.toggleDrawer()}>
|
|
23
26
|
<div>
|
|
@@ -3,6 +3,7 @@ import { Highlight } from 'svelte-highlight';
|
|
|
3
3
|
import css from 'svelte-highlight/languages/css';
|
|
4
4
|
import { resolveTheme } from './themeUtils';
|
|
5
5
|
import { workspaceStore } from '../../../../stores';
|
|
6
|
+
import HighlightTheme from '../../../HighlightTheme.svelte';
|
|
6
7
|
export let theme;
|
|
7
8
|
let code = undefined;
|
|
8
9
|
let codeDrawer;
|
|
@@ -12,6 +13,8 @@ export async function openDrawer() {
|
|
|
12
13
|
}
|
|
13
14
|
</script>
|
|
14
15
|
|
|
16
|
+
<HighlightTheme />
|
|
17
|
+
|
|
15
18
|
<Drawer bind:this={codeDrawer}>
|
|
16
19
|
<DrawerContent title="Theme viewer" on:close={codeDrawer.closeDrawer}>
|
|
17
20
|
<div class="p-2 border rounded-sm">
|
|
@@ -10,6 +10,7 @@ import { MoveRight } from 'lucide-svelte';
|
|
|
10
10
|
import { customisationByComponent } from '../componentsPanel/cssUtils';
|
|
11
11
|
import { sendUserToast } from '../../../../toast';
|
|
12
12
|
import CloseButton from '../../../common/CloseButton.svelte';
|
|
13
|
+
import HighlightTheme from '../../../HighlightTheme.svelte';
|
|
13
14
|
export let component;
|
|
14
15
|
const { app } = getContext('AppViewerContext');
|
|
15
16
|
function fadeFast(node) {
|
|
@@ -94,6 +95,8 @@ function hasStyles(customCss) {
|
|
|
94
95
|
let type = component?.type;
|
|
95
96
|
</script>
|
|
96
97
|
|
|
98
|
+
<HighlightTheme />
|
|
99
|
+
|
|
97
100
|
{#if migrationModalOpen}
|
|
98
101
|
<div
|
|
99
102
|
transition:fadeFast|local
|
|
@@ -4,11 +4,14 @@ import { getComponentControl } from '../componentsPanel/componentControlUtils';
|
|
|
4
4
|
import { Highlight } from 'svelte-highlight';
|
|
5
5
|
import typescript from 'svelte-highlight/languages/typescript';
|
|
6
6
|
import { Button } from '../../../common';
|
|
7
|
+
import HighlightTheme from '../../../HighlightTheme.svelte';
|
|
7
8
|
export let type;
|
|
8
9
|
const componentControls = getComponentControl(type);
|
|
9
10
|
let collapsed = true;
|
|
10
11
|
</script>
|
|
11
12
|
|
|
13
|
+
<HighlightTheme />
|
|
14
|
+
|
|
12
15
|
{#if componentControls?.length > 0}
|
|
13
16
|
<PanelSection title="Controls">
|
|
14
17
|
<div slot="action" class="flex justify-end flex-wrap gap-1">
|
|
@@ -6,6 +6,7 @@ import { yaml } from 'svelte-highlight/languages';
|
|
|
6
6
|
import json from 'svelte-highlight/languages/json';
|
|
7
7
|
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
|
8
8
|
import YAML from 'yaml';
|
|
9
|
+
import HighlightTheme from '../HighlightTheme.svelte';
|
|
9
10
|
export let triggerSelected = 'webhooks';
|
|
10
11
|
export let flow_json = undefined;
|
|
11
12
|
export let hasStepDetails = false;
|
|
@@ -19,6 +20,8 @@ $: if (hasStepDetails) {
|
|
|
19
20
|
$: !hasStepDetails && selected === 'flow_step' && (selected = 'saved_inputs');
|
|
20
21
|
</script>
|
|
21
22
|
|
|
23
|
+
<HighlightTheme />
|
|
24
|
+
|
|
22
25
|
<Splitpanes horizontal class="h-full">
|
|
23
26
|
<Pane size={100}>
|
|
24
27
|
<Tabs bind:selected>
|
|
@@ -12,6 +12,7 @@ import { Highlight } from 'svelte-highlight';
|
|
|
12
12
|
import { typescript } from 'svelte-highlight/languages';
|
|
13
13
|
import ClipboardPanel from './ClipboardPanel.svelte';
|
|
14
14
|
import { copyToClipboard, generateRandomString } from '../../utils';
|
|
15
|
+
import HighlightTheme from '../HighlightTheme.svelte';
|
|
15
16
|
let userSettings;
|
|
16
17
|
export let webhooks;
|
|
17
18
|
export let token;
|
|
@@ -138,6 +139,8 @@ done`}`;
|
|
|
138
139
|
}
|
|
139
140
|
</script>
|
|
140
141
|
|
|
142
|
+
<HighlightTheme />
|
|
143
|
+
|
|
141
144
|
<UserSettings
|
|
142
145
|
bind:this={userSettings}
|
|
143
146
|
on:tokenCreated={(e) => {
|