@garagem-ai/site-sdk 0.4.6 → 0.4.7
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 +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +37 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -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 +39 -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,31 @@ 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
|
+
wrapperClassName: "mx-auto w-full max-w-site px-4"
|
|
1635
|
+
};
|
|
1636
|
+
function studioSiteWidthCss() {
|
|
1637
|
+
return `:root {
|
|
1638
|
+
--site-max-width: ${STUDIO_SITE_LAYOUT.maxWidthRem};
|
|
1639
|
+
}
|
|
1640
|
+
.max-w-site {
|
|
1641
|
+
max-width: var(--site-max-width);
|
|
1642
|
+
}`;
|
|
1643
|
+
}
|
|
1644
|
+
function studioLayoutInstruction() {
|
|
1645
|
+
const scale = STUDIO_SITE_LAYOUT.maxWidthRemOptions.join(", ");
|
|
1646
|
+
return `Content width (hard rule). In \`app/globals.css\` keep brand tokens and add:
|
|
1647
|
+
\`\`\`css
|
|
1648
|
+
${studioSiteWidthCss()}
|
|
1649
|
+
\`\`\`
|
|
1650
|
+
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, padding, or per-page containers.`;
|
|
1651
|
+
}
|
|
1652
|
+
function studioSearchLandmarkInstruction() {
|
|
1653
|
+
return `Search at \`/imoveis\` (hard rule). The page landmark is \`<main className="${STUDIO_SITE_LAYOUT.surfaceClassName}">\` 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>\`. The wrapper has no extra vertical padding class.`;
|
|
1654
|
+
}
|
|
1629
1655
|
var REACT_SDK_NAMED_IMPORT_RE = /(?:^|[\n;])\s*import\s+(?!type\b)(?:type\s+)?\{([^}]+)\}\s+from\s+['"]@garagem-ai\/site-sdk\/react['"]/g;
|
|
1630
1656
|
var SHOWCASE_LEADS_POST_URL_RE = /\/api\/sites\/[^\s"']*\/leads(?!\/ui)/;
|
|
1631
1657
|
function hasShowcaseLeadsPostUrl(text) {
|
|
@@ -1694,7 +1720,7 @@ function studioChromeInstruction() {
|
|
|
1694
1720
|
STUDIO_SDK_CONTRACT.minNpmVersion,
|
|
1695
1721
|
STUDIO_SDK_CONTRACT.selfInjectSince
|
|
1696
1722
|
) >= 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\`.`;
|
|
1723
|
+
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
1724
|
}
|
|
1699
1725
|
function studioCodegenContractViolations(text) {
|
|
1700
1726
|
const violations = [];
|
|
@@ -1882,6 +1908,7 @@ export {
|
|
|
1882
1908
|
STUDIO_DEFAULT_VISIT_SCHEDULE,
|
|
1883
1909
|
STUDIO_SDK_CONTRACT,
|
|
1884
1910
|
STUDIO_SDK_PACKAGE,
|
|
1911
|
+
STUDIO_SITE_LAYOUT,
|
|
1885
1912
|
TOOLBAR_PRIMARY_FILTER_IDS,
|
|
1886
1913
|
VISIT_TIME_ZONE,
|
|
1887
1914
|
applyPathFilter,
|
|
@@ -1948,8 +1975,11 @@ export {
|
|
|
1948
1975
|
studioChromeInstruction,
|
|
1949
1976
|
studioCodegenContractViolations,
|
|
1950
1977
|
studioDefaultLeadUi,
|
|
1978
|
+
studioLayoutInstruction,
|
|
1951
1979
|
studioLeadInstruction,
|
|
1952
1980
|
studioSdkPinInstruction,
|
|
1981
|
+
studioSearchLandmarkInstruction,
|
|
1982
|
+
studioSiteWidthCss,
|
|
1953
1983
|
submitContactLead,
|
|
1954
1984
|
submitVisitLead,
|
|
1955
1985
|
toListingCardModel,
|