windmill-components 1.82.4 → 1.82.5
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 +2 -2
- package/components/ArgInput.svelte +72 -52
- package/components/ArgInput.svelte.d.ts +3 -1
- package/components/DisplayResult.svelte +17 -17
- package/components/Editor.svelte +3 -0
- package/components/Editor.svelte.d.ts +1 -0
- package/components/FieldHeader.svelte +1 -0
- package/components/FieldHeader.svelte.d.ts +4 -0
- package/components/FlowBuilder.svelte +0 -6
- package/components/FlowStatusViewer.svelte +4 -7
- package/components/FlowStatusViewer.svelte.d.ts +0 -1
- package/components/FlowViewer.svelte +1 -0
- package/components/InputTransformForm.svelte +1 -0
- package/components/LightweightArgInput.svelte +14 -1
- package/components/LightweightArgInput.svelte.d.ts +3 -1
- package/components/Multiselect.svelte.d.ts +2 -2
- package/components/SimpleEditor.svelte +1 -0
- package/components/SimpleEditor.svelte.d.ts +1 -0
- package/components/TemplateEditor.svelte +1 -0
- package/components/Toggle.svelte +1 -1
- package/components/Toggle.svelte.d.ts +1 -0
- package/components/apps/components/buttons/AppButton.svelte +17 -3
- package/components/apps/components/buttons/AppForm.svelte +10 -2
- package/components/apps/components/buttons/AppFormButton.svelte +82 -58
- package/components/apps/components/display/AppDisplayComponent.svelte +17 -23
- package/components/apps/components/display/AppHtml.svelte +1 -7
- package/components/apps/components/display/AppHtml.svelte.d.ts +0 -2
- package/components/apps/components/display/AppMap.svelte +1 -1
- package/components/apps/components/display/AppPdf.svelte +1 -1
- package/components/apps/components/display/PlotlyHtml.svelte +3 -20
- package/components/apps/components/display/PlotlyHtml.svelte.d.ts +0 -2
- package/components/apps/components/display/table/AppAggridTable.svelte +1 -1
- package/components/apps/components/display/table/AppTable.svelte +49 -75
- package/components/apps/components/display/table/AppTable.svelte.d.ts +1 -1
- package/components/apps/components/display/table/AppTableFooter.svelte +1 -2
- package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +0 -1
- package/components/apps/components/display/table/tableOptions.js +1 -1
- package/components/apps/components/helpers/DebouncedInput.svelte +0 -1
- package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +0 -2
- package/components/apps/components/helpers/HiddenComponent.svelte +2 -3
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +1 -2
- package/components/apps/components/helpers/InputValue.svelte +3 -3
- package/components/apps/components/helpers/RefreshButton.svelte +10 -3
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +0 -1
- package/components/apps/components/helpers/RunnableComponent.svelte +15 -19
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -2
- package/components/apps/components/helpers/RunnableWrapper.svelte +1 -3
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +0 -1
- package/components/apps/components/helpers/eval.d.ts +2 -4
- package/components/apps/components/helpers/eval.js +4 -6
- package/components/apps/components/inputs/AppCheckbox.svelte +4 -0
- package/components/apps/components/inputs/AppDateInput.svelte +2 -2
- package/components/apps/components/inputs/AppMultiSelect.svelte +5 -13
- package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +2 -0
- package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
- package/components/apps/components/inputs/AppSelect.svelte +4 -11
- package/components/apps/components/inputs/AppSelect.svelte.d.ts +2 -0
- package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
- package/components/apps/components/inputs/AppTextInput.svelte +43 -53
- package/components/apps/components/inputs/AppTextInput.svelte.d.ts +1 -1
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +1 -1
- package/components/apps/components/layout/AppContainer.svelte +2 -2
- package/components/apps/components/layout/AppDrawer.svelte +2 -1
- package/components/apps/components/layout/AppSplitpanes.svelte +3 -3
- package/components/apps/components/layout/AppTabs.svelte +1 -1
- package/components/apps/editor/AppEditor.svelte +21 -49
- package/components/apps/editor/AppEditorHeader.svelte +0 -5
- package/components/apps/editor/AppPreview.svelte +7 -18
- package/components/apps/editor/ComponentHeader.svelte +0 -1
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/GridEditor.svelte +12 -22
- package/components/apps/editor/GridViewer.svelte +2 -2
- package/components/apps/editor/GridViewer.svelte.d.ts +1 -1
- package/components/apps/editor/RecomputeAllComponents.svelte +7 -5
- package/components/apps/editor/SettingsPanel.svelte +4 -4
- package/components/apps/editor/SubGridEditor.svelte +12 -13
- package/components/apps/editor/appUtils.d.ts +0 -1
- package/components/apps/editor/appUtils.js +0 -19
- package/components/apps/editor/component/Component.svelte +8 -19
- package/components/apps/editor/component/Component.svelte.d.ts +1 -1
- package/components/apps/editor/component/ComponentNavigation.svelte +47 -57
- package/components/apps/editor/component/README.md +0 -4
- package/components/apps/editor/component/components.d.ts +28 -45
- package/components/apps/editor/component/components.js +27 -41
- package/components/apps/editor/component/sets.js +1 -2
- package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
- package/components/apps/editor/componentsPanel/CssProperty.svelte +48 -62
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +2 -3
- package/components/apps/editor/componentsPanel/CssSettings.svelte +0 -1
- package/components/apps/editor/componentsPanel/store.js +4 -4
- package/components/apps/editor/contextPanel/ComponentOutput.svelte +26 -2
- package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +1 -0
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +6 -8
- package/components/apps/editor/contextPanel/ContextPanel.svelte +14 -7
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +25 -2
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
- package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +40 -29
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +2 -1
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +7 -2
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte.d.ts +1 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +11 -10
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte +3 -4
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorPanel.svelte.d.ts +0 -1
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +1 -0
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +0 -2
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +19 -22
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +13 -42
- package/components/apps/editor/settingsPanel/GridTab.svelte +2 -1
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +1 -2
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +0 -4
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +0 -1
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +2 -1
- package/components/apps/editor/settingsPanel/TableActions.svelte +3 -3
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +12 -12
- package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +2 -3
- package/components/apps/editor/settingsPanel/inputEditor/EvalInputEditor.svelte +1 -5
- package/components/apps/editor/settingsPanel/inputEditor/IconSelectInput.svelte +3 -3
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte +2 -3
- package/components/apps/editor/settingsPanel/inputEditor/JsonEditor.svelte.d.ts +1 -4
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +3 -3
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
- package/components/apps/inputType.d.ts +2 -2
- package/components/apps/rx.d.ts +2 -2
- package/components/apps/svelte-grid/Grid.svelte +34 -50
- package/components/apps/svelte-grid/Grid.svelte.d.ts +9 -14
- package/components/apps/svelte-grid/MoveResize.svelte +55 -76
- package/components/apps/svelte-grid/MoveResize.svelte.d.ts +9 -15
- package/components/apps/svelte-grid/utils/helper.d.ts +1 -0
- package/components/apps/svelte-grid/utils/helper.js +3 -0
- package/components/apps/types.d.ts +5 -9
- package/components/apps/utils.d.ts +0 -2
- package/components/apps/utils.js +1 -33
- package/components/common/button/ButtonPopup.svelte +2 -5
- package/components/common/button/ButtonPopup.svelte.d.ts +1 -5
- package/components/common/button/ButtonPopupItem.svelte +1 -2
- package/components/common/button/ButtonPopupItem.svelte.d.ts +0 -1
- package/components/common/index.d.ts +0 -1
- package/components/common/index.js +0 -1
- package/components/common/kbd/Kbd.svelte +1 -4
- package/components/common/kbd/Kbd.svelte.d.ts +14 -6
- package/components/common/menu/Menu.svelte +2 -8
- package/components/common/menu/Menu.svelte.d.ts +1 -4
- package/components/flows/map/MapItem.svelte +3 -3
- package/components/propertyPicker/ObjectViewer.svelte +3 -0
- package/components/scriptEditor/LogPanel.svelte +3 -3
- package/infer.js +1 -6
- package/package.json +2 -11
- package/utils.d.ts +0 -1
- package/utils.js +0 -3
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +0 -170
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte.d.ts +0 -18
- package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +0 -130
- package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte.d.ts +0 -21
- package/components/apps/editor/componentsPanel/quickStyleProperties.d.ts +0 -535
- package/components/apps/editor/componentsPanel/quickStyleProperties.js +0 -598
- package/components/apps/editor/settingsPanel/StylePanel.svelte +0 -61
- package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +0 -17
- package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +0 -47
- package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte.d.ts +0 -14
- package/components/apps/editor/settingsPanel/secondaryMenu/index.d.ts +0 -2
- package/components/apps/editor/settingsPanel/secondaryMenu/index.js +0 -2
- package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.d.ts +0 -12
- package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.js +0 -10
- package/components/common/clearableInput/ClearableInput.svelte +0 -56
- package/components/common/clearableInput/ClearableInput.svelte.d.ts +0 -28
- package/components/common/modal/AlwaysMountedModal.svelte +0 -109
- package/components/common/modal/AlwaysMountedModal.svelte.d.ts +0 -22
|
@@ -1,81 +1,67 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { createEventDispatcher, getContext } from 'svelte';
|
|
1
|
+
<script>import { X } from 'lucide-svelte';
|
|
3
2
|
import { fade } from 'svelte/transition';
|
|
4
|
-
import { addWhitespaceBeforeCapitals
|
|
5
|
-
import { Button, ClearableInput } from '../../../common';
|
|
6
|
-
import Popover from '../../../Popover.svelte';
|
|
7
|
-
import QuickStyleMenu from './QuickStyleMenu.svelte';
|
|
3
|
+
import { addWhitespaceBeforeCapitals } from '../../../../utils';
|
|
8
4
|
export let name;
|
|
9
5
|
export let value = {};
|
|
10
6
|
export let forceStyle = false;
|
|
11
7
|
export let forceClass = false;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
$: dispatch('change', value);
|
|
17
|
-
function toggleQuickMenu() {
|
|
18
|
-
isQuickMenuOpen = !isQuickMenuOpen;
|
|
8
|
+
function reset(property) {
|
|
9
|
+
if (value) {
|
|
10
|
+
value[property] = '';
|
|
11
|
+
}
|
|
19
12
|
}
|
|
20
13
|
</script>
|
|
21
14
|
|
|
22
|
-
<div
|
|
23
|
-
class="sticky top-0 z-20 text-lg bg-white font-semibold [font-variant:small-caps] text-gray-700 pt-2 pb-1"
|
|
24
|
-
>
|
|
15
|
+
<div class="text-sm font-semibold text-gray-500 capitalize pt-2">
|
|
25
16
|
{addWhitespaceBeforeCapitals(name)}
|
|
26
17
|
</div>
|
|
27
18
|
{#if value}
|
|
28
|
-
<div class="border-l border-gray-400/80 py-1 pl-3.5 ml-0.5">
|
|
19
|
+
<div class="border-l border-gray-400/80 py-1 pl-3.5 mt-1 ml-0.5">
|
|
29
20
|
{#if value.style !== undefined || forceStyle}
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
: ''}"
|
|
53
|
-
aria-label="{isQuickMenuOpen ? 'Close' : 'Open'} styling menu"
|
|
54
|
-
on:click={toggleQuickMenu}
|
|
55
|
-
>
|
|
56
|
-
<Paintbrush2 size={18} />
|
|
57
|
-
</Button>
|
|
58
|
-
<svelte:fragment slot="text">
|
|
59
|
-
{isQuickMenuOpen ? 'Close' : 'Open'} styling menu
|
|
60
|
-
</svelte:fragment>
|
|
61
|
-
</Popover>
|
|
62
|
-
{/if}
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</label>
|
|
66
|
-
{#if quickStyleProperties?.length && isQuickMenuOpen}
|
|
67
|
-
<div transition:fade|local={{ duration: 200 }} class="w-full pt-1">
|
|
68
|
-
<QuickStyleMenu bind:value={value.style} properties={quickStyleProperties} />
|
|
69
|
-
</div>
|
|
70
|
-
{/if}
|
|
71
|
-
</div>
|
|
21
|
+
<label class="block pb-2">
|
|
22
|
+
<div class="text-xs font-medium pb-0.5"> Style </div>
|
|
23
|
+
<div class="relative">
|
|
24
|
+
<input
|
|
25
|
+
on:keydown|stopPropagation
|
|
26
|
+
type="text"
|
|
27
|
+
class="!pr-7"
|
|
28
|
+
bind:value={value.style}
|
|
29
|
+
on:focus
|
|
30
|
+
/>
|
|
31
|
+
{#if value?.style}
|
|
32
|
+
<button
|
|
33
|
+
transition:fade|local={{ duration: 100 }}
|
|
34
|
+
class="absolute z-10 top-1.5 right-1 rounded-full p-1 duration-200 hover:bg-gray-200"
|
|
35
|
+
aria-label="Remove styles"
|
|
36
|
+
on:click|preventDefault|stopPropagation={() => reset('style')}
|
|
37
|
+
>
|
|
38
|
+
<X size={14} />
|
|
39
|
+
</button>
|
|
40
|
+
{/if}
|
|
41
|
+
</div>
|
|
42
|
+
</label>
|
|
72
43
|
{/if}
|
|
73
44
|
{#if value.class !== undefined || forceClass}
|
|
74
|
-
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
75
45
|
<label class="block">
|
|
76
|
-
<div class="text-
|
|
46
|
+
<div class="text-xs font-medium pb-0.5"> Tailwind classes </div>
|
|
77
47
|
<div class="relative">
|
|
78
|
-
<
|
|
48
|
+
<input
|
|
49
|
+
on:keydown|stopPropagation
|
|
50
|
+
type="text"
|
|
51
|
+
class="!pr-7"
|
|
52
|
+
bind:value={value.class}
|
|
53
|
+
on:focus
|
|
54
|
+
/>
|
|
55
|
+
{#if value?.class}
|
|
56
|
+
<button
|
|
57
|
+
transition:fade|local={{ duration: 100 }}
|
|
58
|
+
class="absolute z-10 top-1.5 right-1 rounded-full p-1 duration-200 hover:bg-gray-200"
|
|
59
|
+
aria-label="Remove classes"
|
|
60
|
+
on:click|preventDefault|stopPropagation={() => reset('class')}
|
|
61
|
+
>
|
|
62
|
+
<X size={14} />
|
|
63
|
+
</button>
|
|
64
|
+
{/if}
|
|
79
65
|
</div>
|
|
80
66
|
</label>
|
|
81
67
|
{/if}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { ComponentCssProperty } from '../../types';
|
|
3
|
-
import type { StylePropertyKey } from './quickStyleProperties';
|
|
4
3
|
declare const __propDef: {
|
|
5
4
|
props: {
|
|
6
5
|
name: string;
|
|
7
6
|
value?: ComponentCssProperty | undefined;
|
|
8
7
|
forceStyle?: boolean | undefined;
|
|
9
8
|
forceClass?: boolean | undefined;
|
|
10
|
-
quickStyleProperties?: StylePropertyKey[] | undefined;
|
|
11
9
|
};
|
|
12
10
|
events: {
|
|
13
|
-
|
|
11
|
+
keydown: KeyboardEvent;
|
|
12
|
+
focus: FocusEvent;
|
|
14
13
|
} & {
|
|
15
14
|
[evt: string]: CustomEvent<any>;
|
|
16
15
|
};
|
|
@@ -53,7 +53,6 @@ entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
|
53
53
|
let search = '';
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
|
-
<h3 class="w-full text-center text-gray-600 py-1">Global Styling</h3>
|
|
57
56
|
<Tabs selected="ui" on:selected={(e) => switchTab(e.detail === 'json')} class="relative">
|
|
58
57
|
<Tab value="ui" size="xs" class="grow">
|
|
59
58
|
<div class="m-1 center-center">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writable } from
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
2
|
const store = writable({});
|
|
3
3
|
export const isOpenStore = {
|
|
4
4
|
subscribe: store.subscribe,
|
|
@@ -6,11 +6,11 @@ export const isOpenStore = {
|
|
|
6
6
|
/** If an item is already set, it won't get updated. */
|
|
7
7
|
addItems: (items) => {
|
|
8
8
|
let newItems = {};
|
|
9
|
-
items.forEach(
|
|
10
|
-
store.update(
|
|
9
|
+
items.forEach(item => newItems = { ...newItems, ...item });
|
|
10
|
+
store.update(last => ({ ...newItems, ...last }));
|
|
11
11
|
},
|
|
12
12
|
toggle: (id) => {
|
|
13
|
-
store.update(
|
|
13
|
+
store.update(last => ({ ...last, [id]: !last[id] }));
|
|
14
14
|
},
|
|
15
15
|
reset: () => store.set({})
|
|
16
16
|
};
|
|
@@ -8,8 +8,9 @@ import TableActionsOutput from './components/TableActionsOutput.svelte';
|
|
|
8
8
|
export let gridItem;
|
|
9
9
|
export let first = false;
|
|
10
10
|
export let nested = false;
|
|
11
|
+
export let parentId = undefined;
|
|
11
12
|
export let expanded = false;
|
|
12
|
-
const { connectingInput } = getContext('AppViewerContext');
|
|
13
|
+
const { selectedComponent, connectingInput } = getContext('AppViewerContext');
|
|
13
14
|
const name = getComponentNameById(gridItem.id);
|
|
14
15
|
function getComponentNameById(componentId) {
|
|
15
16
|
if (gridItem?.data?.type) {
|
|
@@ -26,9 +27,32 @@ function getComponentNameById(componentId) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
$: subGrids = Array.from({ length: gridItem.data.numberOfSubgrids ?? 0 }).map((_, i) => `${gridItem.id}-${i}`);
|
|
30
|
+
function onHeaderClick(manuallyOpen) {
|
|
31
|
+
if (manuallyOpen) {
|
|
32
|
+
if (parentId) {
|
|
33
|
+
$selectedComponent = parentId;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
$selectedComponent = undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
$selectedComponent = gridItem.id;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
29
43
|
</script>
|
|
30
44
|
|
|
31
|
-
<OutputHeader
|
|
45
|
+
<OutputHeader
|
|
46
|
+
on:handleClick={(e) => {
|
|
47
|
+
if (!$connectingInput.opened) {
|
|
48
|
+
onHeaderClick(e.detail.manuallyOpen)
|
|
49
|
+
}
|
|
50
|
+
}}
|
|
51
|
+
id={gridItem.id}
|
|
52
|
+
name={getComponentNameById(gridItem.id)}
|
|
53
|
+
{first}
|
|
54
|
+
{nested}
|
|
55
|
+
>
|
|
32
56
|
<ComponentOutputViewer
|
|
33
57
|
componentId={gridItem.id}
|
|
34
58
|
on:select={({ detail }) => {
|
|
@@ -23,12 +23,10 @@ $: filtered = recursivelyFilterInJSON(object, $search, componentId);
|
|
|
23
23
|
$: $hasResult[componentId] = Object.keys(filtered).length > 0;
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
{#if
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class="text-xs pl-2 text-gray-600">No outputs</div>
|
|
33
|
-
{/if}
|
|
26
|
+
{#if $hasResult[componentId] || $search == ''}
|
|
27
|
+
<ObjectViewer json={filtered} on:select topBrackets={false} />
|
|
28
|
+
{:else if $search.length > 0}
|
|
29
|
+
<div class="text-xs pl-2 text-gray-600">No results</div>
|
|
30
|
+
{:else}
|
|
31
|
+
<div class="text-xs pl-2 text-gray-600">No outputs</div>
|
|
34
32
|
{/if}
|
|
@@ -6,21 +6,24 @@ import PanelSection from '../settingsPanel/common/PanelSection.svelte';
|
|
|
6
6
|
import ComponentOutput from './ComponentOutput.svelte';
|
|
7
7
|
import ComponentOutputViewer from './ComponentOutputViewer.svelte';
|
|
8
8
|
import BackgroundScriptsOutput from './components/BackgroundScriptsOutput.svelte';
|
|
9
|
+
import MinMaxButton from './components/MinMaxButton.svelte';
|
|
9
10
|
import OutputHeader from './components/OutputHeader.svelte';
|
|
10
11
|
const { connectingInput, app } = getContext('AppViewerContext');
|
|
11
12
|
let search = writable('');
|
|
13
|
+
let expanded = writable(false);
|
|
12
14
|
setContext('ContextPanel', {
|
|
13
15
|
search,
|
|
14
16
|
manuallyOpened: writable({}),
|
|
15
|
-
hasResult: writable({})
|
|
17
|
+
hasResult: writable({}),
|
|
18
|
+
expanded
|
|
16
19
|
});
|
|
17
20
|
</script>
|
|
18
21
|
|
|
19
|
-
<PanelSection noPadding titlePadding="px-
|
|
20
|
-
<div class="bg-white
|
|
22
|
+
<PanelSection noPadding titlePadding="px-4 pt-2 pb-0.5" title="Outputs">
|
|
23
|
+
<div class="bg-white w-full h-full z-30">
|
|
21
24
|
<div class="min-w-[150px]">
|
|
22
|
-
<div class="sticky z-10 top-0 left-0 w-full bg-white p-
|
|
23
|
-
<div class="relative
|
|
25
|
+
<div class="sticky z-10 top-0 left-0 w-full bg-white p-2">
|
|
26
|
+
<div class="relative">
|
|
24
27
|
<input
|
|
25
28
|
bind:value={$search}
|
|
26
29
|
class="px-2 pb-1 border border-gray-300 rounded-sm {search ? 'pr-8' : ''}"
|
|
@@ -37,11 +40,15 @@ setContext('ContextPanel', {
|
|
|
37
40
|
</div>
|
|
38
41
|
</div>
|
|
39
42
|
|
|
43
|
+
<div class="p-1 ">
|
|
44
|
+
<MinMaxButton bind:expanded={$expanded} />
|
|
45
|
+
</div>
|
|
46
|
+
|
|
40
47
|
<div class="flex flex-col gap-4">
|
|
41
48
|
<div>
|
|
42
49
|
<span class="text-xs font-bold p-2">State & Context</span>
|
|
43
50
|
|
|
44
|
-
<OutputHeader
|
|
51
|
+
<OutputHeader id={'ctx'} name={'App Context'} first color="blue">
|
|
45
52
|
<ComponentOutputViewer
|
|
46
53
|
componentId={'ctx'}
|
|
47
54
|
on:select={({ detail }) => {
|
|
@@ -50,7 +57,7 @@ setContext('ContextPanel', {
|
|
|
50
57
|
/>
|
|
51
58
|
</OutputHeader>
|
|
52
59
|
|
|
53
|
-
<OutputHeader
|
|
60
|
+
<OutputHeader id={'state'} name={'State'} color="blue">
|
|
54
61
|
<ComponentOutputViewer
|
|
55
62
|
componentId={'state'}
|
|
56
63
|
on:select={({ detail }) => {
|
|
@@ -2,13 +2,36 @@
|
|
|
2
2
|
import { connectInput } from '../../appUtils';
|
|
3
3
|
import ComponentOutputViewer from '../ComponentOutputViewer.svelte';
|
|
4
4
|
import OutputHeader from './OutputHeader.svelte';
|
|
5
|
-
const { connectingInput } = getContext('AppViewerContext');
|
|
5
|
+
const { selectedComponent, connectingInput } = getContext('AppViewerContext');
|
|
6
6
|
export let id;
|
|
7
7
|
export let name;
|
|
8
8
|
export let first = false;
|
|
9
|
+
function onHeaderClick(manuallyOpen) {
|
|
10
|
+
if (manuallyOpen) {
|
|
11
|
+
if (id) {
|
|
12
|
+
$selectedComponent = id;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
$selectedComponent = undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
$selectedComponent = id;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
9
22
|
</script>
|
|
10
23
|
|
|
11
|
-
<OutputHeader
|
|
24
|
+
<OutputHeader
|
|
25
|
+
{id}
|
|
26
|
+
{name}
|
|
27
|
+
color="blue"
|
|
28
|
+
{first}
|
|
29
|
+
on:handleClick={(e) => {
|
|
30
|
+
if (!$connectingInput.opened) {
|
|
31
|
+
onHeaderClick(e.detail.manuallyOpen)
|
|
32
|
+
}
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
12
35
|
<ComponentOutputViewer
|
|
13
36
|
componentId={id}
|
|
14
37
|
on:select={({ detail }) => {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>import Button from '../../../../common/button/Button.svelte';
|
|
2
|
+
import { Maximize, Minimize } from 'lucide-svelte';
|
|
3
|
+
export let expanded = false;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<Button
|
|
7
|
+
on:click={() => {
|
|
8
|
+
expanded = !expanded
|
|
9
|
+
}}
|
|
10
|
+
color="light"
|
|
11
|
+
size="xs"
|
|
12
|
+
variant="border"
|
|
13
|
+
>
|
|
14
|
+
{#if !expanded}
|
|
15
|
+
<div class="flex flex-row gap-2">
|
|
16
|
+
<Maximize size="14" />
|
|
17
|
+
Expand all
|
|
18
|
+
</div>
|
|
19
|
+
{:else}
|
|
20
|
+
<div class="flex flex-row gap-2">
|
|
21
|
+
<Minimize size="14" />
|
|
22
|
+
Collapse all
|
|
23
|
+
</div>
|
|
24
|
+
{/if}
|
|
25
|
+
</Button>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
expanded?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export type MinMaxButtonProps = typeof __propDef.props;
|
|
12
|
+
export type MinMaxButtonEvents = typeof __propDef.events;
|
|
13
|
+
export type MinMaxButtonSlots = typeof __propDef.slots;
|
|
14
|
+
export default class MinMaxButton extends SvelteComponentTyped<MinMaxButtonProps, MinMaxButtonEvents, MinMaxButtonSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<script>import { classNames } from '../../../../../utils';
|
|
2
|
-
import { ChevronDown, ChevronUp
|
|
3
|
-
import { getContext } from 'svelte';
|
|
2
|
+
import { ChevronDown, ChevronUp } from 'lucide-svelte';
|
|
3
|
+
import { createEventDispatcher, getContext } from 'svelte';
|
|
4
4
|
import { allsubIds } from '../../appUtils';
|
|
5
5
|
export let id;
|
|
6
6
|
export let name;
|
|
7
7
|
export let first = false;
|
|
8
8
|
export let nested = false;
|
|
9
9
|
export let color = 'indigo';
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
|
|
13
|
-
$: subids = $search != '' ? allsubIds($app, id) : [];
|
|
10
|
+
const { expanded, manuallyOpened, search, hasResult } = getContext('ContextPanel');
|
|
11
|
+
const { selectedComponent, app, hoverStore } = getContext('AppViewerContext');
|
|
12
|
+
$: subids = allsubIds($app, id);
|
|
14
13
|
$: inSearch =
|
|
15
14
|
$search != '' &&
|
|
16
15
|
($hasResult[id] ||
|
|
17
16
|
Object.entries($hasResult).some(([key, value]) => value && subids.includes(key)));
|
|
18
|
-
$: open =
|
|
17
|
+
$: open =
|
|
18
|
+
$expanded || subids.includes($selectedComponent ?? '') || $manuallyOpened[id] || inSearch;
|
|
19
|
+
const dispatch = createEventDispatcher();
|
|
19
20
|
const hoverColor = {
|
|
20
21
|
blue: 'hover:bg-blue-300 hover:text-blue-600',
|
|
21
22
|
indigo: 'hover:bg-indigo-300 hover:text-indigo-600'
|
|
@@ -51,35 +52,29 @@ const idClass = {
|
|
|
51
52
|
class={classNames(
|
|
52
53
|
'flex items-center justify-between p-1 cursor-pointer border-b gap-1 truncate',
|
|
53
54
|
hoverColor[color],
|
|
54
|
-
$selectedComponent
|
|
55
|
+
$selectedComponent == id ? openBackground[color] : 'bg-white',
|
|
55
56
|
first ? 'border-t' : '',
|
|
56
57
|
nested ? 'border-l' : ''
|
|
57
58
|
)}
|
|
58
59
|
on:click={() => {
|
|
60
|
+
dispatch('handleClick', { manuallyOpen: $manuallyOpened[id] })
|
|
59
61
|
$manuallyOpened[id] = $manuallyOpened[id] != undefined ? !$manuallyOpened[id] : true
|
|
60
62
|
}}
|
|
61
63
|
>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
<div
|
|
65
|
+
class={classNames(
|
|
66
|
+
'text-2xs ml-0.5 font-bold px-2 py-0.5 rounded-sm',
|
|
67
|
+
$selectedComponent == id ? idClass[color] : ' bg-gray-100'
|
|
68
|
+
)}
|
|
69
|
+
>
|
|
70
|
+
{id}
|
|
71
|
+
</div>
|
|
72
|
+
<div
|
|
73
|
+
on:click|stopPropagation={() => {
|
|
74
|
+
$manuallyOpened[id] = $manuallyOpened[id] != undefined ? !$manuallyOpened[id] : true
|
|
75
|
+
}}
|
|
76
|
+
class="text-2xs font-bold flex flex-row gap-2 items-center truncate"
|
|
67
77
|
>
|
|
68
|
-
<div
|
|
69
|
-
class={classNames(
|
|
70
|
-
'text-2xs font-bold px-2 py-0.5 rounded-sm',
|
|
71
|
-
$selectedComponent?.includes(id) ? idClass[color] : ''
|
|
72
|
-
)}
|
|
73
|
-
>
|
|
74
|
-
{id}
|
|
75
|
-
</div>
|
|
76
|
-
{#if selectable && !$selectedComponent?.includes(id)}
|
|
77
|
-
<div class=" px-1 ">
|
|
78
|
-
<Pointer size={14} />
|
|
79
|
-
</div>
|
|
80
|
-
{/if}
|
|
81
|
-
</button>
|
|
82
|
-
<div class="text-2xs font-bold flex flex-row gap-2 items-center truncate">
|
|
83
78
|
{name}
|
|
84
79
|
{#if !open}
|
|
85
80
|
<ChevronDown size={14} />
|
|
@@ -90,9 +85,25 @@ const idClass = {
|
|
|
90
85
|
{/if}
|
|
91
86
|
</div>
|
|
92
87
|
</div>
|
|
93
|
-
<div class="border-b {open ? '
|
|
88
|
+
<div class="scale border-b overflow-hidden {open ? 'py-1 scale-y' : 'scale-0 max-h-0'} ">
|
|
94
89
|
<div class={classNames(nested ? 'border-l ml-2' : '')}>
|
|
95
90
|
<slot />
|
|
96
91
|
</div>
|
|
97
92
|
</div>
|
|
98
93
|
</div>
|
|
94
|
+
|
|
95
|
+
<style>
|
|
96
|
+
.scale {
|
|
97
|
+
transform-origin: top;
|
|
98
|
+
transition: transform 0.26s ease;
|
|
99
|
+
}
|
|
100
|
+
.scale-y {
|
|
101
|
+
transform: scaleY(1);
|
|
102
|
+
max-height: 100%;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.scale-0 {
|
|
106
|
+
transform: scaleY(0);
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
max-height: 0;
|
|
109
|
+
}</style>
|
|
@@ -6,9 +6,10 @@ declare const __propDef: {
|
|
|
6
6
|
first?: boolean | undefined;
|
|
7
7
|
nested?: boolean | undefined;
|
|
8
8
|
color?: "blue" | "indigo" | undefined;
|
|
9
|
-
selectable?: boolean | undefined;
|
|
10
9
|
};
|
|
11
10
|
events: {
|
|
11
|
+
handleClick: CustomEvent<any>;
|
|
12
|
+
} & {
|
|
12
13
|
[evt: string]: CustomEvent<any>;
|
|
13
14
|
};
|
|
14
15
|
slots: {
|
|
@@ -14,7 +14,7 @@ import { defaultCode } from '../component';
|
|
|
14
14
|
import InlineScriptList from '../settingsPanel/mainInput/InlineScriptList.svelte';
|
|
15
15
|
import WorkspaceScriptList from '../settingsPanel/mainInput/WorkspaceScriptList.svelte';
|
|
16
16
|
export let name;
|
|
17
|
-
export let
|
|
17
|
+
export let id;
|
|
18
18
|
let tab = 'inlinescripts';
|
|
19
19
|
let filter = '';
|
|
20
20
|
let picker;
|
|
@@ -30,6 +30,7 @@ async function inferInlineScriptSchema(language, content, schema) {
|
|
|
30
30
|
return schema;
|
|
31
31
|
}
|
|
32
32
|
async function createInlineScriptByLanguage(language, path, subkind = undefined) {
|
|
33
|
+
const componentType = $app.grid.find((c) => c.data.id === id)?.data?.type;
|
|
33
34
|
const content = defaultCode(componentType ?? '', language) ??
|
|
34
35
|
initialCode(language, Script.kind.SCRIPT, subkind ?? 'flow');
|
|
35
36
|
return newInlineScript(content, language, path);
|
|
@@ -62,6 +63,9 @@ function pickInlineScript(name) {
|
|
|
62
63
|
dispatch('new', unusedInlineScript.inlineScript);
|
|
63
64
|
}
|
|
64
65
|
const langs = ['deno', 'python3', 'go', 'bash'];
|
|
66
|
+
function loadSchemaFromTriggerable(path, arg1) {
|
|
67
|
+
throw new Error('Function not implemented.');
|
|
68
|
+
}
|
|
65
69
|
</script>
|
|
66
70
|
|
|
67
71
|
<Drawer bind:this={picker} size="1000px">
|
|
@@ -180,7 +184,8 @@ console.log(ctx.email)
|
|
|
180
184
|
if (!state.foo) { state.foo = 0 }
|
|
181
185
|
state.foo += 1
|
|
182
186
|
|
|
183
|
-
// you can also navigate
|
|
187
|
+
// you can also navigate to another page
|
|
188
|
+
//await goto("?foo=bar")
|
|
184
189
|
|
|
185
190
|
return state.foo`,
|
|
186
191
|
language: 'frontend',
|
|
@@ -5,7 +5,7 @@ import InlineScriptEditorDrawer from './InlineScriptEditorDrawer.svelte';
|
|
|
5
5
|
import { inferArgs } from '../../../../infer';
|
|
6
6
|
import Badge from '../../../common/badge/Badge.svelte';
|
|
7
7
|
import Editor from '../../../Editor.svelte';
|
|
8
|
-
import { emptySchema,
|
|
8
|
+
import { emptySchema, scriptLangToEditorLang } from '../../../../utils';
|
|
9
9
|
import Popover from '../../../Popover.svelte';
|
|
10
10
|
import { computeFields } from './utils';
|
|
11
11
|
import { deepEqual } from 'fast-equals';
|
|
@@ -58,6 +58,7 @@ async function loadSchemaAndInputsByName() {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
let isMac = navigator.userAgent.indexOf('Mac OS X') !== -1;
|
|
61
62
|
$: extraLib =
|
|
62
63
|
inlineScript?.language == 'frontend' && worldStore
|
|
63
64
|
? buildExtraLib($worldStore?.outputsById ?? {}, id, false, $state, true)
|
|
@@ -148,7 +149,7 @@ function handleRefreshOn(refreshOn) {
|
|
|
148
149
|
Format
|
|
149
150
|
|
|
150
151
|
<div class="flex flex-row items-center gap-1">
|
|
151
|
-
<Kbd>{isMac
|
|
152
|
+
<Kbd>{isMac ? '⌘' : 'CTRL'}</Kbd>
|
|
152
153
|
<Kbd>S</Kbd>
|
|
153
154
|
</div>
|
|
154
155
|
</div>
|
|
@@ -162,7 +163,7 @@ function handleRefreshOn(refreshOn) {
|
|
|
162
163
|
btnClasses="!px-2 !py-1 !bg-gray-700 !text-white hover:!bg-gray-900"
|
|
163
164
|
on:click={async () => {
|
|
164
165
|
runLoading = true
|
|
165
|
-
await $runnableComponents[id]?.
|
|
166
|
+
await $runnableComponents[id]?.(!transformer ? inlineScript : undefined)
|
|
166
167
|
runLoading = false
|
|
167
168
|
}}
|
|
168
169
|
>
|
|
@@ -170,7 +171,7 @@ function handleRefreshOn(refreshOn) {
|
|
|
170
171
|
Run
|
|
171
172
|
|
|
172
173
|
<div class="flex flex-row items-center gap-1">
|
|
173
|
-
<Kbd>{isMac
|
|
174
|
+
<Kbd>{isMac ? '⌘' : 'CTRL'}</Kbd>
|
|
174
175
|
<Kbd>
|
|
175
176
|
<div class="h-4 flex items-center justify-center">
|
|
176
177
|
<CornerDownLeft size={10} />
|
|
@@ -198,7 +199,7 @@ function handleRefreshOn(refreshOn) {
|
|
|
198
199
|
inlineScript.content = editor?.getCode() ?? ''
|
|
199
200
|
}
|
|
200
201
|
runLoading = true
|
|
201
|
-
await $runnableComponents[id]?.
|
|
202
|
+
await $runnableComponents[id]?.(inlineScript)
|
|
202
203
|
runLoading = false
|
|
203
204
|
}}
|
|
204
205
|
on:change={async (e) => {
|
|
@@ -219,15 +220,15 @@ function handleRefreshOn(refreshOn) {
|
|
|
219
220
|
{:else}
|
|
220
221
|
<SimpleEditor
|
|
221
222
|
bind:this={simpleEditor}
|
|
222
|
-
class="h-full"
|
|
223
|
-
{extraLib}
|
|
224
|
-
bind:code={inlineScript.content}
|
|
225
|
-
lang="javascript"
|
|
226
223
|
cmdEnterAction={async () => {
|
|
227
224
|
runLoading = true
|
|
228
|
-
await $runnableComponents[id]?.
|
|
225
|
+
await $runnableComponents[id]?.(!transformer ? inlineScript : undefined)
|
|
229
226
|
runLoading = false
|
|
230
227
|
}}
|
|
228
|
+
class="h-full"
|
|
229
|
+
{extraLib}
|
|
230
|
+
bind:code={inlineScript.content}
|
|
231
|
+
lang="javascript"
|
|
231
232
|
on:change={() => {
|
|
232
233
|
$app = $app
|
|
233
234
|
}}
|
|
@@ -14,7 +14,6 @@ import { deepEqual } from 'fast-equals';
|
|
|
14
14
|
import { getContext } from 'svelte';
|
|
15
15
|
export let componentInput;
|
|
16
16
|
export let defaultUserInput = false;
|
|
17
|
-
export let componentType;
|
|
18
17
|
export let id;
|
|
19
18
|
export let transformer;
|
|
20
19
|
const { app } = getContext('AppViewerContext');
|
|
@@ -87,8 +86,8 @@ function deleteInlineScript() {
|
|
|
87
86
|
}}
|
|
88
87
|
/>
|
|
89
88
|
{:else}
|
|
90
|
-
<span class="px-2 text-gray-600"
|
|
91
|
-
Selected editor component is a transformer but component has no transformer
|
|
89
|
+
<span class="px-2 text-gray-600"
|
|
90
|
+
>Selected editor component is a transformer but component has no transformer
|
|
92
91
|
</span>
|
|
93
92
|
{/if}
|
|
94
93
|
{:else if componentInput && componentInput.type == 'runnable'}
|
|
@@ -105,7 +104,7 @@ function deleteInlineScript() {
|
|
|
105
104
|
/>
|
|
106
105
|
{:else}
|
|
107
106
|
<EmptyInlineScript
|
|
108
|
-
{
|
|
107
|
+
{id}
|
|
109
108
|
name={componentInput.runnable.name}
|
|
110
109
|
on:delete={deleteInlineScript}
|
|
111
110
|
on:new={(e) => {
|