windmill-components 1.82.2 → 1.82.3

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/Multiselect.svelte.d.ts +2 -2
  2. package/components/apps/components/buttons/AppFormButton.svelte +70 -58
  3. package/components/apps/editor/AppEditor.svelte +12 -14
  4. package/components/apps/editor/AppPreview.svelte +2 -1
  5. package/components/apps/editor/component/README.md +0 -4
  6. package/components/apps/editor/componentsPanel/CssProperty.svelte +47 -87
  7. package/components/apps/editor/componentsPanel/CssProperty.svelte.d.ts +2 -5
  8. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +14 -24
  9. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +12 -12
  10. package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte.d.ts +2 -3
  11. package/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte +1 -1
  12. package/components/apps/types.d.ts +1 -2
  13. package/components/common/button/ButtonPopup.svelte +2 -5
  14. package/components/common/button/ButtonPopup.svelte.d.ts +1 -5
  15. package/components/common/button/ButtonPopupItem.svelte +1 -2
  16. package/components/common/button/ButtonPopupItem.svelte.d.ts +0 -1
  17. package/components/common/index.d.ts +0 -1
  18. package/components/common/index.js +0 -1
  19. package/components/common/kbd/Kbd.svelte +1 -4
  20. package/components/common/kbd/Kbd.svelte.d.ts +14 -6
  21. package/components/common/menu/Menu.svelte +2 -8
  22. package/components/common/menu/Menu.svelte.d.ts +1 -4
  23. package/package.json +1 -11
  24. package/utils.d.ts +0 -1
  25. package/utils.js +0 -3
  26. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +0 -167
  27. package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte.d.ts +0 -18
  28. package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte +0 -130
  29. package/components/apps/editor/componentsPanel/QuickStyleProperty.svelte.d.ts +0 -21
  30. package/components/apps/editor/componentsPanel/quickStyleProperties.d.ts +0 -535
  31. package/components/apps/editor/componentsPanel/quickStyleProperties.js +0 -595
  32. package/components/apps/editor/settingsPanel/StylePanel.svelte +0 -23
  33. package/components/apps/editor/settingsPanel/StylePanel.svelte.d.ts +0 -17
  34. package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +0 -47
  35. package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte.d.ts +0 -14
  36. package/components/apps/editor/settingsPanel/secondaryMenu/index.d.ts +0 -2
  37. package/components/apps/editor/settingsPanel/secondaryMenu/index.js +0 -2
  38. package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.d.ts +0 -12
  39. package/components/apps/editor/settingsPanel/secondaryMenu/menuStore.js +0 -10
  40. package/components/common/clearableInput/ClearableInput.svelte +0 -56
  41. package/components/common/clearableInput/ClearableInput.svelte.d.ts +0 -28
  42. package/components/common/modal/AlwaysMountedModal.svelte +0 -109
  43. package/components/common/modal/AlwaysMountedModal.svelte.d.ts +0 -22
@@ -4,8 +4,8 @@
4
4
  export default class Multiselect extends SvelteComponentTyped<{
5
5
  value?: any[] | undefined;
6
6
  id?: string | undefined;
7
- placeholder?: string | undefined;
8
7
  readonly?: boolean | undefined;
8
+ placeholder?: string | undefined;
9
9
  }, {
10
10
  [evt: string]: CustomEvent<any>;
11
11
  }, {
@@ -20,8 +20,8 @@ declare const __propDef: {
20
20
  props: {
21
21
  value?: any[] | undefined;
22
22
  id?: string | undefined;
23
- placeholder?: string | undefined;
24
23
  readonly?: boolean | undefined;
24
+ placeholder?: string | undefined;
25
25
  };
26
26
  events: {
27
27
  [evt: string]: CustomEvent<any>;
@@ -3,12 +3,14 @@ import { faUser } from '@fortawesome/free-solid-svg-icons';
3
3
  import { getContext } from 'svelte';
4
4
  import { Icon } from 'svelte-awesome';
5
5
  import AlignWrapper from '../helpers/AlignWrapper.svelte';
6
+ import InputValue from '../helpers/InputValue.svelte';
6
7
  import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
8
+ import Portal from 'svelte-portal';
9
+ import Modal from '../../../common/modal/Modal.svelte';
7
10
  import { concatCustomCss } from '../../utils';
8
11
  import { initConfig, initOutput } from '../../editor/appUtils';
9
12
  import { components } from '../../editor/component';
10
13
  import ResolveConfig from '../helpers/ResolveConfig.svelte';
11
- import AlwaysMountedModal, { getModal } from '../../../common/modal/AlwaysMountedModal.svelte';
12
14
  export let id;
13
15
  export let componentInput;
14
16
  export let configuration;
@@ -28,6 +30,7 @@ let runnableComponent;
28
30
  let isLoading = false;
29
31
  let ownClick = false;
30
32
  let errors = {};
33
+ let open = false;
31
34
  $: errorsMessage = Object.values(errors)
32
35
  .filter((x) => x != '')
33
36
  .join('\n');
@@ -59,64 +62,73 @@ let runnableWrapper;
59
62
  />
60
63
  {/each}
61
64
 
62
- <AlwaysMountedModal
63
- title={resolvedConfig.label ?? ''}
64
- class={css?.popup?.class}
65
- style={css?.popup?.style}
66
- >
67
- <RunnableWrapper
68
- bind:this={runnableWrapper}
69
- {recomputeIds}
70
- {render}
71
- bind:runnableComponent
72
- {componentInput}
73
- {id}
74
- {extraQueryParams}
75
- autoRefresh={false}
76
- forceSchemaDisplay={true}
77
- runnableClass="!block"
78
- {outputs}
79
- doOnSuccess={resolvedConfig.onSuccess}
65
+ <Portal>
66
+ <Modal
67
+ {open}
68
+ title={resolvedConfig.label ?? ''}
69
+ class={css?.popup?.class}
70
+ style={css?.popup?.style}
71
+ on:canceled={() => {
72
+ open = false
73
+ }}
74
+ on:confirmed={() => {
75
+ open = false
76
+ }}
80
77
  >
81
- <div class="flex flex-col gap-2 px-4 w-full">
82
- <div>
83
- {#if noInputs}
84
- <div class="text-gray-600 italic text-sm my-4">
85
- Run forms are associated with a runnable that has user inputs.
86
- <br />
87
- Once a script or flow is chosen, set some <strong>Runnable Inputs</strong> to
88
- <strong>
89
- User Input
90
- <Icon data={faUser} scale={1.3} class="rounded-sm bg-gray-200 p-1 ml-0.5" />
91
- </strong>
92
- </div>
93
- {/if}
94
- </div>
95
- <div class="flex justify-end">
96
- <Button
97
- {loading}
98
- btnClasses="my-1"
99
- on:pointerdown={(e) => {
100
- e?.stopPropagation()
101
- window.dispatchEvent(new Event('pointerup'))
102
- }}
103
- on:click={async () => {
104
- if (!runnableComponent) {
105
- runnableWrapper.onSuccess()
106
- } else {
107
- await runnableComponent?.runComponent()
108
- }
109
- getModal().close()
110
- }}
111
- size="xs"
112
- color="dark"
113
- >
114
- Submit
115
- </Button>
78
+ <RunnableWrapper
79
+ bind:this={runnableWrapper}
80
+ {recomputeIds}
81
+ {render}
82
+ bind:runnableComponent
83
+ {componentInput}
84
+ {id}
85
+ {extraQueryParams}
86
+ autoRefresh={false}
87
+ forceSchemaDisplay={true}
88
+ runnableClass="!block"
89
+ {outputs}
90
+ doOnSuccess={resolvedConfig.onSuccess}
91
+ >
92
+ <div class="flex flex-col gap-2 px-4 w-full">
93
+ <div>
94
+ {#if noInputs}
95
+ <div class="text-gray-600 italic text-sm my-4">
96
+ Run forms are associated with a runnable that has user inputs.
97
+ <br />
98
+ Once a script or flow is chosen, set some <strong>Runnable Inputs</strong> to
99
+ <strong>
100
+ User Input
101
+ <Icon data={faUser} scale={1.3} class="rounded-sm bg-gray-200 p-1 ml-0.5" />
102
+ </strong>
103
+ </div>
104
+ {/if}
105
+ </div>
106
+ <div class="flex justify-end">
107
+ <Button
108
+ {loading}
109
+ btnClasses="my-1"
110
+ on:pointerdown={(e) => {
111
+ e?.stopPropagation()
112
+ window.dispatchEvent(new Event('pointerup'))
113
+ }}
114
+ on:click={async () => {
115
+ if (!runnableComponent) {
116
+ runnableWrapper.onSuccess()
117
+ } else {
118
+ await runnableComponent?.runComponent()
119
+ }
120
+ open = false
121
+ }}
122
+ size="xs"
123
+ color="dark"
124
+ >
125
+ Submit
126
+ </Button>
127
+ </div>
116
128
  </div>
117
- </div>
118
- </RunnableWrapper>
119
- </AlwaysMountedModal>
129
+ </RunnableWrapper>
130
+ </Modal>
131
+ </Portal>
120
132
 
121
133
  <AlignWrapper {horizontalAlignment} {verticalAlignment}>
122
134
  {#if errorsMessage}
@@ -129,7 +141,7 @@ let runnableWrapper;
129
141
  btnClasses={css?.button?.class ?? ''}
130
142
  style={css?.button?.style ?? ''}
131
143
  on:click={(e) => {
132
- getModal().open()
144
+ open = true
133
145
  }}
134
146
  >
135
147
  {resolvedConfig.label}
@@ -10,7 +10,8 @@ import Tabs from '../../common/tabs/Tabs.svelte';
10
10
  import TabContent from '../../common/tabs/TabContent.svelte';
11
11
  import { Alert, Button, Tab } from '../../common';
12
12
  import ComponentList from './componentsPanel/ComponentList.svelte';
13
- import { faPlus } from '@fortawesome/free-solid-svg-icons';
13
+ import Icon from 'svelte-awesome';
14
+ import { faCode, faPlus, faSliders } from '@fortawesome/free-solid-svg-icons';
14
15
  import ContextPanel from './contextPanel/ContextPanel.svelte';
15
16
  import { classNames, encodeState } from '../../../utils';
16
17
  import AppPreview from './AppPreview.svelte';
@@ -25,8 +26,6 @@ import { initHistory } from '../../../history';
25
26
  import ComponentNavigation from './component/ComponentNavigation.svelte';
26
27
  import ItemPicker from '../../ItemPicker.svelte';
27
28
  import VariableEditor from '../../VariableEditor.svelte';
28
- import { SecondaryMenu } from './settingsPanel/secondaryMenu';
29
- import { Component, Paintbrush, Plus } from 'lucide-svelte';
30
29
  export let app;
31
30
  export let path;
32
31
  export let initialMode = 'dnd';
@@ -161,7 +160,7 @@ let variableEditor = undefined;
161
160
  <Pane size={15} minSize={5} maxSize={33}>
162
161
  <ContextPanel />
163
162
  </Pane>
164
- <Pane size={63}>
163
+ <Pane size={64}>
165
164
  <SplitPanesWrapper>
166
165
  <Splitpanes horizontal>
167
166
  <Pane size={70}>
@@ -202,32 +201,31 @@ let variableEditor = undefined;
202
201
  </Splitpanes>
203
202
  </SplitPanesWrapper>
204
203
  </Pane>
205
- <Pane size={22} minSize={5} maxSize={33}>
204
+ <Pane size={21} minSize={5} maxSize={33}>
206
205
  <div class="relative flex flex-col h-full">
207
206
  <Tabs bind:selected={selectedTab} wrapperClass="!h-[40px]" class="!h-full">
208
207
  <Tab value="insert" size="xs">
209
- <div class="m-1 center-center gap-1">
210
- <Plus size={18} />
208
+ <div class="m-1 center-center gap-2">
209
+ <Icon data={faPlus} />
211
210
  <span>Insert</span>
212
211
  </div>
213
212
  </Tab>
214
213
  <Tab value="settings" size="xs">
215
- <div class="m-1 center-center gap-1">
216
- <Component size={18} />
217
- <span>Component</span>
214
+ <div class="m-1 center-center gap-2">
215
+ <Icon data={faSliders} />
216
+ <span>Settings</span>
218
217
  </div>
219
218
  </Tab>
220
219
  <Tab value="css" size="xs">
221
- <div class="m-1 center-center gap-1">
222
- <Paintbrush size={18} />
223
- <span>Styling</span>
220
+ <div class="m-1 center-center gap-2">
221
+ <Icon data={faCode} />
222
+ <span>CSS</span>
224
223
  </div>
225
224
  </Tab>
226
225
  <div slot="content" class="h-full overflow-y-auto">
227
226
  <TabContent class="overflow-auto h-full" value="settings">
228
227
  {#if $selectedComponent !== undefined}
229
228
  <SettingsPanel />
230
- <SecondaryMenu />
231
229
  {:else}
232
230
  <div class="min-w-[150px] text-sm text-gray-500 text-center py-8 px-2">
233
231
  Select a component to see the settings&nbsp;for&nbsp;it
@@ -82,7 +82,8 @@ $: lockedClasses = isLocked ? '!max-h-[400px] overflow-hidden pointer-events-non
82
82
  )}
83
83
  >
84
84
  <div
85
- class="w-full sticky z-[1001] top-0 flex justify-between border-b bg-gray-50 px-4 py-1 items-center gap-4"
85
+ class="w-full sticky top-0 flex justify-between border-b bg-gray-50 px-4 py-1 items-center gap-4"
86
+ style="z-index: 1000;"
86
87
  >
87
88
  <h2 class="truncate">{summary}</h2>
88
89
  <RecomputeAllComponents />
@@ -8,10 +8,6 @@
8
8
  1. Add the component to one of the component sets: `layout`, `buttons`,
9
9
  `inputs` or `display` _(this controls which group the component will be
10
10
  placed in in the **Insert** menu)_
11
- 1. [**`quickStyleProperties.ts`**](../componentsPanel/quickStyleProperties.ts):
12
- 1. Add the component to the `quickStyleProperties` record
13
- 1. _(optional)_ Add the CSS properties that could be applied to the component
14
- parts
15
11
  1. [**`Component.svelte`**](./Component.svelte):
16
12
  1. Add the new component in the Svelte `if` statement
17
13
  1. [**`default-codes.ts`**](./default-codes.ts):
@@ -1,107 +1,67 @@
1
- <script>import { Forward, Paintbrush2 } from 'lucide-svelte';
2
- import { createEventDispatcher, getContext } from 'svelte';
1
+ <script>import { X } from 'lucide-svelte';
3
2
  import { fade } from 'svelte/transition';
4
- import { addWhitespaceBeforeCapitals, sendUserToast } from '../../../../utils';
5
- import { Button, ClearableInput } from '../../../common';
6
- import Popover from '../../../Popover.svelte';
7
- import QuickStyleMenu from './QuickStyleMenu.svelte';
3
+ import { addWhitespaceBeforeCapitals } from '../../../../utils';
8
4
  export let name;
9
- export let componentType = undefined;
10
5
  export let value = {};
11
6
  export let forceStyle = false;
12
7
  export let forceClass = false;
13
- export let quickStyleProperties = undefined;
14
- const { app } = getContext('AppViewerContext');
15
- const dispatch = createEventDispatcher();
16
- let isQuickMenuOpen = false;
17
- $: dispatch('change', value);
18
- function toggleQuickMenu() {
19
- isQuickMenuOpen = !isQuickMenuOpen;
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`);
8
+ function reset(property) {
9
+ if (value) {
10
+ value[property] = '';
27
11
  }
28
12
  }
29
13
  </script>
30
14
 
31
- <div
32
- class="sticky top-0 z-20 text-lg bg-white font-semibold [font-variant:small-caps] text-gray-700 pt-2 pb-1"
33
- >
15
+ <div class="text-sm font-semibold text-gray-500 capitalize pt-2">
34
16
  {addWhitespaceBeforeCapitals(name)}
35
17
  </div>
36
18
  {#if value}
37
- <div class="border-l border-gray-400/80 py-1 pl-3.5 ml-0.5">
19
+ <div class="border-l border-gray-400/80 py-1 pl-3.5 mt-1 ml-0.5">
38
20
  {#if value.style !== undefined || forceStyle}
39
- <div class="pb-2">
40
- <!-- svelte-ignore a11y-label-has-associated-control -->
41
- <label class="block">
42
- <div class="text-sm font-medium text-gray-600 pb-0.5"> Style </div>
43
- <div class="flex gap-1">
44
- <div class="relative grow">
45
- <ClearableInput
46
- bind:value={value.style}
47
- type="textarea"
48
- wrapperClass="h-full min-h-[72px]"
49
- inputClass="h-full"
50
- />
51
- </div>
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}
70
- {#if quickStyleProperties?.length}
71
- <Popover placement="bottom" notClickable disapperTimoout={0}>
72
- <Button
73
- variant="border"
74
- color="light"
75
- size="xs"
76
- btnClasses="!p-1 !w-[34px] !h-[34px] {isQuickMenuOpen
77
- ? '!bg-gray-200/60 hover:!bg-gray-200'
78
- : ''}"
79
- aria-label="{isQuickMenuOpen ? 'Close' : 'Open'} styling menu"
80
- on:click={toggleQuickMenu}
81
- >
82
- <Paintbrush2 size={18} />
83
- </Button>
84
- <svelte:fragment slot="text">
85
- {isQuickMenuOpen ? 'Close' : 'Open'} styling menu
86
- </svelte:fragment>
87
- </Popover>
88
- {/if}
89
- </div>
90
- </div>
91
- </label>
92
- {#if quickStyleProperties?.length && isQuickMenuOpen}
93
- <div transition:fade|local={{ duration: 200 }} class="w-full pt-1">
94
- <QuickStyleMenu bind:value={value.style} properties={quickStyleProperties} />
95
- </div>
96
- {/if}
97
- </div>
21
+ <label class="block pb-2">
22
+ <div class="text-xs font-medium pb-0.5"> Style </div>
23
+ <div class="relative">
24
+ <input
25
+ on:keydown|stopPropagation
26
+ type="text"
27
+ class="!pr-7"
28
+ bind:value={value.style}
29
+ on:focus
30
+ />
31
+ {#if value?.style}
32
+ <button
33
+ transition:fade|local={{ duration: 100 }}
34
+ class="absolute z-10 top-1.5 right-1 rounded-full p-1 duration-200 hover:bg-gray-200"
35
+ aria-label="Remove styles"
36
+ on:click|preventDefault|stopPropagation={() => reset('style')}
37
+ >
38
+ <X size={14} />
39
+ </button>
40
+ {/if}
41
+ </div>
42
+ </label>
98
43
  {/if}
99
44
  {#if value.class !== undefined || forceClass}
100
- <!-- svelte-ignore a11y-label-has-associated-control -->
101
45
  <label class="block">
102
- <div class="text-sm font-medium text-gray-600 pb-0.5"> Tailwind classes </div>
46
+ <div class="text-xs font-medium pb-0.5"> Tailwind classes </div>
103
47
  <div class="relative">
104
- <ClearableInput bind:value={value.class} />
48
+ <input
49
+ on:keydown|stopPropagation
50
+ type="text"
51
+ class="!pr-7"
52
+ bind:value={value.class}
53
+ on:focus
54
+ />
55
+ {#if value?.class}
56
+ <button
57
+ transition:fade|local={{ duration: 100 }}
58
+ class="absolute z-10 top-1.5 right-1 rounded-full p-1 duration-200 hover:bg-gray-200"
59
+ aria-label="Remove classes"
60
+ on:click|preventDefault|stopPropagation={() => reset('class')}
61
+ >
62
+ <X size={14} />
63
+ </button>
64
+ {/if}
105
65
  </div>
106
66
  </label>
107
67
  {/if}
@@ -1,18 +1,15 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { ComponentCssProperty } from '../../types';
3
- import type { AppComponent } from '../component/components';
4
- import type { StylePropertyKey } from './quickStyleProperties';
5
3
  declare const __propDef: {
6
4
  props: {
7
5
  name: string;
8
- componentType?: AppComponent['type'] | undefined;
9
6
  value?: ComponentCssProperty | undefined;
10
7
  forceStyle?: boolean | undefined;
11
8
  forceClass?: boolean | undefined;
12
- quickStyleProperties?: StylePropertyKey[] | undefined;
13
9
  };
14
10
  events: {
15
- change: CustomEvent<any>;
11
+ keydown: KeyboardEvent;
12
+ focus: FocusEvent;
16
13
  } & {
17
14
  [evt: string]: CustomEvent<any>;
18
15
  };
@@ -1,5 +1,5 @@
1
1
  <script>import Button from '../../../common/button/Button.svelte';
2
- import { faChevronRight } from '@fortawesome/free-solid-svg-icons';
2
+ import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
3
3
  import { getContext } from 'svelte';
4
4
  import PanelSection from './common/PanelSection.svelte';
5
5
  import InputsSpecsEditor from './InputsSpecsEditor.svelte';
@@ -7,7 +7,7 @@ import TableActions from './TableActions.svelte';
7
7
  import StaticInputEditor from './inputEditor/StaticInputEditor.svelte';
8
8
  import ConnectedInputEditor from './inputEditor/ConnectedInputEditor.svelte';
9
9
  import Badge from '../../../common/badge/Badge.svelte';
10
- import { capitalize, classNames, getModifierKey, isMac } from '../../../../utils';
10
+ import { capitalize, classNames, getModifierKey } from '../../../../utils';
11
11
  import { buildExtraLib, fieldTypeToTsType } from '../../utils';
12
12
  import Recompute from './Recompute.svelte';
13
13
  import Tooltip from '../../../Tooltip.svelte';
@@ -23,9 +23,6 @@ import GridPane from './GridPane.svelte';
23
23
  import { slide } from 'svelte/transition';
24
24
  import { push } from '../../../../history';
25
25
  import Kbd from '../../../common/kbd/Kbd.svelte';
26
- import { secondaryMenu } from './secondaryMenu';
27
- import StylePanel from './StylePanel.svelte';
28
- import { Delete } from 'lucide-svelte';
29
26
  export let componentSettings = undefined;
30
27
  export let rowColumns = false;
31
28
  export let onDelete = undefined;
@@ -62,10 +59,12 @@ $: extraLib =
62
59
  ? buildExtraLib($worldStore?.outputsById ?? {}, componentSettings?.item?.data?.id, false, $state, false)
63
60
  : undefined;
64
61
  function keydown(event) {
65
- const { key, metaKey } = event;
66
- if (key === 'Delte' || (key === 'Backspace' && metaKey)) {
67
- removeGridElement();
68
- event.stopPropagation();
62
+ switch (event.key) {
63
+ case 'Delete': {
64
+ removeGridElement();
65
+ event.stopPropagation();
66
+ break;
67
+ }
69
68
  }
70
69
  }
71
70
  const initialConfiguration = componentSettings?.item?.data?.type
@@ -202,20 +201,19 @@ $: componentSettings?.item?.data && ($app = $app);
202
201
  <div class="grow shrink" />
203
202
 
204
203
  {#if Object.keys(ccomponents[component.type].customCss ?? {}).length > 0}
205
- <PanelSection title="Styling">
204
+ <PanelSection title="Custom CSS">
206
205
  <div slot="action">
207
206
  <Button
208
207
  color="light"
209
208
  size="xs"
210
- variant="border"
211
- endIcon={{ icon: faChevronRight }}
212
- on:click={() => secondaryMenu.open(StylePanel, { component })}
209
+ endIcon={{ icon: viewCssOptions ? faChevronUp : faChevronDown }}
210
+ on:click={() => (viewCssOptions = !viewCssOptions)}
213
211
  >
214
- Open
212
+ {viewCssOptions ? 'Hide' : 'Show'}
215
213
  </Button>
216
214
  </div>
217
215
  {#if viewCssOptions}
218
- <div transition:slide|local class="w-full">
216
+ <div transition:slide|local>
219
217
  {#each Object.keys(ccomponents[component.type].customCss ?? {}) as name}
220
218
  {#if componentSettings.item.data?.customCss != undefined}
221
219
  <div class="w-full mb-2">
@@ -238,15 +236,7 @@ $: componentSettings?.item?.data && ($app = $app);
238
236
  <div slot="action">
239
237
  <Button size="xs" color="red" variant="border" on:click={removeGridElement}>
240
238
  Delete&nbsp;&nbsp;
241
- {#if isMac()}
242
- <Kbd kbdClass="center-center">
243
- <span class="text-lg leading-none">⌘</span>
244
- <span class="px-0.5">+</span>
245
- <Delete size={16} />
246
- </Kbd>
247
- {:else}
248
- <Kbd>Del</Kbd>
249
- {/if}
239
+ <Kbd>Del</Kbd>
250
240
  </Button>
251
241
  </div>
252
242
  <div class="flex flex-col gap-1">
@@ -1,18 +1,19 @@
1
- <script>import { createEventDispatcher } from 'svelte';
2
- import ColorPicker, { ChromeVariant } from 'svelte-awesome-color-picker';
3
- import { ClearableInput } from '../../../../common';
4
- export let value = '#fff';
5
- const dispatch = createEventDispatcher();
1
+ <script>import ColorPicker, { ChromeVariant } from 'svelte-awesome-color-picker';
2
+ export let componentInput;
6
3
  let isOpen = false;
7
- $: dispatch('change', value);
8
4
  </script>
9
5
 
10
- <div class="color-picker-input grow">
11
- <ClearableInput readonly bind:value on:focus={() => (isOpen = true)} />
6
+ <div class="color-picker-input">
7
+ <input
8
+ type="text"
9
+ readonly
10
+ value={componentInput.value}
11
+ on:focus|preventDefault|stopPropagation={() => (isOpen = true)}
12
+ />
12
13
  <ColorPicker
13
14
  bind:isOpen
14
- bind:hex={value}
15
- label={value}
15
+ bind:hex={componentInput.value}
16
+ label={componentInput.value}
16
17
  canChangeMode={false}
17
18
  components={ChromeVariant}
18
19
  toRight
@@ -21,7 +22,7 @@ $: dispatch('change', value);
21
22
  </div>
22
23
 
23
24
  <style global>
24
- :global(.color-picker-input) :global(span) > :global(label) {
25
+ :global(.color-picker-input) :global(span) > :global(label.svelte-rogbpz) {
25
26
  display: none;
26
27
  }
27
28
 
@@ -29,7 +30,6 @@ $: dispatch('change', value);
29
30
  box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.25) !important;
30
31
  border-style: none !important;
31
32
  border-radius: 0.375rem !important;
32
- z-index: 20;
33
33
  }
34
34
 
35
35
  :global(.color-picker-input) :global(.slider-wrapper) {
@@ -1,11 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type { StaticInput } from '../../../inputType';
2
3
  declare const __propDef: {
3
4
  props: {
4
- value?: string | undefined;
5
+ componentInput: StaticInput<string>;
5
6
  };
6
7
  events: {
7
- change: CustomEvent<any>;
8
- } & {
9
8
  [evt: string]: CustomEvent<any>;
10
9
  };
11
10
  slots: {};
@@ -74,7 +74,7 @@ $: componentInput && onchange?.();
74
74
  Inconsistent labeled resource object
75
75
  {/if}
76
76
  {:else if fieldType === 'color'}
77
- <ColorInput bind:value={componentInput.value} />
77
+ <ColorInput bind:componentInput />
78
78
  {:else if fieldType === 'object'}
79
79
  {#if format?.startsWith('resource-')}
80
80
  <ResourcePicker
@@ -63,7 +63,6 @@ export type InlineScript = {
63
63
  key: string;
64
64
  }[];
65
65
  };
66
- export type AppCssItemName = 'viewer' | 'grid' | AppComponent['type'];
67
66
  export type App = {
68
67
  grid: GridItem[];
69
68
  fullscreen: boolean;
@@ -79,7 +78,7 @@ export type App = {
79
78
  autoRefresh?: boolean;
80
79
  doNotRecomputeOnInputChanged?: boolean;
81
80
  }>;
82
- css?: Partial<Record<AppCssItemName, Record<string, ComponentCssProperty>>>;
81
+ css?: Partial<Record<'viewer' | 'grid' | AppComponent['type'], Record<string, ComponentCssProperty>>>;
83
82
  subgrids?: Record<string, GridItem[]>;
84
83
  };
85
84
  export type ConnectingInput = {
@@ -7,7 +7,6 @@ export let color = 'blue';
7
7
  export let variant = 'contained';
8
8
  export let mainClasses = '';
9
9
  export let toggleClasses = '';
10
- export let listClasses = '';
11
10
  export let disabled = false;
12
11
  export let href = undefined;
13
12
  export let target = '_self';
@@ -60,16 +59,14 @@ $: commonProps = {
60
59
  {#if ref}
61
60
  <Popup
62
61
  {ref}
63
- let:open
64
- let:close
65
62
  options={{
66
63
  placement: $$slots.main ? 'bottom-end' : 'bottom',
67
64
  strategy: 'absolute',
68
65
  modifiers: [{ name: 'offset', options: { offset: [0, 0] } }]
69
66
  }}
70
67
  >
71
- <ul class="bg-white rounded-t border pt-1 pb-2 max-h-40 overflow-auto {listClasses}">
72
- <slot {open} {close} />
68
+ <ul class="bg-white rounded-t border pt-1 pb-2 max-h-40 overflow-auto">
69
+ <slot />
73
70
  </ul>
74
71
  </Popup>
75
72
  {/if}