From 79bdea044111dd7cb132eef67a5d5cb45e7a6f2a Mon Sep 17 00:00:00 2001 From: Carter Date: Thu, 26 Oct 2023 14:34:15 -0700 Subject: [PATCH] MOD-349 Contextual Uploads for MD Editor (#119) * Migrate DropArea to composition * remove hardcoded button styling * let markdown editor call for image upload * allow for local testing in the docs * validate url on set * add chips to modal with correct defaults * update docs to show example url doesn't load * Bump version 0.6.4 --- docs/components/drop-area.md | 10 +- docs/components/markdown-editor.md | 33 ++++++- docs/components/text-inputs.md | 6 +- lib/assets/styles/defaults.scss | 3 +- lib/components/base/DropArea.vue | 117 ++++++++++++----------- lib/components/base/MarkdownEditor.vue | 105 ++++++++++++++++---- lib/components/modal/ShareModal.vue | 2 +- lib/components/search/SearchDropdown.vue | 2 +- package.json | 2 +- 9 files changed, 192 insertions(+), 88 deletions(-) diff --git a/docs/components/drop-area.md b/docs/components/drop-area.md index 1afa1e52a..c3e10ae40 100644 --- a/docs/components/drop-area.md +++ b/docs/components/drop-area.md @@ -1,8 +1,14 @@ # Drop Area + - Click to choose a file or drag one onto this page - + + Click to choose a file or drag one onto this page + ```vue diff --git a/docs/components/markdown-editor.md b/docs/components/markdown-editor.md index 878b432ad..8d3ad813c 100644 --- a/docs/components/markdown-editor.md +++ b/docs/components/markdown-editor.md @@ -1,8 +1,14 @@ # Markdown Editor The Markdown editor allows for easy formatting of Markdown text whether the user is familiar with Markdown or not. It includes standard shortcuts such as `CTRL+B` for bold, `CTRL+I` for italic, and more. @@ -21,9 +27,30 @@ const description = ref(null) ``` +## With image upload + + + + +```vue + + + +``` + ## Without heading buttons - + ```vue diff --git a/docs/components/text-inputs.md b/docs/components/text-inputs.md index 7253fe344..6a5b6e184 100644 --- a/docs/components/text-inputs.md +++ b/docs/components/text-inputs.md @@ -26,7 +26,7 @@ const inputText = ref(null) type="text" placeholder="Text input" /> - @@ -65,7 +65,7 @@ const inputText = ref(null) type="text" placeholder="Text input" /> - @@ -92,7 +92,7 @@ const value = ref(null) type="text" placeholder="Text input" /> - diff --git a/lib/assets/styles/defaults.scss b/lib/assets/styles/defaults.scss index 4c74292e7..f9a2dd20c 100644 --- a/lib/assets/styles/defaults.scss +++ b/lib/assets/styles/defaults.scss @@ -47,6 +47,7 @@ input[type='url'], input[type='number'], input[type='password'], textarea, +.input-text-inherit, .cm-content { border-radius: var(--radius-md); box-sizing: border-box; @@ -146,7 +147,7 @@ input[type='number'] { opacity: 0.6; } - .btn { + .r-btn { @extend .transparent, .icon-only; position: absolute; diff --git a/lib/components/base/DropArea.vue b/lib/components/base/DropArea.vue index 4e459e7ea..9f1e61fea 100644 --- a/lib/components/base/DropArea.vue +++ b/lib/components/base/DropArea.vue @@ -1,65 +1,72 @@ - + diff --git a/lib/components/modal/ShareModal.vue b/lib/components/modal/ShareModal.vue index f4563a362..160f3736a 100644 --- a/lib/components/modal/ShareModal.vue +++ b/lib/components/modal/ShareModal.vue @@ -129,7 +129,7 @@ defineExpose({
-
diff --git a/lib/components/search/SearchDropdown.vue b/lib/components/search/SearchDropdown.vue index cac5357e4..5919abade 100644 --- a/lib/components/search/SearchDropdown.vue +++ b/lib/components/search/SearchDropdown.vue @@ -26,7 +26,7 @@ @focusout="onBlur" @keydown.enter.prevent="$emit('enter')" /> - diff --git a/package.json b/package.json index bdbb3e48d..072589ee9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "omorphia", "type": "module", - "version": "0.6.3", + "version": "0.6.4", "files": [ "dist" ],