@propeller-commerce/propeller-v2-react-ui 0.4.15 → 0.4.16
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/CHANGELOG.md +25 -0
- package/dist/index.cjs +45 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +132 -63
- package/dist/index.d.ts +132 -63
- package/dist/index.js +45 -18
- package/dist/index.js.map +1 -1
- package/dist/pure.cjs.map +1 -1
- package/dist/pure.d.cts +2 -2
- package/dist/pure.d.ts +2 -2
- package/dist/pure.js.map +1 -1
- package/dist/shared.d.cts +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -6,10 +6,10 @@ import React__default, { ReactNode, ComponentType } from 'react';
|
|
|
6
6
|
import { GraphQLClient, Contact, Customer, Cart, CartMainItem, Product, Cluster, AddressType, Gender, YesNo, Address, TransformationsInput, MediaImageProductSearchInput, CartProcessResponse, Crossupsell, CartUpdateAddressInput, CartUpdateInput, CartAddressType, ClusterConfig, Company, CompanyVariables, PurchaseAuthorizationConfigCreateInput, PurchaseAuthorizationConfigUpdateInput, FavoriteList, DateSearchInput, DecimalSearchInput, OrderSortInput, OrderType, OrderSearchFields, Order, ProductTextFilterInput, AttributeFilter, ProductsResponse, Category, CrossupsellType, AttributeResult, RegisterContactInput as RegisterContactInput$1, PurchaseAuthorizationConfig, CartChildItemInput, CartAddress, WarehouseAddress, OrderAddress, CartBaseItem, CartCarrier, CartPaymethod, ClusterOption, ProductInventory, OrderItem, ProductPrice, Bundle, PaginatedMediaDocumentResponse, PaginatedMediaVideoResponse } from '@propeller-commerce/propeller-sdk-v2';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Tier 1
|
|
9
|
+
* Tier 1 — application-wide infrastructure. Bound by `<PropellerDepsProvider>`
|
|
10
10
|
* once at the root of the app. These values are app-singletons: the GraphQL
|
|
11
11
|
* client, the SDK Services bundle wired to it, and the cosmetic / branding
|
|
12
|
-
* defaults (currency, configuration). They do not change per subtree
|
|
12
|
+
* defaults (currency, configuration). They do not change per subtree — for
|
|
13
13
|
* per-scope state (user, companyId, language) use `<PropellerProvider>`.
|
|
14
14
|
*
|
|
15
15
|
* Why split: per-scope state belongs to a routed section (impersonation,
|
|
@@ -20,7 +20,7 @@ import { GraphQLClient, Contact, Customer, Cart, CartMainItem, Product, Cluster,
|
|
|
20
20
|
interface PropellerDeps {
|
|
21
21
|
/**
|
|
22
22
|
* The GraphQL client the consumer constructed. Exposed for code that needs
|
|
23
|
-
* to pass it back into SDK helpers (rare
|
|
23
|
+
* to pass it back into SDK helpers (rare — most code should use `services`).
|
|
24
24
|
*/
|
|
25
25
|
graphqlClient: GraphQLClient;
|
|
26
26
|
/**
|
|
@@ -28,13 +28,13 @@ interface PropellerDeps {
|
|
|
28
28
|
* `graphqlClient`. Build it via `createServices(graphqlClient)`.
|
|
29
29
|
*/
|
|
30
30
|
services: Services;
|
|
31
|
-
/** Currency symbol used by display components. Default: `'
|
|
31
|
+
/** Currency symbol used by display components. Default: `'€'`. */
|
|
32
32
|
currency: string;
|
|
33
33
|
/** Free-form configuration bag forwarded to components. */
|
|
34
34
|
configuration: unknown;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* Tier 2
|
|
37
|
+
* Tier 2 — per-scope state. Bound by `<PropellerProvider>` and replaceable
|
|
38
38
|
* by nesting a second provider deeper in the tree.
|
|
39
39
|
*/
|
|
40
40
|
interface PropellerScope {
|
|
@@ -52,7 +52,7 @@ interface PropellerScope {
|
|
|
52
52
|
* Shop mode declared in `propeller.json`. Combined with `user` to derive
|
|
53
53
|
* `userMode` on the composite context. Defaults to `'hybrid'` when omitted
|
|
54
54
|
* so existing call sites keep their current branching semantics (any
|
|
55
|
-
* logged-in Contact
|
|
55
|
+
* logged-in Contact → b2b surface).
|
|
56
56
|
*/
|
|
57
57
|
shopMode?: ShopMode;
|
|
58
58
|
}
|
|
@@ -87,7 +87,7 @@ interface PropellerDepsProviderProps {
|
|
|
87
87
|
*
|
|
88
88
|
* export function Providers({ children }) {
|
|
89
89
|
* return (
|
|
90
|
-
* <PropellerDepsProvider value={{ graphqlClient, services, currency: '
|
|
90
|
+
* <PropellerDepsProvider value={{ graphqlClient, services, currency: '€', configuration }}>
|
|
91
91
|
* <PropellerProvider value={scopeFromHostStores}>
|
|
92
92
|
* {children}
|
|
93
93
|
* </PropellerProvider>
|
|
@@ -105,7 +105,7 @@ interface PropellerProviderProps {
|
|
|
105
105
|
/**
|
|
106
106
|
* Provider for Tier 2 per-scope state (user, companyId, language,
|
|
107
107
|
* includeTax, portalMode). Wrap the routed tree; nest deeper to override
|
|
108
|
-
* scope for a subtree (impersonation, multi-cart,
|
|
108
|
+
* scope for a subtree (impersonation, multi-cart, …).
|
|
109
109
|
*/
|
|
110
110
|
declare function PropellerProvider({ value, children }: PropellerProviderProps): React$1.JSX.Element;
|
|
111
111
|
/**
|
|
@@ -113,7 +113,7 @@ declare function PropellerProvider({ value, children }: PropellerProviderProps):
|
|
|
113
113
|
* components stay usable standalone / in tests.
|
|
114
114
|
*/
|
|
115
115
|
declare function usePropellerDeps(): PropellerDeps | null;
|
|
116
|
-
/** Throwing variant
|
|
116
|
+
/** Throwing variant — call when deps are required. */
|
|
117
117
|
declare function useRequiredPropellerDeps(): PropellerDeps;
|
|
118
118
|
/**
|
|
119
119
|
* Read the Tier 2 scope. Returns `null` outside the provider so components
|
|
@@ -221,7 +221,7 @@ interface ProductGridConfig {
|
|
|
221
221
|
} & Record<string, unknown>>;
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
|
-
* Provider
|
|
224
|
+
* Provider — ProductGrid wraps its card subtree with this so descendant
|
|
225
225
|
* cards read display flags and callbacks via {@link useProductGridConfig}
|
|
226
226
|
* instead of receiving them as threaded props.
|
|
227
227
|
*
|
|
@@ -1001,7 +1001,7 @@ type InfraKey$1 = keyof PropellerInfra;
|
|
|
1001
1001
|
declare function useInfraProps<P extends Partial<Record<InfraKey$1, unknown>>>(props: P): P & Partial<PropellerInfra>;
|
|
1002
1002
|
|
|
1003
1003
|
/**
|
|
1004
|
-
* useMenu (React)
|
|
1004
|
+
* useMenu (React) — Category tree fetch with depth-configurable recursive GraphQL query.
|
|
1005
1005
|
*
|
|
1006
1006
|
* Responsibilities:
|
|
1007
1007
|
* - Dynamic recursive GraphQL category query (depth-configurable, default 3)
|
|
@@ -1045,14 +1045,14 @@ interface UseMenuReturn {
|
|
|
1045
1045
|
clearCache: (rootCategoryId: number, language: string, userKey?: string) => void;
|
|
1046
1046
|
}
|
|
1047
1047
|
/**
|
|
1048
|
-
* useMenu
|
|
1048
|
+
* useMenu — category-tree fetch with a depth-configurable recursive GraphQL query.
|
|
1049
1049
|
*
|
|
1050
1050
|
* @param options - see {@link UseMenuOptions}.
|
|
1051
|
-
* @returns the category tree, loading/error state and fetch/cache actions
|
|
1051
|
+
* @returns the category tree, loading/error state and fetch/cache actions — see {@link UseMenuReturn}.
|
|
1052
1052
|
*
|
|
1053
1053
|
* @remarks
|
|
1054
1054
|
* GraphQL integration: unlike the SDK-service hooks, `fetchMenu` runs a raw query
|
|
1055
|
-
* directly via `graphqlClient.query()`
|
|
1055
|
+
* directly via `graphqlClient.query()` — it builds a recursive `categories { ... }`
|
|
1056
1056
|
* fragment to the configured `depth` and reads the root category's children.
|
|
1057
1057
|
* Results are cached in `localStorage` with a 12h TTL under a key scoped by root
|
|
1058
1058
|
* category, language and `userKey`. A module-level `inflightFetches` map dedups
|
|
@@ -1281,6 +1281,18 @@ interface UseProductInfoOptions {
|
|
|
1281
1281
|
user?: Contact | Customer | null;
|
|
1282
1282
|
/** Active company id for company-scoped pricing and orderlist resolution. */
|
|
1283
1283
|
companyId?: number;
|
|
1284
|
+
/**
|
|
1285
|
+
* Scope the product fetch to specific orderlist IDs (e.g. a chosen B2B
|
|
1286
|
+
* contract). When provided, these override the default behaviour of resolving
|
|
1287
|
+
* and applying ALL of the company's orderlists.
|
|
1288
|
+
*/
|
|
1289
|
+
orderlistIds?: number[];
|
|
1290
|
+
/**
|
|
1291
|
+
* Apply the orderlist filter. Defaults to `true` when `orderlistIds` is
|
|
1292
|
+
* non-empty (or resolved from the company), `false` when explicitly set so an
|
|
1293
|
+
* authenticated user without a contract sees the full catalogue.
|
|
1294
|
+
*/
|
|
1295
|
+
applyOrderlists?: boolean;
|
|
1284
1296
|
/** Attribute names to include in attributeResultSearchInput (productTrackAttributes). */
|
|
1285
1297
|
productTrackAttributes?: string[];
|
|
1286
1298
|
/** Portal configuration: image search/variant filters per size. */
|
|
@@ -1360,6 +1372,14 @@ interface UseProductSearchOptions {
|
|
|
1360
1372
|
user?: Contact | Customer | null;
|
|
1361
1373
|
/** Active company id for company-scoped pricing/visibility. */
|
|
1362
1374
|
companyId?: number;
|
|
1375
|
+
/** Scope the product fetch to specific orderlist IDs (e.g. a chosen B2B contract). */
|
|
1376
|
+
orderlistIds?: number[];
|
|
1377
|
+
/**
|
|
1378
|
+
* Apply the orderlist filter on the search input. Defaults to `true` when
|
|
1379
|
+
* `orderlistIds` is non-empty, `false` otherwise — so an authenticated user
|
|
1380
|
+
* without a contract still sees the full catalogue.
|
|
1381
|
+
*/
|
|
1382
|
+
applyOrderlists?: boolean;
|
|
1363
1383
|
/** Attribute text filters applied to the category search. */
|
|
1364
1384
|
textFilters?: ProductTextFilterInput[];
|
|
1365
1385
|
/** Lower price bound filter. */
|
|
@@ -1860,7 +1880,7 @@ declare function useResolvedProps<P extends object>(rawProps: P, spec: ResolveSp
|
|
|
1860
1880
|
declare function useServices(): Services;
|
|
1861
1881
|
|
|
1862
1882
|
/**
|
|
1863
|
-
* cartInit
|
|
1883
|
+
* cartInit — 3-step cart initialisation shared by useCart and useProductBundles.
|
|
1864
1884
|
*
|
|
1865
1885
|
* Step 1: Search for an existing OPEN cart for this user.
|
|
1866
1886
|
* Step 2: If none found, create a new cart via startCart.
|
|
@@ -1872,14 +1892,14 @@ declare function useServices(): Services;
|
|
|
1872
1892
|
/** Configuration object for {@link initCart}. */
|
|
1873
1893
|
interface CartInitConfig {
|
|
1874
1894
|
/**
|
|
1875
|
-
* The Services bundle
|
|
1895
|
+
* The Services bundle — pass `services` from `usePropellerContext()` / the
|
|
1876
1896
|
* provider's value object. Replaces the previous `graphqlClient` field
|
|
1877
1897
|
* which forced this util to know how to construct services.
|
|
1878
1898
|
*/
|
|
1879
1899
|
services: Services;
|
|
1880
1900
|
/** The current user (Contact or Customer); `null` for anonymous carts. */
|
|
1881
1901
|
user: AnyUser;
|
|
1882
|
-
/** Active company ID
|
|
1902
|
+
/** Active company ID — overrides user's default company for cart lookup and creation */
|
|
1883
1903
|
companyId?: number;
|
|
1884
1904
|
/** Language code for localised cart queries. Defaults to `'NL'`. */
|
|
1885
1905
|
language?: string;
|
|
@@ -1909,7 +1929,7 @@ interface CartInitConfig {
|
|
|
1909
1929
|
declare function initCart(config: CartInitConfig): Promise<Cart>;
|
|
1910
1930
|
|
|
1911
1931
|
/**
|
|
1912
|
-
* fetchActiveCart
|
|
1932
|
+
* fetchActiveCart — fetches the user's existing OPEN cart filtered by user/company.
|
|
1913
1933
|
*
|
|
1914
1934
|
* Framework-agnostic helper so login/register pages can reuse the same logic
|
|
1915
1935
|
* without forcing a state-management store dependency.
|
|
@@ -1918,13 +1938,13 @@ declare function initCart(config: CartInitConfig): Promise<Cart>;
|
|
|
1918
1938
|
/** Configuration object for {@link fetchActiveCart}. */
|
|
1919
1939
|
interface FetchActiveCartConfig {
|
|
1920
1940
|
/**
|
|
1921
|
-
* The Services bundle
|
|
1941
|
+
* The Services bundle — pass `services` from `usePropellerContext()` / the
|
|
1922
1942
|
* provider's value object. Replaces the previous `graphqlClient` field.
|
|
1923
1943
|
*/
|
|
1924
1944
|
services: Services;
|
|
1925
1945
|
/** The authenticated user (Contact or Customer) whose cart to look up. */
|
|
1926
1946
|
user: Contact | Customer;
|
|
1927
|
-
/** Active company ID
|
|
1947
|
+
/** Active company ID — narrows the cart search for company users. */
|
|
1928
1948
|
companyId?: number;
|
|
1929
1949
|
/** Language code for the localised cart query. */
|
|
1930
1950
|
language: string;
|
|
@@ -1948,7 +1968,7 @@ interface FetchActiveCartConfig {
|
|
|
1948
1968
|
declare function fetchActiveCart(cfg: FetchActiveCartConfig): Promise<Cart | null>;
|
|
1949
1969
|
|
|
1950
1970
|
/**
|
|
1951
|
-
* mergeAnonymousCart
|
|
1971
|
+
* mergeAnonymousCart — copies items from an anonymous cart into a target
|
|
1952
1972
|
* (authenticated) cart by calling CartService.addItemToCart per item.
|
|
1953
1973
|
*
|
|
1954
1974
|
* Framework-agnostic.
|
|
@@ -1957,7 +1977,7 @@ declare function fetchActiveCart(cfg: FetchActiveCartConfig): Promise<Cart | nul
|
|
|
1957
1977
|
/** Configuration object for {@link mergeAnonymousCart}. */
|
|
1958
1978
|
interface MergeAnonymousCartConfig {
|
|
1959
1979
|
/**
|
|
1960
|
-
* The Services bundle
|
|
1980
|
+
* The Services bundle — pass `services` from `usePropellerContext()` / the
|
|
1961
1981
|
* provider's value object. Replaces the previous `graphqlClient` field.
|
|
1962
1982
|
*/
|
|
1963
1983
|
services: Services;
|
|
@@ -3200,7 +3220,7 @@ interface CartSummaryProps {
|
|
|
3200
3220
|
declare function CartSummary(rawProps: CartSummaryProps): React$1.JSX.Element;
|
|
3201
3221
|
|
|
3202
3222
|
/**
|
|
3203
|
-
* @rsc-blocked
|
|
3223
|
+
* @rsc-blocked — Client-only component: interactive state (useState/useReducer).
|
|
3204
3224
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
3205
3225
|
* imported directly into a React Server Component. The 'use client' header
|
|
3206
3226
|
* above marks this boundary to Next.js.
|
|
@@ -3239,7 +3259,7 @@ interface CategoryDescriptionProps {
|
|
|
3239
3259
|
declare function CategoryDescription(props: CategoryDescriptionProps): React$1.JSX.Element;
|
|
3240
3260
|
|
|
3241
3261
|
/**
|
|
3242
|
-
* @rsc-safe
|
|
3262
|
+
* @rsc-safe — Pure display component. No React hooks, no event handlers, no
|
|
3243
3263
|
* browser APIs, no context reads. Renders directly from props and can be
|
|
3244
3264
|
* imported into a React Server Component without a 'use client' boundary.
|
|
3245
3265
|
* Verified C0.2 (2026-05-20).
|
|
@@ -3523,7 +3543,7 @@ interface ClusterConfiguratorProps {
|
|
|
3523
3543
|
declare function ClusterConfigurator(props: ClusterConfiguratorProps): React$1.JSX.Element;
|
|
3524
3544
|
|
|
3525
3545
|
/**
|
|
3526
|
-
* @rsc-blocked
|
|
3546
|
+
* @rsc-blocked — Client-only component: side effects (useEffect).
|
|
3527
3547
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
3528
3548
|
* imported directly into a React Server Component. The 'use client' header
|
|
3529
3549
|
* above marks this boundary to Next.js.
|
|
@@ -3548,7 +3568,7 @@ interface ClusterInfoProps {
|
|
|
3548
3568
|
*/
|
|
3549
3569
|
graphqlClient?: GraphQLClient;
|
|
3550
3570
|
/**
|
|
3551
|
-
* Called once the cluster data is loaded
|
|
3571
|
+
* Called once the cluster data is loaded — either immediately (when
|
|
3552
3572
|
* `cluster` prop is supplied) or after the internal fetch completes.
|
|
3553
3573
|
* Use this to hydrate sibling components (configurator, price, gallery, etc.).
|
|
3554
3574
|
*/
|
|
@@ -3656,7 +3676,7 @@ interface ClusterOptionsProps {
|
|
|
3656
3676
|
declare function ClusterOptions(props: ClusterOptionsProps): React$1.JSX.Element;
|
|
3657
3677
|
|
|
3658
3678
|
/**
|
|
3659
|
-
* @rsc-blocked
|
|
3679
|
+
* @rsc-blocked — Client-only component: browser-only APIs (window/document/storage).
|
|
3660
3680
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
3661
3681
|
* imported directly into a React Server Component. The 'use client' header
|
|
3662
3682
|
* above marks this boundary to Next.js.
|
|
@@ -3719,7 +3739,7 @@ interface DeliveryDateProps {
|
|
|
3719
3739
|
declare function DeliveryDate(props: DeliveryDateProps): React$1.JSX.Element;
|
|
3720
3740
|
|
|
3721
3741
|
/**
|
|
3722
|
-
* @rsc-blocked
|
|
3742
|
+
* @rsc-blocked — Client-only component: JSX event handlers (onClick/onChange/etc.).
|
|
3723
3743
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
3724
3744
|
* imported directly into a React Server Component. The 'use client' header
|
|
3725
3745
|
* above marks this boundary to Next.js.
|
|
@@ -3738,8 +3758,8 @@ interface GridPaginationProps {
|
|
|
3738
3758
|
onPageChange: (page: number) => void;
|
|
3739
3759
|
/**
|
|
3740
3760
|
* Pagination display variant.
|
|
3741
|
-
* 'compact'
|
|
3742
|
-
* 'full'
|
|
3761
|
+
* 'compact' — Previous / "Page X of Y" / Next.
|
|
3762
|
+
* 'full' — numbered page buttons with ellipsis collapsing + Previous / Next.
|
|
3743
3763
|
* Defaults to 'compact'.
|
|
3744
3764
|
*/
|
|
3745
3765
|
variant?: string;
|
|
@@ -4060,7 +4080,7 @@ interface FavoriteListsProps {
|
|
|
4060
4080
|
declare function FavoriteLists(rawProps: FavoriteListsProps): React$1.JSX.Element;
|
|
4061
4081
|
|
|
4062
4082
|
/**
|
|
4063
|
-
* @rsc-blocked
|
|
4083
|
+
* @rsc-blocked — Client-only component: interactive state (useState/useReducer).
|
|
4064
4084
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
4065
4085
|
* imported directly into a React Server Component. The 'use client' header
|
|
4066
4086
|
* above marks this boundary to Next.js.
|
|
@@ -4107,7 +4127,7 @@ interface ForgotPasswordProps {
|
|
|
4107
4127
|
declare function ForgotPassword(rawProps: ForgotPasswordProps): React$1.JSX.Element;
|
|
4108
4128
|
|
|
4109
4129
|
/**
|
|
4110
|
-
* @rsc-blocked
|
|
4130
|
+
* @rsc-blocked — Client-only component: interactive state (useState/useReducer).
|
|
4111
4131
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
4112
4132
|
* imported directly into a React Server Component. The 'use client' header
|
|
4113
4133
|
* above marks this boundary to Next.js.
|
|
@@ -4144,11 +4164,11 @@ interface GridFiltersProps {
|
|
|
4144
4164
|
/** Enable mobile-specific behaviour (drops sticky positioning). */
|
|
4145
4165
|
isMobile?: boolean;
|
|
4146
4166
|
/**
|
|
4147
|
-
* 'open'
|
|
4148
|
-
* 'semi-closed'
|
|
4167
|
+
* 'open' — show price filter for all users.
|
|
4168
|
+
* 'semi-closed' — hide price filter for unauthenticated users.
|
|
4149
4169
|
*/
|
|
4150
4170
|
portalMode?: string;
|
|
4151
|
-
/** Authenticated user
|
|
4171
|
+
/** Authenticated user — price filter visibility depends on this in semi-closed mode. */
|
|
4152
4172
|
user?: Contact | Customer | null;
|
|
4153
4173
|
/**
|
|
4154
4174
|
* Whether filter accordions start collapsed.
|
|
@@ -4261,6 +4281,11 @@ interface GridToolbarProps {
|
|
|
4261
4281
|
* Defaults to all available sort fields.
|
|
4262
4282
|
*/
|
|
4263
4283
|
sortOptions?: string[];
|
|
4284
|
+
/**
|
|
4285
|
+
* Hide the price-ascending/descending sort options entirely. Default: false.
|
|
4286
|
+
* Useful for closed B2B portals where prices are "by quotation".
|
|
4287
|
+
*/
|
|
4288
|
+
hidePriceSort?: boolean;
|
|
4264
4289
|
/**
|
|
4265
4290
|
* Active sort — first element is used.
|
|
4266
4291
|
* Defaults to [{ field: 'CATEGORY_ORDER', order: 'DESC' }].
|
|
@@ -4503,6 +4528,13 @@ interface MenuProps {
|
|
|
4503
4528
|
* Defaults to 'category/{categoryId}/{slug}'.
|
|
4504
4529
|
*/
|
|
4505
4530
|
menuLinkFormat?: string;
|
|
4531
|
+
/**
|
|
4532
|
+
* Custom URL builder for category links. Overrides `menuLinkFormat` /
|
|
4533
|
+
* `configuration.urls.getCategoryUrl`. Lets hosts inject dynamic query strings
|
|
4534
|
+
* (e.g. `?contract=…`) that a static format string cannot express.
|
|
4535
|
+
* Mirrors the `getUrl` prop on Breadcrumbs.
|
|
4536
|
+
*/
|
|
4537
|
+
getUrl?: (category: Category) => string;
|
|
4506
4538
|
/**
|
|
4507
4539
|
* Called when a menu item is clicked.
|
|
4508
4540
|
* Use for SPA-style routing instead of full-page navigation.
|
|
@@ -5295,7 +5327,7 @@ type ProductCardComponent = typeof MemoizedRoot & {
|
|
|
5295
5327
|
declare const ProductCard: ProductCardComponent;
|
|
5296
5328
|
|
|
5297
5329
|
/**
|
|
5298
|
-
* @rsc-blocked
|
|
5330
|
+
* @rsc-blocked — Client-only component: interactive state (useState/useReducer).
|
|
5299
5331
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
5300
5332
|
* imported directly into a React Server Component. The 'use client' header
|
|
5301
5333
|
* above marks this boundary to Next.js.
|
|
@@ -5400,7 +5432,7 @@ declare function ProductGallery(props: ProductGalleryProps): React$1.JSX.Element
|
|
|
5400
5432
|
interface ProductGridProps {
|
|
5401
5433
|
/**
|
|
5402
5434
|
* Initialised Propeller SDK GraphQL client.
|
|
5403
|
-
* Required when `products` is not provided
|
|
5435
|
+
* Required when `products` is not provided — used for internal data fetching.
|
|
5404
5436
|
*/
|
|
5405
5437
|
graphqlClient?: GraphQLClient;
|
|
5406
5438
|
/**
|
|
@@ -5420,15 +5452,23 @@ interface ProductGridProps {
|
|
|
5420
5452
|
*/
|
|
5421
5453
|
categoryId?: number;
|
|
5422
5454
|
/**
|
|
5423
|
-
* Search term
|
|
5455
|
+
* Search term — passes `term` into categoryProductSearchInput and uses
|
|
5424
5456
|
* `config.baseCategoryId` so the whole catalog is searched.
|
|
5425
5457
|
*/
|
|
5426
5458
|
term?: string;
|
|
5427
5459
|
/**
|
|
5428
|
-
* Manufacturer/brand name
|
|
5460
|
+
* Manufacturer/brand name — passes `manufacturers: [brand]` into
|
|
5429
5461
|
* categoryProductSearchInput and uses `config.baseCategoryId`.
|
|
5430
5462
|
*/
|
|
5431
5463
|
brand?: string;
|
|
5464
|
+
/** Scope the product fetch to specific orderlist IDs (e.g. a chosen B2B contract). */
|
|
5465
|
+
orderlistIds?: number[];
|
|
5466
|
+
/**
|
|
5467
|
+
* Apply the orderlist filter. Defaults to `true` when `orderlistIds` is
|
|
5468
|
+
* non-empty, `false` otherwise — so an authenticated user without a contract
|
|
5469
|
+
* still sees the full catalogue.
|
|
5470
|
+
*/
|
|
5471
|
+
applyOrderlists?: boolean;
|
|
5432
5472
|
/** Number of columns in the grid. Accepts 2, 3, 4, 5, or 6. Defaults to 3. */
|
|
5433
5473
|
columns?: number;
|
|
5434
5474
|
/**
|
|
@@ -5450,8 +5490,8 @@ interface ProductGridProps {
|
|
|
5450
5490
|
renderClusterCard?: (cluster: Cluster) => any;
|
|
5451
5491
|
/**
|
|
5452
5492
|
* Controls portal visibility mode.
|
|
5453
|
-
* 'open'
|
|
5454
|
-
* 'semi-closed'
|
|
5493
|
+
* 'open' — full e-commerce; AddToCart is visible in product cards.
|
|
5494
|
+
* 'semi-closed' — catalog-only; AddToCart is hidden.
|
|
5455
5495
|
* Defaults to 'open'.
|
|
5456
5496
|
*/
|
|
5457
5497
|
portalMode?: string;
|
|
@@ -5462,16 +5502,16 @@ interface ProductGridProps {
|
|
|
5462
5502
|
/** * Enables stock validation inside AddToCart. * Blocks add when requested quantity exceeds available stock. * Defaults to false. */ stockValidation?: boolean;
|
|
5463
5503
|
/** * When false, hides the AddToCart control in product cards. * ClusterCards always show their "View cluster" navigation button. * Defaults to true. */ allowAddToCart?: boolean;
|
|
5464
5504
|
/** * Called after each internal data fetch with the filterable attributes * returned by the API (for driving a sibling FiltersSidebar). */ onFiltersChange?: (filters: AttributeFilter[]) => void;
|
|
5465
|
-
/** * Active text filters to apply
|
|
5505
|
+
/** * Active text filters to apply — built by the parent from FiltersSidebar * `onFilterChange` callbacks. Each entry maps to a `textFilters` input * row in the CategoryService query. * When this prop changes the grid automatically re-fetches (page resets to 1). */ textFilters?: ProductTextFilterInput[];
|
|
5466
5506
|
/** * Active price range lower bound from the FiltersSidebar `onPriceChange`. * Triggers a re-fetch when changed. */ priceFilterMin?: number;
|
|
5467
5507
|
/** * Active price range upper bound from the FiltersSidebar `onPriceChange`. * Triggers a re-fetch when changed. */ priceFilterMax?: number;
|
|
5468
5508
|
/** * Called when sort state changes internally (for syncing a sibling toolbar). */ onSortChange?: (field: string, order: string) => void;
|
|
5469
|
-
/** * Called after each internal data fetch with the min/max price of the * current product set
|
|
5470
|
-
/** * Called after each fetch with the total number of products found
|
|
5509
|
+
/** * Called after each internal data fetch with the min/max price of the * current product set — use to populate a price range slider in the parent. */ onPriceBoundsChange?: (min: number, max: number) => void;
|
|
5510
|
+
/** * Called after each fetch with the total number of products found — * use to display a result count in the parent toolbar. */ onItemsFoundChange?: (count: number) => void;
|
|
5471
5511
|
/** * Called after each fetch with the number of items visible on the current page * (after client-side language filtering). */ onPageItemCountChange?: (count: number) => void;
|
|
5472
|
-
/** * Called when the user clicks Previous / Next in the built-in pagination
|
|
5473
|
-
/** * Called after each successful internal data fetch with the full * ProductsResponse object
|
|
5474
|
-
/** * Called after each successful internal data fetch with the full * Category object
|
|
5512
|
+
/** * Called when the user clicks Previous / Next in the built-in pagination — * use to keep the parent URL / page state in sync. */ onPageChange?: (page: number) => void;
|
|
5513
|
+
/** * Called after each successful internal data fetch with the full * ProductsResponse object — use to drive an external GridPagination * component by passing the result as its `products` prop. */ onProductsResponse?: (products: ProductsResponse) => void;
|
|
5514
|
+
/** * Called after each successful internal data fetch with the full * Category object — use to populate sibling components like GridTitle, * CategoryDescription, and CategoryShortDescription. */ onCategoryChange?: (category: Category) => void;
|
|
5475
5515
|
/** * Called whenever the internal loading state changes. * Use to disable sibling components (e.g. GridFilters) while a fetch is in flight. */ onLoadingChange?: (isLoading: boolean) => void;
|
|
5476
5516
|
/** * Externally controlled current page. * When provided, the grid uses this value instead of its internal page * counter. Wire this to the `onPageChange` callback from a sibling * GridPagination so the two components stay in sync. * When changed the grid automatically re-fetches. */ page?: number;
|
|
5477
5517
|
/** * Number of products per page. Defaults to 12. * When changed the grid automatically re-fetches (page resets to 1). */ pageSize?: number;
|
|
@@ -5479,9 +5519,9 @@ interface ProductGridProps {
|
|
|
5479
5519
|
/** * Sort direction: 'ASC' or 'DESC'. * Only used when sortField is also provided. * When changed the grid automatically re-fetches (page resets to 1). */ sortOrder?: string;
|
|
5480
5520
|
/**
|
|
5481
5521
|
* Configuration object providing:
|
|
5482
|
-
* imageSearchFiltersGrid, imageVariantFiltersMedium
|
|
5483
|
-
* baseCategoryId
|
|
5484
|
-
* urls.getProductUrl / urls.getClusterUrl
|
|
5522
|
+
* imageSearchFiltersGrid, imageVariantFiltersMedium — passed to CategoryService
|
|
5523
|
+
* baseCategoryId — used when querying by term or brand
|
|
5524
|
+
* urls.getProductUrl / urls.getClusterUrl — for card URL generation
|
|
5485
5525
|
*/
|
|
5486
5526
|
configuration?: {
|
|
5487
5527
|
baseCategoryId?: number;
|
|
@@ -5497,7 +5537,7 @@ interface ProductGridProps {
|
|
|
5497
5537
|
/** Called after AddToCart creates a new cart internally. */ onCartCreated?: (cart: Cart) => void;
|
|
5498
5538
|
/** Called after every successful add-to-cart operation. */ afterAddToCart?: (cart: Cart, item?: CartMainItem) => void;
|
|
5499
5539
|
/** * When true, AddToCart shows a success modal instead of a toast. * Defaults to false. */ showModal?: boolean;
|
|
5500
|
-
/** * Render
|
|
5540
|
+
/** * Render − / + stepper buttons in AddToCart. * Defaults to true. */ allowIncrDecr?: boolean;
|
|
5501
5541
|
/** Called when "Proceed to checkout" is clicked in the AddToCart modal. */ onProceedToCheckout?: () => void;
|
|
5502
5542
|
/** Called when "Request a Quote" is clicked in the AddToCart modal. */ onRequestQuoteClick?: (cart: Cart) => void;
|
|
5503
5543
|
/** * Label overrides forwarded directly to the embedded AddToCart component. * Keys: add, adding, addedToCart, outOfStock, noCartId, errorAdding, * modalTitle, quantity, continueShopping, proceedToCheckout */ addToCartLabels?: Record<string, string>;
|
|
@@ -5516,8 +5556,8 @@ interface ProductGridProps {
|
|
|
5516
5556
|
clusterCardLabels?: Record<string, string>;
|
|
5517
5557
|
/** Show a heart-icon favourite toggle on each card. */ enableAddFavorite?: boolean;
|
|
5518
5558
|
/** * Called when a favourite is toggled on any card. * Receives the full Product or Cluster object and the new favourite state. */ onToggleFavorite?: (item: Product | Cluster, isFavorite: boolean) => void;
|
|
5519
|
-
/** * Called when a cluster card name, image, or "View cluster" button is * clicked
|
|
5520
|
-
/** * Called when a product card name or image is clicked
|
|
5559
|
+
/** * Called when a cluster card name, image, or "View cluster" button is * clicked — use for SPA-style routing instead of full-page navigation. */ onClusterClick?: (cluster: Cluster) => void;
|
|
5560
|
+
/** * Called when a product card name or image is clicked — use for SPA * routing instead of full-page navigation. */ onProductClick?: (product: Product) => void;
|
|
5521
5561
|
/** Extra CSS class applied to the root element. */ className?: string;
|
|
5522
5562
|
/**
|
|
5523
5563
|
* Compound API: when provided, the grid renders these children inside a
|
|
@@ -5556,7 +5596,7 @@ interface ProductGridProps {
|
|
|
5556
5596
|
declare function ProductGrid(rawProps: ProductGridProps): React$1.JSX.Element;
|
|
5557
5597
|
/**
|
|
5558
5598
|
* The items grid. By default renders `<ProductCard>` / `<ClusterCard>` for
|
|
5559
|
-
* each item
|
|
5599
|
+
* each item — but `renderItem` is the proper extension point: pass a
|
|
5560
5600
|
* function that returns whatever shape you want (compound `<ProductCard>`
|
|
5561
5601
|
* with custom subcomponents, a fully custom card, a list row, etc.).
|
|
5562
5602
|
*
|
|
@@ -5575,7 +5615,7 @@ declare function ProductGridItems(props: {
|
|
|
5575
5615
|
}): React$1.JSX.Element;
|
|
5576
5616
|
/**
|
|
5577
5617
|
* Pagination control wired to the parent ProductGrid context. Compact "Prev /
|
|
5578
|
-
* Page X of Y / Next" style by default
|
|
5618
|
+
* Page X of Y / Next" style by default — a future enhancement could expose
|
|
5579
5619
|
* `style="full"` matching GridPagination. For complex pagination, render
|
|
5580
5620
|
* GridPagination directly (it accepts the same context fields as props).
|
|
5581
5621
|
*/
|
|
@@ -5598,6 +5638,16 @@ interface ProductInfoProps {
|
|
|
5598
5638
|
* Overrides default company for price calculation.
|
|
5599
5639
|
* Triggers a re-fetch when changed. */
|
|
5600
5640
|
companyId?: number;
|
|
5641
|
+
/**
|
|
5642
|
+
* Scope the product fetch to specific orderlist IDs (e.g. a chosen B2B
|
|
5643
|
+
* contract). Overrides the default resolution of all the company's orderlists.
|
|
5644
|
+
*/
|
|
5645
|
+
orderlistIds?: number[];
|
|
5646
|
+
/**
|
|
5647
|
+
* Apply the orderlist filter. Defaults to `true`; set `false` to browse
|
|
5648
|
+
* unscoped (full catalogue) for an authenticated user without a contract.
|
|
5649
|
+
*/
|
|
5650
|
+
applyOrderlists?: boolean;
|
|
5601
5651
|
/**
|
|
5602
5652
|
* Pre-fetched product object to display.
|
|
5603
5653
|
* When provided the component skips internal fetching.
|
|
@@ -5631,7 +5681,7 @@ interface ProductInfoProps {
|
|
|
5631
5681
|
*/
|
|
5632
5682
|
taxZone?: string;
|
|
5633
5683
|
/**
|
|
5634
|
-
* Called once the product data is loaded
|
|
5684
|
+
* Called once the product data is loaded — either immediately (when
|
|
5635
5685
|
* `product` prop is supplied) or after the internal fetch completes.
|
|
5636
5686
|
* Use this to hydrate sibling components (gallery, price, descriptions, etc.).
|
|
5637
5687
|
*/
|
|
@@ -5829,7 +5879,7 @@ declare function ProductPriceDisplay(props: ProductPriceProps): React$1.JSX.Elem
|
|
|
5829
5879
|
declare function ProductPriceWithProvider(rawProps: ProductPriceProps): React$1.JSX.Element;
|
|
5830
5880
|
|
|
5831
5881
|
/**
|
|
5832
|
-
* @rsc-safe
|
|
5882
|
+
* @rsc-safe — Pure display component. No React hooks, no event handlers, no
|
|
5833
5883
|
* browser APIs, no context reads. The legacy `'use client'` header was
|
|
5834
5884
|
* removed in C0 once verified pure. Renders directly
|
|
5835
5885
|
* from props and can be imported into a React Server Component.
|
|
@@ -5957,7 +6007,7 @@ interface ProductSliderProps {
|
|
|
5957
6007
|
declare function ProductSlider(rawProps: ProductSliderProps): React$1.JSX.Element;
|
|
5958
6008
|
|
|
5959
6009
|
/**
|
|
5960
|
-
* @rsc-blocked
|
|
6010
|
+
* @rsc-blocked — Client-only component: side effects (useEffect).
|
|
5961
6011
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
5962
6012
|
* imported directly into a React Server Component. The 'use client' header
|
|
5963
6013
|
* above marks this boundary to Next.js.
|
|
@@ -5966,7 +6016,7 @@ declare function ProductSlider(rawProps: ProductSliderProps): React$1.JSX.Elemen
|
|
|
5966
6016
|
interface ProductSpecificationsProps {
|
|
5967
6017
|
/**
|
|
5968
6018
|
* Initialised Propeller SDK GraphQL client.
|
|
5969
|
-
* Required when `productId` is set
|
|
6019
|
+
* Required when `productId` is set — used to fetch public attributes.
|
|
5970
6020
|
*/
|
|
5971
6021
|
graphqlClient?: GraphQLClient;
|
|
5972
6022
|
/**
|
|
@@ -5985,8 +6035,8 @@ interface ProductSpecificationsProps {
|
|
|
5985
6035
|
language?: string;
|
|
5986
6036
|
/**
|
|
5987
6037
|
* Display layout for the specifications.
|
|
5988
|
-
* 'table'
|
|
5989
|
-
* 'list'
|
|
6038
|
+
* 'table' — two-column table (name | value). Default.
|
|
6039
|
+
* 'list' — vertical label + value stacked rows.
|
|
5990
6040
|
*/
|
|
5991
6041
|
layout?: string;
|
|
5992
6042
|
/**
|
|
@@ -5994,6 +6044,11 @@ interface ProductSpecificationsProps {
|
|
|
5994
6044
|
* When false or omitted, displays a flat ungrouped table/list. Default: false.
|
|
5995
6045
|
*/
|
|
5996
6046
|
grouping?: boolean;
|
|
6047
|
+
/**
|
|
6048
|
+
* Optional package-description string (e.g. contents / packaging notes),
|
|
6049
|
+
* rendered above the attribute table. Omitted when empty.
|
|
6050
|
+
*/
|
|
6051
|
+
packageDescription?: string;
|
|
5997
6052
|
/** Extra CSS class applied to the root element. */
|
|
5998
6053
|
className?: string;
|
|
5999
6054
|
}
|
|
@@ -6091,6 +6146,12 @@ interface ProductTabsProps {
|
|
|
6091
6146
|
* Passed as `grouping` to ProductSpecifications.
|
|
6092
6147
|
*/
|
|
6093
6148
|
specificationsGrouping?: boolean;
|
|
6149
|
+
/**
|
|
6150
|
+
* Extra package-description string rendered in the specifications section
|
|
6151
|
+
* (e.g. contents / packaging notes). Passed as `packageDescription` to
|
|
6152
|
+
* ProductSpecifications.
|
|
6153
|
+
*/
|
|
6154
|
+
specificationsPackageDescription?: string;
|
|
6094
6155
|
/**
|
|
6095
6156
|
* Override UI strings for the Downloads section.
|
|
6096
6157
|
* Available keys: title, download
|
|
@@ -6267,7 +6328,7 @@ interface QuoteActionsProps {
|
|
|
6267
6328
|
declare function QuoteActions(rawProps: QuoteActionsProps): React$1.JSX.Element;
|
|
6268
6329
|
|
|
6269
6330
|
/**
|
|
6270
|
-
* @rsc-blocked
|
|
6331
|
+
* @rsc-blocked — Client-only component: browser-only APIs (window/document/storage).
|
|
6271
6332
|
* Must be rendered inside (or below) a Client Component boundary; cannot be
|
|
6272
6333
|
* imported directly into a React Server Component. The 'use client' header
|
|
6273
6334
|
* above marks this boundary to Next.js.
|
|
@@ -6335,7 +6396,7 @@ interface RegisterFormProps {
|
|
|
6335
6396
|
* forwarded so the parent can merge it into the new user's cart.
|
|
6336
6397
|
*/
|
|
6337
6398
|
afterRegistration?: (user: Contact | Customer, accessToken?: string, refreshToken?: string, expiresAt?: string, anonymousCart?: Cart | null) => void;
|
|
6338
|
-
/** Anonymous cart snapshot from the parent's state
|
|
6399
|
+
/** Anonymous cart snapshot from the parent's state — forwarded to `afterRegistration`. */
|
|
6339
6400
|
cart?: Cart | null;
|
|
6340
6401
|
/** Action for the login link click */
|
|
6341
6402
|
onLoginClick?: () => void;
|
|
@@ -6430,6 +6491,14 @@ interface SearchBarProps {
|
|
|
6430
6491
|
* Active company ID from the company switcher.
|
|
6431
6492
|
*/
|
|
6432
6493
|
companyId?: number;
|
|
6494
|
+
/** Scope the autosuggest fetch to specific orderlist IDs (e.g. a chosen B2B contract). */
|
|
6495
|
+
orderlistIds?: number[];
|
|
6496
|
+
/**
|
|
6497
|
+
* Apply the orderlist filter. Defaults to `true` when `orderlistIds` is
|
|
6498
|
+
* non-empty, `false` otherwise — so an authenticated user without a contract
|
|
6499
|
+
* still sees the full catalogue.
|
|
6500
|
+
*/
|
|
6501
|
+
applyOrderlists?: boolean;
|
|
6433
6502
|
/**
|
|
6434
6503
|
* Bump this counter to clear the search input from outside (e.g. on route
|
|
6435
6504
|
* change). Each unique value triggers a one-time reset of the local term.
|