@sonordev/site-kit 7.4.0 → 8.0.1
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 +72 -0
- package/README.md +44 -18
- package/agent-manifest.json +111 -56
- package/dist/AnalyticsProvider-EGCZ2MVM.js +13 -0
- package/dist/{ArticleViewTracker-3DH53RSB.js → ArticleViewTracker-ATNVMT45.js} +6 -5
- package/dist/{BlocksPopup-FGWYVHCH.js → BlocksPopup-F636XNO4.js} +6 -5
- package/dist/{ChatWidget-CDQZCLVH.js → ChatWidget-EQTLKPJX.js} +8 -5
- package/dist/{FileField-IPJ7L2W6.js → FileField-BUD2YGN5.js} +5 -5
- package/dist/{FormSpotlight-CQI2DBWI.js → FormSpotlight-NGH56TGC.js} +3 -3
- package/dist/{FormStage-4WHD6ED4.js → FormStage-XZRC54SY.js} +3 -3
- package/dist/ManagedForm-CQDQ4CUN.js +19 -0
- package/dist/{ManagedNewsletterForm-3D2BK3KQ.js → ManagedNewsletterForm-KCN3BTKA.js} +9 -6
- package/dist/{SignalCore-HEQYITTM.js → SignalCore-RDQPM2L2.js} +7 -7
- package/dist/SiteChat-QBDOQ5ZZ.js +6 -0
- package/dist/SiteDesignReporter-426TUCUF.js +12 -0
- package/dist/SitePopups-KLUD6XIE.js +13 -0
- package/dist/SitemapSync-QOIMV5GO.js +9 -0
- package/dist/_client/booking-widget.js +6 -5
- package/dist/_client/testimonial-section.js +3 -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-CSN45MHO.js → chunk-3222QBUS.js} +13 -16
- 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-3E3PPSNR.js → chunk-55JLUMAC.js} +2 -2
- package/dist/{chunk-EHR4NIMX.js → chunk-5GB2HHVJ.js} +3 -3
- package/dist/chunk-5ROTTMBL.js +19 -0
- package/dist/chunk-5TM3WPCI.js +7 -0
- package/dist/{chunk-DA5XC7Y6.js → chunk-6BXUSAOJ.js} +1 -1
- package/dist/{chunk-7HPZSWS4.js → chunk-6CJGZFOU.js} +1 -1
- package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
- package/dist/{chunk-JRCNUUNG.js → chunk-6KUCA5HG.js} +1 -1
- package/dist/{chunk-MDP7EB4J.js → chunk-7BSC6HF3.js} +5 -5
- package/dist/{chunk-YCFW2OQO.js → chunk-AGJODJ4V.js} +2 -2
- package/dist/{chunk-OOD6GMT4.js → chunk-B7QRRLTU.js} +6 -4
- package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
- package/dist/{chunk-PQDJNIHR.js → chunk-CAF53GKN.js} +2 -2
- package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
- package/dist/{chunk-XA2BNW5M.js → chunk-DWNS6ZJM.js} +1 -1
- package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
- package/dist/{chunk-XEMHGJEG.js → chunk-EE6IG5GK.js} +10 -10
- package/dist/{chunk-D2RGEWHS.js → chunk-FIGIJK5F.js} +2 -2
- package/dist/{chunk-PF64OEXC.js → chunk-GMXY2OOY.js} +2 -2
- package/dist/{chunk-IE5SSOCN.js → chunk-H3SDOSVU.js} +3 -11
- package/dist/{chunk-GK7TV7EK.js → chunk-IY6G67EF.js} +1 -1
- package/dist/{chunk-CG4ETW5Y.js → chunk-J6N5DCGW.js} +3 -3
- package/dist/{chunk-ATE6IFVK.js → chunk-JCFQGEG7.js} +1 -1
- package/dist/{chunk-4BHRA7TI.js → chunk-JIH32RH2.js} +3 -3
- package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
- package/dist/{chunk-5O62CER4.js → chunk-M62U7TJF.js} +1 -1
- package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
- package/dist/{chunk-6LLTLLEJ.js → chunk-NKFRW2VB.js} +6 -5
- package/dist/{chunk-CKW4HFJG.js → chunk-OCKGB734.js} +3 -3
- package/dist/{chunk-4DJMJ4V5.js → chunk-OE3NXEOF.js} +1 -1
- package/dist/{chunk-KHQ5GD6T.js → chunk-S5G3A7OZ.js} +1 -1
- package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
- package/dist/{chunk-ZTLU3BSW.js → chunk-TZ5RTANX.js} +2 -2
- package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
- package/dist/{chunk-FUQTV5O6.js → chunk-VQQV7FOX.js} +3 -3
- package/dist/{chunk-PKGN32AU.js → chunk-XPTJRVL2.js} +1 -1
- package/dist/{chunk-662ILEZ6.js → chunk-Y35BWW2C.js} +3 -7
- package/dist/{chunk-MHGAZ3LL.js → chunk-YGXWG54S.js} +3 -5
- package/dist/{chunk-AH4AXO4P.js → chunk-Z4MK4VOG.js} +1 -1
- package/dist/{chunk-AV4QAK5F.js → chunk-Z6PVFZRI.js} +5 -4
- package/dist/chunk-ZKADJNR2.js +52 -0
- package/dist/client/index.js +6 -5
- package/dist/contracts/entries.d.ts +1 -1
- package/dist/contracts/knowledge.d.ts +84 -0
- 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 +13 -11
- package/dist/llms/index.js +7 -6
- package/dist/maps/index.js +6 -6
- package/dist/mcp/sonor.d.ts +47 -3
- package/dist/mcp/sonor.js +30 -20
- package/dist/proxy/index.d.ts +3 -3
- package/dist/proxy/index.js +1 -1
- package/dist/reputation/index.js +3 -2
- package/dist/reputation/server.js +2 -1
- 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 +7 -6
- 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 +4 -3
- package/dist/seo/types.d.ts +9 -30
- package/dist/server/index.d.ts +8 -1
- package/dist/server/index.js +4 -3
- package/dist/server/mint-site-token.d.ts +0 -11
- 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/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 +74 -0
- package/dist/shared/sonorFetch.d.ts +4 -3
- package/dist/shared/source-graph.d.ts +4 -1
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +2 -2
- package/dist/sitemap/index.js +4 -3
- 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-OL4KQERZ.js → writeLLMsTxt-UZGN6IBU.js} +3 -2
- package/docs/MIGRATING-TO-7.md +5 -2
- package/docs/MIGRATING-TO-8.md +183 -0
- package/docs.json +4 -8
- package/package.json +18 -45
- 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/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-BQXV3ZF3.js +0 -11
- package/dist/ManagedForm-7FZNH4L2.js +0 -16
- package/dist/SiteChat-DMPDXY3W.js +0 -5
- package/dist/SiteDesignReporter-Y2IOJE52.js +0 -11
- package/dist/SitePopups-HD2LDKVU.js +0 -10
- package/dist/SitemapSync-OKPZHRX6.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,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,4 +1,4 @@
|
|
|
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
4
|
import { freshFetch } from './chunk-UAYAJPEP.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()
|
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
import { FormEnhancer } from './chunk-
|
|
2
|
-
import { StaticForm } from './chunk-
|
|
3
|
-
import { serverApiFetch } from './chunk-
|
|
1
|
+
import { FormEnhancer } from './chunk-GMXY2OOY.js';
|
|
2
|
+
import { StaticForm } from './chunk-LNSF6BJC.js';
|
|
3
|
+
import { serverApiFetch } from './chunk-C7TLGL3R.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
async function ServerForm({
|
|
@@ -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,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getClientApiConfig } from './chunk-3G7YABRA.js';
|
|
2
|
+
import { sonorFetch } from './chunk-55JLUMAC.js';
|
|
2
3
|
|
|
3
4
|
// src/sync/api.ts
|
|
4
|
-
var DEFAULT_API_URL = "https://api.sonor.io";
|
|
5
5
|
function getApiConfig() {
|
|
6
|
-
|
|
7
|
-
const apiKey = typeof window !== "undefined" ? window.__SITE_KIT_API_KEY__ : void 0;
|
|
8
|
-
return { apiUrl, apiKey };
|
|
6
|
+
return getClientApiConfig();
|
|
9
7
|
}
|
|
10
8
|
function buildHeaders(isPost = false) {
|
|
11
9
|
const headers = {};
|
|
@@ -54,7 +54,7 @@ function useSignal() {
|
|
|
54
54
|
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
55
55
|
}
|
|
56
56
|
var LazySignalCore = dynamic(
|
|
57
|
-
() => import('./SignalCore-
|
|
57
|
+
() => import('./SignalCore-RDQPM2L2.js').then((m) => ({ default: m.SignalCore })),
|
|
58
58
|
{ ssr: false }
|
|
59
59
|
);
|
|
60
60
|
function SignalBridge({
|
|
@@ -1,5 +1,6 @@
|
|
|
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-YGXWG54S.js';
|
|
3
|
+
import { readPublishedApiConfig, DEFAULT_SONOR_API_URL } from './chunk-3G7YABRA.js';
|
|
3
4
|
import { useState, useRef, useMemo, useCallback, useEffect, useId } from 'react';
|
|
4
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
6
|
|
|
@@ -125,7 +126,6 @@ function bookingRecoveryFromError(error) {
|
|
|
125
126
|
if (/time reservation expired|invalid slot hold|meeting details changed/i.test(message)) return "hold";
|
|
126
127
|
return null;
|
|
127
128
|
}
|
|
128
|
-
var DEFAULT_API_URL = "https://api.sonor.io";
|
|
129
129
|
var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
130
130
|
var MONTHS = [
|
|
131
131
|
"January",
|
|
@@ -217,8 +217,9 @@ function BookingWidget({
|
|
|
217
217
|
autoSelectFirstDay = true,
|
|
218
218
|
styles = {}
|
|
219
219
|
}) {
|
|
220
|
-
const
|
|
221
|
-
const
|
|
220
|
+
const published = readPublishedApiConfig();
|
|
221
|
+
const apiKey = propApiKey || published.apiKey;
|
|
222
|
+
const apiUrl = propApiUrl || published.apiUrl || DEFAULT_SONOR_API_URL;
|
|
222
223
|
const [step, setStep] = useState(bookingTypeSlug ? "datetime" : "type");
|
|
223
224
|
const [loading, setLoading] = useState(false);
|
|
224
225
|
const [slotsLoading, setSlotsLoading] = useState(false);
|
|
@@ -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-6KUCA5HG.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-IY6G67EF.js';
|
|
12
|
+
import '../chunk-S5G3A7OZ.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', 'knowledge'];
|
|
8
8
|
export type ContractEntry = (typeof CONTRACT_ENTRIES)[number];
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge contract: which Sonor records Signal reads into a project's
|
|
3
|
+
* knowledge, the address each record's knowledge is stored under, and the
|
|
4
|
+
* limits of the call that tells Signal a site's pages changed. The Sonor API
|
|
5
|
+
* makes those calls and Signal answers them, so both import this as
|
|
6
|
+
* `@sonordev/contracts/knowledge` instead of keeping lists that drift apart.
|
|
7
|
+
* The dashboard, which shows the owner what Signal read, reads stored
|
|
8
|
+
* addresses by the same rules.
|
|
9
|
+
*
|
|
10
|
+
* A record's knowledge is stored under a URI built from its kind and id:
|
|
11
|
+
* `<kind>://<id>` for its first chunk and `<kind>://<id>#<anchor>` for any
|
|
12
|
+
* more (an article indexed in full, split by heading). The scheme is what
|
|
13
|
+
* tells a record's rows apart from a page's passages, which are stored under
|
|
14
|
+
* the page's https URL. The content type can't: an article's record has the
|
|
15
|
+
* same content type as the page passages beside it, because a live article is
|
|
16
|
+
* a page on the site.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The kinds of Sonor record Signal indexes, in the order the dashboard lists
|
|
20
|
+
* them: case studies, proof records, managed FAQs, reviews, articles and
|
|
21
|
+
* commerce offerings. Each kind is also its URI scheme.
|
|
22
|
+
*/
|
|
23
|
+
export declare const KNOWLEDGE_RECORD_KINDS: readonly ["portfolio", "proof", "faq", "review", "article", "offering"];
|
|
24
|
+
export type KnowledgeRecordKind = (typeof KNOWLEDGE_RECORD_KINDS)[number];
|
|
25
|
+
/** True for one of KNOWLEDGE_RECORD_KINDS, spelled exactly (lowercase). */
|
|
26
|
+
export declare function isKnowledgeRecordKind(value: unknown): value is KnowledgeRecordKind;
|
|
27
|
+
/** `<kind>://`, the start every address of that kind shares, for prefix queries. */
|
|
28
|
+
export declare function knowledgeRecordPrefix(kind: KnowledgeRecordKind): string;
|
|
29
|
+
/**
|
|
30
|
+
* Where a record's knowledge is stored: `<kind>://<id>` for its first chunk,
|
|
31
|
+
* `<kind>://<id>#<anchor>` for a further one. `id` is the record's UUID, and
|
|
32
|
+
* checking it is the caller's job: an empty id, or one holding `#`, `?`, `/`
|
|
33
|
+
* or whitespace, builds an address knowledgeRecordRefOf can't read back.
|
|
34
|
+
*/
|
|
35
|
+
export declare function knowledgeRecordSourceUrl(kind: KnowledgeRecordKind, id: string, anchor?: string | null): string;
|
|
36
|
+
/**
|
|
37
|
+
* The address an offering had before offerings were records of their own:
|
|
38
|
+
* `commerce://offering/<id>`. Nothing writes it any more. Signal switches the
|
|
39
|
+
* row off the next time that offering syncs, and a reader counts it as the
|
|
40
|
+
* offering until then (knowledgeRecordRefOf).
|
|
41
|
+
*/
|
|
42
|
+
export declare function legacyOfferingSourceUrl(id: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* The kind of record a stored address belongs to, by its scheme
|
|
45
|
+
* (`article://<id>#part-2` is 'article'), or null for anything else: a page
|
|
46
|
+
* passage, an older page summary, a note. Case doesn't matter and surrounding
|
|
47
|
+
* whitespace is ignored. This is the test for "is this row a record's": it
|
|
48
|
+
* reads only the scheme, so it doesn't need an id, and an offering's legacy
|
|
49
|
+
* address isn't a record row by it.
|
|
50
|
+
*/
|
|
51
|
+
export declare function knowledgeRecordKindOf(sourceUrl: string | null | undefined): KnowledgeRecordKind | null;
|
|
52
|
+
/** The record a stored address names. */
|
|
53
|
+
export interface KnowledgeRecordRef {
|
|
54
|
+
kind: KnowledgeRecordKind;
|
|
55
|
+
id: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The record a stored address names (`portfolio://<id>#part-2` is
|
|
59
|
+
* `{ kind: 'portfolio', id }`), or null when it names none. An offering's
|
|
60
|
+
* legacy address (`commerce://offering/<id>`) names that offering. Case
|
|
61
|
+
* doesn't matter in the scheme, surrounding whitespace is ignored, and the id
|
|
62
|
+
* keeps its own case.
|
|
63
|
+
*/
|
|
64
|
+
export declare function knowledgeRecordRefOf(sourceUrl: string | null | undefined): KnowledgeRecordRef | null;
|
|
65
|
+
/**
|
|
66
|
+
* One page of a site in a page sync: it changed (Signal reads it live) or
|
|
67
|
+
* left the site (`removed`: Signal switches its passages off). Signal applies
|
|
68
|
+
* every removal in a call, then reads the changed pages in the order given,
|
|
69
|
+
* as many as it reads in one call; the rest wait for its nightly sweep. So a
|
|
70
|
+
* sender puts removals first, then the pages that matter most.
|
|
71
|
+
*/
|
|
72
|
+
export interface KnowledgePageChange {
|
|
73
|
+
/** The host as the project's pages store it; null or absent is the project's primary domain. */
|
|
74
|
+
site?: string | null;
|
|
75
|
+
/** The page's path, from "/". */
|
|
76
|
+
path: string;
|
|
77
|
+
removed?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** The most pages one page sync may name. Signal refuses a longer list outright, so cut the list after ordering it. */
|
|
80
|
+
export declare const KNOWLEDGE_SYNC_MAX_PAGES = 500;
|
|
81
|
+
/** The longest path a page sync may name, in characters. */
|
|
82
|
+
export declare const KNOWLEDGE_SYNC_PATH_MAX_LENGTH = 2048;
|
|
83
|
+
/** The longest host a page sync may name, in characters (a DNS name's limit). */
|
|
84
|
+
export declare const KNOWLEDGE_SYNC_SITE_MAX_LENGTH = 253;
|
|
@@ -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';
|
package/dist/fleet/index.js
CHANGED
|
@@ -1,10 +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-5GB2HHVJ.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-CAH4Y4PY.js';
|
|
6
6
|
import '../chunk-EKBEOXTH.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
9
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-3G7YABRA.js';
|
|
8
|
+
import '../chunk-55JLUMAC.js';
|
|
9
|
+
import '../chunk-IY6G67EF.js';
|
|
10
|
+
import '../chunk-S5G3A7OZ.js';
|
|
10
11
|
import '../chunk-PKBMQBKP.js';
|