@sonordev/site-kit 8.6.0 → 8.7.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 (153) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/agent-manifest.json +1 -1
  3. package/dist/{AnalyticsProvider-GVJYL6XY.js → AnalyticsProvider-3UIQMIRW.js} +6 -6
  4. package/dist/{ArticleViewTracker-AOJXEBYM.js → ArticleViewTracker-KNXP2DXL.js} +5 -5
  5. package/dist/{BlocksPopup-AJ3CKVQG.js → BlocksPopup-DFE32GPX.js} +9 -8
  6. package/dist/{ChatWidget-EYBVB5SZ.js → ChatWidget-L74L4YAD.js} +5 -5
  7. package/dist/{FileField-UEQYIFRO.js → FileField-P3PLEAON.js} +3 -3
  8. package/dist/{FormSpotlight-H73ZZ66T.js → FormSpotlight-DNBSBRIE.js} +1 -1
  9. package/dist/{FormStage-2PLWWYBW.js → FormStage-I4JGLT57.js} +1 -1
  10. package/dist/{ManagedForm-ZQOFXEWS.js → ManagedForm-GJRGBM6W.js} +6 -6
  11. package/dist/{ManagedNewsletterForm-5TE47YZD.js → ManagedNewsletterForm-AUZ6YB7G.js} +9 -9
  12. package/dist/{SignalCore-FEFNMNYN.js → SignalCore-UV7K7PT4.js} +5 -5
  13. package/dist/SiteChat-6UWE545R.js +6 -0
  14. package/dist/SiteDesignReporter-ZSU76DZJ.js +13 -0
  15. package/dist/{SitePopups-C44YTQ3Q.js → SitePopups-XHWU7GNF.js} +6 -6
  16. package/dist/SitemapSync-ELWV6W7Y.js +9 -0
  17. package/dist/_client/booking-widget.js +5 -5
  18. package/dist/affiliates/index.js +3 -3
  19. package/dist/analytics/content-text.d.ts +17 -0
  20. package/dist/analytics/index.js +6 -6
  21. package/dist/{article-styles-VASFBYA3.js → article-styles-D7VCDXMG.js} +2 -1
  22. package/dist/article-tables-W45BE353.js +3 -0
  23. package/dist/articles/index.js +7 -20
  24. package/dist/articles/server-ui.js +29 -55
  25. package/dist/articles/server.js +6 -5
  26. package/dist/chat/index.js +8 -8
  27. package/dist/{chunk-3RDJKIYO.js → chunk-2WDWQI7K.js} +1 -1
  28. package/dist/{chunk-NI6ZTP3D.js → chunk-36ZMNBXZ.js} +1 -1
  29. package/dist/chunk-3MJNBOUO.js +8 -0
  30. package/dist/{chunk-ZZSAWXWD.js → chunk-3MLWIBHX.js} +1 -1
  31. package/dist/{chunk-BF7TZYC3.js → chunk-52KO4LKD.js} +1 -1
  32. package/dist/{chunk-U34O6I7W.js → chunk-5WHBYQJ4.js} +3 -3
  33. package/dist/{chunk-5D7ZISUP.js → chunk-7DYMM6SS.js} +11 -6
  34. package/dist/{chunk-GFY3E7EQ.js → chunk-7YB3QA4P.js} +15 -7
  35. package/dist/{chunk-6AWIUO2Z.js → chunk-A2MDVP47.js} +1 -1
  36. package/dist/{chunk-E4PTMORJ.js → chunk-AL5UCWLI.js} +23 -8
  37. package/dist/{chunk-O3Z5HHFP.js → chunk-BAJUXQTH.js} +2 -2
  38. package/dist/{chunk-IGAIQ2B3.js → chunk-BJYX6SFI.js} +2 -2
  39. package/dist/{chunk-72F44HKL.js → chunk-DJIGFX33.js} +1 -1
  40. package/dist/{chunk-AJG74ZZV.js → chunk-DPYGC7WE.js} +1 -1
  41. package/dist/{chunk-XA7Q2VQA.js → chunk-EK7P62DT.js} +1 -1
  42. package/dist/chunk-FXR5PJDL.js +420 -0
  43. package/dist/{chunk-OWO3RFEX.js → chunk-G5FD7UXK.js} +1 -1
  44. package/dist/{chunk-KTMHRXDT.js → chunk-HM7CDWFK.js} +1 -1
  45. package/dist/{chunk-CMUD37WV.js → chunk-HWQPCZOX.js} +1 -1
  46. package/dist/{chunk-6KU7STM3.js → chunk-HY7ZEU2C.js} +3 -1
  47. package/dist/chunk-IBHBEUZV.js +27 -0
  48. package/dist/{chunk-NUXXFCIT.js → chunk-IXZBOOAD.js} +4 -4
  49. package/dist/chunk-JESLPEST.js +14 -0
  50. package/dist/{chunk-BC7JMY4Z.js → chunk-JG53YJLM.js} +58 -1
  51. package/dist/{chunk-VA6IJ55K.js → chunk-JWCCY72G.js} +1 -1
  52. package/dist/{chunk-RI2N2EBI.js → chunk-JYITKUUB.js} +13 -5
  53. package/dist/chunk-KIYACQW3.js +1 -0
  54. package/dist/{chunk-OFSV5TZY.js → chunk-KLIDCNML.js} +1 -1
  55. package/dist/{chunk-7R2STOVD.js → chunk-L2KSHJS2.js} +3 -3
  56. package/dist/{chunk-HMTPRBYJ.js → chunk-LGWN6KCN.js} +1 -1
  57. package/dist/{chunk-YNBRVVTX.js → chunk-MJW6YIDJ.js} +1 -1
  58. package/dist/{chunk-BUE3Z32O.js → chunk-MNORERMF.js} +1 -1
  59. package/dist/{chunk-Y35BWW2C.js → chunk-ODOV76VW.js} +1 -1
  60. package/dist/{chunk-6NXFA7HE.js → chunk-OHLCE4GC.js} +2 -2
  61. package/dist/{chunk-QQT2T6JQ.js → chunk-P5PRR2BB.js} +1 -1
  62. package/dist/{chunk-JJ4JS3LD.js → chunk-PAYCK7FC.js} +1 -1
  63. package/dist/{chunk-DLM4FFNH.js → chunk-QTBAKOCZ.js} +1 -1
  64. package/dist/{chunk-L6QTERSH.js → chunk-RHT7OZNF.js} +1 -1
  65. package/dist/{chunk-YJH6WE76.js → chunk-RWWSOYJO.js} +9 -9
  66. package/dist/{chunk-JSW42BHL.js → chunk-T6TWPKBL.js} +1 -1
  67. package/dist/{chunk-FTSEP7Q3.js → chunk-U4OQJQK6.js} +3 -3
  68. package/dist/{chunk-IYCSDFPN.js → chunk-UYOE3HA4.js} +2 -2
  69. package/dist/chunk-VEJD5EJ2.js +344 -0
  70. package/dist/chunk-XAZC2TUD.js +1119 -0
  71. package/dist/{chunk-DSD3XZQQ.js → chunk-XC2TWYDV.js} +3 -3
  72. package/dist/{chunk-URJN75ZG.js → chunk-XIDWNXZN.js} +3 -3
  73. package/dist/chunk-XLAHRN4B.js +1 -0
  74. package/dist/{chunk-V67OD7RW.js → chunk-XZFOQ2V4.js} +113 -93
  75. package/dist/{chunk-QNOJSSQT.js → chunk-YYPYLYZM.js} +1 -1
  76. package/dist/client/index.js +4 -4
  77. package/dist/contracts/campaign-normalize.d.ts +2 -0
  78. package/dist/contracts/entries.d.ts +1 -1
  79. package/dist/contracts/funnels.d.ts +576 -0
  80. package/dist/contracts/inbox.d.ts +42 -0
  81. package/dist/contracts/llms.d.ts +200 -0
  82. package/dist/contracts/portfolio.d.ts +170 -0
  83. package/dist/contracts/publication-branding.d.ts +10 -2
  84. package/dist/contracts/site-cache.d.ts +2 -0
  85. package/dist/fleet/index.js +6 -6
  86. package/dist/forms/index.js +9 -9
  87. package/dist/forms/server.js +2 -2
  88. package/dist/images/index.js +4 -4
  89. package/dist/index.js +1 -1
  90. package/dist/landing/contract.d.ts +2 -13
  91. package/dist/landing/contract.js +2 -0
  92. package/dist/landing/index.js +4 -2
  93. package/dist/landing/managed-server.d.ts +21 -0
  94. package/dist/landing/managed.d.ts +11 -0
  95. package/dist/landing/metadata.js +2 -0
  96. package/dist/landing/server.d.ts +5 -0
  97. package/dist/landing/server.js +19 -2
  98. package/dist/layout/client.js +9 -9
  99. package/dist/layout/index.js +10 -10
  100. package/dist/llms/contract.js +2 -1
  101. package/dist/llms/index.js +9 -7
  102. package/dist/llms/merge.d.ts +29 -0
  103. package/dist/maps/index.js +3 -3
  104. package/dist/mcp/sonor.js +9 -8
  105. package/dist/portfolio/contract.js +1 -1
  106. package/dist/press-kit/articles/article-body.d.ts +13 -0
  107. package/dist/press-kit/articles/article-heading-ids.d.ts +7 -0
  108. package/dist/press-kit/articles/article-headings.d.ts +61 -0
  109. package/dist/press-kit/articles/html-tags.d.ts +46 -0
  110. package/dist/press-kit/articles/types.d.ts +2 -0
  111. package/dist/revalidate/index.js +3 -3
  112. package/dist/runtime/index.js +3 -3
  113. package/dist/seo/client.js +6 -6
  114. package/dist/seo/index.js +14 -13
  115. package/dist/seo/llms/contract.js +2 -1
  116. package/dist/seo/llms.js +9 -7
  117. package/dist/seo/meta/contract.js +2 -1
  118. package/dist/seo/register-sitemap-cli.js +1 -1
  119. package/dist/seo/server.js +5 -4
  120. package/dist/seo/sitemap.js +7 -5
  121. package/dist/seo-meta/contract.js +2 -1
  122. package/dist/server/index.js +3 -3
  123. package/dist/{server-api-EGOKC7Q3.js → server-api-XIKDWSNO.js} +2 -2
  124. package/dist/shared/build-entries.d.ts +3 -1
  125. package/dist/shared/markdown.d.ts +7 -6
  126. package/dist/shared/version.d.ts +1 -1
  127. package/dist/signal/index.js +2 -2
  128. package/dist/sitemap/index.js +7 -5
  129. package/dist/slots/index.js +2 -2
  130. package/dist/sync/index.js +5 -5
  131. package/dist/website/contract.js +2 -1
  132. package/dist/website/images.js +4 -4
  133. package/dist/website/index.js +10 -9
  134. package/dist/website/landing/server.js +19 -2
  135. package/dist/website/landing.js +4 -2
  136. package/dist/website/popups.js +9 -8
  137. package/dist/website/slots.js +2 -2
  138. package/dist/{writeLLMsTxt-KHVHNSDM.js → writeLLMsTxt-QN2HIVT4.js} +6 -4
  139. package/docs.json +5 -0
  140. package/package.json +1 -1
  141. package/src/analytics/README.md +1 -1
  142. package/src/landing/README.md +64 -0
  143. package/src/llms/README.md +52 -20
  144. package/dist/SiteChat-3MKYL2XM.js +0 -6
  145. package/dist/SiteDesignReporter-AJDIBNHI.js +0 -12
  146. package/dist/SitemapSync-UJA6JVPW.js +0 -9
  147. package/dist/article-tables-6XHVULPU.js +0 -2
  148. package/dist/chunk-EKBEOXTH.js +0 -114
  149. package/dist/chunk-NZ4RXN3G.js +0 -145
  150. package/dist/chunk-OSYCOC3K.js +0 -21
  151. /package/dist/{chunk-7ZWO5HDQ.js → chunk-BTHEQDN4.js} +0 -0
  152. /package/dist/{chunk-BQR4IPBW.js → chunk-ISRBSTB7.js} +0 -0
  153. /package/dist/{chunk-IHG36STL.js → chunk-XHYE24HU.js} +0 -0
@@ -6,6 +6,13 @@
6
6
  * `@sonordev/site-kit/seo/llms/contract`.
7
7
  *
8
8
  * @see LLM_GEO_CONTRACT.md in this folder
9
+ *
10
+ * It is also where llms.txt's page notes, page titles and page order are
11
+ * decided, so the Sonor API's index, its fallback file and site-kit's local
12
+ * generator can't disagree: `pickLlmsPageDescription` (summary, curated meta,
13
+ * the page's own meta, the schema description, then a cleaned scrape),
14
+ * `llmsPageTitle`, `isLlmsListablePage`, `selectLlmsPages`, `groupLlmsPages`,
15
+ * `llmsPageListNote` and `llmsContactLines`.
9
16
  */
10
17
  /** Increment when public LLMs payload shape changes incompatibly. */
11
18
  export declare const LLM_GEO_CONTRACT_VERSION: 1;
@@ -29,8 +36,27 @@ export interface LLMsPayloadMeta {
29
36
  llms_disclaimer?: string | null;
30
37
  }
31
38
  export declare function clipAtWordBoundary(text: string, max: number): string;
39
+ /**
40
+ * The text with its phone numbers and email addresses taken out. The business's
41
+ * Contact Information block already carries them, and a page's note is no place
42
+ * for either.
43
+ *
44
+ * Works a sentence at a time: a sentence with a detail in it keeps what comes
45
+ * before the detail (and before a "call" or "email us at" in front of it) when
46
+ * that is still a sentence of four words or more, and is dropped otherwise.
47
+ * "Family-owned HVAC in Cincinnati, call 513-555-1234 today." becomes
48
+ * "Family-owned HVAC in Cincinnati."; "Call 513-555-1234 for a quote." goes.
49
+ * Cutting out only the number would leave "for a quote." behind.
50
+ */
51
+ export declare function stripContactDetails(text: string): string;
52
+ export declare function stripPageFiller(note: string): string;
32
53
  /**
33
54
  * Public-safe summary for llms.txt `[title](url): notes` — never CRM-only or internal copy.
55
+ *
56
+ * A summary that mentions a phone number or an email address loses that part
57
+ * (`stripContactDetails`) and is still used. It used to be thrown away whole,
58
+ * and a page with no summary is described by its scrape, so a well-meant
59
+ * "...call 555-1234" summary made the page's note worse, not safer.
34
60
  */
35
61
  export declare function sanitizeLlmsPublicSummary(raw: unknown): string | null;
36
62
  /**
@@ -53,3 +79,177 @@ export declare function sanitizePrimaryLanguageTag(raw: unknown): string | null;
53
79
  export declare function isEmittableReviewNode(node: Record<string, unknown>): boolean;
54
80
  /** Pick JSON-LD-safe subset of managed_llm_schema for script injection. */
55
81
  export declare function pickManagedLlmSchemaForJsonLd(schema: Record<string, unknown> | null | undefined): Record<string, unknown> | null;
82
+ /** The longest note a page line carries. */
83
+ export declare const LLMS_DESCRIPTION_MAX_LENGTH = 500;
84
+ /**
85
+ * A page's scraped text (seo_pages.content_text) made fit to describe it.
86
+ *
87
+ * The DOM scrape joins elements with nothing between them: a heading, its
88
+ * tagline and the first paragraph arrive as "Getting paid for the
89
+ * workIncome, spending, budgets.Track expenses by vendor", a contact page as
90
+ * "First Name*Last Name*Email*PhoneMessage*Send Message". This puts the
91
+ * whitespace back, drops what is not about the page (form labels, menu items,
92
+ * skip links, cookie banners, "Eyebrow · Section" lines) and returns what is
93
+ * left. It may return '' when nothing worth a note is.
94
+ *
95
+ * It does not cut to a length: the caller clips (`clipAtWordBoundary`). It
96
+ * does not strip phone numbers: that is `stripContactDetails`. `knownTerms`
97
+ * are words written with a capital inside them that must stay whole.
98
+ */
99
+ export declare function cleanScrapedPageText(raw: string | null | undefined, options?: {
100
+ knownTerms?: readonly string[];
101
+ }): string;
102
+ /** Where a page's note came from, best source first. */
103
+ export type LlmsDescriptionSource = 'summary' | 'managed_meta' | 'meta' | 'schema' | 'scrape';
104
+ export interface LlmsDescriptionInput {
105
+ /** The page's own name: a note that only repeats it says nothing. */
106
+ title?: string | null;
107
+ /** seo_pages.llms_public_summary: written for this file. */
108
+ llms_public_summary?: string | null;
109
+ /** seo_pages.managed_meta_description: the curated meta description. */
110
+ managed_meta_description?: string | null;
111
+ /** seo_pages.meta_description: the meta description the page serves. */
112
+ meta_description?: string | null;
113
+ /** The `description` of the page's managed LLM schema. */
114
+ llm_schema_description?: string | null;
115
+ /** seo_pages.content_text: the DOM scrape. */
116
+ content_text?: string | null;
117
+ /**
118
+ * True when the page's managed copy says the page itself is missing
119
+ * (describesErrorPage). That copy, the schema and the page's own meta
120
+ * description are then not used.
121
+ */
122
+ copyWithheld?: boolean;
123
+ }
124
+ /**
125
+ * The note a page's line in llms.txt carries, and where it came from.
126
+ *
127
+ * One rule for every llms.txt Sonor builds, best source first:
128
+ *
129
+ * 1. `llms_public_summary`, written for this file, with a phone number or an
130
+ * email address taken out rather than the whole summary thrown away;
131
+ * 2. `managed_meta_description`, the curated meta description;
132
+ * 3. `meta_description`, the one the page serves;
133
+ * 4. the managed schema's description;
134
+ * 5. the cleaned scrape (`cleanScrapedPageText`), last, because it is the
135
+ * least written of the five.
136
+ *
137
+ * Until 2026-10 the scrape was FIRST: llms.txt, the one file handed straight
138
+ * to AI crawlers, described a contact page as "First Name*Last Name*Email*".
139
+ * Every note is cut at a sentence or word boundary at 500 characters. A scrape
140
+ * that is an error page is not used (`usablePageText`). Returns null when
141
+ * nothing says anything about the page.
142
+ */
143
+ export declare function pickLlmsPageDescription(input: LlmsDescriptionInput): {
144
+ text: string;
145
+ source: LlmsDescriptionSource;
146
+ } | null;
147
+ /** `pickLlmsPageDescription`'s text. */
148
+ export declare function resolveLlmsPageDescription(input: LlmsDescriptionInput): string | null;
149
+ /**
150
+ * The note on a page's line, from what the payload carries: its
151
+ * `llms_public_summary`, then its `description`. With `publicSummaryOnly`
152
+ * (a site that wants strict notes) only the summary counts. Single source of
153
+ * truth for the Sonor API's fallback file and site-kit's local generator, which
154
+ * each had their own copy.
155
+ */
156
+ export declare function llmsPageListNote(page: {
157
+ description?: string | null;
158
+ llms_public_summary?: string | null;
159
+ }, publicSummaryOnly?: boolean): string | undefined;
160
+ export interface LlmsListablePage {
161
+ path: string;
162
+ http_status?: number | null;
163
+ has_noindex?: boolean | null;
164
+ robots_meta?: string | null;
165
+ managed_robots_meta?: string | null;
166
+ }
167
+ /**
168
+ * Whether a live seo_pages row belongs in llms.txt. A page the last visit saw
169
+ * answer with an error (404, 5xx), a page that asks search engines to leave it
170
+ * out, and a utility page (a thank-you page, a cart, a login) are not listed:
171
+ * llms.txt is the index of what a site is, and every dead or unwanted link in
172
+ * it is one a model may follow and cite. Retired pages never get here
173
+ * (LIVE_SEO_PAGE_FILTER).
174
+ */
175
+ export declare function isLlmsListablePage(page: LlmsListablePage): boolean;
176
+ /**
177
+ * What a page is called in llms.txt: its curated title, else the title it
178
+ * serves, else its h1, each with the brand suffix off and only when it is a
179
+ * name and not an address; the home page is `homeName`; else the last segment
180
+ * of its path as a label. Never the path itself: "[/features/accounting]" was
181
+ * what a page with no title got.
182
+ */
183
+ export declare function llmsPageTitle(page: {
184
+ path: string;
185
+ managed_title?: string | null;
186
+ title?: string | null;
187
+ h1?: string | null;
188
+ }, homeName?: string | null): string;
189
+ /**
190
+ * Choose which pages survive a page cap.
191
+ *
192
+ * A round-robin across top-level sections, not a truncation: cutting an
193
+ * alphabetical list amputates its tail. On a 191-page site a cap of 50 kept 37
194
+ * `/industries/*` pages and dropped `/work`, `/pricing`, `/services`,
195
+ * `/web-design` and `/resources` entirely. Every section is represented at any
196
+ * cap, and the survivors keep their original order, because the round-robin
197
+ * decides membership, not presentation. Sections are taken most valuable first
198
+ * (the order `groupLlmsPages` lists them in, legal pages last), so a cap smaller
199
+ * than the number of sections drops the least valuable one.
200
+ *
201
+ * Single source of truth: the Sonor API caps its index with it, and site-kit's
202
+ * local generator caps with it instead of `slice(0, max)`.
203
+ */
204
+ export declare function selectLlmsPages<T extends {
205
+ path: string;
206
+ }>(pages: T[], cap: number): T[];
207
+ export interface LlmsPageGroup<T> {
208
+ /** null for the one list of a small site. */
209
+ heading: string | null;
210
+ pages: T[];
211
+ }
212
+ /**
213
+ * The page index in the order and groups an answer engine reads best: the
214
+ * home page, then the site's top-level pages by value (what it does, where,
215
+ * the proof, who, the cost, contact), then one group per section of the site
216
+ * (`/services/*` is "Services"), biggest unlisted sections last, and the legal
217
+ * pages at the very end. Nothing is dropped or renamed; a list of 12 pages or
218
+ * fewer is one ungrouped list in the same order.
219
+ *
220
+ * Single source of truth for the Sonor API's fallback file and site-kit's
221
+ * local generator.
222
+ */
223
+ export declare function groupLlmsPages<T extends {
224
+ path: string;
225
+ }>(pages: readonly T[]): Array<LlmsPageGroup<T>>;
226
+ /**
227
+ * The one-line summary under the business name: its tagline, else the first
228
+ * sentence of its description, else its name. The first sentence comes from
229
+ * `splitSentences`, not `description.split('.')[0]`, which ends "Smith &
230
+ * Sons, Inc. is a roofing company" at "Inc".
231
+ */
232
+ export declare function llmsBlockquoteSummary(business: {
233
+ name?: string | null;
234
+ tagline?: string | null;
235
+ description?: string | null;
236
+ }): string;
237
+ export interface LlmsContactLike {
238
+ phone?: string | null;
239
+ email?: string | null;
240
+ address?: string | null;
241
+ city?: string | null;
242
+ state?: string | null;
243
+ postal_code?: string | null;
244
+ country?: string | null;
245
+ hours?: unknown;
246
+ }
247
+ /**
248
+ * The bullets of the Contact Information block, none for a field that is
249
+ * empty. An address reads "1 Main St, Springfield, OH 45501", and a
250
+ * default "US" is not printed. Empty array when there is nothing to show, so a
251
+ * caller leaves the whole section out rather than print a bare heading.
252
+ */
253
+ export declare function llmsContactLines(contact: LlmsContactLike | null | undefined): string[];
254
+ /** A page or service link as an absolute URL on the site, so a crawler never resolves it against llms.txt's own address. */
255
+ export declare function llmsAbsoluteUrl(baseUrl: string | null | undefined, pathOrUrl: string): string;
@@ -26,6 +26,176 @@ export interface FrameReadyMessage {
26
26
  export declare function isFrameReadyMessage(data: unknown): data is FrameReadyMessage;
27
27
  /** Bump on breaking changes to the collapse policy. */
28
28
  export declare const PORTFOLIO_CONTRACT_VERSION: 1;
29
+ /** The four beats, in reading order. */
30
+ export declare const CASE_STUDY_STAGES: readonly ['problem', 'build', 'proof', 'outcome'];
31
+ export type CaseStudyStage = (typeof CASE_STUDY_STAGES)[number];
32
+ /** The generic name of each beat and the question its sections answer. */
33
+ export declare const CASE_STUDY_STAGE_COPY: Record<CaseStudyStage, {
34
+ name: string;
35
+ question: string;
36
+ }>;
37
+ /**
38
+ * A site's own names for the four stages ("Heat", "Shape", "Temper",
39
+ * "Finish"), set per project in the dashboard (branding is per project) and
40
+ * read everywhere a stage is named: the editor, the public portfolio config,
41
+ * the site itself. A stage left unnamed falls back to its generic name. The
42
+ * ids never change; only what people see does.
43
+ */
44
+ export type CaseStudyStageNames = Partial<Record<CaseStudyStage, string>>;
45
+ /** The longest a stage name may run. It's a heading word, a rail label, a tab. */
46
+ export declare const STAGE_NAME_MAX_CHARS = 24;
47
+ /**
48
+ * What's wrong with a set of stage names, or an empty list. Absent passes
49
+ * (generic names); present must be an object of short text keyed by stage.
50
+ */
51
+ export declare function stageNamesProblems(names: unknown): string[];
52
+ /** The name a stage is shown under: the site's own when set, else the generic one. */
53
+ export declare function stageName(names: CaseStudyStageNames | null | undefined, stage: CaseStudyStage): string;
54
+ /**
55
+ * Every section type a case study can hold, in canonical reading order:
56
+ * hero, then each stage's sections, then the two that aren't rendered as
57
+ * sections of the story (SEO metadata, the closing CTA). This is THE list;
58
+ * the Sonor API and agency-site-kit import it rather than keeping their own.
59
+ */
60
+ export declare const PORTFOLIO_SECTION_TYPES: readonly ['portfolioHero', 'portfolioChallenges', 'portfolioBeforeAfter', 'portfolioStrategy', 'portfolioSiteArchitecture', 'portfolioDesignSystem', 'portfolioFeatureSpotlight', 'portfolioGallery', 'portfolioVideo', 'portfolioTechStack', 'portfolioPerformance', 'portfolioSpeedComparison', 'portfolioResults', 'portfolioMetricsTimeline', 'portfolioConversionFunnel', 'portfolioServices', 'portfolioTeam', 'portfolioTestimonial', 'portfolioDetails', 'portfolioSeo', 'portfolioCTA'];
61
+ export type PortfolioSectionType = (typeof PORTFOLIO_SECTION_TYPES)[number];
62
+ export declare function isPortfolioSectionType(value: unknown): value is PortfolioSectionType;
63
+ /**
64
+ * Which stage each section belongs to. Null for the hero (it opens the page,
65
+ * above the story), SEO metadata (never rendered as a section) and the CTA
66
+ * (closes the page, after the story). Typed over every section type so a new
67
+ * type without a stage is a compile error, not a section that renders last.
68
+ */
69
+ export declare const SECTION_STAGE: Record<PortfolioSectionType, CaseStudyStage | null>;
70
+ /** The stage a section type belongs to, or null when it sits outside the story. Unknown types are null. */
71
+ export declare function sectionStage(type: string): CaseStudyStage | null;
72
+ /**
73
+ * The one section each stage can't do without. A stage with other sections
74
+ * but not this one is told so by {@link caseStudyStageStatus}: a proof stage
75
+ * that's only a speed comparison has no measurement of the finished build.
76
+ */
77
+ export declare const STAGE_CORE_SECTION: Record<CaseStudyStage, PortfolioSectionType>;
78
+ /**
79
+ * Canonical display order, derived from the list above so it can't disagree
80
+ * with the stages. Renderers sort by this when nobody has reordered; the
81
+ * dashboard's stored order only ever moves a section within its stage.
82
+ */
83
+ export declare const PORTFOLIO_SECTION_ORDER: Record<PortfolioSectionType, number>;
84
+ /** The least a section needs for the ordering helpers: its type. Anything else rides along. */
85
+ export interface SectionLike {
86
+ sectionType: string;
87
+ }
88
+ /**
89
+ * The sections in the order the case study reads.
90
+ *
91
+ * The arc always wins: the hero, then problem, build, proof, outcome, then
92
+ * the CTA. Within a stage, the agency's own order is kept once it has
93
+ * reordered in the dashboard (`sectionsOrdered`); otherwise the canonical
94
+ * order. Before this, a reordered case study rendered in exactly its stored
95
+ * order, so Results could sit above Challenges and the page read backwards.
96
+ * Never mutates.
97
+ */
98
+ export declare function orderSections<T extends SectionLike>(sections: readonly T[] | null | undefined, options?: {
99
+ sectionsOrdered?: boolean;
100
+ }): T[];
101
+ /** One beat of the story with the sections that tell it. */
102
+ export interface CaseStudyStageGroup<T extends SectionLike = SectionLike> {
103
+ stage: CaseStudyStage;
104
+ /** 1-based position among the stages this case study actually has. */
105
+ index: number;
106
+ sections: T[];
107
+ }
108
+ /**
109
+ * The story's beats, in order, each with its sections in reading order
110
+ * ({@link orderSections}). A stage with no sections is left out and the
111
+ * numbering follows, so a software case study with nothing measured runs
112
+ * problem, build, outcome as 1, 2, 3. The hero, SEO and CTA aren't in any
113
+ * group; a renderer places them itself.
114
+ */
115
+ export declare function groupSectionsByStage<T extends SectionLike>(sections: readonly T[] | null | undefined, options?: {
116
+ sectionsOrdered?: boolean;
117
+ }): CaseStudyStageGroup<T>[];
118
+ /** What each stage of a case study has and what it's missing. */
119
+ export interface CaseStudyStageStatus {
120
+ stage: CaseStudyStage;
121
+ /** The section types present, in reading order. */
122
+ present: PortfolioSectionType[];
123
+ /** True when the stage's core section ({@link STAGE_CORE_SECTION}) is present. */
124
+ complete: boolean;
125
+ /** Null when complete; otherwise one sentence on what the stage is missing. */
126
+ missing: string | null;
127
+ }
128
+ /**
129
+ * Each stage's status, all four, in order, whether or not the case study has
130
+ * sections in it. The dashboard shows these beside the editor so an empty
131
+ * proof stage is seen before the case study is published, not after.
132
+ */
133
+ export declare function caseStudyStageStatus(sections: readonly SectionLike[] | null | undefined): CaseStudyStageStatus[];
134
+ export interface CaseStudyNarrative {
135
+ /** One sentence: what this project was, in the end. */
136
+ thesis: string;
137
+ /** One or two sentences opening each stage, specific to this project. A stage may be left unwritten. */
138
+ stages: Partial<Record<CaseStudyStage, string>>;
139
+ }
140
+ /** The longest a thesis or a stage lede may run. Longer is a paragraph, and the sections are the paragraphs. */
141
+ export declare const NARRATIVE_MAX_CHARS = 320;
142
+ /**
143
+ * What's wrong with a narrative, or an empty list when nothing is. An absent
144
+ * narrative is legacy data and passes (renderers fall back to house copy);
145
+ * one that's present must be prose, under the length, with no unknown stage.
146
+ */
147
+ export declare function narrativeProblems(narrative: unknown): string[];
148
+ /** Agent-native contract: JSON Schema for {@link CaseStudyNarrative}. */
149
+ export declare const CASE_STUDY_NARRATIVE_JSON_SCHEMA: {
150
+ readonly $schema: 'http://json-schema.org/draft-07/schema#';
151
+ readonly $id: 'https://sonor.io/schemas/case-study-narrative.v1.json';
152
+ readonly title: 'CaseStudyNarrative';
153
+ readonly description: 'The thesis of a case study and the lede that opens each of its four stages.';
154
+ readonly type: 'object';
155
+ readonly required: readonly ['thesis'];
156
+ readonly properties: {
157
+ readonly thesis: {
158
+ readonly type: 'string';
159
+ readonly minLength: 1;
160
+ readonly maxLength: 320;
161
+ };
162
+ readonly stages: {
163
+ readonly type: 'object';
164
+ readonly properties: {
165
+ [k: string]: {
166
+ type: string;
167
+ maxLength: number;
168
+ };
169
+ };
170
+ readonly additionalProperties: false;
171
+ };
172
+ };
173
+ readonly additionalProperties: false;
174
+ };
175
+ export interface ChallengeLike {
176
+ id?: string | null;
177
+ title?: string;
178
+ }
179
+ export interface PhaseLike {
180
+ resolves?: readonly string[] | null;
181
+ }
182
+ export interface ResultLike {
183
+ proves?: readonly string[] | null;
184
+ }
185
+ /** A stable id for the n-th challenge (1-based): "c1", "c2"… Writers that don't mint their own use this. */
186
+ export declare function challengeId(position: number): string;
187
+ /**
188
+ * The problems with how a case study's story hangs together, each one
189
+ * sentence, or an empty list. Read by the generator's audit and the
190
+ * dashboard. It judges links only where they've been written: a case study
191
+ * whose challenges carry no ids has nothing to check and passes, so legacy
192
+ * content isn't failed for predating the thread.
193
+ */
194
+ export declare function caseStudyFlowProblems(input: {
195
+ challenges?: readonly ChallengeLike[] | null;
196
+ phases?: readonly PhaseLike[] | null;
197
+ results?: readonly ResultLike[] | null;
198
+ }): string[];
29
199
  /** Minimal KPI shape the policy reads — callers pass their own richer tiles. */
30
200
  export interface KpiLike {
31
201
  label: string;
@@ -9,11 +9,12 @@ export type PublicationPlatform = (typeof PUBLICATION_PLATFORMS)[number];
9
9
  /** The sections of a profile and of each platform override, in the order they're read. */
10
10
  export declare const PUBLICATION_BRANDING_SECTIONS: readonly ['identity', 'colors', 'typography', 'editorial', 'newsletter'];
11
11
  export type PublicationBrandingSection = (typeof PUBLICATION_BRANDING_SECTIONS)[number];
12
- export declare const PUBLICATION_IDENTITY_FIELDS: readonly ['publicationName', 'wordmark', 'tagline', 'publisherName', 'publisherUrl', 'publisherLogoUrl', 'logos'];
12
+ export declare const PUBLICATION_IDENTITY_FIELDS: readonly ['publicationName', 'wordmark', 'tagline', 'publisherName', 'publisherUrl', 'publisherLogoUrl', 'logos', 'squareLogoUrl', 'fullLogoUrl'];
13
13
  export declare const PUBLICATION_LOGO_VARIANTS: readonly ['default', 'light', 'dark'];
14
14
  export declare const PUBLICATION_COLOR_FIELDS: readonly ['primary', 'secondary', 'accent', 'background', 'surface', 'text', 'muted', 'border'];
15
15
  export declare const PUBLICATION_TYPOGRAPHY_FIELDS: readonly ['heading', 'body', 'mono', 'emailHeadingFallback', 'emailBodyFallback'];
16
- export declare const PUBLICATION_EDITORIAL_FIELDS: readonly ['articleStyle', 'cardLayout', 'charter', 'siteCharters'];
16
+ export declare const PUBLICATION_EDITORIAL_FIELDS: readonly ['articleStyle', 'cardLayout', 'focusClosingBackground', 'charter', 'siteCharters'];
17
+ export declare const FOCUS_CLOSING_BACKGROUNDS: readonly ['planned_photo', 'article_atmosphere'];
17
18
  export declare const PUBLICATION_NEWSLETTER_FIELDS: readonly ['name', 'tagline', 'layout', 'maxWidth'];
18
19
  /** Fonts every email client has, the only families an email fallback may name. Lowercase. */
19
20
  export declare const EMAIL_SAFE_FONTS: ReadonlySet<string>;
@@ -27,6 +28,11 @@ export interface PublicationIdentity {
27
28
  publisherUrl?: string;
28
29
  /** The publisher's attribution mark, separate from the publication masthead. */
29
30
  publisherLogoUrl?: string;
31
+ /** The publication's square mark; independent of theme variants and publisher attribution. */
32
+ squareLogoUrl?: string;
33
+ /** The publication's full/display logo; wordmark remains a text fallback. */
34
+ fullLogoUrl?: string;
35
+ /** Legacy theme variants, not square/full logo roles. */
30
36
  logos?: {
31
37
  default?: string;
32
38
  light?: string;
@@ -56,6 +62,8 @@ export interface PublicationEditorial {
56
62
  /** Shared Broadcast style for articles, reviews and generated posts; portfolio is excluded. Legacy wire name. */
57
63
  articleStyle?: BroadcastStyleId;
58
64
  cardLayout?: PublicationCardLayout;
65
+ /** Focus closing frames may reuse the article's saved atmosphere and real author portrait. */
66
+ focusClosingBackground?: (typeof FOCUS_CLOSING_BACKGROUNDS)[number];
59
67
  }
60
68
  export interface PublicationNewsletter {
61
69
  name?: string;
@@ -29,6 +29,8 @@ export declare const SITE_CACHE_TAGS: {
29
29
  readonly portfolio: 'portfolio';
30
30
  /** Products, services, events and membership plans (commerce-kit). */
31
31
  readonly commerce: 'commerce';
32
+ /** Published managed landing pages. Draft previews never enter this cache. */
33
+ readonly funnels: 'sonor-funnels';
32
34
  };
33
35
  export type SiteCacheTag = (typeof SITE_CACHE_TAGS)[keyof typeof SITE_CACHE_TAGS];
34
36
  /** The body Sonor POSTs to the revalidation route. */
@@ -1,11 +1,11 @@
1
1
  'use client';
2
- export { FLEET_HEARTBEAT_PATH, FleetHeartbeat, detectNextVersion, sendFleetHeartbeat } from '../chunk-U34O6I7W.js';
2
+ export { FLEET_HEARTBEAT_PATH, FleetHeartbeat, detectNextVersion, sendFleetHeartbeat } from '../chunk-5WHBYQJ4.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-DLM4FFNH.js';
6
- import '../chunk-EKBEOXTH.js';
7
- import '../chunk-IYCSDFPN.js';
8
- import '../chunk-QQT2T6JQ.js';
5
+ import '../chunk-QTBAKOCZ.js';
6
+ import '../chunk-VEJD5EJ2.js';
7
+ import '../chunk-UYOE3HA4.js';
8
+ import '../chunk-P5PRR2BB.js';
9
9
  import '../chunk-W7OPEMGJ.js';
10
- import '../chunk-BUE3Z32O.js';
10
+ import '../chunk-MNORERMF.js';
11
11
  import '../chunk-PKBMQBKP.js';
@@ -1,13 +1,13 @@
1
1
  'use client';
2
- export { configureFormsApi, defineForm, field, formsApi, initializeForms } from '../chunk-L6QTERSH.js';
3
- export { FormClient, ManagedForm } from '../chunk-7R2STOVD.js';
4
- import '../chunk-NI6ZTP3D.js';
5
- export { DatePicker } from '../chunk-SOD2F6C2.js';
2
+ export { configureFormsApi, defineForm, field, formsApi, initializeForms } from '../chunk-RHT7OZNF.js';
6
3
  export { FormCelebration } from '../chunk-YGGDU6C3.js';
7
- export { useForm, useFormTracking } from '../chunk-HMTPRBYJ.js';
4
+ export { FormClient, ManagedForm } from '../chunk-L2KSHJS2.js';
5
+ import '../chunk-36ZMNBXZ.js';
6
+ export { DatePicker } from '../chunk-SOD2F6C2.js';
7
+ export { useForm, useFormTracking } from '../chunk-LGWN6KCN.js';
8
8
  import '../chunk-Q6E4OPGG.js';
9
9
  import '../chunk-5ROTTMBL.js';
10
- export { FormEnhancer } from '../chunk-OWO3RFEX.js';
10
+ export { FormEnhancer } from '../chunk-G5FD7UXK.js';
11
11
  import '../chunk-C2FZBUSS.js';
12
12
  import '../chunk-YC7ELZS3.js';
13
13
  import '../chunk-DXO6SBMD.js';
@@ -18,8 +18,8 @@ import '../chunk-NJCTQH2P.js';
18
18
  import '../chunk-L2V5PUFN.js';
19
19
  import '../chunk-GJWI74ZZ.js';
20
20
  import '../chunk-5TM3WPCI.js';
21
- import '../chunk-IYCSDFPN.js';
22
- import '../chunk-QQT2T6JQ.js';
21
+ import '../chunk-UYOE3HA4.js';
22
+ import '../chunk-P5PRR2BB.js';
23
23
  import '../chunk-W7OPEMGJ.js';
24
- import '../chunk-BUE3Z32O.js';
24
+ import '../chunk-MNORERMF.js';
25
25
  import '../chunk-PKBMQBKP.js';
@@ -1,5 +1,5 @@
1
- export { ServerForm, getFormConfig } from '../chunk-AJG74ZZV.js';
2
- import '../chunk-OWO3RFEX.js';
1
+ export { ServerForm, getFormConfig } from '../chunk-DPYGC7WE.js';
2
+ import '../chunk-G5FD7UXK.js';
3
3
  import '../chunk-C2FZBUSS.js';
4
4
  import '../chunk-YC7ELZS3.js';
5
5
  export { StaticForm } from '../chunk-VPZJ7ZTL.js';
@@ -1,6 +1,6 @@
1
- export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-CMUD37WV.js';
1
+ export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-HWQPCZOX.js';
2
2
  export { ManagedFavicon, getManagedFaviconUrl } from '../chunk-GW7GSBO7.js';
3
- import '../chunk-IYCSDFPN.js';
4
- import '../chunk-QQT2T6JQ.js';
5
- import '../chunk-BUE3Z32O.js';
3
+ import '../chunk-UYOE3HA4.js';
4
+ import '../chunk-P5PRR2BB.js';
5
+ import '../chunk-MNORERMF.js';
6
6
  import '../chunk-PKBMQBKP.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { SITE_KIT_VERSION } from './chunk-BUE3Z32O.js';
1
+ export { SITE_KIT_VERSION } from './chunk-MNORERMF.js';
2
2
  import './chunk-PKBMQBKP.js';
@@ -1,13 +1,2 @@
1
- /**
2
- * Landing-page campaign contract.
3
- *
4
- * normalizeCampaignSlug is an inlined MIRROR of the Sonor API's campaign
5
- * normalizer (the CANONICAL copy); keep the function body byte-identical.
6
- * Both sides assert the same fixed vectors (this package's
7
- * landing/contract.test.ts), so silent drift fails CI on either side.
8
- *
9
- * A slug normalized here always matches the server's canonical form, so the
10
- * campaign a developer declares in code is exactly the identity the
11
- * dashboard reports on.
12
- */
13
- export declare function normalizeCampaignSlug(input?: string | null): string | null;
1
+ /** Compatibility entry. The shared contract owns campaign normalization. */
2
+ export { normalizeCampaignSlug } from '../contracts/campaign-normalize';
@@ -0,0 +1,2 @@
1
+ export { normalizeCampaignSlug } from '../chunk-3MJNBOUO.js';
2
+ import '../chunk-PKBMQBKP.js';
@@ -1,3 +1,5 @@
1
- export { LandingPage } from '../chunk-JJ4JS3LD.js';
2
- export { landingPageMetadata, normalizeCampaignSlug } from '../chunk-OSYCOC3K.js';
1
+ import '../chunk-BTHEQDN4.js';
2
+ export { LandingPage } from '../chunk-PAYCK7FC.js';
3
+ export { normalizeCampaignSlug } from '../chunk-3MJNBOUO.js';
4
+ export { landingPageMetadata } from '../chunk-JESLPEST.js';
3
5
  import '../chunk-PKBMQBKP.js';
@@ -0,0 +1,21 @@
1
+ import 'server-only';
2
+ import React from 'react';
3
+ import type { Metadata } from 'next';
4
+ import { type ResolveServerApiConfigOptions } from '../server/server-fetch';
5
+ import { type PublishedFunnelPage } from '../contracts/funnels';
6
+ export interface GetPublishedFunnelPageOptions extends ResolveServerApiConfigOptions {
7
+ /** Explicit registered site host. No primary-domain or sibling-site fallback. */
8
+ site: string;
9
+ }
10
+ /** Current published pointer, uncached so pointer changes take effect at the next read. */
11
+ export declare function getPublishedFunnelPage(slug: string, options: GetPublishedFunnelPageOptions): Promise<PublishedFunnelPage | null>;
12
+ export declare function managedFunnelMetadata(page: PublishedFunnelPage): Metadata;
13
+ export interface ManagedFunnelPageProps {
14
+ page: PublishedFunnelPage;
15
+ /** Expiring owner dashboard preview only. Never fetches or mounts a live form. */
16
+ preview?: boolean;
17
+ /** Optional server transport overrides; never forwarded to browser markup. */
18
+ configOptions?: ResolveServerApiConfigOptions;
19
+ }
20
+ /** Server-rendered content plus the existing managed browser form and deferred analytics contract. */
21
+ export declare function ManagedFunnelPage({ page: input, preview, configOptions }: ManagedFunnelPageProps): Promise<React.JSX.Element>;
@@ -0,0 +1,11 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { type PublishedFunnelPage } from '../contracts/funnels';
3
+ export interface FunnelPageContentProps {
4
+ page: PublishedFunnelPage;
5
+ /** A live managed form supplied by the server adapter. Never used in a preview. */
6
+ conversion?: ReactNode;
7
+ /** Private dashboard preview. All conversion controls are inert. */
8
+ preview?: boolean;
9
+ }
10
+ /** Bounded SSR layout for newsletter, requested-guide and inquiry content. */
11
+ export declare function FunnelPageContent({ page: input, conversion, preview }: FunnelPageContentProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { landingPageMetadata } from '../chunk-JESLPEST.js';
2
+ import '../chunk-PKBMQBKP.js';
@@ -29,3 +29,8 @@
29
29
  */
30
30
  export { landingPageMetadata } from './metadata';
31
31
  export { normalizeCampaignSlug } from './contract';
32
+ export { getPublishedFunnelPage, managedFunnelMetadata, ManagedFunnelPage } from './managed-server';
33
+ export type { GetPublishedFunnelPageOptions, ManagedFunnelPageProps } from './managed-server';
34
+ export { FunnelPageContent } from './managed';
35
+ export type { FunnelPageContentProps } from './managed';
36
+ export type { PublishedFunnelPage } from '../contracts/funnels';
@@ -1,3 +1,20 @@
1
- import '../chunk-7ZWO5HDQ.js';
2
- export { landingPageMetadata, normalizeCampaignSlug } from '../chunk-OSYCOC3K.js';
1
+ export { FunnelPageContent, ManagedFunnelPage, getPublishedFunnelPage, managedFunnelMetadata } from '../chunk-FXR5PJDL.js';
2
+ import '../chunk-PAYCK7FC.js';
3
+ export { normalizeCampaignSlug } from '../chunk-3MJNBOUO.js';
4
+ export { landingPageMetadata } from '../chunk-JESLPEST.js';
5
+ import '../chunk-XHYE24HU.js';
6
+ import '../chunk-DPYGC7WE.js';
7
+ import '../chunk-G5FD7UXK.js';
8
+ import '../chunk-C2FZBUSS.js';
9
+ import '../chunk-YC7ELZS3.js';
10
+ import '../chunk-VPZJ7ZTL.js';
11
+ import '../chunk-DXO6SBMD.js';
12
+ import '../chunk-CVADNHJ4.js';
13
+ import '../chunk-TYSIAWC3.js';
14
+ import '../chunk-HW7B43E5.js';
15
+ import '../chunk-NJCTQH2P.js';
16
+ import '../chunk-C7TLGL3R.js';
17
+ import '../chunk-MH2DSGC6.js';
18
+ import '../chunk-S22FSH7C.js';
19
+ import '../chunk-A4CC4ZG3.js';
3
20
  import '../chunk-PKBMQBKP.js';