@sonordev/site-kit 7.4.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 +67 -0
- package/README.md +44 -18
- package/agent-manifest.json +111 -56
- package/dist/AnalyticsProvider-LYFDQRRJ.js +13 -0
- package/dist/{ArticleViewTracker-3DH53RSB.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
- package/dist/{BlocksPopup-FGWYVHCH.js → BlocksPopup-GFX3GZIK.js} +6 -5
- package/dist/{ChatWidget-CDQZCLVH.js → ChatWidget-DVS7MLBN.js} +8 -5
- package/dist/{FileField-IPJ7L2W6.js → FileField-DVN7NUBI.js} +5 -5
- package/dist/{FormSpotlight-CQI2DBWI.js → FormSpotlight-W4SXKKO6.js} +3 -3
- package/dist/{FormStage-4WHD6ED4.js → FormStage-JTEE5MZD.js} +3 -3
- package/dist/ManagedForm-ZAUHIHGP.js +19 -0
- package/dist/{ManagedNewsletterForm-3D2BK3KQ.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
- package/dist/{SignalCore-HEQYITTM.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.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-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-56VDS2RP.js} +2 -2
- package/dist/chunk-5ROTTMBL.js +19 -0
- package/dist/{chunk-KHQ5GD6T.js → chunk-5S2XDG5O.js} +1 -1
- package/dist/chunk-5TM3WPCI.js +7 -0
- package/dist/{chunk-7HPZSWS4.js → chunk-6CJGZFOU.js} +1 -1
- package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
- package/dist/{chunk-FUQTV5O6.js → chunk-6QFINXLH.js} +3 -3
- package/dist/{chunk-AH4AXO4P.js → chunk-6ZXJ3SXR.js} +1 -1
- package/dist/{chunk-XA2BNW5M.js → chunk-7YEEOIWI.js} +1 -1
- package/dist/{chunk-IE5SSOCN.js → chunk-BQ2CXKTQ.js} +3 -11
- package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
- package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
- package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
- package/dist/{chunk-OOD6GMT4.js → chunk-GNSXOTIK.js} +6 -4
- package/dist/{chunk-EHR4NIMX.js → chunk-ICAVVF6D.js} +3 -3
- package/dist/{chunk-MHGAZ3LL.js → chunk-IJQ767JS.js} +3 -5
- package/dist/{chunk-CKW4HFJG.js → chunk-J65N34YM.js} +3 -3
- package/dist/{chunk-4BHRA7TI.js → chunk-JIH32RH2.js} +3 -3
- package/dist/{chunk-D2RGEWHS.js → chunk-K22OLAPC.js} +2 -2
- package/dist/{chunk-CG4ETW5Y.js → chunk-KRBBH64S.js} +3 -3
- package/dist/{chunk-JRCNUUNG.js → chunk-LBIQ5LTC.js} +1 -1
- package/dist/{chunk-MDP7EB4J.js → chunk-LKH44GI3.js} +5 -5
- 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-4DJMJ4V5.js → chunk-OE3NXEOF.js} +1 -1
- package/dist/{chunk-AV4QAK5F.js → chunk-OGK7OL3T.js} +5 -4
- package/dist/{chunk-YCFW2OQO.js → chunk-PD7K54EQ.js} +2 -2
- package/dist/{chunk-PF64OEXC.js → chunk-PIX7FAMX.js} +2 -2
- package/dist/{chunk-XEMHGJEG.js → chunk-ROAOI6GG.js} +10 -10
- package/dist/{chunk-6LLTLLEJ.js → chunk-S7SSYGUJ.js} +6 -5
- package/dist/{chunk-ATE6IFVK.js → chunk-SBPAXWLF.js} +1 -1
- package/dist/{chunk-DA5XC7Y6.js → chunk-TOSZGJEQ.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-CSN45MHO.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-PQDJNIHR.js → chunk-ZHNQFNO3.js} +2 -2
- package/dist/chunk-ZKADJNR2.js +52 -0
- package/dist/{chunk-GK7TV7EK.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 +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 +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 +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 +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/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,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @sonordev/site-kit/commerce - ProductPage
|
|
3
|
-
*
|
|
4
|
-
* Complete product page component with SEO metadata, breadcrumbs, and related products.
|
|
5
|
-
* Use this as a drop-in for dynamic [slug] routes.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import type { CommerceOffering, CommerceVariant } from './types';
|
|
9
|
-
export interface ProductPageProps {
|
|
10
|
-
/** Pre-loaded product data (for SSR) */
|
|
11
|
-
product?: CommerceOffering;
|
|
12
|
-
/** Product slug to fetch (if not pre-loaded) */
|
|
13
|
-
slug?: string;
|
|
14
|
-
/** Show breadcrumbs navigation */
|
|
15
|
-
showBreadcrumbs?: boolean;
|
|
16
|
-
/** Show related products section */
|
|
17
|
-
showRelatedProducts?: boolean;
|
|
18
|
-
/** Number of related products to show */
|
|
19
|
-
relatedProductsLimit?: number;
|
|
20
|
-
/** Show back to shop link */
|
|
21
|
-
showBackLink?: boolean;
|
|
22
|
-
/** Base path for shop */
|
|
23
|
-
shopBasePath?: string;
|
|
24
|
-
/** Success URL after checkout */
|
|
25
|
-
successUrl?: string;
|
|
26
|
-
/** Cancel URL if checkout cancelled */
|
|
27
|
-
cancelUrl?: string;
|
|
28
|
-
/** Callback when added to cart */
|
|
29
|
-
onAddToCart?: (product: CommerceOffering, variant?: CommerceVariant, quantity?: number) => void;
|
|
30
|
-
/** Custom breadcrumb renderer */
|
|
31
|
-
renderBreadcrumbs?: (product: CommerceOffering) => React.ReactNode;
|
|
32
|
-
/** Custom SEO head renderer (for Next.js Head or similar) */
|
|
33
|
-
renderHead?: (product: CommerceOffering) => React.ReactNode;
|
|
34
|
-
/** Additional class names */
|
|
35
|
-
className?: string;
|
|
36
|
-
/** Custom styles */
|
|
37
|
-
style?: React.CSSProperties;
|
|
38
|
-
}
|
|
39
|
-
export declare function ProductPage({ product: propProduct, slug, showBreadcrumbs, showRelatedProducts, relatedProductsLimit, showBackLink, shopBasePath, successUrl, cancelUrl, onAddToCart, renderBreadcrumbs, renderHead, className, style, }: ProductPageProps): React.JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @sonordev/site-kit/commerce - RegistrationForm
|
|
3
|
-
*
|
|
4
|
-
* Simplified registration form for free events/classes.
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { RegistrationFormProps } from './types';
|
|
8
|
-
export declare function RegistrationForm({ event, scheduleId, title, submitText, successMessage, collectPhone, additionalFields, onSuccess, onError, className, formClassName, inputClassName, buttonClassName, }: RegistrationFormProps): React.JSX.Element;
|
|
9
|
-
export default RegistrationForm;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SizeChart as SizeChartType } from './types';
|
|
2
|
-
interface SizeChartProps {
|
|
3
|
-
chart: SizeChartType;
|
|
4
|
-
selectedSize?: string;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function SizeChart({ chart, selectedSize, className }: SizeChartProps): import("react").JSX.Element | null;
|
|
8
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @sonordev/site-kit/commerce - UpcomingEvents
|
|
3
|
-
*
|
|
4
|
-
* Displays a list of upcoming events with date, title, and registration buttons.
|
|
5
|
-
*/
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import type { UpcomingEventsProps } from './types';
|
|
8
|
-
export declare function UpcomingEvents({ events: propEvents, limit, category, variant, layout, showViewAll, viewAllUrl, viewAllText, emptyMessage, title, onRegister, onCtaClick, className, titleClassName, eventClassName, }: UpcomingEventsProps): React.JSX.Element;
|
|
9
|
-
export default UpcomingEvents;
|
package/dist/commerce/api.d.ts
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @sonordev/site-kit/commerce - Commerce API
|
|
3
|
-
*
|
|
4
|
-
* API functions for fetching offerings, submitting orders, and registrations.
|
|
5
|
-
* All data goes through Sonor API with API key auth - never Supabase directly.
|
|
6
|
-
*/
|
|
7
|
-
import type { CommerceOffering, FetchOfferingsOptions, FetchEventsOptions, CheckoutCustomer, CheckoutResult } from './types';
|
|
8
|
-
export declare function fetchOfferings(options?: FetchOfferingsOptions): Promise<CommerceOffering[]>;
|
|
9
|
-
export declare function fetchOffering(slug: string): Promise<CommerceOffering | null>;
|
|
10
|
-
export declare function fetchLatestOffering(type?: string, category?: string): Promise<CommerceOffering | null>;
|
|
11
|
-
export declare function fetchUpcomingEvents(options?: FetchEventsOptions): Promise<CommerceOffering[]>;
|
|
12
|
-
export declare function fetchNextEvent(category?: string): Promise<CommerceOffering | null>;
|
|
13
|
-
export declare function fetchProducts(options?: Omit<FetchOfferingsOptions, 'type'>): Promise<CommerceOffering[]>;
|
|
14
|
-
export declare function fetchServices(options?: Omit<FetchOfferingsOptions, 'type'>): Promise<CommerceOffering[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Fetch products via public API
|
|
17
|
-
*/
|
|
18
|
-
export declare function fetchProductsPublic(options?: {
|
|
19
|
-
category?: string;
|
|
20
|
-
limit?: number;
|
|
21
|
-
offset?: number;
|
|
22
|
-
orderBy?: 'name' | 'price' | 'created_at' | 'sort_order';
|
|
23
|
-
order?: 'asc' | 'desc';
|
|
24
|
-
search?: string;
|
|
25
|
-
}): Promise<{
|
|
26
|
-
products: CommerceOffering[];
|
|
27
|
-
total: number;
|
|
28
|
-
}>;
|
|
29
|
-
/**
|
|
30
|
-
* Fetch single product by slug
|
|
31
|
-
*/
|
|
32
|
-
export declare function fetchProductBySlug(slug: string): Promise<CommerceOffering | null>;
|
|
33
|
-
/**
|
|
34
|
-
* Fetch product categories
|
|
35
|
-
*/
|
|
36
|
-
export declare function fetchCategories(): Promise<{
|
|
37
|
-
id: string;
|
|
38
|
-
name: string;
|
|
39
|
-
slug: string;
|
|
40
|
-
}[]>;
|
|
41
|
-
export interface ShippingAddress {
|
|
42
|
-
street1: string;
|
|
43
|
-
street2?: string;
|
|
44
|
-
city: string;
|
|
45
|
-
state: string;
|
|
46
|
-
zip: string;
|
|
47
|
-
country?: string;
|
|
48
|
-
name?: string;
|
|
49
|
-
phone?: string;
|
|
50
|
-
}
|
|
51
|
-
export interface ShippingRate {
|
|
52
|
-
carrier: string;
|
|
53
|
-
service: string;
|
|
54
|
-
amount: string;
|
|
55
|
-
currency: string;
|
|
56
|
-
estimatedDays?: number;
|
|
57
|
-
objectId?: string;
|
|
58
|
-
/**
|
|
59
|
-
* Signed by the API along with the rate. Checkout charges shipping from it,
|
|
60
|
-
* not from `amount`, so send it back as `shippingQuote` (shippingSelection
|
|
61
|
-
* does). Absent from APIs that predate quotes.
|
|
62
|
-
*/
|
|
63
|
-
quote?: string;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* The chosen rate as checkout options: carrier, service, amount, and the
|
|
67
|
-
* signed quote the API charges shipping from. The one place a rate becomes
|
|
68
|
-
* checkout fields, for CheckoutForm, ProductDetail and custom checkouts.
|
|
69
|
-
*/
|
|
70
|
-
export declare function shippingSelection(rate: ShippingRate | null | undefined): Pick<CreateCheckoutOptions, 'shippingCarrier' | 'shippingService' | 'shippingCost' | 'shippingQuote'>;
|
|
71
|
-
export interface ValidateAddressResult {
|
|
72
|
-
isValid: boolean;
|
|
73
|
-
normalized?: {
|
|
74
|
-
street1: string;
|
|
75
|
-
street2?: string;
|
|
76
|
-
city: string;
|
|
77
|
-
state: string;
|
|
78
|
-
zip: string;
|
|
79
|
-
country: string;
|
|
80
|
-
};
|
|
81
|
-
messages?: string[];
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Fetch shipping rates for checkout (when shipping is enabled)
|
|
85
|
-
*/
|
|
86
|
-
export declare function fetchShippingRates(shippingAddress: ShippingAddress, offerings: Array<{
|
|
87
|
-
offering_id: string;
|
|
88
|
-
quantity?: number;
|
|
89
|
-
}>): Promise<ShippingRate[]>;
|
|
90
|
-
/**
|
|
91
|
-
* Validate a shipping address before checkout
|
|
92
|
-
*/
|
|
93
|
-
export declare function validateAddress(address: Omit<ShippingAddress, 'name' | 'phone'>): Promise<ValidateAddressResult>;
|
|
94
|
-
/**
|
|
95
|
-
* Fetch the active payment processor for the current project.
|
|
96
|
-
* Returns 'stripe' | 'square' | null.
|
|
97
|
-
*/
|
|
98
|
-
export declare function fetchActiveProcessor(): Promise<'stripe' | 'square' | null>;
|
|
99
|
-
export declare function registerForEvent(eventId: string, scheduleId: string | undefined, customer: CheckoutCustomer): Promise<CheckoutResult>;
|
|
100
|
-
export interface CheckoutLineItem {
|
|
101
|
-
offeringId: string;
|
|
102
|
-
variantId?: string;
|
|
103
|
-
scheduleId?: string;
|
|
104
|
-
quantity: number;
|
|
105
|
-
}
|
|
106
|
-
export interface CreateCheckoutOptions {
|
|
107
|
-
offeringId?: string;
|
|
108
|
-
variantId?: string;
|
|
109
|
-
scheduleId?: string;
|
|
110
|
-
quantity?: number;
|
|
111
|
-
/**
|
|
112
|
-
* Multi-line cart (v1: events only, all items must share offeringId + scheduleId).
|
|
113
|
-
* When provided, takes precedence over offeringId/variantId/quantity. Requires
|
|
114
|
-
* `sourceId` (Square Web Payments SDK nonce) — Square inline only in v1.
|
|
115
|
-
*/
|
|
116
|
-
lineItems?: CheckoutLineItem[];
|
|
117
|
-
customer?: CheckoutCustomer;
|
|
118
|
-
successUrl?: string;
|
|
119
|
-
cancelUrl?: string;
|
|
120
|
-
/** Square card nonce from Web Payments SDK for inline card collection (no redirect) */
|
|
121
|
-
sourceId?: string;
|
|
122
|
-
/** Shipping address (required for physical products when shipping_enabled) */
|
|
123
|
-
shippingAddress?: ShippingAddress;
|
|
124
|
-
/** Selected shipping carrier from rates */
|
|
125
|
-
shippingCarrier?: string;
|
|
126
|
-
/** Selected shipping service from rates */
|
|
127
|
-
shippingService?: string;
|
|
128
|
-
/** Shipping cost in dollars (from selected rate) */
|
|
129
|
-
shippingCost?: number;
|
|
130
|
-
/** The selected rate's signed quote; the API charges shipping from it. */
|
|
131
|
-
shippingQuote?: string;
|
|
132
|
-
/** Discount/promo code to apply */
|
|
133
|
-
discountCode?: string;
|
|
134
|
-
}
|
|
135
|
-
export interface DiscountValidationResult {
|
|
136
|
-
valid: boolean;
|
|
137
|
-
discount_amount?: number;
|
|
138
|
-
discount_type?: 'percentage' | 'fixed_amount' | 'free_shipping';
|
|
139
|
-
discount_value?: number;
|
|
140
|
-
code?: string;
|
|
141
|
-
name?: string;
|
|
142
|
-
message?: string;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Validate a discount code against the current order.
|
|
146
|
-
* Returns the discount amount if valid, or an error message if not.
|
|
147
|
-
*/
|
|
148
|
-
export declare function validateDiscountCode(code: string, subtotal: number, offeringIds?: string[]): Promise<DiscountValidationResult>;
|
|
149
|
-
export interface ProcessorConfig {
|
|
150
|
-
processor: 'stripe' | 'square' | null;
|
|
151
|
-
squareAppId?: string;
|
|
152
|
-
squareLocationId?: string;
|
|
153
|
-
squareEnvironment?: string;
|
|
154
|
-
stripePublishableKey?: string;
|
|
155
|
-
/** Whether shipping is enabled for this project */
|
|
156
|
-
shipping_enabled?: boolean;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Fetch client-side SDK config for the active payment processor.
|
|
160
|
-
* Returns public-safe values (app IDs, location IDs) for SDK initialization.
|
|
161
|
-
*/
|
|
162
|
-
export declare function fetchProcessorConfig(): Promise<ProcessorConfig | null>;
|
|
163
|
-
/**
|
|
164
|
-
* Create a Stripe PaymentIntent for inline card payment (no redirect).
|
|
165
|
-
* Use with Stripe Elements on the frontend to collect and confirm card details directly.
|
|
166
|
-
* The existing payment_intent.succeeded webhook handles marking the sale as paid.
|
|
167
|
-
*/
|
|
168
|
-
export declare function createPaymentIntent(options: CreateCheckoutOptions): Promise<{
|
|
169
|
-
success: boolean;
|
|
170
|
-
clientSecret?: string;
|
|
171
|
-
saleId?: string;
|
|
172
|
-
confirmationNumber?: string;
|
|
173
|
-
error?: string;
|
|
174
|
-
}>;
|
|
175
|
-
/**
|
|
176
|
-
* Create a checkout session for a product or service
|
|
177
|
-
* Supports both Stripe and Square based on project configuration
|
|
178
|
-
*/
|
|
179
|
-
export declare function createCheckoutSession(optionsOrOfferingId: CreateCheckoutOptions | string, legacyOptions?: Omit<CreateCheckoutOptions, 'offeringId'>): Promise<CheckoutResult>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Events polish: calendar links, structured data, honest capacity.
|
|
3
|
-
*
|
|
4
|
-
* - icsForEvent / googleCalendarUrl / createIcsRoute: "Add to calendar"
|
|
5
|
-
* without a third-party service.
|
|
6
|
-
* - EventJsonLd: schema.org/Event emitted from the offering the site already
|
|
7
|
-
* fetched — free rich results.
|
|
8
|
-
* - CapacityBadge: renders from spots_remaining/capacity. Per the QCR
|
|
9
|
-
* oversell incident, the seat count is the ONLY honest sold-out signal
|
|
10
|
-
* (status can stay 'active' during an emergency shutdown), so this badge
|
|
11
|
-
* never derives fullness from status.
|
|
12
|
-
*
|
|
13
|
-
* Server-safe: no hooks, no browser APIs — usable from RSC pages directly.
|
|
14
|
-
*/
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import type { CommerceOffering, CommerceSchedule } from './types';
|
|
17
|
-
export interface IcsEventInput {
|
|
18
|
-
offering: CommerceOffering;
|
|
19
|
-
schedule: CommerceSchedule;
|
|
20
|
-
/** Absolute URL of the event page, for the ICS URL property. */
|
|
21
|
-
url?: string;
|
|
22
|
-
}
|
|
23
|
-
/** Build a single-event .ics document. */
|
|
24
|
-
export declare function icsForEvent({ offering, schedule, url }: IcsEventInput): string;
|
|
25
|
-
/** Google Calendar "add event" URL for the same data. */
|
|
26
|
-
export declare function googleCalendarUrl({ offering, schedule }: IcsEventInput): string;
|
|
27
|
-
/**
|
|
28
|
-
* Route handler factory: app/events/[slug]/calendar.ics/route.ts (or any
|
|
29
|
-
* route) — resolve the event yourself, delegate the response here.
|
|
30
|
-
*/
|
|
31
|
-
export declare function icsResponse(input: IcsEventInput): Response;
|
|
32
|
-
export interface EventJsonLdProps {
|
|
33
|
-
offering: CommerceOffering;
|
|
34
|
-
schedule: CommerceSchedule;
|
|
35
|
-
/** Absolute page URL. */
|
|
36
|
-
url?: string;
|
|
37
|
-
/** Site origin for offer URLs, e.g. https://example.com */
|
|
38
|
-
origin?: string;
|
|
39
|
-
}
|
|
40
|
-
/** schema.org/Event structured data from data the page already fetched. */
|
|
41
|
-
export declare function EventJsonLd({ offering, schedule, url, origin }: EventJsonLdProps): React.JSX.Element;
|
|
42
|
-
export interface CapacityBadgeProps {
|
|
43
|
-
schedule: CommerceSchedule;
|
|
44
|
-
className?: string;
|
|
45
|
-
/** Show "N of M spots left" instead of just "N spots left" when capacity known. */
|
|
46
|
-
showTotal?: boolean;
|
|
47
|
-
/** Below this count the badge gets data-sk-urgency="low-spots". Default 5. */
|
|
48
|
-
lowThreshold?: number;
|
|
49
|
-
labels?: {
|
|
50
|
-
soldOut?: string;
|
|
51
|
-
spotsLeft?: (n: number, total?: number | null) => string;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Honest capacity, styled by the site via data attributes:
|
|
56
|
-
* [data-sk-part="capacity-badge"][data-sk-availability="sold-out" | "open"]
|
|
57
|
-
* [data-sk-urgency="low-spots"]
|
|
58
|
-
* Renders nothing when the schedule doesn't track capacity.
|
|
59
|
-
*/
|
|
60
|
-
export declare function CapacityBadge({ schedule, className, showTotal, lowThreshold, labels, }: CapacityBadgeProps): React.JSX.Element | null;
|
package/dist/commerce/index.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @sonordev/site-kit/commerce
|
|
3
|
-
*
|
|
4
|
-
* Commerce module for displaying products, services, events, and classes
|
|
5
|
-
* with checkout and registration flows.
|
|
6
|
-
*/
|
|
7
|
-
export * from './types';
|
|
8
|
-
export * from './utils';
|
|
9
|
-
export { fetchOfferings, fetchOffering, fetchLatestOffering, fetchProducts, fetchProductsPublic, fetchProductBySlug, fetchCategories, fetchServices, fetchUpcomingEvents, fetchNextEvent, fetchShippingRates, shippingSelection, validateAddress, registerForEvent, createCheckoutSession, createPaymentIntent, fetchActiveProcessor, fetchProcessorConfig, validateDiscountCode, } from './api';
|
|
10
|
-
export type { ShippingAddress, ShippingRate, ValidateAddressResult, CreateCheckoutOptions, CheckoutLineItem, ProcessorConfig, DiscountValidationResult } from './api';
|
|
11
|
-
export { OfferingCard } from './OfferingCard';
|
|
12
|
-
export { OfferingList } from './OfferingList';
|
|
13
|
-
export { EventTile } from './EventTile';
|
|
14
|
-
export { UpcomingEvents } from './UpcomingEvents';
|
|
15
|
-
export { ProductEmbed } from './ProductEmbed';
|
|
16
|
-
export { ProductDetail } from './ProductDetail';
|
|
17
|
-
export { SizeChart } from './SizeChart';
|
|
18
|
-
export { ProductGrid } from './ProductGrid';
|
|
19
|
-
export { ProductPage } from './ProductPage';
|
|
20
|
-
export { EventEmbed } from './EventEmbed';
|
|
21
|
-
export { CheckoutForm } from './CheckoutForm';
|
|
22
|
-
export { EventCheckout } from './EventCheckout';
|
|
23
|
-
export type { EventCheckoutProps } from './EventCheckout';
|
|
24
|
-
export { RegistrationForm } from './RegistrationForm';
|
|
25
|
-
export { CalendarView } from './CalendarView';
|
|
26
|
-
export { EventsAgenda } from './EventsAgenda';
|
|
27
|
-
export type { EventsAgendaProps, AgendaItem } from './EventsAgenda';
|
|
28
|
-
export { EventModal } from './EventModal';
|
|
29
|
-
export { EventCalendar } from './EventCalendar';
|
|
30
|
-
export { EventsWidget } from './EventsWidget';
|
|
31
|
-
export { useEventModal } from './useEventModal';
|
|
32
|
-
export { icsForEvent, icsResponse, googleCalendarUrl, EventJsonLd, CapacityBadge, } from './events-extras';
|
|
33
|
-
export type { IcsEventInput, EventJsonLdProps, CapacityBadgeProps } from './events-extras';
|