Revert "remove yPadding in template and simple editor"

This reverts commit 8f27c8d0b8.
This commit is contained in:
Diego Imbert
2025-09-27 14:27:06 +02:00
parent 4af1b41844
commit d78faed851
5 changed files with 13 additions and 2 deletions
@@ -766,6 +766,7 @@
<SimpleEditor
bind:this={monaco}
bind:code={arg.expr}
yPadding={8}
{extraLib}
lang="javascript"
shouldBindKey={false}
@@ -89,6 +89,7 @@
{disabled}
{fixedOverflowWidgets}
renderLineHighlight="none"
yPadding={8}
/>
</div>
{#if error != ''}
@@ -90,7 +90,8 @@
key,
disabled = false,
minHeight = 1000,
renderLineHighlight = 'none'
renderLineHighlight = 'none',
yPadding
}: {
lang: string
code?: string
@@ -119,6 +120,7 @@
disabled?: boolean
minHeight?: number
renderLineHighlight?: 'all' | 'line' | 'gutter' | 'none'
yPadding?: number
} = $props()
const dispatch = createEventDispatcher()
@@ -336,6 +338,7 @@
$relativeLineNumbers
),
model,
...(yPadding !== undefined ? { padding: { bottom: yPadding, top: yPadding } } : {}),
renderLineHighlight,
lineDecorationsWidth: 6,
lineNumbersMinChars: 2,
@@ -452,7 +452,12 @@
fontSize,
suggestOnTriggerCharacters: true,
renderLineHighlight: 'none',
lineNumbers: 'off'
lineNumbers: 'off',
padding: {
bottom: 8,
top: 8
}
})
} catch (e) {
console.error('Error loading monaco:', e)
@@ -447,6 +447,7 @@
{#if showExpr}
<div class="mt-2 bg-surface-secondary rounded-md pl-4">
<SimpleEditor
yPadding={8}
extraLib={`declare const fields: Record<${propsNames
?.filter((x) => x != name)
.map((x) => `"${x}"`)