@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
@@ -27,7 +27,6 @@ export declare const entry: {
27
27
  readonly 'seo/server': 'src/seo/server.ts';
28
28
  readonly 'seo/register-sitemap-cli': 'src/seo/register-sitemap-cli.ts';
29
29
  readonly 'analytics/index': 'src/analytics/index.ts';
30
- readonly 'engage/index': 'src/engage/index.ts';
31
30
  readonly 'signal/index': 'src/signal/index.ts';
32
31
  readonly 'forms/index': 'src/forms/index.ts';
33
32
  /** Pure honeypot policy contract (src/contracts, also published as @sonordev/contracts) */
@@ -43,8 +42,6 @@ export declare const entry: {
43
42
  readonly 'articles/index': 'src/articles/index.ts';
44
43
  readonly 'articles/server': 'src/articles/server-core.ts';
45
44
  readonly 'articles/server-ui': 'src/articles/server-ui.ts';
46
- readonly 'commerce/index': 'src/commerce/index.ts';
47
- readonly 'commerce/server': 'src/commerce/server.ts';
48
45
  readonly 'admin-auth/index': 'src/admin-auth/index.ts';
49
46
  readonly 'sync/index': 'src/sync/index.ts';
50
47
  readonly 'sitemap/index': 'src/sitemap/index.ts';
@@ -90,7 +87,7 @@ export declare const entry: {
90
87
  * component as its own client entry makes it reachable from two entries,
91
88
  * so esbuild puts it in a shared chunk, which the build stamps. In 6.x
92
89
  * the root entry re-exported these two and hid the problem; 7.0's
93
- * types-only root exposed it (BookingWidget on /tour, a QCR build).
90
+ * types-only root exposed it (BookingWidget on a tour page of a production build).
94
91
  * tsup.config.ts fails the build if any other entry is caught this way.
95
92
  */
96
93
  readonly '_client/booking-widget': 'src/sync/BookingWidget.tsx';
@@ -110,8 +107,6 @@ export declare const entry: {
110
107
  readonly 'website/images/server': 'src/website/images-server.ts';
111
108
  readonly 'website/slots': 'src/website/slots.ts';
112
109
  readonly 'website/slots/contract': 'src/website/slots-contract.ts';
113
- readonly 'website/cms': 'src/website/cms.ts';
114
- readonly 'website/cms/server': 'src/website/cms-server.ts';
115
110
  readonly 'website/landing': 'src/website/landing.ts';
116
111
  readonly 'website/landing/server': 'src/website/landing-server.ts';
117
112
  readonly 'website/cta-bar': 'src/website/cta-bar.ts';
@@ -152,11 +147,17 @@ export declare const entry: {
152
147
  readonly 'landing/server': 'src/landing/server.ts';
153
148
  readonly 'layout/client': 'src/layout/SiteKitClientProviders.tsx';
154
149
  readonly 'client/index': 'src/client/index.ts';
150
+ /**
151
+ * The browser transport and API-config reader, for packages that build on
152
+ * site-kit (@sonordev/commerce-kit): sonorFetch, getClientApiConfig. NOT
153
+ * stamped 'use client' — it's imported from server and client code alike —
154
+ * so it is listed in ISOMORPHIC_ENTRIES below, and the build fails if it
155
+ * ever reaches a stamped chunk.
156
+ */
157
+ readonly 'runtime/index': 'src/runtime/index.ts';
155
158
  readonly 'proxy/index': 'src/proxy/index.ts';
156
159
  readonly 'manifest/index': 'src/manifest/index.ts';
157
160
  readonly 'config/index': 'src/config/index.ts';
158
- readonly 'cms/index': 'src/cms/index.ts';
159
- readonly 'cms/server': 'src/cms/server.ts';
160
161
  readonly 'maps/index': 'src/maps/index.ts';
161
162
  /** Tier 0: zero-dep Reveal / Parallax / ScrollScene on the scroll engine */
162
163
  readonly 'motion/index': 'src/motion/index.ts';
@@ -182,7 +183,18 @@ export declare const entry: {
182
183
  * `server-only` module. Add new client entries HERE — that keeps the stamp and
183
184
  * the guard reading the same list.
184
185
  */
185
- export declare const CLIENT_ENTRIES: readonly ["_client/booking-widget", "_client/testimonial-section", "forms/index", "affiliates/index", "analytics/index", "seo/client", "engage/index", "signal/index", "commerce/index", "layout/client", "client/index", "fleet/index", "website/index", "website/popups", "chat/index", "articles/index", "maps/index", "mcp/client", "motion/index", "motion/gsap", "motion/three", "cta-bar/client"];
186
+ export declare const CLIENT_ENTRIES: readonly ["_client/booking-widget", "_client/testimonial-section", "forms/index", "affiliates/index", "analytics/index", "seo/client", "signal/index", "layout/client", "client/index", "fleet/index", "website/index", "website/popups", "chat/index", "articles/index", "maps/index", "mcp/client", "motion/index", "motion/gsap", "motion/three", "cta-bar/client"];
187
+ /**
188
+ * Entries that must run anywhere: imported by server components, route
189
+ * handlers and client components alike. So they are never stamped 'use client'
190
+ * (a function exported from a stamped module is a client reference on the
191
+ * server, and can't be called there), they import neither React nor Next nor
192
+ * `server-only`, and nothing they load eagerly may be a stamped chunk.
193
+ *
194
+ * `./client-entry-boundary.test.ts` checks the source graph and
195
+ * `tsup.config.ts` checks the built files, both from this list.
196
+ */
197
+ export declare const ISOMORPHIC_ENTRIES: readonly ["runtime/index"];
186
198
  /**
187
199
  * CLI binaries are consumed via `bin`/`npx`, never imported as typed modules, so they
188
200
  * don't ship `.d.ts`. Everything else in `entry` gets declarations.
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Where browser code finds Sonor: the API origin and the site credential
3
+ * SiteKitLayout publishes on window (`__SITE_KIT_API_URL__`,
4
+ * `__SITE_KIT_API_KEY__`, the latter usually a short-lived site token; see
5
+ * publishCredential.ts and siteToken.ts, the only writers).
6
+ *
7
+ * SINGLE SOURCE OF TRUTH for reading them. Every client module goes through
8
+ * one of the two functions below; don't read the globals anywhere else.
9
+ *
10
+ * readPublishedApiConfig() exactly what the layout published, no
11
+ * fallbacks. For code that must stay silent on a
12
+ * page without SiteKitLayout (form tracking,
13
+ * article views, the analytics gate).
14
+ * getClientApiConfig() the same with fallbacks: the default API origin
15
+ * (or the server's SONOR_API_URL during SSR), and,
16
+ * only when asked, the server's SONOR_API_KEY
17
+ * during SSR.
18
+ *
19
+ * Never read a NEXT_PUBLIC_*KEY here: Next inlines NEXT_PUBLIC_ values into
20
+ * every bundle a module reaches (see client-entry-boundary.test.ts).
21
+ */
22
+ export declare const DEFAULT_SONOR_API_URL = "https://api.sonor.io";
23
+ /** The globals SiteKitLayout sets on window. */
24
+ export interface SiteKitWindowGlobals {
25
+ __SITE_KIT_API_URL__?: string;
26
+ __SITE_KIT_API_KEY__?: string;
27
+ __SITE_KIT_SITE__?: string;
28
+ __SITE_KIT_SIGNAL_URL__?: string;
29
+ }
30
+ /**
31
+ * What SiteKitLayout published on this page, as is: either value is
32
+ * undefined when it wasn't published, and both are on the server.
33
+ */
34
+ export declare function readPublishedApiConfig(): {
35
+ apiUrl?: string;
36
+ apiKey?: string;
37
+ };
38
+ export interface ClientApiConfigOptions {
39
+ /**
40
+ * During server rendering, use the server's SONOR_API_KEY. For modules
41
+ * whose fetchers also run on the server (maps, reputation, llms). It's
42
+ * never inlined into a browser bundle: it isn't a NEXT_PUBLIC_ value.
43
+ */
44
+ serverKey?: boolean;
45
+ }
46
+ /**
47
+ * The API origin and credential with fallbacks. In the browser: the
48
+ * published origin (else api.sonor.io) and the published credential. On the
49
+ * server: SONOR_API_URL / NEXT_PUBLIC_SONOR_API_URL (else api.sonor.io), so
50
+ * SSR-rendered absolute URLs follow a staging override, and no credential
51
+ * unless `serverKey` asks for it.
52
+ */
53
+ export declare function getClientApiConfig(options?: ClientApiConfigOptions): {
54
+ apiUrl: string;
55
+ apiKey: string | undefined;
56
+ };
@@ -2,9 +2,9 @@
2
2
  * @sonordev/site-kit shared - Fetch outside Next's Data Cache
3
3
  *
4
4
  * Single source of truth for requests that must not touch Next's Data Cache
5
- * and must not change how the calling route renders. Used by the build-time
6
- * writers (public/llms.txt, the sitemap's Sonor reads) and the site credential
7
- * mint (server/mint-site-token.ts). Don't re-fork this into a module.
5
+ * and must not change how the calling route renders. Used by build-time
6
+ * writers and the site credential mint. The mint uses trackedFreshFetch so
7
+ * Cache Components can await it without an uncached prerender bailout.
8
8
  *
9
9
  * Next.js monkey-patches `globalThis.fetch` so every call joins its Data Cache
10
10
  * and static-generation tracking. That's wrong for these requests, and the
@@ -38,6 +38,12 @@ export declare function resolveFetch(): {
38
38
  unpatched: boolean;
39
39
  };
40
40
  export declare const FRESH_FETCH_NONCE_HEADER = "x-sitekit-build-nonce";
41
+ /**
42
+ * A fresh request that Next can await during a Cache Components prerender.
43
+ * A unique cache key per request prevents reuse after a credential expires or
44
+ * across deploys. The caller owns memoization and concurrent-request deduping.
45
+ */
46
+ export declare function trackedFreshFetch(input: string | URL, init?: RequestInit): Promise<Response>;
41
47
  /**
42
48
  * Fetch that never reads a response cached by an earlier build.
43
49
  *
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @sonordev/site-kit/shared — the read-only reader of the analytics identity.
3
+ *
4
+ * Forms, popups and `@sonordev/commerce-kit` (through `./runtime`) attach the
5
+ * visitor's ids to what they send, so Sonor can tie a lead or a sale to the
6
+ * visit; minting an id there would tie it to a visit analytics never saw.
7
+ * Creating the ids is identity.tsx's job; where they live is
8
+ * identity-storage.ts.
9
+ *
10
+ * React-free and not `'use client'`: the `./runtime` entry re-exports it, and
11
+ * that entry must stay isomorphic.
12
+ */
13
+ /** The visitor's current analytics ids. Each is null when there isn't one. */
14
+ export interface AnalyticsIdentity {
15
+ sessionId: string | null;
16
+ visitorId: string | null;
17
+ }
18
+ /**
19
+ * Read the visitor's analytics ids without creating them, so what a form,
20
+ * popup or checkout sends ties to the visit analytics recorded (and never to
21
+ * a fresh id analytics didn't see). Both are null during server rendering
22
+ * and before analytics has started a session in this tab. When the browser
23
+ * blocks storage, these are the in-memory ids analytics is using for this
24
+ * page load. Never throws.
25
+ */
26
+ export declare function readAnalyticsIdentity(): AnalyticsIdentity;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @sonordev/site-kit/shared — where the analytics identity is kept.
3
+ *
4
+ * Single source of truth for the `_sk_*` storage keys and for the in-memory
5
+ * fallback the writer (identity.tsx) and the reader (identity-reader.ts)
6
+ * share:
7
+ *
8
+ * localStorage: _sk_vid (visitor ID, kept across visits)
9
+ * sessionStorage: _sk_sid (session ID, per tab)
10
+ * sessionStorage: _sk_stime (last activity, for the inactivity timeout)
11
+ *
12
+ * Kept this small on purpose: analytics loads on every page of every site,
13
+ * and it shares this module with the forms, popups and runtime bundles. What
14
+ * only they use, the reader, lives in its own module so analytics doesn't
15
+ * download it.
16
+ */
17
+ /** localStorage: the visitor id, kept across visits. */
18
+ export declare const VISITOR_ID_KEY = "_sk_vid";
19
+ /** sessionStorage: the session id, per tab. */
20
+ export declare const SESSION_ID_KEY = "_sk_sid";
21
+ /** sessionStorage: last activity, for the session's inactivity timeout. */
22
+ export declare const SESSION_TIME_KEY = "_sk_stime";
23
+ /**
24
+ * The ids for this page load when storage can't hold them (privacy settings,
25
+ * a sandboxed frame). Written only by get-or-create in identity.tsx.
26
+ */
27
+ export declare const memoryIdentity: {
28
+ visitorId: string;
29
+ sessionId: string;
30
+ };
@@ -1,25 +1,25 @@
1
1
  /**
2
2
  * @sonordev/site-kit/shared — Unified Identity Management
3
3
  *
4
- * Single source of truth for visitor and session IDs across
5
- * Analytics, Signal, chat and popups.
4
+ * Creates the visitor and session ids that Analytics, Signal, chat and popups
5
+ * share, and the hook that reads them. The storage keys and the in-memory
6
+ * fallback live in identity-storage.ts (the single source of truth for where
7
+ * the ids are kept); the read-only reader is identity-reader.ts.
6
8
  *
7
- * Storage keys:
8
- * localStorage: _sk_vid (visitor ID, persists ~forever)
9
- * sessionStorage: _sk_sid (session ID, per-tab)
10
- * sessionStorage: _sk_stime (last activity timestamp for timeout)
11
- *
12
- * Storage keys are prefixed with `_sk_*`.
9
+ * When the browser blocks storage (privacy settings, a sandboxed frame), the
10
+ * ids live in memory for this page load instead. That matters because these
11
+ * functions run DURING RENDER (SiteKitClientProviders), where a throw takes
12
+ * the whole page down; same reason shared/uuid.ts never throws.
13
13
  */
14
14
  /**
15
- * Get or create a persistent visitor ID.
16
- * Stored in localStorage under `_sk_vid`.
15
+ * Get or create a persistent visitor ID, stored in localStorage under
16
+ * `_sk_vid`. Never throws.
17
17
  */
18
18
  export declare function getOrCreateVisitorId(): string;
19
19
  /**
20
- * Get or create a session ID with inactivity timeout.
21
- * Stored in sessionStorage under `_sk_sid`.
22
- * Session expires after `timeoutMinutes` of inactivity (default 30).
20
+ * Get or create a session ID, stored in sessionStorage under `_sk_sid`. The
21
+ * session expires after `timeoutMinutes` of inactivity (default 30). Never
22
+ * throws.
23
23
  */
24
24
  export declare function getOrCreateSessionId(timeoutMinutes?: number): string;
25
25
  export interface SiteKitIdentity {
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The module specifiers a piece of code imports, and what an isomorphic entry
3
+ * may not import: the one definition behind both the source-level boundary
4
+ * checks (./boundary-graph.ts) and the built-chunk check
5
+ * (scripts/kit-post-build.ts), which had each grown their own copy.
6
+ *
7
+ * Test and build infrastructure: nothing ships from here (tsconfig.build.json
8
+ * leaves it out of the declarations, and no entry reaches it).
9
+ *
10
+ * Callers strip comments (and type-only imports, where erased imports don't
11
+ * count) first; a comment that names an import is not an import.
12
+ */
13
+ /**
14
+ * Every specifier `code` imports, in the order they appear, without a query or
15
+ * hash a bundler would strip (`./server?raw` is `./server`).
16
+ */
17
+ export declare function importSpecifiers(code: string): string[];
18
+ /**
19
+ * A specifier an isomorphic entry's graph must not import: React, Next or
20
+ * `server-only` (hooks, a client reference, or a hard error on the other
21
+ * side), and any site-kit entry but `./runtime`, which is isomorphic by design
22
+ * (the others are `'use client'` or server-only: `./analytics`, `./server`...).
23
+ * Matches by package name, so a subpath (`react/jsx-runtime`, `next/headers`)
24
+ * counts.
25
+ */
26
+ export declare function isNotIsomorphicSpecifier(spec: string): boolean;
@@ -2,9 +2,10 @@
2
2
  * @sonordev/site-kit shared - Canonical client transport
3
3
  *
4
4
  * Single source of truth for how site-kit talks to Sonor from the browser.
5
- * Every client-side module (analytics, forms, commerce, engage, maps, images,
6
- * SitemapSync) routes through here instead of bare fetch(), which gives the
7
- * whole kit, in one place:
5
+ * Every client-side module (analytics, forms, engage, maps, images,
6
+ * SitemapSync) routes through here instead of bare fetch(), and so do the kits
7
+ * that build on site-kit (commerce-kit), through `@sonordev/site-kit/runtime`.
8
+ * That gives the whole kit family, in one place:
8
9
  *
9
10
  * - per-attempt timeout + retry with backoff (via fetchWithRetry) — a hung
10
11
  * request left to the browser's own network timeout logs a console error
@@ -7,4 +7,4 @@
7
7
  * it matches package.json at publish time, and version.test.ts asserts it in
8
8
  * dev, so it can't silently drift.
9
9
  */
10
- export declare const SITE_KIT_VERSION = "7.3.0";
10
+ export declare const SITE_KIT_VERSION = "8.0.0";
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { useSignalExperiment, useSignalEvent } from '../chunk-CYUFBKJQ.js';
3
- export { SignalBridge, useSignal, useSignalConfig, useSignalEvent, useSignalExperiment, useSignalOutcome } from '../chunk-CYUFBKJQ.js';
2
+ import { useSignalExperiment, useSignalEvent } from '../chunk-6ZXJ3SXR.js';
3
+ export { SignalBridge, useSignal, useSignalConfig, useSignalEvent, useSignalExperiment, useSignalOutcome } from '../chunk-6ZXJ3SXR.js';
4
4
  import '../chunk-PKBMQBKP.js';
5
5
  import React, { useEffect } from 'react';
6
6
  import { jsx, Fragment } from 'react/jsx-runtime';
@@ -1,10 +1,10 @@
1
- export { createSitemap, getPortfolioPaths, syncSitemapToPortal } from '../chunk-Y6LP36UW.js';
1
+ export { createSitemap, getPortfolioPaths, syncSitemapToPortal } from '../chunk-OE3NXEOF.js';
2
+ import '../chunk-TZ5RTANX.js';
3
+ import '../chunk-JIH32RH2.js';
2
4
  import '../chunk-Z22QVHT4.js';
3
- import '../chunk-Z65DHMTW.js';
4
- import '../chunk-6U3VLV2C.js';
5
5
  import '../chunk-L5UOHS6E.js';
6
6
  import '../chunk-WMVK77ND.js';
7
- import '../chunk-VX5CMNMM.js';
7
+ import '../chunk-UAYAJPEP.js';
8
8
  import '../chunk-NZ4RXN3G.js';
9
9
  import '../chunk-MJP63SSS.js';
10
10
  import '../chunk-ZEGVKVD5.js';
@@ -12,4 +12,5 @@ import '../chunk-YVKRYQRG.js';
12
12
  import '../chunk-DIKNRN34.js';
13
13
  import '../chunk-FESKKJAS.js';
14
14
  import '../chunk-A4CC4ZG3.js';
15
+ import '../chunk-3G7YABRA.js';
15
16
  import '../chunk-PKBMQBKP.js';
@@ -1,7 +1,7 @@
1
- export { ManagedLink, ManagedList, ManagedRichText, ManagedSlot, SLOTS_CACHE_TAG, createSlotsRevalidateHandler, ManagedSlot_default as default, getSlot, renderSlotRichText, resolveSlots } from '../chunk-CGWUXUYZ.js';
1
+ export { ManagedLink, ManagedList, ManagedRichText, ManagedSlot, SLOTS_CACHE_TAG, createSlotsRevalidateHandler, ManagedSlot_default as default, getSlot, renderSlotRichText, resolveSlots } from '../chunk-3RDJKIYO.js';
2
2
  export { SLOTS_CONTRACT_VERSION, signSlotContent, slotSigningPayload, verifySlotContent } from '../chunk-VCJYLYJV.js';
3
3
  export { SLOT_CONTENT_MAX_LENGTH, SLOT_CONTENT_TYPES, SLOT_ID_PATTERN, SLOT_LIST_MAX_ITEMS, isSafeSlotHref, isValidSlotId, normalizeSlotValue, parseSlotRichText } from '../chunk-LPH5FANE.js';
4
- import '../chunk-RYVDGXC2.js';
5
- import '../chunk-X6F6SO4S.js';
4
+ import '../chunk-6KU7STM3.js';
5
+ import '../chunk-C7TLGL3R.js';
6
6
  import '../chunk-MH2DSGC6.js';
7
7
  import '../chunk-PKBMQBKP.js';
@@ -1,6 +1,7 @@
1
- export { BookingWidget } from '../chunk-L7U23XI2.js';
2
- export { createBooking, createSlotHold, detectTimezone, fetchAvailability, fetchAvailableDates, fetchBookingTypeDetails, fetchBookingTypes, formatDate, formatDuration, formatTime, prepareMeeting, releaseSlotHold } from '../chunk-2ECWEUHP.js';
3
- import '../chunk-BEBR4OJD.js';
4
- import '../chunk-WGG6GTKW.js';
5
- import '../chunk-56KNHB4U.js';
1
+ export { BookingWidget } from '../chunk-OGK7OL3T.js';
2
+ export { createBooking, createSlotHold, detectTimezone, fetchAvailability, fetchAvailableDates, fetchBookingTypeDetails, fetchBookingTypes, formatDate, formatDuration, formatTime, prepareMeeting, releaseSlotHold } from '../chunk-IJQ767JS.js';
3
+ import '../chunk-3G7YABRA.js';
4
+ import '../chunk-56VDS2RP.js';
5
+ import '../chunk-ZLFGXKLG.js';
6
+ import '../chunk-5S2XDG5O.js';
6
7
  import '../chunk-PKBMQBKP.js';
package/dist/types.d.ts CHANGED
@@ -16,6 +16,5 @@ export * from './seo/types';
16
16
  export * from './analytics/types';
17
17
  export * from './chat/types';
18
18
  export * from './website/popup-types';
19
- export type { EngageAnalytics, EngageConfig, EngageElement, TargetingRules, TriggerConfig, WidgetConfig, WidgetType } from './engage/types';
20
19
  export * from './forms/types';
21
20
  export * from './articles/types';
@@ -1,5 +1,5 @@
1
1
  export { CTA_BAR_BREAKPOINTS, CTA_BAR_SPACE, CtaBar, CtaBarAction, ECHO_CLEARANCE } from '../chunk-LNSNA3W4.js';
2
2
  import '../chunk-UPFU63L4.js';
3
- import '../chunk-LCDVPAMR.js';
4
3
  import '../chunk-JE4A5S4F.js';
4
+ import '../chunk-LCDVPAMR.js';
5
5
  import '../chunk-PKBMQBKP.js';
@@ -1,6 +1,6 @@
1
- export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-ZHS2XFLV.js';
1
+ export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-TOSZGJEQ.js';
2
2
  export { ManagedFavicon, getManagedFaviconUrl } from '../chunk-GW7GSBO7.js';
3
- import '../chunk-BEBR4OJD.js';
4
- import '../chunk-WGG6GTKW.js';
5
- import '../chunk-56KNHB4U.js';
3
+ import '../chunk-56VDS2RP.js';
4
+ import '../chunk-ZLFGXKLG.js';
5
+ import '../chunk-5S2XDG5O.js';
6
6
  import '../chunk-PKBMQBKP.js';
@@ -1,13 +1,14 @@
1
1
  'use client';
2
- export { SiteDesignReporter } from '../chunk-MRQ2U4LZ.js';
3
- export { SITE_DESIGN_PATH, cleanFontStack, colorToHex, getSiteDesignTokens, measureSiteDesign, readDeclaredDesign, sendSiteDesign } from '../chunk-I2YX3HVD.js';
2
+ export { SiteDesignReporter } from '../chunk-ZHNQFNO3.js';
3
+ export { SITE_DESIGN_PATH, cleanFontStack, colorToHex, getSiteDesignTokens, measureSiteDesign, readDeclaredDesign, sendSiteDesign } from '../chunk-KRBBH64S.js';
4
4
  export { DEFAULT_POPUP_TOKENS, PopupBlocks } from '../chunk-BF7TZYC3.js';
5
5
  import '../chunk-IHG36STL.js';
6
6
  import '../chunk-YC7ELZS3.js';
7
7
  import '../chunk-S22FSH7C.js';
8
- import '../chunk-43OCZ3JA.js';
8
+ import '../chunk-CAH4Y4PY.js';
9
9
  import '../chunk-EKBEOXTH.js';
10
- import '../chunk-BEBR4OJD.js';
11
- import '../chunk-WGG6GTKW.js';
12
- import '../chunk-56KNHB4U.js';
10
+ import '../chunk-3G7YABRA.js';
11
+ import '../chunk-56VDS2RP.js';
12
+ import '../chunk-ZLFGXKLG.js';
13
+ import '../chunk-5S2XDG5O.js';
13
14
  import '../chunk-PKBMQBKP.js';
@@ -1,14 +1,17 @@
1
1
  'use client';
2
+ export { SitePopups } from '../chunk-S7SSYGUJ.js';
3
+ import '../chunk-27FISYK4.js';
2
4
  export { DEFAULT_POPUP_TOKENS, PopupBlocks } from '../chunk-BF7TZYC3.js';
3
5
  import '../chunk-IHG36STL.js';
4
- export { SitePopups } from '../chunk-YJLS6JBI.js';
5
- import '../chunk-27FISYK4.js';
6
+ import '../chunk-5ROTTMBL.js';
6
7
  import '../chunk-S22FSH7C.js';
7
- import '../chunk-24QZEO3Q.js';
8
+ import '../chunk-ZKADJNR2.js';
9
+ import '../chunk-5TM3WPCI.js';
8
10
  import '../chunk-GJWI74ZZ.js';
9
- import '../chunk-43OCZ3JA.js';
11
+ import '../chunk-CAH4Y4PY.js';
10
12
  import '../chunk-EKBEOXTH.js';
11
- import '../chunk-BEBR4OJD.js';
12
- import '../chunk-WGG6GTKW.js';
13
- import '../chunk-56KNHB4U.js';
13
+ import '../chunk-3G7YABRA.js';
14
+ import '../chunk-56VDS2RP.js';
15
+ import '../chunk-ZLFGXKLG.js';
16
+ import '../chunk-5S2XDG5O.js';
14
17
  import '../chunk-PKBMQBKP.js';
@@ -1,7 +1,7 @@
1
- export { ManagedLink, ManagedList, ManagedRichText, ManagedSlot, SLOTS_CACHE_TAG, createSlotsRevalidateHandler, ManagedSlot_default as default, getSlot, renderSlotRichText, resolveSlots } from '../chunk-CGWUXUYZ.js';
1
+ export { ManagedLink, ManagedList, ManagedRichText, ManagedSlot, SLOTS_CACHE_TAG, createSlotsRevalidateHandler, ManagedSlot_default as default, getSlot, renderSlotRichText, resolveSlots } from '../chunk-3RDJKIYO.js';
2
2
  export { SLOTS_CONTRACT_VERSION, signSlotContent, slotSigningPayload, verifySlotContent } from '../chunk-VCJYLYJV.js';
3
3
  export { SLOT_CONTENT_MAX_LENGTH, SLOT_CONTENT_TYPES, SLOT_ID_PATTERN, SLOT_LIST_MAX_ITEMS, isSafeSlotHref, isValidSlotId, normalizeSlotValue, parseSlotRichText } from '../chunk-LPH5FANE.js';
4
- import '../chunk-RYVDGXC2.js';
5
- import '../chunk-X6F6SO4S.js';
4
+ import '../chunk-6KU7STM3.js';
5
+ import '../chunk-C7TLGL3R.js';
6
6
  import '../chunk-MH2DSGC6.js';
7
7
  import '../chunk-PKBMQBKP.js';
@@ -1,11 +1,12 @@
1
- export { writeLLMsTxtToPublic } from './chunk-Z65DHMTW.js';
2
- import './chunk-6U3VLV2C.js';
1
+ export { writeLLMsTxtToPublic } from './chunk-TZ5RTANX.js';
2
+ import './chunk-JIH32RH2.js';
3
3
  import './chunk-L5UOHS6E.js';
4
4
  import './chunk-WMVK77ND.js';
5
- import './chunk-VX5CMNMM.js';
5
+ import './chunk-UAYAJPEP.js';
6
6
  import './chunk-NZ4RXN3G.js';
7
7
  import './chunk-MJP63SSS.js';
8
8
  import './chunk-YVKRYQRG.js';
9
9
  import './chunk-FESKKJAS.js';
10
10
  import './chunk-A4CC4ZG3.js';
11
+ import './chunk-3G7YABRA.js';
11
12
  import './chunk-PKBMQBKP.js';
@@ -1,5 +1,7 @@
1
1
  # Moving a site to site-kit 7
2
2
 
3
+ > This guide covers the move from 6 to 7 and is kept as it was. Moving from 7 to 8 is a separate, shorter guide: [Migrating to 8](MIGRATING-TO-8.md). Two things have changed since this page was written. Commerce now lives in [`@sonordev/commerce-kit`](https://sonor.dev/commerce-kit), so the commerce row below names a path that moved in 8.0. And where this page says old paths are removed in 8.0, the [8.0.0 changelog entry](../CHANGELOG.md) says what that release actually removed: the retired Engage and CMS entries, but not the aliases for renamed modules, which are still there.
4
+
3
5
  site-kit 7 is organised the way Sonor's dashboard is: one entry per module.
4
6
  Most sites need no changes at all. Move a site when you next touch it;
5
7
  nothing forces it before then, because a
@@ -78,7 +80,8 @@ New homes, each the same module as before:
78
80
  - Website chat: `./chat`, and popups: `./website/popups` (both out of
79
81
  `./engage`, which Sonor retired with the Engage module)
80
82
 
81
- **The old paths keep working through 7.x** and are removed in 8.0. The
83
+ **The old paths keep working through 7.x** (and in 8, except `./engage`, which was
84
+ removed with the retired Engage module). The
82
85
  codemod moves them anyway, so a touched site is done in one pass: chat
83
86
  imports go to `./chat`, popup types to `./website/popups` under their new
84
87
  names (`EngageElement` is `SitePopup`). It flags `EngageWidget`, which draws
@@ -128,7 +131,7 @@ just this part.
128
131
  type (not `withSiteKitConfig`, which stays).
129
132
  - Source maps. The package no longer ships `.map` files (7.3 of 6.x's 11 MB).
130
133
 
131
- Still accepted and ignored until 8.0, because sites pass them:
134
+ Still accepted and ignored (in 8 too), because sites pass them:
132
135
  `contentSignals` on `createRobotsTxtHandler`, `nativeReturnTo` on forms, and
133
136
  `<ManagedScripts />`.
134
137