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
|
@@ -62,6 +62,7 @@ $: unusedInlineScript = $app?.unusedInlineScripts?.findIndex((k_, index) => `unu
|
|
|
62
62
|
/>
|
|
63
63
|
{:else}
|
|
64
64
|
<EmptyInlineScript
|
|
65
|
+
id={`b_${hiddenInlineScript}`}
|
|
65
66
|
name={$app.hiddenInlineScripts[hiddenInlineScript].name}
|
|
66
67
|
on:delete={() => deleteBackgroundScript(hiddenInlineScript)}
|
|
67
68
|
on:new={(e) => {
|
|
@@ -11,14 +11,14 @@ const { selectedComponentInEditor } = getContext('AppEditorContext');
|
|
|
11
11
|
function selectScript(id) {
|
|
12
12
|
$selectedComponentInEditor = id;
|
|
13
13
|
if (!id.startsWith('unused-') || !id.startsWith('bg_')) {
|
|
14
|
-
$selectedComponent =
|
|
14
|
+
$selectedComponent = $selectedComponentInEditor.split('_transformer')[0];
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
$: runnables = getAppScripts($app.grid, $app.subgrids);
|
|
18
18
|
// When selected component changes, update selectedScriptComponentId
|
|
19
19
|
$: if ($selectedComponent != $selectedComponentInEditor &&
|
|
20
20
|
!$selectedComponentInEditor?.includes('_transformer')) {
|
|
21
|
-
$selectedComponentInEditor = $selectedComponent
|
|
21
|
+
$selectedComponentInEditor = $selectedComponent;
|
|
22
22
|
}
|
|
23
23
|
function createBackgroundScript() {
|
|
24
24
|
let index = 0;
|
|
@@ -9,7 +9,6 @@ export let gridItem;
|
|
|
9
9
|
defaultUserInput={gridItem.data?.type == 'formcomponent' ||
|
|
10
10
|
gridItem?.data?.type == 'formbuttoncomponent'}
|
|
11
11
|
id={gridItem.data.id}
|
|
12
|
-
componentType={gridItem.data.type}
|
|
13
12
|
transformer={$selectedComponentInEditor?.endsWith('_transformer')}
|
|
14
13
|
bind:componentInput={gridItem.data.componentInput}
|
|
15
14
|
/>
|
|
@@ -19,7 +18,6 @@ export let gridItem;
|
|
|
19
18
|
{#each gridItem.data.actionButtons as actionButton, index (index)}
|
|
20
19
|
{#if actionButton?.id === $selectedComponentInEditor || actionButton?.id + '_transformer' === $selectedComponentInEditor}
|
|
21
20
|
<InlineScriptEditorPanel
|
|
22
|
-
componentType={actionButton.type}
|
|
23
21
|
id={actionButton.id}
|
|
24
22
|
transformer={$selectedComponentInEditor?.endsWith('_transformer')}
|
|
25
23
|
bind:componentInput={actionButton.componentInput}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { Button } from '../../../common';
|
|
2
|
-
import { faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { faPlus, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { X } from 'lucide-svelte';
|
|
4
4
|
import { createEventDispatcher } from 'svelte';
|
|
5
5
|
import { fade } from 'svelte/transition';
|
|
@@ -23,8 +23,8 @@ function addElementByType() {
|
|
|
23
23
|
else if (subFieldType === 'object') {
|
|
24
24
|
value.push({});
|
|
25
25
|
}
|
|
26
|
-
else if (subFieldType === 'labeledresource'
|
|
27
|
-
value.push({ value: '
|
|
26
|
+
else if (subFieldType === 'labeledresource') {
|
|
27
|
+
value.push({ value: '', label: '' });
|
|
28
28
|
}
|
|
29
29
|
else if (subFieldType === 'tab-select') {
|
|
30
30
|
value.push({ id: '', index: 0 });
|
|
@@ -49,31 +49,28 @@ function addElementByType() {
|
|
|
49
49
|
function deleteElementByType(index) {
|
|
50
50
|
if (componentInput.value) {
|
|
51
51
|
componentInput.value.splice(index, 1);
|
|
52
|
-
redraw = redraw + 1;
|
|
53
52
|
dispatch('deleteArrayItem', { index });
|
|
53
|
+
componentInput = componentInput;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
let redraw = 0;
|
|
57
56
|
</script>
|
|
58
57
|
|
|
59
58
|
<div class="flex gap-2 flex-col mt-2">
|
|
60
|
-
{#
|
|
61
|
-
{#
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
{/if}
|
|
76
|
-
{/key}
|
|
59
|
+
{#if Array.isArray(componentInput.value)}
|
|
60
|
+
{#each componentInput.value as value, index (index)}
|
|
61
|
+
<div class="flex flex-row gap-2 items-center relative">
|
|
62
|
+
<SubTypeEditor {subFieldType} bind:componentInput bind:value />
|
|
63
|
+
<button
|
|
64
|
+
transition:fade|local={{ duration: 100 }}
|
|
65
|
+
class="z-10 rounded-full p-1 duration-200 hover:bg-gray-200"
|
|
66
|
+
aria-label="Remove item"
|
|
67
|
+
on:click|preventDefault|stopPropagation={() => deleteElementByType(index)}
|
|
68
|
+
>
|
|
69
|
+
<X size={14} />
|
|
70
|
+
</button>
|
|
71
|
+
</div>
|
|
72
|
+
{/each}
|
|
73
|
+
{/if}
|
|
77
74
|
<Button size="xs" color="light" startIcon={{ icon: faPlus }} on:click={() => addElementByType()}>
|
|
78
75
|
Add
|
|
79
76
|
</Button>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import Button from '../../../common/button/Button.svelte';
|
|
2
|
-
import {
|
|
2
|
+
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { getContext } from 'svelte';
|
|
4
4
|
import PanelSection from './common/PanelSection.svelte';
|
|
5
5
|
import InputsSpecsEditor from './InputsSpecsEditor.svelte';
|
|
@@ -7,7 +7,7 @@ import TableActions from './TableActions.svelte';
|
|
|
7
7
|
import StaticInputEditor from './inputEditor/StaticInputEditor.svelte';
|
|
8
8
|
import ConnectedInputEditor from './inputEditor/ConnectedInputEditor.svelte';
|
|
9
9
|
import Badge from '../../../common/badge/Badge.svelte';
|
|
10
|
-
import { capitalize, classNames, getModifierKey
|
|
10
|
+
import { capitalize, classNames, getModifierKey } from '../../../../utils';
|
|
11
11
|
import { buildExtraLib, fieldTypeToTsType } from '../../utils';
|
|
12
12
|
import Recompute from './Recompute.svelte';
|
|
13
13
|
import Tooltip from '../../../Tooltip.svelte';
|
|
@@ -23,9 +23,6 @@ import GridPane from './GridPane.svelte';
|
|
|
23
23
|
import { slide } from 'svelte/transition';
|
|
24
24
|
import { push } from '../../../../history';
|
|
25
25
|
import Kbd from '../../../common/kbd/Kbd.svelte';
|
|
26
|
-
import { secondaryMenu } from './secondaryMenu';
|
|
27
|
-
import StylePanel from './StylePanel.svelte';
|
|
28
|
-
import { Delete } from 'lucide-svelte';
|
|
29
26
|
export let componentSettings = undefined;
|
|
30
27
|
export let rowColumns = false;
|
|
31
28
|
export let onDelete = undefined;
|
|
@@ -33,16 +30,13 @@ export let noGrid = false;
|
|
|
33
30
|
export let duplicateMoveAllowed = true;
|
|
34
31
|
let editor = undefined;
|
|
35
32
|
const { app, runnableComponents, selectedComponent, worldStore, focusedGrid, stateId, state, errorByComponent, jobs } = getContext('AppViewerContext');
|
|
36
|
-
const { history, ontextfocus
|
|
33
|
+
const { history, ontextfocus } = getContext('AppEditorContext');
|
|
37
34
|
$: editor && ($ontextfocus = () => editor?.focus());
|
|
38
35
|
function removeGridElement() {
|
|
39
36
|
push(history, $app);
|
|
40
37
|
if (componentSettings?.item.id) {
|
|
41
38
|
$errorByComponent = clearErrorByComponentId(componentSettings?.item.id, $errorByComponent);
|
|
42
39
|
$jobs = clearJobsByComponentId(componentSettings?.item.id, $jobs);
|
|
43
|
-
if ($movingcomponents?.includes(componentSettings?.item.id)) {
|
|
44
|
-
$movingcomponents = $movingcomponents.filter((id) => id !== componentSettings?.item.id);
|
|
45
|
-
}
|
|
46
40
|
}
|
|
47
41
|
$selectedComponent = undefined;
|
|
48
42
|
$focusedGrid = undefined;
|
|
@@ -65,10 +59,12 @@ $: extraLib =
|
|
|
65
59
|
? buildExtraLib($worldStore?.outputsById ?? {}, componentSettings?.item?.data?.id, false, $state, false)
|
|
66
60
|
: undefined;
|
|
67
61
|
function keydown(event) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
switch (event.key) {
|
|
63
|
+
case 'Delete': {
|
|
64
|
+
removeGridElement();
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
72
68
|
}
|
|
73
69
|
}
|
|
74
70
|
const initialConfiguration = componentSettings?.item?.data?.type
|
|
@@ -184,10 +180,6 @@ $: componentSettings?.item?.data && ($app = $app);
|
|
|
184
180
|
userInputEnabled={false}
|
|
185
181
|
/>
|
|
186
182
|
</PanelSection>
|
|
187
|
-
{:else}
|
|
188
|
-
<div class="h-full w-full font-bold text-gray-400 text-lg py-10 px-4"
|
|
189
|
-
>{ccomponents[component.type].name} has no configuration</div
|
|
190
|
-
>
|
|
191
183
|
{/if}
|
|
192
184
|
|
|
193
185
|
{#if componentSettings.item.data.type === 'tabscomponent'}
|
|
@@ -209,28 +201,19 @@ $: componentSettings?.item?.data && ($app = $app);
|
|
|
209
201
|
<div class="grow shrink" />
|
|
210
202
|
|
|
211
203
|
{#if Object.keys(ccomponents[component.type].customCss ?? {}).length > 0}
|
|
212
|
-
<PanelSection title="
|
|
204
|
+
<PanelSection title="Custom CSS">
|
|
213
205
|
<div slot="action">
|
|
214
206
|
<Button
|
|
215
207
|
color="light"
|
|
216
208
|
size="xs"
|
|
217
|
-
|
|
209
|
+
endIcon={{ icon: viewCssOptions ? faChevronUp : faChevronDown }}
|
|
218
210
|
on:click={() => (viewCssOptions = !viewCssOptions)}
|
|
219
211
|
>
|
|
220
212
|
{viewCssOptions ? 'Hide' : 'Show'}
|
|
221
213
|
</Button>
|
|
222
|
-
<Button
|
|
223
|
-
color="light"
|
|
224
|
-
size="xs"
|
|
225
|
-
variant="border"
|
|
226
|
-
endIcon={{ icon: faChevronRight }}
|
|
227
|
-
on:click={() => secondaryMenu.open(StylePanel, { component })}
|
|
228
|
-
>
|
|
229
|
-
Rich Editor
|
|
230
|
-
</Button>
|
|
231
214
|
</div>
|
|
232
215
|
{#if viewCssOptions}
|
|
233
|
-
<div transition:slide|local
|
|
216
|
+
<div transition:slide|local>
|
|
234
217
|
{#each Object.keys(ccomponents[component.type].customCss ?? {}) as name}
|
|
235
218
|
{#if componentSettings.item.data?.customCss != undefined}
|
|
236
219
|
<div class="w-full mb-2">
|
|
@@ -253,15 +236,7 @@ $: componentSettings?.item?.data && ($app = $app);
|
|
|
253
236
|
<div slot="action">
|
|
254
237
|
<Button size="xs" color="red" variant="border" on:click={removeGridElement}>
|
|
255
238
|
Delete
|
|
256
|
-
|
|
257
|
-
<Kbd kbdClass="center-center">
|
|
258
|
-
<span class="text-lg leading-none">⌘</span>
|
|
259
|
-
<span class="px-0.5">+</span>
|
|
260
|
-
<Delete size={16} />
|
|
261
|
-
</Kbd>
|
|
262
|
-
{:else}
|
|
263
|
-
<Kbd>Del</Kbd>
|
|
264
|
-
{/if}
|
|
239
|
+
<Kbd>Del</Kbd>
|
|
265
240
|
</Button>
|
|
266
241
|
</div>
|
|
267
242
|
<div class="flex flex-col gap-1">
|
|
@@ -281,10 +256,6 @@ $: componentSettings?.item?.data && ($app = $app);
|
|
|
281
256
|
<Kbd>↑</Kbd><Kbd>→</Kbd>
|
|
282
257
|
<Kbd>ESC</Kbd>
|
|
283
258
|
</div>
|
|
284
|
-
<div>
|
|
285
|
-
<span class="text-gray-600 text-xs mr-2">Add to selection:</span>
|
|
286
|
-
<Kbd>⇑</Kbd>+<Kbd>click</Kbd>
|
|
287
|
-
</div>
|
|
288
259
|
</div>
|
|
289
260
|
</PanelSection>
|
|
290
261
|
{/if}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>import Button from '../../../common/button/Button.svelte';
|
|
2
2
|
import CloseButton from '../../../common/CloseButton.svelte';
|
|
3
|
-
import { faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { faPlus, faTrashAlt } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { CrossIcon } from 'lucide-svelte';
|
|
4
5
|
import { getContext } from 'svelte';
|
|
5
6
|
import { deleteGridItem } from '../appUtils';
|
|
6
7
|
import PanelSection from './common/PanelSection.svelte';
|
|
@@ -23,7 +23,6 @@ export let fieldType;
|
|
|
23
23
|
export let subFieldType;
|
|
24
24
|
export let format;
|
|
25
25
|
export let selectOptions;
|
|
26
|
-
export let fileUpload = undefined;
|
|
27
26
|
export let placeholder;
|
|
28
27
|
const { connectingInput } = getContext('AppViewerContext');
|
|
29
28
|
$: if (componentInput == undefined) {
|
|
@@ -89,7 +88,7 @@ $: if (componentInput == undefined) {
|
|
|
89
88
|
<svelte:fragment slot="text">User Input</svelte:fragment>
|
|
90
89
|
</Popover>
|
|
91
90
|
{/if}
|
|
92
|
-
{#if fileUpload}
|
|
91
|
+
{#if 'fileUpload' in componentInput}
|
|
93
92
|
<Popover placement="bottom" notClickable disapperTimoout={0}>
|
|
94
93
|
<ToggleButton
|
|
95
94
|
position="center"
|
|
@@ -16,10 +16,6 @@ declare const __propDef: {
|
|
|
16
16
|
subFieldType: InputType | undefined;
|
|
17
17
|
format: string | undefined;
|
|
18
18
|
selectOptions: string[] | undefined;
|
|
19
|
-
fileUpload?: {
|
|
20
|
-
accept: string;
|
|
21
|
-
convertTo: string;
|
|
22
|
-
} | undefined;
|
|
23
19
|
placeholder: string | undefined;
|
|
24
20
|
};
|
|
25
21
|
events: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script>import Button from '../../../common/button/Button.svelte';
|
|
2
2
|
import Toggle from '../../../Toggle.svelte';
|
|
3
3
|
import Tooltip from '../../../Tooltip.svelte';
|
|
4
|
-
import { faClose } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { faClose, faEdit } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { includes } from 'lodash';
|
|
5
6
|
import { getContext } from 'svelte';
|
|
6
7
|
import { clearResultAppInput } from '../../utils';
|
|
7
8
|
import ComponentTriggerList from './triggerLists/ComponentTriggerList.svelte';
|
|
@@ -24,7 +24,7 @@ function deleteComponent(cid) {
|
|
|
24
24
|
components = components.filter((x) => x.id !== cid);
|
|
25
25
|
$errorByComponent = clearErrorByComponentId(cid, $errorByComponent);
|
|
26
26
|
$jobs = clearJobsByComponentId(cid, $jobs);
|
|
27
|
-
$selectedComponent =
|
|
27
|
+
$selectedComponent = id;
|
|
28
28
|
$app = $app;
|
|
29
29
|
}
|
|
30
30
|
</script>
|
|
@@ -49,10 +49,10 @@ function deleteComponent(cid) {
|
|
|
49
49
|
class={classNames(
|
|
50
50
|
'w-full text-xs font-bold gap-1 truncate py-1.5 px-2 cursor-pointer transition-all justify-between flex items-center border border-gray-3 rounded-md',
|
|
51
51
|
'bg-white border-gray-300 hover:bg-gray-100 focus:bg-gray-100 text-gray-700',
|
|
52
|
-
$selectedComponent
|
|
52
|
+
$selectedComponent === component.id ? 'outline outline-blue-500 bg-red-400' : ''
|
|
53
53
|
)}
|
|
54
54
|
on:click={() => {
|
|
55
|
-
$selectedComponent =
|
|
55
|
+
$selectedComponent = component.id
|
|
56
56
|
}}
|
|
57
57
|
on:keypress
|
|
58
58
|
>
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
|
|
3
|
-
import { ClearableInput } from '../../../../common';
|
|
4
|
-
export let value = '#fff';
|
|
5
|
-
const dispatch = createEventDispatcher();
|
|
1
|
+
<script>import ColorPicker, { ChromeVariant } from 'svelte-awesome-color-picker';
|
|
2
|
+
export let componentInput;
|
|
6
3
|
let isOpen = false;
|
|
7
|
-
$: dispatch('change', value);
|
|
8
4
|
</script>
|
|
9
5
|
|
|
10
|
-
<div class="color-picker-input
|
|
11
|
-
<
|
|
6
|
+
<div class="color-picker-input">
|
|
7
|
+
<input
|
|
8
|
+
type="text"
|
|
9
|
+
readonly
|
|
10
|
+
value={componentInput.value}
|
|
11
|
+
on:focus|preventDefault|stopPropagation={() => (isOpen = true)}
|
|
12
|
+
/>
|
|
12
13
|
<ColorPicker
|
|
13
14
|
bind:isOpen
|
|
14
|
-
bind:hex={value}
|
|
15
|
-
label={value}
|
|
15
|
+
bind:hex={componentInput.value}
|
|
16
|
+
label={componentInput.value}
|
|
16
17
|
canChangeMode={false}
|
|
17
18
|
components={ChromeVariant}
|
|
18
19
|
toRight
|
|
@@ -21,7 +22,7 @@ $: dispatch('change', value);
|
|
|
21
22
|
</div>
|
|
22
23
|
|
|
23
24
|
<style global>
|
|
24
|
-
:global(.color-picker-input) :global(span) > :global(label) {
|
|
25
|
+
:global(.color-picker-input) :global(span) > :global(label.svelte-rogbpz) {
|
|
25
26
|
display: none;
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -29,7 +30,6 @@ $: dispatch('change', value);
|
|
|
29
30
|
box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.25) !important;
|
|
30
31
|
border-style: none !important;
|
|
31
32
|
border-radius: 0.375rem !important;
|
|
32
|
-
z-index: 20;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:global(.color-picker-input) :global(.slider-wrapper) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { StaticInput } from '../../../inputType';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
|
-
|
|
5
|
+
componentInput: StaticInput<string>;
|
|
5
6
|
};
|
|
6
7
|
events: {
|
|
7
|
-
change: CustomEvent<any>;
|
|
8
|
-
} & {
|
|
9
8
|
[evt: string]: CustomEvent<any>;
|
|
10
9
|
};
|
|
11
10
|
slots: {};
|
|
@@ -5,6 +5,7 @@ export let componentInput;
|
|
|
5
5
|
export let id;
|
|
6
6
|
export let hasRows = false;
|
|
7
7
|
const { onchange, worldStore, state } = getContext('AppViewerContext');
|
|
8
|
+
$: componentInput && onchange?.();
|
|
8
9
|
$: extraLib =
|
|
9
10
|
componentInput?.expr && $worldStore
|
|
10
11
|
? buildExtraLib($worldStore?.outputsById ?? {}, id, hasRows, $state, false)
|
|
@@ -19,11 +20,6 @@ $: extraLib =
|
|
|
19
20
|
shouldBindKey={false}
|
|
20
21
|
{extraLib}
|
|
21
22
|
autoHeight
|
|
22
|
-
on:change={() => {
|
|
23
|
-
if (onchange) {
|
|
24
|
-
onchange()
|
|
25
|
-
}
|
|
26
|
-
}}
|
|
27
23
|
/>
|
|
28
24
|
</div>
|
|
29
25
|
{/if}
|
|
@@ -37,9 +37,9 @@ function formatName(name) {
|
|
|
37
37
|
}
|
|
38
38
|
function select(label) {
|
|
39
39
|
componentInput.value = label;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
if (document.activeElement?.blur) {
|
|
41
|
+
;
|
|
42
|
+
document.activeElement.blur();
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
</script>
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
export let code;
|
|
3
3
|
export let value = undefined;
|
|
4
4
|
export let error = '';
|
|
5
|
-
export let editor = undefined;
|
|
6
5
|
function parseJson() {
|
|
7
6
|
try {
|
|
8
|
-
value = JSON.parse(code
|
|
7
|
+
value = JSON.parse(code);
|
|
9
8
|
error = '';
|
|
10
9
|
}
|
|
11
10
|
catch (e) {
|
|
@@ -17,7 +16,7 @@ $: code && parseJson();
|
|
|
17
16
|
|
|
18
17
|
<div class="flex flex-col w-full">
|
|
19
18
|
<div class="border border-gray-300 w-full">
|
|
20
|
-
<SimpleEditor on:
|
|
19
|
+
<SimpleEditor on:change autoHeight lang="json" bind:code />
|
|
21
20
|
</div>
|
|
22
21
|
{#if error != ''}
|
|
23
22
|
<span class="text-red-600 text-xs">{error}</span>
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import SimpleEditor from '../../../../SimpleEditor.svelte';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
|
-
code: string
|
|
4
|
+
code: string;
|
|
6
5
|
value?: any;
|
|
7
6
|
error?: string | undefined;
|
|
8
|
-
editor?: SimpleEditor | undefined;
|
|
9
7
|
};
|
|
10
8
|
events: {
|
|
11
|
-
focus: CustomEvent<any>;
|
|
12
9
|
change: CustomEvent<any>;
|
|
13
10
|
} & {
|
|
14
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -21,7 +21,7 @@ $: componentInput && onchange?.();
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
{#if componentInput?.type === 'static'}
|
|
24
|
-
{#if fieldType === 'number'
|
|
24
|
+
{#if fieldType === 'number'}
|
|
25
25
|
<input on:keydown|stopPropagation type="number" bind:value={componentInput.value} />
|
|
26
26
|
{:else if fieldType === 'textarea'}
|
|
27
27
|
<textarea on:keydown|stopPropagation bind:value={componentInput.value} />
|
|
@@ -74,8 +74,8 @@ $: componentInput && onchange?.();
|
|
|
74
74
|
Inconsistent labeled resource object
|
|
75
75
|
{/if}
|
|
76
76
|
{:else if fieldType === 'color'}
|
|
77
|
-
<ColorInput bind:
|
|
78
|
-
{:else if fieldType === 'object'
|
|
77
|
+
<ColorInput bind:componentInput />
|
|
78
|
+
{:else if fieldType === 'object'}
|
|
79
79
|
{#if format?.startsWith('resource-')}
|
|
80
80
|
<ResourcePicker
|
|
81
81
|
initialValue={componentInput.value?.split('$res:')[1] || ''}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReadFileAs } from '../common/fileInput/model';
|
|
2
2
|
import type { InlineScript } from './types';
|
|
3
|
-
export type InputType = '
|
|
3
|
+
export type InputType = 'text' | 'textarea' | 'template' | 'number' | 'boolean' | 'select' | 'icon-select' | 'color' | 'date' | 'time' | 'datetime' | 'object' | 'array' | 'any' | 'labeledresource' | 'tab-select';
|
|
4
4
|
export type InputConnection = {
|
|
5
5
|
componentId: string;
|
|
6
6
|
path: string;
|
|
@@ -81,7 +81,7 @@ export type StaticOptions = {
|
|
|
81
81
|
label: string;
|
|
82
82
|
}[];
|
|
83
83
|
};
|
|
84
|
-
export type AppInput = AppInputSpec<'text', string> | AppInputSpec<'textarea', string> | AppInputSpec<'template', string> | AppInputSpec<'number', number> | AppInputSpec<'boolean', boolean> | AppInputSpec<'date', string> | AppInputSpec<'time', string> | AppInputSpec<'datetime', string> | AppInputSpec<'any', any> | AppInputSpec<'object', Record<string | number, any>> | AppInputSpec<'object', string> | (AppInputSpec<'select', string> & StaticOptions) | AppInputSpec<'icon-select', string> | AppInputSpec<'color', string> | AppInputSpec<'array', string[], 'text'> | AppInputSpec<'array', string[], 'textarea'> | AppInputSpec<'array', number[], 'number'> | AppInputSpec<'array', boolean[], 'boolean'> | AppInputSpec<'array', string[], 'date'> | AppInputSpec<'array', string[], 'time'> | AppInputSpec<'array', string[], 'datetime'> | AppInputSpec<'array', object[], 'object'> | (AppInputSpec<'array', string[], 'select'> & StaticOptions) | AppInputSpec<'array', object[], 'labeledresource'> | AppInputSpec<'
|
|
84
|
+
export type AppInput = AppInputSpec<'text', string> | AppInputSpec<'textarea', string> | AppInputSpec<'template', string> | AppInputSpec<'number', number> | AppInputSpec<'boolean', boolean> | AppInputSpec<'date', string> | AppInputSpec<'time', string> | AppInputSpec<'datetime', string> | AppInputSpec<'any', any> | AppInputSpec<'object', Record<string | number, any>> | AppInputSpec<'object', string> | (AppInputSpec<'select', string> & StaticOptions) | AppInputSpec<'icon-select', string> | AppInputSpec<'color', string> | AppInputSpec<'array', string[], 'text'> | AppInputSpec<'array', string[], 'textarea'> | AppInputSpec<'array', number[], 'number'> | AppInputSpec<'array', boolean[], 'boolean'> | AppInputSpec<'array', string[], 'date'> | AppInputSpec<'array', string[], 'time'> | AppInputSpec<'array', string[], 'datetime'> | AppInputSpec<'array', object[], 'object'> | (AppInputSpec<'array', string[], 'select'> & StaticOptions) | AppInputSpec<'array', object[], 'labeledresource'> | AppInputSpec<'labeledresource', object> | AppInputSpec<'array', object[], 'tab-select'>;
|
|
85
85
|
export type RowAppInput = Extract<AppInput, {
|
|
86
86
|
type: 'row';
|
|
87
87
|
}>;
|
package/components/apps/rx.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import type { AppInput } from './inputType';
|
|
|
2
2
|
import { type Writable } from 'svelte/store';
|
|
3
3
|
export interface Subscriber<T> {
|
|
4
4
|
id?: string;
|
|
5
|
-
next(v: T):
|
|
5
|
+
next(v: T): any;
|
|
6
6
|
}
|
|
7
7
|
export interface Observable<T> {
|
|
8
|
-
subscribe(x: Subscriber<T>):
|
|
8
|
+
subscribe(x: Subscriber<T>): any;
|
|
9
9
|
}
|
|
10
10
|
export interface Output<T> extends Observable<T> {
|
|
11
11
|
set(x: T, force?: boolean): void;
|