@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.
- package/AGENTS.md +13 -1
- package/CHANGELOG.md +12 -0
- package/README.md +9 -5
- package/agent-manifest.json +53 -8
- package/dist/{AnalyticsProvider-6TAA3XYB.js → AnalyticsProvider-D6GWEJSB.js} +6 -6
- package/dist/{ArticleFaqSection-3Q26DP7P.js → ArticleFaqSection-DEWE5B4Q.js} +1 -1
- package/dist/{ArticleViewTracker-H4N7YCLC.js → ArticleViewTracker-YZ76HM64.js} +17 -6
- package/dist/{BlocksPopup-FJT5YQD3.js → BlocksPopup-UJXZ4AXG.js} +6 -6
- package/dist/{ChatWidget-THQHHTAA.js → ChatWidget-H4EOSH5I.js} +6 -6
- package/dist/{FileField-OZXXJGUM.js → FileField-CKBYGCNT.js} +4 -4
- package/dist/{FormSpotlight-MLDJS246.js → FormSpotlight-CGF5ZE6S.js} +1 -1
- package/dist/{FormStage-6RVY7M3R.js → FormStage-PQPUPQWW.js} +1 -1
- package/dist/{ManagedForm-3VV54RVH.js → ManagedForm-YOEZ7CFS.js} +7 -7
- package/dist/{ManagedNewsletterForm-RTJDGMGG.js → ManagedNewsletterForm-EUWJ2HCA.js} +25 -11
- package/dist/{SignalCore-T7ZOCA44.js → SignalCore-JZSU7A44.js} +14 -8
- package/dist/SiteChat-OAZH34W7.js +6 -0
- package/dist/SiteDesignReporter-IWBMZJYU.js +12 -0
- package/dist/{SitePopups-K6ADAWFK.js → SitePopups-MLAT35UN.js} +6 -6
- package/dist/SitemapSync-6KQLKFO2.js +9 -0
- package/dist/_client/booking-widget.js +6 -6
- package/dist/_client/testimonial-section.js +3 -3
- package/dist/affiliates/index.js +4 -4
- package/dist/analytics/index.js +6 -6
- package/dist/analytics/publication-cta.d.ts +3 -0
- package/dist/{article-styles-GFXJJDLE.js → article-styles-AOOVVKXH.js} +7 -5
- package/dist/article-tables-6XHVULPU.js +2 -0
- package/dist/articles/Article.d.ts +2 -89
- package/dist/articles/ArticleFAQ.d.ts +2 -41
- package/dist/articles/ArticleFaqSection.d.ts +2 -2
- package/dist/articles/ArticleList.d.ts +2 -79
- package/dist/articles/ArticleViewTracker.d.ts +2 -15
- package/dist/articles/AuthorCard.d.ts +2 -10
- package/dist/articles/AuthorPage.d.ts +2 -8
- package/dist/articles/ClusterLandingPage.d.ts +2 -40
- package/dist/articles/ClusterNavigation.d.ts +2 -37
- package/dist/articles/ManagedNewsletterForm.d.ts +3 -12
- package/dist/articles/NewsletterShell.d.ts +2 -17
- package/dist/articles/NewsletterWidget.d.ts +2 -30
- package/dist/articles/PublicationLayout.d.ts +2 -67
- package/dist/articles/PublicationSidebar.d.ts +2 -36
- package/dist/articles/RelatedPosts.d.ts +2 -22
- package/dist/articles/ServiceCallout.d.ts +2 -56
- package/dist/articles/TableOfContents.d.ts +2 -6
- package/dist/articles/article-photos.d.ts +2 -9
- package/dist/articles/article-styles.d.ts +2 -21
- package/dist/articles/article-tables.d.ts +2 -12
- package/dist/articles/artwork.d.ts +2 -13
- package/dist/articles/author-schema.d.ts +2 -72
- package/dist/articles/author-social.d.ts +2 -14
- package/dist/articles/excerpt.d.ts +2 -17
- package/dist/articles/index.d.ts +2 -79
- package/dist/articles/index.js +16 -11
- package/dist/articles/news-sitemap.d.ts +2 -46
- package/dist/articles/processArticleHtml.d.ts +2 -34
- package/dist/articles/public-reads.d.ts +2 -26
- package/dist/articles/reading-time.d.ts +2 -9
- package/dist/articles/routes.d.ts +2 -52
- package/dist/articles/server-core.d.ts +2 -461
- package/dist/articles/server-ui.d.ts +2 -30
- package/dist/articles/server-ui.js +72 -62
- package/dist/articles/server.d.ts +2 -461
- package/dist/articles/server.js +14 -5
- package/dist/articles/types.d.ts +2 -316
- package/dist/articles/widget-styles.d.ts +2 -8
- package/dist/chat/index.js +8 -8
- package/dist/chunk-34ZYJTQR.js +1 -0
- package/dist/{chunk-727R7C5R.js → chunk-3VSFOD2Z.js} +2 -2
- package/dist/{chunk-JC2VS2SB.js → chunk-44GVU5UH.js} +1 -1
- package/dist/{chunk-WYZ4OUON.js → chunk-4HYIDQJJ.js} +1 -1
- package/dist/{chunk-WMVK77ND.js → chunk-4K735O3J.js} +1 -1
- package/dist/{chunk-L5UOHS6E.js → chunk-5D7ZISUP.js} +1 -1
- package/dist/{chunk-Q72M5KBS.js → chunk-5S7YTOCB.js} +1 -1
- package/dist/{chunk-WSNG2K3T.js → chunk-5TDZHIG6.js} +3 -3
- package/dist/{chunk-6CJGZFOU.js → chunk-A4MPHIVP.js} +1 -1
- package/dist/chunk-B7T2SFUF.js +1 -0
- package/dist/{chunk-FV2VD7WM.js → chunk-BC7JMY4Z.js} +3 -3
- package/dist/chunk-BLCHQIWR.js +319 -0
- package/dist/{chunk-NNEIBXGU.js → chunk-BLENFNBW.js} +2 -2
- package/dist/{chunk-NFRJTOTB.js → chunk-BSQP6PRA.js} +1 -1
- package/dist/{chunk-GKGSXUVQ.js → chunk-BVB5FBAA.js} +1 -1
- package/dist/{chunk-WACWV5EP.js → chunk-CE7VPAEH.js} +3 -3
- package/dist/{chunk-GYF2ULVO.js → chunk-DJAYFHVF.js} +1 -1
- package/dist/{chunk-WBC5B3JD.js → chunk-DKKYZLKR.js} +3 -3
- package/dist/{chunk-CAH4Y4PY.js → chunk-DLM4FFNH.js} +6 -2
- package/dist/{chunk-575L73NT.js → chunk-DS6LECIX.js} +1 -1
- package/dist/{chunk-Y3INC4QJ.js → chunk-E4PTMORJ.js} +1 -1
- package/dist/chunk-H72ZFO3F.js +1 -0
- package/dist/{chunk-WK3N3Y7V.js → chunk-HH2GOZTO.js} +2 -2
- package/dist/{chunk-JBEUZJS3.js → chunk-ITY4UZEJ.js} +3 -3
- package/dist/{chunk-GWP2VBFH.js → chunk-J4KX2D3Q.js} +3 -3
- package/dist/{chunk-57K4GW3D.js → chunk-JCSU6EJI.js} +1 -1
- package/dist/{chunk-SC4MZGWZ.js → chunk-JHTPHA2D.js} +6 -3
- package/dist/{chunk-YBAFUM3Z.js → chunk-JV5YWTJN.js} +13 -4
- package/dist/{chunk-I6QFPSUU.js → chunk-KASKB7UK.js} +11 -10
- package/dist/{chunk-SMYX3AAO.js → chunk-LEGMPX6N.js} +1 -1
- package/dist/{chunk-ZM2FNWIQ.js → chunk-LPVEBQVL.js} +1 -1
- package/dist/{chunk-HUBMKTPW.js → chunk-M5SF7NCC.js} +1 -1
- package/dist/{chunk-EBILJHUF.js → chunk-MTV5LYXN.js} +31 -2
- package/dist/{chunk-5ZCY36TY.js → chunk-MZX4EN6Z.js} +1 -1
- package/dist/{chunk-7FSB2EXS.js → chunk-OKITZFML.js} +1 -1
- package/dist/{chunk-H4R2GPAB.js → chunk-PEI6DRSK.js} +2 -2
- package/dist/{chunk-FVXFLVXF.js → chunk-QD73RO67.js} +3 -3
- package/dist/{chunk-66G47P5C.js → chunk-QKOVP7WO.js} +2 -2
- package/dist/{chunk-3EU6S5YC.js → chunk-RBNHRZGD.js} +1 -1
- package/dist/{chunk-XWIRU6UT.js → chunk-S6QDNXDK.js} +2 -2
- package/dist/{chunk-FQUGGPBM.js → chunk-TY6WNQO3.js} +124 -41
- package/dist/{chunk-QXMIKDOL.js → chunk-UVYUTBT4.js} +14 -4
- package/dist/{chunk-3G7YABRA.js → chunk-W7OPEMGJ.js} +4 -1
- package/dist/{chunk-JIH32RH2.js → chunk-XA7Q2VQA.js} +1 -1
- package/dist/{chunk-X7VKRHFF.js → chunk-XENW66OF.js} +1 -1
- package/dist/chunk-XI2XM7UG.js +14 -0
- package/dist/{chunk-BQZPHICL.js → chunk-YM5KMNTU.js} +1 -1
- package/dist/client/index.js +4 -16
- package/dist/fleet/index.js +6 -6
- package/dist/forms/index.js +9 -325
- package/dist/forms/server.js +2 -2
- package/dist/forms/types.d.ts +5 -0
- package/dist/forms/useForm.d.ts +4 -0
- package/dist/images/index.js +4 -4
- package/dist/index.js +1 -1
- package/dist/layout/client.js +9 -9
- package/dist/layout/index.js +10 -10
- package/dist/llms/index.js +8 -8
- package/dist/maps/index.js +4 -4
- package/dist/mcp/sonor.d.ts +46 -3
- package/dist/mcp/sonor.js +51 -29
- package/dist/mcp/transport.d.ts +1 -1
- package/dist/press-kit/articles/Article.d.ts +89 -0
- package/dist/press-kit/articles/ArticleFAQ.d.ts +41 -0
- package/dist/press-kit/articles/ArticleFaqSection.d.ts +2 -0
- package/dist/press-kit/articles/ArticleList.d.ts +79 -0
- package/dist/press-kit/articles/ArticleViewTracker.d.ts +15 -0
- package/dist/press-kit/articles/AuthorCard.d.ts +10 -0
- package/dist/press-kit/articles/AuthorPage.d.ts +8 -0
- package/dist/press-kit/articles/ClusterLandingPage.d.ts +40 -0
- package/dist/press-kit/articles/ClusterNavigation.d.ts +37 -0
- package/dist/press-kit/articles/ManagedNewsletterForm.d.ts +12 -0
- package/dist/press-kit/articles/NewsletterShell.d.ts +17 -0
- package/dist/press-kit/articles/NewsletterWidget.d.ts +30 -0
- package/dist/press-kit/articles/PublicationLayout.d.ts +67 -0
- package/dist/press-kit/articles/PublicationSidebar.d.ts +36 -0
- package/dist/press-kit/articles/RelatedPosts.d.ts +22 -0
- package/dist/press-kit/articles/ServiceCallout.d.ts +56 -0
- package/dist/press-kit/articles/TableOfContents.d.ts +6 -0
- package/dist/press-kit/articles/article-photos.d.ts +9 -0
- package/dist/press-kit/articles/article-styles.d.ts +21 -0
- package/dist/press-kit/articles/article-tables.d.ts +12 -0
- package/dist/press-kit/articles/artwork.d.ts +16 -0
- package/dist/press-kit/articles/author-schema.d.ts +72 -0
- package/dist/press-kit/articles/author-social.d.ts +14 -0
- package/dist/press-kit/articles/excerpt.d.ts +17 -0
- package/dist/press-kit/articles/index.d.ts +80 -0
- package/dist/press-kit/articles/news-sitemap.d.ts +40 -0
- package/dist/press-kit/articles/processArticleHtml.d.ts +34 -0
- package/dist/press-kit/articles/public-reads.d.ts +42 -0
- package/dist/press-kit/articles/publication-definition.d.ts +41 -0
- package/dist/press-kit/articles/publication-reads.d.ts +54 -0
- package/dist/press-kit/articles/reading-time.d.ts +9 -0
- package/dist/press-kit/articles/routes.d.ts +52 -0
- package/dist/press-kit/articles/server-core.d.ts +479 -0
- package/dist/press-kit/articles/server-ui.d.ts +31 -0
- package/dist/press-kit/articles/types.d.ts +339 -0
- package/dist/press-kit/articles/widget-styles.d.ts +8 -0
- package/dist/reputation/index.js +3 -3
- package/dist/reputation/server.js +2 -2
- package/dist/revalidate/index.js +2 -2
- package/dist/runtime/index.js +5 -4
- package/dist/seo/client.js +6 -6
- package/dist/seo/index.js +7 -7
- package/dist/seo/llms.js +8 -8
- package/dist/seo/register-sitemap-cli.js +1 -1
- package/dist/seo/sitemap.js +6 -6
- package/dist/server/index.js +3 -2
- package/dist/shared/build-entries.d.ts +2 -1
- package/dist/shared/clientApiConfig.d.ts +2 -0
- package/dist/shared/import-specifiers.d.ts +1 -1
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.js +8 -0
- package/dist/shared/reporting-gate.d.ts +2 -0
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +2 -2
- package/dist/sitemap/index.js +6 -6
- package/dist/sync/index.js +6 -6
- package/dist/website/images.js +4 -4
- package/dist/website/index.js +7 -7
- package/dist/website/popups.js +6 -6
- package/dist/{writeLLMsTxt-DGKLYXIW.js → writeLLMsTxt-N4Y4YC2H.js} +5 -5
- package/docs/MIGRATING-TO-PRESS-KIT.md +83 -0
- package/docs.json +145 -29
- package/package.json +15 -5
- package/src/articles/README.md +5 -360
- package/src/mcp/README.md +16 -0
- package/src/og/README.md +1 -1
- package/src/runtime/README.md +4 -0
- package/dist/SiteChat-JSHPGAE3.js +0 -6
- package/dist/SiteDesignReporter-L2JBAKKK.js +0 -12
- package/dist/SitemapSync-VV2YSMIW.js +0 -9
- package/dist/article-tables-AXSZOGNW.js +0 -2
|
@@ -83,7 +83,7 @@ function resolveArticlePhotoPlacements(html, photos = []) {
|
|
|
83
83
|
return { headings: headings.map(({ start: _start, end: _end, ...heading }) => heading), placements };
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// src/articles/article-photos.ts
|
|
86
|
+
// packages/press-kit/src/articles/article-photos.ts
|
|
87
87
|
var escape = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
88
88
|
function photoUrl(value) {
|
|
89
89
|
if (typeof value !== "string" || value.length > 2e3 || /[\s\\]/.test(value)) return null;
|
|
@@ -2,12 +2,23 @@
|
|
|
2
2
|
import { registerAnalyticsDispatcher } from './chunk-LCDVPAMR.js';
|
|
3
3
|
import { getOrCreateVisitorId, getOrCreateSessionId } from './chunk-ZKADJNR2.js';
|
|
4
4
|
import { onPageLeave } from './chunk-L2V5PUFN.js';
|
|
5
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
6
|
-
import { sonorFetch, sonorBeacon } from './chunk-
|
|
5
|
+
import { resolveAnalyticsTarget } from './chunk-DLM4FFNH.js';
|
|
6
|
+
import { sonorFetch, sonorBeacon } from './chunk-3VSFOD2Z.js';
|
|
7
7
|
import { createContext, useRef, useEffect, useState, useMemo, useCallback, useContext } from 'react';
|
|
8
8
|
import { usePathname } from 'next/navigation';
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
|
+
// src/analytics/publication-cta.ts
|
|
12
|
+
function publicationCtaEvent(target) {
|
|
13
|
+
if (!(target instanceof Element)) return null;
|
|
14
|
+
const link = target.closest("a[data-sk-article-id][data-sk-article-goal]");
|
|
15
|
+
const article_id = link?.dataset.skArticleId?.trim();
|
|
16
|
+
const goal = link?.dataset.skArticleGoal?.trim();
|
|
17
|
+
const href = link?.getAttribute("href")?.trim();
|
|
18
|
+
if (!article_id || !goal || !href || !/^(?:https?:\/\/|\/(?!\/))/.test(href)) return null;
|
|
19
|
+
return { name: "article_cta_click", category: "publication", properties: { article_id, goal, href } };
|
|
20
|
+
}
|
|
21
|
+
|
|
11
22
|
// src/analytics/page-observation.ts
|
|
12
23
|
function collectPageObservation() {
|
|
13
24
|
const observedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -978,6 +989,24 @@ function AnalyticsProvider({
|
|
|
978
989
|
document.removeEventListener("click", handleClick);
|
|
979
990
|
};
|
|
980
991
|
}, [pathname, gate, trackClicks, debug]);
|
|
992
|
+
useEffect(() => {
|
|
993
|
+
if (typeof document === "undefined" || !resolveAnalyticsTarget(gate)) return;
|
|
994
|
+
const click = (event) => {
|
|
995
|
+
const options = publicationCtaEvent(event.target);
|
|
996
|
+
if (!options) return;
|
|
997
|
+
void analyticsSend("/api/public/analytics/event", {
|
|
998
|
+
sessionId: sessionIdRef.current,
|
|
999
|
+
visitorId: visitorIdRef.current,
|
|
1000
|
+
site,
|
|
1001
|
+
pagePath: pathname,
|
|
1002
|
+
eventName: options.name,
|
|
1003
|
+
eventCategory: options.category,
|
|
1004
|
+
properties: options.properties
|
|
1005
|
+
}, { ...gate, keepalive: true });
|
|
1006
|
+
};
|
|
1007
|
+
document.addEventListener("click", click, { passive: true });
|
|
1008
|
+
return () => document.removeEventListener("click", click);
|
|
1009
|
+
}, [gate, site, pathname]);
|
|
981
1010
|
const trackEvent = useCallback((options) => {
|
|
982
1011
|
const doTrack = async () => {
|
|
983
1012
|
const event = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveSiteHost } from './chunk-FESKKJAS.js';
|
|
2
|
-
import { configureSiteCredential, currentCredential } from './chunk-
|
|
2
|
+
import { configureSiteCredential, currentCredential } from './chunk-RBNHRZGD.js';
|
|
3
3
|
|
|
4
4
|
// src/shared/publishCredential.ts
|
|
5
5
|
function publishSiteCredential({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-
|
|
2
|
+
import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-DKKYZLKR.js';
|
|
3
3
|
import { designTokensHash } from './chunk-IHG36STL.js';
|
|
4
4
|
import { useDeferredActivation } from './chunk-YC7ELZS3.js';
|
|
5
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
5
|
+
import { resolveAnalyticsTarget } from './chunk-DLM4FFNH.js';
|
|
6
6
|
import { useRef, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
var STAMP_KEY = (site) => `_sk_design_sent:${site}`;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { VISUAL_VIEWPORT_GAP_PROPERTY } from './chunk-6T6CQVNL.js';
|
|
3
3
|
import { GlassStyles } from './chunk-JE4A5S4F.js';
|
|
4
4
|
import { DEFAULT_WIDGET_Z_INDEX } from './chunk-27FISYK4.js';
|
|
5
|
-
import { useForm } from './chunk-
|
|
5
|
+
import { useForm } from './chunk-JV5YWTJN.js';
|
|
6
6
|
import { parseColor, relativeLuminance, DARK_LUMINANCE, contrastRatio } from './chunk-S22FSH7C.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { sonorFetch } from './chunk-3VSFOD2Z.js';
|
|
8
|
+
import { readPublishedApiConfig } from './chunk-W7OPEMGJ.js';
|
|
9
9
|
import { useState, useEffect, useRef, useLayoutEffect, useCallback, Fragment as Fragment$1 } from 'react';
|
|
10
10
|
import { lexer } from 'marked';
|
|
11
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { detectTimezone, releaseSlotHold, fetchBookingTypeDetails, fetchBookingTypes, fetchAvailability, createSlotHold, createBooking, formatDuration, formatDate, formatTime, prepareMeeting } from './chunk-
|
|
3
|
-
import { readPublishedApiConfig, DEFAULT_SONOR_API_URL } from './chunk-
|
|
2
|
+
import { detectTimezone, releaseSlotHold, fetchBookingTypeDetails, fetchBookingTypes, fetchAvailability, createSlotHold, createBooking, formatDuration, formatDate, formatTime, prepareMeeting } from './chunk-S6QDNXDK.js';
|
|
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';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { sonorFetch } from './chunk-3VSFOD2Z.js';
|
|
2
|
+
import { getClientApiConfig } from './chunk-W7OPEMGJ.js';
|
|
3
3
|
|
|
4
4
|
// src/sync/api.ts
|
|
5
5
|
function getApiConfig() {
|
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import { insertArticlePhotos } from './chunk-
|
|
2
|
-
import { generateArticleAuthorNode, resolveArticleArtwork, withArticleAuthorIdentity } from './chunk-
|
|
3
|
-
import { resolveArticleUrl, createPublicationRoutes, resolvePublicationUrl, articleCategorySlug } from './chunk-
|
|
1
|
+
import { insertArticlePhotos } from './chunk-M5SF7NCC.js';
|
|
2
|
+
import { resolveRepresentativeImage, generateArticleAuthorNode, articleImageSchema, resolveArticleArtwork, withArticleAuthorIdentity } from './chunk-UVYUTBT4.js';
|
|
3
|
+
import { resolveArticleUrl, createPublicationRoutes, resolvePublicationUrl, articleCategorySlug } from './chunk-4K735O3J.js';
|
|
4
4
|
import { withoutSchemaPlaceholders } from './chunk-VWWITFWM.js';
|
|
5
5
|
import { withSiteParam, withSiteBody } from './chunk-MJP63SSS.js';
|
|
6
6
|
import { resolveServerApiConfig } from './chunk-C7TLGL3R.js';
|
|
7
|
+
import 'server-only';
|
|
7
8
|
import { notFound } from 'next/navigation';
|
|
8
9
|
|
|
9
|
-
// src/articles/public-reads.ts
|
|
10
|
-
|
|
10
|
+
// packages/press-kit/src/articles/public-reads.ts
|
|
11
|
+
var ArticleUnavailableError = class extends Error {
|
|
12
|
+
constructor(status) {
|
|
13
|
+
super("Articles are temporarily unavailable. Please try again.");
|
|
14
|
+
this.status = status;
|
|
15
|
+
this.code = "ARTICLE_UNAVAILABLE";
|
|
16
|
+
this.name = "ArticleUnavailableError";
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
async function readArticleBySlug({ apiUrl, apiKey, site }, slug) {
|
|
11
20
|
try {
|
|
12
|
-
const response = await fetch(withSiteParam(`${apiUrl}/public/articles/posts/${slug}`, site), {
|
|
21
|
+
const response = await fetch(withSiteParam(`${apiUrl}/public/articles/posts/${encodeURIComponent(slug)}`, site), {
|
|
13
22
|
headers: { "x-api-key": apiKey },
|
|
14
23
|
next: { revalidate: 60 }
|
|
15
24
|
});
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
25
|
+
if (response.status === 404) return { state: "not_found" };
|
|
26
|
+
if (!response.ok) return { state: "unavailable", status: response.status };
|
|
20
27
|
const data = await response.json();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return
|
|
28
|
+
if (!data.post || typeof data.post.slug !== "string" || typeof data.post.title !== "string") return { state: "unavailable" };
|
|
29
|
+
return { state: "ready", value: data.post };
|
|
30
|
+
} catch {
|
|
31
|
+
return { state: "unavailable" };
|
|
25
32
|
}
|
|
26
33
|
}
|
|
34
|
+
async function fetchArticleBySlug(config, slug) {
|
|
35
|
+
const result = await readArticleBySlug(config, slug);
|
|
36
|
+
if (result.state === "unavailable") throw new ArticleUnavailableError(result.status);
|
|
37
|
+
return result.state === "ready" ? result.value : null;
|
|
38
|
+
}
|
|
27
39
|
async function fetchArticleCategories({ apiUrl, apiKey, site }) {
|
|
28
40
|
try {
|
|
29
41
|
const response = await fetch(withSiteParam(`${apiUrl}/public/articles/categories`, site), {
|
|
@@ -58,7 +70,7 @@ async function fetchRelatedArticles({ apiUrl, apiKey, site }, currentPostId, lim
|
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
|
|
61
|
-
// src/articles/excerpt.ts
|
|
73
|
+
// packages/press-kit/src/articles/excerpt.ts
|
|
62
74
|
function sanitizeExcerpt(raw, maxLength = 160) {
|
|
63
75
|
if (!raw) return "";
|
|
64
76
|
let text = String(raw).trim();
|
|
@@ -90,7 +102,7 @@ function sanitizeExcerpt(raw, maxLength = 160) {
|
|
|
90
102
|
return `${(lastSpace > maxLength * 0.6 ? cut.slice(0, lastSpace) : cut).replace(/[\s,;:—–-]+$/, "")}\u2026`;
|
|
91
103
|
}
|
|
92
104
|
|
|
93
|
-
// src/articles/news-sitemap.ts
|
|
105
|
+
// packages/press-kit/src/articles/news-sitemap.ts
|
|
94
106
|
var NEWS_SITEMAP_WINDOW_MS = 2 * 24 * 60 * 60 * 1e3;
|
|
95
107
|
var NEWS_SITEMAP_MAX_URLS = 1e3;
|
|
96
108
|
var FEED_DEFAULT_ITEMS = 20;
|
|
@@ -111,8 +123,11 @@ function buildNewsSitemapXml(posts, options, now = /* @__PURE__ */ new Date()) {
|
|
|
111
123
|
const language = options.language || "en";
|
|
112
124
|
const items = recentNewsPosts(posts, now).map((post) => {
|
|
113
125
|
const url = resolveArticleUrl(post, { ...options, siteUrl: options.siteUrl });
|
|
126
|
+
const image = resolveRepresentativeImage(post);
|
|
127
|
+
const imageUrl = image ? new URL(image.url, options.siteUrl).href : void 0;
|
|
114
128
|
return ` <url>
|
|
115
|
-
<loc>${escapeXml(url)}</loc
|
|
129
|
+
<loc>${escapeXml(url)}</loc>${imageUrl ? `
|
|
130
|
+
<image:image><image:loc>${escapeXml(imageUrl)}</image:loc></image:image>` : ""}
|
|
116
131
|
<news:news>
|
|
117
132
|
<news:publication>
|
|
118
133
|
<news:name>${escapeXml(options.publicationName)}</news:name>
|
|
@@ -124,11 +139,79 @@ function buildNewsSitemapXml(posts, options, now = /* @__PURE__ */ new Date()) {
|
|
|
124
139
|
</url>`;
|
|
125
140
|
});
|
|
126
141
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
127
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
|
|
142
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
|
|
128
143
|
${items.join("\n")}${items.length ? "\n" : ""}</urlset>`;
|
|
129
144
|
}
|
|
130
|
-
|
|
131
|
-
|
|
145
|
+
async function publicRead(path, site) {
|
|
146
|
+
const config = resolveServerApiConfig();
|
|
147
|
+
if (!config) return { state: "unavailable" };
|
|
148
|
+
try {
|
|
149
|
+
const response = await fetch(withSiteParam(`${config.apiUrl}${path}`, site), {
|
|
150
|
+
headers: { "x-api-key": config.apiKey },
|
|
151
|
+
next: { revalidate: 60 }
|
|
152
|
+
});
|
|
153
|
+
if (response.status === 404) return { state: "not_found" };
|
|
154
|
+
if (!response.ok) return { state: "unavailable", status: response.status };
|
|
155
|
+
return { state: "ready", value: await response.json() };
|
|
156
|
+
} catch {
|
|
157
|
+
return { state: "unavailable" };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async function getPublicationIssues(options = {}) {
|
|
161
|
+
const query = new URLSearchParams({ limit: String(Math.min(50, Math.max(1, options.limit || 20))) });
|
|
162
|
+
if (options.cursor) query.set("cursor", options.cursor);
|
|
163
|
+
const result = await publicRead(`/public/publications/issues?${query}`, options.site);
|
|
164
|
+
if (result.state === "ready" && !Array.isArray(result.value?.issues)) return { state: "unavailable" };
|
|
165
|
+
return result;
|
|
166
|
+
}
|
|
167
|
+
async function getPublicationIssue(id, options = {}) {
|
|
168
|
+
const result = await publicRead(`/public/publications/issues/${encodeURIComponent(id)}`, options.site);
|
|
169
|
+
if (result.state !== "ready") return result;
|
|
170
|
+
return result.value?.issue?.id ? { state: "ready", value: result.value.issue } : { state: "unavailable" };
|
|
171
|
+
}
|
|
172
|
+
var PUBLICATION_PREVIEW_COOKIE = "_sk_press_preview";
|
|
173
|
+
var PUBLICATION_PREVIEW_HEADERS = { "Cache-Control": "private, no-store, max-age=0", "X-Robots-Tag": "noindex, nofollow, noarchive", "Referrer-Policy": "no-referrer" };
|
|
174
|
+
async function getArticlePreview(token, options) {
|
|
175
|
+
const config = resolveServerApiConfig();
|
|
176
|
+
if (!config || !token || token.length > 8192 || !options.site) return { state: "not_found" };
|
|
177
|
+
try {
|
|
178
|
+
const response = await fetch(`${config.apiUrl}/public/articles/preview`, {
|
|
179
|
+
method: "POST",
|
|
180
|
+
headers: { "Content-Type": "application/json", "x-api-key": config.apiKey },
|
|
181
|
+
body: JSON.stringify({ token, site: options.site }),
|
|
182
|
+
cache: "no-store"
|
|
183
|
+
});
|
|
184
|
+
if ([401, 403, 404, 410].includes(response.status)) return { state: "not_found" };
|
|
185
|
+
if (!response.ok) return { state: "unavailable", status: response.status };
|
|
186
|
+
const value = await response.json();
|
|
187
|
+
if (!value.post?.slug || value.site !== options.site || !Number.isFinite(Date.parse(value.expiresAt)) || Date.parse(value.expiresAt) <= Date.now()) return { state: "not_found" };
|
|
188
|
+
return { state: "ready", value };
|
|
189
|
+
} catch {
|
|
190
|
+
return { state: "unavailable" };
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function createPublicationPreviewHandler(options) {
|
|
194
|
+
const origin = new URL(options.siteUrl);
|
|
195
|
+
if (!/^https?:$/.test(origin.protocol) || !/^\/(?!\/)[^?#\\]*$/.test(options.previewPath)) throw new Error("Configure an HTTP site origin and a local preview path.");
|
|
196
|
+
return async (request) => {
|
|
197
|
+
const token = new URL(request.url).searchParams.get("token") || "";
|
|
198
|
+
const result = await getArticlePreview(token, { site: origin.hostname });
|
|
199
|
+
if (result.state !== "ready") return new Response(result.state === "unavailable" ? "Preview is temporarily unavailable. Please try again." : "This preview has expired or changed. Request a new preview in Sonor.", {
|
|
200
|
+
status: result.state === "unavailable" ? 503 : 410,
|
|
201
|
+
headers: PUBLICATION_PREVIEW_HEADERS
|
|
202
|
+
});
|
|
203
|
+
const maxAge = Math.max(0, Math.min(900, Math.floor((Date.parse(result.value.expiresAt) - Date.now()) / 1e3)));
|
|
204
|
+
return new Response(null, { status: 303, headers: {
|
|
205
|
+
...PUBLICATION_PREVIEW_HEADERS,
|
|
206
|
+
Location: new URL(options.previewPath, origin.origin).href,
|
|
207
|
+
"Set-Cookie": `${PUBLICATION_PREVIEW_COOKIE}=${encodeURIComponent(token)}; Path=${options.previewPath}; Max-Age=${maxAge}; HttpOnly; SameSite=Lax${origin.protocol === "https:" ? "; Secure" : ""}`
|
|
208
|
+
} });
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
async function getArticleResult(slug, options) {
|
|
212
|
+
const config = resolveServerApiConfig();
|
|
213
|
+
return config ? readArticleBySlug({ ...config, site: options?.site }, slug) : { state: "unavailable" };
|
|
214
|
+
}
|
|
132
215
|
var SEO_LIMITS = {
|
|
133
216
|
title: { min: 30, max: 60, recommended: 55 },
|
|
134
217
|
metaDescription: { min: 120, max: 160, recommended: 155 },
|
|
@@ -221,8 +304,7 @@ function validateArticleSeo(post) {
|
|
|
221
304
|
async function getArticle(slug, options) {
|
|
222
305
|
const config = resolveServerApiConfig();
|
|
223
306
|
if (!config) {
|
|
224
|
-
|
|
225
|
-
return null;
|
|
307
|
+
throw new ArticleUnavailableError();
|
|
226
308
|
}
|
|
227
309
|
return fetchArticleBySlug({ ...config, site: options?.site }, slug);
|
|
228
310
|
}
|
|
@@ -269,11 +351,21 @@ async function generateArticleMetadata(slug, options = {}) {
|
|
|
269
351
|
}
|
|
270
352
|
const title = post.meta_title || post.title;
|
|
271
353
|
const description = sanitizeExcerpt(post.meta_description || post.excerpt);
|
|
354
|
+
const representative = options.images === false ? void 0 : resolveRepresentativeImage(post);
|
|
272
355
|
const image = options.images === false ? void 0 : post.featured_image || defaultImage;
|
|
356
|
+
const images = options.images === false ? [] : [
|
|
357
|
+
...representative ? [representative] : [],
|
|
358
|
+
...image && image !== representative?.url ? [{
|
|
359
|
+
url: image,
|
|
360
|
+
alt: post.featured_image_alt || post.title,
|
|
361
|
+
...post.featured_image_width && post.featured_image_height ? { width: post.featured_image_width, height: post.featured_image_height } : {}
|
|
362
|
+
}] : []
|
|
363
|
+
];
|
|
273
364
|
const url = resolveArticleUrl(post, options);
|
|
274
365
|
return {
|
|
275
366
|
title,
|
|
276
367
|
description,
|
|
368
|
+
robots: { "max-image-preview": "large" },
|
|
277
369
|
openGraph: {
|
|
278
370
|
title: post.og_title || title,
|
|
279
371
|
description: post.og_description || description,
|
|
@@ -282,16 +374,7 @@ async function generateArticleMetadata(slug, options = {}) {
|
|
|
282
374
|
type: "article",
|
|
283
375
|
publishedTime: post.published_at,
|
|
284
376
|
authors: post.author ? [typeof post.author === "string" ? post.author : post.author.name] : void 0,
|
|
285
|
-
...
|
|
286
|
-
images: [
|
|
287
|
-
{
|
|
288
|
-
url: image,
|
|
289
|
-
width: 1200,
|
|
290
|
-
height: 630,
|
|
291
|
-
alt: post.featured_image_alt || post.title
|
|
292
|
-
}
|
|
293
|
-
]
|
|
294
|
-
}
|
|
377
|
+
...images.length ? { images } : {}
|
|
295
378
|
},
|
|
296
379
|
twitter: {
|
|
297
380
|
card: "summary_large_image",
|
|
@@ -415,7 +498,7 @@ async function generateArticleSitemap(siteUrl, options = {}) {
|
|
|
415
498
|
});
|
|
416
499
|
slugs.forEach((post) => {
|
|
417
500
|
const isPillar = post.article_type === "pillar";
|
|
418
|
-
const image = absoluteImage(post
|
|
501
|
+
const image = absoluteImage(resolveRepresentativeImage(post)?.url, siteUrl);
|
|
419
502
|
entries.push({
|
|
420
503
|
url: resolveArticleUrl(post, { ...options, siteUrl }),
|
|
421
504
|
lastModified: post.last_modified ? new Date(post.last_modified) : void 0,
|
|
@@ -443,7 +526,7 @@ function generateArticleSchema(post, options = {}) {
|
|
|
443
526
|
};
|
|
444
527
|
const author = generateArticleAuthorNode(post.author, options);
|
|
445
528
|
if (author) schema.author = author;
|
|
446
|
-
const articleImage =
|
|
529
|
+
const articleImage = articleImageSchema(post);
|
|
447
530
|
if (articleImage) schema.image = articleImage;
|
|
448
531
|
if (siteName || logoUrl) {
|
|
449
532
|
schema.publisher = {
|
|
@@ -520,8 +603,7 @@ async function getAllArticles(options = {}) {
|
|
|
520
603
|
if (!(maxPosts > 0)) return [];
|
|
521
604
|
const config = resolveServerApiConfig();
|
|
522
605
|
if (!config) {
|
|
523
|
-
|
|
524
|
-
return [];
|
|
606
|
+
throw new ArticleUnavailableError();
|
|
525
607
|
}
|
|
526
608
|
const { apiUrl, apiKey } = config;
|
|
527
609
|
const posts = [];
|
|
@@ -535,15 +617,16 @@ async function getAllArticles(options = {}) {
|
|
|
535
617
|
next: { revalidate: 300 }
|
|
536
618
|
}
|
|
537
619
|
);
|
|
538
|
-
if (!response.ok)
|
|
620
|
+
if (!response.ok) throw new ArticleUnavailableError(response.status);
|
|
539
621
|
const data = await response.json();
|
|
540
|
-
|
|
622
|
+
if (!Array.isArray(data.posts)) throw new ArticleUnavailableError();
|
|
623
|
+
const batch = data.posts;
|
|
541
624
|
posts.push(...batch);
|
|
542
625
|
if (!batch.length || !data.pagination?.has_next) break;
|
|
543
626
|
page += 1;
|
|
544
627
|
}
|
|
545
628
|
} catch (error) {
|
|
546
|
-
|
|
629
|
+
throw error instanceof ArticleUnavailableError ? error : new ArticleUnavailableError();
|
|
547
630
|
}
|
|
548
631
|
return posts.slice(0, maxPosts);
|
|
549
632
|
}
|
|
@@ -812,7 +895,7 @@ function generateClusterArticleSchema(post, cluster, options = {}) {
|
|
|
812
895
|
};
|
|
813
896
|
const author = generateArticleAuthorNode(post.author, options);
|
|
814
897
|
if (author) schema.author = author;
|
|
815
|
-
const articleImage =
|
|
898
|
+
const articleImage = articleImageSchema(post);
|
|
816
899
|
if (articleImage) schema.image = articleImage;
|
|
817
900
|
if (siteName || logoUrl) {
|
|
818
901
|
schema.publisher = {
|
|
@@ -1083,4 +1166,4 @@ function generateAuthorPageMetadata(author, options = {}) {
|
|
|
1083
1166
|
};
|
|
1084
1167
|
}
|
|
1085
1168
|
|
|
1086
|
-
export { FEED_DEFAULT_ITEMS, NEWS_SITEMAP_MAX_URLS, NEWS_SITEMAP_WINDOW_MS, SEO_LIMITS, buildNewsSitemapXml, cdata, fetchArticleBySlug, fetchArticleCategories, fetchRelatedArticles, generateAllArticleSchemas, generateArticleCategoryMetadata, generateArticleListSchema, generateArticleMetadata, generateArticleSchema, generateArticleSitemap, generateArticleStaticParams, generateAtomFeed, generateAuthorPageMetadata, generateAuthorStaticParams, generateBreadcrumbSchema, generateCategoryStaticParams, generateClusterArticleSchema, generateClusterBreadcrumbSchema, generateClusterItemListSchema, generateClusterLandingSchema, generateClusterPageMetadata, generateFaqSchema, generateHowToSchema, generateNewsSitemap, generatePublicationMetadata, generateRssFeed, getAllArticleSlugs, getAllArticles, getAllAuthorSlugs, getArticle, getArticleCategories, getAuthorBySlug, getAuthorPosts, getClusterNavigation, getPostsByCategory, getRelatedInsights, getTopicCluster, getTopicClusters, recentNewsPosts, requireArticle, sanitizeExcerpt, validateArticleSeo, validateMetaDescription, validateSeoTitle };
|
|
1169
|
+
export { ArticleUnavailableError, FEED_DEFAULT_ITEMS, NEWS_SITEMAP_MAX_URLS, NEWS_SITEMAP_WINDOW_MS, PUBLICATION_PREVIEW_COOKIE, PUBLICATION_PREVIEW_HEADERS, SEO_LIMITS, buildNewsSitemapXml, cdata, createPublicationPreviewHandler, fetchArticleBySlug, fetchArticleCategories, fetchRelatedArticles, generateAllArticleSchemas, generateArticleCategoryMetadata, generateArticleListSchema, generateArticleMetadata, generateArticleSchema, generateArticleSitemap, generateArticleStaticParams, generateAtomFeed, generateAuthorPageMetadata, generateAuthorStaticParams, generateBreadcrumbSchema, generateCategoryStaticParams, generateClusterArticleSchema, generateClusterBreadcrumbSchema, generateClusterItemListSchema, generateClusterLandingSchema, generateClusterPageMetadata, generateFaqSchema, generateHowToSchema, generateNewsSitemap, generatePublicationMetadata, generateRssFeed, getAllArticleSlugs, getAllArticles, getAllAuthorSlugs, getArticle, getArticleCategories, getArticlePreview, getArticleResult, getAuthorBySlug, getAuthorPosts, getClusterNavigation, getPostsByCategory, getPublicationIssue, getPublicationIssues, getRelatedInsights, getTopicCluster, getTopicClusters, recentNewsPosts, requireArticle, sanitizeExcerpt, validateArticleSeo, validateMetaDescription, validateSeoTitle };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolvePublicationUrl, createPublicationRoutes } from './chunk-
|
|
1
|
+
import { resolvePublicationUrl, createPublicationRoutes } from './chunk-4K735O3J.js';
|
|
2
2
|
|
|
3
|
-
// src/articles/artwork.ts
|
|
3
|
+
// packages/press-kit/src/articles/artwork.ts
|
|
4
4
|
function resolveArticleArtwork(post, placement = "card") {
|
|
5
5
|
const editorial = placement === "article" && !!post.editorial_image;
|
|
6
6
|
const src = (editorial ? post.editorial_image : post.featured_image) || void 0;
|
|
@@ -17,8 +17,18 @@ function resolveArticleArtwork(post, placement = "card") {
|
|
|
17
17
|
function articleArtworkImageStyle(artwork) {
|
|
18
18
|
return artwork.composed ? { display: "block", height: "auto", maxHeight: "none", objectFit: "contain", transform: "none" } : void 0;
|
|
19
19
|
}
|
|
20
|
+
function resolveRepresentativeImage(post) {
|
|
21
|
+
const image = post.representative_image?.url ? post.representative_image : post.editorial_image ? { url: post.editorial_image, alt: post.editorial_image_alt, width: post.editorial_image_width, height: post.editorial_image_height } : post.featured_image ? { url: post.featured_image, alt: post.featured_image_alt, width: post.featured_image_width, height: post.featured_image_height } : void 0;
|
|
22
|
+
if (!image || !/^(https?:\/\/|\/(?!\/))/i.test(image.url)) return void 0;
|
|
23
|
+
const dimensions = Number.isFinite(image.width) && Number.isFinite(image.height) && image.width > 0 && image.height > 0;
|
|
24
|
+
return { url: image.url, alt: image.alt ?? post.title ?? "", ...dimensions ? { width: image.width, height: image.height } : {} };
|
|
25
|
+
}
|
|
26
|
+
function articleImageSchema(post) {
|
|
27
|
+
const image = resolveRepresentativeImage(post);
|
|
28
|
+
return image ? image.width ? { "@type": "ImageObject", url: image.url, width: image.width, height: image.height } : image.url : void 0;
|
|
29
|
+
}
|
|
20
30
|
|
|
21
|
-
// src/articles/author-schema.ts
|
|
31
|
+
// packages/press-kit/src/articles/author-schema.ts
|
|
22
32
|
var ARTICLE_TYPES = /* @__PURE__ */ new Set(["Article", "BlogPosting", "NewsArticle", "TechArticle", "Report", "ScholarlyArticle"]);
|
|
23
33
|
function isAbsoluteUrl(value) {
|
|
24
34
|
return /^https?:\/\//i.test(value);
|
|
@@ -122,4 +132,4 @@ function withArticleAuthorIdentity(node, author, options = {}) {
|
|
|
122
132
|
return { ...record, author: { ...byline, ...additions } };
|
|
123
133
|
}
|
|
124
134
|
|
|
125
|
-
export { articleArtworkImageStyle, authorEntityId, generateArticleAuthorNode, generateAuthorPersonSchema, generateAuthorSchema, resolveArticleArtwork, withArticleAuthorIdentity };
|
|
135
|
+
export { articleArtworkImageStyle, articleImageSchema, authorEntityId, generateArticleAuthorNode, generateAuthorPersonSchema, generateAuthorSchema, resolveArticleArtwork, resolveRepresentativeImage, withArticleAuthorIdentity };
|
|
@@ -21,5 +21,8 @@ function getClientApiConfig(options = {}) {
|
|
|
21
21
|
const published = readPublishedApiConfig();
|
|
22
22
|
return { apiUrl: published.apiUrl || DEFAULT_SONOR_API_URL, apiKey: published.apiKey };
|
|
23
23
|
}
|
|
24
|
+
function readPublishedSite() {
|
|
25
|
+
return siteKitWindow()?.__SITE_KIT_SITE__ || void 0;
|
|
26
|
+
}
|
|
24
27
|
|
|
25
|
-
export { DEFAULT_SONOR_API_URL, getClientApiConfig, readPublishedApiConfig };
|
|
28
|
+
export { DEFAULT_SONOR_API_URL, getClientApiConfig, readPublishedApiConfig, readPublishedSite };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { freshFetch } from './chunk-UAYAJPEP.js';
|
|
2
2
|
import { LLM_GEO_CONTRACT_VERSION } from './chunk-NZ4RXN3G.js';
|
|
3
3
|
import { withSiteParam } from './chunk-MJP63SSS.js';
|
|
4
|
-
import { getClientApiConfig } from './chunk-
|
|
4
|
+
import { getClientApiConfig } from './chunk-W7OPEMGJ.js';
|
|
5
5
|
import { cache } from 'react';
|
|
6
6
|
|
|
7
7
|
function getApiConfig() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { secretsMatch, readCappedBody } from './chunk-XTRZGXB2.js';
|
|
2
|
-
import { SITE_KIT_VERSION } from './chunk-
|
|
2
|
+
import { SITE_KIT_VERSION } from './chunk-5S7YTOCB.js';
|
|
3
3
|
|
|
4
4
|
// src/llms/revalidate.ts
|
|
5
5
|
function createLlmsRevalidateHandler(secret, options) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { publishSiteCredential } from './chunk-MZX4EN6Z.js';
|
|
2
|
+
|
|
3
|
+
// src/client/SiteKitCredential.tsx
|
|
4
|
+
function SiteKitCredential({
|
|
5
|
+
apiKey,
|
|
6
|
+
apiUrl,
|
|
7
|
+
site,
|
|
8
|
+
debug
|
|
9
|
+
}) {
|
|
10
|
+
publishSiteCredential({ apiKey, apiUrl, site, debug });
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { SiteKitCredential };
|
package/dist/client/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
2
|
+
export { SiteKitCredential } from '../chunk-XI2XM7UG.js';
|
|
3
|
+
import '../chunk-MZX4EN6Z.js';
|
|
3
4
|
export { VISUAL_VIEWPORT_GAP_PROPERTY, VisualViewportGap, useVisualViewportGap } from '../chunk-6T6CQVNL.js';
|
|
4
5
|
export { useDeferredActivation } from '../chunk-YC7ELZS3.js';
|
|
5
6
|
import '../chunk-FESKKJAS.js';
|
|
@@ -8,19 +9,6 @@ export { trackConversion, trackEvent } from '../chunk-LCDVPAMR.js';
|
|
|
8
9
|
export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity } from '../chunk-ZKADJNR2.js';
|
|
9
10
|
import '../chunk-5TM3WPCI.js';
|
|
10
11
|
import '../chunk-GJWI74ZZ.js';
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-RBNHRZGD.js';
|
|
13
|
+
import '../chunk-5S7YTOCB.js';
|
|
13
14
|
import '../chunk-PKBMQBKP.js';
|
|
14
|
-
|
|
15
|
-
// src/client/SiteKitCredential.tsx
|
|
16
|
-
function SiteKitCredential({
|
|
17
|
-
apiKey,
|
|
18
|
-
apiUrl,
|
|
19
|
-
site,
|
|
20
|
-
debug
|
|
21
|
-
}) {
|
|
22
|
-
publishSiteCredential({ apiKey, apiUrl, site, debug });
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { SiteKitCredential };
|
package/dist/fleet/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { FLEET_HEARTBEAT_PATH, FleetHeartbeat, detectNextVersion, sendFleetHeartbeat } from '../chunk-
|
|
2
|
+
export { FLEET_HEARTBEAT_PATH, FleetHeartbeat, detectNextVersion, sendFleetHeartbeat } from '../chunk-5TDZHIG6.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-
|
|
5
|
+
import '../chunk-DLM4FFNH.js';
|
|
6
6
|
import '../chunk-EKBEOXTH.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
9
|
-
import '../chunk-
|
|
10
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-3VSFOD2Z.js';
|
|
8
|
+
import '../chunk-RBNHRZGD.js';
|
|
9
|
+
import '../chunk-W7OPEMGJ.js';
|
|
10
|
+
import '../chunk-5S7YTOCB.js';
|
|
11
11
|
import '../chunk-PKBMQBKP.js';
|