+
);
@@ -36,24 +46,55 @@ export function DialogHeader(props: DialogHeaderProps): ReactElement {
);
}
-export function DialogBody(props: PropsWithChildrenWithClass): ReactElement {
- const { children, className } = props;
+export interface DialogBodyProps extends PropsWithChildrenWithClass {
+ formOrientation: "horizontal" | "vertical";
+}
+
+export function DialogBody(props: DialogBodyProps): ReactElement {
+ const { children, className, formOrientation } = props;
- return
{children}
;
+ return (
+
+ {children}
+
+ );
}
export interface FormControlProps extends PropsWithChildrenWithClass {
label?: string;
+ formOrientation: "horizontal" | "vertical";
+ inputId?: string;
}
export function FormControl(props: FormControlProps): ReactElement {
- const { children, className, label } = props;
+ const { children, className, label, formOrientation, inputId } = props;
return (
-
- {label &&
{label} }
-
{children}
+
+ {label && (
+
+ {label}
+
+ )}
+ {formOrientation === "vertical" ? (
+ children
+ ) : (
+
{children}
+ )}
);
diff --git a/packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/ImageDialog.tsx b/packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/ImageDialog.tsx
index d6dba5215d..f822858668 100644
--- a/packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/ImageDialog.tsx
+++ b/packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/ImageDialog.tsx
@@ -20,15 +20,19 @@ interface CustomEvent
extends Event {
initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;
}
-export interface ImageDialogProps extends Pick {
+export interface ImageDialogProps
+ extends Pick<
+ RichTextContainerProps,
+ "imageSource" | "imageSourceContent" | "enableDefaultUpload" | "formOrientation"
+ > {
onSubmit(value: imageConfigType): void;
onClose(): void;
defaultValue?: imageConfigType;
- enableDefaultUpload?: boolean;
}
export default function ImageDialog(props: ImageDialogProps): ReactElement {
- const { onClose, defaultValue, onSubmit, imageSource, imageSourceContent, enableDefaultUpload } = props;
+ const { onClose, defaultValue, onSubmit, imageSource, imageSourceContent, enableDefaultUpload, formOrientation } =
+ props;
const [activeTab, setActiveTab] = useState("general");
const [selectedImageEntity, setSelectedImageEntity] = useState();
const imageUploadElementRef = useRef(null);
@@ -127,9 +131,9 @@ export default function ImageDialog(props: ImageDialogProps): ReactElement {
}, [imageUploadElementRef.current]);
return (
-
+
{activeTab === "general" ? "Insert/Edit" : "Embed"} Images
-
+
{!disableEmbed && (
@@ -161,7 +165,11 @@ export default function ImageDialog(props: ImageDialogProps): ReactElement {
)}
-
+
{defaultValue?.src ? (
) : enableDefaultUpload ? (
) : undefined}
-
+
-
+
-
+
+
Insert/Edit Link
-
-
+
+
-
+
-
+
-
-
+
+
Current window
New window
diff --git a/packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/VideoDialog.tsx b/packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/VideoDialog.tsx
index a3671ea30e..c6a8e62038 100644
--- a/packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/VideoDialog.tsx
+++ b/packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/VideoDialog.tsx
@@ -13,6 +13,7 @@ export interface VideoDialogProps {
onClose(): void;
selection?: Range | null;
defaultValue?: videoConfigType;
+ formOrientation: "horizontal" | "vertical";
}
export function getValueType(value: VideoFormType): VideoFormType {
@@ -22,7 +23,7 @@ export function getValueType(value: VideoFormType): VideoFormType {
}
function GeneralVideoDialog(props: VideoDialogProps): ReactElement {
- const { onSubmit, onClose, defaultValue } = props;
+ const { onSubmit, onClose, defaultValue, formOrientation } = props;
const [formState, setFormState] = useState({
src: defaultValue?.src ?? "",
width: defaultValue?.width ?? 560,
@@ -47,11 +48,12 @@ function GeneralVideoDialog(props: VideoDialogProps): ReactElement {
return (
-
+
{defaultValue?.src ? (
{defaultValue?.src}
) : (
)}
-
+
-
+
({
embedcode: ""
});
@@ -95,9 +99,10 @@ function EmbedVideoDialog(props: VideoDialogProps): ReactElement {
return (
-
+
{" "}