diff --git a/packages/bbui/package.json b/packages/bbui/package.json index c9e8c8873c..0fdd23f349 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -79,6 +79,7 @@ "@spectrum-css/underlay": "^2.0.9", "@spectrum-css/vars": "^3.0.1", "dayjs": "^1.10.4", + "easymde": "^2.16.1", "svelte-flatpickr": "^3.2.3", "svelte-portal": "^1.0.0" }, diff --git a/packages/bbui/src/Form/Core/RichTextField.svelte b/packages/bbui/src/Form/Core/RichTextField.svelte new file mode 100644 index 0000000000..f964405f0d --- /dev/null +++ b/packages/bbui/src/Form/Core/RichTextField.svelte @@ -0,0 +1,42 @@ + + +
+ +
+ + diff --git a/packages/bbui/src/Form/Core/TextArea.svelte b/packages/bbui/src/Form/Core/TextArea.svelte index b615e97bff..465212cd44 100644 --- a/packages/bbui/src/Form/Core/TextArea.svelte +++ b/packages/bbui/src/Form/Core/TextArea.svelte @@ -22,11 +22,23 @@ dispatch("change", event.target.value) focus = false } + + const getStyleString = (attribute, value) => { + if (!attribute || value == null) { + return "" + } + if (isNaN(value)) { + return `${attribute}:${value};` + } + return `${attribute}:${value}px;` + } + + $: heightString = getStyleString("height", height) + $: minHeightString = getStyleString("min-height", minHeight)
+ import Field from "./Field.svelte" + import RichTextField from "./Core/RichTextField.svelte" + import { createEventDispatcher } from "svelte" + + export let value = null + export let label = null + export let labelPosition = "above" + export let placeholder = null + export let disabled = false + export let error = null + export let height = null + export let id = null + export let fullScreenOffset = null + export let easyMDEOptions = null + + const dispatch = createEventDispatcher() + const onChange = e => { + value = e.detail + dispatch("change", e.detail) + } + + + + + diff --git a/packages/bbui/src/Markdown/MarkdownEditor.svelte b/packages/bbui/src/Markdown/MarkdownEditor.svelte new file mode 100644 index 0000000000..7fb6414ad8 --- /dev/null +++ b/packages/bbui/src/Markdown/MarkdownEditor.svelte @@ -0,0 +1,60 @@ + + +{#key height} + +{/key} diff --git a/packages/bbui/src/Markdown/MarkdownViewer.svelte b/packages/bbui/src/Markdown/MarkdownViewer.svelte new file mode 100644 index 0000000000..5705020f45 --- /dev/null +++ b/packages/bbui/src/Markdown/MarkdownViewer.svelte @@ -0,0 +1,70 @@ + + +
+ +
+ + diff --git a/packages/bbui/src/Markdown/SpectrumMDE.svelte b/packages/bbui/src/Markdown/SpectrumMDE.svelte new file mode 100644 index 0000000000..9b0832c91f --- /dev/null +++ b/packages/bbui/src/Markdown/SpectrumMDE.svelte @@ -0,0 +1,184 @@ + + +
+