+ 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 @@
+
+
+
+
+
diff --git a/packages/bbui/src/Notification/Notification.svelte b/packages/bbui/src/Notification/Notification.svelte
index cebc859bda..1d21131553 100644
--- a/packages/bbui/src/Notification/Notification.svelte
+++ b/packages/bbui/src/Notification/Notification.svelte
@@ -1,7 +1,12 @@
+
+
diff --git a/packages/bbui/src/Notification/NotificationDisplay.svelte b/packages/bbui/src/Notification/NotificationDisplay.svelte
index 9d96bf7e70..eb778f3aa0 100644
--- a/packages/bbui/src/Notification/NotificationDisplay.svelte
+++ b/packages/bbui/src/Notification/NotificationDisplay.svelte
@@ -1,7 +1,6 @@
{#if typeClass !== "none"}
+ import { MarkdownViewer } from "@budibase/bbui"
+ import { getContext } from "svelte"
+ import Placeholder from "./Placeholder.svelte"
+
+ export let value
+
+ const component = getContext("component")
+ const { builderStore, styleable } = getContext("sdk")
+ const height = $component.styles?.normal?.height
+
+
+
+ {#if value}
+
+ {:else if $builderStore.inBuilder}
+
+ {/if}
+
diff --git a/packages/client/src/components/app/forms/LongFormField.svelte b/packages/client/src/components/app/forms/LongFormField.svelte
index 888992f6b3..15a10827b2 100644
--- a/packages/client/src/components/app/forms/LongFormField.svelte
+++ b/packages/client/src/components/app/forms/LongFormField.svelte
@@ -1,7 +1,8 @@
{#if fieldState}
-
+ {#if useRichText}
+ fieldApi.setValue(e.detail)}
+ disabled={fieldState.disabled}
+ error={fieldState.error}
+ id={fieldState.fieldId}
+ {placeholder}
+ {height}
+ fullScreenOffset={{
+ x: $layout.screenXOffset,
+ y: $layout.screenYOffset,
+ }}
+ easyMDEOptions={{
+ hideIcons: $context.device.mobile ? ["side-by-side", "guide"] : [],
+ }}
+ />
+ {:else}
fieldApi.setValue(e.detail)}
disabled={fieldState.disabled}
error={fieldState.error}
id={fieldState.fieldId}
- {align}
{placeholder}
+ minHeight={height}
/>
-
+ {/if}
{/if}
-
-
diff --git a/packages/client/src/components/app/index.js b/packages/client/src/components/app/index.js
index ef0f96ce59..5af62201e5 100644
--- a/packages/client/src/components/app/index.js
+++ b/packages/client/src/components/app/index.js
@@ -30,6 +30,7 @@ export { default as daterangepicker } from "./DateRangePicker.svelte"
export { default as cardstat } from "./CardStat.svelte"
export { default as spectrumcard } from "./SpectrumCard.svelte"
export { default as tag } from "./Tag.svelte"
+export { default as markdownviewer } from "./MarkdownViewer.svelte"
export * from "./charts"
export * from "./forms"
export * from "./table"
diff --git a/packages/client/src/components/overlay/NotificationDisplay.svelte b/packages/client/src/components/overlay/NotificationDisplay.svelte
index 6e8be21647..667f706ff2 100644
--- a/packages/client/src/components/overlay/NotificationDisplay.svelte
+++ b/packages/client/src/components/overlay/NotificationDisplay.svelte
@@ -19,6 +19,8 @@
type={$notificationStore.type}
message={$notificationStore.message}
icon={$notificationStore.icon}
+ dismissable={$notificationStore.dismissable}
+ on:dismiss={notificationStore.actions.dismiss}
/>
{/key}
diff --git a/packages/client/src/components/overlay/PeekScreenDisplay.svelte b/packages/client/src/components/overlay/PeekScreenDisplay.svelte
index 7d3531d236..72ea58c194 100644
--- a/packages/client/src/components/overlay/PeekScreenDisplay.svelte
+++ b/packages/client/src/components/overlay/PeekScreenDisplay.svelte
@@ -25,8 +25,8 @@
}
const proxyNotification = event => {
- const { message, type, icon } = event.detail
- notificationStore.actions.send(message, type, icon)
+ const { message, type, icon, autoDismiss } = event.detail
+ notificationStore.actions.send(message, type, icon, autoDismiss)
}
const proxyStateUpdate = event => {
diff --git a/packages/client/src/stores/notification.js b/packages/client/src/stores/notification.js
index 64178328c0..e12eccf210 100644
--- a/packages/client/src/stores/notification.js
+++ b/packages/client/src/stores/notification.js
@@ -19,7 +19,7 @@ const createNotificationStore = () => {
setTimeout(() => (block = false), timeout)
}
- const send = (message, type = "info", icon) => {
+ const send = (message, type = "info", icon, autoDismiss = true) => {
if (block) {
return
}
@@ -32,6 +32,7 @@ const createNotificationStore = () => {
message,
type,
icon,
+ autoDismiss,
},
})
return
@@ -42,12 +43,20 @@ const createNotificationStore = () => {
type,
message,
icon,
+ dismissable: !autoDismiss,
delay: get(store) != null,
})
clearTimeout(timeout)
- timeout = setTimeout(() => {
- store.set(null)
- }, NOTIFICATION_TIMEOUT)
+ if (autoDismiss) {
+ timeout = setTimeout(() => {
+ store.set(null)
+ }, NOTIFICATION_TIMEOUT)
+ }
+ }
+
+ const dismiss = () => {
+ clearTimeout(timeout)
+ store.set(null)
}
return {
@@ -57,8 +66,9 @@ const createNotificationStore = () => {
info: msg => send(msg, "info", "Info"),
success: msg => send(msg, "success", "CheckmarkCircle"),
warning: msg => send(msg, "warning", "Alert"),
- error: msg => send(msg, "error", "Alert"),
+ error: msg => send(msg, "error", "Alert", false),
blockNotifications,
+ dismiss,
},
}
}
diff --git a/packages/server/package.json b/packages/server/package.json
index 9d58d99838..875d328973 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
- "version": "1.0.49-alpha.14",
+ "version": "1.0.50-alpha.1",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@@ -70,9 +70,9 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "^10.0.3",
- "@budibase/backend-core": "^1.0.49-alpha.14",
- "@budibase/client": "^1.0.49-alpha.14",
- "@budibase/string-templates": "^1.0.49-alpha.14",
+ "@budibase/backend-core": "^1.0.50-alpha.1",
+ "@budibase/client": "^1.0.50-alpha.1",
+ "@budibase/string-templates": "^1.0.50-alpha.1",
"@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0",
diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json
index 9492de19c2..370c23f498 100644
--- a/packages/string-templates/package.json
+++ b/packages/string-templates/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
- "version": "1.0.49-alpha.14",
+ "version": "1.0.50-alpha.1",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",
@@ -13,6 +13,9 @@
},
"./package.json": "./package.json"
},
+ "files": [
+ "dist"
+ ],
"scripts": {
"build": "tsc && rollup -c",
"dev:builder": "tsc && rollup -cw",
diff --git a/packages/worker/package.json b/packages/worker/package.json
index 76ebaff106..03eca5e89f 100644
--- a/packages/worker/package.json
+++ b/packages/worker/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
- "version": "1.0.49-alpha.14",
+ "version": "1.0.50-alpha.1",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@@ -34,8 +34,8 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
- "@budibase/backend-core": "^1.0.49-alpha.14",
- "@budibase/string-templates": "^1.0.49-alpha.14",
+ "@budibase/backend-core": "^1.0.50-alpha.1",
+ "@budibase/string-templates": "^1.0.50-alpha.1",
"@koa/router": "^8.0.0",
"@sentry/node": "^6.0.0",
"@techpass/passport-openidconnect": "^0.3.0",