Skip to content

Commit

Permalink
fix markdown block, bump v
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Apr 17, 2024
1 parent 2ee3c5a commit 9f61ccd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "myrelay.site",
"type": "module",
"version": "0.1.1",
"version": "0.2.0",
"main": "index.js",
"repository": "[email protected]:sandwichfarm/myrelay.site.git",
"author": "dskvr <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const optionsConfig = {
type: "text",
default: defaultOptions.blockHeading
},
imageUrl: {
markdown: {
label: "Markdown",
type: "text",
type: "textarea",
default: defaultOptions.markdown
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
</script>

<Block key={key} id={id}>
<svelte:fragment slot="title">
{$MRP.loader.config.event.blocks[key]?.options?.blockHeading || ""}
</svelte:fragment>
<svelte:fragment slot="content">
{$MRP.loader.config.event.blocks[key]?.options?.html || ""}
<SvelteMarkdown source={$MRP.loader.config.event.blocks[key]?.options?.markdown || ""} />
</svelte:fragment>
</Block>
12 changes: 8 additions & 4 deletions src/lib/components/partials/editor.block-options.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ loaded: {$loaded}
{#each Object.keys($optionsConfig) as optionKey}
{#if inputType(optionKey) === 'text'}
<Label for={inputName(optionKey)} >{inputLabel(optionKey)}</Label>
<Input type="text" name={inputName(optionKey)} value={inputValue(optionKey)} on:change={event => change(optionKey, event?.target?.value)} />
<Input type="text" name={inputName(optionKey)} value={inputValue(optionKey)} on:keyup={event => change(optionKey, event?.target?.value)} />
{/if}
{#if inputType(optionKey) === 'textarea'}
<Label for={inputName(optionKey)} >{inputLabel(optionKey)}</Label>
<Textarea name={inputName(optionKey)} value={inputValue(optionKey)} on:change={event => change(optionKey, event?.target?.value)}></Textarea>
<Textarea name={inputName(optionKey)} value={inputValue(optionKey)} on:change={keyup => change(optionKey, event?.target?.value)}></Textarea>
{/if}
{#if inputType(optionKey) === 'checkbox'}
<Label for={inputName(optionKey)} >{inputLabel(optionKey)}</Label>
Expand All @@ -75,15 +75,19 @@ loaded: {$loaded}
{/if}
{#if inputType(optionKey) === 'email'}
<Label for={inputName(optionKey)} >{inputLabel(optionKey)}</Label>
<Input type="email" name={inputName(optionKey)} value={inputValue(optionKey)} on:change={event => change(optionKey, event?.target?.value)} />
<Input type="email" name={inputName(optionKey)} value={inputValue(optionKey)} on:keyup={event => change(optionKey, event?.target?.value)} />
{/if}
{#if inputType(optionKey) === 'url'}
<Label for={inputName(optionKey)} >{inputLabel(optionKey)}</Label>
<Input type="url" name={inputName(optionKey)} value={inputValue(optionKey)} on:change={event => change(optionKey, event?.target?.value)} />
<Input type="url" name={inputName(optionKey)} value={inputValue(optionKey)} on:keyup={event => change(optionKey, event?.target?.value)} />
{/if}
{#if inputType(optionKey) === 'number'}
<Label for={inputName(optionKey)} >{inputLabel(optionKey)}</Label>
<Input type="number" name={inputName(optionKey)} value={inputValue(optionKey)} on:change={event => change(optionKey, event?.target?.value)} />
{/if}
<!-- {#if inputType(optionKey) === 'dropdown'}
<Label for={inputName(optionKey)} >{inputLabel(optionKey)}</Label>
<Input type="number" name={inputName(optionKey)} value={inputValue(optionKey)} on:change={event => change(optionKey, event?.target?.value)} />
{/if} -->
{/each}
{/if}

0 comments on commit 9f61ccd

Please sign in to comment.