@junbyeol/tiptap-editor 1.0.12 → 1.0.13
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 +102 -5
- package/dist/index.cjs +38 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +3972 -3801
- package/dist/index.mjs.map +1 -1
- package/dist/types/components/custom/font-family-dropdown-menu/font-family-dropdown-menu.d.ts +9 -0
- package/dist/types/components/custom/font-family-dropdown-menu/index.d.ts +2 -0
- package/dist/types/components/custom/font-family-dropdown-menu/nanum-fonts.d.ts +31 -0
- package/dist/types/lib/fonts.d.ts +12 -0
- package/dist/types/lib/index.d.ts +3 -0
- package/dist/types/tiptap/content.d.ts +6 -0
- package/dist/types/tiptap/extensions/FontFamilyKit.d.ts +10 -0
- package/package.json +11 -13
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useTiptapEditor } from '../../../hooks/use-tiptap-editor';
|
|
2
|
+
import { ButtonProps } from '../../tiptap-ui-primitive/button';
|
|
3
|
+
export interface FontFamilyDropdownMenuProps extends Omit<ButtonProps, "type"> {
|
|
4
|
+
editor?: ReturnType<typeof useTiptapEditor>["editor"];
|
|
5
|
+
portal?: boolean;
|
|
6
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const FontFamilyDropdownMenu: import('react').ForwardRefExoticComponent<FontFamilyDropdownMenuProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export default FontFamilyDropdownMenu;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const NANUM_FONTS: readonly [{
|
|
2
|
+
readonly label: "나눔고딕";
|
|
3
|
+
readonly family: "Nanum Gothic";
|
|
4
|
+
readonly href: "https://fonts.googleapis.com/css2?family=Nanum+Gothic&display=swap";
|
|
5
|
+
}, {
|
|
6
|
+
readonly label: "나눔명조";
|
|
7
|
+
readonly family: "Nanum Myeongjo";
|
|
8
|
+
readonly href: "https://fonts.googleapis.com/css2?family=Nanum+Myeongjo&display=swap";
|
|
9
|
+
}, {
|
|
10
|
+
readonly label: "나눔바른고딕";
|
|
11
|
+
readonly family: "NanumBarunGothic";
|
|
12
|
+
readonly href: "https://hangeul.pstatic.net/hangeul_static/css/nanum-barun-gothic.css";
|
|
13
|
+
}, {
|
|
14
|
+
readonly label: "나눔스퀘어";
|
|
15
|
+
readonly family: "NanumSquare";
|
|
16
|
+
readonly href: "https://hangeul.pstatic.net/hangeul_static/css/nanum-square.css";
|
|
17
|
+
}, {
|
|
18
|
+
readonly label: "나눔스퀘어 네오";
|
|
19
|
+
readonly family: "NanumSquareNeo";
|
|
20
|
+
readonly href: "https://hangeul.pstatic.net/hangeul_static/css/nanum-square-neo.css";
|
|
21
|
+
}, {
|
|
22
|
+
readonly label: "나눔손글씨 펜";
|
|
23
|
+
readonly family: "Nanum Pen Script";
|
|
24
|
+
readonly href: "https://fonts.googleapis.com/css2?family=Nanum+Pen+Script&display=swap";
|
|
25
|
+
}];
|
|
26
|
+
export type NanumFontEntry = (typeof NANUM_FONTS)[number];
|
|
27
|
+
export declare const NANUM_FONT_LINKS: {
|
|
28
|
+
family: "Nanum Gothic" | "Nanum Myeongjo" | "NanumBarunGothic" | "NanumSquare" | "NanumSquareNeo" | "Nanum Pen Script";
|
|
29
|
+
href: "https://fonts.googleapis.com/css2?family=Nanum+Gothic&display=swap" | "https://fonts.googleapis.com/css2?family=Nanum+Myeongjo&display=swap" | "https://hangeul.pstatic.net/hangeul_static/css/nanum-barun-gothic.css" | "https://hangeul.pstatic.net/hangeul_static/css/nanum-square.css" | "https://hangeul.pstatic.net/hangeul_static/css/nanum-square-neo.css" | "https://fonts.googleapis.com/css2?family=Nanum+Pen+Script&display=swap";
|
|
30
|
+
}[];
|
|
31
|
+
export declare function NanumFontStylesheets(): import("react").JSX.Element[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type FontEntry = {
|
|
2
|
+
label: string;
|
|
3
|
+
family: string;
|
|
4
|
+
href: string;
|
|
5
|
+
};
|
|
6
|
+
export type FontLinkEntry = {
|
|
7
|
+
family: string;
|
|
8
|
+
href: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const EDITOR_FONTS: FontEntry[];
|
|
11
|
+
export declare const EDITOR_FONT_LINKS: FontLinkEntry[];
|
|
12
|
+
export declare function EditorFontStylesheets(): import("react").JSX.Element[];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { default as TiptapEditor } from '../tiptap/index';
|
|
2
2
|
export type { TiptapProps } from '../tiptap/index';
|
|
3
|
+
export { default as TiptapContent } from '../tiptap/content';
|
|
4
|
+
export type { TiptapContentProps } from '../tiptap/content';
|
|
3
5
|
export type { FileAttachmentAttributes } from '../tiptap/extensions/FileAttachment';
|
|
4
6
|
export { FileAttachment, FileAttachmentNode, } from '../tiptap/extensions/FileAttachment';
|
|
5
7
|
export { DefaultFileAttachmentComponent } from '../tiptap/extensions/DefaultFileAttachmentComponent';
|
|
8
|
+
export { EDITOR_FONTS, EDITOR_FONT_LINKS, EditorFontStylesheets, } from './fonts';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
declare module "@tiptap/core" {
|
|
3
|
+
interface Commands<ReturnType> {
|
|
4
|
+
fontFamily: {
|
|
5
|
+
setFontFamily: (family: string) => ReturnType;
|
|
6
|
+
unsetFontFamily: () => ReturnType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare const FontFamilyKit: Extension<any, any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junbyeol/tiptap-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -21,17 +21,6 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"dev": "vite",
|
|
26
|
-
"build": "tsc -b && vite build",
|
|
27
|
-
"build:lib": "vite build --config vite.lib.config.ts",
|
|
28
|
-
"prepublishOnly": "pnpm build:lib",
|
|
29
|
-
"lint": "eslint .",
|
|
30
|
-
"preview": "vite preview",
|
|
31
|
-
"prettier": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md,scss}\"",
|
|
32
|
-
"lint-staged": "lint-staged",
|
|
33
|
-
"prepare": "husky"
|
|
34
|
-
},
|
|
35
24
|
"peerDependencies": {
|
|
36
25
|
"react": "^19.0.0",
|
|
37
26
|
"react-dom": "^19.0.0",
|
|
@@ -108,5 +97,14 @@
|
|
|
108
97
|
"prettier --write",
|
|
109
98
|
"eslint --no-warn-ignored --max-warnings=0"
|
|
110
99
|
]
|
|
100
|
+
},
|
|
101
|
+
"scripts": {
|
|
102
|
+
"dev": "vite",
|
|
103
|
+
"build": "tsc -b && vite build",
|
|
104
|
+
"build:lib": "vite build --config vite.lib.config.ts",
|
|
105
|
+
"lint": "eslint .",
|
|
106
|
+
"preview": "vite preview",
|
|
107
|
+
"prettier": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md,scss}\"",
|
|
108
|
+
"lint-staged": "lint-staged"
|
|
111
109
|
}
|
|
112
|
-
}
|
|
110
|
+
}
|