Skip to content

Commit 0f3d36f

Browse files
committed
fix #236
1 parent 4787f2a commit 0f3d36f

File tree

7 files changed

+121
-186
lines changed

7 files changed

+121
-186
lines changed

exampleVault/Input Fields/Select and Multi Select.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ showcase
4747

4848
### Multi Select
4949

50-
```meta-bind
51-
INPUT[multi_select(
52-
option(option 1),
53-
option(option 2),
54-
option(option 3),
55-
showcase
56-
):multiSelect]
57-
```
58-
5950
```meta-bind
6051
INPUT[multiSelect(
6152
option(option 1),

exampleVault/Input Fields/Text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ INPUT[text(showcase, limit(10)):text]
1616
### Text Area
1717

1818
```meta-bind
19-
INPUT[text_area(showcase, class(meta-bind-full-width), class(meta-bind-high)):textArea]
19+
INPUT[textArea(showcase, class(meta-bind-full-width), class(meta-bind-high)):textArea]
2020
```

packages/core/src/fields/inputFields/fields/InlineList/InlineListComponent.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import LiteralRenderComponent from '../../../../utils/components/LiteralRenderComponent.svelte';
55
import { IPlugin } from '../../../../IPlugin';
66
import { ContextMenuItemDefinition } from 'packages/core/src/utils/IContextMenu';
7+
import { ButtonStyleType } from 'packages/core/src/config/ButtonConfig';
8+
import Button from 'packages/core/src/utils/components/Button.svelte';
79
810
export let plugin: IPlugin;
911
export let value: MBLiteral[];
@@ -96,9 +98,9 @@
9698
{#each value as entry, i}
9799
<div class="mb-inline-list-item">
98100
<LiteralRenderComponent value={entry}></LiteralRenderComponent>
99-
<button class="mb-inline-list-item-button" on:click={e => openContextMenuForElement(e, i)}>
101+
<Button variant={ButtonStyleType.PLAIN} on:click={e => openContextMenuForElement(e, i)}>
100102
<Icon plugin={plugin} iconName="more-vertical" />
101-
</button>
103+
</Button>
102104
</div>
103105
{/each}
104106
<div class="mb-inline-list-add" on:click={() => showInput()} on:keydown={inputKey} role="button" tabindex="0">

packages/core/src/fields/inputFields/fields/InlineListSuggester/InlineListSuggesterComponent.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import LiteralRenderComponent from '../../../../utils/components/LiteralRenderComponent.svelte';
55
import { IPlugin } from '../../../../IPlugin';
66
import { ContextMenuItemDefinition } from 'packages/core/src/utils/IContextMenu';
7+
import Button from '../../../../utils/components/Button.svelte';
8+
import { ButtonStyleType } from '../../../../config/ButtonConfig';
79
810
export let plugin: IPlugin;
911
export let value: MBLiteral[];
@@ -100,9 +102,9 @@
100102
{#each value as entry, i}
101103
<div class="mb-inline-list-item">
102104
<LiteralRenderComponent value={entry}></LiteralRenderComponent>
103-
<button class="mb-inline-list-item-button" on:click={e => openContextMenuForElement(e, i)}>
105+
<Button variant={ButtonStyleType.PLAIN} on:click={e => openContextMenuForElement(e, i)}>
104106
<Icon plugin={plugin} iconName="more-vertical" />
105-
</button>
107+
</Button>
106108
</div>
107109
{/each}
108110
<div class="mb-inline-list-add" on:click={suggest} on:keydown={suggestKey} role="button" tabindex="0">

packages/core/src/utils/IJsRenderer.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1+
/**
2+
* A JS renderer that should be initialized with a container, a file path and a code string.
3+
* Every time that evaluate is called, the code string is executed and the result is returned, as well as rendered into the container.
4+
*/
15
export interface IJsRenderer {
6+
/**
7+
* The container element that the result of the evaluation should be rendered to.
8+
*/
9+
containerEl: HTMLElement;
10+
/**
11+
* The code string that should be evaluated.
12+
*/
13+
code: string;
14+
15+
/**
16+
* Evaluate the code string with the given context.
17+
* Should return the result of the evaluation as well as render the result to the container.
18+
*
19+
* @param context
20+
*/
221
evaluate(context: Record<string, unknown>): Promise<unknown>;
322

423
unload(): void;

styles.css

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,9 @@ div.mb-view-wrapper {
236236
margin-right: var(--size-4-2);
237237
}
238238

239-
& > .mb-inline-list-item-button {
240-
border: none;
241-
background: none;
242-
padding: initial;
239+
& > button {
240+
padding: 0;
243241
height: unset;
244-
box-shadow: none;
245-
246-
&:hover {
247-
color: var(--text-error);
248-
}
249242
}
250243
}
251244

0 commit comments

Comments
 (0)