doccraft 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.
Files changed (64) hide show
  1. package/README.md +84 -0
  2. package/dist/blocks/base-styles.d.ts +6 -0
  3. package/dist/blocks/for-block/extension.d.ts +16 -0
  4. package/dist/blocks/for-block/index.d.ts +2 -0
  5. package/dist/blocks/for-block/styles.d.ts +2 -0
  6. package/dist/blocks/for-block/view.d.ts +2 -0
  7. package/dist/blocks/if-block/extension.d.ts +11 -0
  8. package/dist/blocks/if-block/index.d.ts +2 -0
  9. package/dist/blocks/if-block/styles.d.ts +2 -0
  10. package/dist/blocks/if-block/view.d.ts +2 -0
  11. package/dist/blocks/index.d.ts +5 -0
  12. package/dist/blocks/readonly-block/extension.d.ts +12 -0
  13. package/dist/blocks/readonly-block/index.d.ts +2 -0
  14. package/dist/blocks/readonly-block/styles.d.ts +2 -0
  15. package/dist/blocks/readonly-block/view.d.ts +2 -0
  16. package/dist/blocks/types.d.ts +47 -0
  17. package/dist/canvas/HeaderFooterField.d.ts +11 -0
  18. package/dist/canvas/PageCanvas.d.ts +16 -0
  19. package/dist/canvas/canvas-config.d.ts +25 -0
  20. package/dist/core/DocCraft.d.ts +54 -0
  21. package/dist/core/page-flow-plugin.d.ts +22 -0
  22. package/dist/core/use-editor.d.ts +14 -0
  23. package/dist/doccraft.cjs +1006 -0
  24. package/dist/doccraft.cjs.map +1 -0
  25. package/dist/doccraft.css +2 -0
  26. package/dist/doccraft.js +53090 -0
  27. package/dist/doccraft.js.map +1 -0
  28. package/dist/extensions/TemplateVariableView.d.ts +2 -0
  29. package/dist/extensions/page-break.d.ts +9 -0
  30. package/dist/extensions/paste-handler.d.ts +14 -0
  31. package/dist/extensions/resizable-image.d.ts +15 -0
  32. package/dist/extensions/template-variable.d.ts +21 -0
  33. package/dist/hooks/use-block-styles.d.ts +7 -0
  34. package/dist/image/HfResizableImage.d.ts +2 -0
  35. package/dist/image/ImageCropOverlay.d.ts +14 -0
  36. package/dist/image/ImageNodeView.d.ts +2 -0
  37. package/dist/index.d.ts +13 -0
  38. package/dist/pdf-C0490ZCf.js +15393 -0
  39. package/dist/pdf-C0490ZCf.js.map +1 -0
  40. package/dist/pdf-DDIBR0qz.cjs +12 -0
  41. package/dist/pdf-DDIBR0qz.cjs.map +1 -0
  42. package/dist/table/TableControls.d.ts +6 -0
  43. package/dist/toolbar/BubbleToolbar.d.ts +6 -0
  44. package/dist/toolbar/EditorActions.d.ts +25 -0
  45. package/dist/toolbar/EditorToolbar.d.ts +17 -0
  46. package/dist/toolbar/toolbar-config.d.ts +3 -0
  47. package/dist/types.d.ts +35 -0
  48. package/dist/ui/button.d.ts +8 -0
  49. package/dist/ui/card.d.ts +11 -0
  50. package/dist/ui/dialog.d.ts +17 -0
  51. package/dist/ui/dropdown-menu.d.ts +29 -0
  52. package/dist/ui/input.d.ts +3 -0
  53. package/dist/ui/label.d.ts +3 -0
  54. package/dist/ui/popover.d.ts +9 -0
  55. package/dist/ui/separator.d.ts +3 -0
  56. package/dist/ui/toggle-group.d.ts +10 -0
  57. package/dist/ui/toggle.d.ts +8 -0
  58. package/dist/ui/tooltip.d.ts +6 -0
  59. package/dist/utils/cn.d.ts +2 -0
  60. package/dist/utils/export-html.d.ts +39 -0
  61. package/dist/utils/image-utils.d.ts +8 -0
  62. package/dist/utils/import-docx.d.ts +20 -0
  63. package/dist/utils/import-pdf.d.ts +19 -0
  64. package/package.json +93 -0
@@ -0,0 +1,6 @@
1
+ import type { Editor } from '@tiptap/react';
2
+ interface TableControlsProps {
3
+ editor: Editor;
4
+ }
5
+ export declare function TableControls({ editor }: TableControlsProps): import("react/jsx-runtime").JSX.Element | null;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { Editor } from '@tiptap/react';
2
+ interface BubbleToolbarProps {
3
+ editor: Editor;
4
+ }
5
+ export declare function BubbleToolbar({ editor }: BubbleToolbarProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { DocCraftRef } from '../core/DocCraft';
2
+ export interface EditorActionsConfig {
3
+ /** Enable/disable individual actions. All enabled by default. */
4
+ import?: boolean;
5
+ preview?: boolean;
6
+ print?: boolean;
7
+ export?: boolean;
8
+ /** Lifecycle hooks */
9
+ onBeforeImport?: (file: File) => boolean | Promise<boolean>;
10
+ onAfterImport?: (html: string, file: File) => void;
11
+ onBeforePreview?: () => boolean;
12
+ onAfterPreview?: (html: string) => void;
13
+ onBeforePrint?: () => boolean;
14
+ onAfterPrint?: () => void;
15
+ onBeforeExport?: (format: 'html' | 'markdown' | 'clipboard') => boolean;
16
+ onAfterExport?: (content: string, format: 'html' | 'markdown' | 'clipboard') => void;
17
+ }
18
+ interface EditorActionsProps {
19
+ config: EditorActionsConfig;
20
+ editorRef: React.RefObject<DocCraftRef | null>;
21
+ readOnly: boolean;
22
+ onToggleReadOnly: () => void;
23
+ }
24
+ export declare function EditorActions({ config, editorRef, readOnly, onToggleReadOnly }: EditorActionsProps): import("react/jsx-runtime").JSX.Element | null;
25
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { Editor } from '@tiptap/react';
2
+ import type { EditorBlockPlugin } from '../blocks/types';
3
+ import type { ToolbarFeature, TemplateVariable } from '../types';
4
+ interface EditorToolbarProps {
5
+ editor: Editor | null;
6
+ variables?: TemplateVariable[];
7
+ onAddVariable?: (name: string) => void;
8
+ blocks?: EditorBlockPlugin[];
9
+ /** Extra actions rendered at the right side of the toolbar */
10
+ actions?: React.ReactNode;
11
+ /** When true, all formatting controls are disabled */
12
+ readOnly?: boolean;
13
+ /** Set of toolbar features to display. When undefined, all features are shown. */
14
+ features?: Set<ToolbarFeature>;
15
+ }
16
+ export declare function EditorToolbar({ editor, variables, onAddVariable, blocks, actions, readOnly, features }: EditorToolbarProps): import("react/jsx-runtime").JSX.Element | null;
17
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { ToolbarFeature, ToolbarConfig } from '../types';
2
+ export declare const TOOLBAR_PRESETS: Record<string, ToolbarFeature[]>;
3
+ export declare function resolveToolbar(toolbar: string | ToolbarConfig | undefined): Set<ToolbarFeature>;
@@ -0,0 +1,35 @@
1
+ export interface TemplateVariable {
2
+ key: string;
3
+ label?: string;
4
+ }
5
+ export interface ThemeConfig {
6
+ fontFamily?: string;
7
+ fontSize?: string;
8
+ lineHeight?: string;
9
+ textColor?: string;
10
+ canvasBackground?: string;
11
+ pageBackground?: string;
12
+ }
13
+ export interface ExtensionsConfig {
14
+ add?: any[];
15
+ remove?: string[];
16
+ configure?: Record<string, any>;
17
+ }
18
+ export type ToolbarFeature = 'undo' | 'redo' | 'heading' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'subscript' | 'superscript' | 'color' | 'highlight' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'bulletList' | 'orderedList' | 'taskList' | 'indent' | 'outdent' | 'link' | 'table' | 'image' | 'horizontalRule' | 'pageBreak' | 'blockquote' | 'codeBlock' | 'variables' | 'blocks';
19
+ export interface ToolbarConfig {
20
+ preset?: 'full' | 'minimal' | 'document';
21
+ enable?: ToolbarFeature[];
22
+ disable?: ToolbarFeature[];
23
+ }
24
+ export interface CanvasConfig {
25
+ width: string;
26
+ height?: string;
27
+ padding?: {
28
+ top: string;
29
+ right: string;
30
+ bottom: string;
31
+ left: string;
32
+ };
33
+ paginate?: boolean;
34
+ pageGap?: number;
35
+ }
@@ -0,0 +1,8 @@
1
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
8
+ export { Button, buttonVariants };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
3
+ size?: "default" | "sm";
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
6
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
10
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
11
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
3
+ declare function Dialog({ ...props }: DialogPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
4
+ declare function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
5
+ declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
6
+ declare function DialogClose({ ...props }: DialogPrimitive.Close.Props): import("react/jsx-runtime").JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): import("react/jsx-runtime").JSX.Element;
8
+ declare function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
9
+ showCloseButton?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
13
+ showCloseButton?: boolean;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): import("react/jsx-runtime").JSX.Element;
16
+ declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): import("react/jsx-runtime").JSX.Element;
17
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu";
3
+ declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
4
+ declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
5
+ declare function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
6
+ declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react/jsx-runtime").JSX.Element;
7
+ declare function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props): import("react/jsx-runtime").JSX.Element;
8
+ declare function DropdownMenuLabel({ className, inset, ...props }: MenuPrimitive.GroupLabel.Props & {
9
+ inset?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: MenuPrimitive.Item.Props & {
12
+ inset?: boolean;
13
+ variant?: "default" | "destructive";
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ declare function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props): import("react/jsx-runtime").JSX.Element;
16
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: MenuPrimitive.SubmenuTrigger.Props & {
17
+ inset?: boolean;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): import("react/jsx-runtime").JSX.Element;
20
+ declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: MenuPrimitive.CheckboxItem.Props & {
21
+ inset?: boolean;
22
+ }): import("react/jsx-runtime").JSX.Element;
23
+ declare function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props): import("react/jsx-runtime").JSX.Element;
24
+ declare function DropdownMenuRadioItem({ className, children, inset, ...props }: MenuPrimitive.RadioItem.Props & {
25
+ inset?: boolean;
26
+ }): import("react/jsx-runtime").JSX.Element;
27
+ declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): import("react/jsx-runtime").JSX.Element;
28
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
29
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
3
+ export { Input };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Label({ className, ...props }: React.ComponentProps<"label">): import("react/jsx-runtime").JSX.Element;
3
+ export { Label };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
3
+ declare function Popover({ ...props }: PopoverPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
5
+ declare function PopoverContent({ className, align, alignOffset, side, sideOffset, ...props }: PopoverPrimitive.Popup.Props & Pick<PopoverPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react/jsx-runtime").JSX.Element;
6
+ declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
+ declare function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props): import("react/jsx-runtime").JSX.Element;
8
+ declare function PopoverDescription({ className, ...props }: PopoverPrimitive.Description.Props): import("react/jsx-runtime").JSX.Element;
9
+ export { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
@@ -0,0 +1,3 @@
1
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
2
+ declare function Separator({ className, orientation, ...props }: SeparatorPrimitive.Props): import("react/jsx-runtime").JSX.Element;
3
+ export { Separator };
@@ -0,0 +1,10 @@
1
+ import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
2
+ import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ import { toggleVariants } from "./toggle";
5
+ declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: ToggleGroupPrimitive.Props & VariantProps<typeof toggleVariants> & {
6
+ spacing?: number;
7
+ orientation?: "horizontal" | "vertical";
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare function ToggleGroupItem({ className, children, variant, size, ...props }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
10
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,8 @@
1
+ import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const toggleVariants: (props?: ({
4
+ variant?: "default" | "outline" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Toggle({ className, variant, size, ...props }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
8
+ export { Toggle, toggleVariants };
@@ -0,0 +1,6 @@
1
+ import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
2
+ declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.Props): import("react/jsx-runtime").JSX.Element;
3
+ declare function Tooltip({ ...props }: TooltipPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
4
+ declare function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
5
+ declare function TooltipContent({ className, side, sideOffset, align, alignOffset, children, ...props }: TooltipPrimitive.Popup.Props & Pick<TooltipPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react/jsx-runtime").JSX.Element;
6
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,39 @@
1
+ interface ExportOptions {
2
+ title?: string;
3
+ pageSize?: 'A4' | 'Letter';
4
+ margins?: {
5
+ top: string;
6
+ right: string;
7
+ bottom: string;
8
+ left: string;
9
+ };
10
+ extraStyles?: string;
11
+ header?: string;
12
+ footer?: string;
13
+ }
14
+ /**
15
+ * Export editor content as clean HTML for PDF generation.
16
+ *
17
+ * This produces a self-contained HTML document with:
18
+ * - @page rules for PDF library page sizing/margins
19
+ * - Content formatting styles (typography, tables, lists, code, images, etc.)
20
+ * - Page break markers converted to CSS page-break-after
21
+ * - NO page wrappers, NO shadows, NO gray background, NO pagination script
22
+ *
23
+ * Pass this HTML to any PDF library (Puppeteer, wkhtmltopdf, Prince, etc.)
24
+ * and the library handles page layout automatically using the @page rules.
25
+ */
26
+ export declare function exportToPdfHtml(editorHtml: string, options?: ExportOptions): string;
27
+ /**
28
+ * Export editor content as a visual preview HTML.
29
+ *
30
+ * This produces a document that visually mimics the editor:
31
+ * - Gray background with white A4 page cards
32
+ * - Content split at page breaks into separate visual pages
33
+ * - Auto-pagination script for overflowing content
34
+ *
35
+ * Used ONLY for the preview iframe — never for PDF generation or copy.
36
+ */
37
+ export declare function exportToPreviewHtml(editorHtml: string, options?: ExportOptions): string;
38
+ export declare function exportToHtml(editorHtml: string): string;
39
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare function cropImage(imageSrc: string, crop: {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ }): Promise<string>;
7
+ export declare function fileToBase64(file: File): Promise<string>;
8
+ export declare function clamp(value: number, min: number, max: number): number;
@@ -0,0 +1,20 @@
1
+ export interface ImportResult {
2
+ html: string;
3
+ messages: string[];
4
+ }
5
+ /**
6
+ * Import a .docx file and convert it to HTML that TipTap can parse.
7
+ *
8
+ * Mammoth converts .docx semantic structure to clean HTML:
9
+ * - Headings (Heading 1-6 → <h1>-<h6>)
10
+ * - Bold, italic, underline, strikethrough
11
+ * - Bullet and numbered lists (nested)
12
+ * - Tables with headers
13
+ * - Images (embedded as base64 data URIs)
14
+ * - Links
15
+ * - Blockquotes
16
+ *
17
+ * The `styleMap` option maps Word styles to HTML elements so that
18
+ * custom heading styles and list styles are preserved.
19
+ */
20
+ export declare function importDocx(file: File): Promise<ImportResult>;
@@ -0,0 +1,19 @@
1
+ export interface ImportResult {
2
+ html: string;
3
+ messages: string[];
4
+ }
5
+ /**
6
+ * Import a PDF file and extract text + images as HTML.
7
+ *
8
+ * PDFs are a display format, not a document format — they don't store
9
+ * semantic structure (headings, lists, tables). This extractor:
10
+ *
11
+ * 1. Extracts text items with their font size and position
12
+ * 2. Groups text into paragraphs based on vertical gaps
13
+ * 3. Infers headings from larger font sizes
14
+ * 4. Extracts embedded images via the operator list
15
+ * 5. Inserts page breaks between pages
16
+ *
17
+ * The result is a best-effort reconstruction suitable for editing.
18
+ */
19
+ export declare function importPdf(file: File): Promise<ImportResult>;
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "doccraft",
3
+ "version": "0.1.0",
4
+ "description": "A Google Docs-style WYSIWYG PDF editor built on TipTap. Supports rich text, tables, images (resize/crop), template variables, block plugins (for-loops, conditionals), page breaks, and HTML export for PDF generation.",
5
+ "type": "module",
6
+ "main": "./dist/doccraft.cjs",
7
+ "module": "./dist/doccraft.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/doccraft.js",
12
+ "require": "./dist/doccraft.cjs",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./styles": "./dist/doccraft.css",
16
+ "./blocks": {
17
+ "import": "./dist/doccraft.js",
18
+ "require": "./dist/doccraft.cjs",
19
+ "types": "./dist/index.d.ts"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md"
25
+ ],
26
+ "sideEffects": [
27
+ "**/*.css"
28
+ ],
29
+ "scripts": {
30
+ "build": "vite build && tsc --emitDeclarationOnly",
31
+ "dev": "vite build --watch"
32
+ },
33
+ "peerDependencies": {
34
+ "react": "^18.0.0 || ^19.0.0",
35
+ "react-dom": "^18.0.0 || ^19.0.0"
36
+ },
37
+ "dependencies": {
38
+ "@base-ui/react": "^1.3.0",
39
+ "@tiptap/core": "^3.20.4",
40
+ "@tiptap/extension-color": "^3.20.4",
41
+ "@tiptap/extension-dropcursor": "^3.20.4",
42
+ "@tiptap/extension-highlight": "^3.20.4",
43
+ "@tiptap/extension-image": "^3.20.4",
44
+ "@tiptap/extension-link": "^3.20.4",
45
+ "@tiptap/extension-placeholder": "^3.20.4",
46
+ "@tiptap/extension-subscript": "^3.20.4",
47
+ "@tiptap/extension-superscript": "^3.20.4",
48
+ "@tiptap/extension-table": "^3.20.4",
49
+ "@tiptap/extension-table-cell": "^3.20.4",
50
+ "@tiptap/extension-table-header": "^3.20.4",
51
+ "@tiptap/extension-table-row": "^3.20.4",
52
+ "@tiptap/extension-task-item": "^3.20.4",
53
+ "@tiptap/extension-task-list": "^3.20.4",
54
+ "@tiptap/extension-text-align": "^3.20.4",
55
+ "@tiptap/extension-text-style": "^3.20.4",
56
+ "@tiptap/extension-typography": "^3.20.4",
57
+ "@tiptap/extension-underline": "^3.20.4",
58
+ "@tiptap/pm": "^3.20.4",
59
+ "@tiptap/react": "^3.20.4",
60
+ "@tiptap/starter-kit": "^3.20.4",
61
+ "class-variance-authority": "^0.7.1",
62
+ "clsx": "^2.1.1",
63
+ "lucide-react": "^0.577.0",
64
+ "mammoth": "^1.12.0",
65
+ "tailwind-merge": "^3.5.0"
66
+ },
67
+ "optionalDependencies": {
68
+ "pdfjs-dist": "^5.5.207"
69
+ },
70
+ "devDependencies": {
71
+ "@types/react": "^19.2.14",
72
+ "@types/react-dom": "^19.2.3",
73
+ "typescript": "~5.9.3",
74
+ "vite": "^8.0.1",
75
+ "@vitejs/plugin-react": "^6.0.1"
76
+ },
77
+ "keywords": [
78
+ "editor",
79
+ "pdf",
80
+ "wysiwyg",
81
+ "tiptap",
82
+ "rich-text",
83
+ "template",
84
+ "react",
85
+ "document-editor",
86
+ "google-docs"
87
+ ],
88
+ "license": "MIT",
89
+ "repository": {
90
+ "type": "git",
91
+ "url": "https://github.com/itsparser/doccraft"
92
+ }
93
+ }