@sonordev/site-kit 8.5.2 → 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.
- package/CHANGELOG.md +16 -0
- package/agent-manifest.json +1 -1
- package/dist/{AnalyticsProvider-HSJMHYBA.js → AnalyticsProvider-3UIQMIRW.js} +6 -6
- package/dist/{ArticleViewTracker-XEA6ZY67.js → ArticleViewTracker-KNXP2DXL.js} +5 -5
- package/dist/{BlocksPopup-DUTOENMQ.js → BlocksPopup-DFE32GPX.js} +9 -8
- package/dist/{ChatWidget-PMVQTSEU.js → ChatWidget-L74L4YAD.js} +6 -6
- package/dist/FileField-P3PLEAON.js +237 -0
- package/dist/{FormSpotlight-RTPJPLQ3.js → FormSpotlight-DNBSBRIE.js} +2 -2
- package/dist/{FormStage-UANGD66Z.js → FormStage-I4JGLT57.js} +2 -2
- package/dist/{ManagedForm-4AACRHEY.js → ManagedForm-GJRGBM6W.js} +8 -8
- package/dist/{ManagedNewsletterForm-RWKFWZ72.js → ManagedNewsletterForm-AUZ6YB7G.js} +11 -11
- package/dist/{SignalCore-XULLPKPX.js → SignalCore-UV7K7PT4.js} +5 -5
- package/dist/SiteChat-6UWE545R.js +6 -0
- package/dist/SiteDesignReporter-ZSU76DZJ.js +13 -0
- package/dist/{SitePopups-US6VQN7X.js → SitePopups-XHWU7GNF.js} +6 -6
- package/dist/SitemapSync-ELWV6W7Y.js +9 -0
- package/dist/_client/booking-widget.js +5 -5
- package/dist/affiliates/index.js +3 -3
- package/dist/analytics/content-text.d.ts +17 -0
- package/dist/analytics/index.js +6 -6
- package/dist/{article-styles-VASFBYA3.js → article-styles-D7VCDXMG.js} +2 -1
- package/dist/article-tables-W45BE353.js +3 -0
- package/dist/articles/index.js +7 -20
- package/dist/articles/server-ui.js +29 -55
- package/dist/articles/server.js +6 -5
- package/dist/chat/index.js +9 -9
- package/dist/{chunk-3RDJKIYO.js → chunk-2WDWQI7K.js} +1 -1
- package/dist/{chunk-DLTLXYOV.js → chunk-36ZMNBXZ.js} +4 -9
- package/dist/chunk-3MJNBOUO.js +8 -0
- package/dist/{chunk-IXA7ZB6U.js → chunk-3MLWIBHX.js} +1 -1
- package/dist/{chunk-BF7TZYC3.js → chunk-52KO4LKD.js} +1 -1
- package/dist/{chunk-ZDUTXHM6.js → chunk-5WHBYQJ4.js} +3 -3
- package/dist/{chunk-5D7ZISUP.js → chunk-7DYMM6SS.js} +11 -6
- package/dist/{chunk-HNYECNCU.js → chunk-7YB3QA4P.js} +15 -7
- package/dist/{chunk-N4ZCNYWF.js → chunk-A2MDVP47.js} +1 -1
- package/dist/{chunk-E4PTMORJ.js → chunk-AL5UCWLI.js} +23 -8
- package/dist/{chunk-ANVHRT35.js → chunk-BAJUXQTH.js} +2 -2
- package/dist/{chunk-ITQND6IB.js → chunk-BJYX6SFI.js} +2 -2
- package/dist/{chunk-TYAVHRWH.js → chunk-CVADNHJ4.js} +8 -2
- package/dist/{chunk-5BRHTBPO.js → chunk-DJIGFX33.js} +1 -1
- package/dist/{chunk-ZSU7KTIE.js → chunk-DPYGC7WE.js} +2 -2
- package/dist/{chunk-XA7Q2VQA.js → chunk-EK7P62DT.js} +1 -1
- package/dist/chunk-FXR5PJDL.js +420 -0
- package/dist/{chunk-GLLFIE2R.js → chunk-G5FD7UXK.js} +2 -2
- package/dist/{chunk-OFQ3BU52.js → chunk-HM7CDWFK.js} +1 -1
- package/dist/{chunk-Q4Y3WIHE.js → chunk-HWQPCZOX.js} +1 -1
- package/dist/{chunk-6KU7STM3.js → chunk-HY7ZEU2C.js} +3 -1
- package/dist/chunk-IBHBEUZV.js +27 -0
- package/dist/{chunk-7HRYSLY2.js → chunk-IXZBOOAD.js} +4 -4
- package/dist/chunk-JESLPEST.js +14 -0
- package/dist/{chunk-BC7JMY4Z.js → chunk-JG53YJLM.js} +58 -1
- package/dist/{chunk-FVXCQC7W.js → chunk-JWCCY72G.js} +1 -1
- package/dist/{chunk-RI2N2EBI.js → chunk-JYITKUUB.js} +13 -5
- package/dist/chunk-KIYACQW3.js +1 -0
- package/dist/{chunk-YW3LNSBM.js → chunk-KLIDCNML.js} +1 -1
- package/dist/{chunk-3PT6SO65.js → chunk-L2KSHJS2.js} +5 -5
- package/dist/{chunk-27LYZVPP.js → chunk-LGWN6KCN.js} +2 -2
- package/dist/{chunk-GTVOB5RN.js → chunk-MJW6YIDJ.js} +1 -1
- package/dist/{chunk-CFSIGEUW.js → chunk-MNORERMF.js} +1 -1
- package/dist/{chunk-Y35BWW2C.js → chunk-ODOV76VW.js} +1 -1
- package/dist/{chunk-EQHGPB3J.js → chunk-OHLCE4GC.js} +2 -2
- package/dist/{chunk-OEA7U4HJ.js → chunk-P5PRR2BB.js} +1 -1
- package/dist/{chunk-JJ4JS3LD.js → chunk-PAYCK7FC.js} +1 -1
- package/dist/{chunk-DLM4FFNH.js → chunk-QTBAKOCZ.js} +1 -1
- package/dist/{chunk-2QFIYYMP.js → chunk-RHT7OZNF.js} +1 -1
- package/dist/{chunk-UGZ3B5AK.js → chunk-RWWSOYJO.js} +9 -9
- package/dist/{chunk-T6U6J3QK.js → chunk-T6TWPKBL.js} +1 -1
- package/dist/{chunk-5SQK3D53.js → chunk-TYSIAWC3.js} +1 -0
- package/dist/{chunk-24NM64IV.js → chunk-U4OQJQK6.js} +3 -3
- package/dist/{chunk-GDQKDL3E.js → chunk-UYOE3HA4.js} +2 -2
- package/dist/chunk-VEJD5EJ2.js +344 -0
- package/dist/{chunk-LNSF6BJC.js → chunk-VPZJ7ZTL.js} +2 -2
- package/dist/chunk-XAZC2TUD.js +1119 -0
- package/dist/{chunk-A7RZQI6H.js → chunk-XC2TWYDV.js} +3 -3
- package/dist/{chunk-URJN75ZG.js → chunk-XIDWNXZN.js} +3 -3
- package/dist/chunk-XLAHRN4B.js +1 -0
- package/dist/{chunk-URZTBPZO.js → chunk-XZFOQ2V4.js} +113 -93
- package/dist/{chunk-I4LMZNBN.js → chunk-YYPYLYZM.js} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/contracts/broadcast-layouts.d.ts +133 -0
- package/dist/contracts/business-claims.d.ts +456 -0
- package/dist/contracts/campaign-normalize.d.ts +2 -0
- package/dist/contracts/entries.d.ts +1 -1
- package/dist/contracts/funnels.d.ts +576 -0
- package/dist/contracts/inbox.d.ts +42 -0
- package/dist/contracts/llms.d.ts +200 -0
- package/dist/contracts/outreach.d.ts +267 -0
- package/dist/contracts/page-titles.d.ts +140 -0
- package/dist/contracts/portfolio.d.ts +170 -0
- package/dist/contracts/public-url-host.d.ts +10 -0
- package/dist/contracts/publication-branding.d.ts +151 -0
- package/dist/contracts/publication-charter.d.ts +14 -0
- package/dist/contracts/site-cache.d.ts +2 -0
- package/dist/fleet/index.js +6 -6
- package/dist/forms/FileField.d.ts +3 -1
- package/dist/forms/PrivateFileField.d.ts +3 -0
- package/dist/forms/index.js +11 -11
- package/dist/forms/private-file-rules.d.ts +8 -0
- package/dist/forms/server.js +5 -5
- package/dist/forms/static.js +3 -3
- package/dist/forms/styles.css +17 -1
- package/dist/forms/types.d.ts +4 -0
- package/dist/images/index.js +4 -4
- package/dist/index.js +1 -1
- package/dist/landing/contract.d.ts +2 -13
- package/dist/landing/contract.js +2 -0
- package/dist/landing/index.js +4 -2
- package/dist/landing/managed-server.d.ts +21 -0
- package/dist/landing/managed.d.ts +11 -0
- package/dist/landing/metadata.js +2 -0
- package/dist/landing/server.d.ts +5 -0
- package/dist/landing/server.js +19 -2
- package/dist/layout/client.js +9 -9
- package/dist/layout/index.js +10 -10
- package/dist/llms/contract.js +2 -1
- package/dist/llms/index.js +9 -7
- package/dist/llms/merge.d.ts +29 -0
- package/dist/maps/index.js +3 -3
- package/dist/mcp/sonor.js +12 -11
- package/dist/portfolio/contract.js +1 -1
- package/dist/press-kit/articles/article-body.d.ts +13 -0
- package/dist/press-kit/articles/article-heading-ids.d.ts +7 -0
- package/dist/press-kit/articles/article-headings.d.ts +61 -0
- package/dist/press-kit/articles/html-tags.d.ts +46 -0
- package/dist/press-kit/articles/types.d.ts +2 -0
- package/dist/revalidate/index.js +3 -3
- package/dist/runtime/index.js +3 -3
- package/dist/seo/client.js +6 -6
- package/dist/seo/index.js +14 -13
- package/dist/seo/llms/contract.js +2 -1
- package/dist/seo/llms.js +9 -7
- package/dist/seo/meta/contract.js +2 -1
- package/dist/seo/register-sitemap-cli.js +1 -1
- package/dist/seo/server.js +5 -4
- package/dist/seo/sitemap.js +7 -5
- package/dist/seo-meta/contract.js +2 -1
- package/dist/server/index.js +3 -3
- package/dist/{server-api-EGOKC7Q3.js → server-api-XIKDWSNO.js} +2 -2
- package/dist/shared/build-entries.d.ts +3 -1
- package/dist/shared/markdown.d.ts +7 -6
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +2 -2
- package/dist/sitemap/index.js +7 -5
- package/dist/slots/index.js +2 -2
- package/dist/sync/index.js +5 -5
- package/dist/website/contract.js +2 -1
- package/dist/website/images.js +4 -4
- package/dist/website/index.js +10 -9
- package/dist/website/landing/server.js +19 -2
- package/dist/website/landing.js +4 -2
- package/dist/website/popups.js +9 -8
- package/dist/website/slots.js +2 -2
- package/dist/{writeLLMsTxt-BAK5XMRR.js → writeLLMsTxt-QN2HIVT4.js} +6 -4
- package/docs.json +5 -0
- package/package.json +1 -1
- package/src/analytics/README.md +1 -1
- package/src/forms/README.md +22 -0
- package/src/landing/README.md +64 -0
- package/src/llms/README.md +52 -20
- package/dist/FileField-F7BG4XAZ.js +0 -83
- package/dist/SiteChat-P4CRBRJZ.js +0 -6
- package/dist/SiteDesignReporter-QDVP4WMK.js +0 -12
- package/dist/SitemapSync-5FBRDGHG.js +0 -9
- package/dist/article-tables-6XHVULPU.js +0 -2
- package/dist/chunk-EKBEOXTH.js +0 -114
- package/dist/chunk-NZ4RXN3G.js +0 -145
- package/dist/chunk-OSYCOC3K.js +0 -21
- /package/dist/{chunk-7ZWO5HDQ.js → chunk-BTHEQDN4.js} +0 -0
- /package/dist/{chunk-BQR4IPBW.js → chunk-ISRBSTB7.js} +0 -0
- /package/dist/{chunk-IHG36STL.js → chunk-XHYE24HU.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-
|
|
3
|
-
import { designTokensHash } from './chunk-
|
|
2
|
+
import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-IXZBOOAD.js';
|
|
3
|
+
import { designTokensHash } from './chunk-XHYE24HU.js';
|
|
4
4
|
import { useDeferredActivation } from './chunk-YC7ELZS3.js';
|
|
5
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
5
|
+
import { resolveAnalyticsTarget } from './chunk-QTBAKOCZ.js';
|
|
6
6
|
import { useRef, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
var STAMP_KEY = (site) => `_sk_design_sent:${site}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getSEOPageData, ensureMetadata, getABTest, recordABImpression, getRedirectData, getRobotsData, getSitemapEntries } from './chunk-
|
|
2
|
-
import { titleProblem, descriptionProblem } from './chunk-
|
|
1
|
+
import { getSEOPageData, ensureMetadata, getABTest, recordABImpression, getRedirectData, getRobotsData, getSitemapEntries } from './chunk-ODOV76VW.js';
|
|
2
|
+
import { titleProblem, descriptionProblem } from './chunk-ISRBSTB7.js';
|
|
3
3
|
import { resolveSiteHost } from './chunk-FESKKJAS.js';
|
|
4
4
|
|
|
5
5
|
// src/seo/getManagedMetadata.ts
|
|
@@ -232,7 +232,7 @@ async function generateSitemap(options) {
|
|
|
232
232
|
}));
|
|
233
233
|
}
|
|
234
234
|
async function registerLocalSitemap(options) {
|
|
235
|
-
const { registerSitemap } = await import('./server-api-
|
|
235
|
+
const { registerSitemap } = await import('./server-api-XIKDWSNO.js');
|
|
236
236
|
let entries = options.entries || [];
|
|
237
237
|
if (options.autoDiscover && entries.length === 0) {
|
|
238
238
|
try {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getLLMsData, getOptimizedLLMsTxt } from './chunk-
|
|
2
|
-
import { linkClassificationHost } from './chunk-
|
|
1
|
+
import { getLLMsData, getOptimizedLLMsTxt } from './chunk-EK7P62DT.js';
|
|
2
|
+
import { linkClassificationHost } from './chunk-7DYMM6SS.js';
|
|
3
3
|
import { resolveArticleUrl } from './chunk-4K735O3J.js';
|
|
4
4
|
import { freshFetch } from './chunk-UAYAJPEP.js';
|
|
5
|
-
import { LLM_GEO_CONTRACT_VERSION, sanitizePrimaryLanguageTag, sanitizeLlmsDisclaimerLine,
|
|
5
|
+
import { selectLlmsPages, LLM_GEO_CONTRACT_VERSION, sanitizePrimaryLanguageTag, sanitizeLlmsDisclaimerLine, llmsBlockquoteSummary, llmsAbsoluteUrl, llmsContactLines, isLlmsListablePage, groupLlmsPages, llmsPageTitle, llmsPageListNote } from './chunk-XAZC2TUD.js';
|
|
6
6
|
import { resolveTrailingSlash, applyTrailingSlash } from './chunk-YVKRYQRG.js';
|
|
7
7
|
import { resolveSiteHost } from './chunk-FESKKJAS.js';
|
|
8
8
|
import { readFileSync, existsSync, mkdirSync, writeFileSync, renameSync, unlinkSync, readdirSync } from 'fs';
|
|
@@ -101,6 +101,47 @@ function humanizeIndustry(industry) {
|
|
|
101
101
|
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
// src/llms/merge.ts
|
|
105
|
+
function isFilled(value) {
|
|
106
|
+
if (typeof value === "string") return value.trim() !== "";
|
|
107
|
+
return value !== null && value !== void 0;
|
|
108
|
+
}
|
|
109
|
+
function mergeFilledFields(sonor, local) {
|
|
110
|
+
if (!sonor && !local) return void 0;
|
|
111
|
+
if (!sonor) return local ?? void 0;
|
|
112
|
+
if (!local) return sonor;
|
|
113
|
+
const merged = { ...local };
|
|
114
|
+
for (const [key, value] of Object.entries(sonor)) {
|
|
115
|
+
if (isFilled(value) || !isFilled(merged[key])) merged[key] = value;
|
|
116
|
+
}
|
|
117
|
+
return merged;
|
|
118
|
+
}
|
|
119
|
+
var NAP_BUSINESS_FIELDS = ["name", "description"];
|
|
120
|
+
var NAP_CONTACT_FIELDS = ["phone", "address", "city", "state", "postal_code"];
|
|
121
|
+
function lacksNap(data) {
|
|
122
|
+
const business = data.business ?? {};
|
|
123
|
+
const contact = data.contact ?? {};
|
|
124
|
+
return NAP_BUSINESS_FIELDS.some((key) => !isFilled(business[key])) || NAP_CONTACT_FIELDS.some((key) => !isFilled(contact[key]));
|
|
125
|
+
}
|
|
126
|
+
function needsLocalData(data) {
|
|
127
|
+
if (!data) return true;
|
|
128
|
+
if (!data.services?.length || !data.faq?.length || !data.pages?.length) return true;
|
|
129
|
+
return lacksNap(data);
|
|
130
|
+
}
|
|
131
|
+
function mergeLlmsData(sonor, local, mergeMeta) {
|
|
132
|
+
if (!local) return sonor;
|
|
133
|
+
if (!sonor) return local;
|
|
134
|
+
return {
|
|
135
|
+
meta: mergeMeta(local.meta, sonor.meta),
|
|
136
|
+
business: mergeFilledFields(sonor.business, local.business),
|
|
137
|
+
contact: mergeFilledFields(sonor.contact, local.contact),
|
|
138
|
+
services: (sonor.services?.length ? sonor.services : local.services) ?? [],
|
|
139
|
+
faq: (sonor.faq?.length ? sonor.faq : local.faq) ?? [],
|
|
140
|
+
pages: (sonor.pages?.length ? sonor.pages : local.pages) ?? [],
|
|
141
|
+
portfolio: (sonor.portfolio?.length ? sonor.portfolio : local.portfolio) ?? []
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
104
145
|
// src/llms/links.ts
|
|
105
146
|
var ABSOLUTE_URL = /https?:\/\/[^\s<>()[\]"'`]+/g;
|
|
106
147
|
var RELATIVE_LINK_TARGET = /\]\((\/(?!\/)[^)\s]*)/g;
|
|
@@ -138,19 +179,6 @@ function resolveBaseUrl(optionBaseUrl, businessWebsite) {
|
|
|
138
179
|
const candidate = optionBaseUrl || businessWebsite || process.env.NEXT_PUBLIC_SITE_URL || process.env.SITE_URL || "";
|
|
139
180
|
return candidate.trim().replace(/\/+$/, "");
|
|
140
181
|
}
|
|
141
|
-
function mergeLLMsData(portal, local) {
|
|
142
|
-
if (!local) return portal;
|
|
143
|
-
if (!portal) return local;
|
|
144
|
-
return {
|
|
145
|
-
meta: mergeLlmsMeta(local.meta, portal.meta),
|
|
146
|
-
business: portal.business ?? local.business,
|
|
147
|
-
contact: portal.contact ?? local.contact,
|
|
148
|
-
services: (portal.services?.length ? portal.services : local.services) ?? [],
|
|
149
|
-
faq: (portal.faq?.length ? portal.faq : local.faq) ?? [],
|
|
150
|
-
pages: (portal.pages?.length ? portal.pages : local.pages) ?? [],
|
|
151
|
-
portfolio: (portal.portfolio?.length ? portal.portfolio : local.portfolio) ?? []
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
182
|
async function generateLLMsTxt(options) {
|
|
155
183
|
const {
|
|
156
184
|
projectId,
|
|
@@ -182,11 +210,10 @@ async function generateLLMsTxt(options) {
|
|
|
182
210
|
} = options;
|
|
183
211
|
const readFetch = fresh ? freshFetch : fetch;
|
|
184
212
|
let data = await getLLMsData(projectId, site, fresh);
|
|
185
|
-
|
|
186
|
-
if (useLocal && getLocalData) {
|
|
213
|
+
if (getLocalData && needsLocalData(data)) {
|
|
187
214
|
try {
|
|
188
215
|
const local = await getLocalData();
|
|
189
|
-
data =
|
|
216
|
+
data = mergeLlmsData(data ?? null, local, mergeLlmsMeta);
|
|
190
217
|
} catch (err) {
|
|
191
218
|
console.warn("[site-kit] getLocalData failed:", err);
|
|
192
219
|
}
|
|
@@ -222,11 +249,32 @@ async function generateLLMsTxt(options) {
|
|
|
222
249
|
sections.push(about);
|
|
223
250
|
sectionNames.push("about");
|
|
224
251
|
}
|
|
252
|
+
if (includeContact) {
|
|
253
|
+
const contact = generateContactSection(data.contact);
|
|
254
|
+
if (contact) {
|
|
255
|
+
sections.push(contact);
|
|
256
|
+
sectionNames.push("contact");
|
|
257
|
+
}
|
|
258
|
+
}
|
|
225
259
|
if (includeServices && data.services?.length > 0) {
|
|
226
|
-
const services = generateServicesSection(data.services);
|
|
260
|
+
const services = generateServicesSection(data.services, baseUrl);
|
|
227
261
|
sections.push(services);
|
|
228
262
|
sectionNames.push("services");
|
|
229
263
|
}
|
|
264
|
+
const renderOptional = optionalPagePaths.length > 0 && Boolean(baseUrl);
|
|
265
|
+
const optionalKeys = renderOptional ? new Set(optionalPagePaths.map(normalizeLlmsPagePath)) : null;
|
|
266
|
+
const listable = listablePages(data.pages ?? []);
|
|
267
|
+
const indexPages = optionalKeys ? listable.filter((p) => !optionalKeys.has(normalizeLlmsPagePath(p.path))) : listable;
|
|
268
|
+
if (includePages && indexPages.length > 0) {
|
|
269
|
+
const pages = generatePagesSection(
|
|
270
|
+
selectLlmsPages(indexPages, maxPages),
|
|
271
|
+
baseUrl,
|
|
272
|
+
pageListNotesFromPublicSummaryOnly,
|
|
273
|
+
data.business?.name
|
|
274
|
+
);
|
|
275
|
+
sections.push(pages);
|
|
276
|
+
sectionNames.push("pages");
|
|
277
|
+
}
|
|
230
278
|
if (includePortfolio) {
|
|
231
279
|
let portfolioItems = data.portfolio || [];
|
|
232
280
|
if (portfolioItems.length === 0) {
|
|
@@ -262,41 +310,11 @@ async function generateLLMsTxt(options) {
|
|
|
262
310
|
sectionNames.push("portfolio");
|
|
263
311
|
}
|
|
264
312
|
}
|
|
265
|
-
if (includeContact && data.contact) {
|
|
266
|
-
const contact = generateContactSection(data.contact);
|
|
267
|
-
sections.push(contact);
|
|
268
|
-
sectionNames.push("contact");
|
|
269
|
-
}
|
|
270
313
|
if (includeFAQ && data.faq?.length > 0) {
|
|
271
314
|
const faq = generateFAQSection(data.faq.slice(0, maxFAQItems));
|
|
272
315
|
sections.push(faq);
|
|
273
316
|
sectionNames.push("faq");
|
|
274
317
|
}
|
|
275
|
-
const renderOptional = optionalPagePaths.length > 0 && Boolean(baseUrl);
|
|
276
|
-
const optionalKeys = renderOptional ? new Set(optionalPagePaths.map(normalizeLlmsPagePath)) : null;
|
|
277
|
-
const indexPages = optionalKeys ? (data.pages ?? []).filter((p) => !optionalKeys.has(normalizeLlmsPagePath(p.path))) : data.pages ?? [];
|
|
278
|
-
if (includePages && indexPages.length > 0) {
|
|
279
|
-
const pages = generatePagesSection(
|
|
280
|
-
indexPages.slice(0, maxPages),
|
|
281
|
-
baseUrl,
|
|
282
|
-
pageListNotesFromPublicSummaryOnly
|
|
283
|
-
);
|
|
284
|
-
sections.push(pages);
|
|
285
|
-
sectionNames.push("pages");
|
|
286
|
-
}
|
|
287
|
-
if (renderOptional) {
|
|
288
|
-
const opt = generateOptionalPagesSection(
|
|
289
|
-
optionalPagePaths,
|
|
290
|
-
data.pages || [],
|
|
291
|
-
baseUrl,
|
|
292
|
-
pageListNotesFromPublicSummaryOnly,
|
|
293
|
-
trailingSlash
|
|
294
|
-
);
|
|
295
|
-
if (opt) {
|
|
296
|
-
sections.push(opt);
|
|
297
|
-
sectionNames.push("optional");
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
318
|
if (linkToFullLlms && baseUrl) {
|
|
301
319
|
const fullPath = fullLlmsTxtPath.startsWith("/") ? fullLlmsTxtPath : `/${fullLlmsTxtPath}`;
|
|
302
320
|
const fullUrl = fullPath.startsWith("http") ? fullPath : `${baseUrl}${fullPath}`;
|
|
@@ -312,7 +330,7 @@ async function generateLLMsTxt(options) {
|
|
|
312
330
|
if (includeEntities) {
|
|
313
331
|
attemptedSections.push("knowledge-graph");
|
|
314
332
|
optionalFetches.push(
|
|
315
|
-
import('./server-api-
|
|
333
|
+
import('./server-api-XIKDWSNO.js').then(async ({ getEntities, getPrimaryEntity }) => {
|
|
316
334
|
const [entities, primaryEntity] = await Promise.all([
|
|
317
335
|
getEntities().then((e) => e.slice(0, maxEntities)),
|
|
318
336
|
getPrimaryEntity()
|
|
@@ -389,6 +407,20 @@ ${custom.content}`);
|
|
|
389
407
|
sections.splice(index, 0, formatAgentAccessSection(baseUrl, agentOptions));
|
|
390
408
|
sectionNames.splice(index, 0, "agent-access");
|
|
391
409
|
}
|
|
410
|
+
if (renderOptional) {
|
|
411
|
+
const opt = generateOptionalPagesSection(
|
|
412
|
+
optionalPagePaths,
|
|
413
|
+
data.pages || [],
|
|
414
|
+
baseUrl,
|
|
415
|
+
pageListNotesFromPublicSummaryOnly,
|
|
416
|
+
trailingSlash,
|
|
417
|
+
data.business?.name
|
|
418
|
+
);
|
|
419
|
+
if (opt) {
|
|
420
|
+
sections.push(opt);
|
|
421
|
+
sectionNames.push("optional");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
392
424
|
return {
|
|
393
425
|
// Every own-site link (pages, clusters, portfolio, custom sections) takes
|
|
394
426
|
// the site's trailing-slash shape in one pass.
|
|
@@ -442,8 +474,7 @@ function generateHeaderSection(business, meta, resolvedBaseUrl) {
|
|
|
442
474
|
const lines = [];
|
|
443
475
|
lines.push(`# ${business.name}`);
|
|
444
476
|
lines.push("");
|
|
445
|
-
|
|
446
|
-
lines.push(`> ${summary}`);
|
|
477
|
+
lines.push(`> ${llmsBlockquoteSummary(business)}`);
|
|
447
478
|
if (meta?.last_updated) {
|
|
448
479
|
lines.push(`> Content index last updated: ${meta.last_updated}`);
|
|
449
480
|
}
|
|
@@ -477,13 +508,13 @@ function generateAboutSection(business) {
|
|
|
477
508
|
}
|
|
478
509
|
return lines.join("\n");
|
|
479
510
|
}
|
|
480
|
-
function generateServicesSection(services) {
|
|
511
|
+
function generateServicesSection(services, baseUrl) {
|
|
481
512
|
const lines = [];
|
|
482
513
|
lines.push("## Services");
|
|
483
514
|
lines.push("");
|
|
484
515
|
for (const service of services) {
|
|
485
516
|
if (service.url) {
|
|
486
|
-
lines.push(`- **[${service.name}](${service.url})**: ${service.description}`);
|
|
517
|
+
lines.push(`- **[${service.name}](${llmsAbsoluteUrl(baseUrl, service.url)})**: ${service.description}`);
|
|
487
518
|
} else {
|
|
488
519
|
lines.push(`- **${service.name}**: ${service.description}`);
|
|
489
520
|
}
|
|
@@ -524,29 +555,8 @@ function generatePortfolioSection(items, baseUrl) {
|
|
|
524
555
|
return lines.join("\n").trim();
|
|
525
556
|
}
|
|
526
557
|
function generateContactSection(contact) {
|
|
527
|
-
const lines =
|
|
528
|
-
lines.
|
|
529
|
-
lines.push("");
|
|
530
|
-
if (contact.phone) {
|
|
531
|
-
lines.push(`- **Phone:** ${contact.phone}`);
|
|
532
|
-
}
|
|
533
|
-
if (contact.email) {
|
|
534
|
-
lines.push(`- **Email:** ${contact.email}`);
|
|
535
|
-
}
|
|
536
|
-
if (contact.address || contact.city) {
|
|
537
|
-
const addressParts = [
|
|
538
|
-
contact.address,
|
|
539
|
-
contact.city,
|
|
540
|
-
contact.state,
|
|
541
|
-
contact.postal_code,
|
|
542
|
-
contact.country
|
|
543
|
-
].filter(Boolean);
|
|
544
|
-
lines.push(`- **Address:** ${addressParts.join(", ")}`);
|
|
545
|
-
}
|
|
546
|
-
if (contact.hours) {
|
|
547
|
-
lines.push(`- **Hours:** ${contact.hours}`);
|
|
548
|
-
}
|
|
549
|
-
return lines.join("\n");
|
|
558
|
+
const lines = llmsContactLines(contact);
|
|
559
|
+
return lines.length > 0 ? ["## Contact Information", "", ...lines].join("\n") : null;
|
|
550
560
|
}
|
|
551
561
|
function generateFAQSection(faq) {
|
|
552
562
|
const lines = [];
|
|
@@ -560,32 +570,42 @@ function generateFAQSection(faq) {
|
|
|
560
570
|
}
|
|
561
571
|
return lines.join("\n").trim();
|
|
562
572
|
}
|
|
563
|
-
function
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
573
|
+
function listablePages(pages) {
|
|
574
|
+
const seen = /* @__PURE__ */ new Set();
|
|
575
|
+
return pages.filter((page) => {
|
|
576
|
+
if (!page?.path || !isLlmsListablePage({ path: page.path })) return false;
|
|
577
|
+
const key = normalizeLlmsPagePath(page.path);
|
|
578
|
+
if (seen.has(key)) return false;
|
|
579
|
+
seen.add(key);
|
|
580
|
+
return true;
|
|
581
|
+
});
|
|
569
582
|
}
|
|
570
583
|
function normalizeLlmsPagePath(path) {
|
|
571
584
|
const withLeading = path.startsWith("/") ? path : `/${path}`;
|
|
572
585
|
return withLeading.replace(/\/$/, "") || "/";
|
|
573
586
|
}
|
|
574
|
-
function formatPageLine(page, baseUrl, publicSummaryOnly) {
|
|
587
|
+
function formatPageLine(page, baseUrl, publicSummaryOnly, homeName) {
|
|
575
588
|
const url = page.path.startsWith("http") ? page.path : `${baseUrl}${page.path}`;
|
|
576
|
-
const
|
|
577
|
-
|
|
589
|
+
const title = llmsPageTitle({ path: page.path, title: page.title }, homeName).replace(/[[\]]/g, "");
|
|
590
|
+
const note = llmsPageListNote(page, publicSummaryOnly);
|
|
591
|
+
return note ? `- [${title}](${url}): ${note}` : `- [${title}](${url})`;
|
|
578
592
|
}
|
|
579
|
-
function generatePagesSection(pages, baseUrl, publicSummaryOnly) {
|
|
593
|
+
function generatePagesSection(pages, baseUrl, publicSummaryOnly, homeName) {
|
|
580
594
|
const lines = [];
|
|
581
595
|
lines.push("## Site Pages");
|
|
582
596
|
lines.push("");
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
597
|
+
groupLlmsPages(pages).forEach((group, i) => {
|
|
598
|
+
if (group.heading) {
|
|
599
|
+
if (i > 0) lines.push("");
|
|
600
|
+
lines.push(`### ${group.heading}`, "");
|
|
601
|
+
}
|
|
602
|
+
for (const page of group.pages) {
|
|
603
|
+
lines.push(formatPageLine(page, baseUrl, publicSummaryOnly, homeName));
|
|
604
|
+
}
|
|
605
|
+
});
|
|
586
606
|
return lines.join("\n");
|
|
587
607
|
}
|
|
588
|
-
function generateOptionalPagesSection(paths, pages, baseUrl, publicSummaryOnly, trailingSlash) {
|
|
608
|
+
function generateOptionalPagesSection(paths, pages, baseUrl, publicSummaryOnly, trailingSlash, homeName) {
|
|
589
609
|
const byPath = /* @__PURE__ */ new Map();
|
|
590
610
|
for (const page of pages) {
|
|
591
611
|
const key = normalizeLlmsPagePath(page.path);
|
|
@@ -599,7 +619,7 @@ function generateOptionalPagesSection(paths, pages, baseUrl, publicSummaryOnly,
|
|
|
599
619
|
seen.add(key);
|
|
600
620
|
const match = byPath.get(key);
|
|
601
621
|
if (match) {
|
|
602
|
-
lines.push(formatPageLine(match, baseUrl, publicSummaryOnly));
|
|
622
|
+
lines.push(formatPageLine(match, baseUrl, publicSummaryOnly, homeName));
|
|
603
623
|
continue;
|
|
604
624
|
}
|
|
605
625
|
const title = key.split("/").filter(Boolean).pop() || key;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { detectTimezone, releaseSlotHold, fetchBookingTypeDetails, fetchBookingTypes, fetchAvailability, createSlotHold, createBooking, formatDuration, formatDate, formatTime, prepareMeeting } from './chunk-
|
|
2
|
+
import { detectTimezone, releaseSlotHold, fetchBookingTypeDetails, fetchBookingTypes, fetchAvailability, createSlotHold, createBooking, formatDuration, formatDate, formatTime, prepareMeeting } from './chunk-DJIGFX33.js';
|
|
3
3
|
import { readPublishedApiConfig, DEFAULT_SONOR_API_URL } from './chunk-W7OPEMGJ.js';
|
|
4
4
|
import { useState, useRef, useMemo, useCallback, useEffect, useId } from 'react';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
package/dist/client/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { SiteKitCredential } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
2
|
+
export { SiteKitCredential } from '../chunk-A2MDVP47.js';
|
|
3
|
+
import '../chunk-JWCCY72G.js';
|
|
4
4
|
export { VISUAL_VIEWPORT_GAP_PROPERTY, VisualViewportGap, useVisualViewportGap } from '../chunk-6T6CQVNL.js';
|
|
5
5
|
export { useDeferredActivation } from '../chunk-YC7ELZS3.js';
|
|
6
6
|
import '../chunk-FESKKJAS.js';
|
|
@@ -9,6 +9,6 @@ export { trackConversion, trackEvent } from '../chunk-LCDVPAMR.js';
|
|
|
9
9
|
export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity } from '../chunk-IPQKQEWI.js';
|
|
10
10
|
import '../chunk-GJWI74ZZ.js';
|
|
11
11
|
import '../chunk-5TM3WPCI.js';
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-P5PRR2BB.js';
|
|
13
|
+
import '../chunk-MNORERMF.js';
|
|
14
14
|
import '../chunk-PKBMQBKP.js';
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Broadcast layouts: which compositions a Broadcast card draws, which retired
|
|
3
|
+
* IDs stay readable and what each one draws as, the Broadcast styles, and the
|
|
4
|
+
* review card variations with the frozen draw that gives each review its
|
|
5
|
+
* composition. Sonor's APIs and dashboard import it as
|
|
6
|
+
* `@sonordev/contracts/broadcast-layouts`.
|
|
7
|
+
*
|
|
8
|
+
* Why it exists: a post is centered (`headline`) or low (`anchor`), never
|
|
9
|
+
* top-aligned. Retiring the top-aligned compositions meant changing the same
|
|
10
|
+
* lists in three places (the Sonor API, Signal and the dashboard), and any one
|
|
11
|
+
* of them drifting would let an old ID reach a renderer or a picker. So the
|
|
12
|
+
* IDs, the retired-to-drawn map, the normalizers, the labels and the review
|
|
13
|
+
* draw live here once.
|
|
14
|
+
*
|
|
15
|
+
* Two lists, on purpose:
|
|
16
|
+
* - CARD_LAYOUTS is every ID a stored row, a saved setting or a request may
|
|
17
|
+
* carry. Retired IDs stay in it so old rows keep validating; they're
|
|
18
|
+
* normalized on the way to a renderer.
|
|
19
|
+
* - ARTICLE_COVER_LAYOUTS is what's drawn and offered. Nothing else is.
|
|
20
|
+
* Both orders are visible (rotation order and refusal messages), so they're
|
|
21
|
+
* part of the contract.
|
|
22
|
+
*
|
|
23
|
+
* Pure: no I/O, no Node built-ins. The review draw takes the SHA-256 digest
|
|
24
|
+
* of reviewCompositionSeed, which the caller hashes, so the hash stays with
|
|
25
|
+
* the server.
|
|
26
|
+
*/
|
|
27
|
+
/** Bumped when a stored ID here changes meaning. */
|
|
28
|
+
export declare const BROADCAST_LAYOUTS_CONTRACT_VERSION = 1;
|
|
29
|
+
/**
|
|
30
|
+
* Every composition ID a stored row, a saved setting or a request may carry.
|
|
31
|
+
*
|
|
32
|
+
* - `headline`: centered, the title set large.
|
|
33
|
+
* - `anchor`: the background leads, the title sits low.
|
|
34
|
+
* - `stacked`: retired 2026-10-14 (title pinned to the top, art below). Draws as `anchor`.
|
|
35
|
+
* - `split`: retired (title and stage in columns). Draws as `headline`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const CARD_LAYOUTS: readonly ['stacked', 'headline', 'split', 'anchor'];
|
|
38
|
+
export type CardLayoutId = (typeof CARD_LAYOUTS)[number];
|
|
39
|
+
/** The compositions Broadcast draws and offers: centered or low. Nothing is top-aligned. */
|
|
40
|
+
export declare const ARTICLE_COVER_LAYOUTS: readonly ['headline', 'anchor'];
|
|
41
|
+
export type ArticleCoverLayoutId = (typeof ARTICLE_COVER_LAYOUTS)[number];
|
|
42
|
+
export type RetiredCardLayoutId = Exclude<CardLayoutId, ArticleCoverLayoutId>;
|
|
43
|
+
/** Each retired layout ID, and the composition it draws as. */
|
|
44
|
+
export declare const RETIRED_CARD_LAYOUTS: Readonly<Record<RetiredCardLayoutId, ArticleCoverLayoutId>>;
|
|
45
|
+
/** A readable layout ID, retired ones included. The check every input boundary uses. */
|
|
46
|
+
export declare const isCardLayoutId: (value: unknown) => value is CardLayoutId;
|
|
47
|
+
/** A layout that's drawn and offered today. */
|
|
48
|
+
export declare const isArticleCoverLayoutId: (value: unknown) => value is ArticleCoverLayoutId;
|
|
49
|
+
/** A retired layout ID (an own key of RETIRED_CARD_LAYOUTS, never an inherited one). */
|
|
50
|
+
export declare const isRetiredCardLayoutId: (value: unknown) => value is RetiredCardLayoutId;
|
|
51
|
+
/**
|
|
52
|
+
* Which composition a layout ID draws. A retired ID becomes what it draws as;
|
|
53
|
+
* anything else is returned as it came, so callers check isCardLayoutId (or
|
|
54
|
+
* pass `auto` through) before rendering. Every renderer reads its layout
|
|
55
|
+
* through here, so a retired ID never reaches one.
|
|
56
|
+
*/
|
|
57
|
+
export declare function normalizeArticleCoverLayout(layout: CardLayoutId): ArticleCoverLayoutId;
|
|
58
|
+
export declare function normalizeArticleCoverLayout<T>(layout: T): T | ArticleCoverLayoutId;
|
|
59
|
+
/** What each drawn layout is called wherever a person picks one. */
|
|
60
|
+
export declare const CARD_LAYOUT_LABELS: Readonly<Record<ArticleCoverLayoutId, string>>;
|
|
61
|
+
/** The layout choices the API serves to pickers and agents, Anchor first. */
|
|
62
|
+
export declare const CARD_LAYOUT_OPTIONS: ReadonlyArray<{
|
|
63
|
+
id: ArticleCoverLayoutId;
|
|
64
|
+
label: string;
|
|
65
|
+
}>;
|
|
66
|
+
/** A publication's card layout when it doesn't pin one: rotate. */
|
|
67
|
+
export declare const AUTO_CARD_LAYOUT: 'auto';
|
|
68
|
+
export type PublicationCardLayout = CardLayoutId | typeof AUTO_CARD_LAYOUT;
|
|
69
|
+
/** What a publication-branding write may choose: rotate, or a drawn layout. */
|
|
70
|
+
export declare const PUBLICATION_CARD_LAYOUTS: readonly ["auto", "headline", "anchor"];
|
|
71
|
+
/** What a saved publication-branding profile may carry: a write's choices plus the retired IDs. */
|
|
72
|
+
export declare const SAVED_PUBLICATION_CARD_LAYOUTS: readonly ["auto", "stacked", "headline", "split", "anchor"];
|
|
73
|
+
/**
|
|
74
|
+
* The shared Broadcast look for article, review and generated post artwork.
|
|
75
|
+
* One choice per project (stored as `articleStyle`, its legacy wire name).
|
|
76
|
+
*
|
|
77
|
+
* - `glass`: the background full bleed, the words on a frosted card.
|
|
78
|
+
* - `editorial`: paper, a serif headline, the image framed like a magazine plate.
|
|
79
|
+
* - `poster`: one flat accent field, condensed type, big numbers.
|
|
80
|
+
* - `cinematic`: the image as a widescreen still over solid ground.
|
|
81
|
+
* - `blueprint`: a drawing sheet, with a grid, mono labels and a title block.
|
|
82
|
+
* - `focus`: real project photos, a dark reading gradient and circular details.
|
|
83
|
+
*/
|
|
84
|
+
export declare const BROADCAST_STYLES: readonly ['glass', 'editorial', 'poster', 'cinematic', 'blueprint', 'focus'];
|
|
85
|
+
export type BroadcastStyleId = (typeof BROADCAST_STYLES)[number];
|
|
86
|
+
export declare const DEFAULT_BROADCAST_STYLE: BroadcastStyleId;
|
|
87
|
+
export declare const isBroadcastStyleId: (value: unknown) => value is BroadcastStyleId;
|
|
88
|
+
/**
|
|
89
|
+
* The review compositions Broadcast draws: `signature` (photo up top, the
|
|
90
|
+
* quote low) and `frame` (centered). Order matters: a review whose v1 draw
|
|
91
|
+
* was retired redraws by index into this list.
|
|
92
|
+
*/
|
|
93
|
+
export declare const REVIEW_CARD_VARIATIONS: readonly ['signature', 'frame'];
|
|
94
|
+
export type ReviewCardVariation = (typeof REVIEW_CARD_VARIATIONS)[number];
|
|
95
|
+
/** A review composition when none is chosen, or an unknown one is asked for. */
|
|
96
|
+
export declare const DEFAULT_REVIEW_CARD_VARIATION: ReviewCardVariation;
|
|
97
|
+
/** Each retired review variation, and what it draws as. `spotlight` pinned the quote to the top; retired 2026-10-14. */
|
|
98
|
+
export declare const RETIRED_REVIEW_CARD_VARIATIONS: Readonly<Record<'spotlight', ReviewCardVariation>>;
|
|
99
|
+
/** What each review variation is called wherever a person picks one. */
|
|
100
|
+
export declare const REVIEW_CARD_VARIATION_LABELS: Readonly<Record<ReviewCardVariation, string>>;
|
|
101
|
+
/** The review variation choices, in REVIEW_CARD_VARIATIONS order. */
|
|
102
|
+
export declare const REVIEW_CARD_VARIATION_OPTIONS: ReadonlyArray<{
|
|
103
|
+
id: ReviewCardVariation;
|
|
104
|
+
label: string;
|
|
105
|
+
}>;
|
|
106
|
+
/** A review variation that's drawn today. Strict: a retired one isn't. */
|
|
107
|
+
export declare const isReviewCardVariation: (value: unknown) => value is ReviewCardVariation;
|
|
108
|
+
/**
|
|
109
|
+
* The review composition to draw for a stored or requested value: a drawn
|
|
110
|
+
* one as it is, a retired one as what it draws as, anything else (null, '',
|
|
111
|
+
* an unknown string) as the default.
|
|
112
|
+
*/
|
|
113
|
+
export declare function normalizeReviewCardVariation(value: unknown): ReviewCardVariation;
|
|
114
|
+
/**
|
|
115
|
+
* The v1 draw list, frozen. A review's composition belongs to its immutable
|
|
116
|
+
* identity, so changing this list (or its order) would reshuffle every
|
|
117
|
+
* review's card. New compositions get a new seed version, never an edit here.
|
|
118
|
+
*/
|
|
119
|
+
export declare const REVIEW_CARD_VARIATION_V1_DRAW: readonly ['signature', 'spotlight', 'frame'];
|
|
120
|
+
/**
|
|
121
|
+
* What a review's composition is drawn from: the project and the review, and
|
|
122
|
+
* nothing a person can edit (platform, artwork, copy and brand never move it).
|
|
123
|
+
* Hash this string with SHA-256 and pass the digest to
|
|
124
|
+
* reviewCardVariationFromDigest.
|
|
125
|
+
*/
|
|
126
|
+
export declare function reviewCompositionSeed(projectId: string, reviewId: string): string;
|
|
127
|
+
/**
|
|
128
|
+
* The composition a review's digest draws. The first four bytes (big-endian)
|
|
129
|
+
* pick from the v1 list; a review that drew a retired composition redraws
|
|
130
|
+
* between the drawn ones from the next four, so no other review moves.
|
|
131
|
+
* `digest` is the SHA-256 of reviewCompositionSeed (a Node Buffer works).
|
|
132
|
+
*/
|
|
133
|
+
export declare function reviewCardVariationFromDigest(digest: ArrayLike<number>): ReviewCardVariation;
|