windmill-components 1.83.0 → 1.83.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/components/ArgInput.svelte +35 -27
- package/components/DisplayResult.svelte +10 -1
- package/components/DisplayResult.svelte.d.ts +1 -0
- package/components/FlowGraphViewer.svelte +4 -20
- package/components/FlowJobResult.svelte +2 -1
- package/components/FlowJobResult.svelte.d.ts +1 -0
- package/components/FlowStatusViewer.svelte +1 -0
- package/components/Range.svelte.d.ts +2 -2
- package/components/RunForm.svelte +6 -2
- package/components/ScriptBuilder.svelte +6 -4
- package/components/ScriptBuilder.svelte.d.ts +1 -0
- package/components/TemplateEditor.svelte.d.ts +205 -0
- package/components/apps/components/display/PlotlyHtml.svelte +26 -13
- package/components/apps/components/display/table/AppAggridTable.svelte +29 -17
- package/components/apps/components/display/table/AppTable.svelte +17 -4
- package/components/apps/components/display/table/AppTableFooter.svelte +2 -2
- package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +1 -1
- package/components/apps/components/inputs/AppMultiSelect.svelte +3 -1
- package/components/apps/components/inputs/AppSelect.svelte +3 -1
- package/components/apps/components/layout/AppContainer.svelte +4 -2
- package/components/apps/components/layout/AppDrawer.svelte +33 -13
- package/components/apps/components/layout/AppSplitpanes.svelte +7 -6
- package/components/apps/components/layout/AppTabs.svelte +6 -3
- package/components/apps/editor/AppEditor.svelte +25 -37
- package/components/apps/editor/ComponentHeader.svelte +5 -2
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -0
- package/components/apps/editor/ConnectionInstructions.svelte +29 -0
- package/components/apps/editor/ConnectionInstructions.svelte.d.ts +14 -0
- package/components/apps/editor/GridEditor.svelte +6 -28
- package/components/apps/editor/SubGridEditor.svelte +7 -19
- package/components/apps/editor/component/Component.svelte +7 -4
- package/components/apps/editor/component/ComponentWrapper.svelte +59 -0
- package/components/apps/editor/component/ComponentWrapper.svelte.d.ts +20 -0
- package/components/apps/editor/component/components.d.ts +32 -19
- package/components/apps/editor/component/components.js +28 -14
- package/components/apps/editor/componentsPanel/CssProperty.svelte +13 -8
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +4 -2
- package/components/apps/editor/componentsPanel/ListItem.svelte +14 -4
- package/components/apps/editor/componentsPanel/ListItem.svelte.d.ts +5 -0
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +62 -21
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte.d.ts +5 -2
- package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +1 -0
- package/components/apps/editor/componentsPanel/quickStyleProperties.d.ts +29 -503
- package/components/apps/editor/componentsPanel/quickStyleProperties.js +97 -98
- package/components/apps/editor/componentsPanel/store.d.ts +1 -0
- package/components/apps/editor/componentsPanel/store.js +1 -0
- package/components/apps/editor/contextPanel/ContextPanel.svelte +11 -10
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +13 -4
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +78 -43
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/OneOfInputSpecsEditor.svelte +17 -3
- package/components/apps/editor/settingsPanel/StylePanel.svelte +2 -0
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +1 -1
- package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +2 -2
- package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.d.ts +2 -1
- package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.js +9 -3
- package/components/common/button/Button.svelte.d.ts +1 -1
- package/components/common/button/ButtonPopup.svelte.d.ts +1 -1
- package/components/flows/content/FlowLoop.svelte +26 -14
- package/components/flows/flowStore.js +4 -40
- package/components/flows/utils.js +16 -22
- package/components/propertyPicker/ObjectViewer.svelte +12 -4
- package/infer.js +2 -0
- package/init_scripts/python_failure_module.d.ts +2 -0
- package/init_scripts/{python_failure_module.py → python_failure_module.js} +2 -2
- package/init_scripts/python_init_code.d.ts +2 -0
- package/init_scripts/{python_init_code.py → python_init_code.js} +3 -3
- package/init_scripts/python_init_code_clear.d.ts +2 -0
- package/init_scripts/python_init_code_clear.js +5 -0
- package/init_scripts/python_init_code_trigger.d.ts +2 -0
- package/init_scripts/{python_init_code_trigger.py → python_init_code_trigger.js} +2 -2
- package/package.json +673 -671
- package/script_helpers.d.ts +5 -5
- package/script_helpers.js +15 -5
- package/stores.d.ts +4 -3
- package/stores.js +23 -19
- package/utils.d.ts +1 -0
- package/utils.js +8 -0
- package/init_scripts/python_init_code_clear.py +0 -5
package/script_helpers.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Script } from
|
|
2
|
-
import PYTHON_INIT_CODE from './init_scripts/python_init_code
|
|
3
|
-
import PYTHON_INIT_CODE_CLEAR from './init_scripts/python_init_code_clear
|
|
4
|
-
import PYTHON_INIT_CODE_TRIGGER from './init_scripts/python_init_code_trigger
|
|
5
|
-
import PYTHON_FAILURE_MODULE_CODE from './init_scripts/python_failure_module
|
|
1
|
+
import type { Script } from './gen';
|
|
2
|
+
import PYTHON_INIT_CODE from './init_scripts/python_init_code';
|
|
3
|
+
import PYTHON_INIT_CODE_CLEAR from './init_scripts/python_init_code_clear';
|
|
4
|
+
import PYTHON_INIT_CODE_TRIGGER from './init_scripts/python_init_code_trigger';
|
|
5
|
+
import PYTHON_FAILURE_MODULE_CODE from './init_scripts/python_failure_module';
|
|
6
6
|
export { PYTHON_INIT_CODE, PYTHON_INIT_CODE_CLEAR, PYTHON_INIT_CODE_TRIGGER, PYTHON_FAILURE_MODULE_CODE };
|
|
7
7
|
export declare const DENO_INIT_CODE: string;
|
|
8
8
|
export declare const GO_INIT_CODE = "package inner\n\nimport (\n\t\"fmt\"\n\t\"rsc.io/quote\"\n // wmill \"github.com/windmill-labs/windmill-go-client\"\n)\n\n// the main must return (interface{}, error)\n\nfunc main(x string, nested struct{ Foo string `json:\"foo\"` }) (interface{}, error) {\n\tfmt.Println(\"Hello, World\")\n\tfmt.Println(nested.Foo)\n\tfmt.Println(quote.Opt())\n // v, _ := wmill.GetVariable(\"f/examples/secret\")\n return x, nil\n}\n";
|
package/script_helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import PYTHON_INIT_CODE from './init_scripts/python_init_code
|
|
2
|
-
import PYTHON_INIT_CODE_CLEAR from './init_scripts/python_init_code_clear
|
|
3
|
-
import PYTHON_INIT_CODE_TRIGGER from './init_scripts/python_init_code_trigger
|
|
4
|
-
import PYTHON_FAILURE_MODULE_CODE from './init_scripts/python_failure_module
|
|
1
|
+
import PYTHON_INIT_CODE from './init_scripts/python_init_code';
|
|
2
|
+
import PYTHON_INIT_CODE_CLEAR from './init_scripts/python_init_code_clear';
|
|
3
|
+
import PYTHON_INIT_CODE_TRIGGER from './init_scripts/python_init_code_trigger';
|
|
4
|
+
import PYTHON_FAILURE_MODULE_CODE from './init_scripts/python_failure_module';
|
|
5
5
|
export { PYTHON_INIT_CODE, PYTHON_INIT_CODE_CLEAR, PYTHON_INIT_CODE_TRIGGER, PYTHON_FAILURE_MODULE_CODE };
|
|
6
6
|
export const DENO_INIT_CODE = `// Ctrl+. to cache dependencies on imports hover, Ctrl+S to format.
|
|
7
7
|
|
|
@@ -155,7 +155,17 @@ export const DENO_INIT_CODE_APPROVAL = `import * as wmill from "https://deno.lan
|
|
|
155
155
|
export async function main(approver?: string) {
|
|
156
156
|
return wmill.getResumeEndpoints(approver)
|
|
157
157
|
}`;
|
|
158
|
-
const ALL_INITIAL_CODE = [
|
|
158
|
+
const ALL_INITIAL_CODE = [
|
|
159
|
+
PYTHON_INIT_CODE,
|
|
160
|
+
PYTHON_INIT_CODE_TRIGGER,
|
|
161
|
+
DENO_INIT_CODE,
|
|
162
|
+
POSTGRES_INIT_CODE,
|
|
163
|
+
DENO_INIT_CODE_TRIGGER,
|
|
164
|
+
DENO_INIT_CODE_CLEAR,
|
|
165
|
+
PYTHON_INIT_CODE_CLEAR,
|
|
166
|
+
DENO_INIT_CODE_APPROVAL,
|
|
167
|
+
DENO_FAILURE_MODULE_CODE
|
|
168
|
+
];
|
|
159
169
|
export function isInitialCode(content) {
|
|
160
170
|
for (const code of ALL_INITIAL_CODE) {
|
|
161
171
|
if (content === code) {
|
package/stores.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Readable } from
|
|
2
|
-
import type { UserWorkspaceList } from
|
|
3
|
-
import { type TokenResponse } from
|
|
1
|
+
import { type Readable } from 'svelte/store';
|
|
2
|
+
import type { UserWorkspaceList } from './gen/models/UserWorkspaceList.js';
|
|
3
|
+
import { type TokenResponse } from './gen';
|
|
4
4
|
export interface UserExt {
|
|
5
5
|
email: string;
|
|
6
6
|
username: string;
|
|
@@ -13,6 +13,7 @@ export interface UserExt {
|
|
|
13
13
|
folders: string[];
|
|
14
14
|
}
|
|
15
15
|
export declare const usageStore: import("svelte/store").Writable<number>;
|
|
16
|
+
export declare const runFormStore: import("svelte/store").Writable<any>;
|
|
16
17
|
export declare const oauthStore: import("svelte/store").Writable<TokenResponse | undefined>;
|
|
17
18
|
export declare const userStore: import("svelte/store").Writable<UserExt | undefined>;
|
|
18
19
|
export declare const workspaceStore: import("svelte/store").Writable<string | undefined>;
|
package/stores.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { browser } from
|
|
2
|
-
import { derived, writable } from
|
|
3
|
-
import { getUserExt } from
|
|
4
|
-
import { WorkspaceService } from
|
|
5
|
-
import { isCloudHosted } from
|
|
6
|
-
let persistedWorkspace = browser && localStorage.getItem(
|
|
1
|
+
import { browser } from '$app/environment';
|
|
2
|
+
import { derived, writable } from 'svelte/store';
|
|
3
|
+
import { getUserExt } from './user';
|
|
4
|
+
import { WorkspaceService } from './gen';
|
|
5
|
+
import { isCloudHosted } from './utils';
|
|
6
|
+
let persistedWorkspace = browser && localStorage.getItem('workspace');
|
|
7
7
|
export const usageStore = writable(0);
|
|
8
|
+
export const runFormStore = writable();
|
|
8
9
|
export const oauthStore = writable(undefined);
|
|
9
10
|
export const userStore = writable(undefined);
|
|
10
11
|
export const workspaceStore = writable(persistedWorkspace ? String(persistedWorkspace) : undefined);
|
|
@@ -13,13 +14,16 @@ export const starStore = writable(1);
|
|
|
13
14
|
export const usersWorkspaceStore = writable(undefined);
|
|
14
15
|
export const superadmin = writable(undefined);
|
|
15
16
|
export const userWorkspaces = derived([usersWorkspaceStore, superadmin], ([store, superadmin]) => {
|
|
16
|
-
const originalWorkspaces =
|
|
17
|
+
const originalWorkspaces = store?.workspaces ?? [];
|
|
17
18
|
if (superadmin) {
|
|
18
|
-
return [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return [
|
|
20
|
+
...originalWorkspaces.filter((x) => x.id != 'starter' && x.id != 'admins'),
|
|
21
|
+
{
|
|
22
|
+
id: 'admins',
|
|
23
|
+
name: 'Admins',
|
|
24
|
+
username: 'superadmin'
|
|
25
|
+
}
|
|
26
|
+
];
|
|
23
27
|
}
|
|
24
28
|
else {
|
|
25
29
|
return originalWorkspaces;
|
|
@@ -30,7 +34,7 @@ if (browser) {
|
|
|
30
34
|
workspaceStore.subscribe(async (workspace) => {
|
|
31
35
|
if (workspace) {
|
|
32
36
|
try {
|
|
33
|
-
localStorage.setItem(
|
|
37
|
+
localStorage.setItem('workspace', String(workspace));
|
|
34
38
|
}
|
|
35
39
|
catch (e) {
|
|
36
40
|
console.error('Could not persist workspace to local storage', e);
|
|
@@ -38,7 +42,7 @@ if (browser) {
|
|
|
38
42
|
const user = await getUserExt(workspace);
|
|
39
43
|
userStore.set(user);
|
|
40
44
|
if (isCloudHosted() && user?.is_admin) {
|
|
41
|
-
premiumStore.set(
|
|
45
|
+
premiumStore.set(await WorkspaceService.getPremiumInfo({ workspace }));
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
else {
|
|
@@ -47,14 +51,14 @@ if (browser) {
|
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
export function switchWorkspace(workspace) {
|
|
50
|
-
localStorage.removeItem(
|
|
51
|
-
localStorage.removeItem(
|
|
54
|
+
localStorage.removeItem('flow');
|
|
55
|
+
localStorage.removeItem('app');
|
|
52
56
|
workspaceStore.set(workspace);
|
|
53
57
|
}
|
|
54
58
|
export function clearStores() {
|
|
55
|
-
localStorage.removeItem(
|
|
56
|
-
localStorage.removeItem(
|
|
57
|
-
localStorage.removeItem(
|
|
59
|
+
localStorage.removeItem('flow');
|
|
60
|
+
localStorage.removeItem('app');
|
|
61
|
+
localStorage.removeItem('workspace');
|
|
58
62
|
userStore.set(undefined);
|
|
59
63
|
workspaceStore.set(undefined);
|
|
60
64
|
usersWorkspaceStore.set(undefined);
|
package/utils.d.ts
CHANGED
|
@@ -117,3 +117,4 @@ export declare function throttle<T>(func: (...args: any[]) => T, wait: number):
|
|
|
117
117
|
export declare function isMac(): boolean;
|
|
118
118
|
export declare function getModifierKey(): string;
|
|
119
119
|
export declare function isValidHexColor(color: string): boolean;
|
|
120
|
+
export declare function sortObject<T>(o: T & object): T;
|
package/utils.js
CHANGED
|
@@ -610,3 +610,11 @@ export function getModifierKey() {
|
|
|
610
610
|
export function isValidHexColor(color) {
|
|
611
611
|
return /^#(([A-F0-9]{2}){3,4}|[A-F0-9]{3})$/i.test(color);
|
|
612
612
|
}
|
|
613
|
+
export function sortObject(o) {
|
|
614
|
+
return Object.keys(o)
|
|
615
|
+
.sort()
|
|
616
|
+
.reduce((obj, key) => {
|
|
617
|
+
obj[key] = obj[key];
|
|
618
|
+
return obj;
|
|
619
|
+
}, {});
|
|
620
|
+
}
|