diff --git a/www/apps/api-reference/app/layout.tsx b/www/apps/api-reference/app/layout.tsx index 1aaad14356a31..e66e474383045 100644 --- a/www/apps/api-reference/app/layout.tsx +++ b/www/apps/api-reference/app/layout.tsx @@ -1,6 +1,6 @@ import "./globals.css" import Providers from "../providers" -import { WideLayout } from "docs-ui" +import { BareboneLayout, WideLayout } from "docs-ui" import { Inter, Roboto_Mono } from "next/font/google" import clsx from "clsx" @@ -26,17 +26,18 @@ export default function RootLayout({ children: React.ReactNode }) { return ( - - {children} - + + + {children} + + ) } diff --git a/www/apps/api-reference/components/DownloadFull/index.tsx b/www/apps/api-reference/components/DownloadFull/index.tsx index d60c6d42b4012..5504cf398bb5d 100644 --- a/www/apps/api-reference/components/DownloadFull/index.tsx +++ b/www/apps/api-reference/components/DownloadFull/index.tsx @@ -9,11 +9,7 @@ const DownloadFull = () => { return ( diff --git a/www/apps/book/app/not-found.mdx b/www/apps/book/app/_not-found.mdx similarity index 100% rename from www/apps/book/app/not-found.mdx rename to www/apps/book/app/_not-found.mdx diff --git a/www/apps/book/app/fonts.ts b/www/apps/book/app/fonts.ts new file mode 100644 index 0000000000000..e6c4972f38aa5 --- /dev/null +++ b/www/apps/book/app/fonts.ts @@ -0,0 +1,12 @@ +import { Inter, Roboto_Mono } from "next/font/google" + +export const inter = Inter({ + subsets: ["latin"], + variable: "--font-inter", + weight: ["400", "500"], +}) + +export const robotoMono = Roboto_Mono({ + subsets: ["latin"], + variable: "--font-roboto-mono", +}) diff --git a/www/apps/book/app/globals.css b/www/apps/book/app/globals.css index abdd9847fb297..4f4a8320117fa 100644 --- a/www/apps/book/app/globals.css +++ b/www/apps/book/app/globals.css @@ -16,10 +16,14 @@ @apply bg-medusa-bg-highlight; } - * { + *:not(.code-block-elm) { scrollbar-color: var(--docs-border-base) var(--docs-bg-base); } + .code-block-elm { + scrollbar-color: var(--docs-contrast-border-base) transparent; + } + aside * { scrollbar-color: var(--docs-border-base) var(--docs-bg-subtle); } diff --git a/www/apps/book/app/layout.tsx b/www/apps/book/app/layout.tsx index 13c157f552420..ffb3ac9641966 100644 --- a/www/apps/book/app/layout.tsx +++ b/www/apps/book/app/layout.tsx @@ -1,12 +1,9 @@ import type { Metadata } from "next" -import { Inter, Roboto_Mono } from "next/font/google" -import Providers from "@/providers" import "./globals.css" -import { TightLayout } from "docs-ui" import { config } from "@/config" +import { BareboneLayout } from "docs-ui" +import { inter, robotoMono } from "./fonts" import clsx from "clsx" -import Feedback from "@/components/Feedback" -import EditButton from "@/components/EditButton" export const metadata: Metadata = { title: { @@ -19,34 +16,14 @@ export const metadata: Metadata = { ), } -export const inter = Inter({ - subsets: ["latin"], - variable: "--font-inter", - weight: ["400", "500"], -}) - -export const robotoMono = Roboto_Mono({ - subsets: ["latin"], - variable: "--font-roboto-mono", -}) - export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( - } - editComponent={} - > + {children} - + ) } diff --git a/www/apps/book/app/advanced-development/admin/constraints/page.mdx b/www/apps/book/app/learn/advanced-development/admin/constraints/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/admin/constraints/page.mdx rename to www/apps/book/app/learn/advanced-development/admin/constraints/page.mdx diff --git a/www/apps/book/app/advanced-development/admin/page.mdx b/www/apps/book/app/learn/advanced-development/admin/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/admin/page.mdx rename to www/apps/book/app/learn/advanced-development/admin/page.mdx diff --git a/www/apps/book/app/advanced-development/admin/tips/page.mdx b/www/apps/book/app/learn/advanced-development/admin/tips/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/admin/tips/page.mdx rename to www/apps/book/app/learn/advanced-development/admin/tips/page.mdx diff --git a/www/apps/book/app/advanced-development/admin/ui-routes/page.mdx b/www/apps/book/app/learn/advanced-development/admin/ui-routes/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/admin/ui-routes/page.mdx rename to www/apps/book/app/learn/advanced-development/admin/ui-routes/page.mdx diff --git a/www/apps/book/app/advanced-development/admin/widgets/page.mdx b/www/apps/book/app/learn/advanced-development/admin/widgets/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/admin/widgets/page.mdx rename to www/apps/book/app/learn/advanced-development/admin/widgets/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/additional-data/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/additional-data/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/additional-data/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/additional-data/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/cors/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/cors/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/cors/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/cors/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/errors/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/errors/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/errors/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/errors/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/http-methods/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/http-methods/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/http-methods/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/http-methods/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/middlewares/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/middlewares/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/middlewares/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/middlewares/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/parameters/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/parameters/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/parameters/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/parameters/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/protected-routes/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/protected-routes/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/protected-routes/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/protected-routes/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/responses/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/responses/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/responses/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/responses/page.mdx diff --git a/www/apps/book/app/advanced-development/api-routes/validation/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/validation/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/api-routes/validation/page.mdx rename to www/apps/book/app/learn/advanced-development/api-routes/validation/page.mdx diff --git a/www/apps/book/app/advanced-development/architecture/architectural-modules/page.mdx b/www/apps/book/app/learn/advanced-development/architecture/architectural-modules/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/architecture/architectural-modules/page.mdx rename to www/apps/book/app/learn/advanced-development/architecture/architectural-modules/page.mdx diff --git a/www/apps/book/app/advanced-development/architecture/overview/page.mdx b/www/apps/book/app/learn/advanced-development/architecture/overview/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/architecture/overview/page.mdx rename to www/apps/book/app/learn/advanced-development/architecture/overview/page.mdx diff --git a/www/apps/book/app/advanced-development/custom-cli-scripts/page.mdx b/www/apps/book/app/learn/advanced-development/custom-cli-scripts/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/custom-cli-scripts/page.mdx rename to www/apps/book/app/learn/advanced-development/custom-cli-scripts/page.mdx diff --git a/www/apps/book/app/advanced-development/custom-cli-scripts/seed-data/page.mdx b/www/apps/book/app/learn/advanced-development/custom-cli-scripts/seed-data/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/custom-cli-scripts/seed-data/page.mdx rename to www/apps/book/app/learn/advanced-development/custom-cli-scripts/seed-data/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/configure-properties/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/configure-properties/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/configure-properties/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/configure-properties/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/default-properties/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/default-properties/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/default-properties/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/default-properties/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/index/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/index/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/index/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/index/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/infer-type/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/infer-type/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/infer-type/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/infer-type/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/manage-relationships/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/manage-relationships/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/manage-relationships/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/manage-relationships/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/primary-key/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/primary-key/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/primary-key/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/primary-key/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/property-types/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/property-types/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/property-types/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/property-types/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/relationships/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/relationships/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/relationships/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/relationships/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/searchable-property/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/searchable-property/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/searchable-property/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/searchable-property/page.mdx diff --git a/www/apps/book/app/advanced-development/data-models/write-migration/page.mdx b/www/apps/book/app/learn/advanced-development/data-models/write-migration/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/data-models/write-migration/page.mdx rename to www/apps/book/app/learn/advanced-development/data-models/write-migration/page.mdx diff --git a/www/apps/book/app/advanced-development/events-and-subscribers/data-payload/page.mdx b/www/apps/book/app/learn/advanced-development/events-and-subscribers/data-payload/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/events-and-subscribers/data-payload/page.mdx rename to www/apps/book/app/learn/advanced-development/events-and-subscribers/data-payload/page.mdx diff --git a/www/apps/book/app/advanced-development/events-and-subscribers/emit-event/page.mdx b/www/apps/book/app/learn/advanced-development/events-and-subscribers/emit-event/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/events-and-subscribers/emit-event/page.mdx rename to www/apps/book/app/learn/advanced-development/events-and-subscribers/emit-event/page.mdx diff --git a/www/apps/book/app/advanced-development/module-links/custom-columns/page.mdx b/www/apps/book/app/learn/advanced-development/module-links/custom-columns/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/module-links/custom-columns/page.mdx rename to www/apps/book/app/learn/advanced-development/module-links/custom-columns/page.mdx diff --git a/www/apps/book/app/advanced-development/module-links/directions/page.mdx b/www/apps/book/app/learn/advanced-development/module-links/directions/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/module-links/directions/page.mdx rename to www/apps/book/app/learn/advanced-development/module-links/directions/page.mdx diff --git a/www/apps/book/app/advanced-development/module-links/page.mdx b/www/apps/book/app/learn/advanced-development/module-links/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/module-links/page.mdx rename to www/apps/book/app/learn/advanced-development/module-links/page.mdx diff --git a/www/apps/book/app/advanced-development/module-links/query/page.mdx b/www/apps/book/app/learn/advanced-development/module-links/query/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/module-links/query/page.mdx rename to www/apps/book/app/learn/advanced-development/module-links/query/page.mdx diff --git a/www/apps/book/app/advanced-development/module-links/remote-link/page.mdx b/www/apps/book/app/learn/advanced-development/module-links/remote-link/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/module-links/remote-link/page.mdx rename to www/apps/book/app/learn/advanced-development/module-links/remote-link/page.mdx diff --git a/www/apps/book/app/advanced-development/modules/container/page.mdx b/www/apps/book/app/learn/advanced-development/modules/container/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/modules/container/page.mdx rename to www/apps/book/app/learn/advanced-development/modules/container/page.mdx diff --git a/www/apps/book/app/advanced-development/modules/db-operations/page.mdx b/www/apps/book/app/learn/advanced-development/modules/db-operations/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/modules/db-operations/page.mdx rename to www/apps/book/app/learn/advanced-development/modules/db-operations/page.mdx diff --git a/www/apps/book/app/advanced-development/modules/isolation/page.mdx b/www/apps/book/app/learn/advanced-development/modules/isolation/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/modules/isolation/page.mdx rename to www/apps/book/app/learn/advanced-development/modules/isolation/page.mdx diff --git a/www/apps/book/app/advanced-development/modules/multiple-services/page.mdx b/www/apps/book/app/learn/advanced-development/modules/multiple-services/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/modules/multiple-services/page.mdx rename to www/apps/book/app/learn/advanced-development/modules/multiple-services/page.mdx diff --git a/www/apps/book/app/advanced-development/modules/options/page.mdx b/www/apps/book/app/learn/advanced-development/modules/options/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/modules/options/page.mdx rename to www/apps/book/app/learn/advanced-development/modules/options/page.mdx diff --git a/www/apps/book/app/advanced-development/modules/page.mdx b/www/apps/book/app/learn/advanced-development/modules/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/modules/page.mdx rename to www/apps/book/app/learn/advanced-development/modules/page.mdx diff --git a/www/apps/book/app/advanced-development/modules/service-constraints/page.mdx b/www/apps/book/app/learn/advanced-development/modules/service-constraints/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/modules/service-constraints/page.mdx rename to www/apps/book/app/learn/advanced-development/modules/service-constraints/page.mdx diff --git a/www/apps/book/app/advanced-development/modules/service-factory/page.mdx b/www/apps/book/app/learn/advanced-development/modules/service-factory/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/modules/service-factory/page.mdx rename to www/apps/book/app/learn/advanced-development/modules/service-factory/page.mdx diff --git a/www/apps/book/app/advanced-development/page.mdx b/www/apps/book/app/learn/advanced-development/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/page.mdx rename to www/apps/book/app/learn/advanced-development/page.mdx diff --git a/www/apps/book/app/advanced-development/scheduled-jobs/execution-number/page.mdx b/www/apps/book/app/learn/advanced-development/scheduled-jobs/execution-number/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/scheduled-jobs/execution-number/page.mdx rename to www/apps/book/app/learn/advanced-development/scheduled-jobs/execution-number/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/access-workflow-errors/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/access-workflow-errors/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/access-workflow-errors/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/access-workflow-errors/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/add-workflow-hook/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/add-workflow-hook/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/add-workflow-hook/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/add-workflow-hook/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/compensation-function/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/compensation-function/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/compensation-function/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/compensation-function/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/conditions/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/conditions/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/conditions/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/conditions/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/constructor-constraints/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/constructor-constraints/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/constructor-constraints/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/constructor-constraints/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/execute-another-workflow/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/execute-another-workflow/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/execute-another-workflow/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/execute-another-workflow/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/long-running-workflow/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/long-running-workflow/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/long-running-workflow/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/long-running-workflow/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/parallel-steps/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/parallel-steps/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/parallel-steps/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/parallel-steps/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/retry-failed-steps/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/retry-failed-steps/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/retry-failed-steps/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/retry-failed-steps/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/variable-manipulation/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/variable-manipulation/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/variable-manipulation/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/variable-manipulation/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/workflow-hooks/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/workflow-hooks/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/workflow-hooks/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/workflow-hooks/page.mdx diff --git a/www/apps/book/app/advanced-development/workflows/workflow-timeout/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/workflow-timeout/page.mdx similarity index 100% rename from www/apps/book/app/advanced-development/workflows/workflow-timeout/page.mdx rename to www/apps/book/app/learn/advanced-development/workflows/workflow-timeout/page.mdx diff --git a/www/apps/book/app/basics/admin-customizations/page.mdx b/www/apps/book/app/learn/basics/admin-customizations/page.mdx similarity index 100% rename from www/apps/book/app/basics/admin-customizations/page.mdx rename to www/apps/book/app/learn/basics/admin-customizations/page.mdx diff --git a/www/apps/book/app/basics/api-routes/page.mdx b/www/apps/book/app/learn/basics/api-routes/page.mdx similarity index 100% rename from www/apps/book/app/basics/api-routes/page.mdx rename to www/apps/book/app/learn/basics/api-routes/page.mdx diff --git a/www/apps/book/app/basics/commerce-modules/page.mdx b/www/apps/book/app/learn/basics/commerce-modules/page.mdx similarity index 100% rename from www/apps/book/app/basics/commerce-modules/page.mdx rename to www/apps/book/app/learn/basics/commerce-modules/page.mdx diff --git a/www/apps/book/app/basics/events-and-subscribers/page.mdx b/www/apps/book/app/learn/basics/events-and-subscribers/page.mdx similarity index 100% rename from www/apps/book/app/basics/events-and-subscribers/page.mdx rename to www/apps/book/app/learn/basics/events-and-subscribers/page.mdx diff --git a/www/apps/book/app/basics/loaders/page.mdx b/www/apps/book/app/learn/basics/loaders/page.mdx similarity index 100% rename from www/apps/book/app/basics/loaders/page.mdx rename to www/apps/book/app/learn/basics/loaders/page.mdx diff --git a/www/apps/book/app/basics/medusa-container/page.mdx b/www/apps/book/app/learn/basics/medusa-container/page.mdx similarity index 100% rename from www/apps/book/app/basics/medusa-container/page.mdx rename to www/apps/book/app/learn/basics/medusa-container/page.mdx diff --git a/www/apps/book/app/basics/modules-directory-structure/page.mdx b/www/apps/book/app/learn/basics/modules-directory-structure/page.mdx similarity index 100% rename from www/apps/book/app/basics/modules-directory-structure/page.mdx rename to www/apps/book/app/learn/basics/modules-directory-structure/page.mdx diff --git a/www/apps/book/app/basics/modules/page.mdx b/www/apps/book/app/learn/basics/modules/page.mdx similarity index 100% rename from www/apps/book/app/basics/modules/page.mdx rename to www/apps/book/app/learn/basics/modules/page.mdx diff --git a/www/apps/book/app/basics/page.mdx b/www/apps/book/app/learn/basics/page.mdx similarity index 100% rename from www/apps/book/app/basics/page.mdx rename to www/apps/book/app/learn/basics/page.mdx diff --git a/www/apps/book/app/basics/project-directories-files/page.mdx b/www/apps/book/app/learn/basics/project-directories-files/page.mdx similarity index 100% rename from www/apps/book/app/basics/project-directories-files/page.mdx rename to www/apps/book/app/learn/basics/project-directories-files/page.mdx diff --git a/www/apps/book/app/basics/scheduled-jobs/page.mdx b/www/apps/book/app/learn/basics/scheduled-jobs/page.mdx similarity index 100% rename from www/apps/book/app/basics/scheduled-jobs/page.mdx rename to www/apps/book/app/learn/basics/scheduled-jobs/page.mdx diff --git a/www/apps/book/app/basics/workflows/page.mdx b/www/apps/book/app/learn/basics/workflows/page.mdx similarity index 100% rename from www/apps/book/app/basics/workflows/page.mdx rename to www/apps/book/app/learn/basics/workflows/page.mdx diff --git a/www/apps/book/app/customization/custom-features/api-route/page.mdx b/www/apps/book/app/learn/customization/custom-features/api-route/page.mdx similarity index 100% rename from www/apps/book/app/customization/custom-features/api-route/page.mdx rename to www/apps/book/app/learn/customization/custom-features/api-route/page.mdx diff --git a/www/apps/book/app/customization/custom-features/module/page.mdx b/www/apps/book/app/learn/customization/custom-features/module/page.mdx similarity index 100% rename from www/apps/book/app/customization/custom-features/module/page.mdx rename to www/apps/book/app/learn/customization/custom-features/module/page.mdx diff --git a/www/apps/book/app/customization/custom-features/page.mdx b/www/apps/book/app/learn/customization/custom-features/page.mdx similarity index 100% rename from www/apps/book/app/customization/custom-features/page.mdx rename to www/apps/book/app/learn/customization/custom-features/page.mdx diff --git a/www/apps/book/app/customization/custom-features/workflow/page.mdx b/www/apps/book/app/learn/customization/custom-features/workflow/page.mdx similarity index 100% rename from www/apps/book/app/customization/custom-features/workflow/page.mdx rename to www/apps/book/app/learn/customization/custom-features/workflow/page.mdx diff --git a/www/apps/book/app/customization/customize-admin/page.mdx b/www/apps/book/app/learn/customization/customize-admin/page.mdx similarity index 100% rename from www/apps/book/app/customization/customize-admin/page.mdx rename to www/apps/book/app/learn/customization/customize-admin/page.mdx diff --git a/www/apps/book/app/customization/customize-admin/route/page.mdx b/www/apps/book/app/learn/customization/customize-admin/route/page.mdx similarity index 100% rename from www/apps/book/app/customization/customize-admin/route/page.mdx rename to www/apps/book/app/learn/customization/customize-admin/route/page.mdx diff --git a/www/apps/book/app/customization/customize-admin/widget/page.mdx b/www/apps/book/app/learn/customization/customize-admin/widget/page.mdx similarity index 100% rename from www/apps/book/app/customization/customize-admin/widget/page.mdx rename to www/apps/book/app/learn/customization/customize-admin/widget/page.mdx diff --git a/www/apps/book/app/customization/extend-models/create-links/page.mdx b/www/apps/book/app/learn/customization/extend-models/create-links/page.mdx similarity index 100% rename from www/apps/book/app/customization/extend-models/create-links/page.mdx rename to www/apps/book/app/learn/customization/extend-models/create-links/page.mdx diff --git a/www/apps/book/app/customization/extend-models/define-link/page.mdx b/www/apps/book/app/learn/customization/extend-models/define-link/page.mdx similarity index 100% rename from www/apps/book/app/customization/extend-models/define-link/page.mdx rename to www/apps/book/app/learn/customization/extend-models/define-link/page.mdx diff --git a/www/apps/book/app/customization/extend-models/extend-create-product/page.mdx b/www/apps/book/app/learn/customization/extend-models/extend-create-product/page.mdx similarity index 100% rename from www/apps/book/app/customization/extend-models/extend-create-product/page.mdx rename to www/apps/book/app/learn/customization/extend-models/extend-create-product/page.mdx diff --git a/www/apps/book/app/customization/extend-models/page.mdx b/www/apps/book/app/learn/customization/extend-models/page.mdx similarity index 100% rename from www/apps/book/app/customization/extend-models/page.mdx rename to www/apps/book/app/learn/customization/extend-models/page.mdx diff --git a/www/apps/book/app/customization/extend-models/query-linked-records/page.mdx b/www/apps/book/app/learn/customization/extend-models/query-linked-records/page.mdx similarity index 100% rename from www/apps/book/app/customization/extend-models/query-linked-records/page.mdx rename to www/apps/book/app/learn/customization/extend-models/query-linked-records/page.mdx diff --git a/www/apps/book/app/customization/integrate-systems/handle-event/page.mdx b/www/apps/book/app/learn/customization/integrate-systems/handle-event/page.mdx similarity index 100% rename from www/apps/book/app/customization/integrate-systems/handle-event/page.mdx rename to www/apps/book/app/learn/customization/integrate-systems/handle-event/page.mdx diff --git a/www/apps/book/app/customization/integrate-systems/page.mdx b/www/apps/book/app/learn/customization/integrate-systems/page.mdx similarity index 100% rename from www/apps/book/app/customization/integrate-systems/page.mdx rename to www/apps/book/app/learn/customization/integrate-systems/page.mdx diff --git a/www/apps/book/app/customization/integrate-systems/schedule-task/page.mdx b/www/apps/book/app/learn/customization/integrate-systems/schedule-task/page.mdx similarity index 100% rename from www/apps/book/app/customization/integrate-systems/schedule-task/page.mdx rename to www/apps/book/app/learn/customization/integrate-systems/schedule-task/page.mdx diff --git a/www/apps/book/app/customization/integrate-systems/service/page.mdx b/www/apps/book/app/learn/customization/integrate-systems/service/page.mdx similarity index 100% rename from www/apps/book/app/customization/integrate-systems/service/page.mdx rename to www/apps/book/app/learn/customization/integrate-systems/service/page.mdx diff --git a/www/apps/book/app/customization/next-steps/page.mdx b/www/apps/book/app/learn/customization/next-steps/page.mdx similarity index 100% rename from www/apps/book/app/customization/next-steps/page.mdx rename to www/apps/book/app/learn/customization/next-steps/page.mdx diff --git a/www/apps/book/app/customization/page.mdx b/www/apps/book/app/learn/customization/page.mdx similarity index 100% rename from www/apps/book/app/customization/page.mdx rename to www/apps/book/app/learn/customization/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/instrumentation/page.mdx b/www/apps/book/app/learn/debugging-and-testing/instrumentation/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/instrumentation/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/instrumentation/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/logging/page.mdx b/www/apps/book/app/learn/debugging-and-testing/logging/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/logging/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/logging/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/page.mdx b/www/apps/book/app/learn/debugging-and-testing/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/testing-tools/integration-tests/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/testing-tools/integration-tests/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/testing-tools/modules-tests/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/testing-tools/modules-tests/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/testing-tools/modules-tests/page.mdx diff --git a/www/apps/book/app/debugging-and-testing/testing-tools/page.mdx b/www/apps/book/app/learn/debugging-and-testing/testing-tools/page.mdx similarity index 100% rename from www/apps/book/app/debugging-and-testing/testing-tools/page.mdx rename to www/apps/book/app/learn/debugging-and-testing/testing-tools/page.mdx diff --git a/www/apps/book/app/deployment/page.mdx b/www/apps/book/app/learn/deployment/page.mdx similarity index 100% rename from www/apps/book/app/deployment/page.mdx rename to www/apps/book/app/learn/deployment/page.mdx diff --git a/www/apps/book/app/first-customizations/page.mdx b/www/apps/book/app/learn/first-customizations/page.mdx similarity index 100% rename from www/apps/book/app/first-customizations/page.mdx rename to www/apps/book/app/learn/first-customizations/page.mdx diff --git a/www/apps/book/app/learn/layout.tsx b/www/apps/book/app/learn/layout.tsx new file mode 100644 index 0000000000000..6f37c55a62bbd --- /dev/null +++ b/www/apps/book/app/learn/layout.tsx @@ -0,0 +1,24 @@ +import { TightLayout } from "docs-ui" +import Feedback from "@/components/Feedback" +import EditButton from "@/components/EditButton" +import Providers from "../../providers" + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + } + editComponent={} + ProvidersComponent={Providers} + > + {children} + + ) +} diff --git a/www/apps/book/app/more-resources/cheatsheet/page.mdx b/www/apps/book/app/learn/more-resources/cheatsheet/page.mdx similarity index 100% rename from www/apps/book/app/more-resources/cheatsheet/page.mdx rename to www/apps/book/app/learn/more-resources/cheatsheet/page.mdx diff --git a/www/apps/book/app/more-resources/page.mdx b/www/apps/book/app/learn/more-resources/page.mdx similarity index 100% rename from www/apps/book/app/more-resources/page.mdx rename to www/apps/book/app/learn/more-resources/page.mdx diff --git a/www/apps/book/app/page.mdx b/www/apps/book/app/learn/page.mdx similarity index 100% rename from www/apps/book/app/page.mdx rename to www/apps/book/app/learn/page.mdx diff --git a/www/apps/book/app/storefront-development/nextjs-starter/page.mdx b/www/apps/book/app/learn/storefront-development/nextjs-starter/page.mdx similarity index 100% rename from www/apps/book/app/storefront-development/nextjs-starter/page.mdx rename to www/apps/book/app/learn/storefront-development/nextjs-starter/page.mdx diff --git a/www/apps/book/app/storefront-development/page.mdx b/www/apps/book/app/learn/storefront-development/page.mdx similarity index 100% rename from www/apps/book/app/storefront-development/page.mdx rename to www/apps/book/app/learn/storefront-development/page.mdx diff --git a/www/apps/book/app/not-found.tsx b/www/apps/book/app/not-found.tsx new file mode 100644 index 0000000000000..36dfb6a183035 --- /dev/null +++ b/www/apps/book/app/not-found.tsx @@ -0,0 +1,23 @@ +import { TightLayout } from "docs-ui" +import Feedback from "../components/Feedback" +import EditButton from "../components/EditButton" +import NotFoundContent from "./_not-found.mdx" +import Providers from "../providers" + +const NotFoundPage = () => { + return ( + } + editComponent={} + ProvidersComponent={Providers} + > + + + ) +} + +export default NotFoundPage diff --git a/www/apps/book/app/page.tsx b/www/apps/book/app/page.tsx new file mode 100644 index 0000000000000..dc31d82618081 --- /dev/null +++ b/www/apps/book/app/page.tsx @@ -0,0 +1,49 @@ +import clsx from "clsx" +import { MainNav, RootProviders } from "docs-ui" +import HomepageTopSection from "../components/Homepage/TopSection" +import Providers from "../providers" +import HomepageLinksSection from "../components/Homepage/LinksSection" +import HomepageRecipesSection from "../components/Homepage/RecipesSection" +import HomepageModulesSection from "../components/Homepage/ModulesSection" +import HomepageFooter from "../components/Homepage/Footer" + +const Homepage = () => { + return ( + + + +
+ + + + + + +
+
+
+ + ) +} + +export default Homepage diff --git a/www/apps/book/components/Homepage/CodeTabs/index.tsx b/www/apps/book/components/Homepage/CodeTabs/index.tsx new file mode 100644 index 0000000000000..e7c00da4cf3e8 --- /dev/null +++ b/www/apps/book/components/Homepage/CodeTabs/index.tsx @@ -0,0 +1,379 @@ +"use client" + +import { Link, VerticalCodeTab, VerticalCodeTabs } from "docs-ui" +import { useState } from "react" + +type Tab = VerticalCodeTab & { + textSection: { + content: string + link: { + title: string + link: string + } + } +} + +const HomepageCodeTabs = () => { + const [selectedTabIndex, setSelectedTabIndex] = useState(0) + + const tabs: Tab[] = [ + { + title: "Create API Route", + textSection: { + content: + "Expose custom features with REST API routes, then consume them from your client applications.", + link: { + title: "API Routes", + link: "/learn/basics/api-routes", + }, + }, + code: { + lang: "ts", + source: `export async function GET( + req: MedusaRequest, + res: MedusaResponse +) { + const query = req.scope.resolve("query") + + const { data } = await query.graph({ + entity: "company", + fields: ["id", "name"], + filters: { name: "ACME" }, + }) + + res.json({ + companies: data + }) +}`, + highlights: [ + ["1", "GET", "Create a GET endpoint."], + [ + "5", + `query`, + "Query utility to retrieve data from a graph of\nall data models and their relations.", + ], + ["8", `"company"`, "Retrieve records of the `company` data model"], + ["13", "res.json", "Return a JSON response"], + ], + }, + }, + { + title: "Build Workflows", + textSection: { + content: + "Build flows as a series of steps, with retry mechanisms and tracking of each steps' status.", + link: { + title: "Workflows", + link: "/learn/basics/workflows", + }, + }, + code: { + lang: "ts", + source: `const handleDeliveryWorkflow = createWorkflow( + "handle-delivery", + function (input: WorkflowInput) { + notifyRestaurantStep(input.delivery_id); + + const order = createOrderStep(input.delivery_id); + + createFulfillmentStep(order); + + awaitDeliveryStep(); + + return new WorkflowResponse("Delivery completed"); + } +)`, + highlights: [ + [ + "1", + "createWorkflow", + "Use the Workflows SDK to build a flow of a series of steps.", + ], + ["4", "notifyRestaurantStep", "Run steps in the worklfow"], + [ + "10", + "awaitDeliveryStep", + "Wait for background actions to finish execution\nbefore performing some steps.", + ], + ], + }, + }, + { + title: "Add a Data Model", + textSection: { + content: + "Create data models that represent tables in the database using Medusa's Data Model Language.", + link: { + title: "DML", + link: "/learn/basics/modules#1-create-data-model", + }, + }, + code: { + lang: "ts", + source: `const DigitalProduct = model.define("digital_product", { + id: model.id().primaryKey(), + name: model.text(), + medias: model.hasMany(() => DigitalProductMedia, { + mappedBy: "digitalProduct" + }) +}) +.cascades({ + delete: ["medias"] +})`, + highlights: [ + [ + "1", + "model", + "Use Medusa's Data Model Language to\nrepresent custom tables in the database.", + ], + [ + "4", + "hasMany", + "Create relations between models of the same module.", + ], + ], + }, + }, + { + title: "Build a Custom Module", + textSection: { + content: + "Build custom modules with commerce or architectural features and use them in API routes or workflows.", + link: { + title: "Modules", + link: "/learn/basics/modules", + }, + }, + code: { + lang: "ts", + source: `class DigitalProductModuleService extends MedusaService({ + DigitalProduct, +}) { + async authorizeLicense() { + console.log("License authorized!") + } +} + +export async function POST( + req: MedusaRequest, + res: MedusaResponse +) { + const digitalProductModuleService = req.scope.resolve( + "digitalProductModuleService" + ) + + await digitalProductModuleService.authorizeLicense() + + res.json({ success: true }) +}`, + highlights: [ + [ + "1", + "DigitalProductModuleService", + "Create a service that accesses\nthe database to manage data models.", + ], + [ + "1", + "MedusaService", + "Generate data-management methods\nfor your data models automatically.", + ], + [ + "13", + "digitalProductModuleService", + "Resolve the database from the Medusa container\nin routes and other resources.", + ], + ["17", "authorizeLicense", "Use the service's custom methods."], + ], + }, + }, + { + title: "Link Data Models", + textSection: { + content: + "Add custom properties to Medusa's data models using module links to build custom use cases.", + link: { + title: "Module Links", + link: "/learn/advanced-development/module-links", + }, + }, + code: { + lang: "ts", + source: `const DigitalProduct = model.define("digital_product", { + id: model.id().primaryKey(), + name: model.text(), +}) + +export default defineLink( + DigitalProductModule.linkable.digitalProduct, + ProductModule.linkable.productVariant +)`, + highlights: [ + [ + "6", + "defineLink", + "Create a link between data models of different modules.", + ], + ], + }, + }, + { + title: "Subscribe to Events", + textSection: { + content: + "Handle events emitted by the Medusa application to perform custom actions.", + link: { + title: "Subscribers", + link: "/learn/basics/events-and-subscribers", + }, + }, + code: { + lang: "ts", + source: `async function orderPlaced({ + container, +}: SubscriberArgs) { + const notificaitonModuleService = container.resolve( + Modules.NOTIFICATION + ) + + await notificaitonModuleService.createNotifications({ + to: "customer@gmail.com", + channel: "email", + template: "order-placed" + }) +} + +export const config: SubscriberConfig = { + event: "order.placed", +}`, + highlights: [ + [ + "1", + "orderPlaced", + "Define a subscriber that's\nexecuted when an event is emitted.", + ], + [ + "4", + "notificaitonModuleService", + "Resolve a module's main service\nto use its methods.", + ], + ["8", "createNotification", "Send an email to a customer."], + [ + "16", + `"order.placed"`, + "Execute the subscriber when an order is placed.", + ], + ], + }, + }, + { + title: "Customize Admin", + textSection: { + content: + "Inject widgets into predefined zones in the Medusa Admin, or add new pages.", + link: { + title: "Admin Customizations", + link: "/learn/basics/admin-customizations", + }, + }, + code: { + lang: "tsx", + source: `const ProductBrandWidget = () => { + const [brand, setBrand] = useState({ + name: "Acme" + }) + + return ( + + Brand + {brand && Name: {brand.name}} + + ) +} + +export const config = defineWidgetConfig({ + zone: "product.details.before", +})`, + highlights: [ + [ + "1", + "ProductBrandWidget", + "Create admin widgets as React components.", + ], + [ + "7", + "Container", + "Use Medusa's UI components in your customizations.", + ], + [ + "15", + `"product.details.before"`, + "Show the widget on the product details page.", + ], + ], + }, + }, + { + title: "Integrate Systems", + textSection: { + content: + "Build workflows around multiple systems to add more powerful features to Medusa.", + link: { + title: "Integrate Systems", + link: "/learn/customization/integrate-systems", + }, + }, + code: { + lang: "tsx", + source: `const syncBrandsFromSystemWorkflow = createWorkflow( + "sync-brands-from-system", + () => { + const toCreate = retrieveBrandsFromSystemStep() + + const created = createBrandsInMedusaStep({ + brands: toCreate + }) + + return new WorkflowResponse({ + created, + }) + } +)`, + highlights: [ + ["1", "createWorkflow", "Integrate systems using workflows."], + [ + "4", + "retrieveBrandsFromSystemStep", + "Retrieve data from an external system.", + ], + ["6", "createBrandsInMedusaStep", "Sync data to Medusa."], + ], + }, + }, + ] + + return ( +
+ +
+ + {tabs[selectedTabIndex].textSection.content} + + · + + {tabs[selectedTabIndex].textSection.link.title} + +
+
+ ) +} + +export default HomepageCodeTabs diff --git a/www/apps/book/components/Homepage/Footer/index.tsx b/www/apps/book/components/Homepage/Footer/index.tsx new file mode 100644 index 0000000000000..0e69a321c26c0 --- /dev/null +++ b/www/apps/book/components/Homepage/Footer/index.tsx @@ -0,0 +1,24 @@ +import clsx from "clsx" +import Feedback from "../../Feedback" +import EditButton from "../../EditButton" + +const HomepageFooter = () => { + return ( +
+
+ + +
+
+ ) +} + +export default HomepageFooter diff --git a/www/apps/book/components/Homepage/LinksSection/index.tsx b/www/apps/book/components/Homepage/LinksSection/index.tsx new file mode 100644 index 0000000000000..ac3672c6f797f --- /dev/null +++ b/www/apps/book/components/Homepage/LinksSection/index.tsx @@ -0,0 +1,95 @@ +import clsx from "clsx" +import { Link } from "docs-ui" + +const HomepageLinksSection = () => { + const sections: SectionProps[] = [ + { + title: "Customize Medusa Application", + links: [ + { + href: "/learn", + text: "Create your first application", + }, + { + href: "/learn/customization", + text: "Build a Module", + }, + { + href: "https://docs.medusajs.com/v2/resources/integrations", + text: "Browse third-party integrations", + }, + ], + }, + { + title: "Admin Development", + links: [ + { + href: "/learn/basics/admin-customizations", + text: "Build a UI Widget", + }, + { + href: "/learn/advanced-development/admin/ui-routes", + text: "Add a UI Route", + }, + { + href: "https://docs.medusajs.com/ui", + text: "Browse the UI component library", + }, + ], + }, + { + title: "Storefront Development", + links: [ + { + href: "https://docs.medusajs.com/v2/resources/nextjs-starter", + text: "Explore our storefront starter", + }, + { + href: "https://docs.medusajs.com/v2/resources/storefront-development", + text: "Build a custom storefront", + }, + { + href: "https://docs.medusajs.com/ui", + text: "Browse the UI component library", + }, + ], + }, + ] + return ( +
+
+ {sections.map((section, index) => ( +
+ ))} +
+
+ ) +} + +type SectionProps = { + title: string + links: { + text: string + href: string + }[] +} + +const Section = ({ title, links }: SectionProps) => { + return ( +
+

{title}

+ {links.map((link, index) => ( + + {link.text} + + ))} +
+ ) +} + +export default HomepageLinksSection diff --git a/www/apps/book/components/Homepage/ModulesSection/index.tsx b/www/apps/book/components/Homepage/ModulesSection/index.tsx new file mode 100644 index 0000000000000..83ce2b35689a9 --- /dev/null +++ b/www/apps/book/components/Homepage/ModulesSection/index.tsx @@ -0,0 +1,203 @@ +import clsx from "clsx" +import { Card, CardProps, IconHeadline, PuzzleColoredIcon } from "docs-ui" +import { basePathUrl } from "../../../utils/base-path-url" + +const HomepageModulesSection = () => { + const sections: SectionProps[] = [ + { + title: "Cart & Purchase", + text: "Checkout, Total calculations, and more", + modules: [ + { + title: "Cart", + text: "Add to cart, checkout, and totals.", + href: "/resources/commerce-modules/cart", + image: basePathUrl("/images/cart-icon.png"), + }, + { + title: "Payment", + text: "Process any payment type.", + href: "/resources/commerce-modules/payment", + image: basePathUrl("/images/payment-icon.png"), + }, + { + title: "Customer", + text: "Customer and group management.", + href: "/resources/commerce-modules/customer", + image: basePathUrl("/images/customer-icon.png"), + }, + ], + }, + { + title: "Merchandising", + text: "Products, pricing, and promotions.", + modules: [ + { + title: "Pricing", + text: "Configurable pricing engine", + href: "/resources/commerce-modules/pricing", + image: basePathUrl("/images/pricing-icon.png"), + }, + { + title: "Promotion", + text: "Discounts and promotions", + href: "/resources/commerce-modules/promotion", + image: basePathUrl("/images/promotion-icon.png"), + }, + { + title: "Product", + text: "Variants, categories, and bulk edits", + href: "/resources/commerce-modules/product", + image: basePathUrl("/images/product-icon.png"), + }, + ], + }, + { + title: "Fulfillment", + text: "OMS, fulfilment, and inventory.", + modules: [ + { + title: "Order", + text: "Omnichannel order management", + href: "/resources/commerce-modules/order", + image: basePathUrl("/images/order-icon.png"), + }, + { + title: "Inventory", + text: "Multi-warehouse and reservations", + href: "/resources/commerce-modules/inventory", + image: basePathUrl("/images/inventory-icon.png"), + }, + { + title: "Fulfillment", + text: "Order fulfillment and shipping", + href: "/resources/commerce-modules/fulfillment", + image: basePathUrl("/images/fulfillment-icon.png"), + }, + { + title: "Stock Location", + text: "Locations of stock-kept items", + href: "/resources/commerce-modules/stock-location", + image: basePathUrl("/images/stock-location-icon.png"), + }, + ], + }, + { + title: "Regions & Channels", + text: "Multi-region and omnichannel support.", + modules: [ + { + title: "Region", + text: "Cross-border commerce", + href: "/resources/commerce-modules/region", + image: basePathUrl("/images/region-icon.png"), + }, + { + title: "Sales Channel", + text: "Omnichannel sales", + href: "/resources/commerce-modules/sales-channel", + image: basePathUrl("/images/sales-channel-icon.png"), + }, + { + title: "Tax", + text: "Granular tax control", + href: "/resources/commerce-modules/stock-location", + image: basePathUrl("/images/tax-icon.png"), + }, + { + title: "Currency", + text: "Multi-currency support", + href: "/resources/commerce-modules/currency", + image: basePathUrl("/images/currency-icon.png"), + }, + ], + }, + { + title: "User Access", + text: "API keys and authentication.", + modules: [ + { + title: "API Keys", + text: "Store and admin access", + href: "/resources/commerce-modules/api-key", + image: basePathUrl("/images/api-key-icon.png"), + }, + { + title: "User Module", + text: "Admin user management", + href: "/resources/commerce-modules/user", + image: basePathUrl("/images/user-icon.png"), + }, + { + title: "Auth", + text: "Integrate authentication methods", + href: "/resources/commerce-modules/auth", + image: basePathUrl("/images/auth-icon.png"), + }, + ], + }, + ] + + return ( +
+
+
+ } + /> +

+ All commerce features are provided as extendable modules in Medusa. +

+ + Click on any of the commerce modules below to learn more about their + commerce features, and how to extend and use them for your custom + use-case. + +
+ {sections.map((section, index) => ( +
+ ))} +
+
+ ) +} + +type SectionProps = { + title: string + text: string + modules: Omit[] +} + +const Section = ({ title, text, modules }: SectionProps) => { + return ( +
+
+

{title}

+ {text} +
+
+ {modules.map((card, index) => ( + + ))} +
+
+ ) +} + +export default HomepageModulesSection diff --git a/www/apps/book/components/Homepage/RecipesSection/index.tsx b/www/apps/book/components/Homepage/RecipesSection/index.tsx new file mode 100644 index 0000000000000..3e1be4509a517 --- /dev/null +++ b/www/apps/book/components/Homepage/RecipesSection/index.tsx @@ -0,0 +1,90 @@ +import { TriangleRightMini } from "@medusajs/icons" +import clsx from "clsx" +import { + CalendarRefreshIcon, + Card, + CardProps, + ChefHatIcon, + IconHeadline, + ImageBinaryIcon, + Link, + ScrollTextIcon, + ShopIcon, +} from "docs-ui" + +const HomepageRecipesSection = () => { + const cards: CardProps[] = [ + { + type: "large", + title: "Marketplace", + text: "Build a marketplace with multiple vendors", + href: "https://docs.medusajs.com/v2/resources/recipes/marketplace/examples/vendors", + icon: ShopIcon, + }, + { + type: "large", + title: "Subscriptions", + text: "Implement a subscription-based commerce store.", + href: "https://docs.medusajs.com/v2/resources/recipes/subscriptions/examples/standard", + icon: CalendarRefreshIcon, + }, + { + type: "large", + title: "Restaurant-Delivery", + text: "Build a restaurant marketplace inspired by UberEats, with real-time delivery handling", + href: "https://docs.medusajs.com/v2/resources/recipes/marketplace/examples/restaurant-delivery", + icon: ChefHatIcon, + }, + { + type: "large", + title: "Digital Products", + text: "Sell digital products with custom fulfillment.", + href: "https://docs.medusajs.com/v2/resources/recipes/digital-products/examples/standard", + icon: ImageBinaryIcon, + }, + ] + return ( +
+
+
+
+ } /> +

+ Medusa’s framework supports any business use case. +

+ + These recipes show how you to build a use case by customizing and + extending existing data models and features, or creating new ones. + +
+ + View All Recipes + +
+
+ {cards.map((card, index) => ( + + ))} +
+
+
+ ) +} + +export default HomepageRecipesSection diff --git a/www/apps/book/components/Homepage/TopSection/index.tsx b/www/apps/book/components/Homepage/TopSection/index.tsx new file mode 100644 index 0000000000000..5f4f903bdd8fd --- /dev/null +++ b/www/apps/book/components/Homepage/TopSection/index.tsx @@ -0,0 +1,76 @@ +/* eslint-disable @next/next/no-img-element */ +import clsx from "clsx" +import { BookIcon, Card, IconHeadline, WindowPaintbrushIcon } from "docs-ui" +import { basePathUrl } from "../../../utils/base-path-url" +import HomepageCodeTabs from "../CodeTabs" + +const HomepageTopSection = () => { + return ( +
+
+
+
+
+
+ } /> +

+ Learn how to build Medusa projects. Explore our guides. +

+
+ +
+ +
+ } + /> +

+ A digital commerce platform with a built-in framework for + customizations. +

+ + Unlike other platforms, Medusa allows you to easily customize and + extend the behavior of your commerce platform to always fit your + business needs. + +
+
+
+ ) +} + +export default HomepageTopSection diff --git a/www/apps/book/config/index.ts b/www/apps/book/config/index.ts index 8535ed7e77402..43c73a685acaa 100644 --- a/www/apps/book/config/index.ts +++ b/www/apps/book/config/index.ts @@ -4,7 +4,7 @@ import { sidebarConfig } from "./sidebar" const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000" export const config: DocsConfig = { - titleSuffix: "Medusa v2 Docs", + titleSuffix: "Medusa v2 Documentation", baseUrl, basePath: process.env.NEXT_PUBLIC_BASE_PATH, sidebar: sidebarConfig, diff --git a/www/apps/book/generated/edit-dates.mjs b/www/apps/book/generated/edit-dates.mjs index 4ef61ae0f0dfd..c1a14cd970ae9 100644 --- a/www/apps/book/generated/edit-dates.mjs +++ b/www/apps/book/generated/edit-dates.mjs @@ -1,116 +1,116 @@ export const generatedEditDates = { - "app/basics/scheduled-jobs/page.mdx": "2024-09-30T08:43:53.132Z", - "app/basics/workflows/page.mdx": "2024-09-30T08:43:53.132Z", - "app/deployment/page.mdx": "2024-08-05T07:24:05+00:00", - "app/page.mdx": "2024-09-03T07:09:09.034Z", - "app/basics/commerce-modules/page.mdx": "2024-09-30T08:43:53.131Z", - "app/advanced-development/workflows/retry-failed-steps/page.mdx": "2024-09-30T08:43:53.130Z", - "app/advanced-development/workflows/workflow-hooks/page.mdx": "2024-09-30T08:43:53.131Z", - "app/cheatsheet/page.mdx": "2024-07-11T13:53:40+03:00", - "app/debugging-and-testing/logging/page.mdx": "2024-09-30T08:43:53.135Z", - "app/more-resources/page.mdx": "2024-07-04T17:26:03+03:00", - "app/storefront-development/page.mdx": "2024-09-11T10:58:59.290Z", - "app/storefront-development/nextjs-starter/page.mdx": "2024-07-04T17:26:03+03:00", - "app/basics/page.mdx": "2024-09-03T07:11:06.879Z", - "app/basics/admin-customizations/page.mdx": "2024-10-07T12:41:39.218Z", - "app/advanced-development/workflows/workflow-timeout/page.mdx": "2024-09-30T08:43:53.131Z", - "app/advanced-development/workflows/parallel-steps/page.mdx": "2024-09-30T08:43:53.130Z", - "app/advanced-development/page.mdx": "2024-07-04T17:26:03+03:00", - "app/first-customizations/page.mdx": "2024-09-11T10:48:42.374Z", - "app/debugging-and-testing/page.mdx": "2024-05-03T17:36:38+03:00", - "app/basics/medusa-container/page.mdx": "2024-09-30T08:43:53.132Z", - "app/basics/project-directories-files/page.mdx": "2024-10-03T12:46:52.762Z", - "app/basics/api-routes/page.mdx": "2024-09-11T10:48:31.777Z", - "app/basics/modules-directory-structure/page.mdx": "2024-10-03T13:03:35.957Z", - "app/advanced-development/workflows/access-workflow-errors/page.mdx": "2024-09-18T12:54:04.695Z", - "app/basics/events-and-subscribers/page.mdx": "2024-09-30T08:43:53.131Z", - "app/advanced-development/modules/container/page.mdx": "2024-09-30T08:43:53.125Z", - "app/advanced-development/workflows/execute-another-workflow/page.mdx": "2024-09-30T08:43:53.129Z", - "app/basics/loaders/page.mdx": "2024-09-03T08:00:45.993Z", - "app/advanced-development/admin/widgets/page.mdx": "2024-10-07T12:51:09.969Z", - "app/advanced-development/data-models/page.mdx": "2024-09-19T07:26:43.535Z", - "app/advanced-development/modules/remote-link/page.mdx": "2024-09-30T08:43:53.127Z", - "app/advanced-development/api-routes/protected-routes/page.mdx": "2024-09-30T08:43:53.121Z", - "app/advanced-development/workflows/add-workflow-hook/page.mdx": "2024-09-30T08:43:53.128Z", - "app/advanced-development/events-and-subscribers/data-payload/page.mdx": "2024-07-16T17:12:05+01:00", - "app/advanced-development/data-models/default-properties/page.mdx": "2024-09-19T07:32:06.118Z", - "app/advanced-development/workflows/advanced-example/page.mdx": "2024-09-11T10:46:59.975Z", - "app/advanced-development/events-and-subscribers/emit-event/page.mdx": "2024-09-30T08:43:53.125Z", - "app/advanced-development/workflows/conditions/page.mdx": "2024-09-30T08:43:53.128Z", - "app/advanced-development/modules/module-link-directions/page.mdx": "2024-07-24T09:16:01+02:00", - "app/advanced-development/admin/page.mdx": "2024-10-07T12:39:13.178Z", - "app/advanced-development/workflows/long-running-workflow/page.mdx": "2024-09-30T08:43:53.129Z", - "app/advanced-development/workflows/constructor-constraints/page.mdx": "2024-10-04T08:40:14.867Z", - "app/advanced-development/data-models/write-migration/page.mdx": "2024-07-15T17:46:10+02:00", - "app/advanced-development/data-models/manage-relationships/page.mdx": "2024-09-10T11:39:51.167Z", - "app/advanced-development/modules/remote-query/page.mdx": "2024-07-21T21:20:24+02:00", - "app/advanced-development/modules/options/page.mdx": "2024-10-16T08:49:27.162Z", - "app/advanced-development/data-models/relationships/page.mdx": "2024-09-30T08:43:53.125Z", - "app/advanced-development/workflows/compensation-function/page.mdx": "2024-09-30T08:43:53.128Z", - "app/advanced-development/modules/service-factory/page.mdx": "2024-09-30T08:43:53.127Z", - "app/advanced-development/data-models/primary-key/page.mdx": "2024-09-30T08:43:53.123Z", - "app/advanced-development/modules/module-links/page.mdx": "2024-09-30T08:43:53.126Z", - "app/advanced-development/data-models/searchable-property/page.mdx": "2024-09-30T08:43:53.125Z", - "app/advanced-development/scheduled-jobs/execution-number/page.mdx": "2024-07-02T09:41:15+00:00", - "app/advanced-development/api-routes/parameters/page.mdx": "2024-09-11T10:44:13.491Z", - "app/advanced-development/api-routes/http-methods/page.mdx": "2024-09-11T10:43:33.169Z", - "app/advanced-development/admin/tips/page.mdx": "2024-10-07T12:50:36.335Z", - "app/advanced-development/api-routes/cors/page.mdx": "2024-09-30T08:43:53.121Z", - "app/advanced-development/admin/ui-routes/page.mdx": "2024-10-07T12:52:37.509Z", - "app/advanced-development/api-routes/middlewares/page.mdx": "2024-09-11T10:45:31.861Z", - "app/advanced-development/modules/isolation/page.mdx": "2024-07-04T17:26:03+03:00", - "app/advanced-development/data-models/configure-properties/page.mdx": "2024-09-30T08:43:53.122Z", - "app/advanced-development/data-models/index/page.mdx": "2024-09-30T08:43:53.122Z", - "app/advanced-development/custom-cli-scripts/page.mdx": "2024-09-30T08:43:53.122Z", - "app/advanced-development/data-models/property-types/page.mdx": "2024-09-30T08:43:53.124Z", - "app/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx": "2024-09-30T08:43:53.136Z", - "app/debugging-and-testing/testing-tools/integration-tests/page.mdx": "2024-09-10T11:39:51.170Z", - "app/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx": "2024-09-30T08:43:53.139Z", - "app/debugging-and-testing/testing-tools/page.mdx": "2024-09-30T08:43:53.139Z", - "app/debugging-and-testing/testing-tools/unit-tests/module-example/page.mdx": "2024-09-02T11:04:27.232Z", - "app/debugging-and-testing/testing-tools/unit-tests/page.mdx": "2024-09-02T11:03:26.997Z", - "app/advanced-development/modules/service-constraints/page.mdx": "2024-09-30T08:43:53.127Z", - "app/advanced-development/api-routes/page.mdx": "2024-09-04T09:36:33.961Z", - "app/advanced-development/api-routes/responses/page.mdx": "2024-09-11T10:44:37.016Z", - "app/advanced-development/api-routes/validation/page.mdx": "2024-09-11T10:46:31.476Z", - "app/advanced-development/api-routes/errors/page.mdx": "2024-09-30T08:43:53.121Z", - "app/advanced-development/admin/constraints/page.mdx": "2024-09-10T11:39:51.165Z", - "app/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx": "2024-10-16T08:50:03.061Z", - "app/debugging-and-testing/testing-tools/modules-tests/page.mdx": "2024-10-16T08:50:23.232Z", - "app/advanced-development/module-links/custom-columns/page.mdx": "2024-09-16T15:51:33.570Z", - "app/advanced-development/module-links/directions/page.mdx": "2024-09-16T15:37:51.441Z", - "app/advanced-development/module-links/page.mdx": "2024-09-16T15:36:48.190Z", - "app/advanced-development/module-links/query/page.mdx": "2024-09-16T12:42:27.579Z", - "app/advanced-development/module-links/remote-link/page.mdx": "2024-09-16T12:42:27.581Z", - "app/advanced-development/modules/db-operations/page.mdx": "2024-09-16T14:38:29.150Z", - "app/advanced-development/modules/multiple-services/page.mdx": "2024-09-16T14:41:32.975Z", - "app/advanced-development/modules/page.mdx": "2024-09-16T14:33:48.217Z", - "app/debugging-and-testing/instrumentation/page.mdx": "2024-09-17T08:53:15.910Z", - "app/advanced-development/api-routes/additional-data/page.mdx": "2024-09-30T08:43:53.120Z", - "app/advanced-development/workflows/page.mdx": "2024-09-18T08:00:57.364Z", - "app/advanced-development/workflows/variable-manipulation/page.mdx": "2024-09-30T08:43:53.130Z", - "app/customization/custom-features/api-route/page.mdx": "2024-09-12T12:42:34.201Z", - "app/customization/custom-features/module/page.mdx": "2024-10-16T08:49:44.676Z", - "app/customization/custom-features/workflow/page.mdx": "2024-09-30T08:43:53.133Z", - "app/customization/extend-models/create-links/page.mdx": "2024-09-30T08:43:53.133Z", - "app/customization/extend-models/extend-create-product/page.mdx": "2024-09-30T08:43:53.134Z", - "app/customization/custom-features/page.mdx": "2024-09-12T11:18:13.271Z", - "app/customization/customize-admin/page.mdx": "2024-09-12T12:25:29.853Z", - "app/customization/customize-admin/route/page.mdx": "2024-10-07T12:43:11.335Z", - "app/customization/customize-admin/widget/page.mdx": "2024-10-07T12:44:24.538Z", - "app/customization/extend-models/define-link/page.mdx": "2024-09-30T08:43:53.134Z", - "app/customization/extend-models/page.mdx": "2024-09-12T12:38:57.394Z", - "app/customization/extend-models/query-linked-records/page.mdx": "2024-09-30T08:43:53.134Z", - "app/customization/integrate-systems/handle-event/page.mdx": "2024-09-30T08:43:53.135Z", - "app/customization/integrate-systems/page.mdx": "2024-09-12T12:33:29.827Z", - "app/customization/integrate-systems/schedule-task/page.mdx": "2024-09-30T08:43:53.135Z", - "app/customization/integrate-systems/service/page.mdx": "2024-10-16T08:49:50.899Z", - "app/customization/next-steps/page.mdx": "2024-09-12T10:50:04.873Z", - "app/customization/page.mdx": "2024-09-12T11:16:18.504Z", - "app/more-resources/cheatsheet/page.mdx": "2024-07-11T16:11:26.480Z", - "app/architecture/architectural-modules/page.mdx": "2024-09-23T12:51:04.520Z", - "app/architecture/overview/page.mdx": "2024-09-23T12:55:01.339Z", - "app/advanced-development/data-models/infer-type/page.mdx": "2024-09-30T08:43:53.123Z", - "app/advanced-development/custom-cli-scripts/seed-data/page.mdx": "2024-10-03T11:11:07.181Z", - "app/basics/modules/page.mdx": "2024-10-16T08:49:39.997Z" + "app/learn/basics/scheduled-jobs/page.mdx": "2024-09-30T08:43:53.132Z", + "app/learn/basics/workflows/page.mdx": "2024-09-30T08:43:53.132Z", + "app/learn/deployment/page.mdx": "2024-08-05T07:24:05+00:00", + "app/learn/page.mdx": "2024-09-03T07:09:09.034Z", + "app/learn/basics/commerce-modules/page.mdx": "2024-09-30T08:43:53.131Z", + "app/learn/advanced-development/workflows/retry-failed-steps/page.mdx": "2024-09-30T08:43:53.130Z", + "app/learn/advanced-development/workflows/workflow-hooks/page.mdx": "2024-09-30T08:43:53.131Z", + "app/learn/cheatsheet/page.mdx": "2024-07-11T13:53:40+03:00", + "app/learn/debugging-and-testing/logging/page.mdx": "2024-09-30T08:43:53.135Z", + "app/learn/more-resources/page.mdx": "2024-07-04T17:26:03+03:00", + "app/learn/storefront-development/page.mdx": "2024-09-11T10:58:59.290Z", + "app/learn/storefront-development/nextjs-starter/page.mdx": "2024-07-04T17:26:03+03:00", + "app/learn/basics/page.mdx": "2024-09-03T07:11:06.879Z", + "app/learn/basics/admin-customizations/page.mdx": "2024-10-07T12:41:39.218Z", + "app/learn/advanced-development/workflows/workflow-timeout/page.mdx": "2024-09-30T08:43:53.131Z", + "app/learn/advanced-development/workflows/parallel-steps/page.mdx": "2024-09-30T08:43:53.130Z", + "app/learn/advanced-development/page.mdx": "2024-07-04T17:26:03+03:00", + "app/learn/first-customizations/page.mdx": "2024-09-11T10:48:42.374Z", + "app/learn/debugging-and-testing/page.mdx": "2024-05-03T17:36:38+03:00", + "app/learn/basics/medusa-container/page.mdx": "2024-09-30T08:43:53.132Z", + "app/learn/basics/project-directories-files/page.mdx": "2024-10-03T12:46:52.762Z", + "app/learn/basics/api-routes/page.mdx": "2024-09-11T10:48:31.777Z", + "app/learn/basics/modules-directory-structure/page.mdx": "2024-10-03T13:03:35.957Z", + "app/learn/advanced-development/workflows/access-workflow-errors/page.mdx": "2024-09-18T12:54:04.695Z", + "app/learn/basics/events-and-subscribers/page.mdx": "2024-09-30T08:43:53.131Z", + "app/learn/advanced-development/modules/container/page.mdx": "2024-09-30T08:43:53.125Z", + "app/learn/advanced-development/workflows/execute-another-workflow/page.mdx": "2024-09-30T08:43:53.129Z", + "app/learn/basics/loaders/page.mdx": "2024-09-03T08:00:45.993Z", + "app/learn/advanced-development/admin/widgets/page.mdx": "2024-10-07T12:51:09.969Z", + "app/learn/advanced-development/data-models/page.mdx": "2024-09-19T07:26:43.535Z", + "app/learn/advanced-development/modules/remote-link/page.mdx": "2024-09-30T08:43:53.127Z", + "app/learn/advanced-development/api-routes/protected-routes/page.mdx": "2024-09-30T08:43:53.121Z", + "app/learn/advanced-development/workflows/add-workflow-hook/page.mdx": "2024-09-30T08:43:53.128Z", + "app/learn/advanced-development/events-and-subscribers/data-payload/page.mdx": "2024-07-16T17:12:05+01:00", + "app/learn/advanced-development/data-models/default-properties/page.mdx": "2024-09-19T07:32:06.118Z", + "app/learn/advanced-development/workflows/advanced-example/page.mdx": "2024-09-11T10:46:59.975Z", + "app/learn/advanced-development/events-and-subscribers/emit-event/page.mdx": "2024-09-30T08:43:53.125Z", + "app/learn/advanced-development/workflows/conditions/page.mdx": "2024-09-30T08:43:53.128Z", + "app/learn/advanced-development/modules/module-link-directions/page.mdx": "2024-07-24T09:16:01+02:00", + "app/learn/advanced-development/admin/page.mdx": "2024-10-07T12:39:13.178Z", + "app/learn/advanced-development/workflows/long-running-workflow/page.mdx": "2024-09-30T08:43:53.129Z", + "app/learn/advanced-development/workflows/constructor-constraints/page.mdx": "2024-10-04T08:40:14.867Z", + "app/learn/advanced-development/data-models/write-migration/page.mdx": "2024-07-15T17:46:10+02:00", + "app/learn/advanced-development/data-models/manage-relationships/page.mdx": "2024-09-10T11:39:51.167Z", + "app/learn/advanced-development/modules/remote-query/page.mdx": "2024-07-21T21:20:24+02:00", + "app/learn/advanced-development/modules/options/page.mdx": "2024-10-16T08:49:27.162Z", + "app/learn/advanced-development/data-models/relationships/page.mdx": "2024-09-30T08:43:53.125Z", + "app/learn/advanced-development/workflows/compensation-function/page.mdx": "2024-09-30T08:43:53.128Z", + "app/learn/advanced-development/modules/service-factory/page.mdx": "2024-09-30T08:43:53.127Z", + "app/learn/advanced-development/data-models/primary-key/page.mdx": "2024-09-30T08:43:53.123Z", + "app/learn/advanced-development/modules/module-links/page.mdx": "2024-09-30T08:43:53.126Z", + "app/learn/advanced-development/data-models/searchable-property/page.mdx": "2024-09-30T08:43:53.125Z", + "app/learn/advanced-development/scheduled-jobs/execution-number/page.mdx": "2024-07-02T09:41:15+00:00", + "app/learn/advanced-development/api-routes/parameters/page.mdx": "2024-09-11T10:44:13.491Z", + "app/learn/advanced-development/api-routes/http-methods/page.mdx": "2024-09-11T10:43:33.169Z", + "app/learn/advanced-development/admin/tips/page.mdx": "2024-10-07T12:50:36.335Z", + "app/learn/advanced-development/api-routes/cors/page.mdx": "2024-09-30T08:43:53.121Z", + "app/learn/advanced-development/admin/ui-routes/page.mdx": "2024-10-07T12:52:37.509Z", + "app/learn/advanced-development/api-routes/middlewares/page.mdx": "2024-09-11T10:45:31.861Z", + "app/learn/advanced-development/modules/isolation/page.mdx": "2024-07-04T17:26:03+03:00", + "app/learn/advanced-development/data-models/configure-properties/page.mdx": "2024-09-30T08:43:53.122Z", + "app/learn/advanced-development/data-models/index/page.mdx": "2024-09-30T08:43:53.122Z", + "app/learn/advanced-development/custom-cli-scripts/page.mdx": "2024-09-30T08:43:53.122Z", + "app/learn/advanced-development/data-models/property-types/page.mdx": "2024-09-30T08:43:53.124Z", + "app/learn/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx": "2024-09-30T08:43:53.136Z", + "app/learn/debugging-and-testing/testing-tools/integration-tests/page.mdx": "2024-09-10T11:39:51.170Z", + "app/learn/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx": "2024-09-30T08:43:53.139Z", + "app/learn/debugging-and-testing/testing-tools/page.mdx": "2024-09-30T08:43:53.139Z", + "app/learn/debugging-and-testing/testing-tools/unit-tests/module-example/page.mdx": "2024-09-02T11:04:27.232Z", + "app/learn/debugging-and-testing/testing-tools/unit-tests/page.mdx": "2024-09-02T11:03:26.997Z", + "app/learn/advanced-development/modules/service-constraints/page.mdx": "2024-09-30T08:43:53.127Z", + "app/learn/advanced-development/api-routes/page.mdx": "2024-09-04T09:36:33.961Z", + "app/learn/advanced-development/api-routes/responses/page.mdx": "2024-09-11T10:44:37.016Z", + "app/learn/advanced-development/api-routes/validation/page.mdx": "2024-09-11T10:46:31.476Z", + "app/learn/advanced-development/api-routes/errors/page.mdx": "2024-09-30T08:43:53.121Z", + "app/learn/advanced-development/admin/constraints/page.mdx": "2024-09-10T11:39:51.165Z", + "app/learn/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx": "2024-10-16T08:50:03.061Z", + "app/learn/debugging-and-testing/testing-tools/modules-tests/page.mdx": "2024-10-16T08:50:23.232Z", + "app/learn/advanced-development/module-links/custom-columns/page.mdx": "2024-09-16T15:51:33.570Z", + "app/learn/advanced-development/module-links/directions/page.mdx": "2024-09-16T15:37:51.441Z", + "app/learn/advanced-development/module-links/page.mdx": "2024-09-16T15:36:48.190Z", + "app/learn/advanced-development/module-links/query/page.mdx": "2024-09-16T12:42:27.579Z", + "app/learn/advanced-development/module-links/remote-link/page.mdx": "2024-09-16T12:42:27.581Z", + "app/learn/advanced-development/modules/db-operations/page.mdx": "2024-09-16T14:38:29.150Z", + "app/learn/advanced-development/modules/multiple-services/page.mdx": "2024-09-16T14:41:32.975Z", + "app/learn/advanced-development/modules/page.mdx": "2024-09-16T14:33:48.217Z", + "app/learn/debugging-and-testing/instrumentation/page.mdx": "2024-09-17T08:53:15.910Z", + "app/learn/advanced-development/api-routes/additional-data/page.mdx": "2024-09-30T08:43:53.120Z", + "app/learn/advanced-development/workflows/page.mdx": "2024-09-18T08:00:57.364Z", + "app/learn/advanced-development/workflows/variable-manipulation/page.mdx": "2024-09-30T08:43:53.130Z", + "app/learn/customization/custom-features/api-route/page.mdx": "2024-09-12T12:42:34.201Z", + "app/learn/customization/custom-features/module/page.mdx": "2024-10-16T08:49:44.676Z", + "app/learn/customization/custom-features/workflow/page.mdx": "2024-09-30T08:43:53.133Z", + "app/learn/customization/extend-models/create-links/page.mdx": "2024-09-30T08:43:53.133Z", + "app/learn/customization/extend-models/extend-create-product/page.mdx": "2024-09-30T08:43:53.134Z", + "app/learn/customization/custom-features/page.mdx": "2024-09-12T11:18:13.271Z", + "app/learn/customization/customize-admin/page.mdx": "2024-09-12T12:25:29.853Z", + "app/learn/customization/customize-admin/route/page.mdx": "2024-10-07T12:43:11.335Z", + "app/learn/customization/customize-admin/widget/page.mdx": "2024-10-07T12:44:24.538Z", + "app/learn/customization/extend-models/define-link/page.mdx": "2024-09-30T08:43:53.134Z", + "app/learn/customization/extend-models/page.mdx": "2024-09-12T12:38:57.394Z", + "app/learn/customization/extend-models/query-linked-records/page.mdx": "2024-09-30T08:43:53.134Z", + "app/learn/customization/integrate-systems/handle-event/page.mdx": "2024-09-30T08:43:53.135Z", + "app/learn/customization/integrate-systems/page.mdx": "2024-09-12T12:33:29.827Z", + "app/learn/customization/integrate-systems/schedule-task/page.mdx": "2024-09-30T08:43:53.135Z", + "app/learn/customization/integrate-systems/service/page.mdx": "2024-10-16T08:49:50.899Z", + "app/learn/customization/next-steps/page.mdx": "2024-09-12T10:50:04.873Z", + "app/learn/customization/page.mdx": "2024-09-12T11:16:18.504Z", + "app/learn/more-resources/cheatsheet/page.mdx": "2024-07-11T16:11:26.480Z", + "app/learn/architecture/architectural-modules/page.mdx": "2024-09-23T12:51:04.520Z", + "app/learn/architecture/overview/page.mdx": "2024-09-23T12:55:01.339Z", + "app/learn/advanced-development/data-models/infer-type/page.mdx": "2024-09-30T08:43:53.123Z", + "app/learn/advanced-development/custom-cli-scripts/seed-data/page.mdx": "2024-10-03T11:11:07.181Z", + "app/learn/basics/modules/page.mdx": "2024-10-16T08:49:39.997Z" } \ No newline at end of file diff --git a/www/apps/book/next.config.mjs b/www/apps/book/next.config.mjs index f297b998358ba..7225d90473a06 100644 --- a/www/apps/book/next.config.mjs +++ b/www/apps/book/next.config.mjs @@ -130,48 +130,43 @@ const nextConfig = { async redirects() { return [ { - source: "/advanced-development/modules/remote-query", - destination: "/advanced-development/module-links/query", + source: "/advanced-development/:path*", + destination: "/learn/advanced-development/:path*", permanent: true, }, { - source: "/advanced-development/modules/query", - destination: "/advanced-development/module-links/query", + source: "/basics/:path*", + destination: "/learn/basics/:path*", permanent: true, }, { - source: "/advanced-development/modules/module-links", - destination: "/advanced-development/module-links", + source: "/customization/:path*", + destination: "/learn/customization/:path*", permanent: true, }, { - source: "/advanced-development/modules/module-link-directions", - destination: "/advanced-development/module-links/directions", + source: "/debugging-and-testing/:path*", + destination: "/learn/debugging-and-testing/:path*", permanent: true, }, { - source: "/advanced-development/modules/remote-link", - destination: "/advanced-development/module-links/remote-link", + source: "/deployment/:path*", + destination: "/learn/deployment/:path*", permanent: true, }, { - source: "/cheatsheet", - destination: "/more-resources/cheatsheet", + source: "/first-customizations/:path*", + destination: "/learn/first-customizations/:path*", permanent: true, }, { - source: "/architectural-modules", - destination: "/advanced-development/architecture/architectural-modules", + source: "/more-resources/:path*", + destination: "/learn/more-resources/:path*", permanent: true, }, { - source: "/basics/modules-and-services", - destination: "/basics/modules", - permanent: true, - }, - { - source: "/basics/data-models", - destination: "/basics/modules", + source: "/storefront-development/:path*", + destination: "/learn/storefront-development/:path*", permanent: true, }, { diff --git a/www/apps/book/package.json b/www/apps/book/package.json index 8d866b5447ac1..127a06426a526 100644 --- a/www/apps/book/package.json +++ b/www/apps/book/package.json @@ -16,6 +16,7 @@ "dependencies": { "@mdx-js/loader": "^3.0.0", "@mdx-js/react": "^3.0.0", + "@medusajs/icons": "rc", "@next/mdx": "^14.2.14", "clsx": "^2.1.0", "docs-ui": "*", diff --git a/www/apps/book/public/images/api-key-icon.png b/www/apps/book/public/images/api-key-icon.png new file mode 100644 index 0000000000000..88d8166f9f5cb Binary files /dev/null and b/www/apps/book/public/images/api-key-icon.png differ diff --git a/www/apps/book/public/images/auth-icon.png b/www/apps/book/public/images/auth-icon.png new file mode 100644 index 0000000000000..c3afa03d747a2 Binary files /dev/null and b/www/apps/book/public/images/auth-icon.png differ diff --git a/www/apps/book/public/images/bg-stripes-dark.png b/www/apps/book/public/images/bg-stripes-dark.png new file mode 100644 index 0000000000000..b186b87dcebff Binary files /dev/null and b/www/apps/book/public/images/bg-stripes-dark.png differ diff --git a/www/apps/book/public/images/bg-stripes.png b/www/apps/book/public/images/bg-stripes.png new file mode 100644 index 0000000000000..ed5e7e9b39ae3 Binary files /dev/null and b/www/apps/book/public/images/bg-stripes.png differ diff --git a/www/apps/book/public/images/cart-icon.png b/www/apps/book/public/images/cart-icon.png new file mode 100644 index 0000000000000..75a37f623db3d Binary files /dev/null and b/www/apps/book/public/images/cart-icon.png differ diff --git a/www/apps/book/public/images/currency-icon.png b/www/apps/book/public/images/currency-icon.png new file mode 100644 index 0000000000000..fef1c2f7e2f4b Binary files /dev/null and b/www/apps/book/public/images/currency-icon.png differ diff --git a/www/apps/book/public/images/customer-icon.png b/www/apps/book/public/images/customer-icon.png new file mode 100644 index 0000000000000..b1deb68afcab8 Binary files /dev/null and b/www/apps/book/public/images/customer-icon.png differ diff --git a/www/apps/book/public/images/fulfillment-icon.png b/www/apps/book/public/images/fulfillment-icon.png new file mode 100644 index 0000000000000..efbf148a010c8 Binary files /dev/null and b/www/apps/book/public/images/fulfillment-icon.png differ diff --git a/www/apps/book/public/images/get-started-card-dark.png b/www/apps/book/public/images/get-started-card-dark.png new file mode 100644 index 0000000000000..cf78ad0c31585 Binary files /dev/null and b/www/apps/book/public/images/get-started-card-dark.png differ diff --git a/www/apps/book/public/images/get-started-card-md.png b/www/apps/book/public/images/get-started-card-md.png new file mode 100644 index 0000000000000..2b1910e9d3eba Binary files /dev/null and b/www/apps/book/public/images/get-started-card-md.png differ diff --git a/www/apps/book/public/images/get-started-card.png b/www/apps/book/public/images/get-started-card.png new file mode 100644 index 0000000000000..5b05ed9b27e1c Binary files /dev/null and b/www/apps/book/public/images/get-started-card.png differ diff --git a/www/apps/book/public/images/inventory-icon.png b/www/apps/book/public/images/inventory-icon.png new file mode 100644 index 0000000000000..7632438baca89 Binary files /dev/null and b/www/apps/book/public/images/inventory-icon.png differ diff --git a/www/apps/book/public/images/order-icon.png b/www/apps/book/public/images/order-icon.png new file mode 100644 index 0000000000000..8869a30ec8d15 Binary files /dev/null and b/www/apps/book/public/images/order-icon.png differ diff --git a/www/apps/book/public/images/payment-icon.png b/www/apps/book/public/images/payment-icon.png new file mode 100644 index 0000000000000..124d62965d210 Binary files /dev/null and b/www/apps/book/public/images/payment-icon.png differ diff --git a/www/apps/book/public/images/pricing-icon.png b/www/apps/book/public/images/pricing-icon.png new file mode 100644 index 0000000000000..ae0e8ad462c20 Binary files /dev/null and b/www/apps/book/public/images/pricing-icon.png differ diff --git a/www/apps/book/public/images/product-icon.png b/www/apps/book/public/images/product-icon.png new file mode 100644 index 0000000000000..8fdb4f0d0cd55 Binary files /dev/null and b/www/apps/book/public/images/product-icon.png differ diff --git a/www/apps/book/public/images/promotion-icon.png b/www/apps/book/public/images/promotion-icon.png new file mode 100644 index 0000000000000..640200620b0ab Binary files /dev/null and b/www/apps/book/public/images/promotion-icon.png differ diff --git a/www/apps/book/public/images/region-icon.png b/www/apps/book/public/images/region-icon.png new file mode 100644 index 0000000000000..72fb2b63e68ee Binary files /dev/null and b/www/apps/book/public/images/region-icon.png differ diff --git a/www/apps/book/public/images/sales-channel-icon.png b/www/apps/book/public/images/sales-channel-icon.png new file mode 100644 index 0000000000000..47867c1508c9c Binary files /dev/null and b/www/apps/book/public/images/sales-channel-icon.png differ diff --git a/www/apps/book/public/images/stock-location-icon.png b/www/apps/book/public/images/stock-location-icon.png new file mode 100644 index 0000000000000..61674b2f5b0eb Binary files /dev/null and b/www/apps/book/public/images/stock-location-icon.png differ diff --git a/www/apps/book/public/images/tax-icon.png b/www/apps/book/public/images/tax-icon.png new file mode 100644 index 0000000000000..2be16099b4441 Binary files /dev/null and b/www/apps/book/public/images/tax-icon.png differ diff --git a/www/apps/book/public/images/user-icon.png b/www/apps/book/public/images/user-icon.png new file mode 100644 index 0000000000000..bff05107f027d Binary files /dev/null and b/www/apps/book/public/images/user-icon.png differ diff --git a/www/apps/book/sidebar.mjs b/www/apps/book/sidebar.mjs index 814073317ad46..eabd10db4e527 100644 --- a/www/apps/book/sidebar.mjs +++ b/www/apps/book/sidebar.mjs @@ -6,193 +6,193 @@ export const sidebar = numberSidebarItems( sidebarAttachHrefCommonOptions([ { type: "link", - path: "/", + path: "/learn", title: "Introduction", }, { type: "link", - path: "/first-customizations", + path: "/learn/first-customizations", title: "Your First Customizations", chapterTitle: "First Customization", }, { type: "link", - path: "/basics", + path: "/learn/basics", title: "The Basics", chapterTitle: "Basics", children: [ { type: "link", - path: "/basics/project-directories-files", + path: "/learn/basics/project-directories-files", title: "Project Conventions", }, { type: "link", - path: "/basics/medusa-container", + path: "/learn/basics/medusa-container", title: "Medusa Container", }, { type: "link", - path: "/basics/modules", + path: "/learn/basics/modules", title: "Modules", }, { type: "link", - path: "/basics/api-routes", + path: "/learn/basics/api-routes", title: "API Routes", }, { type: "link", - path: "/basics/commerce-modules", + path: "/learn/basics/commerce-modules", title: "Commerce Modules", }, { type: "link", - path: "/basics/modules-directory-structure", + path: "/learn/basics/modules-directory-structure", title: "Modules Directory Structure", }, { type: "link", - path: "/basics/loaders", + path: "/learn/basics/loaders", title: "Loaders", }, { type: "link", - path: "/basics/events-and-subscribers", + path: "/learn/basics/events-and-subscribers", title: "Events and Subscribers", }, { type: "link", - path: "/basics/scheduled-jobs", + path: "/learn/basics/scheduled-jobs", title: "Scheduled Jobs", }, { type: "link", - path: "/basics/workflows", + path: "/learn/basics/workflows", title: "Workflows", }, { type: "link", - path: "/basics/admin-customizations", + path: "/learn/basics/admin-customizations", title: "Admin Customizations", }, ], }, { type: "link", - path: "/customization", + path: "/learn/customization", title: "Custom Development", chapterTitle: "Customization", children: [ { type: "link", title: "Build Custom Features", - path: "/customization/custom-features", + path: "/learn/customization/custom-features", children: [ { type: "link", title: "Brand Module", - path: "/customization/custom-features/module", + path: "/learn/customization/custom-features/module", }, { type: "link", title: "Create Brand Workflow", - path: "/customization/custom-features/workflow", + path: "/learn/customization/custom-features/workflow", }, { type: "link", title: "Create Brand API Route", - path: "/customization/custom-features/api-route", + path: "/learn/customization/custom-features/api-route", }, ], }, { type: "link", title: "Extend Models", - path: "/customization/extend-models", + path: "/learn/customization/extend-models", children: [ { type: "link", title: "Define Link", - path: "/customization/extend-models/define-link", + path: "/learn/customization/extend-models/define-link", }, { type: "link", title: "Create Links Between Records", - path: "/customization/extend-models/create-links", + path: "/learn/customization/extend-models/create-links", }, { type: "link", title: "Extend Route", - path: "/customization/extend-models/extend-create-product", + path: "/learn/customization/extend-models/extend-create-product", }, { type: "link", title: "Query Linked Records", - path: "/customization/extend-models/query-linked-records", + path: "/learn/customization/extend-models/query-linked-records", }, ], }, { type: "link", title: "Customize Admin", - path: "/customization/customize-admin", + path: "/learn/customization/customize-admin", children: [ { type: "link", title: "Add Widgets", - path: "/customization/customize-admin/widget", + path: "/learn/customization/customize-admin/widget", }, { type: "link", title: "Add UI Route", - path: "/customization/customize-admin/route", + path: "/learn/customization/customize-admin/route", }, ], }, { type: "link", title: "Integrate Systems", - path: "/customization/integrate-systems", + path: "/learn/customization/integrate-systems", children: [ { type: "link", title: "Integrate with Service", - path: "/customization/integrate-systems/service", + path: "/learn/customization/integrate-systems/service", }, { type: "link", title: "Handle Event", - path: "/customization/integrate-systems/handle-event", + path: "/learn/customization/integrate-systems/handle-event", }, { type: "link", title: "Schedule Task", - path: "/customization/integrate-systems/schedule-task", + path: "/learn/customization/integrate-systems/schedule-task", }, ], }, { type: "link", title: "Next Steps", - path: "/customization/next-steps", + path: "/learn/customization/next-steps", }, ], }, { type: "link", - path: "/advanced-development", + path: "/learn/advanced-development", title: "Advanced Development", chapterTitle: "Advanced", children: [ { type: "link", title: "Architecture", - path: "/advanced-development/architecture/overview", + path: "/learn/advanced-development/architecture/overview", children: [ { type: "link", - path: "/advanced-development/architecture/architectural-modules", + path: "/learn/advanced-development/architecture/architectural-modules", title: "Architectural Modules", }, ], @@ -200,177 +200,177 @@ export const sidebar = numberSidebarItems( { type: "link", title: "API Routes", - path: "/advanced-development/api-routes", + path: "/learn/advanced-development/api-routes", children: [ { type: "link", - path: "/advanced-development/api-routes/http-methods", + path: "/learn/advanced-development/api-routes/http-methods", title: "HTTP Methods", }, { type: "link", - path: "/advanced-development/api-routes/parameters", + path: "/learn/advanced-development/api-routes/parameters", title: "Parameters", }, { type: "link", - path: "/advanced-development/api-routes/responses", + path: "/learn/advanced-development/api-routes/responses", title: "Response", }, { type: "link", - path: "/advanced-development/api-routes/middlewares", + path: "/learn/advanced-development/api-routes/middlewares", title: "Middlewares", }, { type: "link", - path: "/advanced-development/api-routes/validation", + path: "/learn/advanced-development/api-routes/validation", title: "Validation", }, { type: "link", - path: "/advanced-development/api-routes/protected-routes", + path: "/learn/advanced-development/api-routes/protected-routes", title: "Protected Routes", }, { type: "link", - path: "/advanced-development/api-routes/errors", + path: "/learn/advanced-development/api-routes/errors", title: "Errors", }, { type: "link", - path: "/advanced-development/api-routes/cors", + path: "/learn/advanced-development/api-routes/cors", title: "Handling CORS", }, { type: "link", - path: "/advanced-development/api-routes/additional-data", + path: "/learn/advanced-development/api-routes/additional-data", title: "Additional Data", }, ], }, { type: "link", - path: "/advanced-development/modules", + path: "/learn/advanced-development/modules", title: "Modules", children: [ { type: "link", - path: "/advanced-development/modules/isolation", + path: "/learn/advanced-development/modules/isolation", title: "Module Isolation", }, { type: "link", - path: "/advanced-development/modules/container", + path: "/learn/advanced-development/modules/container", title: "Module's Container", }, { type: "link", - path: "/advanced-development/modules/options", + path: "/learn/advanced-development/modules/options", title: "Module Options", }, { type: "link", - path: "/advanced-development/modules/service-factory", + path: "/learn/advanced-development/modules/service-factory", title: "Service Factory", }, { type: "link", - path: "/advanced-development/modules/service-constraints", + path: "/learn/advanced-development/modules/service-constraints", title: "Service Constraints", }, { type: "link", - path: "/advanced-development/modules/db-operations", + path: "/learn/advanced-development/modules/db-operations", title: "Database Operations", }, { type: "link", - path: "/advanced-development/modules/multiple-services", + path: "/learn/advanced-development/modules/multiple-services", title: "Multiple Services", }, ], }, { type: "link", - path: "/advanced-development/module-links", + path: "/learn/advanced-development/module-links", title: "Module Links", children: [ { type: "link", - path: "/advanced-development/module-links/directions", + path: "/learn/advanced-development/module-links/directions", title: "Module Link Direction", }, { type: "link", - path: "/advanced-development/module-links/remote-link", + path: "/learn/advanced-development/module-links/remote-link", title: "Remote Link", }, { type: "link", - path: "/advanced-development/module-links/query", + path: "/learn/advanced-development/module-links/query", title: "Query", }, { type: "link", - path: "/advanced-development/module-links/custom-columns", + path: "/learn/advanced-development/module-links/custom-columns", title: "Custom Columns", }, ], }, { type: "link", - path: "/advanced-development/data-models", + path: "/learn/advanced-development/data-models", title: "Data Models", children: [ { type: "link", - path: "/advanced-development/data-models/infer-type", + path: "/learn/advanced-development/data-models/infer-type", title: "Infer Type", }, { type: "link", - path: "/advanced-development/data-models/property-types", + path: "/learn/advanced-development/data-models/property-types", title: "Property Types", }, { type: "link", - path: "/advanced-development/data-models/primary-key", + path: "/learn/advanced-development/data-models/primary-key", title: "Primary Key", }, { type: "link", - path: "/advanced-development/data-models/default-properties", + path: "/learn/advanced-development/data-models/default-properties", title: "Default Properties", }, { type: "link", - path: "/advanced-development/data-models/configure-properties", + path: "/learn/advanced-development/data-models/configure-properties", title: "Configure Properties", }, { type: "link", - path: "/advanced-development/data-models/relationships", + path: "/learn/advanced-development/data-models/relationships", title: "Relationships", }, { type: "link", - path: "/advanced-development/data-models/manage-relationships", + path: "/learn/advanced-development/data-models/manage-relationships", title: "Manage Relationships", }, { type: "link", - path: "/advanced-development/data-models/index", + path: "/learn/advanced-development/data-models/index", title: "Define Index", }, { type: "link", - path: "/advanced-development/data-models/searchable-property", + path: "/learn/advanced-development/data-models/searchable-property", title: "Searchable Property", }, { type: "link", - path: "/advanced-development/data-models/write-migration", + path: "/learn/advanced-development/data-models/write-migration", title: "Write Migration", }, ], @@ -381,11 +381,11 @@ export const sidebar = numberSidebarItems( children: [ { type: "link", - path: "/advanced-development/events-and-subscribers/data-payload", + path: "/learn/advanced-development/events-and-subscribers/data-payload", title: "Events Data Payload", }, { - path: "/advanced-development/events-and-subscribers/emit-event", + path: "/learn/advanced-development/events-and-subscribers/emit-event", title: "Emit an Event", }, ], @@ -396,81 +396,81 @@ export const sidebar = numberSidebarItems( children: [ { type: "link", - path: "/advanced-development/scheduled-jobs/execution-number", + path: "/learn/advanced-development/scheduled-jobs/execution-number", title: "Execution Number", }, ], }, { type: "link", - path: "/advanced-development/workflows", + path: "/learn/advanced-development/workflows", title: "Workflows", children: [ { type: "link", - path: "/advanced-development/workflows/variable-manipulation", + path: "/learn/advanced-development/workflows/variable-manipulation", title: "Variable Manipulation", }, { type: "link", - path: "/advanced-development/workflows/conditions", + path: "/learn/advanced-development/workflows/conditions", title: "Using Conditions", }, { type: "link", - path: "/advanced-development/workflows/constructor-constraints", + path: "/learn/advanced-development/workflows/constructor-constraints", title: "Constructor Constraints", }, { type: "link", - path: "/advanced-development/workflows/compensation-function", + path: "/learn/advanced-development/workflows/compensation-function", title: "Compensation Function", }, { type: "link", - path: "/advanced-development/workflows/workflow-hooks", + path: "/learn/advanced-development/workflows/workflow-hooks", title: "Workflow Hooks", }, { type: "link", - path: "/advanced-development/workflows/add-workflow-hook", + path: "/learn/advanced-development/workflows/add-workflow-hook", title: "Expose a Hook", }, { type: "link", - path: "/advanced-development/workflows/access-workflow-errors", + path: "/learn/advanced-development/workflows/access-workflow-errors", title: "Access Workflow Errors", }, { type: "link", - path: "/advanced-development/workflows/retry-failed-steps", + path: "/learn/advanced-development/workflows/retry-failed-steps", title: "Retry Failed Steps", }, { type: "link", - path: "/advanced-development/workflows/parallel-steps", + path: "/learn/advanced-development/workflows/parallel-steps", title: "Run Steps in Parallel", }, { type: "link", - path: "/advanced-development/workflows/workflow-timeout", + path: "/learn/advanced-development/workflows/workflow-timeout", title: "Workflow Timeout", }, { type: "link", - path: "/advanced-development/workflows/long-running-workflow", + path: "/learn/advanced-development/workflows/long-running-workflow", title: "Long-Running Workflow", }, { type: "link", - path: "/advanced-development/workflows/execute-another-workflow", + path: "/learn/advanced-development/workflows/execute-another-workflow", title: "Execute Another Workflow", }, ], }, { type: "link", - path: "/advanced-development/custom-cli-scripts", + path: "/learn/advanced-development/custom-cli-scripts", title: "Custom CLI Scripts", children: [ { @@ -482,27 +482,27 @@ export const sidebar = numberSidebarItems( }, { type: "link", - path: "/advanced-development/admin", + path: "/learn/advanced-development/admin", title: "Admin Development", children: [ { type: "link", - path: "/advanced-development/admin/widgets", + path: "/learn/advanced-development/admin/widgets", title: "Admin Widgets", }, { type: "link", - path: "/advanced-development/admin/ui-routes", + path: "/learn/advanced-development/admin/ui-routes", title: "Admin UI Routes", }, { type: "link", - path: "/advanced-development/admin/constraints", + path: "/learn/advanced-development/admin/constraints", title: "Constraints", }, { type: "link", - path: "/advanced-development/admin/tips", + path: "/learn/advanced-development/admin/tips", title: "Tips", }, ], @@ -511,87 +511,87 @@ export const sidebar = numberSidebarItems( }, { type: "link", - path: "/storefront-development", + path: "/learn/storefront-development", title: "Storefront Development", chapterTitle: "Storefront", children: [ { type: "link", - path: "/storefront-development/nextjs-starter", + path: "/learn/storefront-development/nextjs-starter", title: "Next.js Starter", }, ], }, { type: "link", - path: "/debugging-and-testing", + path: "/learn/debugging-and-testing", title: "Debugging and Testing", chapterTitle: "Debugging & Testing", children: [ { type: "link", - path: "/debugging-and-testing/testing-tools", + path: "/learn/debugging-and-testing/testing-tools", title: "Testing Tools", }, { type: "link", - path: "/debugging-and-testing/testing-tools/integration-tests", + path: "/learn/debugging-and-testing/testing-tools/integration-tests", title: "Integration Tests", children: [ { type: "link", - path: "/debugging-and-testing/testing-tools/integration-tests/api-routes", + path: "/learn/debugging-and-testing/testing-tools/integration-tests/api-routes", title: "Example: API Routes Tests", }, { type: "link", - path: "/debugging-and-testing/testing-tools/integration-tests/workflows", + path: "/learn/debugging-and-testing/testing-tools/integration-tests/workflows", title: "Example: Workflows Tests", }, ], }, { type: "link", - path: "/debugging-and-testing/testing-tools/modules-tests", + path: "/learn/debugging-and-testing/testing-tools/modules-tests", title: "Modules Tests", children: [ { type: "link", - path: "/debugging-and-testing/testing-tools/modules-tests/module-example", + path: "/learn/debugging-and-testing/testing-tools/modules-tests/module-example", title: "Example", }, ], }, { type: "link", - path: "/debugging-and-testing/instrumentation", + path: "/learn/debugging-and-testing/instrumentation", title: "Instrumentation", }, { type: "link", - path: "/debugging-and-testing/logging", + path: "/learn/debugging-and-testing/logging", title: "Logging", }, ], }, { type: "link", - path: "/deployment", + path: "/learn/deployment", title: "Deployment", }, { type: "link", - path: "/more-resources", + path: "/learn/more-resources", title: "More Resources", children: [ { type: "link", - path: "/more-resources/cheatsheet", + path: "/learn/more-resources/cheatsheet", title: "Cheat Sheet", }, { type: "link", - path: "/more-resources/examples", + path: "/learn/more-resources/examples", title: "Examples", }, ], diff --git a/www/apps/book/tailwind.config.js b/www/apps/book/tailwind.config.js index d582b22247162..488af7843f90a 100644 --- a/www/apps/book/tailwind.config.js +++ b/www/apps/book/tailwind.config.js @@ -32,6 +32,8 @@ module.exports = { "search-no-result-dark": "url('/images/search-no-result.svg')", "magnifying-glass": "url('/images/magnifying-glass.svg')", "magnifying-glass-dark": "url('/images/magnifying-glass-dark.svg')", + "bg-stripes": "url('/v2/images/bg-stripes.png')", + "bg-stripes-dark": "url('/v2/images/bg-stripes-dark.png')", }, }, } diff --git a/www/apps/book/utils/number-sidebar-items.mjs b/www/apps/book/utils/number-sidebar-items.mjs index 318fd4c740f9c..e341e09387a7e 100644 --- a/www/apps/book/utils/number-sidebar-items.mjs +++ b/www/apps/book/utils/number-sidebar-items.mjs @@ -5,7 +5,6 @@ * @returns {import("@/types").SidebarItem[]} The modified sidebar items */ export default function numberSidebarItems(sidebarItems, numbering = [1]) { - // TODO generate chapter titles if (!numbering.length) { numbering.push(1) } @@ -24,7 +23,7 @@ export default function numberSidebarItems(sidebarItems, numbering = [1]) { item.chapterTitle = `${item.number} ${ item.chapterTitle?.trim() || item.title?.trim() }` - item.title = `${item.number} ${item.title.trim()}` + item.title = item.title.trim() if (isTopItems) { // Add chapter category diff --git a/www/apps/resources/app/admin-components/components/forms/page.mdx b/www/apps/resources/app/admin-components/components/forms/page.mdx index fc3b34fbd1123..469dcae57d83c 100644 --- a/www/apps/resources/app/admin-components/components/forms/page.mdx +++ b/www/apps/resources/app/admin-components/components/forms/page.mdx @@ -175,7 +175,7 @@ You create the `CreateForm` component. For now, it uses `useForm` from `react-ho You also define a `handleSubmit` function to perform an action when the form is submitted. -You can replace the content of the function with sending a request to Medusa's routes. Refer to [this guide](!docs!/advanced-development/admin/tips#send-requests-to-api-routes) for more details on how to do that. +You can replace the content of the function with sending a request to Medusa's routes. Refer to [this guide](!docs!/learn/advanced-development/admin/tips#send-requests-to-api-routes) for more details on how to do that. ### Render Components @@ -454,7 +454,7 @@ You create the `EditForm` component. For now, it uses `useForm` from `react-hook You also define a `handleSubmit` function to perform an action when the form is submitted. -You can replace the content of the function with sending a request to Medusa's routes. Refer to [this guide](!docs!/advanced-development/admin/tips#send-requests-to-api-routes) for more details on how to do that. +You can replace the content of the function with sending a request to Medusa's routes. Refer to [this guide](!docs!/learn/advanced-development/admin/tips#send-requests-to-api-routes) for more details on how to do that. ### Render Components diff --git a/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx b/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx index a190e10bb8dc1..b37100870fb29 100644 --- a/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx @@ -12,7 +12,7 @@ Before creating an actor type, you must have a module with a data model represen -Learn how to create a module in [this guide](!docs!/basics/modules). +Learn how to create a module in [this guide](!docs!/learn/basics/modules). diff --git a/www/apps/resources/app/commerce-modules/cart/extend/page.mdx b/www/apps/resources/app/commerce-modules/cart/extend/page.mdx index e80fad21085c7..7d671ff0ddc0a 100644 --- a/www/apps/resources/app/commerce-modules/cart/extend/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/extend/page.mdx @@ -22,7 +22,7 @@ Consider you have a Hello Module defined in the `/src/modules/hello` directory. -If you don't have a module, follow [this guide](!docs!/basics/modules) to create one. +If you don't have a module, follow [this guide](!docs!/learn/basics/modules) to create one. @@ -43,7 +43,7 @@ This creates a `Custom` data model that has the `id` and `custom_name` propertie -Learn more about data models in [this guide](!docs!/data-models). +Learn more about data models in [this guide](!docs!/learn/data-models). @@ -55,7 +55,7 @@ Next, you'll define a module link between the `Custom` and `Cart` data model. A -Learn more about module links in [this guide](!docs!/module-links). +Learn more about module links in [this guide](!docs!/learn/module-links). @@ -82,7 +82,7 @@ This defines a link between the `Cart` and `Custom` data models. Using this link items={[ { text: "Module must be registered in medusa-config.ts", - link: "!docs!/basics/modules#4-add-module-to-configurations" + link: "!docs!/learn/basics/modules#4-add-module-to-configurations" } ]} /> @@ -115,7 +115,7 @@ To do that, you'll consume the [cartCreated](/references/medusa-workflows/create -Learn more about workflow hooks in [this guide](!docs!/advanced-development/workflows/workflow-hooks). +Learn more about workflow hooks in [this guide](!docs!/learn/advanced-development/workflows/workflow-hooks). @@ -150,7 +150,7 @@ In the snippet above, you add a validation rule indicating that `custom_name` is -Learn more about additional data validation in [this guide](!docs!/advanced-development/api-routes/additional-data). +Learn more about additional data validation in [this guide](!docs!/learn/advanced-development/api-routes/additional-data). @@ -202,7 +202,7 @@ In the compensation function that undoes the step's actions in case of an error, -Learn more about compensation functions in [this guide](!docs!/advanced-development/workflows/compensation-function). +Learn more about compensation functions in [this guide](!docs!/learn/advanced-development/workflows/compensation-function). @@ -260,9 +260,9 @@ The workflow accepts as an input the created cart and the `additional_data` para In the workflow, you: -1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). 2. Create the `Custom` record using the `createCustomStep`. -3. Use the `when-then` utility to link the cart to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +3. Use the `when-then` utility to link the cart to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). You'll next call the workflow in the hook handler. @@ -355,7 +355,7 @@ Among the returned `cart` object, you'll find a `custom` property which holds th ### Retrieve using Query -You can also retrieve the `Custom` record linked to a cart in your code using [Query](!docs!/advanced-development/module-links/query). +You can also retrieve the `Custom` record linked to a cart in your code using [Query](!docs!/learn/advanced-development/module-links/query). For example: @@ -369,7 +369,7 @@ const { data: [cart] } = await query.graph({ }) ``` -Learn more about how to use Query in [this guide](!docs!/advanced-development/module-links/query). +Learn more about how to use Query in [this guide](!docs!/learn/advanced-development/module-links/query). --- diff --git a/www/apps/resources/app/commerce-modules/customer/extend/page.mdx b/www/apps/resources/app/commerce-modules/customer/extend/page.mdx index 6bbf7a358b873..b3914e75dd13c 100644 --- a/www/apps/resources/app/commerce-modules/customer/extend/page.mdx +++ b/www/apps/resources/app/commerce-modules/customer/extend/page.mdx @@ -28,7 +28,7 @@ Consider you have a Hello Module defined in the `/src/modules/hello` directory. -If you don't have a module, follow [this guide](!docs!/basics/modules) to create one. +If you don't have a module, follow [this guide](!docs!/learn/basics/modules) to create one. @@ -49,7 +49,7 @@ This creates a `Custom` data model that has the `id` and `custom_name` propertie -Learn more about data models in [this guide](!docs!/data-models). +Learn more about data models in [this guide](!docs!/learn/data-models). @@ -61,7 +61,7 @@ Next, you'll define a module link between the `Custom` and `Customer` data model -Learn more about module links in [this guide](!docs!/module-links). +Learn more about module links in [this guide](!docs!/learn/module-links). @@ -88,7 +88,7 @@ This defines a link between the `Customer` and `Custom` data models. Using this items={[ { text: "Module must be registered in medusa-config.ts", - link: "!docs!/basics/modules#4-add-module-to-configurations" + link: "!docs!/learn/basics/modules#4-add-module-to-configurations" } ]} /> @@ -121,7 +121,7 @@ To do that, you'll consume the [customersCreated](/resources/references/medusa-w -Learn more about workflow hooks in [this guide](!docs!/advanced-development/workflows/workflow-hooks). +Learn more about workflow hooks in [this guide](!docs!/learn/advanced-development/workflows/workflow-hooks). @@ -156,7 +156,7 @@ In the snippet above, you add a validation rule indicating that `custom_name` is -Learn more about additional data validation in [this guide](!docs!/advanced-development/api-routes/additional-data). +Learn more about additional data validation in [this guide](!docs!/learn/advanced-development/api-routes/additional-data). @@ -208,7 +208,7 @@ In the compensation function that undoes the step's actions in case of an error, -Learn more about compensation functions in [this guide](!docs!/advanced-development/workflows/compensation-function). +Learn more about compensation functions in [this guide](!docs!/learn/advanced-development/workflows/compensation-function). @@ -266,9 +266,9 @@ The workflow accepts as an input the created customer and the `additional_data` In the workflow, you: -1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). 2. Create the `Custom` record using the `createCustomStep`. -3. Use the `when-then` utility to link the customer to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +3. Use the `when-then` utility to link the customer to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). You'll next execute the workflow in the hook handler. @@ -367,7 +367,7 @@ Among the returned `customer` object, you'll find a `custom` property which hold ### Retrieve using Query -You can also retrieve the `Custom` record linked to a customer in your code using [Query](!docs!/advanced-development/module-links/query). +You can also retrieve the `Custom` record linked to a customer in your code using [Query](!docs!/learn/advanced-development/module-links/query). For example: @@ -381,7 +381,7 @@ const { data: [customer] } = await query.graph({ }) ``` -Learn more about how to use Query in [this guide](!docs!/advanced-development/module-links/query). +Learn more about how to use Query in [this guide](!docs!/learn/advanced-development/module-links/query). --- diff --git a/www/apps/resources/app/commerce-modules/product/guides/price/page.mdx b/www/apps/resources/app/commerce-modules/product/guides/price/page.mdx index e69b068af834b..78e2a80bf7fb5 100644 --- a/www/apps/resources/app/commerce-modules/product/guides/price/page.mdx +++ b/www/apps/resources/app/commerce-modules/product/guides/price/page.mdx @@ -8,7 +8,7 @@ export const metadata = { # {metadata.title} -In this document, you'll learn how to retrieve product variant prices in the Medusa application using [Query](!docs!/advanced-development/module-links/query). +In this document, you'll learn how to retrieve product variant prices in the Medusa application using [Query](!docs!/learn/advanced-development/module-links/query). diff --git a/www/apps/resources/app/globals.css b/www/apps/resources/app/globals.css index abdd9847fb297..97686aaf3e93e 100644 --- a/www/apps/resources/app/globals.css +++ b/www/apps/resources/app/globals.css @@ -5,11 +5,17 @@ @layer base { html { - -webkit-font-smoothing: antialiased; + --webkit-font-smoothing: antialiased; + overscroll-behavior-y: none; } body { @apply overflow-x-hidden; + overscroll-behavior-y: none; + } + + #main { + overscroll-behavior-y: contain; } *::selection { @@ -22,6 +28,7 @@ aside * { scrollbar-color: var(--docs-border-base) var(--docs-bg-subtle); + overscroll-behavior-y: contain; } body[data-modal="opened"] { diff --git a/www/apps/resources/app/layout.tsx b/www/apps/resources/app/layout.tsx index 7ee078e186bca..0ccd725d31292 100644 --- a/www/apps/resources/app/layout.tsx +++ b/www/apps/resources/app/layout.tsx @@ -2,7 +2,7 @@ import type { Metadata } from "next" import { Inter, Roboto_Mono } from "next/font/google" import Providers from "@/providers" import "./globals.css" -import { TightLayout } from "docs-ui" +import { BareboneLayout, TightLayout } from "docs-ui" import { config } from "@/config" import clsx from "clsx" import { Feedback } from "@/components/Feedback" @@ -37,16 +37,17 @@ export default function RootLayout({ children: React.ReactNode }) { return ( - } - editComponent={} - > - {children} - + + } + editComponent={} + ProvidersComponent={Providers} + > + {children} + + ) } diff --git a/www/apps/resources/app/medusa-cli/commands/exec/page.mdx b/www/apps/resources/app/medusa-cli/commands/exec/page.mdx index e640962ef4bc9..ec86d4bac9cbf 100644 --- a/www/apps/resources/app/medusa-cli/commands/exec/page.mdx +++ b/www/apps/resources/app/medusa-cli/commands/exec/page.mdx @@ -11,7 +11,7 @@ export const metadata = { # {metadata.title} -Run a custom CLI script. Learn more about it in [this guide](!docs!/advanced-development/custom-cli-scripts). +Run a custom CLI script. Learn more about it in [this guide](!docs!/learn/advanced-development/custom-cli-scripts). ```bash npx medusa exec [file] [args...] diff --git a/www/apps/resources/app/recipes/b2b/page.mdx b/www/apps/resources/app/recipes/b2b/page.mdx index 43bc70cde5121..9ac8e49266f99 100644 --- a/www/apps/resources/app/recipes/b2b/page.mdx +++ b/www/apps/resources/app/recipes/b2b/page.mdx @@ -173,13 +173,13 @@ You can create a B2B module that adds necessary data models to represent a B2B c {/* - You can store the product's ID in the external system using the `metadata` property of the `Product` data model in the Product Module. Alternatively, you can create a [data model](!docs!/basics/modules#1-create-data-model) in your module to store data related to the external system. + You can store the product's ID in the external system using the `metadata` property of the `Product` data model in the Product Module. Alternatively, you can create a [data model](!docs!/learn/basics/modules#1-create-data-model) in your module to store data related to the external system. @@ -150,7 +150,7 @@ Workflows can be executed from anywhere. So, taking the workflow described above Workflows guarantee data consistency through their compensation feature. You can provide a compensation function to steps that roll back the actions of that step. Then, if an error occurs in any step, the actions of previous steps are rolled back using their compensation function. -If you’re calling this API route from a frontend client, make sure to set the [CORS middleware](!docs!/advanced-development/api-routes/cors) on it since it’s not under the `/store` or `/admin` route prefixes. +If you’re calling this API route from a frontend client, make sure to set the [CORS middleware](!docs!/learn/advanced-development/api-routes/cors) on it since it’s not under the `/store` or `/admin` route prefixes. ### Further Reads -- [How to Create a Workflow](!docs!/basics/workflows) -- [What is a Compensation Function](!docs!/advanced-development/workflows/compensation-function) -- [How to Create an API route](!docs!/basics/api-routes) +- [How to Create a Workflow](!docs!/learn/basics/workflows) +- [What is a Compensation Function](!docs!/learn/advanced-development/workflows/compensation-function) +- [How to Create an API route](!docs!/learn/basics/api-routes) --- @@ -687,7 +687,7 @@ This returns the list of restaurants in the response. ### Further Reads -- [What is and how to use it](!docs!/advanced-development/module-links/query) +- [What is and how to use it](!docs!/learn/advanced-development/module-links/query) - [How to Retrieve Prices for Product Variants](../../../../commerce-modules/product/guides/price/page.mdx) --- @@ -1542,7 +1542,7 @@ In this step, you’ll create the workflow that handles the different stages of For example, when a restaurant finishes preparing the order’s items, this workflow creates a fulfillment for the order. -This workflow will be a [long-running workflow](!docs!/advanced-development/workflows/long-running-workflow) that runs asynchronously in the background. Its async steps only succeed once an outside action sets its status, allowing the workflow to move to the next step. +This workflow will be a [long-running workflow](!docs!/learn/advanced-development/workflows/long-running-workflow) that runs asynchronously in the background. Its async steps only succeed once an outside action sets its status, allowing the workflow to move to the next step. API routes that perform actions related to the delivery, which you’ll create later, will trigger the workflow to move to the next step. @@ -2063,7 +2063,7 @@ In the next steps, you’ll execute the workflow and see it in action as you add ### Further Reads -- [Long-Running Workflows](!docs!/advanced-development/workflows/long-running-workflow) +- [Long-Running Workflows](!docs!/learn/advanced-development/workflows/long-running-workflow) --- @@ -3459,7 +3459,7 @@ The next steps of this example depend on your use case. This section provides so ### Admin Development -The Medusa Admin is extendable, allowing you to add widgets to existing pages or create new pages. Learn more about it in [this documentation](!docs!/advanced-development/admin). +The Medusa Admin is extendable, allowing you to add widgets to existing pages or create new pages. Learn more about it in [this documentation](!docs!/learn/advanced-development/admin). ### Storefront Development diff --git a/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx b/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx index 83ed961f99e9a..e7d6acd853f1a 100644 --- a/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx +++ b/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx @@ -116,7 +116,7 @@ class MarketplaceModuleService extends MedusaService({ export default MarketplaceModuleService ``` -The service extends the [service factory](!docs!/advanced-development/modules/service-factory), which provides basic data-management features. +The service extends the [service factory](!docs!/learn/advanced-development/modules/service-factory), which provides basic data-management features. ### Create Module Definition @@ -150,8 +150,8 @@ module.exports = defineConfig({ ### Further Reads -- [How to Create a Module](!docs!/basics/modules) -- [How to Create Data Models](!docs!/basics/modules#1-create-data-model) +- [How to Create a Module](!docs!/learn/basics/modules) +- [How to Create Data Models](!docs!/learn/basics/modules#1-create-data-model) --- @@ -203,7 +203,7 @@ This adds a list link between the `Vendor` and `Order` data models, indicating t ### Further Read -- [How to Define Module Links](!docs!/advanced-development/module-links) +- [How to Define Module Links](!docs!/learn/advanced-development/module-links) --- @@ -338,10 +338,10 @@ You return the created vendor admin. ### Further Read -- [How to Create a Workflow](!docs!/basics/workflows) +- [How to Create a Workflow](!docs!/learn/basics/workflows) - [What is an Actor Type](../../../../commerce-modules/auth/auth-identity-and-actor-types/page.mdx) - [How to Create an Actor Type](../../../../commerce-modules/auth/create-actor-type/page.mdx) -- [What is a Compensation Function](!docs!/advanced-development/workflows/compensation-function) +- [What is a Compensation Function](!docs!/learn/advanced-development/workflows/compensation-function) --- @@ -513,7 +513,7 @@ This route is available because you created the `vendor` actor type previously. -Don't include a trailing slash at the end of the URL. Learn more [here](!docs!/advanced-development/api-routes/middlewares). +Don't include a trailing slash at the end of the URL. Learn more [here](!docs!/learn/advanced-development/api-routes/middlewares). @@ -549,8 +549,8 @@ Use this token in the header of later requests that require authentication. ### Further Reads -- [How to Create an API route](!docs!/basics/api-routes) -- [How to Create a Middleware](!docs!/advanced-development/api-routes/middlewares) +- [How to Create an API route](!docs!/learn/basics/api-routes) +- [How to Create a Middleware](!docs!/learn/advanced-development/api-routes/middlewares) - [Learn more about the /auth route](../../../../commerce-modules/auth/authentication-route/page.mdx) --- @@ -778,8 +778,8 @@ curl 'http://localhost:9000/vendors/products' \ ### Further Reads -- [How to use Query](!docs!/advanced-development/module-links/query) -- [How to use the Remote Link](!docs!/advanced-development/module-links/remote-link) +- [How to use Query](!docs!/learn/advanced-development/module-links/query) +- [How to use the Remote Link](!docs!/learn/advanced-development/module-links/remote-link) --- @@ -1361,7 +1361,7 @@ For example, you can link sales channels to vendors or other settings. -[Learn more about module links](!docs!/advanced-development/module-links). +[Learn more about module links](!docs!/learn/advanced-development/module-links). @@ -1373,6 +1373,6 @@ You can also create a custom storefront. Check out the [Storefront Development]( ### Admin Development -The Medusa Admin is extendable, allowing you to add widgets to existing pages or create new pages. Learn more about it in [this documentation](!docs!/advanced-development/admin). +The Medusa Admin is extendable, allowing you to add widgets to existing pages or create new pages. Learn more about it in [this documentation](!docs!/learn/advanced-development/admin). If your use case requires bigger customizations to the admin, such as showing different products and orders based on the logged-in vendor, use the [admin API routes](!api!/admin) to build a custom admin. diff --git a/www/apps/resources/app/recipes/marketplace/page.mdx b/www/apps/resources/app/recipes/marketplace/page.mdx index dc5ab1665bd4b..332c426aa0962 100644 --- a/www/apps/resources/app/recipes/marketplace/page.mdx +++ b/www/apps/resources/app/recipes/marketplace/page.mdx @@ -35,13 +35,13 @@ You can create a marketplace module that implements data models for vendors, the -This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/advanced-development/module-links/query). +This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/advanced-development/module-links/query). diff --git a/www/apps/resources/app/service-factory-reference/methods/listAndCount/page.mdx b/www/apps/resources/app/service-factory-reference/methods/listAndCount/page.mdx index 350f99c57672e..33aac00fa951b 100644 --- a/www/apps/resources/app/service-factory-reference/methods/listAndCount/page.mdx +++ b/www/apps/resources/app/service-factory-reference/methods/listAndCount/page.mdx @@ -54,7 +54,7 @@ The method returns an array with two items: -This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/advanced-development/module-links/query). +This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/advanced-development/module-links/query). diff --git a/www/apps/resources/app/service-factory-reference/methods/retrieve/page.mdx b/www/apps/resources/app/service-factory-reference/methods/retrieve/page.mdx index c4d81f61cc9fa..cc09b4c4ac42b 100644 --- a/www/apps/resources/app/service-factory-reference/methods/retrieve/page.mdx +++ b/www/apps/resources/app/service-factory-reference/methods/retrieve/page.mdx @@ -30,7 +30,7 @@ The method returns the record as an object. -This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/advanced-development/module-links/query). +This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/advanced-development/module-links/query). diff --git a/www/apps/resources/app/service-factory-reference/page.mdx b/www/apps/resources/app/service-factory-reference/page.mdx index 099f6dabcfe47..c145165551066 100644 --- a/www/apps/resources/app/service-factory-reference/page.mdx +++ b/www/apps/resources/app/service-factory-reference/page.mdx @@ -10,7 +10,7 @@ This section of the documentation provides a reference of the methods generated -Learn more about the service factory in [this documentation](!docs!/advanced-development/modules/service-factory). +Learn more about the service factory in [this documentation](!docs!/learn/advanced-development/modules/service-factory). diff --git a/www/apps/resources/app/storefront-development/products/price/examples/tax-price/page.mdx b/www/apps/resources/app/storefront-development/products/price/examples/tax-price/page.mdx index 75b8776d6ce93..24d2aa7db0b9a 100644 --- a/www/apps/resources/app/storefront-development/products/price/examples/tax-price/page.mdx +++ b/www/apps/resources/app/storefront-development/products/price/examples/tax-price/page.mdx @@ -41,7 +41,7 @@ fetch(`http://localhost:9000/store/products/${id}?${queryParams.toString()}`, { }) ``` -You pass the selected region's ID and the code of its first country as query parameters to the [Get Product API route](https://docs.medusajs.com/v2/api/store#products_getproductsid). +You pass the selected region's ID and the code of its first country as query parameters to the [Get Product API route](!api!/store#products_getproductsid). @@ -248,6 +248,6 @@ export default function Product({ params: { id } }: Params) { In this example, you: -- Pass the selected region's ID and the code of its first country as query parameters to the [Get Product API route](https://docs.medusajs.com/v2/api/store#products_getproductsid). +- Pass the selected region's ID and the code of its first country as query parameters to the [Get Product API route](!api!/store#products_getproductsid). - You can instead allow the customer to choose their country. - Display the selected variant's price by formatting its price's `calculated_amount_with_tax` property. diff --git a/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx b/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx index ed288ac27d7d1..e3d26b715d28a 100644 --- a/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx +++ b/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx @@ -18,7 +18,7 @@ Refer to the [Admin Widget Injection Zones list](../../../admin-widget-injection Widget and UI routes must be defined as arrow functions. Any other type of declaration isn't accepted. -Refer to the [Admin Development Constraints](!docs!/advanced-development/admin/constraints) documentation for more details. +Refer to the [Admin Development Constraints](!docs!/learn/advanced-development/admin/constraints) documentation for more details. --- @@ -34,7 +34,7 @@ export const config = defineWidgetConfig({ Any other usage leads to the widget not being shown. -Refer to the [Admin Development Constraints](!docs!/advanced-development/admin/constraints) documentation for more details. +Refer to the [Admin Development Constraints](!docs!/learn/advanced-development/admin/constraints) documentation for more details. --- diff --git a/www/apps/ui/src/app/layout.tsx b/www/apps/ui/src/app/layout.tsx index 7066dcb65f702..d618c1a7f3446 100644 --- a/www/apps/ui/src/app/layout.tsx +++ b/www/apps/ui/src/app/layout.tsx @@ -4,7 +4,7 @@ import { Providers } from "@/providers" import { siteConfig } from "@/config/site" import "../styles/globals.css" -import { TightLayout } from "docs-ui" +import { BareboneLayout, TightLayout } from "docs-ui" import { Inter, Roboto_Mono } from "next/font/google" import clsx from "clsx" @@ -33,15 +33,16 @@ export default function RootLayout({ children: React.ReactNode }) { return ( - - {children} - + + + {children} + + ) } diff --git a/www/apps/user-guide/app/layout.tsx b/www/apps/user-guide/app/layout.tsx index 58fd69fd66d3a..30219e21136c2 100644 --- a/www/apps/user-guide/app/layout.tsx +++ b/www/apps/user-guide/app/layout.tsx @@ -2,7 +2,7 @@ import type { Metadata } from "next" import { Inter, Roboto_Mono } from "next/font/google" import Providers from "@/providers" import "../css/globals.css" -import { TightLayout } from "docs-ui" +import { BareboneLayout, TightLayout } from "docs-ui" import { config } from "@/config" import clsx from "clsx" import Feedback from "../components/Feedback" @@ -36,16 +36,17 @@ export default function RootLayout({ children: React.ReactNode }) { return ( - - {children} - - - + + + {children} + + + + ) } diff --git a/www/packages/docs-ui/package.json b/www/packages/docs-ui/package.json index 78cd91dab5314..a7d3bf6ac1cab 100644 --- a/www/packages/docs-ui/package.json +++ b/www/packages/docs-ui/package.json @@ -60,7 +60,7 @@ "react-dom": "^18.2.0" }, "dependencies": { - "@medusajs/icons": "preview", + "@medusajs/icons": "rc", "@medusajs/ui": "^3.0.0", "@octokit/request": "^8.1.1", "@react-hook/resize-observer": "^1.2.6", diff --git a/www/packages/docs-ui/src/components/BorderedIcon/index.tsx b/www/packages/docs-ui/src/components/BorderedIcon/index.tsx index 770df82dccd0d..3706e90cfdd86 100644 --- a/www/packages/docs-ui/src/components/BorderedIcon/index.tsx +++ b/www/packages/docs-ui/src/components/BorderedIcon/index.tsx @@ -1,6 +1,7 @@ import React from "react" import clsx from "clsx" import { IconProps } from "@medusajs/icons/dist/types" +import Image from "next/image" export type BorderedIconProps = { icon?: string @@ -29,9 +30,11 @@ export const BorderedIcon = ({ > {!IconComponent && ( - )} diff --git a/www/packages/docs-ui/src/components/Breadcrumbs/index.tsx b/www/packages/docs-ui/src/components/Breadcrumbs/index.tsx index bdf952ff8a327..ede20126fed5c 100644 --- a/www/packages/docs-ui/src/components/Breadcrumbs/index.tsx +++ b/www/packages/docs-ui/src/components/Breadcrumbs/index.tsx @@ -93,7 +93,7 @@ export const Breadcrumbs = () => { className={clsx( "flex items-center gap-docs_0.25", "text-medusa-fg-muted text-compact-small", - "mb-docs_1" + "mb-docs_1 flex-wrap" )} > {Array.from(breadcrumbItems).map(([link, title], index) => ( diff --git a/www/packages/docs-ui/src/components/Card/Layout/Default/index.tsx b/www/packages/docs-ui/src/components/Card/Layout/Default/index.tsx index 64019230e428b..c84b95d82b1d0 100644 --- a/www/packages/docs-ui/src/components/Card/Layout/Default/index.tsx +++ b/www/packages/docs-ui/src/components/Card/Layout/Default/index.tsx @@ -42,10 +42,7 @@ export const CardDefaultLayout = ({ )} {image && ( )} @@ -53,19 +50,17 @@ export const CardDefaultLayout = ({ className={clsx("flex flex-col flex-1 overflow-auto", contentClassName)} > {title && ( -
+
{title}
)} {text && ( - - {text} - + {text} )} {children}
{badge && } - + {isExternal ? : } diff --git a/www/packages/docs-ui/src/components/Card/Layout/Large/index.tsx b/www/packages/docs-ui/src/components/Card/Layout/Large/index.tsx index 36d255255a394..c06759a202a07 100644 --- a/www/packages/docs-ui/src/components/Card/Layout/Large/index.tsx +++ b/www/packages/docs-ui/src/components/Card/Layout/Large/index.tsx @@ -2,7 +2,7 @@ import React from "react" import { CardProps } from "../.." import { useIsExternalLink } from "../../../.." import clsx from "clsx" -import { ArrowRightMini, ArrowUpRightOnBox } from "@medusajs/icons" +import { ArrowUpRightOnBox, TriangleRightMini } from "@medusajs/icons" import Link from "next/link" export const CardLargeLayout = ({ @@ -30,11 +30,16 @@ export const CardLargeLayout = ({ "shadow-elevation-card-rest dark:shadow-elevation-card-rest-dark", href && "group-hover:shadow-elevation-card-hover group-hover:dark:shadow-elevation-card-hover-dark", - "px-docs_0.75 py-docs_0.5 flex justify-center items-center" + "px-docs_0.75 py-docs_0.5 flex justify-center items-center w-full" )} > {IconComponent && ( - + )} {image && ( {title @@ -44,12 +49,12 @@ export const CardLargeLayout = ({
{title && {title}} {href && isExternal && } - {href && !isExternal && } + {href && !isExternal && ( + + )}
{text && ( - - {text} - + {text} )}
{href && ( diff --git a/www/packages/docs-ui/src/components/Card/Layout/Mini/index.tsx b/www/packages/docs-ui/src/components/Card/Layout/Mini/index.tsx new file mode 100644 index 0000000000000..28a7384f6ece5 --- /dev/null +++ b/www/packages/docs-ui/src/components/Card/Layout/Mini/index.tsx @@ -0,0 +1,97 @@ +"use client" + +import React from "react" +import clsx from "clsx" +import { CardProps } from "../.." +import { BorderedIcon, ThemeImage, useIsExternalLink } from "../../../.." +import Link from "next/link" +import Image from "next/image" +import { ArrowUpRightOnBox, TriangleRightMini } from "@medusajs/icons" + +export const CardLayoutMini = ({ + icon, + image, + themeImage, + title, + text, + href, +}: CardProps) => { + const isExternal = useIsExternalLink({ href }) + + return ( +
+
+ {icon && ( + + )} + {image && ( + {title + )} + {themeImage && ( + + )} +
+ {title && ( + + {title} + + )} + {text && ( + + {text} + + )} +
+ + {isExternal ? : } + + {href && ( + + )} +
+
+ ) +} diff --git a/www/packages/docs-ui/src/components/Card/index.tsx b/www/packages/docs-ui/src/components/Card/index.tsx index b2f47f96caa22..643975e39d09d 100644 --- a/www/packages/docs-ui/src/components/Card/index.tsx +++ b/www/packages/docs-ui/src/components/Card/index.tsx @@ -4,11 +4,16 @@ import { CardDefaultLayout } from "./Layout/Default" import { IconProps } from "@medusajs/icons/dist/types" import { CardLargeLayout } from "./Layout/Large" import { CardFillerLayout } from "./Layout/Filler" +import { CardLayoutMini } from "./Layout/Mini" export type CardProps = { - type?: "default" | "large" | "filler" + type?: "default" | "large" | "filler" | "mini" icon?: React.FC image?: string + themeImage?: { + light: string + dark: string + } title?: string text?: string href?: string @@ -25,6 +30,8 @@ export const Card = ({ type = "default", ...props }: CardProps) => { return case "filler": return + case "mini": + return default: return } diff --git a/www/packages/docs-ui/src/components/CodeBlock/Line/index.tsx b/www/packages/docs-ui/src/components/CodeBlock/Line/index.tsx index d0387f721d5af..d5dc5dfa5489c 100644 --- a/www/packages/docs-ui/src/components/CodeBlock/Line/index.tsx +++ b/www/packages/docs-ui/src/components/CodeBlock/Line/index.tsx @@ -24,6 +24,7 @@ type CodeBlockLineProps = { lineNumberColorClassName: string lineNumberBgClassName: string isTerminal: boolean + animateTokenHighlights?: boolean } & Pick export const CodeBlockLine = ({ @@ -36,6 +37,7 @@ export const CodeBlockLine = ({ lineNumberColorClassName, lineNumberBgClassName, isTerminal, + animateTokenHighlights = false, }: CodeBlockLineProps) => { const lineProps = getLineProps({ line, key: lineNumber }) @@ -94,6 +96,16 @@ export const CodeBlockLine = ({ if (currentPositionInHighlightedText === highlight.text!.length) { // matching text was found, break loop endIndex = tokenIndex + const trimmedContent = token.content.trimEnd() + const endingSpacesLength = + token.content.length - trimmedContent.length + if (endingSpacesLength) { + line.splice(tokenIndex + 1, 0, { + content: new Array(endingSpacesLength).fill(" ").join(""), + types: ["plain"], + }) + token.content = trimmedContent + } return true } }) @@ -197,19 +209,26 @@ export const CodeBlockLine = ({ const getTokensElm = ({ tokens, isTokenHighlighted, - isLineHighlighted, offset, }: { tokens: Token[] isTokenHighlighted: boolean - isLineHighlighted: boolean offset: number }) => ( - + {isTokenHighlighted && ( + )} - > {tokens.map((token, key) => { const tokenKey = offset + key const { className: tokenClassName, ...rest } = getTokenProps({ @@ -221,8 +240,7 @@ export const CodeBlockLine = ({ key={tokenKey} className={clsx( tokenClassName, - (isTokenHighlighted || isLineHighlighted) && - "!text-medusa-contrast-fg-primary" + isTokenHighlighted && "relative z-[1]" )} {...rest} /> @@ -242,7 +260,7 @@ export const CodeBlockLine = ({ {...lineProps} className={clsx( "table-row", - isHighlightedLine && "bg-medusa-contrast-border-base", + isHighlightedLine && "bg-medusa-alpha-white-alpha-6", lineProps.className )} > @@ -287,7 +305,6 @@ export const CodeBlockLine = ({ tokens, isTokenHighlighted: isHighlighted, offset, - isLineHighlighted: isHighlightedLine, })} )} @@ -296,7 +313,6 @@ export const CodeBlockLine = ({ tokens, isTokenHighlighted: isHighlighted, offset, - isLineHighlighted: isHighlightedLine, })} ) diff --git a/www/packages/docs-ui/src/components/CodeBlock/index.tsx b/www/packages/docs-ui/src/components/CodeBlock/index.tsx index 7f3392efef7c4..8d8befeab7698 100644 --- a/www/packages/docs-ui/src/components/CodeBlock/index.tsx +++ b/www/packages/docs-ui/src/components/CodeBlock/index.tsx @@ -47,11 +47,23 @@ export type CodeBlockStyle = "loud" | "subtle" | "inline" export type CodeBlockProps = { source: string lang?: string + wrapperClassName?: string + innerClassName?: string className?: string collapsed?: boolean blockStyle?: CodeBlockStyle children?: React.ReactNode style?: React.HTMLAttributes["style"] + forceNoTitle?: boolean + animateTokenHighlights?: boolean + overrideColors?: { + bg?: string + innerBg?: string + lineNumbersBg?: string + border?: string + innerBorder?: string + boxShadow?: string + } } & CodeBlockMetaFields & Omit @@ -59,7 +71,10 @@ export const CodeBlock = ({ source, hasTabs = false, lang = "", + wrapperClassName, + innerClassName, className, + overrideColors = {}, collapsed = false, title = "", highlights = [], @@ -73,6 +88,8 @@ export const CodeBlock = ({ expandButtonLabel, isTerminal, style, + forceNoTitle = false, + animateTokenHighlights, ...rest }: CodeBlockProps) => { if (!source && typeof children === "string") { @@ -94,6 +111,10 @@ export const CodeBlock = ({ : isTerminal }, [isTerminal, lang]) const codeTitle = useMemo(() => { + if (forceNoTitle) { + return "" + } + if (title) { return title } @@ -107,7 +128,7 @@ export const CodeBlock = ({ } return "Code" - }, [title, isTerminalCode, hasTabs]) + }, [title, isTerminalCode, hasTabs, forceNoTitle]) const hasInnerCodeBlock = useMemo( () => hasTabs || codeTitle.length > 0, [hasTabs, codeTitle] @@ -123,72 +144,90 @@ export const CodeBlock = ({ const bgColor = useMemo( () => clsx( - blockStyle === "loud" && "bg-medusa-contrast-bg-base", - blockStyle === "subtle" && [ - colorMode === "light" && "bg-medusa-bg-subtle", - colorMode === "dark" && "bg-medusa-code-bg-base", + overrideColors.bg, + !overrideColors.bg && [ + blockStyle === "loud" && "bg-medusa-contrast-bg-base", + blockStyle === "subtle" && [ + colorMode === "light" && "bg-medusa-bg-subtle", + colorMode === "dark" && "bg-medusa-code-bg-base", + ], ] ), - [blockStyle, colorMode] + [blockStyle, colorMode, overrideColors] ) const lineNumbersColor = useMemo( () => clsx( - blockStyle === "loud" && "text-medusa-contrast-fg-secondary", - blockStyle === "subtle" && [ - colorMode === "light" && "text-medusa-fg-muted", - colorMode === "dark" && "text-medusa-contrast-fg-secondary", + overrideColors.lineNumbersBg, + !overrideColors.lineNumbersBg && [ + blockStyle === "loud" && "text-medusa-contrast-fg-secondary", + blockStyle === "subtle" && [ + colorMode === "light" && "text-medusa-fg-muted", + colorMode === "dark" && "text-medusa-contrast-fg-secondary", + ], ] ), - [blockStyle, colorMode] + [blockStyle, colorMode, overrideColors] ) const borderColor = useMemo( () => clsx( - blockStyle === "loud" && "border-0", - blockStyle === "subtle" && [ - colorMode === "light" && "border-medusa-border-base", - colorMode === "dark" && "border-medusa-code-border", + overrideColors.border, + !overrideColors.border && [ + blockStyle === "loud" && "border-0", + blockStyle === "subtle" && [ + colorMode === "light" && "border-medusa-border-base", + colorMode === "dark" && "border-medusa-code-border", + ], ] ), - [blockStyle, colorMode] + [blockStyle, colorMode, overrideColors] ) const boxShadow = useMemo( () => clsx( - blockStyle === "loud" && - "shadow-elevation-code-block dark:shadow-elevation-code-block-dark", - blockStyle === "subtle" && "shadow-none" + overrideColors.boxShadow, + !overrideColors.boxShadow && [ + blockStyle === "loud" && + "shadow-elevation-code-block dark:shadow-elevation-code-block-dark", + blockStyle === "subtle" && "shadow-none", + ] ), - [blockStyle] + [blockStyle, overrideColors] ) const innerBgColor = useMemo( () => clsx( - blockStyle === "loud" && [ - hasInnerCodeBlock && "bg-medusa-contrast-bg-subtle", - !hasInnerCodeBlock && "bg-medusa-contrast-bg-base", - ], - blockStyle === "subtle" && bgColor + overrideColors.innerBg, + !overrideColors.innerBg && [ + blockStyle === "loud" && [ + hasInnerCodeBlock && "bg-medusa-contrast-bg-subtle", + !hasInnerCodeBlock && "bg-medusa-contrast-bg-base", + ], + blockStyle === "subtle" && bgColor, + ] ), - [blockStyle, bgColor, hasInnerCodeBlock] + [blockStyle, bgColor, hasInnerCodeBlock, overrideColors] ) const innerBorderClasses = useMemo( () => clsx( - blockStyle === "loud" && [ - hasInnerCodeBlock && - "border border-solid border-medusa-contrast-border-bot rounded-docs_DEFAULT", - !hasInnerCodeBlock && "border-transparent rounded-docs_DEFAULT", - ], - blockStyle === "subtle" && "border-transparent rounded-docs_DEFAULT" + overrideColors.innerBorder, + !overrideColors.innerBorder && [ + blockStyle === "loud" && [ + hasInnerCodeBlock && + "border border-solid border-medusa-contrast-border-bot rounded-docs_DEFAULT", + !hasInnerCodeBlock && "border-transparent rounded-docs_DEFAULT", + ], + blockStyle === "subtle" && "border-transparent rounded-docs_DEFAULT", + ] ), - [blockStyle, hasInnerCodeBlock] + [blockStyle, hasInnerCodeBlock, overrideColors] ) const language = useMemo(() => { @@ -227,6 +266,7 @@ export const CodeBlock = ({ lineNumberColorClassName={lineNumbersColor} lineNumberBgClassName={innerBgColor} isTerminal={isTerminalCode} + animateTokenHighlights={animateTokenHighlights} {...highlightProps} /> ) @@ -309,7 +349,8 @@ export const CodeBlock = ({ blockStyle === "loud" && "code-block-highlight", blockStyle === "subtle" && colorMode === "light" && - "code-block-highlight-light" + "code-block-highlight-light", + wrapperClassName )} > {codeTitle && ( @@ -327,7 +368,7 @@ export const CodeBlock = ({
(
{collapsibleType === "start" && ( @@ -406,13 +452,14 @@ export const CodeBlock = ({ })} - {!hasInnerCodeBlock && ( - - )} + {!hasInnerCodeBlock && + (!noCopy || !noReport || canShowApiTesting) && ( + + )} {collapsibleType === "end" && ( <> { href={`https://github.com/medusajs/medusa/edit/develop${filePath}`} className={clsx( "flex w-fit gap-docs_0.25 my-docs_2 items-center", - "text-medusa-fg-muted hover:text-medusa-fg-subtle" + "text-medusa-fg-muted hover:text-medusa-fg-subtle", + "text-compact-small-plus" )} > Edit this page diff --git a/www/packages/docs-ui/src/components/Feedback/index.tsx b/www/packages/docs-ui/src/components/Feedback/index.tsx index a025adaa032bd..0d84f26dca3d6 100644 --- a/www/packages/docs-ui/src/components/Feedback/index.tsx +++ b/www/packages/docs-ui/src/components/Feedback/index.tsx @@ -32,6 +32,7 @@ export type FeedbackProps = { extraData?: ExtraData vertical?: boolean showLongForm?: boolean + showDottedSeparator?: boolean } & React.HTMLAttributes export const Feedback = ({ @@ -50,6 +51,7 @@ export const Feedback = ({ extraData = {}, vertical = false, showLongForm = false, + showDottedSeparator = true, }: FeedbackProps) => { const [showForm, setShowForm] = useState(false) const [submittedFeedback, setSubmittedFeedback] = useState(false) @@ -121,7 +123,9 @@ export const Feedback = ({ return (
- + {showDottedSeparator && ( + + )} - +
- + {showDottedSeparator && ( + + )}
) } diff --git a/www/packages/docs-ui/src/components/IconHeadline/index.tsx b/www/packages/docs-ui/src/components/IconHeadline/index.tsx new file mode 100644 index 0000000000000..688ea79964322 --- /dev/null +++ b/www/packages/docs-ui/src/components/IconHeadline/index.tsx @@ -0,0 +1,15 @@ +import React from "react" + +type IconHeadlineProps = { + title: string + icon: React.ReactNode +} + +export const IconHeadline = ({ title, icon }: IconHeadlineProps) => { + return ( +
+ {icon} + {title} +
+ ) +} diff --git a/www/packages/docs-ui/src/components/Icons/Book/index.tsx b/www/packages/docs-ui/src/components/Icons/Book/index.tsx new file mode 100644 index 0000000000000..11ac7b0518c7a --- /dev/null +++ b/www/packages/docs-ui/src/components/Icons/Book/index.tsx @@ -0,0 +1,63 @@ +import React from "react" +import { IconProps } from "@medusajs/icons/dist/types" + +export const BookIcon = (props: IconProps) => { + return ( + + + + + + + + + + + + + + + + ) +} diff --git a/www/packages/docs-ui/src/components/Icons/CalendarRefresh/index.tsx b/www/packages/docs-ui/src/components/Icons/CalendarRefresh/index.tsx new file mode 100644 index 0000000000000..7c9a228bea9e9 --- /dev/null +++ b/www/packages/docs-ui/src/components/Icons/CalendarRefresh/index.tsx @@ -0,0 +1,70 @@ +import React from "react" +import { IconProps } from "@medusajs/icons/dist/types" + +export const CalendarRefreshIcon = (props: IconProps) => { + return ( + + + + + + + + + + + + + + + + + ) +} diff --git a/www/packages/docs-ui/src/components/Icons/ChefHat/index.tsx b/www/packages/docs-ui/src/components/Icons/ChefHat/index.tsx new file mode 100644 index 0000000000000..0db37de501eaa --- /dev/null +++ b/www/packages/docs-ui/src/components/Icons/ChefHat/index.tsx @@ -0,0 +1,65 @@ +import React from "react" +import { IconProps } from "@medusajs/icons/dist/types" + +export const ChefHatIcon = (props: IconProps) => { + return ( + + + + + + + + + + + + + + + + ) +} diff --git a/www/packages/docs-ui/src/components/Icons/ImageBinary/index.tsx b/www/packages/docs-ui/src/components/Icons/ImageBinary/index.tsx new file mode 100644 index 0000000000000..f88f3cbc3d095 --- /dev/null +++ b/www/packages/docs-ui/src/components/Icons/ImageBinary/index.tsx @@ -0,0 +1,69 @@ +import React from "react" +import { IconProps } from "@medusajs/icons/dist/types" + +export const ImageBinaryIcon = (props: IconProps) => { + return ( + + + + + + + + + + + + + + + + + ) +} diff --git a/www/packages/docs-ui/src/components/Icons/PuzzleColored/index.tsx b/www/packages/docs-ui/src/components/Icons/PuzzleColored/index.tsx new file mode 100644 index 0000000000000..2172e8980d5dd --- /dev/null +++ b/www/packages/docs-ui/src/components/Icons/PuzzleColored/index.tsx @@ -0,0 +1,35 @@ +import React from "react" +import { IconProps } from "@medusajs/icons/dist/types" + +export const PuzzleColoredIcon = (props: IconProps) => { + return ( + + + + + + + + + + + + ) +} diff --git a/www/packages/docs-ui/src/components/Icons/ScrollText/index.tsx b/www/packages/docs-ui/src/components/Icons/ScrollText/index.tsx new file mode 100644 index 0000000000000..7fdf238f72c1b --- /dev/null +++ b/www/packages/docs-ui/src/components/Icons/ScrollText/index.tsx @@ -0,0 +1,68 @@ +import React from "react" +import { IconProps } from "@medusajs/icons/dist/types" + +export const ScrollTextIcon = (props: IconProps) => { + return ( + + + + + + + + + + + + + + + + + ) +} diff --git a/www/packages/docs-ui/src/components/Icons/Shop/index.tsx b/www/packages/docs-ui/src/components/Icons/Shop/index.tsx new file mode 100644 index 0000000000000..7123605b48246 --- /dev/null +++ b/www/packages/docs-ui/src/components/Icons/Shop/index.tsx @@ -0,0 +1,68 @@ +import React from "react" +import { IconProps } from "@medusajs/icons/dist/types" + +export const ShopIcon = (props: IconProps) => { + return ( + + + + + + + + + + + + + + + + + ) +} diff --git a/www/packages/docs-ui/src/components/Icons/WindowPaintbrush/index.tsx b/www/packages/docs-ui/src/components/Icons/WindowPaintbrush/index.tsx new file mode 100644 index 0000000000000..fe0bf9e841426 --- /dev/null +++ b/www/packages/docs-ui/src/components/Icons/WindowPaintbrush/index.tsx @@ -0,0 +1,57 @@ +import React from "react" +import { IconProps } from "@medusajs/icons/dist/types" + +export const WindowPaintbrushIcon = (props: IconProps) => { + return ( + + + + + + + + + + + + + + + + ) +} diff --git a/www/packages/docs-ui/src/components/Icons/index.tsx b/www/packages/docs-ui/src/components/Icons/index.tsx index f8a18679d0019..8df127ecc2f7a 100644 --- a/www/packages/docs-ui/src/components/Icons/index.tsx +++ b/www/packages/docs-ui/src/components/Icons/index.tsx @@ -1,8 +1,16 @@ export * from "./AiAssistant" +export * from "./Book" +export * from "./CalendarRefresh" +export * from "./ChefHat" export * from "./CircleDottedLine" export * from "./DecisionProcess" +export * from "./ImageBinary" +export * from "./PuzzleColored" export * from "./QuestionMark" +export * from "./ScrollText" export * from "./ShadedBg" +export * from "./Shop" export * from "./StripeColored" export * from "./ThumbDown" export * from "./ThumbUp" +export * from "./WindowPaintbrush" diff --git a/www/packages/docs-ui/src/components/Link/index.tsx b/www/packages/docs-ui/src/components/Link/index.tsx index 93576f6683302..cb70392d0722c 100644 --- a/www/packages/docs-ui/src/components/Link/index.tsx +++ b/www/packages/docs-ui/src/components/Link/index.tsx @@ -2,6 +2,7 @@ import React from "react" import NextLink from "next/link" import type { LinkProps as NextLinkProps } from "next/link" import clsx from "clsx" +import { TriangleRightMini } from "@medusajs/icons" export type LinkProps = { href?: string @@ -9,9 +10,16 @@ export type LinkProps = { className?: string target?: string rel?: string + withIcon?: boolean } & Partial -export const Link = ({ href, children, className, ...rest }: LinkProps) => { +export const Link = ({ + href, + children, + className, + withIcon = false, + ...rest +}: LinkProps) => { if (href?.replace(/#.*$/, "").endsWith("page.mdx")) { href = href.replace("/page.mdx", "") } @@ -21,10 +29,14 @@ export const Link = ({ href, children, className, ...rest }: LinkProps) => { {...rest} className={clsx( "text-medusa-fg-interactive hover:text-medusa-fg-interactive-hover", + withIcon && "flex gap-0.25 items-center group", className )} > {children} + {withIcon && ( + + )} ) } diff --git a/www/packages/docs-ui/src/components/MainNav/DesktopMenu/index.tsx b/www/packages/docs-ui/src/components/MainNav/DesktopMenu/index.tsx index 1c9eef04d7393..d512b017cee9a 100644 --- a/www/packages/docs-ui/src/components/MainNav/DesktopMenu/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/DesktopMenu/index.tsx @@ -6,7 +6,7 @@ import { SidebarLeft, TimelineVertical, } from "@medusajs/icons" -import React, { useRef, useState } from "react" +import React, { useMemo, useRef, useState } from "react" import { Button, getOsShortcut, @@ -17,10 +17,11 @@ import { import clsx from "clsx" import { HouseIcon } from "../../Icons/House" import { MainNavThemeMenu } from "./ThemeMenu" +import { MenuItem } from "types" export const MainNavDesktopMenu = () => { const [isOpen, setIsOpen] = useState(false) - const { setDesktopSidebarOpen } = useSidebar() + const { setDesktopSidebarOpen, isSidebarShown } = useSidebar() const ref = useRef(null) useClickOutside({ @@ -28,6 +29,59 @@ export const MainNavDesktopMenu = () => { onClickOutside: () => setIsOpen(false), }) + const items: MenuItem[] = useMemo(() => { + const items: MenuItem[] = [ + { + type: "link", + icon: , + title: "Homepage", + link: "https://docs.medusajs.com/v2", + }, + { + type: "link", + icon: , + title: "Changelog", + link: "https://medusajs.com/changelog", + }, + { + type: "link", + icon: , + title: "Troubleshooting", + link: "https://docs.medusajs.com/v2/resources/troubleshooting", + }, + ] + + if (isSidebarShown) { + items.push( + { + type: "divider", + }, + { + type: "action", + title: "Hide Sidebar", + icon: , + shortcut: `${getOsShortcut()}\\`, + action: () => { + setDesktopSidebarOpen((prev) => !prev) + setIsOpen(false) + }, + } + ) + } + + items.push( + { + type: "divider", + }, + { + type: "custom", + content: , + } + ) + + return items + }, [isSidebarShown]) + return (
{ "absolute top-[calc(100%+8px)] right-0 min-w-[200px]", !isOpen && "hidden" )} - items={[ - { - type: "link", - icon: , - title: "Homepage", - link: "https://medusajs.com", - }, - { - type: "link", - icon: , - title: "Changelog", - link: "https://medusajs.com/changelog", - }, - { - type: "link", - icon: , - title: "Troubleshooting", - link: "https://docs.medusajs.com/v2/resources/troubleshooting", - }, - { - type: "divider", - }, - { - type: "action", - title: "Hide Sidebar", - icon: , - shortcut: `${getOsShortcut()}\\`, - action: () => { - setDesktopSidebarOpen((prev) => !prev) - setIsOpen(false) - }, - }, - { - type: "divider", - }, - { - type: "custom", - content: , - }, - ]} + items={items} />
) diff --git a/www/packages/docs-ui/src/components/MainNav/Items/Dropdown/index.tsx b/www/packages/docs-ui/src/components/MainNav/Items/Dropdown/index.tsx index dde6072016fd7..0df8dec7b4729 100644 --- a/www/packages/docs-ui/src/components/MainNav/Items/Dropdown/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/Items/Dropdown/index.tsx @@ -4,7 +4,7 @@ import { TriangleDownMini } from "@medusajs/icons" import clsx from "clsx" import React, { useRef, useState } from "react" import { NavigationItemDropdown } from "types" -import { Menu, useClickOutside } from "../../../.." +import { Menu } from "../../../.." type MainNavItemDropdownProps = { item: NavigationItemDropdown @@ -16,15 +16,15 @@ export const MainNavItemDropdown = ({ isActive, }: MainNavItemDropdownProps) => { const [isOpen, setIsOpen] = useState(false) - const ref = useRef(null) - - useClickOutside({ - elmRef: ref, - onClickOutside: () => setIsOpen(false), - }) + const ref = useRef(null) return ( -
+
setIsOpen(true)} + onMouseLeave={() => setIsOpen(false)} + >
setIsOpen((prev) => !prev)} > {item.title}
- setIsOpen(false)} - /> +
+ setIsOpen(false)} + /> +
) } diff --git a/www/packages/docs-ui/src/components/MainNav/Items/index.tsx b/www/packages/docs-ui/src/components/MainNav/Items/index.tsx index e1b8da42de5e8..b40b4558c5305 100644 --- a/www/packages/docs-ui/src/components/MainNav/Items/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/Items/index.tsx @@ -6,14 +6,19 @@ import clsx from "clsx" import { MainNavItemLink } from "./Link" import { MainNavItemDropdown } from "./Dropdown" -export const MainNavItems = () => { +type MainNavItemsProps = { + className?: string +} + +export const MainNavItems = ({ className }: MainNavItemsProps) => { const { navItems, activeItemIndex } = useMainNav() return (
    {navItems.map((item, index) => { diff --git a/www/packages/docs-ui/src/components/MainNav/index.tsx b/www/packages/docs-ui/src/components/MainNav/index.tsx index 1b67a4069b2b1..2ce7c9f823b28 100644 --- a/www/packages/docs-ui/src/components/MainNav/index.tsx +++ b/www/packages/docs-ui/src/components/MainNav/index.tsx @@ -17,33 +17,41 @@ import { MainNavDesktopMenu } from "./DesktopMenu" import { SidebarLeftIcon } from "../Icons/SidebarLeft" import { MainNavMobileMenu } from "./MobileMenu" -export const MainNav = () => { +type MainNavProps = { + className?: string + itemsClassName?: string +} + +export const MainNav = ({ className, itemsClassName }: MainNavProps) => { const { reportIssueLink, editDate } = useMainNav() - const { setMobileSidebarOpen } = useSidebar() + const { setMobileSidebarOpen, isSidebarShown } = useSidebar() return (
    - + {isSidebarShown && ( + + )}
    - +
    diff --git a/www/packages/docs-ui/src/components/Search/ModalOpener/index.tsx b/www/packages/docs-ui/src/components/Search/ModalOpener/index.tsx index 7a73425005273..bfdf2fa8365c8 100644 --- a/www/packages/docs-ui/src/components/Search/ModalOpener/index.tsx +++ b/www/packages/docs-ui/src/components/Search/ModalOpener/index.tsx @@ -41,7 +41,7 @@ export const SearchModalOpener = ({ diff --git a/www/packages/docs-ui/src/components/Search/index.tsx b/www/packages/docs-ui/src/components/Search/index.tsx index b15c3afa41ae2..70d22299f7eff 100644 --- a/www/packages/docs-ui/src/components/Search/index.tsx +++ b/www/packages/docs-ui/src/components/Search/index.tsx @@ -91,7 +91,7 @@ export const Search = ({ setFilters(filterOptions.map((option) => option.value)) } }} - className="px-docs_1 pt-docs_1 bg-medusa-bg-base" + className="px-docs_1 pt-docs_1 bg-medusa-bg-base z-10" /> )} -
    +
    } /> -
    isLinkActive(item, true), [isLinkActive, item]) const ref = useRef(null) - const newTopCalculator = useCallback(() => { + const newTopCalculator = useMemo(() => { if (!sidebarRef.current || !ref.current) { return 0 } @@ -45,7 +45,8 @@ export const SidebarItemLink = ({ return ( itemBoundingRect.top - (sidebarBoundingRect.top + sidebarTopHeight) + - sidebarRef.current.scrollTop + sidebarRef.current.scrollTop - + 10 // remove extra margin just in case ) }, [sidebarTopHeight, sidebarRef, ref]) @@ -64,7 +65,7 @@ export const SidebarItemLink = ({ }) } else { sidebarRef.current.scrollTo({ - top: newTopCalculator(), + top: newTopCalculator, }) } } diff --git a/www/packages/docs-ui/src/components/Sidebar/Top/index.tsx b/www/packages/docs-ui/src/components/Sidebar/Top/index.tsx index 476837803900a..604809e3ff7ae 100644 --- a/www/packages/docs-ui/src/components/Sidebar/Top/index.tsx +++ b/www/packages/docs-ui/src/components/Sidebar/Top/index.tsx @@ -5,6 +5,7 @@ import { SidebarChild } from "../Child" import { InteractiveSidebarItem } from "types" import { SidebarTopMobileClose } from "./MobileClose" import { DottedSeparator } from "../../.." +import clsx from "clsx" export type SidebarTopProps = { parentItem?: InteractiveSidebarItem @@ -13,9 +14,15 @@ export type SidebarTopProps = { export const SidebarTop = React.forwardRef( function SidebarTop({ parentItem }, ref) { return ( -
    +
    -
    +
    {parentItem && ( <> diff --git a/www/packages/docs-ui/src/components/Sidebar/index.tsx b/www/packages/docs-ui/src/components/Sidebar/index.tsx index 4f3ad134dc75e..306e6c0e88713 100644 --- a/www/packages/docs-ui/src/components/Sidebar/index.tsx +++ b/www/packages/docs-ui/src/components/Sidebar/index.tsx @@ -3,12 +3,12 @@ import React, { useMemo, useRef } from "react" import { useSidebar } from "@/providers" import clsx from "clsx" -import { DottedSeparator, Loading } from "@/components" +import { Loading } from "@/components" import { SidebarItem } from "./Item" import { CSSTransition, SwitchTransition } from "react-transition-group" import { SidebarTop, SidebarTopProps } from "./Top" -import useResizeObserver from "@react-hook/resize-observer" import { useClickOutside, useKeyboardShortcut } from "@/hooks" +import useResizeObserver from "@react-hook/resize-observer" export type SidebarProps = { className?: string @@ -30,10 +30,9 @@ export const Sidebar = ({ setMobileSidebarOpen, staticSidebarItems, sidebarRef, - sidebarTopHeight, - setSidebarTopHeight, desktopSidebarOpen, setDesktopSidebarOpen, + setSidebarTopHeight, } = useSidebar() useClickOutside({ elmRef: sidebarWrapperRef, @@ -92,11 +91,6 @@ export const Sidebar = ({ ref={sidebarWrapperRef} >
      - + {/* MOBILE SIDEBAR - keeping this in case we need it in the future */} {/*
      {!sidebarItems.mobile.length && !staticSidebarItems && ( @@ -134,7 +130,7 @@ export const Sidebar = ({ {sidebarItems.mobile.length > 0 && }
      */} {/* DESKTOP SIDEBAR */} -
      +
      {!sidebarItems.default.length && !staticSidebarItems && ( )} diff --git a/www/packages/docs-ui/src/components/VerticalCodeTabs/index.tsx b/www/packages/docs-ui/src/components/VerticalCodeTabs/index.tsx new file mode 100644 index 0000000000000..564207e763469 --- /dev/null +++ b/www/packages/docs-ui/src/components/VerticalCodeTabs/index.tsx @@ -0,0 +1,105 @@ +"use client" + +import React from "react" +import { CodeBlock, CodeBlockProps } from "../CodeBlock" +import clsx from "clsx" + +export type VerticalCodeTab = { + title: string + code: CodeBlockProps +} & Record + +export type VerticalCodeTabsProps = { + tabs: VerticalCodeTab[] + className?: string + selectedTabIndex: number + setSelectedTabIndex: (value: number) => void +} + +export const VerticalCodeTabs = ({ + tabs, + className, + selectedTabIndex, + setSelectedTabIndex, +}: VerticalCodeTabsProps) => { + return ( +
      +
      +
      + {new Array(3).fill(0).map((_, index) => ( + + ))} +
      +
      +
        + {tabs.map((tab, index) => ( +
      • setSelectedTabIndex(index)} + key={index} + > + {tab.title} +
      • + ))} +
      +
      + +
      +
      +
      +
      + ) +} diff --git a/www/packages/docs-ui/src/components/index.ts b/www/packages/docs-ui/src/components/index.ts index 1843422e79ffb..27bc061cd2a45 100644 --- a/www/packages/docs-ui/src/components/index.ts +++ b/www/packages/docs-ui/src/components/index.ts @@ -26,6 +26,7 @@ export * from "./Feedback" export * from "./Feedback/Solutions" export * from "./Heading" export * from "./HooksLoader" +export * from "./IconHeadline" export * from "./Icons" export * from "./InlineIcon" export * from "./InlineThemeImage" @@ -73,5 +74,6 @@ export * from "./ThemeImage" export * from "./Toggle" export * from "./Tooltip" export * from "./TypeList" +export * from "./VerticalCodeTabs" export * from "./WorkflowDiagram" export * from "./ZoomImg" diff --git a/www/packages/docs-ui/src/constants.tsx b/www/packages/docs-ui/src/constants.tsx index bb2e6a93f60a9..eb3155fd1d8e9 100644 --- a/www/packages/docs-ui/src/constants.tsx +++ b/www/packages/docs-ui/src/constants.tsx @@ -7,7 +7,7 @@ export const GITHUB_UI_ISSUES_PREFIX = `https://github.com/medusajs/ui/issues/ne export const navDropdownItems: NavigationItem[] = [ { type: "link", - path: `/v2`, + path: `/v2/learn`, title: "Get Started", project: "book", }, @@ -55,6 +55,11 @@ export const navDropdownItems: NavigationItem[] = [ title: "UI Library", link: "/ui", }, + { + type: "link", + title: "Admin Components", + link: "/v2/resources/admin-components", + }, { type: "link", title: "Storefront Development", diff --git a/www/packages/docs-ui/src/layouts/barebone.tsx b/www/packages/docs-ui/src/layouts/barebone.tsx new file mode 100644 index 0000000000000..d31c24c025479 --- /dev/null +++ b/www/packages/docs-ui/src/layouts/barebone.tsx @@ -0,0 +1,19 @@ +import clsx from "clsx" +import React from "react" + +export type BareboneLayoutProps = { + htmlClassName?: string + children: React.ReactNode +} + +export const BareboneLayout = ({ + htmlClassName, + children, +}: BareboneLayoutProps) => { + return ( + + + {children} + + ) +} diff --git a/www/packages/docs-ui/src/layouts/index.ts b/www/packages/docs-ui/src/layouts/index.ts index f950866a74bd7..de9dfe7256404 100644 --- a/www/packages/docs-ui/src/layouts/index.ts +++ b/www/packages/docs-ui/src/layouts/index.ts @@ -1,3 +1,4 @@ +export * from "./barebone" export * from "./root" export * from "./tight" export * from "./wide" diff --git a/www/packages/docs-ui/src/layouts/root.tsx b/www/packages/docs-ui/src/layouts/root.tsx index 9fbac1e12eaa1..640964a017669 100644 --- a/www/packages/docs-ui/src/layouts/root.tsx +++ b/www/packages/docs-ui/src/layouts/root.tsx @@ -5,47 +5,42 @@ import { Toc } from "../components/Toc" import { MainContentLayout, MainContentLayoutProps } from "./main-content" export type RootLayoutProps = { - ProvidersComponent: React.FC<{ children: React.ReactNode }> + bodyClassName?: string showToc?: boolean sidebarProps?: SidebarProps - htmlClassName?: string - bodyClassName?: string showPagination?: boolean feedbackComponent?: React.ReactNode editComponent?: React.ReactNode showBreadcrumbs?: boolean + ProvidersComponent: React.FC<{ children: React.ReactNode }> } & MainContentLayoutProps export const RootLayout = ({ - ProvidersComponent, - sidebarProps, - htmlClassName, bodyClassName, + sidebarProps, showToc = true, + ProvidersComponent, ...mainProps }: RootLayoutProps) => { return ( - - - - - - -
      - - {showToc && } -
      -
      -
      - - + + + + +
      + + {showToc && } +
      +
      +
      + ) } diff --git a/www/packages/docs-ui/src/providers/Search/index.tsx b/www/packages/docs-ui/src/providers/Search/index.tsx index 2b9430f5704f4..3446463be7d4e 100644 --- a/www/packages/docs-ui/src/providers/Search/index.tsx +++ b/www/packages/docs-ui/src/providers/Search/index.tsx @@ -228,7 +228,7 @@ export const SearchProvider = ({ "!p-0 overflow-hidden relative h-full", "flex flex-col justify-between" )} - modalContainerClassName="sm:h-[480px] sm:max-h-[480px]" + modalContainerClassName="!h-[480px] max-h-[480px]" open={isOpen} onClose={() => setIsOpen(false)} passedRef={modalRef} diff --git a/www/packages/docs-ui/src/providers/Sidebar/index.tsx b/www/packages/docs-ui/src/providers/Sidebar/index.tsx index 835e3b2650bb9..4d35acb38d68f 100644 --- a/www/packages/docs-ui/src/providers/Sidebar/index.tsx +++ b/www/packages/docs-ui/src/providers/Sidebar/index.tsx @@ -61,6 +61,7 @@ export type SidebarContextType = { updatePersistedCategoryState: (title: string, opened: boolean) => void getPersistedCategoryState: (title: string) => boolean | undefined persistState: boolean + isSidebarShown: boolean } & SidebarStyleOptions export const SidebarContext = createContext(null) @@ -280,6 +281,13 @@ export const SidebarProvider = ({ const getResolvedScrollableElement = useCallback(() => { return scrollableElement || window }, [scrollableElement]) + const isSidebarShown = useMemo(() => { + if (!isBrowser) { + return true + } + + return document.getElementsByTagName("aside").length > 0 + }, [isBrowser]) const isItemLoaded = useCallback( (path: string) => { @@ -589,6 +597,7 @@ export const SidebarProvider = ({ updatePersistedCategoryState, getPersistedCategoryState, persistState, + isSidebarShown, }} > {children} diff --git a/www/packages/tailwind/base.tailwind.config.js b/www/packages/tailwind/base.tailwind.config.js index 13e50a8cfe2d1..ed9e64121610b 100644 --- a/www/packages/tailwind/base.tailwind.config.js +++ b/www/packages/tailwind/base.tailwind.config.js @@ -185,6 +185,14 @@ module.exports = { hover: "#505052", }, }, + alpha: { + white: { + alpha: { + 6: "var(--docs-alpha-white-alpha-6)", + 12: "var(--docs-alpha-white-alpha-12)", + }, + }, + }, }, }, boxShadow: { @@ -340,7 +348,7 @@ module.exports = { h3: [ "16px", { - lineHeight: "24px", + lineHeight: "150%", fontWeight: "500", }, ], @@ -678,6 +686,14 @@ module.exports = { visibility: "hidden", }, }, + growWidth: { + from: { + width: 0, + }, + to: { + width: "100%", + }, + }, }, animation: { fadeIn: "fadeIn 500ms", @@ -699,6 +715,7 @@ module.exports = { minimize: "minimize 500ms", maximize: "maximize 500ms", flash: "flash 1500ms 1", + growWidth: "growWidth 500ms", }, scrollMargin: { 56: "56px", diff --git a/www/packages/tailwind/theme-presets.js b/www/packages/tailwind/theme-presets.js index 7ea1366eb0661..05fd0b6b7b654 100644 --- a/www/packages/tailwind/theme-presets.js +++ b/www/packages/tailwind/theme-presets.js @@ -99,7 +99,10 @@ const light = { "--docs-contrast-fg-secondary": "rgba(255, 255, 255, 0.56)", "--docs-contrast-border-base": "rgba(255, 255, 255, 0.16)", "--docs-contrast-border-top": "rgba(9, 9, 11, 1)", - "--docs-contrast-border-bot": "rgba(255, 255, 255, 0.1)", + "--docs-contrast-border-bot": "rgba(255, 255, 255, 0.10)", + + "--docs-alpha-white-alpha-6": "rgba(255, 255, 255, 0.06)", + "--docs-alpha-white-alpha-12": "rgba(255, 255, 255, 0.12)", } const dark = { diff --git a/www/yarn.lock b/www/yarn.lock index 8d62faaf169bd..d44185bac35dc 100644 --- a/www/yarn.lock +++ b/www/yarn.lock @@ -1400,6 +1400,15 @@ __metadata: languageName: node linkType: hard +"@medusajs/icons@npm:rc": + version: 2.0.0-rc-20241003153304 + resolution: "@medusajs/icons@npm:2.0.0-rc-20241003153304" + peerDependencies: + react: ^16.x || ^17.x || ^18.x + checksum: 6859af30f227ac3374e111e679fd90311e571ae72e6aedc690b3c324b42ba9082d69d675533fae9aa221b0aeccec4b51ee9535203f92d014ba82684f56a0ec7b + languageName: node + linkType: hard + "@medusajs/ui-preset@npm:^1.1.2": version: 1.1.2 resolution: "@medusajs/ui-preset@npm:1.1.2" @@ -5898,6 +5907,7 @@ __metadata: dependencies: "@mdx-js/loader": ^3.0.0 "@mdx-js/react": ^3.0.0 + "@medusajs/icons": rc "@next/mdx": ^14.2.14 "@types/mdx": ^2.0.10 "@types/node": ^20 @@ -7131,7 +7141,7 @@ __metadata: version: 0.0.0-use.local resolution: "docs-ui@workspace:packages/docs-ui" dependencies: - "@medusajs/icons": preview + "@medusajs/icons": rc "@medusajs/ui": ^3.0.0 "@octokit/request": ^8.1.1 "@react-hook/resize-observer": ^1.2.6