@aifeatures/admin-react 0.16.0 → 0.17.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/dist/index.cjs +4 -4
- package/dist/index.d.cts +107 -35
- package/dist/index.d.ts +107 -35
- package/dist/index.js +4 -4
- package/dist/styles.css +1 -1
- package/package.json +13 -14
package/dist/index.d.cts
CHANGED
|
@@ -2961,6 +2961,94 @@ declare function toMinorUnits(major: string | number, currency: string): number
|
|
|
2961
2961
|
*/
|
|
2962
2962
|
declare function toMajorUnits(minor: number, currency: string): number;
|
|
2963
2963
|
|
|
2964
|
+
/**
|
|
2965
|
+
* THE CONVERSION THIS SITE IS JUDGED ON, said in one line.
|
|
2966
|
+
*
|
|
2967
|
+
* A MARKER, not a classification. Every site reports on the same tracked
|
|
2968
|
+
* conversions; this says which one of them is the business's own measure of a
|
|
2969
|
+
* good day, so the Dashboard can lead with it and the conversions table can
|
|
2970
|
+
* lift it out of the list.
|
|
2971
|
+
*
|
|
2972
|
+
* ITS GRAIN IS A GOAL PLUS AN OPTIONAL TARGET, which is the whole reason this
|
|
2973
|
+
* replaced an earlier five-value `SiteGoal` enum. "A form submission" is not
|
|
2974
|
+
* specific enough to be a business's goal once a site has more than one form:
|
|
2975
|
+
* on landingsite.ai the conversion that matters is the form that CREATES A
|
|
2976
|
+
* SITE, and `Form: Submission` aggregates every form on the page. For another
|
|
2977
|
+
* site the same goal means a newsletter sign-up, and for a third the answer is
|
|
2978
|
+
* an order instead. Five archetypes cannot express any of that.
|
|
2979
|
+
*
|
|
2980
|
+
* `target` ABSENT IS A REAL STATE, not a missing one — "this goal, any target".
|
|
2981
|
+
* It has to be, because a specific target is not always knowable: measured
|
|
2982
|
+
* 2026-10-11, 97.3% of sites have no form target recorded at all, since the
|
|
2983
|
+
* instrumentation is newer than the trackers most sites have cached. So a site
|
|
2984
|
+
* is markable from its first day at goal level, and narrowing to one target is
|
|
2985
|
+
* a refinement for the sites that can.
|
|
2986
|
+
*
|
|
2987
|
+
* WHY `label` IS THE HOST'S TO SUPPLY, AND OPTIONAL. The conversions targets
|
|
2988
|
+
* report already resolves a target to a human name where one exists — a form's
|
|
2989
|
+
* current name, else the raw endpoint. Only the host knows which of those it
|
|
2990
|
+
* got, and the difference decides the copy: "Your main conversion is Create a
|
|
2991
|
+
* site" reads as intended, while "Your main conversion is
|
|
2992
|
+
* api.example.com/f/3b2a" is worse than saying nothing specific. So the host
|
|
2993
|
+
* passes `label` ONLY when it holds a name a person wrote, and this component
|
|
2994
|
+
* never has to guess whether a string is a name or a URL.
|
|
2995
|
+
*/
|
|
2996
|
+
interface PrimaryConversion {
|
|
2997
|
+
/**
|
|
2998
|
+
* The tracked goal's name, spelled as the conversions report spells it —
|
|
2999
|
+
* `Form: Submission`, `Contact`, `Outbound Link: Click`, `File Download`,
|
|
3000
|
+
* `Purchase`, `Form: Received`, or a goal the merchant created.
|
|
3001
|
+
*
|
|
3002
|
+
* Deliberately an open string rather than a union. The merchant can create
|
|
3003
|
+
* goals, so a closed set here would be wrong the moment one does.
|
|
3004
|
+
*
|
|
3005
|
+
* THE NAME IS THE REPORT'S OWN KEY, not a label beside an id: "matching is
|
|
3006
|
+
* query-time and the display name is the key reports are keyed by", and a
|
|
3007
|
+
* conversions row carries no id at all. So matching on it is not a shortcut
|
|
3008
|
+
* — it is the only join the report offers.
|
|
3009
|
+
*
|
|
3010
|
+
* WHICH MAKES A BUILT-IN SAFE AND A CUSTOM GOAL NOT, and a host persisting
|
|
3011
|
+
* this needs to know the difference. The six built-ins "are not rows and
|
|
3012
|
+
* cannot be renamed or deleted", so their names are permanent. A goal the
|
|
3013
|
+
* merchant created can be renamed through `PATCH /analytics/goals/{id}`,
|
|
3014
|
+
* which keeps its id and relabels every historical report — so a stored
|
|
3015
|
+
* marker naming the old one stops matching any row, and because goal names
|
|
3016
|
+
* are unique per site rather than reserved, a NEW goal can later take the
|
|
3017
|
+
* freed name and inherit the mark silently.
|
|
3018
|
+
*
|
|
3019
|
+
* Until the conversions report exposes a goal id, a host should therefore
|
|
3020
|
+
* either mark only built-ins, or re-validate a custom marker against the
|
|
3021
|
+
* current conversions and drop it when it no longer matches. Dropping is
|
|
3022
|
+
* safe here: an unset marker renders nothing by design.
|
|
3023
|
+
*/
|
|
3024
|
+
goal: string;
|
|
3025
|
+
/**
|
|
3026
|
+
* Whether this is one of the six BUILT-IN goals, as the conversions row
|
|
3027
|
+
* reports it.
|
|
3028
|
+
*
|
|
3029
|
+
* It decides whether curated copy may be used at all, and it has to, because
|
|
3030
|
+
* a name is not proof of a built-in. The goals API shipped hours before
|
|
3031
|
+
* these names were reserved, so a merchant could already have created a
|
|
3032
|
+
* PAGEVIEW goal called `Purchase` — and when that happens the API keeps
|
|
3033
|
+
* theirs and drops the derived one, reporting `implicit: false`. Trusting
|
|
3034
|
+
* the name alone would tell that merchant "This site is set up to sell"
|
|
3035
|
+
* about a goal that counts visits to `/thanks`.
|
|
3036
|
+
*
|
|
3037
|
+
* Absent means "not established", and curated copy is withheld rather than
|
|
3038
|
+
* guessed: a host that forgets this gets the generic line, which is less
|
|
3039
|
+
* specific but never wrong. The opposite default would be wrong exactly
|
|
3040
|
+
* where it is hardest to notice.
|
|
3041
|
+
*/
|
|
3042
|
+
implicit?: boolean;
|
|
3043
|
+
/** One target under that goal, or null/undefined for "any target". */
|
|
3044
|
+
target?: string | null;
|
|
3045
|
+
/**
|
|
3046
|
+
* A human name for what is marked, when the host has one. Omit it rather
|
|
3047
|
+
* than passing an endpoint or a URL — see the note above.
|
|
3048
|
+
*/
|
|
3049
|
+
label?: string;
|
|
3050
|
+
}
|
|
3051
|
+
|
|
2964
3052
|
interface AnalyticsViewProps {
|
|
2965
3053
|
/**
|
|
2966
3054
|
* Filters, when the HOST wants to own them — to put them in its URL, say.
|
|
@@ -2976,6 +3064,16 @@ interface AnalyticsViewProps {
|
|
|
2976
3064
|
/** Bump to force a refetch, matching the other views. */
|
|
2977
3065
|
refreshKey?: number;
|
|
2978
3066
|
onBackToWebsite?: () => void;
|
|
3067
|
+
/**
|
|
3068
|
+
* The conversion this business is judged on, so its row in the conversions
|
|
3069
|
+
* table reads as the one that matters.
|
|
3070
|
+
*
|
|
3071
|
+
* THE SAME SHAPE THE DASHBOARD TAKES, so a host passes one object for one
|
|
3072
|
+
* fact rather than two differently-shaped things. This view uses only
|
|
3073
|
+
* `goal`: it has no headline to name a target in, and the table has one row
|
|
3074
|
+
* per goal.
|
|
3075
|
+
*/
|
|
3076
|
+
primaryConversion?: PrimaryConversion | null;
|
|
2979
3077
|
className?: string;
|
|
2980
3078
|
/**
|
|
2981
3079
|
* Publish state, supplied by the host: aifeatures has none of its own.
|
|
@@ -3005,37 +3103,7 @@ interface AnalyticsViewProps {
|
|
|
3005
3103
|
* `published === false` overrides a collecting status: an unpublished site
|
|
3006
3104
|
* with nothing ever seen is the first row above, not the third.
|
|
3007
3105
|
*/
|
|
3008
|
-
declare function AnalyticsView({ filters: filtersProp, onFiltersChange, refreshKey, onBackToWebsite, className, published, lastPublishedAt, }: AnalyticsViewProps): react_jsx_runtime.JSX.Element;
|
|
3009
|
-
|
|
3010
|
-
/**
|
|
3011
|
-
* What this site is trying to get its visitors to do, said in one line.
|
|
3012
|
-
*
|
|
3013
|
-
* The site builder already decides this: picking a conversion mechanism is a
|
|
3014
|
-
* gated first step of every build — form, external link, phone-first, or
|
|
3015
|
-
* native payments — and the CTA it writes is the artifact of that decision.
|
|
3016
|
-
* This names it back to the owner.
|
|
3017
|
-
*
|
|
3018
|
-
* The vocabulary deliberately matches the conversion goals that already
|
|
3019
|
-
* report on these events, so the headline and the numbers under it describe
|
|
3020
|
-
* the same thing in the same words rather than two vocabularies for one site.
|
|
3021
|
-
*
|
|
3022
|
-
* WHATSAPP IS ITS OWN GOAL, not a kind of `outbound`, because the fleet says
|
|
3023
|
-
* so: measured over the 30 days to 2026-10-11, a WhatsApp link is the
|
|
3024
|
-
* dominant conversion for 179 sites — 11.7% of every site with any
|
|
3025
|
-
* conversion at all, and more sites than every named booking platform
|
|
3026
|
-
* combined (Fresha, Square, SkyTab, Toast, HotDoc, Clover and SpotOn are 1-5
|
|
3027
|
-
* sites each). Folding it into `outbound` would tell 179 merchants their site
|
|
3028
|
-
* is "set up to send visitors on to book with you", which is not what a
|
|
3029
|
-
* message thread is. It is not generalised to "messaging" either: Telegram is
|
|
3030
|
-
* 2 sites and Messenger, Signal and `sms:` are none, so a broader word would
|
|
3031
|
-
* only make the line vaguer for the ones it actually describes.
|
|
3032
|
-
*
|
|
3033
|
-
* `unknown` renders NOTHING. The derivation is lazy and improvable, so a site
|
|
3034
|
-
* it cannot settle yet is normal rather than broken — and naming the wrong
|
|
3035
|
-
* goal on a merchant's own dashboard is worse than naming none. An
|
|
3036
|
-
* undetermined goal costs this line, never the screen.
|
|
3037
|
-
*/
|
|
3038
|
-
type SiteGoal = "calls" | "enquiries" | "sales" | "whatsapp" | "outbound" | "unknown";
|
|
3106
|
+
declare function AnalyticsView({ filters: filtersProp, onFiltersChange, refreshKey, onBackToWebsite, primaryConversion, className, published, lastPublishedAt, }: AnalyticsViewProps): react_jsx_runtime.JSX.Element;
|
|
3039
3107
|
|
|
3040
3108
|
interface DashboardViewProps {
|
|
3041
3109
|
/** Bumped by the host after any turn that touched business data. */
|
|
@@ -3046,8 +3114,12 @@ interface DashboardViewProps {
|
|
|
3046
3114
|
* Facts the package cannot know, supplied by the host — the same contract
|
|
3047
3115
|
* the analytics view already uses.
|
|
3048
3116
|
*/
|
|
3049
|
-
/**
|
|
3050
|
-
|
|
3117
|
+
/**
|
|
3118
|
+
* Which tracked conversion this business is judged on — a goal, optionally
|
|
3119
|
+
* narrowed to one target. Absent renders nothing, which is the state of a
|
|
3120
|
+
* site nobody has marked yet.
|
|
3121
|
+
*/
|
|
3122
|
+
primaryConversion?: PrimaryConversion | null;
|
|
3051
3123
|
/**
|
|
3052
3124
|
* Host callback to change the active surface. Without it the storefront
|
|
3053
3125
|
* entries render nothing, because a panel that claims to lead somewhere and
|
|
@@ -3081,6 +3153,6 @@ interface DashboardViewProps {
|
|
|
3081
3153
|
* own call and fails alone. Nothing here claims per-panel isolation it does
|
|
3082
3154
|
* not have.
|
|
3083
3155
|
*/
|
|
3084
|
-
declare function DashboardView({ refreshKey, onBackToWebsite,
|
|
3156
|
+
declare function DashboardView({ refreshKey, onBackToWebsite, primaryConversion, onOpenSurface, needsPaidPlan, onUpgradePlan, onConnectStripe, }: DashboardViewProps): react_jsx_runtime.JSX.Element;
|
|
3085
3157
|
|
|
3086
|
-
export { type AdjustInventoryInput, type AifeaturesApiClient, AifeaturesApiError, type AifeaturesContextValue, AifeaturesProvider, type AifeaturesProviderProps, type AnalyticsBreakdown, type AnalyticsBreakdownName, type AnalyticsBreakdownRow, type AnalyticsChannelRow, type AnalyticsChannels, type AnalyticsConversionRow, type AnalyticsConversions, type AnalyticsFilter, type AnalyticsFilterDimension, type AnalyticsPeriod, type AnalyticsRealtime, type AnalyticsSourced, type AnalyticsStatus, type AnalyticsSummary, type AnalyticsSummaryData, type AnalyticsSummaryMetrics, type AnalyticsTimeseries, type AnalyticsTimeseriesRow, AnalyticsView, type AnalyticsViewProps, type ApiError, type Attachment, type BusinessSummary, type BusinessVisitors, type CreateEventDestinationInput, type CreateFormInput, type CreateOptionInput, type CreateProductInput, type CreatePromoInput, type CreateVariantInput, type Customer, type CustomerAddress, CustomerDetail, type CustomerDetail$1 as CustomerDetailData, type CustomerDetailProps, CustomersList, type CustomersListProps, type CustomersListResponse, DashboardView, type DashboardViewProps, type EmailDelivery, type EmailSideStatus, type EventDeliveriesListResponse, type EventDelivery, type EventDestination, type EventDestinationSecretResponse, type EventDestinationsListResponse, type Form, FormSettings, type FormSettingsProps, FormSubmissions, type FormSubmissionsProps, FormsDashboard, type FormsDashboardProps, FormsList, type FormsListProps, type FormsListResponse, type GetBusinessSummaryOptions, type GetCustomersOptions, type GetInvoicesOptions, type GetOrdersOptions, type GetPeopleOptions, type GetProductsOptions, type GetSubmissionsOptions, type GetSubscriptionsOptions, type Invoice, type InvoiceAggregates, type InvoiceBillTo, type InvoiceDeliveryState, InvoiceDetail, type InvoiceDetailProps, type InvoiceLabel, InvoiceLabelBadge, type InvoiceLineItem, type InvoicePreview, type InvoiceSettings, InvoicesList, type InvoicesListProps, InvoicesView, type InvoicesViewProps, LeadsView, type LeadsViewProps, type LowStockProduct, MAX_ANALYTICS_FILTERS, MAX_ANALYTICS_FILTER_VALUES, type NeedsAttentionItem, type NeedsAttentionType, type Order, OrderDetail, type OrderDetailProps, type OrderStatus, OrderStatusBadge, OrdersList, type OrdersListProps, OrdersView, type OrdersViewProps, type PaginatedInvoices, type PaginatedOrders, type PaginatedSubmissions, type PaginatedSubscriptions, PaymentsDashboard, type PaymentsDashboardProps, PaymentsSetup, type PaymentsSetupProps, type PaymentsStatus, type PaymentsStatusReason, type PaymentsStatusResponse, type PeopleListResponse, type Person, type PersonDetail, type PersonOrder, type PersonSource, type PersonSubmission, type Product, type ProductDetail, type ProductFulfillment, type ProductFulfillmentType, type ProductOption, ProductSettings, type ProductSettingsProps, type ProductStats, type ProductVariant, ProductsList, type ProductsListProps, type ProductsListResponse, ProductsView, type ProductsViewProps, type Promo, type PromosListResponse, PromosPanel, REALTIME_FAILURES_BEFORE_ERROR, REALTIME_POLL_MS, type RefundRequest, type ReportSlot, RetainerStatusBadge, RetainersPanel, type RetainersPanelProps, type RevenueCurrencyTotal, type RevenuePeriod, type SetInventoryInput, type SetOrderFulfillmentInput, type SettledRevenue, type
|
|
3158
|
+
export { type AdjustInventoryInput, type AifeaturesApiClient, AifeaturesApiError, type AifeaturesContextValue, AifeaturesProvider, type AifeaturesProviderProps, type AnalyticsBreakdown, type AnalyticsBreakdownName, type AnalyticsBreakdownRow, type AnalyticsChannelRow, type AnalyticsChannels, type AnalyticsConversionRow, type AnalyticsConversions, type AnalyticsFilter, type AnalyticsFilterDimension, type AnalyticsPeriod, type AnalyticsRealtime, type AnalyticsSourced, type AnalyticsStatus, type AnalyticsSummary, type AnalyticsSummaryData, type AnalyticsSummaryMetrics, type AnalyticsTimeseries, type AnalyticsTimeseriesRow, AnalyticsView, type AnalyticsViewProps, type ApiError, type Attachment, type BusinessSummary, type BusinessVisitors, type CreateEventDestinationInput, type CreateFormInput, type CreateOptionInput, type CreateProductInput, type CreatePromoInput, type CreateVariantInput, type Customer, type CustomerAddress, CustomerDetail, type CustomerDetail$1 as CustomerDetailData, type CustomerDetailProps, CustomersList, type CustomersListProps, type CustomersListResponse, DashboardView, type DashboardViewProps, type EmailDelivery, type EmailSideStatus, type EventDeliveriesListResponse, type EventDelivery, type EventDestination, type EventDestinationSecretResponse, type EventDestinationsListResponse, type Form, FormSettings, type FormSettingsProps, FormSubmissions, type FormSubmissionsProps, FormsDashboard, type FormsDashboardProps, FormsList, type FormsListProps, type FormsListResponse, type GetBusinessSummaryOptions, type GetCustomersOptions, type GetInvoicesOptions, type GetOrdersOptions, type GetPeopleOptions, type GetProductsOptions, type GetSubmissionsOptions, type GetSubscriptionsOptions, type Invoice, type InvoiceAggregates, type InvoiceBillTo, type InvoiceDeliveryState, InvoiceDetail, type InvoiceDetailProps, type InvoiceLabel, InvoiceLabelBadge, type InvoiceLineItem, type InvoicePreview, type InvoiceSettings, InvoicesList, type InvoicesListProps, InvoicesView, type InvoicesViewProps, LeadsView, type LeadsViewProps, type LowStockProduct, MAX_ANALYTICS_FILTERS, MAX_ANALYTICS_FILTER_VALUES, type NeedsAttentionItem, type NeedsAttentionType, type Order, OrderDetail, type OrderDetailProps, type OrderStatus, OrderStatusBadge, OrdersList, type OrdersListProps, OrdersView, type OrdersViewProps, type PaginatedInvoices, type PaginatedOrders, type PaginatedSubmissions, type PaginatedSubscriptions, PaymentsDashboard, type PaymentsDashboardProps, PaymentsSetup, type PaymentsSetupProps, type PaymentsStatus, type PaymentsStatusReason, type PaymentsStatusResponse, type PeopleListResponse, type Person, type PersonDetail, type PersonOrder, type PersonSource, type PersonSubmission, type PrimaryConversion, type Product, type ProductDetail, type ProductFulfillment, type ProductFulfillmentType, type ProductOption, ProductSettings, type ProductSettingsProps, type ProductStats, type ProductVariant, ProductsList, type ProductsListProps, type ProductsListResponse, ProductsView, type ProductsViewProps, type Promo, type PromosListResponse, PromosPanel, REALTIME_FAILURES_BEFORE_ERROR, REALTIME_POLL_MS, type RefundRequest, type ReportSlot, RetainerStatusBadge, RetainersPanel, type RetainersPanelProps, type RevenueCurrencyTotal, type RevenuePeriod, type SetInventoryInput, type SetOrderFulfillmentInput, type SettledRevenue, type Submission, SubmissionDetail, type SubmissionDetailProps, type SubmissionMetadata, type Subscription, SubscriptionsView, type SubscriptionsViewProps, type UpdateEventDestinationInput, type UpdateFormInput, type UpdateOptionInput, type UpdateProductInput, type UpdateVariantInput, type UseAnalyticsOptions, type UseAnalyticsReturn, type UseBusinessSummaryOptions, type UseBusinessSummaryReturn, type UseCustomersOptions, type UseCustomersReturn, type UseEventDestinationsReturn, type UseFormsReturn, type UseInvoicesOptions, type UseInvoicesReturn, type UseOrdersOptions, type UseOrdersReturn, type UsePaymentsStatusReturn, type UsePeopleOptions, type UsePeopleReturn, type UsePersonOptions, type UsePersonReturn, type UseProductsOptions, type UseProductsReturn, type UseRealtimeVisitorsReturn, type UseSubmissionsOptions, type UseSubmissionsReturn, type UseSubscriptionsOptions, type UseSubscriptionsReturn, type VariantInventory, type VariantOptionValue, VariantsEditor, type VariantsEditorProps, ViewShell, type ViewShellProps, WebhookDeliveries, type WebhookDeliveriesProps, WebhookSettings, type WebhookSettingsProps, chargedTotal, createApiClient, formatPrice, isZeroDecimalCurrency, toMajorUnits, toMinorUnits, useAifeaturesContext as useAifeatures, useAifeaturesContext, useAnalytics, useBusinessSummary, useCustomers, useEventDestinations, useForms, useInvoices, useOrders, usePaymentsStatus, usePeople, usePerson, useProducts, useRealtimeVisitors, useRetainers, useSubmissions, useSubscriptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -2961,6 +2961,94 @@ declare function toMinorUnits(major: string | number, currency: string): number
|
|
|
2961
2961
|
*/
|
|
2962
2962
|
declare function toMajorUnits(minor: number, currency: string): number;
|
|
2963
2963
|
|
|
2964
|
+
/**
|
|
2965
|
+
* THE CONVERSION THIS SITE IS JUDGED ON, said in one line.
|
|
2966
|
+
*
|
|
2967
|
+
* A MARKER, not a classification. Every site reports on the same tracked
|
|
2968
|
+
* conversions; this says which one of them is the business's own measure of a
|
|
2969
|
+
* good day, so the Dashboard can lead with it and the conversions table can
|
|
2970
|
+
* lift it out of the list.
|
|
2971
|
+
*
|
|
2972
|
+
* ITS GRAIN IS A GOAL PLUS AN OPTIONAL TARGET, which is the whole reason this
|
|
2973
|
+
* replaced an earlier five-value `SiteGoal` enum. "A form submission" is not
|
|
2974
|
+
* specific enough to be a business's goal once a site has more than one form:
|
|
2975
|
+
* on landingsite.ai the conversion that matters is the form that CREATES A
|
|
2976
|
+
* SITE, and `Form: Submission` aggregates every form on the page. For another
|
|
2977
|
+
* site the same goal means a newsletter sign-up, and for a third the answer is
|
|
2978
|
+
* an order instead. Five archetypes cannot express any of that.
|
|
2979
|
+
*
|
|
2980
|
+
* `target` ABSENT IS A REAL STATE, not a missing one — "this goal, any target".
|
|
2981
|
+
* It has to be, because a specific target is not always knowable: measured
|
|
2982
|
+
* 2026-10-11, 97.3% of sites have no form target recorded at all, since the
|
|
2983
|
+
* instrumentation is newer than the trackers most sites have cached. So a site
|
|
2984
|
+
* is markable from its first day at goal level, and narrowing to one target is
|
|
2985
|
+
* a refinement for the sites that can.
|
|
2986
|
+
*
|
|
2987
|
+
* WHY `label` IS THE HOST'S TO SUPPLY, AND OPTIONAL. The conversions targets
|
|
2988
|
+
* report already resolves a target to a human name where one exists — a form's
|
|
2989
|
+
* current name, else the raw endpoint. Only the host knows which of those it
|
|
2990
|
+
* got, and the difference decides the copy: "Your main conversion is Create a
|
|
2991
|
+
* site" reads as intended, while "Your main conversion is
|
|
2992
|
+
* api.example.com/f/3b2a" is worse than saying nothing specific. So the host
|
|
2993
|
+
* passes `label` ONLY when it holds a name a person wrote, and this component
|
|
2994
|
+
* never has to guess whether a string is a name or a URL.
|
|
2995
|
+
*/
|
|
2996
|
+
interface PrimaryConversion {
|
|
2997
|
+
/**
|
|
2998
|
+
* The tracked goal's name, spelled as the conversions report spells it —
|
|
2999
|
+
* `Form: Submission`, `Contact`, `Outbound Link: Click`, `File Download`,
|
|
3000
|
+
* `Purchase`, `Form: Received`, or a goal the merchant created.
|
|
3001
|
+
*
|
|
3002
|
+
* Deliberately an open string rather than a union. The merchant can create
|
|
3003
|
+
* goals, so a closed set here would be wrong the moment one does.
|
|
3004
|
+
*
|
|
3005
|
+
* THE NAME IS THE REPORT'S OWN KEY, not a label beside an id: "matching is
|
|
3006
|
+
* query-time and the display name is the key reports are keyed by", and a
|
|
3007
|
+
* conversions row carries no id at all. So matching on it is not a shortcut
|
|
3008
|
+
* — it is the only join the report offers.
|
|
3009
|
+
*
|
|
3010
|
+
* WHICH MAKES A BUILT-IN SAFE AND A CUSTOM GOAL NOT, and a host persisting
|
|
3011
|
+
* this needs to know the difference. The six built-ins "are not rows and
|
|
3012
|
+
* cannot be renamed or deleted", so their names are permanent. A goal the
|
|
3013
|
+
* merchant created can be renamed through `PATCH /analytics/goals/{id}`,
|
|
3014
|
+
* which keeps its id and relabels every historical report — so a stored
|
|
3015
|
+
* marker naming the old one stops matching any row, and because goal names
|
|
3016
|
+
* are unique per site rather than reserved, a NEW goal can later take the
|
|
3017
|
+
* freed name and inherit the mark silently.
|
|
3018
|
+
*
|
|
3019
|
+
* Until the conversions report exposes a goal id, a host should therefore
|
|
3020
|
+
* either mark only built-ins, or re-validate a custom marker against the
|
|
3021
|
+
* current conversions and drop it when it no longer matches. Dropping is
|
|
3022
|
+
* safe here: an unset marker renders nothing by design.
|
|
3023
|
+
*/
|
|
3024
|
+
goal: string;
|
|
3025
|
+
/**
|
|
3026
|
+
* Whether this is one of the six BUILT-IN goals, as the conversions row
|
|
3027
|
+
* reports it.
|
|
3028
|
+
*
|
|
3029
|
+
* It decides whether curated copy may be used at all, and it has to, because
|
|
3030
|
+
* a name is not proof of a built-in. The goals API shipped hours before
|
|
3031
|
+
* these names were reserved, so a merchant could already have created a
|
|
3032
|
+
* PAGEVIEW goal called `Purchase` — and when that happens the API keeps
|
|
3033
|
+
* theirs and drops the derived one, reporting `implicit: false`. Trusting
|
|
3034
|
+
* the name alone would tell that merchant "This site is set up to sell"
|
|
3035
|
+
* about a goal that counts visits to `/thanks`.
|
|
3036
|
+
*
|
|
3037
|
+
* Absent means "not established", and curated copy is withheld rather than
|
|
3038
|
+
* guessed: a host that forgets this gets the generic line, which is less
|
|
3039
|
+
* specific but never wrong. The opposite default would be wrong exactly
|
|
3040
|
+
* where it is hardest to notice.
|
|
3041
|
+
*/
|
|
3042
|
+
implicit?: boolean;
|
|
3043
|
+
/** One target under that goal, or null/undefined for "any target". */
|
|
3044
|
+
target?: string | null;
|
|
3045
|
+
/**
|
|
3046
|
+
* A human name for what is marked, when the host has one. Omit it rather
|
|
3047
|
+
* than passing an endpoint or a URL — see the note above.
|
|
3048
|
+
*/
|
|
3049
|
+
label?: string;
|
|
3050
|
+
}
|
|
3051
|
+
|
|
2964
3052
|
interface AnalyticsViewProps {
|
|
2965
3053
|
/**
|
|
2966
3054
|
* Filters, when the HOST wants to own them — to put them in its URL, say.
|
|
@@ -2976,6 +3064,16 @@ interface AnalyticsViewProps {
|
|
|
2976
3064
|
/** Bump to force a refetch, matching the other views. */
|
|
2977
3065
|
refreshKey?: number;
|
|
2978
3066
|
onBackToWebsite?: () => void;
|
|
3067
|
+
/**
|
|
3068
|
+
* The conversion this business is judged on, so its row in the conversions
|
|
3069
|
+
* table reads as the one that matters.
|
|
3070
|
+
*
|
|
3071
|
+
* THE SAME SHAPE THE DASHBOARD TAKES, so a host passes one object for one
|
|
3072
|
+
* fact rather than two differently-shaped things. This view uses only
|
|
3073
|
+
* `goal`: it has no headline to name a target in, and the table has one row
|
|
3074
|
+
* per goal.
|
|
3075
|
+
*/
|
|
3076
|
+
primaryConversion?: PrimaryConversion | null;
|
|
2979
3077
|
className?: string;
|
|
2980
3078
|
/**
|
|
2981
3079
|
* Publish state, supplied by the host: aifeatures has none of its own.
|
|
@@ -3005,37 +3103,7 @@ interface AnalyticsViewProps {
|
|
|
3005
3103
|
* `published === false` overrides a collecting status: an unpublished site
|
|
3006
3104
|
* with nothing ever seen is the first row above, not the third.
|
|
3007
3105
|
*/
|
|
3008
|
-
declare function AnalyticsView({ filters: filtersProp, onFiltersChange, refreshKey, onBackToWebsite, className, published, lastPublishedAt, }: AnalyticsViewProps): react_jsx_runtime.JSX.Element;
|
|
3009
|
-
|
|
3010
|
-
/**
|
|
3011
|
-
* What this site is trying to get its visitors to do, said in one line.
|
|
3012
|
-
*
|
|
3013
|
-
* The site builder already decides this: picking a conversion mechanism is a
|
|
3014
|
-
* gated first step of every build — form, external link, phone-first, or
|
|
3015
|
-
* native payments — and the CTA it writes is the artifact of that decision.
|
|
3016
|
-
* This names it back to the owner.
|
|
3017
|
-
*
|
|
3018
|
-
* The vocabulary deliberately matches the conversion goals that already
|
|
3019
|
-
* report on these events, so the headline and the numbers under it describe
|
|
3020
|
-
* the same thing in the same words rather than two vocabularies for one site.
|
|
3021
|
-
*
|
|
3022
|
-
* WHATSAPP IS ITS OWN GOAL, not a kind of `outbound`, because the fleet says
|
|
3023
|
-
* so: measured over the 30 days to 2026-10-11, a WhatsApp link is the
|
|
3024
|
-
* dominant conversion for 179 sites — 11.7% of every site with any
|
|
3025
|
-
* conversion at all, and more sites than every named booking platform
|
|
3026
|
-
* combined (Fresha, Square, SkyTab, Toast, HotDoc, Clover and SpotOn are 1-5
|
|
3027
|
-
* sites each). Folding it into `outbound` would tell 179 merchants their site
|
|
3028
|
-
* is "set up to send visitors on to book with you", which is not what a
|
|
3029
|
-
* message thread is. It is not generalised to "messaging" either: Telegram is
|
|
3030
|
-
* 2 sites and Messenger, Signal and `sms:` are none, so a broader word would
|
|
3031
|
-
* only make the line vaguer for the ones it actually describes.
|
|
3032
|
-
*
|
|
3033
|
-
* `unknown` renders NOTHING. The derivation is lazy and improvable, so a site
|
|
3034
|
-
* it cannot settle yet is normal rather than broken — and naming the wrong
|
|
3035
|
-
* goal on a merchant's own dashboard is worse than naming none. An
|
|
3036
|
-
* undetermined goal costs this line, never the screen.
|
|
3037
|
-
*/
|
|
3038
|
-
type SiteGoal = "calls" | "enquiries" | "sales" | "whatsapp" | "outbound" | "unknown";
|
|
3106
|
+
declare function AnalyticsView({ filters: filtersProp, onFiltersChange, refreshKey, onBackToWebsite, primaryConversion, className, published, lastPublishedAt, }: AnalyticsViewProps): react_jsx_runtime.JSX.Element;
|
|
3039
3107
|
|
|
3040
3108
|
interface DashboardViewProps {
|
|
3041
3109
|
/** Bumped by the host after any turn that touched business data. */
|
|
@@ -3046,8 +3114,12 @@ interface DashboardViewProps {
|
|
|
3046
3114
|
* Facts the package cannot know, supplied by the host — the same contract
|
|
3047
3115
|
* the analytics view already uses.
|
|
3048
3116
|
*/
|
|
3049
|
-
/**
|
|
3050
|
-
|
|
3117
|
+
/**
|
|
3118
|
+
* Which tracked conversion this business is judged on — a goal, optionally
|
|
3119
|
+
* narrowed to one target. Absent renders nothing, which is the state of a
|
|
3120
|
+
* site nobody has marked yet.
|
|
3121
|
+
*/
|
|
3122
|
+
primaryConversion?: PrimaryConversion | null;
|
|
3051
3123
|
/**
|
|
3052
3124
|
* Host callback to change the active surface. Without it the storefront
|
|
3053
3125
|
* entries render nothing, because a panel that claims to lead somewhere and
|
|
@@ -3081,6 +3153,6 @@ interface DashboardViewProps {
|
|
|
3081
3153
|
* own call and fails alone. Nothing here claims per-panel isolation it does
|
|
3082
3154
|
* not have.
|
|
3083
3155
|
*/
|
|
3084
|
-
declare function DashboardView({ refreshKey, onBackToWebsite,
|
|
3156
|
+
declare function DashboardView({ refreshKey, onBackToWebsite, primaryConversion, onOpenSurface, needsPaidPlan, onUpgradePlan, onConnectStripe, }: DashboardViewProps): react_jsx_runtime.JSX.Element;
|
|
3085
3157
|
|
|
3086
|
-
export { type AdjustInventoryInput, type AifeaturesApiClient, AifeaturesApiError, type AifeaturesContextValue, AifeaturesProvider, type AifeaturesProviderProps, type AnalyticsBreakdown, type AnalyticsBreakdownName, type AnalyticsBreakdownRow, type AnalyticsChannelRow, type AnalyticsChannels, type AnalyticsConversionRow, type AnalyticsConversions, type AnalyticsFilter, type AnalyticsFilterDimension, type AnalyticsPeriod, type AnalyticsRealtime, type AnalyticsSourced, type AnalyticsStatus, type AnalyticsSummary, type AnalyticsSummaryData, type AnalyticsSummaryMetrics, type AnalyticsTimeseries, type AnalyticsTimeseriesRow, AnalyticsView, type AnalyticsViewProps, type ApiError, type Attachment, type BusinessSummary, type BusinessVisitors, type CreateEventDestinationInput, type CreateFormInput, type CreateOptionInput, type CreateProductInput, type CreatePromoInput, type CreateVariantInput, type Customer, type CustomerAddress, CustomerDetail, type CustomerDetail$1 as CustomerDetailData, type CustomerDetailProps, CustomersList, type CustomersListProps, type CustomersListResponse, DashboardView, type DashboardViewProps, type EmailDelivery, type EmailSideStatus, type EventDeliveriesListResponse, type EventDelivery, type EventDestination, type EventDestinationSecretResponse, type EventDestinationsListResponse, type Form, FormSettings, type FormSettingsProps, FormSubmissions, type FormSubmissionsProps, FormsDashboard, type FormsDashboardProps, FormsList, type FormsListProps, type FormsListResponse, type GetBusinessSummaryOptions, type GetCustomersOptions, type GetInvoicesOptions, type GetOrdersOptions, type GetPeopleOptions, type GetProductsOptions, type GetSubmissionsOptions, type GetSubscriptionsOptions, type Invoice, type InvoiceAggregates, type InvoiceBillTo, type InvoiceDeliveryState, InvoiceDetail, type InvoiceDetailProps, type InvoiceLabel, InvoiceLabelBadge, type InvoiceLineItem, type InvoicePreview, type InvoiceSettings, InvoicesList, type InvoicesListProps, InvoicesView, type InvoicesViewProps, LeadsView, type LeadsViewProps, type LowStockProduct, MAX_ANALYTICS_FILTERS, MAX_ANALYTICS_FILTER_VALUES, type NeedsAttentionItem, type NeedsAttentionType, type Order, OrderDetail, type OrderDetailProps, type OrderStatus, OrderStatusBadge, OrdersList, type OrdersListProps, OrdersView, type OrdersViewProps, type PaginatedInvoices, type PaginatedOrders, type PaginatedSubmissions, type PaginatedSubscriptions, PaymentsDashboard, type PaymentsDashboardProps, PaymentsSetup, type PaymentsSetupProps, type PaymentsStatus, type PaymentsStatusReason, type PaymentsStatusResponse, type PeopleListResponse, type Person, type PersonDetail, type PersonOrder, type PersonSource, type PersonSubmission, type Product, type ProductDetail, type ProductFulfillment, type ProductFulfillmentType, type ProductOption, ProductSettings, type ProductSettingsProps, type ProductStats, type ProductVariant, ProductsList, type ProductsListProps, type ProductsListResponse, ProductsView, type ProductsViewProps, type Promo, type PromosListResponse, PromosPanel, REALTIME_FAILURES_BEFORE_ERROR, REALTIME_POLL_MS, type RefundRequest, type ReportSlot, RetainerStatusBadge, RetainersPanel, type RetainersPanelProps, type RevenueCurrencyTotal, type RevenuePeriod, type SetInventoryInput, type SetOrderFulfillmentInput, type SettledRevenue, type
|
|
3158
|
+
export { type AdjustInventoryInput, type AifeaturesApiClient, AifeaturesApiError, type AifeaturesContextValue, AifeaturesProvider, type AifeaturesProviderProps, type AnalyticsBreakdown, type AnalyticsBreakdownName, type AnalyticsBreakdownRow, type AnalyticsChannelRow, type AnalyticsChannels, type AnalyticsConversionRow, type AnalyticsConversions, type AnalyticsFilter, type AnalyticsFilterDimension, type AnalyticsPeriod, type AnalyticsRealtime, type AnalyticsSourced, type AnalyticsStatus, type AnalyticsSummary, type AnalyticsSummaryData, type AnalyticsSummaryMetrics, type AnalyticsTimeseries, type AnalyticsTimeseriesRow, AnalyticsView, type AnalyticsViewProps, type ApiError, type Attachment, type BusinessSummary, type BusinessVisitors, type CreateEventDestinationInput, type CreateFormInput, type CreateOptionInput, type CreateProductInput, type CreatePromoInput, type CreateVariantInput, type Customer, type CustomerAddress, CustomerDetail, type CustomerDetail$1 as CustomerDetailData, type CustomerDetailProps, CustomersList, type CustomersListProps, type CustomersListResponse, DashboardView, type DashboardViewProps, type EmailDelivery, type EmailSideStatus, type EventDeliveriesListResponse, type EventDelivery, type EventDestination, type EventDestinationSecretResponse, type EventDestinationsListResponse, type Form, FormSettings, type FormSettingsProps, FormSubmissions, type FormSubmissionsProps, FormsDashboard, type FormsDashboardProps, FormsList, type FormsListProps, type FormsListResponse, type GetBusinessSummaryOptions, type GetCustomersOptions, type GetInvoicesOptions, type GetOrdersOptions, type GetPeopleOptions, type GetProductsOptions, type GetSubmissionsOptions, type GetSubscriptionsOptions, type Invoice, type InvoiceAggregates, type InvoiceBillTo, type InvoiceDeliveryState, InvoiceDetail, type InvoiceDetailProps, type InvoiceLabel, InvoiceLabelBadge, type InvoiceLineItem, type InvoicePreview, type InvoiceSettings, InvoicesList, type InvoicesListProps, InvoicesView, type InvoicesViewProps, LeadsView, type LeadsViewProps, type LowStockProduct, MAX_ANALYTICS_FILTERS, MAX_ANALYTICS_FILTER_VALUES, type NeedsAttentionItem, type NeedsAttentionType, type Order, OrderDetail, type OrderDetailProps, type OrderStatus, OrderStatusBadge, OrdersList, type OrdersListProps, OrdersView, type OrdersViewProps, type PaginatedInvoices, type PaginatedOrders, type PaginatedSubmissions, type PaginatedSubscriptions, PaymentsDashboard, type PaymentsDashboardProps, PaymentsSetup, type PaymentsSetupProps, type PaymentsStatus, type PaymentsStatusReason, type PaymentsStatusResponse, type PeopleListResponse, type Person, type PersonDetail, type PersonOrder, type PersonSource, type PersonSubmission, type PrimaryConversion, type Product, type ProductDetail, type ProductFulfillment, type ProductFulfillmentType, type ProductOption, ProductSettings, type ProductSettingsProps, type ProductStats, type ProductVariant, ProductsList, type ProductsListProps, type ProductsListResponse, ProductsView, type ProductsViewProps, type Promo, type PromosListResponse, PromosPanel, REALTIME_FAILURES_BEFORE_ERROR, REALTIME_POLL_MS, type RefundRequest, type ReportSlot, RetainerStatusBadge, RetainersPanel, type RetainersPanelProps, type RevenueCurrencyTotal, type RevenuePeriod, type SetInventoryInput, type SetOrderFulfillmentInput, type SettledRevenue, type Submission, SubmissionDetail, type SubmissionDetailProps, type SubmissionMetadata, type Subscription, SubscriptionsView, type SubscriptionsViewProps, type UpdateEventDestinationInput, type UpdateFormInput, type UpdateOptionInput, type UpdateProductInput, type UpdateVariantInput, type UseAnalyticsOptions, type UseAnalyticsReturn, type UseBusinessSummaryOptions, type UseBusinessSummaryReturn, type UseCustomersOptions, type UseCustomersReturn, type UseEventDestinationsReturn, type UseFormsReturn, type UseInvoicesOptions, type UseInvoicesReturn, type UseOrdersOptions, type UseOrdersReturn, type UsePaymentsStatusReturn, type UsePeopleOptions, type UsePeopleReturn, type UsePersonOptions, type UsePersonReturn, type UseProductsOptions, type UseProductsReturn, type UseRealtimeVisitorsReturn, type UseSubmissionsOptions, type UseSubmissionsReturn, type UseSubscriptionsOptions, type UseSubscriptionsReturn, type VariantInventory, type VariantOptionValue, VariantsEditor, type VariantsEditorProps, ViewShell, type ViewShellProps, WebhookDeliveries, type WebhookDeliveriesProps, WebhookSettings, type WebhookSettingsProps, chargedTotal, createApiClient, formatPrice, isZeroDecimalCurrency, toMajorUnits, toMinorUnits, useAifeaturesContext as useAifeatures, useAifeaturesContext, useAnalytics, useBusinessSummary, useCustomers, useEventDestinations, useForms, useInvoices, useOrders, usePaymentsStatus, usePeople, usePerson, useProducts, useRealtimeVisitors, useRetainers, useSubmissions, useSubscriptions };
|