@budibase/bbui 3.20.15 → 3.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/bbui",
3
3
  "description": "A UI solution used in the different Budibase projects.",
4
- "version": "3.20.15",
4
+ "version": "3.21.0",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.ts",
7
7
  "module": "dist/bbui.mjs",
@@ -106,5 +106,5 @@
106
106
  }
107
107
  }
108
108
  },
109
- "gitHead": "29787f399c811acf15104c21c88e2355fb726eb3"
109
+ "gitHead": "89497e01938534167c4ffbe74cdd4090e3e7c3a5"
110
110
  }
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import EasyMDE from "easymde"
2
+ import type EasyMDE from "easymde"
3
3
  import "easymde/dist/easymde.min.css"
4
- import { onMount } from "svelte"
4
+ import { onDestroy, onMount } from "svelte"
5
5
 
6
6
  export let height: string | null = null
7
7
  export let scroll: boolean = true
@@ -13,8 +13,9 @@
13
13
 
14
14
  let element: HTMLTextAreaElement | undefined = undefined
15
15
 
16
- onMount(() => {
16
+ onMount(async () => {
17
17
  height = height || "200px"
18
+ const { default: EasyMDE } = await import("easymde")
18
19
  mde = new EasyMDE({
19
20
  element,
20
21
  spellChecker: false,
@@ -24,11 +25,10 @@
24
25
  minHeight: scroll ? undefined : height,
25
26
  ...easyMDEOptions,
26
27
  })
28
+ })
27
29
 
28
- // Revert the editor when we unmount
29
- return () => {
30
- mde?.toTextArea()
31
- }
30
+ onDestroy(() => {
31
+ mde?.toTextArea()
32
32
  })
33
33
 
34
34
  $: styleString = getStyleString(fullScreenOffset)