react-tiptap-base-editor 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/tiptap-templates/simple/simple-editor.d.ts.map +1 -1
- package/dist/components/tiptap-ui/color-text-button/color-text-button.d.ts +25 -0
- package/dist/components/tiptap-ui/color-text-button/color-text-button.d.ts.map +1 -0
- package/dist/components/tiptap-ui/color-text-button/index.d.ts +3 -0
- package/dist/components/tiptap-ui/color-text-button/index.d.ts.map +1 -0
- package/dist/components/tiptap-ui/color-text-button/use-color-text.d.ts +61 -0
- package/dist/components/tiptap-ui/color-text-button/use-color-text.d.ts.map +1 -0
- package/dist/components/tiptap-ui/color-text-popover/color-text-popover.d.ts +27 -0
- package/dist/components/tiptap-ui/color-text-popover/color-text-popover.d.ts.map +1 -0
- package/dist/components/tiptap-ui/color-text-popover/index.d.ts +2 -0
- package/dist/components/tiptap-ui/color-text-popover/index.d.ts.map +1 -0
- package/dist/index.cjs +50 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5096 -4773
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-templates/simple/simple-editor.tsx"],"names":[],"mappings":"AA+BA,OAAO,+DAA+D,CAAA;AACtE,OAAO,+DAA+D,CAAA;AACtE,OAAO,yEAAyE,CAAA;AAChF,OAAO,mDAAmD,CAAA;AAC1D,OAAO,qDAAqD,CAAA;AAC5D,OAAO,yEAAyE,CAAA;AAChF,OAAO,yDAAyD,CAAA;AAChE,OAAO,6DAA6D,CAAA;
|
|
1
|
+
{"version":3,"file":"simple-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-templates/simple/simple-editor.tsx"],"names":[],"mappings":"AA+BA,OAAO,+DAA+D,CAAA;AACtE,OAAO,+DAA+D,CAAA;AACtE,OAAO,yEAAyE,CAAA;AAChF,OAAO,mDAAmD,CAAA;AAC1D,OAAO,qDAAqD,CAAA;AAC5D,OAAO,yEAAyE,CAAA;AAChF,OAAO,yDAAyD,CAAA;AAChE,OAAO,6DAA6D,CAAA;AAyCpE,OAAO,yDAAyD,CAAA;AAwHhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,aAAa,CAAC,EAAE,CACd,IAAI,EAAE,IAAI,EACV,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,EAClD,WAAW,CAAC,EAAE,WAAW,KACtB,OAAO,CAAC,MAAM,CAAC,CAAA;CACrB,CAAA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAiIpD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { UseColorTextConfig } from '@/components/tiptap-ui/color-text-button';
|
|
3
|
+
import type { ButtonProps } from '@/components/tiptap-ui-primitive/button';
|
|
4
|
+
import '@/components/tiptap-ui/color-text-button/color-text-button.scss';
|
|
5
|
+
export interface ColorTextButtonProps extends Omit<ButtonProps, 'type'>, UseColorTextConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Optional text to display alongside the icon.
|
|
8
|
+
*/
|
|
9
|
+
text?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional show shortcut keys in the button.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
showShortcut?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function ColorTextShortcutBadge({ shortcutKeys }: {
|
|
17
|
+
shortcutKeys?: string;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Button component for applying text colors in a Tiptap editor.
|
|
21
|
+
*
|
|
22
|
+
* For custom button implementations, use the `useColorText` hook instead.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ColorTextButton: React.ForwardRefExoticComponent<ColorTextButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
//# sourceMappingURL=color-text-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-text-button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-text-button/color-text-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAA;AAOlF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAK1E,OAAO,iEAAiE,CAAA;AAExE,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,kBAAkB;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,YAAsC,EACvC,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,2CAEA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,gGAyF3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-text-button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Editor } from "@tiptap/react";
|
|
3
|
+
export declare const COLOR_TEXT_SHORTCUT_KEY = "mod+shift+c";
|
|
4
|
+
export declare const TEXT_COLORS: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
border: string;
|
|
8
|
+
}[];
|
|
9
|
+
export type TextColor = (typeof TEXT_COLORS)[number];
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for the color text functionality
|
|
12
|
+
*/
|
|
13
|
+
export interface UseColorTextConfig {
|
|
14
|
+
/**
|
|
15
|
+
* The Tiptap editor instance.
|
|
16
|
+
*/
|
|
17
|
+
editor?: Editor | null;
|
|
18
|
+
/**
|
|
19
|
+
* The color to apply when toggling the text color.
|
|
20
|
+
*/
|
|
21
|
+
textColor?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional label to display alongside the icon.
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the button should hide when the mark is not available.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
hideWhenUnavailable?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Called when the text color is applied.
|
|
33
|
+
*/
|
|
34
|
+
onApplied?: ({ color, label }: {
|
|
35
|
+
color: string;
|
|
36
|
+
label: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
}
|
|
39
|
+
export declare function pickTextColorsByValue(values: string[]): {
|
|
40
|
+
label: string;
|
|
41
|
+
value: string;
|
|
42
|
+
border: string;
|
|
43
|
+
}[];
|
|
44
|
+
export declare function canColorText(editor: Editor | null): boolean;
|
|
45
|
+
export declare function isColorTextActive(editor: Editor | null, textColor?: string): boolean;
|
|
46
|
+
export declare function removeTextColor(editor: Editor | null): boolean;
|
|
47
|
+
export declare function shouldShowButton(props: {
|
|
48
|
+
editor: Editor | null;
|
|
49
|
+
hideWhenUnavailable: boolean;
|
|
50
|
+
}): boolean;
|
|
51
|
+
export declare function useColorText(config: UseColorTextConfig): {
|
|
52
|
+
isVisible: boolean;
|
|
53
|
+
isActive: boolean;
|
|
54
|
+
handleColorText: () => false | undefined;
|
|
55
|
+
handleRemoveTextColor: () => boolean;
|
|
56
|
+
canColorText: boolean;
|
|
57
|
+
label: string;
|
|
58
|
+
shortcutKeys: string;
|
|
59
|
+
Icon: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=use-color-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-color-text.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-text-button/use-color-text.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAa3C,eAAO,MAAM,uBAAuB,gBAAgB,CAAA;AACpD,eAAO,MAAM,WAAW;;;;GAmDvB,CAAA;AACD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACzE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE;;;;IAOrD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAS3D;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAKT;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAK9D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;CAC7B,GAAG,OAAO,CAWV;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB;;;;;;;;;EAwFtD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type Editor } from '@tiptap/react';
|
|
3
|
+
import type { ButtonProps } from '@/components/tiptap-ui-primitive/button';
|
|
4
|
+
import type { TextColor, UseColorTextConfig } from '@/components/tiptap-ui/color-text-button';
|
|
5
|
+
export interface ColorTextPopoverContentProps {
|
|
6
|
+
/**
|
|
7
|
+
* The Tiptap editor instance.
|
|
8
|
+
*/
|
|
9
|
+
editor?: Editor | null;
|
|
10
|
+
/**
|
|
11
|
+
* Optional colors to use in the text color popover.
|
|
12
|
+
* If not provided, defaults to a predefined set of colors.
|
|
13
|
+
*/
|
|
14
|
+
colors?: TextColor[];
|
|
15
|
+
}
|
|
16
|
+
export interface ColorTextPopoverProps extends Omit<ButtonProps, 'type'>, Pick<UseColorTextConfig, 'editor' | 'hideWhenUnavailable' | 'onApplied'> {
|
|
17
|
+
/**
|
|
18
|
+
* Optional colors to use in the text color popover.
|
|
19
|
+
* If not provided, defaults to a predefined set of colors.
|
|
20
|
+
*/
|
|
21
|
+
colors?: TextColor[];
|
|
22
|
+
}
|
|
23
|
+
export declare const ColorTextPopoverButton: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
export declare function ColorTextPopoverContent({ editor, colors }: ColorTextPopoverContentProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function ColorTextPopover({ editor: providedEditor, colors, hideWhenUnavailable, onApplied, ...props }: ColorTextPopoverProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export default ColorTextPopover;
|
|
27
|
+
//# sourceMappingURL=color-text-popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-text-popover.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-text-popover/color-text-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAY3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAe1E,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EACnB,MAAM,0CAA0C,CAAA;AAOjD,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,qBAAqB,GAAG,WAAW,CAAC;IAC1E;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,EAAE,CAAA;CACrB;AAED,eAAO,MAAM,sBAAsB,uFAkBjC,CAAA;AAIF,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,MAME,EACH,EAAE,4BAA4B,2CAiE9B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EAAE,cAAc,EACtB,MAME,EACF,mBAA2B,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,qBAAqB,kDA+BvB;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-text-popover/index.tsx"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|