fix: Disabling editor embeds should work with collaborative editing (#2968)
* fix: Disabling editor embeds should work with collaborative editing * Design tweaks, fixed dragging
This commit is contained in:
@@ -104,7 +104,7 @@ function CollectionDescription({ collection }: Props) {
|
||||
autoFocus={isEditing}
|
||||
onBlur={handleStopEditing}
|
||||
maxLength={1000}
|
||||
disableEmbeds
|
||||
embedsDisabled
|
||||
readOnlyWriteCheckboxes
|
||||
grow
|
||||
/>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as React from "react";
|
||||
import { Optional } from "utility-types";
|
||||
import embeds from "@shared/editor/embeds";
|
||||
import { EmbedDescriptor } from "@shared/editor/types";
|
||||
import ErrorBoundary from "~/components/ErrorBoundary";
|
||||
import { Props as EditorProps } from "~/editor";
|
||||
import useDictionary from "~/hooks/useDictionary";
|
||||
@@ -19,14 +18,12 @@ const SharedEditor = React.lazy(
|
||||
)
|
||||
);
|
||||
|
||||
const EMPTY_ARRAY: EmbedDescriptor[] = [];
|
||||
|
||||
export type Props = Optional<
|
||||
EditorProps,
|
||||
"placeholder" | "defaultValue" | "onClickLink" | "embeds" | "dictionary"
|
||||
> & {
|
||||
shareId?: string | undefined;
|
||||
disableEmbeds?: boolean;
|
||||
embedsDisabled?: boolean;
|
||||
grow?: boolean;
|
||||
onSynced?: () => Promise<void>;
|
||||
onPublish?: (event: React.MouseEvent) => any;
|
||||
@@ -94,7 +91,7 @@ function Editor(props: Props, ref: React.Ref<any>) {
|
||||
ref={ref}
|
||||
uploadImage={onUploadImage}
|
||||
onShowToast={onShowToast}
|
||||
embeds={props.disableEmbeds ? EMPTY_ARRAY : embeds}
|
||||
embeds={embeds}
|
||||
dictionary={dictionary}
|
||||
{...props}
|
||||
onClickLink={onClickLink}
|
||||
|
||||
@@ -37,7 +37,7 @@ function HoverPreviewDocument({ url, children }: Props) {
|
||||
<Editor
|
||||
key={document.id}
|
||||
defaultValue={document.getSummary()}
|
||||
disableEmbeds
|
||||
embedsDisabled
|
||||
readOnly
|
||||
/>
|
||||
</React.Suspense>
|
||||
|
||||
Reference in New Issue
Block a user