mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
fix: Cannot resize embed on collection overview (#10498)
fix: Toolbar too small on embed link editor
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ import * as React from "react";
|
||||
import useMeasure from "react-use-measure";
|
||||
|
||||
export const MeasuredContainer = <T extends React.ElementType>({
|
||||
as: As,
|
||||
as: As = "div",
|
||||
name,
|
||||
children,
|
||||
...rest
|
||||
@@ -298,7 +298,7 @@ const FloatingToolbar = React.forwardRef(function FloatingToolbar_(
|
||||
ref={menuRef}
|
||||
$offset={position.offset}
|
||||
style={{
|
||||
width: props.width,
|
||||
minWidth: props.width,
|
||||
maxWidth: `${position.maxWidth}px`,
|
||||
top: `${position.top}px`,
|
||||
left: `${position.left}px`,
|
||||
|
||||
@@ -13,6 +13,7 @@ import Document from "~/models/Document";
|
||||
import Editor from "~/components/Editor";
|
||||
import LoadingIndicator from "~/components/LoadingIndicator";
|
||||
import Text from "~/components/Text";
|
||||
import { MeasuredContainer } from "~/components/MeasuredContainer";
|
||||
import { withUIExtensions } from "~/editor/extensions";
|
||||
import useCurrentUser from "~/hooks/useCurrentUser";
|
||||
import usePolicy from "~/hooks/usePolicy";
|
||||
@@ -81,20 +82,22 @@ function Overview({ collection, shareId }: Props) {
|
||||
{collections.isSaving && <LoadingIndicator />}
|
||||
{(collection.hasDescription || can.update) && (
|
||||
<Suspense fallback={<Placeholder>Loading…</Placeholder>}>
|
||||
<Editor
|
||||
defaultValue={collection.data}
|
||||
onChange={handleSave}
|
||||
placeholder={`${t("Add a description")}…`}
|
||||
extensions={extensions}
|
||||
maxLength={CollectionValidation.maxDescriptionLength}
|
||||
onCreateLink={onCreateLink}
|
||||
canUpdate={can.update}
|
||||
readOnly={!can.update || !!shareId}
|
||||
userId={user?.id}
|
||||
editorStyle={editorStyle}
|
||||
shareId={shareId}
|
||||
/>
|
||||
<div ref={childRef} />
|
||||
<MeasuredContainer name="document">
|
||||
<Editor
|
||||
defaultValue={collection.data}
|
||||
onChange={handleSave}
|
||||
placeholder={`${t("Add a description")}…`}
|
||||
extensions={extensions}
|
||||
maxLength={CollectionValidation.maxDescriptionLength}
|
||||
onCreateLink={onCreateLink}
|
||||
canUpdate={can.update}
|
||||
readOnly={!can.update || !!shareId}
|
||||
userId={user?.id}
|
||||
editorStyle={editorStyle}
|
||||
shareId={shareId}
|
||||
/>
|
||||
<div ref={childRef} />
|
||||
</MeasuredContainer>
|
||||
</Suspense>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -41,6 +41,7 @@ import PlaceholderDocument from "~/components/PlaceholderDocument";
|
||||
import RegisterKeyDown from "~/components/RegisterKeyDown";
|
||||
import { SidebarContextType } from "~/components/Sidebar/components/SidebarContext";
|
||||
import withStores from "~/components/withStores";
|
||||
import { MeasuredContainer } from "~/components/MeasuredContainer";
|
||||
import type { Editor as TEditor } from "~/editor";
|
||||
import { Properties } from "~/types";
|
||||
import { client } from "~/utils/ApiClient";
|
||||
@@ -54,7 +55,6 @@ import Container from "./Container";
|
||||
import Contents from "./Contents";
|
||||
import Editor from "./Editor";
|
||||
import Header from "./Header";
|
||||
import { MeasuredContainer } from "./MeasuredContainer";
|
||||
import Notices from "./Notices";
|
||||
import PublicReferences from "./PublicReferences";
|
||||
import References from "./References";
|
||||
|
||||
Reference in New Issue
Block a user