[WIKI-449] feat: image block download and alignment options (#7254)
* refactor: custom image extension * refactor: extension config * revert: image full screen component * fix: undo operation * chore: add download and alignment options * chore: render image full screen modal in a portal * chore: add missing attribute to image extension * chore: minor bugs and improvements * chore: add aria attributes * chore: remove unnecessary file * fix: full screen modal z-index
This commit is contained in:
parent
ba6b822f60
commit
f679628365
17 changed files with 456 additions and 210 deletions
|
|
@ -80,6 +80,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|||
</head>
|
||||
<body>
|
||||
<div id="context-menu-portal" />
|
||||
<div id="editor-portal" />
|
||||
<AppProvider>
|
||||
<div
|
||||
className={cn(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { useCallback } from "react";
|
|||
// plane editor
|
||||
import { TFileHandler, TReadOnlyFileHandler } from "@plane/editor";
|
||||
// helpers
|
||||
import { getEditorAssetSrc } from "@plane/utils";
|
||||
import { getEditorAssetDownloadSrc, getEditorAssetSrc } from "@plane/utils";
|
||||
// hooks
|
||||
import { useEditorAsset } from "@/hooks/store";
|
||||
// plane web hooks
|
||||
|
|
@ -33,6 +33,20 @@ export const useEditorConfig = () => {
|
|||
const res = await fileService.checkIfAssetExists(workspaceSlug, assetId);
|
||||
return res?.exists ?? false;
|
||||
},
|
||||
getAssetDownloadSrc: async (path) => {
|
||||
if (!path) return "";
|
||||
if (path?.startsWith("http")) {
|
||||
return path;
|
||||
} else {
|
||||
return (
|
||||
getEditorAssetDownloadSrc({
|
||||
assetId: path,
|
||||
projectId,
|
||||
workspaceSlug,
|
||||
}) ?? ""
|
||||
);
|
||||
}
|
||||
},
|
||||
getAssetSrc: async (path) => {
|
||||
if (!path) return "";
|
||||
if (path?.startsWith("http")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue