windmill-components 1.28.7 → 1.35.1

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.
Files changed (159) hide show
  1. package/common.d.ts +3 -0
  2. package/components/AppConnect.svelte +29 -13
  3. package/components/ArgInput.svelte +25 -14
  4. package/components/ArgInput.svelte.d.ts +4 -0
  5. package/components/CenteredPage.svelte +2 -2
  6. package/components/DisplayResult.svelte +3 -3
  7. package/components/Editor.svelte +70 -78
  8. package/components/Editor.svelte.d.ts +3 -0
  9. package/components/EditorBar.svelte +57 -38
  10. package/components/FlowBuilder.svelte +39 -33
  11. package/components/FlowEditor.svelte +17 -58
  12. package/components/FlowJobResult.svelte +16 -16
  13. package/components/FlowModulesViewer.svelte +97 -0
  14. package/components/FlowModulesViewer.svelte.d.ts +17 -0
  15. package/components/FlowPreview.svelte +46 -66
  16. package/components/FlowPreview.svelte.d.ts +2 -4
  17. package/components/FlowPreviewContent.svelte +59 -44
  18. package/components/FlowPreviewContent.svelte.d.ts +0 -1
  19. package/components/FlowStatusViewer.svelte +104 -204
  20. package/components/FlowStatusViewer.svelte.d.ts +7 -4
  21. package/components/FlowViewer.svelte +60 -156
  22. package/components/FlowViewer.svelte.d.ts +0 -1
  23. package/components/IconedPath.svelte +12 -0
  24. package/components/IconedPath.svelte.d.ts +16 -0
  25. package/components/IconedResourceType.svelte +24 -5
  26. package/components/IconedResourceType.svelte.d.ts +1 -0
  27. package/components/InputTransformForm.svelte +9 -8
  28. package/components/InputTransformForm.svelte.d.ts +1 -1
  29. package/components/InviteGlobalUser.svelte +1 -1
  30. package/components/ItemPicker.svelte +6 -1
  31. package/components/JobStatus.svelte +1 -1
  32. package/components/ModuleStep.svelte +74 -94
  33. package/components/ModuleStep.svelte.d.ts +7 -2
  34. package/components/Multiselect.svelte +1 -1
  35. package/components/Path.svelte +62 -40
  36. package/components/Path.svelte.d.ts +2 -0
  37. package/components/ProgressBar.svelte +31 -0
  38. package/components/ProgressBar.svelte.d.ts +17 -0
  39. package/components/ProgressBarPart.svelte +20 -0
  40. package/components/ProgressBarPart.svelte.d.ts +20 -0
  41. package/components/ResourceEditor.svelte +2 -1
  42. package/components/ResourcePicker.svelte +9 -0
  43. package/components/SchemaForm.svelte +9 -4
  44. package/components/SchemaForm.svelte.d.ts +1 -1
  45. package/components/SchemaModal.svelte +20 -3
  46. package/components/SchemaViewer.svelte +58 -68
  47. package/components/ScriptBuilder.svelte +145 -122
  48. package/components/ScriptBuilder.svelte.d.ts +1 -0
  49. package/components/ScriptEditor.svelte +118 -339
  50. package/components/ScriptEditor.svelte.d.ts +0 -2
  51. package/components/ScriptSchema.svelte +45 -44
  52. package/components/SharedBadge.svelte +8 -3
  53. package/components/VariableEditor.svelte +1 -1
  54. package/components/common/drawer/Drawer.svelte +108 -0
  55. package/components/common/drawer/Drawer.svelte.d.ts +23 -0
  56. package/components/common/drawer/DrawerContent.svelte +19 -0
  57. package/components/common/drawer/DrawerContent.svelte.d.ts +20 -0
  58. package/components/common/menu/Menu.svelte +57 -0
  59. package/components/common/menu/Menu.svelte.d.ts +23 -0
  60. package/components/common/menu/MenuItem.svelte +9 -0
  61. package/components/common/menu/MenuItem.svelte.d.ts +27 -0
  62. package/components/common/tabs/Tab.svelte +17 -0
  63. package/components/common/tabs/Tab.svelte.d.ts +18 -0
  64. package/components/common/tabs/TabContent.svelte +12 -0
  65. package/components/common/tabs/TabContent.svelte.d.ts +19 -0
  66. package/components/common/tabs/Tabs.svelte +20 -0
  67. package/components/common/tabs/Tabs.svelte.d.ts +24 -0
  68. package/components/flows/CopyFirstStepSchema.svelte +4 -3
  69. package/components/flows/DynamicInputHelpBox.svelte +6 -4
  70. package/components/flows/DynamicInputHelpBox.svelte.d.ts +1 -1
  71. package/components/flows/FlowBox.svelte +15 -2
  72. package/components/flows/FlowBox.svelte.d.ts +14 -14
  73. package/components/flows/FlowBoxHeader.svelte +10 -3
  74. package/components/flows/FlowBoxHeader.svelte.d.ts +3 -0
  75. package/components/flows/FlowInput.svelte +14 -12
  76. package/components/flows/FlowInputs.svelte +55 -35
  77. package/components/flows/FlowInputs.svelte.d.ts +3 -1
  78. package/components/flows/FlowModuleHeader.svelte +69 -54
  79. package/components/flows/FlowModuleHeader.svelte.d.ts +6 -6
  80. package/components/flows/FlowSettings.svelte +72 -91
  81. package/components/flows/FlowSettings.svelte.d.ts +0 -1
  82. package/components/flows/FlowTimeline.svelte +169 -0
  83. package/components/flows/FlowTimeline.svelte.d.ts +21 -0
  84. package/components/flows/flowState.d.ts +14 -0
  85. package/components/flows/flowState.js +52 -0
  86. package/components/flows/flowStateUtils.d.ts +37 -0
  87. package/components/flows/flowStateUtils.js +220 -0
  88. package/components/flows/flowStore.d.ts +1 -16
  89. package/components/flows/flowStore.js +26 -203
  90. package/components/flows/pickers/FlowScriptPicker.svelte +5 -9
  91. package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +0 -1
  92. package/components/flows/pickers/PickHubScript.svelte +1 -1
  93. package/components/flows/pickers/PickHubScript.svelte.d.ts +1 -1
  94. package/components/flows/pickers/PickScript.svelte +1 -1
  95. package/components/flows/pickers/PickScript.svelte.d.ts +1 -1
  96. package/components/flows/scheduleUtils.d.ts +7 -0
  97. package/components/flows/scheduleUtils.js +21 -0
  98. package/components/flows/stepOpenedStore.d.ts +1 -0
  99. package/components/flows/stepOpenedStore.js +6 -0
  100. package/components/flows/utils.d.ts +6 -13
  101. package/components/flows/utils.js +47 -119
  102. package/components/icons/DiscordIcon.svelte +16 -0
  103. package/components/icons/DiscordIcon.svelte.d.ts +17 -0
  104. package/components/icons/GithubIcon.svelte +17 -0
  105. package/components/icons/GithubIcon.svelte.d.ts +17 -0
  106. package/components/icons/HttpIcon.svelte +21 -0
  107. package/components/icons/HttpIcon.svelte.d.ts +17 -0
  108. package/components/icons/MastodonIcon.svelte +16 -0
  109. package/components/icons/MastodonIcon.svelte.d.ts +17 -0
  110. package/components/icons/MatrixIcon.svelte +16 -0
  111. package/components/icons/MatrixIcon.svelte.d.ts +17 -0
  112. package/components/icons/S3Icon.svelte +16 -0
  113. package/components/icons/S3Icon.svelte.d.ts +17 -0
  114. package/components/icons/WindmillIcon.svelte +68 -0
  115. package/components/icons/WindmillIcon.svelte.d.ts +17 -0
  116. package/components/jobs/JobDetail.svelte +176 -0
  117. package/components/jobs/JobDetail.svelte.d.ts +17 -0
  118. package/components/landing/FlowGettingStarted.svelte +95 -0
  119. package/components/landing/FlowGettingStarted.svelte.d.ts +19 -0
  120. package/components/landing/FlowLandingBox.svelte +69 -0
  121. package/components/landing/FlowLandingBox.svelte.d.ts +17 -0
  122. package/components/landing/RessourceGettingStarted.svelte +51 -0
  123. package/components/landing/RessourceGettingStarted.svelte.d.ts +19 -0
  124. package/components/landing/ScriptBox.svelte +81 -0
  125. package/components/landing/ScriptBox.svelte.d.ts +17 -0
  126. package/components/landing/ScriptGettingStarted.svelte +93 -0
  127. package/components/landing/ScriptGettingStarted.svelte.d.ts +19 -0
  128. package/components/preview/FlowPreviewStatus.svelte +28 -0
  129. package/components/preview/FlowPreviewStatus.svelte.d.ts +17 -0
  130. package/components/propertyPicker/ObjectViewer.svelte +13 -13
  131. package/components/propertyPicker/utils.js +3 -2
  132. package/components/script_editor/LogPanel.svelte +172 -0
  133. package/components/script_editor/LogPanel.svelte.d.ts +22 -0
  134. package/components/sidebar/MenuLink.svelte +49 -0
  135. package/components/sidebar/MenuLink.svelte.d.ts +21 -0
  136. package/components/sidebar/SidebarContent.svelte +55 -0
  137. package/components/sidebar/SidebarContent.svelte.d.ts +16 -0
  138. package/components/sidebar/UserMenu.svelte +62 -0
  139. package/components/sidebar/UserMenu.svelte.d.ts +16 -0
  140. package/components/sidebar/WorkspaceMenu.svelte +66 -0
  141. package/components/sidebar/WorkspaceMenu.svelte.d.ts +16 -0
  142. package/gen/core/OpenAPI.js +1 -1
  143. package/gen/core/request.js +1 -0
  144. package/gen/models/FlowModule.d.ts +5 -3
  145. package/gen/models/ForloopFlow.d.ts +2 -2
  146. package/gen/models/MainArgSignature.d.ts +14 -3
  147. package/gen/services/JobService.d.ts +10 -2
  148. package/gen/services/JobService.js +4 -2
  149. package/gen/services/ScriptService.d.ts +22 -6
  150. package/gen/services/ScriptService.js +32 -2
  151. package/infer.js +47 -24
  152. package/logout.js +1 -1
  153. package/package.json +58 -23
  154. package/script_helpers.d.ts +4 -1
  155. package/script_helpers.js +68 -17
  156. package/stores.d.ts +0 -2
  157. package/stores.js +0 -4
  158. package/utils.d.ts +5 -2
  159. package/utils.js +36 -5
@@ -2,77 +2,67 @@
2
2
  import Highlight from 'svelte-highlight';
3
3
  import json from 'svelte-highlight/languages/json';
4
4
  import TableCustom from './TableCustom.svelte';
5
+ import Tab from './common/tabs/Tab.svelte';
6
+ import TabContent from './common/tabs/TabContent.svelte';
7
+ import Tabs from './common/tabs/Tabs.svelte';
5
8
  export let schema = emptySchema();
6
- let viewJsonSchema = false;
7
9
  </script>
8
10
 
9
11
  <div class="w-full">
10
- <div class="flex flex-col sm:flex-row text-base">
11
- <button
12
- class="text-xs sm:text-base py-1 px-6 block hover:text-blue-500 focus:outline-noneborder-gray-200 {viewJsonSchema
13
- ? 'text-gray-500 '
14
- : 'text-gray-700 font-semibold '}"
15
- on:click={() => (viewJsonSchema = false)}
16
- >
17
- arguments
18
- </button><button
19
- class="py-1 px-6 block hover:text-blue-500 focus:outline-none border-gray-200 {viewJsonSchema
20
- ? 'text-gray-700 font-semibold '
21
- : 'text-gray-500'}"
22
- on:click={() => (viewJsonSchema = true)}
23
- >
24
- advanced
25
- </button>
26
- </div>
27
- </div>
28
- <!--json schema or table view-->
29
- <div class="border-t py-1">
30
- <div class={viewJsonSchema ? 'hidden' : ''}>
31
- {#if schema && schema.properties && Object.keys(schema.properties).length > 0 && schema.required}
32
- <div class="flex flex-row">
33
- <TableCustom>
34
- <tr slot="header-row" class="underline">
35
- <th>name</th>
36
- <th>type</th>
37
- <th>description</th>
38
- <th>default</th>
39
- <th>format</th>
40
- <th>required</th>
41
- </tr>
42
- <tbody slot="body">
43
- {#each Object.entries(schema.properties) as [name, property] (name)}
44
- <tr>
45
- <td>{name}</td>
46
- <td
47
- >{#if !property.type} any {:else} {property.type} {/if}</td
48
- >
49
- <td>{property.description}</td>
50
- <td
51
- >{property.default == '<function call>'
52
- ? '<function call>'
53
- : property.default
54
- ? JSON.stringify(property.default)
55
- : ''}</td
56
- >
57
- <td
58
- >{property.format ?? ''}
59
- {property.contentEncoding ? `(encoding: ${property.contentEncoding})` : ''}</td
60
- >
61
- <td
62
- >{#if schema.required.includes(name)}
63
- <span class="text-red-600 font-bold text-lg">*</span>
64
- {/if}</td
65
- >
12
+ <Tabs selected="arguments">
13
+ <Tab value="arguments">Arguments</Tab>
14
+ <Tab value="advanced">Advanced</Tab>
15
+ <svelte:fragment slot="content">
16
+ <TabContent value="arguments">
17
+ {#if schema && schema.properties && Object.keys(schema.properties).length > 0 && schema.required}
18
+ <div class="flex flex-row">
19
+ <TableCustom>
20
+ <tr slot="header-row" class="underline">
21
+ <th>name</th>
22
+ <th>type</th>
23
+ <th>description</th>
24
+ <th>default</th>
25
+ <th>format</th>
26
+ <th>required</th>
66
27
  </tr>
67
- {/each}
68
- </tbody>
69
- </TableCustom>
70
- </div>
71
- {:else}
72
- <div class="text-gray-700 text-xs italic">This script has no arguments</div>
73
- {/if}
74
- </div>
75
- <div class={viewJsonSchema ? '' : 'hidden'}>
76
- <Highlight language={json} code={JSON.stringify(schema, null, 4)} />
77
- </div>
28
+ <tbody slot="body">
29
+ {#each Object.entries(schema.properties) as [name, property] (name)}
30
+ <tr>
31
+ <td>{name}</td>
32
+ <td
33
+ >{#if !property.type} any {:else} {property.type} {/if}</td
34
+ >
35
+ <td>{property.description}</td>
36
+ <td
37
+ >{property.default == '<function call>'
38
+ ? '<function call>'
39
+ : property.default
40
+ ? JSON.stringify(property.default)
41
+ : ''}</td
42
+ >
43
+ <td
44
+ >{property.format ?? ''}
45
+ {property.contentEncoding
46
+ ? `(encoding: ${property.contentEncoding})`
47
+ : ''}</td
48
+ >
49
+ <td
50
+ >{#if schema.required.includes(name)}
51
+ <span class="text-red-600 font-bold text-lg">*</span>
52
+ {/if}</td
53
+ >
54
+ </tr>
55
+ {/each}
56
+ </tbody>
57
+ </TableCustom>
58
+ </div>
59
+ {:else}
60
+ <div class="text-gray-700 text-xs italic">This script has no arguments</div>
61
+ {/if}
62
+ </TabContent>
63
+ <TabContent value="advanced">
64
+ <Highlight language={json} code={JSON.stringify(schema, null, 4)} />
65
+ </TabContent>
66
+ </svelte:fragment>
67
+ </Tabs>
78
68
  </div>
@@ -2,7 +2,7 @@
2
2
  import { goto } from '$app/navigation';
3
3
  import { page } from '$app/stores';
4
4
  import { inferArgs } from '../infer';
5
- import { DENO_INIT_CODE, DENO_INIT_CODE_TRIGGER, initialCode } from '../script_helpers';
5
+ import { DENO_INIT_CODE, DENO_INIT_CODE_TRIGGER, initialCode, POSTGRES_INIT_CODE } from '../script_helpers';
6
6
  import { workspaceStore } from '../stores';
7
7
  import { emptySchema, encodeState, sendUserToast, setQueryWithoutLoad } from '../utils';
8
8
  import { Breadcrumb, BreadcrumbItem } from 'flowbite-svelte';
@@ -13,23 +13,25 @@ import RadioButton from './RadioButton.svelte';
13
13
  import Required from './Required.svelte';
14
14
  import ScriptEditor from './ScriptEditor.svelte';
15
15
  import ScriptSchema from './ScriptSchema.svelte';
16
+ import CenteredPage from './CenteredPage.svelte';
16
17
  let editor;
17
18
  let scriptSchema;
18
- $: step = Number($page.url.searchParams.get('step')) || 1;
19
19
  export let script;
20
20
  export let initialPath = '';
21
+ export let template = undefined;
21
22
  let pathError = '';
22
23
  $: setQueryWithoutLoad($page.url, 'state', encodeState(script));
24
+ $: step = Number($page.url.searchParams.get('step')) || 1;
23
25
  $: {
24
26
  if (script.language == 'python3') {
25
27
  script.is_trigger = false;
26
28
  }
27
29
  }
28
30
  if (script.content == '') {
29
- initContent(script.language, script.is_trigger);
31
+ initContent(script.language, template);
30
32
  }
31
- function initContent(lang, is_trigger) {
32
- script.content = initialCode(lang, is_trigger);
33
+ function initContent(language, template) {
34
+ script.content = initialCode(language, template == 'pgsql' ? 'pgsql' : script.is_trigger ? 'trigger' : undefined);
33
35
  }
34
36
  async function editScript() {
35
37
  try {
@@ -81,11 +83,11 @@ onDestroy(() => {
81
83
  });
82
84
  </script>
83
85
 
84
- <div class="flex flex-col h-screen max-w-screen-lg xl:-ml-20 xl:pl-4 w-full -mt-4 pt-4 md:mx-10 ">
86
+ <div class="flex flex-col h-screen">
85
87
  <!-- Nav between steps-->
86
- <div class="flex flex-col w-full">
87
- <div class="justify-between flex flex-row drop-shadow-sm w-full mt-4">
88
- <div class="wizard-nav flex flex-row w-full">
88
+ <div class="flex flex-col w-full px-4 py-2 border-b shadow-sm">
89
+ <div class="justify-between flex flex-row drop-shadow-sm w-full">
90
+ <div class="flex flex-row w-full">
89
91
  <Breadcrumb>
90
92
  <BreadcrumbItem>
91
93
  <button on:click={() => changeStep(1)} class={step === 1 ? 'font-bold' : null}>
@@ -119,68 +121,92 @@ onDestroy(() => {
119
121
  class="default-button px-6 max-h-8"
120
122
  on:click={() => {
121
123
  changeStep(step + 1)
122
- }}>Next</button
124
+ }}
123
125
  >
124
- {#if step == 2}
125
- <button
126
- class="default-button-secondary px-6 max-h-8 mr-2"
127
- on:click={async () => {
128
- await inferSchema()
129
- editScript()
130
- }}>Save (commit)</button
131
- >
132
- {/if}
126
+ Next
127
+ </button>
133
128
  {:else}
134
- <button class="default-button px-6 self-end" on:click={editScript}>Save (commit)</button>
129
+ <button class="default-button px-6 self-end" on:click={editScript}>Save</button>
130
+ {/if}
131
+ {#if step > 1}
132
+ <button
133
+ class="default-button-secondary px-6 max-h-8 mr-2"
134
+ on:click={async () => {
135
+ changeStep(step - 1)
136
+ }}
137
+ >
138
+ Back
139
+ </button>
140
+ {/if}
141
+ {#if step == 2}
142
+ <button
143
+ class="default-button-secondary px-6 max-h-8 mr-2"
144
+ on:click={async () => {
145
+ await inferSchema()
146
+ editScript()
147
+ }}
148
+ >
149
+ Save (commit)
150
+ </button>
135
151
  {/if}
136
152
  </div>
137
153
  </div>
138
- <div class="flex flex-row-reverse">
139
- <span class="my-1 text-sm text-gray-500 italic">
140
- {#if script.hash != ''} Editing from {script.hash} with path{/if}
141
- {#if initialPath && initialPath != script.path} {initialPath} &rightarrow; {/if}
142
- {script.path}
143
- </span>
144
- </div>
145
154
  </div>
146
155
 
147
156
  <!-- metadata -->
148
157
  {#if step === 1}
149
- <div class="grid grid-cols-1 gap-6 max-w-7xl">
150
- <Path
151
- bind:error={pathError}
152
- bind:path={script.path}
153
- {initialPath}
154
- namePlaceholder="example/my/script"
155
- kind="script"
156
- >
157
- <div slot="ownerToolkit">
158
- Script permissions depend on their path. Select the group <span class="font-mono"
159
- >all</span
160
- >
161
- to share your script, and <span class="font-mono">user</span> to keep it private.
162
- <a href="https://docs.windmill.dev/docs/reference/namespaces">docs</a>
158
+ <CenteredPage>
159
+ <div class="space-y-6">
160
+ <Path
161
+ bind:error={pathError}
162
+ bind:path={script.path}
163
+ {initialPath}
164
+ on:enter={() => changeStep(2)}
165
+ namePlaceholder="my_script"
166
+ kind="script"
167
+ >
168
+ <div slot="ownerToolkit">
169
+ Script permissions depend on their path. Select the group
170
+ <span class="font-mono"> all </span>
171
+ to share your script, and <span class="font-mono">user</span> to keep it private.
172
+ <a href="https://docs.windmill.dev/docs/reference/namespaces">docs</a>
173
+ </div>
174
+ </Path>
175
+ <h3 class="text-gray-700 border-b">Language</h3>
176
+ <div class="max-w-md">
177
+ <RadioButton
178
+ label="Language"
179
+ options={[
180
+ ['Typescript (Deno)', 'deno'],
181
+ ['Python 3.10', 'python3']
182
+ ]}
183
+ on:change={(e) => initContent(e.detail, template)}
184
+ bind:value={script.language}
185
+ />
163
186
  </div>
164
- </Path>
165
- <h3 class="text-gray-700 pb-1 border-b">Language</h3>
166
- <div class="max-w-md">
167
- <RadioButton
168
- label="Language"
169
- options={[
170
- ['Typescript (Deno)', 'deno'],
171
- ['Python 3.10', 'python3']
172
- ]}
173
- on:change={(e) => initContent(e.detail, script.is_trigger)}
174
- bind:value={script.language}
175
- />
176
- </div>
177
- <h3 class="text-gray-700 pb-1 border-b">Metadata</h3>
187
+ {#if script.language == 'deno'}
188
+ <h4 class="text-gray-700 border-b">Template</h4>
189
+
190
+ <div class="max-w-md">
191
+ <RadioButton
192
+ label="Template"
193
+ options={[
194
+ ['None', undefined],
195
+ ['PostgreSQL', 'pgsql']
196
+ ]}
197
+ on:change={(e) => initContent(script.language, e.detail)}
198
+ bind:value={template}
199
+ />
200
+ </div>
201
+ {/if}
202
+
203
+ <h3 class="text-gray-700 pb-1 border-b">Metadata</h3>
178
204
 
179
- <label class="block ">
180
- <span class="text-gray-700">Summary <Required required={false} /></span>
181
- <textarea
182
- bind:value={script.summary}
183
- class="
205
+ <label class="block ">
206
+ <span class="text-gray-700">Summary <Required required={false} /></span>
207
+ <textarea
208
+ bind:value={script.summary}
209
+ class="
184
210
  mt-1
185
211
  block
186
212
  w-full
@@ -189,17 +215,17 @@ onDestroy(() => {
189
215
  shadow-sm
190
216
  focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
191
217
  "
192
- placeholder="A very short summary of the script displayed when the script is listed"
193
- rows="1"
194
- />
195
- </label>
196
- <label class="block" for="inp">
197
- <span class="text-gray-700"
198
- >Description<Required required={false} detail="accept markdown formatting" />
199
- <textarea
200
- id="inp"
201
- bind:value={script.description}
202
- class="
218
+ placeholder="A very short summary of the script displayed when the script is listed"
219
+ rows="1"
220
+ />
221
+ </label>
222
+ <label class="block" for="inp">
223
+ <span class="text-gray-700"
224
+ >Description<Required required={false} detail="accept markdown formatting" />
225
+ <textarea
226
+ id="inp"
227
+ bind:value={script.description}
228
+ class="
203
229
  mt-1
204
230
  block
205
231
  w-full
@@ -208,64 +234,61 @@ onDestroy(() => {
208
234
  shadow-sm
209
235
  focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
210
236
  "
211
- placeholder="A description to help users understand what this script does and how to use it."
212
- rows="3"
213
- />
214
- </span></label
215
- >
237
+ placeholder="A description to help users understand what this script does and how to use it."
238
+ rows="3"
239
+ />
240
+ </span>
241
+ </label>
216
242
 
217
- <label class="block">
218
- <span class="text-gray-700 mr-2">Save as template</span>
219
- <input type="checkbox" bind:checked={script.is_template} />
220
- </label>
243
+ <label class="block">
244
+ <span class="text-gray-700 mr-2">Save as template</span>
245
+ <input type="checkbox" bind:checked={script.is_template} />
246
+ </label>
221
247
 
222
- <label class="block">
223
- <span class="text-gray-700 mr-2">Save as trigger script</span>
224
- <input
225
- disabled={script.language == 'python3'}
226
- type="checkbox"
227
- bind:checked={script.is_trigger}
228
- on:change={() => {
229
- if (script.content == DENO_INIT_CODE || script.content == DENO_INIT_CODE_TRIGGER) {
230
- initContent(script.language, script.is_trigger)
231
- }
232
- }}
233
- />
234
- </label>
248
+ <label class="block">
249
+ <span class="text-gray-700 mr-2">Save as trigger script</span>
250
+ <input
251
+ disabled={script.language == 'python3'}
252
+ type="checkbox"
253
+ bind:checked={script.is_trigger}
254
+ on:change={() => {
255
+ if (
256
+ script.content == DENO_INIT_CODE ||
257
+ script.content == DENO_INIT_CODE_TRIGGER ||
258
+ script.content == POSTGRES_INIT_CODE
259
+ ) {
260
+ initContent(script.language, template)
261
+ }
262
+ }}
263
+ />
264
+ </label>
235
265
 
236
- <div>
237
- <h3 class="text-gray-700 ">Description rendered</h3>
238
- <div
239
- class="prose mt-5 text-xs shadow-inner shadow-blue p-4 overflow-auto"
240
- style="max-height: 200px;"
241
- >
242
- <SvelteMarkdown source={script.description ?? ''} />
266
+ <div>
267
+ <h3 class="text-gray-700 ">Description rendered</h3>
268
+ <div
269
+ class="prose mt-5 text-xs shadow-inner shadow-blue p-4 overflow-auto"
270
+ style="max-height: 200px;"
271
+ >
272
+ <SvelteMarkdown source={script.description ?? ''} />
273
+ </div>
243
274
  </div>
244
275
  </div>
245
- </div>
276
+ </CenteredPage>
246
277
  {:else if step === 2}
247
- <div class="flex-1 overflow-auto">
248
- <ScriptEditor
249
- bind:this={editor}
250
- bind:schema={script.schema}
251
- path={script.path}
252
- bind:code={script.content}
253
- lang={script.language}
254
- />
255
- </div>
256
- {:else if step === 3}
257
- <ScriptSchema
258
- bind:summary={script.summary}
259
- bind:description={script.description}
278
+ <ScriptEditor
279
+ bind:this={editor}
260
280
  bind:schema={script.schema}
281
+ path={script.path}
282
+ bind:code={script.content}
283
+ lang={script.language}
261
284
  />
285
+ {:else if step === 3}
286
+ <CenteredPage>
287
+ <ScriptSchema
288
+ bind:summary={script.summary}
289
+ bind:description={script.description}
290
+ bind:schema={script.schema}
291
+ />
292
+ </CenteredPage>
262
293
  {/if}
263
294
  </div>
264
-
265
- <style>
266
- /* .wizard-nav {
267
- @apply w-1/2 sm:w-1/4;
268
- } */
269
- .wizard-nav button {
270
- max-height: 30px;
271
- }</style>
@@ -4,6 +4,7 @@ declare const __propDef: {
4
4
  props: {
5
5
  script: Script;
6
6
  initialPath?: string | undefined;
7
+ template?: 'pgsql' | undefined;
7
8
  setCode?: ((script: Script) => void) | undefined;
8
9
  };
9
10
  events: {