windmill-components 1.55.1 → 1.55.2
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/common.d.ts +1 -1
- package/common.js +3 -0
- package/components/AppConnect.svelte +2 -2
- package/components/ArgInput.svelte +1 -1
- package/components/CronInput.svelte +54 -53
- package/components/Dropdown.svelte +21 -9
- package/components/Editor.svelte +10 -10
- package/components/EditorBar.svelte +2 -2
- package/components/FlowBuilder.svelte +41 -25
- package/components/FlowGraphViewer.svelte +6 -2
- package/components/FlowMetadata.svelte +8 -3
- package/components/FolderEditor.svelte +299 -0
- package/components/FolderEditor.svelte.d.ts +16 -0
- package/components/FolderInfo.svelte +13 -0
- package/components/FolderInfo.svelte.d.ts +16 -0
- package/components/FolderUsageInfo.svelte +17 -0
- package/components/FolderUsageInfo.svelte.d.ts +16 -0
- package/components/GroupEditor.svelte +287 -0
- package/components/GroupEditor.svelte.d.ts +18 -0
- package/components/GroupInfo.svelte +22 -0
- package/components/GroupInfo.svelte.d.ts +16 -0
- package/components/InputTransformForm.svelte +16 -7
- package/components/MoveDrawer.svelte +75 -0
- package/components/MoveDrawer.svelte.d.ts +19 -0
- package/components/Path.svelte +243 -96
- package/components/Path.svelte.d.ts +1 -4
- package/components/RadioButton.svelte +2 -0
- package/components/RadioButton.svelte.d.ts +1 -0
- package/components/ResourceEditor.svelte +11 -16
- package/components/RunForm.svelte +20 -3
- package/components/RunForm.svelte.d.ts +1 -1
- package/components/ScheduleEditor.svelte +226 -0
- package/components/ScheduleEditor.svelte.d.ts +26 -0
- package/components/ScriptBuilder.svelte +109 -114
- package/components/ScriptEditor.svelte +17 -14
- package/components/ScriptEditor.svelte.d.ts +1 -0
- package/components/ScriptPicker.svelte +55 -29
- package/components/ScriptPicker.svelte.d.ts +1 -0
- package/components/ShareModal.svelte +94 -73
- package/components/ShareModal.svelte.d.ts +2 -4
- package/components/SimpleEditor.svelte +15 -10
- package/components/TemplateEditor.svelte +496 -0
- package/components/TemplateEditor.svelte.d.ts +25 -0
- package/components/TestJobLoader.svelte +1 -1
- package/components/VariableEditor.svelte +2 -1
- package/components/apps/CreateApp.svelte +1 -1
- package/components/apps/components/buttons/AppButton.svelte +3 -3
- package/components/apps/components/dataDisplay/AppBarChart.svelte +5 -4
- package/components/apps/components/dataDisplay/AppPieChart.svelte +3 -3
- package/components/apps/components/dateInputs/AppDateInput.svelte +34 -0
- package/components/apps/components/dateInputs/AppDateInput.svelte.d.ts +22 -0
- package/components/apps/components/form/AppForm.svelte +4 -5
- package/components/apps/components/form/AppForm.svelte.d.ts +0 -1
- package/components/apps/components/helpers/AlignWrapper.svelte +3 -4
- package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +2 -3
- package/components/apps/components/helpers/InputValue.svelte +54 -5
- package/components/apps/components/helpers/InputValue.svelte.d.ts +1 -0
- package/components/apps/components/helpers/NonRunnableComponent.svelte +2 -1
- package/components/apps/components/helpers/RefreshButton.svelte +20 -0
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +16 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +38 -42
- package/components/apps/components/helpers/RunnableWrapper.svelte +6 -3
- package/components/apps/components/numberInputs/AppNumberInput.svelte +8 -11
- package/components/apps/components/numberInputs/AppNumberInput.svelte.d.ts +1 -0
- package/components/apps/components/selectInputs/AppCheckbox.svelte +1 -1
- package/components/apps/components/selectInputs/AppSelect.svelte +26 -0
- package/components/apps/components/selectInputs/AppSelect.svelte.d.ts +22 -0
- package/components/apps/components/table/AppTable.svelte +159 -0
- package/components/apps/components/{dataDisplay → table}/AppTable.svelte.d.ts +0 -0
- package/components/apps/components/table/AppTableFooter.svelte +54 -0
- package/components/apps/components/table/AppTableFooter.svelte.d.ts +20 -0
- package/components/apps/components/table/tableOptions.d.ts +10 -0
- package/components/apps/components/table/tableOptions.js +11 -0
- package/components/apps/components/textInputs/AppTextInput.svelte +17 -10
- package/components/apps/components/textInputs/AppTextInput.svelte.d.ts +2 -0
- package/components/apps/editor/AppEditor.svelte +35 -20
- package/components/apps/editor/AppEditorHeader.svelte +15 -7
- package/components/apps/editor/AppPreview.svelte +5 -3
- package/components/apps/editor/AppPreview.svelte.d.ts +4 -1
- package/components/apps/editor/ComponentEditor.svelte +21 -3
- package/components/apps/editor/ComponentEditor.svelte.d.ts +2 -0
- package/components/apps/editor/ComponentHeader.svelte +21 -4
- package/components/apps/editor/ComponentHeader.svelte.d.ts +2 -0
- package/components/apps/editor/GridEditor.svelte +40 -20
- package/components/apps/editor/RecomputeAllComponents.svelte +5 -7
- package/components/apps/editor/componentsPanel/ComponentList.svelte +30 -82
- package/components/apps/editor/componentsPanel/data.js +78 -29
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +5 -1
- package/components/apps/editor/contextPanel/ContextPanel.svelte +35 -152
- package/components/apps/editor/contextPanel/ContextPanel.svelte.d.ts +1 -3
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +64 -0
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +18 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +95 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +20 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +32 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte.d.ts +19 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +63 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +17 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +44 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte.d.ts +14 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +126 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte.d.ts +16 -0
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +41 -0
- package/components/apps/editor/settingsPanel/AlignmentEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +44 -0
- package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte.d.ts +18 -0
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +48 -130
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +3 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -2
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/Recompute.svelte +2 -2
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +46 -0
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -1
- package/components/apps/editor/settingsPanel/{ConnectedInputEditor.svelte → inputEditor/ConnectedInputEditor.svelte} +1 -2
- package/components/apps/editor/settingsPanel/{ConnectedInputEditor.svelte.d.ts → inputEditor/ConnectedInputEditor.svelte.d.ts} +1 -1
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +12 -0
- package/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/{StaticInputEditor.svelte → inputEditor/StaticInputEditor.svelte} +5 -5
- package/components/apps/editor/settingsPanel/{StaticInputEditor.svelte.d.ts → inputEditor/StaticInputEditor.svelte.d.ts} +1 -1
- package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +6 -3
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +66 -22
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +2 -3
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte +1 -1
- package/components/apps/gridUtils.d.ts +3 -1
- package/components/apps/gridUtils.js +16 -1
- package/components/apps/inputType.d.ts +10 -4
- package/components/apps/rx.d.ts +8 -8
- package/components/apps/rx.js +17 -9
- package/components/apps/types.d.ts +14 -2
- package/components/apps/utils.d.ts +4 -3
- package/components/apps/utils.js +37 -5
- package/components/common/drawer/Drawer.svelte +1 -1
- package/components/common/drawer/Drawer.svelte.d.ts +1 -0
- package/components/common/table/FlowRow.svelte +21 -7
- package/components/common/table/FlowRow.svelte.d.ts +2 -0
- package/components/common/table/ScriptRow.svelte +22 -7
- package/components/common/table/ScriptRow.svelte.d.ts +2 -0
- package/components/common/toggleButton/ToggleButton.svelte +1 -1
- package/components/common/toggleButton/ToggleButtonGroup.svelte +1 -1
- package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +1 -0
- package/components/flows/content/FlowEditorPanel.svelte +10 -16
- package/components/flows/content/FlowInputs.svelte +18 -4
- package/components/flows/content/FlowInputs.svelte.d.ts +1 -0
- package/components/flows/content/FlowModuleComponent.svelte +1 -1
- package/components/flows/content/FlowModuleWrapper.svelte +26 -1
- package/components/flows/content/FlowSchedules.svelte +5 -0
- package/components/flows/content/FlowSettings.svelte +13 -23
- package/components/flows/content/FlowSettings.svelte.d.ts +0 -1
- package/components/flows/header/FlowPreviewButtons.svelte +1 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte +1 -1
- package/components/flows/map/FlowModuleSchemaMap.svelte +12 -3
- package/components/flows/map/FlowSettingsItem.svelte +8 -15
- package/components/flows/map/InsertModuleButton.svelte +29 -2
- package/components/flows/map/InsertModuleButton.svelte.d.ts +3 -1
- package/components/flows/map/MapItem.svelte +2 -1
- package/components/flows/map/MapItem.svelte.d.ts +1 -0
- package/components/flows/pickers/WorkspaceScriptPicker.svelte +3 -0
- package/components/flows/previousResults.js +1 -1
- package/components/graph/FlowGraph.svelte +13 -13
- package/components/home/ItemsList.svelte +20 -12
- package/components/jobs/JobDetail.svelte +9 -3
- package/components/sidebar/SidebarContent.svelte +4 -3
- package/components/sidebar/UserMenu.svelte +1 -1
- package/editorUtils.d.ts +7 -1
- package/editorUtils.js +98 -3
- package/es5.d.ts.txt +4526 -0
- package/gen/index.d.ts +2 -0
- package/gen/index.js +1 -0
- package/gen/models/CompletedJob.d.ts +1 -0
- package/gen/models/EditSchedule.d.ts +0 -2
- package/gen/models/Folder.d.ts +5 -0
- package/gen/models/Folder.js +4 -0
- package/gen/models/QueuedJob.d.ts +1 -0
- package/gen/models/Script.d.ts +1 -1
- package/gen/models/User.d.ts +1 -0
- package/gen/services/FolderService.d.ts +128 -0
- package/gen/services/FolderService.js +151 -0
- package/gen/services/GranularAclService.d.ts +3 -3
- package/gen/services/GroupService.d.ts +5 -1
- package/gen/services/GroupService.js +4 -1
- package/gen/services/JobService.d.ts +25 -5
- package/gen/services/JobService.js +10 -5
- package/gen/services/ScriptService.d.ts +2 -1
- package/gen/services/UserService.d.ts +9 -0
- package/gen/services/UserService.js +15 -0
- package/package.json +33 -9
- package/script_helpers.d.ts +2 -2
- package/script_helpers.js +4 -4
- package/stores.d.ts +1 -0
- package/utils.d.ts +3 -0
- package/utils.js +44 -7
- package/components/GroupModal.svelte +0 -98
- package/components/GroupModal.svelte.d.ts +0 -17
- package/components/apps/components/dataDisplay/AppTable.svelte +0 -132
- package/components/apps/components/dataDisplay/app.md +0 -49
- package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte +0 -29
- package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte.d.ts +0 -16
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
<script context="module">import * as monaco from 'monaco-editor';
|
|
2
|
+
import libStdContent from '../es5.d.ts.txt?raw';
|
|
3
|
+
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
|
|
4
|
+
target: monaco.languages.typescript.ScriptTarget.Latest,
|
|
5
|
+
allowNonTsExtensions: true,
|
|
6
|
+
noLib: true
|
|
7
|
+
});
|
|
8
|
+
monaco.languages.register({ id: 'template' });
|
|
9
|
+
export const conf = {
|
|
10
|
+
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
|
11
|
+
comments: {
|
|
12
|
+
lineComment: '//',
|
|
13
|
+
blockComment: ['/*', '*/']
|
|
14
|
+
},
|
|
15
|
+
brackets: [
|
|
16
|
+
['{', '}'],
|
|
17
|
+
['[', ']'],
|
|
18
|
+
['(', ')']
|
|
19
|
+
],
|
|
20
|
+
onEnterRules: [],
|
|
21
|
+
autoClosingPairs: [
|
|
22
|
+
{ open: '{', close: '}' },
|
|
23
|
+
{ open: '[', close: ']' },
|
|
24
|
+
{ open: '(', close: ')' },
|
|
25
|
+
{ open: '"', close: '"', notIn: ['string'] },
|
|
26
|
+
{ open: "'", close: "'", notIn: ['string', 'comment'] },
|
|
27
|
+
{ open: '`', close: '`', notIn: ['string', 'comment'] }
|
|
28
|
+
],
|
|
29
|
+
folding: {
|
|
30
|
+
markers: {
|
|
31
|
+
start: new RegExp('^\\s*//\\s*#?region\\b'),
|
|
32
|
+
end: new RegExp('^\\s*//\\s*#?endregion\\b')
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export const language = {
|
|
37
|
+
// Set defaultToken to invalid to see what you do not tokenize yet
|
|
38
|
+
defaultToken: 'invalid',
|
|
39
|
+
tokenPostfix: '.ts',
|
|
40
|
+
keywords: [
|
|
41
|
+
// Should match the keys of textToKeywordObj in
|
|
42
|
+
// https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts
|
|
43
|
+
'abstract',
|
|
44
|
+
'any',
|
|
45
|
+
'as',
|
|
46
|
+
'asserts',
|
|
47
|
+
'bigint',
|
|
48
|
+
'boolean',
|
|
49
|
+
'break',
|
|
50
|
+
'case',
|
|
51
|
+
'catch',
|
|
52
|
+
'class',
|
|
53
|
+
'continue',
|
|
54
|
+
'const',
|
|
55
|
+
'constructor',
|
|
56
|
+
'debugger',
|
|
57
|
+
'declare',
|
|
58
|
+
'default',
|
|
59
|
+
'delete',
|
|
60
|
+
'do',
|
|
61
|
+
'else',
|
|
62
|
+
'enum',
|
|
63
|
+
'export',
|
|
64
|
+
'extends',
|
|
65
|
+
'false',
|
|
66
|
+
'finally',
|
|
67
|
+
'for',
|
|
68
|
+
'from',
|
|
69
|
+
'function',
|
|
70
|
+
'get',
|
|
71
|
+
'if',
|
|
72
|
+
'implements',
|
|
73
|
+
'import',
|
|
74
|
+
'in',
|
|
75
|
+
'infer',
|
|
76
|
+
'instanceof',
|
|
77
|
+
'interface',
|
|
78
|
+
'is',
|
|
79
|
+
'keyof',
|
|
80
|
+
'let',
|
|
81
|
+
'module',
|
|
82
|
+
'namespace',
|
|
83
|
+
'never',
|
|
84
|
+
'new',
|
|
85
|
+
'null',
|
|
86
|
+
'number',
|
|
87
|
+
'object',
|
|
88
|
+
'out',
|
|
89
|
+
'package',
|
|
90
|
+
'private',
|
|
91
|
+
'protected',
|
|
92
|
+
'public',
|
|
93
|
+
'override',
|
|
94
|
+
'readonly',
|
|
95
|
+
'require',
|
|
96
|
+
'global',
|
|
97
|
+
'return',
|
|
98
|
+
'set',
|
|
99
|
+
'static',
|
|
100
|
+
'string',
|
|
101
|
+
'super',
|
|
102
|
+
'switch',
|
|
103
|
+
'symbol',
|
|
104
|
+
'this',
|
|
105
|
+
'throw',
|
|
106
|
+
'true',
|
|
107
|
+
'try',
|
|
108
|
+
'type',
|
|
109
|
+
'typeof',
|
|
110
|
+
'undefined',
|
|
111
|
+
'unique',
|
|
112
|
+
'unknown',
|
|
113
|
+
'var',
|
|
114
|
+
'void',
|
|
115
|
+
'while',
|
|
116
|
+
'with',
|
|
117
|
+
'yield',
|
|
118
|
+
'async',
|
|
119
|
+
'await',
|
|
120
|
+
'of'
|
|
121
|
+
],
|
|
122
|
+
operators: [
|
|
123
|
+
'<=',
|
|
124
|
+
'>=',
|
|
125
|
+
'==',
|
|
126
|
+
'!=',
|
|
127
|
+
'===',
|
|
128
|
+
'!==',
|
|
129
|
+
'=>',
|
|
130
|
+
'+',
|
|
131
|
+
'-',
|
|
132
|
+
'**',
|
|
133
|
+
'*',
|
|
134
|
+
'/',
|
|
135
|
+
'%',
|
|
136
|
+
'++',
|
|
137
|
+
'--',
|
|
138
|
+
'<<',
|
|
139
|
+
'</',
|
|
140
|
+
'>>',
|
|
141
|
+
'>>>',
|
|
142
|
+
'&',
|
|
143
|
+
'|',
|
|
144
|
+
'^',
|
|
145
|
+
'!',
|
|
146
|
+
'~',
|
|
147
|
+
'&&',
|
|
148
|
+
'||',
|
|
149
|
+
'??',
|
|
150
|
+
'?',
|
|
151
|
+
':',
|
|
152
|
+
'=',
|
|
153
|
+
'+=',
|
|
154
|
+
'-=',
|
|
155
|
+
'*=',
|
|
156
|
+
'**=',
|
|
157
|
+
'/=',
|
|
158
|
+
'%=',
|
|
159
|
+
'<<=',
|
|
160
|
+
'>>=',
|
|
161
|
+
'>>>=',
|
|
162
|
+
'&=',
|
|
163
|
+
'|=',
|
|
164
|
+
'^=',
|
|
165
|
+
'@'
|
|
166
|
+
],
|
|
167
|
+
// we include these common regular expressions
|
|
168
|
+
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
|
169
|
+
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
|
170
|
+
digits: /\d+(_+\d+)*/,
|
|
171
|
+
octaldigits: /[0-7]+(_+[0-7]+)*/,
|
|
172
|
+
binarydigits: /[0-1]+(_+[0-1]+)*/,
|
|
173
|
+
hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
|
|
174
|
+
regexpctl: /[(){}\[\]\$\^|\-*+?\.]/,
|
|
175
|
+
regexpesc: /\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,
|
|
176
|
+
// The main tokenizer for our languages
|
|
177
|
+
tokenizer: {
|
|
178
|
+
root: [
|
|
179
|
+
[/\$\{/, { token: 'delimiter.bracket', next: '@bracketCounting' }],
|
|
180
|
+
[/[^\\`$]+/, 'string'],
|
|
181
|
+
[/@escapes/, 'string.escape'],
|
|
182
|
+
[/\\./, 'string.escape.invalid']
|
|
183
|
+
],
|
|
184
|
+
common: [
|
|
185
|
+
// identifiers and keywords
|
|
186
|
+
[
|
|
187
|
+
/[a-z_$][\w$]*/,
|
|
188
|
+
{
|
|
189
|
+
cases: {
|
|
190
|
+
'@keywords': 'keyword',
|
|
191
|
+
'@default': 'identifier'
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
[/[A-Z][\w\$]*/, 'type.identifier'],
|
|
196
|
+
// [/[A-Z][\w\$]*/, 'identifier'],
|
|
197
|
+
// whitespace
|
|
198
|
+
{ include: '@whitespace' },
|
|
199
|
+
// regular expression: ensure it is terminated before beginning (otherwise it is an opeator)
|
|
200
|
+
[
|
|
201
|
+
/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,
|
|
202
|
+
{ token: 'regexp', bracket: '@open', next: '@regexp' }
|
|
203
|
+
],
|
|
204
|
+
// delimiters and operators
|
|
205
|
+
[/[()\[\]]/, '@brackets'],
|
|
206
|
+
[/[<>](?!@symbols)/, '@brackets'],
|
|
207
|
+
[/!(?=([^=]|$))/, 'delimiter'],
|
|
208
|
+
[
|
|
209
|
+
/@symbols/,
|
|
210
|
+
{
|
|
211
|
+
cases: {
|
|
212
|
+
'@operators': 'delimiter',
|
|
213
|
+
'@default': ''
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
// numbers
|
|
218
|
+
[/(@digits)[eE]([\-+]?(@digits))?/, 'number.float'],
|
|
219
|
+
[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, 'number.float'],
|
|
220
|
+
[/0[xX](@hexdigits)n?/, 'number.hex'],
|
|
221
|
+
[/0[oO]?(@octaldigits)n?/, 'number.octal'],
|
|
222
|
+
[/0[bB](@binarydigits)n?/, 'number.binary'],
|
|
223
|
+
[/(@digits)n?/, 'number'],
|
|
224
|
+
// delimiter: after number because of .\d floats
|
|
225
|
+
[/[;,.]/, 'delimiter'],
|
|
226
|
+
// strings
|
|
227
|
+
[/"([^"\\]|\\.)*$/, 'string.invalid'],
|
|
228
|
+
[/'([^'\\]|\\.)*$/, 'string.invalid'],
|
|
229
|
+
[/"/, 'string', '@string_double'],
|
|
230
|
+
[/'/, 'string', '@string_single'],
|
|
231
|
+
[/`/, 'string', '@string_backtick']
|
|
232
|
+
],
|
|
233
|
+
whitespace: [
|
|
234
|
+
[/[ \t\r\n]+/, ''],
|
|
235
|
+
[/\/\*\*(?!\/)/, 'comment.doc', '@jsdoc'],
|
|
236
|
+
[/\/\*/, 'comment', '@comment'],
|
|
237
|
+
[/\/\/.*$/, 'comment']
|
|
238
|
+
],
|
|
239
|
+
comment: [
|
|
240
|
+
[/[^\/*]+/, 'comment'],
|
|
241
|
+
[/\*\//, 'comment', '@pop'],
|
|
242
|
+
[/[\/*]/, 'comment']
|
|
243
|
+
],
|
|
244
|
+
jsdoc: [
|
|
245
|
+
[/[^\/*]+/, 'comment.doc'],
|
|
246
|
+
[/\*\//, 'comment.doc', '@pop'],
|
|
247
|
+
[/[\/*]/, 'comment.doc']
|
|
248
|
+
],
|
|
249
|
+
// We match regular expression quite precisely
|
|
250
|
+
regexp: [
|
|
251
|
+
[
|
|
252
|
+
/(\{)(\d+(?:,\d*)?)(\})/,
|
|
253
|
+
['regexp.escape.control', 'regexp.escape.control', 'regexp.escape.control']
|
|
254
|
+
],
|
|
255
|
+
[
|
|
256
|
+
/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,
|
|
257
|
+
['regexp.escape.control', { token: 'regexp.escape.control', next: '@regexrange' }]
|
|
258
|
+
],
|
|
259
|
+
[/(\()(\?:|\?=|\?!)/, ['regexp.escape.control', 'regexp.escape.control']],
|
|
260
|
+
[/[()]/, 'regexp.escape.control'],
|
|
261
|
+
[/@regexpctl/, 'regexp.escape.control'],
|
|
262
|
+
[/[^\\\/]/, 'regexp'],
|
|
263
|
+
[/@regexpesc/, 'regexp.escape'],
|
|
264
|
+
[/\\\./, 'regexp.invalid'],
|
|
265
|
+
[
|
|
266
|
+
/(\/)([dgimsuy]*)/,
|
|
267
|
+
[{ token: 'regexp', bracket: '@close', next: '@pop' }, 'keyword.other']
|
|
268
|
+
]
|
|
269
|
+
],
|
|
270
|
+
regexrange: [
|
|
271
|
+
[/-/, 'regexp.escape.control'],
|
|
272
|
+
[/\^/, 'regexp.invalid'],
|
|
273
|
+
[/@regexpesc/, 'regexp.escape'],
|
|
274
|
+
[/[^\]]/, 'regexp'],
|
|
275
|
+
[
|
|
276
|
+
/\]/,
|
|
277
|
+
{
|
|
278
|
+
token: 'regexp.escape.control',
|
|
279
|
+
next: '@pop',
|
|
280
|
+
bracket: '@close'
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
],
|
|
284
|
+
string_double: [
|
|
285
|
+
[/[^\\"]+/, 'string'],
|
|
286
|
+
[/@escapes/, 'string.escape'],
|
|
287
|
+
[/\\./, 'string.escape.invalid'],
|
|
288
|
+
[/"/, 'string', '@pop']
|
|
289
|
+
],
|
|
290
|
+
string_single: [
|
|
291
|
+
[/[^\\']+/, 'string'],
|
|
292
|
+
[/@escapes/, 'string.escape'],
|
|
293
|
+
[/\\./, 'string.escape.invalid'],
|
|
294
|
+
[/'/, 'string', '@pop']
|
|
295
|
+
],
|
|
296
|
+
string_backtick: [
|
|
297
|
+
[/\$\{/, { token: 'delimiter.bracket', next: '@bracketCounting' }],
|
|
298
|
+
[/[^\\`$]+/, 'string'],
|
|
299
|
+
[/@escapes/, 'string.escape'],
|
|
300
|
+
[/\\./, 'string.escape.invalid'],
|
|
301
|
+
[/`/, 'string', '@pop']
|
|
302
|
+
],
|
|
303
|
+
bracketCounting: [
|
|
304
|
+
[/\{/, 'delimiter.bracket', '@bracketCounting'],
|
|
305
|
+
[/\}/, 'delimiter.bracket', '@pop'],
|
|
306
|
+
{ include: 'common' }
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
// Register a tokens provider for the language
|
|
311
|
+
monaco.languages.registerTokensProviderFactory('template', {
|
|
312
|
+
create: () => language
|
|
313
|
+
});
|
|
314
|
+
monaco.languages.setLanguageConfiguration('template', conf);
|
|
315
|
+
// monaco.languages.typescript.getTypeScriptWorker()
|
|
316
|
+
// Register a completion item provider for the new language
|
|
317
|
+
</script>
|
|
318
|
+
|
|
319
|
+
<script>import { browser, dev } from '$app/env';
|
|
320
|
+
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
321
|
+
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
322
|
+
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
323
|
+
import { convertKind, createDocumentationString, createHash, displayPartsToString, editorConfig, updateOptions } from '../editorUtils';
|
|
324
|
+
let divEl = null;
|
|
325
|
+
let editor;
|
|
326
|
+
let model;
|
|
327
|
+
export let code = '';
|
|
328
|
+
export let hash = createHash();
|
|
329
|
+
export let automaticLayout = true;
|
|
330
|
+
export let extraLib = '';
|
|
331
|
+
export let autoHeight = true;
|
|
332
|
+
export let fixedOverflowWidgets = true;
|
|
333
|
+
const lang = 'template';
|
|
334
|
+
const dispatch = createEventDispatcher();
|
|
335
|
+
const uri = `file:///${hash}.ts`;
|
|
336
|
+
if (browser) {
|
|
337
|
+
if (dev) {
|
|
338
|
+
buildWorkerDefinition('../../../node_modules/monaco-editor-workers/dist/workers', import.meta.url, false);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
// @ts-ignore
|
|
342
|
+
self.MonacoEnvironment = {
|
|
343
|
+
getWorker: function (_moduleId, label) {
|
|
344
|
+
return new tsWorker();
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
export function getCode() {
|
|
350
|
+
return editor?.getValue() ?? '';
|
|
351
|
+
}
|
|
352
|
+
let cip;
|
|
353
|
+
let extraModel;
|
|
354
|
+
let width = 0;
|
|
355
|
+
async function loadMonaco() {
|
|
356
|
+
model = monaco.editor.createModel(code, lang, monaco.Uri.parse(uri));
|
|
357
|
+
model.updateOptions(updateOptions);
|
|
358
|
+
editor = monaco.editor.create(divEl, {
|
|
359
|
+
...editorConfig(model, code, lang, automaticLayout, fixedOverflowWidgets),
|
|
360
|
+
lineNumbers: 'off',
|
|
361
|
+
fontSize: 16,
|
|
362
|
+
suggestOnTriggerCharacters: true
|
|
363
|
+
});
|
|
364
|
+
const stdLib = { content: libStdContent, filePath: 'es5.d.ts' };
|
|
365
|
+
if (extraLib != '') {
|
|
366
|
+
monaco.languages.typescript.javascriptDefaults.setExtraLibs([
|
|
367
|
+
{
|
|
368
|
+
content: extraLib,
|
|
369
|
+
filePath: 'windmill.d.ts'
|
|
370
|
+
},
|
|
371
|
+
stdLib
|
|
372
|
+
]);
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
monaco.languages.typescript.javascriptDefaults.setExtraLibs([stdLib]);
|
|
376
|
+
}
|
|
377
|
+
extraModel = monaco.editor.createModel('`' + model.getValue() + '`', 'javascript');
|
|
378
|
+
const worker = await monaco.languages.typescript.getJavaScriptWorker();
|
|
379
|
+
const client = await worker(extraModel.uri);
|
|
380
|
+
cip = monaco.languages.registerCompletionItemProvider('template', {
|
|
381
|
+
triggerCharacters: ['.'],
|
|
382
|
+
provideCompletionItems: async (model, position) => {
|
|
383
|
+
extraModel.setValue('`' + model.getValue() + '`');
|
|
384
|
+
const offset = model.getOffsetAt(position) + 1;
|
|
385
|
+
const info = await client.getCompletionsAtPosition(extraModel.uri.toString(), offset);
|
|
386
|
+
if (!info) {
|
|
387
|
+
return { suggestions: [] };
|
|
388
|
+
}
|
|
389
|
+
const wordInfo = model.getWordUntilPosition(position);
|
|
390
|
+
const wordRange = new monaco.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
391
|
+
const suggestions = info.entries
|
|
392
|
+
.filter((x) => x.kind != 'keyword' && x.kind != 'var')
|
|
393
|
+
.map((entry) => {
|
|
394
|
+
let range = wordRange;
|
|
395
|
+
if (entry.replacementSpan) {
|
|
396
|
+
const p1 = model.getPositionAt(entry.replacementSpan.start);
|
|
397
|
+
const p2 = model.getPositionAt(entry.replacementSpan.start + entry.replacementSpan.length);
|
|
398
|
+
range = new monaco.Range(p1.lineNumber, p1.column, p2.lineNumber, p2.column);
|
|
399
|
+
}
|
|
400
|
+
const tags = [];
|
|
401
|
+
if (entry.kindModifiers?.indexOf('deprecated') !== -1) {
|
|
402
|
+
tags.push(monaco.languages.CompletionItemTag.Deprecated);
|
|
403
|
+
}
|
|
404
|
+
return {
|
|
405
|
+
uri: model.uri,
|
|
406
|
+
position: position,
|
|
407
|
+
offset: offset,
|
|
408
|
+
range: range,
|
|
409
|
+
label: entry.name,
|
|
410
|
+
insertText: entry.name,
|
|
411
|
+
sortText: entry.sortText,
|
|
412
|
+
kind: convertKind(entry.kind),
|
|
413
|
+
tags
|
|
414
|
+
};
|
|
415
|
+
});
|
|
416
|
+
return { suggestions };
|
|
417
|
+
},
|
|
418
|
+
resolveCompletionItem: async (item, token) => {
|
|
419
|
+
extraModel.setValue('`' + model.getValue() + '`');
|
|
420
|
+
const myItem = item;
|
|
421
|
+
const position = myItem.position;
|
|
422
|
+
const offset = myItem.offset;
|
|
423
|
+
const details = await client.getCompletionEntryDetails(extraModel.uri.toString(), offset, myItem.label);
|
|
424
|
+
if (!details) {
|
|
425
|
+
return myItem;
|
|
426
|
+
}
|
|
427
|
+
return {
|
|
428
|
+
uri: model.uri,
|
|
429
|
+
position: position,
|
|
430
|
+
label: details.name,
|
|
431
|
+
kind: convertKind(details.kind),
|
|
432
|
+
detail: displayPartsToString(details.displayParts),
|
|
433
|
+
documentation: {
|
|
434
|
+
value: createDocumentationString(details)
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
let timeoutModel = undefined;
|
|
440
|
+
editor.onDidChangeModelContent((event) => {
|
|
441
|
+
timeoutModel && clearTimeout(timeoutModel);
|
|
442
|
+
timeoutModel = setTimeout(() => {
|
|
443
|
+
code = getCode();
|
|
444
|
+
dispatch('change', { code });
|
|
445
|
+
}, 200);
|
|
446
|
+
});
|
|
447
|
+
if (autoHeight) {
|
|
448
|
+
let ignoreEvent = false;
|
|
449
|
+
const updateHeight = () => {
|
|
450
|
+
const contentHeight = Math.min(1000, editor.getContentHeight());
|
|
451
|
+
if (divEl) {
|
|
452
|
+
divEl.style.height = `${contentHeight}px`;
|
|
453
|
+
}
|
|
454
|
+
try {
|
|
455
|
+
ignoreEvent = true;
|
|
456
|
+
editor.layout({ width, height: contentHeight });
|
|
457
|
+
}
|
|
458
|
+
finally {
|
|
459
|
+
ignoreEvent = false;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
editor.onDidContentSizeChange(updateHeight);
|
|
463
|
+
updateHeight();
|
|
464
|
+
}
|
|
465
|
+
editor.onDidFocusEditorText(() => {
|
|
466
|
+
dispatch('focus');
|
|
467
|
+
});
|
|
468
|
+
editor.onDidBlurEditorText(() => {
|
|
469
|
+
code = getCode();
|
|
470
|
+
dispatch('blur');
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
onMount(() => {
|
|
474
|
+
if (browser) {
|
|
475
|
+
loadMonaco();
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
onDestroy(() => {
|
|
479
|
+
try {
|
|
480
|
+
model && model.dispose();
|
|
481
|
+
editor && editor.dispose();
|
|
482
|
+
cip && cip.dispose();
|
|
483
|
+
extraModel && extraModel.dispose();
|
|
484
|
+
}
|
|
485
|
+
catch (err) { }
|
|
486
|
+
});
|
|
487
|
+
</script>
|
|
488
|
+
|
|
489
|
+
<div bind:this={divEl} class="{$$props.class} editor templatable-editor" bind:clientWidth={width} />
|
|
490
|
+
|
|
491
|
+
<style>
|
|
492
|
+
.editor {
|
|
493
|
+
margin-left: 0.125rem;
|
|
494
|
+
margin-right: 0.125rem;
|
|
495
|
+
border-radius: 0.5rem
|
|
496
|
+
}</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const conf: {
|
|
2
|
+
wordPattern: RegExp;
|
|
3
|
+
comments: {
|
|
4
|
+
lineComment: string;
|
|
5
|
+
blockComment: [string, string];
|
|
6
|
+
};
|
|
7
|
+
brackets: [string, string][];
|
|
8
|
+
onEnterRules: never[];
|
|
9
|
+
autoClosingPairs: ({
|
|
10
|
+
open: string;
|
|
11
|
+
close: string;
|
|
12
|
+
notIn?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
open: string;
|
|
15
|
+
close: string;
|
|
16
|
+
notIn: string[];
|
|
17
|
+
})[];
|
|
18
|
+
folding: {
|
|
19
|
+
markers: {
|
|
20
|
+
start: RegExp;
|
|
21
|
+
end: RegExp;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const language: boolean;
|
|
@@ -94,7 +94,7 @@ async function loadTestJob(id) {
|
|
|
94
94
|
logOffset: job.logs?.length ?? 0
|
|
95
95
|
});
|
|
96
96
|
if (previewJobUpdates.new_logs) {
|
|
97
|
-
job.logs = (job
|
|
97
|
+
job.logs = (job?.logs ?? '').concat(previewJobUpdates.new_logs);
|
|
98
98
|
}
|
|
99
99
|
if ((previewJobUpdates.running ?? false) || (previewJobUpdates.completed ?? false)) {
|
|
100
100
|
job = await JobService.getJob({ workspace: workspace, id });
|
|
@@ -124,7 +124,7 @@ let editor = undefined;
|
|
|
124
124
|
>
|
|
125
125
|
</div>
|
|
126
126
|
{/if}
|
|
127
|
-
<
|
|
127
|
+
<span class="font-semibold text-gray-700">Path</span>
|
|
128
128
|
<Path
|
|
129
129
|
disabled={!can_write}
|
|
130
130
|
bind:error={pathError}
|
|
@@ -136,6 +136,7 @@ let editor = undefined;
|
|
|
136
136
|
</div>
|
|
137
137
|
<div class="mt-4">
|
|
138
138
|
<Toggle bind:checked={variable.is_secret} options={{ right: 'Secret' }} />
|
|
139
|
+
<div class="mb-2" />
|
|
139
140
|
{#if variable.is_secret}
|
|
140
141
|
<Alert type="warning" title="Audit log for each access">
|
|
141
142
|
Every secret is encrypted at rest and in transit with a key specific to this
|
|
@@ -18,9 +18,9 @@ let size;
|
|
|
18
18
|
let runnableComponent;
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
|
-
<InputValue input={configuration.label} bind:value={labelValue} />
|
|
22
|
-
<InputValue input={configuration.color} bind:value={color} />
|
|
23
|
-
<InputValue input={configuration.size} bind:value={size} />
|
|
21
|
+
<InputValue {id} input={configuration.label} bind:value={labelValue} />
|
|
22
|
+
<InputValue {id} input={configuration.color} bind:value={color} />
|
|
23
|
+
<InputValue {id} input={configuration.size} bind:value={size} />
|
|
24
24
|
|
|
25
25
|
<RunnableWrapper
|
|
26
26
|
bind:runnableComponent
|
|
@@ -19,7 +19,8 @@ $: backgroundColor = {
|
|
|
19
19
|
}[theme];
|
|
20
20
|
const options = {
|
|
21
21
|
responsive: true,
|
|
22
|
-
animation: false
|
|
22
|
+
animation: false,
|
|
23
|
+
maintainAspectRatio: false
|
|
23
24
|
};
|
|
24
25
|
$: data = {
|
|
25
26
|
labels,
|
|
@@ -32,11 +33,11 @@ $: data = {
|
|
|
32
33
|
};
|
|
33
34
|
</script>
|
|
34
35
|
|
|
35
|
-
<InputValue input={configuration.theme} bind:value={theme} />
|
|
36
|
-
<InputValue input={configuration.labels} bind:value={labels} />
|
|
36
|
+
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
37
|
+
<InputValue {id} input={configuration.labels} bind:value={labels} />
|
|
37
38
|
|
|
38
39
|
<RunnableWrapper bind:componentInput {id} bind:result>
|
|
39
|
-
{#if
|
|
40
|
+
{#if result}
|
|
40
41
|
<Bar {data} {options} />
|
|
41
42
|
{/if}
|
|
42
43
|
</RunnableWrapper>
|
|
@@ -33,11 +33,11 @@ $: data = {
|
|
|
33
33
|
};
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
|
-
<InputValue input={configuration.theme} bind:value={theme} />
|
|
37
|
-
<InputValue input={configuration.labels} bind:value={labels} />
|
|
36
|
+
<InputValue {id} input={configuration.theme} bind:value={theme} />
|
|
37
|
+
<InputValue {id} input={configuration.labels} bind:value={labels} />
|
|
38
38
|
|
|
39
39
|
<RunnableWrapper bind:componentInput {id} bind:result>
|
|
40
|
-
{#if
|
|
40
|
+
{#if result}
|
|
41
41
|
<Pie {data} {options} />
|
|
42
42
|
{/if}
|
|
43
43
|
</RunnableWrapper>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import AlignWrapper from '../helpers/AlignWrapper.svelte';
|
|
3
|
+
import InputValue from '../helpers/InputValue.svelte';
|
|
4
|
+
export let id;
|
|
5
|
+
export let configuration;
|
|
6
|
+
export let inputType;
|
|
7
|
+
export let verticalAlignment = undefined;
|
|
8
|
+
export const staticOutputs = ['result'];
|
|
9
|
+
const { worldStore } = getContext('AppEditorContext');
|
|
10
|
+
let input;
|
|
11
|
+
let labelValue = 'Title';
|
|
12
|
+
let minValue = '';
|
|
13
|
+
let maxValue = '';
|
|
14
|
+
$: outputs = $worldStore?.outputsById[id];
|
|
15
|
+
function handleInput() {
|
|
16
|
+
outputs?.result.set(input.value);
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<InputValue {id} input={configuration.label} bind:value={labelValue} />
|
|
21
|
+
<InputValue {id} input={configuration.minDate} bind:value={minValue} />
|
|
22
|
+
<InputValue {id} input={configuration.maxDate} bind:value={maxValue} />
|
|
23
|
+
|
|
24
|
+
<AlignWrapper {verticalAlignment}>
|
|
25
|
+
<input
|
|
26
|
+
type={inputType}
|
|
27
|
+
bind:this={input}
|
|
28
|
+
on:input={handleInput}
|
|
29
|
+
min={minValue}
|
|
30
|
+
max={maxValue}
|
|
31
|
+
placeholder="Type..."
|
|
32
|
+
class="h-full"
|
|
33
|
+
/>
|
|
34
|
+
</AlignWrapper>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { AppInput } from '../../inputType';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: string;
|
|
6
|
+
configuration: Record<string, AppInput>;
|
|
7
|
+
inputType: 'date' | 'time' | 'datetime-local';
|
|
8
|
+
verticalAlignment?: 'top' | 'center' | 'bottom' | undefined;
|
|
9
|
+
staticOutputs?: string[] | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type AppDateInputProps = typeof __propDef.props;
|
|
17
|
+
export type AppDateInputEvents = typeof __propDef.events;
|
|
18
|
+
export type AppDateInputSlots = typeof __propDef.slots;
|
|
19
|
+
export default class AppDateInput extends SvelteComponentTyped<AppDateInputProps, AppDateInputEvents, AppDateInputSlots> {
|
|
20
|
+
get staticOutputs(): string[];
|
|
21
|
+
}
|
|
22
|
+
export {};
|