windmill-components 1.504.4 → 1.504.6
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/FlowBuilder.svelte +2 -2
- package/package/components/schema/AddPropertyFormV2.svelte +42 -33
- package/package/components/schema/AddPropertyFormV2.svelte.d.ts +1 -0
- package/package/components/schema/AddPropertyV2.svelte +2 -1
- package/package/components/schema/AddPropertyV2.svelte.d.ts +1 -0
- package/package/components/schema/EditableSchemaWrapper.svelte +3 -1
- package/package/components/schema/editable_schema_wrapper.d.ts +3 -0
- package/package.json +1 -1
|
@@ -784,9 +784,9 @@ const flowHasChanged = $derived(flowPreviewContent?.flowHasChanged());
|
|
|
784
784
|
redoProps={{ disabled: $history.index === $history.history.length - 1 }}
|
|
785
785
|
on:undo={() => {
|
|
786
786
|
const currentModules = flowStore.val?.value?.modules
|
|
787
|
-
|
|
787
|
+
console.log('undo before', flowStore.val, JSON.stringify(flowStore.val, null, 2))
|
|
788
788
|
flowStore.val = undo(history, flowStore.val)
|
|
789
|
-
|
|
789
|
+
console.log('undo after', flowStore.val, JSON.stringify(flowStore.val, null, 2))
|
|
790
790
|
|
|
791
791
|
const newModules = flowStore.val?.value?.modules
|
|
792
792
|
const restoredModules = newModules?.filter(
|
|
@@ -3,7 +3,7 @@ import { Button } from '../common';
|
|
|
3
3
|
import { CornerDownLeft } from 'lucide-svelte';
|
|
4
4
|
import Popover from '../meltComponents/Popover.svelte';
|
|
5
5
|
let name = $state('');
|
|
6
|
-
let { customName = undefined, disabled = false, trigger } = $props();
|
|
6
|
+
let { customName = undefined, disabled = false, trigger, noPopover } = $props();
|
|
7
7
|
const dispatch = createEventDispatcher();
|
|
8
8
|
function addField() {
|
|
9
9
|
dispatch('add', { name });
|
|
@@ -12,37 +12,46 @@ function addField() {
|
|
|
12
12
|
const trigger_render = $derived(trigger);
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
placeholder={`${customName ?? 'Field'} name`}
|
|
24
|
-
onkeydown={(event) => {
|
|
25
|
-
if (event.key === 'Enter') {
|
|
26
|
-
addField()
|
|
27
|
-
close()
|
|
28
|
-
}
|
|
29
|
-
}}
|
|
30
|
-
{disabled}
|
|
31
|
-
/>
|
|
32
|
-
<Button
|
|
33
|
-
variant="contained"
|
|
34
|
-
color="dark"
|
|
35
|
-
size="xs"
|
|
36
|
-
id="flow-editor-add-property"
|
|
37
|
-
on:click={() => {
|
|
15
|
+
{#snippet form({ close })}
|
|
16
|
+
<div class="flex flex-row gap-2 p-2 rounded-md">
|
|
17
|
+
<input
|
|
18
|
+
bind:value={name}
|
|
19
|
+
class="max-w-80"
|
|
20
|
+
placeholder={`${customName ?? 'Field'} name`}
|
|
21
|
+
onkeydown={(event) => {
|
|
22
|
+
if (event.key === 'Enter') {
|
|
38
23
|
addField()
|
|
39
24
|
close()
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
}
|
|
26
|
+
}}
|
|
27
|
+
{disabled}
|
|
28
|
+
/>
|
|
29
|
+
<Button
|
|
30
|
+
variant="contained"
|
|
31
|
+
color="dark"
|
|
32
|
+
size="xs"
|
|
33
|
+
id="flow-editor-add-property"
|
|
34
|
+
on:click={() => {
|
|
35
|
+
addField()
|
|
36
|
+
close()
|
|
37
|
+
}}
|
|
38
|
+
disabled={!name || disabled}
|
|
39
|
+
shortCut={{ Icon: CornerDownLeft, withoutModifier: true }}
|
|
40
|
+
>
|
|
41
|
+
Add {customName ? customName.toLowerCase() : 'field'}
|
|
42
|
+
</Button>
|
|
43
|
+
</div>
|
|
44
|
+
{/snippet}
|
|
45
|
+
|
|
46
|
+
{#if noPopover}
|
|
47
|
+
{@render form({ close: () => {} })}
|
|
48
|
+
{:else}
|
|
49
|
+
<Popover closeButton={false} class="w-full" {disabled}>
|
|
50
|
+
{#snippet trigger()}
|
|
51
|
+
{@render trigger_render?.()}
|
|
52
|
+
{/snippet}
|
|
53
|
+
{#snippet content({ close })}
|
|
54
|
+
{@render form({ close })}
|
|
55
|
+
{/snippet}
|
|
56
|
+
</Popover>
|
|
57
|
+
{/if}
|
|
@@ -2,6 +2,7 @@ interface Props {
|
|
|
2
2
|
customName?: string | undefined;
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
trigger?: import('svelte').Snippet;
|
|
5
|
+
noPopover?: boolean;
|
|
5
6
|
}
|
|
6
7
|
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> {
|
|
7
8
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { emptySchema, sendUserToast } from '../../utils';
|
|
3
3
|
import { createEventDispatcher } from 'svelte';
|
|
4
4
|
import AddPropertyFormV2 from './AddPropertyFormV2.svelte';
|
|
5
|
-
let { schema = $bindable(emptySchema()), trigger } = $props();
|
|
5
|
+
let { schema = $bindable(emptySchema()), trigger, noPopover } = $props();
|
|
6
6
|
export const DEFAULT_PROPERTY = {
|
|
7
7
|
selectedType: 'string',
|
|
8
8
|
description: '',
|
|
@@ -130,6 +130,7 @@ const trigger_render = $derived(trigger);
|
|
|
130
130
|
</script>
|
|
131
131
|
|
|
132
132
|
<AddPropertyFormV2
|
|
133
|
+
{noPopover}
|
|
133
134
|
on:add={(e) => {
|
|
134
135
|
try {
|
|
135
136
|
handleAddOrEditArgument({
|
|
@@ -2,6 +2,7 @@ import { type Schema, type ModalSchemaProperty } from '../../common';
|
|
|
2
2
|
interface Props {
|
|
3
3
|
schema?: Schema | any;
|
|
4
4
|
trigger?: import('svelte').Snippet;
|
|
5
|
+
noPopover?: boolean;
|
|
5
6
|
}
|
|
6
7
|
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> {
|
|
7
8
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -7,7 +7,7 @@ import AddPropertyV2 from './AddPropertyV2.svelte';
|
|
|
7
7
|
import { Plus } from 'lucide-svelte';
|
|
8
8
|
import Select from '../select/Select.svelte';
|
|
9
9
|
import { safeSelectItems } from '../select/utils.svelte';
|
|
10
|
-
let { schema = $bindable(), uiOnly = false, noPreview = false, fullHeight = true, formatExtension = $bindable(undefined), onSchemaChange } = $props();
|
|
10
|
+
let { schema = $bindable(), uiOnly = false, noPreview = false, fullHeight = true, formatExtension = $bindable(undefined), onSchemaChange, customUi } = $props();
|
|
11
11
|
let resourceIsTextFile = $state(false);
|
|
12
12
|
let addPropertyComponent = $state(undefined);
|
|
13
13
|
let editableSchemaForm = $state(undefined);
|
|
@@ -61,6 +61,7 @@ let suggestedFileExtensions = $state([
|
|
|
61
61
|
>
|
|
62
62
|
{#if noPreview}
|
|
63
63
|
<AddPropertyV2
|
|
64
|
+
noPopover={customUi?.noAddPopover}
|
|
64
65
|
bind:schema
|
|
65
66
|
bind:this={addPropertyComponent}
|
|
66
67
|
on:change={() => onSchemaChange?.({ schema: $state.snapshot(schema) })}
|
|
@@ -96,6 +97,7 @@ let suggestedFileExtensions = $state([
|
|
|
96
97
|
{#snippet addProperty()}
|
|
97
98
|
{#if !noPreview}
|
|
98
99
|
<AddPropertyV2
|
|
100
|
+
noPopover={customUi?.noAddPopover}
|
|
99
101
|
bind:schema
|
|
100
102
|
bind:this={addPropertyComponent}
|
|
101
103
|
on:change={() => onSchemaChange?.({ schema })}
|