@sonordev/site-kit 8.2.0 → 8.4.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 (198) hide show
  1. package/AGENTS.md +13 -1
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +9 -5
  4. package/agent-manifest.json +53 -8
  5. package/dist/{AnalyticsProvider-6TAA3XYB.js → AnalyticsProvider-D6GWEJSB.js} +6 -6
  6. package/dist/{ArticleFaqSection-3Q26DP7P.js → ArticleFaqSection-DEWE5B4Q.js} +1 -1
  7. package/dist/{ArticleViewTracker-H4N7YCLC.js → ArticleViewTracker-YZ76HM64.js} +17 -6
  8. package/dist/{BlocksPopup-FJT5YQD3.js → BlocksPopup-UJXZ4AXG.js} +6 -6
  9. package/dist/{ChatWidget-THQHHTAA.js → ChatWidget-H4EOSH5I.js} +6 -6
  10. package/dist/{FileField-OZXXJGUM.js → FileField-CKBYGCNT.js} +4 -4
  11. package/dist/{FormSpotlight-MLDJS246.js → FormSpotlight-CGF5ZE6S.js} +1 -1
  12. package/dist/{FormStage-6RVY7M3R.js → FormStage-PQPUPQWW.js} +1 -1
  13. package/dist/{ManagedForm-3VV54RVH.js → ManagedForm-YOEZ7CFS.js} +7 -7
  14. package/dist/{ManagedNewsletterForm-RTJDGMGG.js → ManagedNewsletterForm-EUWJ2HCA.js} +25 -11
  15. package/dist/{SignalCore-T7ZOCA44.js → SignalCore-JZSU7A44.js} +14 -8
  16. package/dist/SiteChat-OAZH34W7.js +6 -0
  17. package/dist/SiteDesignReporter-IWBMZJYU.js +12 -0
  18. package/dist/{SitePopups-K6ADAWFK.js → SitePopups-MLAT35UN.js} +6 -6
  19. package/dist/SitemapSync-6KQLKFO2.js +9 -0
  20. package/dist/_client/booking-widget.js +6 -6
  21. package/dist/_client/testimonial-section.js +3 -3
  22. package/dist/affiliates/index.js +4 -4
  23. package/dist/analytics/index.js +6 -6
  24. package/dist/analytics/publication-cta.d.ts +3 -0
  25. package/dist/{article-styles-GFXJJDLE.js → article-styles-AOOVVKXH.js} +7 -5
  26. package/dist/article-tables-6XHVULPU.js +2 -0
  27. package/dist/articles/Article.d.ts +2 -89
  28. package/dist/articles/ArticleFAQ.d.ts +2 -41
  29. package/dist/articles/ArticleFaqSection.d.ts +2 -2
  30. package/dist/articles/ArticleList.d.ts +2 -79
  31. package/dist/articles/ArticleViewTracker.d.ts +2 -15
  32. package/dist/articles/AuthorCard.d.ts +2 -10
  33. package/dist/articles/AuthorPage.d.ts +2 -8
  34. package/dist/articles/ClusterLandingPage.d.ts +2 -40
  35. package/dist/articles/ClusterNavigation.d.ts +2 -37
  36. package/dist/articles/ManagedNewsletterForm.d.ts +3 -12
  37. package/dist/articles/NewsletterShell.d.ts +2 -17
  38. package/dist/articles/NewsletterWidget.d.ts +2 -30
  39. package/dist/articles/PublicationLayout.d.ts +2 -67
  40. package/dist/articles/PublicationSidebar.d.ts +2 -36
  41. package/dist/articles/RelatedPosts.d.ts +2 -22
  42. package/dist/articles/ServiceCallout.d.ts +2 -56
  43. package/dist/articles/TableOfContents.d.ts +2 -6
  44. package/dist/articles/article-photos.d.ts +2 -9
  45. package/dist/articles/article-styles.d.ts +2 -21
  46. package/dist/articles/article-tables.d.ts +2 -12
  47. package/dist/articles/artwork.d.ts +2 -13
  48. package/dist/articles/author-schema.d.ts +2 -72
  49. package/dist/articles/author-social.d.ts +2 -14
  50. package/dist/articles/excerpt.d.ts +2 -17
  51. package/dist/articles/index.d.ts +2 -79
  52. package/dist/articles/index.js +16 -11
  53. package/dist/articles/news-sitemap.d.ts +2 -46
  54. package/dist/articles/processArticleHtml.d.ts +2 -34
  55. package/dist/articles/public-reads.d.ts +2 -26
  56. package/dist/articles/reading-time.d.ts +2 -9
  57. package/dist/articles/routes.d.ts +2 -52
  58. package/dist/articles/server-core.d.ts +2 -461
  59. package/dist/articles/server-ui.d.ts +2 -30
  60. package/dist/articles/server-ui.js +72 -62
  61. package/dist/articles/server.d.ts +2 -461
  62. package/dist/articles/server.js +14 -5
  63. package/dist/articles/types.d.ts +2 -316
  64. package/dist/articles/widget-styles.d.ts +2 -8
  65. package/dist/chat/index.js +8 -8
  66. package/dist/chunk-34ZYJTQR.js +1 -0
  67. package/dist/{chunk-727R7C5R.js → chunk-3VSFOD2Z.js} +2 -2
  68. package/dist/{chunk-JC2VS2SB.js → chunk-44GVU5UH.js} +1 -1
  69. package/dist/{chunk-WYZ4OUON.js → chunk-4HYIDQJJ.js} +1 -1
  70. package/dist/{chunk-WMVK77ND.js → chunk-4K735O3J.js} +1 -1
  71. package/dist/{chunk-L5UOHS6E.js → chunk-5D7ZISUP.js} +1 -1
  72. package/dist/{chunk-Q72M5KBS.js → chunk-5S7YTOCB.js} +1 -1
  73. package/dist/{chunk-WSNG2K3T.js → chunk-5TDZHIG6.js} +3 -3
  74. package/dist/{chunk-6CJGZFOU.js → chunk-A4MPHIVP.js} +1 -1
  75. package/dist/chunk-B7T2SFUF.js +1 -0
  76. package/dist/{chunk-FV2VD7WM.js → chunk-BC7JMY4Z.js} +3 -3
  77. package/dist/chunk-BLCHQIWR.js +319 -0
  78. package/dist/{chunk-NNEIBXGU.js → chunk-BLENFNBW.js} +2 -2
  79. package/dist/{chunk-NFRJTOTB.js → chunk-BSQP6PRA.js} +1 -1
  80. package/dist/{chunk-GKGSXUVQ.js → chunk-BVB5FBAA.js} +1 -1
  81. package/dist/{chunk-WACWV5EP.js → chunk-CE7VPAEH.js} +3 -3
  82. package/dist/{chunk-GYF2ULVO.js → chunk-DJAYFHVF.js} +1 -1
  83. package/dist/{chunk-WBC5B3JD.js → chunk-DKKYZLKR.js} +3 -3
  84. package/dist/{chunk-CAH4Y4PY.js → chunk-DLM4FFNH.js} +6 -2
  85. package/dist/{chunk-575L73NT.js → chunk-DS6LECIX.js} +1 -1
  86. package/dist/{chunk-Y3INC4QJ.js → chunk-E4PTMORJ.js} +1 -1
  87. package/dist/chunk-H72ZFO3F.js +1 -0
  88. package/dist/{chunk-WK3N3Y7V.js → chunk-HH2GOZTO.js} +2 -2
  89. package/dist/{chunk-JBEUZJS3.js → chunk-ITY4UZEJ.js} +3 -3
  90. package/dist/{chunk-GWP2VBFH.js → chunk-J4KX2D3Q.js} +3 -3
  91. package/dist/{chunk-57K4GW3D.js → chunk-JCSU6EJI.js} +1 -1
  92. package/dist/{chunk-SC4MZGWZ.js → chunk-JHTPHA2D.js} +6 -3
  93. package/dist/{chunk-YBAFUM3Z.js → chunk-JV5YWTJN.js} +13 -4
  94. package/dist/{chunk-I6QFPSUU.js → chunk-KASKB7UK.js} +11 -10
  95. package/dist/{chunk-SMYX3AAO.js → chunk-LEGMPX6N.js} +1 -1
  96. package/dist/{chunk-ZM2FNWIQ.js → chunk-LPVEBQVL.js} +1 -1
  97. package/dist/{chunk-HUBMKTPW.js → chunk-M5SF7NCC.js} +1 -1
  98. package/dist/{chunk-EBILJHUF.js → chunk-MTV5LYXN.js} +31 -2
  99. package/dist/{chunk-5ZCY36TY.js → chunk-MZX4EN6Z.js} +1 -1
  100. package/dist/{chunk-7FSB2EXS.js → chunk-OKITZFML.js} +1 -1
  101. package/dist/{chunk-H4R2GPAB.js → chunk-PEI6DRSK.js} +2 -2
  102. package/dist/{chunk-FVXFLVXF.js → chunk-QD73RO67.js} +3 -3
  103. package/dist/{chunk-66G47P5C.js → chunk-QKOVP7WO.js} +2 -2
  104. package/dist/{chunk-3EU6S5YC.js → chunk-RBNHRZGD.js} +1 -1
  105. package/dist/{chunk-XWIRU6UT.js → chunk-S6QDNXDK.js} +2 -2
  106. package/dist/{chunk-FQUGGPBM.js → chunk-TY6WNQO3.js} +124 -41
  107. package/dist/{chunk-QXMIKDOL.js → chunk-UVYUTBT4.js} +14 -4
  108. package/dist/{chunk-3G7YABRA.js → chunk-W7OPEMGJ.js} +4 -1
  109. package/dist/{chunk-JIH32RH2.js → chunk-XA7Q2VQA.js} +1 -1
  110. package/dist/{chunk-X7VKRHFF.js → chunk-XENW66OF.js} +1 -1
  111. package/dist/chunk-XI2XM7UG.js +14 -0
  112. package/dist/{chunk-BQZPHICL.js → chunk-YM5KMNTU.js} +1 -1
  113. package/dist/client/index.js +4 -16
  114. package/dist/fleet/index.js +6 -6
  115. package/dist/forms/index.js +9 -325
  116. package/dist/forms/server.js +2 -2
  117. package/dist/forms/types.d.ts +5 -0
  118. package/dist/forms/useForm.d.ts +4 -0
  119. package/dist/images/index.js +4 -4
  120. package/dist/index.js +1 -1
  121. package/dist/layout/client.js +9 -9
  122. package/dist/layout/index.js +10 -10
  123. package/dist/llms/index.js +8 -8
  124. package/dist/maps/index.js +4 -4
  125. package/dist/mcp/sonor.d.ts +46 -3
  126. package/dist/mcp/sonor.js +51 -29
  127. package/dist/mcp/transport.d.ts +1 -1
  128. package/dist/press-kit/articles/Article.d.ts +89 -0
  129. package/dist/press-kit/articles/ArticleFAQ.d.ts +41 -0
  130. package/dist/press-kit/articles/ArticleFaqSection.d.ts +2 -0
  131. package/dist/press-kit/articles/ArticleList.d.ts +79 -0
  132. package/dist/press-kit/articles/ArticleViewTracker.d.ts +15 -0
  133. package/dist/press-kit/articles/AuthorCard.d.ts +10 -0
  134. package/dist/press-kit/articles/AuthorPage.d.ts +8 -0
  135. package/dist/press-kit/articles/ClusterLandingPage.d.ts +40 -0
  136. package/dist/press-kit/articles/ClusterNavigation.d.ts +37 -0
  137. package/dist/press-kit/articles/ManagedNewsletterForm.d.ts +12 -0
  138. package/dist/press-kit/articles/NewsletterShell.d.ts +17 -0
  139. package/dist/press-kit/articles/NewsletterWidget.d.ts +30 -0
  140. package/dist/press-kit/articles/PublicationLayout.d.ts +67 -0
  141. package/dist/press-kit/articles/PublicationSidebar.d.ts +36 -0
  142. package/dist/press-kit/articles/RelatedPosts.d.ts +22 -0
  143. package/dist/press-kit/articles/ServiceCallout.d.ts +56 -0
  144. package/dist/press-kit/articles/TableOfContents.d.ts +6 -0
  145. package/dist/press-kit/articles/article-photos.d.ts +9 -0
  146. package/dist/press-kit/articles/article-styles.d.ts +21 -0
  147. package/dist/press-kit/articles/article-tables.d.ts +12 -0
  148. package/dist/press-kit/articles/artwork.d.ts +16 -0
  149. package/dist/press-kit/articles/author-schema.d.ts +72 -0
  150. package/dist/press-kit/articles/author-social.d.ts +14 -0
  151. package/dist/press-kit/articles/excerpt.d.ts +17 -0
  152. package/dist/press-kit/articles/index.d.ts +80 -0
  153. package/dist/press-kit/articles/news-sitemap.d.ts +40 -0
  154. package/dist/press-kit/articles/processArticleHtml.d.ts +34 -0
  155. package/dist/press-kit/articles/public-reads.d.ts +42 -0
  156. package/dist/press-kit/articles/publication-definition.d.ts +41 -0
  157. package/dist/press-kit/articles/publication-reads.d.ts +54 -0
  158. package/dist/press-kit/articles/reading-time.d.ts +9 -0
  159. package/dist/press-kit/articles/routes.d.ts +52 -0
  160. package/dist/press-kit/articles/server-core.d.ts +479 -0
  161. package/dist/press-kit/articles/server-ui.d.ts +31 -0
  162. package/dist/press-kit/articles/types.d.ts +339 -0
  163. package/dist/press-kit/articles/widget-styles.d.ts +8 -0
  164. package/dist/reputation/index.js +3 -3
  165. package/dist/reputation/server.js +2 -2
  166. package/dist/revalidate/index.js +2 -2
  167. package/dist/runtime/index.js +5 -4
  168. package/dist/seo/client.js +6 -6
  169. package/dist/seo/index.js +7 -7
  170. package/dist/seo/llms.js +8 -8
  171. package/dist/seo/register-sitemap-cli.js +1 -1
  172. package/dist/seo/sitemap.js +6 -6
  173. package/dist/server/index.js +3 -2
  174. package/dist/shared/build-entries.d.ts +2 -1
  175. package/dist/shared/clientApiConfig.d.ts +2 -0
  176. package/dist/shared/import-specifiers.d.ts +1 -1
  177. package/dist/shared/index.d.ts +6 -0
  178. package/dist/shared/index.js +8 -0
  179. package/dist/shared/reporting-gate.d.ts +2 -0
  180. package/dist/shared/version.d.ts +1 -1
  181. package/dist/signal/index.js +2 -2
  182. package/dist/sitemap/index.js +6 -6
  183. package/dist/sync/index.js +6 -6
  184. package/dist/website/images.js +4 -4
  185. package/dist/website/index.js +7 -7
  186. package/dist/website/popups.js +6 -6
  187. package/dist/{writeLLMsTxt-DGKLYXIW.js → writeLLMsTxt-N4Y4YC2H.js} +5 -5
  188. package/docs/MIGRATING-TO-PRESS-KIT.md +83 -0
  189. package/docs.json +145 -29
  190. package/package.json +15 -5
  191. package/src/articles/README.md +5 -360
  192. package/src/mcp/README.md +16 -0
  193. package/src/og/README.md +1 -1
  194. package/src/runtime/README.md +4 -0
  195. package/dist/SiteChat-JSHPGAE3.js +0 -6
  196. package/dist/SiteDesignReporter-L2JBAKKK.js +0 -12
  197. package/dist/SitemapSync-VV2YSMIW.js +0 -9
  198. package/dist/article-tables-AXSZOGNW.js +0 -2
@@ -1,12 +1,13 @@
1
1
  'use client';
2
- export { FormClient, ManagedForm } from '../chunk-GWP2VBFH.js';
2
+ export { configureFormsApi, defineForm, field, formsApi, initializeForms } from '../chunk-BLCHQIWR.js';
3
+ export { FormClient, ManagedForm } from '../chunk-J4KX2D3Q.js';
4
+ import '../chunk-44GVU5UH.js';
3
5
  export { DatePicker } from '../chunk-SOD2F6C2.js';
4
6
  export { FormCelebration } from '../chunk-YGGDU6C3.js';
5
- import '../chunk-JC2VS2SB.js';
6
- export { useForm, useFormTracking } from '../chunk-YBAFUM3Z.js';
7
+ export { useForm, useFormTracking } from '../chunk-JV5YWTJN.js';
7
8
  import '../chunk-Q6E4OPGG.js';
8
9
  import '../chunk-5ROTTMBL.js';
9
- export { FormEnhancer } from '../chunk-SMYX3AAO.js';
10
+ export { FormEnhancer } from '../chunk-LEGMPX6N.js';
10
11
  import '../chunk-C2FZBUSS.js';
11
12
  import '../chunk-YC7ELZS3.js';
12
13
  import '../chunk-DXO6SBMD.js';
@@ -17,325 +18,8 @@ import '../chunk-NJCTQH2P.js';
17
18
  import '../chunk-L2V5PUFN.js';
18
19
  import '../chunk-5TM3WPCI.js';
19
20
  import '../chunk-GJWI74ZZ.js';
20
- import { readPublishedApiConfig } from '../chunk-3G7YABRA.js';
21
- import { sonorFetch } from '../chunk-727R7C5R.js';
22
- import '../chunk-3EU6S5YC.js';
23
- import '../chunk-Q72M5KBS.js';
21
+ import '../chunk-3VSFOD2Z.js';
22
+ import '../chunk-RBNHRZGD.js';
23
+ import '../chunk-W7OPEMGJ.js';
24
+ import '../chunk-5S7YTOCB.js';
24
25
  import '../chunk-PKBMQBKP.js';
25
-
26
- // src/forms/formsApi.ts
27
- var config = null;
28
- function configureFormsApi(options) {
29
- config = options;
30
- }
31
- function getConfig() {
32
- if (config) return config;
33
- const { apiUrl, apiKey } = readPublishedApiConfig();
34
- if (apiUrl && apiKey) {
35
- return { baseUrl: apiUrl, apiKey };
36
- }
37
- throw new Error(
38
- "Forms API not configured. Use SiteKitLayout in your root layout or call configureFormsApi() first."
39
- );
40
- }
41
- async function apiRequest(method, path, body) {
42
- const { baseUrl, apiKey, getAuthToken } = getConfig();
43
- const headers = {
44
- "Content-Type": "application/json"
45
- };
46
- if (apiKey) {
47
- headers["x-api-key"] = apiKey;
48
- } else if (getAuthToken) {
49
- const token = await getAuthToken();
50
- headers["Authorization"] = `Bearer ${token}`;
51
- }
52
- const response = await sonorFetch(`${baseUrl}${path}`, {
53
- method,
54
- headers,
55
- body: body ? JSON.stringify(body) : void 0
56
- }, { retries: 0 });
57
- if (!response.ok) {
58
- const error = await response.json().catch(() => ({ message: response.statusText }));
59
- throw new Error(error.message || `API error: ${response.status}`);
60
- }
61
- if (response.status === 204) {
62
- return void 0;
63
- }
64
- return response.json();
65
- }
66
- var formsApi = {
67
- /**
68
- * List all forms for a project
69
- */
70
- async list(options = {}) {
71
- const params = new URLSearchParams();
72
- if (options.projectId) params.set("projectId", options.projectId);
73
- if (options.formType) params.set("formType", options.formType);
74
- if (options.isActive !== void 0) params.set("isActive", String(options.isActive));
75
- if (options.search) params.set("search", options.search);
76
- const query = params.toString();
77
- const result = await apiRequest("GET", `/forms${query ? `?${query}` : ""}`);
78
- return result.data;
79
- },
80
- /**
81
- * Get a single form by ID or slug
82
- */
83
- async get(idOrSlug) {
84
- return apiRequest("GET", `/forms/${idOrSlug}`);
85
- },
86
- /**
87
- * Create a new form
88
- */
89
- async create(input) {
90
- return apiRequest("POST", "/forms", input);
91
- },
92
- /**
93
- * Update an existing form
94
- */
95
- async update(id, input) {
96
- return apiRequest("PUT", `/forms/${id}`, input);
97
- },
98
- /**
99
- * Delete a form
100
- */
101
- async delete(id) {
102
- return apiRequest("DELETE", `/forms/${id}`);
103
- },
104
- /**
105
- * Add a field to an existing form
106
- */
107
- async addField(formId, field2) {
108
- const form = await formsApi.get(formId);
109
- const maxSortOrder = Math.max(0, ...(form.fields || []).map((f) => f.sortOrder || 0));
110
- return formsApi.update(formId, {
111
- fields: [
112
- ...form.fields || [],
113
- { ...field2, sortOrder: field2.sortOrder ?? maxSortOrder + 1 }
114
- ]
115
- });
116
- },
117
- /**
118
- * Update a field in an existing form
119
- */
120
- async updateField(formId, fieldSlug, updates) {
121
- const form = await formsApi.get(formId);
122
- return formsApi.update(formId, {
123
- fields: (form.fields || []).map(
124
- (f) => f.slug === fieldSlug ? { ...f, ...updates } : f
125
- )
126
- });
127
- },
128
- /**
129
- * Remove a field from a form
130
- */
131
- async removeField(formId, fieldSlug) {
132
- const form = await formsApi.get(formId);
133
- return formsApi.update(formId, {
134
- fields: (form.fields || []).filter((f) => f.slug !== fieldSlug)
135
- });
136
- },
137
- /**
138
- * Reorder fields in a form
139
- */
140
- async reorderFields(formId, fieldSlugs) {
141
- const form = await formsApi.get(formId);
142
- const fieldsMap = new Map((form.fields || []).map((f) => [f.slug, f]));
143
- const orderedFields = fieldSlugs.map((slug, index) => {
144
- const field2 = fieldsMap.get(slug);
145
- if (!field2) throw new Error(`Field not found: ${slug}`);
146
- return { ...field2, sortOrder: index };
147
- });
148
- return formsApi.update(formId, { fields: orderedFields });
149
- },
150
- /**
151
- * Clone a form
152
- */
153
- async clone(formId, newSlug, newName) {
154
- const form = await formsApi.get(formId);
155
- return formsApi.create({
156
- projectId: form.projectId,
157
- slug: newSlug,
158
- name: newName || `${form.name} (Copy)`,
159
- description: form.description,
160
- formType: form.formType,
161
- successMessage: form.successMessage,
162
- redirectUrl: form.redirectUrl,
163
- notificationEmails: form.notificationEmails,
164
- submitButtonText: form.submitButtonText,
165
- layout: form.layout,
166
- showProgress: form.showProgress,
167
- enableSaveDraft: form.enableSaveDraft,
168
- isActive: false,
169
- // Clone as inactive
170
- fields: (form.fields || []).map(({ id, ...field2 }) => field2),
171
- // Remove IDs
172
- steps: (form.steps || []).map(({ id, ...step }) => step)
173
- // Remove IDs
174
- });
175
- },
176
- /**
177
- * Activate or deactivate a form
178
- */
179
- async setActive(formId, isActive) {
180
- return formsApi.update(formId, { isActive });
181
- },
182
- /**
183
- * Sync a form definition to the backend
184
- * Creates the form if it doesn't exist, updates if it does
185
- * Perfect for defining forms in code during development
186
- *
187
- * @example
188
- * ```tsx
189
- * // In your app initialization or form component
190
- * await formsApi.sync({
191
- * slug: 'contact',
192
- * name: 'Contact Form',
193
- * formType: 'prospect',
194
- * fields: [
195
- * field.text('name', 'Your Name', { isRequired: true }),
196
- * field.email('email', 'Email Address'),
197
- * field.phone('phone', 'Phone Number'),
198
- * field.textarea('message', 'Message'),
199
- * ]
200
- * })
201
- * ```
202
- */
203
- async sync(input) {
204
- return apiRequest(
205
- "POST",
206
- "/api/public/forms/sync",
207
- input
208
- );
209
- },
210
- /**
211
- * Sync multiple forms at once
212
- * Useful for initializing all forms in your app
213
- *
214
- * Runs sequentially to avoid bursting the API (many hosts throttle concurrent POSTs → 429).
215
- */
216
- async syncAll(forms) {
217
- const results = [];
218
- for (const form of forms) {
219
- results.push(await formsApi.sync(form));
220
- }
221
- return results;
222
- }
223
- };
224
- var field = {
225
- text: (slug, label, options) => ({
226
- slug,
227
- label,
228
- fieldType: "text",
229
- ...options
230
- }),
231
- email: (slug, label, options) => ({
232
- slug,
233
- label,
234
- fieldType: "email",
235
- isRequired: true,
236
- ...options
237
- }),
238
- phone: (slug, label, options) => ({
239
- slug,
240
- label,
241
- fieldType: "phone",
242
- ...options
243
- }),
244
- textarea: (slug, label, options) => ({
245
- slug,
246
- label,
247
- fieldType: "textarea",
248
- ...options
249
- }),
250
- select: (slug, label, choices, options) => ({
251
- slug,
252
- label,
253
- fieldType: "select",
254
- options: choices,
255
- ...options
256
- }),
257
- radio: (slug, label, choices, options) => ({
258
- slug,
259
- label,
260
- fieldType: "radio",
261
- options: choices,
262
- ...options
263
- }),
264
- checkbox: (slug, label, options) => ({
265
- slug,
266
- label,
267
- fieldType: "checkbox",
268
- ...options
269
- }),
270
- date: (slug, label, options) => ({
271
- slug,
272
- label,
273
- fieldType: "date",
274
- ...options
275
- }),
276
- number: (slug, label, options) => ({
277
- slug,
278
- label,
279
- fieldType: "number",
280
- ...options
281
- }),
282
- rating: (slug, label, options) => ({
283
- slug,
284
- label,
285
- fieldType: "rating",
286
- ...options
287
- }),
288
- file: (slug, label, options) => ({
289
- slug,
290
- label,
291
- fieldType: "file",
292
- ...options
293
- }),
294
- hidden: (slug, defaultValue) => ({
295
- slug,
296
- label: "",
297
- fieldType: "hidden",
298
- defaultValue
299
- }),
300
- heading: (slug, label) => ({
301
- slug,
302
- label,
303
- fieldType: "heading"
304
- }),
305
- paragraph: (slug, label) => ({
306
- slug,
307
- label,
308
- fieldType: "paragraph"
309
- })
310
- };
311
- function defineForm(definition) {
312
- const fieldsWithOrder = definition.fields.map((f, index) => ({
313
- ...f,
314
- sortOrder: f.sortOrder ?? index
315
- }));
316
- return {
317
- ...definition,
318
- fields: fieldsWithOrder,
319
- formType: definition.formType || "contact",
320
- successMessage: definition.successMessage || "Thank you for your submission!",
321
- submitButtonText: definition.submitButtonText || "Submit",
322
- layout: definition.layout || "stacked",
323
- isActive: definition.isActive ?? true
324
- };
325
- }
326
- async function initializeForms(forms) {
327
- if (typeof window === "undefined") {
328
- console.log(`[Site-Kit] ${forms.length} form(s) ready to sync: ${forms.map((f) => f.slug).join(", ")}`);
329
- return;
330
- }
331
- try {
332
- const results = await formsApi.syncAll(forms);
333
- const created = results.filter((r) => r.created).length;
334
- const updated = results.filter((r) => r.updated).length;
335
- console.log(`[Site-Kit] Forms synced: ${created} created, ${updated} updated`);
336
- } catch (error) {
337
- console.error("[Site-Kit] Failed to sync forms:", error);
338
- }
339
- }
340
-
341
- export { configureFormsApi, defineForm, field, formsApi, initializeForms };
@@ -1,5 +1,5 @@
1
- export { ServerForm, getFormConfig } from '../chunk-BQZPHICL.js';
2
- import '../chunk-SMYX3AAO.js';
1
+ export { ServerForm, getFormConfig } from '../chunk-YM5KMNTU.js';
2
+ import '../chunk-LEGMPX6N.js';
3
3
  import '../chunk-C2FZBUSS.js';
4
4
  import '../chunk-YC7ELZS3.js';
5
5
  export { StaticForm } from '../chunk-LNSF6BJC.js';
@@ -167,6 +167,11 @@ export type FormSubmitOutcome = {
167
167
  totalSteps: number;
168
168
  };
169
169
  export interface FormSubmitResult {
170
+ /** Receipt only; never exposes existing subscriber membership to the public. */
171
+ publicationEnrollment?: {
172
+ status: 'accepted';
173
+ message: string;
174
+ };
170
175
  success: boolean;
171
176
  /** The form_submissions row id (same as submissionId). */
172
177
  id: string;
@@ -120,6 +120,10 @@ export interface UseFormReturn {
120
120
  /** Submission state */
121
121
  isSubmitting: boolean;
122
122
  isComplete: boolean;
123
+ /** Accepted server receipt, distinct from confirmed newsletter enrollment. */
124
+ submissionResult: FormSubmitResult | null;
125
+ /** Retry loading configuration, preserving the visitor's entered values. */
126
+ reload: () => void;
123
127
  /** Reset form to initial state */
124
128
  reset: () => void;
125
129
  /**
@@ -1,6 +1,6 @@
1
- export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-7FSB2EXS.js';
1
+ export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-OKITZFML.js';
2
2
  export { ManagedFavicon, getManagedFaviconUrl } from '../chunk-GW7GSBO7.js';
3
- import '../chunk-727R7C5R.js';
4
- import '../chunk-3EU6S5YC.js';
5
- import '../chunk-Q72M5KBS.js';
3
+ import '../chunk-3VSFOD2Z.js';
4
+ import '../chunk-RBNHRZGD.js';
5
+ import '../chunk-5S7YTOCB.js';
6
6
  import '../chunk-PKBMQBKP.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { SITE_KIT_VERSION } from './chunk-Q72M5KBS.js';
1
+ export { SITE_KIT_VERSION } from './chunk-5S7YTOCB.js';
2
2
  import './chunk-PKBMQBKP.js';
@@ -1,8 +1,8 @@
1
1
  'use client';
2
- export { SiteKitClientProviders } from '../chunk-I6QFPSUU.js';
2
+ export { SiteKitClientProviders } from '../chunk-KASKB7UK.js';
3
3
  import '../chunk-6G43IRWR.js';
4
- import '../chunk-5ZCY36TY.js';
5
- import '../chunk-WSNG2K3T.js';
4
+ import '../chunk-MZX4EN6Z.js';
5
+ import '../chunk-5TDZHIG6.js';
6
6
  import '../chunk-ZTZQPYP6.js';
7
7
  import '../chunk-YC7ELZS3.js';
8
8
  import '../chunk-FESKKJAS.js';
@@ -10,11 +10,11 @@ import '../chunk-A4CC4ZG3.js';
10
10
  import '../chunk-ZKADJNR2.js';
11
11
  import '../chunk-5TM3WPCI.js';
12
12
  import '../chunk-GJWI74ZZ.js';
13
- import '../chunk-CAH4Y4PY.js';
13
+ import '../chunk-DLM4FFNH.js';
14
14
  import '../chunk-EKBEOXTH.js';
15
- import '../chunk-3G7YABRA.js';
16
- import '../chunk-727R7C5R.js';
17
- import '../chunk-3EU6S5YC.js';
18
- import '../chunk-Q72M5KBS.js';
19
- import '../chunk-WYZ4OUON.js';
15
+ import '../chunk-3VSFOD2Z.js';
16
+ import '../chunk-RBNHRZGD.js';
17
+ import '../chunk-W7OPEMGJ.js';
18
+ import '../chunk-5S7YTOCB.js';
19
+ import '../chunk-4HYIDQJJ.js';
20
20
  import '../chunk-PKBMQBKP.js';
@@ -1,11 +1,11 @@
1
- import { SiteKitClientProviders } from '../chunk-I6QFPSUU.js';
1
+ import { SiteKitClientProviders } from '../chunk-KASKB7UK.js';
2
2
  import '../chunk-6G43IRWR.js';
3
- import '../chunk-5ZCY36TY.js';
4
- import '../chunk-WSNG2K3T.js';
3
+ import '../chunk-MZX4EN6Z.js';
4
+ import '../chunk-5TDZHIG6.js';
5
5
  import '../chunk-ZTZQPYP6.js';
6
6
  import { ManagedFavicon } from '../chunk-GW7GSBO7.js';
7
7
  import '../chunk-YC7ELZS3.js';
8
- import { resolveClientCredential } from '../chunk-ZM2FNWIQ.js';
8
+ import { resolveClientCredential } from '../chunk-LPVEBQVL.js';
9
9
  import '../chunk-UAYAJPEP.js';
10
10
  import { ManagedScripts } from '../chunk-MVLMXC44.js';
11
11
  import { resolveApiOrigin } from '../chunk-C7TLGL3R.js';
@@ -15,13 +15,13 @@ import '../chunk-A4CC4ZG3.js';
15
15
  import '../chunk-ZKADJNR2.js';
16
16
  import '../chunk-5TM3WPCI.js';
17
17
  import '../chunk-GJWI74ZZ.js';
18
- import '../chunk-CAH4Y4PY.js';
18
+ import '../chunk-DLM4FFNH.js';
19
19
  import '../chunk-EKBEOXTH.js';
20
- import '../chunk-3G7YABRA.js';
21
- import '../chunk-727R7C5R.js';
22
- import '../chunk-3EU6S5YC.js';
23
- import '../chunk-Q72M5KBS.js';
24
- import '../chunk-WYZ4OUON.js';
20
+ import '../chunk-3VSFOD2Z.js';
21
+ import '../chunk-RBNHRZGD.js';
22
+ import '../chunk-W7OPEMGJ.js';
23
+ import '../chunk-5S7YTOCB.js';
24
+ import '../chunk-4HYIDQJJ.js';
25
25
  import '../chunk-PKBMQBKP.js';
26
26
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
27
27
 
@@ -1,13 +1,13 @@
1
- export { createLLMsFullTxtHandler, createLLMsTxtHandler, formatSourcedFactsSection, llmsResponseHeaders } from '../chunk-575L73NT.js';
1
+ export { createLLMsFullTxtHandler, createLLMsTxtHandler, formatSourcedFactsSection, llmsResponseHeaders } from '../chunk-DS6LECIX.js';
2
2
  export { buildAiDiscoveryHeaders, wantsLlmsDiscoveryLink } from '../chunk-PO2TRJPY.js';
3
3
  export { AI_RETRIEVAL_CRAWLERS, AI_TRAINING_CRAWLERS, buildAiCrawlerRules, createRobotsTxtHandler } from '../chunk-QLTDFUJ7.js';
4
- export { LEGACY_PUBLICATION_PATH, SEO_REVALIDATION_MAX_BODY_BYTES, SEO_REVALIDATION_MAX_ITEMS, createLlmsRevalidateHandler, createSeoRevalidationHandler, parseSeoRevalidationPayload } from '../chunk-X7VKRHFF.js';
4
+ export { LEGACY_PUBLICATION_PATH, SEO_REVALIDATION_MAX_BODY_BYTES, SEO_REVALIDATION_MAX_ITEMS, createLlmsRevalidateHandler, createSeoRevalidationHandler, parseSeoRevalidationPayload } from '../chunk-XENW66OF.js';
5
5
  export { AEOBlock, AEOCitedContent, AEOClaim, AEOComparison, AEODefinition, AEOEntity, AEOProvenanceList, AEOStep, AEOSteps, AEOSummary, DEFAULT_SPEAKABLE_SELECTORS, SpeakableSchema, createSpeakableSchema, getSpeakableSelectorsForPage } from '../chunk-PSAG45YF.js';
6
6
  import '../chunk-XTRZGXB2.js';
7
- export { AGENT_ACCESS_HEADING, appendAgentAccessSection, describesMcp, detectMcpServer, formatAgentAccessSection, generateLLMsFullTxt, generateLLMsTxt, writeLLMsTxtToPublic } from '../chunk-WACWV5EP.js';
8
- export { getBusinessInfo, getFAQItems, getLLMsData, getOptimizedLLMsTxt, getPageSummaries, getServices } from '../chunk-JIH32RH2.js';
9
- import '../chunk-L5UOHS6E.js';
10
- import '../chunk-WMVK77ND.js';
7
+ export { AGENT_ACCESS_HEADING, appendAgentAccessSection, describesMcp, detectMcpServer, formatAgentAccessSection, generateLLMsFullTxt, generateLLMsTxt, writeLLMsTxtToPublic } from '../chunk-CE7VPAEH.js';
8
+ export { getBusinessInfo, getFAQItems, getLLMsData, getOptimizedLLMsTxt, getPageSummaries, getServices } from '../chunk-XA7Q2VQA.js';
9
+ import '../chunk-5D7ZISUP.js';
10
+ import '../chunk-4K735O3J.js';
11
11
  import '../chunk-UAYAJPEP.js';
12
12
  export { LLMS_DISCLAIMER_MAX_LENGTH, LLMS_PUBLIC_SUMMARY_MAX_LENGTH, LLM_GEO_CONTRACT_VERSION, MANAGED_LLM_SCHEMA_KNOWN_KEYS, pickManagedLlmSchemaForJsonLd, sanitizeLlmsDisclaimerLine, sanitizeLlmsPublicSummary, sanitizePrimaryLanguageTag } from '../chunk-NZ4RXN3G.js';
13
13
  import '../chunk-4KZ6W3ZH.js';
@@ -15,6 +15,6 @@ import '../chunk-MJP63SSS.js';
15
15
  import '../chunk-YVKRYQRG.js';
16
16
  import '../chunk-FESKKJAS.js';
17
17
  import '../chunk-A4CC4ZG3.js';
18
- import '../chunk-3G7YABRA.js';
19
- import '../chunk-Q72M5KBS.js';
18
+ import '../chunk-W7OPEMGJ.js';
19
+ import '../chunk-5S7YTOCB.js';
20
20
  import '../chunk-PKBMQBKP.js';
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { monotonicMs } from '../chunk-MH2DSGC6.js';
3
- import { getClientApiConfig } from '../chunk-3G7YABRA.js';
4
- import { sonorFetch } from '../chunk-727R7C5R.js';
5
- import '../chunk-3EU6S5YC.js';
6
- import '../chunk-Q72M5KBS.js';
3
+ import { sonorFetch } from '../chunk-3VSFOD2Z.js';
4
+ import '../chunk-RBNHRZGD.js';
5
+ import { getClientApiConfig } from '../chunk-W7OPEMGJ.js';
6
+ import '../chunk-5S7YTOCB.js';
7
7
  import '../chunk-PKBMQBKP.js';
8
8
  import { useState, useCallback, useEffect } from 'react';
9
9
  import { APIProvider, Map as Map$1, AdvancedMarker, Pin, InfoWindow } from '@vis.gl/react-google-maps';
@@ -41,8 +41,49 @@
41
41
  import 'server-only';
42
42
  import { type McpServerDefinition } from './protocol';
43
43
  import type { McpServerInfo, SiteKitMcpTool } from './types';
44
+ import { type PublicationRoutingOptions } from '../articles/routes';
44
45
  export { reportToolCallsToSonor } from './report';
45
46
  export type { ReportToolCallsOptions } from './report';
47
+ /** The public fields article tools read. Readers can come from Press Kit or a site's own CMS. */
48
+ export interface McpArticle {
49
+ slug: string;
50
+ title: string;
51
+ excerpt?: string;
52
+ content?: string;
53
+ content_html?: string;
54
+ canonical_url?: string;
55
+ author?: unknown;
56
+ category?: unknown;
57
+ published_at?: string;
58
+ faq_items?: {
59
+ question: string;
60
+ answer: string;
61
+ }[];
62
+ editorial_photos?: {
63
+ url: string;
64
+ alt: string;
65
+ caption?: string;
66
+ width: number;
67
+ height: number;
68
+ placement: {
69
+ kind: 'after_intro';
70
+ } | {
71
+ kind: 'after_heading';
72
+ heading: string;
73
+ headingId?: string;
74
+ };
75
+ }[];
76
+ }
77
+ /** Pass getAllArticles and getArticle from @sonordev/press-kit/articles/server. */
78
+ export interface McpArticleReaders {
79
+ readMany: (options: {
80
+ maxPosts: number;
81
+ site?: string;
82
+ }) => Promise<McpArticle[]>;
83
+ readOne: (slug: string, options: {
84
+ site?: string;
85
+ }) => Promise<McpArticle | null>;
86
+ }
46
87
  /**
47
88
  * One priced thing a business sells, as `list_offerings` reads it. Only the
48
89
  * fields the tool uses, so any source of offerings can supply them; the
@@ -89,10 +130,12 @@ export interface SonorMcpOptions {
89
130
  siteUrl?: string;
90
131
  /** Sub-site host on a multi-site project. Default: resolved from NEXT_PUBLIC_SITE_URL. */
91
132
  site?: string;
92
- /** Articles live under this path (`/blog/<slug>`). `false` drops the article tools. Default '/blog'. */
93
- articles?: {
133
+ /** Articles live under this path. Pass Press Kit's getAllArticles/getArticle as readMany/readOne.
134
+ * Omitting both readers retains the 8.x legacy adapter. false drops article tools. Default '/blog'. */
135
+ articles?: ({
94
136
  path?: string;
95
- } | false;
137
+ routing?: PublicationRoutingOptions;
138
+ } & Partial<McpArticleReaders>) | false;
96
139
  /** `false` drops get_reviews (a site with no reviews in Sonor). */
97
140
  reviews?: boolean;
98
141
  /**