windmill-components 1.501.15 → 1.501.16

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.
@@ -0,0 +1,6 @@
1
+ <script lang="ts">import AppEditor from './apps/editor/AppEditor.svelte';
2
+ let { app: oldApp, ...props } = $props();
3
+ let app = $state(oldApp);
4
+ </script>
5
+
6
+ <AppEditor {app} {...props} />
@@ -1,26 +1,4 @@
1
+ import type { AppEditorProps } from './apps/types';
2
+ declare const AppWrapper: import("svelte").Component<AppEditorProps, {}, "">;
3
+ type AppWrapper = ReturnType<typeof AppWrapper>;
1
4
  export default AppWrapper;
2
- type AppWrapper = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const AppWrapper: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
- $$bindings?: Bindings;
17
- } & Exports;
18
- (internal: unknown, props: {
19
- $$events?: Events;
20
- $$slots?: Slots;
21
- }): Exports & {
22
- $set?: any;
23
- $on?: any;
24
- };
25
- z_$$bindings?: Bindings;
26
- }
@@ -7,6 +7,6 @@ interface Props {
7
7
  inlineEditorOpened: boolean;
8
8
  initializing?: boolean | undefined;
9
9
  }
10
- declare const ComponentInner: import("svelte").Component<Props, {}, "inlineEditorOpened" | "errorHandledByComponent" | "initializing">;
10
+ declare const ComponentInner: import("svelte").Component<Props, {}, "initializing" | "errorHandledByComponent" | "inlineEditorOpened">;
11
11
  type ComponentInner = ReturnType<typeof ComponentInner>;
12
12
  export default ComponentInner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.501.15",
3
+ "version": "1.501.16",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",
@@ -1,66 +0,0 @@
1
- import type { Flow, OpenFlow } from '../../gen';
2
- import { type Writable } from 'svelte/store';
3
- import { type FlowState } from './flowState';
4
- import type { StateStore } from '../../utils';
5
- export type FlowMode = 'push' | 'pull';
6
- export declare const importFlowStore: Writable<Flow | undefined>;
7
- export declare function initFlow(flow: Flow, flowStore: StateStore<Flow>, flowStateStore: Writable<FlowState>): Promise<void>;
8
- export declare function copyFirstStepSchema(flowState: FlowState, flowStore: Writable<OpenFlow>): Promise<void>;
9
- export declare function getFirstStepSchema(flowState: FlowState, flowStore: StateStore<OpenFlow>): Promise<{
10
- schema: {
11
- $schema: string | undefined;
12
- type: string;
13
- properties: {
14
- [x: string]: {
15
- type: string | undefined;
16
- description?: string | undefined;
17
- pattern?: string | undefined;
18
- default?: any;
19
- enum?: string[] | undefined;
20
- contentEncoding?: "base64" | "binary" | undefined;
21
- format?: string | undefined;
22
- items?: {
23
- type?: "string" | "number" | "bytes" | "object" | "resource" | undefined;
24
- contentEncoding?: "base64" | undefined;
25
- enum?: string[] | undefined;
26
- resourceType?: string | undefined;
27
- properties?: {
28
- [x: string]: /*elided*/ any;
29
- } | undefined;
30
- } | undefined;
31
- min?: number | undefined;
32
- max?: number | undefined;
33
- currency?: string | undefined;
34
- currencyLocale?: string | undefined;
35
- multiselect?: boolean | undefined;
36
- customErrorMessage?: string | undefined;
37
- properties?: {
38
- [x: string]: /*elided*/ any;
39
- } | undefined;
40
- required?: string[] | undefined;
41
- showExpr?: string | undefined;
42
- password?: boolean | undefined;
43
- order?: string[] | undefined;
44
- nullable?: boolean | undefined;
45
- dateFormat?: string | undefined;
46
- title?: string | undefined;
47
- placeholder?: string | undefined;
48
- oneOf?: /*elided*/ any[] | undefined;
49
- originalType?: string | undefined;
50
- };
51
- };
52
- order?: string[] | undefined;
53
- required: string[];
54
- } | undefined;
55
- mod: {
56
- id: string;
57
- summary: string | undefined;
58
- value: {
59
- language?: "deno" | "bun" | "python3" | "go" | "bash" | "powershell" | "postgresql" | "mysql" | "bigquery" | "snowflake" | "mssql" | "oracledb" | "graphql" | "nativets" | "php" | undefined;
60
- path?: string | undefined;
61
- type: "rawscript" | "script" | "flow" | "forloopflow" | "branchone" | "branchall" | "identity" | "whileloopflow";
62
- };
63
- };
64
- connectFirstNode: () => void;
65
- }>;
66
- export declare function replaceId(expr: string, id: string, newId: string): string;
@@ -1,71 +0,0 @@
1
- import { writable } from 'svelte/store';
2
- import { initFlowState } from './flowState';
3
- import { sendUserToast } from '../../toast';
4
- import { stateSnapshot } from '../../svelte5Utils.svelte';
5
- export const importFlowStore = writable(undefined);
6
- export async function initFlow(flow, flowStore, flowStateStore) {
7
- await initFlowState(flow, flowStateStore);
8
- flowStore.val = flow;
9
- }
10
- export async function copyFirstStepSchema(flowState, flowStore) {
11
- flowStore.update((flow) => {
12
- const firstModuleId = flow.value.modules[0]?.id;
13
- if (flowState[firstModuleId] && firstModuleId) {
14
- flow.schema = structuredClone(stateSnapshot(flowState[firstModuleId].schema));
15
- const v = flow.value.modules[0].value;
16
- if (v.type == 'rawscript' || v.type == 'script') {
17
- Object.keys(v.input_transforms ?? {}).forEach((key) => {
18
- v.input_transforms[key] = {
19
- type: 'javascript',
20
- expr: `flow_input.${key}`
21
- };
22
- });
23
- return flow;
24
- }
25
- sendUserToast('Only scripts can be used as a input schema', true);
26
- return flow;
27
- }
28
- sendUserToast('No first step found', true);
29
- return flow;
30
- });
31
- }
32
- export async function getFirstStepSchema(flowState, flowStore) {
33
- const flow = flowStore.val;
34
- const firstModuleId = flow.value.modules[0]?.id;
35
- if (!firstModuleId || !flowState[firstModuleId]) {
36
- throw new Error('no first step found');
37
- }
38
- const schema = structuredClone(stateSnapshot(flowState[firstModuleId].schema));
39
- const v = flow.value.modules[0].value;
40
- if (v.type !== 'rawscript' && v.type !== 'script') {
41
- throw new Error('only scripts can be used as a input schema');
42
- }
43
- const simplifiedModule = {
44
- id: flow.value.modules[0].id,
45
- summary: flow.value.modules[0].summary,
46
- value: {
47
- type: flow.value.modules[0].value.type,
48
- ...('path' in flow.value.modules[0].value ? { path: flow.value.modules[0].value.path } : {}),
49
- ...('language' in flow.value.modules[0].value
50
- ? { language: flow.value.modules[0].value.language }
51
- : {})
52
- }
53
- };
54
- return {
55
- schema,
56
- mod: simplifiedModule,
57
- connectFirstNode: () => {
58
- Object.keys(v.input_transforms ?? {}).forEach((key) => {
59
- v.input_transforms[key] = {
60
- type: 'javascript',
61
- expr: `flow_input.${key}`
62
- };
63
- });
64
- }
65
- };
66
- }
67
- export function replaceId(expr, id, newId) {
68
- return expr
69
- .replaceAll(`results.${id}`, `results.${newId}`)
70
- .replaceAll(`results?.${id}`, `results?.${newId}`);
71
- }