@projectfive/v-richtext-vue2 0.0.0-stage → 3.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.
Files changed (106) hide show
  1. package/Readme.md +69 -0
  2. package/dist/style.css +1 -0
  3. package/dist/types/richtext-vue/src/components/input-richtext/CharacterCount.vue.d.ts +19 -0
  4. package/dist/types/richtext-vue/src/components/input-richtext/InputRichtext.vue.d.ts +135 -0
  5. package/dist/types/richtext-vue/src/components/input-richtext/MediaControls.vue.d.ts +3 -0
  6. package/dist/types/richtext-vue/src/components/input-richtext/MentionMenu.vue.d.ts +21 -0
  7. package/dist/types/richtext-vue/src/components/input-richtext/TableMenu.vue.d.ts +19 -0
  8. package/dist/types/richtext-vue/src/components/input-richtext/TableOfContents.vue.d.ts +3 -0
  9. package/dist/types/richtext-vue/src/components/input-richtext/TemplatesMenu.vue.d.ts +18 -0
  10. package/dist/types/richtext-vue/src/components/input-richtext/UploadPopover.vue.d.ts +24 -0
  11. package/dist/types/richtext-vue/src/components/input-richtext/VisibilityConditionsMenu.vue.d.ts +20 -0
  12. package/dist/types/richtext-vue/src/components/input-richtext/YoutubePopover.vue.d.ts +4 -0
  13. package/dist/types/richtext-vue/src/components/input-richtext/extensions/file-drop.d.ts +22 -0
  14. package/dist/types/richtext-vue/src/components/input-richtext/extensions/file-node.d.ts +18 -0
  15. package/dist/types/richtext-vue/src/components/input-richtext/extensions/heading-id.d.ts +14 -0
  16. package/dist/types/richtext-vue/src/components/input-richtext/extensions/index.d.ts +36 -0
  17. package/dist/types/richtext-vue/src/components/input-richtext/extensions/link.d.ts +8 -0
  18. package/dist/types/richtext-vue/src/components/input-richtext/extensions/media-attributes.d.ts +8 -0
  19. package/dist/types/richtext-vue/src/components/input-richtext/extensions/mention-menu.d.ts +62 -0
  20. package/dist/types/richtext-vue/src/components/input-richtext/extensions/mention.d.ts +16 -0
  21. package/dist/types/richtext-vue/src/components/input-richtext/extensions/previews.d.ts +8 -0
  22. package/dist/types/richtext-vue/src/components/input-richtext/extensions/task-item.d.ts +8 -0
  23. package/dist/types/richtext-vue/src/components/input-richtext/extensions/visibility-conditions.d.ts +32 -0
  24. package/dist/types/richtext-vue/src/components/input-richtext/liquid.d.ts +11 -0
  25. package/dist/types/richtext-vue/src/components/input-richtext/types.d.ts +122 -0
  26. package/dist/types/richtext-vue/src/components/tiptap-icons/Icon.vue.d.ts +15 -0
  27. package/dist/types/richtext-vue/src/components/tiptap-icons/index.d.ts +40 -0
  28. package/dist/types/richtext-vue/src/components/tiptap-ui/CommandButton.vue.d.ts +36 -0
  29. package/dist/types/richtext-vue/src/components/tiptap-ui/blockquote-button/index.d.ts +1 -0
  30. package/dist/types/richtext-vue/src/components/tiptap-ui/blockquote-button/use-blockquote.d.ts +12 -0
  31. package/dist/types/richtext-vue/src/components/tiptap-ui/code-block-button/index.d.ts +1 -0
  32. package/dist/types/richtext-vue/src/components/tiptap-ui/code-block-button/use-code-block.d.ts +12 -0
  33. package/dist/types/richtext-vue/src/components/tiptap-ui/color-highlight-button/index.d.ts +1 -0
  34. package/dist/types/richtext-vue/src/components/tiptap-ui/color-highlight-button/use-color-highlight.d.ts +125 -0
  35. package/dist/types/richtext-vue/src/components/tiptap-ui/color-highlight-popover/ColorHighlightPopover.vue.d.ts +3 -0
  36. package/dist/types/richtext-vue/src/components/tiptap-ui/color-highlight-popover/ColorHighlightPopoverButton.vue.d.ts +17 -0
  37. package/dist/types/richtext-vue/src/components/tiptap-ui/color-highlight-popover/ColorHighlightPopoverContent.vue.d.ts +183 -0
  38. package/dist/types/richtext-vue/src/components/tiptap-ui/color-highlight-popover/index.d.ts +3 -0
  39. package/dist/types/richtext-vue/src/components/tiptap-ui/command.d.ts +26 -0
  40. package/dist/types/richtext-vue/src/components/tiptap-ui/heading-button/index.d.ts +1 -0
  41. package/dist/types/richtext-vue/src/components/tiptap-ui/heading-button/use-heading.d.ts +25 -0
  42. package/dist/types/richtext-vue/src/components/tiptap-ui/heading-dropdown-menu/HeadingDropdownMenu.vue.d.ts +32 -0
  43. package/dist/types/richtext-vue/src/components/tiptap-ui/heading-dropdown-menu/index.d.ts +2 -0
  44. package/dist/types/richtext-vue/src/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts +6 -0
  45. package/dist/types/richtext-vue/src/components/tiptap-ui/link-popover/LinkButton.vue.d.ts +17 -0
  46. package/dist/types/richtext-vue/src/components/tiptap-ui/link-popover/LinkContent.vue.d.ts +18 -0
  47. package/dist/types/richtext-vue/src/components/tiptap-ui/link-popover/LinkMain.vue.d.ts +28 -0
  48. package/dist/types/richtext-vue/src/components/tiptap-ui/link-popover/LinkPopover.vue.d.ts +62 -0
  49. package/dist/types/richtext-vue/src/components/tiptap-ui/link-popover/index.d.ts +4 -0
  50. package/dist/types/richtext-vue/src/components/tiptap-ui/link-popover/use-link-popover.d.ts +96 -0
  51. package/dist/types/richtext-vue/src/components/tiptap-ui/list-button/index.d.ts +1 -0
  52. package/dist/types/richtext-vue/src/components/tiptap-ui/list-button/use-list.d.ts +22 -0
  53. package/dist/types/richtext-vue/src/components/tiptap-ui/list-dropdown-menu/ListDropdownMenu.vue.d.ts +32 -0
  54. package/dist/types/richtext-vue/src/components/tiptap-ui/list-dropdown-menu/index.d.ts +2 -0
  55. package/dist/types/richtext-vue/src/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.d.ts +15 -0
  56. package/dist/types/richtext-vue/src/components/tiptap-ui/mark-button/index.d.ts +1 -0
  57. package/dist/types/richtext-vue/src/components/tiptap-ui/mark-button/use-mark.d.ts +29 -0
  58. package/dist/types/richtext-vue/src/components/tiptap-ui/text-align-button/index.d.ts +1 -0
  59. package/dist/types/richtext-vue/src/components/tiptap-ui/text-align-button/use-text-align.d.ts +27 -0
  60. package/dist/types/richtext-vue/src/components/tiptap-ui/undo-redo-button/index.d.ts +1 -0
  61. package/dist/types/richtext-vue/src/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts +17 -0
  62. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/button/Button.vue.d.ts +53 -0
  63. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/button/index.d.ts +1 -0
  64. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/button-group/ButtonGroup.vue.d.ts +43 -0
  65. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/button-group/index.d.ts +1 -0
  66. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/card/Card.vue.d.ts +16 -0
  67. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/card/CardBody.vue.d.ts +15 -0
  68. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/card/CardItemGroup.vue.d.ts +42 -0
  69. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/card/index.d.ts +3 -0
  70. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/dropdown-menu/DropdownMenu.vue.d.ts +66 -0
  71. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/dropdown-menu/index.d.ts +1 -0
  72. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/input/Input.vue.d.ts +20 -0
  73. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/input/index.d.ts +1 -0
  74. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/popover/Popover.vue.d.ts +65 -0
  75. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/popover/index.d.ts +1 -0
  76. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/separator/Separator.vue.d.ts +35 -0
  77. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/separator/index.d.ts +1 -0
  78. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/spacer/Spacer.vue.d.ts +31 -0
  79. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/spacer/index.d.ts +1 -0
  80. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/toolbar/Toolbar.vue.d.ts +45 -0
  81. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/toolbar/ToolbarGroup.vue.d.ts +15 -0
  82. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/toolbar/ToolbarSeparator.vue.d.ts +3 -0
  83. package/dist/types/richtext-vue/src/components/tiptap-ui-primitive/toolbar/index.d.ts +3 -0
  84. package/dist/types/richtext-vue/src/composables/use-editor-state.d.ts +32 -0
  85. package/dist/types/richtext-vue/src/composables/use-is-breakpoint.d.ts +10 -0
  86. package/dist/types/richtext-vue/src/composables/use-menu-navigation.d.ts +55 -0
  87. package/dist/types/richtext-vue/src/composables/use-popover.d.ts +45 -0
  88. package/dist/types/richtext-vue/src/composables/use-tiptap-editor.d.ts +16 -0
  89. package/dist/types/richtext-vue/src/composables/use-top-layer.d.ts +9 -0
  90. package/dist/types/richtext-vue/src/composables/use-translations.d.ts +7 -0
  91. package/dist/types/richtext-vue/src/composables/utils.d.ts +21 -0
  92. package/dist/types/richtext-vue/src/index.d.ts +14 -0
  93. package/dist/types/richtext-vue/src/lib/pointer.d.ts +6 -0
  94. package/dist/types/richtext-vue/src/lib/resize-image.d.ts +6 -0
  95. package/dist/types/richtext-vue/src/lib/shortcuts.d.ts +24 -0
  96. package/dist/types/richtext-vue/src/lib/throttle.d.ts +10 -0
  97. package/dist/types/richtext-vue/src/lib/tiptap-utils.d.ts +109 -0
  98. package/dist/types/richtext-vue/src/locales/en.d.ts +140 -0
  99. package/dist/types/richtext-vue/src/locales/index.d.ts +5 -0
  100. package/dist/types/richtext-vue/src/locales/nl.d.ts +2 -0
  101. package/dist/types/richtext-vue2/src/components/tiptap-ui-primitive/portal/Portal.vue.d.ts +15 -0
  102. package/dist/types/richtext-vue2/src/lib/tiptap-vue.d.ts +9 -0
  103. package/dist/v-richtext.js +3318 -0
  104. package/dist/v-richtext.js.map +1 -0
  105. package/package.json +64 -6
  106. package/README.md +0 -3
@@ -0,0 +1,45 @@
1
+ import { type Ref } from "vue";
2
+ export type PopoverAlign = "start" | "center" | "end";
3
+ export interface UsePopoverOptions {
4
+ open: () => boolean;
5
+ setOpen: (open: boolean) => void;
6
+ align?: () => PopoverAlign;
7
+ sideOffset?: () => number;
8
+ }
9
+ /**
10
+ * Shared logic for Popover and DropdownMenu, built on the native `popover`
11
+ * attribute and CSS anchor positioning instead of Radix.
12
+ *
13
+ * - The trigger gets `popovertarget`, so the browser handles toggling, light
14
+ * dismiss (click outside) and Escape.
15
+ * - `open` stays controllable: the `toggle` event syncs the browser's state
16
+ * back, and changing `open` programmatically calls show/hidePopover.
17
+ * - Browsers without anchor positioning get a one-off position on open.
18
+ * - An `[autofocus]` element inside the content is focused once it is shown.
19
+ */
20
+ export declare function usePopover({ open, setOpen, align, sideOffset, }: UsePopoverOptions): {
21
+ id: string;
22
+ contentRef: Ref<HTMLElement | null>;
23
+ triggerAttrs: import("vue").ComputedRef<{
24
+ popovertarget: string;
25
+ "aria-controls": string;
26
+ "aria-expanded": string;
27
+ "data-state": string;
28
+ style: {
29
+ anchorName: string;
30
+ };
31
+ }>;
32
+ contentAttrs: import("vue").ComputedRef<{
33
+ id: string;
34
+ popover: string;
35
+ "data-state": string;
36
+ "data-side": string;
37
+ "data-align": PopoverAlign;
38
+ style: {
39
+ positionAnchor: string;
40
+ "--tt-popover-offset": string;
41
+ };
42
+ }>;
43
+ onToggle: (event: Event) => void;
44
+ close: () => void;
45
+ };
@@ -0,0 +1,16 @@
1
+ import type { Editor } from "@tiptap/core";
2
+ import { type ComputedRef, type Ref } from "vue";
3
+ import { type MaybeGetter } from "@/composables/utils";
4
+ /**
5
+ * Makes the editor available to every tiptap-ui component below this one.
6
+ * Replaces the React template's `EditorContext.Provider`.
7
+ */
8
+ export declare function provideTiptapEditor(editor: Ref<Editor | null | undefined>): void;
9
+ /**
10
+ * Returns the editor passed in explicitly (e.g. an `editor` prop), falling
11
+ * back to the one provided by the nearest `provideTiptapEditor`.
12
+ *
13
+ * Unlike the React hook this does not re-render on every transaction; use
14
+ * `useEditorState` to select the bits of state a component needs.
15
+ */
16
+ export declare function useTiptapEditor(providedEditor?: MaybeGetter<Editor | null | undefined>): ComputedRef<Editor | null>;
@@ -0,0 +1,9 @@
1
+ import { type Ref } from "vue";
2
+ /**
3
+ * p5: shows an element with `popover="manual"` in the browser's top layer as
4
+ * soon as it's rendered, so it isn't hidden behind modal <dialog>s or a
5
+ * fullscreen element (which are in the top layer too). `onShown` runs
6
+ * afterwards, e.g. to measure it: a popover has no size until it's shown.
7
+ * Without popover support the element simply stays where it is.
8
+ */
9
+ export declare function useTopLayer(element: Ref<HTMLElement | null>, onShown?: () => void): void;
@@ -0,0 +1,7 @@
1
+ import { type ComputedRef } from "vue";
2
+ import { type RichtextMessages } from "@/locales";
3
+ import type { RichtextLocale } from "@/components/input-richtext/types";
4
+ /** p5: makes the texts for `locale` available to all components below */
5
+ export declare function provideTranslations(locale: () => RichtextLocale | undefined): ComputedRef<RichtextMessages>;
6
+ /** The texts of the surrounding editor's locale, or the default locale */
7
+ export declare function useTranslations(): ComputedRef<RichtextMessages>;
@@ -0,0 +1,21 @@
1
+ import { type Ref } from "vue";
2
+ /**
3
+ * A plain value, a ref, or a getter. Lets composables accept reactive props
4
+ * (`() => props.type`) as well as static values.
5
+ *
6
+ * Deliberately not Vue's `MaybeRefOrGetter`/`toValue` (Vue 3.3+), so this also
7
+ * works on Vue 2.7 should we ever port back.
8
+ */
9
+ export type MaybeGetter<T> = T | Ref<T> | (() => T);
10
+ /**
11
+ * A config object whose values may be getters, except callbacks (`on*`),
12
+ * which are passed through as-is.
13
+ */
14
+ export type MaybeGetters<T> = {
15
+ [K in keyof T]: K extends `on${string}` ? T[K] : MaybeGetter<T[K]>;
16
+ };
17
+ export declare function resolveValue<T>(value: MaybeGetter<T>): T;
18
+ /**
19
+ * Compares primitives with Object.is and plain objects/arrays one level deep.
20
+ */
21
+ export declare function shallowEqual(a: unknown, b: unknown): boolean;
@@ -0,0 +1,14 @@
1
+ import InputRichtext from "./components/input-richtext/InputRichtext.vue";
2
+ export { InputRichtext };
3
+ export { addLiquidConditions, stripLiquidConditions, } from "./components/input-richtext/liquid";
4
+ export type * from "./components/input-richtext/types";
5
+ /**
6
+ * Registers <InputRichtext> globally: `app.use(RichtextPlugin)`.
7
+ * Or import `InputRichtext` and register it locally.
8
+ */
9
+ export declare const RichtextPlugin: {
10
+ install(app: {
11
+ component: (name: string, component: any) => unknown;
12
+ }): void;
13
+ };
14
+ export default RichtextPlugin;
@@ -0,0 +1,6 @@
1
+ export declare const isPointerDown: () => boolean;
2
+ /**
3
+ * Runs `callback` once the current pointer press has fully ended, including
4
+ * the click it causes: the timeout lets the browser dispatch that first.
5
+ */
6
+ export declare function afterPointerRelease(callback: () => void): void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * p5: scales an image down to `maxWidth` (keeping its ratio) before it's
3
+ * uploaded. Returns the file itself when it's already narrow enough, isn't a
4
+ * resizable format, or can't be decoded.
5
+ */
6
+ export declare function resizeImage(file: File, maxWidth: number): Promise<File>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * p5: keyboard shortcuts handled by InputRichtext, on top of Tiptap's own
3
+ * (bold, lists, headings, …). Buttons that open a popover or menu carry
4
+ * `data-rt-shortcut`, and InputRichtext clicks them on a matching key press.
5
+ */
6
+ export declare const SHORTCUTS: {
7
+ readonly focusToolbar: "alt+f10";
8
+ readonly clearFormatting: "mod+\\";
9
+ readonly link: "mod+k";
10
+ readonly highlight: "mod+shift+h";
11
+ readonly image: "mod+alt+i";
12
+ readonly file: "mod+alt+f";
13
+ readonly table: "mod+alt+t";
14
+ readonly visibilityCondition: "mod+alt+v";
15
+ };
16
+ /**
17
+ * Whether a keydown matches e.g. "mod+shift+h" ("mod" is Ctrl, or ⌘ on Mac).
18
+ *
19
+ * Compares `event.key`, so AltGr characters don't trigger Ctrl+Alt shortcuts:
20
+ * on Windows AltGr is Ctrl+Alt, and on e.g. US-International AltGr+I types "í"
21
+ * (event.key "í", not "i"). On Mac, Option changes event.key too (Option+I is a
22
+ * dead key), so letters fall back to event.code there.
23
+ */
24
+ export declare function matchesShortcut(event: KeyboardEvent, keys: string): boolean;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Calls `fn` at most once per `wait` ms: right away, then once more at the end
3
+ * of the wait if it was called again in the meantime (lodash's defaults).
4
+ * p5: replaces lodash.throttle, which was the only use of that dependency.
5
+ */
6
+ export declare function throttle(fn: () => void, wait: number): {
7
+ (): void;
8
+ flush(): void;
9
+ cancel(): void;
10
+ };
@@ -0,0 +1,109 @@
1
+ import type { Node as PMNode } from "@tiptap/pm/model";
2
+ import type { Editor } from "@tiptap/core";
3
+ export declare const MAX_FILE_SIZE: number;
4
+ export declare const MAC_SYMBOLS: Record<string, string>;
5
+ /**
6
+ * Determines if the current platform is macOS
7
+ * @returns boolean indicating if the current platform is Mac
8
+ */
9
+ export declare function isMac(): boolean;
10
+ /**
11
+ * Formats a shortcut key based on the platform (Mac or non-Mac)
12
+ * @param key - The key to format (e.g., "ctrl", "alt", "shift")
13
+ * @param isMac - Boolean indicating if the platform is Mac
14
+ * @param capitalize - Whether to capitalize the key (default: true)
15
+ * @returns Formatted shortcut key symbol
16
+ */
17
+ export declare const formatShortcutKey: (key: string, isMac: boolean, capitalize?: boolean) => string;
18
+ /**
19
+ * Parses a shortcut key string into an array of formatted key symbols
20
+ * @param shortcutKeys - The string of shortcut keys (e.g., "ctrl-alt-shift")
21
+ * @param delimiter - The delimiter used to split the keys (default: "-")
22
+ * @param capitalize - Whether to capitalize the keys (default: true)
23
+ * @returns Array of formatted shortcut key symbols
24
+ */
25
+ export declare const parseShortcutKeys: (props: {
26
+ shortcutKeys: string | undefined;
27
+ delimiter?: string;
28
+ capitalize?: boolean;
29
+ }) => string[];
30
+ /**
31
+ * Checks if a mark exists in the editor schema
32
+ * @param markName - The name of the mark to check
33
+ * @param editor - The editor instance
34
+ * @returns boolean indicating if the mark exists in the schema
35
+ */
36
+ export declare const isMarkInSchema: (markName: string, editor: Editor | null) => boolean;
37
+ /**
38
+ * Checks if a node exists in the editor schema
39
+ * @param nodeName - The name of the node to check
40
+ * @param editor - The editor instance
41
+ * @returns boolean indicating if the node exists in the schema
42
+ */
43
+ export declare const isNodeInSchema: (nodeName: string, editor: Editor | null) => boolean;
44
+ /**
45
+ * Checks if a value is a valid number (not null, undefined, or NaN)
46
+ * @param value - The value to check
47
+ * @returns boolean indicating if the value is a valid number
48
+ */
49
+ export declare function isValidPosition(pos: number | null | undefined): pos is number;
50
+ export declare function isExtensionAvailable(editor: Editor | null, extensionNames: string | string[]): boolean;
51
+ /**
52
+ * Finds a node at the specified position with error handling
53
+ * @param editor The Tiptap editor instance
54
+ * @param position The position in the document to find the node
55
+ * @returns The node at the specified position, or null if not found
56
+ */
57
+ export declare function findNodeAtPosition(editor: Editor, position: number): PMNode | null;
58
+ /**
59
+ * Finds the position and instance of a node in the document
60
+ * @param props Object containing editor, node (optional), and nodePos (optional)
61
+ * @param props.editor The Tiptap editor instance
62
+ * @param props.node The node to find (optional if nodePos is provided)
63
+ * @param props.nodePos The position of the node to find (optional if node is provided)
64
+ * @returns An object with the position and node, or null if not found
65
+ */
66
+ export declare function findNodePosition(props: {
67
+ editor: Editor | null;
68
+ node?: PMNode | null;
69
+ nodePos?: number | null;
70
+ }): {
71
+ pos: number;
72
+ node: PMNode;
73
+ } | null;
74
+ /**
75
+ * Determines whether the current selection contains a node whose type matches
76
+ * any of the provided node type names.
77
+ * @param editor Tiptap editor instance
78
+ * @param nodeTypeNames List of node type names to match against
79
+ * @param checkAncestorNodes Whether to check ancestor node types up the depth chain
80
+ */
81
+ export declare function isNodeTypeSelected(editor: Editor | null, nodeTypeNames?: string[], checkAncestorNodes?: boolean): boolean;
82
+ /**
83
+ * Check whether the current selection is fully within nodes
84
+ * whose type names are in the provided `types` list.
85
+ *
86
+ * - NodeSelection → checks the selected node.
87
+ * - Text/AllSelection → ensures all textblocks within [from, to) are allowed.
88
+ */
89
+ export declare function selectionWithinConvertibleTypes(editor: Editor, types?: string[]): boolean;
90
+ type ProtocolOptions = {
91
+ /**
92
+ * The protocol scheme to be registered.
93
+ * @default '''
94
+ * @example 'ftp'
95
+ * @example 'git'
96
+ */
97
+ scheme: string;
98
+ /**
99
+ * If enabled, it allows optional slashes after the protocol.
100
+ * @default false
101
+ * @example true
102
+ */
103
+ optionalSlashes?: boolean;
104
+ };
105
+ type ProtocolConfig = Array<ProtocolOptions | string>;
106
+ export declare function isAllowedUri(uri: string | undefined, protocols?: ProtocolConfig): true | RegExpMatchArray | null;
107
+ export declare function sanitizeUrl(inputUrl: string, baseUrl: string, protocols?: ProtocolConfig): string;
108
+ export declare function getSelectedBlockNodes(editor: Editor): PMNode[];
109
+ export {};
@@ -0,0 +1,140 @@
1
+ /**
2
+ * English texts. Also defines the shape of every locale: a text missing in
3
+ * another locale is a type error.
4
+ */
5
+ export declare const en: {
6
+ placeholder: string;
7
+ toolbar: string;
8
+ tableOfContents: string;
9
+ back: string;
10
+ undo: string;
11
+ redo: string;
12
+ marks: {
13
+ bold: string;
14
+ italic: string;
15
+ strike: string;
16
+ underline: string;
17
+ code: string;
18
+ superscript: string;
19
+ subscript: string;
20
+ };
21
+ heading: {
22
+ button: string;
23
+ menu: string;
24
+ level: (level: number) => string;
25
+ };
26
+ list: {
27
+ button: string;
28
+ menu: string;
29
+ bulletList: string;
30
+ orderedList: string;
31
+ taskList: string;
32
+ /** Screen reader label of a task's checkbox */
33
+ taskCheckbox: (text: string) => string;
34
+ };
35
+ blockquote: string;
36
+ codeBlock: string;
37
+ align: {
38
+ left: string;
39
+ center: string;
40
+ right: string;
41
+ justify: string;
42
+ };
43
+ highlight: {
44
+ button: string;
45
+ menu: string;
46
+ remove: string;
47
+ colors: {
48
+ default: string;
49
+ gray: string;
50
+ brown: string;
51
+ orange: string;
52
+ yellow: string;
53
+ green: string;
54
+ blue: string;
55
+ purple: string;
56
+ pink: string;
57
+ red: string;
58
+ };
59
+ };
60
+ link: {
61
+ button: string;
62
+ placeholder: string;
63
+ apply: string;
64
+ newTab: string;
65
+ open: string;
66
+ remove: string;
67
+ };
68
+ image: {
69
+ button: string;
70
+ choose: string;
71
+ open: string;
72
+ remove: string;
73
+ add: string;
74
+ };
75
+ file: {
76
+ button: string;
77
+ choose: string;
78
+ open: string;
79
+ remove: string;
80
+ add: string;
81
+ };
82
+ upload: {
83
+ pasteLink: string;
84
+ orPasteLink: string;
85
+ uploading: string;
86
+ uploadingFile: (name: string) => string;
87
+ dismiss: string;
88
+ failed: string;
89
+ tooLarge: (megabytes: number) => string;
90
+ };
91
+ youtube: {
92
+ button: string;
93
+ placeholder: string;
94
+ add: string;
95
+ remove: string;
96
+ invalid: string;
97
+ };
98
+ table: {
99
+ button: string;
100
+ insert: string;
101
+ addRowBefore: string;
102
+ addRowAfter: string;
103
+ deleteRow: string;
104
+ addColumnBefore: string;
105
+ addColumnAfter: string;
106
+ deleteColumn: string;
107
+ toggleHeaderRow: string;
108
+ mergeOrSplit: string;
109
+ delete: string;
110
+ };
111
+ templates: {
112
+ button: string;
113
+ };
114
+ visibilityConditions: {
115
+ button: string;
116
+ remove: string;
117
+ hidden: (label: string) => string;
118
+ };
119
+ media: {
120
+ toolbar: string;
121
+ caption: string;
122
+ small: string;
123
+ medium: string;
124
+ large: string;
125
+ floatLeft: string;
126
+ floatNone: string;
127
+ floatRight: string;
128
+ };
129
+ mentions: {
130
+ noResults: string;
131
+ };
132
+ characterCount: {
133
+ count: (count: number) => string;
134
+ atLeast: (min: number) => string;
135
+ };
136
+ validation: {
137
+ minCharacters: (min: number, current: number) => string;
138
+ };
139
+ };
140
+ export type RichtextMessages = typeof en;
@@ -0,0 +1,5 @@
1
+ import { type RichtextMessages } from "./en";
2
+ import type { RichtextLocale } from "@/components/input-richtext/types";
3
+ export type { RichtextMessages };
4
+ export declare const DEFAULT_LOCALE: RichtextLocale;
5
+ export declare const locales: Record<RichtextLocale, RichtextMessages>;
@@ -0,0 +1,2 @@
1
+ import type { RichtextMessages } from "./en";
2
+ export declare const nl: RichtextMessages;
@@ -0,0 +1,15 @@
1
+ declare const __VLS_template: () => {
2
+ __VLS_Slots: {
3
+ default?: (props: {}) => any;
4
+ };
5
+ };
6
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
7
+ declare const __VLS_base: import("vue").DefineComponent<{}, unknown, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,9 @@
1
+ import { Editor, EditorContent } from "@tiptap/vue-2";
2
+ import type { EditorOptions } from "@tiptap/core";
3
+ /**
4
+ * Vue 2 version of ../../../richtext-vue/src/lib/tiptap-vue.ts. @tiptap/vue-2
5
+ * has no `useEditor`, so this is the same as @tiptap/vue-3's: the editor is
6
+ * created on mount and destroyed on unmount.
7
+ */
8
+ export declare function useEditor(options?: Partial<EditorOptions>): import("vue").ShallowRef<Editor | undefined>;
9
+ export { EditorContent };