@garagem-ai/site-sdk 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/index.d.mts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +41 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -3
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +5 -2
- package/dist/react.d.ts +5 -2
- package/dist/react.js +7 -5
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +7 -5
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/react/search-chrome.tsx +4 -2
- package/src/react/search-page.tsx +5 -2
- package/src/react/search.css +0 -6
- package/src/react/styles/search-chrome-css.generated.ts +2 -2
- package/src/studio-contract.ts +43 -3
package/dist/index.mjs
CHANGED
|
@@ -1590,9 +1590,10 @@ var STUDIO_SDK_CONTRACT = {
|
|
|
1590
1590
|
/**
|
|
1591
1591
|
* Exact pin for generated Studio sites. Must be ≥ `selfInjectSince` so
|
|
1592
1592
|
* prompts that skip the layout chrome tag match the tarball v0 installs.
|
|
1593
|
-
* 0.4.
|
|
1593
|
+
* 0.4.7 lets SearchPage fill the site wrapper (`as="div"`) with no
|
|
1594
|
+
* nested 80rem inset and no padding on the search slot.
|
|
1594
1595
|
*/
|
|
1595
|
-
minNpmVersion: "0.4.
|
|
1596
|
+
minNpmVersion: "0.4.7",
|
|
1596
1597
|
/** First release where ListingCard and ResultsSkeleton inject the sheet. */
|
|
1597
1598
|
selfInjectSince: "0.4.2",
|
|
1598
1599
|
chromeStrategy: "self-inject",
|
|
@@ -1626,6 +1627,35 @@ var STUDIO_SDK_CONTRACT = {
|
|
|
1626
1627
|
"STUDIO_DEFAULT_VISIT_SCHEDULE"
|
|
1627
1628
|
]
|
|
1628
1629
|
};
|
|
1630
|
+
var STUDIO_SITE_LAYOUT = {
|
|
1631
|
+
maxWidthRem: "80rem",
|
|
1632
|
+
maxWidthRemOptions: ["64rem", "80rem", "120rem", "160rem", "240rem"],
|
|
1633
|
+
surfaceClassName: "w-full",
|
|
1634
|
+
/** Editor search `<main>` default. Designs may change the spacing values. */
|
|
1635
|
+
searchMainClassName: "w-full pt-4 pb-12",
|
|
1636
|
+
/** Opt out of default search spacing — flush against the header on purpose. */
|
|
1637
|
+
searchFlushMarker: 'data-studio-search-spacing="flush"',
|
|
1638
|
+
wrapperClassName: "mx-auto w-full max-w-site px-4"
|
|
1639
|
+
};
|
|
1640
|
+
function studioSiteWidthCss() {
|
|
1641
|
+
return `:root {
|
|
1642
|
+
--site-max-width: ${STUDIO_SITE_LAYOUT.maxWidthRem};
|
|
1643
|
+
}
|
|
1644
|
+
.max-w-site {
|
|
1645
|
+
max-width: var(--site-max-width);
|
|
1646
|
+
}`;
|
|
1647
|
+
}
|
|
1648
|
+
function studioLayoutInstruction() {
|
|
1649
|
+
const scale = STUDIO_SITE_LAYOUT.maxWidthRemOptions.join(", ");
|
|
1650
|
+
return `Content width (hard rule). In \`app/globals.css\` keep brand tokens and add:
|
|
1651
|
+
\`\`\`css
|
|
1652
|
+
${studioSiteWidthCss()}
|
|
1653
|
+
\`\`\`
|
|
1654
|
+
Every page section is two layers: (1) surface \u2014 \`section\` / header / footer \`${STUDIO_SITE_LAYOUT.surfaceClassName}\`, background to the viewport edges, no max-width class and no horizontal padding; (2) wrapper \u2014 one child \`${STUDIO_SITE_LAYOUT.wrapperClassName}\`. Header and footer use that same inner wrapper. Components fill the wrapper (\`w-full\`). Never nest a second max-width container with extra horizontal padding. ${studioSearchLandmarkInstruction()} Do not use \`ml-auto\` on the content wrapper. To make the site narrower or wider, change ONLY \`--site-max-width\` in \`app/globals.css\` (allowed: ${scale}; default ${STUDIO_SITE_LAYOUT.maxWidthRem}). Do not edit wrapper class names or horizontal padding. Full-bleed image surfaces (home hero, listing gallery) stay flush with the header \u2014 do not add vertical padding there.`;
|
|
1655
|
+
}
|
|
1656
|
+
function studioSearchLandmarkInstruction() {
|
|
1657
|
+
return `Search at \`/imoveis\` (hard rule). The page landmark is \`<main className="${STUDIO_SITE_LAYOUT.searchMainClassName}">\` with one child \`${STUDIO_SITE_LAYOUT.wrapperClassName}\`. Pass \`as="div"\` to \`SearchPage\` so it is not a second main. Do not wrap \`SearchPage\` in \`<section>\`. Do not put vertical padding on SearchPage. \`pt-4 pb-12\` is the default on that search \`<main>\` \u2014 change those values if the design needs it. Flush search (glued to the header) is allowed only with \`${STUDIO_SITE_LAYOUT.searchFlushMarker}\` on that \`<main>\`. Never add that vertical padding to home heroes or listing galleries.`;
|
|
1658
|
+
}
|
|
1629
1659
|
var REACT_SDK_NAMED_IMPORT_RE = /(?:^|[\n;])\s*import\s+(?!type\b)(?:type\s+)?\{([^}]+)\}\s+from\s+['"]@garagem-ai\/site-sdk\/react['"]/g;
|
|
1630
1660
|
var SHOWCASE_LEADS_POST_URL_RE = /\/api\/sites\/[^\s"']*\/leads(?!\/ui)/;
|
|
1631
1661
|
function hasShowcaseLeadsPostUrl(text) {
|
|
@@ -1694,7 +1724,7 @@ function studioChromeInstruction() {
|
|
|
1694
1724
|
STUDIO_SDK_CONTRACT.minNpmVersion,
|
|
1695
1725
|
STUDIO_SDK_CONTRACT.selfInjectSince
|
|
1696
1726
|
) >= 0 ? "`SearchPage`, `ListingCard`, and `ResultsSkeleton`" : "`SearchPage`";
|
|
1697
|
-
return `Search chrome CSS is injected by ${injectors} (JS \`<style>\` tag). Never \`import "@garagem-ai/site-sdk/react/search.css"\` \u2014 v0 preview cannot load npm CSS. Do not copy SDK layout into the app. Theme via CSS variables in \`app/globals.css\` (\`SEARCH_CSS_RECIPE\` / \`--garagem-*\`), \`classNames\`, and \`data-slot\`.`;
|
|
1727
|
+
return `Search chrome CSS is injected by ${injectors} (JS \`<style>\` tag). Never \`import "@garagem-ai/site-sdk/react/search.css"\` \u2014 v0 preview cannot load npm CSS. Do not copy SDK card/toolbar layout into the app. Theme via CSS variables in \`app/globals.css\` (\`SEARCH_CSS_RECIPE\` / \`--garagem-*\`), \`classNames\`, and \`data-slot\`.`;
|
|
1698
1728
|
}
|
|
1699
1729
|
function studioCodegenContractViolations(text) {
|
|
1700
1730
|
const violations = [];
|
|
@@ -1882,6 +1912,7 @@ export {
|
|
|
1882
1912
|
STUDIO_DEFAULT_VISIT_SCHEDULE,
|
|
1883
1913
|
STUDIO_SDK_CONTRACT,
|
|
1884
1914
|
STUDIO_SDK_PACKAGE,
|
|
1915
|
+
STUDIO_SITE_LAYOUT,
|
|
1885
1916
|
TOOLBAR_PRIMARY_FILTER_IDS,
|
|
1886
1917
|
VISIT_TIME_ZONE,
|
|
1887
1918
|
applyPathFilter,
|
|
@@ -1948,8 +1979,11 @@ export {
|
|
|
1948
1979
|
studioChromeInstruction,
|
|
1949
1980
|
studioCodegenContractViolations,
|
|
1950
1981
|
studioDefaultLeadUi,
|
|
1982
|
+
studioLayoutInstruction,
|
|
1951
1983
|
studioLeadInstruction,
|
|
1952
1984
|
studioSdkPinInstruction,
|
|
1985
|
+
studioSearchLandmarkInstruction,
|
|
1986
|
+
studioSiteWidthCss,
|
|
1953
1987
|
submitContactLead,
|
|
1954
1988
|
submitVisitLead,
|
|
1955
1989
|
toListingCardModel,
|