@tumaet/prompt-ui-components 0.0.6 → 0.0.7
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/index.css +1044 -1
- package/package.json +2 -2
- package/dist/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.js +0 -65
- package/dist/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.js.map +0 -1
- package/dist/components/minimal-tiptap/components/image/image-edit-block.js +0 -38
- package/dist/components/minimal-tiptap/components/image/image-edit-block.js.map +0 -1
- package/dist/components/minimal-tiptap/components/image/image-edit-dialog.js +0 -12
- package/dist/components/minimal-tiptap/components/image/image-edit-dialog.js.map +0 -1
- package/dist/components/minimal-tiptap/components/link/link-edit-block.js +0 -34
- package/dist/components/minimal-tiptap/components/link/link-edit-block.js.map +0 -1
- package/dist/components/minimal-tiptap/components/link/link-edit-popover.js +0 -38
- package/dist/components/minimal-tiptap/components/link/link-edit-popover.js.map +0 -1
- package/dist/components/minimal-tiptap/components/link/link-popover-block.js +0 -28
- package/dist/components/minimal-tiptap/components/link/link-popover-block.js.map +0 -1
- package/dist/components/minimal-tiptap/components/measured-container.js +0 -16
- package/dist/components/minimal-tiptap/components/measured-container.js.map +0 -1
- package/dist/components/minimal-tiptap/components/section/five.js +0 -39
- package/dist/components/minimal-tiptap/components/section/five.js.map +0 -1
- package/dist/components/minimal-tiptap/components/section/four.js +0 -29
- package/dist/components/minimal-tiptap/components/section/four.js.map +0 -1
- package/dist/components/minimal-tiptap/components/section/mailingPlaceholders.js +0 -23
- package/dist/components/minimal-tiptap/components/section/mailingPlaceholders.js.map +0 -1
- package/dist/components/minimal-tiptap/components/section/one.js +0 -77
- package/dist/components/minimal-tiptap/components/section/one.js.map +0 -1
- package/dist/components/minimal-tiptap/components/section/three.js +0 -79
- package/dist/components/minimal-tiptap/components/section/three.js.map +0 -1
- package/dist/components/minimal-tiptap/components/section/two.js +0 -65
- package/dist/components/minimal-tiptap/components/section/two.js.map +0 -1
- package/dist/components/minimal-tiptap/components/shortcut-key.js +0 -11
- package/dist/components/minimal-tiptap/components/shortcut-key.js.map +0 -1
- package/dist/components/minimal-tiptap/components/spinner.js +0 -9
- package/dist/components/minimal-tiptap/components/spinner.js.map +0 -1
- package/dist/components/minimal-tiptap/components/toolbar-button.js +0 -15
- package/dist/components/minimal-tiptap/components/toolbar-button.js.map +0 -1
- package/dist/components/minimal-tiptap/components/toolbar-section.js +0 -27
- package/dist/components/minimal-tiptap/components/toolbar-section.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.js +0 -16
- package/dist/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/code-block-lowlight/index.js +0 -2
- package/dist/components/minimal-tiptap/extensions/code-block-lowlight/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/color/color.js +0 -20
- package/dist/components/minimal-tiptap/extensions/color/color.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/color/index.js +0 -2
- package/dist/components/minimal-tiptap/extensions/color/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/file-handler/index.js +0 -74
- package/dist/components/minimal-tiptap/extensions/file-handler/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.js +0 -16
- package/dist/components/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/horizontal-rule/index.js +0 -2
- package/dist/components/minimal-tiptap/extensions/horizontal-rule/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/image/components/image-actions.js +0 -39
- package/dist/components/minimal-tiptap/extensions/image/components/image-actions.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/image/components/image-overlay.js +0 -9
- package/dist/components/minimal-tiptap/extensions/image/components/image-overlay.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/image/components/image-view-block.js +0 -167
- package/dist/components/minimal-tiptap/extensions/image/components/image-view-block.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/image/components/resize-handle.js +0 -11
- package/dist/components/minimal-tiptap/extensions/image/components/resize-handle.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/image/hooks/use-drag-resize.js +0 -88
- package/dist/components/minimal-tiptap/extensions/image/hooks/use-drag-resize.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/image/hooks/use-image-actions.js +0 -32
- package/dist/components/minimal-tiptap/extensions/image/hooks/use-image-actions.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/image/image.js +0 -225
- package/dist/components/minimal-tiptap/extensions/image/image.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/image/index.js +0 -2
- package/dist/components/minimal-tiptap/extensions/image/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/index.js +0 -10
- package/dist/components/minimal-tiptap/extensions/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/link/index.js +0 -2
- package/dist/components/minimal-tiptap/extensions/link/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/link/link.js +0 -74
- package/dist/components/minimal-tiptap/extensions/link/link.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/reset-marks-on-enter/index.js +0 -2
- package/dist/components/minimal-tiptap/extensions/reset-marks-on-enter/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.js +0 -20
- package/dist/components/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/selection/index.js +0 -2
- package/dist/components/minimal-tiptap/extensions/selection/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/selection/selection.js +0 -31
- package/dist/components/minimal-tiptap/extensions/selection/selection.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/unset-all-marks/index.js +0 -2
- package/dist/components/minimal-tiptap/extensions/unset-all-marks/index.js.map +0 -1
- package/dist/components/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.js +0 -9
- package/dist/components/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.js.map +0 -1
- package/dist/components/minimal-tiptap/form-description-tiptap.js +0 -26
- package/dist/components/minimal-tiptap/form-description-tiptap.js.map +0 -1
- package/dist/components/minimal-tiptap/hooks/use-container-size.js +0 -44
- package/dist/components/minimal-tiptap/hooks/use-container-size.js.map +0 -1
- package/dist/components/minimal-tiptap/hooks/use-minimal-tiptap.js +0 -160
- package/dist/components/minimal-tiptap/hooks/use-minimal-tiptap.js.map +0 -1
- package/dist/components/minimal-tiptap/hooks/use-theme.js +0 -19
- package/dist/components/minimal-tiptap/hooks/use-theme.js.map +0 -1
- package/dist/components/minimal-tiptap/hooks/use-throttle.js +0 -24
- package/dist/components/minimal-tiptap/hooks/use-throttle.js.map +0 -1
- package/dist/components/minimal-tiptap/index.js +0 -2
- package/dist/components/minimal-tiptap/index.js.map +0 -1
- package/dist/components/minimal-tiptap/mailing-tiptap.js +0 -30
- package/dist/components/minimal-tiptap/mailing-tiptap.js.map +0 -1
- package/dist/components/minimal-tiptap/minimal-tiptap.js +0 -29
- package/dist/components/minimal-tiptap/minimal-tiptap.js.map +0 -1
- package/dist/components/minimal-tiptap/types.js +0 -2
- package/dist/components/minimal-tiptap/types.js.map +0 -1
- package/dist/components/minimal-tiptap/utils.js +0 -156
- package/dist/components/minimal-tiptap/utils.js.map +0 -1
- package/dist/types/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.d.ts +0 -7
- package/dist/types/components/minimal-tiptap/components/image/image-edit-block.d.ts +0 -8
- package/dist/types/components/minimal-tiptap/components/image/image-edit-dialog.d.ts +0 -8
- package/dist/types/components/minimal-tiptap/components/link/link-edit-block.d.ts +0 -9
- package/dist/types/components/minimal-tiptap/components/link/link-edit-popover.d.ts +0 -8
- package/dist/types/components/minimal-tiptap/components/link/link-popover-block.d.ts +0 -8
- package/dist/types/components/minimal-tiptap/components/measured-container.d.ts +0 -2
- package/dist/types/components/minimal-tiptap/components/section/five.d.ts +0 -12
- package/dist/types/components/minimal-tiptap/components/section/four.d.ts +0 -12
- package/dist/types/components/minimal-tiptap/components/section/mailingPlaceholders.d.ts +0 -10
- package/dist/types/components/minimal-tiptap/components/section/one.d.ts +0 -11
- package/dist/types/components/minimal-tiptap/components/section/three.d.ts +0 -9
- package/dist/types/components/minimal-tiptap/components/section/two.d.ts +0 -12
- package/dist/types/components/minimal-tiptap/components/shortcut-key.d.ts +0 -5
- package/dist/types/components/minimal-tiptap/components/spinner.d.ts +0 -5
- package/dist/types/components/minimal-tiptap/components/toolbar-button.d.ts +0 -10
- package/dist/types/components/minimal-tiptap/components/toolbar-section.d.ts +0 -16
- package/dist/types/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.d.ts +0 -2
- package/dist/types/components/minimal-tiptap/extensions/code-block-lowlight/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/color/color.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/color/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/file-handler/index.d.ts +0 -12
- package/dist/types/components/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.d.ts +0 -2
- package/dist/types/components/minimal-tiptap/extensions/horizontal-rule/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/image/components/image-actions.d.ts +0 -17
- package/dist/types/components/minimal-tiptap/extensions/image/components/image-overlay.d.ts +0 -2
- package/dist/types/components/minimal-tiptap/extensions/image/components/image-view-block.d.ts +0 -3
- package/dist/types/components/minimal-tiptap/extensions/image/components/resize-handle.d.ts +0 -6
- package/dist/types/components/minimal-tiptap/extensions/image/hooks/use-drag-resize.d.ts +0 -24
- package/dist/types/components/minimal-tiptap/extensions/image/hooks/use-image-actions.d.ts +0 -24
- package/dist/types/components/minimal-tiptap/extensions/image/image.d.ts +0 -52
- package/dist/types/components/minimal-tiptap/extensions/image/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/index.d.ts +0 -9
- package/dist/types/components/minimal-tiptap/extensions/link/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/link/link.d.ts +0 -2
- package/dist/types/components/minimal-tiptap/extensions/reset-marks-on-enter/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.d.ts +0 -2
- package/dist/types/components/minimal-tiptap/extensions/selection/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/selection/selection.d.ts +0 -3
- package/dist/types/components/minimal-tiptap/extensions/unset-all-marks/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.d.ts +0 -2
- package/dist/types/components/minimal-tiptap/form-description-tiptap.d.ts +0 -4
- package/dist/types/components/minimal-tiptap/hooks/use-container-size.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/hooks/use-minimal-tiptap.d.ts +0 -13
- package/dist/types/components/minimal-tiptap/hooks/use-theme.d.ts +0 -2
- package/dist/types/components/minimal-tiptap/hooks/use-throttle.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/index.d.ts +0 -1
- package/dist/types/components/minimal-tiptap/mailing-tiptap.d.ts +0 -13
- package/dist/types/components/minimal-tiptap/minimal-tiptap.d.ts +0 -12
- package/dist/types/components/minimal-tiptap/types.d.ts +0 -25
- package/dist/types/components/minimal-tiptap/utils.d.ts +0 -38
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Editor } from '@tiptap/react';
|
|
3
|
-
import type { toggleVariants } from '../../../../../components/ui/toggle';
|
|
4
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
5
|
-
interface SectionMailingPlaceholderProps extends VariantProps<typeof toggleVariants> {
|
|
6
|
-
editor: Editor;
|
|
7
|
-
placeholders: string[];
|
|
8
|
-
}
|
|
9
|
-
export declare const SectionMailingPlaceholders: React.FC<SectionMailingPlaceholderProps>;
|
|
10
|
-
export default SectionMailingPlaceholders;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Editor } from '@tiptap/react';
|
|
3
|
-
import type { Level } from '@tiptap/extension-heading';
|
|
4
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import type { toggleVariants } from '../../../../../components/ui/toggle';
|
|
6
|
-
interface SectionOneProps extends VariantProps<typeof toggleVariants> {
|
|
7
|
-
editor: Editor;
|
|
8
|
-
activeLevels?: Level[];
|
|
9
|
-
}
|
|
10
|
-
export declare const SectionOne: React.FC<SectionOneProps>;
|
|
11
|
-
export default SectionOne;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Editor } from '@tiptap/react';
|
|
3
|
-
import type { toggleVariants } from '../../../../../components/ui/toggle';
|
|
4
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
5
|
-
interface SectionThreeProps extends VariantProps<typeof toggleVariants> {
|
|
6
|
-
editor: Editor;
|
|
7
|
-
}
|
|
8
|
-
export declare const SectionThree: React.FC<SectionThreeProps>;
|
|
9
|
-
export default SectionThree;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Editor } from '@tiptap/react';
|
|
3
|
-
import type { toggleVariants } from '../../../../../components/ui/toggle';
|
|
4
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
5
|
-
type TextStyleAction = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'clearFormatting';
|
|
6
|
-
interface SectionTwoProps extends VariantProps<typeof toggleVariants> {
|
|
7
|
-
editor: Editor;
|
|
8
|
-
activeActions?: TextStyleAction[];
|
|
9
|
-
mainActionCount?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const SectionTwo: React.FC<SectionTwoProps>;
|
|
12
|
-
export default SectionTwo;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { TooltipContentProps } from '@radix-ui/react-tooltip';
|
|
3
|
-
import { Toggle } from '../../../../components/ui/toggle';
|
|
4
|
-
interface ToolbarButtonProps extends React.ComponentPropsWithoutRef<typeof Toggle> {
|
|
5
|
-
isActive?: boolean;
|
|
6
|
-
tooltip?: string;
|
|
7
|
-
tooltipOptions?: TooltipContentProps;
|
|
8
|
-
}
|
|
9
|
-
export declare const ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
export default ToolbarButton;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Editor } from '@tiptap/react';
|
|
3
|
-
import type { FormatAction } from '../types';
|
|
4
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import type { toggleVariants } from '../../../../components/ui/toggle';
|
|
6
|
-
interface ToolbarSectionProps extends VariantProps<typeof toggleVariants> {
|
|
7
|
-
editor: Editor;
|
|
8
|
-
actions: FormatAction[];
|
|
9
|
-
activeActions?: string[];
|
|
10
|
-
mainActionCount?: number;
|
|
11
|
-
dropdownIcon?: React.ReactNode;
|
|
12
|
-
dropdownTooltip?: string;
|
|
13
|
-
dropdownClassName?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const ToolbarSection: React.FC<ToolbarSectionProps>;
|
|
16
|
-
export default ToolbarSection;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './code-block-lowlight';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Color: import("@tiptap/core").Extension<import("@tiptap/extension-color").ColorOptions, any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './color';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Editor, Extension } from '@tiptap/react';
|
|
2
|
-
import { PluginKey } from '@tiptap/pm/state';
|
|
3
|
-
import type { FileError, FileValidationOptions } from '../../utils';
|
|
4
|
-
type FileHandlePluginOptions = {
|
|
5
|
-
key?: PluginKey;
|
|
6
|
-
editor: Editor;
|
|
7
|
-
onPaste?: (editor: Editor, files: File[], pasteContent?: string) => void;
|
|
8
|
-
onDrop?: (editor: Editor, files: File[], pos: number) => void;
|
|
9
|
-
onValidationError?: (errors: FileError[]) => void;
|
|
10
|
-
} & FileValidationOptions;
|
|
11
|
-
export declare const FileHandler: Extension<Omit<FileHandlePluginOptions, "key" | "editor">, any>;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './horizontal-rule';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface ImageActionsProps {
|
|
3
|
-
shouldMerge?: boolean;
|
|
4
|
-
isLink?: boolean;
|
|
5
|
-
onView?: () => void;
|
|
6
|
-
onDownload?: () => void;
|
|
7
|
-
onCopy?: () => void;
|
|
8
|
-
onCopyLink?: () => void;
|
|
9
|
-
}
|
|
10
|
-
interface ActionButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
|
-
icon: React.ReactNode;
|
|
12
|
-
tooltip: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const ActionWrapper: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>>;
|
|
15
|
-
export declare const ActionButton: React.MemoExoticComponent<React.ForwardRefExoticComponent<ActionButtonProps & React.RefAttributes<HTMLButtonElement>>>;
|
|
16
|
-
export declare const ImageActions: React.FC<ImageActionsProps>;
|
|
17
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type ResizeDirection = 'left' | 'right';
|
|
2
|
-
export type ElementDimensions = {
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
};
|
|
6
|
-
type HookParams = {
|
|
7
|
-
initialWidth?: number;
|
|
8
|
-
initialHeight?: number;
|
|
9
|
-
contentWidth?: number;
|
|
10
|
-
contentHeight?: number;
|
|
11
|
-
gridInterval: number;
|
|
12
|
-
minWidth: number;
|
|
13
|
-
minHeight: number;
|
|
14
|
-
maxWidth: number;
|
|
15
|
-
onDimensionsChange?: (dimensions: ElementDimensions) => void;
|
|
16
|
-
};
|
|
17
|
-
export declare function useDragResize({ initialWidth, initialHeight, contentWidth, contentHeight, gridInterval, minWidth, minHeight, maxWidth, onDimensionsChange }: HookParams): {
|
|
18
|
-
initiateResize: (direction: ResizeDirection) => (event: React.PointerEvent<HTMLDivElement>) => void;
|
|
19
|
-
isResizing: boolean;
|
|
20
|
-
updateDimensions: import("react").Dispatch<import("react").SetStateAction<ElementDimensions>>;
|
|
21
|
-
currentWidth: number;
|
|
22
|
-
currentHeight: number;
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/react';
|
|
2
|
-
import type { Node } from '@tiptap/pm/model';
|
|
3
|
-
interface UseImageActionsProps {
|
|
4
|
-
editor: Editor;
|
|
5
|
-
node: Node;
|
|
6
|
-
src: string;
|
|
7
|
-
onViewClick: (value: boolean) => void;
|
|
8
|
-
}
|
|
9
|
-
export type ImageActionHandlers = {
|
|
10
|
-
onView?: () => void;
|
|
11
|
-
onDownload?: () => void;
|
|
12
|
-
onCopy?: () => void;
|
|
13
|
-
onCopyLink?: () => void;
|
|
14
|
-
onRemoveImg?: () => void;
|
|
15
|
-
};
|
|
16
|
-
export declare const useImageActions: ({ editor, node, src, onViewClick }: UseImageActionsProps) => {
|
|
17
|
-
isLink: boolean;
|
|
18
|
-
onView: () => void;
|
|
19
|
-
onDownload: () => void;
|
|
20
|
-
onCopy: () => void;
|
|
21
|
-
onCopyLink: () => void;
|
|
22
|
-
onRemoveImg: () => void;
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { ImageOptions } from '@tiptap/extension-image';
|
|
2
|
-
import type { Editor } from '@tiptap/react';
|
|
3
|
-
import { type FileError, type FileValidationOptions } from '../../utils';
|
|
4
|
-
import type { Attrs } from '@tiptap/pm/model';
|
|
5
|
-
type ImageAction = 'download' | 'copyImage' | 'copyLink';
|
|
6
|
-
interface DownloadImageCommandProps {
|
|
7
|
-
src: string;
|
|
8
|
-
alt?: string;
|
|
9
|
-
}
|
|
10
|
-
interface ImageActionProps extends DownloadImageCommandProps {
|
|
11
|
-
action: ImageAction;
|
|
12
|
-
}
|
|
13
|
-
export type UploadReturnType = string | {
|
|
14
|
-
id: string | number;
|
|
15
|
-
src: string;
|
|
16
|
-
};
|
|
17
|
-
interface CustomImageOptions extends ImageOptions, Omit<FileValidationOptions, 'allowBase64'> {
|
|
18
|
-
uploadFn?: (file: File, editor: Editor) => Promise<UploadReturnType>;
|
|
19
|
-
onImageRemoved?: (props: Attrs) => void;
|
|
20
|
-
onActionSuccess?: (props: ImageActionProps) => void;
|
|
21
|
-
onActionError?: (error: Error, props: ImageActionProps) => void;
|
|
22
|
-
downloadImage?: (props: ImageActionProps, options: CustomImageOptions) => Promise<void>;
|
|
23
|
-
copyImage?: (props: ImageActionProps, options: CustomImageOptions) => Promise<void>;
|
|
24
|
-
copyLink?: (props: ImageActionProps, options: CustomImageOptions) => Promise<void>;
|
|
25
|
-
onValidationError?: (errors: FileError[]) => void;
|
|
26
|
-
onToggle?: (editor: Editor, files: File[], pos: number) => void;
|
|
27
|
-
}
|
|
28
|
-
declare module '@tiptap/react' {
|
|
29
|
-
interface Commands<ReturnType> {
|
|
30
|
-
setImages: {
|
|
31
|
-
setImages: (attrs: {
|
|
32
|
-
src: string | File;
|
|
33
|
-
alt?: string;
|
|
34
|
-
title?: string;
|
|
35
|
-
}[]) => ReturnType;
|
|
36
|
-
};
|
|
37
|
-
downloadImage: {
|
|
38
|
-
downloadImage: (attrs: DownloadImageCommandProps) => ReturnType;
|
|
39
|
-
};
|
|
40
|
-
copyImage: {
|
|
41
|
-
copyImage: (attrs: DownloadImageCommandProps) => ReturnType;
|
|
42
|
-
};
|
|
43
|
-
copyLink: {
|
|
44
|
-
copyLink: (attrs: DownloadImageCommandProps) => ReturnType;
|
|
45
|
-
};
|
|
46
|
-
toggleImage: {
|
|
47
|
-
toggleImage: () => ReturnType;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export declare const Image: import("@tiptap/react").Node<CustomImageOptions, any>;
|
|
52
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './image';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './code-block-lowlight';
|
|
2
|
-
export * from './color';
|
|
3
|
-
export * from './horizontal-rule';
|
|
4
|
-
export * from './image';
|
|
5
|
-
export * from './link';
|
|
6
|
-
export * from './selection';
|
|
7
|
-
export * from './unset-all-marks';
|
|
8
|
-
export * from './reset-marks-on-enter';
|
|
9
|
-
export * from './file-handler';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './link';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './reset-marks-on-enter';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './selection';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './unset-all-marks';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useContainerSize(element: HTMLElement | null): DOMRect;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/react';
|
|
2
|
-
import type { Content, UseEditorOptions } from '@tiptap/react';
|
|
3
|
-
export interface UseMinimalTiptapEditorProps extends UseEditorOptions {
|
|
4
|
-
value?: Content;
|
|
5
|
-
output?: 'html' | 'json' | 'text';
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
editorClassName?: string;
|
|
8
|
-
throttleDelay?: number;
|
|
9
|
-
onUpdate?: (content: Content) => void;
|
|
10
|
-
onBlur?: (content: Content) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const useMinimalTiptapEditor: ({ value, output, placeholder, editorClassName, throttleDelay, onUpdate, onBlur, ...props }: UseMinimalTiptapEditorProps) => Editor | null;
|
|
13
|
-
export default useMinimalTiptapEditor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useThrottle<T extends (...args: any[]) => void>(callback: T, delay: number): (...args: Parameters<T>) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './minimal-tiptap';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import './styles/index.css';
|
|
3
|
-
import type { Content } from '@tiptap/react';
|
|
4
|
-
import type { UseMinimalTiptapEditorProps } from './hooks/use-minimal-tiptap';
|
|
5
|
-
export interface MailingTiptapProps extends Omit<UseMinimalTiptapEditorProps, 'onUpdate'> {
|
|
6
|
-
value?: Content;
|
|
7
|
-
onChange?: (value: Content) => void;
|
|
8
|
-
className?: string;
|
|
9
|
-
editorContentClassName?: string;
|
|
10
|
-
placeholders: string[];
|
|
11
|
-
}
|
|
12
|
-
export declare const MailingTiptapEditor: React.ForwardRefExoticComponent<MailingTiptapProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
export default MailingTiptapEditor;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import './styles/index.css';
|
|
3
|
-
import type { Content } from '@tiptap/react';
|
|
4
|
-
import type { UseMinimalTiptapEditorProps } from './hooks/use-minimal-tiptap';
|
|
5
|
-
export interface MinimalTiptapProps extends Omit<UseMinimalTiptapEditorProps, 'onUpdate'> {
|
|
6
|
-
value?: Content;
|
|
7
|
-
onChange?: (value: Content) => void;
|
|
8
|
-
className?: string;
|
|
9
|
-
editorContentClassName?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const MinimalTiptapEditor: React.ForwardRefExoticComponent<MinimalTiptapProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
export default MinimalTiptapEditor;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/react';
|
|
2
|
-
import type { EditorView } from '@tiptap/pm/view';
|
|
3
|
-
import type { EditorState } from '@tiptap/pm/state';
|
|
4
|
-
export interface LinkProps {
|
|
5
|
-
url: string;
|
|
6
|
-
text?: string;
|
|
7
|
-
openInNewTab?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface ShouldShowProps {
|
|
10
|
-
editor: Editor;
|
|
11
|
-
view: EditorView;
|
|
12
|
-
state: EditorState;
|
|
13
|
-
oldState?: EditorState;
|
|
14
|
-
from: number;
|
|
15
|
-
to: number;
|
|
16
|
-
}
|
|
17
|
-
export interface FormatAction {
|
|
18
|
-
label: string;
|
|
19
|
-
icon?: React.ReactNode;
|
|
20
|
-
action: (editor: Editor) => void;
|
|
21
|
-
isActive: (editor: Editor) => boolean;
|
|
22
|
-
canExecute: (editor: Editor) => boolean;
|
|
23
|
-
shortcuts: string[];
|
|
24
|
-
value: string;
|
|
25
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Editor } from '@tiptap/react';
|
|
2
|
-
import type { MinimalTiptapProps } from './minimal-tiptap';
|
|
3
|
-
type ShortcutKeyResult = {
|
|
4
|
-
symbol: string;
|
|
5
|
-
readable: string;
|
|
6
|
-
};
|
|
7
|
-
export type FileError = {
|
|
8
|
-
file: File | string;
|
|
9
|
-
reason: 'type' | 'size' | 'invalidBase64' | 'base64NotAllowed';
|
|
10
|
-
};
|
|
11
|
-
export type FileValidationOptions = {
|
|
12
|
-
allowedMimeTypes: string[];
|
|
13
|
-
maxFileSize?: number;
|
|
14
|
-
allowBase64: boolean;
|
|
15
|
-
};
|
|
16
|
-
type FileInput = File | {
|
|
17
|
-
src: string | File;
|
|
18
|
-
alt?: string;
|
|
19
|
-
title?: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const isClient: () => boolean;
|
|
22
|
-
export declare const isServer: () => boolean;
|
|
23
|
-
export declare const isMacOS: () => boolean;
|
|
24
|
-
export declare const getShortcutKey: (key: string) => ShortcutKeyResult;
|
|
25
|
-
export declare const getShortcutKeys: (keys: string[]) => ShortcutKeyResult[];
|
|
26
|
-
export declare const getOutput: (editor: Editor, format: MinimalTiptapProps["output"]) => object | string;
|
|
27
|
-
export declare const isUrl: (text: string, options?: {
|
|
28
|
-
requireHostname: boolean;
|
|
29
|
-
allowBase64?: boolean;
|
|
30
|
-
}) => boolean;
|
|
31
|
-
export declare const sanitizeUrl: (url: string | null | undefined, options?: {
|
|
32
|
-
allowBase64?: boolean;
|
|
33
|
-
}) => string | undefined;
|
|
34
|
-
export declare const blobUrlToBase64: (blobUrl: string) => Promise<string>;
|
|
35
|
-
export declare const randomId: () => string;
|
|
36
|
-
export declare const fileToBase64: (file: File | Blob) => Promise<string>;
|
|
37
|
-
export declare const filterFiles: <T extends FileInput>(files: T[], options: FileValidationOptions) => [T[], FileError[]];
|
|
38
|
-
export {};
|