@sonordev/site-kit 7.3.0 → 8.0.0

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.
Files changed (239) hide show
  1. package/AGENTS.md +40 -12
  2. package/CHANGELOG.md +73 -0
  3. package/README.md +44 -18
  4. package/agent-manifest.json +111 -56
  5. package/dist/AnalyticsProvider-LYFDQRRJ.js +13 -0
  6. package/dist/{ArticleViewTracker-GFOAXFV7.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
  7. package/dist/{BlocksPopup-AHDU34TL.js → BlocksPopup-GFX3GZIK.js} +6 -5
  8. package/dist/{ChatWidget-FHBAHFZX.js → ChatWidget-DVS7MLBN.js} +8 -5
  9. package/dist/{FileField-J5W5MIAZ.js → FileField-DVN7NUBI.js} +5 -5
  10. package/dist/{FormSpotlight-PE5YZBFZ.js → FormSpotlight-W4SXKKO6.js} +3 -3
  11. package/dist/{FormStage-OOPQC27J.js → FormStage-JTEE5MZD.js} +3 -3
  12. package/dist/ManagedForm-ZAUHIHGP.js +19 -0
  13. package/dist/{ManagedNewsletterForm-TC5542ZG.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
  14. package/dist/{SignalCore-2YP5FCAS.js → SignalCore-W5PYYMGX.js} +7 -7
  15. package/dist/SiteChat-MY2GATWC.js +6 -0
  16. package/dist/SiteDesignReporter-ICZWEGCY.js +12 -0
  17. package/dist/SitePopups-TGULLAER.js +13 -0
  18. package/dist/SitemapSync-AN2OBJE6.js +9 -0
  19. package/dist/_client/booking-widget.js +6 -5
  20. package/dist/_client/testimonial-section.d.ts +1 -1
  21. package/dist/_client/testimonial-section.js +4 -2
  22. package/dist/affiliates/index.js +6 -6
  23. package/dist/analytics/index.js +73 -7
  24. package/dist/articles/index.js +2 -2
  25. package/dist/articles/server-ui.js +3 -3
  26. package/dist/articles/server.js +2 -2
  27. package/dist/brand.css +1 -1
  28. package/dist/chat/index.d.ts +1 -1
  29. package/dist/chat/index.js +39 -8
  30. package/dist/chunk-3G7YABRA.js +25 -0
  31. package/dist/{chunk-CGWUXUYZ.js → chunk-3RDJKIYO.js} +2 -2
  32. package/dist/{chunk-J4FSB4OG.js → chunk-3YKQLC7J.js} +5 -2
  33. package/dist/{chunk-BEBR4OJD.js → chunk-56VDS2RP.js} +2 -2
  34. package/dist/chunk-5ROTTMBL.js +19 -0
  35. package/dist/{chunk-56KNHB4U.js → chunk-5S2XDG5O.js} +1 -1
  36. package/dist/chunk-5TM3WPCI.js +7 -0
  37. package/dist/{chunk-BR4ZKUHH.js → chunk-6CJGZFOU.js} +18 -2
  38. package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
  39. package/dist/{chunk-XLSQTTUE.js → chunk-6QFINXLH.js} +3 -3
  40. package/dist/{chunk-CYUFBKJQ.js → chunk-6ZXJ3SXR.js} +1 -1
  41. package/dist/{chunk-NI2XNEMR.js → chunk-7YEEOIWI.js} +1 -1
  42. package/dist/{chunk-DNPNYWVL.js → chunk-BQ2CXKTQ.js} +5 -20
  43. package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
  44. package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
  45. package/dist/chunk-CAT235HY.js +13 -0
  46. package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
  47. package/dist/{chunk-O5RGXTWU.js → chunk-GNSXOTIK.js} +6 -4
  48. package/dist/{chunk-UPRSH6Q4.js → chunk-ICAVVF6D.js} +3 -3
  49. package/dist/{chunk-2ECWEUHP.js → chunk-IJQ767JS.js} +3 -5
  50. package/dist/{chunk-MKMD2HJW.js → chunk-J65N34YM.js} +3 -3
  51. package/dist/{chunk-6U3VLV2C.js → chunk-JIH32RH2.js} +4 -4
  52. package/dist/{chunk-T4DLETKR.js → chunk-K22OLAPC.js} +2 -2
  53. package/dist/{chunk-I2YX3HVD.js → chunk-KRBBH64S.js} +3 -3
  54. package/dist/{chunk-VF4F5WXZ.js → chunk-LBIQ5LTC.js} +1 -1
  55. package/dist/{chunk-WGIDC6QP.js → chunk-LKH44GI3.js} +5 -5
  56. package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
  57. package/dist/{chunk-WDQB4OXY.js → chunk-M62U7TJF.js} +1 -1
  58. package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
  59. package/dist/chunk-OD2ULW5Z.js +57 -0
  60. package/dist/{chunk-Y6LP36UW.js → chunk-OE3NXEOF.js} +2 -2
  61. package/dist/{chunk-L7U23XI2.js → chunk-OGK7OL3T.js} +5 -4
  62. package/dist/{chunk-RDPW4D33.js → chunk-PD7K54EQ.js} +2 -2
  63. package/dist/{chunk-MVR4FY5R.js → chunk-PIX7FAMX.js} +2 -2
  64. package/dist/{chunk-2AD3CDRR.js → chunk-ROAOI6GG.js} +10 -10
  65. package/dist/{chunk-YJLS6JBI.js → chunk-S7SSYGUJ.js} +6 -5
  66. package/dist/{chunk-ZKHI4E2B.js → chunk-SBPAXWLF.js} +1 -1
  67. package/dist/{chunk-ZHS2XFLV.js → chunk-TOSZGJEQ.js} +1 -1
  68. package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
  69. package/dist/{chunk-Z65DHMTW.js → chunk-TZ5RTANX.js} +3 -3
  70. package/dist/{chunk-VX5CMNMM.js → chunk-UAYAJPEP.js} +7 -1
  71. package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
  72. package/dist/{chunk-EPT6FJUY.js → chunk-UUWUAMUC.js} +13 -16
  73. package/dist/{chunk-PKGN32AU.js → chunk-XPTJRVL2.js} +1 -1
  74. package/dist/{chunk-662ILEZ6.js → chunk-Y35BWW2C.js} +3 -7
  75. package/dist/{chunk-MRQ2U4LZ.js → chunk-ZHNQFNO3.js} +2 -2
  76. package/dist/chunk-ZKADJNR2.js +52 -0
  77. package/dist/{chunk-WGG6GTKW.js → chunk-ZLFGXKLG.js} +1 -1
  78. package/dist/client/index.js +6 -5
  79. package/dist/contracts/entries.d.ts +1 -1
  80. package/dist/contracts/sentences.d.ts +46 -0
  81. package/dist/contracts/site-cache.d.ts +2 -0
  82. package/dist/cta-bar/index.js +1 -1
  83. package/dist/fleet/index.js +6 -5
  84. package/dist/forms/field-autocomplete.d.ts +16 -8
  85. package/dist/forms/index.d.ts +5 -0
  86. package/dist/forms/index.js +17 -17
  87. package/dist/forms/server.js +7 -7
  88. package/dist/forms/static.js +2 -2
  89. package/dist/forms/submitForm.d.ts +5 -0
  90. package/dist/images/index.js +4 -4
  91. package/dist/index.d.ts +3 -7
  92. package/dist/index.js +1 -1
  93. package/dist/layout/SiteKitLayout.d.ts +2 -1
  94. package/dist/layout/client.js +11 -9
  95. package/dist/layout/index.js +14 -12
  96. package/dist/llms/index.js +8 -7
  97. package/dist/maps/index.js +6 -6
  98. package/dist/mcp/sonor.d.ts +47 -3
  99. package/dist/mcp/sonor.js +31 -21
  100. package/dist/proxy/index.d.ts +3 -3
  101. package/dist/proxy/index.js +1 -1
  102. package/dist/reputation/TestimonialSection.d.ts +1 -1
  103. package/dist/reputation/VisualReviewCard.d.ts +6 -0
  104. package/dist/reputation/index.d.ts +2 -1
  105. package/dist/reputation/index.js +5 -2
  106. package/dist/reputation/review-photo.d.ts +2 -0
  107. package/dist/reputation/server.d.ts +3 -2
  108. package/dist/reputation/server.js +4 -1
  109. package/dist/reputation/types.d.ts +22 -0
  110. package/dist/revalidate/index.js +3 -3
  111. package/dist/robots/indexnow.js +2 -2
  112. package/dist/runtime/index.d.ts +32 -0
  113. package/dist/runtime/index.js +7 -0
  114. package/dist/seo/api.d.ts +0 -4
  115. package/dist/seo/client.js +6 -5
  116. package/dist/seo/getManagedMetadata.d.ts +24 -0
  117. package/dist/seo/index.d.ts +2 -3
  118. package/dist/seo/index.js +14 -132
  119. package/dist/seo/indexnow.js +2 -2
  120. package/dist/seo/llms.js +8 -7
  121. package/dist/seo/register-sitemap-cli.js +2 -2
  122. package/dist/seo/server-api.d.ts +0 -6
  123. package/dist/seo/server.d.ts +1 -1
  124. package/dist/seo/server.js +4 -4
  125. package/dist/seo/sitemap.js +5 -4
  126. package/dist/seo/types.d.ts +9 -30
  127. package/dist/server/index.d.ts +8 -1
  128. package/dist/server/index.js +5 -4
  129. package/dist/server/mint-site-token.d.ts +1 -13
  130. package/dist/server/server-fetch.d.ts +19 -0
  131. package/dist/server-api-EGOKC7Q3.js +9 -0
  132. package/dist/shared/build-entries.d.ts +21 -9
  133. package/dist/shared/clientApiConfig.d.ts +56 -0
  134. package/dist/shared/fresh-fetch.d.ts +9 -3
  135. package/dist/shared/identity-reader.d.ts +26 -0
  136. package/dist/shared/identity-storage.d.ts +30 -0
  137. package/dist/shared/identity.d.ts +13 -13
  138. package/dist/shared/import-specifiers.d.ts +26 -0
  139. package/dist/shared/sonorFetch.d.ts +4 -3
  140. package/dist/shared/version.d.ts +1 -1
  141. package/dist/signal/index.js +2 -2
  142. package/dist/sitemap/index.js +5 -4
  143. package/dist/slots/index.js +3 -3
  144. package/dist/sync/index.js +6 -5
  145. package/dist/types.d.ts +0 -1
  146. package/dist/website/cta-bar.js +1 -1
  147. package/dist/website/images.js +4 -4
  148. package/dist/website/index.js +7 -6
  149. package/dist/website/popups.js +10 -7
  150. package/dist/website/slots.js +3 -3
  151. package/dist/{writeLLMsTxt-2NQVDGYI.js → writeLLMsTxt-UZGN6IBU.js} +4 -3
  152. package/docs/MIGRATING-TO-7.md +5 -2
  153. package/docs/MIGRATING-TO-8.md +183 -0
  154. package/docs.json +4 -8
  155. package/package.json +15 -44
  156. package/skills/site-kit/SKILL.md +41 -11
  157. package/src/analytics/README.md +14 -14
  158. package/src/chat/README.md +7 -7
  159. package/src/forms/README.md +61 -6
  160. package/src/mcp/README.md +61 -20
  161. package/src/proxy/README.md +5 -4
  162. package/src/reputation/README.md +25 -0
  163. package/src/revalidate/README.md +2 -2
  164. package/src/runtime/README.md +51 -0
  165. package/src/seo/README.md +24 -8
  166. package/src/sync/README.md +2 -2
  167. package/src/website/README.md +3 -2
  168. package/dist/AnalyticsProvider-DJQA66AG.js +0 -11
  169. package/dist/ManagedForm-JRZAJ7SZ.js +0 -16
  170. package/dist/SiteChat-EGEZJJVV.js +0 -5
  171. package/dist/SiteDesignReporter-YEEWJKWN.js +0 -11
  172. package/dist/SitePopups-LQBIXIFV.js +0 -10
  173. package/dist/SitemapSync-LSZ2EYOF.js +0 -8
  174. package/dist/chunk-24QZEO3Q.js +0 -41
  175. package/dist/chunk-BU66S5B7.js +0 -1
  176. package/dist/chunk-G3NHWMP5.js +0 -233
  177. package/dist/chunk-HODO5BX5.js +0 -28
  178. package/dist/chunk-L3AQCDCY.js +0 -386
  179. package/dist/chunk-P5GB6NEO.js +0 -66
  180. package/dist/chunk-SWKE6FWH.js +0 -47
  181. package/dist/cms/CmsPage.d.ts +0 -17
  182. package/dist/cms/CmsPreview.d.ts +0 -37
  183. package/dist/cms/CmsSection.d.ts +0 -8
  184. package/dist/cms/PortableTextRenderer.d.ts +0 -7
  185. package/dist/cms/index.d.ts +0 -37
  186. package/dist/cms/index.js +0 -5
  187. package/dist/cms/sanity-image.d.ts +0 -47
  188. package/dist/cms/sections/CtaSection.d.ts +0 -3
  189. package/dist/cms/sections/CustomSection.d.ts +0 -7
  190. package/dist/cms/sections/FaqSection.d.ts +0 -3
  191. package/dist/cms/sections/FormSection.d.ts +0 -8
  192. package/dist/cms/sections/GallerySection.d.ts +0 -3
  193. package/dist/cms/sections/HeroSection.d.ts +0 -3
  194. package/dist/cms/sections/RichTextSection.d.ts +0 -3
  195. package/dist/cms/sections/TestimonialsSection.d.ts +0 -3
  196. package/dist/cms/sections/index.d.ts +0 -8
  197. package/dist/cms/server-api.d.ts +0 -49
  198. package/dist/cms/server.d.ts +0 -1
  199. package/dist/cms/server.js +0 -5
  200. package/dist/cms/types.d.ts +0 -104
  201. package/dist/commerce/CalendarView.d.ts +0 -43
  202. package/dist/commerce/CheckoutForm.d.ts +0 -11
  203. package/dist/commerce/EventCalendar.d.ts +0 -26
  204. package/dist/commerce/EventCheckout.d.ts +0 -42
  205. package/dist/commerce/EventEmbed.d.ts +0 -11
  206. package/dist/commerce/EventModal.d.ts +0 -43
  207. package/dist/commerce/EventTile.d.ts +0 -10
  208. package/dist/commerce/EventsAgenda.d.ts +0 -38
  209. package/dist/commerce/EventsWidget.d.ts +0 -84
  210. package/dist/commerce/OfferingCard.d.ts +0 -9
  211. package/dist/commerce/OfferingList.d.ts +0 -9
  212. package/dist/commerce/ProductDetail.d.ts +0 -38
  213. package/dist/commerce/ProductEmbed.d.ts +0 -11
  214. package/dist/commerce/ProductGrid.d.ts +0 -41
  215. package/dist/commerce/ProductPage.d.ts +0 -39
  216. package/dist/commerce/RegistrationForm.d.ts +0 -9
  217. package/dist/commerce/SizeChart.d.ts +0 -8
  218. package/dist/commerce/UpcomingEvents.d.ts +0 -9
  219. package/dist/commerce/api.d.ts +0 -179
  220. package/dist/commerce/events-extras.d.ts +0 -60
  221. package/dist/commerce/index.d.ts +0 -33
  222. package/dist/commerce/index.js +0 -8022
  223. package/dist/commerce/server.d.ts +0 -161
  224. package/dist/commerce/server.js +0 -2
  225. package/dist/commerce/types.d.ts +0 -340
  226. package/dist/commerce/useEventModal.d.ts +0 -20
  227. package/dist/commerce/utils.d.ts +0 -17
  228. package/dist/engage/EngageWidget.d.ts +0 -21
  229. package/dist/engage/index.d.ts +0 -14
  230. package/dist/engage/index.js +0 -45
  231. package/dist/engage/types.d.ts +0 -33
  232. package/dist/seo/ManagedContent.d.ts +0 -14
  233. package/dist/server-api-BVCBLJKL.js +0 -9
  234. package/dist/website/cms/server.d.ts +0 -2
  235. package/dist/website/cms/server.js +0 -5
  236. package/dist/website/cms-server.d.ts +0 -2
  237. package/dist/website/cms.d.ts +0 -2
  238. package/dist/website/cms.js +0 -5
  239. package/src/commerce/README.md +0 -109
@@ -1,66 +0,0 @@
1
- 'use client';
2
- import { trackConversion } from './chunk-LCDVPAMR.js';
3
- import { useCallback, useEffect } from 'react';
4
-
5
- function useContactTracking(options = {}) {
6
- const { autoTrack = true, debug = false } = options;
7
- const trackPhoneClick = useCallback((phoneNumber, metadata) => {
8
- if (debug) console.log("[Analytics] Phone click:", phoneNumber);
9
- trackConversion({
10
- type: "phone_call",
11
- metadata: {
12
- phoneNumber: phoneNumber.replace(/\D/g, ""),
13
- // Normalize to digits
14
- rawNumber: phoneNumber,
15
- ...metadata
16
- }
17
- });
18
- }, [debug]);
19
- const trackEmailClick = useCallback((email, metadata) => {
20
- if (debug) console.log("[Analytics] Email click:", email);
21
- trackConversion({
22
- type: "email_click",
23
- metadata: {
24
- email,
25
- ...metadata
26
- }
27
- });
28
- }, [debug]);
29
- useEffect(() => {
30
- if (!autoTrack || typeof document === "undefined") return;
31
- const handleClick = (e) => {
32
- const target = e.target;
33
- const anchor = target.closest("a");
34
- if (!anchor) return;
35
- const href = anchor.getAttribute("href");
36
- if (!href) return;
37
- if (href.startsWith("tel:")) {
38
- const phone = href.replace("tel:", "").trim();
39
- trackPhoneClick(phone, {
40
- linkText: anchor.textContent?.trim(),
41
- source: "auto"
42
- });
43
- } else if (href.startsWith("mailto:")) {
44
- const email = href.replace("mailto:", "").split("?")[0].trim();
45
- trackEmailClick(email, {
46
- linkText: anchor.textContent?.trim(),
47
- source: "auto"
48
- });
49
- }
50
- };
51
- document.addEventListener("click", handleClick, { capture: true });
52
- return () => {
53
- document.removeEventListener("click", handleClick, { capture: true });
54
- };
55
- }, [autoTrack, trackPhoneClick, trackEmailClick]);
56
- return {
57
- trackPhoneClick,
58
- trackEmailClick
59
- };
60
- }
61
- function ContactTracking({ debug = false }) {
62
- useContactTracking({ autoTrack: true, debug });
63
- return null;
64
- }
65
-
66
- export { ContactTracking, useContactTracking };
@@ -1,47 +0,0 @@
1
- import { serverApiFetch } from './chunk-X6F6SO4S.js';
2
- import { cache } from 'react';
3
- import 'server-only';
4
-
5
- var CMS_LOG_PREFIX = "@sonordev/site-kit/cms";
6
- function secureApiPost(endpoint, body = {}) {
7
- return serverApiFetch(endpoint, {
8
- method: "POST",
9
- body,
10
- revalidate: 60,
11
- requireKey: true,
12
- retry: true,
13
- logPrefix: CMS_LOG_PREFIX
14
- });
15
- }
16
- var getCmsPage = cache(
17
- async (path) => {
18
- const result = await secureApiPost("/api/public/cms/page", { path });
19
- if (!result?.found || !result.page) return null;
20
- return result.page;
21
- }
22
- );
23
- var getCmsSection = cache(
24
- async (sectionId) => {
25
- const result = await secureApiPost("/api/public/cms/section", { sectionId });
26
- if (!result?.found || !result.section) return null;
27
- return result.section;
28
- }
29
- );
30
- var getCmsPageMetadata = cache(
31
- async (path) => {
32
- const page = await getCmsPage(path);
33
- if (!page) return null;
34
- const seo = page.seo || {};
35
- return {
36
- title: seo.title || page.title,
37
- description: seo.description,
38
- robots: seo.noindex ? { index: false } : void 0,
39
- openGraph: {
40
- title: seo.title || page.title,
41
- description: seo.description
42
- }
43
- };
44
- }
45
- );
46
-
47
- export { getCmsPage, getCmsPageMetadata, getCmsSection };
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import type { CmsPageProps } from './types';
3
- /**
4
- * Async React Server Component that fetches and renders a full CMS page.
5
- *
6
- * @example
7
- * ```tsx
8
- * // app/[...slug]/page.tsx
9
- * import { CmsPage } from '@sonordev/site-kit/cms'
10
- *
11
- * export default function Page({ params }) {
12
- * return <CmsPage path={`/${params.slug.join('/')}`} />
13
- * }
14
- * ```
15
- * @deprecated Since 7.1. Sonor retired the Sanity CMS and no longer serves CMS pages, so this renders nothing. Use managed copy from `@sonordev/site-kit/website/slots` (`ManagedRichText`, `ManagedList`). Removed in 8.0.
16
- */
17
- export declare function CmsPage({ path, sectionComponents, portableTextComponents, fallback, className, }: CmsPageProps): Promise<React.ReactElement | null>;
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import type { SectionType, SectionRendererProps } from './types';
3
- interface CmsPreviewProps {
4
- /** Sonor API base URL */
5
- apiUrl?: string;
6
- /** API key for fetching draft content */
7
- apiKey: string;
8
- /** Page path to preview */
9
- path: string;
10
- /** Poll interval in ms (0 = no polling) */
11
- pollInterval?: number;
12
- /** Override section renderers */
13
- sectionComponents?: Partial<Record<SectionType, React.ComponentType<SectionRendererProps>>>;
14
- /** Override Portable Text components */
15
- portableTextComponents?: Record<string, React.ComponentType<any>>;
16
- /** Wrapper className */
17
- className?: string;
18
- }
19
- /**
20
- * Client component for previewing draft CMS content.
21
- * Fetches draft content from Sonor API and re-renders on changes.
22
- *
23
- * @example
24
- * ```tsx
25
- * // Used in preview mode (e.g., ?preview=true)
26
- * import { CmsPreview } from '@sonordev/site-kit/cms'
27
- *
28
- * <CmsPreview
29
- * apiKey={process.env.SONOR_API_KEY!}
30
- * path="/about"
31
- * pollInterval={3000}
32
- * />
33
- * ```
34
- * @deprecated Since 7.1. Sonor retired the Sanity CMS and no longer serves CMS pages, so this renders nothing. Use managed copy from `@sonordev/site-kit/website/slots` (`ManagedRichText`, `ManagedList`). Removed in 8.0.
35
- */
36
- export declare function CmsPreview({ apiUrl, apiKey, path, pollInterval, sectionComponents, portableTextComponents, className, }: CmsPreviewProps): React.JSX.Element;
37
- export {};
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { CmsSectionProps } from './types';
3
- /**
4
- * Renders a single CMS section using the appropriate renderer for its type.
5
- * Override specific section renderers via the `sectionComponents` prop.
6
- * @deprecated Since 7.1. Sonor retired the Sanity CMS and no longer serves CMS pages, so this renders nothing. Use managed copy from `@sonordev/site-kit/website/slots` (`ManagedRichText`, `ManagedList`). Removed in 8.0.
7
- */
8
- export declare function CmsSection({ section, sectionComponents, portableTextComponents }: CmsSectionProps): React.JSX.Element | null;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { PortableTextRendererProps } from './types';
3
- /**
4
- * Renders Portable Text content with Sonor default styling.
5
- * Accepts `components` prop to override or extend defaults.
6
- */
7
- export declare function PortableTextRenderer({ value, components: overrides, className, }: PortableTextRendererProps): React.JSX.Element | null;
@@ -1,37 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/cms
3
- *
4
- * DEPRECATED since 7.1, removed in 8.0. Sonor retired the Sanity CMS: no
5
- * project has CMS pages and the API no longer serves them, so these components
6
- * render nothing. Site copy is managed copy now (`@sonordev/site-kit/website/slots`:
7
- * `ManagedSlot`, `ManagedRichText`, `ManagedLink`, `ManagedList`), edited in
8
- * Sonor under Website → Content.
9
- *
10
- * REQUIRES TWO OPTIONAL PEER DEPENDENCIES. Importing this entry without them
11
- * fails the consuming site's build with "Module not found":
12
- *
13
- * npm i @portabletext/react @sanity/image-url
14
- *
15
- * They are peers rather than dependencies because they serve only this module
16
- * (~8 packages / 1.7 MB) and most sites on the fleet never render Sanity
17
- * content. The isolation that makes this safe is the subpath export: nothing
18
- * outside `src/cms/` imports them, and no shared build chunk carries them, so
19
- * a site that never imports `@sonordev/site-kit/cms` never resolves them. The
20
- * same pattern already governs `@vis.gl/react-google-maps` for `./maps`.
21
- *
22
- * Note this applies to `./cms` only — `./cms/server` has no Sanity imports and
23
- * works with no peers installed.
24
- *
25
- * Do NOT apply this pattern to a dependency reachable from a widely-imported
26
- * entry: bundlers resolve even a dynamic import at build time, so there is no
27
- * runtime fallback to hide behind. react-markdown (4.0.3; 7.0 dropped it) is
28
- * the case where exactly that made it impossible.
29
- */
30
- export { CmsPage } from './CmsPage';
31
- export { CmsSection } from './CmsSection';
32
- export { CmsPreview } from './CmsPreview';
33
- export { PortableTextRenderer } from './PortableTextRenderer';
34
- export { configureSanityImages, sanityImageUrl, sanityImageSrcSet, hotspotToObjectPosition, } from './sanity-image';
35
- export type { SanityImageConfig, ImageUrlOptions } from './sanity-image';
36
- export { HeroSection, RichTextSection, CtaSection, GallerySection, TestimonialsSection, FaqSection, FormSection, CustomSection, } from './sections';
37
- export type { CmsPageData, CmsSectionData, CmsPageSeo, CmsPageProps, CmsSectionProps, SectionRendererProps, SectionType, PortableTextRendererProps, PortableTextContent, PortableTextBlock, SanityImageRef, } from './types';
package/dist/cms/index.js DELETED
@@ -1,5 +0,0 @@
1
- export { CmsPage, CmsPreview, CmsSection, CtaSection, CustomSection, FaqSection, FormSection, GallerySection, HeroSection, PortableTextRenderer, RichTextSection, TestimonialsSection, configureSanityImages, hotspotToObjectPosition, sanityImageSrcSet, sanityImageUrl } from '../chunk-L3AQCDCY.js';
2
- import '../chunk-SWKE6FWH.js';
3
- import '../chunk-X6F6SO4S.js';
4
- import '../chunk-MH2DSGC6.js';
5
- import '../chunk-PKBMQBKP.js';
@@ -1,47 +0,0 @@
1
- import type { SanityImageRef } from './types';
2
- export interface SanityImageConfig {
3
- projectId: string;
4
- dataset: string;
5
- }
6
- /**
7
- * Initialise (or re-initialise) the image builder with project config.
8
- * Call once at app startup — e.g. at module scope in app/layout.tsx.
9
- * If never called, falls back to DEFAULT_CONFIG.
10
- */
11
- export declare function configureSanityImages(config: SanityImageConfig): void;
12
- export interface ImageUrlOptions {
13
- width?: number;
14
- height?: number;
15
- /** Device-pixel-ratio multiplier (default 1) */
16
- dpr?: number;
17
- /** Quality 0-100 (default: Sanity auto) */
18
- quality?: number;
19
- /** Force a specific format */
20
- format?: 'webp' | 'avif' | 'png' | 'jpg';
21
- /** Fit mode */
22
- fit?: 'clip' | 'crop' | 'fill' | 'fillmax' | 'max' | 'scale' | 'min';
23
- /** Apply blur (0-2000) */
24
- blur?: number;
25
- }
26
- /**
27
- * Build an optimised image URL from a SanityImageRef.
28
- * Automatically applies hotspot/crop metadata when present.
29
- *
30
- * ```ts
31
- * const url = sanityImageUrl(heroImage, { width: 1200 })
32
- * ```
33
- */
34
- export declare function sanityImageUrl(image: SanityImageRef | undefined | null, options?: ImageUrlOptions): string;
35
- /**
36
- * Generate a srcSet string for responsive images.
37
- *
38
- * ```tsx
39
- * <img srcSet={sanityImageSrcSet(img, [400, 800, 1200])} sizes="100vw" />
40
- * ```
41
- */
42
- export declare function sanityImageSrcSet(image: SanityImageRef | undefined | null, widths?: number[], options?: Omit<ImageUrlOptions, 'width'>): string;
43
- /**
44
- * Compute CSS `object-position` from a Sanity hotspot.
45
- * Returns `undefined` if no hotspot is defined.
46
- */
47
- export declare function hotspotToObjectPosition(image: SanityImageRef | undefined | null): string | undefined;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { SectionRendererProps } from '../types';
3
- export declare function CtaSection({ data, portableTextComponents }: SectionRendererProps): React.JSX.Element;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { SectionRendererProps } from '../types';
3
- /**
4
- * Custom section — passes props to a named component.
5
- * Sites must provide their own component map via sectionComponents override.
6
- */
7
- export declare function CustomSection({ data, displayName }: SectionRendererProps): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { SectionRendererProps } from '../types';
3
- export declare function FaqSection({ data, portableTextComponents }: SectionRendererProps): React.JSX.Element | null;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { SectionRendererProps } from '../types';
3
- /**
4
- * Form section — renders a heading and a placeholder for the managed form.
5
- * The actual form rendering depends on ManagedForm from the forms module.
6
- * Sites should override this section renderer to integrate with their form setup.
7
- */
8
- export declare function FormSection({ data, portableTextComponents }: SectionRendererProps): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { SectionRendererProps } from '../types';
3
- export declare function GallerySection({ data, portableTextComponents }: SectionRendererProps): React.JSX.Element | null;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { SectionRendererProps } from '../types';
3
- export declare function HeroSection({ data, portableTextComponents }: SectionRendererProps): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { SectionRendererProps } from '../types';
3
- export declare function RichTextSection({ data, portableTextComponents }: SectionRendererProps): React.JSX.Element | null;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { SectionRendererProps } from '../types';
3
- export declare function TestimonialsSection({ data, portableTextComponents }: SectionRendererProps): React.JSX.Element | null;
@@ -1,8 +0,0 @@
1
- export { HeroSection } from './HeroSection';
2
- export { RichTextSection } from './RichTextSection';
3
- export { CtaSection } from './CtaSection';
4
- export { GallerySection } from './GallerySection';
5
- export { TestimonialsSection } from './TestimonialsSection';
6
- export { FaqSection } from './FaqSection';
7
- export { FormSection } from './FormSection';
8
- export { CustomSection } from './CustomSection';
@@ -1,49 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/cms - Server-Only API Functions
3
- *
4
- * Fetches CMS page/section data from Sonor API.
5
- * Uses the same secure API pattern as seo/server-api.ts — both delegate config
6
- * resolution + fetch/retry to the shared server-fetch primitive (single source
7
- * of truth — see ../server/server-fetch).
8
- */
9
- import 'server-only';
10
- import type { CmsPageData, CmsSectionData } from './types';
11
- /**
12
- * Fetch a published CMS page by path — cached per request.
13
- * Returns the full page with all sections and their Portable Text content.
14
- * @server-only
15
- * @deprecated Since 7.1. Sonor retired the Sanity CMS and no longer serves CMS pages, so this resolves to null. Use managed copy from `@sonordev/site-kit/website/slots`. Removed in 8.0.
16
- */
17
- export declare const getCmsPage: (path: string) => Promise<CmsPageData | null>;
18
- /**
19
- * Fetch a single published CMS section by ID — cached per request.
20
- * @server-only
21
- * @deprecated Since 7.1. Sonor retired the Sanity CMS and no longer serves CMS pages, so this resolves to null. Use managed copy from `@sonordev/site-kit/website/slots`. Removed in 8.0.
22
- */
23
- export declare const getCmsSection: (sectionId: string) => Promise<CmsSectionData | null>;
24
- /**
25
- * Fetch CMS page and return Next.js Metadata object.
26
- * Use in generateMetadata() for CMS-managed pages.
27
- *
28
- * @example
29
- * ```ts
30
- * import { getCmsPageMetadata } from '@sonordev/site-kit/cms/server'
31
- *
32
- * export async function generateMetadata({ params }) {
33
- * return getCmsPageMetadata(`/${params.slug}`)
34
- * }
35
- * ```
36
- * @server-only
37
- * @deprecated Since 7.1. Sonor retired the Sanity CMS and no longer serves CMS pages, so this resolves to null. Use managed copy from `@sonordev/site-kit/website/slots`. Removed in 8.0.
38
- */
39
- export declare const getCmsPageMetadata: (path: string) => Promise<{
40
- title?: string;
41
- description?: string;
42
- robots?: {
43
- index: boolean;
44
- };
45
- openGraph?: {
46
- title?: string;
47
- description?: string;
48
- };
49
- } | null>;
@@ -1 +0,0 @@
1
- export { getCmsPage, getCmsSection, getCmsPageMetadata } from './server-api';
@@ -1,5 +0,0 @@
1
- import '../chunk-BU66S5B7.js';
2
- export { getCmsPage, getCmsPageMetadata, getCmsSection } from '../chunk-SWKE6FWH.js';
3
- import '../chunk-X6F6SO4S.js';
4
- import '../chunk-MH2DSGC6.js';
5
- import '../chunk-PKBMQBKP.js';
@@ -1,104 +0,0 @@
1
- /**
2
- * CMS Types for site-kit — mirrors Sonor API response shapes.
3
- * Portable Text is the canonical content format.
4
- */
5
- export interface PortableTextBlock {
6
- _type: string;
7
- _key: string;
8
- style?: string;
9
- listItem?: string;
10
- level?: number;
11
- children?: Array<{
12
- _type: string;
13
- _key: string;
14
- text?: string;
15
- marks?: string[];
16
- }>;
17
- markDefs?: Array<{
18
- _type: string;
19
- _key: string;
20
- [key: string]: unknown;
21
- }>;
22
- [key: string]: unknown;
23
- }
24
- export type PortableTextContent = PortableTextBlock[];
25
- export interface SanityImageRef {
26
- _type: 'image';
27
- asset: {
28
- _type: 'reference';
29
- _ref: string;
30
- };
31
- hotspot?: {
32
- x: number;
33
- y: number;
34
- height: number;
35
- width: number;
36
- };
37
- crop?: {
38
- top: number;
39
- bottom: number;
40
- left: number;
41
- right: number;
42
- };
43
- alt?: string;
44
- }
45
- export type SectionType = 'hero' | 'richText' | 'cta' | 'gallery' | 'testimonials' | 'faq' | 'form' | 'custom';
46
- export interface CmsSectionData {
47
- _id: string;
48
- sectionType: SectionType;
49
- displayName: string;
50
- data: Record<string, unknown>;
51
- }
52
- export interface CmsPageSeo {
53
- title?: string;
54
- description?: string;
55
- ogImage?: SanityImageRef;
56
- noindex?: boolean;
57
- }
58
- export interface CmsPageData {
59
- _id: string;
60
- path: string;
61
- title: string;
62
- status: string;
63
- seo?: CmsPageSeo;
64
- sections: CmsSectionData[];
65
- metadata?: {
66
- createdBy?: string;
67
- lastEditedBy?: string;
68
- publishedAt?: string;
69
- };
70
- }
71
- export interface CmsPageProps {
72
- /** Page path to fetch (e.g., '/about') */
73
- path: string;
74
- /** Override default section renderers by type */
75
- sectionComponents?: Partial<Record<SectionType, React.ComponentType<SectionRendererProps>>>;
76
- /** Override Portable Text components */
77
- portableTextComponents?: Record<string, React.ComponentType<any>>;
78
- /** Fallback if page not found */
79
- fallback?: React.ReactNode;
80
- /** Wrapper className */
81
- className?: string;
82
- }
83
- export interface CmsSectionProps {
84
- section: CmsSectionData;
85
- /** Override default section renderers by type */
86
- sectionComponents?: Partial<Record<SectionType, React.ComponentType<SectionRendererProps>>>;
87
- /** Override Portable Text components */
88
- portableTextComponents?: Record<string, React.ComponentType<any>>;
89
- }
90
- export interface SectionRendererProps {
91
- data: Record<string, unknown>;
92
- sectionType: SectionType;
93
- displayName: string;
94
- /** Portable Text components override */
95
- portableTextComponents?: Record<string, React.ComponentType<any>>;
96
- }
97
- export interface PortableTextRendererProps {
98
- /** Portable Text blocks to render */
99
- value: PortableTextContent;
100
- /** Override default components */
101
- components?: Record<string, React.ComponentType<any>>;
102
- /** Wrapper className */
103
- className?: string;
104
- }
@@ -1,43 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - CalendarView
3
- *
4
- * Monthly calendar view for displaying events.
5
- */
6
- import React from 'react';
7
- import type { CommerceOffering, CommerceSchedule } from './types';
8
- export interface CalendarViewProps {
9
- /** Pre-loaded events (optional - will fetch if not provided) */
10
- events?: CommerceOffering[];
11
- /** Initial month to display (defaults to current) */
12
- initialDate?: Date;
13
- /** Category filter */
14
- category?: string;
15
- /** Callback when event is clicked */
16
- onEventClick?: (event: CommerceOffering, schedule: CommerceSchedule) => void;
17
- /** Callback when day is clicked */
18
- onDayClick?: (date: Date, events: EventOnDay[]) => void;
19
- /** Show navigation arrows */
20
- showNavigation?: boolean;
21
- /** Show month/year header */
22
- showHeader?: boolean;
23
- /** First day of week (0 = Sunday, 1 = Monday) */
24
- weekStartsOn?: 0 | 1;
25
- /** Minimum date to show */
26
- minDate?: Date;
27
- /** Maximum date to show */
28
- maxDate?: Date;
29
- /** How to display events in cells: 'title' = text, 'image' = thumbnail with details on hover */
30
- eventDisplay?: 'title' | 'image';
31
- /** Custom class names */
32
- className?: string;
33
- headerClassName?: string;
34
- dayClassName?: string;
35
- eventClassName?: string;
36
- todayClassName?: string;
37
- }
38
- export interface EventOnDay {
39
- event: CommerceOffering;
40
- schedule: CommerceSchedule;
41
- }
42
- export declare function CalendarView({ events: propEvents, initialDate, category, onEventClick, onDayClick, showNavigation, showHeader, weekStartsOn, minDate, maxDate, eventDisplay, className, headerClassName, dayClassName, eventClassName, todayClassName, }: CalendarViewProps): React.JSX.Element;
43
- export default CalendarView;
@@ -1,11 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - CheckoutForm
3
- *
4
- * Checkout/registration form for purchasing products or registering for events.
5
- * Supports shipping flow when shipping_enabled and product type.
6
- */
7
- import React from 'react';
8
- import type { CheckoutFormProps } from './types';
9
- export declare function CheckoutForm({ offering, scheduleId, variantId, quantity: initialQuantity, mode, // 'checkout' | 'register'
10
- showQuantity, submitText, onSuccess, onError, className, formClassName, inputClassName, buttonClassName, }: CheckoutFormProps): React.JSX.Element;
11
- export default CheckoutForm;
@@ -1,26 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - EventCalendar
3
- *
4
- * Calendar view with built-in registration modal.
5
- * Clicking an event opens a popup for registration/checkout.
6
- */
7
- import React from 'react';
8
- import type { CheckoutResult } from './types';
9
- import type { CalendarViewProps } from './CalendarView';
10
- import type { AdditionalField } from './EventModal';
11
- export interface EventCalendarProps extends Omit<CalendarViewProps, 'onEventClick'> {
12
- /** Callback when registration/checkout succeeds */
13
- onRegistrationSuccess?: (result: CheckoutResult) => void;
14
- /** Callback when registration/checkout fails */
15
- onRegistrationError?: (error: string) => void;
16
- /** Collect phone number in registration form */
17
- collectPhone?: boolean;
18
- /** Additional form fields for registration */
19
- additionalFields?: AdditionalField[];
20
- /** Custom modal class names */
21
- modalClassName?: string;
22
- modalOverlayClassName?: string;
23
- modalContentClassName?: string;
24
- }
25
- export declare function EventCalendar({ onRegistrationSuccess, onRegistrationError, collectPhone, additionalFields, modalClassName, modalOverlayClassName, modalContentClassName, ...calendarProps }: EventCalendarProps): React.JSX.Element;
26
- export default EventCalendar;
@@ -1,42 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - EventCheckout
3
- *
4
- * Multi-variant inline event checkout. Renders a tier selector (one row per variant
5
- * with qty controls), customer info, and a Square card element. Submits a single
6
- * lineItems[] payload to Sonor multi-line checkout endpoint — one charge for
7
- * the aggregate total, no redirect.
8
- *
9
- * v1: Square inline only. For single-tier events without variants, the component
10
- * gracefully falls back to a single "ticket" row using the offering's base price.
11
- */
12
- import React from 'react';
13
- import type { CommerceOffering, CommerceSchedule, CheckoutResult } from './types';
14
- export interface EventCheckoutProps {
15
- /** Event offering — must include `variants` (multi-tier) or have a base price (single-tier). */
16
- event: CommerceOffering;
17
- /** Specific schedule to book. Defaults to first upcoming schedule on the event. */
18
- schedule?: CommerceSchedule;
19
- /** Collect a phone number (defaults to true; tickets often need contact). */
20
- collectPhone?: boolean;
21
- /** Maximum quantity per individual variant row (default 10). */
22
- maxPerVariant?: number;
23
- /**
24
- * Seed per-variant quantities on mount, keyed by variant id — lets a tier
25
- * card or deep link open checkout with that tier already selected. Values
26
- * clamp to [0, maxPerVariant]; unknown ids are ignored. Multi-tier events
27
- * only (single-ticket events already start at 1). Initial state only: to
28
- * re-seed an already-mounted checkout, remount it (e.g. `key={variantId}`).
29
- */
30
- initialQuantities?: Record<string, number>;
31
- /** Card label override (e.g. "Card details" vs "Payment"). */
32
- cardLabel?: string;
33
- /** Submit button text override. Falls back to "Buy {total}". */
34
- submitText?: string;
35
- /** Success callback after a successful charge. */
36
- onSuccess?: (result: CheckoutResult) => void;
37
- /** Error callback. */
38
- onError?: (error: string) => void;
39
- className?: string;
40
- }
41
- export declare function EventCheckout({ event, schedule: propSchedule, collectPhone, maxPerVariant, initialQuantities, cardLabel, submitText, onSuccess, onError, className, }: EventCheckoutProps): React.JSX.Element;
42
- export default EventCheckout;
@@ -1,11 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - EventEmbed
3
- *
4
- * Embeddable widget for displaying an event on a homepage or landing page.
5
- * Great for featuring the next upcoming event.
6
- */
7
- import React from 'react';
8
- import type { EventEmbedProps } from './types';
9
- export declare function EventEmbed({ event: propEvent, slug, mode, // 'specific', 'next'
10
- category, variant, showDate, showTime, showLocation, showCapacity, showPrice, showCta, ctaText, onRegister, onCtaClick, className, }: EventEmbedProps): React.JSX.Element | null;
11
- export default EventEmbed;