@particle-academy/react-fancy 1.7.3 → 1.7.4
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.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1507,6 +1507,8 @@ interface EditorToolbarProps {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
interface EditorContentProps {
|
|
1509
1509
|
className?: string;
|
|
1510
|
+
/** Max height in px before scrolling. When set, content area becomes scrollable. */
|
|
1511
|
+
maxHeight?: number;
|
|
1510
1512
|
}
|
|
1511
1513
|
interface EditorProps {
|
|
1512
1514
|
children: ReactNode;
|
|
@@ -1531,7 +1533,7 @@ declare namespace EditorToolbarSeparator {
|
|
|
1531
1533
|
var displayName: string;
|
|
1532
1534
|
}
|
|
1533
1535
|
|
|
1534
|
-
declare function EditorContent({ className }: EditorContentProps): react_jsx_runtime.JSX.Element;
|
|
1536
|
+
declare function EditorContent({ className, maxHeight }: EditorContentProps): react_jsx_runtime.JSX.Element;
|
|
1535
1537
|
declare namespace EditorContent {
|
|
1536
1538
|
var displayName: string;
|
|
1537
1539
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1507,6 +1507,8 @@ interface EditorToolbarProps {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
interface EditorContentProps {
|
|
1509
1509
|
className?: string;
|
|
1510
|
+
/** Max height in px before scrolling. When set, content area becomes scrollable. */
|
|
1511
|
+
maxHeight?: number;
|
|
1510
1512
|
}
|
|
1511
1513
|
interface EditorProps {
|
|
1512
1514
|
children: ReactNode;
|
|
@@ -1531,7 +1533,7 @@ declare namespace EditorToolbarSeparator {
|
|
|
1531
1533
|
var displayName: string;
|
|
1532
1534
|
}
|
|
1533
1535
|
|
|
1534
|
-
declare function EditorContent({ className }: EditorContentProps): react_jsx_runtime.JSX.Element;
|
|
1536
|
+
declare function EditorContent({ className, maxHeight }: EditorContentProps): react_jsx_runtime.JSX.Element;
|
|
1535
1537
|
declare namespace EditorContent {
|
|
1536
1538
|
var displayName: string;
|
|
1537
1539
|
}
|
package/dist/index.js
CHANGED
|
@@ -8319,7 +8319,7 @@ function extensionEditorClasses(extensions) {
|
|
|
8319
8319
|
].join(" ");
|
|
8320
8320
|
}).join(" ");
|
|
8321
8321
|
}
|
|
8322
|
-
function EditorContent({ className }) {
|
|
8322
|
+
function EditorContent({ className, maxHeight }) {
|
|
8323
8323
|
const { contentRef, lineSpacing, placeholder, extensions, _initialHtml, _onInput } = useEditor();
|
|
8324
8324
|
const initialized = useRef(false);
|
|
8325
8325
|
useEffect(() => {
|
|
@@ -8342,10 +8342,14 @@ function EditorContent({ className }) {
|
|
|
8342
8342
|
"data-react-fancy-editor-content": "",
|
|
8343
8343
|
"data-placeholder": placeholder,
|
|
8344
8344
|
onInput: _onInput,
|
|
8345
|
-
style: {
|
|
8345
|
+
style: {
|
|
8346
|
+
lineHeight: lineSpacing,
|
|
8347
|
+
maxHeight: maxHeight ? `${maxHeight}px` : void 0
|
|
8348
|
+
},
|
|
8346
8349
|
className: cn(
|
|
8347
8350
|
"min-h-[120px] px-4 py-3 text-sm outline-none",
|
|
8348
8351
|
"focus:outline-none",
|
|
8352
|
+
maxHeight && "overflow-y-auto",
|
|
8349
8353
|
proseClasses,
|
|
8350
8354
|
extClasses,
|
|
8351
8355
|
"empty:before:content-[attr(data-placeholder)] empty:before:text-zinc-400 empty:before:pointer-events-none",
|