windmill-components 1.82.8 → 1.82.10
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 +6 -0
- package/components/FlowBuilder.svelte +0 -5
- package/components/LightweightArgInput.svelte +5 -0
- package/components/Toggle.svelte +1 -1
- package/components/Toggle.svelte.d.ts +1 -0
- package/components/apps/components/buttons/AppButton.svelte +1 -1
- package/components/apps/components/buttons/AppForm.svelte +1 -0
- package/components/apps/components/buttons/AppFormButton.svelte +1 -0
- 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 +6 -6
- 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/RefreshButton.svelte +10 -3
- package/components/apps/components/helpers/RefreshButton.svelte.d.ts +0 -1
- package/components/apps/components/helpers/RunnableComponent.svelte +7 -8
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -1
- package/components/apps/components/helpers/RunnableWrapper.svelte +1 -1
- 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 +3 -7
- package/components/apps/components/inputs/AppNumberInput.svelte +3 -3
- package/components/apps/components/inputs/AppSelect.svelte +4 -3
- package/components/apps/components/inputs/AppSliderInputs.svelte +1 -1
- package/components/apps/components/inputs/AppTextInput.svelte +10 -7
- 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 +9 -35
- package/components/apps/editor/AppEditorHeader.svelte +0 -5
- package/components/apps/editor/AppPreview.svelte +5 -17
- package/components/apps/editor/ComponentHeader.svelte +0 -1
- package/components/apps/editor/ComponentHeader.svelte.d.ts +1 -1
- package/components/apps/editor/GridEditor.svelte +11 -21
- 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 +3 -3
- 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 +6 -5
- package/components/apps/editor/component/Component.svelte.d.ts +1 -1
- package/components/apps/editor/component/ComponentNavigation.svelte +46 -55
- package/components/apps/editor/component/components.d.ts +26 -9
- package/components/apps/editor/component/components.js +26 -10
- package/components/apps/editor/componentsPanel/ComponentList.svelte +1 -1
- package/components/apps/editor/componentsPanel/CssProperty.svelte +26 -0
- package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +2 -0
- package/components/apps/editor/componentsPanel/CssSettings.svelte +0 -1
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +10 -13
- 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 +11 -4
- 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/InlineScriptEditor.svelte +3 -3
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +2 -2
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +2 -2
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +2 -18
- package/components/apps/editor/settingsPanel/StylePanel.svelte +2 -40
- package/components/apps/editor/settingsPanel/TableActions.svelte +3 -3
- package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +1 -1
- package/components/apps/editor/settingsPanel/triggerLists/ComponentTriggerList.svelte +1 -1
- package/components/apps/inputType.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 +4 -7
- package/components/apps/utils.d.ts +0 -2
- package/components/apps/utils.js +1 -30
- package/infer.js +1 -3
- package/package.json +2 -1
|
@@ -81,6 +81,7 @@ export const components = {
|
|
|
81
81
|
name: 'Rich Result',
|
|
82
82
|
icon: Monitor,
|
|
83
83
|
dims: '2:8-6:8',
|
|
84
|
+
softWrap: false,
|
|
84
85
|
customCss: {
|
|
85
86
|
header: { class: '', style: '' },
|
|
86
87
|
container: { class: '', style: '' }
|
|
@@ -98,6 +99,7 @@ export const components = {
|
|
|
98
99
|
name: 'Container',
|
|
99
100
|
icon: BoxSelect,
|
|
100
101
|
dims: '2:8-6:8',
|
|
102
|
+
softWrap: true,
|
|
101
103
|
customCss: {
|
|
102
104
|
container: { class: '', style: '' }
|
|
103
105
|
},
|
|
@@ -111,6 +113,7 @@ export const components = {
|
|
|
111
113
|
name: 'Text',
|
|
112
114
|
icon: Type,
|
|
113
115
|
dims: '1:1-3:1',
|
|
116
|
+
softWrap: true,
|
|
114
117
|
customCss: {
|
|
115
118
|
text: { class: '', style: '' }
|
|
116
119
|
},
|
|
@@ -150,6 +153,7 @@ export const components = {
|
|
|
150
153
|
name: 'Button',
|
|
151
154
|
icon: Inspect,
|
|
152
155
|
dims: '1:1-2:1',
|
|
156
|
+
softWrap: true,
|
|
153
157
|
customCss: {
|
|
154
158
|
button: { style: '', class: '' }
|
|
155
159
|
},
|
|
@@ -367,6 +371,7 @@ export const components = {
|
|
|
367
371
|
name: 'HTML',
|
|
368
372
|
icon: Code2,
|
|
369
373
|
dims: '1:2-1:2',
|
|
374
|
+
softWrap: false,
|
|
370
375
|
customCss: {
|
|
371
376
|
container: { class: '', style: '' }
|
|
372
377
|
},
|
|
@@ -388,6 +393,7 @@ Hello \${ctx.username}
|
|
|
388
393
|
name: 'Vega Lite',
|
|
389
394
|
icon: PieChart,
|
|
390
395
|
dims: '2:8-6:8',
|
|
396
|
+
softWrap: false,
|
|
391
397
|
customCss: {},
|
|
392
398
|
initialData: {
|
|
393
399
|
componentInput: {
|
|
@@ -424,6 +430,7 @@ Hello \${ctx.username}
|
|
|
424
430
|
name: 'Plotly',
|
|
425
431
|
icon: PieChart,
|
|
426
432
|
dims: '2:8-6:8',
|
|
433
|
+
softWrap: false,
|
|
427
434
|
customCss: {},
|
|
428
435
|
initialData: {
|
|
429
436
|
componentInput: {
|
|
@@ -441,15 +448,7 @@ Hello \${ctx.username}
|
|
|
441
448
|
}
|
|
442
449
|
}
|
|
443
450
|
},
|
|
444
|
-
configuration: {
|
|
445
|
-
layout: {
|
|
446
|
-
type: 'static',
|
|
447
|
-
fieldType: 'object',
|
|
448
|
-
value: {},
|
|
449
|
-
tooltip: 'Layout options for the plot. See https://plotly.com/javascript/reference/layout/ for more information',
|
|
450
|
-
onlyStatic: true
|
|
451
|
-
}
|
|
452
|
-
}
|
|
451
|
+
configuration: {}
|
|
453
452
|
}
|
|
454
453
|
},
|
|
455
454
|
timeseriescomponent: {
|
|
@@ -671,6 +670,7 @@ Hello \${ctx.username}
|
|
|
671
670
|
name: 'Toggle',
|
|
672
671
|
icon: ToggleLeft,
|
|
673
672
|
dims: '1:1-2:1',
|
|
673
|
+
softWrap: true,
|
|
674
674
|
customCss: {
|
|
675
675
|
text: { class: '', style: '' }
|
|
676
676
|
},
|
|
@@ -695,6 +695,7 @@ Hello \${ctx.username}
|
|
|
695
695
|
name: 'Text Input',
|
|
696
696
|
icon: TextCursorInput,
|
|
697
697
|
dims: '2:1-2:1',
|
|
698
|
+
softWrap: true,
|
|
698
699
|
customCss: {
|
|
699
700
|
input: { class: '', style: '' }
|
|
700
701
|
},
|
|
@@ -720,6 +721,7 @@ Hello \${ctx.username}
|
|
|
720
721
|
name: 'Select',
|
|
721
722
|
icon: List,
|
|
722
723
|
dims: '2:1-3:1',
|
|
724
|
+
softWrap: true,
|
|
723
725
|
customCss: {
|
|
724
726
|
input: { style: '' }
|
|
725
727
|
},
|
|
@@ -730,7 +732,7 @@ Hello \${ctx.username}
|
|
|
730
732
|
items: {
|
|
731
733
|
type: 'static',
|
|
732
734
|
fieldType: 'array',
|
|
733
|
-
subFieldType: '
|
|
735
|
+
subFieldType: 'object',
|
|
734
736
|
value: [
|
|
735
737
|
{ value: 'foo', label: 'Foo' },
|
|
736
738
|
{ value: 'bar', label: 'Bar' }
|
|
@@ -761,6 +763,7 @@ Hello \${ctx.username}
|
|
|
761
763
|
name: 'Multi Select',
|
|
762
764
|
icon: List,
|
|
763
765
|
dims: '2:1-3:1',
|
|
766
|
+
softWrap: true,
|
|
764
767
|
customCss: {
|
|
765
768
|
input: { style: '' }
|
|
766
769
|
},
|
|
@@ -787,6 +790,7 @@ Hello \${ctx.username}
|
|
|
787
790
|
name: 'Resource Select',
|
|
788
791
|
icon: List,
|
|
789
792
|
dims: '2:1-3:1',
|
|
793
|
+
softWrap: true,
|
|
790
794
|
customCss: {
|
|
791
795
|
input: { style: '' }
|
|
792
796
|
},
|
|
@@ -813,6 +817,7 @@ Hello \${ctx.username}
|
|
|
813
817
|
name: 'Number',
|
|
814
818
|
icon: Binary,
|
|
815
819
|
dims: '2:1-3:1',
|
|
820
|
+
softWrap: true,
|
|
816
821
|
customCss: {
|
|
817
822
|
input: { class: '', style: '' }
|
|
818
823
|
},
|
|
@@ -854,6 +859,7 @@ Hello \${ctx.username}
|
|
|
854
859
|
name: 'Currency',
|
|
855
860
|
icon: DollarSign,
|
|
856
861
|
dims: '2:1-3:1',
|
|
862
|
+
softWrap: true,
|
|
857
863
|
customCss: {
|
|
858
864
|
input: { class: '', style: '' }
|
|
859
865
|
},
|
|
@@ -894,6 +900,7 @@ Hello \${ctx.username}
|
|
|
894
900
|
name: 'Slider',
|
|
895
901
|
icon: SlidersHorizontal,
|
|
896
902
|
dims: '3:1-4:1',
|
|
903
|
+
softWrap: true,
|
|
897
904
|
customCss: {
|
|
898
905
|
bar: { style: '' },
|
|
899
906
|
handle: { style: '' },
|
|
@@ -933,6 +940,7 @@ Hello \${ctx.username}
|
|
|
933
940
|
name: 'Range',
|
|
934
941
|
icon: SlidersHorizontal,
|
|
935
942
|
dims: '3:2-4:2',
|
|
943
|
+
softWrap: true,
|
|
936
944
|
customCss: {
|
|
937
945
|
handles: { style: '' },
|
|
938
946
|
bar: { style: '' },
|
|
@@ -976,6 +984,7 @@ Hello \${ctx.username}
|
|
|
976
984
|
name: 'Password',
|
|
977
985
|
icon: Lock,
|
|
978
986
|
dims: '2:1-3:1',
|
|
987
|
+
softWrap: true,
|
|
979
988
|
customCss: {
|
|
980
989
|
input: { class: '', style: '' }
|
|
981
990
|
},
|
|
@@ -996,6 +1005,7 @@ Hello \${ctx.username}
|
|
|
996
1005
|
name: 'Email Input',
|
|
997
1006
|
icon: AtSignIcon,
|
|
998
1007
|
dims: '2:1-3:1',
|
|
1008
|
+
softWrap: true,
|
|
999
1009
|
customCss: {
|
|
1000
1010
|
input: { class: '', style: '' }
|
|
1001
1011
|
},
|
|
@@ -1021,6 +1031,7 @@ Hello \${ctx.username}
|
|
|
1021
1031
|
name: 'Date',
|
|
1022
1032
|
icon: Calendar,
|
|
1023
1033
|
dims: '2:1-3:1',
|
|
1034
|
+
softWrap: true,
|
|
1024
1035
|
customCss: {
|
|
1025
1036
|
input: { class: '', style: '' }
|
|
1026
1037
|
},
|
|
@@ -1050,6 +1061,7 @@ Hello \${ctx.username}
|
|
|
1050
1061
|
name: 'Tabs',
|
|
1051
1062
|
icon: ListOrdered,
|
|
1052
1063
|
dims: '2:8-6:8',
|
|
1064
|
+
softWrap: true,
|
|
1053
1065
|
customCss: {
|
|
1054
1066
|
tabRow: { class: '', style: '' },
|
|
1055
1067
|
allTabs: { class: '', style: '' },
|
|
@@ -1075,6 +1087,7 @@ Hello \${ctx.username}
|
|
|
1075
1087
|
name: 'Icon',
|
|
1076
1088
|
icon: Smile,
|
|
1077
1089
|
dims: '1:3-1:2',
|
|
1090
|
+
softWrap: true,
|
|
1078
1091
|
customCss: {
|
|
1079
1092
|
container: { class: '', style: '' },
|
|
1080
1093
|
icon: { class: '', style: '' }
|
|
@@ -1235,6 +1248,7 @@ Hello \${ctx.username}
|
|
|
1235
1248
|
name: 'Drawer',
|
|
1236
1249
|
icon: SidebarClose,
|
|
1237
1250
|
dims: '1:1-2:1',
|
|
1251
|
+
softWrap: true,
|
|
1238
1252
|
customCss: {
|
|
1239
1253
|
container: { class: '', style: '' }
|
|
1240
1254
|
},
|
|
@@ -1340,6 +1354,7 @@ Hello \${ctx.username}
|
|
|
1340
1354
|
name: 'Vertical Split Panes',
|
|
1341
1355
|
icon: FlipHorizontal,
|
|
1342
1356
|
dims: '2:8-6:8',
|
|
1357
|
+
softWrap: true,
|
|
1343
1358
|
customCss: {
|
|
1344
1359
|
container: { class: '', style: '' }
|
|
1345
1360
|
},
|
|
@@ -1354,6 +1369,7 @@ Hello \${ctx.username}
|
|
|
1354
1369
|
name: 'Horizontal Split Panes',
|
|
1355
1370
|
icon: FlipVertical,
|
|
1356
1371
|
dims: '2:8-6:8',
|
|
1372
|
+
softWrap: true,
|
|
1357
1373
|
customCss: {
|
|
1358
1374
|
container: { class: '', style: '' }
|
|
1359
1375
|
},
|
|
@@ -13,7 +13,7 @@ function addComponent(appComponentType) {
|
|
|
13
13
|
push(history, $app);
|
|
14
14
|
$dirtyStore = true;
|
|
15
15
|
const id = insertNewGridItem($app, appComponentFromType(appComponentType), $focusedGrid);
|
|
16
|
-
$selectedComponent =
|
|
16
|
+
$selectedComponent = id;
|
|
17
17
|
$app = $app;
|
|
18
18
|
$worldStore = $worldStore;
|
|
19
19
|
}
|
|
@@ -6,6 +6,7 @@ import { Button, ClearableInput } from '../../../common';
|
|
|
6
6
|
import Popover from '../../../Popover.svelte';
|
|
7
7
|
import QuickStyleMenu from './QuickStyleMenu.svelte';
|
|
8
8
|
export let name;
|
|
9
|
+
export let componentType = undefined;
|
|
9
10
|
export let value = {};
|
|
10
11
|
export let forceStyle = false;
|
|
11
12
|
export let forceClass = false;
|
|
@@ -17,6 +18,14 @@ $: dispatch('change', value);
|
|
|
17
18
|
function toggleQuickMenu() {
|
|
18
19
|
isQuickMenuOpen = !isQuickMenuOpen;
|
|
19
20
|
}
|
|
21
|
+
function applyToAllInstances() {
|
|
22
|
+
if (componentType &&
|
|
23
|
+
componentType in ($app?.css || {}) &&
|
|
24
|
+
name in ($app?.css?.[componentType] || {})) {
|
|
25
|
+
$app.css[componentType][name].style = value.style;
|
|
26
|
+
sendUserToast(`Applied style to all instances of the ${componentType.replace('component', '')} component`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
20
29
|
</script>
|
|
21
30
|
|
|
22
31
|
<div
|
|
@@ -41,6 +50,23 @@ function toggleQuickMenu() {
|
|
|
41
50
|
/>
|
|
42
51
|
</div>
|
|
43
52
|
<div class="flex flex-col gap-1">
|
|
53
|
+
{#if componentType}
|
|
54
|
+
<Popover placement="bottom" notClickable disapperTimoout={0}>
|
|
55
|
+
<Button
|
|
56
|
+
variant="border"
|
|
57
|
+
color="light"
|
|
58
|
+
size="xs"
|
|
59
|
+
btnClasses="!p-1 !w-[34px] !h-[34px]"
|
|
60
|
+
aria-label="Apply to all instances of this component"
|
|
61
|
+
on:click={applyToAllInstances}
|
|
62
|
+
>
|
|
63
|
+
<Forward size={18} />
|
|
64
|
+
</Button>
|
|
65
|
+
<svelte:fragment slot="text">
|
|
66
|
+
Apply to all instances of this component
|
|
67
|
+
</svelte:fragment>
|
|
68
|
+
</Popover>
|
|
69
|
+
{/if}
|
|
44
70
|
{#if quickStyleProperties?.length}
|
|
45
71
|
<Popover placement="bottom" notClickable disapperTimoout={0}>
|
|
46
72
|
<Button
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { ComponentCssProperty } from '../../types';
|
|
3
|
+
import type { AppComponent } from '../component/components';
|
|
3
4
|
import type { StylePropertyKey } from './quickStyleProperties';
|
|
4
5
|
declare const __propDef: {
|
|
5
6
|
props: {
|
|
6
7
|
name: string;
|
|
8
|
+
componentType?: AppComponent['type'] | undefined;
|
|
7
9
|
value?: ComponentCssProperty | undefined;
|
|
8
10
|
forceStyle?: boolean | undefined;
|
|
9
11
|
forceClass?: boolean | undefined;
|
|
@@ -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">
|
|
@@ -19,19 +19,16 @@ function parseStyle() {
|
|
|
19
19
|
multiValues = initiateMultiValues();
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
setTopColors();
|
|
33
|
-
}
|
|
34
|
-
catch { }
|
|
22
|
+
const current = parse(value) || {};
|
|
23
|
+
Object.entries(current).forEach(([k, v]) => {
|
|
24
|
+
styleStore.updatePropValue(k, v);
|
|
25
|
+
const { prop, index } = styleStore.getProp(k);
|
|
26
|
+
if (Array.isArray(prop?.prop?.value) && index !== undefined) {
|
|
27
|
+
const valueArray = v.split(' ');
|
|
28
|
+
multiValues[index] = multiValues[index].map((v, i) => valueArray[i] || v);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
setTopColors();
|
|
35
32
|
}
|
|
36
33
|
function writeStyle() {
|
|
37
34
|
const current = parse(value) || {};
|
|
@@ -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,13 +6,16 @@ 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
|
-
const { connectingInput, app
|
|
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
|
|
|
@@ -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: {
|
|
@@ -163,7 +163,7 @@ function handleRefreshOn(refreshOn) {
|
|
|
163
163
|
btnClasses="!px-2 !py-1 !bg-gray-700 !text-white hover:!bg-gray-900"
|
|
164
164
|
on:click={async () => {
|
|
165
165
|
runLoading = true
|
|
166
|
-
await $runnableComponents[id]?.
|
|
166
|
+
await $runnableComponents[id]?.(!transformer ? inlineScript : undefined)
|
|
167
167
|
runLoading = false
|
|
168
168
|
}}
|
|
169
169
|
>
|
|
@@ -199,7 +199,7 @@ function handleRefreshOn(refreshOn) {
|
|
|
199
199
|
inlineScript.content = editor?.getCode() ?? ''
|
|
200
200
|
}
|
|
201
201
|
runLoading = true
|
|
202
|
-
await $runnableComponents[id]?.
|
|
202
|
+
await $runnableComponents[id]?.(inlineScript)
|
|
203
203
|
runLoading = false
|
|
204
204
|
}}
|
|
205
205
|
on:change={async (e) => {
|
|
@@ -222,7 +222,7 @@ function handleRefreshOn(refreshOn) {
|
|
|
222
222
|
bind:this={simpleEditor}
|
|
223
223
|
cmdEnterAction={async () => {
|
|
224
224
|
runLoading = true
|
|
225
|
-
await $runnableComponents[id]?.
|
|
225
|
+
await $runnableComponents[id]?.(!transformer ? inlineScript : undefined)
|
|
226
226
|
runLoading = false
|
|
227
227
|
}}
|
|
228
228
|
class="h-full"
|