import { $ as resolveTheme, A as DEFAULT_COLORS, At as RemoteDomWidgetDefinition, B as removeTheme, Bt as applyPropertyValues, C as sectionLayoutConfig, Ct as WidgetTypeName, D as RepAppManifest, Dt as isWidgetTypeName, E as RepAppData, Et as isWidgetType, F as DEFAULT_THEME_ID, Ft as PropertyFieldSchema, G as deserialiseTheme, H as buildThemeDefinition, Ht as groupPropertyFields, I as DEFAULT_THEME_NAME, It as PropertyFieldType, J as generateThemeCSS, K as serialiseTheme, L as getDefaultThemeDefinition, Lt as QuoteListItem, M as DEFAULT_FONT_SIZES, N as DEFAULT_RADII, O as RepAppProfile, P as DEFAULT_SPACING, Pt as PROPERTY_FIELD_TYPES, Q as parseColor, R as applyTheme, Rt as TabConfig, S as SectionLayoutType, St as WidgetType, T as NavigationItem, Tt as assertNever, U as getActiveThemeId, Ut as isPropertyFieldType, V as RawApiTheme, Vt as extractPropertyValues, W as transformThemes, X as getForegroundColor, Y as deriveDarkVariant, Z as mergeDarkOverrides, _ as ColorOptions, _t as TypedWidgetSchema, at as RADIUS_KEYS, b as GapOptions, bt as WidgetRegistry, ct as ResolvedSemanticColor, d as AlignOptions, dt as SemanticColorName, et as FONT_FAMILY_KEYS, f as BackgroundType, ft as ThemeColorInput, g as ButtonSizeOptions, gt as AnyComponent, h as BorderWidthOptions, ht as ThemePayload, it as OklchPlain, j as DEFAULT_FONT_FAMILIES, jt as RemoteDomWidgetPackageDescriptor, k as ScreenDefinition$1, lt as ResolvedTheme, m as BorderRadiusOptions, mt as ThemeDefinition, n as PortalFunction, nt as FontFamilyKey, o as PortalFunctionHandler, ot as RadiusKey, p as BackgroundValue, pt as ThemeColorPlain, q as GenerateThemeCSSOptions, r as PortalFunctionDefinition, rt as FontSizeKey, s as PortalFunctionImplementation, st as ResolvedColorSet, tt as FONT_SIZE_KEYS, u as implementPortalFunction, ut as SEMANTIC_COLOR_NAMES, v as FontSizeOptions, vt as WIDGET_TYPE_NAMES, w as ShareableItem, wt as assertDefined, x as PaddingOptions, xt as WidgetSchema, y as FontWeightOptions, yt as WidgetPath, z as removeAllThemes, zt as WidgetPropertySchema } from "./portal-function-Bl-Hkn1b.mjs"; import { a as buildRemoteWidgetRegistry, c as RemoteDomCapabilityMode, t as RemoteDomWidgetRegistryOptions } from "./build-widget-registry-tyQ_SMfm.mjs"; import { a as gapValues, i as WidgetManifest, n as buildRemoteWidgetPluginManifests, r as getRemoteWidgetPackageCategoryId, t as RemoteWidgetPluginHostOptions } from "./build-remote-widget-plugin-manifests-CmK7Vp3b.mjs"; import React$1, { AnchorHTMLAttributes, ComponentProps, ComponentType, ErrorInfo, ReactElement, ReactNode } from "react"; import { QueryClient, UseQueryResult } from "@tanstack/react-query"; import { z } from "zod"; import { RemoteComponentRendererMap } from "@remote-dom/react/host"; import { RemoteDomFullscreenRequest, RemoteDomSerializableValue } from "@fluid-app/widget-runtime/remote-dom"; //#region src/types/config.d.ts /** * Configuration for the Fluid SDK. * Use Readonly when the config should not be modified after creation. */ interface FluidSDKConfig { /** * Base URL for the Fluid API domain (e.g., "https://api.fluid.app"). * Endpoints include their full path from root (e.g., "/api/reps/me"). */ readonly baseUrl: string; /** * Optional token getter for contexts where session cookies are unavailable * (e.g., the cross-origin builder preview iframe). Not used in normal * portal operation — auth is handled by session cookies via `credentials: 'include'`. */ readonly getAuthToken?: () => string | null | Promise; /** * Callback invoked when a 401 authentication error occurs * Use this to trigger re-authentication flows */ readonly onAuthError?: () => void; /** * Default headers to include in all requests * Example: { "x-fluid-client": "portal" } */ readonly defaultHeaders?: Readonly>; /** * Override WebSocket URL for real-time messaging. * Default: derived from baseUrl by replacing trailing /api with /cable */ readonly websocketUrl?: string; /** * ISO country code for the store/merchant (e.g., "US", "CA", "GB"). * Used to fetch country-specific payment methods. * @default "US" */ readonly countryIso?: string; /** * SmartyStreets embedded autocomplete key. When omitted, the address * autocomplete in the address modals falls back to a plain text input. * The key is referer-locked, so each environment's hostnames must be * added to the SmartyStreets allowlist. */ readonly smartyEmbeddedKey?: string; /** * Google Maps Static API key. When provided, order detail screens * display a static map image of the shipping address. */ readonly googleMapsApiKey?: string; } //#endregion //#region src/types/remote-widgets.d.ts /** * Reviews a widget request to enter the portal screen-area fullscreen surface. * * @param request - Serializable fullscreen request from the active widget. * @returns Serializable approval data, synchronously or asynchronously. */ type RemoteWidgetFullscreenHandler = (request: RemoteDomFullscreenRequest) => RemoteDomSerializableValue | Promise; /** Host configuration for Remote DOM package loading and capabilities. */ interface RemoteWidgetOptions { /** * Compiled Fluid component stylesheets loaded into each widget shadow root. * Import `@fluid-app/portal-sdk/remote-widget-shadow.css?url` and pass its URL * here. The Portal SDK supplies the renderer map and containment providers. */ readonly fluidComponentCssUrls?: readonly string[]; /** Load packages from the authenticated portal catalog. @default true */ readonly catalog?: boolean; /** Trusted canonical packages appended after catalog packages. */ readonly packages?: readonly RemoteDomWidgetPackageDescriptor[]; /** Implements declared custom portal functions not owned by the Portal SDK. */ readonly functions?: readonly PortalFunctionImplementation[]; /** * Controls whether Remote DOM widgets may invoke any capability, including * SDK built-ins, custom functions, and fullscreen. In `unavailable` mode * every capability call fails with `UNAVAILABLE`; use it for non-interactive * builder and preview environments. * @default "live" */ readonly capabilityMode?: RemoteDomCapabilityMode; /** * Optional preflight hook for fullscreen requests. The Portal SDK remains * the canonical owner of screen-area state, layout, focus, and exit UI. */ readonly onFullscreen?: RemoteWidgetFullscreenHandler; } //#endregion //#region src/providers/FluidConfigProvider.d.ts interface FluidContextValue { readonly config: FluidSDKConfig; } declare function useFluidContext(): FluidContextValue; //#endregion //#region src/providers/FluidProvider.d.ts interface FluidProviderProps { /** SDK configuration (baseUrl, auth, etc.) */ config: FluidSDKConfig; /** React children */ children: ReactNode; /** Optional custom QueryClient instance */ queryClient?: QueryClient; /** Optional initial theme */ initialTheme?: ThemeDefinition; /** Optional container for scoped theme application */ themeContainer?: HTMLElement | null; /** Optional custom widget registry (defaults to all built-in widgets) */ widgetRegistry?: Record>; /** Canonical Remote DOM package catalog and explicit package options. */ remoteWidgets?: RemoteWidgetOptions; /** Dynamic variables for data source endpoint path substitution (e.g., { rep_id: "123" }) */ variables?: Record; } /** * Main provider for the Fluid Portal SDK * * @example * ```tsx * function App() { * return ( * * * * ); * } * ``` */ declare function FluidProvider({ config, children, queryClient, initialTheme, themeContainer, widgetRegistry, remoteWidgets, variables }: FluidProviderProps): React.JSX.Element; //#endregion //#region src/providers/FluidThemeProvider.d.ts type ThemeMode$1 = "light" | "dark"; /** * Context value for theme management. * All properties are readonly since context values should not be mutated by consumers. */ interface ThemeContextValue { /** Currently active theme definition */ readonly currentTheme: ThemeDefinition | null; /** Switch to a different theme */ readonly setTheme: (theme: ThemeDefinition) => void; /** Switch between light and dark mode for the current theme */ readonly setThemeMode: (mode: ThemeMode$1) => void; /** Current theme mode */ readonly mode: ThemeMode$1 | undefined; } interface FluidThemeProviderProps { children: ReactNode; /** Initial theme to apply */ initialTheme?: ThemeDefinition; /** Container element for scoped theme application (defaults to document.documentElement) */ container?: HTMLElement | null; } declare function FluidThemeProvider({ children, initialTheme, container }: FluidThemeProviderProps): React.JSX.Element; /** * Hook to access theme context * Must be used within a FluidThemeProvider */ declare function useThemeContext(): ThemeContextValue; //#endregion //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/auth.gen.d.ts type AuthToken = string | undefined; interface Auth { /** * Which part of the request do we use to send the auth? * * @default 'header' */ in?: "header" | "query" | "cookie"; /** * A unique identifier for the security scheme. * * Defined only when there are multiple security schemes whose `Auth` * shape would otherwise be identical. */ key?: string; /** * Header or query parameter name. * * @default 'Authorization' */ name?: string; scheme?: "basic" | "bearer"; type: "apiKey" | "http"; } //#endregion //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/pathSerializer.gen.d.ts interface SerializerOptions { /** * @default true */ explode: boolean; style: T; } type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited"; type ObjectStyle = "form" | "deepObject"; //#endregion //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/bodySerializer.gen.d.ts type QuerySerializer = (query: Record) => string; type BodySerializer = (body: unknown) => unknown; type QuerySerializerOptionsObject = { allowReserved?: boolean; array?: Partial>; object?: Partial>; }; type QuerySerializerOptions = QuerySerializerOptionsObject & { /** * Per-parameter serialization overrides. When provided, these settings * override the global array/object settings for specific parameter names. */ parameters?: Record; }; //#endregion //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/types.gen.d.ts type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace"; type Client$1 = { /** * Returns the final request URL. */ buildUrl: BuildUrlFn; getConfig: () => Config; request: RequestFn; setConfig: (config: Config) => Config; } & { [K in HttpMethod]: MethodFn } & ([SseFn] extends [never] ? { sse?: never; } : { sse: { [K in HttpMethod]: SseFn }; }); interface Config$1 { /** * Auth token or a function returning auth token. The resolved value will be * added to the request payload as defined by its `security` array. */ auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; /** * A function for serializing request body parameter. By default, * {@link JSON.stringify()} will be used. */ bodySerializer?: BodySerializer | null; /** * An object containing any HTTP headers that you want to pre-populate your * `Headers` object with. * * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} */ headers?: RequestInit["headers"] | Record; /** * The request method. * * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} */ method?: Uppercase; /** * A function for serializing request query parameters. By default, arrays * will be exploded in form style, objects will be exploded in deepObject * style, and reserved characters are percent-encoded. * * This method will have no effect if the native `paramsSerializer()` Axios * API function is used. * * {@link https://swagger.io/docs/specification/serialization/#query View examples} */ querySerializer?: QuerySerializer | QuerySerializerOptions; /** * A function validating request data. This is useful if you want to ensure * the request conforms to the desired shape, so it can be safely sent to * the server. */ requestValidator?: (data: unknown) => Promise; /** * A function transforming response data before it's returned. This is useful * for post-processing data, e.g., converting ISO strings into Date objects. */ responseTransformer?: (data: unknown) => Promise; /** * A function validating response data. This is useful if you want to ensure * the response conforms to the desired shape, so it can be safely passed to * the transformers and returned to the user. */ responseValidator?: (data: unknown) => Promise; } //#endregion //#region ../../api-clients/hey-api-fetch-runtime/src/generated/core/serverSentEvents.gen.d.ts type ServerSentEventsOptions = Omit & Pick & { /** * Fetch API implementation. You can use this option to provide a custom * fetch instance. * * @default globalThis.fetch */ fetch?: typeof fetch; /** * Implementing clients can call request interceptors inside this hook. */ onRequest?: (url: string, init: RequestInit) => Promise; /** * Callback invoked when a network or parsing error occurs during streaming. * * This option applies only if the endpoint returns a stream of events. * * @param error The error that occurred. */ onSseError?: (error: unknown) => void; /** * Callback invoked when an event is streamed from the server. * * This option applies only if the endpoint returns a stream of events. * * @param event Event streamed from the server. * @returns Nothing (void). */ onSseEvent?: (event: StreamEvent) => void; serializedBody?: RequestInit["body"]; /** * Default retry delay in milliseconds. * * This option applies only if the endpoint returns a stream of events. * * @default 3000 */ sseDefaultRetryDelay?: number; /** * Maximum number of retry attempts before giving up. */ sseMaxRetryAttempts?: number; /** * Maximum retry delay in milliseconds. * * Applies only when exponential backoff is used. * * This option applies only if the endpoint returns a stream of events. * * @default 30000 */ sseMaxRetryDelay?: number; /** * Optional sleep function for retry backoff. * * Defaults to using `setTimeout`. */ sseSleepFn?: (ms: number) => Promise; url: string; }; interface StreamEvent { data: TData; event?: string; id?: string; retry?: number; } type ServerSentEventsResult = { stream: AsyncGenerator ? TData[keyof TData] : TData, TReturn, TNext>; }; //#endregion //#region ../../api-clients/hey-api-fetch-runtime/src/generated/client/utils.gen.d.ts type ErrInterceptor = (error: Err, response: Res | undefined, request: Req | undefined, options: Options) => Err | Promise; type ReqInterceptor = (request: Req, options: Options) => Req | Promise; type ResInterceptor = (response: Res, request: Req, options: Options) => Res | Promise; declare class Interceptors { fns: Array; clear(): void; eject(id: number | Interceptor): void; exists(id: number | Interceptor): boolean; getInterceptorIndex(id: number | Interceptor): number; update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false; use(fn: Interceptor): number; } interface Middleware { error: Interceptors>; request: Interceptors>; response: Interceptors>; } //#endregion //#region ../../api-clients/hey-api-fetch-runtime/src/generated/client/types.gen.d.ts type ResponseStyle = "data" | "fields"; interface Config extends Omit, Config$1 { /** * Base URL for all requests made by this client. */ baseUrl?: T["baseUrl"]; /** * Fetch API implementation. You can use this option to provide a custom * fetch instance. * * @default globalThis.fetch */ fetch?: typeof fetch; /** * Please don't use the Fetch client for Next.js applications. The `next` * options won't have any effect. * * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. */ next?: never; /** * Return the response data parsed in a specified format. By default, `auto` * will infer the appropriate method from the `Content-Type` response header. * You can override this behavior with any of the {@link Body} methods. * Select `stream` if you don't want to parse response data at all. * * @default 'auto' */ parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text"; /** * Should we return only data or multiple fields (data, error, response, etc.)? * * @default 'fields' */ responseStyle?: ResponseStyle; /** * Throw an error instead of returning it in the response? * * @default false */ throwOnError?: T["throwOnError"]; } interface RequestOptions extends Config<{ responseStyle: TResponseStyle; throwOnError: ThrowOnError; }>, Pick, "onRequest" | "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> { /** * Any body that you want to add to your request. * * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} */ body?: unknown; path?: Record; query?: Record; /** * Security mechanism(s) to use for the request. */ security?: ReadonlyArray; url: Url; } interface ResolvedRequestOptions extends RequestOptions { headers: Headers; serializedBody?: string; } type RequestResult = ThrowOnError extends true ? Promise ? TData[keyof TData] : TData : { data: TData extends Record ? TData[keyof TData] : TData; request: Request; response: Response; }> : Promise ? TData[keyof TData] : TData) | undefined : ({ data: TData extends Record ? TData[keyof TData] : TData; error: undefined; } | { data: undefined; error: TError extends Record ? TError[keyof TError] : TError; }) & { /** request may be undefined, because error may be from building the request object itself */request?: Request; /** response may be undefined, because error may be from building the request object itself or from a network error */ response?: Response; }>; interface ClientOptions { baseUrl?: string; responseStyle?: ResponseStyle; throwOnError?: boolean; } type MethodFn = (options: Omit, "method">) => RequestResult; type SseFn = (options: Omit, "method">) => Promise>; type RequestFn = (options: Omit, "method"> & Pick>, "method">) => RequestResult; type BuildUrlFn = ; query?: Record; url: string; }>(options: TData & Options) => string; type Client = Client$1 & { interceptors: Middleware; }; interface TDataShape { body?: unknown; headers?: unknown; path?: unknown; query?: unknown; url: string; } type OmitKeys = Pick>; type Options = OmitKeys, "body" | "path" | "query" | "url"> & ([TData] extends [never] ? unknown : Omit); //#endregion //#region ../../api-clients/portal-tenant/src/hey-api-client.d.ts type PortalTenantHeyApiClient = Client; //#endregion //#region src/providers/PortalTenantClientProvider.d.ts /** * Returns the portal-tenant PortalTenantHeyApiClient from context. * Must be used within a PortalTenantClientProvider. */ declare function usePortalTenantClient(): PortalTenantHeyApiClient; //#endregion //#region ../core/src/fluidos-api.d.ts interface ResponseMeta { request_id?: string; timestamp?: string; } /** Raw FluidOS navigation item as returned by the API. */ interface FluidOsApiNavigationItem { id: number; icon?: string | null; label?: string | null; parent_id?: number | null; position?: number | null; screen_id?: number | null; slug?: string | null; /** @enum {string} */ source?: "user" | "system" | "code"; children?: FluidOsApiNavigationItem[]; } interface FluidOsNavigationBasic { id: number; name?: string | null; definition_id: number; platform: "web" | "mobile"; } interface FluidOsScreenBasic { id: number; name?: string | null; slug?: string | null; definition_id: number; } interface FluidOsScreen extends FluidOsScreenBasic { component_tree?: Record | null; } interface FluidOsTheme { id: number; config?: Record | null; active?: boolean | null; name?: string | null; definition_id: number; } //#endregion //#region ../core/src/app-definition-types.d.ts /** * Profile slice returned by `GET /api/app/manifest`. Permissions are * stripped server-side — the BFF only emits the data needed to render * the portal for the currently matched user. */ interface AppManifestProfile { id?: number; name?: string; default?: boolean; navigation?: { navigation_items?: FluidOsApiNavigationItem[]; }; themes?: FluidOsTheme[]; } /** * Rendered manifest returned by `GET /api/app/manifest`. Mirrors the * `FluidOsManifest` schema in the portal-tenant OpenAPI spec. */ interface AppManifest { name?: string; definition_id?: number; published_version?: number; published_at?: string; navigations?: FluidOsNavigationBasic[]; profile?: AppManifestProfile; screens?: FluidOsScreen[]; themes?: FluidOsTheme[]; } /** * Response shape for `GET /api/app/manifest`. * * Wraps the rendered `AppManifest` along with response metadata. This * is the canonical response type going forward. */ interface AppManifestResponse { manifest: AppManifest; meta: Required; } /** * @deprecated Kept only so the legacy `fetchDefinition()` shim on the * {@link AppDefinitionApi} port keeps building during migration. New * code should consume {@link AppManifestResponse} via `fetchManifest()`. */ interface AppFluidOsDefinition { id: number; name: string; version: string | null; components: Record[]; active: boolean; } /** * @deprecated Kept only so the legacy `fetchDefinition()` shim on the * {@link AppDefinitionApi} port keeps building during migration. New * code should consume {@link AppManifestResponse} via `fetchManifest()`. */ interface AppDefinitionResponse { definition: AppFluidOsDefinition; meta: Required; } //#endregion //#region ../core/src/app-definition-api.d.ts /** * Port interface for fetching the active FluidOS app manifest * from the portal-tenant BFF. * * The BFF exposes `GET /api/app/manifest`, which returns a rendered * manifest pre-matched to the current user's country, rank, and roles. */ interface AppDefinitionApi { /** * Fetch the rendered app manifest from `GET /api/app/manifest`. * This is the canonical endpoint going forward. */ fetchManifest(): Promise; /** * @deprecated Use {@link fetchManifest} instead. This shim synthesizes * the legacy `{ definition, meta }` shape from the new manifest * response so existing callers keep building during the migration. * It will be removed in a future release. */ fetchDefinition(): Promise; } //#endregion //#region ../core/src/app-definition-api-context.d.ts declare function useAppDefinitionApi(): AppDefinitionApi; //#endregion //#region src/types/page-template.d.ts /** * Category for organizing page templates in the registry */ interface PageCategory { /** Unique identifier for the category */ readonly id: string; /** Display label */ label: string; /** Icon identifier (e.g., lucide icon name) */ icon?: string; } /** * A reusable page template that can be shared across multiple navigations */ interface PageTemplate { /** Unique identifier for the template */ readonly id: string; /** URL-friendly slug */ slug: string; /** Display name */ name: string; /** Description of the template's purpose */ description?: string; /** Category ID for organization */ category: string; /** Tags for filtering and search */ tags?: readonly string[]; /** The widget tree that defines the page content */ component_tree: readonly WidgetSchema[]; /** Semantic version of the template */ version: string; /** Whether this is a core feature that cannot be removed */ isCore?: boolean; /** Default prop values that can be customized */ defaultProps?: Readonly>; /** Thumbnail image URL for UI display */ thumbnail?: string; } /** * Reference to a shared page template within a navigation */ interface PageReference { /** ID of the page template being referenced */ page_template_id: string; /** Screen ID to assign to this page in the navigation */ screen_id: number; /** Optional prop overrides (only prop values, not widget structure) */ overrides?: readonly PageOverride[]; } /** * Override for a specific widget's props within a page template */ interface PageOverride { /** ID of the widget to override (must match WidgetSchema.id in the template) */ readonly widget_id: string; /** Props to override (merged with original props) */ props: Readonly>; } /** * Built-in page category IDs */ declare const PAGE_CATEGORIES: { readonly CORE: "core"; readonly COMMERCE: "commerce"; readonly COMMUNICATION: "communication"; readonly DATA: "data"; readonly CUSTOM: "custom"; }; type PageCategoryId = (typeof PAGE_CATEGORIES)[keyof typeof PAGE_CATEGORIES]; //#endregion //#region src/types/navigation.d.ts /** * Screen definition with its component tree */ interface ScreenDefinition { readonly id: number; slug: string; name: string; component_tree: WidgetSchema[]; } /** * Navigation configuration for the portal */ interface Navigation { readonly definition_id: number; readonly id: number; name: string; navigation_items: NavigationItem[]; /** Local screen definitions (for backwards compatibility and custom screens) */ screens: ScreenDefinition[]; /** References to shared page templates from the registry */ page_refs?: PageReference[]; } //#endregion //#region src/types/profile.d.ts /** * Portal profile containing themes and navigation configuration */ interface Profile { /** Profile name */ name: string; /** Available themes for the portal */ themes: ThemeDefinition[]; /** Navigation structure and screens */ navigation: Navigation; /** Portal definition ID */ readonly definition_id: number; } //#endregion //#region src/types/screen-types.d.ts /** * Screen Types - Type definitions for core feature screens * * All status and type unions are derived from constants for single source of truth. * Use the constants (e.g., CONVERSATION_STATUSES.active) for type-safe comparisons. */ /** * Conversation status constant - single source of truth. */ declare const CONVERSATION_STATUSES: { readonly active: "active"; readonly archived: "archived"; readonly muted: "muted"; }; /** * Union type derived from CONVERSATION_STATUSES constant. */ type ConversationStatus = (typeof CONVERSATION_STATUSES)[keyof typeof CONVERSATION_STATUSES]; /** * Message type constant - single source of truth. */ declare const MESSAGE_TYPES: { readonly text: "text"; readonly image: "image"; readonly file: "file"; readonly system: "system"; }; /** * Union type derived from MESSAGE_TYPES constant. */ type MessageType = (typeof MESSAGE_TYPES)[keyof typeof MESSAGE_TYPES]; interface Participant { readonly id: string; readonly name: string; readonly email: string; readonly avatarUrl?: string; readonly isOnline?: boolean; } /** * Message attachment type - extracted for reusability and clarity. */ interface MessageAttachment { readonly id: string; readonly name: string; readonly url: string; readonly type: string; readonly size?: number; } interface Message { readonly id: string; readonly conversationId: string; readonly senderId: string; readonly senderName: string; readonly senderAvatarUrl?: string; readonly type: MessageType; readonly content: string; readonly timestamp: string; readonly isRead: boolean; readonly attachments?: readonly MessageAttachment[]; } interface Conversation { readonly id: string; readonly title: string; readonly participants: readonly Participant[]; readonly lastMessage?: Message; readonly unreadCount: number; readonly status: ConversationStatus; readonly createdAt: string; readonly updatedAt: string; } /** * Contact status constant - single source of truth. */ declare const CONTACT_STATUSES: { readonly active: "active"; readonly inactive: "inactive"; readonly lead: "lead"; readonly prospect: "prospect"; }; /** * Union type derived from CONTACT_STATUSES constant. */ type ContactStatus = (typeof CONTACT_STATUSES)[keyof typeof CONTACT_STATUSES]; /** * Contact type constant - single source of truth. */ declare const CONTACT_TYPES: { readonly individual: "individual"; readonly company: "company"; }; /** * Union type derived from CONTACT_TYPES constant. */ type ContactType = (typeof CONTACT_TYPES)[keyof typeof CONTACT_TYPES]; interface ContactAddress { readonly street?: string; readonly city?: string; readonly state?: string; readonly postalCode?: string; readonly country?: string; } interface Contact { readonly id: string; readonly firstName: string; readonly lastName: string; readonly email: string; readonly phone?: string; readonly company?: string; readonly jobTitle?: string; readonly avatarUrl?: string; readonly status: ContactStatus; readonly type: ContactType; readonly address?: ContactAddress; readonly tags?: readonly string[]; readonly notes?: string; readonly createdAt: string; readonly updatedAt: string; } //#endregion //#region src/providers/PageTemplateProvider.d.ts /** * Context value for page template resolution. * All properties are readonly since context values should not be mutated by consumers. */ interface PageTemplateContextValue { /** * Resolve a navigation's page_refs and screens into a unified screen list */ readonly resolvePages: (navigation: Navigation) => ScreenDefinition[]; /** * Get all available page templates */ readonly listTemplates: () => PageTemplate[]; /** * Get a specific template by ID */ readonly getTemplate: (id: string) => PageTemplate | undefined; /** * Check if a template exists */ readonly hasTemplate: (id: string) => boolean; } /** * Props for PageTemplateProvider */ interface PageTemplateProviderProps { children: React$1.ReactNode; /** * Additional custom page templates to register. * These are registered when the provider mounts and unregistered when it unmounts. */ templates?: readonly PageTemplate[]; } /** * Provider for page template resolution. * * This provider: * 1. Registers any custom templates passed via props * 2. Provides methods for resolving navigation pages * 3. Cleans up custom templates on unmount * * @example * ```tsx * // With custom templates * const customTemplates: PageTemplate[] = [ * { * id: 'custom-dashboard', * slug: 'dashboard', * name: 'Dashboard', * category: 'custom', * version: '1.0.0', * component_tree: [{ type: 'TextWidget', props: { text: 'Custom Dashboard' } }], * }, * ]; * * * * * * // Without custom templates (uses only core templates) * * * * ``` */ declare function PageTemplateProvider({ children, templates }: PageTemplateProviderProps): React$1.JSX.Element; /** * Hook to access page template functionality. * * @throws Error if used outside of PageTemplateProvider * * @example * ```tsx * function NavigationRenderer({ navigation }: { navigation: Navigation }) { * const { resolvePages } = usePageTemplates(); * const screens = resolvePages(navigation); * * return ( *
* {screens.map((screen) => ( * * ))} *
* ); * } * ``` */ declare function usePageTemplates(): PageTemplateContextValue; /** * Hook to resolve navigation pages directly. * Convenience wrapper around usePageTemplates().resolvePages. * * @param navigation - The navigation to resolve * @returns Array of resolved screen definitions */ declare function useResolvedPages(navigation: Navigation): ScreenDefinition[]; //#endregion //#region src/errors/portal-error-reporter.d.ts type PortalErrorBoundarySurface = "root" | "screen"; interface PortalErrorContext { boundary: PortalErrorBoundarySurface; componentStack?: ErrorInfo["componentStack"]; pathname?: string; activeSlug?: string; baseSlug?: string; restParams?: string; screenTitle?: string; navItemSlug?: string; screenId?: string | number; } type PortalErrorReporter = (error: Error, context: PortalErrorContext) => void; //#endregion //#region ../core/src/member-type-content.d.ts /** * Per-member-type portal content. * * Lets a portal serve different screens to different member types — e.g. * an `affiliate` sees a different dashboard at the `home` slug than a * `customer` does — without forking the whole app. Keyed by the real * member-type slug (from `member_type_detail.slug`), then by page slug. * * Resolution order in the router: a per-type page for the current * member's slug wins over the global `customPages` entry for the same * slug, which in turn wins over the built-in system screen. A member type * with no entry falls through to the global content unchanged. */ /** A portal page component, receiving the resolved slug and rest params. */ type CustomPageComponent = ComponentType<{ slug?: string; params?: string; }>; /** Page components keyed by navigation slug. */ type CustomPages = Record; /** Per-member-type page overrides: memberTypeSlug -> (pageSlug -> component). */ type MemberTypeCustomPages = Record; //#endregion //#region src/shell/AppShell.d.ts interface AppShellProps { /** Pre-fetched app data (skips internal useFluidApp call if provided) */ appData?: RepAppData; /** Override navigation items (otherwise derived from appData/API) */ navigation?: NavigationItem[]; /** Custom page components keyed by slug */ customPages?: Record>; /** Per-member-type page overrides, resolved by the current member's slug. */ memberTypeCustomPages?: MemberTypeCustomPages; /** Base path for subpath deployments (e.g. "/portal"). Default: "/" */ basePath?: string; /** Controlled current slug */ currentSlug?: string; /** Navigation callback */ onNavigate?: (slug: string) => void; /** Custom sidebar header slot */ sidebarHeader?: ReactNode; /** Custom sidebar footer slot. When provided, replaces the default logout button. */ sidebarFooter?: ReactNode; /** * Callback invoked after the user logs out and all client state has been cleared. * If not provided, a default logout button is still rendered, but no post-logout * action is taken (consumers should pair this with `logoutRedirectUrl` * or provide their own `sidebarFooter`). */ onLogout?: () => void; /** URL to redirect to after logout (e.g. "/login"). Takes precedence over `onLogout`. */ logoutRedirectUrl?: string; /** Optional reporter for screen-level crashes. Falls back to console logging when omitted. */ errorReporter?: PortalErrorReporter; /** Render prop or static children for the content area */ children?: ReactNode | ((props: { currentSlug: string; currentNavItem: NavigationItem | undefined; }) => ReactNode); } declare function AppShell({ appData: appDataProp, navigation: navigationProp, customPages, memberTypeCustomPages, basePath, currentSlug: controlledSlug, onNavigate: onNavigateProp, sidebarHeader, sidebarFooter, onLogout, logoutRedirectUrl, errorReporter, children }: AppShellProps): React.JSX.Element; //#endregion //#region src/entry/create-portal.d.ts /** Route values supplied to a custom portal page component. */ interface PortalCustomPageProps { /** Matched portal route slug. */ readonly slug?: string; /** Remaining route path after the matched slug. */ readonly params?: string; } /** Children supplied to a portal-wide provider component. */ interface PortalProviderProps { /** Complete portal tree wrapped by the provider. */ readonly children: ReactNode; } /** Configuration accepted by {@link createPortal}. */ interface PortalConfig { /** Custom React pages keyed by their portal slug. */ readonly customPages?: Record>; /** * Per-member-type page overrides: memberTypeSlug -> (pageSlug -> component). * Serves different screens to different member types (e.g. an `affiliate` * dashboard) at the same slug. Wins over `customPages` for that member type. */ readonly memberTypeCustomPages?: MemberTypeCustomPages; /** Remote DOM packages, host functions, and package-loading options. */ readonly remoteWidgets?: RemoteWidgetOptions; /** Partial SDK configuration merged with the SDK defaults. */ readonly fluid?: Partial; /** DOM element id where the portal mounts. @defaultValue `"root"` */ readonly rootId?: string; /** App shell options; page and error hooks come from the top-level config. */ readonly shell?: Omit; /** Optional component that wraps the complete portal tree with app providers. */ readonly providers?: ComponentType; /** Receives uncaught root and shell errors with portal context. */ readonly errorReporter?: PortalErrorReporter; /** Disables React Strict Mode when an integration cannot tolerate development double invocation. */ readonly disableStrictMode?: boolean; } /** * Mounts a portal with the shared SDK provider and canonical widget catalog. * * @param config - Portal pages, SDK settings, Remote DOM packages, and host integration hooks. * @throws If the configured root element does not exist. */ declare function createPortal(config?: PortalConfig): void; //#endregion //#region src/widgets/remote/host/elements/remote-dom-component-renderers.d.ts /** Host-only React renderers; the runtime keeps only contract-allowed tags. */ declare const REMOTE_DOM_COMPONENT_RENDERERS: RemoteComponentRendererMap; /** Keeps every portal generated by a widget inside that widget's shadow tree. */ declare function wrapRemoteDomRoot(root: ReactElement, portalContainer: HTMLElement): ReactNode; //#endregion //#region src/config/defaults.d.ts /** * Creates a FluidSDKConfig with sensible defaults. * * Default behavior: * - baseUrl: reads from `VITE_API_URL` env var, falls back to `""` (same-origin relative) * - Auth: relies on session cookies sent via `credentials: 'include'` * * Pass overrides to customize any field: * ```ts * const config = createDefaultFluidConfig({ baseUrl: "https://my-api.example.com" }); * ``` */ declare function createDefaultFluidConfig(overrides?: Partial): FluidSDKConfig; //#endregion //#region src/hooks/use-fluid-profile.d.ts /** * Base query key for profile data. * Kept for backwards compatibility — the runtime key used by the hook * includes a company prefix via {@link useCompanyScopedQueryKey}. * * @deprecated Use {@link APP_DATA_QUERY_KEY} with `useFluidApp` instead. */ declare const PROFILE_QUERY_KEY: readonly ["fluid", "profile"]; /** * Hook to fetch the portal profile (themes, navigation, screens). * * Internally fetches from the fluidos API (same data source as * {@link useFluidApp}) and selects the `profile` slice, so no * legacy `/api/rep_app/manifest` call is made. * * @deprecated Use `useFluidApp()` instead — it returns the full * `RepAppData` including `profile`, `screens`, and more. * * @example * ```tsx * function Navigation() { * const { data: profile, isLoading } = useFluidProfile(); * * if (isLoading) return ; * * return ( * * ); * } * ``` */ declare function useFluidProfile(): UseQueryResult; //#endregion //#region src/transforms/screen-transforms.d.ts /** Raw screen from the FluidOS API */ interface RawApiScreen { id: number | string; definition_id?: number | string; name?: string | null; slug?: string | null; component_tree?: unknown; } /** * Normalize component_tree to always be an array. * The API stores component_tree as a hash (object), but the frontend expects an array. */ declare function normalizeComponentTree(componentTree: unknown): WidgetSchema[]; /** * Convert a raw FluidOS screen to ScreenDefinition. * Normalizes component_tree and converts string IDs to numbers. */ declare function toScreenDefinition(screen: RawApiScreen): ScreenDefinition$1; //#endregion //#region src/transforms/navigation-transforms.d.ts /** Raw navigation item from the FluidOS API. */ type RawApiNavigationItem = FluidOsApiNavigationItem; declare function toNavigationItem(item: RawApiNavigationItem): NavigationItem; //#endregion //#region src/transforms/index.d.ts /** * Raw manifest shape consumed by the transform pipeline. * * A structural superset of `AppManifestResponse` that also accommodates * the legacy `RepAppData` fixtures produced by * `packages/cli/portal/src/vite-plugin/build-manifest.ts` in dev mode. * Fields that are optional here are either (a) never emitted by * `/api/app/manifest` or (b) emitted only by the dev-mode fixture. In both * cases `transformManifestToRepAppData` supplies `?? fallback` defaults. */ interface RawManifestResponse { manifest: { definition_id?: number; published_version?: number; screens?: RawApiScreen[]; profile?: { name?: string; definition_id?: number; themes?: RawApiTheme[]; navigation?: { id?: number; name?: string; definition_id?: number; navigation_items?: RawApiNavigationItem[]; }; mobile_navigation?: { id?: number; name?: string; definition_id?: number; navigation_items?: RawApiNavigationItem[]; }; }; }; } /** * Convert an `AppManifestResponse` into the `RawManifestResponse` shape * expected by the transform pipeline. `AppManifestResponse` is structurally * assignable to `RawManifestResponse`, so this is a runtime-only guard that * rejects empty payloads. */ declare function toRawManifest(response: AppManifestResponse): RawManifestResponse; /** * Transform a raw FluidOS manifest API response into RepAppData. * * Handles: * - Theme transformation (legacy and new formats) * - Screen normalization (component_tree array wrapping) * - Navigation item transformation (recursive with position sorting) */ declare function transformManifestToRepAppData(response: RawManifestResponse): RepAppData; //#endregion //#region src/hooks/use-fluid-app.d.ts /** * Base query key for full app data (rendered manifest endpoint). * Kept for backwards compatibility — the runtime key used by the hook * includes a company prefix via {@link useCompanyScopedQueryKey}. */ declare const APP_DATA_QUERY_KEY: readonly ["fluid", "app"]; /** * Hook to fetch the full portal app data from the rendered-manifest endpoint. * * Returns a `RepAppData` object containing: * - `screens` — all screen definitions with normalized component trees * - `profile.themes` — fully-transformed ThemeDefinition[] (handles legacy + new formats) * - `profile.activeThemeId` — the currently active theme ID * - `profile.navigation.navigation_items` — sorted, recursive navigation tree * * Uses IndexedDB persistence so subsequent page loads hydrate instantly * from cache while revalidating in the background. The raw API response * (plain JSON) is cached; Color objects are recreated from cache via * `select` on every restore — this is fast (CPU only, no network). * * @example * ```tsx * function App() { * const { data: appData, isLoading } = useFluidApp(); * * if (isLoading) return ; * * return ( * * ); * } * ``` */ declare function useFluidApp(options?: { enabled?: boolean; }): UseQueryResult; //#endregion //#region src/hooks/use-app-definition.d.ts /** * Base query key for the app definition endpoint. * The runtime key includes a company prefix via {@link useCompanyScopedQueryKey}. */ declare const APP_DEFINITION_QUERY_KEY: readonly ["fluid", "app-definition"]; /** * Hook to fetch the active app manifest from the portal-tenant BFF. * * Returns the manifest metadata (id, name, version) * sourced from `GET /api/app/manifest` via the {@link AppDefinitionApi} port. * * @example * ```tsx * function MyComponent() { * const { data } = useAppDefinition(); * const definitionId = data?.definition.id ?? 0; * } * ``` */ declare function useAppDefinition(options?: { enabled?: boolean; }): UseQueryResult; //#endregion //#region src/hooks/use-fluid-theme.d.ts /** * Result of useFluidTheme hook */ interface UseFluidThemeResult { /** Currently active theme */ currentTheme: ThemeDefinition | null; /** Switch to a different theme */ setTheme: (theme: ThemeDefinition) => void; /** Switch between light and dark mode */ setThemeMode: (mode: "light" | "dark") => void; /** Current theme mode (convenience accessor) */ mode: "light" | "dark" | undefined; } /** * Hook to access and control theme settings * * @example * ```tsx * function ThemeSwitcher({ themes }: { themes: ThemeDefinition[] }) { * const { currentTheme, setTheme, setThemeMode, mode } = useFluidTheme(); * * return ( *
* * * *
* ); * } * ``` */ declare function useFluidTheme(): UseFluidThemeResult; //#endregion //#region src/hooks/query-keys.d.ts /** * Create a company-scoped query key by prepending ["company", companyId]. * * @param companyId - The company ID * @param baseKey - The base query key segments (e.g. ["fluid", "profile"]) * @returns A tuple like ["company", 42, "fluid", "profile"] */ declare function createCompanyQueryKey(companyId: number, ...baseKey: readonly string[]): readonly ["company", number, ...string[]]; /** * Hook that returns a `scopeKey` function. * * In portal-tenant, each tenant is a single company, so keys are * returned unscoped (no company prefix). */ declare function useCompanyScopedQueryKey(): { readonly companyId: number | undefined; readonly scopeKey: (baseKey: T) => readonly (string | number)[]; }; //#endregion //#region src/hooks/use-logout.d.ts interface UseLogoutOptions { /** URL to redirect to after logout. Triggers a full page navigation. */ redirectUrl?: string; /** Callback invoked after all state is cleared. Ignored when `redirectUrl` is set. */ onLogout?: () => void; } /** * Hook that returns a `logout` function which clears the server session * via `DELETE /logout` and all cached/persisted client state. * * @example * ```tsx * const logout = useLogout({ redirectUrl: "/login" }); * * ``` * * @example * ```tsx * const logout = useLogout({ * onLogout: () => navigate("/signed-out"), * }); * ``` */ declare function useLogout({ redirectUrl, onLogout }?: UseLogoutOptions): () => Promise; //#endregion //#region ../core/src/account-types.d.ts /** * Legacy binary member-type discriminator. Kept for back-compat; prefer * `AccountRep.member_type_detail` for the real per-company type and its * permissions. New code should gate on permissions, not on this string. */ type AccountMemberType = "customer" | "rep"; /** * A member-type permission key from the backend `permissions` JSONB. Open * set — new capability keys can appear before this union is widened, so * consumers must treat unknown keys as "denied" rather than assuming the * set is exhaustive. `rep_eligible` gates rep-only portal surfaces. */ type MemberPermissionKey = "rep_eligible" | "search_enabled" | (string & {}); /** * The full per-company member type. `slug` is the real type slug * (`rep`, `customer`, or a company-custom slug like `affiliate`), `name` * is the admin-facing display label, and `permissions` is the capability * map that drives portal gating. */ interface MemberTypeDetail { slug: string; name: string; permissions: Partial>; } interface AccountRep { id: number; member_type: AccountMemberType; /** * Full per-company member type (slug, display name, permissions). Null * when the backend has no native member type for this membership yet * (backfill gap) — callers then fall back to the binary `member_type`. */ member_type_detail: MemberTypeDetail | null; first_name: string; last_name: string; email: string; phone: string | null; bio: string | null; avatar_url: string | null; slug: string; /** * Full public URL of this member's MySite page. Present for every member * type, customers included. Null until a username is set. */ mysite_url: string | null; public_id: string; social_links: Record | null; /** * Messaging recipient id. Non-null for reps with a recipient row; * null for customers (messaging is rep-only). */ recipient_id: number | null; /** * ISO 3166-1 alpha-2 country code derived from the customer's default * shipping address. Null for rep-only memberships and customers * without a default address. */ default_country_iso: string | null; /** * Fair Share attribution GUID for this member, scoped to the current * portal's company. Rendered as the FairShare SDK's `data-share-guid` so a * logged-in rep's in-portal shopping is attributed to them. Equal to the * member's username (`slug`); null for customers (who must not be * self-attributed). */ share_guid: string | null; /** * ISO 3166-1 alpha-2 country code of the member's market, resolved by the * BFF as user.country || company.default_country — the same market the Shop * prices against. Use to seed cart locale so cart pricing matches the * storefront. Null only when neither is set. */ market_country_iso: string | null; /** * ISO code of the member's saved portal language preference, written * per-company. Seed this as the default content locale. Null when no * language has been set. */ language_iso: string | null; } //#endregion //#region src/hooks/use-account.d.ts /** * Fetches the current user's account from GET /api/account. * Replaces the old useCurrentUser (which called non-existent /api/me). */ declare function useAccount(): UseQueryResult; //#endregion //#region src/pwa/detect-pwa-display-mode.d.ts /** * Whether the portal is running as an installed PWA (`standalone`) or in a * normal browser tab (`browser`). * * This is the PWA analogue of the native shell's `isNativeApp`: it lets the app * render app-like UI (native-feel sheets, hidden browser-only affordances) once * a company's PWA is added to the home screen. Kept separate from the * `native-capabilities` port, which models the native WebView bridge — a * different concern. Compose them at the point of use: * `isNativeApp || displayMode === "standalone"`. */ type PwaDisplayMode = "standalone" | "browser"; //#endregion //#region src/pwa/use-pwa-display-mode.d.ts /** * Reactive `"standalone" | "browser"` for the current session. Updates if the * display mode changes mid-session (e.g. the user installs and relaunches). */ declare function usePwaDisplayMode(): PwaDisplayMode; //#endregion //#region src/hooks/use-member-type.d.ts interface MemberTypeInfo { /** Real per-company member-type slug (rep/customer/affiliate/...), or null while loading. */ slug: string | null; /** Admin-facing display label (e.g. "Affiliate"), or null when unknown. */ name: string | null; /** Whether the member may access rep-only surfaces (rep_eligible). */ canAccessRepSurfaces: boolean; /** Predicate for any member-type permission key. */ can: (key: MemberPermissionKey) => boolean; /** True until the account query resolves. */ isLoading: boolean; } /** * Resolve the current member's type identity and capabilities. * * The single hook UI should use to display the member type (name/slug) and * to gate behavior on permissions, instead of comparing the binary * `member_type` string. Backed by the same cached `useAccount()` query. */ declare function useMemberType(): MemberTypeInfo; //#endregion //#region ../core/src/member-permissions.d.ts type MaybeAccount = Pick | null | undefined; /** * Whether the current member has the given capability. * * Prefers the native `member_type_detail.permissions` map. When no detail * is present yet (backfill gap), falls back to the legacy binary type: * `rep_eligible` is granted to reps and denied to customers, preserving * today's behavior. Unknown keys deny by default. */ declare function hasMemberPermission(account: MaybeAccount, key: MemberPermissionKey): boolean; /** * Whether the current member may access rep-only portal surfaces * (Messages, My Site, and any rep-gated custom screen). This is the single * gate the shell should consult instead of `member_type === "customer"`. */ declare function canAccessRepSurfaces(account: MaybeAccount): boolean; /** * Whether the member is KNOWN to lack rep access — true only once a loaded * account resolves to no rep-eligibility. An unresolved (loading) or absent * account is NOT treated as denied, so shell gating stays permissive while * the account query is in flight. This matches the pre-migration behavior * (which defaulted an unknown member to rep) and avoids briefly filtering a * rep's own navigation — which, combined with the root-path redirect, could * otherwise misroute a rep whose first item is rep-only. Use this for * gating; use `canAccessRepSurfaces` for a positive capability check on an * already-loaded account. */ declare function deniesRepSurfaces(account: MaybeAccount): boolean; /** * The real per-company member-type slug (`rep`, `customer`, or a custom * slug like `affiliate`). Falls back to the binary `member_type` when no * detail is present. */ declare function memberTypeSlug(account: MaybeAccount): string | null; /** * The admin-facing display label for the member type (e.g. "Affiliate"). * Null when no detail is present — callers should not fabricate a label * from the binary type. */ declare function memberTypeName(account: MaybeAccount): string | null; //#endregion //#region ../core/src/store-types.d.ts interface Store { id: number; name: string; subdomain: string; logo_url: string | null; icon_url: string | null; appstore_url: string | null; playstore_url: string | null; bundle_subscriptions_enabled: boolean; allow_username_edit: boolean; allow_name_edit: boolean; activity_screen_enabled: boolean; hide_volume_on_customer_surfaces: boolean; reward_points_label_singular: string; reward_points_label_plural: string; } //#endregion //#region src/hooks/use-store.d.ts /** * Fetches the tenant store branding from GET /api/store. Requires a * StoreApiProvider (throws otherwise) — use `useOptionalStore()` from * portal-react in contexts where the provider may be absent. */ declare function useStore(): UseQueryResult; //#endregion //#region src/hooks/use-company-switch.d.ts interface UseCompanySwitchOptions {} /** * Hook that handles company switching for the portal. * * Calls PUT /api/authentication/company/{id}/switch, clears the TanStack * Query cache and IndexedDB persisted cache, then reloads the page so all * queries re-fetch with the new company context. * * The server updates the session cookie automatically via the switch * endpoint response; no client-side token storage is needed. */ declare function useCompanySwitch(_options?: UseCompanySwitchOptions): { switchCompany: (companyId: number) => void; isPending: boolean; isError: boolean; error: Error | null; }; //#endregion //#region src/hooks/hook-types.d.ts /** * Hook type utilities and type predicates. * * This module provides: * - Generic hook result types with default type parameters * - Type predicates for query state narrowing * - Reusable patterns for type-safe property access in hooks * * Following generics best practices: * - generics-default-type-parameters: Default E to Error for common case * - generics-type-predicates: Type predicates for result state narrowing * - generics-constrain-type-parameters: K extends keyof T for property access */ /** * Base result type for query hooks with default error type. * Uses default type parameter for E (generics-default-type-parameters rule). * * @typeParam T - The data type * @typeParam E - The error type (defaults to Error) * * @example * // Error type defaults to Error * type UsersResult = QueryResult; * * // Can override when needed * type CustomResult = QueryResult; */ interface QueryResult { readonly data: T; readonly isLoading: boolean; readonly isError: boolean; readonly error?: E | undefined; } /** * Result type for hooks that may not have data yet. * Extends QueryResult with nullable data. * * @typeParam T - The data type * @typeParam E - The error type (defaults to Error) */ interface QueryResultNullable { readonly data: T | null | undefined; readonly isLoading: boolean; readonly isError: boolean; readonly error?: E | undefined; } /** * Result type for list/collection hooks with aggregates. * * @typeParam T - The item type in the array * @typeParam E - The error type (defaults to Error) */ interface ListQueryResult extends QueryResult { readonly totalCount: number; } /** * Result type for list hooks with value aggregation (e.g., deals with total value). * * @typeParam T - The item type in the array * @typeParam E - The error type (defaults to Error) */ interface ValueListQueryResult extends ListQueryResult { readonly totalValue: number; } /** * Type predicate to check if a query result has successfully loaded data. * Narrows the data type from T | null | undefined to T. * * @example * const result = useContact(id); * if (hasData(result)) { * // TypeScript knows result.data is Contact, not Contact | null * console.log(result.data.name); * } */ declare function hasData(result: QueryResultNullable): result is QueryResultNullable & { readonly data: T; }; /** * Type predicate to check if a query result is in loading state. * Useful for conditional rendering. * * @example * if (isLoading(result)) { * return ; * } */ declare function isLoading(result: QueryResult | QueryResultNullable): boolean; /** * Type predicate to check if a query result has an error. * Narrows to include the error property. * * @example * if (isErrorResult(result)) { * console.error(result.error); // error is E, not undefined * } */ declare function isErrorResult(result: QueryResult | QueryResultNullable): result is (QueryResult | QueryResultNullable) & { readonly isError: true; readonly error: E; }; /** * Type predicate to check if a query result is in idle state (not loading, no error, has data). * * @example * if (isIdle(result)) { * // Safe to access and render data * } */ declare function isIdle(result: QueryResult | QueryResultNullable): boolean; /** * Type-safe property selector for hook results. * Uses K extends keyof T constraint (generics-function-constraints rule). * * @typeParam T - The data object type * @typeParam K - Key of T (constrained to actual keys) * * @example * const users = [{ name: "Alice", age: 30 }]; * const names = selectProperty(users, "name"); // string[] * const ages = selectProperty(users, "age"); // number[] * selectProperty(users, "invalid"); // Error: "invalid" not in "name" | "age" */ declare function selectProperty(items: readonly T[], key: K): T[K][]; /** * Type-safe property getter for a single item. * Returns undefined if item is null/undefined. * * @typeParam T - The data object type * @typeParam K - Key of T (constrained to actual keys) */ declare function getProperty(item: T | null | undefined, key: K): T[K] | undefined; /** * Generic type for hooks that fetch a single resource by ID. * Useful for creating consistent API across different resource types. * * @typeParam T - The resource type * @typeParam E - The error type (defaults to Error) */ type UseSingleResourceHook = (id: string) => QueryResultNullable; /** * Generic type for hooks that fetch a list of resources with optional params. * Uses generics-default-type-parameters for the params type. * * @typeParam T - The item type * @typeParam P - The params type (defaults to empty object) * @typeParam E - The error type (defaults to Error) */ type UseListResourceHook = Record, E = Error> = (params?: P) => ListQueryResult; /** * Transforms a nullable result to a non-nullable one if data exists. * Useful when you've already checked hasData(). */ type WithData> = R extends QueryResultNullable ? QueryResultNullable & { readonly data: T; } : never; /** * Activity slug constants as a const object. * Derive the ActivitySlug type from this single source of truth. */ declare const ACTIVITY_SLUGS: { readonly abandonedCart: "abandoned_cart"; readonly announcements: "announcements"; readonly cartItemsAdded: "cart_items_added"; readonly commentReply: "comment_reply"; readonly directMessage: "direct_message"; readonly fantasyPoint: "fantasy_point"; readonly newLead: "new_lead"; readonly orderPlaced: "order_placed"; readonly pageViews: "page_views"; readonly pageViewsContact: "page_views_contact"; readonly tasks: "tasks"; readonly upcomingEvent: "upcoming_event"; readonly video: "video"; readonly videoComplete: "video_complete"; readonly videoCompleteContact: "video_complete_contact"; readonly videoContact: "video_contact"; readonly messageReceived: "message_received"; readonly messageSent: "message_sent"; readonly newCartItemsAdded: "new_cart_items_added"; readonly smartLinkClicked: "smart_link_clicked"; readonly reviewLeft: "review_left"; }; /** Activity slug union type derived from ACTIVITY_SLUGS constant. */ type ActivitySlug = (typeof ACTIVITY_SLUGS)[keyof typeof ACTIVITY_SLUGS]; /** Type predicate to check if a string is a valid ActivitySlug. */ declare function isActivitySlug(value: string): value is ActivitySlug; /** Transformed activity for display. */ interface Activity { readonly id: number; readonly userName: string; readonly avatarUrl: string | null; readonly activityType: string; readonly targetName: string; readonly timestamp: string; readonly slug: ActivitySlug; } /** Description/rich text metadata for a calendar event. */ interface CalendarEventDescription { readonly id?: number | null; readonly name?: string | null; readonly body?: string | null; readonly record_type?: string | null; readonly record_id?: number | null; readonly created_at?: string | null; readonly updated_at?: string | null; readonly locale?: string | null; } /** Calendar event data from the API. */ interface CalendarEvent { readonly id: number; readonly title: string; readonly description?: CalendarEventDescription | null; readonly color?: string | null; readonly url?: string | null; readonly start: string; readonly end: string; readonly active?: boolean | null; readonly time_zone?: string | null; readonly status?: string | null; readonly image_url?: string | null; readonly images?: readonly unknown[] | null; readonly venue?: string | null; readonly countries?: readonly string[] | null; readonly hasTomorrow?: boolean | null; readonly hasYesterday?: boolean | null; readonly isAllDay?: boolean; } /** Catch up suggestion data from the API. */ interface CatchUp { readonly id: number; readonly suggestion_title: string; } /** MySite data returned by the hook. */ interface MySiteData { readonly url: string | null; readonly views: number; readonly leads: number; readonly userName: string; } /** Transformed todo for display. */ interface Todo { readonly id: number; readonly body: string; readonly dueAt: string | null; readonly completedAt: string | null; readonly createdAt: string; readonly contactName: string | null; } //#endregion //#region src/hooks/use-calendar-events.d.ts /** * Result type for useCalendarEvents hook. * Uses QueryResult with default Error type. */ type UseCalendarEventsResult = QueryResult; /** * Hook to fetch calendar events. * This is a stub implementation - override with your own data fetching logic. */ declare function useCalendarEvents(): UseCalendarEventsResult; //#endregion //#region src/hooks/use-todos.d.ts /** * Result type for useTodos hook. * Uses QueryResult with default Error type. */ type UseTodosResult = QueryResult; /** * Hook to fetch todo items. * This is a stub implementation - override with your own data fetching logic. */ declare function useTodos(): UseTodosResult; //#endregion //#region src/hooks/use-activities.d.ts /** * Result type for useActivities hook. * Uses QueryResult generic with the activities + optional windowed totalCount. */ type UseActivitiesData = { activities: Activity[]; totalCount?: number; }; type UseActivitiesResult = QueryResult; /** * Hook to fetch recent activities. The optional `daysAgo` arg windows the * result (e.g. `useActivities({ daysAgo: 7 })`) and surfaces the windowed * total via `data.totalCount` — used by the Recent Activity widget chip. * This is a stub implementation - override with your own data fetching logic. */ declare function useActivities(_args?: { daysAgo?: number; }): UseActivitiesResult; //#endregion //#region src/hooks/use-catchups.d.ts /** * Result type for useCatchUps hook. * Uses QueryResult with default Error type. */ type UseCatchUpsResult = QueryResult; /** * Hook to fetch catch up items. * This is a stub implementation - override with your own data fetching logic. */ declare function useCatchUps(): UseCatchUpsResult; //#endregion //#region src/hooks/use-mysite.d.ts /** * Result type for useMySite hook. * Uses QueryResultNullable since MySite data may not be available. */ type UseMySiteResult = QueryResultNullable; /** * Hook to fetch MySite data. * This is a stub implementation - override with your own data fetching logic. */ declare function useMySite(): UseMySiteResult; //#endregion //#region src/hooks/use-conversations.d.ts /** * Result type for useConversations hook. * Uses QueryResult with default Error type. */ type UseConversationsResult = QueryResult; /** * Hook to fetch all conversations. * This is a stub implementation - override with your own data fetching logic. * * @returns UseConversationsResult with empty data array * * @example * ```tsx * const { data: conversations, isLoading, isError } = useConversations(); * * if (isLoading) return ; * if (isError) return ; * * return conversations.map(conv => ); * ``` */ declare function useConversations(): UseConversationsResult; /** * Result type for useConversationMessages hook. * Uses QueryResult with default Error type. */ type UseConversationMessagesResult = QueryResult; /** * Hook to fetch messages for a specific conversation. * This is a stub implementation - override with your own data fetching logic. * * @param conversationId - The ID of the conversation to fetch messages for * @returns UseConversationMessagesResult with empty data array * * @example * ```tsx * const { data: messages, isLoading, isError } = useConversationMessages(conversationId); * * if (isLoading) return ; * if (isError) return ; * * return messages.map(msg => ); * ``` */ declare function useConversationMessages(_conversationId: string): UseConversationMessagesResult; //#endregion //#region src/hooks/use-contacts.d.ts /** * Type predicate to check if a status string is a valid ContactStatus. * Enables runtime validation with type narrowing. */ declare function isContactStatus(value: string): value is ContactStatus; /** * Parameters for filtering and paginating contacts. * Uses readonly properties and proper ContactStatus type for status. */ interface UseContactsParams { /** Search query to filter contacts by name, email, or company */ readonly search?: string; /** Filter contacts by status - uses ContactStatus union type for type safety */ readonly status?: ContactStatus; /** Maximum number of contacts to return */ readonly limit?: number; } /** * Result type for the useContacts hook. * Uses ListQueryResult with totalCount and default Error type. */ type UseContactsResult = ListQueryResult; /** * Result type for the useContact hook. * Uses QueryResultNullable since a specific contact may not exist. */ type UseContactResult = QueryResultNullable; /** * Hook to fetch a list of contacts with optional filtering and pagination. * This is a stub implementation - override with your own data fetching logic. * * @param params - Optional parameters for filtering and pagination * @returns Object containing contacts data, loading state, error state, and total count * * @example * ```tsx * const { data: contacts, isLoading, totalCount } = useContacts({ * search: 'john', * status: 'active', * limit: 20 * }); * ``` */ declare function useContacts(_params?: UseContactsParams): UseContactsResult; /** * Hook to fetch a single contact by ID. * This is a stub implementation - override with your own data fetching logic. * * @param contactId - The unique identifier of the contact to fetch * @returns Object containing contact data, loading state, and error state * * @example * ```tsx * const { data: contact, isLoading, isError } = useContact('contact-123'); * ``` */ declare function useContact(_contactId: string): UseContactResult; //#endregion //#region ../../platform/auth/src/types.d.ts /** * Auth Types * * These types define the JWT payload structure and authentication * configuration options. */ /** * User type constant - single source of truth for user role values. * Use USER_TYPES.admin instead of "admin" for type-safe comparisons. */ declare const USER_TYPES: { readonly admin: "admin"; readonly rep: "rep"; readonly root_admin: "root_admin"; readonly customer: "customer"; }; /** * Union type of all user types, derived from USER_TYPES constant. * @see deriving-typeof-for-object-keys pattern */ type UserType = (typeof USER_TYPES)[keyof typeof USER_TYPES]; /** * Runtime validation for user types. * @param value - The value to check * @returns true if value is a valid UserType */ declare function isUserType(value: string): value is UserType; //#endregion //#region ../../messaging/core/src/types.d.ts /** * Domain types for the messaging package. * * These are owned by messaging-core and represent the contract that * any API adapter (current client, future BFF) must satisfy. * Consuming packages import from here — never from the API client directly. */ interface PaginationObject { pagination: { current: number; previous: number | null; next: number | null; per_page: number; pages: number; count: number; }; } type Paginated = [PaginationObject, { items: T[]; }]; interface AttachmentMetadata { width?: number; height?: number; } interface Attachment { id: number; url: string; filename: string; kind: string; image_url: string | null; image_path: string | null; content_type: string | null; attachable_type: string | null; attachable_id: number | null; thumbnail_url: string | null; metadata: AttachmentMetadata | null; content_size: number | null; } interface MessageAttachmentInput { url: string; filename: string; kind: string; content_type?: string; content_size?: number; metadata?: AttachmentMetadata; } interface LinkPreview { url: string; title?: string | null; description?: string | null; images?: string[]; videos?: string[]; favicon?: string | null; error?: string | null; original_url?: string | null; } interface InfoMessageRecipient { id: number; first_name: string; last_name: string; } interface DefaultMessageMetadata { links: LinkPreview[]; client_message_id?: string | number | null; } interface SystemConversationUpdateMetadata { name: string; previous_name: string; client_message_id?: string | number | null; links?: LinkPreview[]; } interface SystemConversationCreatedMetadata { conversation_name: string; description?: string; member_count: number; auto_add_recipients: boolean; client_message_id?: string | number | null; links?: LinkPreview[]; } interface SystemRecipientActionMetadata { recipient_ids_added?: number[]; recipient_ids_removed?: number[]; recipient_ids_left?: number[]; recipient_ids_joined?: number[]; recipient_added?: InfoMessageRecipient[]; recipient_removed?: InfoMessageRecipient[]; recipient_left?: InfoMessageRecipient[]; recipient_joined?: InfoMessageRecipient[]; client_message_id?: string | number | null; links?: LinkPreview[]; } interface InfoMessageMetadataShape { recipient_added?: InfoMessageRecipient[]; recipient_ids_added?: number[]; recipient_removed?: InfoMessageRecipient[]; recipient_ids_removed?: number[]; links?: LinkPreview[]; client_message_id?: string | number | null; } type MessageMetadata = DefaultMessageMetadata | null | SystemConversationUpdateMetadata | SystemConversationCreatedMetadata | SystemRecipientActionMetadata | InfoMessageMetadataShape; interface Recipient { id: number; first_name: string; last_name: string; avatar_url: string | null; image_url: string | null; receivable_id: number; receivable_type: "Contact" | "UserCompany"; discarded_at: string | null; left_conversation_at: string | null; blocked: boolean | null; country_name: string | null; pro_user: boolean; avatar_background: string | null; email?: string | null; phone?: string | null; status?: "online" | "offline" | "away"; last_online?: string | null; "conversation_messaging_enabled?"?: boolean; } interface ReducedRecipient { id: number; first_name: string; last_name: string; image_url: string | null; discarded_at: string | null; blocked: boolean | null; blocker: boolean | null; avatar_background: string | null; seen_at?: string | null; email?: string | null; phone?: string | null; pro_user?: boolean; } interface SlimmedRecipient { id: number; first_name: string; last_name: string; discarded_at: string | null; blocked: boolean | null; avatar_background: string | null; email?: string | null; phone?: string | null; removed_at?: string | null; } interface WithContactRecipient { id: number; email?: string | null; phone?: string | null; first_name?: string | null; last_name?: string | null; image_url: string | null; receivable_id: number; receivable_type: "Contact"; } interface RecipientSearchCount { meta: { count: number; }; } type FluidMessage = { id: number; body: string; type: string; created_at: string; updated_at?: string | null; deleted_at?: string | null; edited_at?: string | null; conversation_id: number; status: string; attachments: Attachment[]; reaction_stats: Record | null; reaction?: string | null; metadata?: MessageMetadata; emoji_only_count?: number; mentioned_recipients: SlimmedRecipient[]; sent_at?: string; pinned?: boolean; scheduled_at?: string; replied_to_message?: ({ id: number; } & Record) | null; sender_recipient: ReducedRecipient; seen_by: unknown; seen_by_count: unknown; }; interface MessagePinResponse { message: string; pinned: boolean; } interface BaseConversation { id: number; name: string; description: string | null; kind: string | null; type: string; status: string; created_at: string; pinned: boolean; unread_messages_count?: number | null; "sms_enabled?": boolean; draft_message: DraftMessage | null; "email_enabled?": boolean; conversation_type: string; "messaging_enabled?": boolean; broadcasting: boolean | null; total_recipients: number; unread?: boolean | null; image_url: string | null; auto_add_recipients?: boolean | null; muted?: boolean | null; announcing?: boolean | null; scheduled_messages_count?: number | null; avatar_background_color: string | null; avatar_emoji: string | null; avatar_url: string | null; pinned_messages_count?: number | null; recipients: Recipient[]; creator: ReducedRecipient | null; } interface EmailConversation extends BaseConversation { type: "EmailConversation"; kind: null; "sms_enabled?": false; "email_enabled?": true; broadcasting: null; } interface ChannelConversation extends BaseConversation { type: "ChannelConversation"; kind: "channel"; "sms_enabled?": false; "email_enabled?": false; } interface GroupConversation extends BaseConversation { type: "GroupConversation"; kind: "group"; "sms_enabled?": false; "email_enabled?": false; broadcasting: null; } interface SmsConversation extends BaseConversation { type: "SmsConversation"; kind: null; "sms_enabled?": true; "email_enabled?": false; broadcasting: null; } interface DirectConversation extends BaseConversation { type: "DirectConversation"; kind: "direct"; "sms_enabled?": false; "email_enabled?": false; broadcasting: null; } interface BotConversation extends BaseConversation { type: "BotConversation"; kind: "direct"; "sms_enabled?": false; "email_enabled?": false; broadcasting: null; } interface DownlineConversation extends BaseConversation { type: "DownlineConversation"; kind: "downline"; "sms_enabled?": false; "email_enabled?": false; broadcasting: null; } type Conversation$1 = EmailConversation | ChannelConversation | GroupConversation | SmsConversation | DirectConversation | BotConversation | DownlineConversation; type ListConversationsInput = { status?: "open" | "closed"; kind?: "direct" | "group" | "channel"; pinned?: boolean; per_page?: number; page?: number; template?: string; search?: string; filterrific?: Record; } | undefined; type ConversationCreateInput = { conversation: { kind?: string; type?: string; name?: string; description?: string | null; broadcasting?: boolean; filter?: Record; auto_add_recipients?: boolean; }; recipients?: { id?: number; uid?: number; email?: string; phone?: string; first_name?: string; last_name?: string; image_url?: string; }[]; }; type ConversationUpdateInput = { conversation: { name?: string; description?: string | null; additional_recipient_params?: { receivable_id: number; receivable_type: string; }; auto_add_recipients?: boolean; }; }; type ListConversationRecipientsInput = { recipient_ids?: number[]; search?: string; per_page?: number; page?: number; }; type RemoveRecipientsInput = { recipient_ids: number[]; }; type FindConversationInput = { contact_id: number; conversation_type: "ChannelConversation" | "DirectConversation" | "GroupConversation" | "SmsConversation" | "EmailConversation" | "channel" | "direct" | "group"; }; type CreateMessageInput = { message: { body?: string; theme?: string; subject?: string; type?: string; attachments_attributes?: MessageAttachmentInput[]; }; client_message_id?: string | number; }; type ScheduledMessageInput = { scheduled_message: { body?: string; theme?: string; scheduled_at: string; attachments_attributes?: MessageAttachmentInput[]; type?: string; }; }; type SaveDraftInput = { draft_message: { body?: string | null; replied_to_id?: number | null; attachments_attributes?: (MessageAttachmentInput & { id?: number; _destroy?: boolean; })[]; }; }; interface DraftMessage { id: number; body: string | null; created_at: string; updated_at: string; scheduled_at: string | null; metadata?: unknown; replied_to_message: ({ id: number; } & Record) | null; mentioned_recipients: ({ id: number; } & Record)[]; attachments: Attachment[]; sender_recipient?: ReducedRecipient; conversation?: { id: number; name: string | null; } & Record; } type ListConnectedRecipientsInput = { kind?: "external" | "sms" | "email" | "internal"; filterrific?: Record; per_page?: number; page?: number; }; //#endregion //#region ../../messaging/core/src/auth-types.d.ts interface MessagingAuthContext { readonly recipientId: number | null; readonly companyId: number | null; readonly currentUser: MessagingCurrentUser | null; readonly isLoading: boolean; /** * True when the underlying auth lookups failed (e.g. /api/account 500). * Distinguishes "still loading" and "genuinely null" from "broken". */ readonly isError?: boolean; } interface MessagingCurrentUser { readonly id: number; readonly recipientId: number; readonly firstName: string; readonly lastName: string; readonly email: string; readonly imageUrl?: string; readonly affiliateId?: number; } //#endregion //#region ../../messaging/core/src/file-upload-types.d.ts /** * Generic file upload abstraction. * * These types are re-exported from messaging-core so that both * messaging-ui (which owns the concrete hook) and external consumers * can reference the same contracts without depending on the UI layer. */ type UploadResult = { readonly url: string; readonly size: number; readonly mimetype: string; readonly kind: string; readonly metadata?: { width: number; height: number; } | null; }; type UploadCallbacks = { onProgress: (progress: number) => void; onSuccess: (result: UploadResult) => void; onError: (error: Error) => void; }; type FileUploader = { uploadFile: (file: File, callbacks: UploadCallbacks) => { abort: () => void; }; }; //#endregion //#region ../../messaging/core/src/messaging-api.d.ts /** * Interface defining all messaging API operations that core hooks need. * Each app provides an implementation via {@link MessagingApiProvider}, * decoupling shared packages from concrete API clients. */ interface MessagingApi { listConversations(input?: ListConversationsInput): Promise>; getConversation(conversationId: number): Promise; findConversation(input: FindConversationInput): Promise; createConversation(input: ConversationCreateInput): Promise; updateConversation(conversationId: number, input: ConversationUpdateInput): Promise; deleteConversation(conversationId: number): Promise<{ success: boolean; message: string; }>; getAnnouncementChannel(): Promise; listMessages(conversationId: number, input?: { preview?: boolean; message_id?: number; after?: number; before?: number; sorted_by?: string; per_page?: number; page?: number; }): Promise>; createMessage(conversationId: number, input: CreateMessageInput): Promise; replyToMessage(conversationId: number, messageId: number, input: CreateMessageInput): Promise; reactToMessage(conversationId: number, input: { message_id: number; reaction: string; }): Promise; unreactToMessage(conversationId: number, input: { message_id: number; }): Promise; pinMessage(conversationId: number, messageId: number): Promise; unpinMessage(conversationId: number, messageId: number): Promise; listPinnedMessages(conversationId: number, input?: { sorted_by?: string; per_page?: number; page?: number; }): Promise>; listScheduledMessages(conversationId: number, input?: { per_page?: number; page?: number; }): Promise>; createScheduledMessage(conversationId: number, input: ScheduledMessageInput): Promise; updateScheduledMessage(conversationId: number, id: number, input: ScheduledMessageInput): Promise; destroyScheduledMessage(conversationId: number, id: number): Promise<{ success: boolean; message: string; }>; listMyScheduledMessages(input?: { per_page?: number; page?: number; }): Promise>; saveDraft(conversationId: number, input: SaveDraftInput): Promise>; destroyDraft(conversationId: number): Promise; searchRecipientsCount(input: { filter: Record; }): Promise; listConnectedRecipients(input: ListConnectedRecipientsInput): Promise>; listConversationRecipients(conversationId: number, input?: ListConversationRecipientsInput): Promise>; removeRecipientsFromConversation(conversationId: number, input: RemoveRecipientsInput): Promise; } //#endregion //#region src/messaging/use-messaging-auth.d.ts declare function useMessagingAuth(): MessagingAuthContext; //#endregion //#region ../../messaging/api-client/src/client.d.ts /** * Configuration for the messaging API client. * The consuming app provides auth headers and base URL. */ interface MessagingApiConfig { baseUrl: string; fetch?: typeof fetch; getHeaders: () => Record | Promise>; onAuthError?: () => void; } //#endregion //#region src/messaging/use-messaging-config.d.ts interface MessagingConfig { readonly apiConfig: MessagingApiConfig; readonly messagingApi: MessagingApi; readonly websocketUrl: string; } declare function useMessagingConfig(apiConfigOverride?: MessagingApiConfig): MessagingConfig; //#endregion //#region ../widgets/src/widgets/TextWidget.d.ts type TextAlignment$2 = "left" | "center" | "right"; type TextWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; title?: string; titleFontSize?: FontSizeOptions; titleFontWeight?: FontWeightOptions; titleColor?: ColorOptions; titleAlignment?: TextAlignment$2; description?: string; /** * Alias for `description`. Authoring tools and agents reach for `content` * often enough that silently dropping it (and rendering placeholder copy) * reads as a broken widget — accept it, lowest precedence. */ content?: string; descriptionFontSize?: FontSizeOptions; descriptionFontWeight?: FontWeightOptions; descriptionColor?: ColorOptions; descriptionAlignment?: TextAlignment$2; background?: BackgroundValue; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; }; declare function TextWidget({ titleEnabled, title, titleFontSize, titleFontWeight, titleColor, titleAlignment, description, content, descriptionFontSize, descriptionFontWeight, descriptionColor, descriptionAlignment, background, padding, borderRadius, borderWidth, borderColor, className, ...props }: TextWidgetProps): React$1.JSX.Element; declare const textWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/AlertWidget.d.ts /** * AlertWidget - Wrapper for TextWidget (for backwards compatibility) */ declare function AlertWidget(props: ComponentProps): React$1.JSX.Element; declare const alertWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/AnnouncementWidget.d.ts type TextAlignment$1 = "left" | "center" | "right"; type Tone = "info" | "success" | "warning" | "promo" | "neutral"; type AnnouncementWidgetProps = ComponentProps<"div"> & { title?: string; titleColor?: ColorOptions; titleFontSize?: FontSizeOptions; message?: string; messageColor?: ColorOptions; tone?: Tone; showIcon?: boolean; showAccentBar?: boolean; accentColor?: ColorOptions; ctaText?: string; ctaHref?: string; alignment?: TextAlignment$1; background?: BackgroundValue; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; }; declare function AnnouncementWidget({ title, titleColor, titleFontSize, message, messageColor, tone, showIcon, showAccentBar, accentColor, ctaText, ctaHref, alignment, background, padding, borderRadius, borderWidth, borderColor, className, ...props }: AnnouncementWidgetProps): React$1.JSX.Element; declare const announcementWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/BulletListWidget.d.ts type BulletListWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; title?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; listType?: "ordered" | "unordered"; items?: string[] | string; itemFontSize?: FontSizeOptions; itemColor?: ColorOptions; background?: BackgroundValue; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; gapSize?: GapOptions; }; declare function BulletListWidget({ titleEnabled, title, titleFontSize, titleColor, listType, items, itemFontSize, itemColor, background, padding, borderRadius, borderWidth, borderColor, gapSize, className, ...props }: BulletListWidgetProps): React$1.JSX.Element; declare const bulletListWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/CalendarWidget.d.ts type CalendarWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; titleText?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; showEventDensity?: boolean; showTodayButton?: boolean; weekendDim?: boolean; showYearEyebrow?: boolean; }; declare function CalendarWidget({ titleEnabled, titleText, titleFontSize, titleColor, background, textColor, accentColor, padding, borderRadius, borderWidth, borderColor, showEventDensity, showTodayButton, weekendDim, showYearEyebrow, className, ...props }: CalendarWidgetProps): React$1.JSX.Element; declare const calendarWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/CardWidget.d.ts type CardWidgetProps = { headerEnabled?: boolean; title?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; headerBackground?: ColorOptions; footerEnabled?: boolean; footerContent?: string; footerColor?: ColorOptions; footerBackground?: ColorOptions; background?: BackgroundValue; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; /** @deprecated Use borderWidth instead */ borderEnabled?: boolean; gapSize?: GapOptions; children?: (WidgetSchema | null)[]; className?: string; }; declare function CardWidget({ headerEnabled, title, titleFontSize, titleColor, headerBackground, footerEnabled, footerContent, footerColor, footerBackground, background, padding, borderRadius, borderWidth, borderColor, borderEnabled, gapSize, children, className }: CardWidgetProps): React$1.JSX.Element; declare const cardWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/CarouselWidget.d.ts type CarouselSlide = { id: string; content: WidgetSchema; title?: string; description?: string; eyebrow?: string; meta?: string; tag?: string; tagColor?: ColorOptions; buttonEnabled?: boolean; buttonText?: string; buttonVariant?: "default" | "secondary" | "outline" | "destructive" | "ghost" | "link"; buttonLink?: string; secondaryButtonText?: string; secondaryButtonLink?: string; [key: string]: unknown; }; type CarouselWidgetProps = ComponentProps<"div"> & { slides?: CarouselSlide[]; autoScrollInterval?: number; enableAutoScroll?: boolean; align?: AlignOptions; carouselHeight?: string; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; padding?: PaddingOptions; headerSize?: FontSizeOptions; headerColor?: ColorOptions; textSize?: FontSizeOptions; textColor?: ColorOptions; textWidth?: string; showButton?: boolean; buttonColor?: ColorOptions; buttonSize?: ButtonSizeOptions; overlayEnabled?: boolean; overlayType?: "solid" | "gradient"; overlayIntensity?: number; editorialFrame?: boolean; frameColor?: ColorOptions; }; declare function CarouselWidget({ slides, autoScrollInterval, enableAutoScroll, carouselHeight, align, overlayIntensity, borderRadius, borderWidth, borderColor, padding, textWidth, headerSize, headerColor, textSize, textColor, showButton, buttonColor, buttonSize, overlayEnabled, overlayType, editorialFrame, frameColor, className, ...props }: CarouselWidgetProps): React$1.JSX.Element; declare const carouselWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/CatchUpWidget.d.ts type CatchUpWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; titleText?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; maxItems?: number; contactScreenSlug?: string; messagingScreenSlug?: string; shopScreenSlug?: string; shareablesScreenSlug?: string; }; declare function CatchUpWidget({ titleEnabled, titleText, titleFontSize, titleColor, background, textColor, accentColor, padding, borderRadius, borderWidth, borderColor, maxItems, contactScreenSlug, messagingScreenSlug, shopScreenSlug, shareablesScreenSlug, className, ...props }: CatchUpWidgetProps): React$1.JSX.Element; declare const catchUpWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/ChartWidget.d.ts type ChartDataPoint = Record; type ChartWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; title?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; description?: string; descriptionFontSize?: FontSizeOptions; descriptionColor?: ColorOptions; chartType?: "bar" | "line" | "area" | "pie"; showLegend?: boolean; showTooltip?: boolean; showGrid?: boolean; width?: string; height?: string; background?: BackgroundValue; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; dataKey?: string; xAxisKey?: string; /** Chart data - when provided via dataSource, this overrides defaultData */ data?: ChartDataPoint[]; /** Chart configuration - can be dynamically provided via dataSource */ chartConfig?: Record; }; declare function ChartWidget({ titleEnabled, title, titleFontSize, titleColor, description, descriptionFontSize, descriptionColor, chartType, showLegend, showTooltip, showGrid, width, height, background, padding, borderRadius, borderWidth, borderColor, dataKey, xAxisKey, data, chartConfig, className, ...props }: ChartWidgetProps): React$1.JSX.Element; declare const chartWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/LayoutWidget.d.ts type LayoutProps> = Record>> = { sectionLayout?: SectionLayoutType; type?: "flex" | "grid"; columns?: number; rows?: number; direction?: string; justify?: string; align?: string; wrap?: boolean; gap?: number; gapSize?: GapOptions; background?: BackgroundValue; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; children: (TypedWidgetSchema | null)[] | (WidgetSchema | null)[]; registry?: T; className?: string; minHeight?: number; }; declare const LayoutWidget: >>({ sectionLayout, gap, gapSize, background, padding, borderRadius, borderWidth, borderColor, children, registry, className, minHeight }: LayoutProps) => React$1.JSX.Element; declare const layoutWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/ContainerWidget.d.ts /** * ContainerWidget - Root container widget for screens * * This widget wraps LayoutWidget and serves as the foundational container * for every screen. It cannot be added, deleted, moved, or copied by users. * * Only exposes limited settings: gap, padding, and backgroundColor */ type ContainerWidgetProps = ComponentProps; declare function ContainerWidget(props: ContainerWidgetProps): React$1.JSX.Element; declare const containerWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../../platform/app-bridge/src/protocol.d.ts type BridgeEntryType = "droplet" | "drop_zone" | "mobile_embed" | "portal_embed" | "app_extension"; interface BridgeResource { type: string; id: string; } //#endregion //#region ../widgets/src/widgets/EmbedWidget.d.ts type EmbedWidgetAppBridgeConfig = { clientId?: string; appOrigins?: string[]; entryType?: BridgeEntryType; entryName?: string; resources?: BridgeResource[]; }; type DisplayMode$1 = "inline" | "cover"; type EmbedWidgetProps = ComponentProps<"div"> & { url?: string; appBridge?: EmbedWidgetAppBridgeConfig; title?: string; height?: string; fullScreen?: boolean; allowFullscreen?: boolean; loading?: "eager" | "lazy"; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; editMode?: boolean; isSelected?: boolean; displayMode?: DisplayMode$1; coverResource?: ShareableItem; coverUseCustomUrl?: boolean; coverImageUrl?: string; coverTitle?: string; coverMeta?: string; coverShowHeader?: boolean; coverHeaderIcon?: string; coverHeaderIconColor?: ColorOptions; coverHeight?: string; }; declare function EmbedWidget({ url, appBridge, title, height, fullScreen, allowFullscreen, loading, borderRadius, borderWidth, borderColor, editMode: _editMode, isSelected: _isSelected, displayMode, coverResource, coverUseCustomUrl, coverImageUrl, coverTitle, coverMeta, coverShowHeader, coverHeaderIcon, coverHeaderIconColor, coverHeight, className, ...props }: EmbedWidgetProps): React$1.JSX.Element; declare const embedWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/lib/link-type-utils.d.ts type LinkType = "url" | "screen" | "share"; type ShareSource = "resource" | "url"; //#endregion //#region ../widgets/src/widgets/ImageWidget.d.ts type ImageWidgetProps = ComponentProps<"div"> & { src?: string; alt?: string; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; verticalSizing?: "auto" | "fixed"; fixedHeight?: string; displayFit?: "cover" | "contain"; focusPoint?: string; linkType?: LinkType; href?: string; openInNewTab?: boolean; screenSlug?: string; shareSource?: ShareSource; shareResource?: ShareableItem; shareUrl?: string; /** @deprecated Use href instead. Kept for backward compat with existing widgets. */ linkUrl?: string; resource?: ShareableItem; useCustomUrl?: boolean; editMode?: boolean; }; declare function ImageWidget({ src, alt, borderRadius, borderWidth, borderColor, verticalSizing, fixedHeight, displayFit, focusPoint, linkType, href, openInNewTab, screenSlug, shareSource, shareResource, shareUrl, linkUrl, resource, useCustomUrl, editMode: _editMode }: ImageWidgetProps): React$1.JSX.Element; declare const imageWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/LinkWidget.d.ts type LinkVariant = "default" | "outline" | "secondary" | "ghost" | "destructive"; type LinkWidgetProps = ComponentProps<"div"> & { text?: string; linkType?: LinkType; href?: string; openInNewTab?: boolean; screenSlug?: string; shareSource?: ShareSource; shareResource?: ShareableItem; shareUrl?: string; variant?: LinkVariant; size?: ButtonSizeOptions; fontSize?: FontSizeOptions; alignment?: "left" | "center" | "right"; fullWidth?: boolean; padding?: PaddingOptions; /** @deprecated Use per-corner props instead */ borderRadius?: BorderRadiusOptions; borderRadiusTL?: BorderRadiusOptions; borderRadiusTR?: BorderRadiusOptions; borderRadiusBL?: BorderRadiusOptions; borderRadiusBR?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; underline?: boolean; previewMode?: boolean; editMode?: boolean; }; declare function LinkWidget({ text, linkType, href, openInNewTab, screenSlug, shareSource, shareResource, shareUrl, variant, size, fontSize, alignment, fullWidth, padding, borderRadius, borderRadiusTL, borderRadiusTR, borderRadiusBL, borderRadiusBR, borderWidth, borderColor, underline, previewMode, editMode: _editMode, className, ...props }: LinkWidgetProps): React$1.JSX.Element; declare const linkWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/ListWidget.d.ts type ListItem = { id: string; image?: string; imageUrl?: string; videoUrl?: string; title?: string; description?: string; price?: string; originalPrice?: string; discount?: string; qv?: string; cv?: string; [key: string]: unknown; }; type ImageAspectRatio = "square" | "landscape" | "portrait"; type ListType = "ordered" | "unordered"; type ScrollAxis = "horizontal" | "vertical"; type ListWidgetProps = ComponentProps<"div"> & { listType?: ListType; scrollAxis?: ScrollAxis; titleEnabled?: boolean; title?: string; items?: ListItem[]; titleColor?: ColorOptions; titleSize?: FontSizeOptions; itemTitleColor?: ColorOptions; itemTitleSize?: FontSizeOptions; descriptionColor?: ColorOptions; descriptionSize?: FontSizeOptions; priceColor?: ColorOptions; priceSize?: FontSizeOptions; originalPriceColor?: ColorOptions; metaTextColor?: ColorOptions; metaTextSize?: FontSizeOptions; numberColor?: ColorOptions; numberSize?: FontSizeOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; padding?: PaddingOptions; gap?: GapOptions; columns?: number; imageAspectRatio?: ImageAspectRatio; background?: BackgroundValue; showBadge?: boolean; showMetaText?: boolean; maxItems?: number; showFeaturedSection?: boolean; featuredAsset?: string | { [key: string]: unknown; }; featuredTitle?: string; featuredSubtitle?: string; featuredButtonText?: string; featuredButtonUrl?: string; featuredSubtitleColor?: ColorOptions; featuredSubtitleSize?: FontSizeOptions; }; declare function ListWidget({ listType, scrollAxis, titleEnabled, title, items, titleColor, titleSize, itemTitleColor, itemTitleSize, descriptionColor, descriptionSize, priceColor, priceSize, originalPriceColor, metaTextColor, metaTextSize, numberColor, numberSize, borderRadius, borderWidth, borderColor, padding, gap, columns, imageAspectRatio, background, showBadge, showMetaText, maxItems, showFeaturedSection, featuredAsset, featuredTitle, featuredSubtitle, featuredButtonText, featuredButtonUrl, featuredSubtitleColor, featuredSubtitleSize, className, ...props }: ListWidgetProps): React$1.JSX.Element; declare const listWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/MySiteWidget.d.ts type MySiteWidgetProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; borderRadius?: BorderRadiusOptions; showPreview?: boolean; showAnalytics?: boolean; showLiveBadge?: boolean; showQR?: boolean; editMode?: boolean; isSelected?: boolean; }; declare function MySiteWidget({ background, textColor, accentColor, borderRadius, showPreview, showAnalytics, showLiveBadge, showQR, className, editMode: _editMode, isSelected: _isSelected, ...props }: MySiteWidgetProps): React$1.JSX.Element | null; declare const mySiteWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/NestedWidget.d.ts type NestedWidgetProps = ComponentProps<"div"> & { resource?: ShareableItem; titleEnabled?: boolean; titleText?: string; shareables?: ShareableItem[]; gap?: GapOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; primaryMediaHeight?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; titleAlignment?: AlignOptions; nestedTextColor?: ColorOptions; background?: BackgroundValue; overlayEnabled?: boolean; overlayType?: "solid" | "gradient"; overlayIntensity?: number; }; declare function NestedWidget({ resource, titleEnabled, titleText, shareables, gap, padding, borderRadius, borderWidth, borderColor, primaryMediaHeight, titleFontSize, titleColor, titleAlignment, nestedTextColor, background, overlayEnabled, overlayType, overlayIntensity, className, ...props }: NestedWidgetProps): React$1.JSX.Element; declare const nestedWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/PointsWidget.d.ts type PointsWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; title?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; balanceColor?: ColorOptions; historyEnabled?: boolean; historyTitle?: string; background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; }; declare function PointsWidget({ titleEnabled, title, titleFontSize, titleColor, balanceColor, historyEnabled, historyTitle, background, textColor, accentColor, padding, borderRadius, borderWidth, borderColor, className, ...props }: PointsWidgetProps): React$1.JSX.Element; declare const pointsWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/QuoteWidget.d.ts type TextAlignment = "left" | "center" | "right"; type RotationMode = "carousel" | "daily"; type QuoteWidgetProps = ComponentProps<"div"> & { quotes?: QuoteListItem[]; quote?: string; attribution?: string; attributionRole?: string; quoteColor?: ColorOptions; quoteFontSize?: FontSizeOptions; attributionColor?: ColorOptions; accentColor?: ColorOptions; rotation?: RotationMode; autoScrollInterval?: number; showArrows?: boolean; showDots?: boolean; alignment?: TextAlignment; background?: BackgroundValue; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; }; declare function QuoteWidget({ quotes, quote, attribution, attributionRole, quoteColor, quoteFontSize, attributionColor, accentColor, rotation, autoScrollInterval, showArrows, showDots, alignment, background, padding, borderRadius, borderWidth, borderColor, className, ...props }: QuoteWidgetProps): React$1.JSX.Element; declare const quoteWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/QuickLinksWidget.d.ts type QuickLinksWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; title?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; link1Label?: string; link1Url?: string; link1Icon?: string; link1Color?: ColorOptions; link2Enabled?: boolean; link2Label?: string; link2Url?: string; link2Icon?: string; link2Color?: ColorOptions; link3Enabled?: boolean; link3Label?: string; link3Url?: string; link3Icon?: string; link3Color?: ColorOptions; link4Enabled?: boolean; link4Label?: string; link4Url?: string; link4Icon?: string; link4Color?: ColorOptions; link5Enabled?: boolean; link5Label?: string; link5Url?: string; link5Icon?: string; link5Color?: ColorOptions; link6Enabled?: boolean; link6Label?: string; link6Url?: string; link6Icon?: string; link6Color?: ColorOptions; link7Enabled?: boolean; link7Label?: string; link7Url?: string; link7Icon?: string; link7Color?: ColorOptions; link8Enabled?: boolean; link8Label?: string; link8Url?: string; link8Icon?: string; link8Color?: ColorOptions; links?: string[] | string; layout?: "cards" | "list"; iconRadius?: BorderRadiusOptions; showChevron?: boolean; openInNewTab?: boolean; background?: BackgroundValue; textColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; }; declare function QuickLinksWidget({ titleEnabled, title, titleFontSize, titleColor, link1Label, link1Url, link1Icon, link1Color, link2Enabled, link2Label, link2Url, link2Icon, link2Color, link3Enabled, link3Label, link3Url, link3Icon, link3Color, link4Enabled, link4Label, link4Url, link4Icon, link4Color, link5Enabled, link5Label, link5Url, link5Icon, link5Color, link6Enabled, link6Label, link6Url, link6Icon, link6Color, link7Enabled, link7Label, link7Url, link7Icon, link7Color, link8Enabled, link8Label, link8Url, link8Icon, link8Color, links, layout, iconRadius, showChevron, openInNewTab, background, textColor, padding, borderRadius, borderWidth, borderColor, className, ...props }: QuickLinksWidgetProps): React$1.JSX.Element; declare const quickLinksWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/QuickShareWidget.d.ts type QuickShareWidgetProps = ComponentProps<"div"> & { shareableResource?: ShareableItem; titleEnabled?: boolean; titleText?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; overlayEnabled?: boolean; overlayType?: "solid" | "gradient"; overlayIntensity?: number; showBuyButton?: boolean; showResourceType?: boolean; showShareActions?: boolean; showDomainPrefix?: boolean; }; declare function QuickShareWidget({ shareableResource, titleEnabled, titleText, titleFontSize, titleColor, textColor, accentColor, padding, borderRadius, borderWidth, borderColor, overlayEnabled, overlayType, overlayIntensity, showBuyButton, showResourceType, showShareActions, showDomainPrefix, className, style, ...props }: QuickShareWidgetProps): React$1.JSX.Element; declare const quickShareWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/RecentActivityWidget.d.ts type RecentActivityWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; titleText?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; maxItemsToShow?: number; showTimeline?: boolean; showRelativeTime?: boolean; showCountChip?: boolean; showEyebrow?: boolean; }; declare function RecentActivityWidget({ titleEnabled, titleText, titleFontSize, titleColor, background, textColor, accentColor, padding, borderRadius, borderWidth, borderColor, maxItemsToShow, showRelativeTime, showCountChip, showEyebrow, className, onClick: onClickProp, ...props }: RecentActivityWidgetProps): React$1.JSX.Element; declare const recentActivityWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/SeparatorWidget.d.ts type SpacingOptions = 0 | 2 | 4 | 6 | 8 | 10; type SeparatorWidgetProps = ComponentProps<"div"> & { orientation?: "horizontal" | "vertical"; color?: ColorOptions; thickness?: `${number}px`; width?: `${number}%`; marginTop?: SpacingOptions; marginBottom?: SpacingOptions; }; declare function SeparatorWidget({ orientation, color, thickness, width, marginTop, marginBottom, className, style, ...props }: SeparatorWidgetProps): React$1.JSX.Element; declare const separatorWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/SpacerWidget.d.ts type SpacerWidgetProps = ComponentProps<"div"> & { /** * Custom height as a CSS value (e.g., "128px", "8rem", "20vh") */ customHeight?: string; /** * Not customizable, determines if we should show a preview image in the container */ previewMode?: boolean; }; declare function SpacerWidget({ customHeight, previewMode, className, style, ...props }: SpacerWidgetProps): React$1.JSX.Element; declare const spacerWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/TableWidget.d.ts /** Plain column definition provided by data sources (no render functions) */ type TableColumnDef = { key: string; label: string; sortable: boolean; }; type TableWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; titleText?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; background?: BackgroundValue; alternatingColorEnabled?: boolean; textColor?: ColorOptions; headerBackgroundColor?: ColorOptions; headerTextColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; data?: ShareableItem[]; /** Column definitions from a data source (plain data, renderers resolved internally) */ columns?: TableColumnDef[]; filterEnabled?: boolean; sortingEnabled?: boolean; paginationEnabled?: boolean; maxRowsPerPage?: number; }; declare function TableWidget({ titleEnabled, titleText, titleFontSize, titleColor, background, alternatingColorEnabled, textColor, headerBackgroundColor, headerTextColor, padding, borderRadius, borderWidth, borderColor, data, columns: columnsProp, filterEnabled, sortingEnabled, paginationEnabled, maxRowsPerPage, className, ...props }: TableWidgetProps): React$1.JSX.Element; declare const tableWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/ToDoWidget.d.ts type ToDoWidgetProps = ComponentProps<"div"> & { titleEnabled?: boolean; titleText?: string; titleFontSize?: FontSizeOptions; titleColor?: ColorOptions; background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; maxItems?: number; }; declare function ToDoWidget({ titleEnabled, titleText, titleFontSize, titleColor, background, textColor, accentColor, padding, borderRadius, borderWidth, borderColor, maxItems, className, ...props }: ToDoWidgetProps): React$1.JSX.Element; declare const toDoWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/VideoWidget.d.ts type VideoWidgetProps = ComponentProps<"div"> & { src?: string; poster?: string; resource?: ShareableItem; useCustomUrl?: boolean; displayMode?: "inline" | "card"; borderRadius?: BorderRadiusOptions; borderWidth?: BorderWidthOptions; borderColor?: ColorOptions; verticalSizing?: "auto" | "fixed"; fixedHeight?: string; displayFit?: "cover" | "contain"; focusPoint?: string; controls?: boolean; autoplay?: boolean; loop?: boolean; muted?: boolean; editorialFrame?: boolean; frameColor?: ColorOptions; eyebrow?: string; tag?: string; title?: string; tagline?: string; duration?: string; author?: string; date?: string; showFullscreenPill?: boolean; primaryCtaText?: string; primaryCtaLink?: string; secondaryCtaText?: string; secondaryCtaLink?: string; }; declare function VideoWidget({ src, poster, resource, useCustomUrl, displayMode, borderRadius, borderWidth, borderColor, verticalSizing, fixedHeight, displayFit, focusPoint, controls, autoplay, loop, muted, editorialFrame, frameColor, eyebrow, tag, title, tagline, duration, author, date, showFullscreenPill, primaryCtaText, primaryCtaLink, secondaryCtaText, secondaryCtaLink }: VideoWidgetProps): React$1.JSX.Element; declare const videoWidgetPropertySchema: WidgetPropertySchema; //#endregion //#region ../widgets/src/widgets/index.d.ts declare const widgetPropertySchemas: { AlertWidget: () => Promise; AnnouncementWidget: () => Promise; BulletListWidget: () => Promise; CalendarWidget: () => Promise; CardWidget: () => Promise; CarouselWidget: () => Promise; CatchUpWidget: () => Promise; ChartWidget: () => Promise; ContainerWidget: () => Promise; EmbedWidget: () => Promise; ImageWidget: () => Promise; LayoutWidget: () => Promise; LinkWidget: () => Promise; ListWidget: () => Promise; MySiteWidget: () => Promise; NestedWidget: () => Promise; PointsWidget: () => Promise; QuoteWidget: () => Promise; QuickLinksWidget: () => Promise; QuickShareWidget: () => Promise; RecentActivityWidget: () => Promise; SeparatorWidget: () => Promise; ShopWidget: () => Promise; SpacerWidget: () => Promise; TableWidget: () => Promise; TextWidget: () => Promise; ToDoWidget: () => Promise; VideoWidget: () => Promise; }; //#endregion //#region src/screens/ProfileScreen.d.ts type ProfileScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; onToast?: (message: string, type: "success" | "error" | "warning") => void; }; declare function ProfileScreen({ onToast, background, textColor, accentColor, padding, borderRadius, ...divProps }: ProfileScreenProps): React.JSX.Element; declare const profileScreenPropertySchema: WidgetPropertySchema; //#endregion //#region ../../messaging/ui/src/hooks/use-draft-file-upload.d.ts type UploadResult$1 = { url: string; size: number; mimetype: string; kind: string; metadata?: { width: number; height: number; } | null; }; type UploadCallbacks$1 = { onProgress: (progress: number) => void; onSuccess: (result: UploadResult$1) => void; onError: (error: Error) => void; }; type FileUploader$1 = { uploadFile: (file: File, callbacks: UploadCallbacks$1) => { abort: () => void; }; }; //#endregion //#region src/screens/MessagingScreen.d.ts type MessagingScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; onToast?: (message: string, type: "success" | "error") => void; /** * File uploader for messaging attachments. When omitted, attachments are * disabled — the composer surfaces a "not configured" error on upload. */ fileUploader?: FileUploader$1; websocketUrl?: string; apiConfig?: MessagingApiConfig; websocketSession?: boolean; hideMobileBackButton?: boolean; }; declare function MessagingScreen({ onToast, fileUploader, websocketUrl, apiConfig, websocketSession, hideMobileBackButton, background, textColor, accentColor, padding, borderRadius, ...divProps }: MessagingScreenProps): React.JSX.Element; declare const messagingScreenPropertySchema: WidgetPropertySchema; //#endregion //#region ../../contacts/core/src/types.d.ts /** Contact entity — shared across admin and rep views. */ interface Contact$1 { [key: string]: unknown; id: number; full_name: string; first_name?: string | null; last_name?: string | null; email?: string | null; email2?: string | null; phone?: string | null; phone2?: string | null; status: string | null; tags?: string[] | null; address?: string | null; address2?: string | null; city?: string | null; state?: string | null; postal_code?: string | null; country_id?: number | null; language_id?: number | null; lead_type?: string | null; interest?: string | null; avatar_url?: string | null; metadata: Record; token?: string | null; phone_id?: string | null; ip?: string | null; requested_at?: string | null; best_time?: string | null; time_zone?: string | null; reason?: string | null; income?: string | null; hours?: string | null; invest?: string | null; discarded_at?: string | null; engagement?: number; external_id?: string | null; user?: { id?: number; first_name: string | null; last_name: string | null; email: string | null; phone: string | null; image_url?: string | null; country?: { id?: number; name: string; iso?: string; } | null; } | null; country?: { id: number; name: string; iso: string; iso3: string; active: boolean; } | null; affiliate?: { id: number; first_name: string | null; last_name: string | null; image_url?: string | null; } | null; } /** Activity on a contact (page view, purchase, etc.). */ interface ContactActivity { id: number; user_id: number; relation_type?: string | null; relation_id?: number | null; contact_id?: number | null; title?: string | null; description?: string | null; read_at?: string | null; slug?: string | null; company_id?: number | null; created_at: string; formatted_description: string; } /** Note attached to a contact. */ interface ContactNote { id: number; title: string; body: string; note_type?: string | null; due_date?: string | null; due_time?: string | null; pinned?: boolean | null; created_at: string; updated_at: string; contact_id: number; due_at?: string | null; assets: unknown[]; } /** Task attached to a contact. */ interface ContactTask { id: number; body: string; due_at?: string | null; completed_at?: string | null; created_at: string; contact_id?: number | null; } /** Order summary for a contact. */ interface ContactOrder { id: number; first_name?: string | null; last_name?: string | null; email?: string | null; phone?: string | null; order_number?: string | null; status: "awaiting_payment" | "awaiting_shipment" | "shipped" | "delivered" | "archived" | "cancelled" | "failed_payment" | "draft"; order_type: "requested" | "purchased" | "imported" | "abandoned"; source: "mobile" | "web" | "admin" | "backoffice" | "subscription" | "enrollment"; amount: number | string | null; amount_in_base: number | string | null; base_to_currency_rate?: number | string | null; note?: string | null; currency_code?: string | null; created_at: string; updated_at: string; metadata: Record | null; token: string; refundable_amount: string; order_status: "draft" | "pending" | "pending_review" | "processing" | "completed" | "cancelled" | "archived"; fulfillment_status: "unfulfilled" | "in_progress" | "on_hold" | "partially_fulfilled" | "scheduled" | "fulfilled"; financial_status: "pending" | "authorized" | "partially_paid" | "paid" | "partially_refunded" | "refunded" | "voided" | "marked_free" | "marked_paid"; warehouse_id?: number | null; points_applied: number; points_applied_amount?: number; points_applied_amount_in_currency: string; total_points_credited?: number; customer_points_balance?: number; order_total_after_points_redemption: number; free_shipping: boolean; discount_codes: unknown[]; created_subscriptions: unknown[]; } /** Subscription order summary for a contact. */ interface ContactSubscriptionOrder { id: number; amount?: string | null; subtotal?: string | null; tax?: string | null; discount?: string | null; shipping?: string | null; created_at?: string | null; updated_at?: string | null; bill_date?: string | null; next_bill_date?: string | null; subscription_interval?: number | null; cancellation_reason?: string | null; additional_feedback?: string | null; order_number?: string | null; display_amount?: string | null; display_subtotal?: string | null; display_tax?: string | null; display_discount?: string | null; display_shipping?: string | null; total?: string | null; display_total?: string | null; days_until_next_bill_date?: number | null; status: string; order_thumbnail?: string | null; user?: Record | null; buyer?: Record | null; bill_to?: Record | null; ship_to?: Record | null; customer?: Record | null; payment_method?: Record | null; activities?: unknown[]; items?: unknown[]; [key: string]: unknown; } /** Pagination metadata returned by list endpoints. */ interface PaginationMeta { total_count?: number; total_pages?: number; current_page?: number; next_cursor?: string | null; request_id?: string; timestamp?: string; } /** Contact group (BFF-backed). */ interface ContactGroup { id: number; name: string; avatar: string | null; avatar_background: string | null; contacts_count: number; created_at: string; updated_at: string; } interface CreateNoteInput { title: string; body: string; note_type?: string | null; pinned?: boolean | null; } interface UpdateNoteInput { title?: string; body?: string; note_type?: string | null; pinned?: boolean | null; } interface CreateTaskInput { body: string; due_at?: string | null; completed_at?: string | null; user_id?: number | null; } interface UpdateTaskInput { body?: string | null; due_at?: string | null; completed_at?: string | null; contact_id?: number | null; } interface CreateGroupInput { name: string; avatar?: string; avatar_background?: string; } interface UpdateGroupInput { name?: string; avatar?: string; avatar_background?: string; } //#endregion //#region ../../contacts/core/src/contacts-api.d.ts interface ContactsApi { getContact(id: string): Promise<{ contact: Contact$1; }>; listContacts(params?: Record): Promise<{ contacts: Contact$1[]; meta: PaginationMeta; }>; createContact(data: Record): Promise; updateContact(id: string, data: Record): Promise; deleteContact(id: string): Promise; bulkDeleteContacts(ids: number[]): Promise; listActivities?(contactId: string): Promise<{ activities: ContactActivity[]; meta: PaginationMeta; }>; markRead?(contactId: string): Promise; listOrders?(contactId: string, params?: Record): Promise<{ orders: ContactOrder[]; meta: PaginationMeta; }>; listSubscriptionOrders?(contactId: string, params?: Record): Promise<{ subscription_orders: ContactSubscriptionOrder[]; meta: PaginationMeta; }>; } //#endregion //#region ../../contacts/core/src/notes-api.d.ts interface NotesApi { listNotes(contactId: string): Promise<{ notes: ContactNote[]; }>; createNote(contactId: string, input: CreateNoteInput): Promise; updateNote(noteId: number, contactId: string, input: UpdateNoteInput): Promise; deleteNote(noteId: number, contactId: string): Promise; } //#endregion //#region ../../contacts/core/src/tasks-api.d.ts interface TasksApi { listTasks(contactId: string): Promise<{ tasks: ContactTask[]; }>; createTask(contactId: string, input: CreateTaskInput): Promise; updateTask(taskId: number, contactId: string, input: UpdateTaskInput): Promise; deleteTask(taskId: number, contactId: string): Promise; } //#endregion //#region ../../contacts/core/src/groups-api.d.ts interface GroupsApi { listGroups(): Promise<{ groups: ContactGroup[]; }>; createGroup(input: CreateGroupInput): Promise<{ group: ContactGroup; }>; updateGroup(groupId: number, input: UpdateGroupInput): Promise<{ group: ContactGroup; }>; deleteGroup(groupId: number): Promise; } //#endregion //#region ../../contacts/core/src/contacts-api-context.d.ts interface ContactsDomainApi { contacts: ContactsApi; notes: NotesApi; tasks: TasksApi; groups?: GroupsApi; } //#endregion //#region src/screens/ContactsScreen.d.ts type ContactsScreenProps = ComponentProps<"div"> & { api?: ContactsDomainApi; background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; defaultViewMode?: "list" | "grid"; onContactSelect?: (contactId: string) => void; onCreateContact?: () => void; }; declare function ContactsScreen({ api, onContactSelect, onCreateContact, background, textColor, accentColor, padding, borderRadius, defaultViewMode, ...divProps }: ContactsScreenProps): React.JSX.Element; declare const contactsScreenPropertySchema: WidgetPropertySchema; //#endregion //#region src/screens/OrdersScreen.d.ts type OrdersScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; onToast?: (message: string, type: "success" | "error" | "warning") => void; }; declare function OrdersScreen({ onToast, background, textColor, accentColor, padding, borderRadius, ...divProps }: OrdersScreenProps): React.JSX.Element; declare const ordersScreenPropertySchema: WidgetPropertySchema; //#endregion //#region src/screens/SubscriptionsScreen.d.ts type SubscriptionsScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; onToast?: (message: string, type: "success" | "error" | "warning") => void; }; declare function SubscriptionsScreen({ onToast, background, textColor, accentColor, padding, borderRadius, ...divProps }: SubscriptionsScreenProps): React.JSX.Element; declare const subscriptionsScreenPropertySchema: WidgetPropertySchema; //#endregion //#region src/screens/CustomersScreen.d.ts type CustomersScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; }; declare function CustomersScreen(_props: CustomersScreenProps): React.JSX.Element; declare const customersScreenPropertySchema: WidgetPropertySchema; //#endregion //#region src/screens/MySiteScreen/types.d.ts type MySiteScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; }; //#endregion //#region src/screens/MySiteScreen/index.d.ts declare function MySiteScreen({ background, textColor, accentColor, padding, borderRadius, ...divProps }: MySiteScreenProps): React$1.JSX.Element; declare const mySiteScreenPropertySchema: WidgetPropertySchema; //#endregion //#region src/screens/ShareablesScreen.d.ts type ShareablesScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; showProductSharablesCarousel?: boolean; }; declare function ShareablesScreen({ background, textColor, accentColor, padding, borderRadius, showProductSharablesCarousel, ...divProps }: ShareablesScreenProps): React.JSX.Element; declare const shareablesScreenPropertySchema: WidgetPropertySchema; //#endregion //#region src/screens/ShopScreen.d.ts type ShopScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; }; declare function ShopScreen(props: ShopScreenProps): React.JSX.Element; declare const shopScreenPropertySchema: WidgetPropertySchema; //#endregion //#region src/screens/ActivityScreen.d.ts type ActivityScreenProps = ComponentProps<"div"> & { background?: BackgroundValue; textColor?: ColorOptions; accentColor?: ColorOptions; padding?: PaddingOptions; borderRadius?: BorderRadiusOptions; }; /** * The rep's own activity feed, and the destination the Recent Activity widget * clicks into. Needs no API provider of its own: WidgetsApi is mounted app-wide * by FluidProvider. */ declare function ActivityScreen({ background, textColor, accentColor, padding, borderRadius, ...divProps }: ActivityScreenProps): React.JSX.Element; declare const activityScreenPropertySchema: WidgetPropertySchema; //#endregion //#region src/screens/core-page-ids.d.ts /** * Core page template IDs */ declare const CORE_PAGE_IDS: { readonly PROFILE: "core-profile"; readonly MESSAGING: "core-messaging"; readonly CONTACTS: "core-contacts"; readonly ORDERS: "core-orders"; readonly SUBSCRIPTIONS: "core-subscriptions"; readonly CUSTOMERS: "core-customers"; readonly MY_SITE: "core-my-site"; readonly SHAREABLES: "core-shareables"; readonly SHOP: "core-shop"; readonly APP_DOWNLOAD: "core-app-download"; readonly ACTIVITY: "core-activity"; }; //#endregion //#region src/screens/index.d.ts declare const screenPropertySchemas: Record Promise>; //#endregion //#region ../core/src/widget-utils/widget-utils.d.ts /** * Groups children by column index. * Accepts nullable children (sparse arrays from grid layouts) and filters them out. */ declare function groupChildrenByColumn(children: readonly (WidgetSchema | null)[], columnCount: number): WidgetSchema[][]; //#endregion //#region ../core/src/widget-utils/utils.d.ts declare function createWidgetRegistry>(registry: T, plugins?: WidgetManifest[]): T; declare function createScreen>(registry: T, widgets: TypedWidgetSchema[]): TypedWidgetSchema[]; declare function createWidgetFromShareable(item: ShareableItem): WidgetSchema; //#endregion //#region src/core/default-widget-registry.d.ts declare const DEFAULT_SDK_WIDGET_REGISTRY: WidgetRegistry; //#endregion //#region src/core/resolve-pages.d.ts /** * Resolve all page references and local screens into a unified screen list. * * This function merges: * 1. Screen definitions from page_refs (shared templates) * 2. Local screen definitions (for backwards compatibility and custom screens) * * When a screen_id appears in both page_refs and screens, the local screen * takes precedence (allows local overrides of template pages). * * @param navigation - The navigation configuration * @returns A unified array of ScreenDefinition objects * * @example * ```ts * const navigation: Navigation = { * definition_id: 1, * id: 1, * name: "Main Nav", * navigation_items: [...], * screens: [ * // Local custom screen * { id: 1, slug: "home", name: "Home", component_tree: [...] } * ], * page_refs: [ * // Reference to shared messaging template * { page_template_id: "core-messaging", screen_id: 2 } * ], * }; * * const allScreens = resolveNavigationPages(navigation); * // Returns: [home screen, messaging screen from template] * ``` */ declare function resolveNavigationPages(navigation: Readonly): ScreenDefinition[]; /** * Get all available page templates for use in navigation. * * @returns Array of page templates from the registry */ declare function getAvailablePageTemplates(): PageTemplate[]; /** * Get core page templates that are required for basic functionality. * * @returns Array of core page templates */ declare function getCorePageTemplates(): PageTemplate[]; /** * Get optional page templates that can be added to navigation. * * @returns Array of optional (non-core) page templates */ declare function getOptionalPageTemplates(): PageTemplate[]; /** * Check if a navigation has all required core pages. * * @param navigation - The navigation to check * @returns Object with validation result and missing page IDs */ declare function validateNavigationPages(navigation: Readonly): { readonly valid: boolean; readonly missingCorePages: readonly string[]; }; //#endregion //#region src/registries/page-template-registry.d.ts /** * Registry for managing reusable page templates. * * The registry provides a central store for page templates that can be * shared across multiple navigations. Core pages (like Messaging, Contacts) * are pre-registered and cannot be removed. * * @example * ```ts * // Register a custom page template * PageTemplateRegistry.register({ * id: 'custom-dashboard', * slug: 'dashboard', * name: 'Custom Dashboard', * category: 'custom', * version: '1.0.0', * component_tree: [{ type: 'TextWidget', props: { text: 'Hello' } }], * }); * * // Get a template by ID * const template = PageTemplateRegistry.get('custom-dashboard'); * * // List all templates in a category * const corePages = PageTemplateRegistry.getByCategory('core'); * ``` */ declare class PageTemplateRegistryImpl { private templates; private categories; constructor(); /** * Register a new page template. * @throws Error if a template with the same ID already exists */ register(template: PageTemplate): void; /** * Unregister a page template by ID. * Core templates cannot be unregistered. * @returns true if the template was removed, false if it didn't exist or is a core template */ unregister(id: string): boolean; /** * Get a page template by ID. */ get(id: string): PageTemplate | undefined; /** * Get all page templates in a specific category. */ getByCategory(category: PageCategoryId | string): PageTemplate[]; /** * List all registered page templates. */ listAll(): PageTemplate[]; /** * List all core page templates (isCore: true). */ listCore(): PageTemplate[]; /** * List all non-core page templates. */ listOptional(): PageTemplate[]; /** * List all registered categories. */ listCategories(): PageCategory[]; /** * Add a custom category. */ addCategory(category: PageCategory): void; /** * Check if a template exists by ID. */ has(id: string): boolean; /** * Get the count of registered templates. */ get size(): number; /** * Clear all non-core templates. * Useful for testing or resetting the registry. */ clearNonCore(): void; } /** * Global page template registry singleton. * * This registry is automatically populated with core page templates * (Messaging, Contacts) when the SDK is imported. */ declare const PageTemplateRegistry: PageTemplateRegistryImpl; //#endregion //#region src/navigation/filter-nav-items.d.ts /** * Filter navigation items by removing rep-only slugs. * Handles nested children: rep-only children are removed, and parents * with no remaining children are also removed. */ declare function filterRepOnlyNavItems(items: NavigationItem[]): NavigationItem[]; //#endregion //#region src/shell/SdkCompanySwitcher.d.ts /** * Static company display for single-tenant portal. * Shows logo + name in the sidebar header. No switching — just branding. */ declare function SdkCompanySwitcher(): React.JSX.Element | null; //#endregion //#region src/shell/BuilderScreenView.d.ts interface BuilderScreenViewProps { /** The screen definition to render */ screen: ScreenDefinition$1; /** Additional CSS classes for the wrapper div */ className?: string; } /** * Renders a builder screen's component_tree with full data source support. * Widgets with `dataSource` config are automatically wrapped with `DataAwareWidget` * which fetches data and merges it with static props before rendering. */ declare function BuilderScreenViewImpl({ screen, className }: BuilderScreenViewProps): React$1.JSX.Element | null; declare const BuilderScreenView: React$1.MemoExoticComponent; //#endregion //#region src/shell/SdkNavigation.d.ts interface SdkNavigationProps { navItems: NavigationItem[]; currentSlug: string; onNavigate: (slug: string) => void; } declare function SdkNavigation({ navItems, currentSlug, onNavigate }: SdkNavigationProps): React.JSX.Element; //#endregion //#region src/shell/SdkHeader.d.ts interface SdkHeaderProps { mobileTabs?: NavigationItem[]; currentSlug: string; /** Current page title, shown on the left of the mobile top bar. */ title?: string; /** * When provided, a native back button is shown at the start of the mobile * top bar. Set only on drill-down screens (e.g. a product detail) so tapping * it returns to the parent list. */ onBack?: () => void; onNavigate: (slug: string) => void; /** * Navigation for the second-level sub-tabs. Lateral tab switching, so it * should not leave a back-button referrer. Falls back to onNavigate. */ onTabNavigate?: (slug: string) => void; onLogout?: () => void; /** Actions that remain available in the mobile header on every route. */ persistentActions?: ReactNode; } declare function SdkHeader({ mobileTabs, currentSlug, title, onBack, onNavigate, onTabNavigate, onLogout, persistentActions }: SdkHeaderProps): React.JSX.Element | null; //#endregion //#region src/shell/PageRouter.d.ts interface PageRouterProps { currentSlug: string; currentNavItem?: NavigationItem | undefined; customPages?: Record> | undefined; /** Per-member-type page overrides, resolved by the current member's slug. */ memberTypeCustomPages?: MemberTypeCustomPages | undefined; /** Builder screen definitions (from fluidos API) */ screens?: ScreenDefinition[] | undefined; baseSlug: string; restParams: string; /** * Slugs from the active navigation. When provided, screens listed in * `OPT_IN_SYSTEM_SCREENS` only render if they're * reachable via the nav — matching the implicit gating builder screens * get from being sourced via `appData.screens`. All other system screens * bypass this check. Omit to render system screens unconditionally. */ navSlugs?: readonly string[] | undefined; } declare function PageRouter({ currentSlug, currentNavItem, customPages, memberTypeCustomPages, screens, baseSlug, restParams, navSlugs }: PageRouterProps): React.JSX.Element; //#endregion //#region src/shell/QuickLinksDropdown.d.ts interface QuickLinksDropdownProps { onNavigate: (slug: string) => void; } declare function QuickLinksDropdown({ onNavigate }: QuickLinksDropdownProps): React.JSX.Element; //#endregion //#region src/shell/AppNavigationContext.d.ts interface AppNavigationContextValue { /** Current active slug (e.g. "contacts/123") */ currentSlug: string; /** * In-memory referrer. Cleared on popstate and page reload — breadcrumbs * after browser back/forward fall back to the structural parent. */ previousSlug: string | null; /** Resolved navigation items (post role-filter, same as what the shell renders) */ navItems: NavigationItem[]; /** Base path for subpath deployments (e.g. "/portal"). Default: "/" */ basePath: string; /** Navigate to a slug programmatically */ navigate: (slug: string) => void; /** Build a full href for a slug (for use in tags) */ buildHref: (slug: string) => string; } interface AppNavigationProviderProps { currentSlug: string; previousSlug: string | null; navItems: NavigationItem[]; basePath: string; navigate: (slug: string) => void; children: ReactNode; } declare function AppNavigationProvider({ currentSlug, previousSlug, navItems, basePath, navigate, children }: AppNavigationProviderProps): React.JSX.Element; declare function useAppNavigation(): AppNavigationContextValue; //#endregion //#region src/shell/AppLink.d.ts interface AppLinkProps extends Omit, "href"> { /** Slug to navigate to (e.g. "contacts/123") */ to: string; } /** * SPA-aware link that renders a real `` for accessibility * (right-click, ctrl+click, screen readers) but intercepts normal * clicks for client-side navigation. */ declare const AppLink: React$1.ForwardRefExoticComponent>; //#endregion //#region ../core/src/navigation/slug-utils.d.ts interface SlugMatch { matchedSlug: string; rest: string; } /** * Extract all slugs from a navigation tree, sorted by segment count descending. * Longest slugs first enables greedy prefix matching (e.g. "share/playlists" * is checked before "share"). */ declare function collectNavSlugs(items: NavigationItem[]): string[]; /** * Find the longest registered nav slug that is a prefix of `fullSlug`. * Uses segment-boundary checking to prevent "shop" from matching "shopping". */ declare function matchSlugPrefix(fullSlug: string, navSlugs: string[]): SlugMatch | undefined; /** * Extract the slug portion from a full pathname by stripping the basePath prefix. * Returns an empty string when the pathname equals the basePath exactly. * * Examples: * extractSlugFromPathname("/contacts/123", "/") → "contacts/123" * extractSlugFromPathname("/portal/contacts", "/portal") → "contacts" * extractSlugFromPathname("/portal", "/portal") → "" * extractSlugFromPathname("/", "/") → "" */ declare function extractSlugFromPathname(pathname: string, basePath: string): string; declare function isSlugInSection(item: NavigationItem, currentSlug: string, navSlugs: string[]): boolean; //#endregion //#region src/scaffold/manifest.d.ts /** * Scaffold Manifest * * Tracks which files belong to the portal scaffold and their category. * Used by `fluid doctor` to detect drift between a scaffolded portal * and the canonical templates shipped with the SDK. * * Categories: * - "entry" — App bootstrap files (main.tsx, index.css) * - "config" — Developer-owned config (portal.config.ts, navigation.config.ts) * - "infrastructure" — Build/tooling config (vite, tsconfig, index.html, linting) */ type FileCategory = "entry" | "config" | "infrastructure"; interface ManifestEntry { readonly category: FileCategory; } /** * Canonical scaffold file manifest. * * Files marked as "entry" or "infrastructure" are checked by `fluid doctor`. * Files marked as "config" are developer-owned and intentionally excluded from drift checks. */ declare const SCAFFOLD_MANIFEST: { readonly version: 2; readonly files: { readonly "src/main.tsx": { readonly category: "entry"; }; readonly "src/index.css": { readonly category: "entry"; }; readonly "index.html": { readonly category: "infrastructure"; }; readonly "tsconfig.json": { readonly category: "infrastructure"; }; readonly "vite.config.ts": { readonly category: "infrastructure"; }; readonly ".oxlintrc.json": { readonly category: "infrastructure"; }; }; /** Developer-owned files — never checked for drift */ readonly developerOwned: readonly ["src/portal.config.ts", "src/navigation.config.ts", "src/screens/*"]; }; type ScaffoldFile = keyof typeof SCAFFOLD_MANIFEST.files; //#endregion //#region ../react/src/shell/ThemeModeContext.d.ts type ThemeMode = "auto" | "light" | "dark"; type DisplayMode = "light" | "dark"; interface ThemeModeContextValue { mode: ThemeMode; displayMode: DisplayMode; setMode: (mode: ThemeMode) => void; autoModeEnabled: boolean; cycleMode: () => void; dataAttribute: string | undefined; } interface ThemeModeProviderProps { children: ReactNode; mode: ThemeMode; onModeChange: (mode: ThemeMode) => void; /** When false, auto mode is skipped in the cycle (light↔dark only). Default true. */ autoModeEnabled?: boolean; } declare function ThemeModeProvider({ children, mode, onModeChange, autoModeEnabled }: ThemeModeProviderProps): React$1.JSX.Element; /** Access the current theme mode, setter, and cycle helper. Must be used within a `ThemeModeProvider`. */ declare function useThemeMode(): ThemeModeContextValue; /** Maps a ThemeMode to the value for `data-theme-mode`. Returns undefined for "auto". */ declare function getThemeModeAttribute(mode: ThemeMode): string | undefined; //#endregion export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, APP_DEFINITION_QUERY_KEY, type Activity as ActivityItem, ActivityScreen, type ActivitySlug, AlertWidget, type AlignOptions, AnnouncementWidget, type AppDefinitionApi, type AppDefinitionResponse, type AppFluidOsDefinition, AppLink, type AppLinkProps, type AppManifest, type AppManifestProfile, type AppManifestResponse, type AppNavigationContextValue, AppNavigationProvider, type AppNavigationProviderProps, AppShell, type AppShellProps, type BackgroundType, type BackgroundValue, type BorderRadiusOptions, BuilderScreenView, type BuilderScreenViewProps, BulletListWidget, type ButtonSizeOptions, CORE_PAGE_IDS, type CalendarEvent, CalendarWidget, CardWidget, CarouselWidget, type CatchUp as CatchUpItem, CatchUpWidget, ChartWidget, type ColorOptions, type Contact, type ContactAddress, type ContactStatus, type ContactType, ContactsScreen, ContainerWidget, type Conversation, type ConversationStatus, type CustomPageComponent, type CustomPages, CustomersScreen, DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SDK_WIDGET_REGISTRY, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, EmbedWidget, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, type FileCategory, type FileUploader, FluidProvider, type FluidProviderProps, type FluidSDKConfig, FluidThemeProvider, type FluidThemeProviderProps, type FontFamilyKey, type FontSizeKey, type FontSizeOptions, type GapOptions, type GenerateThemeCSSOptions, ImageWidget, LayoutWidget, LinkWidget, type ListQueryResult, ListWidget, type ManifestEntry, type MemberPermissionKey, type MemberTypeCustomPages, type MemberTypeDetail, type MemberTypeInfo, type Message, type MessageType, type MessagingAuthContext, type MessagingConfig, type MessagingCurrentUser, MessagingScreen, type MySiteData, MySiteScreen, MySiteWidget, type Navigation, type NavigationItem, NestedWidget, type OklchPlain, OrdersScreen, PAGE_CATEGORIES, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, type PaddingOptions, type PageCategory, type PageCategoryId, type PageOverride, type PageReference, PageRouter, type PageRouterProps, type PageTemplate, PageTemplateProvider, PageTemplateRegistry, type Participant, PointsWidget, type PortalConfig, type PortalCustomPageProps, type PortalErrorContext, type PortalErrorReporter, type PortalFunction, type PortalFunctionDefinition, type PortalFunctionHandler, type PortalFunctionImplementation, type PortalProviderProps, type PortalTenantHeyApiClient, type Profile, ProfileScreen, type PropertyFieldSchema, type PropertyFieldType, type QueryResult, type QueryResultNullable, QuickLinksDropdown, type QuickLinksDropdownProps, QuickLinksWidget, QuickShareWidget, QuoteWidget, RADIUS_KEYS, REMOTE_DOM_COMPONENT_RENDERERS, type RadiusKey, type RawApiNavigationItem, type RawApiScreen, type RawApiTheme, type RawManifestResponse, RecentActivityWidget, type RemoteDomCapabilityMode, type RemoteDomWidgetDefinition, type RemoteDomWidgetPackageDescriptor, type RemoteDomWidgetRegistryOptions, type RemoteWidgetFullscreenHandler, type RemoteWidgetOptions, type RemoteWidgetPluginHostOptions, type RepAppData, type RepAppManifest, type RepAppProfile, type ResolvedColorSet, type ResolvedSemanticColor, type ResolvedTheme, SCAFFOLD_MANIFEST, SEMANTIC_COLOR_NAMES, type ScaffoldFile, type ScreenDefinition, SdkCompanySwitcher, SdkHeader, type SdkHeaderProps, SdkNavigation, type SdkNavigationProps, type SectionLayoutType, type SemanticColorName, SeparatorWidget, type ShareableItem, ShareablesScreen, ShopScreen, type SlugMatch, SpacerWidget, SubscriptionsScreen, type TabConfig, TableWidget, TextWidget, type ThemeColorInput, type ThemeColorPlain, type ThemeDefinition, type ThemeMode, ThemeModeProvider, type ThemePayload, ToDoWidget, type Todo as TodoItem, type TypedWidgetSchema, USER_TYPES, type UploadCallbacks, type UploadResult, type UseCompanySwitchOptions, type UseContactResult, type UseContactsParams, type UseContactsResult, type UseConversationMessagesResult, type UseConversationsResult, type UseFluidThemeResult, type UseListResourceHook, type UseLogoutOptions, type UseSingleResourceHook, type UserType, type ValueListQueryResult, VideoWidget, WIDGET_TYPE_NAMES, type WidgetPath, type WidgetPropertySchema, type WidgetRegistry, type WidgetSchema, type WidgetType, type WidgetTypeName, type WithData, activityScreenPropertySchema, alertWidgetPropertySchema, announcementWidgetPropertySchema, applyPropertyValues, applyTheme, assertDefined, assertNever, buildRemoteWidgetPluginManifests, buildRemoteWidgetRegistry, buildThemeDefinition, bulletListWidgetPropertySchema, calendarWidgetPropertySchema, canAccessRepSurfaces, cardWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createCompanyQueryKey, createDefaultFluidConfig, createPortal, createScreen, createWidgetFromShareable, createWidgetRegistry, customersScreenPropertySchema, deniesRepSurfaces, deriveDarkVariant, deserialiseTheme, embedWidgetPropertySchema, extractPropertyValues, extractSlugFromPathname, filterRepOnlyNavItems, gapValues, generateThemeCSS, getActiveThemeId, getAvailablePageTemplates, getCorePageTemplates, getDefaultThemeDefinition, getForegroundColor, getOptionalPageTemplates, getProperty, getRemoteWidgetPackageCategoryId, getThemeModeAttribute, groupChildrenByColumn, groupPropertyFields, hasData, hasMemberPermission, imageWidgetPropertySchema, implementPortalFunction, isActivitySlug, isContactStatus, isErrorResult, isIdle, isLoading, isPropertyFieldType, isSlugInSection, isUserType, isWidgetType, isWidgetTypeName, layoutWidgetPropertySchema, linkWidgetPropertySchema, listWidgetPropertySchema, matchSlugPrefix, memberTypeName, memberTypeSlug, mergeDarkOverrides, messagingScreenPropertySchema, mySiteScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, pointsWidgetPropertySchema, profileScreenPropertySchema, quickLinksWidgetPropertySchema, quickShareWidgetPropertySchema, quoteWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, separatorWidgetPropertySchema, serialiseTheme, shareablesScreenPropertySchema, shopScreenPropertySchema, spacerWidgetPropertySchema, subscriptionsScreenPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toRawManifest, toScreenDefinition, transformManifestToRepAppData, transformThemes, useAccount, useActivities, useAppDefinition, useAppDefinitionApi, useAppNavigation, useCalendarEvents, useCatchUps, useCompanyScopedQueryKey, useCompanySwitch, useContact, useContacts, useConversationMessages, useConversations, useFluidApp, useFluidContext, useFluidProfile, useFluidTheme, useLogout, useMemberType, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, usePortalTenantClient, usePwaDisplayMode, useResolvedPages, useStore, useThemeContext, useThemeMode, useTodos, validateNavigationPages, videoWidgetPropertySchema, widgetPropertySchemas, wrapRemoteDomRoot }; //# sourceMappingURL=index.d.mts.map