Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion mintlify/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@
}
]
},
{
"tab": "Build your flow",
"groups": [
{
"group": "Build your flow",
"pages": [
"flow-builder"
]
}
]
},
{
"tab": "Payouts & B2B",
"groups": [
Expand Down Expand Up @@ -298,7 +309,7 @@
},
"footer": {},
"head": {
"raw": "<style>@font-face{font-family:\"Suisse Intl\";src:url(\"/fonts/suisse-intl/SuisseIntl-Regular.woff2\") format(\"woff2\");font-weight:400;font-style:normal;font-display:swap;ascent-override:85%;descent-override:15%;line-gap-override:0%}@font-face{font-family:\"Suisse Intl\";src:url(\"/fonts/suisse-intl/SuisseIntl-Book.woff2\") format(\"woff2\");font-weight:450;font-style:normal;font-display:swap;ascent-override:85%;descent-override:15%;line-gap-override:0%}@font-face{font-family:\"Suisse Intl\";src:url(\"/fonts/suisse-intl/SuisseIntl-Medium.woff2\") format(\"woff2\");font-weight:500;font-style:normal;font-display:swap;ascent-override:85%;descent-override:15%;line-gap-override:0%}@font-face{font-family:\"Suisse Intl\";src:url(\"/fonts/suisse-intl/SuisseIntl-Medium.woff2\") format(\"woff2\");font-weight:700;font-style:normal;font-display:swap;ascent-override:85%;descent-override:15%;line-gap-override:0%}@font-face{font-family:\"Suisse Intl Mono\";src:url(\"/fonts/suisse-intl-mono/SuisseIntlMono-Regular-WebXL.woff2\") format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"Suisse Intl Mono\";src:url(\"/fonts/suisse-intl-mono/SuisseIntlMono-Bold-WebXL.woff2\") format(\"woff2\");font-weight:700;font-style:normal;font-display:swap}*{font-feature-settings:\"salt\" on}</style><style>#header:empty,#page-title:empty{display:none!important}</style><script>if(location.pathname==='/'||location.pathname==='/index'||location.pathname===''){document.write('<style>header#header,#page-title,#page-context-menu-button,#page-context-menu,.eyebrow,#pagination,[class*=\"space-y-2\"]>*{display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important;margin:0!important;padding:0!important}</style>');document.documentElement.classList.add('is-homepage');}</script><style>html.is-homepage #pagination,body.is-homepage #pagination,html.is-homepage #footer,body.is-homepage #footer,html.is-homepage header#header,body.is-homepage header#header,html.is-homepage #page-title,body.is-homepage #page-title,html.is-homepage #page-context-menu-button,body.is-homepage #page-context-menu-button,html.is-homepage #page-context-menu,body.is-homepage #page-context-menu,html.is-homepage .eyebrow,body.is-homepage .eyebrow{display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important}</style>",
"raw": "<style>@font-face{font-family:\"Suisse Intl\";src:url(\"/fonts/suisse-intl/SuisseIntl-Regular.woff2\") format(\"woff2\");font-weight:400;font-style:normal;font-display:swap;ascent-override:85%;descent-override:15%;line-gap-override:0%}@font-face{font-family:\"Suisse Intl\";src:url(\"/fonts/suisse-intl/SuisseIntl-Book.woff2\") format(\"woff2\");font-weight:450;font-style:normal;font-display:swap;ascent-override:85%;descent-override:15%;line-gap-override:0%}@font-face{font-family:\"Suisse Intl\";src:url(\"/fonts/suisse-intl/SuisseIntl-Medium.woff2\") format(\"woff2\");font-weight:500;font-style:normal;font-display:swap;ascent-override:85%;descent-override:15%;line-gap-override:0%}@font-face{font-family:\"Suisse Intl\";src:url(\"/fonts/suisse-intl/SuisseIntl-Medium.woff2\") format(\"woff2\");font-weight:700;font-style:normal;font-display:swap;ascent-override:85%;descent-override:15%;line-gap-override:0%}@font-face{font-family:\"Suisse Intl Mono\";src:url(\"/fonts/suisse-intl-mono/SuisseIntlMono-Regular-WebXL.woff2\") format(\"woff2\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"Suisse Intl Mono\";src:url(\"/fonts/suisse-intl-mono/SuisseIntlMono-Bold-WebXL.woff2\") format(\"woff2\");font-weight:700;font-style:normal;font-display:swap}*{font-feature-settings:\"salt\" on}</style><style>#header:empty,#page-title:empty{display:none!important}</style><script>if(location.pathname==='/'||location.pathname==='/index'||location.pathname===''){document.write('<style>header#header,#page-title,#page-context-menu-button,#page-context-menu,.eyebrow,#pagination,[class*=\"space-y-2\"]>*{display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important;margin:0!important;padding:0!important}</style>');document.documentElement.classList.add('is-homepage');}</script><style>html.is-homepage #pagination,body.is-homepage #pagination,html.is-homepage #footer,body.is-homepage #footer,html.is-homepage header#header,body.is-homepage header#header,html.is-homepage #page-title,body.is-homepage #page-title,html.is-homepage #page-context-menu-button,body.is-homepage #page-context-menu-button,html.is-homepage #page-context-menu,body.is-homepage #page-context-menu,html.is-homepage .eyebrow,body.is-homepage .eyebrow{display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important}</style><script>if(location.pathname==='/flow-builder'){document.write('<style>header#header,#page-title,#page-context-menu-button,#page-context-menu,.eyebrow,#pagination{display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important;margin:0!important;padding:0!important}</style>');}</script><style>html:has(#flow-builder-container) header#header,html:has(#flow-builder-container) #page-title,html:has(#flow-builder-container) .eyebrow,html:has(#flow-builder-container) #page-context-menu-button,html:has(#flow-builder-container) #page-context-menu,html:has(#flow-builder-container) #pagination{display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important;margin:0!important;padding:0!important}</style>",
"links": [
{
"rel": "preload",
Expand Down
67 changes: 67 additions & 0 deletions mintlify/flow-builder.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: "Build your flow"
description: "Design your flow and get the API calls for your exact use case"
mode: "custom"
"og:image": "/images/og/og-flow-builder.png"
---

export const FlowBuilderEmbed = () => {
const [src, setSrc] = React.useState(null);

React.useEffect(() => {
const isDark = document.documentElement.classList.contains('dark');
setSrc('https://grid-visualizer-opal.vercel.app/?embed=true&theme=' + (isDark ? 'dark' : 'light'));

let ignoreNextMutation = false;

const sendTheme = () => {
const t = document.documentElement.classList.contains('dark') ? 'dark' : 'light';
const iframe = document.getElementById('flow-builder-iframe');
if (iframe && iframe.contentWindow) {
iframe.contentWindow.postMessage({ type: 'theme-sync', theme: t }, '*');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using '*' as targetOrigin in postMessage allows any window to receive the message. Should validate and use specific origin like 'https://grid-visualizer-opal.vercel.app'.

Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/flow-builder.mdx
Line: 21

Comment:
Using `'*'` as targetOrigin in `postMessage` allows any window to receive the message. Should validate and use specific origin like `'https://grid-visualizer-opal.vercel.app'`.

How can I resolve this? If you propose a fix, please make it concise.

}
};

const handleMessage = (e) => {
if (e.data && e.data.type === 'theme-request') {
sendTheme();
return;
}
if (e.data && e.data.type === 'theme-sync') {
const isDark = document.documentElement.classList.contains('dark');
const wantsDark = e.data.theme === 'dark';
if (isDark !== wantsDark) {
ignoreNextMutation = true;
document.documentElement.classList.toggle('dark');
}
}
};
Comment on lines +25 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message handler doesn't validate e.origin before processing messages, allowing any site to send theme-sync commands. Add origin check like if (e.origin !== 'https://grid-visualizer-opal.vercel.app') return;.

Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/flow-builder.mdx
Line: 25-38

Comment:
Message handler doesn't validate `e.origin` before processing messages, allowing any site to send theme-sync commands. Add origin check like `if (e.origin !== 'https://grid-visualizer-opal.vercel.app') return;`.

How can I resolve this? If you propose a fix, please make it concise.

window.addEventListener('message', handleMessage);

const obs = new MutationObserver(() => {
if (ignoreNextMutation) { ignoreNextMutation = false; return; }
sendTheme();
});
obs.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });

return () => {
window.removeEventListener('message', handleMessage);
obs.disconnect();
};
}, []);
Comment on lines +11 to +51
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using React.useEffect breaks Mintlify's acorn parser per CLAUDE.md style guide. Replace with initialization code that doesn't use useEffect.

Context Used: Context from dashboard - CLAUDE.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/flow-builder.mdx
Line: 11-51

Comment:
Using `React.useEffect` breaks Mintlify's acorn parser per CLAUDE.md style guide. Replace with initialization code that doesn't use `useEffect`.

**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=21abe025-35ab-4ae8-a4a1-0071c2ac3b98))

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong BTW, mintlify's own examples use useEffect https://www.mintlify.com/docs/customize/react-components#example-2

this was an old rule i added out of caution from a debugging session. i'll remove it


if (!src) return null;

return (
<iframe
id="flow-builder-iframe"
src={src}
title="Grid Flow Builder"
allow="clipboard-write"
/>
);
};

<div id="flow-builder-container">
<FlowBuilderEmbed />
</div>
Binary file added mintlify/images/og/og-flow-builder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions mintlify/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export const gridCategories = [
</div>

{/* Hero Banner with Sand Dunes Image */}
<a href="https://www.lightspark.com/contact" className="hero-banner">
<a href="/flow-builder" className="hero-banner">
<div className="hero-banner-bg"></div>
<div className="hero-banner-overlay">
<span className="hero-banner-text">Ready to test? <span className="hero-banner-text-link">Explore the Grid Sandbox</span></span>
<span className="hero-banner-button">Request sandbox access</span>
<span className="hero-banner-text">Ready to build? <span className="hero-banner-text-link">Get the API calls for your exact use case</span></span>
<span className="hero-banner-button">Build your flow</span>
</div>
</a>

Expand Down
82 changes: 82 additions & 0 deletions mintlify/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3895,3 +3895,85 @@ html.dark .trusted-by-logo {
html.dark .homepage-divider {
border-color: var(--ls-white-06);
}

/* Flow Builder iframe — full bleed */
#flow-builder-container {
position: fixed !important;
top: 112px !important;
left: 0 !important;
width: 100vw !important;
height: calc(100dvh - 112px) !important;
z-index: 1;
aspect-ratio: unset !important;
padding: 0 !important;
margin: 0 !important;
background: var(--ls-gray-100) !important;
}

html.dark #flow-builder-container {
background: var(--ls-gray-975) !important;
}

#flow-builder-iframe {
width: 100% !important;
height: 100% !important;
border: none !important;
aspect-ratio: unset !important;
position: absolute !important;
top: 0 !important;
left: 0 !important;
}

/* Kill Mintlify's iframe aspect-ratio wrapper */
#flow-builder-container > div,
#flow-builder-container > [style*="aspect-ratio"] {
aspect-ratio: unset !important;
width: 100% !important;
height: 100% !important;
position: absolute !important;
inset: 0 !important;
padding: 0 !important;
}

#content-area:has(#flow-builder-container) {
padding: 0 !important;
max-width: 100% !important;
}

#content-container:has(#flow-builder-container) {
max-width: 100% !important;
padding: 0 !important;
}

/* Mobile: logo bar (64px) + breadcrumb bar (56px) = 120px total navbar */
@media (max-width: 1023px) {
#flow-builder-container {
top: 120px !important;
height: calc(100dvh - 120px) !important;
}
}

/* Prevent outer page scroll when flow-builder is present */
html:has(#flow-builder-container),
html:has(#flow-builder-container) body {
overflow: hidden !important;
}

/* Flow Builder mobile breadcrumb — hide text + chevron, keep hamburger, show (0, 0, 0) */
html:has(#flow-builder-container) #navbar button[class*="h-14"][class*="text-left"] > *:not(:first-child) {
display: none !important;
}

html:has(#flow-builder-container) #navbar button[class*="h-14"][class*="text-left"]::after {
content: "(0, 0, 0)";
margin-left: auto;
font-family: "Suisse Intl Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 10px !important;
font-weight: 400;
color: var(--ls-gray-400);
}

html.dark:has(#flow-builder-container) #navbar button[class*="h-14"][class*="text-left"]::after {
color: var(--ls-gray-700);
}