windmill-components 1.77.0 → 1.79.0
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 +4 -14
- package/components/LightweightArgInput.svelte +315 -0
- package/components/LightweightArgInput.svelte.d.ts +47 -0
- package/components/LightweightSchemaForm.svelte +31 -0
- package/components/LightweightSchemaForm.svelte.d.ts +18 -0
- package/components/ModulePreview.svelte +1 -0
- package/components/Multiselect.svelte.d.ts +2 -2
- package/components/Path.svelte +4 -0
- package/components/Range.svelte.d.ts +2 -2
- package/components/SimpleEditor.svelte +1 -1
- package/components/SimpleEditor.svelte.d.ts +2 -0
- package/components/TemplateEditor.svelte +3 -0
- package/components/TemplateEditor.svelte.d.ts +0 -204
- package/components/VariableEditor.svelte +2 -1
- package/components/apps/components/buttons/AppButton.svelte +45 -56
- package/components/apps/components/buttons/AppButton.svelte.d.ts +6 -4
- package/components/apps/components/buttons/AppForm.svelte.d.ts +2 -2
- package/components/apps/components/buttons/AppFormButton.svelte +1 -1
- package/components/apps/components/buttons/AppFormButton.svelte.d.ts +2 -2
- package/components/apps/components/display/AppBarChart.svelte +7 -3
- package/components/apps/components/display/AppBarChart.svelte.d.ts +2 -4
- package/components/apps/components/display/AppDisplayComponent.svelte +7 -3
- package/components/apps/components/display/AppDisplayComponent.svelte.d.ts +0 -2
- package/components/apps/components/display/AppHtml.svelte +7 -11
- package/components/apps/components/display/AppHtml.svelte.d.ts +0 -2
- package/components/apps/components/display/AppIcon.svelte +0 -1
- package/components/apps/components/display/AppIcon.svelte.d.ts +2 -5
- package/components/apps/components/display/AppImage.svelte +0 -1
- package/components/apps/components/display/AppImage.svelte.d.ts +2 -5
- package/components/apps/components/display/AppMap.svelte +13 -6
- package/components/apps/components/display/AppMap.svelte.d.ts +2 -5
- package/components/apps/components/display/AppPdf.svelte +8 -3
- package/components/apps/components/display/AppPdf.svelte.d.ts +2 -5
- package/components/apps/components/display/AppPieChart.svelte +7 -3
- package/components/apps/components/display/AppPieChart.svelte.d.ts +2 -4
- package/components/apps/components/display/AppScatterChart.svelte +7 -3
- package/components/apps/components/display/AppScatterChart.svelte.d.ts +2 -4
- package/components/apps/components/display/AppText.svelte +41 -17
- package/components/apps/components/display/AppText.svelte.d.ts +2 -4
- package/components/apps/components/display/AppTimeseries.svelte +7 -3
- package/components/apps/components/display/AppTimeseries.svelte.d.ts +2 -4
- package/components/apps/components/display/PlotlyHtml.svelte +9 -4
- package/components/apps/components/display/PlotlyHtml.svelte.d.ts +0 -2
- package/components/apps/components/display/VegaLiteHtml.svelte +8 -3
- package/components/apps/components/display/VegaLiteHtml.svelte.d.ts +2 -3
- package/components/apps/components/display/table/AppAggridTable.svelte +9 -4
- package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +2 -3
- package/components/apps/components/display/table/AppTable.svelte +91 -36
- package/components/apps/components/display/table/AppTable.svelte.d.ts +2 -4
- package/components/apps/components/helpers/HiddenComponent.svelte +8 -2
- package/components/apps/components/helpers/HiddenComponent.svelte.d.ts +0 -2
- package/components/apps/components/helpers/InputValue.svelte +5 -1
- package/components/apps/components/helpers/InputValue.svelte.d.ts +3 -1
- package/components/apps/components/helpers/NonRunnableComponent.svelte +2 -2
- package/components/apps/components/helpers/ResizeWrapper.svelte +3 -4
- package/components/apps/components/helpers/RunnableComponent.svelte +17 -24
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +0 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte +0 -2
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +0 -1
- package/components/apps/components/helpers/eval.js +36 -1
- package/components/apps/components/inputs/AppCheckbox.svelte +4 -2
- package/components/apps/components/inputs/AppCheckbox.svelte.d.ts +2 -5
- package/components/apps/components/inputs/AppDateInput.svelte +4 -2
- package/components/apps/components/inputs/AppDateInput.svelte.d.ts +2 -5
- package/components/apps/components/inputs/AppFileInput.svelte +4 -2
- package/components/apps/components/inputs/AppFileInput.svelte.d.ts +2 -5
- package/components/apps/components/inputs/AppMultiSelect.svelte +4 -2
- package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +2 -5
- package/components/apps/components/inputs/AppNumberInput.svelte +4 -2
- package/components/apps/components/inputs/AppNumberInput.svelte.d.ts +2 -5
- package/components/apps/components/inputs/AppRangeInput.svelte +5 -2
- package/components/apps/components/inputs/AppRangeInput.svelte.d.ts +2 -5
- package/components/apps/components/inputs/AppSelect.svelte +5 -2
- package/components/apps/components/inputs/AppSelect.svelte.d.ts +2 -5
- package/components/apps/components/inputs/AppSliderInputs.svelte +4 -2
- package/components/apps/components/inputs/AppSliderInputs.svelte.d.ts +2 -5
- package/components/apps/components/inputs/AppTextInput.svelte +5 -3
- package/components/apps/components/inputs/AppTextInput.svelte.d.ts +2 -5
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +5 -2
- package/components/apps/components/inputs/currency/AppCurrencyInput.svelte.d.ts +2 -5
- package/components/apps/components/layout/AppContainer.svelte +0 -2
- package/components/apps/components/layout/AppContainer.svelte.d.ts +0 -4
- package/components/apps/components/layout/AppDivider.svelte.d.ts +2 -3
- package/components/apps/components/layout/AppDrawer.svelte.d.ts +2 -3
- package/components/apps/components/layout/AppSplitpanes.svelte +1 -5
- package/components/apps/components/layout/AppSplitpanes.svelte.d.ts +0 -2
- package/components/apps/components/layout/AppTabs.svelte +8 -9
- package/components/apps/components/layout/AppTabs.svelte.d.ts +2 -5
- package/components/apps/editor/AppComponentInput.svelte +2 -1
- package/components/apps/editor/AppEditor.svelte +12 -14
- package/components/apps/editor/AppEditorHeader.svelte +2 -2
- package/components/apps/editor/AppInputs.svelte +13 -14
- package/components/apps/editor/AppPreview.svelte +68 -15
- package/components/apps/editor/ComponentHeader.svelte +49 -50
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/GridEditor.svelte +6 -27
- package/components/apps/editor/GridPanel.svelte +3 -1
- package/components/apps/editor/GridViewer.svelte +91 -0
- package/components/apps/editor/GridViewer.svelte.d.ts +32 -0
- package/components/apps/editor/SettingsPanel.svelte +11 -0
- package/components/apps/editor/SubGridEditor.svelte +74 -51
- package/components/apps/editor/SubGridEditor.svelte.d.ts +1 -1
- package/components/apps/editor/appUtils.d.ts +4 -2
- package/components/apps/editor/appUtils.js +26 -19
- package/components/apps/editor/component/Component.svelte +16 -53
- package/components/apps/editor/component/ComponentNavigation.svelte +28 -13
- package/components/apps/editor/component/components.d.ts +3 -2
- package/components/apps/editor/component/components.js +63 -79
- package/components/apps/editor/componentsPanel/ComponentList.svelte +5 -4
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +1 -1
- package/components/apps/editor/contextPanel/ComponentOutput.svelte +23 -33
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +14 -13
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte.d.ts +0 -1
- package/components/apps/editor/contextPanel/ContextPanel.svelte +19 -27
- package/components/apps/editor/contextPanel/SubGridOutput.svelte +5 -10
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +9 -6
- package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte.d.ts +0 -1
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte +1 -3
- package/components/apps/editor/contextPanel/components/BackgroundScriptsOutput.svelte.d.ts +1 -3
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +73 -42
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +0 -2
- package/components/apps/editor/contextPanel/components/TableActionOutput.svelte +2 -4
- package/components/apps/editor/contextPanel/components/TableActionOutput.svelte.d.ts +0 -1
- package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +1 -2
- package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte.d.ts +0 -1
- package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +3 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +20 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +5 -7
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +1 -1
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +31 -41
- package/components/apps/editor/settingsPanel/GridPane.svelte +1 -3
- package/components/apps/editor/settingsPanel/GridTab.svelte +1 -3
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +109 -13
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +6 -2
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +13 -116
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/SelectedRunnable.svelte +4 -0
- package/components/apps/editor/settingsPanel/TableActionLabel.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/TableActions.svelte +2 -5
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +1 -2
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +0 -1
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +12 -6
- package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte +81 -0
- package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte.d.ts +21 -0
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +18 -0
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte +98 -0
- package/components/apps/editor/settingsPanel/triggerLists/TriggerBadgesList.svelte.d.ts +24 -0
- package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.d.ts +2 -0
- package/components/apps/editor/settingsPanel/triggerLists/triggerListUtils.js +11 -0
- package/components/apps/gridUtils.d.ts +1 -3
- package/components/apps/gridUtils.js +1 -15
- package/components/apps/inputType.d.ts +11 -2
- package/components/apps/rx.d.ts +1 -1
- package/components/apps/rx.js +9 -10
- package/components/apps/svelte-grid/Grid.svelte +9 -13
- package/components/apps/svelte-grid/Grid.svelte.d.ts +0 -2
- package/components/apps/svelte-grid/MoveResize.svelte +1 -1
- package/components/apps/svelte-grid/types.d.ts +12 -16
- package/components/apps/svelte-grid/utils/helper.d.ts +1 -5
- package/components/apps/types.d.ts +29 -9
- package/components/apps/utils.js +2 -2
- package/components/common/button/Button.svelte.d.ts +1 -1
- package/components/common/button/ButtonPopup.svelte.d.ts +1 -1
- package/components/common/menu/Menu.svelte.d.ts +1 -1
- package/components/flows/flowStore.js +1 -1
- package/components/graph/FlowGraph.svelte +0 -2
- package/components/graph/FlowGraph.svelte.d.ts +0 -1
- package/components/graph/svelvet/container/views/GraphView.svelte +3 -28
- package/components/graph/svelvet/container/views/GraphView.svelte.d.ts +0 -3
- package/components/graph/svelvet/container/views/Svelvet.svelte +1 -17
- package/components/graph/svelvet/container/views/Svelvet.svelte.d.ts +0 -8
- package/components/graph/svelvet/customCss/controllers/getCss.js +0 -11
- package/components/graph/svelvet/edges/controllers/util.js +1 -2
- package/components/graph/svelvet/edges/views/Edges/SmoothStepEdge.svelte.d.ts +2 -2
- package/components/graph/svelvet/nodes/controllers/util.js +1 -1
- package/components/graph/svelvet/nodes/models/Node.d.ts +0 -4
- package/components/graph/svelvet/nodes/models/Node.js +3 -41
- package/components/graph/svelvet/store/controllers/storeApi.js +2 -7
- package/components/graph/svelvet/store/controllers/util.d.ts +0 -7
- package/components/graph/svelvet/store/controllers/util.js +4 -36
- package/components/graph/svelvet/store/types/types.d.ts +0 -5
- package/components/home/ItemsList.svelte +1 -1
- package/components/propertyPicker/ObjectViewer.svelte +1 -1
- package/components/propertyPicker/PropPicker.svelte +4 -1
- package/package.json +10 -6
- package/utils.d.ts +2 -0
- package/utils.js +6 -0
- package/components/apps/editor/AppComponentInputs.svelte +0 -13
- package/components/apps/editor/AppComponentInputs.svelte.d.ts +0 -20
- package/components/graph/svelvet/nodes/views/EditNode.svelte +0 -147
- package/components/graph/svelvet/nodes/views/EditNode.svelte.d.ts +0 -33
- package/components/graph/svelvet/resizableNodes/controllers/util.d.ts +0 -11
- package/components/graph/svelvet/resizableNodes/controllers/util.js +0 -24
- package/components/graph/svelvet/resizableNodes/models/ResizeNode.d.ts +0 -33
- package/components/graph/svelvet/resizableNodes/models/ResizeNode.js +0 -71
- package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte +0 -81
- package/components/graph/svelvet/resizableNodes/views/ResizeNode.svelte.d.ts +0 -20
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script>import { Button } from '../../../../common';
|
|
2
|
+
import { Plus } from 'lucide-svelte';
|
|
3
|
+
import { getContext } from 'svelte';
|
|
4
|
+
import TriggerBadgesList from './TriggerBadgesList.svelte';
|
|
5
|
+
import { getDependencies } from './triggerListUtils';
|
|
6
|
+
export let fields;
|
|
7
|
+
export let autoRefresh = false;
|
|
8
|
+
export let id;
|
|
9
|
+
export let inlineScript;
|
|
10
|
+
const { connectingInput } = getContext('AppViewerContext');
|
|
11
|
+
let addingDependency = false;
|
|
12
|
+
function applyConnection() {
|
|
13
|
+
if (!$connectingInput.opened && $connectingInput.input !== undefined && addingDependency) {
|
|
14
|
+
if ($connectingInput.input.connection) {
|
|
15
|
+
const x = {
|
|
16
|
+
id: $connectingInput.input.connection.componentId,
|
|
17
|
+
key: $connectingInput.input.connection.path
|
|
18
|
+
};
|
|
19
|
+
if (!inlineScript) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (inlineScript.refreshOn?.find((y) => y.id === x.id && y.key === x.key)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (!inlineScript.refreshOn) {
|
|
26
|
+
inlineScript.refreshOn = [x];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
inlineScript.refreshOn.push(x);
|
|
30
|
+
}
|
|
31
|
+
inlineScript = JSON.parse(JSON.stringify(inlineScript));
|
|
32
|
+
addingDependency = false;
|
|
33
|
+
}
|
|
34
|
+
$connectingInput = {
|
|
35
|
+
opened: false,
|
|
36
|
+
input: undefined,
|
|
37
|
+
hoveredComponent: undefined
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
$: $connectingInput && applyConnection();
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<TriggerBadgesList
|
|
45
|
+
{id}
|
|
46
|
+
inputDependencies={getDependencies(fields)}
|
|
47
|
+
frontendDependencies={inlineScript?.language === 'frontend'
|
|
48
|
+
? inlineScript?.refreshOn?.map((x) => `${x.id} - ${x.key}`) ?? undefined
|
|
49
|
+
: undefined}
|
|
50
|
+
onLoad={autoRefresh}
|
|
51
|
+
on:delete={(e) => {
|
|
52
|
+
const index = e.detail.index
|
|
53
|
+
if (inlineScript) {
|
|
54
|
+
inlineScript.refreshOn?.splice(index, 1)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
inlineScript = JSON.parse(JSON.stringify(inlineScript))
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
{#if inlineScript?.language === 'frontend'}
|
|
61
|
+
<Button
|
|
62
|
+
variant="border"
|
|
63
|
+
size="xs"
|
|
64
|
+
color="light"
|
|
65
|
+
btnClasses="!px-1 !py-0.5"
|
|
66
|
+
on:click={() => {
|
|
67
|
+
addingDependency = true
|
|
68
|
+
$connectingInput = {
|
|
69
|
+
opened: true,
|
|
70
|
+
input: undefined,
|
|
71
|
+
hoveredComponent: undefined
|
|
72
|
+
}
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
<div class="flex flex-row gap-1 items-center">
|
|
76
|
+
Add dependency
|
|
77
|
+
<Plus size={14} />
|
|
78
|
+
</div>
|
|
79
|
+
</Button>
|
|
80
|
+
{/if}
|
|
81
|
+
</TriggerBadgesList>
|
package/components/apps/editor/settingsPanel/triggerLists/BackgroundScriptTriggerList.svelte.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ConnectedAppInput, RowAppInput, StaticAppInput, UserAppInput } from '../../../inputType';
|
|
3
|
+
import type { InlineScript } from '../../../types';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
7
|
+
autoRefresh?: boolean | undefined;
|
|
8
|
+
id: string;
|
|
9
|
+
inlineScript: InlineScript;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type BackgroundScriptTriggerListProps = typeof __propDef.props;
|
|
17
|
+
export type BackgroundScriptTriggerListEvents = typeof __propDef.events;
|
|
18
|
+
export type BackgroundScriptTriggerListSlots = typeof __propDef.slots;
|
|
19
|
+
export default class BackgroundScriptTriggerList extends SvelteComponentTyped<BackgroundScriptTriggerListProps, BackgroundScriptTriggerListEvents, BackgroundScriptTriggerListSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { findGridItem } from '../../appUtils';
|
|
3
|
+
import TriggerBadgesList from './TriggerBadgesList.svelte';
|
|
4
|
+
import { getDependencies } from './triggerListUtils';
|
|
5
|
+
const { selectedComponent, app } = getContext('AppViewerContext');
|
|
6
|
+
export let fields;
|
|
7
|
+
$: gridItem = $selectedComponent ? findGridItem($app, $selectedComponent) : undefined;
|
|
8
|
+
$: onClick =
|
|
9
|
+
gridItem?.data.type &&
|
|
10
|
+
['buttoncomponent', 'formbuttoncomponent', 'formcomponent'].includes(gridItem?.data.type);
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<TriggerBadgesList
|
|
14
|
+
inputDependencies={getDependencies(fields)}
|
|
15
|
+
onLoad={!onClick}
|
|
16
|
+
id={$selectedComponent}
|
|
17
|
+
{onClick}
|
|
18
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ConnectedAppInput, RowAppInput, StaticAppInput, UserAppInput } from '../../../inputType';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export type ComponentTriggerListProps = typeof __propDef.props;
|
|
13
|
+
export type ComponentTriggerListEvents = typeof __propDef.events;
|
|
14
|
+
export type ComponentTriggerListSlots = typeof __propDef.slots;
|
|
15
|
+
export default class ComponentTriggerList extends SvelteComponentTyped<ComponentTriggerListProps, ComponentTriggerListEvents, ComponentTriggerListSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script>import { classNames } from '../../../../../utils';
|
|
2
|
+
import { X } from 'lucide-svelte';
|
|
3
|
+
import { createEventDispatcher, getContext } from 'svelte';
|
|
4
|
+
import { getAllRecomputeIdsForComponent } from '../../appUtils';
|
|
5
|
+
export let inputDependencies = [];
|
|
6
|
+
export let frontendDependencies = undefined;
|
|
7
|
+
export let onClick = false;
|
|
8
|
+
export let onLoad = false;
|
|
9
|
+
export let id = undefined;
|
|
10
|
+
const colors = {
|
|
11
|
+
red: 'text-red-800 border-red-600 bg-red-100',
|
|
12
|
+
green: 'text-green-800 border-green-600 bg-green-100',
|
|
13
|
+
indigo: 'text-indigo-800 border-indigo-600 bg-indigo-100',
|
|
14
|
+
blue: 'text-blue-800 border-blue-600 bg-blue-100'
|
|
15
|
+
};
|
|
16
|
+
let badgeClass = 'inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium border';
|
|
17
|
+
const recomputedBadges = [];
|
|
18
|
+
const { app, selectedComponent } = getContext('AppViewerContext');
|
|
19
|
+
const dispatch = createEventDispatcher();
|
|
20
|
+
$: if ($app && $selectedComponent && id) {
|
|
21
|
+
const recomputeIds = getAllRecomputeIdsForComponent($app, id);
|
|
22
|
+
if ($selectedComponent && recomputeIds) {
|
|
23
|
+
recomputeIds.forEach((x) => {
|
|
24
|
+
recomputedBadges.push(x);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<div class="flex w-full flex-col items-start gap-2 mt-2 mb-1">
|
|
31
|
+
{#if recomputedBadges.length === 0 && !onLoad && !onClick && inputDependencies?.length === 0 && !frontendDependencies}
|
|
32
|
+
<p class="text-xs font-semibold text-slate-800 ">
|
|
33
|
+
This script has no triggers. It will never run.
|
|
34
|
+
</p>
|
|
35
|
+
{:else}
|
|
36
|
+
<div class="text-sm font-semibold text-slate-800 ">Triggered by</div>
|
|
37
|
+
|
|
38
|
+
{#if onLoad || onClick}
|
|
39
|
+
<div class="w-full">
|
|
40
|
+
<div class="text-xs font-semibold text-slate-800 mb-1">Event</div>
|
|
41
|
+
<div class="flex flex-row gap-2 flex-wrap">
|
|
42
|
+
{#if onLoad}
|
|
43
|
+
<span class={classNames(badgeClass, colors['green'])}>On load</span>
|
|
44
|
+
{/if}
|
|
45
|
+
{#if onClick}
|
|
46
|
+
<span class={classNames(badgeClass, colors['green'])}>On click</span>
|
|
47
|
+
{/if}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
{/if}
|
|
51
|
+
{#if inputDependencies.length > 0}
|
|
52
|
+
<div class="w-full">
|
|
53
|
+
<div class="flex justify-between items-center mb-2">
|
|
54
|
+
<div class="text-xs font-semibold text-slate-800 mb-1">Values change </div>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="flex flex-row gap-2 flex-wrap">
|
|
57
|
+
{#each inputDependencies as label, index}
|
|
58
|
+
<span class={classNames(badgeClass, colors['blue'])}>
|
|
59
|
+
{label}
|
|
60
|
+
</span>
|
|
61
|
+
{/each}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
{/if}
|
|
65
|
+
|
|
66
|
+
{#if recomputedBadges?.length > 0}
|
|
67
|
+
<div class="w-full">
|
|
68
|
+
<div class="text-xs font-semibold text-slate-800 mb-1">Success of</div>
|
|
69
|
+
<div class="flex flex-row gap-2 flex-wrap">
|
|
70
|
+
{#each recomputedBadges as badge}
|
|
71
|
+
<span class={classNames(badgeClass, colors['indigo'])}>{badge}</span>
|
|
72
|
+
{/each}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
{/if}
|
|
76
|
+
{/if}
|
|
77
|
+
{#if frontendDependencies}
|
|
78
|
+
<div class="w-full">
|
|
79
|
+
<div class="flex justify-between items-center mb-2">
|
|
80
|
+
<div class="text-xs font-semibold text-slate-800 mb-1">Values change (Frontend)</div>
|
|
81
|
+
<slot />
|
|
82
|
+
</div>
|
|
83
|
+
<div class="flex flex-row gap-2 flex-wrap">
|
|
84
|
+
{#each frontendDependencies as label, index}
|
|
85
|
+
<span class={classNames(badgeClass, colors['red'])}>
|
|
86
|
+
{label}
|
|
87
|
+
<button
|
|
88
|
+
on:click={() => dispatch('delete', { index })}
|
|
89
|
+
class="bg-red-300 cursor-pointer hover:bg-red-400 ml-1 rounded-md"
|
|
90
|
+
>
|
|
91
|
+
<X size={18} class="p-0.5" />
|
|
92
|
+
</button>
|
|
93
|
+
</span>
|
|
94
|
+
{/each}
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
{/if}
|
|
98
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
inputDependencies?: string[] | undefined;
|
|
5
|
+
frontendDependencies?: string[] | undefined;
|
|
6
|
+
onClick?: boolean | undefined;
|
|
7
|
+
onLoad?: boolean | undefined;
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
delete: CustomEvent<any>;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {
|
|
16
|
+
default: {};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type TriggerBadgesListProps = typeof __propDef.props;
|
|
20
|
+
export type TriggerBadgesListEvents = typeof __propDef.events;
|
|
21
|
+
export type TriggerBadgesListSlots = typeof __propDef.slots;
|
|
22
|
+
export default class TriggerBadgesList extends SvelteComponentTyped<TriggerBadgesListProps, TriggerBadgesListEvents, TriggerBadgesListSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function getDependencies(fields) {
|
|
2
|
+
let dependencies = [];
|
|
3
|
+
if (!fields)
|
|
4
|
+
return dependencies;
|
|
5
|
+
Object.values(fields).forEach((field) => {
|
|
6
|
+
if (field.type === 'connected' && dependencies && field.connection) {
|
|
7
|
+
dependencies.push(`${field.connection.componentId} - ${field.connection.path}`);
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
return dependencies;
|
|
11
|
+
}
|
|
@@ -8,8 +8,6 @@ declare const WIDE_GRID_COLUMNS: 12;
|
|
|
8
8
|
declare const NARROW_GRID_COLUMNS: 3;
|
|
9
9
|
declare const columnConfiguration: ColumnConfiguration;
|
|
10
10
|
declare const gridColumns: number[];
|
|
11
|
-
declare function disableDrag(component: GridItem): GridItem;
|
|
12
11
|
declare function toggleFixed(component: GridItem): GridItem;
|
|
13
12
|
declare function isFixed(component: GridItem): boolean;
|
|
14
|
-
|
|
15
|
-
export { gridColumns, WIDE_GRID_COLUMNS, NARROW_GRID_COLUMNS, columnConfiguration, disableDrag, enableDrag, Breakpoints, toggleFixed, isFixed };
|
|
13
|
+
export { gridColumns, WIDE_GRID_COLUMNS, NARROW_GRID_COLUMNS, columnConfiguration, Breakpoints, toggleFixed, isFixed };
|
|
@@ -9,13 +9,6 @@ const columnConfiguration = [
|
|
|
9
9
|
[Breakpoints.sm, NARROW_GRID_COLUMNS]
|
|
10
10
|
];
|
|
11
11
|
const gridColumns = columnConfiguration.map((value) => value[1]);
|
|
12
|
-
function disableDrag(component) {
|
|
13
|
-
gridColumns.forEach((column) => {
|
|
14
|
-
component[column].customDragger = true;
|
|
15
|
-
component[column].customResizer = true;
|
|
16
|
-
});
|
|
17
|
-
return component;
|
|
18
|
-
}
|
|
19
12
|
function toggleFixed(component) {
|
|
20
13
|
const nValue = !component[gridColumns[0]].fixed;
|
|
21
14
|
gridColumns.forEach((column) => {
|
|
@@ -32,11 +25,4 @@ function isFixed(component) {
|
|
|
32
25
|
});
|
|
33
26
|
return fixed;
|
|
34
27
|
}
|
|
35
|
-
|
|
36
|
-
gridColumns.forEach((column) => {
|
|
37
|
-
component[column].customDragger = false;
|
|
38
|
-
component[column].customResizer = false;
|
|
39
|
-
});
|
|
40
|
-
return component;
|
|
41
|
-
}
|
|
42
|
-
export { gridColumns, WIDE_GRID_COLUMNS, NARROW_GRID_COLUMNS, columnConfiguration, disableDrag, enableDrag, Breakpoints, toggleFixed, isFixed };
|
|
28
|
+
export { gridColumns, WIDE_GRID_COLUMNS, NARROW_GRID_COLUMNS, columnConfiguration, Breakpoints, toggleFixed, isFixed };
|
|
@@ -52,8 +52,8 @@ export type ResultInput = {
|
|
|
52
52
|
type: 'runnable';
|
|
53
53
|
value?: any;
|
|
54
54
|
};
|
|
55
|
-
type AppInputSpec<T extends InputType, U, V extends InputType = never> = (StaticInput<U> | ConnectedInput | UserInput<U> | RowInput | EvalInput | UploadInput | ResultInput | TemplateInput) & InputConfiguration<T,
|
|
56
|
-
type InputConfiguration<T extends InputType,
|
|
55
|
+
type AppInputSpec<T extends InputType, U, V extends InputType = never> = (StaticInput<U> | ConnectedInput | UserInput<U> | RowInput | EvalInput | UploadInput | ResultInput | TemplateInput) & InputConfiguration<T, V>;
|
|
56
|
+
type InputConfiguration<T extends InputType, V extends InputType> = {
|
|
57
57
|
fieldType: T;
|
|
58
58
|
subFieldType?: V;
|
|
59
59
|
format?: string | undefined;
|
|
@@ -107,5 +107,14 @@ export type EvalAppInput = Extract<AppInput, {
|
|
|
107
107
|
export type UploadAppInput = Extract<AppInput, {
|
|
108
108
|
type: 'upload';
|
|
109
109
|
}>;
|
|
110
|
+
export type RichAppInput = AppInput | {
|
|
111
|
+
type: 'oneOf';
|
|
112
|
+
oneOf: string[];
|
|
113
|
+
configuration: Record<string, AppInput>;
|
|
114
|
+
} | {
|
|
115
|
+
type: 'group';
|
|
116
|
+
title: string;
|
|
117
|
+
configuration: Record<string, AppInput>;
|
|
118
|
+
};
|
|
110
119
|
export type AppInputs = Record<string, AppInput>;
|
|
111
120
|
export {};
|
package/components/apps/rx.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type World = {
|
|
|
20
20
|
stateId: Writable<number>;
|
|
21
21
|
newOutput: <T>(id: string, name: string, previousValue: T) => Output<T>;
|
|
22
22
|
};
|
|
23
|
-
export declare function buildWorld(
|
|
23
|
+
export declare function buildWorld(context: Record<string, any>): Writable<World>;
|
|
24
24
|
export declare function buildObservableWorld(): {
|
|
25
25
|
connect: <T>(inputSpec: AppInput, next: (x: T) => void, id?: string) => Input<T>;
|
|
26
26
|
newOutput: <T_1>(id: string, name: string, state: Writable<number>, previousValue: T_1) => Output<T_1>;
|
package/components/apps/rx.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
2
|
import { deepEqual } from 'fast-equals';
|
|
3
|
-
export function buildWorld(
|
|
3
|
+
export function buildWorld(context) {
|
|
4
4
|
const newWorld = buildObservableWorld();
|
|
5
5
|
const stateId = writable(0);
|
|
6
|
+
let writableWorld = undefined;
|
|
6
7
|
const outputsById = {
|
|
7
8
|
ctx: Object.fromEntries(Object.entries(context).map(([k, v]) => {
|
|
8
9
|
return [k, newWorld.newOutput('ctx', k, stateId, v)];
|
|
9
10
|
})),
|
|
10
|
-
state:
|
|
11
|
+
state: {}
|
|
11
12
|
};
|
|
12
|
-
for (const [k, outputs] of Object.entries(components)) {
|
|
13
|
-
outputsById[k] = {};
|
|
14
|
-
for (const o of outputs) {
|
|
15
|
-
outputsById[k][o] = newWorld.newOutput(k, o, stateId, previousWorld?.outputsById[k]?.[o]?.peak());
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
13
|
function newOutput(id, name, previousValue) {
|
|
19
14
|
if (outputsById[id]?.[name]) {
|
|
15
|
+
writableWorld?.update((x) => x);
|
|
20
16
|
return outputsById[id][name];
|
|
21
17
|
}
|
|
22
18
|
let o = newWorld.newOutput(id, name, stateId, previousValue);
|
|
@@ -24,10 +20,12 @@ export function buildWorld(components, previousWorld, context) {
|
|
|
24
20
|
outputsById[id] = {};
|
|
25
21
|
}
|
|
26
22
|
outputsById[id][name] = o;
|
|
23
|
+
writableWorld?.update((x) => x);
|
|
27
24
|
return o;
|
|
28
25
|
}
|
|
29
26
|
stateId.update((x) => x + 1);
|
|
30
|
-
|
|
27
|
+
writableWorld = writable({ outputsById, connect: newWorld.connect, stateId, newOutput });
|
|
28
|
+
return writableWorld;
|
|
31
29
|
}
|
|
32
30
|
export function buildObservableWorld() {
|
|
33
31
|
const observables = {};
|
|
@@ -40,7 +38,6 @@ export function buildObservableWorld() {
|
|
|
40
38
|
};
|
|
41
39
|
}
|
|
42
40
|
else if (inputSpec.type === 'connected') {
|
|
43
|
-
const input = cachedInput(next, id);
|
|
44
41
|
const connection = inputSpec.connection;
|
|
45
42
|
if (!connection) {
|
|
46
43
|
return {
|
|
@@ -50,6 +47,8 @@ export function buildObservableWorld() {
|
|
|
50
47
|
};
|
|
51
48
|
}
|
|
52
49
|
const { componentId, path } = connection;
|
|
50
|
+
console.log('connection', connection);
|
|
51
|
+
const input = cachedInput(next, `${componentId}-${path}-${id}`);
|
|
53
52
|
const [p] = path ? path.split('.')[0].split('[') : [undefined];
|
|
54
53
|
let obs = observables[`${componentId}.${p}`];
|
|
55
54
|
if (!obs) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script>import { getContainerHeight } from './utils/container';
|
|
2
|
-
import {
|
|
2
|
+
import { moveItem, getItemById, specifyUndefinedColumns } from './utils/item';
|
|
3
3
|
import { onMount, createEventDispatcher } from 'svelte';
|
|
4
4
|
import { getColumn, throttle } from './utils/other';
|
|
5
5
|
import MoveResize from './MoveResize.svelte';
|
|
6
|
+
import { sortGridItemsPosition } from '../editor/appUtils';
|
|
6
7
|
const dispatch = createEventDispatcher();
|
|
7
|
-
export let fillSpace = false;
|
|
8
8
|
export let items;
|
|
9
9
|
export let rowHeight;
|
|
10
10
|
export let cols;
|
|
@@ -63,6 +63,8 @@ onMount(() => {
|
|
|
63
63
|
sizeObserver.observe(container);
|
|
64
64
|
return () => sizeObserver.disconnect();
|
|
65
65
|
});
|
|
66
|
+
let sortedItems = [];
|
|
67
|
+
$: sortedItems = JSON.parse(JSON.stringify(items)).sort((a, b) => a.id.localeCompare(b.id));
|
|
66
68
|
let initItems = undefined;
|
|
67
69
|
const updateMatrix = ({ detail }) => {
|
|
68
70
|
let isPointerUp = detail.isPointerUp;
|
|
@@ -72,13 +74,13 @@ const updateMatrix = ({ detail }) => {
|
|
|
72
74
|
citems = JSON.parse(JSON.stringify(initItems));
|
|
73
75
|
}
|
|
74
76
|
catch (e) {
|
|
75
|
-
citems = JSON.parse(JSON.stringify(
|
|
77
|
+
citems = JSON.parse(JSON.stringify(sortedItems));
|
|
76
78
|
}
|
|
77
79
|
initItems = undefined;
|
|
78
80
|
}
|
|
79
81
|
else {
|
|
80
82
|
if (initItems == undefined) {
|
|
81
|
-
initItems = JSON.parse(JSON.stringify(
|
|
83
|
+
initItems = JSON.parse(JSON.stringify(sortedItems));
|
|
82
84
|
}
|
|
83
85
|
citems = JSON.parse(JSON.stringify(initItems));
|
|
84
86
|
}
|
|
@@ -91,12 +93,7 @@ const updateMatrix = ({ detail }) => {
|
|
|
91
93
|
...detail.shadow
|
|
92
94
|
}
|
|
93
95
|
};
|
|
94
|
-
|
|
95
|
-
items = moveItemsAroundItem(activeItem, citems, getComputedCols, getItemById(detail.id, citems));
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
items = moveItem(activeItem, citems, getComputedCols, getItemById(detail.id, citems));
|
|
99
|
-
}
|
|
96
|
+
sortedItems = moveItem(activeItem, citems, getComputedCols, getItemById(detail.id, citems));
|
|
100
97
|
if (detail.onUpdate)
|
|
101
98
|
detail.onUpdate();
|
|
102
99
|
dispatch('change', {
|
|
@@ -106,7 +103,7 @@ const updateMatrix = ({ detail }) => {
|
|
|
106
103
|
});
|
|
107
104
|
}
|
|
108
105
|
if (isPointerUp) {
|
|
109
|
-
dispatch('redraw',
|
|
106
|
+
dispatch('redraw', sortGridItemsPosition(JSON.parse(JSON.stringify(sortedItems)), getComputedCols));
|
|
110
107
|
}
|
|
111
108
|
};
|
|
112
109
|
const throttleMatrix = throttle(updateMatrix, throttleResize);
|
|
@@ -122,7 +119,7 @@ const handleRepaint = ({ detail }) => {
|
|
|
122
119
|
|
|
123
120
|
<div class="svlt-grid-container" style="height: {containerHeight}px" bind:this={container}>
|
|
124
121
|
{#if xPerPx || !fastStart}
|
|
125
|
-
{#each
|
|
122
|
+
{#each sortedItems as item (item.id)}
|
|
126
123
|
<MoveResize
|
|
127
124
|
on:repaint={handleRepaint}
|
|
128
125
|
on:pointerup={pointerup}
|
|
@@ -156,7 +153,6 @@ const handleRepaint = ({ detail }) => {
|
|
|
156
153
|
{resizePointerDown}
|
|
157
154
|
dataItem={item}
|
|
158
155
|
item={item[getComputedCols]}
|
|
159
|
-
index={i}
|
|
160
156
|
/>
|
|
161
157
|
{/if}
|
|
162
158
|
</MoveResize>
|
|
@@ -2,7 +2,6 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import type { FilledItem } from './types';
|
|
3
3
|
declare class __sveltets_Render<T> {
|
|
4
4
|
props(): {
|
|
5
|
-
fillSpace?: boolean | undefined;
|
|
6
5
|
items: FilledItem<T>[];
|
|
7
6
|
rowHeight: number;
|
|
8
7
|
cols: [number, number][];
|
|
@@ -35,7 +34,6 @@ declare class __sveltets_Render<T> {
|
|
|
35
34
|
resizePointerDown: (e: any) => void;
|
|
36
35
|
dataItem: FilledItem<T>;
|
|
37
36
|
item: Required<import("./types").ItemLayout>;
|
|
38
|
-
index: any;
|
|
39
37
|
};
|
|
40
38
|
};
|
|
41
39
|
}
|
|
@@ -242,7 +242,7 @@ const resizePointerUp = (e) => {
|
|
|
242
242
|
class:svlt-grid-active={active || (trans && rect)}
|
|
243
243
|
style="width: {active ? newSize.width : width}px; height:{active
|
|
244
244
|
? newSize.height
|
|
245
|
-
: height}px; {onTop ? 'z-index:
|
|
245
|
+
: height}px; {onTop ? 'z-index: 1000;' : ''}
|
|
246
246
|
{active
|
|
247
247
|
? `transform: translate(${cordDiff.x}px, ${cordDiff.y}px);top:${rect.top}px;left:${rect.left}px;`
|
|
248
248
|
: trans
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
|
|
2
1
|
export interface Size {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
w: number
|
|
3
|
+
h: number
|
|
5
4
|
}
|
|
6
5
|
|
|
7
6
|
export interface Positon {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
x: number
|
|
8
|
+
y: number
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
interface ItemLayout extends Size, Positon {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
fixed?: boolean
|
|
13
|
+
resizable?: boolean
|
|
14
|
+
draggable?: boolean
|
|
15
|
+
customDragger?: boolean
|
|
16
|
+
customResizer?: boolean
|
|
17
|
+
min?: Size
|
|
18
|
+
max?: Size
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
export type FilledItem<T> =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
export type FilledItem<T> = { [width: number]: Required<ItemLayout>; data: T; id: string }
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
declare const gridHelp: {
|
|
2
2
|
normalize(items: any, col: any): any;
|
|
3
|
-
adjust(items: any, col: any):
|
|
4
|
-
[width: number]: Required<import("../types").ItemLayout>;
|
|
5
|
-
data: any;
|
|
6
|
-
id: string;
|
|
7
|
-
}[];
|
|
3
|
+
adjust(items: any, col: any): import("../types").FilledItem<unknown>[];
|
|
8
4
|
item(obj: any): any;
|
|
9
5
|
findSpace(item: any, items: any, cols: any): {
|
|
10
6
|
x: number;
|
|
@@ -22,11 +22,23 @@ export type ComponentCssProperty = {
|
|
|
22
22
|
style?: string;
|
|
23
23
|
};
|
|
24
24
|
export type ComponentCustomCSS<T extends string = string> = Record<T, ComponentCssProperty>;
|
|
25
|
+
export type Configuration = GeneralAppInput & (StaticAppInput | ConnectedAppInput | UserAppInput | RowAppInput | EvalAppInput | UploadAppInput);
|
|
26
|
+
export type RichConfiguration = (Configuration & {
|
|
27
|
+
ctype?: undefined;
|
|
28
|
+
}) | {
|
|
29
|
+
ctype: 'oneOf';
|
|
30
|
+
selected: string;
|
|
31
|
+
configuration: Record<string, Record<string, Configuration>>;
|
|
32
|
+
} | {
|
|
33
|
+
ctype: 'group';
|
|
34
|
+
title: string;
|
|
35
|
+
configuration: Record<string, Configuration>;
|
|
36
|
+
};
|
|
37
|
+
export type RichConfigurations = Record<string, RichConfiguration>;
|
|
25
38
|
export interface BaseAppComponent extends Partial<Aligned> {
|
|
26
39
|
id: ComponentID;
|
|
27
40
|
componentInput: AppInput | undefined;
|
|
28
|
-
configuration:
|
|
29
|
-
card: boolean | undefined;
|
|
41
|
+
configuration: RichConfigurations;
|
|
30
42
|
customCss?: ComponentCustomCSS;
|
|
31
43
|
/**
|
|
32
44
|
* If `true` then the wrapper will allow items to flow outside of it's borders.
|
|
@@ -45,15 +57,16 @@ export type AppSection = {
|
|
|
45
57
|
components: AppComponent[];
|
|
46
58
|
id: SectionID;
|
|
47
59
|
};
|
|
48
|
-
export type GridItem = FilledItem<
|
|
49
|
-
data: AppComponent;
|
|
50
|
-
id: string;
|
|
51
|
-
}>;
|
|
60
|
+
export type GridItem = FilledItem<AppComponent>;
|
|
52
61
|
export type InlineScript = {
|
|
53
62
|
content: string;
|
|
54
63
|
language: Preview.language | 'frontend';
|
|
55
64
|
path?: string;
|
|
56
65
|
schema?: Schema;
|
|
66
|
+
refreshOn?: {
|
|
67
|
+
id: string;
|
|
68
|
+
key: string;
|
|
69
|
+
}[];
|
|
57
70
|
};
|
|
58
71
|
export type App = {
|
|
59
72
|
grid: GridItem[];
|
|
@@ -78,8 +91,7 @@ export type ConnectingInput = {
|
|
|
78
91
|
hoveredComponent: string | undefined;
|
|
79
92
|
};
|
|
80
93
|
export type AppViewerContext = {
|
|
81
|
-
worldStore: Writable<World
|
|
82
|
-
staticOutputs: Writable<Record<string, string[]>>;
|
|
94
|
+
worldStore: Writable<World>;
|
|
83
95
|
app: Writable<App>;
|
|
84
96
|
summary: Writable<string>;
|
|
85
97
|
selectedComponent: Writable<string | undefined>;
|
|
@@ -108,13 +120,15 @@ export type AppViewerContext = {
|
|
|
108
120
|
state: Writable<Record<string, any>>;
|
|
109
121
|
componentControl: Writable<Record<string, {
|
|
110
122
|
left?: () => boolean;
|
|
111
|
-
right?: () => boolean;
|
|
123
|
+
right?: (skipTableActions?: boolean | undefined) => string | boolean;
|
|
112
124
|
setTab?: (index: number) => void;
|
|
113
125
|
}>>;
|
|
126
|
+
hoverStore: Writable<string | undefined>;
|
|
114
127
|
};
|
|
115
128
|
export type AppEditorContext = {
|
|
116
129
|
history: History<App> | undefined;
|
|
117
130
|
pickVariableCallback: Writable<((path: string) => void) | undefined>;
|
|
131
|
+
ontextfocus: Writable<(() => void) | undefined>;
|
|
118
132
|
};
|
|
119
133
|
export type FocusedGrid = {
|
|
120
134
|
parentComponentId: string;
|
|
@@ -124,4 +138,10 @@ export type EditorMode = 'dnd' | 'preview';
|
|
|
124
138
|
export type EditorBreakpoint = 'sm' | 'lg';
|
|
125
139
|
export declare const IS_APP_PUBLIC_CONTEXT_KEY: "isAppPublicContext";
|
|
126
140
|
type ComponentID = string;
|
|
141
|
+
export type ContextPanelContext = {
|
|
142
|
+
search: Writable<string>;
|
|
143
|
+
manuallyOpened: Writable<Record<string, boolean>>;
|
|
144
|
+
expanded: Writable<boolean>;
|
|
145
|
+
hasResult: Writable<Record<string, boolean>>;
|
|
146
|
+
};
|
|
127
147
|
export {};
|
package/components/apps/utils.js
CHANGED
|
@@ -144,8 +144,8 @@ export function getAllScriptNames(app) {
|
|
|
144
144
|
componentInput?.runnable?.type === 'runnableByName') {
|
|
145
145
|
acc.push(componentInput.runnable.name);
|
|
146
146
|
}
|
|
147
|
-
if (
|
|
148
|
-
|
|
147
|
+
if (gridItem.data.type === 'tablecomponent') {
|
|
148
|
+
gridItem.data.actionButtons.forEach((actionButton) => {
|
|
149
149
|
if (actionButton.componentInput?.type === 'runnable') {
|
|
150
150
|
if (actionButton.componentInput.runnable?.type === 'runnableByName') {
|
|
151
151
|
acc.push(actionButton.componentInput.runnable.name);
|