tetrons 0.1.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/.hintrc +13 -0
- package/README.md +36 -0
- package/eslint.config.mjs +16 -0
- package/next.config.ts +7 -0
- package/package.json +61 -0
- package/postcss.config.mjs +5 -0
- package/public/editor-content.json +27 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon-64x64.png +0 -0
- package/public/favicon-768x768.png +0 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/next.svg +1 -0
- package/public/site.webmanifest +20 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/src/app/api/export/route.ts +0 -0
- package/src/app/api/save/route.ts +18 -0
- package/src/app/favicon-16x16.png +0 -0
- package/src/app/favicon-32x32.png +0 -0
- package/src/app/favicon-64x64.png +0 -0
- package/src/app/favicon-768x768.png +0 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +207 -0
- package/src/app/layout.tsx +47 -0
- package/src/app/page.tsx +11 -0
- package/src/components/UI/Button.tsx +0 -0
- package/src/components/UI/Dropdown.tsx +0 -0
- package/src/components/tetrons/EditorContent.tsx +210 -0
- package/src/components/tetrons/ResizableImage.ts +39 -0
- package/src/components/tetrons/ResizableImageComponent.tsx +77 -0
- package/src/components/tetrons/ResizableVideo.ts +66 -0
- package/src/components/tetrons/ResizableVideoComponent.tsx +56 -0
- package/src/components/tetrons/helpers.ts +0 -0
- package/src/components/tetrons/toolbar/ActionGroup.tsx +222 -0
- package/src/components/tetrons/toolbar/ClipboardGroup.tsx +57 -0
- package/src/components/tetrons/toolbar/FileGroup.tsx +70 -0
- package/src/components/tetrons/toolbar/FontStyleGroup.tsx +198 -0
- package/src/components/tetrons/toolbar/InsertGroup.tsx +268 -0
- package/src/components/tetrons/toolbar/ListAlignGroup.tsx +69 -0
- package/src/components/tetrons/toolbar/MiscGroup.tsx +70 -0
- package/src/components/tetrons/toolbar/TableContextMenu.tsx +91 -0
- package/src/components/tetrons/toolbar/TetronsToolbar.tsx +60 -0
- package/src/components/tetrons/toolbar/ToolbarButton.tsx +38 -0
- package/src/components/tetrons/toolbar/extensions/Comment.ts +72 -0
- package/src/components/tetrons/toolbar/extensions/Embed.ts +113 -0
- package/src/components/tetrons/toolbar/extensions/FontFamily.ts +43 -0
- package/src/components/tetrons/toolbar/extensions/FontSize.ts +43 -0
- package/src/components/tetrons/toolbar/extensions/ResizableTable.ts +16 -0
- package/src/components/tetrons/toolbar/marks/Subscript.ts +45 -0
- package/src/components/tetrons/toolbar/marks/Superscript.ts +45 -0
- package/src/index.ts +3 -0
- package/src/lib/export.ts +0 -0
- package/src/lib/tiptap-extensions.ts +0 -0
- package/src/types/dom-to-pdf.d.ts +13 -0
- package/src/types/editor.d.ts +0 -0
- package/src/types/emoji-picker.d.ts +18 -0
- package/src/types/global.d.ts +6 -0
- package/src/types/html2pdf.d.ts +1 -0
- package/src/types/tiptap-extensions.d.ts +23 -0
- package/src/utils/loadEmojiPicker.ts +12 -0
- package/tsconfig.json +41 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "@tiptap/core";
|
|
2
|
+
import { CommandChain } from "@tiptap/core";
|
|
3
|
+
|
|
4
|
+
declare module "@tiptap/core" {
|
|
5
|
+
interface Commands<ReturnType = CommandChain> {
|
|
6
|
+
subscript: {
|
|
7
|
+
toggleSubscript: () => ReturnType;
|
|
8
|
+
};
|
|
9
|
+
superscript: {
|
|
10
|
+
toggleSuperscript: () => ReturnType;
|
|
11
|
+
};
|
|
12
|
+
video: {
|
|
13
|
+
setVideo: (options: { src: string; controls?: boolean }) => ReturnType;
|
|
14
|
+
};
|
|
15
|
+
embed: {
|
|
16
|
+
setEmbed: (attributes: {
|
|
17
|
+
src: string;
|
|
18
|
+
width?: number;
|
|
19
|
+
height?: number;
|
|
20
|
+
}) => ReturnType<ReturnType<Commands["chain"]>["insertContent"]>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const loadEmojiPicker = () => {
|
|
2
|
+
if (typeof window === "undefined") return;
|
|
3
|
+
|
|
4
|
+
if (!window.EmojiButton && !document.getElementById("emoji-picker-script")) {
|
|
5
|
+
const script = document.createElement("script");
|
|
6
|
+
script.id = "emoji-picker-script";
|
|
7
|
+
script.src =
|
|
8
|
+
"https://cdn.jsdelivr.net/npm/@joeattardi/emoji-button@latest/dist/index.min.js";
|
|
9
|
+
script.async = true;
|
|
10
|
+
document.body.appendChild(script);
|
|
11
|
+
}
|
|
12
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "ESNext",
|
|
11
|
+
"moduleResolution": "Bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "preserve",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"baseUrl": ".",
|
|
18
|
+
"paths": {
|
|
19
|
+
"@/*": ["./src/*"]
|
|
20
|
+
},
|
|
21
|
+
"typeRoots": [
|
|
22
|
+
"./types",
|
|
23
|
+
"./src/types",
|
|
24
|
+
"./node_modules/@types"
|
|
25
|
+
],
|
|
26
|
+
"plugins": [
|
|
27
|
+
{
|
|
28
|
+
"name": "next"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"include": [
|
|
33
|
+
"next-env.d.ts",
|
|
34
|
+
"**/*.ts",
|
|
35
|
+
"**/*.tsx",
|
|
36
|
+
".next/types/**/*.ts",
|
|
37
|
+
"src/types/**/*.d.ts",
|
|
38
|
+
"types/**/*.d.ts"
|
|
39
|
+
],
|
|
40
|
+
"exclude": ["node_modules"]
|
|
41
|
+
}
|