@splendidlabz/svelte 3.0.0-alpha.2 → 3.0.0-alpha.3
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/CHANGELOG.md +9 -0
- package/components/Markdown/Markdown.svelte +7 -21
- package/package.json +3 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @splendidlabz/svelte
|
|
2
2
|
|
|
3
|
+
## 3.0.0-alpha.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- df4f2d6: Simplified Markdown — so utils now contain a markdown function
|
|
8
|
+
- Updated dependencies [df4f2d6]
|
|
9
|
+
- @splendidlabz/utils@1.5.0-alpha.1
|
|
10
|
+
- @splendidlabz/styles@3.0.0-alpha.3
|
|
11
|
+
|
|
3
12
|
## 3.0.0-alpha.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -6,30 +6,16 @@
|
|
|
6
6
|
-->
|
|
7
7
|
|
|
8
8
|
<script>
|
|
9
|
-
import {
|
|
10
|
-
import { mangle } from 'marked-mangle'
|
|
11
|
-
import { gfmHeadingId } from 'marked-gfm-heading-id'
|
|
12
|
-
import { treatMarkdownWhitespace } from '@splendidlabz/utils'
|
|
9
|
+
import { markdown } from '@splendidlabz/utils'
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const { content, inline = false } = $props()
|
|
12
|
+
let html = $state('')
|
|
16
13
|
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// Process content
|
|
22
|
-
const { content: treatedContent } = treatMarkdownWhitespace(content, {
|
|
23
|
-
inline,
|
|
24
|
-
isSlot: false,
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
// Parse Markdown -> HTML
|
|
28
|
-
let html = ''
|
|
29
|
-
$: {
|
|
30
|
-
html = marked.parse(treatedContent)
|
|
14
|
+
// My hunch is effects isn't needed here.
|
|
15
|
+
$effect(_ => {
|
|
16
|
+
html = markdown(content, { inline })
|
|
31
17
|
if (inline) html = html.replace('<p>', '').replace('</p>', '')
|
|
32
|
-
}
|
|
18
|
+
})
|
|
33
19
|
</script>
|
|
34
20
|
|
|
35
21
|
{@html html}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splendidlabz/svelte",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-alpha.
|
|
4
|
+
"version": "3.0.0-alpha.3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"lint": "eslint . --fix",
|
|
@@ -13,21 +13,16 @@
|
|
|
13
13
|
"svelte": "./index.js"
|
|
14
14
|
},
|
|
15
15
|
"./actions": "./actions/index.js",
|
|
16
|
-
"./styles": "./styles.scss",
|
|
17
|
-
"./styles/*": "../components/**/*.scss",
|
|
18
16
|
"./common": "./common.js"
|
|
19
17
|
},
|
|
20
18
|
"dependencies": {
|
|
21
19
|
"@floating-ui/dom": "^1.6.13",
|
|
22
20
|
"@iconify/svelte": "^4.2.0",
|
|
23
21
|
"@splendidlabz/layouts": "*",
|
|
24
|
-
"@splendidlabz/styles": "3.0.0-alpha.
|
|
25
|
-
"@splendidlabz/utils": "1.5.0-alpha.
|
|
22
|
+
"@splendidlabz/styles": "3.0.0-alpha.3",
|
|
23
|
+
"@splendidlabz/utils": "1.5.0-alpha.1",
|
|
26
24
|
"autosuggest-highlight": "^3.3.4",
|
|
27
25
|
"lodash-es": "^4.17.21",
|
|
28
|
-
"marked": "^15.0.7",
|
|
29
|
-
"marked-gfm-heading-id": "^4.1.1",
|
|
30
|
-
"marked-mangle": "^1.1.10",
|
|
31
26
|
"node-html-parser": "^7.0.1"
|
|
32
27
|
},
|
|
33
28
|
"devDependencies": {
|