@sonordev/site-kit 7.4.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 (227) hide show
  1. package/AGENTS.md +40 -12
  2. package/CHANGELOG.md +67 -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-3DH53RSB.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
  7. package/dist/{BlocksPopup-FGWYVHCH.js → BlocksPopup-GFX3GZIK.js} +6 -5
  8. package/dist/{ChatWidget-CDQZCLVH.js → ChatWidget-DVS7MLBN.js} +8 -5
  9. package/dist/{FileField-IPJ7L2W6.js → FileField-DVN7NUBI.js} +5 -5
  10. package/dist/{FormSpotlight-CQI2DBWI.js → FormSpotlight-W4SXKKO6.js} +3 -3
  11. package/dist/{FormStage-4WHD6ED4.js → FormStage-JTEE5MZD.js} +3 -3
  12. package/dist/ManagedForm-ZAUHIHGP.js +19 -0
  13. package/dist/{ManagedNewsletterForm-3D2BK3KQ.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
  14. package/dist/{SignalCore-HEQYITTM.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.js +3 -2
  21. package/dist/affiliates/index.js +6 -6
  22. package/dist/analytics/index.js +73 -7
  23. package/dist/articles/index.js +2 -2
  24. package/dist/articles/server-ui.js +3 -3
  25. package/dist/articles/server.js +2 -2
  26. package/dist/brand.css +1 -1
  27. package/dist/chat/index.d.ts +1 -1
  28. package/dist/chat/index.js +39 -8
  29. package/dist/chunk-3G7YABRA.js +25 -0
  30. package/dist/{chunk-CGWUXUYZ.js → chunk-3RDJKIYO.js} +2 -2
  31. package/dist/{chunk-J4FSB4OG.js → chunk-3YKQLC7J.js} +5 -2
  32. package/dist/{chunk-3E3PPSNR.js → chunk-56VDS2RP.js} +2 -2
  33. package/dist/chunk-5ROTTMBL.js +19 -0
  34. package/dist/{chunk-KHQ5GD6T.js → chunk-5S2XDG5O.js} +1 -1
  35. package/dist/chunk-5TM3WPCI.js +7 -0
  36. package/dist/{chunk-7HPZSWS4.js → chunk-6CJGZFOU.js} +1 -1
  37. package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
  38. package/dist/{chunk-FUQTV5O6.js → chunk-6QFINXLH.js} +3 -3
  39. package/dist/{chunk-AH4AXO4P.js → chunk-6ZXJ3SXR.js} +1 -1
  40. package/dist/{chunk-XA2BNW5M.js → chunk-7YEEOIWI.js} +1 -1
  41. package/dist/{chunk-IE5SSOCN.js → chunk-BQ2CXKTQ.js} +3 -11
  42. package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
  43. package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
  44. package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
  45. package/dist/{chunk-OOD6GMT4.js → chunk-GNSXOTIK.js} +6 -4
  46. package/dist/{chunk-EHR4NIMX.js → chunk-ICAVVF6D.js} +3 -3
  47. package/dist/{chunk-MHGAZ3LL.js → chunk-IJQ767JS.js} +3 -5
  48. package/dist/{chunk-CKW4HFJG.js → chunk-J65N34YM.js} +3 -3
  49. package/dist/{chunk-4BHRA7TI.js → chunk-JIH32RH2.js} +3 -3
  50. package/dist/{chunk-D2RGEWHS.js → chunk-K22OLAPC.js} +2 -2
  51. package/dist/{chunk-CG4ETW5Y.js → chunk-KRBBH64S.js} +3 -3
  52. package/dist/{chunk-JRCNUUNG.js → chunk-LBIQ5LTC.js} +1 -1
  53. package/dist/{chunk-MDP7EB4J.js → chunk-LKH44GI3.js} +5 -5
  54. package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
  55. package/dist/{chunk-5O62CER4.js → chunk-M62U7TJF.js} +1 -1
  56. package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
  57. package/dist/{chunk-4DJMJ4V5.js → chunk-OE3NXEOF.js} +1 -1
  58. package/dist/{chunk-AV4QAK5F.js → chunk-OGK7OL3T.js} +5 -4
  59. package/dist/{chunk-YCFW2OQO.js → chunk-PD7K54EQ.js} +2 -2
  60. package/dist/{chunk-PF64OEXC.js → chunk-PIX7FAMX.js} +2 -2
  61. package/dist/{chunk-XEMHGJEG.js → chunk-ROAOI6GG.js} +10 -10
  62. package/dist/{chunk-6LLTLLEJ.js → chunk-S7SSYGUJ.js} +6 -5
  63. package/dist/{chunk-ATE6IFVK.js → chunk-SBPAXWLF.js} +1 -1
  64. package/dist/{chunk-DA5XC7Y6.js → chunk-TOSZGJEQ.js} +1 -1
  65. package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
  66. package/dist/{chunk-ZTLU3BSW.js → chunk-TZ5RTANX.js} +2 -2
  67. package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
  68. package/dist/{chunk-CSN45MHO.js → chunk-UUWUAMUC.js} +13 -16
  69. package/dist/{chunk-PKGN32AU.js → chunk-XPTJRVL2.js} +1 -1
  70. package/dist/{chunk-662ILEZ6.js → chunk-Y35BWW2C.js} +3 -7
  71. package/dist/{chunk-PQDJNIHR.js → chunk-ZHNQFNO3.js} +2 -2
  72. package/dist/chunk-ZKADJNR2.js +52 -0
  73. package/dist/{chunk-GK7TV7EK.js → chunk-ZLFGXKLG.js} +1 -1
  74. package/dist/client/index.js +6 -5
  75. package/dist/contracts/entries.d.ts +1 -1
  76. package/dist/contracts/sentences.d.ts +46 -0
  77. package/dist/contracts/site-cache.d.ts +2 -0
  78. package/dist/cta-bar/index.js +1 -1
  79. package/dist/fleet/index.js +6 -5
  80. package/dist/forms/field-autocomplete.d.ts +16 -8
  81. package/dist/forms/index.d.ts +5 -0
  82. package/dist/forms/index.js +17 -17
  83. package/dist/forms/server.js +7 -7
  84. package/dist/forms/static.js +2 -2
  85. package/dist/forms/submitForm.d.ts +5 -0
  86. package/dist/images/index.js +4 -4
  87. package/dist/index.d.ts +3 -7
  88. package/dist/index.js +1 -1
  89. package/dist/layout/SiteKitLayout.d.ts +2 -1
  90. package/dist/layout/client.js +11 -9
  91. package/dist/layout/index.js +13 -11
  92. package/dist/llms/index.js +7 -6
  93. package/dist/maps/index.js +6 -6
  94. package/dist/mcp/sonor.d.ts +47 -3
  95. package/dist/mcp/sonor.js +30 -20
  96. package/dist/proxy/index.d.ts +3 -3
  97. package/dist/proxy/index.js +1 -1
  98. package/dist/reputation/index.js +3 -2
  99. package/dist/reputation/server.js +2 -1
  100. package/dist/revalidate/index.js +3 -3
  101. package/dist/robots/indexnow.js +2 -2
  102. package/dist/runtime/index.d.ts +32 -0
  103. package/dist/runtime/index.js +7 -0
  104. package/dist/seo/api.d.ts +0 -4
  105. package/dist/seo/client.js +6 -5
  106. package/dist/seo/getManagedMetadata.d.ts +24 -0
  107. package/dist/seo/index.d.ts +2 -3
  108. package/dist/seo/index.js +14 -132
  109. package/dist/seo/indexnow.js +2 -2
  110. package/dist/seo/llms.js +7 -6
  111. package/dist/seo/register-sitemap-cli.js +2 -2
  112. package/dist/seo/server-api.d.ts +0 -6
  113. package/dist/seo/server.d.ts +1 -1
  114. package/dist/seo/server.js +4 -4
  115. package/dist/seo/sitemap.js +4 -3
  116. package/dist/seo/types.d.ts +9 -30
  117. package/dist/server/index.d.ts +8 -1
  118. package/dist/server/index.js +4 -3
  119. package/dist/server/mint-site-token.d.ts +0 -11
  120. package/dist/server/server-fetch.d.ts +19 -0
  121. package/dist/server-api-EGOKC7Q3.js +9 -0
  122. package/dist/shared/build-entries.d.ts +21 -9
  123. package/dist/shared/clientApiConfig.d.ts +56 -0
  124. package/dist/shared/identity-reader.d.ts +26 -0
  125. package/dist/shared/identity-storage.d.ts +30 -0
  126. package/dist/shared/identity.d.ts +13 -13
  127. package/dist/shared/import-specifiers.d.ts +26 -0
  128. package/dist/shared/sonorFetch.d.ts +4 -3
  129. package/dist/shared/version.d.ts +1 -1
  130. package/dist/signal/index.js +2 -2
  131. package/dist/sitemap/index.js +4 -3
  132. package/dist/slots/index.js +3 -3
  133. package/dist/sync/index.js +6 -5
  134. package/dist/types.d.ts +0 -1
  135. package/dist/website/cta-bar.js +1 -1
  136. package/dist/website/images.js +4 -4
  137. package/dist/website/index.js +7 -6
  138. package/dist/website/popups.js +10 -7
  139. package/dist/website/slots.js +3 -3
  140. package/dist/{writeLLMsTxt-OL4KQERZ.js → writeLLMsTxt-UZGN6IBU.js} +3 -2
  141. package/docs/MIGRATING-TO-7.md +5 -2
  142. package/docs/MIGRATING-TO-8.md +183 -0
  143. package/docs.json +4 -8
  144. package/package.json +15 -44
  145. package/skills/site-kit/SKILL.md +41 -11
  146. package/src/analytics/README.md +14 -14
  147. package/src/chat/README.md +7 -7
  148. package/src/forms/README.md +61 -6
  149. package/src/mcp/README.md +61 -20
  150. package/src/proxy/README.md +5 -4
  151. package/src/revalidate/README.md +2 -2
  152. package/src/runtime/README.md +51 -0
  153. package/src/seo/README.md +24 -8
  154. package/src/sync/README.md +2 -2
  155. package/src/website/README.md +3 -2
  156. package/dist/AnalyticsProvider-BQXV3ZF3.js +0 -11
  157. package/dist/ManagedForm-7FZNH4L2.js +0 -16
  158. package/dist/SiteChat-DMPDXY3W.js +0 -5
  159. package/dist/SiteDesignReporter-Y2IOJE52.js +0 -11
  160. package/dist/SitePopups-HD2LDKVU.js +0 -10
  161. package/dist/SitemapSync-OKPZHRX6.js +0 -8
  162. package/dist/chunk-24QZEO3Q.js +0 -41
  163. package/dist/chunk-BU66S5B7.js +0 -1
  164. package/dist/chunk-G3NHWMP5.js +0 -233
  165. package/dist/chunk-HODO5BX5.js +0 -28
  166. package/dist/chunk-L3AQCDCY.js +0 -386
  167. package/dist/chunk-P5GB6NEO.js +0 -66
  168. package/dist/chunk-SWKE6FWH.js +0 -47
  169. package/dist/cms/CmsPage.d.ts +0 -17
  170. package/dist/cms/CmsPreview.d.ts +0 -37
  171. package/dist/cms/CmsSection.d.ts +0 -8
  172. package/dist/cms/PortableTextRenderer.d.ts +0 -7
  173. package/dist/cms/index.d.ts +0 -37
  174. package/dist/cms/index.js +0 -5
  175. package/dist/cms/sanity-image.d.ts +0 -47
  176. package/dist/cms/sections/CtaSection.d.ts +0 -3
  177. package/dist/cms/sections/CustomSection.d.ts +0 -7
  178. package/dist/cms/sections/FaqSection.d.ts +0 -3
  179. package/dist/cms/sections/FormSection.d.ts +0 -8
  180. package/dist/cms/sections/GallerySection.d.ts +0 -3
  181. package/dist/cms/sections/HeroSection.d.ts +0 -3
  182. package/dist/cms/sections/RichTextSection.d.ts +0 -3
  183. package/dist/cms/sections/TestimonialsSection.d.ts +0 -3
  184. package/dist/cms/sections/index.d.ts +0 -8
  185. package/dist/cms/server-api.d.ts +0 -49
  186. package/dist/cms/server.d.ts +0 -1
  187. package/dist/cms/server.js +0 -5
  188. package/dist/cms/types.d.ts +0 -104
  189. package/dist/commerce/CalendarView.d.ts +0 -43
  190. package/dist/commerce/CheckoutForm.d.ts +0 -11
  191. package/dist/commerce/EventCalendar.d.ts +0 -26
  192. package/dist/commerce/EventCheckout.d.ts +0 -42
  193. package/dist/commerce/EventEmbed.d.ts +0 -11
  194. package/dist/commerce/EventModal.d.ts +0 -43
  195. package/dist/commerce/EventTile.d.ts +0 -10
  196. package/dist/commerce/EventsAgenda.d.ts +0 -38
  197. package/dist/commerce/EventsWidget.d.ts +0 -84
  198. package/dist/commerce/OfferingCard.d.ts +0 -9
  199. package/dist/commerce/OfferingList.d.ts +0 -9
  200. package/dist/commerce/ProductDetail.d.ts +0 -38
  201. package/dist/commerce/ProductEmbed.d.ts +0 -11
  202. package/dist/commerce/ProductGrid.d.ts +0 -41
  203. package/dist/commerce/ProductPage.d.ts +0 -39
  204. package/dist/commerce/RegistrationForm.d.ts +0 -9
  205. package/dist/commerce/SizeChart.d.ts +0 -8
  206. package/dist/commerce/UpcomingEvents.d.ts +0 -9
  207. package/dist/commerce/api.d.ts +0 -179
  208. package/dist/commerce/events-extras.d.ts +0 -60
  209. package/dist/commerce/index.d.ts +0 -33
  210. package/dist/commerce/index.js +0 -8022
  211. package/dist/commerce/server.d.ts +0 -161
  212. package/dist/commerce/server.js +0 -2
  213. package/dist/commerce/types.d.ts +0 -340
  214. package/dist/commerce/useEventModal.d.ts +0 -20
  215. package/dist/commerce/utils.d.ts +0 -17
  216. package/dist/engage/EngageWidget.d.ts +0 -21
  217. package/dist/engage/index.d.ts +0 -14
  218. package/dist/engage/index.js +0 -45
  219. package/dist/engage/types.d.ts +0 -33
  220. package/dist/seo/ManagedContent.d.ts +0 -14
  221. package/dist/server-api-BVCBLJKL.js +0 -9
  222. package/dist/website/cms/server.d.ts +0 -2
  223. package/dist/website/cms/server.js +0 -5
  224. package/dist/website/cms-server.d.ts +0 -2
  225. package/dist/website/cms.d.ts +0 -2
  226. package/dist/website/cms.js +0 -5
  227. package/src/commerce/README.md +0 -109
@@ -1,6 +1,85 @@
1
1
  import { declarativeToolField } from './chunk-HW7B43E5.js';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
 
4
+ // src/forms/field-autocomplete.ts
5
+ var TOKEN_BY_KEY = {
6
+ email: "email",
7
+ email_address: "email",
8
+ e_mail: "email",
9
+ first_name: "given-name",
10
+ firstname: "given-name",
11
+ fname: "given-name",
12
+ given_name: "given-name",
13
+ last_name: "family-name",
14
+ lastname: "family-name",
15
+ lname: "family-name",
16
+ surname: "family-name",
17
+ family_name: "family-name",
18
+ name: "name",
19
+ full_name: "name",
20
+ fullname: "name",
21
+ your_name: "name",
22
+ contact_name: "name",
23
+ phone: "tel",
24
+ phone_number: "tel",
25
+ telephone: "tel",
26
+ mobile: "tel",
27
+ mobile_phone: "tel",
28
+ cell: "tel",
29
+ cell_phone: "tel",
30
+ tel: "tel",
31
+ company: "organization",
32
+ company_name: "organization",
33
+ organization: "organization",
34
+ organisation: "organization",
35
+ business_name: "organization",
36
+ job_title: "organization-title",
37
+ website: "url",
38
+ website_url: "url",
39
+ company_website: "url",
40
+ url: "url",
41
+ street_address: "street-address",
42
+ address_line1: "address-line1",
43
+ address_line_1: "address-line1",
44
+ address1: "address-line1",
45
+ address_line2: "address-line2",
46
+ address_line_2: "address-line2",
47
+ address2: "address-line2",
48
+ city: "address-level2",
49
+ state: "address-level1",
50
+ province: "address-level1",
51
+ zip: "postal-code",
52
+ zip_code: "postal-code",
53
+ zipcode: "postal-code",
54
+ postal_code: "postal-code",
55
+ postcode: "postal-code",
56
+ country: "country-name"
57
+ };
58
+ var TOKEN_FIELD_TYPES = /* @__PURE__ */ new Set(["text", "email", "phone", "tel", "select"]);
59
+ function toKey(raw) {
60
+ return raw.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/\*/g, "").trim().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
61
+ }
62
+ function withoutGeneratedSuffix(key) {
63
+ const match = /^(.+)_([a-z0-9]{6,10})$/.exec(key);
64
+ if (match && /\d/.test(match[2])) return match[1];
65
+ return key;
66
+ }
67
+ function tokenForKey(raw) {
68
+ if (!raw) return void 0;
69
+ const key = toKey(raw);
70
+ return TOKEN_BY_KEY[key] ?? TOKEN_BY_KEY[withoutGeneratedSuffix(key)];
71
+ }
72
+ function autocompleteFor(field) {
73
+ if (!TOKEN_FIELD_TYPES.has(field.field_type)) return void 0;
74
+ const destination = field.destination_field;
75
+ if (destination && !destination.startsWith("custom.")) {
76
+ const fromDestination = tokenForKey(destination);
77
+ if (fromDestination) return fromDestination;
78
+ }
79
+ if (field.field_type === "email") return "email";
80
+ if (field.field_type === "phone" || field.field_type === "tel") return "tel";
81
+ return tokenForKey(field.slug) ?? tokenForKey(field.label);
82
+ }
4
83
  var STYLE_ID = "sk-delight-css";
5
84
  var CSS = `
6
85
  /* Every frame must carry the centering translateY: the animation fills both
@@ -208,86 +287,6 @@ function FormMomentum({ done, total }) {
208
287
  }
209
288
  );
210
289
  }
211
-
212
- // src/forms/field-autocomplete.ts
213
- var TOKEN_BY_KEY = {
214
- email: "email",
215
- email_address: "email",
216
- e_mail: "email",
217
- first_name: "given-name",
218
- firstname: "given-name",
219
- fname: "given-name",
220
- given_name: "given-name",
221
- last_name: "family-name",
222
- lastname: "family-name",
223
- lname: "family-name",
224
- surname: "family-name",
225
- family_name: "family-name",
226
- name: "name",
227
- full_name: "name",
228
- fullname: "name",
229
- your_name: "name",
230
- contact_name: "name",
231
- phone: "tel",
232
- phone_number: "tel",
233
- telephone: "tel",
234
- mobile: "tel",
235
- mobile_phone: "tel",
236
- cell: "tel",
237
- cell_phone: "tel",
238
- tel: "tel",
239
- company: "organization",
240
- company_name: "organization",
241
- organization: "organization",
242
- organisation: "organization",
243
- business_name: "organization",
244
- job_title: "organization-title",
245
- website: "url",
246
- website_url: "url",
247
- company_website: "url",
248
- url: "url",
249
- street_address: "street-address",
250
- address_line1: "address-line1",
251
- address_line_1: "address-line1",
252
- address1: "address-line1",
253
- address_line2: "address-line2",
254
- address_line_2: "address-line2",
255
- address2: "address-line2",
256
- city: "address-level2",
257
- state: "address-level1",
258
- province: "address-level1",
259
- zip: "postal-code",
260
- zip_code: "postal-code",
261
- zipcode: "postal-code",
262
- postal_code: "postal-code",
263
- postcode: "postal-code",
264
- country: "country-name"
265
- };
266
- var TOKEN_FIELD_TYPES = /* @__PURE__ */ new Set(["text", "email", "phone", "tel", "select"]);
267
- function toKey(raw) {
268
- return raw.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/\*/g, "").trim().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
269
- }
270
- function withoutGeneratedSuffix(key) {
271
- const match = /^(.+)_([a-z0-9]{6,10})$/.exec(key);
272
- if (match && /\d/.test(match[2])) return match[1];
273
- return key;
274
- }
275
- function tokenForKey(raw) {
276
- if (!raw) return void 0;
277
- const key = toKey(raw);
278
- return TOKEN_BY_KEY[key] ?? TOKEN_BY_KEY[withoutGeneratedSuffix(key)];
279
- }
280
- function autocompleteFor(field) {
281
- if (!TOKEN_FIELD_TYPES.has(field.field_type)) return void 0;
282
- const destination = field.destination_field;
283
- if (destination && !destination.startsWith("custom.")) {
284
- const fromDestination = tokenForKey(destination);
285
- if (fromDestination) return fromDestination;
286
- }
287
- if (field.field_type === "email") return "email";
288
- if (field.field_type === "phone" || field.field_type === "tel") return "tel";
289
- return tokenForKey(field.slug) ?? tokenForKey(field.label);
290
- }
291
290
  var SINGLE_CONTROL_TYPES = /* @__PURE__ */ new Set([
292
291
  "text",
293
292
  "email",
@@ -699,4 +698,4 @@ function FormField({ field, value, error, onChange, onFocus, onBlur, classPrefix
699
698
  ] });
700
699
  }
701
700
 
702
- export { DelightStyles, FormField, FormMomentum };
701
+ export { DelightStyles, FormField, FormMomentum, autocompleteFor };
@@ -1,4 +1,4 @@
1
- import { getLLMsData, getOptimizedLLMsTxt } from './chunk-4BHRA7TI.js';
1
+ import { getLLMsData, getOptimizedLLMsTxt } from './chunk-JIH32RH2.js';
2
2
  import { linkClassificationHost } from './chunk-L5UOHS6E.js';
3
3
  import { resolveArticleUrl } from './chunk-WMVK77ND.js';
4
4
  import { freshFetch } from './chunk-UAYAJPEP.js';
@@ -312,7 +312,7 @@ async function generateLLMsTxt(options) {
312
312
  if (includeEntities) {
313
313
  attemptedSections.push("knowledge-graph");
314
314
  optionalFetches.push(
315
- import('./server-api-BVCBLJKL.js').then(async ({ getEntities, getPrimaryEntity }) => {
315
+ import('./server-api-EGOKC7Q3.js').then(async ({ getEntities, getPrimaryEntity }) => {
316
316
  const [entities, primaryEntity] = await Promise.all([
317
317
  getEntities().then((e) => e.slice(0, maxEntities)),
318
318
  getPrimaryEntity()
@@ -1,10 +1,14 @@
1
- import { getSEOPageData, ensureMetadata, getABTest, recordABImpression, getRedirectData, getRobotsData, getSitemapEntries } from './chunk-662ILEZ6.js';
1
+ import { getSEOPageData, ensureMetadata, getABTest, recordABImpression, getRedirectData, getRobotsData, getSitemapEntries } from './chunk-Y35BWW2C.js';
2
2
  import { titleProblem, descriptionProblem } from './chunk-BQR4IPBW.js';
3
3
  import { resolveSiteHost } from './chunk-FESKKJAS.js';
4
4
 
5
5
  // src/seo/getManagedMetadata.ts
6
+ var SELF_CANONICAL = "./";
7
+ function mergeAlternates(...parts) {
8
+ return Object.assign({}, ...parts.filter(Boolean));
9
+ }
6
10
  async function getManagedMetadata(options) {
7
- const { path, fallback = {}, overrides = {}, favicon: faviconMode = "metadata" } = options;
11
+ const { path, fallback = {}, overrides = {}, favicon: faviconMode = "metadata", scope = "page" } = options;
8
12
  const omitIcons = faviconMode === "component";
9
13
  const result = await getSEOPageData(path);
10
14
  const pageData = result?.page;
@@ -13,6 +17,7 @@ async function getManagedMetadata(options) {
13
17
  const fallbackMeta = {
14
18
  ...fallback,
15
19
  ...overrides,
20
+ alternates: mergeAlternates({ canonical: SELF_CANONICAL }, fallback.alternates, overrides.alternates),
16
21
  _managed: false,
17
22
  _source: "fallback"
18
23
  };
@@ -70,18 +75,20 @@ async function getManagedMetadata(options) {
70
75
  if (pageData.managed_robots) {
71
76
  metadata.robots = pageData.managed_robots;
72
77
  }
73
- if (pageData.managed_canonical) {
74
- metadata.alternates = {
75
- ...metadata.alternates,
76
- canonical: pageData.managed_canonical
77
- };
78
- }
79
- const langAlts = pageData.language_alternates;
80
- if (langAlts && typeof langAlts === "object" && !Array.isArray(langAlts)) {
81
- metadata.alternates = {
82
- ...metadata.alternates,
83
- languages: langAlts
84
- };
78
+ if (scope === "page") {
79
+ if (pageData.managed_canonical) {
80
+ metadata.alternates = {
81
+ ...metadata.alternates,
82
+ canonical: pageData.managed_canonical
83
+ };
84
+ }
85
+ const langAlts = pageData.language_alternates;
86
+ if (langAlts && typeof langAlts === "object" && !Array.isArray(langAlts)) {
87
+ metadata.alternates = {
88
+ ...metadata.alternates,
89
+ languages: langAlts
90
+ };
91
+ }
85
92
  }
86
93
  const managedOgTitle = pageData.managed_og_title && !titleProblem(pageData.managed_og_title, identity, { path }) ? pageData.managed_og_title : void 0;
87
94
  const managedOgDescription = pageData.managed_og_description && !descriptionProblem(pageData.managed_og_description, identity) ? pageData.managed_og_description : void 0;
@@ -106,6 +113,12 @@ async function getManagedMetadata(options) {
106
113
  return {
107
114
  ...metadata,
108
115
  ...overrides,
116
+ alternates: mergeAlternates(
117
+ { canonical: SELF_CANONICAL },
118
+ metadata.alternates,
119
+ fallback.alternates,
120
+ overrides.alternates
121
+ ),
109
122
  _managed: true,
110
123
  _source: "database"
111
124
  };
@@ -219,7 +232,7 @@ async function generateSitemap(options) {
219
232
  }));
220
233
  }
221
234
  async function registerLocalSitemap(options) {
222
- const { registerSitemap } = await import('./server-api-BVCBLJKL.js');
235
+ const { registerSitemap } = await import('./server-api-EGOKC7Q3.js');
223
236
  let entries = options.entries || [];
224
237
  if (options.autoDiscover && entries.length === 0) {
225
238
  try {
@@ -250,4 +263,4 @@ async function isIndexable(projectId, path) {
250
263
  return directive.index;
251
264
  }
252
265
 
253
- export { generateSitemap, getABVariant, getManagedMetadata, getManagedMetadataWithAB, getRedirect, getRobotsDirective, isIndexable, registerLocalSitemap };
266
+ export { generateSitemap, getABVariant, getManagedMetadata, getManagedMetadataWithAB, getRedirect, getRobotsDirective, isIndexable, mergeAlternates, registerLocalSitemap };
@@ -1,11 +1,13 @@
1
1
  'use client';
2
2
  import { readAgentSubmit, formToolAttributes } from './chunk-Q6E4OPGG.js';
3
+ import { readAnalyticsIdentity } from './chunk-5ROTTMBL.js';
3
4
  import { isFieldVisible, validateField, isFieldComplete, unseenControlValues } from './chunk-C2FZBUSS.js';
4
5
  import { normalizeFormConfig, DEFAULT_FORM_SUCCESS_MESSAGE } from './chunk-5SQK3D53.js';
5
6
  import { DEFAULT_HONEYPOT_FIELD } from './chunk-NJCTQH2P.js';
6
7
  import { onPageLeave } from './chunk-L2V5PUFN.js';
7
8
  import { uuid } from './chunk-GJWI74ZZ.js';
8
- import { sonorFetch, sonorBeacon } from './chunk-3E3PPSNR.js';
9
+ import { readPublishedApiConfig, getClientApiConfig } from './chunk-3G7YABRA.js';
10
+ import { sonorFetch, sonorBeacon } from './chunk-56VDS2RP.js';
9
11
  import { useRef, useCallback, useEffect, useState, useMemo } from 'react';
10
12
 
11
13
  // src/forms/field-interactions.ts
@@ -190,8 +192,7 @@ function useFormTracking({
190
192
  return;
191
193
  }
192
194
  const startTracking = async (sessionId) => {
193
- const apiUrl = window.__SITE_KIT_API_URL__;
194
- const apiKey = window.__SITE_KIT_API_KEY__;
195
+ const { apiUrl, apiKey } = readPublishedApiConfig();
195
196
  if (!apiUrl || !apiKey) {
196
197
  if (debug) console.error("[Forms] Missing API URL or API key");
197
198
  return null;
@@ -232,8 +233,7 @@ function useFormTracking({
232
233
  });
233
234
  const reportAbandon = (analyticsId) => {
234
235
  if (!analyticsId) return;
235
- const apiUrl = window.__SITE_KIT_API_URL__;
236
- const apiKey = window.__SITE_KIT_API_KEY__;
236
+ const { apiUrl, apiKey } = readPublishedApiConfig();
237
237
  if (!apiUrl || !apiKey) return;
238
238
  if (!claimAbandon(session)) return;
239
239
  const now = Date.now();
@@ -287,8 +287,7 @@ function useFormTracking({
287
287
  }, []);
288
288
  const trackStepChange = useCallback(async (step) => {
289
289
  if (!enabled) return;
290
- const apiUrl = window.__SITE_KIT_API_URL__;
291
- const apiKey = window.__SITE_KIT_API_KEY__;
290
+ const { apiUrl, apiKey } = readPublishedApiConfig();
292
291
  if (!apiUrl || !apiKey) {
293
292
  if (debug) console.error("[Forms] Missing API URL or API key");
294
293
  return;
@@ -331,8 +330,7 @@ function useFormTracking({
331
330
  if (!enabled) return;
332
331
  const session = sessionRef.current;
333
332
  if (session) markCompleted(session);
334
- const apiUrl = window.__SITE_KIT_API_URL__;
335
- const apiKey = window.__SITE_KIT_API_KEY__;
333
+ const { apiUrl, apiKey } = readPublishedApiConfig();
336
334
  if (!apiUrl || !apiKey) {
337
335
  if (debug) console.error("[Forms] Missing API URL or API key");
338
336
  return;
@@ -551,9 +549,7 @@ function readGa4Identity() {
551
549
 
552
550
  // src/forms/submitForm.ts
553
551
  function getApiConfig() {
554
- const apiUrl = typeof window !== "undefined" ? window.__SITE_KIT_API_URL__ || "https://api.sonor.io" : process.env.SONOR_API_URL || process.env.NEXT_PUBLIC_SONOR_API_URL || "https://api.sonor.io";
555
- const apiKey = typeof window !== "undefined" ? window.__SITE_KIT_API_KEY__ : void 0;
556
- return { apiUrl, apiKey };
552
+ return getClientApiConfig();
557
553
  }
558
554
  function getUTMParams() {
559
555
  if (typeof window === "undefined") return {};
@@ -582,6 +578,7 @@ async function submitForm({
582
578
  const honeypotFieldName = config.honeypot_field || DEFAULT_HONEYPOT_FIELD;
583
579
  const utm = getUTMParams();
584
580
  const ga4 = readGa4Identity();
581
+ const identity = readAnalyticsIdentity();
585
582
  const payload = {
586
583
  formId: config.id,
587
584
  form_id: config.id,
@@ -593,11 +590,11 @@ async function submitForm({
593
590
  pageUrl: typeof window !== "undefined" ? window.location.href : null,
594
591
  referrer: typeof document !== "undefined" ? document.referrer || null : null,
595
592
  userAgent: typeof navigator !== "undefined" ? navigator.userAgent : null,
596
- sessionId: typeof sessionStorage !== "undefined" ? sessionStorage.getItem("_sk_sid") : null,
593
+ sessionId: identity.sessionId,
597
594
  // Anonymous visitor id (_sk_vid) — the same id Analytics/Signal stamp on
598
595
  // page views, so the Sonor side can bind this lead to its browsing session
599
596
  // (page -> lead attribution). Sent on every submission; null pre-hydration.
600
- visitorId: typeof localStorage !== "undefined" ? localStorage.getItem("_sk_vid") : null,
597
+ visitorId: identity.visitorId,
601
598
  recaptchaToken: recaptchaToken || void 0,
602
599
  utmSource: utm.utm_source,
603
600
  utmMedium: utm.utm_medium,
@@ -706,12 +703,12 @@ function useForm(formIdOrSlug, options = {}) {
706
703
  }
707
704
  return;
708
705
  }
709
- const apiUrl = typeof window !== "undefined" ? window.__SITE_KIT_API_URL__ || "https://api.sonor.io" : "https://api.sonor.io";
706
+ const { apiUrl } = getClientApiConfig();
710
707
  async function fetchForm() {
711
708
  try {
712
709
  setIsLoading(true);
713
710
  setFetchError(null);
714
- const readApiKey = () => typeof window !== "undefined" ? window.__SITE_KIT_API_KEY__ : void 0;
711
+ const readApiKey = () => readPublishedApiConfig().apiKey;
715
712
  let apiKey = readApiKey();
716
713
  for (let i = 0; i < 15 && !apiKey; i++) {
717
714
  await new Promise((r) => setTimeout(r, 100));
@@ -2,7 +2,7 @@ import { generateArticleAuthorNode, resolveArticleArtwork, withArticleAuthorIden
2
2
  import { resolveArticleUrl, createPublicationRoutes, resolvePublicationUrl, articleCategorySlug } from './chunk-WMVK77ND.js';
3
3
  import { withoutSchemaPlaceholders } from './chunk-VWWITFWM.js';
4
4
  import { withSiteParam, withSiteBody } from './chunk-MJP63SSS.js';
5
- import { resolveServerApiConfig } from './chunk-X6F6SO4S.js';
5
+ import { resolveServerApiConfig } from './chunk-C7TLGL3R.js';
6
6
  import { notFound } from 'next/navigation';
7
7
 
8
8
  // src/articles/public-reads.ts
@@ -1,6 +1,6 @@
1
- import { SITE_CACHE_TAGS } from './chunk-RYVDGXC2.js';
2
1
  import { withSiteBody } from './chunk-MJP63SSS.js';
3
- import { serverApiFetch, requireServerApiConfig } from './chunk-X6F6SO4S.js';
2
+ import { SITE_CACHE_TAGS } from './chunk-6KU7STM3.js';
3
+ import { serverApiFetch, requireServerApiConfig } from './chunk-C7TLGL3R.js';
4
4
  import { postRegisterSitemap, resolveSyncSite } from './chunk-DIKNRN34.js';
5
5
  import { cache } from 'react';
6
6
  import 'server-only';
@@ -116,10 +116,6 @@ var getInternalLinks = cache(async (sourcePath, options) => {
116
116
  );
117
117
  return result?.links || [];
118
118
  });
119
- var getContentBlock = cache(async (path, section, site) => {
120
- const result = await secureApiPost("/api/public/seo/content", withSiteBody({ path, section }, site));
121
- return result?.content || null;
122
- });
123
119
  var getABTest = cache(async (path, field) => {
124
120
  const result = await secureApiPost("/api/public/seo/ab-test", { path, field });
125
121
  return result?.test || null;
@@ -237,4 +233,4 @@ var getVisibilitySummary = cache(async () => {
237
233
  return signalApiGet(`/skills/seo/visibility/${projectId}/summary`);
238
234
  });
239
235
 
240
- export { ensureMetadata, getABTest, getContentBlock, getEntities, getEntityEnhancedSchema, getFAQData, getInternalLinks, getManagedScripts, getPrimaryEntity, getRedirectData, getRobotsData, getSEOPageData, getSchemaMarkups, getSitemapEntries, getVisibilityScore, getVisibilitySummary, pruneSchemaTypes, recordABImpression, registerSitemap };
236
+ export { ensureMetadata, getABTest, getEntities, getEntityEnhancedSchema, getFAQData, getInternalLinks, getManagedScripts, getPrimaryEntity, getRedirectData, getRobotsData, getSEOPageData, getSchemaMarkups, getSitemapEntries, getVisibilityScore, getVisibilitySummary, pruneSchemaTypes, recordABImpression, registerSitemap };
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-CG4ETW5Y.js';
2
+ import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-KRBBH64S.js';
3
3
  import { designTokensHash } from './chunk-IHG36STL.js';
4
4
  import { useDeferredActivation } from './chunk-YC7ELZS3.js';
5
- import { resolveAnalyticsTarget } from './chunk-43OCZ3JA.js';
5
+ import { resolveAnalyticsTarget } from './chunk-CAH4Y4PY.js';
6
6
  import { useRef, useEffect } from 'react';
7
7
 
8
8
  var STAMP_KEY = (site) => `_sk_design_sent:${site}`;
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+ import { VISITOR_ID_KEY, memoryIdentity, SESSION_ID_KEY, SESSION_TIME_KEY } from './chunk-5TM3WPCI.js';
3
+ import { uuid } from './chunk-GJWI74ZZ.js';
4
+ import { useState } from 'react';
5
+
6
+ function getOrCreateVisitorId() {
7
+ var _a;
8
+ if (typeof window === "undefined") return "";
9
+ let stored = null;
10
+ try {
11
+ stored = window.localStorage.getItem(VISITOR_ID_KEY);
12
+ const visitorId = stored || uuid();
13
+ window.localStorage.setItem(VISITOR_ID_KEY, visitorId);
14
+ return visitorId;
15
+ } catch {
16
+ return (_a = memoryIdentity).visitorId || (_a.visitorId = stored || uuid());
17
+ }
18
+ }
19
+ function getOrCreateSessionId(timeoutMinutes = 30) {
20
+ var _a;
21
+ if (typeof window === "undefined") return "";
22
+ const now = Date.now();
23
+ const timeoutMs = timeoutMinutes * 60 * 1e3;
24
+ let existingSession = null;
25
+ try {
26
+ existingSession = window.sessionStorage.getItem(SESSION_ID_KEY);
27
+ const lastActivity = window.sessionStorage.getItem(SESSION_TIME_KEY);
28
+ if (existingSession && lastActivity) {
29
+ const elapsed = now - parseInt(lastActivity, 10);
30
+ if (elapsed < timeoutMs) {
31
+ window.sessionStorage.setItem(SESSION_TIME_KEY, now.toString());
32
+ window.sessionStorage.setItem(SESSION_ID_KEY, existingSession);
33
+ return existingSession;
34
+ }
35
+ }
36
+ const newSession = uuid();
37
+ window.sessionStorage.setItem(SESSION_ID_KEY, newSession);
38
+ window.sessionStorage.setItem(SESSION_TIME_KEY, now.toString());
39
+ return newSession;
40
+ } catch {
41
+ return (_a = memoryIdentity).sessionId || (_a.sessionId = existingSession || uuid());
42
+ }
43
+ }
44
+ function useSiteKitIdentity() {
45
+ const [identity] = useState(() => ({
46
+ visitorId: getOrCreateVisitorId(),
47
+ sessionId: getOrCreateSessionId()
48
+ }));
49
+ return identity;
50
+ }
51
+
52
+ export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity };
@@ -1,4 +1,4 @@
1
- import { SITE_KIT_VERSION } from './chunk-KHQ5GD6T.js';
1
+ import { SITE_KIT_VERSION } from './chunk-5S2XDG5O.js';
2
2
 
3
3
  // src/shared/siteToken.ts
4
4
  var SITE_TOKEN_PREFIX = "st1.";
@@ -1,14 +1,15 @@
1
1
  'use client';
2
- import { publishSiteCredential } from '../chunk-JRCNUUNG.js';
2
+ import { publishSiteCredential } from '../chunk-LBIQ5LTC.js';
3
+ export { VISUAL_VIEWPORT_GAP_PROPERTY, VisualViewportGap, useVisualViewportGap } from '../chunk-6T6CQVNL.js';
3
4
  export { useDeferredActivation } from '../chunk-YC7ELZS3.js';
4
5
  import '../chunk-FESKKJAS.js';
5
6
  import '../chunk-A4CC4ZG3.js';
6
7
  export { trackConversion, trackEvent } from '../chunk-LCDVPAMR.js';
7
- export { VISUAL_VIEWPORT_GAP_PROPERTY, VisualViewportGap, useVisualViewportGap } from '../chunk-6T6CQVNL.js';
8
- export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity } from '../chunk-24QZEO3Q.js';
8
+ export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity } from '../chunk-ZKADJNR2.js';
9
+ import '../chunk-5TM3WPCI.js';
9
10
  import '../chunk-GJWI74ZZ.js';
10
- import '../chunk-GK7TV7EK.js';
11
- import '../chunk-KHQ5GD6T.js';
11
+ import '../chunk-ZLFGXKLG.js';
12
+ import '../chunk-5S2XDG5O.js';
12
13
  import '../chunk-PKBMQBKP.js';
13
14
 
14
15
  // src/client/SiteKitCredential.tsx
@@ -4,5 +4,5 @@
4
4
  * tsup config, its package.json check and the boundary test, so a new
5
5
  * contract is added in one place.
6
6
  */
7
- export declare const CONTRACT_ENTRIES: readonly ['forms', 'llms', 'slots', 'slot-content', 'site-cache', 'site-edit', 'website', 'color', 'fleet', 'sites', 'seo-pages', 'seo-meta', 'portfolio', 'voice', 'proposal-sitemap', 'error-page', 'schema-placeholders'];
7
+ export declare const CONTRACT_ENTRIES: readonly ['forms', 'llms', 'slots', 'slot-content', 'site-cache', 'site-edit', 'website', 'color', 'fleet', 'sites', 'seo-pages', 'seo-meta', 'portfolio', 'voice', 'proposal-sitemap', 'error-page', 'schema-placeholders', 'sentences'];
8
8
  export type ContractEntry = (typeof CONTRACT_ENTRIES)[number];
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Sentences contract: how prose is split into sentences, so the APIs that cut
3
+ * an excerpt, a carousel slide or a summary out of an article agree on where
4
+ * a sentence ends. The APIs import it as `@sonordev/contracts/sentences`.
5
+ *
6
+ * Lossless: joining the result with spaces gives back every word of the input,
7
+ * in order. The usual one-liner, `text.match(/[^.!?]+[.!?]+(?=\s|$)/g)`, isn't.
8
+ * A period it can't use, like the first one in "9 p.m. call", makes match()
9
+ * skip ahead and silently drop every word before its next match, so a
10
+ * sentence about a 9 p.m. call comes back as "m.". Don't re-fork a regex for
11
+ * this.
12
+ *
13
+ * A sentence ends at . ! or ? (and any closing quote or bracket after it)
14
+ * followed by whitespace, then an optional opening quote or bracket, then
15
+ * A to Z or 0 to 9. Never before a lowercase word or a symbol, and only ASCII
16
+ * capitals count. It doesn't end at:
17
+ * - an abbreviation: a dotted one made of letters ("p.m.", "U.S.", "e.g.",
18
+ * "Ph.D."), a single letter ("J.", "Plan A."), or a short form listed below
19
+ * (titles, months, days, company suffixes, street suffixes);
20
+ * - a label that has a number after it ("No. 5", "Fig. 2", "Ste. 200");
21
+ * - a list number ("1.", "Step 2.", "Do three things: 1.").
22
+ * A piece with no letter in it ("...", "1.") isn't a sentence and joins the
23
+ * next one. A "!" or "?" is never held back by an abbreviation (only a period
24
+ * is), though the same start-of-sentence rule applies after it.
25
+ *
26
+ * Prices, versions, domains and email addresses ("$4.50", "v2.1",
27
+ * "example.com") are not abbreviations: a sentence can end after them.
28
+ *
29
+ * Where it is unsure it leans toward not splitting, because a sentence that
30
+ * runs long costs less than a lost word. A period after a short form that
31
+ * isn't listed ends a sentence like any other.
32
+ *
33
+ * It reads sentences, not layout. A newline or a list marker doesn't start a
34
+ * new sentence by itself, so split text into lines or paragraphs first when
35
+ * those matter, then split each one.
36
+ */
37
+ /**
38
+ * Splits prose into trimmed sentences without dropping or reordering a word.
39
+ * Empty, blank and nullish input give `[]`, never `null`.
40
+ *
41
+ * One pass, linear in the length of the text: each run of . ! ? (and the
42
+ * closing quotes or brackets after it) is looked at once, an abbreviation or
43
+ * list-marker check reads only the last few characters, and the check for a
44
+ * letter reads each character once.
45
+ */
46
+ export declare function splitSentences(text: string | null | undefined): string[];
@@ -27,6 +27,8 @@ export declare const SITE_CACHE_TAGS: {
27
27
  readonly taxonomy: 'editorial-taxonomy';
28
28
  /** Portfolio items (agency-site-kit). */
29
29
  readonly portfolio: 'portfolio';
30
+ /** Products, services, events and membership plans (commerce-kit). */
31
+ readonly commerce: 'commerce';
30
32
  };
31
33
  export type SiteCacheTag = (typeof SITE_CACHE_TAGS)[keyof typeof SITE_CACHE_TAGS];
32
34
  /** The body Sonor POSTs to the revalidation route. */
@@ -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,10 +1,11 @@
1
1
  'use client';
2
- export { FLEET_HEARTBEAT_PATH, FleetHeartbeat, detectNextVersion, sendFleetHeartbeat } from '../chunk-EHR4NIMX.js';
2
+ export { FLEET_HEARTBEAT_PATH, FleetHeartbeat, detectNextVersion, sendFleetHeartbeat } from '../chunk-ICAVVF6D.js';
3
3
  export { FLEET_CONTRACT_VERSION, FLEET_MODULES, FLEET_MODULES_MAX, FLEET_SITE_MAX_LENGTH, FLEET_VERSION_MAX_LENGTH, FLEET_VERSION_PATTERN, buildFleetHeartbeatPayload, isFleetModule, normalizeFleetModules, normalizeFleetSite, sanitizeFleetVersion } from '../chunk-ZTZQPYP6.js';
4
4
  import '../chunk-YC7ELZS3.js';
5
- import '../chunk-43OCZ3JA.js';
5
+ import '../chunk-CAH4Y4PY.js';
6
6
  import '../chunk-EKBEOXTH.js';
7
- import '../chunk-3E3PPSNR.js';
8
- import '../chunk-GK7TV7EK.js';
9
- import '../chunk-KHQ5GD6T.js';
7
+ import '../chunk-3G7YABRA.js';
8
+ import '../chunk-56VDS2RP.js';
9
+ import '../chunk-ZLFGXKLG.js';
10
+ import '../chunk-5S2XDG5O.js';
10
11
  import '../chunk-PKBMQBKP.js';
@@ -7,9 +7,10 @@
7
7
  * ends up in the company field. Managed forms shipped no tokens at all before
8
8
  * 7.2.0.
9
9
  *
10
- * Single source of truth for which token a managed field gets. FormField is
11
- * the only caller; every experience (classic, spotlight, stage, the static
12
- * shell) renders its controls through FormField.
10
+ * Single source of truth for which token a managed field gets. FormField calls
11
+ * it for every experience (classic, spotlight, stage, the static shell), and
12
+ * `@sonordev/site-kit/forms` exports it for sites that draw their own controls
13
+ * with `useForm`, so a headless form reads this table instead of keeping a copy.
13
14
  *
14
15
  * Precedence: the field's CRM destination (`destination_field`, set in
15
16
  * Sonor) > its input type > its slug > its label. When nothing matches the
@@ -18,11 +19,18 @@
18
19
  * (`email_k3x9pq2m`).
19
20
  */
20
21
  import type { FormField } from './types';
22
+ /**
23
+ * What `autocompleteFor` reads from a managed field. Any field `useForm`
24
+ * returns fits, and so does an object literal with these keys (`field_type`
25
+ * has to be a `FieldType`, not a bare string).
26
+ */
27
+ export type AutocompleteField = Pick<FormField, 'field_type' | 'slug' | 'label' | 'destination_field'>;
21
28
  /**
22
29
  * The `autocomplete` token for one managed field, or undefined to omit it.
23
- * Only text-like inputs and selects get one; a message box, a date or a
24
- * checkbox never does.
30
+ * Only text, email and phone fields and selects get one; a message box, a
31
+ * number, a date or a checkbox never does.
32
+ *
33
+ * Pass it straight to a control: `<input autoComplete={autocompleteFor(field)} />`.
34
+ * React leaves the attribute off when the result is undefined.
25
35
  */
26
- export declare function autocompleteFor(field: Pick<FormField, 'field_type' | 'slug' | 'label'> & {
27
- destination_field?: string;
28
- }): string | undefined;
36
+ export declare function autocompleteFor(field: AutocompleteField): string | undefined;