fuma 1.0.21 → 2.0.0
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 +1 -1
- package/dist/action/list/handlers.d.ts +2 -2
- package/dist/action/list/index.d.ts +2 -0
- package/dist/action/list/index.js +1 -0
- package/dist/action/list/trigger.d.ts +7 -1
- package/dist/action/list/trigger.js +2 -2
- package/dist/private/Meta.svelte +32 -27
- package/dist/private/Meta.svelte.d.ts +29 -17
- package/dist/private/api.d.ts +1 -1
- package/dist/private/store.d.ts +0 -1
- package/dist/server/parseFormData.d.ts +1 -1
- package/dist/server/parseQuery.d.ts +1 -1
- package/dist/server/sse.d.ts +0 -1
- package/dist/store/isSmallScreen.d.ts +0 -1
- package/dist/store/param.d.ts +0 -2
- package/dist/store/session.d.ts +0 -1
- package/dist/ui/badge/Badge.svelte +4 -3
- package/dist/ui/badge/Badge.svelte.d.ts +19 -15
- package/dist/ui/button/ButtonCopy.svelte +35 -32
- package/dist/ui/button/ButtonCopy.svelte.d.ts +23 -21
- package/dist/ui/button/ButtonDelete.svelte +23 -21
- package/dist/ui/button/ButtonDelete.svelte.d.ts +32 -20
- package/dist/ui/card/Card.svelte +13 -10
- package/dist/ui/card/Card.svelte.d.ts +39 -24
- package/dist/ui/card/CardBasic.svelte +5 -4
- package/dist/ui/card/CardBasic.svelte.d.ts +29 -18
- package/dist/ui/card/CardCollapse.svelte +35 -31
- package/dist/ui/card/CardCollapse.svelte.d.ts +37 -23
- package/dist/ui/card/CardFullScreen.svelte +8 -6
- package/dist/ui/card/CardFullScreen.svelte.d.ts +35 -20
- package/dist/ui/card/CardLink.svelte +5 -4
- package/dist/ui/card/CardLink.svelte.d.ts +29 -18
- package/dist/ui/dialog/Dialog.svelte +41 -34
- package/dist/ui/dialog/Dialog.svelte.d.ts +36 -23
- package/dist/ui/dialog/DialogConfirm.svelte +6 -4
- package/dist/ui/dialog/DialogConfirm.svelte.d.ts +33 -19
- package/dist/ui/drawer/Drawer.svelte +47 -38
- package/dist/ui/drawer/Drawer.svelte.d.ts +81 -46
- package/dist/ui/drawer/drawerFly.d.ts +0 -1
- package/dist/ui/drawer/layers.d.ts +0 -1
- package/dist/ui/form/Form.svelte +106 -87
- package/dist/ui/form/Form.svelte.d.ts +29 -16
- package/dist/ui/form/FormInput.svelte +12 -6
- package/dist/ui/form/FormSection.svelte +24 -17
- package/dist/ui/form/FormSection.svelte.d.ts +37 -25
- package/dist/ui/icon/Icon.svelte +35 -32
- package/dist/ui/icon/Icon.svelte.d.ts +25 -21
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/input/FormControl.svelte +48 -36
- package/dist/ui/input/FormControl.svelte.d.ts +32 -30
- package/dist/ui/input/InputBoolean.svelte +29 -22
- package/dist/ui/input/InputBoolean.svelte.d.ts +43 -35
- package/dist/ui/input/InputCheckboxs.svelte +37 -34
- package/dist/ui/input/InputCheckboxs.svelte.d.ts +54 -39
- package/dist/ui/input/InputCheckboxsMenu.svelte +64 -47
- package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +56 -41
- package/dist/ui/input/InputCheckboxsTree.svelte +9 -6
- package/dist/ui/input/InputCheckboxsTree.svelte.d.ts +22 -18
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte +36 -28
- package/dist/ui/input/InputCheckboxsTreeNodes.svelte.d.ts +20 -16
- package/dist/ui/input/InputCombo.svelte +76 -65
- package/dist/ui/input/InputCombo.svelte.d.ts +55 -39
- package/dist/ui/input/InputDate.svelte +36 -29
- package/dist/ui/input/InputDate.svelte.d.ts +20 -16
- package/dist/ui/input/InputDateTime.svelte +37 -30
- package/dist/ui/input/InputDateTime.svelte.d.ts +20 -16
- package/dist/ui/input/InputImage.svelte +52 -45
- package/dist/ui/input/InputImage.svelte.d.ts +40 -27
- package/dist/ui/input/InputImagePreview.svelte +24 -20
- package/dist/ui/input/InputImagePreview.svelte.d.ts +25 -21
- package/dist/ui/input/InputNumber.svelte +28 -22
- package/dist/ui/input/InputNumber.svelte.d.ts +20 -20
- package/dist/ui/input/InputOptionInParam.svelte +12 -10
- package/dist/ui/input/InputOptionInParam.svelte.d.ts +21 -17
- package/dist/ui/input/InputOptions.svelte +40 -34
- package/dist/ui/input/InputOptions.svelte.d.ts +19 -15
- package/dist/ui/input/InputPassword.svelte +22 -18
- package/dist/ui/input/InputPassword.svelte.d.ts +43 -35
- package/dist/ui/input/InputRadio.svelte +51 -46
- package/dist/ui/input/InputRadio.svelte.d.ts +53 -38
- package/dist/ui/input/InputRelation.svelte +129 -112
- package/dist/ui/input/InputRelation.svelte.d.ts +39 -53
- package/dist/ui/input/InputRelations.svelte +96 -90
- package/dist/ui/input/InputRelations.svelte.d.ts +35 -37
- package/dist/ui/input/InputSearch.svelte +14 -11
- package/dist/ui/input/InputSearch.svelte.d.ts +25 -21
- package/dist/ui/input/InputSelect.svelte +59 -46
- package/dist/ui/input/InputSelect.svelte.d.ts +23 -19
- package/dist/ui/input/InputText.svelte +29 -28
- package/dist/ui/input/InputText.svelte.d.ts +41 -28
- package/dist/ui/input/InputTextarea.svelte +20 -19
- package/dist/ui/input/InputTextarea.svelte.d.ts +20 -20
- package/dist/ui/input/InputTime.svelte +43 -36
- package/dist/ui/input/InputTime.svelte.d.ts +21 -36
- package/dist/ui/input/RelationAfter.svelte +13 -9
- package/dist/ui/input/RelationAfter.svelte.d.ts +24 -20
- package/dist/ui/input/SelectorList.svelte +16 -12
- package/dist/ui/input/SelectorList.svelte.d.ts +29 -20
- package/dist/ui/input/textRich/InputTextRich.svelte +63 -59
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +36 -38
- package/dist/ui/input/textRich/SuggesionList.svelte +13 -9
- package/dist/ui/input/textRich/SuggesionList.svelte.d.ts +19 -15
- package/dist/ui/input/textRich/ToolMark.svelte +12 -9
- package/dist/ui/input/textRich/ToolMark.svelte.d.ts +22 -18
- package/dist/ui/input/textRich/ToolMarkColor.svelte +16 -12
- package/dist/ui/input/textRich/ToolMarkColor.svelte.d.ts +21 -17
- package/dist/ui/input/textRich/ToolMarkLink.svelte +46 -38
- package/dist/ui/input/textRich/ToolMarkLink.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolMenu.svelte +34 -19
- package/dist/ui/input/textRich/ToolMenu.svelte.d.ts +30 -26
- package/dist/ui/input/textRich/ToolMenuAlign.svelte +13 -9
- package/dist/ui/input/textRich/ToolMenuAlign.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolMenuInsert.svelte +12 -7
- package/dist/ui/input/textRich/ToolMenuInsert.svelte.d.ts +20 -16
- package/dist/ui/input/textRich/ToolMenuNode.svelte +14 -10
- package/dist/ui/input/textRich/ToolMenuNode.svelte.d.ts +18 -14
- package/dist/ui/input/textRich/ToolsBar.svelte +21 -14
- package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +19 -17
- package/dist/ui/input/textRich/suggestion.d.ts +0 -1
- package/dist/ui/login/Login.svelte +37 -31
- package/dist/ui/login/Login.svelte.d.ts +18 -14
- package/dist/ui/menu/ContextMenu.svelte +37 -31
- package/dist/ui/menu/ContextMenu.svelte.d.ts +38 -25
- package/dist/ui/menu/DropDown.svelte +92 -83
- package/dist/ui/menu/DropDown.svelte.d.ts +46 -33
- package/dist/ui/menu/DropDownMenu.svelte +25 -18
- package/dist/ui/menu/DropDownMenu.svelte.d.ts +30 -19
- package/dist/ui/mode/ToggleMode.svelte +28 -16
- package/dist/ui/mode/ToggleMode.svelte.d.ts +34 -17
- package/dist/ui/pagination/Pagination.svelte +9 -8
- package/dist/ui/pagination/Pagination.svelte.d.ts +18 -14
- package/dist/ui/placeholder/Placeholder.svelte +4 -3
- package/dist/ui/placeholder/Placeholder.svelte.d.ts +28 -17
- package/dist/ui/placeholder/PlaceholderImage.svelte +6 -4
- package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +28 -17
- package/dist/ui/range/RangePicker.svelte +76 -63
- package/dist/ui/range/RangePicker.svelte.d.ts +29 -24
- package/dist/ui/range/RangePickerButton.svelte +45 -40
- package/dist/ui/range/RangePickerButton.svelte.d.ts +21 -19
- package/dist/ui/table/Table.svelte +35 -28
- package/dist/ui/table/Table.svelte.d.ts +24 -19
- package/dist/ui/table/TableBody.svelte +18 -12
- package/dist/ui/table/TableBody.svelte.d.ts +20 -15
- package/dist/ui/table/TableCell.svelte +13 -10
- package/dist/ui/table/TableCell.svelte.d.ts +19 -14
- package/dist/ui/table/TableFieldsEdition.svelte +58 -52
- package/dist/ui/table/TableFieldsEdition.svelte.d.ts +20 -15
- package/dist/ui/table/TableHead.svelte +20 -21
- package/dist/ui/table/TableHead.svelte.d.ts +19 -14
- package/dist/ui/table/TableViewSelect.svelte +50 -37
- package/dist/ui/table/TableViewSelect.svelte.d.ts +27 -23
- package/dist/ui/table/cell/TableCellArray.svelte +5 -3
- package/dist/ui/table/cell/TableCellArray.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellBoolean.svelte +4 -3
- package/dist/ui/table/cell/TableCellBoolean.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellNumber.svelte +2 -1
- package/dist/ui/table/cell/TableCellNumber.svelte.d.ts +18 -14
- package/dist/ui/table/cell/TableCellString.svelte +5 -2
- package/dist/ui/table/cell/TableCellString.svelte.d.ts +19 -25
- package/dist/ui/table/field.d.ts +32 -40
- package/dist/ui/table/field.js +1 -1
- package/dist/ui/table/head/TableHeadBoolean.svelte +6 -3
- package/dist/ui/table/head/TableHeadBoolean.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadDate.svelte +61 -113
- package/dist/ui/table/head/TableHeadDate.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadDefault.svelte +5 -2
- package/dist/ui/table/head/TableHeadDefault.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadNumber.svelte +67 -76
- package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +18 -24
- package/dist/ui/table/head/TableHeadSelect.svelte +47 -41
- package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +21 -27
- package/dist/ui/table/head/TableHeadString.svelte +14 -8
- package/dist/ui/table/head/TableHeadString.svelte.d.ts +18 -24
- package/dist/ui/tabs/Tabs.svelte +8 -5
- package/dist/ui/tabs/Tabs.svelte.d.ts +19 -15
- package/dist/ui/tabs/TabsIcon.svelte +31 -28
- package/dist/ui/tabs/TabsIcon.svelte.d.ts +21 -17
- package/dist/utils/eventEmitter.d.ts +4 -4
- package/dist/utils/tippy.d.ts +1 -1
- package/dist/validation/form.d.ts +0 -1
- package/dist/validation/zod.d.ts +96 -162
- package/dist/validation/zod.js +2 -4
- package/package.json +134 -138
- package/dist/ui/form/FormInput.svelte.d.ts +0 -152
- package/dist/ui/form/formInput.d.ts +0 -90
- package/dist/ui/slot/Slot.svelte +0 -35
- package/dist/ui/slot/Slot.svelte.d.ts +0 -22
- package/dist/ui/slot/Span.svelte +0 -4
- package/dist/ui/slot/Span.svelte.d.ts +0 -16
- package/dist/ui/slot/index.d.ts +0 -1
- package/dist/ui/slot/index.js +0 -1
- package/dist/ui/table/head/OrderButtons.svelte +0 -37
- package/dist/ui/table/head/OrderButtons.svelte.d.ts +0 -20
- package/dist/ui/table/head/index.d.ts +0 -19
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
8
11
|
};
|
|
9
|
-
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export type ToolMarkColorProps = typeof __propDef.props;
|
|
15
|
-
export type ToolMarkColorEvents = typeof __propDef.events;
|
|
16
|
-
export type ToolMarkColorSlots = typeof __propDef.slots;
|
|
17
|
-
export default class ToolMarkColor extends SvelteComponent<ToolMarkColorProps, ToolMarkColorEvents, ToolMarkColorSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
18
13
|
}
|
|
19
|
-
|
|
14
|
+
declare const ToolMarkColor: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
icon: string;
|
|
16
|
+
label: string;
|
|
17
|
+
color: string;
|
|
18
|
+
setColor: (color: string) => void;
|
|
19
|
+
}, {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, string>;
|
|
22
|
+
type ToolMarkColor = InstanceType<typeof ToolMarkColor>;
|
|
23
|
+
export default ToolMarkColor;
|
|
@@ -1,41 +1,49 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Editor } from '@tiptap/core'
|
|
3
|
+
import { mdiLinkVariant } from '@mdi/js'
|
|
4
|
+
|
|
5
|
+
import { Dialog } from '../../dialog/index.js'
|
|
6
|
+
import { InputText } from '../index.js'
|
|
7
|
+
import { z } from '../../../validation/zod.js'
|
|
8
|
+
import ToolMark from './ToolMark.svelte'
|
|
9
|
+
|
|
10
|
+
export let editor: Editor
|
|
11
|
+
let dialogLink: HTMLDialogElement
|
|
12
|
+
let linkHref = ''
|
|
13
|
+
let linkError = ''
|
|
14
|
+
|
|
15
|
+
async function handleNewLink() {
|
|
16
|
+
if (!linkHref) {
|
|
17
|
+
linkError = 'URL requis'
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const isEmail = z.string().email().safeParse(linkHref)
|
|
22
|
+
if (isEmail.success) linkHref = 'mailto:' + linkHref
|
|
23
|
+
else if (!linkHref.match(/^http(s)?:\/\//)) {
|
|
24
|
+
linkHref = 'https://' + linkHref
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const isUrl = z.string().url().safeParse(linkHref)
|
|
28
|
+
if (!isUrl.success) {
|
|
29
|
+
linkError = 'URL invalide'
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
editor.chain().focus().setLink({ href: linkHref }).run()
|
|
34
|
+
dialogLink.close()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function handleRemoveLink() {
|
|
38
|
+
editor.chain().focus().unsetLink().run()
|
|
39
|
+
dialogLink.close()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function handleKeyDown(event: KeyboardEvent) {
|
|
43
|
+
if (event.key !== 'Enter') return
|
|
44
|
+
event.preventDefault()
|
|
45
|
+
handleNewLink()
|
|
46
|
+
}
|
|
39
47
|
</script>
|
|
40
48
|
|
|
41
49
|
<ToolMark
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Editor } from '@tiptap/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
6
12
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
};
|
|
12
|
-
export type ToolMarkLinkProps = typeof __propDef.props;
|
|
13
|
-
export type ToolMarkLinkEvents = typeof __propDef.events;
|
|
14
|
-
export type ToolMarkLinkSlots = typeof __propDef.slots;
|
|
15
|
-
export default class ToolMarkLink extends SvelteComponent<ToolMarkLinkProps, ToolMarkLinkEvents, ToolMarkLinkSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
16
14
|
}
|
|
17
|
-
|
|
15
|
+
declare const ToolMarkLink: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
editor: Editor;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type ToolMarkLink = InstanceType<typeof ToolMarkLink>;
|
|
21
|
+
export default ToolMarkLink;
|
|
@@ -1,22 +1,37 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Editor } from '@tiptap/core'
|
|
3
|
+
import { mdiChevronDown } from '@mdi/js'
|
|
4
|
+
|
|
5
|
+
import { Icon } from '../../icon/index.js'
|
|
6
|
+
import { DropDown } from '../../menu/index.js'
|
|
7
|
+
|
|
8
|
+
type Tool = {
|
|
9
|
+
key?: string
|
|
10
|
+
attributes?: {}
|
|
11
|
+
label: string
|
|
12
|
+
icon: string
|
|
13
|
+
action: () => unknown
|
|
14
|
+
newSection?: true
|
|
15
|
+
disable?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export let editor: Editor
|
|
19
|
+
export let tools: Tool[]
|
|
20
|
+
export let hideLabel = false
|
|
21
|
+
|
|
22
|
+
let dropdown: DropDown
|
|
23
|
+
|
|
24
|
+
function handleClick(tool: Tool) {
|
|
25
|
+
tool.action()
|
|
26
|
+
dropdown.hide()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$: toolSelected =
|
|
30
|
+
tools.find((t) => {
|
|
31
|
+
if (t.key) return editor.isActive(t.key, t.attributes)
|
|
32
|
+
if (t.attributes) return editor.isActive(t.attributes)
|
|
33
|
+
return false
|
|
34
|
+
}) || tools[0]
|
|
20
35
|
</script>
|
|
21
36
|
|
|
22
37
|
<DropDown hideOnBlur bind:this={dropdown}>
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Editor } from '@tiptap/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
disable?: boolean | undefined;
|
|
14
|
-
}[];
|
|
15
|
-
hideLabel?: boolean | undefined;
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
16
12
|
};
|
|
17
|
-
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
};
|
|
20
|
-
slots: {
|
|
21
|
-
activator: {};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export type ToolMenuProps = typeof __propDef.props;
|
|
25
|
-
export type ToolMenuEvents = typeof __propDef.events;
|
|
26
|
-
export type ToolMenuSlots = typeof __propDef.slots;
|
|
27
|
-
export default class ToolMenu extends SvelteComponent<ToolMenuProps, ToolMenuEvents, ToolMenuSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
28
14
|
}
|
|
29
|
-
|
|
15
|
+
declare const ToolMenu: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
editor: Editor;
|
|
17
|
+
tools: {
|
|
18
|
+
key?: string;
|
|
19
|
+
attributes?: {};
|
|
20
|
+
label: string;
|
|
21
|
+
icon: string;
|
|
22
|
+
action: () => unknown;
|
|
23
|
+
newSection?: true;
|
|
24
|
+
disable?: boolean;
|
|
25
|
+
}[];
|
|
26
|
+
hideLabel?: boolean;
|
|
27
|
+
}, {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
}, {
|
|
30
|
+
activator: {};
|
|
31
|
+
}, {}, string>;
|
|
32
|
+
type ToolMenu = InstanceType<typeof ToolMenu>;
|
|
33
|
+
export default ToolMenu;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Editor } from '@tiptap/core'
|
|
3
|
+
import {
|
|
4
|
+
mdiAlignHorizontalLeft,
|
|
5
|
+
mdiAlignHorizontalCenter,
|
|
6
|
+
mdiAlignHorizontalRight,
|
|
7
|
+
mdiFormatIndentIncrease,
|
|
8
|
+
mdiFormatIndentDecrease,
|
|
9
|
+
} from '@mdi/js'
|
|
10
|
+
|
|
11
|
+
import ToolMenu from './ToolMenu.svelte'
|
|
12
|
+
|
|
13
|
+
export let editor: Editor
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
16
|
<ToolMenu
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Editor } from '@tiptap/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
6
12
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
};
|
|
12
|
-
export type ToolMenuAlignProps = typeof __propDef.props;
|
|
13
|
-
export type ToolMenuAlignEvents = typeof __propDef.events;
|
|
14
|
-
export type ToolMenuAlignSlots = typeof __propDef.slots;
|
|
15
|
-
export default class ToolMenuAlign extends SvelteComponent<ToolMenuAlignProps, ToolMenuAlignEvents, ToolMenuAlignSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
16
14
|
}
|
|
17
|
-
|
|
15
|
+
declare const ToolMenuAlign: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
editor: Editor;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type ToolMenuAlign = InstanceType<typeof ToolMenuAlign>;
|
|
21
|
+
export default ToolMenuAlign;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher } from 'svelte'
|
|
3
|
+
import type { Editor } from '@tiptap/core'
|
|
4
|
+
import { mdiPlus, mdiMinus, mdiImageOutline, mdiYoutube, mdiAt } from '@mdi/js'
|
|
5
|
+
|
|
6
|
+
import { Icon } from '../../icon/index.js'
|
|
7
|
+
import ToolMenu from './ToolMenu.svelte'
|
|
8
|
+
import { suggestionItems } from './suggestion.js'
|
|
9
|
+
|
|
10
|
+
export let editor: Editor
|
|
11
|
+
|
|
12
|
+
const dispatch = createEventDispatcher<{ insertMedia: void }>()
|
|
8
13
|
</script>
|
|
9
14
|
|
|
10
15
|
<ToolMenu
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Editor } from '@tiptap/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
6
12
|
};
|
|
7
|
-
|
|
8
|
-
insertMedia: CustomEvent<void>;
|
|
9
|
-
} & {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export type ToolMenuInsertProps = typeof __propDef.props;
|
|
15
|
-
export type ToolMenuInsertEvents = typeof __propDef.events;
|
|
16
|
-
export type ToolMenuInsertSlots = typeof __propDef.slots;
|
|
17
|
-
export default class ToolMenuInsert extends SvelteComponent<ToolMenuInsertProps, ToolMenuInsertEvents, ToolMenuInsertSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
18
14
|
}
|
|
19
|
-
|
|
15
|
+
declare const ToolMenuInsert: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
editor: Editor;
|
|
17
|
+
}, {
|
|
18
|
+
insertMedia: CustomEvent<void>;
|
|
19
|
+
} & {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, string>;
|
|
22
|
+
type ToolMenuInsert = InstanceType<typeof ToolMenuInsert>;
|
|
23
|
+
export default ToolMenuInsert;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Editor } from '@tiptap/core'
|
|
3
|
+
import {
|
|
4
|
+
mdiText,
|
|
5
|
+
mdiFormatListBulleted,
|
|
6
|
+
mdiFormatListNumbered,
|
|
7
|
+
mdiFormatHeader1,
|
|
8
|
+
mdiFormatHeader3,
|
|
9
|
+
mdiFormatHeader2,
|
|
10
|
+
} from '@mdi/js'
|
|
11
|
+
|
|
12
|
+
import ToolMenu from './ToolMenu.svelte'
|
|
13
|
+
|
|
14
|
+
export let editor: Editor
|
|
11
15
|
</script>
|
|
12
16
|
|
|
13
17
|
<ToolMenu
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Editor } from '@tiptap/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
6
12
|
};
|
|
7
|
-
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
};
|
|
12
|
-
export type ToolMenuNodeProps = typeof __propDef.props;
|
|
13
|
-
export type ToolMenuNodeEvents = typeof __propDef.events;
|
|
14
|
-
export type ToolMenuNodeSlots = typeof __propDef.slots;
|
|
15
|
-
export default class ToolMenuNode extends SvelteComponent<ToolMenuNodeProps, ToolMenuNodeEvents, ToolMenuNodeSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
16
14
|
}
|
|
17
|
-
|
|
15
|
+
declare const ToolMenuNode: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
editor: Editor;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type ToolMenuNode = InstanceType<typeof ToolMenuNode>;
|
|
21
|
+
export default ToolMenuNode;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Editor } from '@tiptap/core'
|
|
3
|
+
import { mdiFormatBold, mdiFormatColorFill, mdiFormatColorText, mdiFormatItalic } from '@mdi/js'
|
|
4
|
+
import { toast } from 'svelte-sonner'
|
|
5
|
+
|
|
6
|
+
import ToolMenuNode from './ToolMenuNode.svelte'
|
|
7
|
+
import ToolMark from './ToolMark.svelte'
|
|
8
|
+
import ToolMarkColor from './ToolMarkColor.svelte'
|
|
9
|
+
import ToolMarkLink from './ToolMarkLink.svelte'
|
|
10
|
+
import ToolMenuAlign from './ToolMenuAlign.svelte'
|
|
11
|
+
import ToolMenuInsert from './ToolMenuInsert.svelte'
|
|
12
|
+
|
|
13
|
+
export let editor: Editor
|
|
14
|
+
let klass = ''
|
|
15
|
+
export { klass as class }
|
|
12
16
|
</script>
|
|
13
17
|
|
|
14
18
|
<div
|
|
@@ -20,7 +24,7 @@ export { klass as class };
|
|
|
20
24
|
<div class="flex overflow-x-auto p-2">
|
|
21
25
|
<ToolMenuNode {editor} />
|
|
22
26
|
<ToolMenuAlign {editor} />
|
|
23
|
-
<div class="mx-1 my-auto h-6 border border-y-0 border-l-0"
|
|
27
|
+
<div class="mx-1 my-auto h-6 border border-y-0 border-l-0"></div>
|
|
24
28
|
|
|
25
29
|
<ToolMark
|
|
26
30
|
{editor}
|
|
@@ -50,8 +54,11 @@ export { klass as class };
|
|
|
50
54
|
setColor={(color) => editor.commands.setHighlight({ color })}
|
|
51
55
|
/>
|
|
52
56
|
|
|
53
|
-
<div class="mx-1 my-auto h-6 border border-y-0 border-l-0"
|
|
57
|
+
<div class="mx-1 my-auto h-6 border border-y-0 border-l-0"></div>
|
|
54
58
|
|
|
55
|
-
<ToolMenuInsert
|
|
59
|
+
<ToolMenuInsert
|
|
60
|
+
{editor}
|
|
61
|
+
on:insertMedia={() => toast.warning('TODO: import SelectMedia like benev.io')}
|
|
62
|
+
/>
|
|
56
63
|
</div>
|
|
57
64
|
</div>
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Editor } from '@tiptap/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
7
12
|
};
|
|
8
|
-
|
|
9
|
-
insertMedia: CustomEvent<void>;
|
|
10
|
-
} & {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {};
|
|
14
|
-
};
|
|
15
|
-
export type ToolsBarProps = typeof __propDef.props;
|
|
16
|
-
export type ToolsBarEvents = typeof __propDef.events;
|
|
17
|
-
export type ToolsBarSlots = typeof __propDef.slots;
|
|
18
|
-
export default class ToolsBar extends SvelteComponent<ToolsBarProps, ToolsBarEvents, ToolsBarSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
19
14
|
}
|
|
20
|
-
|
|
15
|
+
declare const ToolsBar: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
editor: Editor;
|
|
17
|
+
class?: string;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type ToolsBar = InstanceType<typeof ToolsBar>;
|
|
22
|
+
export default ToolsBar;
|