feat: Documentation and API reference (#348)

Co-authored-by: Vadim Smirnov <smirnou.vadzim@gmail.com>
Co-authored-by: zakariasaad <zakaria.elas@gmail.com>
Co-authored-by: Vilfred Sikker <vilfredsikker@gmail.com>
Co-authored-by: Kasper <kasper@medusa-commerce.com>
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
This commit is contained in:
71 files changed
+16482 -1156

No files matched your search

+1
View File
@@ -0,0 +1 @@
build
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/env node
const execa = require("execa");
const installDeps = async () => {
await execa("yarn", ["install"], {
cwd: "./reference",
stdio: "inherit",
});
await execa("yarn", ["install"], {
cwd: "./docs",
stdio: "inherit",
});
};
const buildGatsby = async () => {
await execa("./node_modules/.bin/gatsby", ["build"], {
cwd: "./reference",
stdio: "inherit",
});
};
const buildDocusaurus = async () => {
await execa("./node_modules/.bin/docusaurus", ["build"], {
cwd: "./docs",
stdio: "inherit",
});
};
const buildSite = async () => {
await installDeps();
await buildGatsby();
await buildDocusaurus();
await execa("rm", ["-rf", "build"]);
await execa("mkdir", ["build"]);
await execa("cp", ["-a", `reference/public/.`, `build/`]);
await execa("cp", ["-a", `docs/build/.`, `build/`]);
};
buildSite();
+9
View File
@@ -0,0 +1,9 @@
{
"plugins": ["prettier"],
"extends": ["prettier"],
"rules": {
"prettier/prettier": "error",
"semi": "error",
"no-unused-expressions": "true"
}
}
+20
View File
@@ -0,0 +1,20 @@
# Dependencies
/node_modules
# Production
/build
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
+7
View File
@@ -0,0 +1,7 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
}
+3
View File
@@ -0,0 +1,3 @@
# Website
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
}
+138
View File
@@ -0,0 +1,138 @@
const lightCodeTheme = require("prism-react-renderer/themes/github")
const darkCodeTheme = require("prism-react-renderer/themes/dracula")
const path = require("path")
const docsPath = path.join(__dirname, "../../docs/content")
const algoliaAppId = process.env.ALGOLIA_APP_ID || "temp"
const algoliaApiKey = process.env.ALGOLIA_API_KEY || "temp"
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: "Medusa Commerce",
tagline: "Explore and learn how to use Medusa",
url: "https://docs.medusa-commerce.com",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
organizationName: "medusajs",
projectName: "medusajs/www",
plugins: [
[
"docusaurus2-dotenv",
{
path: "./.env", // The path to your environment variables.
systemvars: true, // Set to true if you would rather load all system variables as well (useful for CI purposes)
},
],
],
themeConfig: {
disableSwitch: true,
algolia: {
apiKey: algoliaApiKey,
indexName: "medusa-commerce",
placeholder: "Search docs...",
appId: algoliaAppId,
},
navbar: {
hideOnScroll: true,
logo: {
alt: "Medusa Commerce",
src: "img/logo.svg",
srcDark: "img/logo.svg",
},
items: [
{
type: "search",
position: "left",
},
{
type: "doc",
docId: "tutorial/set-up-your-development-environment",
position: "right",
label: "Tutorial",
},
{
href: `https://docs.medusa-commerce.com/api/store`,
target: "_self",
position: "right",
label: "API Reference",
},
{
className: "navbar-github-link",
href: "https://github.com/medusajs/medusa/",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Tutorial",
to: "/tutorial/set-up-your-development-environment",
},
],
},
{
title: "Community",
items: [
{
label: "Stack Overflow",
href: "https://stackoverflow.com/questions/tagged/medusa-commerce",
},
{
label: "Discord",
href: "https://discordapp.com/invite/medusajs",
},
{
label: "Twitter",
href: "https://twitter.com/medusajs",
},
],
},
{
title: "More",
items: [
{
label: "Contact",
href: "https://medusa-commere.com",
},
{
label: "Privacy & Terms",
href: "https://medusa-commere.com",
},
{
label: "GitHub",
href: "https://github.com/medusajs/medusa",
},
],
},
],
copyright: `© ${new Date().getFullYear()} Medusa Commerce`,
},
prism: {
theme: darkCodeTheme,
},
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/medusajs/medusa/edit/master/www/",
path: docsPath,
routeBasePath: "/",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
},
],
],
}
+46
View File
@@ -0,0 +1,46 @@
{
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus clear && docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.3",
"@docusaurus/preset-classic": "2.0.0-beta.3",
"@docusaurus/theme-search-algolia": "^2.0.0-beta.3",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.1.1",
"docusaurus2-dotenv": "^1.4.0",
"file-loader": "^6.2.0",
"lodash": "^4.17.21",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"url-loader": "^4.1.1"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"prettier": "^2.3.2"
}
}
+77
View File
@@ -0,0 +1,77 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
module.exports = {
tutorialSidebar: [
{
type: "doc",
id: "quickstart/quick-start",
label: "Quickstart",
},
// {
// type: 'category',
// label: 'Quickstart',
// items: [
// {
// type: 'doc',
// id: 'quickstart/quick-start-docker',
// label: 'Quickstart w. Docker (Coming soon!)',
// },
// ],
// },
{
type: "category",
label: "Tutorials",
items: [
{
type: "doc",
id: "tutorial/set-up-your-development-environment",
},
{
type: "doc",
id: "tutorial/creating-your-medusa-server",
},
{
type: "doc",
id: "tutorial/adding-custom-functionality",
},
{
type: "doc",
id: "tutorial/linking-your-local-project-with-medusa-cloud",
},
],
},
{
type: "category",
label: "How to",
items: [
{
type: "doc",
id: "how-to/plugins",
},
{
type: "doc",
id: "how-to/notification-api",
},
{
type: "category",
label: "Gatsby + Contentful + Medusa",
items: [
{
type: "doc",
id: "how-to/headless-ecommerce-store-with-gatsby-contentful-medusa",
},
],
},
],
},
],
}
+55
View File
@@ -0,0 +1,55 @@
import React, { useEffect, useState } from "react"
import CloseIcon from "../close-icon"
import styles from "./banner.module.css"
import clsx from "clsx"
import useThemeContext from "@theme/hooks/useThemeContext"
import ConfLogo from "../../../static/img/logo.svg"
const Banner = (props) => {
const [isBannerVisible, setIsBannerVisible] = useState(true)
const { isDarkTheme } = useThemeContext()
const handleDismissBanner = () => {
setIsBannerVisible(false)
if (localStorage) {
localStorage.setItem("mc::banner", false)
}
}
useEffect(() => {
if (localStorage) {
const shouldShow = localStorage.getItem("mc::banner")
if (!shouldShow) {
setIsBannerVisible(true)
}
if (shouldShow === "false") {
setIsBannerVisible(false)
}
}
}, [])
return (
isBannerVisible && (
<div className={clsx(styles.bannerContainer, "margin-top--lg")}>
<div
className={clsx(styles.banner, "padding--sm", "padding-right--md")}
>
<div className="padding" sx={{ marginLeft: "10px" }}>
<ConfLogo />
<p className="padding-left--md">
We are still working on building out our documentation and guides,
but if you are interested in learning more please reach out - we
would love to jump on a call with you and help you get set up!
</p>
</div>
{/* <div style={{ cursor: "pointer" }} onClick={handleDismissBanner}>
<CloseIcon fill={isDarkTheme ? "white" : "black"} />
</div> */}
</div>
</div>
)
)
}
export default Banner
@@ -0,0 +1,18 @@
.bannerContainer {
height: 100%;
padding: 10px 0px;
margin-bottom: 20px;
background-color: var(--ifm-medusa-gray);
border-radius: 5px;
}
.bannerContainer svg {
max-width: 100px;
margin-left: 15px;
}
.banner {
display: flex;
flex-direction: row;
justify-content: space-between;
}
+1
View File
@@ -0,0 +1 @@
export { default as Banner } from "./Banner"
+50
View File
@@ -0,0 +1,50 @@
import React from "react"
import Link from "@docusaurus/Link"
import CodeBlock from "@theme/CodeBlock"
import styles from "./intro.module.css"
const Intro = ({ title, desc }) => {
return (
<div>
<h1 className="margin-bottom--xs margin-top--lg">Documentation</h1>
<p className={styles.title}>{title}</p>
<h2 className="margin-top--lg margin-bottom--sm">Quickstart</h2>
<p className={styles.description}>{desc}</p>
<CodeBlock>
{`yarn global add @medusajs/medusa-cli
medusa new my-awesome-store`}
</CodeBlock>
<div>
<Link
to="quickstart/quick-start"
className="margin-top--md margin-bottom--sm button button--lg button--primary"
>
Quickstart Guide →
</Link>
</div>
<div className={` margin-top--md`}>
<Link
to="tutorial/set-up-your-development-environment"
className={`${styles.docsLink}`}
>
Set up your own local environment →
</Link>
</div>
<div className={`margin-top--md`}>
<Link
to="tutorial/creating-your-medusa-server"
className={`${styles.docsLink}`}
>
Create your very own Medusa server →
</Link>
</div>
<div className={`margin-top--md margin-bottom--xl`}>
<Link to="how-to/plugins" className={`${styles.docsLink}`}>
Explore plugins →
</Link>
</div>
</div>
)
}
export default Intro
+1
View File
@@ -0,0 +1 @@
export { default as Intro } from "./Intro"
@@ -0,0 +1,17 @@
.title {
font-size: 24px;
}
.description {
font-size: 20px;
}
.docsLink {
font-size: 20px;
}
@media screen and (max-width: 966px) {
.docsLink {
font-size: 16px;
}
}
+12
View File
@@ -0,0 +1,12 @@
import React from "react"
import RootLayout from "@theme/Layout"
const Layout = ({ children, ...props }) => {
return (
<RootLayout {...props}>
<div className="container">{children}</div>
</RootLayout>
)
}
export default Layout
+1
View File
@@ -0,0 +1 @@
export { default as Layout } from "./Layout"
@@ -0,0 +1,19 @@
import React from "react"
import styles from "./tab.module.css"
const TabItem = ({ title, isOverviewCard, items }) => {
const overviewModeList = () =>
items.map((item) => <p className="margin-bottom--xs">{item.title}</p>)
return (
<div className="col col--4 padding-right--md padding-bottom--md">
<div className={styles.card}>
<div className={styles.cardContent}>
<h3>{title}</h3>
<div>{isOverviewCard && overviewModeList()}</div>
</div>
</div>
</div>
)
}
export default TabItem
@@ -0,0 +1 @@
export { default as TabItem } from "./TabItem"
@@ -0,0 +1,18 @@
.card {
background-color: var(--ifm-medusa-gray);
min-height: 257px;
border-radius: 5px;
padding: 20px 13px;
height: 100%;
}
.cardContent {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.cardContent p {
font-size: 18px;
}
+77
View File
@@ -0,0 +1,77 @@
import clsx from "clsx"
import React, { useState } from "react"
import { TabItem } from "./TabItem/"
const BUTTONS_DATA = [
{ buttonTitle: "Overview", value: "overview" },
{ buttonTitle: "Tutorial", value: "tutorial" },
{ buttonTitle: "Guides", value: "guide" },
{ buttonTitle: "Reference", value: "reference" },
]
const OVERVIEW_DATA = ["Tutorial", "Guides", "Reference"]
const TabsPanel = ({ items }) => {
const [sort, setSort] = useState("overview")
const buttons = BUTTONS_DATA.map((item) => (
// <button
// className={clsx(
// { [styles.buttonActive]: sort === item.value },
// styles.button
// )}
// onClick={() => setSort(item.value)}
// >
// {item.buttonTitle}
// </button>
<li
className={clsx("tabs__item", {
"tabs__item--active": sort === item.value,
})}
onClick={() => setSort(item.value)}
>
{item.buttonTitle}
</li>
))
const getOverviewCardItemsSet = (currentCard) =>
items.filter((item) => item.key === currentCard.toLowerCase())
const overviewCardsSet = () =>
OVERVIEW_DATA.map((item) => (
<TabItem
isOverviewCard
title={item}
items={getOverviewCardItemsSet(item)}
/>
))
const getSortedArray = () => {
return items.filter((entry) => entry.type === sort)
}
const renderTabItems = () => {
if (sort === "overview") return overviewCardsSet()
return getSortedArray().length > 0 ? (
getSortedArray().map((item) => {
return <TabItem title={item.title} />
})
) : (
<p>hold tight! we are building these things</p>
)
}
return (
<div className="padding-bottom--xl">
{/* <Box sx={{ borderBottom: "1px solid black", marginBottom: "50px" }}>
{buttons}
</Box> */}
<ul class="tabs margin-bottom--lg">{buttons}</ul>
<div className="container padding--none">
<div className="row row--no-gutters">{renderTabItems()}</div>
</div>
</div>
)
}
export default TabsPanel
+1
View File
@@ -0,0 +1 @@
export { default as TabsPanel } from "./TabsPanel"
@@ -0,0 +1,15 @@
.button {
background-color: transparent;
border: none;
cursor: pointer;
height: 30px;
font-size: 16px;
margin-right: 10px;
}
.buttonActive {
color: var(--ifm-color-primary);
border-bottom: 3px solid var(--ifm-color-primary) !important;
font-weight: 500;
transition: ;
}
+18
View File
@@ -0,0 +1,18 @@
import React from "react"
const CloseIcon = ({ fill = "black" }) => (
<svg
width="15"
height="15"
viewBox="0 0 9 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1.05 7.76L0.51 7.22L3.79 3.92L0.51 0.62L1.05 0.0799997L4.33 3.38L7.59 0.0799997L8.13 0.62L4.85 3.92L8.13 7.22L7.59 7.76L4.33 4.48L1.05 7.76Z"
fill={fill}
/>
</svg>
)
export default CloseIcon
+48
View File
@@ -0,0 +1,48 @@
import React from "react"
const ConfLogo = ({ fill }) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 371.2226 96">
<title>medusa-logo-one-colour-rgb</title>
<g id="black-rgb">
<path
id="logoMark"
d="M77.8271,15.6225,56.08,3.0664a22.8877,22.8877,0,0,0-22.8877,0L11.4438,15.6225A22.8877,22.8877,0,0,0,0,35.4438V60.5562A22.8877,22.8877,0,0,0,11.4438,80.3775L33.1919,92.9336a22.8877,22.8877,0,0,0,22.8877,0L77.8271,80.3775A22.8876,22.8876,0,0,0,89.271,60.5562V35.4438A22.8876,22.8876,0,0,0,77.8271,15.6225ZM44.6357,70.3178A22.3178,22.3178,0,1,1,66.9531,48,22.3176,22.3176,0,0,1,44.6357,70.3178Z"
style="fill: #0a3149"
/>
<g id="type">
<path
id="type_CompoundPathItem_"
d="M163.5361,22.6571h14.1416V71.662H169.206V30.078L155.625,71.662h-8.8907l-13.581-41.0948V71.662h-8.4707V22.6571h14.2109l12.3906,39.2734Z"
style="fill: #0a3149"
/>
<path
id="type_CompoundPathItem_2"
d="M220.4453,60.6c-2.03,7.3516-8.2608,12.042-17.0118,12.042-10.9209,0-17.8525-7.3515-17.8525-18.4824s7.001-18.4814,18.0625-18.4814c12.3213,0,18.6914,9.24,15.332,20.7216H194.0517c.7012,5.8106,3.9209,9.2413,9.5215,9.2413,3.92,0,7.001-1.82,8.1914-5.0411Zm-26.253-9.871H211.414c.49-5.04-2.38-8.33-7.9111-8.33C198.2529,42.3993,195.0322,45.34,194.1923,50.7294Z"
style="fill: #0a3149"
/>
<path
id="type_CompoundPathItem_3"
d="M252.5742,22.6571h7.9814V71.662h-7.9814V66.4813a13.8489,13.8489,0,0,1-11.9014,6.1611c-9.24,0-15.752-7.3515-15.752-18.4824,0-11.06,6.4415-18.4814,15.752-18.4814a13.85,13.85,0,0,1,11.9014,6.16Zm.3506,31.5029c0-6.9306-3.9209-11.4814-9.8018-11.4814-5.95,0-9.87,4.5508-9.87,11.4814s3.92,11.4815,9.87,11.4815C249.0039,65.6415,252.9248,61.0907,252.9248,54.16Z"
style="fill: #0a3149"
/>
<path
id="type_CompoundPathItem_4"
d="M290.2333,36.6581h7.9805V71.662h-7.9805V65.3612c-2.4511,4.69-6.4414,7.1406-11.3417,7.1406-9.7305,0-11.2715-9.6611-11.2715-15.8916V36.6581h7.98V56.5409c0,4.62,1.0508,9.03,6.0918,9.03,5.18,0,8.541-4.62,8.541-11.0605Z"
style="fill: #0a3149"
/>
<path
id="type_CompoundPathItem_5"
d="M304.0888,59.1307H311.79c-.49,4.3408,2.7305,7.07,8.1914,7.07,4.2695,0,7.1406-1.68,7.1406-4.2,0-7.0009-22.5429-1.96-22.5429-15.0517,0-7,6.5107-11.27,14.9824-11.27,9.3808,0,16.1709,5.25,14.7011,13.1611h-7.7714c.98-3.99-2.17-6.7207-7-6.7207-4.0606,0-6.7207,1.82-6.7207,4.34,0,7.0713,22.6123,1.6807,22.6123,14.9825,0,7.07-6.3711,11.2011-15.4717,11.2011C310.04,72.6424,303.5292,67.6014,304.0888,59.1307Z"
style="fill: #0a3149"
/>
<path
id="type_CompoundPathItem_6"
d="M371.2226,51.78V71.662H363.872V65.5711a13.7856,13.7856,0,0,1-12.6015,7.0713c-7.42,0-12.0411-4.3408-12.0411-10.4316,0-7.07,6.16-11.3408,16.0313-11.3408a36.6377,36.6377,0,0,1,7.9814.91c0-5.3213-1.8906-9.1709-7.4912-9.1709-4.2,0-6.791,2.1-5.95,6.02H341.749c-1.89-7.77,4.9707-12.9511,14.0722-12.9511C366.0419,35.6786,371.2226,42.0487,371.2226,51.78Zm-7.7,6.0909a25.2,25.2,0,0,0-7.6308-1.19c-5.7413,0-8.5411,2.1006-8.5411,5.32,0,2.8008,2.1,4.27,5.53,4.27A10.8339,10.8339,0,0,0,363.5224,57.871Z"
style="fill: #0a3149"
/>
</g>
</g>
</svg>
)
export default ConfLogo
+190
View File
@@ -0,0 +1,190 @@
/* stylelint-disable docusaurus/copyright-header */
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/
/* You can override the default Infima variables here. */
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap");
:root {
/* Colors */
--ifm-color-primary: #0a3149;
--ifm-color-primary-dark: #0a3149;
--ifm-color-primary-darker: #0a3149;
--ifm-color-primary-darkest: #0a3149;
--ifm-color-primary-light: #0a3149;
--ifm-color-primary-lighter: #0a3149;
--ifm-color-primary-lightest: #0a3149;
--ifm-medusa-gray: #f0f0f0;
/* Fonts */
--ifm-code-font-size: 90%;
--ifm-font-family-base: "Open Sans";
/* Sidebar */
--doc-sidebar-width: 350px !important;
/* Docs Page */
--ifm-docs-page-max-width: 700px;
/* Toc */
--ifm-toc-border-color: #f0f0f0;
--ifm-toc-link-color: #a6acb5;
--ifm-toc-padding-horizontal: 9px;
/* Navbar */
--ifm-navbar-shadow: 0px 1px 0px 0px #a6acb5;
}
html[data-theme="dark"] {
--ifm-color-primary-dark: #ff4848;
--ifm-color-primary: #ff4242;
--ifm-background-color: #1f1f1f;
--ifm-background-surface-color: #1f1f1f;
--ifm-medusa-gray: #292929;
--ifm-menu-color: #fff;
--ifm-toc-border-color: #333;
}
/* DocSearch */
html[data-theme="light"] .DocSearch-Button {
--docsearch-searchbox-background: #fff;
}
html[data-theme="dark"] .DocSearch-Button {
--docsearch-searchbox-background: #1f1f1f;
}
span.DocSearch-Button-Key {
display: none;
}
/* Navbar */
html[data-theme="dark"] .navbar-github-link:before {
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
no-repeat;
}
html[data-theme="dark"] .docusaurus-highlight-code-line {
background-color: rgba(0, 0, 0, 0.3);
}
.navbar-github-link:before {
content: "";
width: 24px;
height: 24px;
display: flex;
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
no-repeat;
}
.navbar__link svg {
display: none;
}
/* DocsPage */
article {
max-width: var(--ifm-docs-page-max-width);
margin-left: auto;
margin-right: auto;
}
.docusaurus-highlight-code-line {
background-color: rgba(0, 0, 0, 0.1);
display: block;
margin: 0 calc(-1 * var(--ifm-pre-padding));
padding: 0 var(--ifm-pre-padding);
}
/* TOC */
.table-of-contents {
font-size: 0.85rem;
}
.table-of-contents::before {
content: "ON THIS PAGE";
display: inline-block;
font-size: 0.85rem;
padding-bottom: 4px;
}
.table-of-contents .table-of-contents__link--active {
border-left: 3px solid var(--ifm-link-color);
color: var(--ifm-color-primary);
font-weight: 500;
margin-left: -14px;
padding-left: 10px;
}
/* Sidebar */
.main-wrapper aside {
z-index: var(--ifm-z-index-fixed);
}
.sidebar-bg {
background: var(--ifm-medusa-gray);
height: 100%;
}
.padding-top--md {
padding-top: 2rem !important;
}
a.menu__link.menu__link--active.active {
border-left: 4px solid var(--ifm-color-primary);
padding-left: 12px;
}
/* Pagination */
.pagination-nav {
margin-left: auto;
margin-right: auto;
max-width: var(--ifm-docs-page-max-width);
}
.navbar {
padding-left: 32px;
padding-right: 32px;
}
/* Footer */
footer .footer__items svg {
display: none;
}
footer .footer__item a:hover {
color: white;
}
@media screen and (min-width: 966px) {
footer .footer__col {
display: flex;
flex-direction: column;
align-items: center;
}
}
footer .footer__items li {
width: 150px;
}
footer .footer__title {
width: 150px;
}
.footer--dark {
--ifm-footer-background-color: #333;
}
.react-toggle {
display: none;
}
+20
View File
@@ -0,0 +1,20 @@
import React from "react"
import { Banner } from "../components/Banner/"
import { Intro } from "../components/Intro/"
import { Layout } from "../components/Layout/"
import styles from "./index.module.css"
export default function Home() {
return (
<Layout title={`Docs`} description="some description...">
<div className={styles.container}>
<Banner />
<Intro
title="Explore and learn how to use Medusa."
desc="Get up and running within 5 minutes."
/>
{/* <TabsPanel items={CARDS_DATA} /> */}
</div>
</Layout>
)
}
+37
View File
@@ -0,0 +1,37 @@
/* stylelint-disable docusaurus/copyright-header */
/**
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
*/
.heroBanner {
padding: 4rem 0;
text-align: center;
position: relative;
overflow: hidden;
}
@media screen and (max-width: 966px) {
.heroBanner {
padding: 2rem;
}
}
.buttons {
display: flex;
align-items: center;
justify-content: center;
}
.container {
display: flex;
flex-direction: column;
}
@media screen and (min-width: 966px) {
.container {
max-width: 850px;
margin: 0 auto;
}
}
+12
View File
@@ -0,0 +1,12 @@
import OriginalDocSidebar from "@theme-original/DocSidebar"
import React from "react"
const DocSidebar = (props) => {
return (
<div className="sidebar-bg">
<OriginalDocSidebar {...props} />
</div>
)
}
export default DocSidebar
@@ -0,0 +1,124 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
:root {
--collapse-button-bg-color-dark: #2e333a;
}
@media (min-width: 997px) {
.sidebar {
display: flex;
flex-direction: column;
max-height: 100vh;
height: 100%;
position: sticky;
top: 0;
padding-top: var(--ifm-navbar-height);
width: var(--doc-sidebar-width);
transition: opacity 50ms ease;
}
.sidebarWithHideableNavbar {
padding-top: 0;
}
.sidebarHidden {
opacity: 0;
height: 0;
overflow: hidden;
visibility: hidden;
}
.sidebarLogo {
display: flex !important;
align-items: center;
margin: 0 var(--ifm-navbar-padding-horizontal);
min-height: var(--ifm-navbar-height);
max-height: var(--ifm-navbar-height);
color: inherit !important;
text-decoration: none !important;
}
.sidebarLogo img {
margin-right: 0.5rem;
height: 2rem;
}
.menu {
flex-grow: 1;
padding: 0.5rem;
}
.menuLinkText {
cursor: initial;
}
.menuLinkText:hover {
background: none;
}
.menuWithAnnouncementBar {
margin-bottom: var(--docusaurus-announcement-bar-height);
}
.collapseSidebarButton {
display: block !important;
background-color: var(--ifm-button-background-color);
height: 40px;
position: sticky;
bottom: 0;
border-radius: 0;
border: 1px solid var(--ifm-toc-border-color);
}
.collapseSidebarButtonIcon {
transform: rotate(180deg);
margin-top: 4px;
}
html[dir="rtl"] .collapseSidebarButtonIcon {
transform: rotate(0);
}
html[data-theme="dark"] .collapseSidebarButton {
background-color: var(--collapse-button-bg-color-dark);
}
html[data-theme="dark"] .collapseSidebarButton:hover,
html[data-theme="dark"] .collapseSidebarButton:focus {
background-color: var(--ifm-color-emphasis-200);
}
}
.sidebarLogo,
.collapseSidebarButton {
display: none;
}
.sidebarMenuIcon {
vertical-align: middle;
}
.sidebarMenuCloseIcon {
display: inline-flex;
justify-content: center;
align-items: center;
height: 24px;
font-size: 1.5rem;
font-weight: var(--ifm-font-weight-bold);
line-height: 0.9;
width: 24px;
}
:global(.menu__list) :global(.menu__list) {
overflow-y: hidden;
will-change: height;
transition: height var(--ifm-transition-fast) linear;
}
:global(.menu__list-item--collapsed) :global(.menu__list) {
height: 0 !important;
}
+204
View File
@@ -0,0 +1,204 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React, { useState, useRef, useCallback, useMemo } from "react"
import { createPortal } from "react-dom"
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"
import { useHistory } from "@docusaurus/router"
import { useBaseUrlUtils } from "@docusaurus/useBaseUrl"
import Link from "@docusaurus/Link"
import Head from "@docusaurus/Head"
import useSearchQuery from "@theme/hooks/useSearchQuery"
import { DocSearchButton, useDocSearchKeyboardEvents } from "@docsearch/react"
import useAlgoliaContextualFacetFilters from "@theme/hooks/useAlgoliaContextualFacetFilters"
import { translate } from "@docusaurus/Translate"
import styles from "./styles.module.css"
let DocSearchModal = null
function Hit({ hit, children }) {
return <Link to={hit.url}>{children}</Link>
}
function ResultsFooter({ state, onClose }) {
const { generateSearchPageLink } = useSearchQuery()
return (
<Link to={generateSearchPageLink(state.query)} onClick={onClose}>
See all {state.context.nbHits} results
</Link>
)
}
function DocSearch({ contextualSearch, ...props }) {
const { siteMetadata } = useDocusaurusContext()
const contextualSearchFacetFilters = useAlgoliaContextualFacetFilters()
const configFacetFilters = props.searchParameters?.facetFilters ?? []
const facetFilters = contextualSearch
? // Merge contextual search filters with config filters
[...contextualSearchFacetFilters, ...configFacetFilters]
: // ... or use config facetFilters
configFacetFilters
// we let user override default searchParameters if he wants to
const searchParameters = {
...props.searchParameters,
facetFilters,
}
const { withBaseUrl } = useBaseUrlUtils()
const history = useHistory()
const searchContainer = useRef(null)
const searchButtonRef = useRef(null)
const [isOpen, setIsOpen] = useState(false)
const [initialQuery, setInitialQuery] = useState(null)
const importDocSearchModalIfNeeded = useCallback(() => {
if (DocSearchModal) {
return Promise.resolve()
}
return Promise.all([
import("@docsearch/react/modal"),
import("@docsearch/react/style"),
import("./styles.css"),
]).then(([{ DocSearchModal: Modal }]) => {
DocSearchModal = Modal
})
}, [])
const onOpen = useCallback(() => {
importDocSearchModalIfNeeded().then(() => {
searchContainer.current = document.createElement("div")
document.body.insertBefore(
searchContainer.current,
document.body.firstChild
)
setIsOpen(true)
})
}, [importDocSearchModalIfNeeded, setIsOpen])
const onClose = useCallback(() => {
setIsOpen(false)
searchContainer.current.remove()
}, [setIsOpen])
const onInput = useCallback(
(event) => {
importDocSearchModalIfNeeded().then(() => {
setIsOpen(true)
setInitialQuery(event.key)
})
},
[importDocSearchModalIfNeeded, setIsOpen, setInitialQuery]
)
const navigator = useRef({
navigate({ itemUrl }) {
history.push(itemUrl)
},
}).current
const transformItems = useRef((items) => {
return items.map((item) => {
// We transform the absolute URL into a relative URL.
// Alternatively, we can use `new URL(item.url)` but it's not
// supported in IE.
const a = document.createElement("a")
a.href = item.url
return {
...item,
url: withBaseUrl(`${a.pathname}${a.hash}`),
}
})
}).current
const resultsFooterComponent = useMemo(
() => (footerProps) => <ResultsFooter {...footerProps} onClose={onClose} />,
[onClose]
)
const transformSearchClient = useCallback(
(searchClient) => {
searchClient.addAlgoliaAgent("docusaurus", siteMetadata.docusaurusVersion)
return searchClient
},
[siteMetadata.docusaurusVersion]
)
useDocSearchKeyboardEvents({
isOpen,
onOpen,
onClose,
onInput,
searchButtonRef,
})
const translatedSearchLabel = translate({
id: "theme.SearchBar.label",
message: "Search",
description: "The ARIA label and placeholder for search button",
})
return (
<>
<Head>
{/* This hints the browser that the website will load data from Algolia,
and allows it to preconnect to the DocSearch cluster. It makes the first
query faster, especially on mobile. */}
<link
rel="preconnect"
href={`https://${props.appId}-dsn.algolia.net`}
crossOrigin="anonymous"
/>
</Head>
<div className={styles.searchBox}>
<DocSearchButton
onTouchStart={importDocSearchModalIfNeeded}
onFocus={importDocSearchModalIfNeeded}
onMouseOver={importDocSearchModalIfNeeded}
onClick={onOpen}
ref={searchButtonRef}
translations={{
buttonText: translatedSearchLabel,
buttonAriaLabel: translatedSearchLabel,
}}
/>
</div>
{isOpen &&
createPortal(
<DocSearchModal
onClose={onClose}
initialScrollY={window.scrollY}
initialQuery={initialQuery}
navigator={navigator}
transformItems={transformItems}
hitComponent={Hit}
resultsFooterComponent={resultsFooterComponent}
transformSearchClient={transformSearchClient}
{...props}
searchParameters={searchParameters}
/>,
searchContainer.current
)}
</>
)
}
function SearchBar() {
const { siteConfig } = useDocusaurusContext()
return <DocSearch {...siteConfig.themeConfig.algolia} />
}
export default SearchBar
+22
View File
@@ -0,0 +1,22 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
:root {
--docsearch-primary-color: var(--ifm-color-primary);
--docsearch-text-color: var(--ifm-font-color-base);
}
.DocSearch-Button {
margin: 0;
transition: all var(--ifm-transition-fast)
var(--ifm-transition-timing-default);
width: 100%;
}
.DocSearch-Container {
z-index: calc(var(--ifm-z-index-fixed) + 1);
}
@@ -0,0 +1,28 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
@media (max-width: 996px) {
.searchBox {
position: absolute;
right: var(--ifm-navbar-padding-horizontal);
}
}
@media (min-width: 997px) {
.searchBox {
padding: var(--ifm-navbar-item-padding-vertical)
var(--ifm-navbar-item-padding-horizontal);
flex: 1;
margin-left: 200px;
padding-right: 100px;
}
.searchBox button {
border: 1px solid var(--ifm-medusa-gray);
width: 250px;
}
}
View File
Whitespace-only changes.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 371.2226 96">
<title>medusa-logo-one-colour-rgb</title>
<g id="black-rgb">
<path id="logoMark" d="M77.8271,15.6225,56.08,3.0664a22.8877,22.8877,0,0,0-22.8877,0L11.4438,15.6225A22.8877,22.8877,0,0,0,0,35.4438V60.5562A22.8877,22.8877,0,0,0,11.4438,80.3775L33.1919,92.9336a22.8877,22.8877,0,0,0,22.8877,0L77.8271,80.3775A22.8876,22.8876,0,0,0,89.271,60.5562V35.4438A22.8876,22.8876,0,0,0,77.8271,15.6225ZM44.6357,70.3178A22.3178,22.3178,0,1,1,66.9531,48,22.3176,22.3176,0,0,1,44.6357,70.3178Z" style="fill: #0a3149"/>
<g id="type">
<path id="type_CompoundPathItem_" data-name="type &lt;CompoundPathItem&gt;" d="M163.5361,22.6571h14.1416V71.662H169.206V30.078L155.625,71.662h-8.8907l-13.581-41.0948V71.662h-8.4707V22.6571h14.2109l12.3906,39.2734Z" style="fill: #0a3149"/>
<path id="type_CompoundPathItem_2" data-name="type &lt;CompoundPathItem&gt;" d="M220.4453,60.6c-2.03,7.3516-8.2608,12.042-17.0118,12.042-10.9209,0-17.8525-7.3515-17.8525-18.4824s7.001-18.4814,18.0625-18.4814c12.3213,0,18.6914,9.24,15.332,20.7216H194.0517c.7012,5.8106,3.9209,9.2413,9.5215,9.2413,3.92,0,7.001-1.82,8.1914-5.0411Zm-26.253-9.871H211.414c.49-5.04-2.38-8.33-7.9111-8.33C198.2529,42.3993,195.0322,45.34,194.1923,50.7294Z" style="fill: #0a3149"/>
<path id="type_CompoundPathItem_3" data-name="type &lt;CompoundPathItem&gt;" d="M252.5742,22.6571h7.9814V71.662h-7.9814V66.4813a13.8489,13.8489,0,0,1-11.9014,6.1611c-9.24,0-15.752-7.3515-15.752-18.4824,0-11.06,6.4415-18.4814,15.752-18.4814a13.85,13.85,0,0,1,11.9014,6.16Zm.3506,31.5029c0-6.9306-3.9209-11.4814-9.8018-11.4814-5.95,0-9.87,4.5508-9.87,11.4814s3.92,11.4815,9.87,11.4815C249.0039,65.6415,252.9248,61.0907,252.9248,54.16Z" style="fill: #0a3149"/>
<path id="type_CompoundPathItem_4" data-name="type &lt;CompoundPathItem&gt;" d="M290.2333,36.6581h7.9805V71.662h-7.9805V65.3612c-2.4511,4.69-6.4414,7.1406-11.3417,7.1406-9.7305,0-11.2715-9.6611-11.2715-15.8916V36.6581h7.98V56.5409c0,4.62,1.0508,9.03,6.0918,9.03,5.18,0,8.541-4.62,8.541-11.0605Z" style="fill: #0a3149"/>
<path id="type_CompoundPathItem_5" data-name="type &lt;CompoundPathItem&gt;" d="M304.0888,59.1307H311.79c-.49,4.3408,2.7305,7.07,8.1914,7.07,4.2695,0,7.1406-1.68,7.1406-4.2,0-7.0009-22.5429-1.96-22.5429-15.0517,0-7,6.5107-11.27,14.9824-11.27,9.3808,0,16.1709,5.25,14.7011,13.1611h-7.7714c.98-3.99-2.17-6.7207-7-6.7207-4.0606,0-6.7207,1.82-6.7207,4.34,0,7.0713,22.6123,1.6807,22.6123,14.9825,0,7.07-6.3711,11.2011-15.4717,11.2011C310.04,72.6424,303.5292,67.6014,304.0888,59.1307Z" style="fill: #0a3149"/>
<path id="type_CompoundPathItem_6" data-name="type &lt;CompoundPathItem&gt;" d="M371.2226,51.78V71.662H363.872V65.5711a13.7856,13.7856,0,0,1-12.6015,7.0713c-7.42,0-12.0411-4.3408-12.0411-10.4316,0-7.07,6.16-11.3408,16.0313-11.3408a36.6377,36.6377,0,0,1,7.9814.91c0-5.3213-1.8906-9.1709-7.4912-9.1709-4.2,0-6.791,2.1-5.95,6.02H341.749c-1.89-7.77,4.9707-12.9511,14.0722-12.9511C366.0419,35.6786,371.2226,42.0487,371.2226,51.78Zm-7.7,6.0909a25.2,25.2,0,0,0-7.6308-1.19c-5.7413,0-8.5411,2.1006-8.5411,5.32,0,2.8008,2.1,4.27,5.53,4.27A10.8339,10.8339,0,0,0,363.5224,57.871Z" style="fill: #0a3149"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

+8798
View File
File diff suppressed because it is too large. Load diff
+11
View File
@@ -0,0 +1,11 @@
{
"name": "www",
"version": "0.0.0",
"description": "Medusa documentation site",
"main": "index.js",
"license": "MIT",
"dependencies": {
"execa": "^5.1.1",
"gatsby-cli": "^3.11.0"
}
}
+1
View File
@@ -0,0 +1 @@
{"tags":{"Auth":[{"method":"POST","path":"/auth","operationId":"PostAuth","summary":"Authenticate a User","description":"Logs a User in and authorizes them to manage Store settings.","parameters":[],"tags":["Auth"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"user":{"$ref":"#/components/schemas/user"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","description":"The User's email."},"password":{"type":"string","description":"The User's password."}}}}}}},{"method":"GET","path":"/auth","operationId":"GetAuth","summary":"Get Session","description":"Gets the currently logged in User.","tags":["Auth"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"user":{"$ref":"#/components/schemas/user"}}}}}}}}],"Collection":[{"method":"POST","path":"/collections","operationId":"PostCollections","summary":"Create a Product Collection","description":"Creates a Product Collection.","requestBody":{"content":{"application/json":{"schema":{"required":["title"],"properties":{"title":{"type":"string","description":"The title to identify the Collection by."},"handle":{"type":"string","description":"An optional handle to be used in slugs, if none is provided we will kebab-case the title."},"metadata":{"description":"An optional set of key-value pairs to hold additional information.","type":"object"}}}}}},"tags":["Collection"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"collection":{"$ref":"#/components/schemas/product_collection"}}}}}}}},{"method":"GET","path":"/collections","operationId":"GetCollections","summary":"List Product Collections","description":"Retrieve a list of Product Collection.","tags":["Collection"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"collection":{"$ref":"#/components/schemas/product_collection"}}}}}}}},{"method":"DELETE","path":"/collections/{id}","operationId":"DeleteCollectionsCollection","summary":"Delete a Product Collection","description":"Deletes a Product Collection.","parameters":[{"in":"path","name":"id","required":true,"description":"The id of the Collection.","schema":{"type":"string"}}],"tags":["Collection"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"id":{"type":"string","description":"The id of the deleted Collection"},"object":{"type":"string","description":"The type of the object that was deleted."},"deleted":{"type":"boolean"}}}}}}}},{"method":"GET","path":"/collections/{id}","operationId":"GetCollectionsCollection","summary":"Retrieve a Product Collection","description":"Retrieves a Product Collection.","parameters":[{"in":"path","name":"id","required":true,"description":"The id of the Product Collection","schema":{"type":"string"}}],"tags":["Collection"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"collection":{"$ref":"#/components/schemas/product_collection"}}}}}}}},{"method":"POST","path":"/collections/{id}","operationId":"PostCollectionsCollection","summary":"Update a Product Collection","description":"Updates a Product Collection.","parameters":[{"in":"path","name":"id","required":true,"description":"The id of the Collection.","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"title":{"type":"string","description":"The title to identify the Collection by."},"handle":{"type":"string","description":"An optional handle to be used in slugs, if none is provided we will kebab-case the title."},"metadata":{"description":"An optional set of key-value pairs to hold additional information.","type":"object"}}}}}},"tags":["Collection"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"collection":{"$ref":"#/components/schemas/product_collection"}}}}}}}}],"Customer":[{"method":"POST","path":"/customers","operationId":"PostCustomers","summary":"Create a Customer","description":"Creates a Customer.","parameters":[],"tags":["Customer"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"customer":{"$ref":"#/components/schemas/customer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","first_name","last_name"],"properties":{"email":{"type":"string","description":"The Customer's email address."},"first_name":{"type":"string","description":"The Customer's first name."},"last_name":{"type":"string","description":"The Customer's last name."},"phone":{"type":"string","description":"The Customer's phone number."}}}}}}},{"method":"GET","path":"/customers","operationId":"GetCustomers","summary":"List Customers","description":"Retrieves a list of Customers.","tags":["Customer"],"responses":{"200":{"description":"OK","content":{"appliLine truncated
+1
View File
@@ -0,0 +1 @@
{"tags":{"Auth":[{"method":"POST","path":"/auth","operationId":"PostAuth","summary":"Authenticate Customer","description":"Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser.","parameters":[],"tags":["Auth"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"customer":{"$ref":"#/components/schemas/customer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","description":"The Customer's email."},"password":{"type":"string","description":"The Customer's password."}}}}}}},{"method":"DELETE","path":"/auth","operationId":"DeleteAuth","summary":"Log out","description":"Destroys a Customer's authenticated session.","tags":["Auth"],"responses":{"200":{"description":"OK"}}},{"method":"GET","path":"/auth","operationId":"GetAuth","summary":"Get Session","description":"Gets the currently logged in Customer.","tags":["Auth"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"customer":{"$ref":"#/components/schemas/customer"}}}}}}}},{"method":"GET","path":"/auth/{email}","operationId":"GetAuthEmail","summary":"Check if email has account","description":"Checks if a Customer with the given email has signed up.","parameters":[{"in":"path","name":"email","required":true,"description":"The Customer's email.","schema":{"type":"string"}}],"tags":["Auth"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"exists":{"type":"boolean"}}}}}}}}],"Cart":[{"method":"POST","path":"/carts/{id}/shipping-methods","operationId":"PostCartsCartShippingMethod","description":"Adds a Shipping Method to the Cart.","summary":"Add a Shipping Method","tags":["Cart"],"parameters":[{"in":"path","name":"id","required":true,"description":"The cart id.","schema":{"type":"string"}}],"responses":{"200":{"description":"A successful response","content":{"application/json":{"schema":{"properties":{"cart":{"$ref":"#/components/schemas/cart"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["option_id"],"properties":{"option_id":{"type":"string","description":"id of the shipping option to create the method from"},"data":{"type":"object","description":"Used to hold any data that the shipping method may need to process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send."}}}}}}},{"method":"POST","path":"/carts/{id}/complete-cart","summary":"Complete a Cart","operationId":"PostCartsCartComplete","description":"Completes a cart. The following steps will be performed. Payment authorization is attempted and if more work is required, we simply return the cart for further updates. If payment is authorized and order is not yet created, we make sure to do so. The completion of a cart can be performed idempotently with a provided header `Idempotency-Key`. If not provided, we will generate one for the request.","parameters":[{"in":"path","name":"id","required":true,"description":"The Cart id.","schema":{"type":"string"}}],"tags":["Cart"],"responses":{"200":{"description":"If a cart was successfully authorized, but requires further action from the user the response body will contain the cart with an updated payment session. If the Cart was successfully completed the response body will contain the newly created Order.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"order":{"$ref":"#/components/schemas/order"}}},{"type":"object","properties":{"cart":{"$ref":"#/components/schemas/cart"}}}]}}}}}},{"method":"POST","path":"/carts","summary":"Create a Cart","operationId":"PostCart","description":"Creates a Cart within the given region and with the initial items. If no `region_id` is provided the cart will be associated with the first Region available. If no items are provided the cart will be empty after creation. If a user is logged in the cart's customer id and email will be set.","requestBody":{"content":{"application/json":{"schema":{"properties":{"region_id":{"type":"string","description":"The id of the Region to create the Cart in."},"country_code":{"type":"string","description":"The 2 character ISO country code to create the Cart in."},"items":{"description":"An optional array of `variant_id`, `quantity` pairs to generate Line Items from.","type":"array","items":{"properties":{"variant_id":{"description":"The id of the Product Variant to generate a Line Item from.","type":"string"},"quantity":{"description":"The quantity of the Product Variant to add","type":"integer"}}}},"context":{"description":"An optional object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent`","type":"object"}}}}}},"tags":["Cart"],"responses":{"200":{"description":"Successfully created a Line truncated
+3 -2
View File
@@ -61,8 +61,9 @@ module.exports = {
{
resolve: `gatsby-plugin-algolia-docsearch`,
options: {
apiKey: process.env.ALGOLIA_DOCSEARCH_API_KEY, // required
indexName: process.env.ALGOLIA_DOCSEARCH_INDEX_NAME, // required
appId: process.env.ALGOLIA_APP_ID || "temp",
apiKey: process.env.ALGOLIA_API_KEY || "temp", // required
indexName: "medusa-commerce", // required
inputSelector: "#algolia-doc-search", // required
debug: false, // (bool) Optional. Default `false`
},
+71 -58
View File
@@ -17,76 +17,87 @@ const createCustomNode = ({ name, node, createNode }) => {
return {
name: path,
methods: Object.entries(values).map(([method, values]) => {
const requestBodyValues =
values?.requestBody?.content?.["application/json"]?.schema
let requestBodyValues = undefined
if (values.requestBody && values.requestBody.content) {
requestBodyValues =
values.requestBody.content["application/json"].schema
}
return {
method: method,
...values,
requestBody: {
required: requestBodyValues?.required,
type: requestBodyValues?.type,
properties: Object.entries(requestBodyValues?.properties || {}).map(
([property, values]) => {
let ref = null
let component_id = null
let nestedModelNode = null
const { items, anyOf, oneOf, ...rest } = values
if (items || anyOf || oneOf) {
if (items?.anyOf) {
component_id = items.anyOf[0]["$ref"].substring(
items.anyOf[0]["$ref"].lastIndexOf("/") + 1
)
ref = node.components.schemas[component_id]
} else if (items) {
const refPath = items["$ref"]
if (refPath) {
component_id = refPath.substring(
items["$ref"].lastIndexOf("/") + 1
)
ref = node.components.schemas[component_id]
}
} else if (anyOf) {
component_id = anyOf[0]["$ref"].substring(
anyOf[0]["$ref"].lastIndexOf("/") + 1
)
ref = node.components.schemas[component_id]
} else if (oneOf) {
component_id = oneOf[0]["$ref"].substring(
oneOf[0]["$ref"].lastIndexOf("/") + 1
required: requestBodyValues
? requestBodyValues.required
: undefined,
type: requestBodyValues ? requestBodyValues.type : undefined,
properties: Object.entries(
requestBodyValues ? requestBodyValues.properties : {}
).map(([property, values]) => {
let ref = null
let component_id = null
let nestedModelNode = null
const { items, anyOf, oneOf, ...rest } = values
if (items || anyOf || oneOf) {
if (items && items.anyOf) {
component_id = items.anyOf[0]["$ref"].substring(
items.anyOf[0]["$ref"].lastIndexOf("/") + 1
)
ref = node.components.schemas[component_id]
} else if (items) {
const refPath = items["$ref"]
if (refPath) {
component_id = refPath.substring(
items["$ref"].lastIndexOf("/") + 1
)
ref = node.components.schemas[component_id]
}
}
if (ref) {
const { properties, ...rest } = ref
let nestedModelProperties = []
if (properties) {
Object.entries(properties).map(([key, values]) => {
nestedModelProperties.push({
property: key,
...values,
})
})
nestedModelNode = {
properties: nestedModelProperties,
...rest,
}
}
}
return {
property: property,
nestedModel: nestedModelNode,
...rest,
} else if (anyOf) {
component_id = anyOf[0]["$ref"].substring(
anyOf[0]["$ref"].lastIndexOf("/") + 1
)
ref = node.components.schemas[component_id]
} else if (oneOf) {
component_id = oneOf[0]["$ref"].substring(
oneOf[0]["$ref"].lastIndexOf("/") + 1
)
ref = node.components.schemas[component_id]
}
}
),
if (ref) {
const { properties, ...rest } = ref
let nestedModelProperties = []
if (properties) {
Object.entries(properties).map(([key, values]) => {
nestedModelProperties.push({
property: key,
...values,
})
})
nestedModelNode = {
properties: nestedModelProperties,
...rest,
}
}
}
return {
property: property,
nestedModel: nestedModelNode,
...rest,
}
}),
},
responses: Object.entries(values.responses).map(
([response, values]) => {
const properties =
values.content?.["application/json"]?.schema?.properties
let properties = undefined
if (values && values.content) {
properties =
values.content["application/json"].schema.properties
}
return {
status: response,
content: properties
@@ -177,7 +188,7 @@ const createCustomNode = ({ name, node, createNode }) => {
let { items, anyOf, oneOf, ...rest } = values
if (items || anyOf || oneOf) {
if (items?.anyOf) {
if (items && items.anyOf) {
component_id = items.anyOf[0]["$ref"].substring(
items.anyOf[0]["$ref"].lastIndexOf("/") + 1
)
@@ -261,6 +272,8 @@ const createCustomNode = ({ name, node, createNode }) => {
existingSection.section.paths.push({ ...current })
}
//acc[section].section[current.name] = { ...current }
return acc
}, [])
@@ -317,7 +330,7 @@ const createAllPages = (sections, api, siteData, createPage, template) => {
data: siteData.data[api],
api: api,
title: edge.section.section_name,
description: edge.section.schema?.description || "",
description: edge.section.schema ? edge.section.schema.description : "",
to: { section: baseURL, method: null },
},
})
+2 -1
View File
@@ -6,7 +6,7 @@
"license": "0BSD",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"develop": "gatsby clean && gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
@@ -14,6 +14,7 @@
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
},
"dependencies": {
"@docsearch/react": "^3.0.0-alpha.40",
"@emotion/react": "^11.1.2",
"@emotion/styled": "^11.0.0",
"@rebass/forms": "^4.0.6",
@@ -1,6 +1,6 @@
import React, { useRef, useEffect } from "react"
import { Box } from "theme-ui"
import "../../prism-medusa-theme/prism.css"
import "../../medusa-plugin-themes/prism/theme.css"
import Prism from "prismjs"
import "prismjs/components/prism-json"
import CodeBox from "./code-box"
+31 -29
View File
@@ -14,7 +14,7 @@ import useInView from "../../hooks/use-in-view"
const Section = ({ data }) => {
const { section } = data
const [isExpanded, setIsExpanded] = useState(false)
const [isExpanded, setIsExpanded] = useState(true)
const { openSections, updateSection, updateMetadata } = useContext(
NavigationContext
)
@@ -52,10 +52,8 @@ const Section = ({ data }) => {
}
useEffect(() => {
if (isExpanded) {
scrollIntoView()
}
}, [isExpanded])
setIsExpanded(false)
}, [])
useEffect(() => {
const shouldOpen = openSections.includes(
@@ -84,7 +82,11 @@ const Section = ({ data }) => {
}, [isInView])
return (
<section ref={sectionRef} id={convertToKebabCase(section.section_name)}>
<section
ref={sectionRef}
id={convertToKebabCase(section.section_name)}
className="DocSearch-content"
>
<Box
sx={{
borderBottom: "hairline",
@@ -149,7 +151,29 @@ const Section = ({ data }) => {
) : null}
</Flex>
</ResponsiveContainer>
{isExpanded ? (
{!isExpanded ? (
<Flex
sx={{
justifyContent: "center",
alignItems: "center",
width: "100%",
}}
mt={4}
>
<Button
onClick={handleExpand}
sx={{
display: "flex",
alignItems: "center",
borderRadius: "24px",
bg: "light",
fontWeight: "500",
}}
>
SHOW <ChevronDown fill={"dark"} styles={{ mr: "-10px" }} />
</Button>
</Flex>
) : (
<Box mt={4}>
{section.paths.map((p, i) => {
return (
@@ -173,28 +197,6 @@ const Section = ({ data }) => {
)
})}
</Box>
) : (
<Flex
sx={{
justifyContent: "center",
alignItems: "center",
width: "100%",
}}
mt={4}
>
<Button
onClick={handleExpand}
sx={{
display: "flex",
alignItems: "center",
borderRadius: "24px",
bg: "light",
fontWeight: "500",
}}
>
SHOW <ChevronDown fill={"dark"} styles={{ mr: "-10px" }} />
</Button>
</Flex>
)}
</Flex>
</Box>
+1 -1
View File
@@ -1,6 +1,6 @@
import React from "react"
import { Flex, Box } from "theme-ui"
import Sidebar from "./sidebar"
import Sidebar from "./side-bar"
const Layout = ({ data, api, children }) => {
return (
@@ -0,0 +1,13 @@
import React from "react"
import { DocSearch } from "@docsearch/react"
import "../../medusa-plugin-themes/docsearch/theme.css"
const algoliaApiKey =
process.env.ALGOLIA_API_KEY || "25626fae796133dc1e734c6bcaaeac3c" //second opt is for testing purposes
const algoliaIndexName = process.env.ALGOLIA_API_KEY || "docsearch"
const Search = () => {
return <DocSearch apiKey={algoliaApiKey} indexName={algoliaIndexName} />
}
export default Search
@@ -5,6 +5,7 @@ import Logo from "../../assets/logo.svg"
import LogoMuted from "../../assets/logo-muted.svg"
import SideBarItem from "./sidebar-item"
import SideBarSelector from "./sidebar-selector"
import { navigate } from "gatsby"
const SideBarContainer = styled(Flex)`
--side-bar-width: 220px;
@@ -40,7 +41,6 @@ const Sidebar = ({ data, api }) => {
setScrollPos(pos)
}
}
nav.addEventListener("scroll", handleScroll)
return () => nav.removeEventListener("scroll", handleScroll)
}, [])
@@ -71,8 +71,10 @@ const Sidebar = ({ data, api }) => {
<Image
src={Logo}
alt="Medusa logo"
onClick={() => navigate("/")}
sx={{
height: "28px",
height: "32px",
cursor: "pointer",
}}
/>
</Flex>
+4
View File
@@ -6,6 +6,7 @@ import GitHub from "../components/icons/github"
import NavigationContext from "../context/navigation-context"
import { convertToKebabCase } from "../utils/convert-to-kebab-case"
import ChevronDown from "./icons/chevron-down"
import Search from "./search"
const Topbar = ({ data, api }) => {
const { goTo, reset, currentSection } = useContext(NavigationContext)
@@ -60,6 +61,7 @@ const Topbar = ({ data, api }) => {
fontWeight: "500",
flexGrow: "1",
px: "0",
backgroundColor: "light",
transition: "all .1s ease-in-out",
"&:focus": {
outline: "none !important",
@@ -107,6 +109,8 @@ const Topbar = ({ data, api }) => {
>
<GitHub />
</Link>
{/* Re-add once indexing has been fine tuned */}
{/* <Search /> */}
</Flex>
</Flex>
)
@@ -0,0 +1,744 @@
:root {
--docsearch-primary-color: #0a3149;
/*dark*/
--docsearch-secondary-color: #eef0f5;
/*faded*/
--docsearch-text-color: rgb(28, 30, 33);
--docsearch-spacing: 12px;
--docsearch-icon-stroke-width: 1.4;
--docsearch-highlight-color: var(--docsearch-primary-color);
--docsearch-muted-color: rgb(150, 159, 175);
--docsearch-container-background: #eef0f575;
--docsearch-logo-color: rgba(84, 104, 255);
--docsearch-key-border: 1px solid rgba(0, 0, 0, .05);
/* modal */
--docsearch-modal-width: 560px;
--docsearch-modal-height: 600px;
--docsearch-modal-background: white;
--docsearch-modal-shadow: 0 15px 35px 0 rgb(59 65 94 / 10%);
/* searchbox */
--docsearch-searchbox-height: 56px;
--docsearch-searchbox-background: rgb(235, 237, 240);
--docsearch-searchbox-focus-background: #fff;
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
/* hit */
--docsearch-hit-height: 56px;
--docsearch-hit-color: rgb(68, 73, 80);
--docsearch-hit-active-color: #fff;
--docsearch-hit-background: #fff;
--docsearch-hit-shadow: 0 1px 3px 0 rgb(212, 217, 225);
/* key */
--docsearch-key-gradient: linear-gradient( -225deg, rgb(213, 219, 228) 0%, rgb(248, 248, 248) 100%);
--docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230), inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);
/* footer */
--docsearch-footer-height: 44px;
--docsearch-footer-background: #fff;
--docsearch-footer-shadow: 0 -1px 0 0 rgb(224, 227, 232), 0 -3px 6px 0 rgba(69, 98, 155, 0.12);
}
/* Darkmode */
html[data-theme='dark'] {
--docsearch-text-color: rgb(245, 246, 247);
--docsearch-container-background: rgba(9, 10, 17, 0.8);
--docsearch-modal-background: rgb(21, 23, 42);
--docsearch-modal-shadow: inset 1px 1px 0 0 rgb(44, 46, 64), 0 3px 8px 0 rgb(0, 3, 9);
--docsearch-searchbox-background: rgb(9, 10, 17);
--docsearch-searchbox-focus-background: #000;
--docsearch-hit-color: rgb(190, 195, 201);
--docsearch-hit-shadow: none;
--docsearch-hit-background: rgb(9, 10, 17);
--docsearch-key-gradient: linear-gradient( -26.5deg, rgb(86, 88, 114) 0%, rgb(49, 53, 91) 100%);
--docsearch-key-shadow: inset 0 -2px 0 0 rgb(40, 45, 85), inset 0 0 1px 1px rgb(81, 87, 125), 0 2px 2px 0 rgba(3, 4, 9, 0.3);
--docsearch-footer-background: rgb(30, 33, 54);
--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), 0 -4px 8px 0 rgba(0, 0, 0, 0.2);
--docsearch-logo-color: rgb(255, 255, 255);
--docsearch-muted-color: rgb(127, 132, 151);
}
/* Body modifier */
.DocSearch--active {
/*
* We need to mark it as important because some websites override the
* `style` attribute (e.g. Docusaurus).
*/
overflow: hidden !important;
}
/* Container & Modal */
.DocSearch-Container, .DocSearch-Container * {
box-sizing: border-box;
}
.DocSearch-Container {
background-color: var(--docsearch-container-background);
height: 100vh;
left: 0;
position: fixed;
top: 0;
width: 100vw;
z-index: 200;
}
.DocSearch-Container a {
text-decoration: none;
}
.DocSearch-Link {
appearance: none;
background: none;
border: 0;
color: var(--docsearch-highlight-color);
cursor: pointer;
font: inherit;
margin: 0;
padding: 0;
}
.DocSearch-Modal {
background: var(--docsearch-modal-background);
border-radius: 8px;
box-shadow: var(--docsearch-modal-shadow);
flex-direction: column;
margin: 60px auto auto;
max-width: var(--docsearch-modal-width);
position: relative;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Ubuntu, sans-serif;
}
/* Modal Searchbox */
.DocSearch-SearchBar {
display: flex;
padding: var(--docsearch-spacing) var(--docsearch-spacing) 0;
}
.DocSearch-Form {
align-items: center;
background: var(--docsearch-searchbox-focus-background);
border-radius: 4px;
display: flex;
height: var(--docsearch-searchbox-height);
padding: 0 var(--docsearch-spacing);
position: relative;
width: 100%;
}
.DocSearch-Input {
appearance: none;
background: transparent;
border: 0;
color: var(--docsearch-text-color);
flex: 1;
font: inherit;
font-size: 1em;
height: 100%;
outline: none;
padding: 0 0 0 8px;
width: 80%;
}
.DocSearch-Input::placeholder {
color: var(--docsearch-muted-color);
opacity: 1;
/* Firefox */
}
.DocSearch-Input::-webkit-search-cancel-button, .DocSearch-Input::-webkit-search-decoration, .DocSearch-Input::-webkit-search-results-button, .DocSearch-Input::-webkit-search-results-decoration {
display: none;
}
.DocSearch-LoadingIndicator, .DocSearch-MagnifierLabel, .DocSearch-Reset {
margin: 0;
padding: 0;
}
.DocSearch-MagnifierLabel, .DocSearch-Reset {
align-items: center;
color: var(--docsearch-highlight-color);
display: flex;
justify-content: center;
}
.DocSearch-Container--Stalled .DocSearch-MagnifierLabel {
display: none;
}
.DocSearch-LoadingIndicator {
display: none;
}
.DocSearch-Container--Stalled .DocSearch-LoadingIndicator {
align-items: center;
color: var(--docsearch-highlight-color);
display: flex;
justify-content: center;
}
@media screen and (prefers-reduced-motion: reduce) {
.DocSearch-Reset {
animation: none;
appearance: none;
background: none;
border: 0;
border-radius: 50%;
color: var(--docsearch-icon-color);
cursor: pointer;
right: 0;
stroke-width: var(--docsearch-icon-stroke-width);
}
}
.DocSearch-Reset {
animation: fade-in 0.1s ease-in forwards;
appearance: none;
background: none;
border: 0;
border-radius: 50%;
color: var(--docsearch-icon-color);
cursor: pointer;
padding: 2px;
right: 0;
stroke-width: var(--docsearch-icon-stroke-width);
}
.DocSearch-Reset[hidden] {
display: none;
}
.DocSearch-Reset:focus {
outline: none;
}
.DocSearch-Reset:hover {
color: var(--docsearch-highlight-color);
}
.DocSearch-LoadingIndicator svg, .DocSearch-MagnifierLabel svg {
height: 1em;
width: 1em;
}
.DocSearch-Cancel {
display: none;
}
/* Modal Dropdown */
.DocSearch-Dropdown {
max-height: calc( var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));
overflow-y: auto;
/* firefox */
overflow-y: overlay;
padding: 0 var(--docsearch-spacing);
scrollbar-color: var(--docsearch-muted-color) var(--docsearch-modal-background);
scrollbar-width: thin;
border-top: 1px solid var(--docsearch-secondary-color)
}
.DocSearch-Dropdown::-webkit-scrollbar {
width: 12px;
}
.DocSearch-Dropdown::-webkit-scrollbar-track {
background: transparent;
}
.DocSearch-Dropdown::-webkit-scrollbar-thumb {
background-color: var(--docsearch-muted-color);
border: 3px solid var(--docsearch-modal-background);
border-radius: 20px;
}
.DocSearch-Dropdown ul {
list-style: none;
margin: 0;
padding: 0;
}
.DocSearch-Label {
color: var(--docsearch-muted-color);
font-size: 0.75em;
line-height: 1.6em;
}
.DocSearch-Help {
color: var(--docsearch-muted-color);
font-size: 0.9em;
margin: 0;
user-select: none;
}
.DocSearch-Title {
font-size: 1.2em;
}
.DocSearch-Logo a {
display: flex;
}
.DocSearch-Logo svg {
color: var(--docsearch-logo-color);
margin-left: 8px;
}
/* Hit */
.DocSearch-Hits:last-of-type {
margin-bottom: 24px;
}
.DocSearch-Hits mark {
background: none;
color: var(--docsearch-highlight-color);
}
.DocSearch-HitsFooter {
color: var(--docsearch-muted-color);
display: flex;
font-size: 0.85em;
justify-content: center;
margin-bottom: var(--docsearch-spacing);
padding: var(--docsearch-spacing);
}
.DocSearch-HitsFooter a {
border-bottom: 1px solid;
color: inherit;
}
.DocSearch-Hit {
border-radius: 4px;
display: flex;
padding-bottom: 4px;
position: relative;
}
@media screen and (prefers-reduced-motion: reduce) {
.DocSearch-Hit--deleting {
transition: none;
}
}
.DocSearch-Hit--deleting {
opacity: 0;
transition: all 250ms linear;
}
@media screen and (prefers-reduced-motion: reduce) {
.DocSearch-Hit--favoriting {
transition: none;
}
}
.DocSearch-Hit--favoriting {
transform: scale(0);
transform-origin: top center;
transition: all 250ms linear;
transition-delay: 250ms;
}
.DocSearch-Hit a {
background: var(--docsearch-hit-background);
border-radius: 4px;
box-shadow: var(--docsearch-hit-shadow);
display: block;
padding-left: var(--docsearch-spacing);
width: 100%;
}
.DocSearch-Hit-source {
background: var(--docsearch-modal-background);
color: var(--docsearch-highlight-color);
font-size: 0.85em;
font-weight: 600;
line-height: 32px;
margin: 0 -4px;
padding: 8px 4px 0;
position: sticky;
top: 0;
z-index: 10;
}
.DocSearch-Hit-Tree {
color: var(--docsearch-muted-color);
height: var(--docsearch-hit-height);
opacity: 0.5;
stroke-width: var(--docsearch-icon-stroke-width);
width: 24px;
}
.DocSearch-Hit[aria-selected='true'] a {
background-color: var(--docsearch-highlight-color);
}
.DocSearch-Hit[aria-selected='true'] mark {
text-decoration: underline;
}
.DocSearch-Hit-Container {
align-items: center;
color: var(--docsearch-hit-color);
display: flex;
flex-direction: row;
height: var(--docsearch-hit-height);
padding: 0 var(--docsearch-spacing) 0 0;
}
.DocSearch-Hit-icon {
color: var(--docsearch-muted-color);
height: 20px;
stroke-width: var(--docsearch-icon-stroke-width);
width: 20px;
}
.DocSearch-Hit-action {
align-items: center;
color: var(--docsearch-muted-color);
display: flex;
height: 22px;
stroke-width: var(--docsearch-icon-stroke-width);
width: 22px;
}
.DocSearch-Hit-action svg {
display: block;
height: 18px;
width: 18px;
}
.DocSearch-Hit-action+.DocSearch-Hit-action {
margin-left: 6px;
}
.DocSearch-Hit-action-button {
appearance: none;
background: none;
border: 0;
border-radius: 50%;
color: inherit;
cursor: pointer;
padding: 2px;
}
svg.DocSearch-Hit-Select-Icon {
display: none;
}
.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-Select-Icon {
display: block;
}
.DocSearch-Hit-action-button:hover, .DocSearch-Hit-action-button:focus {
background: rgba(0, 0, 0, 0.2);
transition: background-color 0.1s ease-in;
}
@media screen and (prefers-reduced-motion: reduce) {
.DocSearch-Hit-action-button:hover, .DocSearch-Hit-action-button:focus {
transition: none;
}
}
.DocSearch-Hit-action-button:hover path, .DocSearch-Hit-action-button:focus path {
fill: #fff;
}
.DocSearch-Hit-content-wrapper {
display: flex;
flex: 1 1 auto;
flex-direction: column;
font-weight: 500;
justify-content: center;
line-height: 1.2em;
margin: 0 8px;
overflow-x: hidden;
position: relative;
text-overflow: ellipsis;
white-space: nowrap;
width: 80%;
}
.DocSearch-Hit-title {
font-size: 0.9em;
}
.DocSearch-Hit-path {
color: var(--docsearch-muted-color);
font-size: 0.75em;
}
.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-title, .DocSearch-Hit[aria-selected='true'] mark, .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-text, .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-path, .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-icon, .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-action, .DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-Tree {
color: var(--docsearch-hit-active-color) !important;
}
@media screen and (prefers-reduced-motion: reduce) {
.DocSearch-Hit-action-button:hover, .DocSearch-Hit-action-button:focus {
background: rgba(0, 0, 0, 0.2);
transition: none;
}
}
/* No Results - Start Screen - Error Screen */
.DocSearch-NoResults, .DocSearch-StartScreen, .DocSearch-ErrorScreen {
font-size: 0.9em;
margin: 0 auto;
padding: 36px 0;
text-align: center;
width: 80%;
}
.DocSearch-Screen-Icon {
color: var(--docsearch-muted-color);
padding-bottom: 12px;
}
.DocSearch-NoResults-Prefill-List {
display: inline-block;
padding-bottom: 24px;
text-align: left;
}
.DocSearch-NoResults-Prefill-List ul {
display: inline-block;
padding: 8px 0 0;
}
.DocSearch-NoResults-Prefill-List li {
list-style-position: inside;
list-style-type: '» ';
}
.DocSearch-Prefill {
appearance: none;
background: none;
border: 0;
border-radius: 1em;
color: var(--docsearch-highlight-color);
cursor: pointer;
display: inline-block;
font-size: 1em;
font-weight: 700;
padding: 0;
}
.DocSearch-Prefill:hover, .DocSearch-Prefill:focus {
outline: none;
text-decoration: underline;
}
/* Modal Footer */
.DocSearch-Footer {
align-items: center;
background: var(--docsearch-footer-background);
border-radius: 0 0 8px 8px;
border-top: 1px solid var(--docsearch-secondary-color);
display: flex;
flex-direction: row-reverse;
flex-shrink: 0;
height: var(--docsearch-footer-height);
justify-content: space-between;
padding: 0 var(--docsearch-spacing);
position: relative;
user-select: none;
width: 100%;
z-index: 300;
}
.DocSearch-Commands {
color: var(--docsearch-muted-color);
display: flex;
list-style: none;
margin: 0;
padding: 0;
}
.DocSearch-Commands li {
align-items: center;
display: flex;
}
.DocSearch-Commands li:not(:last-of-type) {
margin-right: 0.8em;
}
.DocSearch-Commands-Key {
align-items: center;
/* background: var(--docsearch-key-gradient); */
border-radius: 2px;
/* box-shadow: var(--docsearch-key-shadow); */
display: flex;
height: 18px;
justify-content: center;
margin-right: 0.4em;
width: 20px;
}
/* Responsive */
@media screen and (max-width: 848px) {
:root {
--docsearch-spacing: 10px;
--docsearch-footer-height: 40px;
}
.DocSearch-Dropdown {
height: 100%;
}
.DocSearch-Container {
height: 100vh;
height: -webkit-fill-available;
position: absolute;
}
.DocSearch-Footer {
border-radius: 0;
bottom: 0;
position: absolute;
}
.DocSearch-Hit-content-wrapper {
display: flex;
position: relative;
width: 80%;
}
.DocSearch-Modal {
border-radius: 0;
box-shadow: none;
height: 100vh;
height: -webkit-fill-available;
margin: 0;
max-width: 100%;
width: 100%;
}
.DocSearch-Cancel {
appearance: none;
background: none;
border: 0;
color: var(--docsearch-highlight-color);
cursor: pointer;
display: inline-block;
flex: none;
font: inherit;
font-size: 1em;
font-weight: 500;
margin-left: var(--docsearch-spacing);
outline: none;
overflow: hidden;
padding: 0;
user-select: none;
white-space: nowrap;
}
.DocSearch-Commands {
display: none;
}
.DocSearch-Hit-Tree {
display: none;
}
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.DocSearch-Button {
display: flex;
align-items: center;
background: white;
border: 0;
border-radius: 36px;
color: var(--docsearch-muted-color);
cursor: pointer;
display: flex;
font-weight: 500;
height: 36px;
justify-content: space-between;
padding: 0 8px;
user-select: none;
border: 1px solid var(--docsearch-secondary-color);
flex-grow: 1;
max-width: 200px;
margin-left: 12px;
}
.DocSearch-Button:hover, .DocSearch-Button:active, .DocSearch-Button:focus {
color: var(--docsearch-primary-color);
outline: none;
}
.DocSearch-Button-Container {
align-items: center;
display: flex;
}
.DocSearch-Search-Icon {
stroke-width: 1.6;
height: 1em;
}
.DocSearch-Button .DocSearch-Search-Icon {
color: var(--docsearch-muted-color);
}
.DocSearch-Button-Placeholder {
font-size: 1em;
padding: 0 12px 0 6px;
}
.DocSearch-Button-Keys {
display: flex;
justify-content: center;
align-items: center;
border: var(--docsearch-key-border);
background-color: var(--docsearch-secondary-color);
padding: 4px;
border-radius: 4px;
margin-right: 4px;
font-size: .85em;
}
.DocSearch-Button-Key {
align-items: center;
border-radius: 3px;
color: var(--docsearch-muted-color);
display: flex;
height: 10px;
justify-content: center;
position: relative;
width: 10px;
}
.DocSearch-Button-Key:last-of-type {
margin-left: 2px;
padding-top: 1px;
}
@media screen and (max-width: 848px) {
.DocSearch-Button-Keys, .DocSearch-Button-Placeholder {
display: none;
}
.DocSearch-Button {
width: 30px;
max-width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
justify-content: center;
padding: 0;
background-color: var(--docsearch-secondary-color);
border: none;
}
.DocSearch-Button .DocSearch-Search-Icon {
color: var(--docsearch-primary-color);
}
.DocSearch-Search-Icon {
stroke-width: 2.4;
height: 1em;
}
}
@@ -0,0 +1,100 @@
code[class*="language-"], pre[class*="language-"] {
color: #0a3149;
background: none;
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
font-size: 12px;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre)>code[class*="language-"], pre[class*="language-"] {
background: transparent;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: 0.1em;
border-radius: 0.3em;
white-space: normal;
}
.token.comment, .token.prolog, .token.doctype, .token.cdata {
color: blue;
}
.token.punctuation {
color: #0a3149;
}
.token.namespace {
opacity: 0.7;
}
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted {
color: #0a3149;
}
.token.number {
color: #e56f4a;
}
.token.boolean {
color: #3a97d4;
}
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted {
color: #09825d;
}
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string, .token.variable {
color: #0a3149;
}
.token.atrule, .token.attr-value, .token.function, .token.class-name {
color: #e6db74;
}
.token.keyword {
color: #3a97d4;
}
.token.keyword.null {
color: grey;
}
.token.regex, .token.important {
color: #fd971f;
}
.token.important, .token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
@@ -1,123 +0,0 @@
code[class*="language-"],
pre[class*="language-"] {
color: #0a3149;
background: none;
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
font-size: 12px;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: transparent;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: 0.1em;
border-radius: 0.3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: blue;
}
.token.punctuation {
color: #0a3149;
}
.token.namespace {
opacity: 0.7;
}
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
color: #0a3149;
}
.token.number {
color: #e56f4a;
}
.token.boolean {
color: #3a97d4;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #09825d;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #0a3149;
}
.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
color: #e6db74;
}
.token.keyword {
color: #3a97d4;
}
.token.keyword.null {
color: grey;
}
.token.regex,
.token.important {
color: #fd971f;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
@@ -34,7 +34,7 @@ export default function ReferencePage({
return (
<Layout data={data} api={api}>
<Helmet>
<title>{`${siteData.title} | Medusa Commerce API Reference`}</title>
<title>{`API | Medusa Commerce API Reference`}</title>
<meta name="description" content={siteData.description} />
</Helmet>
<Content data={data} api={api} />
Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 3.3 KiB

+941 -783
View File
File diff suppressed because it is too large. Load diff
+3825
View File
File diff suppressed because it is too large. Load diff