@cloudvoyant/helical-svelte 0.20.0 → 0.20.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.
- package/dist/editor/SlashMenu.svelte +33 -3
- package/package.json +3 -2
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SlashCommandItem } from '@cloudvoyant/helical-ui';
|
|
3
3
|
import { onMount, tick } from 'svelte';
|
|
4
|
-
import
|
|
4
|
+
import {
|
|
5
|
+
Bookmark,
|
|
6
|
+
Code,
|
|
7
|
+
Heading1,
|
|
8
|
+
Heading2,
|
|
9
|
+
Heading3,
|
|
10
|
+
Heading4,
|
|
11
|
+
Image,
|
|
12
|
+
List,
|
|
13
|
+
ListOrdered,
|
|
14
|
+
ListTodo,
|
|
15
|
+
MessageSquareWarning,
|
|
16
|
+
Minus,
|
|
17
|
+
Quote,
|
|
18
|
+
} from 'lucide-svelte';
|
|
5
19
|
import type { Component } from 'svelte';
|
|
6
20
|
|
|
21
|
+
const SLASH_MENU_ICONS: Record<string, typeof Heading1 | undefined> = {
|
|
22
|
+
Heading1,
|
|
23
|
+
Heading2,
|
|
24
|
+
Heading3,
|
|
25
|
+
Heading4,
|
|
26
|
+
Quote,
|
|
27
|
+
MessageSquareWarning,
|
|
28
|
+
List,
|
|
29
|
+
ListOrdered,
|
|
30
|
+
ListTodo,
|
|
31
|
+
Minus,
|
|
32
|
+
Code,
|
|
33
|
+
Image,
|
|
34
|
+
Bookmark,
|
|
35
|
+
};
|
|
36
|
+
|
|
7
37
|
interface Props {
|
|
8
38
|
items: SlashCommandItem[];
|
|
9
39
|
command: (item: SlashCommandItem) => void;
|
|
@@ -16,8 +46,8 @@
|
|
|
16
46
|
let menuScrollElement = $state<HTMLDivElement | undefined>();
|
|
17
47
|
let itemElements = $state<Array<HTMLButtonElement | undefined>>([]);
|
|
18
48
|
|
|
19
|
-
function getIcon(iconName: string): Component | undefined {
|
|
20
|
-
return
|
|
49
|
+
function getIcon(iconName: string): Component<{ size?: number }> | undefined {
|
|
50
|
+
return SLASH_MENU_ICONS[iconName] as unknown as Component<{ size?: number }> | undefined;
|
|
21
51
|
}
|
|
22
52
|
|
|
23
53
|
function setSelectedIndex(index: number) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudvoyant/helical-svelte",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "helical-ui Svelte UI components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
7
8
|
"svelte": "./dist/index.js",
|
|
8
9
|
"main": "./dist/index.js",
|
|
9
10
|
"module": "./dist/index.js",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"lucide-svelte": "^0.577.0",
|
|
44
45
|
"lowlight": "^3.3.0",
|
|
45
46
|
"svelte-tiptap": "^3.0.1",
|
|
46
|
-
"@cloudvoyant/helical-ui": "0.20.
|
|
47
|
+
"@cloudvoyant/helical-ui": "0.20.1"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@sveltejs/package": "^2.5.8",
|