@websline/system-components 1.3.4 → 1.3.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/dist/components/atoms/checkbox/Checkbox.svelte +1 -1
- package/dist/components/atoms/chip/Chip.svelte +4 -3
- package/dist/components/atoms/chip/chip.variants.d.ts +15 -15
- package/dist/components/atoms/chip/chip.variants.js +48 -29
- package/dist/components/atoms/icon/components/AiStars.svelte +29 -0
- package/dist/components/atoms/icon/components/AiStars.svelte.d.ts +33 -0
- package/dist/components/atoms/icon/components/AlignBottom.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignBottom.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignBottomOne.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignBottomOne.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignCenter.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignCenter.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignCenterOne.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignCenterOne.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignLeft.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignLeft.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignMiddle.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignMiddle.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignMiddleOne.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignMiddleOne.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignRight.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignRight.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignRightOne.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignRightOne.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignTop.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignTop.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/AlignTopOne.svelte +27 -0
- package/dist/components/atoms/icon/components/AlignTopOne.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ArrowDown.svelte +13 -8
- package/dist/components/atoms/icon/components/ArrowUp.svelte +13 -8
- package/dist/components/atoms/icon/components/BoxIn.svelte +27 -0
- package/dist/components/atoms/icon/components/{Unlink.svelte.d.ts → BoxIn.svelte.d.ts} +3 -3
- package/dist/components/atoms/icon/components/BoxOut.svelte +27 -0
- package/dist/components/atoms/icon/components/BoxOut.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ChevronDoubleLeft.svelte +27 -0
- package/dist/components/atoms/icon/components/ChevronDoubleLeft.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ChevronDoubleRight.svelte +27 -0
- package/dist/components/atoms/icon/components/ChevronDoubleRight.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Clipboard.svelte +27 -0
- package/dist/components/atoms/icon/components/Clipboard.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Computer.svelte +26 -0
- package/dist/components/atoms/icon/components/Computer.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Connect.svelte +26 -0
- package/dist/components/atoms/icon/components/Connect.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ConnectCrossed.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ContactCard.svelte +27 -0
- package/dist/components/atoms/icon/components/ContactCard.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Crop.svelte +27 -0
- package/dist/components/atoms/icon/components/Crop.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Envelope.svelte +27 -0
- package/dist/components/atoms/icon/components/Envelope.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Envelopes.svelte +27 -0
- package/dist/components/atoms/icon/components/Envelopes.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Expand.svelte +27 -0
- package/dist/components/atoms/icon/components/Expand.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Eye.svelte +31 -0
- package/dist/components/atoms/icon/components/Eye.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/EyeCrossed.svelte +36 -0
- package/dist/components/atoms/icon/components/EyeCrossed.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Filter.svelte +27 -0
- package/dist/components/atoms/icon/components/Filter.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/FocalPoint.svelte +26 -0
- package/dist/components/atoms/icon/components/FocalPoint.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/FolderPlus.svelte +27 -0
- package/dist/components/atoms/icon/components/FolderPlus.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Funnel.svelte +26 -0
- package/dist/components/atoms/icon/components/Funnel.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Inbox.svelte +27 -0
- package/dist/components/atoms/icon/components/Inbox.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Intergration.svelte +27 -0
- package/dist/components/atoms/icon/components/Intergration.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/LinkAi.svelte +33 -0
- package/dist/components/atoms/icon/components/LinkAi.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/ListTasks.svelte +27 -0
- package/dist/components/atoms/icon/components/ListTasks.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Lock.svelte +27 -0
- package/dist/components/atoms/icon/components/Lock.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Minus.svelte +27 -0
- package/dist/components/atoms/icon/components/Minus.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/PageEdit.svelte +27 -0
- package/dist/components/atoms/icon/components/PageEdit.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Pages.svelte +33 -0
- package/dist/components/atoms/icon/components/Pages.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Payment.svelte +27 -0
- package/dist/components/atoms/icon/components/Payment.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Pencil.svelte +27 -0
- package/dist/components/atoms/icon/components/Pencil.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Phone.svelte +26 -0
- package/dist/components/atoms/icon/components/Phone.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Plus.svelte +27 -0
- package/dist/components/atoms/icon/components/Plus.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Print.svelte +36 -0
- package/dist/components/atoms/icon/components/Print.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/RefreshCircle.svelte +27 -0
- package/dist/components/atoms/icon/components/RefreshCircle.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Replace.svelte +27 -0
- package/dist/components/atoms/icon/components/Replace.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Report.svelte +27 -0
- package/dist/components/atoms/icon/components/Report.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/SEO.svelte +33 -0
- package/dist/components/atoms/icon/components/SEO.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Shop.svelte +27 -0
- package/dist/components/atoms/icon/components/Shop.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Smartphone.svelte +26 -0
- package/dist/components/atoms/icon/components/Smartphone.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Sort.svelte +27 -0
- package/dist/components/atoms/icon/components/Sort.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Star.svelte +26 -0
- package/dist/components/atoms/icon/components/Star.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/StyleGuide.svelte +38 -0
- package/dist/components/atoms/icon/components/StyleGuide.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Tablet.svelte +26 -0
- package/dist/components/atoms/icon/components/Tablet.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Translate.svelte +27 -0
- package/dist/components/atoms/icon/components/Translate.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/TranslateCrossed.svelte +36 -0
- package/dist/components/atoms/icon/components/TranslateCrossed.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/components/Width.svelte +27 -0
- package/dist/components/atoms/icon/components/Width.svelte.d.ts +41 -0
- package/dist/components/atoms/icon/index.d.ts +6 -774
- package/dist/components/atoms/icon/index.js +43 -87
- package/dist/components/atoms/radio/Radio.svelte +1 -1
- package/dist/components/atoms/switch/Switch.svelte +1 -1
- package/dist/components/atoms/tag/Tag.svelte +47 -0
- package/dist/components/atoms/tag/Tag.svelte.d.ts +73 -0
- package/dist/components/atoms/tag/tag.variants.d.ts +58 -0
- package/dist/components/atoms/tag/tag.variants.js +32 -0
- package/dist/components/molecules/richTextEditor/RichTextEditor.svelte +50 -63
- package/dist/components/molecules/richTextEditor/RichTextEditor.svelte.d.ts +15 -135
- package/dist/components/molecules/richTextEditor/toolbar/RichTextEditorToolbar.svelte +10 -11
- package/dist/components/molecules/richTextEditor/toolbar/RichTextEditorToolbar.svelte.d.ts +0 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarBold.svelte +9 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarBold.svelte.d.ts +2 -7
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarColor.svelte +7 -4
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarColor.svelte.d.ts +0 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarItalic.svelte +9 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarItalic.svelte.d.ts +2 -7
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarLink.svelte +11 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarLink.svelte.d.ts +0 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarList.svelte +9 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarList.svelte.d.ts +2 -7
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarListOrdered.svelte +9 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarListOrdered.svelte.d.ts +2 -7
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarRedo.svelte +2 -1
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarRedo.svelte.d.ts +2 -7
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarUnderline.svelte +9 -2
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarUnderline.svelte.d.ts +2 -7
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarUndo.svelte +2 -1
- package/dist/components/molecules/richTextEditor/toolbar/ToolbarUndo.svelte.d.ts +2 -7
- package/dist/components/molecules/selectorCard/SelectorCard.svelte +1 -1
- package/dist/components/molecules/tagSelector/ValueList.svelte +5 -9
- package/dist/components/molecules/toggleGroup/ToggleGroup.svelte +21 -3
- package/dist/components/molecules/toggleGroup/ToggleGroup.svelte.d.ts +16 -0
- package/dist/components/molecules/toggleGroup/ToggleGroupItem.svelte +5 -3
- package/dist/components/molecules/toggleGroup/toggleGroup.variants.d.ts +32 -13
- package/dist/components/molecules/toggleGroup/toggleGroup.variants.js +12 -0
- package/dist/components/molecules/toggleGroup/toggleGroupItem.variants.d.ts +9 -0
- package/dist/components/molecules/toggleGroup/toggleGroupItem.variants.js +8 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- /package/dist/components/atoms/icon/components/{Unlink.svelte → ConnectCrossed.svelte} +0 -0
|
@@ -9,41 +9,40 @@
|
|
|
9
9
|
import ToolbarRedo from "./ToolbarRedo.svelte";
|
|
10
10
|
import ToolbarColor from "./ToolbarColor.svelte";
|
|
11
11
|
|
|
12
|
-
let {
|
|
12
|
+
let { toolbarConfig } = $props();
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
{#if toolbarConfig && toolbarConfig.bold && toolbarConfig.bold.enabled}
|
|
16
|
-
<ToolbarBold
|
|
16
|
+
<ToolbarBold />
|
|
17
17
|
{/if}
|
|
18
18
|
|
|
19
19
|
{#if toolbarConfig && toolbarConfig.italic && toolbarConfig.italic.enabled}
|
|
20
|
-
<ToolbarItalic
|
|
20
|
+
<ToolbarItalic />
|
|
21
21
|
{/if}
|
|
22
22
|
|
|
23
23
|
{#if toolbarConfig && toolbarConfig.underline && toolbarConfig.underline.enabled}
|
|
24
|
-
<ToolbarUnderline
|
|
24
|
+
<ToolbarUnderline />
|
|
25
25
|
{/if}
|
|
26
26
|
|
|
27
27
|
{#if toolbarConfig && toolbarConfig.link && toolbarConfig.link.enabled}
|
|
28
|
-
<ToolbarLink
|
|
28
|
+
<ToolbarLink onOpenLink={toolbarConfig.link.onOpenLink} />
|
|
29
29
|
{/if}
|
|
30
30
|
|
|
31
31
|
{#if toolbarConfig && toolbarConfig.color && toolbarConfig.color.enabled && toolbarConfig.color.colors.length > 0}
|
|
32
32
|
<ToolbarColor
|
|
33
33
|
colors={toolbarConfig.color.colors}
|
|
34
|
-
defaultColor={toolbarConfig.color.defaultColor}
|
|
35
|
-
{editor} />
|
|
34
|
+
defaultColor={toolbarConfig.color.defaultColor} />
|
|
36
35
|
{/if}
|
|
37
36
|
|
|
38
37
|
{#if toolbarConfig && toolbarConfig.list && toolbarConfig.list.enabled}
|
|
39
|
-
<ToolbarList
|
|
38
|
+
<ToolbarList />
|
|
40
39
|
{/if}
|
|
41
40
|
|
|
42
41
|
{#if toolbarConfig && toolbarConfig.listOrdered && toolbarConfig.listOrdered.enabled}
|
|
43
|
-
<ToolbarListOrdered
|
|
42
|
+
<ToolbarListOrdered />
|
|
44
43
|
{/if}
|
|
45
44
|
|
|
46
45
|
{#if toolbarConfig && toolbarConfig.history && toolbarConfig.history.enabled}
|
|
47
|
-
<ToolbarUndo
|
|
48
|
-
<ToolbarRedo
|
|
46
|
+
<ToolbarUndo />
|
|
47
|
+
<ToolbarRedo />
|
|
49
48
|
{/if}
|
|
@@ -4,10 +4,8 @@ type RichTextEditorToolbar = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const RichTextEditorToolbar: import("svelte").Component<{
|
|
7
|
-
editor: any;
|
|
8
7
|
toolbarConfig: any;
|
|
9
8
|
}, {}, "">;
|
|
10
9
|
type $$ComponentProps = {
|
|
11
|
-
editor: any;
|
|
12
10
|
toolbarConfig: any;
|
|
13
11
|
};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { getContext } from "svelte";
|
|
2
3
|
import { IconButton } from "../../../../index.js";
|
|
3
4
|
|
|
4
|
-
let
|
|
5
|
+
let active = $state(false);
|
|
6
|
+
let editor = $derived(getContext("richt-text-editor")());
|
|
7
|
+
|
|
8
|
+
$effect(() => {
|
|
9
|
+
if (!editor) return;
|
|
10
|
+
return editor.on("transaction", () => (active = editor.isActive("bold")));
|
|
11
|
+
});
|
|
5
12
|
</script>
|
|
6
13
|
|
|
7
14
|
{#if editor}
|
|
8
15
|
<IconButton
|
|
9
|
-
color={
|
|
16
|
+
color={active ? "default" : "transparent"}
|
|
10
17
|
icon="bold"
|
|
11
18
|
onclick={() => editor.chain().focus().toggleBold().run()}
|
|
12
19
|
shape="square" />
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export default ToolbarBold;
|
|
2
2
|
type ToolbarBold = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial
|
|
5
|
-
};
|
|
6
|
-
declare const ToolbarBold: import("svelte").Component<{
|
|
7
|
-
editor: any;
|
|
8
|
-
}, {}, "">;
|
|
9
|
-
type $$ComponentProps = {
|
|
10
|
-
editor: any;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
11
5
|
};
|
|
6
|
+
declare const ToolbarBold: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { getContext } from "svelte";
|
|
2
3
|
import { ColorSwatch } from "../../../../index.js";
|
|
3
4
|
|
|
4
|
-
let { colors = [], defaultColor = "#121110"
|
|
5
|
+
let { colors = [], defaultColor = "#121110" } = $props();
|
|
5
6
|
|
|
6
7
|
let isOpen = $state(false);
|
|
8
|
+
let editor = $derived(getContext("richt-text-editor")());
|
|
7
9
|
let selectedColor = $derived(defaultColor);
|
|
8
10
|
|
|
9
11
|
const handleColorSelect = (color) => {
|
|
@@ -15,9 +17,10 @@
|
|
|
15
17
|
|
|
16
18
|
$effect(() => {
|
|
17
19
|
if (!editor) return;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
return editor.on("transaction", () => {
|
|
21
|
+
const attrs = editor.getAttributes("textStyle");
|
|
22
|
+
selectedColor = attrs.color || defaultColor;
|
|
23
|
+
});
|
|
21
24
|
});
|
|
22
25
|
</script>
|
|
23
26
|
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { getContext } from "svelte";
|
|
2
3
|
import { IconButton } from "../../../../index.js";
|
|
3
4
|
|
|
4
|
-
let
|
|
5
|
+
let active = $state(false);
|
|
6
|
+
let editor = $derived(getContext("richt-text-editor")());
|
|
7
|
+
|
|
8
|
+
$effect(() => {
|
|
9
|
+
if (!editor) return;
|
|
10
|
+
return editor.on("transaction", () => (active = editor.isActive("italic")));
|
|
11
|
+
});
|
|
5
12
|
</script>
|
|
6
13
|
|
|
7
14
|
{#if editor}
|
|
8
15
|
<IconButton
|
|
9
|
-
color={
|
|
16
|
+
color={active ? "default" : "transparent"}
|
|
10
17
|
icon="italic"
|
|
11
18
|
onclick={() => editor.chain().focus().toggleItalic().run()}
|
|
12
19
|
shape="square" />
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export default ToolbarItalic;
|
|
2
2
|
type ToolbarItalic = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial
|
|
5
|
-
};
|
|
6
|
-
declare const ToolbarItalic: import("svelte").Component<{
|
|
7
|
-
editor: any;
|
|
8
|
-
}, {}, "">;
|
|
9
|
-
type $$ComponentProps = {
|
|
10
|
-
editor: any;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
11
5
|
};
|
|
6
|
+
declare const ToolbarItalic: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { getContext } from "svelte";
|
|
2
3
|
import { IconButton } from "../../../../index.js";
|
|
3
4
|
|
|
4
|
-
let {
|
|
5
|
+
let { onOpenLink } = $props();
|
|
6
|
+
|
|
7
|
+
let active = $state(false);
|
|
8
|
+
let editor = $derived(getContext("richt-text-editor")());
|
|
9
|
+
|
|
10
|
+
$effect(() => {
|
|
11
|
+
if (!editor) return;
|
|
12
|
+
return editor.on("transaction", () => (active = editor.isActive("link")));
|
|
13
|
+
});
|
|
5
14
|
|
|
6
15
|
const setLink = () => {
|
|
7
16
|
const focus = () => editor.chain().focus();
|
|
@@ -27,7 +36,7 @@
|
|
|
27
36
|
|
|
28
37
|
{#if editor}
|
|
29
38
|
<IconButton
|
|
30
|
-
color={
|
|
39
|
+
color={active ? "default" : "transparent"}
|
|
31
40
|
icon="link"
|
|
32
41
|
onclick={handleOpenLinkModal}
|
|
33
42
|
shape="square" />
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { getContext } from "svelte";
|
|
2
3
|
import { IconButton } from "../../../../index.js";
|
|
3
4
|
|
|
4
|
-
let
|
|
5
|
+
let active = $state(false);
|
|
6
|
+
let editor = $derived(getContext("richt-text-editor")());
|
|
7
|
+
|
|
8
|
+
$effect(() => {
|
|
9
|
+
if (!editor) return;
|
|
10
|
+
return editor.on("transaction", () => (active = editor.isActive("bulletList")));
|
|
11
|
+
});
|
|
5
12
|
</script>
|
|
6
13
|
|
|
7
14
|
{#if editor}
|
|
8
15
|
<IconButton
|
|
9
|
-
color={
|
|
16
|
+
color={active ? "default" : "transparent"}
|
|
10
17
|
icon="listUnordered"
|
|
11
18
|
onclick={() => editor.chain().focus().toggleBulletList().run()}
|
|
12
19
|
shape="square" />
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export default ToolbarList;
|
|
2
2
|
type ToolbarList = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial
|
|
5
|
-
};
|
|
6
|
-
declare const ToolbarList: import("svelte").Component<{
|
|
7
|
-
editor: any;
|
|
8
|
-
}, {}, "">;
|
|
9
|
-
type $$ComponentProps = {
|
|
10
|
-
editor: any;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
11
5
|
};
|
|
6
|
+
declare const ToolbarList: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { getContext } from "svelte";
|
|
2
3
|
import { IconButton } from "../../../../index.js";
|
|
3
4
|
|
|
4
|
-
let
|
|
5
|
+
let active = $state(false);
|
|
6
|
+
let editor = $derived(getContext("richt-text-editor")());
|
|
7
|
+
|
|
8
|
+
$effect(() => {
|
|
9
|
+
if (!editor) return;
|
|
10
|
+
return editor.on("transaction", () => (active = editor.isActive("orderedList")));
|
|
11
|
+
});
|
|
5
12
|
</script>
|
|
6
13
|
|
|
7
14
|
{#if editor}
|
|
8
15
|
<IconButton
|
|
9
|
-
color={
|
|
16
|
+
color={active ? "default" : "transparent"}
|
|
10
17
|
icon="listOrdered"
|
|
11
18
|
onclick={() => editor.chain().focus().toggleOrderedList().run()}
|
|
12
19
|
shape="square" />
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export default ToolbarListOrdered;
|
|
2
2
|
type ToolbarListOrdered = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial
|
|
5
|
-
};
|
|
6
|
-
declare const ToolbarListOrdered: import("svelte").Component<{
|
|
7
|
-
editor: any;
|
|
8
|
-
}, {}, "">;
|
|
9
|
-
type $$ComponentProps = {
|
|
10
|
-
editor: any;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
11
5
|
};
|
|
6
|
+
declare const ToolbarListOrdered: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export default ToolbarRedo;
|
|
2
2
|
type ToolbarRedo = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial
|
|
5
|
-
};
|
|
6
|
-
declare const ToolbarRedo: import("svelte").Component<{
|
|
7
|
-
editor: any;
|
|
8
|
-
}, {}, "">;
|
|
9
|
-
type $$ComponentProps = {
|
|
10
|
-
editor: any;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
11
5
|
};
|
|
6
|
+
declare const ToolbarRedo: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { getContext } from "svelte";
|
|
2
3
|
import { IconButton } from "../../../../index.js";
|
|
3
4
|
|
|
4
|
-
let
|
|
5
|
+
let active = $state(false);
|
|
6
|
+
let editor = $derived(getContext("richt-text-editor")());
|
|
7
|
+
|
|
8
|
+
$effect(() => {
|
|
9
|
+
if (!editor) return;
|
|
10
|
+
return editor.on("transaction", () => (active = editor.isActive("underline")));
|
|
11
|
+
});
|
|
5
12
|
</script>
|
|
6
13
|
|
|
7
14
|
{#if editor}
|
|
8
15
|
<IconButton
|
|
9
|
-
color={
|
|
16
|
+
color={active ? "default" : "transparent"}
|
|
10
17
|
icon="underline"
|
|
11
18
|
onclick={() => editor.chain().focus().toggleUnderline().run()}
|
|
12
19
|
shape="square" />
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export default ToolbarUnderline;
|
|
2
2
|
type ToolbarUnderline = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial
|
|
5
|
-
};
|
|
6
|
-
declare const ToolbarUnderline: import("svelte").Component<{
|
|
7
|
-
editor: any;
|
|
8
|
-
}, {}, "">;
|
|
9
|
-
type $$ComponentProps = {
|
|
10
|
-
editor: any;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
11
5
|
};
|
|
6
|
+
declare const ToolbarUnderline: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export default ToolbarUndo;
|
|
2
2
|
type ToolbarUndo = {
|
|
3
3
|
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
-
$set?(props: Partial
|
|
5
|
-
};
|
|
6
|
-
declare const ToolbarUndo: import("svelte").Component<{
|
|
7
|
-
editor: any;
|
|
8
|
-
}, {}, "">;
|
|
9
|
-
type $$ComponentProps = {
|
|
10
|
-
editor: any;
|
|
4
|
+
$set?(props: Partial<Record<string, never>>): void;
|
|
11
5
|
};
|
|
6
|
+
declare const ToolbarUndo: import("svelte").Component<Record<string, never>, {}, "">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
2
|
+
import { Tag } from "../../../index.js";
|
|
3
3
|
import { tagSelectorVariants } from "./tagSelector.variants.js";
|
|
4
4
|
|
|
5
5
|
let {
|
|
@@ -21,17 +21,13 @@
|
|
|
21
21
|
<div class={styles.valueList()}>
|
|
22
22
|
{#each value as s (s)}
|
|
23
23
|
{@const opt = options.find((i) => i.id === s)}
|
|
24
|
-
<
|
|
25
|
-
class={styles.item()}
|
|
26
|
-
clickable
|
|
27
|
-
icon="closeSmall"
|
|
28
|
-
onclick={() => onRemoveItem(s)}>
|
|
24
|
+
<Tag class={styles.item()} icon="closeSmall" onclick={() => onRemoveItem(s)}>
|
|
29
25
|
{opt?.label ?? s}
|
|
30
|
-
</
|
|
26
|
+
</Tag>
|
|
31
27
|
{/each}
|
|
32
28
|
|
|
33
29
|
{#if !localValues.disabled}
|
|
34
|
-
<
|
|
30
|
+
<Tag class={styles.searchField()} icon="add" variant="outline">
|
|
35
31
|
<input
|
|
36
32
|
bind:this={inputRef}
|
|
37
33
|
bind:value={query}
|
|
@@ -47,6 +43,6 @@
|
|
|
47
43
|
: {}}
|
|
48
44
|
{placeholder}
|
|
49
45
|
role="searchbox" />
|
|
50
|
-
</
|
|
46
|
+
</Tag>
|
|
51
47
|
{/if}
|
|
52
48
|
</div>
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* @property {"default" | "raised"} [appearance="default"] The appearance variant of the component
|
|
14
14
|
* @property {import('svelte').Snippet} [children] Children content – can be text, HTML, or other Svelte components
|
|
15
15
|
* @property {string} [class=""] Additional CSS classes to apply to the component
|
|
16
|
+
* @property {boolean} [disabled=false] Whether the toggle group is disabled
|
|
17
|
+
* @property {string} [name] The name of the toggle group, used for form submission
|
|
16
18
|
* @property {"small" | "medium"} [size="medium"] The size variant of the component
|
|
17
19
|
* @property {string} [value=""] The value of the toggle group
|
|
18
20
|
* @property {"default" | "tabs"} [variant="default"] The variant of the toggle group
|
|
@@ -28,6 +30,8 @@
|
|
|
28
30
|
appearance = "default",
|
|
29
31
|
children,
|
|
30
32
|
class: className = "",
|
|
33
|
+
disabled = false,
|
|
34
|
+
name,
|
|
31
35
|
size = "medium",
|
|
32
36
|
value = $bindable(),
|
|
33
37
|
variant = "default",
|
|
@@ -50,17 +54,31 @@
|
|
|
50
54
|
};
|
|
51
55
|
});
|
|
52
56
|
|
|
57
|
+
let inputProps = $derived({
|
|
58
|
+
disabled,
|
|
59
|
+
name,
|
|
60
|
+
value,
|
|
61
|
+
});
|
|
62
|
+
|
|
53
63
|
let styles = $derived.by(() => {
|
|
54
64
|
if (variant === "tabs") {
|
|
55
|
-
return toggleGroupTabVariants();
|
|
65
|
+
return toggleGroupTabVariants({ disabled });
|
|
56
66
|
}
|
|
57
67
|
|
|
58
|
-
return toggleGroupVariants({ appearance, size, variant });
|
|
68
|
+
return toggleGroupVariants({ appearance, disabled, size, variant });
|
|
59
69
|
});
|
|
60
70
|
</script>
|
|
61
71
|
|
|
62
72
|
<XScroll class={styles.base({ class: className })}>
|
|
63
|
-
<div
|
|
73
|
+
<div
|
|
74
|
+
bind:this={toggleGroupEl}
|
|
75
|
+
class={styles.tabs()}
|
|
76
|
+
inert={disabled}
|
|
77
|
+
role="tablist"
|
|
78
|
+
{...rest}>
|
|
79
|
+
{#if name}
|
|
80
|
+
<input type="hidden" {...inputProps} />
|
|
81
|
+
{/if}
|
|
64
82
|
{@render children?.()}
|
|
65
83
|
</div>
|
|
66
84
|
</XScroll>
|
|
@@ -16,6 +16,14 @@ declare const ToggleGroup: import("svelte").Component<{
|
|
|
16
16
|
* Additional CSS classes to apply to the component
|
|
17
17
|
*/
|
|
18
18
|
class?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the toggle group is disabled
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The name of the toggle group, used for form submission
|
|
25
|
+
*/
|
|
26
|
+
name?: string;
|
|
19
27
|
/**
|
|
20
28
|
* The size variant of the component
|
|
21
29
|
*/
|
|
@@ -42,6 +50,14 @@ type Props = {
|
|
|
42
50
|
* Additional CSS classes to apply to the component
|
|
43
51
|
*/
|
|
44
52
|
class?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the toggle group is disabled
|
|
55
|
+
*/
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The name of the toggle group, used for form submission
|
|
59
|
+
*/
|
|
60
|
+
name?: string;
|
|
45
61
|
/**
|
|
46
62
|
* The size variant of the component
|
|
47
63
|
*/
|
|
@@ -45,15 +45,17 @@
|
|
|
45
45
|
store.update(localeValue);
|
|
46
46
|
}}
|
|
47
47
|
type="button">
|
|
48
|
-
<
|
|
48
|
+
<div class={stylesByVariant.content()}>
|
|
49
49
|
{#if icon}
|
|
50
50
|
<Icon
|
|
51
51
|
class={stylesByVariant.icon()}
|
|
52
52
|
name={icon}
|
|
53
53
|
size={variant === "tabs" || size === "small" ? 16 : 24} />
|
|
54
54
|
{/if}
|
|
55
|
-
{
|
|
56
|
-
|
|
55
|
+
<span class={stylesByVariant.span()}>
|
|
56
|
+
{@render children?.()}
|
|
57
|
+
</span>
|
|
58
|
+
</div>
|
|
57
59
|
{#if isActive}
|
|
58
60
|
<div
|
|
59
61
|
class={stylesByVariant.trigger({ appearance })}
|
|
@@ -3,6 +3,11 @@ export const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
|
3
3
|
default: string;
|
|
4
4
|
raised: string;
|
|
5
5
|
};
|
|
6
|
+
disabled: {
|
|
7
|
+
true: {
|
|
8
|
+
base: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
6
11
|
size: {
|
|
7
12
|
small: {
|
|
8
13
|
tabs: string;
|
|
@@ -19,6 +24,11 @@ export const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
|
19
24
|
default: string;
|
|
20
25
|
raised: string;
|
|
21
26
|
};
|
|
27
|
+
disabled: {
|
|
28
|
+
true: {
|
|
29
|
+
base: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
22
32
|
size: {
|
|
23
33
|
small: {
|
|
24
34
|
tabs: string;
|
|
@@ -35,6 +45,11 @@ export const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
|
35
45
|
default: string;
|
|
36
46
|
raised: string;
|
|
37
47
|
};
|
|
48
|
+
disabled: {
|
|
49
|
+
true: {
|
|
50
|
+
base: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
38
53
|
size: {
|
|
39
54
|
small: {
|
|
40
55
|
tabs: string;
|
|
@@ -48,26 +63,30 @@ export const toggleGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
|
48
63
|
tabs: string;
|
|
49
64
|
}, undefined, unknown, unknown, undefined>>;
|
|
50
65
|
export const toggleGroupTabVariants: import("tailwind-variants").TVReturnType<{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
base
|
|
54
|
-
tabs?: import("tailwind-variants").ClassValue;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
} | {
|
|
58
|
-
[x: string]: {
|
|
59
|
-
[x: string]: import("tailwind-variants").ClassValue | {
|
|
60
|
-
base?: import("tailwind-variants").ClassValue;
|
|
61
|
-
tabs?: import("tailwind-variants").ClassValue;
|
|
66
|
+
disabled: {
|
|
67
|
+
true: {
|
|
68
|
+
base: string;
|
|
62
69
|
};
|
|
63
70
|
};
|
|
64
71
|
}, {
|
|
65
72
|
base: string;
|
|
66
73
|
tabs: string;
|
|
67
|
-
}, undefined,
|
|
74
|
+
}, undefined, {
|
|
75
|
+
disabled: {
|
|
76
|
+
true: {
|
|
77
|
+
base: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
}, {
|
|
68
81
|
base: string;
|
|
69
82
|
tabs: string;
|
|
70
|
-
}, import("tailwind-variants").TVReturnType<
|
|
83
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
84
|
+
disabled: {
|
|
85
|
+
true: {
|
|
86
|
+
base: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}, {
|
|
71
90
|
base: string;
|
|
72
91
|
tabs: string;
|
|
73
92
|
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -10,6 +10,11 @@ const toggleGroupVariants = tv({
|
|
|
10
10
|
default: "text-neutral-100 dark:text-neutral-900",
|
|
11
11
|
raised: "text-neutral-300 dark:text-neutral-700",
|
|
12
12
|
},
|
|
13
|
+
disabled: {
|
|
14
|
+
true: {
|
|
15
|
+
base: "opacity-40",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
13
18
|
size: {
|
|
14
19
|
small: {
|
|
15
20
|
tabs: "h-9 p-1",
|
|
@@ -26,6 +31,13 @@ const toggleGroupTabVariants = tv({
|
|
|
26
31
|
base: "",
|
|
27
32
|
tabs: "flex h-9 gap-4 border-b border-neutral-300 dark:border-neutral-700",
|
|
28
33
|
},
|
|
34
|
+
variants: {
|
|
35
|
+
disabled: {
|
|
36
|
+
true: {
|
|
37
|
+
base: "opacity-40",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
29
41
|
});
|
|
30
42
|
|
|
31
43
|
export { toggleGroupVariants, toggleGroupTabVariants };
|