@splendidlabz/svelte 4.7.5 → 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,12 @@
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
+
3
10
  ## 4.7.5
4
11
 
5
12
  ### 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
- ...rest
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
- const opts = { ...defaultOptions, ...options, ...rest }
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(opts.includes.join(',')),
68
+ targetElement.querySelectorAll(includes.join(',')),
66
69
  ).filter(el => {
67
70
  if (el.matches('.contentlist-exclude')) return false
68
- if (opts.excludes.some(selector => el.matches(selector))) return false
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.5",
4
+ "version": "4.7.6",
5
5
  "sideEffects": false,
6
6
  "homepage": "https://splendidlabz.com/docs/svelte",
7
7
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@floating-ui/dom": "^1.6.13",
23
23
  "@iconify/svelte": "^4.2.0",
24
- "@splendidlabz/styles": "4.6.4",
24
+ "@splendidlabz/styles": "4.6.5",
25
25
  "@splendidlabz/utils": "1.11.2",
26
26
  "autosuggest-highlight": "^3.3.4",
27
27
  "lodash-es": "^4.17.21",