- Updated .env.example to include configuration for OnlyOffice Document Server. - Modified the workspace configuration to remove the drive-suite path. - Adjusted TypeScript environment imports for consistency. - Enhanced Next.js configuration to disable canvas in Webpack. - Updated package.json to include new dependencies for OnlyOffice and PDF.js. - Added global styles for OnlyOffice theme integration in the CSS. - Created new layout and page components for the Drive feature, including public sharing and editing functionalities. - Updated metadata handling across various layouts to reflect the new app structure.
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
"use client"
|
|
|
|
import { useParams, useSearchParams } from "next/navigation"
|
|
import { useState } from "react"
|
|
import { PublicOfficeEditor } from "@/components/drive/public-office-editor"
|
|
import { filePathFromPublicEditSegments } from "@/lib/drive/public-share-url"
|
|
|
|
export default function PublicShareEditPage() {
|
|
const params = useParams()
|
|
const searchParams = useSearchParams()
|
|
const token = String(params.token ?? "")
|
|
const pathSegments = params.path as string[] | undefined
|
|
const filePath = filePathFromPublicEditSegments(token, pathSegments)
|
|
const returnTo = searchParams.get("returnTo")
|
|
const mode = searchParams.get("mode") === "view" ? "view" : "edit"
|
|
const [password] = useState<string | undefined>(() => {
|
|
if (typeof window === "undefined") return undefined
|
|
return sessionStorage.getItem(`public-share-pw:${token}`) ?? undefined
|
|
})
|
|
|
|
return (
|
|
<PublicOfficeEditor
|
|
token={token}
|
|
filePath={filePath}
|
|
password={password}
|
|
returnTo={returnTo}
|
|
mode={mode}
|
|
/>
|
|
)
|
|
}
|