@flexiui/svelte-rich-text 0.0.60 → 0.0.61
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/README.md +388 -185
- package/dist/RichText.svelte +382 -2070
- package/dist/RichText.svelte.d.ts +28 -0
- package/dist/Toolbar/RenderToolbarButton.svelte +147 -0
- package/dist/Toolbar/RenderToolbarButton.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/ClearFormatting.svelte +31 -0
- package/dist/Toolbar/action-buttons/ClearFormatting.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/ClearNodes.svelte +15 -0
- package/dist/Toolbar/action-buttons/ClearNodes.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/MergeCellsBtn.svelte +31 -0
- package/dist/Toolbar/action-buttons/MergeCellsBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/Redo.svelte +26 -0
- package/dist/Toolbar/action-buttons/Redo.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/SplitCellBtn.svelte +31 -0
- package/dist/Toolbar/action-buttons/SplitCellBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/Undo.svelte +30 -0
- package/dist/Toolbar/action-buttons/Undo.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/Bold.svelte +29 -0
- package/dist/Toolbar/action-buttons/marks/Bold.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/CodeMarkBtn.svelte +33 -0
- package/dist/Toolbar/action-buttons/marks/CodeMarkBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/FontSize.svelte +99 -0
- package/dist/Toolbar/action-buttons/marks/FontSize.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/Italic.svelte +27 -0
- package/dist/Toolbar/action-buttons/marks/Italic.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/LinkBtn.svelte +64 -0
- package/dist/Toolbar/action-buttons/marks/LinkBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/SpecialBox.svelte +21 -0
- package/dist/Toolbar/action-buttons/marks/SpecialBox.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/Strike.svelte +30 -0
- package/dist/Toolbar/action-buttons/marks/Strike.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/TextAlign.svelte +66 -0
- package/dist/Toolbar/action-buttons/marks/TextAlign.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/Underline.svelte +29 -0
- package/dist/Toolbar/action-buttons/marks/Underline.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/Audio.svelte +60 -0
- package/dist/Toolbar/action-buttons/nodes/Audio.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/Blockquote.svelte +25 -0
- package/dist/Toolbar/action-buttons/nodes/Blockquote.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/CodeBlock.svelte +37 -0
- package/dist/Toolbar/action-buttons/nodes/CodeBlock.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/HardBreakBtn.svelte +26 -0
- package/dist/Toolbar/action-buttons/nodes/HardBreakBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/HeadingBtn.svelte +78 -0
- package/dist/Toolbar/action-buttons/nodes/HeadingBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/HorizontalRule.svelte +24 -0
- package/dist/Toolbar/action-buttons/nodes/HorizontalRule.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/Image.svelte +60 -0
- package/dist/Toolbar/action-buttons/nodes/Image.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/InlineMath.svelte +50 -0
- package/dist/Toolbar/action-buttons/nodes/InlineMath.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/ListBtn.svelte +43 -0
- package/dist/Toolbar/action-buttons/nodes/ListBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/MediaGridBtn.svelte +58 -0
- package/dist/Toolbar/action-buttons/nodes/MediaGridBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/Table.svelte +60 -0
- package/dist/Toolbar/action-buttons/nodes/Table.svelte.d.ts +14 -0
- package/dist/Toolbar/bubble-menus/BubbleMenuImage.svelte +139 -0
- package/dist/Toolbar/bubble-menus/BubbleMenuImage.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/HeadingsDropdownBtn.svelte +64 -0
- package/dist/Toolbar/dropdown-buttons/HeadingsDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/HighlightDropdownBtn.svelte +45 -0
- package/dist/Toolbar/dropdown-buttons/HighlightDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/LineHeightDropdownBtn.svelte +18 -0
- package/dist/Toolbar/dropdown-buttons/LineHeightDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/ListsDropdownBtn.svelte +188 -0
- package/dist/Toolbar/dropdown-buttons/ListsDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/TextColorDropdownBtn.svelte +37 -0
- package/dist/Toolbar/dropdown-buttons/TextColorDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdowns/LineHeightDropdown.svelte +26 -0
- package/dist/Toolbar/dropdowns/LineHeightDropdown.svelte.d.ts +14 -0
- package/dist/Toolbar/toolbar-utils.d.ts +1 -0
- package/dist/Toolbar/toolbar-utils.js +15 -0
- package/dist/extensions/NodeFontSize.d.ts +10 -0
- package/dist/extensions/NodeFontSize.js +53 -0
- package/dist/extensions/SemanticHeadings.d.ts +10 -0
- package/dist/extensions/SemanticHeadings.js +124 -0
- package/dist/extensions/Table/TableCellNodeView.svelte +0 -4
- package/dist/getExtensions.d.ts +7 -0
- package/dist/getExtensions.js +13 -2
- package/dist/styles.css +53 -10
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type HeadingBtnProps = typeof __propDef.props;
|
|
10
|
+
export type HeadingBtnEvents = typeof __propDef.events;
|
|
11
|
+
export type HeadingBtnSlots = typeof __propDef.slots;
|
|
12
|
+
export default class HeadingBtn extends SvelteComponentTyped<HeadingBtnProps, HeadingBtnEvents, HeadingBtnSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const { editor, ariaLabel = "Horizontal rule" } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<!-- Horizontal rule -->
|
|
6
|
+
<button
|
|
7
|
+
type="button"
|
|
8
|
+
onclick={() => $editor.chain().focus().setHorizontalRule().run()}
|
|
9
|
+
aria-label={ariaLabel}
|
|
10
|
+
>
|
|
11
|
+
<svg
|
|
12
|
+
width="15"
|
|
13
|
+
height="15"
|
|
14
|
+
viewBox="0 0 15 15"
|
|
15
|
+
fill="none"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
><path
|
|
18
|
+
d="M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z"
|
|
19
|
+
fill="currentColor"
|
|
20
|
+
fill-rule="evenodd"
|
|
21
|
+
clip-rule="evenodd"
|
|
22
|
+
></path></svg
|
|
23
|
+
>
|
|
24
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type HorizontalRuleProps = typeof __propDef.props;
|
|
10
|
+
export type HorizontalRuleEvents = typeof __propDef.events;
|
|
11
|
+
export type HorizontalRuleSlots = typeof __propDef.slots;
|
|
12
|
+
export default class HorizontalRule extends SvelteComponentTyped<HorizontalRuleProps, HorizontalRuleEvents, HorizontalRuleSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { isNodeFullySelected } from "../../toolbar-utils";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
editor,
|
|
6
|
+
nodesLimit,
|
|
7
|
+
currentNodeCount,
|
|
8
|
+
accenSoft = false,
|
|
9
|
+
ariaLabel = "Image",
|
|
10
|
+
} = $props();
|
|
11
|
+
|
|
12
|
+
function addImage() {
|
|
13
|
+
const hasSelected = isNodeFullySelected($editor);
|
|
14
|
+
|
|
15
|
+
if (currentNodeCount >= nodesLimit && !hasSelected) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const previousSrc = $editor.getAttributes("image").src;
|
|
20
|
+
const src = window.prompt("Enter the URL of the image:", previousSrc);
|
|
21
|
+
|
|
22
|
+
if (!src) {
|
|
23
|
+
alert("Please enter a valid URL");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Si el nodo está completamente seleccionado, reemplazarlo
|
|
28
|
+
if (hasSelected) {
|
|
29
|
+
$editor
|
|
30
|
+
.chain()
|
|
31
|
+
.deleteSelection() // Elimina el nodo seleccionado
|
|
32
|
+
.setImage({ src })
|
|
33
|
+
.run();
|
|
34
|
+
} else {
|
|
35
|
+
// Comportamiento normal: insertar
|
|
36
|
+
$editor.chain().focus().setImage({ src }).run();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<!-- Image -->
|
|
42
|
+
<button
|
|
43
|
+
type="button"
|
|
44
|
+
onclick={addImage}
|
|
45
|
+
aria-label={ariaLabel}
|
|
46
|
+
class:is-active={$editor.isActive("image")}
|
|
47
|
+
class:accent-soft={accenSoft}
|
|
48
|
+
>
|
|
49
|
+
<svg
|
|
50
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
+
width="24"
|
|
52
|
+
height="24"
|
|
53
|
+
viewBox="0 0 24 24"
|
|
54
|
+
fill="currentColor"
|
|
55
|
+
class="icon icon-tabler icons-tabler-filled icon-tabler-photo"
|
|
56
|
+
><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path
|
|
57
|
+
d="M8.813 11.612c.457 -.38 .918 -.38 1.386 .011l.108 .098l4.986 4.986l.094 .083a1 1 0 0 0 1.403 -1.403l-.083 -.094l-1.292 -1.293l.292 -.293l.106 -.095c.457 -.38 .918 -.38 1.386 .011l.108 .098l4.674 4.675a4 4 0 0 1 -3.775 3.599l-.206 .005h-12a4 4 0 0 1 -3.98 -3.603l6.687 -6.69l.106 -.095zm9.187 -9.612a4 4 0 0 1 3.995 3.8l.005 .2v9.585l-3.293 -3.292l-.15 -.137c-1.256 -1.095 -2.85 -1.097 -4.096 -.017l-.154 .14l-.307 .306l-2.293 -2.292l-.15 -.137c-1.256 -1.095 -2.85 -1.097 -4.096 -.017l-.154 .14l-5.307 5.306v-9.585a4 4 0 0 1 3.8 -3.995l.2 -.005h12zm-2.99 5l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z"
|
|
58
|
+
/></svg
|
|
59
|
+
>
|
|
60
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type ImageProps = typeof __propDef.props;
|
|
10
|
+
export type ImageEvents = typeof __propDef.events;
|
|
11
|
+
export type ImageSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Image extends SvelteComponentTyped<ImageProps, ImageEvents, ImageSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let {
|
|
3
|
+
editor,
|
|
4
|
+
ariaLabel = "Add inline LaTeX math",
|
|
5
|
+
} = $props();
|
|
6
|
+
|
|
7
|
+
function addInlineMath() {
|
|
8
|
+
const hasSelection = !$editor.state.selection.empty;
|
|
9
|
+
|
|
10
|
+
if (hasSelection) {
|
|
11
|
+
const latex = prompt("Enter inline math LaTeX expression:", "");
|
|
12
|
+
if (latex) {
|
|
13
|
+
return $editor
|
|
14
|
+
.chain()
|
|
15
|
+
.deleteSelection()
|
|
16
|
+
.insertInlineMath({ latex })
|
|
17
|
+
.focus()
|
|
18
|
+
.run();
|
|
19
|
+
}
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const latex = prompt("Enter inline math LaTeX expression:", "");
|
|
24
|
+
if (latex) {
|
|
25
|
+
return $editor.chain().insertInlineMath({ latex }).focus().run();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<button
|
|
31
|
+
type="button"
|
|
32
|
+
onclick={addInlineMath}
|
|
33
|
+
aria-label={ariaLabel}
|
|
34
|
+
>
|
|
35
|
+
<svg
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
width="16"
|
|
38
|
+
height="16"
|
|
39
|
+
viewBox="0 0 24 24"
|
|
40
|
+
fill="none"
|
|
41
|
+
stroke="currentColor"
|
|
42
|
+
stroke-width="2"
|
|
43
|
+
stroke-linecap="round"
|
|
44
|
+
stroke-linejoin="round"
|
|
45
|
+
class="icon icon-tabler icons-tabler-outline icon-tabler-math"
|
|
46
|
+
><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path
|
|
47
|
+
d="M19 5h-7l-4 14l-3 -6h-2"
|
|
48
|
+
/><path d="M14 13l6 6" /><path d="M14 19l6 -6" /></svg
|
|
49
|
+
>
|
|
50
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type InlineMathProps = typeof __propDef.props;
|
|
10
|
+
export type InlineMathEvents = typeof __propDef.events;
|
|
11
|
+
export type InlineMathSlots = typeof __propDef.slots;
|
|
12
|
+
export default class InlineMath extends SvelteComponentTyped<InlineMathProps, InlineMathEvents, InlineMathSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
editor: any;
|
|
4
|
+
type?: "bulletList" | "orderedList" | "taskList";
|
|
5
|
+
accenSoft?: boolean;
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
editor,
|
|
11
|
+
type = "bulletList",
|
|
12
|
+
accenSoft = false,
|
|
13
|
+
ariaLabel,
|
|
14
|
+
}: Props = $props();
|
|
15
|
+
|
|
16
|
+
const DEFAULT_ARIA_LABELS = {
|
|
17
|
+
bulletList: "Bullet list",
|
|
18
|
+
orderedList: "Ordered list",
|
|
19
|
+
taskList: "Task list",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
if (!ariaLabel) {
|
|
23
|
+
ariaLabel = DEFAULT_ARIA_LABELS[type];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const icons = {
|
|
27
|
+
bulletList: `<svg width="24" height="24" class="tiptap-button-icon" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z" fill="currentColor"></path></svg>`,
|
|
28
|
+
orderedList: `<svg width="24" height="24" class="tiptap-button-icon" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z" fill="currentColor"></path></svg>`,
|
|
29
|
+
taskList: `<svg width="24" height="24" class="tiptap-button-icon" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M2 6C2 4.89543 2.89543 4 4 4H8C9.10457 4 10 4.89543 10 6V10C10 11.1046 9.10457 12 8 12H4C2.89543 12 2 11.1046 2 10V6ZM8 6H4V10H8V6Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071L2.29289 17.7071C1.90237 17.3166 1.90237 16.6834 2.29289 16.2929C2.68342 15.9024 3.31658 15.9024 3.70711 16.2929L5 17.5858L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M12 6C12 5.44772 12.4477 5 13 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H13C12.4477 7 12 6.55228 12 6Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M12 12C12 11.4477 12.4477 11 13 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H13C12.4477 13 12 12.5523 12 12Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M12 18C12 17.4477 12.4477 17 13 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H13C12.4477 19 12 18.5523 12 18Z" fill="currentColor"></path></svg>`,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const itemType = type === "taskList" ? "taskItem" : "listItem";
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<button
|
|
36
|
+
type="button"
|
|
37
|
+
onclick={() => $editor.chain().focus().toggleList(type, itemType).run()}
|
|
38
|
+
class:is-active={$editor.isActive(type)}
|
|
39
|
+
class:accent-soft={accenSoft}
|
|
40
|
+
aria-label={ariaLabel}
|
|
41
|
+
>
|
|
42
|
+
{@html icons[type]}
|
|
43
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type ListBtnProps = typeof __propDef.props;
|
|
10
|
+
export type ListBtnEvents = typeof __propDef.events;
|
|
11
|
+
export type ListBtnSlots = typeof __propDef.slots;
|
|
12
|
+
export default class ListBtn extends SvelteComponentTyped<ListBtnProps, ListBtnEvents, ListBtnSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { isNodeFullySelected } from "../../toolbar-utils";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
editor,
|
|
6
|
+
nodesLimit,
|
|
7
|
+
currentNodeCount,
|
|
8
|
+
accenSoft = false,
|
|
9
|
+
ariaLabel = "Media grid"
|
|
10
|
+
} = $props();
|
|
11
|
+
|
|
12
|
+
function addMediaGrid() {
|
|
13
|
+
const hasSelected = isNodeFullySelected($editor);
|
|
14
|
+
|
|
15
|
+
if (currentNodeCount >= nodesLimit && !hasSelected) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Si el nodo está completamente seleccionado, reemplazarlo
|
|
20
|
+
if (hasSelected) {
|
|
21
|
+
$editor
|
|
22
|
+
.chain()
|
|
23
|
+
.deleteSelection() // Elimina el nodo seleccionado
|
|
24
|
+
.insertGrid({ cols: 2 })
|
|
25
|
+
.run();
|
|
26
|
+
} else {
|
|
27
|
+
// Comportamiento normal: insertar
|
|
28
|
+
$editor.chain().focus().insertGrid({ cols: 2 }).run();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<!-- Grid -->
|
|
34
|
+
<button
|
|
35
|
+
type="button"
|
|
36
|
+
onclick={addMediaGrid}
|
|
37
|
+
aria-label={ariaLabel}
|
|
38
|
+
class:is-active={$editor.isActive("MediaGridComponent")}
|
|
39
|
+
class:accent-soft={accenSoft}
|
|
40
|
+
>
|
|
41
|
+
<svg
|
|
42
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
43
|
+
width="24"
|
|
44
|
+
height="24"
|
|
45
|
+
viewBox="0 0 24 24"
|
|
46
|
+
fill="currentColor"
|
|
47
|
+
class="icon icon-tabler icons-tabler-filled icon-tabler-layout-grid"
|
|
48
|
+
><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path
|
|
49
|
+
d="M9 3a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-4a2 2 0 0 1 -2 -2v-4a2 2 0 0 1 2 -2z"
|
|
50
|
+
/><path
|
|
51
|
+
d="M19 3a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-4a2 2 0 0 1 -2 -2v-4a2 2 0 0 1 2 -2z"
|
|
52
|
+
/><path
|
|
53
|
+
d="M9 13a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-4a2 2 0 0 1 -2 -2v-4a2 2 0 0 1 2 -2z"
|
|
54
|
+
/><path
|
|
55
|
+
d="M19 13a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-4a2 2 0 0 1 -2 -2v-4a2 2 0 0 1 2 -2z"
|
|
56
|
+
/></svg
|
|
57
|
+
>
|
|
58
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type MediaGridBtnProps = typeof __propDef.props;
|
|
10
|
+
export type MediaGridBtnEvents = typeof __propDef.events;
|
|
11
|
+
export type MediaGridBtnSlots = typeof __propDef.slots;
|
|
12
|
+
export default class MediaGridBtn extends SvelteComponentTyped<MediaGridBtnProps, MediaGridBtnEvents, MediaGridBtnSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { isNodeFullySelected } from "../../toolbar-utils";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
editor,
|
|
6
|
+
nodesLimit,
|
|
7
|
+
currentNodeCount,
|
|
8
|
+
accenSoft = false,
|
|
9
|
+
ariaLabel = "Table",
|
|
10
|
+
} = $props();
|
|
11
|
+
|
|
12
|
+
function addTable() {
|
|
13
|
+
const hasSelected = isNodeFullySelected($editor);
|
|
14
|
+
|
|
15
|
+
if (currentNodeCount >= nodesLimit && !hasSelected) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Si el nodo está completamente seleccionado, reemplazarlo
|
|
20
|
+
if (hasSelected) {
|
|
21
|
+
$editor
|
|
22
|
+
.chain()
|
|
23
|
+
.deleteSelection() // Elimina el nodo seleccionado
|
|
24
|
+
.insertTable({ rows: 3, cols: 3, withHeaderRow: true })
|
|
25
|
+
.run();
|
|
26
|
+
} else {
|
|
27
|
+
// Comportamiento normal: insertar
|
|
28
|
+
$editor
|
|
29
|
+
.chain()
|
|
30
|
+
.focus()
|
|
31
|
+
.insertTable({ rows: 3, cols: 3, withHeaderRow: true })
|
|
32
|
+
.run();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<!-- Table -->
|
|
38
|
+
<button
|
|
39
|
+
type="button"
|
|
40
|
+
onclick={addTable}
|
|
41
|
+
aria-label={ariaLabel}
|
|
42
|
+
class:is-active={$editor.isActive("table")}
|
|
43
|
+
class:accent-soft={accenSoft}
|
|
44
|
+
>
|
|
45
|
+
<svg
|
|
46
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
47
|
+
width="24"
|
|
48
|
+
height="24"
|
|
49
|
+
viewBox="0 0 24 24"
|
|
50
|
+
fill="none"
|
|
51
|
+
stroke="currentColor"
|
|
52
|
+
stroke-width="2"
|
|
53
|
+
stroke-linecap="round"
|
|
54
|
+
stroke-linejoin="round"
|
|
55
|
+
class="icon icon-tabler icons-tabler-outline icon-tabler-table"
|
|
56
|
+
><path stroke="none" d="M0 0h24v24H0z" fill="none" /><path
|
|
57
|
+
d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14"
|
|
58
|
+
/><path d="M3 10h18" /><path d="M10 3v18" /></svg
|
|
59
|
+
>
|
|
60
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type TableProps = typeof __propDef.props;
|
|
10
|
+
export type TableEvents = typeof __propDef.events;
|
|
11
|
+
export type TableSlots = typeof __propDef.slots;
|
|
12
|
+
export default class Table extends SvelteComponentTyped<TableProps, TableEvents, TableSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { BubbleMenu } from "svelte-tiptap";
|
|
3
|
+
|
|
4
|
+
let { editor, accentSoft = false } = $props();
|
|
5
|
+
|
|
6
|
+
let imageUrlInputEl: HTMLInputElement = $state(null) as HTMLInputElement;
|
|
7
|
+
let imageUrlInputValue: string = $state(null);
|
|
8
|
+
|
|
9
|
+
function setLink() {
|
|
10
|
+
const previousUrl = $editor.getAttributes("link").href;
|
|
11
|
+
const url = window.prompt("URL", previousUrl);
|
|
12
|
+
|
|
13
|
+
if (url === null) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (url === "") {
|
|
18
|
+
$editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
19
|
+
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
$editor
|
|
25
|
+
.chain()
|
|
26
|
+
.focus()
|
|
27
|
+
.extendMarkRange("link")
|
|
28
|
+
.setLink({ href: url })
|
|
29
|
+
.run();
|
|
30
|
+
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
const allLinks = $editor.view.dom.querySelectorAll("a");
|
|
33
|
+
|
|
34
|
+
allLinks.forEach((link: any) => {
|
|
35
|
+
link.addEventListener("click", (e: any) => {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}, 100);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
// console.log(e.message);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<!-- Image Menu -->
|
|
47
|
+
<div class="hidden">
|
|
48
|
+
<BubbleMenu
|
|
49
|
+
editor={$editor}
|
|
50
|
+
shouldShow={() => {
|
|
51
|
+
const emptySelection = $editor.state.selection.empty;
|
|
52
|
+
if (emptySelection) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return $editor.isActive("image");
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<div data-test-id="bubble-menu" class="fl-bubble-menu flex">
|
|
59
|
+
<input
|
|
60
|
+
class="fl-editor-image-url-input"
|
|
61
|
+
type="text"
|
|
62
|
+
placeholder="Insert image url"
|
|
63
|
+
bind:this={imageUrlInputEl}
|
|
64
|
+
value={$editor.getAttributes("image").src}
|
|
65
|
+
oninput={(e: any) => {
|
|
66
|
+
// console.log(e.target.value);
|
|
67
|
+
imageUrlInputValue = e.target.value;
|
|
68
|
+
}}
|
|
69
|
+
onkeydown={(e: any) => {
|
|
70
|
+
if (e.key === "Enter") {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
$editor
|
|
73
|
+
.chain()
|
|
74
|
+
.focus()
|
|
75
|
+
.setImage({ src: imageUrlInputEl?.value })
|
|
76
|
+
.run();
|
|
77
|
+
}
|
|
78
|
+
}}
|
|
79
|
+
/>
|
|
80
|
+
<button
|
|
81
|
+
type="button"
|
|
82
|
+
aria-label="Insert image from url"
|
|
83
|
+
disabled={!imageUrlInputValue ||
|
|
84
|
+
imageUrlInputValue === $editor.getAttributes("image").src}
|
|
85
|
+
class:is-active={imageUrlInputValue &&
|
|
86
|
+
imageUrlInputValue !== $editor.getAttributes("image").src}
|
|
87
|
+
class:accent-soft={accentSoft}
|
|
88
|
+
onclick={() => {
|
|
89
|
+
$editor
|
|
90
|
+
.chain()
|
|
91
|
+
.focus()
|
|
92
|
+
.setImage({ src: imageUrlInputEl?.value })
|
|
93
|
+
.run();
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
<svg
|
|
97
|
+
width="16"
|
|
98
|
+
height="16"
|
|
99
|
+
class="tiptap-button-icon"
|
|
100
|
+
viewBox="0 0 24 24"
|
|
101
|
+
fill="currentColor"
|
|
102
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
103
|
+
><path
|
|
104
|
+
fill-rule="evenodd"
|
|
105
|
+
clip-rule="evenodd"
|
|
106
|
+
d="M21 4C21 3.44772 20.5523 3 20 3C19.4477 3 19 3.44772 19 4V11C19 11.7956 18.6839 12.5587 18.1213 13.1213C17.5587 13.6839 16.7956 14 16 14H6.41421L9.70711 10.7071C10.0976 10.3166 10.0976 9.68342 9.70711 9.29289C9.31658 8.90237 8.68342 8.90237 8.29289 9.29289L3.29289 14.2929C2.90237 14.6834 2.90237 15.3166 3.29289 15.7071L8.29289 20.7071C8.68342 21.0976 9.31658 21.0976 9.70711 20.7071C10.0976 20.3166 10.0976 19.6834 9.70711 19.2929L6.41421 16H16C17.3261 16 18.5979 15.4732 19.5355 14.5355C20.4732 13.5979 21 12.3261 21 11V4Z"
|
|
107
|
+
fill="currentColor"
|
|
108
|
+
class="s-m1-89pp0R0Iu"
|
|
109
|
+
></path></svg
|
|
110
|
+
>
|
|
111
|
+
</button>
|
|
112
|
+
|
|
113
|
+
<button
|
|
114
|
+
type="button"
|
|
115
|
+
onclick={() => setLink()}
|
|
116
|
+
class="fl-bubble-menu-mark-button"
|
|
117
|
+
class:is-active={$editor.isActive("link")}
|
|
118
|
+
class:accent-soft={accentSoft}
|
|
119
|
+
aria-label="Link"
|
|
120
|
+
>
|
|
121
|
+
<svg
|
|
122
|
+
width="16"
|
|
123
|
+
height="16"
|
|
124
|
+
class="tiptap-button-icon"
|
|
125
|
+
viewBox="0 0 24 24"
|
|
126
|
+
fill="currentColor"
|
|
127
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
128
|
+
><path
|
|
129
|
+
d="M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z"
|
|
130
|
+
fill="currentColor"
|
|
131
|
+
></path><path
|
|
132
|
+
d="M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z"
|
|
133
|
+
fill="currentColor"
|
|
134
|
+
></path></svg
|
|
135
|
+
>
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
</BubbleMenu>
|
|
139
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type BubbleMenuImageProps = typeof __propDef.props;
|
|
10
|
+
export type BubbleMenuImageEvents = typeof __propDef.events;
|
|
11
|
+
export type BubbleMenuImageSlots = typeof __propDef.slots;
|
|
12
|
+
export default class BubbleMenuImage extends SvelteComponentTyped<BubbleMenuImageProps, BubbleMenuImageEvents, BubbleMenuImageSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { HEADINGS } from "../../utils";
|
|
3
|
+
|
|
4
|
+
const { editor, accentSoft = false, ariaLabel = "Headings", onToggleDropdown, } = $props();
|
|
5
|
+
|
|
6
|
+
function handleClick(event: MouseEvent) {
|
|
7
|
+
onToggleDropdown?.(event, "headings-dropdown");
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<!-- Headings dropdown btn -->
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
onclick={handleClick}
|
|
15
|
+
class:is-active={$editor.isActive("heading") || $editor.isActive("h1")}
|
|
16
|
+
class:accent-soft={accentSoft}
|
|
17
|
+
aria-label={ariaLabel}
|
|
18
|
+
>
|
|
19
|
+
{#if $editor.isActive("heading")}
|
|
20
|
+
{#each HEADINGS as heading}
|
|
21
|
+
{#if $editor.isActive("heading", { level: Number(heading.level) })}
|
|
22
|
+
{@html heading.icon}
|
|
23
|
+
{/if}
|
|
24
|
+
{/each}
|
|
25
|
+
{:else if $editor.isActive("h1")}
|
|
26
|
+
{@html HEADINGS[0].icon}
|
|
27
|
+
{/if}
|
|
28
|
+
|
|
29
|
+
{#if !$editor.isActive("heading") && !$editor.isActive("h1")}
|
|
30
|
+
<svg
|
|
31
|
+
width="24"
|
|
32
|
+
height="24"
|
|
33
|
+
class="tiptap-button-icon"
|
|
34
|
+
viewBox="0 0 24 24"
|
|
35
|
+
fill="currentColor"
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
><path
|
|
38
|
+
d="M6 3C6.55228 3 7 3.44772 7 4V11H17V4C17 3.44772 17.4477 3 18 3C18.5523 3 19 3.44772 19 4V20C19 20.5523 18.5523 21 18 21C17.4477 21 17 20.5523 17 20V13H7V20C7 20.5523 6.55228 21 6 21C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3Z"
|
|
39
|
+
fill="currentColor"
|
|
40
|
+
></path></svg
|
|
41
|
+
>
|
|
42
|
+
{/if}
|
|
43
|
+
|
|
44
|
+
<svg
|
|
45
|
+
class="toogle-dropdown-button-icon"
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
48
|
+
fill="none"
|
|
49
|
+
viewBox="0 0 20 12"
|
|
50
|
+
>
|
|
51
|
+
<defs>
|
|
52
|
+
<symbol id="dropdown-arrow" viewBox="0 0 10 6" fill="none">
|
|
53
|
+
<path
|
|
54
|
+
stroke="currentColor"
|
|
55
|
+
stroke-linecap="round"
|
|
56
|
+
stroke-linejoin="round"
|
|
57
|
+
stroke-width="2"
|
|
58
|
+
d="m1 1 4 4 4-4"
|
|
59
|
+
></path>
|
|
60
|
+
</symbol>
|
|
61
|
+
</defs>
|
|
62
|
+
<use href="#dropdown-arrow"></use>
|
|
63
|
+
</svg>
|
|
64
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type HeadingsDropdownBtnProps = typeof __propDef.props;
|
|
10
|
+
export type HeadingsDropdownBtnEvents = typeof __propDef.events;
|
|
11
|
+
export type HeadingsDropdownBtnSlots = typeof __propDef.slots;
|
|
12
|
+
export default class HeadingsDropdownBtn extends SvelteComponentTyped<HeadingsDropdownBtnProps, HeadingsDropdownBtnEvents, HeadingsDropdownBtnSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|