windmill-components 1.103.2 → 1.109.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.
- package/package/components/AppConnect.svelte +4 -1
- package/package/components/ArgInput.svelte +81 -68
- package/package/components/ArgInput.svelte.d.ts +0 -2
- package/package/components/Awareness.svelte +17 -0
- package/package/components/Awareness.svelte.d.ts +14 -0
- package/package/components/CliHelpBox.svelte +2 -5
- package/package/components/Editor.svelte +81 -30
- package/package/components/Editor.svelte.d.ts +4 -0
- package/package/components/EditorBar.svelte +127 -131
- package/package/components/EditorBar.svelte.d.ts +8 -0
- package/package/components/FlowBuilder.svelte +6 -1
- package/package/components/FlowStatusViewer.svelte +157 -144
- package/package/components/FlowStatusViewer.svelte.d.ts +1 -0
- package/package/components/HighlightCode.svelte +9 -2
- package/package/components/HighlightCode.svelte.d.ts +1 -0
- package/package/components/InputTransformForm.svelte +1 -1
- package/package/components/InputTransformSchemaForm.svelte +4 -1
- package/package/components/InputTransformSchemaForm.svelte.d.ts +3 -0
- package/package/components/ObjectTypeNarrowing.svelte +8 -2
- package/package/components/ResourcePicker.svelte +0 -1
- package/package/components/ResourceTypePicker.svelte +1 -1
- package/package/components/RunForm.svelte.d.ts +1 -1
- package/package/components/ScheduleEditor.svelte +35 -3
- package/package/components/SchemaEditor.svelte +7 -8
- package/package/components/SchemaEditor.svelte.d.ts +1 -1
- package/package/components/SchemaForm.svelte.d.ts +1 -1
- package/package/components/SchemaModal.svelte +7 -12
- package/package/components/SchemaModal.svelte.d.ts +2 -3
- package/package/components/SchemaViewer.svelte +7 -1
- package/package/components/SchemaViewer.svelte.d.ts +1 -1
- package/package/components/ScriptBuilder.svelte +95 -21
- package/package/components/ScriptEditor.svelte +114 -6
- package/package/components/ScriptEditor.svelte.d.ts +7 -1
- package/package/components/ScriptSchema.svelte.d.ts +1 -1
- package/package/components/TemplateEditor.svelte +1 -0
- package/package/components/Toggle.svelte +1 -1
- package/package/components/Urlize.svelte +19 -0
- package/package/components/Urlize.svelte.d.ts +16 -0
- package/package/components/UserSettings.svelte +57 -36
- package/package/components/UserSettings.svelte.d.ts +1 -0
- package/package/components/VariableEditor.svelte +1 -1
- package/package/components/apps/components/buttons/AppSchemaForm.svelte +6 -1
- package/package/components/apps/components/display/AppDisplayComponent.svelte +6 -1
- package/package/components/apps/components/display/AppDownload.svelte +33 -25
- package/package/components/apps/components/display/AppFlowStatusComponent.svelte +2 -2
- package/package/components/apps/components/display/AppLogsComponent.svelte +2 -2
- package/package/components/apps/components/display/AppText.svelte +9 -14
- package/package/components/apps/components/display/table/AppAggridTable.svelte +45 -36
- package/package/components/apps/components/display/table/AppTable.svelte +5 -2
- package/package/components/apps/components/helpers/ComponentErrorHandler.svelte +26 -0
- package/package/components/apps/components/helpers/ComponentErrorHandler.svelte.d.ts +18 -0
- package/package/components/apps/components/helpers/InputValue.svelte +15 -17
- package/package/components/apps/components/helpers/NonRunnableComponent.svelte +1 -1
- package/package/components/apps/components/helpers/eval.d.ts +1 -0
- package/package/components/apps/components/helpers/eval.js +3 -1
- package/package/components/apps/components/inputs/AppCheckbox.svelte +21 -8
- package/package/components/apps/components/inputs/AppDateInput.svelte +6 -1
- package/package/components/apps/components/inputs/AppMultiSelect.svelte +18 -7
- package/package/components/apps/components/inputs/AppNumberInput.svelte +6 -1
- package/package/components/apps/components/inputs/AppRangeInput.svelte +6 -2
- package/package/components/apps/components/inputs/AppSelect.svelte +11 -3
- package/package/components/apps/components/inputs/AppSelectStep.svelte +19 -6
- package/package/components/apps/components/inputs/AppSelectTab.svelte +9 -1
- package/package/components/apps/components/inputs/AppSliderInputs.svelte +6 -1
- package/package/components/apps/components/inputs/AppTextInput.svelte +6 -1
- package/package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +6 -1
- package/package/components/apps/components/inputs/currency/CurrencyInput.svelte +0 -1
- package/package/components/apps/editor/AppEditor.svelte +4 -7
- package/package/components/apps/editor/AppEditor.svelte.d.ts +3 -2
- package/package/components/apps/editor/AppEditorHeader.svelte +38 -11
- package/package/components/apps/editor/AppEditorHeader.svelte.d.ts +3 -0
- package/package/components/apps/editor/AppPreview.svelte +9 -7
- package/package/components/apps/editor/AppPreview.svelte.d.ts +6 -6
- package/package/components/apps/editor/ConnectionInstructions.svelte +1 -0
- package/package/components/apps/editor/DeploymentHistory.svelte +70 -0
- package/package/components/apps/editor/DeploymentHistory.svelte.d.ts +18 -0
- package/package/components/apps/editor/RecomputeAllComponents.svelte +49 -20
- package/package/components/apps/editor/component/ComponentNavigation.svelte +51 -20
- package/package/components/apps/editor/component/ComponentNavigation.svelte.d.ts +4 -1
- package/package/components/apps/editor/component/components.d.ts +50 -49
- package/package/components/apps/editor/component/components.js +6 -0
- package/package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +1 -0
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
- package/package/components/apps/editor/settingsPanel/ComponentPanel.svelte +1 -4
- package/package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +4 -7
- package/package/components/apps/rx.js +6 -1
- package/package/components/apps/types.d.ts +1 -1
- package/package/components/apps/utils.js +1 -0
- package/package/components/common/button/ButtonDropdown.svelte +45 -19
- package/package/components/common/button/ButtonDropdown.svelte.d.ts +1 -0
- package/package/components/common/modal/Modal.svelte +13 -2
- package/package/components/common/modal/Modal.svelte.d.ts +1 -0
- package/package/components/common/table/AppRow.svelte +33 -3
- package/package/components/flows/content/FlowModuleCache.svelte +37 -0
- package/package/components/flows/content/FlowModuleCache.svelte.d.ts +17 -0
- package/package/components/flows/content/FlowModuleComponent.svelte +57 -54
- package/package/components/flows/content/FlowModuleEarlyStop.svelte +1 -1
- package/package/components/flows/content/FlowModuleHeader.svelte +12 -1
- package/package/components/flows/content/FlowModuleHeader.svelte.d.ts +1 -0
- package/package/components/flows/content/FlowModuleSleep.svelte +1 -1
- package/package/components/flows/content/FlowModuleSuspend.svelte +1 -7
- package/package/components/flows/content/ScriptEditorDrawer.svelte +2 -1
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +13 -1
- package/package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +1 -0
- package/package/components/flows/map/FlowModuleSchemaMap.svelte +49 -5
- package/package/components/flows/map/MapItem.svelte +9 -2
- package/package/components/flows/map/MapItem.svelte.d.ts +1 -0
- package/package/components/flows/pickers/PickHubApp.svelte +2 -1
- package/package/components/flows/pickers/PickHubApp.svelte.d.ts +1 -0
- package/package/components/flows/pickers/PickHubFlow.svelte +2 -1
- package/package/components/flows/pickers/PickHubFlow.svelte.d.ts +1 -0
- package/package/components/flows/pickers/PickHubScript.svelte +2 -1
- package/package/components/flows/pickers/PickHubScript.svelte.d.ts +1 -0
- package/package/components/flows/previousResults.d.ts +2 -0
- package/package/components/flows/previousResults.js +46 -0
- package/package/components/graph/FlowGraph.svelte +1 -1
- package/package/components/home/ItemsList.svelte +11 -3
- package/package/components/home/ListFilters.svelte +39 -0
- package/package/components/home/ListFilters.svelte.d.ts +4 -0
- package/package/components/propertyPicker/ObjectViewer.svelte +77 -79
- package/package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -1
- package/package/components/propertyPicker/PropPicker.svelte +18 -0
- package/package/components/sidebar/MultiplayerMenu.svelte +123 -0
- package/package/components/sidebar/MultiplayerMenu.svelte.d.ts +16 -0
- package/package/components/sidebar/WorkspaceMenu.svelte +1 -1
- package/package/gen/core/CancelablePromise.d.ts +2 -8
- package/package/gen/core/CancelablePromise.js +38 -36
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/core/request.js +3 -2
- package/package/gen/models/AuditLog.d.ts +1 -1
- package/package/gen/models/CreateInput.d.ts +1 -1
- package/package/gen/models/FlowMetadata.d.ts +1 -1
- package/package/gen/models/FlowModule.d.ts +1 -0
- package/package/gen/models/Input.d.ts +1 -1
- package/package/gen/models/NewScript.d.ts +2 -1
- package/package/gen/models/NewToken.d.ts +1 -0
- package/package/gen/models/OpenFlow.d.ts +1 -1
- package/package/gen/models/Policy.d.ts +1 -1
- package/package/gen/models/Script.d.ts +2 -1
- package/package/gen/models/TruncatedToken.d.ts +1 -0
- package/package/gen/services/AppService.d.ts +1 -1
- package/package/gen/services/JobService.d.ts +64 -4
- package/package/gen/services/JobService.js +45 -0
- package/package/gen/services/ResourceService.d.ts +2 -1
- package/package/gen/services/ResourceService.js +4 -1
- package/package/gen/services/ScriptService.d.ts +0 -45
- package/package/gen/services/ScriptService.js +0 -52
- package/package/gen/services/SettingsService.d.ts +6 -0
- package/package/gen/services/SettingsService.js +11 -0
- package/package/gen/services/UserService.d.ts +14 -0
- package/package/gen/services/UserService.js +11 -0
- package/package/gen/services/VariableService.d.ts +12 -0
- package/package/gen/services/VariableService.js +16 -0
- package/package/hub.d.ts +1 -1
- package/package/infer.js +8 -13
- package/package/navigation.d.ts +1 -1
- package/package/navigation.js +6 -1
- package/package/script_helpers.d.ts +1 -1
- package/package/script_helpers.js +6 -1
- package/package/stores.d.ts +2 -0
- package/package/stores.js +4 -2
- package/package/utils.d.ts +1 -0
- package/package/utils.js +14 -0
- package/package.json +23 -19
|
@@ -5,6 +5,7 @@ import { faClipboard, faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
|
5
5
|
import TableCustom from './TableCustom.svelte';
|
|
6
6
|
import { Button } from './common';
|
|
7
7
|
import Icon from 'svelte-awesome';
|
|
8
|
+
export let scopes = undefined;
|
|
8
9
|
let newPassword;
|
|
9
10
|
let passwordError;
|
|
10
11
|
let version;
|
|
@@ -12,13 +13,14 @@ let tokens;
|
|
|
12
13
|
let newToken;
|
|
13
14
|
let newTokenLabel;
|
|
14
15
|
let newTokenExpiration;
|
|
15
|
-
let displayCreateToken =
|
|
16
|
+
let displayCreateToken = scopes != undefined;
|
|
16
17
|
let login_type = 'none';
|
|
17
18
|
import Drawer from './common/drawer/Drawer.svelte';
|
|
18
19
|
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
19
20
|
import { page } from '$app/stores';
|
|
20
21
|
import { goto } from '$app/navigation';
|
|
21
22
|
import { sendUserToast } from '../toast';
|
|
23
|
+
import Tooltip from './Tooltip.svelte';
|
|
22
24
|
let drawer;
|
|
23
25
|
export function openDrawer() {
|
|
24
26
|
loadVersion();
|
|
@@ -64,7 +66,7 @@ async function createToken() {
|
|
|
64
66
|
date.setDate(date.getDate() + newTokenExpiration);
|
|
65
67
|
}
|
|
66
68
|
newToken = await UserService.createToken({
|
|
67
|
-
requestBody: { label: newTokenLabel, expiration: date?.toISOString() }
|
|
69
|
+
requestBody: { label: newTokenLabel, expiration: date?.toISOString(), scopes }
|
|
68
70
|
});
|
|
69
71
|
listTokens();
|
|
70
72
|
displayCreateToken = false;
|
|
@@ -87,29 +89,30 @@ async function deleteToken(tokenPrefix) {
|
|
|
87
89
|
Windmill {version}
|
|
88
90
|
</div>
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<div class="
|
|
97
|
-
<
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
type="text"
|
|
101
|
-
disabled
|
|
102
|
-
value={$usersWorkspaceStore?.email}
|
|
103
|
-
class="input mt-1"
|
|
104
|
-
/>
|
|
105
|
-
</label>
|
|
106
|
-
{#if login_type == 'password'}
|
|
107
|
-
<label class="block w-120">
|
|
108
|
-
<div class="text-gray-700">password</div>
|
|
92
|
+
{#if scopes == undefined}
|
|
93
|
+
<h2 class="border-b mt-4">User info</h2>
|
|
94
|
+
<div class="">
|
|
95
|
+
{#if passwordError}
|
|
96
|
+
<div class="text-red-600 text-2xs grow">{passwordError}</div>
|
|
97
|
+
{/if}
|
|
98
|
+
<div class="flex flex-col gap-2 w-full">
|
|
99
|
+
<div class="mt-4">
|
|
100
|
+
<label class="block w-60 mb-2 text-gray-500">
|
|
101
|
+
<div class="text-gray-700">email</div>
|
|
109
102
|
<input
|
|
110
|
-
type="
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
type="text"
|
|
104
|
+
disabled
|
|
105
|
+
value={$usersWorkspaceStore?.email}
|
|
106
|
+
class="input mt-1"
|
|
107
|
+
/>
|
|
108
|
+
</label>
|
|
109
|
+
{#if login_type == 'password'}
|
|
110
|
+
<label class="block w-120">
|
|
111
|
+
<div class="text-gray-700">password</div>
|
|
112
|
+
<input
|
|
113
|
+
type="password"
|
|
114
|
+
bind:value={newPassword}
|
|
115
|
+
class="
|
|
113
116
|
w-full
|
|
114
117
|
block
|
|
115
118
|
py-1
|
|
@@ -121,17 +124,18 @@ async function deleteToken(tokenPrefix) {
|
|
|
121
124
|
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
122
125
|
text-sm
|
|
123
126
|
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
/>
|
|
128
|
+
<Button size="sm" btnClasses="mt-4 w-min" on:click={setPassword}
|
|
129
|
+
>Set password</Button
|
|
130
|
+
>
|
|
131
|
+
</label>
|
|
132
|
+
{:else if login_type == 'github'}
|
|
133
|
+
<span>Authentified through Github OAuth2. Cannot set a password.</span>
|
|
134
|
+
{/if}
|
|
135
|
+
</div>
|
|
132
136
|
</div>
|
|
133
137
|
</div>
|
|
134
|
-
|
|
138
|
+
{/if}
|
|
135
139
|
|
|
136
140
|
<div class="grid grid-cols-2 pt-8 pb-1">
|
|
137
141
|
<h2 class="py-0 my-0 border-b">Tokens</h2>
|
|
@@ -177,7 +181,22 @@ async function deleteToken(tokenPrefix) {
|
|
|
177
181
|
? ''
|
|
178
182
|
: 'hidden'} py-3 px-3 border rounded-md mb-6 bg-gray-50 min-w-min"
|
|
179
183
|
>
|
|
180
|
-
<h3 class="pb-3 font-semibold">Add new token</h3>
|
|
184
|
+
<h3 class="pb-3 font-semibold">Add a new token</h3>
|
|
185
|
+
{#if scopes != undefined}
|
|
186
|
+
{#each scopes as scope}
|
|
187
|
+
<div class="flex flex-col mb-4">
|
|
188
|
+
<label for="label"
|
|
189
|
+
>Scope <Tooltip
|
|
190
|
+
>This token can only be used within its scope. For flows and scripts, it
|
|
191
|
+
allows you to share them without fear of being impersonated. Once a script is
|
|
192
|
+
triggered, the script itself uses a new ephemeral token to be able to act on
|
|
193
|
+
behalf of the token owner.</Tooltip
|
|
194
|
+
></label
|
|
195
|
+
>
|
|
196
|
+
<input disabled type="text" value={scope} />
|
|
197
|
+
</div>
|
|
198
|
+
{/each}
|
|
199
|
+
{/if}
|
|
181
200
|
<div class="flex flex-row flex-wrap gap-x-2 w-full justify-between">
|
|
182
201
|
<div class="flex flex-col">
|
|
183
202
|
<label for="label"
|
|
@@ -187,7 +206,7 @@ async function deleteToken(tokenPrefix) {
|
|
|
187
206
|
</div>
|
|
188
207
|
<div class="flex flex-col">
|
|
189
208
|
<label for="expires"
|
|
190
|
-
>Expires In
|
|
209
|
+
>Expires In <span class="text-xs text-gray-500">(optional)</span>
|
|
191
210
|
</label>
|
|
192
211
|
<select bind:value={newTokenExpiration}>
|
|
193
212
|
<option value={undefined}>No expiration</option>
|
|
@@ -208,15 +227,17 @@ async function deleteToken(tokenPrefix) {
|
|
|
208
227
|
<th>prefix</th>
|
|
209
228
|
<th>label</th>
|
|
210
229
|
<th>expiration</th>
|
|
230
|
+
<th>scopes</th>
|
|
211
231
|
<th />
|
|
212
232
|
</tr>
|
|
213
233
|
<tbody slot="body">
|
|
214
234
|
{#if tokens && tokens.length > 0}
|
|
215
|
-
{#each tokens as { token_prefix, expiration, label }}
|
|
235
|
+
{#each tokens as { token_prefix, expiration, label, scopes }}
|
|
216
236
|
<tr>
|
|
217
237
|
<td class="grow">{token_prefix}****</td>
|
|
218
238
|
<td class="grow">{label ?? ''}</td>
|
|
219
239
|
<td class="grow">{displayDate(expiration ?? '')}</td>
|
|
240
|
+
<td class="grow">{scopes?.join(', ') ?? ''}</td>
|
|
220
241
|
<td class="grow"
|
|
221
242
|
><button
|
|
222
243
|
class="text-red-500 text-xs underline"
|
|
@@ -139,7 +139,7 @@ let editor = undefined;
|
|
|
139
139
|
</div>
|
|
140
140
|
<div class="mt-4">
|
|
141
141
|
<Toggle
|
|
142
|
-
on:change={() => loadVariable(initialPath)}
|
|
142
|
+
on:change={() => edit && loadVariable(initialPath)}
|
|
143
143
|
bind:checked={variable.is_secret}
|
|
144
144
|
options={{ right: 'Secret' }}
|
|
145
145
|
/>
|
|
@@ -12,7 +12,7 @@ export let initializing = undefined;
|
|
|
12
12
|
export let render;
|
|
13
13
|
export let configuration;
|
|
14
14
|
export let customCss = undefined;
|
|
15
|
-
const { worldStore, connectingInput, app, selectedComponent } = getContext('AppViewerContext');
|
|
15
|
+
const { worldStore, connectingInput, app, selectedComponent, componentControl } = getContext('AppViewerContext');
|
|
16
16
|
const outputs = initOutput($worldStore, id, {
|
|
17
17
|
result: undefined,
|
|
18
18
|
loading: false,
|
|
@@ -30,6 +30,11 @@ function handleArgsChange() {
|
|
|
30
30
|
}
|
|
31
31
|
outputs.values.set(newArgs, true);
|
|
32
32
|
}
|
|
33
|
+
$componentControl[id] = {
|
|
34
|
+
setValue(nvalue) {
|
|
35
|
+
args = nvalue;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
33
38
|
$: args && handleArgsChange();
|
|
34
39
|
$: outputs.valid.set(valid);
|
|
35
40
|
$: css = concatCustomCss($app.css?.schemaformcomponent, customCss);
|
|
@@ -11,8 +11,13 @@ export let initializing = undefined;
|
|
|
11
11
|
export let customCss = undefined;
|
|
12
12
|
export let render;
|
|
13
13
|
const requireHtmlApproval = getContext(IS_APP_PUBLIC_CONTEXT_KEY);
|
|
14
|
-
const { app, worldStore } = getContext('AppViewerContext');
|
|
14
|
+
const { app, worldStore, componentControl } = getContext('AppViewerContext');
|
|
15
15
|
let result = undefined;
|
|
16
|
+
$componentControl[id] = {
|
|
17
|
+
setValue(value) {
|
|
18
|
+
result = value;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
16
21
|
const outputs = initOutput($worldStore, id, {
|
|
17
22
|
result: undefined,
|
|
18
23
|
loading: false
|
|
@@ -8,6 +8,7 @@ import InitializeComponent from '../helpers/InitializeComponent.svelte';
|
|
|
8
8
|
import { AlignWrapper } from '../helpers';
|
|
9
9
|
import { Button } from '../../../common';
|
|
10
10
|
import { loadIcon } from '../icon';
|
|
11
|
+
import ComponentErrorHandler from '../helpers/ComponentErrorHandler.svelte';
|
|
11
12
|
export let id;
|
|
12
13
|
export let configuration;
|
|
13
14
|
export let customCss = undefined;
|
|
@@ -15,7 +16,7 @@ export let render;
|
|
|
15
16
|
export let horizontalAlignment = undefined;
|
|
16
17
|
export let verticalAlignment = undefined;
|
|
17
18
|
export let noWFull = false;
|
|
18
|
-
|
|
19
|
+
const resolvedConfig = initConfig(components['downloadcomponent'].initialData.configuration, configuration);
|
|
19
20
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
20
21
|
//used so that we can count number of outputs setup for first refresh
|
|
21
22
|
initOutput($worldStore, id, {});
|
|
@@ -49,30 +50,37 @@ $: css = concatCustomCss($app.css?.downloadcomponent, customCss);
|
|
|
49
50
|
|
|
50
51
|
{#if render}
|
|
51
52
|
<AlignWrapper {noWFull} {horizontalAlignment} {verticalAlignment}>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
btnClasses={twMerge(css?.button?.class, resolvedConfig.fillContainer ? 'w-full h-full' : '')}
|
|
55
|
-
wrapperClasses={resolvedConfig.fillContainer ? 'w-full h-full' : ''}
|
|
56
|
-
style={css?.button?.style}
|
|
57
|
-
disabled={resolvedConfig.source == undefined}
|
|
58
|
-
size={resolvedConfig.size}
|
|
59
|
-
color={resolvedConfig.color}
|
|
60
|
-
download={resolvedConfig.filename}
|
|
61
|
-
href={transformBareBase64IfNecessary(resolvedConfig.source)}
|
|
62
|
-
target="_self"
|
|
63
|
-
nonCaptureEvent
|
|
53
|
+
<ComponentErrorHandler
|
|
54
|
+
hasError={resolvedConfig?.source != undefined && typeof resolvedConfig.source !== 'string'}
|
|
64
55
|
>
|
|
65
|
-
<
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
56
|
+
<Button
|
|
57
|
+
on:pointerdown={(e) => e.stopPropagation()}
|
|
58
|
+
btnClasses={twMerge(
|
|
59
|
+
css?.button?.class,
|
|
60
|
+
resolvedConfig.fillContainer ? 'w-full h-full' : ''
|
|
61
|
+
)}
|
|
62
|
+
wrapperClasses={resolvedConfig.fillContainer ? 'w-full h-full' : ''}
|
|
63
|
+
style={css?.button?.style}
|
|
64
|
+
disabled={resolvedConfig.source == undefined}
|
|
65
|
+
size={resolvedConfig.size}
|
|
66
|
+
color={resolvedConfig.color}
|
|
67
|
+
download={resolvedConfig.filename}
|
|
68
|
+
href={transformBareBase64IfNecessary(resolvedConfig.source)}
|
|
69
|
+
target="_self"
|
|
70
|
+
nonCaptureEvent
|
|
71
|
+
>
|
|
72
|
+
<span class="truncate inline-flex gap-2 items-center">
|
|
73
|
+
{#if resolvedConfig.beforeIcon && beforeIconComponent}
|
|
74
|
+
<svelte:component this={beforeIconComponent} size={14} />
|
|
75
|
+
{/if}
|
|
76
|
+
{#if resolvedConfig.label && resolvedConfig.label?.length > 0}
|
|
77
|
+
<div>{resolvedConfig.label}</div>
|
|
78
|
+
{/if}
|
|
79
|
+
{#if resolvedConfig.afterIcon && afterIconComponent}
|
|
80
|
+
<svelte:component this={afterIconComponent} size={14} />
|
|
81
|
+
{/if}
|
|
82
|
+
</span>
|
|
83
|
+
</Button>
|
|
84
|
+
</ComponentErrorHandler>
|
|
77
85
|
</AlignWrapper>
|
|
78
86
|
{/if}
|
|
@@ -6,7 +6,7 @@ import { concatCustomCss } from '../../utils';
|
|
|
6
6
|
import FlowStatusViewer from '../../../FlowStatusViewer.svelte';
|
|
7
7
|
export let id;
|
|
8
8
|
export let componentInput;
|
|
9
|
-
export let initializing =
|
|
9
|
+
export let initializing = false;
|
|
10
10
|
export let customCss = undefined;
|
|
11
11
|
export let render;
|
|
12
12
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
@@ -14,6 +14,7 @@ const outputs = initOutput($worldStore, id, {
|
|
|
14
14
|
result: undefined,
|
|
15
15
|
loading: false
|
|
16
16
|
});
|
|
17
|
+
initializing = false;
|
|
17
18
|
$: css = concatCustomCss($app.css?.flowstatuscomponent, customCss);
|
|
18
19
|
let jobId;
|
|
19
20
|
</script>
|
|
@@ -26,7 +27,6 @@ let jobId;
|
|
|
26
27
|
{render}
|
|
27
28
|
{componentInput}
|
|
28
29
|
{id}
|
|
29
|
-
bind:initializing
|
|
30
30
|
>
|
|
31
31
|
<div class="flex flex-col w-full h-full">
|
|
32
32
|
<div
|
|
@@ -7,7 +7,7 @@ import LogViewer from '../../../LogViewer.svelte';
|
|
|
7
7
|
import TestJobLoader from '../../../TestJobLoader.svelte';
|
|
8
8
|
export let id;
|
|
9
9
|
export let componentInput;
|
|
10
|
-
export let initializing =
|
|
10
|
+
export let initializing = false;
|
|
11
11
|
export let customCss = undefined;
|
|
12
12
|
export let render;
|
|
13
13
|
const { app, worldStore } = getContext('AppViewerContext');
|
|
@@ -15,6 +15,7 @@ const outputs = initOutput($worldStore, id, {
|
|
|
15
15
|
result: undefined,
|
|
16
16
|
loading: false
|
|
17
17
|
});
|
|
18
|
+
initializing = false;
|
|
18
19
|
$: css = concatCustomCss($app.css?.logcomponent, customCss);
|
|
19
20
|
let testJobLoader = undefined;
|
|
20
21
|
let testIsLoading = false;
|
|
@@ -31,7 +32,6 @@ let testJob = undefined;
|
|
|
31
32
|
{render}
|
|
32
33
|
{componentInput}
|
|
33
34
|
{id}
|
|
34
|
-
bind:initializing
|
|
35
35
|
>
|
|
36
36
|
<div class="flex flex-col w-full h-full">
|
|
37
37
|
<div
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import Tooltip from '../../../Tooltip.svelte';
|
|
3
3
|
import { Clipboard } from 'lucide-svelte';
|
|
4
4
|
import { getContext } from 'svelte';
|
|
5
|
-
import { get } from 'svelte/store';
|
|
6
5
|
import { twMerge } from 'tailwind-merge';
|
|
7
6
|
import { copyToClipboard } from '../../../../utils';
|
|
8
7
|
import Button from '../../../common/button/Button.svelte';
|
|
@@ -23,12 +22,17 @@ export let render;
|
|
|
23
22
|
export let editorMode = false;
|
|
24
23
|
let resolvedConfig = initConfig(components['textcomponent'].initialData.configuration, configuration);
|
|
25
24
|
const { app, worldStore, mode, componentControl } = getContext('AppViewerContext');
|
|
26
|
-
const editorcontext = getContext('AppEditorContext');
|
|
27
25
|
let result = undefined;
|
|
28
26
|
if (componentInput?.type == 'template' && !isCodeInjection(componentInput.eval)) {
|
|
29
27
|
result = componentInput.eval;
|
|
30
28
|
initializing = false;
|
|
31
29
|
}
|
|
30
|
+
$componentControl[id] = {
|
|
31
|
+
...$componentControl[id],
|
|
32
|
+
setValue(value) {
|
|
33
|
+
result = value;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
32
36
|
const outputs = initOutput($worldStore, id, {
|
|
33
37
|
result,
|
|
34
38
|
loading: initializing
|
|
@@ -94,13 +98,12 @@ function getHorizontalAlignement() {
|
|
|
94
98
|
$: resolvedConfig.style && (component = getComponent());
|
|
95
99
|
$: resolvedConfig.style && (classes = getClasses());
|
|
96
100
|
$: initialValue = componentInput?.type == 'template' ? componentInput.eval : '';
|
|
97
|
-
$: editableValue = initialValue
|
|
101
|
+
$: editableValue = initialValue ?? '';
|
|
98
102
|
let rows = 1;
|
|
99
103
|
function onInput(e) {
|
|
100
104
|
const target = e.target;
|
|
101
|
-
if (target.value) {
|
|
105
|
+
if (target.value != undefined) {
|
|
102
106
|
$componentControl[id]?.setCode?.(target.value);
|
|
103
|
-
editableValue;
|
|
104
107
|
autosize();
|
|
105
108
|
}
|
|
106
109
|
}
|
|
@@ -136,7 +139,7 @@ function autosize() {
|
|
|
136
139
|
}}
|
|
137
140
|
on:keydown|stopPropagation
|
|
138
141
|
>
|
|
139
|
-
{#if editorMode && componentInput?.type == 'template'}
|
|
142
|
+
{#if $mode == 'dnd' && editorMode && componentInput?.type == 'template'}
|
|
140
143
|
<AlignWrapper {horizontalAlignment} {verticalAlignment}>
|
|
141
144
|
<textarea
|
|
142
145
|
class={twMerge(
|
|
@@ -175,14 +178,6 @@ function autosize() {
|
|
|
175
178
|
componentInput?.type == 'template'
|
|
176
179
|
? 'cursor-text'
|
|
177
180
|
: ''}"
|
|
178
|
-
on:click={() => {
|
|
179
|
-
if ($mode === 'dnd' && componentInput?.type == 'template') {
|
|
180
|
-
let ontextfocus = editorcontext?.ontextfocus
|
|
181
|
-
if (ontextfocus) {
|
|
182
|
-
get(ontextfocus)?.()
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}}
|
|
186
181
|
>
|
|
187
182
|
<svelte:element
|
|
188
183
|
this={component}
|
|
@@ -75,45 +75,54 @@ function onCellValueChanged(event) {
|
|
|
75
75
|
|
|
76
76
|
<RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
|
|
77
77
|
{#if Array.isArray(result) && result.every(isObject)}
|
|
78
|
-
|
|
79
|
-
class="border border-gray-300 shadow-sm divide-y divide-gray-300 flex flex-col h-full"
|
|
80
|
-
bind:clientHeight
|
|
81
|
-
bind:clientWidth
|
|
82
|
-
>
|
|
78
|
+
{#if Array.isArray(resolvedConfig.columnDefs) && resolvedConfig.columnDefs.every(isObject)}
|
|
83
79
|
<div
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
style:height="{clientHeight}px"
|
|
88
|
-
style:width="{clientWidth}px"
|
|
89
|
-
class="ag-theme-alpine"
|
|
80
|
+
class="border border-gray-300 shadow-sm divide-y divide-gray-300 flex flex-col h-full"
|
|
81
|
+
bind:clientHeight
|
|
82
|
+
bind:clientWidth
|
|
90
83
|
>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
84
|
+
<div
|
|
85
|
+
on:pointerdown|stopPropagation={() => {
|
|
86
|
+
$selectedComponent = [id]
|
|
87
|
+
}}
|
|
88
|
+
style:height="{clientHeight}px"
|
|
89
|
+
style:width="{clientWidth}px"
|
|
90
|
+
class="ag-theme-alpine"
|
|
91
|
+
>
|
|
92
|
+
{#key resolvedConfig?.pagination}
|
|
93
|
+
<AgGridSvelte
|
|
94
|
+
bind:rowData={result}
|
|
95
|
+
columnDefs={resolvedConfig?.columnDefs}
|
|
96
|
+
pagination={resolvedConfig?.pagination}
|
|
97
|
+
paginationAutoPageSize={resolvedConfig?.pagination}
|
|
98
|
+
defaultColDef={{ flex: 1, editable: resolvedConfig?.allEditable, onCellValueChanged }}
|
|
99
|
+
onPaginationChanged={(event) => {
|
|
100
|
+
outputs?.page.set(event.api.paginationGetCurrentPage())
|
|
101
|
+
}}
|
|
102
|
+
rowSelection="single"
|
|
103
|
+
suppressRowDeselection={true}
|
|
104
|
+
onSelectionChanged={(e) => {
|
|
105
|
+
const row = e.api.getSelectedNodes()?.[0]?.rowIndex
|
|
106
|
+
if (row != undefined) {
|
|
107
|
+
toggleRow(row)
|
|
108
|
+
}
|
|
109
|
+
}}
|
|
110
|
+
onGridReady={(e) => {
|
|
111
|
+
outputs?.ready.set(true)
|
|
112
|
+
$componentControl[id] = { agGrid: { api: e.api, columnApi: e.columnApi } }
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
{/key}
|
|
116
|
+
</div>
|
|
115
117
|
</div>
|
|
116
|
-
|
|
118
|
+
{:else if result != undefined}
|
|
119
|
+
<Alert title="Parsing issues" type="error" size="xs">
|
|
120
|
+
The columnDefs should be an array of objects, received:
|
|
121
|
+
<pre class="overflow-auto">
|
|
122
|
+
{JSON.stringify(resolvedConfig.columnDefs)}
|
|
123
|
+
</pre>
|
|
124
|
+
</Alert>
|
|
125
|
+
{/if}
|
|
117
126
|
{:else if result != undefined}
|
|
118
127
|
<Alert title="Parsing issues" type="error" size="xs">
|
|
119
128
|
The result should be an array of objects, received:
|
|
@@ -46,7 +46,9 @@ let table = createSvelteTable(options);
|
|
|
46
46
|
let resolvedConfig = initConfig(components['tablecomponent'].initialData.configuration, configuration);
|
|
47
47
|
let selectedRowIndex = -1;
|
|
48
48
|
function toggleRow(row, rowIndex, force = false) {
|
|
49
|
-
if (selectedRowIndex !== rowIndex ||
|
|
49
|
+
if (selectedRowIndex !== rowIndex ||
|
|
50
|
+
JSON.stringify(row.original) !== JSON.stringify(result?.[rowIndex]) ||
|
|
51
|
+
force) {
|
|
50
52
|
selectedRowIndex = rowIndex;
|
|
51
53
|
outputs?.selectedRow.set(row.original, force);
|
|
52
54
|
outputs?.selectedRowIndex.set(rowIndex, force);
|
|
@@ -122,7 +124,8 @@ function rerender() {
|
|
|
122
124
|
};
|
|
123
125
|
table = createSvelteTable(options);
|
|
124
126
|
if (result) {
|
|
125
|
-
|
|
127
|
+
//console.log('rerendering table', result[0])
|
|
128
|
+
toggleRow({ original: filteredResult[0] }, 0, true);
|
|
126
129
|
}
|
|
127
130
|
if (outputs.page.peak()) {
|
|
128
131
|
$table.setPageIndex(outputs?.page.peak());
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>import Popover from '../../../Popover.svelte';
|
|
2
|
+
import Alert from '../../../common/alert/Alert.svelte';
|
|
3
|
+
import { classNames } from '../../../../utils';
|
|
4
|
+
import { Bug } from 'lucide-svelte';
|
|
5
|
+
export let hasError = false;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
{#if hasError}
|
|
9
|
+
<div class={classNames('bg-red-100 w-full h-full flex items-center justify-center text-red-500')}>
|
|
10
|
+
<Popover notClickable placement="bottom" popupClass="!bg-white border w-96">
|
|
11
|
+
<Bug size={14} />
|
|
12
|
+
<span slot="text">
|
|
13
|
+
<div class="bg-white">
|
|
14
|
+
<Alert type="error" title="Error during execution">
|
|
15
|
+
<div class="flex flex-col gap-2">
|
|
16
|
+
One of the configuration of the component is invalid. Please check the configuration
|
|
17
|
+
and try again.
|
|
18
|
+
</div>
|
|
19
|
+
</Alert>
|
|
20
|
+
</div>
|
|
21
|
+
</span>
|
|
22
|
+
</Popover>
|
|
23
|
+
</div>
|
|
24
|
+
{:else}
|
|
25
|
+
<slot />
|
|
26
|
+
{/if}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
hasError?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type ComponentErrorHandlerProps = typeof __propDef.props;
|
|
14
|
+
export type ComponentErrorHandlerEvents = typeof __propDef.events;
|
|
15
|
+
export type ComponentErrorHandlerSlots = typeof __propDef.slots;
|
|
16
|
+
export default class ComponentErrorHandler extends SvelteComponentTyped<ComponentErrorHandlerProps, ComponentErrorHandlerEvents, ComponentErrorHandlerSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -52,27 +52,25 @@ function debounce2(cb) {
|
|
|
52
52
|
timeout = setTimeout(cb, 50);
|
|
53
53
|
}
|
|
54
54
|
$: lastInput && $worldStore && debounce(handleConnection);
|
|
55
|
+
const debounceTemplate = async () => {
|
|
56
|
+
let nvalue = await getValue(lastInput);
|
|
57
|
+
if (!deepEqual(nvalue, value)) {
|
|
58
|
+
value = nvalue;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
55
61
|
$: lastInput &&
|
|
56
62
|
lastInput.type == 'template' &&
|
|
63
|
+
isCodeInjection(lastInput.eval) &&
|
|
57
64
|
$stateId &&
|
|
58
65
|
$state &&
|
|
59
|
-
debounce(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
$: lastInput &&
|
|
67
|
-
lastInput.type == 'eval' &&
|
|
68
|
-
$stateId &&
|
|
69
|
-
$state &&
|
|
70
|
-
debounce2(async () => {
|
|
71
|
-
let nvalue = await evalExpr(lastInput);
|
|
72
|
-
if (!deepEqual(nvalue, value)) {
|
|
73
|
-
value = nvalue;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
66
|
+
debounce(debounceTemplate);
|
|
67
|
+
const debounceEval = async () => {
|
|
68
|
+
let nvalue = await evalExpr(lastInput);
|
|
69
|
+
if (!deepEqual(nvalue, value)) {
|
|
70
|
+
value = nvalue;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
$: lastInput && lastInput.type == 'eval' && $stateId && $state && debounce2(debounceEval);
|
|
76
74
|
async function handleConnection() {
|
|
77
75
|
if (lastInput?.type === 'connected') {
|
|
78
76
|
$worldStore?.connect(lastInput, onValueChange, `${id}-${key}`);
|
|
@@ -15,7 +15,7 @@ export function computeGlobalContext(world, extraContext = {}) {
|
|
|
15
15
|
}
|
|
16
16
|
function create_context_function_template(eval_string, context, noReturn) {
|
|
17
17
|
return `
|
|
18
|
-
return async function (context, state, goto, setTab, recompute, getAgGrid) {
|
|
18
|
+
return async function (context, state, goto, setTab, recompute, getAgGrid, setValue) {
|
|
19
19
|
"use strict";
|
|
20
20
|
${Object.keys(context).length > 0
|
|
21
21
|
? `let ${Object.keys(context).map((key) => ` ${key} = context['${key}']`)};`
|
|
@@ -92,5 +92,7 @@ export async function eval_like(text, context = {}, noReturn, state, editor, con
|
|
|
92
92
|
runnableComponents[id]?.cb?.();
|
|
93
93
|
}, (id) => {
|
|
94
94
|
return controlComponents[id]?.agGrid;
|
|
95
|
+
}, (id, value) => {
|
|
96
|
+
controlComponents[id]?.setValue?.(value);
|
|
95
97
|
});
|
|
96
98
|
}
|