Skip to content

armgit / ui

Public Imported from GitHub
0
TypeScript

switch ui site to microfront end (#6)

Andrew Luo348f16429dd7
diff --git a/apps/v4/.env.example b/apps/v4/.env.example
index d2f09fb..4b776c2 100644
--- a/apps/v4/.env.example
+++ b/apps/v4/.env.example
@@ -1,2 +1,4 @@
NEXT_PUBLIC_V0_URL=https://v0.dev
-NEXT_PUBLIC_APP_URL=http://localhost:4000
\ No newline at end of file
+NEXT_PUBLIC_APP_URL=http://localhost:4000/ui
+NEXT_PUBLIC_BASE_PATH=/ui
+NEXT_PUBLIC_ASSET_PREFIX=/ui-static
diff --git a/apps/v4/app/layout.tsx b/apps/v4/app/layout.tsx
index 2611ef0..cd594bf 100644
--- a/apps/v4/app/layout.tsx
+++ b/apps/v4/app/layout.tsx
@@ -6,12 +6,13 @@ import { NuqsAdapter } from "nuqs/adapters/next/app"
import { META_THEME_COLORS, siteConfig } from "@/lib/config"
import { fontVariables } from "@/lib/fonts"
import { cn } from "@/lib/utils"
+import { withUiBasePath } from "@/lib/zone-path"
import { LayoutProvider } from "@/hooks/use-layout"
+import { Toaster } from "@/components/ui/sonner"
+import { TooltipProvider } from "@/components/ui/tooltip"
import { ActiveThemeProvider } from "@/components/active-theme"
import { TailwindIndicator } from "@/components/tailwind-indicator"
import { ThemeProvider } from "@/components/theme-provider"
-import { Toaster } from "@/components/ui/sonner"
-import { TooltipProvider } from "@/components/ui/tooltip"
import "@/app/globals.css"
@@ -56,14 +57,22 @@ export const metadata: Metadata = {
},
icons: {
icon: [
- { url: "/extend.svg", type: "image/svg+xml" },
- { url: "/favicon-32x32.png", sizes: "32x32", type: "image/png" },
- { url: "/favicon-16x16.png", sizes: "16x16", type: "image/png" },
+ { url: withUiBasePath("/extend.svg"), type: "image/svg+xml" },
+ {
+ url: withUiBasePath("/favicon-32x32.png"),
+ sizes: "32x32",
+ type: "image/png",
+ },
+ {
+ url: withUiBasePath("/favicon-16x16.png"),
+ sizes: "16x16",
+ type: "image/png",
+ },
],
- shortcut: "/favicon.ico",
- apple: "/apple-touch-icon.png",
+ shortcut: withUiBasePath("/favicon.ico"),
+ apple: withUiBasePath("/apple-touch-icon.png"),
},
- manifest: "/site.webmanifest",
+ manifest: withUiBasePath("/site.webmanifest"),
}
export default function RootLayout({
diff --git a/apps/v4/components.json b/apps/v4/components.json
index 608f26a..775c782 100644
--- a/apps/v4/components.json
+++ b/apps/v4/components.json
@@ -19,7 +19,7 @@
"hooks": "@/hooks"
},
"registries": {
- "@extend": "https://ui.extend.ai/r/{name}.json",
+ "@extend": "https://extend.ai/ui/r/{name}.json",
"@coss": "https://coss.com/ui/r/{name}.json"
}
}
diff --git a/apps/v4/components/bounding-box-citations-docs.tsx b/apps/v4/components/bounding-box-citations-docs.tsx
index 43388da..e017dcb 100644
--- a/apps/v4/components/bounding-box-citations-docs.tsx
+++ b/apps/v4/components/bounding-box-citations-docs.tsx
@@ -43,6 +43,7 @@ import { useTheme } from "next-themes"
import { flushSync } from "react-dom"
import { cn } from "@/lib/utils"
+import { withUiBasePath } from "@/lib/zone-path"
import { useMounted } from "@/hooks/use-mounted"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
@@ -228,8 +229,10 @@ function ScrollAreaVirtualizer({
)
}
-const PDF_URL = "/samples/attention.pdf"
-const BLOCK_REVIEW_PDF_URL = "/samples/bank-statement-x4uhhi7t.pdf"
+const PDF_URL = withUiBasePath("/samples/attention.pdf")
+const BLOCK_REVIEW_PDF_URL = withUiBasePath(
+ "/samples/bank-statement-x4uhhi7t.pdf"
+)
const DEFAULT_ZOOM = 1
const REVIEW_HIGHLIGHT_STYLE =
"border-blue-500/70 bg-blue-500/12 shadow-[0_4px_16px_rgb(59_130_246_/_10%)]"
diff --git a/apps/v4/components/document-splitter-docs.tsx b/apps/v4/components/document-splitter-docs.tsx
index 0b2d5f6..ad979b7 100644
--- a/apps/v4/components/document-splitter-docs.tsx
+++ b/apps/v4/components/document-splitter-docs.tsx
@@ -37,7 +37,10 @@ import { HugeiconsIcon } from "@hugeicons/react"
import type * as ReactPdf from "react-pdf"
import { cn } from "@/lib/utils"
+import { withUiBasePath } from "@/lib/zone-path"
+import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
+import { Card } from "@/components/ui/card"
import {
FileThumbnail,
type ThumbnailFile,
@@ -55,8 +58,6 @@ import {
DocsViewCodeBlock,
} from "@/components/docs-code-block"
import { PdfBlockResizableShell } from "@/components/pdf-block-resizable-shell"
-import { Badge } from "@/components/ui/badge"
-import { Card } from "@/components/ui/card"
type ReactPdfModule = typeof ReactPdf
export type DocumentSplitPageId = `page-${number}`
@@ -71,8 +72,8 @@ export type DocumentSplit = {
}
type SplitGroup = DocumentSplit
-const PDF_URL = "/samples/attention.pdf"
-const XLSX_URL = "/samples/crazy-chart-zoo.xlsx"
+const PDF_URL = withUiBasePath("/samples/attention.pdf")
+const XLSX_URL = withUiBasePath("/samples/crazy-chart-zoo.xlsx")
const XLSX_THUMBNAIL_FILE = {
name: "crazy-chart-zoo.xlsx",
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
@@ -1613,7 +1614,7 @@ export function DocumentSplitsDemo() {
data-slot="component-preview"
className="group relative mt-4 mb-12 flex flex-col overflow-hidden rounded-xl border"
>
- <DocumentSplitsPreview file="/samples/attention.pdf" />
+ <DocumentSplitsPreview file={PDF_URL} />
<DocsViewCodeBlock code={documentSplitterUsageCode} />
</div>
)
diff --git a/apps/v4/components/docx-editor-docs.tsx b/apps/v4/components/docx-editor-docs.tsx
index 44d7a59..1b66d80 100644
--- a/apps/v4/components/docx-editor-docs.tsx
+++ b/apps/v4/components/docx-editor-docs.tsx
@@ -3,6 +3,7 @@
import * as React from "react"
import dynamic from "next/dynamic"
+import { withUiBasePath } from "@/lib/zone-path"
import { Button } from "@/components/ui/button"
import { Spinner } from "@/components/ui/spinner"
import {
@@ -10,6 +11,8 @@ import {
DocsViewCodeBlock,
} from "@/components/docs-code-block"
+const SAMPLE_DOCX_URL = withUiBasePath("/samples/demo.docx")
+
function EditorPreviewLoading() {
return (
<div className="grid h-[720px] place-items-center bg-background">
@@ -33,7 +36,7 @@ export function DocxEditorDemo() {
data-slot="component-preview"
className="group relative mt-4 mb-12 flex flex-col overflow-hidden rounded-xl border"
>
- <DocxEditorPreview src="/samples/demo.docx" />
+ <DocxEditorPreview src={SAMPLE_DOCX_URL} />
<DocsViewCodeBlock code={docxEditorUsageCode} />
</div>
)
@@ -48,7 +51,7 @@ export function DocxEditorBlock({
}) {
return (
<DocxEditorPreview
- src={file ?? "/samples/demo.docx"}
+ src={file ?? SAMPLE_DOCX_URL}
defaultZoomScale={Math.round(defaultViewerZoom * 100)}
/>
)
diff --git a/apps/v4/components/docx-viewer-docs.tsx b/apps/v4/components/docx-viewer-docs.tsx
index 235783d..c00723d 100644
--- a/apps/v4/components/docx-viewer-docs.tsx
+++ b/apps/v4/components/docx-viewer-docs.tsx
@@ -3,6 +3,7 @@
import * as React from "react"
import dynamic from "next/dynamic"
+import { withUiBasePath } from "@/lib/zone-path"
import { Button } from "@/components/ui/button"
import { Spinner } from "@/components/ui/spinner"
import {
@@ -10,6 +11,8 @@ import {
DocsViewCodeBlock,
} from "@/components/docs-code-block"
+const SAMPLE_DOCX_URL = withUiBasePath("/samples/demo.docx")
+
function ViewerPreviewLoading() {
return (
<div className="grid h-[640px] place-items-center bg-background">
@@ -34,7 +37,7 @@ export function DocxViewerDemo() {
className="group relative mt-4 mb-12 flex flex-col overflow-hidden rounded-xl border"
>
<DocxViewerPreview
- src="/samples/demo.docx"
+ src={SAMPLE_DOCX_URL}
defaultThumbnailSidebarOpen={false}
/>
<DocsViewCodeBlock code={docxViewerUsageCode} />
diff --git a/apps/v4/components/e-signature-docs.tsx b/apps/v4/components/e-signature-docs.tsx
index b5c4326..5247e99 100644
--- a/apps/v4/components/e-signature-docs.tsx
+++ b/apps/v4/components/e-signature-docs.tsx
@@ -11,14 +11,8 @@ import { HugeiconsIcon } from "@hugeicons/react"
import type SignaturePad from "signature_pad"
import { cn } from "@/lib/utils"
+import { withUiBasePath } from "@/lib/zone-path"
import { Button } from "@/components/ui/button"
-import { PDFViewer } from "@/components/ui/pdf-viewer"
-import { ScrollArea } from "@/components/ui/scroll-area"
-import {
- DocsSourceCodeBlock,
- DocsViewCodeBlock,
-} from "@/components/docs-code-block"
-import { PdfBlockResizableShell } from "@/components/pdf-block-resizable-shell"
import {
Dialog,
DialogContent,
@@ -28,6 +22,13 @@ import {
DialogPanel,
DialogTitle,
} from "@/components/ui/dialog"
+import { PDFViewer } from "@/components/ui/pdf-viewer"
+import { ScrollArea } from "@/components/ui/scroll-area"
+import {
+ DocsSourceCodeBlock,
+ DocsViewCodeBlock,
+} from "@/components/docs-code-block"
+import { PdfBlockResizableShell } from "@/components/pdf-block-resizable-shell"
type BoundingBox = {
x: number
@@ -44,7 +45,7 @@ type SignatureField = {
imageDataUrl?: string
}
-const PDF_URL = "/samples/loan-application.pdf"
+const PDF_URL = withUiBasePath("/samples/loan-application.pdf")
const PAGE_WIDTH = 612
const PAGE_HEIGHT = 792
const DEFAULT_ZOOM = 1
diff --git a/apps/v4/components/file-thumbnail-docs.tsx b/apps/v4/components/file-thumbnail-docs.tsx
index fdf3aae..dced93f 100644
--- a/apps/v4/components/file-thumbnail-docs.tsx
+++ b/apps/v4/components/file-thumbnail-docs.tsx
@@ -14,6 +14,7 @@ import {
} from "@extend-ai/react-xlsx"
import type * as ReactPdf from "react-pdf"
+import { withUiBasePath } from "@/lib/zone-path"
import { Button } from "@/components/ui/button"
import {
FileThumbnail,
@@ -55,28 +56,28 @@ export const SAMPLE_FILES: DemoFile[] = [
type: "image/png",
description: "Image",
kind: "image",
- url: "/opengraph-image.png",
+ url: withUiBasePath("/opengraph-image.png"),
},
{
name: "attention.pdf",
type: "application/pdf",
description: "PDF",
kind: "pdf",
- url: "/samples/attention.pdf",
+ url: withUiBasePath("/samples/attention.pdf"),
},
{
name: "demo.docx",
type: DOCX_MIME_TYPE,
description: "DOCX",
kind: "docx",
- url: "/samples/demo.docx",
+ url: withUiBasePath("/samples/demo.docx"),
},
{
name: "crazy-chart-zoo.xlsx",
type: XLSX_MIME_TYPE,
description: "XLSX",
kind: "xlsx",
- url: "/samples/crazy-chart-zoo.xlsx",
+ url: withUiBasePath("/samples/crazy-chart-zoo.xlsx"),
},
]
diff --git a/apps/v4/components/icons.tsx b/apps/v4/components/icons.tsx
index 09ac723..bd2ab7c 100644
--- a/apps/v4/components/icons.tsx
+++ b/apps/v4/components/icons.tsx
@@ -2,18 +2,21 @@ import { File01Icon } from "@hugeicons/core-free-icons"
import { HugeiconsIcon } from "@hugeicons/react"
import { cn } from "@/lib/utils"
+import { withUiBasePath } from "@/lib/zone-path"
type IconProps = React.HTMLAttributes<SVGElement>
type LogoProps = React.HTMLAttributes<HTMLSpanElement>
+const logoMaskUrl = `url('${withUiBasePath("/extend.svg")}') center / contain no-repeat`
+
export const Icons = {
logo: ({ className, style, ...props }: LogoProps) => (
<span
aria-hidden="true"
className={cn("inline-block bg-foreground", className)}
style={{
- mask: "url('/extend.svg') center / contain no-repeat",
- WebkitMask: "url('/extend.svg') center / contain no-repeat",
+ mask: logoMaskUrl,
+ WebkitMask: logoMaskUrl,
...style,
}}
{...props}
diff --git a/apps/v4/components/layout-blocks-docs.tsx b/apps/v4/components/layout-blocks-docs.tsx
index 390379f..dd89252 100644
--- a/apps/v4/components/layout-blocks-docs.tsx
+++ b/apps/v4/components/layout-blocks-docs.tsx
@@ -19,6 +19,7 @@ import rehypeSanitize, { defaultSchema } from "rehype-sanitize"
import remarkGfm from "remark-gfm"
import { cn } from "@/lib/utils"
+import { withUiBasePath } from "@/lib/zone-path"
import { Button } from "@/components/ui/button"
import { PDFViewer, type PDFViewerHandle } from "@/components/ui/pdf-viewer"
import { ScrollArea } from "@/components/ui/scroll-area"
@@ -93,7 +94,7 @@ type HighlightArea = {
height: number
}
-const PDF_URL = "/samples/attention-rotated.pdf"
+const PDF_URL = withUiBasePath("/samples/attention-rotated.pdf")
const DEFAULT_ZOOM = 1
const ROOT_OCR_PREVIEW_PAGE = 1
const OCR_BLOCK_ROW_MIN_ESTIMATE = 92
diff --git a/apps/v4/components/pdf-viewer-preview-client.tsx b/apps/v4/components/pdf-viewer-preview-client.tsx
index cd8e1ad..08d825d 100644
--- a/apps/v4/components/pdf-viewer-preview-client.tsx
+++ b/apps/v4/components/pdf-viewer-preview-client.tsx
@@ -1,8 +1,9 @@
"use client"
+import { withUiBasePath } from "@/lib/zone-path"
import { PDFViewer } from "@/components/ui/pdf-viewer"
-const SAMPLE_PDF_URL = "/samples/attention.pdf"
+const SAMPLE_PDF_URL = withUiBasePath("/samples/attention.pdf")
export function PdfViewerPreviewClient({
file = SAMPLE_PDF_URL,
diff --git a/apps/v4/components/root-components-collage.tsx b/apps/v4/components/root-components-collage.tsx
index 2782f13..a6314a1 100644
--- a/apps/v4/components/root-components-collage.tsx
+++ b/apps/v4/components/root-components-collage.tsx
@@ -8,6 +8,7 @@ import { ArrowRight01Icon } from "@hugeicons/core-free-icons"
import { HugeiconsIcon } from "@hugeicons/react"
import { cn } from "@/lib/utils"
+import { withUiBasePath } from "@/lib/zone-path"
import { Button } from "@/components/ui/button"
import {
DocumentSplits,
@@ -24,6 +25,12 @@ import {
import { FileUpload } from "@/components/file-upload-docs"
const ROOT_PREVIEW_LAZY_ROOT_MARGIN = "900px 0px"
+const ROOT_ATTENTION_PDF_URL = withUiBasePath("/samples/attention.pdf")
+const ROOT_ATTENTION_THUMBNAIL_URL = withUiBasePath(
+ "/samples/attention-page-1.png"
+)
+const ROOT_DOCX_URL = withUiBasePath("/samples/demo.docx")
+const ROOT_XLSX_URL = withUiBasePath("/samples/crazy-chart-zoo.xlsx")
const PdfViewerPreview = dynamic(
() =>
@@ -96,7 +103,7 @@ export function MobileRootPreview() {
return (
<div className="relative bg-background px-4">
<Image
- src="/images/root-components-showcase-light-v2.png"
+ src={withUiBasePath("/images/root-components-showcase-light-v2.png")}
width={1566}
height={1114}
alt="Document component previews"
@@ -105,7 +112,7 @@ export function MobileRootPreview() {
sizes="150vw"
/>
<Image
- src="/images/root-components-showcase-dark-v2.png"
+ src={withUiBasePath("/images/root-components-showcase-dark-v2.png")}
width={1566}
height={1114}
alt="Document component previews"
@@ -175,7 +182,7 @@ function PdfViewerTile() {
className="h-[560px] bg-background"
>
<PdfViewerPreview
- file="/samples/attention.pdf"
+ file={ROOT_ATTENTION_PDF_URL}
showRotateControls={false}
/>
</ComponentCrop>
@@ -213,7 +220,7 @@ function DocxViewerTile() {
viewHref="/docs/components/docx-viewer"
className="h-[560px] bg-background"
>
- <DocxViewerPreview className="h-full" src="/samples/demo.docx" />
+ <DocxViewerPreview className="h-full" src={ROOT_DOCX_URL} />
</ComponentCrop>
)
}
@@ -225,10 +232,7 @@ function ComponentXlsxViewerTile() {
viewHref="/docs/components/xlsx-viewer"
className="h-[540px] bg-background 4xl:h-[500px]"
>
- <XlsxViewerPreview
- className="h-full"
- src="/samples/crazy-chart-zoo.xlsx"
- />
+ <XlsxViewerPreview className="h-full" src={ROOT_XLSX_URL} />
</ComponentCrop>
)
}
@@ -330,10 +334,7 @@ function BlockXlsxViewerTile() {
className="h-[640px] bg-background"
>
<RootPreviewLoader>
- <XlsxViewerPreview
- className="h-full"
- src="/samples/crazy-chart-zoo.xlsx"
- />
+ <XlsxViewerPreview className="h-full" src={ROOT_XLSX_URL} />
</RootPreviewLoader>
</ComponentCrop>
)
@@ -356,7 +357,7 @@ function ESignatureTile() {
const ROOT_DOCUMENT_SPLIT_THUMBNAILS = Object.fromEntries(
INITIAL_SPLITS.flatMap((split) => split.pages).map((pageId) => [
pageId,
- "/samples/attention-page-1.png",
+ ROOT_ATTENTION_THUMBNAIL_URL,
])
) as Record<DocumentSplit["pages"][number], string>
diff --git a/apps/v4/components/root-liquid-logo.tsx b/apps/v4/components/root-liquid-logo.tsx
index f786e33..d96fe3c 100644
--- a/apps/v4/components/root-liquid-logo.tsx
+++ b/apps/v4/components/root-liquid-logo.tsx
@@ -5,6 +5,7 @@ import { GemSmoke, type GemSmokeProps } from "@paper-design/shaders-react"
import { useTheme } from "next-themes"
import { cn } from "@/lib/utils"
+import { withUiBasePath } from "@/lib/zone-path"
import { useMediaQuery } from "@/hooks/use-media-query"
const SMOKE_COLORS = ["#004CFF", "#FF8C00", "#FFB066", "#FFD29A"]
@@ -32,7 +33,7 @@ export function RootLiquidLogo({ className }: { className?: string }) {
const smokeProps = {
width: "100%",
height: "100%",
- image: "/extend-logo.svg",
+ image: withUiBasePath("/extend-logo.svg"),
colors: SMOKE_COLORS,
colorBack: "#00000000",
colorInner,
diff --git a/apps/v4/components/xlsx-editor-docs.tsx b/apps/v4/components/xlsx-editor-docs.tsx
index 1da3619..7ae77a6 100644
--- a/apps/v4/components/xlsx-editor-docs.tsx
+++ b/apps/v4/components/xlsx-editor-docs.tsx
@@ -3,6 +3,7 @@
import * as React from "react"
import dynamic from "next/dynamic"
+import { withUiBasePath } from "@/lib/zone-path"
import { Button } from "@/components/ui/button"
import { Spinner } from "@/components/ui/spinner"
import {
@@ -10,6 +11,8 @@ import {
DocsViewCodeBlock,
} from "@/components/docs-code-block"
+const SAMPLE_XLSX_URL = withUiBasePath("/samples/crazy-chart-zoo.xlsx")
+
function EditorPreviewLoading() {
return (
<div className="grid h-[640px] place-items-center bg-background">
@@ -33,7 +36,7 @@ export function XlsxEditorDemo() {
data-slot="component-preview"
className="group relative mt-4 mb-12 flex flex-col overflow-hidden rounded-xl border"
>
- <XlsxEditorPreview src="/samples/crazy-chart-zoo.xlsx" />
+ <XlsxEditorPreview src={SAMPLE_XLSX_URL} />
<DocsViewCodeBlock code={xlsxEditorUsageCode} />
</div>
)
diff --git a/apps/v4/components/xlsx-viewer-docs.tsx b/apps/v4/components/xlsx-viewer-docs.tsx
index 288f146..02fe278 100644
--- a/apps/v4/components/xlsx-viewer-docs.tsx
+++ b/apps/v4/components/xlsx-viewer-docs.tsx
@@ -3,6 +3,7 @@
import * as React from "react"
import dynamic from "next/dynamic"
+import { withUiBasePath } from "@/lib/zone-path"
import { Button } from "@/components/ui/button"
import { Spinner } from "@/components/ui/spinner"
import {
@@ -10,6 +11,8 @@ import {
DocsViewCodeBlock,
} from "@/components/docs-code-block"
+const SAMPLE_XLSX_URL = withUiBasePath("/samples/crazy-chart-zoo.xlsx")
+
function ViewerPreviewLoading() {
return (
<div className="grid h-[640px] place-items-center bg-background">
@@ -33,7 +36,7 @@ export function XlsxViewerDemo() {
data-slot="component-preview"
className="group relative mt-4 mb-12 flex flex-col overflow-hidden rounded-xl border"
>
- <XlsxViewerPreview src="/samples/crazy-chart-zoo.xlsx" />
+ <XlsxViewerPreview src={SAMPLE_XLSX_URL} />
<DocsViewCodeBlock code={xlsxViewerUsageCode} />
</div>
)
diff --git a/apps/v4/lib/config.ts b/apps/v4/lib/config.ts
index 70eec88..7c72a8f 100644
--- a/apps/v4/lib/config.ts
+++ b/apps/v4/lib/config.ts
@@ -1,4 +1,4 @@
-const appUrl = process.env.NEXT_PUBLIC_APP_URL ?? "https://ui.extend.ai"
+const appUrl = process.env.NEXT_PUBLIC_APP_URL ?? "https://extend.ai/ui"
export const siteConfig = {
name: "Extend UI",
diff --git a/apps/v4/lib/zone-path.ts b/apps/v4/lib/zone-path.ts
new file mode 100644
index 0000000..a985bb3
--- /dev/null
+++ b/apps/v4/lib/zone-path.ts
@@ -0,0 +1,10 @@
+export const UI_BASE_PATH = process.env.NEXT_PUBLIC_BASE_PATH ?? "/ui"
+
+export function withUiBasePath(path: string) {
+ if (!path.startsWith("/")) return path
+ if (path === UI_BASE_PATH || path.startsWith(`${UI_BASE_PATH}/`)) {
+ return path
+ }
+
+ return `${UI_BASE_PATH}${path}`
+}
diff --git a/apps/v4/next.config.mjs b/apps/v4/next.config.mjs
index db44840..40a85ee 100644
--- a/apps/v4/next.config.mjs
+++ b/apps/v4/next.config.mjs
@@ -1,8 +1,13 @@
import path from "path"
import { createMDX } from "fumadocs-mdx/next"
+const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? "/ui"
+const assetPrefix = process.env.NEXT_PUBLIC_ASSET_PREFIX ?? "/ui-static"
+
/** @type {import('next').NextConfig} */
const nextConfig = {
+ basePath,
+ assetPrefix,
devIndicators: false,
typescript: {
ignoreBuildErrors: true,
@@ -57,6 +62,42 @@ const nextConfig = {
},
redirects() {
return [
+ {
+ source: "/",
+ destination: basePath,
+ permanent: false,
+ basePath: false,
+ },
+ {
+ source: "/docs/:path*",
+ destination: `${basePath}/docs/:path*`,
+ permanent: true,
+ basePath: false,
+ },
+ {
+ source: "/blocks",
+ destination: `${basePath}/blocks`,
+ permanent: true,
+ basePath: false,
+ },
+ {
+ source: "/view/:path*",
+ destination: `${basePath}/view/:path*`,
+ permanent: true,
+ basePath: false,
+ },
+ {
+ source: "/r/:path*",
+ destination: `${basePath}/r/:path*`,
+ permanent: true,
+ basePath: false,
+ },
+ {
+ source: "/components",
+ destination: `${basePath}/docs/components`,
+ permanent: true,
+ basePath: false,
+ },
{
source: "/components",
destination: "/docs/components",
diff --git a/apps/v4/public/site.webmanifest b/apps/v4/public/site.webmanifest
index 27a37c5..9b3bb75 100644
--- a/apps/v4/public/site.webmanifest
+++ b/apps/v4/public/site.webmanifest
@@ -3,17 +3,17 @@
"short_name": "Extend UI",
"icons": [
{
- "src": "/android-chrome-192x192.png",
+ "src": "/ui/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
- "src": "/android-chrome-512x512.png",
+ "src": "/ui/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
},
{
- "src": "/extend.svg",
+ "src": "/ui/extend.svg",
"sizes": "any",
"type": "image/svg+xml"
}