@sonordev/site-kit 7.3.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +40 -12
- package/CHANGELOG.md +73 -0
- package/README.md +44 -18
- package/agent-manifest.json +111 -56
- package/dist/AnalyticsProvider-LYFDQRRJ.js +13 -0
- package/dist/{ArticleViewTracker-GFOAXFV7.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
- package/dist/{BlocksPopup-AHDU34TL.js → BlocksPopup-GFX3GZIK.js} +6 -5
- package/dist/{ChatWidget-FHBAHFZX.js → ChatWidget-DVS7MLBN.js} +8 -5
- package/dist/{FileField-J5W5MIAZ.js → FileField-DVN7NUBI.js} +5 -5
- package/dist/{FormSpotlight-PE5YZBFZ.js → FormSpotlight-W4SXKKO6.js} +3 -3
- package/dist/{FormStage-OOPQC27J.js → FormStage-JTEE5MZD.js} +3 -3
- package/dist/ManagedForm-ZAUHIHGP.js +19 -0
- package/dist/{ManagedNewsletterForm-TC5542ZG.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
- package/dist/{SignalCore-2YP5FCAS.js → SignalCore-W5PYYMGX.js} +7 -7
- package/dist/SiteChat-MY2GATWC.js +6 -0
- package/dist/SiteDesignReporter-ICZWEGCY.js +12 -0
- package/dist/SitePopups-TGULLAER.js +13 -0
- package/dist/SitemapSync-AN2OBJE6.js +9 -0
- package/dist/_client/booking-widget.js +6 -5
- package/dist/_client/testimonial-section.d.ts +1 -1
- package/dist/_client/testimonial-section.js +4 -2
- package/dist/affiliates/index.js +6 -6
- package/dist/analytics/index.js +73 -7
- package/dist/articles/index.js +2 -2
- package/dist/articles/server-ui.js +3 -3
- package/dist/articles/server.js +2 -2
- package/dist/brand.css +1 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +39 -8
- package/dist/chunk-3G7YABRA.js +25 -0
- package/dist/{chunk-CGWUXUYZ.js → chunk-3RDJKIYO.js} +2 -2
- package/dist/{chunk-J4FSB4OG.js → chunk-3YKQLC7J.js} +5 -2
- package/dist/{chunk-BEBR4OJD.js → chunk-56VDS2RP.js} +2 -2
- package/dist/chunk-5ROTTMBL.js +19 -0
- package/dist/{chunk-56KNHB4U.js → chunk-5S2XDG5O.js} +1 -1
- package/dist/chunk-5TM3WPCI.js +7 -0
- package/dist/{chunk-BR4ZKUHH.js → chunk-6CJGZFOU.js} +18 -2
- package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
- package/dist/{chunk-XLSQTTUE.js → chunk-6QFINXLH.js} +3 -3
- package/dist/{chunk-CYUFBKJQ.js → chunk-6ZXJ3SXR.js} +1 -1
- package/dist/{chunk-NI2XNEMR.js → chunk-7YEEOIWI.js} +1 -1
- package/dist/{chunk-DNPNYWVL.js → chunk-BQ2CXKTQ.js} +5 -20
- package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
- package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
- package/dist/chunk-CAT235HY.js +13 -0
- package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
- package/dist/{chunk-O5RGXTWU.js → chunk-GNSXOTIK.js} +6 -4
- package/dist/{chunk-UPRSH6Q4.js → chunk-ICAVVF6D.js} +3 -3
- package/dist/{chunk-2ECWEUHP.js → chunk-IJQ767JS.js} +3 -5
- package/dist/{chunk-MKMD2HJW.js → chunk-J65N34YM.js} +3 -3
- package/dist/{chunk-6U3VLV2C.js → chunk-JIH32RH2.js} +4 -4
- package/dist/{chunk-T4DLETKR.js → chunk-K22OLAPC.js} +2 -2
- package/dist/{chunk-I2YX3HVD.js → chunk-KRBBH64S.js} +3 -3
- package/dist/{chunk-VF4F5WXZ.js → chunk-LBIQ5LTC.js} +1 -1
- package/dist/{chunk-WGIDC6QP.js → chunk-LKH44GI3.js} +5 -5
- package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
- package/dist/{chunk-WDQB4OXY.js → chunk-M62U7TJF.js} +1 -1
- package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
- package/dist/chunk-OD2ULW5Z.js +57 -0
- package/dist/{chunk-Y6LP36UW.js → chunk-OE3NXEOF.js} +2 -2
- package/dist/{chunk-L7U23XI2.js → chunk-OGK7OL3T.js} +5 -4
- package/dist/{chunk-RDPW4D33.js → chunk-PD7K54EQ.js} +2 -2
- package/dist/{chunk-MVR4FY5R.js → chunk-PIX7FAMX.js} +2 -2
- package/dist/{chunk-2AD3CDRR.js → chunk-ROAOI6GG.js} +10 -10
- package/dist/{chunk-YJLS6JBI.js → chunk-S7SSYGUJ.js} +6 -5
- package/dist/{chunk-ZKHI4E2B.js → chunk-SBPAXWLF.js} +1 -1
- package/dist/{chunk-ZHS2XFLV.js → chunk-TOSZGJEQ.js} +1 -1
- package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
- package/dist/{chunk-Z65DHMTW.js → chunk-TZ5RTANX.js} +3 -3
- package/dist/{chunk-VX5CMNMM.js → chunk-UAYAJPEP.js} +7 -1
- package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
- package/dist/{chunk-EPT6FJUY.js → chunk-UUWUAMUC.js} +13 -16
- package/dist/{chunk-PKGN32AU.js → chunk-XPTJRVL2.js} +1 -1
- package/dist/{chunk-662ILEZ6.js → chunk-Y35BWW2C.js} +3 -7
- package/dist/{chunk-MRQ2U4LZ.js → chunk-ZHNQFNO3.js} +2 -2
- package/dist/chunk-ZKADJNR2.js +52 -0
- package/dist/{chunk-WGG6GTKW.js → chunk-ZLFGXKLG.js} +1 -1
- package/dist/client/index.js +6 -5
- package/dist/contracts/entries.d.ts +1 -1
- package/dist/contracts/sentences.d.ts +46 -0
- package/dist/contracts/site-cache.d.ts +2 -0
- package/dist/cta-bar/index.js +1 -1
- package/dist/fleet/index.js +6 -5
- package/dist/forms/field-autocomplete.d.ts +16 -8
- package/dist/forms/index.d.ts +5 -0
- package/dist/forms/index.js +17 -17
- package/dist/forms/server.js +7 -7
- package/dist/forms/static.js +2 -2
- package/dist/forms/submitForm.d.ts +5 -0
- package/dist/images/index.js +4 -4
- package/dist/index.d.ts +3 -7
- package/dist/index.js +1 -1
- package/dist/layout/SiteKitLayout.d.ts +2 -1
- package/dist/layout/client.js +11 -9
- package/dist/layout/index.js +14 -12
- package/dist/llms/index.js +8 -7
- package/dist/maps/index.js +6 -6
- package/dist/mcp/sonor.d.ts +47 -3
- package/dist/mcp/sonor.js +31 -21
- package/dist/proxy/index.d.ts +3 -3
- package/dist/proxy/index.js +1 -1
- package/dist/reputation/TestimonialSection.d.ts +1 -1
- package/dist/reputation/VisualReviewCard.d.ts +6 -0
- package/dist/reputation/index.d.ts +2 -1
- package/dist/reputation/index.js +5 -2
- package/dist/reputation/review-photo.d.ts +2 -0
- package/dist/reputation/server.d.ts +3 -2
- package/dist/reputation/server.js +4 -1
- package/dist/reputation/types.d.ts +22 -0
- package/dist/revalidate/index.js +3 -3
- package/dist/robots/indexnow.js +2 -2
- package/dist/runtime/index.d.ts +32 -0
- package/dist/runtime/index.js +7 -0
- package/dist/seo/api.d.ts +0 -4
- package/dist/seo/client.js +6 -5
- package/dist/seo/getManagedMetadata.d.ts +24 -0
- package/dist/seo/index.d.ts +2 -3
- package/dist/seo/index.js +14 -132
- package/dist/seo/indexnow.js +2 -2
- package/dist/seo/llms.js +8 -7
- package/dist/seo/register-sitemap-cli.js +2 -2
- package/dist/seo/server-api.d.ts +0 -6
- package/dist/seo/server.d.ts +1 -1
- package/dist/seo/server.js +4 -4
- package/dist/seo/sitemap.js +5 -4
- package/dist/seo/types.d.ts +9 -30
- package/dist/server/index.d.ts +8 -1
- package/dist/server/index.js +5 -4
- package/dist/server/mint-site-token.d.ts +1 -13
- package/dist/server/server-fetch.d.ts +19 -0
- package/dist/server-api-EGOKC7Q3.js +9 -0
- package/dist/shared/build-entries.d.ts +21 -9
- package/dist/shared/clientApiConfig.d.ts +56 -0
- package/dist/shared/fresh-fetch.d.ts +9 -3
- package/dist/shared/identity-reader.d.ts +26 -0
- package/dist/shared/identity-storage.d.ts +30 -0
- package/dist/shared/identity.d.ts +13 -13
- package/dist/shared/import-specifiers.d.ts +26 -0
- package/dist/shared/sonorFetch.d.ts +4 -3
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +2 -2
- package/dist/sitemap/index.js +5 -4
- package/dist/slots/index.js +3 -3
- package/dist/sync/index.js +6 -5
- package/dist/types.d.ts +0 -1
- package/dist/website/cta-bar.js +1 -1
- package/dist/website/images.js +4 -4
- package/dist/website/index.js +7 -6
- package/dist/website/popups.js +10 -7
- package/dist/website/slots.js +3 -3
- package/dist/{writeLLMsTxt-2NQVDGYI.js → writeLLMsTxt-UZGN6IBU.js} +4 -3
- package/docs/MIGRATING-TO-7.md +5 -2
- package/docs/MIGRATING-TO-8.md +183 -0
- package/docs.json +4 -8
- package/package.json +15 -44
- package/skills/site-kit/SKILL.md +41 -11
- package/src/analytics/README.md +14 -14
- package/src/chat/README.md +7 -7
- package/src/forms/README.md +61 -6
- package/src/mcp/README.md +61 -20
- package/src/proxy/README.md +5 -4
- package/src/reputation/README.md +25 -0
- package/src/revalidate/README.md +2 -2
- package/src/runtime/README.md +51 -0
- package/src/seo/README.md +24 -8
- package/src/sync/README.md +2 -2
- package/src/website/README.md +3 -2
- package/dist/AnalyticsProvider-DJQA66AG.js +0 -11
- package/dist/ManagedForm-JRZAJ7SZ.js +0 -16
- package/dist/SiteChat-EGEZJJVV.js +0 -5
- package/dist/SiteDesignReporter-YEEWJKWN.js +0 -11
- package/dist/SitePopups-LQBIXIFV.js +0 -10
- package/dist/SitemapSync-LSZ2EYOF.js +0 -8
- package/dist/chunk-24QZEO3Q.js +0 -41
- package/dist/chunk-BU66S5B7.js +0 -1
- package/dist/chunk-G3NHWMP5.js +0 -233
- package/dist/chunk-HODO5BX5.js +0 -28
- package/dist/chunk-L3AQCDCY.js +0 -386
- package/dist/chunk-P5GB6NEO.js +0 -66
- package/dist/chunk-SWKE6FWH.js +0 -47
- package/dist/cms/CmsPage.d.ts +0 -17
- package/dist/cms/CmsPreview.d.ts +0 -37
- package/dist/cms/CmsSection.d.ts +0 -8
- package/dist/cms/PortableTextRenderer.d.ts +0 -7
- package/dist/cms/index.d.ts +0 -37
- package/dist/cms/index.js +0 -5
- package/dist/cms/sanity-image.d.ts +0 -47
- package/dist/cms/sections/CtaSection.d.ts +0 -3
- package/dist/cms/sections/CustomSection.d.ts +0 -7
- package/dist/cms/sections/FaqSection.d.ts +0 -3
- package/dist/cms/sections/FormSection.d.ts +0 -8
- package/dist/cms/sections/GallerySection.d.ts +0 -3
- package/dist/cms/sections/HeroSection.d.ts +0 -3
- package/dist/cms/sections/RichTextSection.d.ts +0 -3
- package/dist/cms/sections/TestimonialsSection.d.ts +0 -3
- package/dist/cms/sections/index.d.ts +0 -8
- package/dist/cms/server-api.d.ts +0 -49
- package/dist/cms/server.d.ts +0 -1
- package/dist/cms/server.js +0 -5
- package/dist/cms/types.d.ts +0 -104
- package/dist/commerce/CalendarView.d.ts +0 -43
- package/dist/commerce/CheckoutForm.d.ts +0 -11
- package/dist/commerce/EventCalendar.d.ts +0 -26
- package/dist/commerce/EventCheckout.d.ts +0 -42
- package/dist/commerce/EventEmbed.d.ts +0 -11
- package/dist/commerce/EventModal.d.ts +0 -43
- package/dist/commerce/EventTile.d.ts +0 -10
- package/dist/commerce/EventsAgenda.d.ts +0 -38
- package/dist/commerce/EventsWidget.d.ts +0 -84
- package/dist/commerce/OfferingCard.d.ts +0 -9
- package/dist/commerce/OfferingList.d.ts +0 -9
- package/dist/commerce/ProductDetail.d.ts +0 -38
- package/dist/commerce/ProductEmbed.d.ts +0 -11
- package/dist/commerce/ProductGrid.d.ts +0 -41
- package/dist/commerce/ProductPage.d.ts +0 -39
- package/dist/commerce/RegistrationForm.d.ts +0 -9
- package/dist/commerce/SizeChart.d.ts +0 -8
- package/dist/commerce/UpcomingEvents.d.ts +0 -9
- package/dist/commerce/api.d.ts +0 -179
- package/dist/commerce/events-extras.d.ts +0 -60
- package/dist/commerce/index.d.ts +0 -33
- package/dist/commerce/index.js +0 -8022
- package/dist/commerce/server.d.ts +0 -161
- package/dist/commerce/server.js +0 -2
- package/dist/commerce/types.d.ts +0 -340
- package/dist/commerce/useEventModal.d.ts +0 -20
- package/dist/commerce/utils.d.ts +0 -17
- package/dist/engage/EngageWidget.d.ts +0 -21
- package/dist/engage/index.d.ts +0 -14
- package/dist/engage/index.js +0 -45
- package/dist/engage/types.d.ts +0 -33
- package/dist/seo/ManagedContent.d.ts +0 -14
- package/dist/server-api-BVCBLJKL.js +0 -9
- package/dist/website/cms/server.d.ts +0 -2
- package/dist/website/cms/server.js +0 -5
- package/dist/website/cms-server.d.ts +0 -2
- package/dist/website/cms.d.ts +0 -2
- package/dist/website/cms.js +0 -5
- package/src/commerce/README.md +0 -109
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { DEFAULT_WIDGET_Z_INDEX } from './chunk-27FISYK4.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { readAnalyticsIdentity } from './chunk-5ROTTMBL.js';
|
|
4
|
+
import { getOrCreateVisitorId } from './chunk-ZKADJNR2.js';
|
|
5
|
+
import { resolveAnalyticsTarget } from './chunk-CAH4Y4PY.js';
|
|
6
|
+
import { sonorFetch } from './chunk-56VDS2RP.js';
|
|
6
7
|
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
7
8
|
import ReactDOM from 'react-dom';
|
|
8
9
|
import dynamic from 'next/dynamic';
|
|
@@ -160,7 +161,7 @@ function activatePopup(active, id, popups) {
|
|
|
160
161
|
return [...active, id];
|
|
161
162
|
}
|
|
162
163
|
var LazyBlocksPopup = dynamic(
|
|
163
|
-
() => import('./BlocksPopup-
|
|
164
|
+
() => import('./BlocksPopup-GFX3GZIK.js').then((m) => ({ default: m.BlocksPopup })),
|
|
164
165
|
{ ssr: false }
|
|
165
166
|
);
|
|
166
167
|
function SitePopups(props) {
|
|
@@ -346,7 +347,7 @@ function PopupView({
|
|
|
346
347
|
);
|
|
347
348
|
}
|
|
348
349
|
function trackPopupEvent(apiUrl, apiKey, endpoint, data) {
|
|
349
|
-
const visitorId =
|
|
350
|
+
const { visitorId } = readAnalyticsIdentity();
|
|
350
351
|
sonorFetch(`${apiUrl.replace(/\/$/, "")}/engage/widget/${endpoint}`, {
|
|
351
352
|
method: "POST",
|
|
352
353
|
headers: { "Content-Type": "application/json" },
|
|
@@ -26,7 +26,7 @@ function useFieldControls(fields) {
|
|
|
26
26
|
}
|
|
27
27
|
if (needsFile && !requested.current.file) {
|
|
28
28
|
requested.current.file = true;
|
|
29
|
-
import('./FileField-
|
|
29
|
+
import('./FileField-DVN7NUBI.js').then((m) => {
|
|
30
30
|
if (!cancelled) setControls((prev) => ({ ...prev, File: m.FileField }));
|
|
31
31
|
}).catch(() => {
|
|
32
32
|
requested.current.file = false;
|
|
@@ -1,6 +1,85 @@
|
|
|
1
1
|
import { declarativeToolField } from './chunk-HW7B43E5.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
|
+
// src/forms/field-autocomplete.ts
|
|
5
|
+
var TOKEN_BY_KEY = {
|
|
6
|
+
email: "email",
|
|
7
|
+
email_address: "email",
|
|
8
|
+
e_mail: "email",
|
|
9
|
+
first_name: "given-name",
|
|
10
|
+
firstname: "given-name",
|
|
11
|
+
fname: "given-name",
|
|
12
|
+
given_name: "given-name",
|
|
13
|
+
last_name: "family-name",
|
|
14
|
+
lastname: "family-name",
|
|
15
|
+
lname: "family-name",
|
|
16
|
+
surname: "family-name",
|
|
17
|
+
family_name: "family-name",
|
|
18
|
+
name: "name",
|
|
19
|
+
full_name: "name",
|
|
20
|
+
fullname: "name",
|
|
21
|
+
your_name: "name",
|
|
22
|
+
contact_name: "name",
|
|
23
|
+
phone: "tel",
|
|
24
|
+
phone_number: "tel",
|
|
25
|
+
telephone: "tel",
|
|
26
|
+
mobile: "tel",
|
|
27
|
+
mobile_phone: "tel",
|
|
28
|
+
cell: "tel",
|
|
29
|
+
cell_phone: "tel",
|
|
30
|
+
tel: "tel",
|
|
31
|
+
company: "organization",
|
|
32
|
+
company_name: "organization",
|
|
33
|
+
organization: "organization",
|
|
34
|
+
organisation: "organization",
|
|
35
|
+
business_name: "organization",
|
|
36
|
+
job_title: "organization-title",
|
|
37
|
+
website: "url",
|
|
38
|
+
website_url: "url",
|
|
39
|
+
company_website: "url",
|
|
40
|
+
url: "url",
|
|
41
|
+
street_address: "street-address",
|
|
42
|
+
address_line1: "address-line1",
|
|
43
|
+
address_line_1: "address-line1",
|
|
44
|
+
address1: "address-line1",
|
|
45
|
+
address_line2: "address-line2",
|
|
46
|
+
address_line_2: "address-line2",
|
|
47
|
+
address2: "address-line2",
|
|
48
|
+
city: "address-level2",
|
|
49
|
+
state: "address-level1",
|
|
50
|
+
province: "address-level1",
|
|
51
|
+
zip: "postal-code",
|
|
52
|
+
zip_code: "postal-code",
|
|
53
|
+
zipcode: "postal-code",
|
|
54
|
+
postal_code: "postal-code",
|
|
55
|
+
postcode: "postal-code",
|
|
56
|
+
country: "country-name"
|
|
57
|
+
};
|
|
58
|
+
var TOKEN_FIELD_TYPES = /* @__PURE__ */ new Set(["text", "email", "phone", "tel", "select"]);
|
|
59
|
+
function toKey(raw) {
|
|
60
|
+
return raw.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/\*/g, "").trim().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
61
|
+
}
|
|
62
|
+
function withoutGeneratedSuffix(key) {
|
|
63
|
+
const match = /^(.+)_([a-z0-9]{6,10})$/.exec(key);
|
|
64
|
+
if (match && /\d/.test(match[2])) return match[1];
|
|
65
|
+
return key;
|
|
66
|
+
}
|
|
67
|
+
function tokenForKey(raw) {
|
|
68
|
+
if (!raw) return void 0;
|
|
69
|
+
const key = toKey(raw);
|
|
70
|
+
return TOKEN_BY_KEY[key] ?? TOKEN_BY_KEY[withoutGeneratedSuffix(key)];
|
|
71
|
+
}
|
|
72
|
+
function autocompleteFor(field) {
|
|
73
|
+
if (!TOKEN_FIELD_TYPES.has(field.field_type)) return void 0;
|
|
74
|
+
const destination = field.destination_field;
|
|
75
|
+
if (destination && !destination.startsWith("custom.")) {
|
|
76
|
+
const fromDestination = tokenForKey(destination);
|
|
77
|
+
if (fromDestination) return fromDestination;
|
|
78
|
+
}
|
|
79
|
+
if (field.field_type === "email") return "email";
|
|
80
|
+
if (field.field_type === "phone" || field.field_type === "tel") return "tel";
|
|
81
|
+
return tokenForKey(field.slug) ?? tokenForKey(field.label);
|
|
82
|
+
}
|
|
4
83
|
var STYLE_ID = "sk-delight-css";
|
|
5
84
|
var CSS = `
|
|
6
85
|
/* Every frame must carry the centering translateY: the animation fills both
|
|
@@ -208,86 +287,6 @@ function FormMomentum({ done, total }) {
|
|
|
208
287
|
}
|
|
209
288
|
);
|
|
210
289
|
}
|
|
211
|
-
|
|
212
|
-
// src/forms/field-autocomplete.ts
|
|
213
|
-
var TOKEN_BY_KEY = {
|
|
214
|
-
email: "email",
|
|
215
|
-
email_address: "email",
|
|
216
|
-
e_mail: "email",
|
|
217
|
-
first_name: "given-name",
|
|
218
|
-
firstname: "given-name",
|
|
219
|
-
fname: "given-name",
|
|
220
|
-
given_name: "given-name",
|
|
221
|
-
last_name: "family-name",
|
|
222
|
-
lastname: "family-name",
|
|
223
|
-
lname: "family-name",
|
|
224
|
-
surname: "family-name",
|
|
225
|
-
family_name: "family-name",
|
|
226
|
-
name: "name",
|
|
227
|
-
full_name: "name",
|
|
228
|
-
fullname: "name",
|
|
229
|
-
your_name: "name",
|
|
230
|
-
contact_name: "name",
|
|
231
|
-
phone: "tel",
|
|
232
|
-
phone_number: "tel",
|
|
233
|
-
telephone: "tel",
|
|
234
|
-
mobile: "tel",
|
|
235
|
-
mobile_phone: "tel",
|
|
236
|
-
cell: "tel",
|
|
237
|
-
cell_phone: "tel",
|
|
238
|
-
tel: "tel",
|
|
239
|
-
company: "organization",
|
|
240
|
-
company_name: "organization",
|
|
241
|
-
organization: "organization",
|
|
242
|
-
organisation: "organization",
|
|
243
|
-
business_name: "organization",
|
|
244
|
-
job_title: "organization-title",
|
|
245
|
-
website: "url",
|
|
246
|
-
website_url: "url",
|
|
247
|
-
company_website: "url",
|
|
248
|
-
url: "url",
|
|
249
|
-
street_address: "street-address",
|
|
250
|
-
address_line1: "address-line1",
|
|
251
|
-
address_line_1: "address-line1",
|
|
252
|
-
address1: "address-line1",
|
|
253
|
-
address_line2: "address-line2",
|
|
254
|
-
address_line_2: "address-line2",
|
|
255
|
-
address2: "address-line2",
|
|
256
|
-
city: "address-level2",
|
|
257
|
-
state: "address-level1",
|
|
258
|
-
province: "address-level1",
|
|
259
|
-
zip: "postal-code",
|
|
260
|
-
zip_code: "postal-code",
|
|
261
|
-
zipcode: "postal-code",
|
|
262
|
-
postal_code: "postal-code",
|
|
263
|
-
postcode: "postal-code",
|
|
264
|
-
country: "country-name"
|
|
265
|
-
};
|
|
266
|
-
var TOKEN_FIELD_TYPES = /* @__PURE__ */ new Set(["text", "email", "phone", "tel", "select"]);
|
|
267
|
-
function toKey(raw) {
|
|
268
|
-
return raw.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/\*/g, "").trim().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
269
|
-
}
|
|
270
|
-
function withoutGeneratedSuffix(key) {
|
|
271
|
-
const match = /^(.+)_([a-z0-9]{6,10})$/.exec(key);
|
|
272
|
-
if (match && /\d/.test(match[2])) return match[1];
|
|
273
|
-
return key;
|
|
274
|
-
}
|
|
275
|
-
function tokenForKey(raw) {
|
|
276
|
-
if (!raw) return void 0;
|
|
277
|
-
const key = toKey(raw);
|
|
278
|
-
return TOKEN_BY_KEY[key] ?? TOKEN_BY_KEY[withoutGeneratedSuffix(key)];
|
|
279
|
-
}
|
|
280
|
-
function autocompleteFor(field) {
|
|
281
|
-
if (!TOKEN_FIELD_TYPES.has(field.field_type)) return void 0;
|
|
282
|
-
const destination = field.destination_field;
|
|
283
|
-
if (destination && !destination.startsWith("custom.")) {
|
|
284
|
-
const fromDestination = tokenForKey(destination);
|
|
285
|
-
if (fromDestination) return fromDestination;
|
|
286
|
-
}
|
|
287
|
-
if (field.field_type === "email") return "email";
|
|
288
|
-
if (field.field_type === "phone" || field.field_type === "tel") return "tel";
|
|
289
|
-
return tokenForKey(field.slug) ?? tokenForKey(field.label);
|
|
290
|
-
}
|
|
291
290
|
var SINGLE_CONTROL_TYPES = /* @__PURE__ */ new Set([
|
|
292
291
|
"text",
|
|
293
292
|
"email",
|
|
@@ -699,4 +698,4 @@ function FormField({ field, value, error, onChange, onFocus, onBlur, classPrefix
|
|
|
699
698
|
] });
|
|
700
699
|
}
|
|
701
700
|
|
|
702
|
-
export { DelightStyles, FormField, FormMomentum };
|
|
701
|
+
export { DelightStyles, FormField, FormMomentum, autocompleteFor };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getLLMsData, getOptimizedLLMsTxt } from './chunk-
|
|
1
|
+
import { getLLMsData, getOptimizedLLMsTxt } from './chunk-JIH32RH2.js';
|
|
2
2
|
import { linkClassificationHost } from './chunk-L5UOHS6E.js';
|
|
3
3
|
import { resolveArticleUrl } from './chunk-WMVK77ND.js';
|
|
4
|
-
import { freshFetch } from './chunk-
|
|
4
|
+
import { freshFetch } from './chunk-UAYAJPEP.js';
|
|
5
5
|
import { LLM_GEO_CONTRACT_VERSION, sanitizePrimaryLanguageTag, sanitizeLlmsDisclaimerLine, sanitizeLlmsPublicSummary } from './chunk-NZ4RXN3G.js';
|
|
6
6
|
import { resolveTrailingSlash, applyTrailingSlash } from './chunk-YVKRYQRG.js';
|
|
7
7
|
import { resolveSiteHost } from './chunk-FESKKJAS.js';
|
|
@@ -312,7 +312,7 @@ async function generateLLMsTxt(options) {
|
|
|
312
312
|
if (includeEntities) {
|
|
313
313
|
attemptedSections.push("knowledge-graph");
|
|
314
314
|
optionalFetches.push(
|
|
315
|
-
import('./server-api-
|
|
315
|
+
import('./server-api-EGOKC7Q3.js').then(async ({ getEntities, getPrimaryEntity }) => {
|
|
316
316
|
const [entities, primaryEntity] = await Promise.all([
|
|
317
317
|
getEntities().then((e) => e.slice(0, maxEntities)),
|
|
318
318
|
getPrimaryEntity()
|
|
@@ -8,6 +8,12 @@ function resolveFetch() {
|
|
|
8
8
|
}
|
|
9
9
|
var BUILD_NONCE = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
10
10
|
var FRESH_FETCH_NONCE_HEADER = "x-sitekit-build-nonce";
|
|
11
|
+
var trackedRequestSequence = 0;
|
|
12
|
+
function trackedFreshFetch(input, init = {}) {
|
|
13
|
+
const headers = new Headers(init.headers);
|
|
14
|
+
headers.set(FRESH_FETCH_NONCE_HEADER, `${BUILD_NONCE}-${++trackedRequestSequence}`);
|
|
15
|
+
return fetch(input, { ...init, headers, cache: "force-cache" });
|
|
16
|
+
}
|
|
11
17
|
function freshFetch(input, init = {}) {
|
|
12
18
|
const current = globalThis.fetch;
|
|
13
19
|
const { fn, unpatched } = resolveFetch();
|
|
@@ -23,4 +29,4 @@ function buildFetch(input, init = {}) {
|
|
|
23
29
|
return isNextProductionBuild() ? freshFetch(input, init) : fetch(input, init);
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export { buildFetch, freshFetch, resolveFetch };
|
|
32
|
+
export { buildFetch, freshFetch, resolveFetch, trackedFreshFetch };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { getSEOPageData, ensureMetadata, getABTest, recordABImpression, getRedirectData, getRobotsData, getSitemapEntries } from './chunk-
|
|
1
|
+
import { getSEOPageData, ensureMetadata, getABTest, recordABImpression, getRedirectData, getRobotsData, getSitemapEntries } from './chunk-Y35BWW2C.js';
|
|
2
2
|
import { titleProblem, descriptionProblem } from './chunk-BQR4IPBW.js';
|
|
3
3
|
import { resolveSiteHost } from './chunk-FESKKJAS.js';
|
|
4
4
|
|
|
5
5
|
// src/seo/getManagedMetadata.ts
|
|
6
|
+
var SELF_CANONICAL = "./";
|
|
7
|
+
function mergeAlternates(...parts) {
|
|
8
|
+
return Object.assign({}, ...parts.filter(Boolean));
|
|
9
|
+
}
|
|
6
10
|
async function getManagedMetadata(options) {
|
|
7
|
-
const { path, fallback = {}, overrides = {}, favicon: faviconMode = "metadata" } = options;
|
|
11
|
+
const { path, fallback = {}, overrides = {}, favicon: faviconMode = "metadata", scope = "page" } = options;
|
|
8
12
|
const omitIcons = faviconMode === "component";
|
|
9
13
|
const result = await getSEOPageData(path);
|
|
10
14
|
const pageData = result?.page;
|
|
@@ -13,6 +17,7 @@ async function getManagedMetadata(options) {
|
|
|
13
17
|
const fallbackMeta = {
|
|
14
18
|
...fallback,
|
|
15
19
|
...overrides,
|
|
20
|
+
alternates: mergeAlternates({ canonical: SELF_CANONICAL }, fallback.alternates, overrides.alternates),
|
|
16
21
|
_managed: false,
|
|
17
22
|
_source: "fallback"
|
|
18
23
|
};
|
|
@@ -70,18 +75,20 @@ async function getManagedMetadata(options) {
|
|
|
70
75
|
if (pageData.managed_robots) {
|
|
71
76
|
metadata.robots = pageData.managed_robots;
|
|
72
77
|
}
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
if (scope === "page") {
|
|
79
|
+
if (pageData.managed_canonical) {
|
|
80
|
+
metadata.alternates = {
|
|
81
|
+
...metadata.alternates,
|
|
82
|
+
canonical: pageData.managed_canonical
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const langAlts = pageData.language_alternates;
|
|
86
|
+
if (langAlts && typeof langAlts === "object" && !Array.isArray(langAlts)) {
|
|
87
|
+
metadata.alternates = {
|
|
88
|
+
...metadata.alternates,
|
|
89
|
+
languages: langAlts
|
|
90
|
+
};
|
|
91
|
+
}
|
|
85
92
|
}
|
|
86
93
|
const managedOgTitle = pageData.managed_og_title && !titleProblem(pageData.managed_og_title, identity, { path }) ? pageData.managed_og_title : void 0;
|
|
87
94
|
const managedOgDescription = pageData.managed_og_description && !descriptionProblem(pageData.managed_og_description, identity) ? pageData.managed_og_description : void 0;
|
|
@@ -106,6 +113,12 @@ async function getManagedMetadata(options) {
|
|
|
106
113
|
return {
|
|
107
114
|
...metadata,
|
|
108
115
|
...overrides,
|
|
116
|
+
alternates: mergeAlternates(
|
|
117
|
+
{ canonical: SELF_CANONICAL },
|
|
118
|
+
metadata.alternates,
|
|
119
|
+
fallback.alternates,
|
|
120
|
+
overrides.alternates
|
|
121
|
+
),
|
|
109
122
|
_managed: true,
|
|
110
123
|
_source: "database"
|
|
111
124
|
};
|
|
@@ -219,7 +232,7 @@ async function generateSitemap(options) {
|
|
|
219
232
|
}));
|
|
220
233
|
}
|
|
221
234
|
async function registerLocalSitemap(options) {
|
|
222
|
-
const { registerSitemap } = await import('./server-api-
|
|
235
|
+
const { registerSitemap } = await import('./server-api-EGOKC7Q3.js');
|
|
223
236
|
let entries = options.entries || [];
|
|
224
237
|
if (options.autoDiscover && entries.length === 0) {
|
|
225
238
|
try {
|
|
@@ -250,4 +263,4 @@ async function isIndexable(projectId, path) {
|
|
|
250
263
|
return directive.index;
|
|
251
264
|
}
|
|
252
265
|
|
|
253
|
-
export { generateSitemap, getABVariant, getManagedMetadata, getManagedMetadataWithAB, getRedirect, getRobotsDirective, isIndexable, registerLocalSitemap };
|
|
266
|
+
export { generateSitemap, getABVariant, getManagedMetadata, getManagedMetadataWithAB, getRedirect, getRobotsDirective, isIndexable, mergeAlternates, registerLocalSitemap };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { readAgentSubmit, formToolAttributes } from './chunk-Q6E4OPGG.js';
|
|
3
|
+
import { readAnalyticsIdentity } from './chunk-5ROTTMBL.js';
|
|
3
4
|
import { isFieldVisible, validateField, isFieldComplete, unseenControlValues } from './chunk-C2FZBUSS.js';
|
|
4
5
|
import { normalizeFormConfig, DEFAULT_FORM_SUCCESS_MESSAGE } from './chunk-5SQK3D53.js';
|
|
5
6
|
import { DEFAULT_HONEYPOT_FIELD } from './chunk-NJCTQH2P.js';
|
|
6
7
|
import { onPageLeave } from './chunk-L2V5PUFN.js';
|
|
7
8
|
import { uuid } from './chunk-GJWI74ZZ.js';
|
|
8
|
-
import {
|
|
9
|
+
import { readPublishedApiConfig, getClientApiConfig } from './chunk-3G7YABRA.js';
|
|
10
|
+
import { sonorFetch, sonorBeacon } from './chunk-56VDS2RP.js';
|
|
9
11
|
import { useRef, useCallback, useEffect, useState, useMemo } from 'react';
|
|
10
12
|
|
|
11
13
|
// src/forms/field-interactions.ts
|
|
@@ -190,8 +192,7 @@ function useFormTracking({
|
|
|
190
192
|
return;
|
|
191
193
|
}
|
|
192
194
|
const startTracking = async (sessionId) => {
|
|
193
|
-
const apiUrl =
|
|
194
|
-
const apiKey = window.__SITE_KIT_API_KEY__;
|
|
195
|
+
const { apiUrl, apiKey } = readPublishedApiConfig();
|
|
195
196
|
if (!apiUrl || !apiKey) {
|
|
196
197
|
if (debug) console.error("[Forms] Missing API URL or API key");
|
|
197
198
|
return null;
|
|
@@ -232,8 +233,7 @@ function useFormTracking({
|
|
|
232
233
|
});
|
|
233
234
|
const reportAbandon = (analyticsId) => {
|
|
234
235
|
if (!analyticsId) return;
|
|
235
|
-
const apiUrl =
|
|
236
|
-
const apiKey = window.__SITE_KIT_API_KEY__;
|
|
236
|
+
const { apiUrl, apiKey } = readPublishedApiConfig();
|
|
237
237
|
if (!apiUrl || !apiKey) return;
|
|
238
238
|
if (!claimAbandon(session)) return;
|
|
239
239
|
const now = Date.now();
|
|
@@ -287,8 +287,7 @@ function useFormTracking({
|
|
|
287
287
|
}, []);
|
|
288
288
|
const trackStepChange = useCallback(async (step) => {
|
|
289
289
|
if (!enabled) return;
|
|
290
|
-
const apiUrl =
|
|
291
|
-
const apiKey = window.__SITE_KIT_API_KEY__;
|
|
290
|
+
const { apiUrl, apiKey } = readPublishedApiConfig();
|
|
292
291
|
if (!apiUrl || !apiKey) {
|
|
293
292
|
if (debug) console.error("[Forms] Missing API URL or API key");
|
|
294
293
|
return;
|
|
@@ -331,8 +330,7 @@ function useFormTracking({
|
|
|
331
330
|
if (!enabled) return;
|
|
332
331
|
const session = sessionRef.current;
|
|
333
332
|
if (session) markCompleted(session);
|
|
334
|
-
const apiUrl =
|
|
335
|
-
const apiKey = window.__SITE_KIT_API_KEY__;
|
|
333
|
+
const { apiUrl, apiKey } = readPublishedApiConfig();
|
|
336
334
|
if (!apiUrl || !apiKey) {
|
|
337
335
|
if (debug) console.error("[Forms] Missing API URL or API key");
|
|
338
336
|
return;
|
|
@@ -551,9 +549,7 @@ function readGa4Identity() {
|
|
|
551
549
|
|
|
552
550
|
// src/forms/submitForm.ts
|
|
553
551
|
function getApiConfig() {
|
|
554
|
-
|
|
555
|
-
const apiKey = typeof window !== "undefined" ? window.__SITE_KIT_API_KEY__ : void 0;
|
|
556
|
-
return { apiUrl, apiKey };
|
|
552
|
+
return getClientApiConfig();
|
|
557
553
|
}
|
|
558
554
|
function getUTMParams() {
|
|
559
555
|
if (typeof window === "undefined") return {};
|
|
@@ -582,6 +578,7 @@ async function submitForm({
|
|
|
582
578
|
const honeypotFieldName = config.honeypot_field || DEFAULT_HONEYPOT_FIELD;
|
|
583
579
|
const utm = getUTMParams();
|
|
584
580
|
const ga4 = readGa4Identity();
|
|
581
|
+
const identity = readAnalyticsIdentity();
|
|
585
582
|
const payload = {
|
|
586
583
|
formId: config.id,
|
|
587
584
|
form_id: config.id,
|
|
@@ -593,11 +590,11 @@ async function submitForm({
|
|
|
593
590
|
pageUrl: typeof window !== "undefined" ? window.location.href : null,
|
|
594
591
|
referrer: typeof document !== "undefined" ? document.referrer || null : null,
|
|
595
592
|
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : null,
|
|
596
|
-
sessionId:
|
|
593
|
+
sessionId: identity.sessionId,
|
|
597
594
|
// Anonymous visitor id (_sk_vid) — the same id Analytics/Signal stamp on
|
|
598
595
|
// page views, so the Sonor side can bind this lead to its browsing session
|
|
599
596
|
// (page -> lead attribution). Sent on every submission; null pre-hydration.
|
|
600
|
-
visitorId:
|
|
597
|
+
visitorId: identity.visitorId,
|
|
601
598
|
recaptchaToken: recaptchaToken || void 0,
|
|
602
599
|
utmSource: utm.utm_source,
|
|
603
600
|
utmMedium: utm.utm_medium,
|
|
@@ -706,12 +703,12 @@ function useForm(formIdOrSlug, options = {}) {
|
|
|
706
703
|
}
|
|
707
704
|
return;
|
|
708
705
|
}
|
|
709
|
-
const apiUrl =
|
|
706
|
+
const { apiUrl } = getClientApiConfig();
|
|
710
707
|
async function fetchForm() {
|
|
711
708
|
try {
|
|
712
709
|
setIsLoading(true);
|
|
713
710
|
setFetchError(null);
|
|
714
|
-
const readApiKey = () =>
|
|
711
|
+
const readApiKey = () => readPublishedApiConfig().apiKey;
|
|
715
712
|
let apiKey = readApiKey();
|
|
716
713
|
for (let i = 0; i < 15 && !apiKey; i++) {
|
|
717
714
|
await new Promise((r) => setTimeout(r, 100));
|
|
@@ -2,7 +2,7 @@ import { generateArticleAuthorNode, resolveArticleArtwork, withArticleAuthorIden
|
|
|
2
2
|
import { resolveArticleUrl, createPublicationRoutes, resolvePublicationUrl, articleCategorySlug } from './chunk-WMVK77ND.js';
|
|
3
3
|
import { withoutSchemaPlaceholders } from './chunk-VWWITFWM.js';
|
|
4
4
|
import { withSiteParam, withSiteBody } from './chunk-MJP63SSS.js';
|
|
5
|
-
import { resolveServerApiConfig } from './chunk-
|
|
5
|
+
import { resolveServerApiConfig } from './chunk-C7TLGL3R.js';
|
|
6
6
|
import { notFound } from 'next/navigation';
|
|
7
7
|
|
|
8
8
|
// src/articles/public-reads.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SITE_CACHE_TAGS } from './chunk-RYVDGXC2.js';
|
|
2
1
|
import { withSiteBody } from './chunk-MJP63SSS.js';
|
|
3
|
-
import {
|
|
2
|
+
import { SITE_CACHE_TAGS } from './chunk-6KU7STM3.js';
|
|
3
|
+
import { serverApiFetch, requireServerApiConfig } from './chunk-C7TLGL3R.js';
|
|
4
4
|
import { postRegisterSitemap, resolveSyncSite } from './chunk-DIKNRN34.js';
|
|
5
5
|
import { cache } from 'react';
|
|
6
6
|
import 'server-only';
|
|
@@ -116,10 +116,6 @@ var getInternalLinks = cache(async (sourcePath, options) => {
|
|
|
116
116
|
);
|
|
117
117
|
return result?.links || [];
|
|
118
118
|
});
|
|
119
|
-
var getContentBlock = cache(async (path, section, site) => {
|
|
120
|
-
const result = await secureApiPost("/api/public/seo/content", withSiteBody({ path, section }, site));
|
|
121
|
-
return result?.content || null;
|
|
122
|
-
});
|
|
123
119
|
var getABTest = cache(async (path, field) => {
|
|
124
120
|
const result = await secureApiPost("/api/public/seo/ab-test", { path, field });
|
|
125
121
|
return result?.test || null;
|
|
@@ -237,4 +233,4 @@ var getVisibilitySummary = cache(async () => {
|
|
|
237
233
|
return signalApiGet(`/skills/seo/visibility/${projectId}/summary`);
|
|
238
234
|
});
|
|
239
235
|
|
|
240
|
-
export { ensureMetadata, getABTest,
|
|
236
|
+
export { ensureMetadata, getABTest, getEntities, getEntityEnhancedSchema, getFAQData, getInternalLinks, getManagedScripts, getPrimaryEntity, getRedirectData, getRobotsData, getSEOPageData, getSchemaMarkups, getSitemapEntries, getVisibilityScore, getVisibilitySummary, pruneSchemaTypes, recordABImpression, registerSitemap };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-
|
|
2
|
+
import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-KRBBH64S.js';
|
|
3
3
|
import { designTokensHash } from './chunk-IHG36STL.js';
|
|
4
4
|
import { useDeferredActivation } from './chunk-YC7ELZS3.js';
|
|
5
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
5
|
+
import { resolveAnalyticsTarget } from './chunk-CAH4Y4PY.js';
|
|
6
6
|
import { useRef, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
var STAMP_KEY = (site) => `_sk_design_sent:${site}`;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { VISITOR_ID_KEY, memoryIdentity, SESSION_ID_KEY, SESSION_TIME_KEY } from './chunk-5TM3WPCI.js';
|
|
3
|
+
import { uuid } from './chunk-GJWI74ZZ.js';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
function getOrCreateVisitorId() {
|
|
7
|
+
var _a;
|
|
8
|
+
if (typeof window === "undefined") return "";
|
|
9
|
+
let stored = null;
|
|
10
|
+
try {
|
|
11
|
+
stored = window.localStorage.getItem(VISITOR_ID_KEY);
|
|
12
|
+
const visitorId = stored || uuid();
|
|
13
|
+
window.localStorage.setItem(VISITOR_ID_KEY, visitorId);
|
|
14
|
+
return visitorId;
|
|
15
|
+
} catch {
|
|
16
|
+
return (_a = memoryIdentity).visitorId || (_a.visitorId = stored || uuid());
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function getOrCreateSessionId(timeoutMinutes = 30) {
|
|
20
|
+
var _a;
|
|
21
|
+
if (typeof window === "undefined") return "";
|
|
22
|
+
const now = Date.now();
|
|
23
|
+
const timeoutMs = timeoutMinutes * 60 * 1e3;
|
|
24
|
+
let existingSession = null;
|
|
25
|
+
try {
|
|
26
|
+
existingSession = window.sessionStorage.getItem(SESSION_ID_KEY);
|
|
27
|
+
const lastActivity = window.sessionStorage.getItem(SESSION_TIME_KEY);
|
|
28
|
+
if (existingSession && lastActivity) {
|
|
29
|
+
const elapsed = now - parseInt(lastActivity, 10);
|
|
30
|
+
if (elapsed < timeoutMs) {
|
|
31
|
+
window.sessionStorage.setItem(SESSION_TIME_KEY, now.toString());
|
|
32
|
+
window.sessionStorage.setItem(SESSION_ID_KEY, existingSession);
|
|
33
|
+
return existingSession;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const newSession = uuid();
|
|
37
|
+
window.sessionStorage.setItem(SESSION_ID_KEY, newSession);
|
|
38
|
+
window.sessionStorage.setItem(SESSION_TIME_KEY, now.toString());
|
|
39
|
+
return newSession;
|
|
40
|
+
} catch {
|
|
41
|
+
return (_a = memoryIdentity).sessionId || (_a.sessionId = existingSession || uuid());
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function useSiteKitIdentity() {
|
|
45
|
+
const [identity] = useState(() => ({
|
|
46
|
+
visitorId: getOrCreateVisitorId(),
|
|
47
|
+
sessionId: getOrCreateSessionId()
|
|
48
|
+
}));
|
|
49
|
+
return identity;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity };
|
package/dist/client/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { publishSiteCredential } from '../chunk-
|
|
2
|
+
import { publishSiteCredential } from '../chunk-LBIQ5LTC.js';
|
|
3
|
+
export { VISUAL_VIEWPORT_GAP_PROPERTY, VisualViewportGap, useVisualViewportGap } from '../chunk-6T6CQVNL.js';
|
|
3
4
|
export { useDeferredActivation } from '../chunk-YC7ELZS3.js';
|
|
4
5
|
import '../chunk-FESKKJAS.js';
|
|
5
6
|
import '../chunk-A4CC4ZG3.js';
|
|
6
7
|
export { trackConversion, trackEvent } from '../chunk-LCDVPAMR.js';
|
|
7
|
-
export {
|
|
8
|
-
|
|
8
|
+
export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity } from '../chunk-ZKADJNR2.js';
|
|
9
|
+
import '../chunk-5TM3WPCI.js';
|
|
9
10
|
import '../chunk-GJWI74ZZ.js';
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-ZLFGXKLG.js';
|
|
12
|
+
import '../chunk-5S2XDG5O.js';
|
|
12
13
|
import '../chunk-PKBMQBKP.js';
|
|
13
14
|
|
|
14
15
|
// src/client/SiteKitCredential.tsx
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* tsup config, its package.json check and the boundary test, so a new
|
|
5
5
|
* contract is added in one place.
|
|
6
6
|
*/
|
|
7
|
-
export declare const CONTRACT_ENTRIES: readonly ['forms', 'llms', 'slots', 'slot-content', 'site-cache', 'site-edit', 'website', 'color', 'fleet', 'sites', 'seo-pages', 'seo-meta', 'portfolio', 'voice', 'proposal-sitemap', 'error-page', 'schema-placeholders'];
|
|
7
|
+
export declare const CONTRACT_ENTRIES: readonly ['forms', 'llms', 'slots', 'slot-content', 'site-cache', 'site-edit', 'website', 'color', 'fleet', 'sites', 'seo-pages', 'seo-meta', 'portfolio', 'voice', 'proposal-sitemap', 'error-page', 'schema-placeholders', 'sentences'];
|
|
8
8
|
export type ContractEntry = (typeof CONTRACT_ENTRIES)[number];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sentences contract: how prose is split into sentences, so the APIs that cut
|
|
3
|
+
* an excerpt, a carousel slide or a summary out of an article agree on where
|
|
4
|
+
* a sentence ends. The APIs import it as `@sonordev/contracts/sentences`.
|
|
5
|
+
*
|
|
6
|
+
* Lossless: joining the result with spaces gives back every word of the input,
|
|
7
|
+
* in order. The usual one-liner, `text.match(/[^.!?]+[.!?]+(?=\s|$)/g)`, isn't.
|
|
8
|
+
* A period it can't use, like the first one in "9 p.m. call", makes match()
|
|
9
|
+
* skip ahead and silently drop every word before its next match, so a
|
|
10
|
+
* sentence about a 9 p.m. call comes back as "m.". Don't re-fork a regex for
|
|
11
|
+
* this.
|
|
12
|
+
*
|
|
13
|
+
* A sentence ends at . ! or ? (and any closing quote or bracket after it)
|
|
14
|
+
* followed by whitespace, then an optional opening quote or bracket, then
|
|
15
|
+
* A to Z or 0 to 9. Never before a lowercase word or a symbol, and only ASCII
|
|
16
|
+
* capitals count. It doesn't end at:
|
|
17
|
+
* - an abbreviation: a dotted one made of letters ("p.m.", "U.S.", "e.g.",
|
|
18
|
+
* "Ph.D."), a single letter ("J.", "Plan A."), or a short form listed below
|
|
19
|
+
* (titles, months, days, company suffixes, street suffixes);
|
|
20
|
+
* - a label that has a number after it ("No. 5", "Fig. 2", "Ste. 200");
|
|
21
|
+
* - a list number ("1.", "Step 2.", "Do three things: 1.").
|
|
22
|
+
* A piece with no letter in it ("...", "1.") isn't a sentence and joins the
|
|
23
|
+
* next one. A "!" or "?" is never held back by an abbreviation (only a period
|
|
24
|
+
* is), though the same start-of-sentence rule applies after it.
|
|
25
|
+
*
|
|
26
|
+
* Prices, versions, domains and email addresses ("$4.50", "v2.1",
|
|
27
|
+
* "example.com") are not abbreviations: a sentence can end after them.
|
|
28
|
+
*
|
|
29
|
+
* Where it is unsure it leans toward not splitting, because a sentence that
|
|
30
|
+
* runs long costs less than a lost word. A period after a short form that
|
|
31
|
+
* isn't listed ends a sentence like any other.
|
|
32
|
+
*
|
|
33
|
+
* It reads sentences, not layout. A newline or a list marker doesn't start a
|
|
34
|
+
* new sentence by itself, so split text into lines or paragraphs first when
|
|
35
|
+
* those matter, then split each one.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Splits prose into trimmed sentences without dropping or reordering a word.
|
|
39
|
+
* Empty, blank and nullish input give `[]`, never `null`.
|
|
40
|
+
*
|
|
41
|
+
* One pass, linear in the length of the text: each run of . ! ? (and the
|
|
42
|
+
* closing quotes or brackets after it) is looked at once, an abbreviation or
|
|
43
|
+
* list-marker check reads only the last few characters, and the check for a
|
|
44
|
+
* letter reads each character once.
|
|
45
|
+
*/
|
|
46
|
+
export declare function splitSentences(text: string | null | undefined): string[];
|
|
@@ -27,6 +27,8 @@ export declare const SITE_CACHE_TAGS: {
|
|
|
27
27
|
readonly taxonomy: 'editorial-taxonomy';
|
|
28
28
|
/** Portfolio items (agency-site-kit). */
|
|
29
29
|
readonly portfolio: 'portfolio';
|
|
30
|
+
/** Products, services, events and membership plans (commerce-kit). */
|
|
31
|
+
readonly commerce: 'commerce';
|
|
30
32
|
};
|
|
31
33
|
export type SiteCacheTag = (typeof SITE_CACHE_TAGS)[keyof typeof SITE_CACHE_TAGS];
|
|
32
34
|
/** The body Sonor POSTs to the revalidation route. */
|
package/dist/cta-bar/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CTA_BAR_BREAKPOINTS, CTA_BAR_SPACE, CtaBar, CtaBarAction, ECHO_CLEARANCE } from '../chunk-LNSNA3W4.js';
|
|
2
2
|
import '../chunk-UPFU63L4.js';
|
|
3
|
-
import '../chunk-LCDVPAMR.js';
|
|
4
3
|
import '../chunk-JE4A5S4F.js';
|
|
4
|
+
import '../chunk-LCDVPAMR.js';
|
|
5
5
|
import '../chunk-PKBMQBKP.js';
|