@splendidlabz/svelte 4.7.4 → 4.7.6
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
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @splendidlabz/svelte
|
|
2
2
|
|
|
3
|
+
## 4.7.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @splendidlabz/styles@4.6.5
|
|
9
|
+
|
|
10
|
+
## 4.7.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- - Add excludes to `ContentList` component
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @splendidlabz/utils@1.11.2
|
|
18
|
+
- @splendidlabz/styles@4.6.4
|
|
19
|
+
|
|
3
20
|
## 4.7.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -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
|
-
excludes: [],
|
|
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
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splendidlabz/svelte",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.7.
|
|
4
|
+
"version": "4.7.6",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"homepage": "https://splendidlabz.com/docs/svelte",
|
|
7
7
|
"scripts": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@floating-ui/dom": "^1.6.13",
|
|
23
23
|
"@iconify/svelte": "^4.2.0",
|
|
24
|
-
"@splendidlabz/styles": "4.6.
|
|
25
|
-
"@splendidlabz/utils": "1.11.
|
|
24
|
+
"@splendidlabz/styles": "4.6.5",
|
|
25
|
+
"@splendidlabz/utils": "1.11.2",
|
|
26
26
|
"autosuggest-highlight": "^3.3.4",
|
|
27
27
|
"lodash-es": "^4.17.21",
|
|
28
28
|
"node-html-parser": "^7.0.1"
|