react-better-html 1.1.137 → 1.1.139
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -323,6 +323,7 @@ type PageHolderComponentType = {
|
|
|
323
323
|
(props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
|
|
324
324
|
center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
|
|
325
325
|
pageBackgroundColor?: string;
|
|
326
|
+
contentMaxWidth?: React.CSSProperties["maxWidth"];
|
|
326
327
|
sideImageSrc?: string;
|
|
327
328
|
sideImageName?: AssetName | AnyOtherString;
|
|
328
329
|
/** @default "right" */
|
package/dist/index.d.ts
CHANGED
|
@@ -323,6 +323,7 @@ type PageHolderComponentType = {
|
|
|
323
323
|
(props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
|
|
324
324
|
center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
|
|
325
325
|
pageBackgroundColor?: string;
|
|
326
|
+
contentMaxWidth?: React.CSSProperties["maxWidth"];
|
|
326
327
|
sideImageSrc?: string;
|
|
327
328
|
sideImageName?: AssetName | AnyOtherString;
|
|
328
329
|
/** @default "right" */
|
package/dist/index.js
CHANGED
|
@@ -3589,6 +3589,7 @@ var PageHolderComponent = (0, import_react14.forwardRef)(function PageHolder({ n
|
|
|
3589
3589
|
});
|
|
3590
3590
|
PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
|
|
3591
3591
|
pageBackgroundColor,
|
|
3592
|
+
contentMaxWidth,
|
|
3592
3593
|
sideImageSrc,
|
|
3593
3594
|
sideImageName,
|
|
3594
3595
|
sideImagePosition = "right",
|
|
@@ -3617,7 +3618,7 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
|
|
|
3617
3618
|
Div_default.box,
|
|
3618
3619
|
{
|
|
3619
3620
|
width: `calc(100% - ${theme2.styles.space}px * 2)`,
|
|
3620
|
-
maxWidth: !noMaxContentWidth ? app.contentMaxWidth / 2 : void 0,
|
|
3621
|
+
maxWidth: !noMaxContentWidth ? contentMaxWidth ?? app.contentMaxWidth / 2 : void 0,
|
|
3621
3622
|
marginInline: theme2.styles.space,
|
|
3622
3623
|
marginBlock: theme2.styles.space,
|
|
3623
3624
|
...props,
|
|
@@ -8742,7 +8743,7 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
8742
8743
|
const theme2 = useTheme();
|
|
8743
8744
|
const bodyRef = (0, import_react28.useRef)(null);
|
|
8744
8745
|
const [internalIsOpen, setInternalIsOpen] = useBooleanState(defaultOpen);
|
|
8745
|
-
const [bodyVirtualHeight, setBodyVirtualHeight] = (0, import_react28.useState)(
|
|
8746
|
+
const [bodyVirtualHeight, setBodyVirtualHeight] = (0, import_react28.useState)();
|
|
8746
8747
|
const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
|
|
8747
8748
|
const open = (0, import_react28.useCallback)(() => {
|
|
8748
8749
|
if (controlledIsOpen === void 0) setInternalIsOpen.setTrue();
|
|
@@ -8758,7 +8759,14 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
8758
8759
|
}, [controlledIsOpen, isOpen, onOpenChange]);
|
|
8759
8760
|
(0, import_react28.useEffect)(() => {
|
|
8760
8761
|
if (!bodyRef.current) return;
|
|
8761
|
-
|
|
8762
|
+
const body = bodyRef.current;
|
|
8763
|
+
setBodyVirtualHeight(body.scrollHeight * 2);
|
|
8764
|
+
const timeout = setTimeout(() => {
|
|
8765
|
+
setBodyVirtualHeight(body.scrollHeight * 2);
|
|
8766
|
+
}, 0.2 * 1e3);
|
|
8767
|
+
return () => {
|
|
8768
|
+
clearTimeout(timeout);
|
|
8769
|
+
};
|
|
8762
8770
|
}, [isOpen]);
|
|
8763
8771
|
(0, import_react28.useImperativeHandle)(
|
|
8764
8772
|
ref,
|