windmill-components 1.82.8 → 1.82.9

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.
Files changed (43) hide show
  1. package/components/apps/components/display/AppDisplayComponent.svelte +17 -23
  2. package/components/apps/components/display/AppHtml.svelte +1 -7
  3. package/components/apps/components/display/AppHtml.svelte.d.ts +0 -2
  4. package/components/apps/components/display/PlotlyHtml.svelte +3 -20
  5. package/components/apps/components/display/PlotlyHtml.svelte.d.ts +0 -2
  6. package/components/apps/components/inputs/AppMultiSelect.svelte +1 -5
  7. package/components/apps/components/layout/AppContainer.svelte +1 -1
  8. package/components/apps/editor/AppEditor.svelte +3 -30
  9. package/components/apps/editor/AppPreview.svelte +2 -13
  10. package/components/apps/editor/GridEditor.svelte +2 -11
  11. package/components/apps/editor/GridViewer.svelte +2 -2
  12. package/components/apps/editor/GridViewer.svelte.d.ts +1 -1
  13. package/components/apps/editor/SubGridEditor.svelte +2 -3
  14. package/components/apps/editor/appUtils.d.ts +0 -1
  15. package/components/apps/editor/appUtils.js +0 -19
  16. package/components/apps/editor/component/Component.svelte +3 -1
  17. package/components/apps/editor/component/Component.svelte.d.ts +1 -1
  18. package/components/apps/editor/component/components.d.ts +26 -9
  19. package/components/apps/editor/component/components.js +26 -10
  20. package/components/apps/editor/componentsPanel/CssProperty.svelte +26 -0
  21. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +2 -0
  22. package/components/apps/editor/componentsPanel/CssSettings.svelte +0 -1
  23. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +10 -13
  24. package/components/apps/editor/contextPanel/ComponentOutput.svelte +26 -2
  25. package/components/apps/editor/contextPanel/ComponentOutput.svelte.d.ts +1 -0
  26. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +6 -8
  27. package/components/apps/editor/contextPanel/ContextPanel.svelte +11 -4
  28. package/components/apps/editor/contextPanel/components/BackgroundScriptOutput.svelte +25 -2
  29. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte +25 -0
  30. package/components/apps/editor/contextPanel/components/MinMaxButton.svelte.d.ts +16 -0
  31. package/components/apps/editor/contextPanel/components/OutputHeader.svelte +42 -28
  32. package/components/apps/editor/contextPanel/components/OutputHeader.svelte.d.ts +2 -1
  33. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +2 -2
  34. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +2 -14
  35. package/components/apps/editor/settingsPanel/StylePanel.svelte +2 -40
  36. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +1 -1
  37. package/components/apps/inputType.d.ts +2 -2
  38. package/components/apps/svelte-grid/Grid.svelte +12 -9
  39. package/components/apps/svelte-grid/Grid.svelte.d.ts +6 -1
  40. package/components/apps/svelte-grid/MoveResize.svelte +2 -3
  41. package/components/apps/svelte-grid/MoveResize.svelte.d.ts +8 -1
  42. package/components/apps/types.d.ts +1 -1
  43. package/package.json +2 -1
@@ -19,28 +19,22 @@ const outputs = initOutput($worldStore, id, {
19
19
  </script>
20
20
 
21
21
  <RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
22
- <div class="flex flex-col w-full h-full">
23
- <div
24
- class={twMerge(
25
- 'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
26
- $app.css?.['displaycomponent']?.['header']?.class,
27
- customCss?.header?.class
28
- )}
29
- >
30
- Results
31
- </div>
32
- <div
33
- style={twMerge(
34
- $app.css?.['displaycomponent']?.['container']?.style,
35
- customCss?.container?.style
36
- )}
37
- class={twMerge(
38
- 'p-2 grow',
39
- $app.css?.['displaycomponent']?.['container']?.class,
40
- customCss?.container?.class
41
- )}
42
- >
43
- <DisplayResult {result} {requireHtmlApproval} />
44
- </div>
22
+ <div
23
+ class={twMerge(
24
+ 'w-full border-b px-2 text-xs p-1 font-semibold bg-gray-500 text-white rounded-t-sm',
25
+ $app.css?.['displaycomponent']?.['header']?.class,
26
+ customCss?.header?.class
27
+ )}
28
+ >
29
+ Results
30
+ </div>
31
+ <div
32
+ class={twMerge(
33
+ 'p-2',
34
+ $app.css?.['displaycomponent']?.['container']?.class,
35
+ customCss?.container?.class
36
+ )}
37
+ >
38
+ <DisplayResult {result} {requireHtmlApproval} />
45
39
  </div>
46
40
  </RunnableWrapper>
@@ -7,7 +7,7 @@ export let componentInput;
7
7
  export let initializing = undefined;
8
8
  export let customCss = undefined;
9
9
  export let render;
10
- const { app, worldStore, selectedComponent } = getContext('AppViewerContext');
10
+ const { app, worldStore } = getContext('AppViewerContext');
11
11
  const outputs = initOutput($worldStore, id, {
12
12
  result: undefined,
13
13
  loading: false
@@ -26,10 +26,6 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
26
26
  bind:clientHeight={h}
27
27
  bind:clientWidth={w}
28
28
  >
29
- <button
30
- class="absolute bottom-0 left-0 text-xs border px-2 py-0.5 bg-white/80"
31
- on:click={() => ($selectedComponent = [id])}>Select</button
32
- >
33
29
  <RunnableWrapper
34
30
  {outputs}
35
31
  {render}
@@ -50,7 +46,5 @@ $: css = concatCustomCss($app.css?.htmlcomponent, customCss);
50
46
  : 'No html'}
51
47
  />
52
48
  {/key}
53
- <!-- svelte-ignore a11y-click-events-have-key-events -->
54
- <div on:click|stopPropagation class="absolute top-0 h-full w-full" />
55
49
  </RunnableWrapper>
56
50
  </div>
@@ -10,8 +10,6 @@ declare const __propDef: {
10
10
  render: boolean;
11
11
  };
12
12
  events: {
13
- click: MouseEvent;
14
- } & {
15
13
  [evt: string]: CustomEvent<any>;
16
14
  };
17
15
  slots: {};
@@ -1,15 +1,12 @@
1
1
  <script>import { getContext, onMount } from 'svelte';
2
- import { initConfig, initOutput } from '../../editor/appUtils';
3
- import { components } from '../../editor/component';
4
- import ResolveConfig from '../helpers/ResolveConfig.svelte';
2
+ import { initOutput } from '../../editor/appUtils';
5
3
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
6
4
  export let id;
7
5
  export let componentInput;
8
- export let configuration;
6
+ // export let configuration: Record<string, AppInput>
9
7
  export let initializing = undefined;
10
8
  export let render;
11
9
  const { worldStore } = getContext('AppViewerContext');
12
- let resolvedConfig = initConfig(components['plotlycomponent'].initialData.configuration, configuration);
13
10
  const outputs = initOutput($worldStore, id, {
14
11
  result: undefined,
15
12
  loading: false
@@ -30,23 +27,9 @@ $: Plotly &&
30
27
  divEl &&
31
28
  h &&
32
29
  w &&
33
- Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], {
34
- width: w,
35
- height: h,
36
- margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 },
37
- ...resolvedConfig.layout
38
- }, { responsive: true, displayModeBar: false });
30
+ Plotly.newPlot(divEl, Array.isArray(result) ? result : [result], { width: w, height: h, margin: { l: 50, r: 40, b: 40, t: 40, pad: 4 } }, { responsive: true, displayModeBar: false });
39
31
  </script>
40
32
 
41
- {#each Object.keys(components['plotlycomponent'].initialData.configuration) as key (key)}
42
- <ResolveConfig
43
- {id}
44
- {key}
45
- bind:resolvedConfig={resolvedConfig[key]}
46
- configuration={configuration[key]}
47
- />
48
- {/each}
49
-
50
33
  <div class="w-full h-full" bind:clientHeight={h} bind:clientWidth={w}>
51
34
  <RunnableWrapper {outputs} {render} {componentInput} {id} bind:initializing bind:result>
52
35
  <div on:pointerdown bind:this={divEl} />
@@ -1,11 +1,9 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { AppInput } from '../../inputType';
3
- import type { RichConfigurations } from '../../types';
4
3
  declare const __propDef: {
5
4
  props: {
6
5
  id: string;
7
6
  componentInput: AppInput | undefined;
8
- configuration: RichConfigurations;
9
7
  initializing?: boolean | undefined;
10
8
  render: boolean;
11
9
  };
@@ -42,11 +42,7 @@ $: css = concatCustomCss($app.css?.selectcomponent, customCss);
42
42
  <InputValue {id} input={configuration.placeholder} bind:value={placeholder} />
43
43
 
44
44
  <AlignWrapper {render} {horizontalAlignment} {verticalAlignment}>
45
- <div
46
- class="app-select w-full"
47
- style="height: 34px; overflow: auto;"
48
- on:pointerdown|stopPropagation
49
- >
45
+ <div class="app-select w-full" style="height: 34px" on:pointerdown|stopPropagation>
50
46
  {#if !value || Array.isArray(value)}
51
47
  <Select
52
48
  --border-radius="0"
@@ -15,6 +15,7 @@ function onFocus() {
15
15
  subGridIndex: 0
16
16
  };
17
17
  }
18
+ $: $selectedComponent?.includes(id) && onFocus();
18
19
  $: css = concatCustomCss($app.css?.containercomponent, customCss);
19
20
  </script>
20
21
 
@@ -29,7 +30,6 @@ $: css = concatCustomCss($app.css?.containercomponent, customCss);
29
30
  containerHeight={componentContainerHeight}
30
31
  on:focus={() => {
31
32
  $selectedComponent = [id]
32
- onFocus()
33
33
  }}
34
34
  />
35
35
  {/if}
@@ -27,8 +27,6 @@ import ItemPicker from '../../ItemPicker.svelte';
27
27
  import VariableEditor from '../../VariableEditor.svelte';
28
28
  import { SecondaryMenu } from './settingsPanel/secondaryMenu';
29
29
  import { Component, Paintbrush, Plus } from 'lucide-svelte';
30
- import { findGridItem, findGridItemParentGrid } from './appUtils';
31
- import { findItemsById } from '../svelte-grid/utils/matrix';
32
30
  export let app;
33
31
  export let path;
34
32
  export let initialMode = 'dnd';
@@ -79,8 +77,7 @@ setContext('AppViewerContext', {
79
77
  parentWidth: writable(0),
80
78
  state: writable({}),
81
79
  componentControl: writable({}),
82
- hoverStore: writable(undefined),
83
- allIdsInPath: writable([])
80
+ hoverStore: writable(undefined)
84
81
  });
85
82
  setContext('AppEditorContext', {
86
83
  history,
@@ -117,32 +114,6 @@ let befSelected = undefined;
117
114
  $: if ($selectedComponent?.[0] != befSelected) {
118
115
  befSelected = $selectedComponent?.[0];
119
116
  selectedTab = 'settings';
120
- if (befSelected) {
121
- if (!['ctx', 'state'].includes(befSelected) && !befSelected?.startsWith('bg_')) {
122
- let item = findGridItem($appStore, befSelected);
123
- if (item?.data.type === 'containercomponent') {
124
- $focusedGrid = {
125
- parentComponentId: befSelected,
126
- subGridIndex: 0
127
- };
128
- }
129
- else {
130
- let subgrid = findGridItemParentGrid($appStore, befSelected);
131
- if (subgrid) {
132
- try {
133
- $focusedGrid = {
134
- parentComponentId: subgrid.split('-')[0],
135
- subGridIndex: parseInt(subgrid.split('-')[1])
136
- };
137
- }
138
- catch { }
139
- }
140
- else {
141
- $focusedGrid = undefined;
142
- }
143
- }
144
- }
145
- }
146
117
  }
147
118
  let itemPicker = undefined;
148
119
  $: if ($pickVariableCallback) {
@@ -236,6 +207,7 @@ let variableEditor = undefined;
236
207
  <Tab value="insert" size="xs">
237
208
  <div class="m-1 center-center gap-1">
238
209
  <Plus size={18} />
210
+ <span>Insert</span>
239
211
  </div>
240
212
  </Tab>
241
213
  <Tab value="settings" size="xs">
@@ -247,6 +219,7 @@ let variableEditor = undefined;
247
219
  <Tab value="css" size="xs">
248
220
  <div class="m-1 center-center gap-1">
249
221
  <Paintbrush size={18} />
222
+ <span>Styling</span>
250
223
  </div>
251
224
  </Tab>
252
225
  <div slot="content" class="h-full overflow-y-auto">
@@ -10,8 +10,6 @@ import { Component } from './component';
10
10
  import { twMerge } from 'tailwind-merge';
11
11
  import { columnConfiguration } from '../gridUtils';
12
12
  import { HiddenComponent } from '../components';
13
- import { deepEqual } from 'fast-equals';
14
- import { dfs } from './appUtils';
15
13
  export let app;
16
14
  export let appPath;
17
15
  export let breakpoint;
@@ -30,7 +28,6 @@ const connectingInput = writable({
30
28
  input: undefined,
31
29
  hoveredComponent: undefined
32
30
  });
33
- const allIdsInPath = writable([]);
34
31
  const parentWidth = writable(0);
35
32
  setContext('AppViewerContext', {
36
33
  worldStore: buildWorld(context),
@@ -55,21 +52,13 @@ setContext('AppViewerContext', {
55
52
  parentWidth,
56
53
  state: writable({}),
57
54
  componentControl: writable({}),
58
- hoverStore: writable(undefined),
59
- allIdsInPath
55
+ hoverStore: writable(undefined)
60
56
  });
61
57
  let ncontext = context;
62
58
  function hashchange(e) {
63
59
  ncontext.hash = e.newURL.split('#')[1];
64
60
  ncontext = ncontext;
65
61
  }
66
- let previousSelectedIds = undefined;
67
- $: if (!deepEqual(previousSelectedIds, $selectedComponent)) {
68
- previousSelectedIds = $selectedComponent;
69
- $allIdsInPath = ($selectedComponent ?? [])
70
- .flatMap((id) => dfs(app.grid, id, app.subgrids ?? {}))
71
- .filter((x) => x != undefined);
72
- }
73
62
  $: width = $breakpoint === 'sm' ? 'max-w-[640px]' : 'w-full ';
74
63
  $: lockedClasses = isLocked ? '!max-h-[400px] overflow-hidden pointer-events-none' : '';
75
64
  </script>
@@ -110,7 +99,7 @@ $: lockedClasses = isLocked ? '!max-h-[400px] overflow-hidden pointer-events-non
110
99
  >
111
100
  <div>
112
101
  <GridViewer
113
- allIdsInPath={$allIdsInPath}
102
+ onTopId={$selectedComponent?.[0]}
114
103
  items={app.grid}
115
104
  let:dataItem
116
105
  rowHeight={36}
@@ -6,20 +6,12 @@ import RecomputeAllComponents from './RecomputeAllComponents.svelte';
6
6
  import HiddenComponent from '../components/helpers/HiddenComponent.svelte';
7
7
  import Component from './component/Component.svelte';
8
8
  import { push } from '../../../history';
9
- import { dfs, expandGriditem, findGridItem } from './appUtils';
9
+ import { expandGriditem, findGridItem } from './appUtils';
10
10
  import Grid from '../svelte-grid/Grid.svelte';
11
11
  import { selectId } from '../utils';
12
- import { deepEqual } from 'fast-equals';
13
12
  export let policy;
14
- const { selectedComponent, app, mode, connectingInput, runnableComponents, summary, focusedGrid, parentWidth, breakpoint, allIdsInPath } = getContext('AppViewerContext');
13
+ const { selectedComponent, app, mode, connectingInput, runnableComponents, summary, focusedGrid, parentWidth, breakpoint } = getContext('AppViewerContext');
15
14
  const { history } = getContext('AppEditorContext');
16
- let previousSelectedIds = undefined;
17
- $: if (!deepEqual(previousSelectedIds, $selectedComponent)) {
18
- previousSelectedIds = $selectedComponent;
19
- $allIdsInPath = ($selectedComponent ?? [])
20
- .flatMap((id) => dfs($app.grid, id, $app.subgrids ?? {}))
21
- .filter((x) => x != undefined);
22
- }
23
15
  function removeGridElement(component) {
24
16
  if (component) {
25
17
  $app.grid = $app.grid.filter((gridComponent) => {
@@ -89,7 +81,6 @@ function selectComponent(e, id) {
89
81
  >
90
82
  <div class={!$focusedGrid && $mode !== 'preview' ? 'border-gray-400 border border-dashed' : ''}>
91
83
  <Grid
92
- allIdsInPath={$allIdsInPath}
93
84
  selectedIds={$selectedComponent}
94
85
  items={$app.grid}
95
86
  on:redraw={(e) => {
@@ -8,7 +8,7 @@ export let rowHeight;
8
8
  export let cols;
9
9
  export let gap = [10, 10];
10
10
  export let throttleUpdate = 100;
11
- export let allIdsInPath = undefined;
11
+ export let onTopId = undefined;
12
12
  export let containerWidth = undefined;
13
13
  export let parentWidth = undefined;
14
14
  let getComputedCols;
@@ -56,7 +56,7 @@ onMount(() => {
56
56
  <div class="svlt-grid-container" style="height: {containerHeight}px" bind:this={container}>
57
57
  {#if xPerPx}
58
58
  {#each items as item (item.id)}
59
- {@const onTop = allIdsInPath?.includes(item.id)}
59
+ {@const onTop = item.id == onTopId}
60
60
  {@const width =
61
61
  Math.min(getComputedCols, item[getComputedCols] && item[getComputedCols].w) * xPerPx -
62
62
  gapX * 2}
@@ -7,7 +7,7 @@ declare class __sveltets_Render<T> {
7
7
  cols: [number, number][];
8
8
  gap?: number[] | undefined;
9
9
  throttleUpdate?: number | undefined;
10
- allIdsInPath?: string[] | undefined;
10
+ onTopId?: string | undefined;
11
11
  containerWidth?: number | undefined;
12
12
  parentWidth?: number | undefined;
13
13
  };
@@ -20,7 +20,7 @@ export let visible = true;
20
20
  export let id;
21
21
  export let shouldHighlight = true;
22
22
  const dispatch = createEventDispatcher();
23
- const { app, connectingInput, selectedComponent, focusedGrid, mode, parentWidth, breakpoint, allIdsInPath } = getContext('AppViewerContext');
23
+ const { app, connectingInput, selectedComponent, focusedGrid, mode, parentWidth, breakpoint } = getContext('AppViewerContext');
24
24
  const editorContext = getContext('AppEditorContext');
25
25
  $: highlight = id === $focusedGrid?.parentComponentId && shouldHighlight;
26
26
  const onpointerdown = (e) => {
@@ -60,7 +60,6 @@ let container = undefined;
60
60
  {#if $mode !== 'preview'}
61
61
  <div class={highlight ? 'border-gray-400 border border-dashed min-h-full' : ''}>
62
62
  <Grid
63
- allIdsInPath={$allIdsInPath}
64
63
  items={$app.subgrids?.[subGridId] ?? []}
65
64
  on:redraw={(e) => {
66
65
  push(editorContext?.history, $app)
@@ -131,7 +130,7 @@ let container = undefined;
131
130
  </div>
132
131
  {:else}
133
132
  <GridViewer
134
- allIdsInPath={$allIdsInPath}
133
+ onTopId={$selectedComponent?.[0]}
135
134
  items={$app.subgrids?.[subGridId] ?? []}
136
135
  let:dataItem
137
136
  rowHeight={36}
@@ -3,7 +3,6 @@ import { components, type AppComponent, type BaseComponent } from './component';
3
3
  import type { Output, World } from '../rx';
4
4
  import type { FilledItem } from '../svelte-grid/types';
5
5
  import type { EvalAppInput, StaticAppInput } from '../inputType';
6
- export declare function dfs(grid: GridItem[], id: string, subgrids: Record<string, GridItem[]>): string[] | undefined;
7
6
  export declare function findGridItemParentGrid(app: App, id: string): string | undefined;
8
7
  export declare function allsubIds(app: App, parentId: string): string[];
9
8
  export declare function findGridItem(app: App, id: string): GridItem | undefined;
@@ -3,25 +3,6 @@ import { ccomponents, components, getRecommendedDimensionsByComponent } from './
3
3
  import { gridColumns } from '../gridUtils';
4
4
  import { allItems } from '../utils';
5
5
  import gridHelp from '../svelte-grid/utils/helper';
6
- export function dfs(grid, id, subgrids) {
7
- for (const item of grid) {
8
- if (item.id === id) {
9
- return [id];
10
- }
11
- else if (item.data.type == 'tablecomponent' && item.data.actionButtons.find((x) => x.id)) {
12
- return [item.id, id];
13
- }
14
- else {
15
- for (let i = 0; i < (item.data.numberOfSubgrids ?? 0); i++) {
16
- const res = dfs(subgrids[`${item.id}-${i}`], id, subgrids);
17
- if (res) {
18
- return [item.id, ...res];
19
- }
20
- }
21
- }
22
- }
23
- return undefined;
24
- }
25
6
  function findGridItemById(root, subGrids, id) {
26
7
  for (const gridItem of allItems(root, subGrids)) {
27
8
  if (gridItem.id === id) {
@@ -1,6 +1,8 @@
1
1
  <script>import { getContext } from 'svelte';
2
+ import { Loader2 } from 'lucide-svelte';
2
3
  import { twMerge } from 'tailwind-merge';
3
4
  import ComponentHeader from '../ComponentHeader.svelte';
5
+ import { ccomponents, components } from './components';
4
6
  import { AppBarChart, AppDisplayComponent, AppTable, AppText, AppButton, AppPieChart, AppSelect, AppCheckbox, AppTextInput, AppNumberInput, AppDateInput, AppForm, AppScatterChart, AppTimeseries, AppHtml, AppSliderInputs, AppFormButton, VegaLiteHtml, PlotlyHtml, AppRangeInput, AppTabs, AppIcon, AppCurrencyInput, AppDivider, AppFileInput, AppImage, AppContainer, AppAggridTable, AppDrawer, AppMap, AppSplitpanes, AppPdf } from '../../components';
5
7
  import AppMultiSelect from '../../components/inputs/AppMultiSelect.svelte';
6
8
  export let component;
@@ -59,6 +61,7 @@ $: hasError = componentWithErrors.includes(component.id);
59
61
  'h-full bg-white/40 outline-1',
60
62
  $hoverStore === component.id && $mode !== 'preview' ? 'outline outline-blue-600' : '',
61
63
  selected && $mode !== 'preview' ? 'outline outline-indigo-600' : '',
64
+ ccomponents[component.type].softWrap || hasError ? '' : 'overflow-auto',
62
65
  $mode != 'preview' ? 'cursor-pointer' : '',
63
66
  'relative z-auto',
64
67
  $app.css?.['app']?.['component']?.class,
@@ -112,7 +115,6 @@ $: hasError = componentWithErrors.includes(component.id);
112
115
  {:else if component.type === 'plotlycomponent'}
113
116
  <PlotlyHtml
114
117
  id={component.id}
115
- configuration={component.configuration}
116
118
  bind:initializing
117
119
  componentInput={component.componentInput}
118
120
  {render}
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { AppComponent } from './components';
2
+ import { type AppComponent } from './components';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  component: AppComponent;