@wecode-team/we0-cms 1.1.33 → 1.1.35

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 (126) hide show
  1. package/dist/components/prase.d.ts +2 -1
  2. package/dist/components/routes.d.ts +2 -1
  3. package/dist/components/tiptap-extension/node-background-extension.d.ts +23 -0
  4. package/dist/components/tiptap-icons/align-center-icon.d.ts +3 -0
  5. package/dist/components/tiptap-icons/align-justify-icon.d.ts +3 -0
  6. package/dist/components/tiptap-icons/align-left-icon.d.ts +3 -0
  7. package/dist/components/tiptap-icons/align-right-icon.d.ts +3 -0
  8. package/dist/components/tiptap-icons/arrow-left-icon.d.ts +3 -0
  9. package/dist/components/tiptap-icons/ban-icon.d.ts +3 -0
  10. package/dist/components/tiptap-icons/blockquote-icon.d.ts +3 -0
  11. package/dist/components/tiptap-icons/bold-icon.d.ts +3 -0
  12. package/dist/components/tiptap-icons/check-icon.d.ts +3 -0
  13. package/dist/components/tiptap-icons/chevron-down-icon.d.ts +3 -0
  14. package/dist/components/tiptap-icons/close-icon.d.ts +3 -0
  15. package/dist/components/tiptap-icons/code-block-icon.d.ts +3 -0
  16. package/dist/components/tiptap-icons/code2-icon.d.ts +3 -0
  17. package/dist/components/tiptap-icons/corner-down-left-icon.d.ts +3 -0
  18. package/dist/components/tiptap-icons/external-link-icon.d.ts +3 -0
  19. package/dist/components/tiptap-icons/heading-five-icon.d.ts +3 -0
  20. package/dist/components/tiptap-icons/heading-four-icon.d.ts +3 -0
  21. package/dist/components/tiptap-icons/heading-icon.d.ts +3 -0
  22. package/dist/components/tiptap-icons/heading-one-icon.d.ts +3 -0
  23. package/dist/components/tiptap-icons/heading-six-icon.d.ts +3 -0
  24. package/dist/components/tiptap-icons/heading-three-icon.d.ts +3 -0
  25. package/dist/components/tiptap-icons/heading-two-icon.d.ts +3 -0
  26. package/dist/components/tiptap-icons/highlighter-icon.d.ts +3 -0
  27. package/dist/components/tiptap-icons/image-plus-icon.d.ts +3 -0
  28. package/dist/components/tiptap-icons/italic-icon.d.ts +3 -0
  29. package/dist/components/tiptap-icons/link-icon.d.ts +3 -0
  30. package/dist/components/tiptap-icons/list-icon.d.ts +3 -0
  31. package/dist/components/tiptap-icons/list-ordered-icon.d.ts +3 -0
  32. package/dist/components/tiptap-icons/list-todo-icon.d.ts +3 -0
  33. package/dist/components/tiptap-icons/moon-star-icon.d.ts +3 -0
  34. package/dist/components/tiptap-icons/redo2-icon.d.ts +3 -0
  35. package/dist/components/tiptap-icons/strike-icon.d.ts +3 -0
  36. package/dist/components/tiptap-icons/subscript-icon.d.ts +3 -0
  37. package/dist/components/tiptap-icons/sun-icon.d.ts +3 -0
  38. package/dist/components/tiptap-icons/superscript-icon.d.ts +3 -0
  39. package/dist/components/tiptap-icons/trash-icon.d.ts +3 -0
  40. package/dist/components/tiptap-icons/underline-icon.d.ts +3 -0
  41. package/dist/components/tiptap-icons/undo2-icon.d.ts +3 -0
  42. package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts +2 -0
  43. package/dist/components/tiptap-node/image-upload-node/image-upload-node-extension.d.ts +58 -0
  44. package/dist/components/tiptap-node/image-upload-node/image-upload-node.d.ts +69 -0
  45. package/dist/components/tiptap-node/image-upload-node/index.d.ts +1 -0
  46. package/dist/components/tiptap-templates/simple/simple-editor.d.ts +19 -0
  47. package/dist/components/tiptap-templates/simple/theme-toggle.d.ts +1 -0
  48. package/dist/components/tiptap-ui/blockquote-button/blockquote-button.d.ts +22 -0
  49. package/dist/components/tiptap-ui/blockquote-button/index.d.ts +2 -0
  50. package/dist/components/tiptap-ui/blockquote-button/use-blockquote.d.ts +80 -0
  51. package/dist/components/tiptap-ui/code-block-button/code-block-button.d.ts +22 -0
  52. package/dist/components/tiptap-ui/code-block-button/index.d.ts +2 -0
  53. package/dist/components/tiptap-ui/code-block-button/use-code-block.d.ts +87 -0
  54. package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.d.ts +46 -0
  55. package/dist/components/tiptap-ui/color-highlight-button/index.d.ts +2 -0
  56. package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.d.ts +93 -0
  57. package/dist/components/tiptap-ui/color-highlight-popover/color-highlight-popover.d.ts +35 -0
  58. package/dist/components/tiptap-ui/color-highlight-popover/index.d.ts +1 -0
  59. package/dist/components/tiptap-ui/heading-button/heading-button.d.ts +23 -0
  60. package/dist/components/tiptap-ui/heading-button/index.d.ts +2 -0
  61. package/dist/components/tiptap-ui/heading-button/use-heading.d.ts +108 -0
  62. package/dist/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.d.ts +19 -0
  63. package/dist/components/tiptap-ui/heading-dropdown-menu/index.d.ts +2 -0
  64. package/dist/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts +73 -0
  65. package/dist/components/tiptap-ui/image-upload-button/image-upload-button.d.ts +29 -0
  66. package/dist/components/tiptap-ui/image-upload-button/index.d.ts +2 -0
  67. package/dist/components/tiptap-ui/image-upload-button/use-image-upload.d.ts +84 -0
  68. package/dist/components/tiptap-ui/link-popover/index.d.ts +2 -0
  69. package/dist/components/tiptap-ui/link-popover/link-popover.d.ts +58 -0
  70. package/dist/components/tiptap-ui/link-popover/use-link-popover.d.ts +117 -0
  71. package/dist/components/tiptap-ui/list-button/index.d.ts +2 -0
  72. package/dist/components/tiptap-ui/list-button/list-button.d.ts +23 -0
  73. package/dist/components/tiptap-ui/list-button/use-list.d.ts +97 -0
  74. package/dist/components/tiptap-ui/list-dropdown-menu/index.d.ts +1 -0
  75. package/dist/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.d.ts +28 -0
  76. package/dist/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.d.ts +90 -0
  77. package/dist/components/tiptap-ui/mark-button/index.d.ts +2 -0
  78. package/dist/components/tiptap-ui/mark-button/mark-button.d.ts +23 -0
  79. package/dist/components/tiptap-ui/mark-button/use-mark.d.ts +104 -0
  80. package/dist/components/tiptap-ui/text-align-button/index.d.ts +2 -0
  81. package/dist/components/tiptap-ui/text-align-button/text-align-button.d.ts +30 -0
  82. package/dist/components/tiptap-ui/text-align-button/use-text-align.d.ts +102 -0
  83. package/dist/components/tiptap-ui/undo-redo-button/index.d.ts +2 -0
  84. package/dist/components/tiptap-ui/undo-redo-button/undo-redo-button.d.ts +23 -0
  85. package/dist/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts +90 -0
  86. package/dist/components/tiptap-ui-primitive/badge/badge.d.ts +11 -0
  87. package/dist/components/tiptap-ui-primitive/badge/index.d.ts +1 -0
  88. package/dist/components/tiptap-ui-primitive/button/button.d.ts +16 -0
  89. package/dist/components/tiptap-ui-primitive/button/index.d.ts +1 -0
  90. package/dist/components/tiptap-ui-primitive/button-group/button-group.d.ts +11 -0
  91. package/dist/components/tiptap-ui-primitive/button-group/index.d.ts +1 -0
  92. package/dist/components/tiptap-ui-primitive/card/card.d.ts +10 -0
  93. package/dist/components/tiptap-ui-primitive/card/index.d.ts +1 -0
  94. package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.d.ts +29 -0
  95. package/dist/components/tiptap-ui-primitive/dropdown-menu/index.d.ts +1 -0
  96. package/dist/components/tiptap-ui-primitive/input/index.d.ts +1 -0
  97. package/dist/components/tiptap-ui-primitive/input/input.d.ts +3 -0
  98. package/dist/components/tiptap-ui-primitive/popover/index.d.ts +1 -0
  99. package/dist/components/tiptap-ui-primitive/popover/popover.d.ts +6 -0
  100. package/dist/components/tiptap-ui-primitive/separator/index.d.ts +1 -0
  101. package/dist/components/tiptap-ui-primitive/separator/separator.d.ts +6 -0
  102. package/dist/components/tiptap-ui-primitive/spacer/index.d.ts +1 -0
  103. package/dist/components/tiptap-ui-primitive/spacer/spacer.d.ts +5 -0
  104. package/dist/components/tiptap-ui-primitive/toolbar/index.d.ts +1 -0
  105. package/dist/components/tiptap-ui-primitive/toolbar/toolbar.d.ts +9 -0
  106. package/dist/components/tiptap-ui-primitive/tooltip/index.d.ts +1 -0
  107. package/dist/components/tiptap-ui-primitive/tooltip/tooltip.d.ts +29 -0
  108. package/dist/components/ui/button.d.ts +1 -1
  109. package/dist/hooks/use-composed-ref.d.ts +3 -0
  110. package/dist/hooks/use-cursor-visibility.d.ts +20 -0
  111. package/dist/hooks/use-element-rect.d.ts +35 -0
  112. package/dist/hooks/use-is-breakpoint.d.ts +9 -0
  113. package/dist/hooks/use-menu-navigation.d.ts +52 -0
  114. package/dist/hooks/use-scrolling.d.ts +8 -0
  115. package/dist/hooks/use-throttled-callback.d.ts +18 -0
  116. package/dist/hooks/use-tiptap-editor.d.ts +6 -0
  117. package/dist/hooks/use-unmount.d.ts +7 -0
  118. package/dist/hooks/use-window-size.d.ts +35 -0
  119. package/dist/i18n/display.d.ts +6 -0
  120. package/dist/index.css +2 -2
  121. package/dist/index.esm.js +11 -5
  122. package/dist/index.esm.js.map +1 -1
  123. package/dist/index.js +11 -5
  124. package/dist/index.js.map +1 -1
  125. package/dist/lib/tiptap-utils.d.ts +173 -0
  126. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { RouteConfig } from "./routes";
2
2
  import { CmsModel } from "./types";
3
+ import type { Locale } from "../i18n";
3
4
  export declare function parseModelsToRoutes(inputModels: {
4
5
  models: CmsModel[];
5
- }): RouteConfig[];
6
+ }, locale?: Locale): RouteConfig[];
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { CmsModel } from "./types";
3
+ import type { Locale } from "../i18n";
3
4
  export interface RouteConfig {
4
5
  path: string;
5
6
  name: string;
@@ -9,4 +10,4 @@ export interface RouteConfig {
9
10
  }
10
11
  export declare const cmsRoutes: (inputModels: {
11
12
  models: CmsModel[];
12
- }, t?: (key: string) => string) => RouteConfig[];
13
+ }, t?: (key: string) => string, locale?: Locale) => RouteConfig[];
@@ -0,0 +1,23 @@
1
+ import { Extension } from "@tiptap/core";
2
+ declare module "@tiptap/core" {
3
+ interface Commands<ReturnType> {
4
+ nodeBackground: {
5
+ setNodeBackgroundColor: (backgroundColor: string) => ReturnType;
6
+ unsetNodeBackgroundColor: () => ReturnType;
7
+ toggleNodeBackgroundColor: (backgroundColor: string) => ReturnType;
8
+ };
9
+ }
10
+ }
11
+ export interface NodeBackgroundOptions {
12
+ /**
13
+ * Node types that should support background colors
14
+ * @default ["paragraph", "heading", "blockquote", "taskList", "bulletList", "orderedList", "tableCell", "tableHeader"]
15
+ */
16
+ types: string[];
17
+ /**
18
+ * Use inline style instead of data attribute
19
+ * @default true
20
+ */
21
+ useStyle?: boolean;
22
+ }
23
+ export declare const NodeBackground: Extension<NodeBackgroundOptions, any>;
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const AlignCenterIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const AlignJustifyIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const AlignLeftIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const AlignRightIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const ArrowLeftIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const BanIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const BlockquoteIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const BoldIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const CheckIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const ChevronDownIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const CloseIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const CodeBlockIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const Code2Icon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const CornerDownLeftIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const ExternalLinkIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const HeadingFiveIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const HeadingFourIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const HeadingIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const HeadingOneIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const HeadingSixIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const HeadingThreeIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const HeadingTwoIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const HighlighterIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const ImagePlusIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const ItalicIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const LinkIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const ListIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const ListOrderedIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const ListTodoIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const MoonStarIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const Redo2Icon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const StrikeIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const SubscriptIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const SunIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const SuperscriptIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const TrashIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const UnderlineIcon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,3 @@
1
+ type SvgProps = React.ComponentPropsWithoutRef<"svg">;
2
+ export declare const Undo2Icon: import("react").MemoExoticComponent<({ className, ...props }: SvgProps) => import("react").JSX.Element>;
3
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const HorizontalRule: import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
2
+ export default HorizontalRule;
@@ -0,0 +1,58 @@
1
+ import { Node } from "@tiptap/react";
2
+ import type { NodeType } from "@tiptap/pm/model";
3
+ export type UploadFunction = (file: File, onProgress?: (event: {
4
+ progress: number;
5
+ }) => void, abortSignal?: AbortSignal) => Promise<string>;
6
+ export interface ImageUploadNodeOptions {
7
+ /**
8
+ * The type of the node.
9
+ * @default 'image'
10
+ */
11
+ type?: string | NodeType | undefined;
12
+ /**
13
+ * Acceptable file types for upload.
14
+ * @default 'image/*'
15
+ */
16
+ accept?: string;
17
+ /**
18
+ * Maximum number of files that can be uploaded.
19
+ * @default 1
20
+ */
21
+ limit?: number;
22
+ /**
23
+ * Maximum file size in bytes (0 for unlimited).
24
+ * @default 0
25
+ */
26
+ maxSize?: number;
27
+ /**
28
+ * Function to handle the upload process.
29
+ */
30
+ upload?: UploadFunction;
31
+ /**
32
+ * Callback for upload errors.
33
+ */
34
+ onError?: (error: Error) => void;
35
+ /**
36
+ * Callback for successful uploads.
37
+ */
38
+ onSuccess?: (url: string) => void;
39
+ /**
40
+ * HTML attributes to add to the image element.
41
+ * @default {}
42
+ * @example { class: 'foo' }
43
+ */
44
+ HTMLAttributes: Record<string, any>;
45
+ }
46
+ declare module "@tiptap/react" {
47
+ interface Commands<ReturnType> {
48
+ imageUpload: {
49
+ setImageUploadNode: (options?: ImageUploadNodeOptions) => ReturnType;
50
+ };
51
+ }
52
+ }
53
+ /**
54
+ * A Tiptap node extension that creates an image upload component.
55
+ * @see registry/tiptap-node/image-upload-node/image-upload-node
56
+ */
57
+ export declare const ImageUploadNode: Node<ImageUploadNodeOptions, any>;
58
+ export default ImageUploadNode;
@@ -0,0 +1,69 @@
1
+ import type { NodeViewProps } from "@tiptap/react";
2
+ import "@/components/tiptap-node/image-upload-node/image-upload-node.scss";
3
+ export interface FileItem {
4
+ /**
5
+ * Unique identifier for the file item
6
+ */
7
+ id: string;
8
+ /**
9
+ * The actual File object being uploaded
10
+ */
11
+ file: File;
12
+ /**
13
+ * Current upload progress as a percentage (0-100)
14
+ */
15
+ progress: number;
16
+ /**
17
+ * Current status of the file upload process
18
+ * @default "uploading"
19
+ */
20
+ status: "uploading" | "success" | "error";
21
+ /**
22
+ * URL to the uploaded file, available after successful upload
23
+ * @optional
24
+ */
25
+ url?: string;
26
+ /**
27
+ * Controller that can be used to abort the upload process
28
+ * @optional
29
+ */
30
+ abortController?: AbortController;
31
+ }
32
+ export interface UploadOptions {
33
+ /**
34
+ * Maximum allowed file size in bytes
35
+ */
36
+ maxSize: number;
37
+ /**
38
+ * Maximum number of files that can be uploaded
39
+ */
40
+ limit: number;
41
+ /**
42
+ * String specifying acceptable file types (MIME types or extensions)
43
+ * @example ".jpg,.png,image/jpeg" or "image/*"
44
+ */
45
+ accept: string;
46
+ /**
47
+ * Function that handles the actual file upload process
48
+ * @param {File} file - The file to be uploaded
49
+ * @param {Function} onProgress - Callback function to report upload progress
50
+ * @param {AbortSignal} signal - Signal that can be used to abort the upload
51
+ * @returns {Promise<string>} Promise resolving to the URL of the uploaded file
52
+ */
53
+ upload: (file: File, onProgress: (event: {
54
+ progress: number;
55
+ }) => void, signal: AbortSignal) => Promise<string>;
56
+ /**
57
+ * Callback triggered when a file is uploaded successfully
58
+ * @param {string} url - URL of the successfully uploaded file
59
+ * @optional
60
+ */
61
+ onSuccess?: (url: string) => void;
62
+ /**
63
+ * Callback triggered when an error occurs during upload
64
+ * @param {Error} error - The error that occurred
65
+ * @optional
66
+ */
67
+ onError?: (error: Error) => void;
68
+ }
69
+ export declare const ImageUploadNode: React.FC<NodeViewProps>;
@@ -0,0 +1 @@
1
+ export * from "./image-upload-node-extension";
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import "@/components/tiptap-node/blockquote-node/blockquote-node.scss";
3
+ import "@/components/tiptap-node/code-block-node/code-block-node.scss";
4
+ import "@/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.scss";
5
+ import "@/components/tiptap-node/list-node/list-node.scss";
6
+ import "@/components/tiptap-node/image-node/image-node.scss";
7
+ import "@/components/tiptap-node/heading-node/heading-node.scss";
8
+ import "@/components/tiptap-node/paragraph-node/paragraph-node.scss";
9
+ import "@/components/tiptap-templates/simple/simple-editor.scss";
10
+ export declare function SimpleEditor({ value, onChange, disabled, placeholder, }: {
11
+ value?: string;
12
+ onChange?: (value: string) => void;
13
+ disabled?: boolean;
14
+ placeholder?: string;
15
+ }): React.JSX.Element;
16
+ export declare function SimpleEditorViewer({ value, className, }: {
17
+ value?: string;
18
+ className?: string;
19
+ }): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ThemeToggle(): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import type { UseBlockquoteConfig } from "@/components/tiptap-ui/blockquote-button";
2
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
3
+ export interface BlockquoteButtonProps extends Omit<ButtonProps, "type">, UseBlockquoteConfig {
4
+ /**
5
+ * Optional text to display alongside the icon.
6
+ */
7
+ text?: string;
8
+ /**
9
+ * Optional show shortcut keys in the button.
10
+ * @default false
11
+ */
12
+ showShortcut?: boolean;
13
+ }
14
+ export declare function BlockquoteShortcutBadge({ shortcutKeys, }: {
15
+ shortcutKeys?: string;
16
+ }): import("react").JSX.Element;
17
+ /**
18
+ * Button component for toggling blockquote in a Tiptap editor.
19
+ *
20
+ * For custom button implementations, use the `useBlockquote` hook instead.
21
+ */
22
+ export declare const BlockquoteButton: import("react").ForwardRefExoticComponent<BlockquoteButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,2 @@
1
+ export * from "./blockquote-button";
2
+ export * from "./use-blockquote";
@@ -0,0 +1,80 @@
1
+ import type { Editor } from "@tiptap/react";
2
+ export declare const BLOCKQUOTE_SHORTCUT_KEY = "mod+shift+b";
3
+ /**
4
+ * Configuration for the blockquote functionality
5
+ */
6
+ export interface UseBlockquoteConfig {
7
+ /**
8
+ * The Tiptap editor instance.
9
+ */
10
+ editor?: Editor | null;
11
+ /**
12
+ * Whether the button should hide when blockquote is not available.
13
+ * @default false
14
+ */
15
+ hideWhenUnavailable?: boolean;
16
+ /**
17
+ * Callback function called after a successful toggle.
18
+ */
19
+ onToggled?: () => void;
20
+ }
21
+ /**
22
+ * Checks if blockquote can be toggled in the current editor state
23
+ */
24
+ export declare function canToggleBlockquote(editor: Editor | null, turnInto?: boolean): boolean;
25
+ /**
26
+ * Toggles blockquote formatting for a specific node or the current selection
27
+ */
28
+ export declare function toggleBlockquote(editor: Editor | null): boolean;
29
+ /**
30
+ * Determines if the blockquote button should be shown
31
+ */
32
+ export declare function shouldShowButton(props: {
33
+ editor: Editor | null;
34
+ hideWhenUnavailable: boolean;
35
+ }): boolean;
36
+ /**
37
+ * Custom hook that provides blockquote functionality for Tiptap editor
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * // Simple usage - no params needed
42
+ * function MySimpleBlockquoteButton() {
43
+ * const { isVisible, handleToggle, isActive } = useBlockquote()
44
+ *
45
+ * if (!isVisible) return null
46
+ *
47
+ * return <button onClick={handleToggle}>Blockquote</button>
48
+ * }
49
+ *
50
+ * // Advanced usage with configuration
51
+ * function MyAdvancedBlockquoteButton() {
52
+ * const { isVisible, handleToggle, label, isActive } = useBlockquote({
53
+ * editor: myEditor,
54
+ * hideWhenUnavailable: true,
55
+ * onToggled: () => console.log('Blockquote toggled!')
56
+ * })
57
+ *
58
+ * if (!isVisible) return null
59
+ *
60
+ * return (
61
+ * <MyButton
62
+ * onClick={handleToggle}
63
+ * aria-label={label}
64
+ * aria-pressed={isActive}
65
+ * >
66
+ * Toggle Blockquote
67
+ * </MyButton>
68
+ * )
69
+ * }
70
+ * ```
71
+ */
72
+ export declare function useBlockquote(config?: UseBlockquoteConfig): {
73
+ isVisible: boolean;
74
+ isActive: boolean;
75
+ handleToggle: () => boolean;
76
+ canToggle: boolean;
77
+ label: string;
78
+ shortcutKeys: string;
79
+ Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
80
+ };
@@ -0,0 +1,22 @@
1
+ import type { UseCodeBlockConfig } from "@/components/tiptap-ui/code-block-button";
2
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
3
+ export interface CodeBlockButtonProps extends Omit<ButtonProps, "type">, UseCodeBlockConfig {
4
+ /**
5
+ * Optional text to display alongside the icon.
6
+ */
7
+ text?: string;
8
+ /**
9
+ * Optional show shortcut keys in the button.
10
+ * @default false
11
+ */
12
+ showShortcut?: boolean;
13
+ }
14
+ export declare function CodeBlockShortcutBadge({ shortcutKeys, }: {
15
+ shortcutKeys?: string;
16
+ }): import("react").JSX.Element;
17
+ /**
18
+ * Button component for toggling code block in a Tiptap editor.
19
+ *
20
+ * For custom button implementations, use the `useCodeBlock` hook instead.
21
+ */
22
+ export declare const CodeBlockButton: import("react").ForwardRefExoticComponent<CodeBlockButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,2 @@
1
+ export * from "./code-block-button";
2
+ export * from "./use-code-block";
@@ -0,0 +1,87 @@
1
+ import { type Editor } from "@tiptap/react";
2
+ export declare const CODE_BLOCK_SHORTCUT_KEY = "mod+alt+c";
3
+ /**
4
+ * Configuration for the code block functionality
5
+ */
6
+ export interface UseCodeBlockConfig {
7
+ /**
8
+ * The Tiptap editor instance.
9
+ */
10
+ editor?: Editor | null;
11
+ /**
12
+ * Whether the button should hide when code block is not available.
13
+ * @default false
14
+ */
15
+ hideWhenUnavailable?: boolean;
16
+ /**
17
+ * Callback function called after a successful code block toggle.
18
+ */
19
+ onToggled?: () => void;
20
+ }
21
+ /**
22
+ * Checks if code block can be toggled in the current editor state
23
+ */
24
+ export declare function canToggle(editor: Editor | null, turnInto?: boolean): boolean;
25
+ /**
26
+ * Toggles code block in the editor
27
+ */
28
+ export declare function toggleCodeBlock(editor: Editor | null): boolean;
29
+ /**
30
+ * Determines if the code block button should be shown
31
+ */
32
+ export declare function shouldShowButton(props: {
33
+ editor: Editor | null;
34
+ hideWhenUnavailable: boolean;
35
+ }): boolean;
36
+ /**
37
+ * Custom hook that provides code block functionality for Tiptap editor
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * // Simple usage - no params needed
42
+ * function MySimpleCodeBlockButton() {
43
+ * const { isVisible, isActive, handleToggle } = useCodeBlock()
44
+ *
45
+ * if (!isVisible) return null
46
+ *
47
+ * return (
48
+ * <button
49
+ * onClick={handleToggle}
50
+ * aria-pressed={isActive}
51
+ * >
52
+ * Code Block
53
+ * </button>
54
+ * )
55
+ * }
56
+ *
57
+ * // Advanced usage with configuration
58
+ * function MyAdvancedCodeBlockButton() {
59
+ * const { isVisible, isActive, handleToggle, label } = useCodeBlock({
60
+ * editor: myEditor,
61
+ * hideWhenUnavailable: true,
62
+ * onToggled: (isActive) => console.log('Code block toggled:', isActive)
63
+ * })
64
+ *
65
+ * if (!isVisible) return null
66
+ *
67
+ * return (
68
+ * <MyButton
69
+ * onClick={handleToggle}
70
+ * aria-label={label}
71
+ * aria-pressed={isActive}
72
+ * >
73
+ * Toggle Code Block
74
+ * </MyButton>
75
+ * )
76
+ * }
77
+ * ```
78
+ */
79
+ export declare function useCodeBlock(config?: UseCodeBlockConfig): {
80
+ isVisible: boolean;
81
+ isActive: boolean;
82
+ handleToggle: () => boolean;
83
+ canToggle: boolean;
84
+ label: string;
85
+ shortcutKeys: string;
86
+ Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
87
+ };