ritext 1.2.0 → 1.2.1
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/index.d.mts +11 -6
- package/dist/index.d.ts +11 -6
- package/dist/index.js +11 -0
- package/dist/index.mjs +11 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { Extensions, JSONContent, Editor as Editor$1 } from '@tiptap/react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -28,17 +28,22 @@ type EditorProps = {
|
|
|
28
28
|
|
|
29
29
|
declare const Editor: react.ForwardRefExoticComponent<EditorProps & react.RefAttributes<EditorRef>>;
|
|
30
30
|
|
|
31
|
-
interface Props$
|
|
31
|
+
interface Props$2 {
|
|
32
32
|
className?: string;
|
|
33
33
|
buttonClassName?: string;
|
|
34
34
|
dropdownContainerClassName?: string;
|
|
35
35
|
dropdownItemClassName?: string;
|
|
36
36
|
}
|
|
37
|
-
declare const Toolbar: ({ className, buttonClassName, dropdownContainerClassName, dropdownItemClassName }: Props$
|
|
37
|
+
declare const Toolbar: ({ className, buttonClassName, dropdownContainerClassName, dropdownItemClassName }: Props$2) => react_jsx_runtime.JSX.Element | null;
|
|
38
38
|
|
|
39
|
-
interface Props {
|
|
39
|
+
interface Props$1 {
|
|
40
40
|
className?: string;
|
|
41
41
|
}
|
|
42
|
-
declare const Content: ({ className }: Props) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
declare const Content: ({ className }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
type Props = ComponentPropsWithoutRef<"div"> & {
|
|
45
|
+
content?: string | null;
|
|
46
|
+
};
|
|
47
|
+
declare const Renderer: ({ content, ...props }: Props) => react_jsx_runtime.JSX.Element | null;
|
|
43
48
|
|
|
44
|
-
export { Content, Editor, type EditorRef, Toolbar };
|
|
49
|
+
export { Content, Editor, type EditorRef, Renderer, Toolbar };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { Extensions, JSONContent, Editor as Editor$1 } from '@tiptap/react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -28,17 +28,22 @@ type EditorProps = {
|
|
|
28
28
|
|
|
29
29
|
declare const Editor: react.ForwardRefExoticComponent<EditorProps & react.RefAttributes<EditorRef>>;
|
|
30
30
|
|
|
31
|
-
interface Props$
|
|
31
|
+
interface Props$2 {
|
|
32
32
|
className?: string;
|
|
33
33
|
buttonClassName?: string;
|
|
34
34
|
dropdownContainerClassName?: string;
|
|
35
35
|
dropdownItemClassName?: string;
|
|
36
36
|
}
|
|
37
|
-
declare const Toolbar: ({ className, buttonClassName, dropdownContainerClassName, dropdownItemClassName }: Props$
|
|
37
|
+
declare const Toolbar: ({ className, buttonClassName, dropdownContainerClassName, dropdownItemClassName }: Props$2) => react_jsx_runtime.JSX.Element | null;
|
|
38
38
|
|
|
39
|
-
interface Props {
|
|
39
|
+
interface Props$1 {
|
|
40
40
|
className?: string;
|
|
41
41
|
}
|
|
42
|
-
declare const Content: ({ className }: Props) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
declare const Content: ({ className }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
type Props = ComponentPropsWithoutRef<"div"> & {
|
|
45
|
+
content?: string | null;
|
|
46
|
+
};
|
|
47
|
+
declare const Renderer: ({ content, ...props }: Props) => react_jsx_runtime.JSX.Element | null;
|
|
43
48
|
|
|
44
|
-
export { Content, Editor, type EditorRef, Toolbar };
|
|
49
|
+
export { Content, Editor, type EditorRef, Renderer, Toolbar };
|
package/dist/index.js
CHANGED
|
@@ -61,6 +61,7 @@ var src_exports = {};
|
|
|
61
61
|
__export(src_exports, {
|
|
62
62
|
Content: () => Content_default,
|
|
63
63
|
Editor: () => Editor_default,
|
|
64
|
+
Renderer: () => Renderer_default,
|
|
64
65
|
Toolbar: () => Toolbar_default
|
|
65
66
|
});
|
|
66
67
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -429,9 +430,19 @@ var Content = ({ className }) => {
|
|
|
429
430
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react8.EditorContent, { editor, className: (0, import_tailwind_merge3.twMerge)(`focus:outline-none [&_.tiptap]:focus:outline-none [&_.tiptap]:min-h-50 ${dragHandler ? "[&_.tiptap]:p-[10px_20px_10px_50px]" : "[&_.tiptap]:p-[10px_20px]"}`, className) });
|
|
430
431
|
};
|
|
431
432
|
var Content_default = Content;
|
|
433
|
+
|
|
434
|
+
// src/lib/Renderer.tsx
|
|
435
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
436
|
+
var Renderer = (_a) => {
|
|
437
|
+
var _b = _a, { content } = _b, props = __objRest(_b, ["content"]);
|
|
438
|
+
if (!content) return null;
|
|
439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", __spreadValues({ dangerouslySetInnerHTML: { __html: content } }, props));
|
|
440
|
+
};
|
|
441
|
+
var Renderer_default = Renderer;
|
|
432
442
|
// Annotate the CommonJS export names for ESM import in node:
|
|
433
443
|
0 && (module.exports = {
|
|
434
444
|
Content,
|
|
435
445
|
Editor,
|
|
446
|
+
Renderer,
|
|
436
447
|
Toolbar
|
|
437
448
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Tooltip_default
|
|
9
9
|
} from "./chunk-LLHBVRQR.mjs";
|
|
10
10
|
import {
|
|
11
|
+
__objRest,
|
|
11
12
|
__spreadProps,
|
|
12
13
|
__spreadValues
|
|
13
14
|
} from "./chunk-WNQUEZJF.mjs";
|
|
@@ -228,8 +229,18 @@ var Content = ({ className }) => {
|
|
|
228
229
|
return /* @__PURE__ */ jsx5(EditorContent, { editor, className: twMerge2(`focus:outline-none [&_.tiptap]:focus:outline-none [&_.tiptap]:min-h-50 ${dragHandler ? "[&_.tiptap]:p-[10px_20px_10px_50px]" : "[&_.tiptap]:p-[10px_20px]"}`, className) });
|
|
229
230
|
};
|
|
230
231
|
var Content_default = Content;
|
|
232
|
+
|
|
233
|
+
// src/lib/Renderer.tsx
|
|
234
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
235
|
+
var Renderer = (_a) => {
|
|
236
|
+
var _b = _a, { content } = _b, props = __objRest(_b, ["content"]);
|
|
237
|
+
if (!content) return null;
|
|
238
|
+
return /* @__PURE__ */ jsx6("div", __spreadValues({ dangerouslySetInnerHTML: { __html: content } }, props));
|
|
239
|
+
};
|
|
240
|
+
var Renderer_default = Renderer;
|
|
231
241
|
export {
|
|
232
242
|
Content_default as Content,
|
|
233
243
|
Editor_default as Editor,
|
|
244
|
+
Renderer_default as Renderer,
|
|
234
245
|
Toolbar_default as Toolbar
|
|
235
246
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ritext",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Ritext is a modern WYSIWYG rich text editor built with Tailwind CSS, powered by Tiptap. It offers a customizable UI and functional layer that lets you design your own editor controls and toolbars with clean, composable React components—no heavy UI, no extra dependencies beyond Tiptap.",
|
|
5
5
|
"homepage": "https://ritext.vercel.app/",
|
|
6
6
|
"main": "dist/index.js",
|