@splendidlabz/svelte 4.7.5 → 4.8.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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { reloadScripts } from '../../utils/loadscripts.js'
|
|
5
5
|
import { IconSnippet } from '../Icon/IconSnippet.svelte'
|
|
6
6
|
import { MarkdownSnippet } from '../Markdown/MarkdownSnippet.svelte'
|
|
7
|
+
|
|
7
8
|
const p = $props()
|
|
8
9
|
const DEFAULT_OPTIONS = {
|
|
9
10
|
titleTag: 'h3',
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
iconPosition: 'end',
|
|
12
13
|
transition: 'slide',
|
|
13
14
|
}
|
|
15
|
+
|
|
14
16
|
const opts = mergeOpts(DEFAULT_OPTIONS, p)
|
|
15
17
|
|
|
16
18
|
// Classes
|
|
@@ -42,15 +42,18 @@
|
|
|
42
42
|
liClass,
|
|
43
43
|
aClass,
|
|
44
44
|
options,
|
|
45
|
-
...
|
|
45
|
+
...p
|
|
46
46
|
} = $props()
|
|
47
47
|
|
|
48
|
+
let { includes = [], excludes = [], ...rest } = p
|
|
49
|
+
|
|
48
50
|
const defaultOptions = {
|
|
49
51
|
includes: ['h2', 'h3', 'h4', 'h5', 'h6'],
|
|
50
52
|
excludes: ['.exclude-from-contentlist'],
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
includes = includes.concat(defaultOptions.includes)
|
|
56
|
+
excludes = excludes.concat(defaultOptions.excludes)
|
|
54
57
|
|
|
55
58
|
let ref = $state(null)
|
|
56
59
|
let elements = $state([])
|
|
@@ -62,10 +65,10 @@
|
|
|
62
65
|
const targetElement = selector ? document.querySelector(selector) : document
|
|
63
66
|
|
|
64
67
|
elements = Array.from(
|
|
65
|
-
targetElement.querySelectorAll(
|
|
68
|
+
targetElement.querySelectorAll(includes.join(',')),
|
|
66
69
|
).filter(el => {
|
|
67
70
|
if (el.matches('.contentlist-exclude')) return false
|
|
68
|
-
if (
|
|
71
|
+
if (excludes.some(selector => el.matches(selector))) return false
|
|
69
72
|
return true
|
|
70
73
|
})
|
|
71
74
|
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { toStyleString } from '@splendidlabz/utils'
|
|
3
|
-
const {
|
|
3
|
+
const {
|
|
4
|
+
class: klass = '',
|
|
5
|
+
id,
|
|
6
|
+
link,
|
|
7
|
+
title,
|
|
8
|
+
short = false,
|
|
9
|
+
timestamp = 0,
|
|
10
|
+
} = $props()
|
|
4
11
|
|
|
5
12
|
if (!id && !link)
|
|
6
13
|
throw new Error('id or link is required for Youtube component')
|
|
7
14
|
|
|
8
15
|
const _id = id || link.split('/').pop()
|
|
9
|
-
const src = `https://www.youtube.com/embed/${_id}?vq=highres`
|
|
16
|
+
const src = `https://www.youtube.com/embed/${_id}?vq=highres&t=${timestamp}`
|
|
10
17
|
|
|
11
18
|
const style = toStyleString({
|
|
12
19
|
width: '100%',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splendidlabz/svelte",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.8.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"homepage": "https://splendidlabz.com/docs/svelte",
|
|
7
7
|
"scripts": {
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@floating-ui/dom": "^1.6.13",
|
|
23
23
|
"@iconify/svelte": "^4.2.0",
|
|
24
|
-
"@splendidlabz/styles": "
|
|
25
|
-
"@splendidlabz/utils": "
|
|
24
|
+
"@splendidlabz/styles": "*",
|
|
25
|
+
"@splendidlabz/utils": "*",
|
|
26
26
|
"autosuggest-highlight": "^3.3.4",
|
|
27
27
|
"lodash-es": "^4.17.21",
|
|
28
28
|
"node-html-parser": "^7.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@splendidlabz/eslint-config": "2.1.
|
|
31
|
+
"@splendidlabz/eslint-config": "2.1.3",
|
|
32
32
|
"@tsconfig/svelte": "^5.0.4",
|
|
33
33
|
"svelte": "^5.25.6",
|
|
34
34
|
"svelte-check": "^4.2.1",
|