diff --git a/front/js/svelte/common/Icon.svelte b/front/js/svelte/common/Icon.svelte index 66000bc..6276451 100644 --- a/front/js/svelte/common/Icon.svelte +++ b/front/js/svelte/common/Icon.svelte @@ -56,23 +56,23 @@ path: '', viewBox: "0 0 576 512", }, - "filter": { + filter: { path: '', viewBox: "0 0 512 512", }, - "calendar": { + calendar: { path: '', viewBox: "0 0 448 512", }, - "pencil": { + pencil: { path: '', viewBox: "0 0 512 512", }, - "database": { + database: { path: '', viewBox: "0 0 448 512", }, - "dice": { + dice: { path: '', viewBox: "0 0 640 512", }, @@ -81,7 +81,7 @@ path: '', viewBox: "0 0 512 512", }, - "eye": { + eye: { path: '', viewBox: "0 0 576 512", }, @@ -93,19 +93,19 @@ path: '', viewBox: "0 0 512 512", }, - "expand": { + expand: { path: '', viewBox: "0 0 448 512", }, - "compress": { + compress: { path: '', viewBox: "0 0 448 512", }, - "check": { + check: { path: '', viewBox: "0 0 448 512", }, - "close": { + close: { path: '', viewBox: "0 0 24 24", }, @@ -113,7 +113,7 @@ path: '', viewBox: "0 0 24 24", }, - "list": { + list: { path: '', viewBox: "0 0 24 24", }, @@ -121,13 +121,16 @@ path: '', viewBox: "0 0 24 24", }, - "italic": { + italic: { path: '', viewBox: "0 0 24 24", - } + }, + upload: { + path: ' ', + viewBox: "0 0 16 16", + }, }; - export let width = 16; export let height = 16; export let icon = ""; @@ -138,16 +141,15 @@ {@html selectedIcon.path} @@ -155,6 +157,5 @@ diff --git a/front/js/svelte/dialog/FileDialog.svelte b/front/js/svelte/dialog/FileDialog.svelte index ded5645..b0a1693 100644 --- a/front/js/svelte/dialog/FileDialog.svelte +++ b/front/js/svelte/dialog/FileDialog.svelte @@ -2,13 +2,15 @@ import { createEventDispatcher, getContext } from "svelte"; import Icon from "../common/Icon.svelte"; import FileIndex from "./FileIndex.svelte"; + import Dropdown from "../common/Dropdown.svelte"; let dialogEl; + export let presetMode = false; const dispatch = createEventDispatcher(); const channel = getContext("channel"); $: files = []; - $: selectedRecords = []; + $: selectedFiles = []; // onMount(() => { // load(); // }); @@ -19,7 +21,7 @@ } dialogEl.close(); - selectedRecords = []; + selectedFiles = []; } function load(recordId) { @@ -31,14 +33,14 @@ .catch((error) => console.log(error)); } - function insert(e) { + function insert(e, preset) { e.preventDefault(); - dispatch("insert_files", selectedRecords); + dispatch("insert_files", { files: selectedFiles, preset: preset }); } function replace(e) { e.preventDefault(); - dispatch("replace_files", selectedRecords); + dispatch("replace_files", selectedFiles); } export function open(recordId) { @@ -49,25 +51,38 @@
- - - {#if selectedRecords.length > 0} + {#if presetMode} + +
Insert Preset
+ {#each channel.imagePresets as preset} + + {/each} +
+ {:else} + + + {/if} + {#if selectedFiles.length > 0} - {selectedRecords.length} records selected + {selectedFiles.length} records selected {/if} @@ -82,6 +97,6 @@
- +
diff --git a/front/js/svelte/files/Uploader.svelte b/front/js/svelte/files/Uploader.svelte index ff76256..001847e 100644 --- a/front/js/svelte/files/Uploader.svelte +++ b/front/js/svelte/files/Uploader.svelte @@ -1,5 +1,6 @@ -
- +
+ -
- -
+
{#if value.length > 0} diff --git a/front/js/svelte/records/elements/Markdown.svelte b/front/js/svelte/records/elements/Markdown.svelte index c2c75ee..67a751b 100644 --- a/front/js/svelte/records/elements/Markdown.svelte +++ b/front/js/svelte/records/elements/Markdown.svelte @@ -1,11 +1,13 @@
+ - + {#if errorMessage}
{errorMessage} diff --git a/front/js/svelte/records/elements/RichEditorFiles.svelte b/front/js/svelte/records/elements/RichEditorFiles.svelte index 31dd687..39de492 100644 --- a/front/js/svelte/records/elements/RichEditorFiles.svelte +++ b/front/js/svelte/records/elements/RichEditorFiles.svelte @@ -1,15 +1,13 @@ -
- - +
+ -
- -
+
diff --git a/front/js/svelte/records/previews/PreviewFile.svelte b/front/js/svelte/records/previews/PreviewFile.svelte index c7749b2..10ce00d 100644 --- a/front/js/svelte/records/previews/PreviewFile.svelte +++ b/front/js/svelte/records/previews/PreviewFile.svelte @@ -1,37 +1,18 @@
@@ -48,25 +29,6 @@
- {#if hasInsert} -
- -
- -
- - {#each imagePresets as preset} - - {/each} -
-
- {/if} {#if hasDelete}