svelte-multiselect 11.2.0 → 11.2.1

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.
@@ -2,8 +2,9 @@
2
2
  import { fade } from 'svelte/transition';
3
3
  let { actions, triggers = [`k`], close_keys = [`Escape`], fade_duration = 200, dialog_style = ``, open = $bindable(false), dialog = $bindable(null), input = $bindable(null), placeholder = `Filter actions...`, ...rest } = $props();
4
4
  $effect(() => {
5
- if (open && input)
6
- input?.focus(); // focus input when palette is opened
5
+ if (open && input && document.activeElement !== input) {
6
+ input.focus();
7
+ }
7
8
  });
8
9
  async function toggle(event) {
9
10
  if (triggers.includes(event.key) && event.metaKey && !open) {
@@ -1,6 +1,4 @@
1
- <script lang="ts">import hljs from 'highlight.js';
2
- import 'highlight.js/styles/vs2015.css';
3
- let { files = $bindable([]), toggle_all_btn_title = `Toggle all`, default_lang = `typescript`, as = `ol`, style = null, title_snippet, } = $props();
1
+ <script lang="ts">let { files = $bindable([]), toggle_all_btn_title = `Toggle all`, default_lang = `typescript`, as = `ol`, style = null, title_snippet, } = $props();
4
2
  function toggle_all() {
5
3
  const any_open = files.some((file) => file.node?.open);
6
4
  for (const file of files) {
@@ -8,8 +6,8 @@ function toggle_all() {
8
6
  continue;
9
7
  file.node.open = !any_open;
10
8
  }
11
- files = [...files]; // trigger reactivity
12
9
  }
10
+ export {};
13
11
  </script>
14
12
 
15
13
  {#if files?.length > 1}
@@ -20,7 +18,7 @@ function toggle_all() {
20
18
 
21
19
  <svelte:element this={as} {style}>
22
20
  {#each files as file, idx (file.title)}
23
- {@const { title, content, language = default_lang } = file ?? {}}
21
+ {@const { title, content, _language = default_lang } = file ?? {}}
24
22
  <li>
25
23
  <!-- https://github.com/sveltejs/svelte/issues/12721#issuecomment-2269544690 -->
26
24
  <details bind:this={file.node}>
@@ -34,7 +32,8 @@ function toggle_all() {
34
32
  </summary>
35
33
  {/if}
36
34
 
37
- <pre><code>{@html hljs.highlight(content, { language }).value}</code></pre>
35
+ <pre><code>{@html content}</code></pre>
36
+ <!-- <pre><code>{@html hljs.highlight(content, { language }).value}</code></pre> -->
38
37
  </details>
39
38
  </li>
40
39
  {/each}
@@ -1,4 +1,3 @@
1
- import 'highlight.js/styles/vs2015.css';
2
1
  import type { Snippet } from 'svelte';
3
2
  type File = {
4
3
  title: string;
@@ -1,7 +1,6 @@
1
- <script lang="ts">import { Icon, Wiggle } from './';
1
+ <script lang="ts">import { CircleSpinner, Icon, Wiggle } from './';
2
2
  import { tick } from 'svelte';
3
3
  import { flip } from 'svelte/animate';
4
- import CircleSpinner from './CircleSpinner.svelte';
5
4
  import { get_label, get_style, highlight_matching_nodes } from './utils';
6
5
  let { activeIndex = $bindable(null), activeOption = $bindable(null), createOptionMsg = `Create this option...`, allowUserOptions = false, allowEmpty = false, autocomplete = `off`, autoScroll = true, breakpoint = 800, defaultDisabledTitle = `This option is disabled`, disabled = false, disabledInputTitle = `This input is disabled`, duplicateOptionMsg = `This option is already selected`, duplicates = false, key = (opt) => `${get_label(opt)}`.toLowerCase(), filterFunc = (opt, searchText) => {
7
6
  if (!searchText)
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "homepage": "https://janosh.github.io/svelte-multiselect",
6
6
  "repository": "https://github.com/janosh/svelte-multiselect",
7
7
  "license": "MIT",
8
- "version": "11.2.0",
8
+ "version": "11.2.1",
9
9
  "type": "module",
10
10
  "svelte": "./dist/index.js",
11
11
  "bugs": "https://github.com/janosh/svelte-multiselect/issues",
@@ -24,7 +24,6 @@
24
24
  "eslint": "^9.30.1",
25
25
  "eslint-plugin-svelte": "^3.10.1",
26
26
  "hastscript": "^9.0.1",
27
- "highlight.js": "^11.11.1",
28
27
  "jsdom": "^26.1.0",
29
28
  "mdsvex": "^0.12.6",
30
29
  "mdsvexamples": "^0.5.0",