pxengine 0.1.107 → 0.1.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +93 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -2
- package/dist/index.d.ts +34 -2
- package/dist/index.mjs +91 -82
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +1 -1
- package/package.json +7 -4
package/dist/index.d.cts
CHANGED
|
@@ -1449,7 +1449,7 @@ interface PXEngineRendererProps {
|
|
|
1449
1449
|
*/
|
|
1450
1450
|
onFormSubmit?: (qaText: string, values: Record<string, any>) => void;
|
|
1451
1451
|
}
|
|
1452
|
-
declare const PXEngineRenderer: React__default.
|
|
1452
|
+
declare const PXEngineRenderer: React__default.NamedExoticComponent<PXEngineRendererProps>;
|
|
1453
1453
|
|
|
1454
1454
|
declare const buttonVariants: (props?: ({
|
|
1455
1455
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "purple" | null | undefined;
|
|
@@ -1891,6 +1891,34 @@ declare function generateFieldsFromData(data: Record<string, any>): FieldConfig[
|
|
|
1891
1891
|
*/
|
|
1892
1892
|
declare function generateFieldsFromPropDefinitions(propDefs: EditableOrganismPropDef[], data: Record<string, any>): FieldConfig[];
|
|
1893
1893
|
|
|
1894
|
+
/**
|
|
1895
|
+
* Pluggable auth-token provider for pxengine data-fetching molecules.
|
|
1896
|
+
*
|
|
1897
|
+
* The library's default fetchers (MCQCard, CreatorWidget, …) sometimes call the
|
|
1898
|
+
* backend directly and need a Bearer token. Historically they read the token
|
|
1899
|
+
* from `localStorage["px_auth_token"]`, which the host app mirrored there.
|
|
1900
|
+
*
|
|
1901
|
+
* Persisting a JWT in localStorage makes it trivially exfiltratable by any XSS
|
|
1902
|
+
* (`localStorage.getItem("px_auth_token")`). To avoid that, the host app can
|
|
1903
|
+
* instead INJECT a token provider — a function returning the current in-memory
|
|
1904
|
+
* token — so the library never depends on a script-readable storage key:
|
|
1905
|
+
*
|
|
1906
|
+
* import { setPxAuthTokenProvider } from "pxengine";
|
|
1907
|
+
* setPxAuthTokenProvider(() => getAuthToken()); // in-memory token
|
|
1908
|
+
*
|
|
1909
|
+
* When no provider is registered, the library falls back to any non-httpOnly
|
|
1910
|
+
* auth cookie (other embedding contexts). It deliberately no longer reads
|
|
1911
|
+
* localStorage. In same-origin proxy mode (no direct backend origin) no token is
|
|
1912
|
+
* needed at all — the httpOnly cookie is used server-side by the proxy route.
|
|
1913
|
+
*/
|
|
1914
|
+
type TokenProvider = () => string | null | undefined;
|
|
1915
|
+
/** Register a function that returns the current auth token (or null). Pass null
|
|
1916
|
+
* to clear it (e.g. on logout). */
|
|
1917
|
+
declare function setPxAuthTokenProvider(provider: TokenProvider | null): void;
|
|
1918
|
+
/** Resolve the current auth token: injected provider first, then non-httpOnly
|
|
1919
|
+
* cookies. Never reads localStorage. */
|
|
1920
|
+
declare function getPxAuthToken(): string | null;
|
|
1921
|
+
|
|
1894
1922
|
/**
|
|
1895
1923
|
* Run SSE submission helpers for input widgets.
|
|
1896
1924
|
*
|
|
@@ -3876,6 +3904,10 @@ declare const MCQCard: React__default.NamedExoticComponent<MCQCardProps & {
|
|
|
3876
3904
|
*
|
|
3877
3905
|
* This eliminates the delay where the component remounts after an agent
|
|
3878
3906
|
* response and has to wait for the GET API before showing the selection.
|
|
3907
|
+
*
|
|
3908
|
+
* NOTE: localStorage here caches MCQ *selections* (non-sensitive UI state), not
|
|
3909
|
+
* the auth token. The auth token is resolved via getPxAuthToken() (injected
|
|
3910
|
+
* provider / cookies) — never persisted to localStorage.
|
|
3879
3911
|
*/
|
|
3880
3912
|
declare function defaultFetchSelections(sessionId: string): Promise<Record<string, string>>;
|
|
3881
3913
|
declare function defaultPersistSelection(sessionId: string, questionKey: string, value: string): Promise<void>;
|
|
@@ -4168,4 +4200,4 @@ interface AnalyticsChartProps {
|
|
|
4168
4200
|
}
|
|
4169
4201
|
declare function AnalyticsChart({ config: configProp, chartId, apiBase, authToken, height, className, loading: loadingProp, error: errorProp, }: AnalyticsChartProps): react_jsx_runtime.JSX.Element;
|
|
4170
4202
|
|
|
4171
|
-
export { Accordion, AccordionAtom, type AccordionAtomType, AccordionContent, AccordionItem, AccordionTrigger, ActionButton, type ActionButtonAtom, type ActionButtonProps, type ActionPriority, ActionPriorityCard, type ActionPriorityCardMolecule, type ActionPriorityCardProps, type ActionPriorityItem, Alert, AlertAtom, type AlertAtomType, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogAtom, type AlertDialogAtomType, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnalyticsChart, type AnalyticsChartMolecule, type AnalyticsChartProps, type AnalyticsSummaryCardMolecule, ApprovalCard, type ApprovalCardMolecule, type ApprovalCardProps, type ApprovalDetail, type ApprovalStatus, type AreaChartMolecule, ArrowToggleAtom, type ArrowToggleAtomType, AspectRatio, AspectRatioAtom, type AspectRatioAtomType, AudienceDemographicsCard, type AudienceDemographicsCardMolecule, AudienceMetricCard, type AudienceMetricCardMolecule, AudiencePersonaCard, type AudiencePersonaCardMolecule, type AudiencePersonaCardProps, Avatar, AvatarAtom, type AvatarAtomType, AvatarFallback, AvatarImage, Badge, BadgeAtom, type BadgeAtomType, type BarChartMolecule, type BaseAnalyticsChartMolecule, type BaseAtom, type BaseMolecule, type BranchCI, BrandAffinityGroup, type BrandAffinityGroupMolecule, Breadcrumb, BreadcrumbAtom, type BreadcrumbAtomType, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BudgetAllocCard, type BudgetAllocCardProps, type BudgetAllocItem, Button, type ButtonAction, ButtonAtom, type ButtonAtomType, type ButtonSize$1 as ButtonSize, type ButtonVariant$1 as ButtonVariant, Calendar, CalendarAtom, type CalendarAtomType, type CalendarEventAttendee, CalendarEventCard, type CalendarEventCardProps, type CalendarEventStatus, CampaignBriefCard, type CampaignBriefCardMolecule, type CampaignBriefCardProps, CampaignConceptCard, type CampaignConceptCardProps, CampaignSeedCard, type CampaignSeedCardAtom, type CampaignSeedCardProps, Card, CardAtom, type CardAtomType, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselAtom, type CarouselAtomType, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChannelPlanCard, type ChannelPlanCardMolecule, type ChannelPlanCardProps, type ChannelPlanItem, ChartAtom, type ChartAtomType, type ChartDataPoint, Checkbox, CheckboxAtom, type CheckboxAtomType, ChecklistCard, type ChecklistCardMolecule, type ChecklistCardProps, type ChecklistItem, Collapsible, CollapsibleAtom, type CollapsibleAtomType, CollapsibleContent, CollapsibleTrigger, type CollectedField, type ColumnChartMolecule, Command, CommandAtom, type CommandAtomType, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type ComparativeChartMolecule, type ComparisonAttribute, ComparisonCard, type ComparisonCardProps, type ComparisonOption, ConfirmationCard, type ConfirmationCardMolecule, type ConfirmationCardProps, ContentPreviewGallery, type ContentPreviewGalleryMolecule, ContextMenu, ContextMenuAtom, type ContextMenuAtomType, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, CountrySelectDisplay, CountrySelectEdit, CreatorActionHeader, type CreatorActionHeaderMolecule, CreatorCompactView, type CreatorCompactViewProps, type CreatorDetailData, CreatorExpandedPanel, CreatorGridCard, type CreatorGridCardMolecule, CreatorImageList, type CreatorImageListProps, CreatorProfileSummary, type CreatorProfileSummaryMolecule, CreatorProgressBar, type CreatorProgressBarProps, CreatorSearch, type CreatorSearchProps, type CreatorVersionData, CreatorWidget, type CreatorWidgetAction, type CreatorWidgetMolecule, type CreatorWidgetProps, CreatorWidgetSkeleton, type CreatorWidgetStatus, DataGrid, type DataGridMolecule, DataSourceChecklistCard, type DataSourceChecklistCardMolecule, type DataSourceChecklistCardProps, type DataSourceItem, DataTableCard, type DataTableCardMolecule, type DataTableCardProps, type DataTableColumn, Dialog, DialogAtom, type DialogAtomType, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, type DonutChartMolecule, Drawer, DrawerAtom, type DrawerAtomType, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuAtom, type DropdownMenuAtomType, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, DynamicFormCard, type DynamicFormCardMolecule, type DynamicFormCardProps, EditableField, type EditableFieldProps, EmptyState, type EmptyStateMolecule, FeedbackRatingCard, type FeedbackRatingCardMolecule, type FeedbackRatingCardProps, type FetchCreatorDetailsParams, type FetchStatusParams, type FetchVersionsParams, FileUpload, type FileUploadMolecule, FilterBar, type FilterBarMolecule, Form, FormCard, type FormCardProps, FormControl, FormDescription, FormField, FormInputAtom, type FormInputAtomType, FormItem, FormLabel, FormMessage, FormSelectAtom, type FormSelectAtomType, FormTextareaAtom, type FormTextareaAtomType, type FunnelChartMolecule, type GapSize, GitHubConnectCard, type GitHubConnectCardProps, type GitHubConnectMolecule, GitHubIssueTrackerCard, type GitHubIssueTrackerCardProps, type GitHubIssueTrackerMolecule, GitHubRepoHealthCard, type GitHubRepoHealthCardProps, type GitHubRepoHealthMolecule, GitHubReposListCard, type GitHubReposListCardProps, GoalAlignmentCard, type GoalAlignmentCardMolecule, type GoalAlignmentCardProps, type GoalAlignmentItem, GoogleSheetsCard, type GoogleSheetsCardProps, GoogleSheetsConnectCard, type GoogleSheetsConnectCardProps, GoogleSheetsListCard, type GoogleSheetsListCardProps, GrowthChartCard, type GrowthChartCardMolecule, type HeatmapChartMolecule, HoverCard, HoverCardContent, HoverCardTrigger, IconAtom, type IconAtomType, type IconName, Input, InputAtom, type InputAtomType, type InputElementLike, InputOTP, InputOTPAtom, type InputOTPAtomType, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputType, InputWidget, type InputWidgetField, type InputWidgetFieldKind, type InputWidgetType, InsightDigestCard, type InsightDigestCardMolecule, type InsightDigestCardProps, type InsightDigestItem, type InsightFinding, type InsightItemLike, InsightSummaryCard, type InsightSummaryCardMolecule, type InsightSummaryCardProps, type InsightSummaryItem, type JobProgress$2 as JobProgress, type KPIMetricCardMolecule, type KPIStatItem, KPIStatsCard, type KPIStatsCardMolecule, type KPIStatsCardProps, KbdAtom, type KbdAtomType, KeywordBundlesDisplay, KeywordBundlesEdit, Label, LabelAtom, type LabelAtomType, LayoutAtom, type LayoutAtomType, type LayoutDirection, type LineChartMolecule, LoadingOverlay, type LoadingOverlayMolecule, MCQCard, type MCQCardAtom, type MCQCardProps, type MCQOption, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NextStepCard, type NextStepCardMolecule, type NextStepCardProps, type NextStepItem, NotificationList, type NotificationListMolecule, PXEngineRenderer, Pagination, PaginationAtom, type PaginationAtomType, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PersonaSegment, type PieChartMolecule, PlatformIconGroup, type PlatformIconGroupMolecule, PlatformSelectDisplay, PlatformSelectEdit, PollCard, type PollCardMolecule, type PollCardProps, type PollOption, type PollingConfig, Popover, PopoverAtom, type PopoverAtomType, PopoverContent, PopoverTrigger, type PresentationFormats, PresentationJobCard, type PresentationJobCardProps, type PresentationJobOutput, type PriorityActionItem, PriorityActionsCard, type PriorityActionsCardMolecule, type PriorityActionsCardProps, Progress, ProgressAtom, type ProgressAtomType, type PullRequest, REGISTERED_COMPONENTS, RadioAtom, type RadioAtomType, RadioGroup, RadioGroupAtom, type RadioGroupAtomType, RadioGroupItem, RatingAtom, type RatingAtomType, RecommendationCard, type RecommendationCardMolecule, type RecommendationCardProps, type RepoItem, type ReportTheme, ResearchBriefCard, type ResearchBriefCardMolecule, type ResearchBriefCardProps, type ResearchBriefItem, type JobProgress$1 as ResearchJobProgress, ResearchReportJobCard, type ResearchReportJobCardProps, type ResearchReportJobOutput, ResizableAtom, type ResizableAtomType, ResizablePanel, ResizablePanelGroup, RiskSignalCard, type RiskSignalCardMolecule, type RiskSignalCardProps, type RiskSignalItem, type RunSseConfig, ScoreBreakdownCard, type ScoreBreakdownCardMolecule, type ScoreBreakdownCardProps, type ScoreBreakdownItem, ScrollArea, ScrollAreaAtom, type ScrollAreaAtomType, ScrollBar, SearchSpecCard, type SearchSpecCardAtom, type SearchSpecCardProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeparatorAtom, type SeparatorAtomType, Sheet, SheetAtom, type SheetAtomType, SheetClose, type SheetColumn, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetRow, type SheetTabItem, SheetTitle, SheetTrigger, Skeleton, SkeletonAtom, type SkeletonAtomType, Slider, SliderAtom, type SliderAtomType, type SocialPost, SocialPostCard, type SocialPostCardProps, type SocialPostMolecule, Spinner, SpinnerAtom, type SpinnerAtomType, type SpreadsheetItem, type StackedBarChartMolecule, type StackedColumnChartMolecule, type StaleIssue, StatsGrid, type StatsGridMolecule, type StatusDetails, StepWizard, type StepWizardMolecule, Switch, SwitchAtom, type SwitchAtomType, Table, TableAtom, type TableAtomType, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsAtom, type TabsAtomType, TabsContent, TabsList, TabsTrigger, TagCloud, type TagCloudMolecule, TextAtom, type TextAtomType, type TextVariant, Textarea, TextareaAtom, type TimeSeriesChartMolecule, TimelineAtom, type TimelineAtomType, TimelineCard, type TimelineCardMolecule, type TimelineCardProps, type TimelineStep, type TimelineStepStatus, ToggleAtom, type ToggleAtomType, Tooltip, TooltipAtom, type TooltipAtomType, TooltipContent, TooltipProvider, TooltipTrigger, TopPostsGrid, type TopPostsGridMolecule, type TrendIndicatorMolecule, type UIAtom, type UIComponent, type UIMolecule, type UISchema, VideoAtom, type VideoAtomType, WebSearchJobCard, type WebSearchJobCardProps, type WebSearchJobOutput, type WebSearchResult, type WidgetTheme, WidgetThemeContext, cn, defaultFetchSelections, defaultPersistSelection, elementToQAField, formatQAMessage, generateFieldsFromData, generateFieldsFromPropDefinitions, isInputAtom, submitWidgetToAgent, th, useCreatorWidgetPolling, useWidgetTheme, withAlpha };
|
|
4203
|
+
export { Accordion, AccordionAtom, type AccordionAtomType, AccordionContent, AccordionItem, AccordionTrigger, ActionButton, type ActionButtonAtom, type ActionButtonProps, type ActionPriority, ActionPriorityCard, type ActionPriorityCardMolecule, type ActionPriorityCardProps, type ActionPriorityItem, Alert, AlertAtom, type AlertAtomType, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogAtom, type AlertDialogAtomType, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnalyticsChart, type AnalyticsChartMolecule, type AnalyticsChartProps, type AnalyticsSummaryCardMolecule, ApprovalCard, type ApprovalCardMolecule, type ApprovalCardProps, type ApprovalDetail, type ApprovalStatus, type AreaChartMolecule, ArrowToggleAtom, type ArrowToggleAtomType, AspectRatio, AspectRatioAtom, type AspectRatioAtomType, AudienceDemographicsCard, type AudienceDemographicsCardMolecule, AudienceMetricCard, type AudienceMetricCardMolecule, AudiencePersonaCard, type AudiencePersonaCardMolecule, type AudiencePersonaCardProps, Avatar, AvatarAtom, type AvatarAtomType, AvatarFallback, AvatarImage, Badge, BadgeAtom, type BadgeAtomType, type BarChartMolecule, type BaseAnalyticsChartMolecule, type BaseAtom, type BaseMolecule, type BranchCI, BrandAffinityGroup, type BrandAffinityGroupMolecule, Breadcrumb, BreadcrumbAtom, type BreadcrumbAtomType, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BudgetAllocCard, type BudgetAllocCardProps, type BudgetAllocItem, Button, type ButtonAction, ButtonAtom, type ButtonAtomType, type ButtonSize$1 as ButtonSize, type ButtonVariant$1 as ButtonVariant, Calendar, CalendarAtom, type CalendarAtomType, type CalendarEventAttendee, CalendarEventCard, type CalendarEventCardProps, type CalendarEventStatus, CampaignBriefCard, type CampaignBriefCardMolecule, type CampaignBriefCardProps, CampaignConceptCard, type CampaignConceptCardProps, CampaignSeedCard, type CampaignSeedCardAtom, type CampaignSeedCardProps, Card, CardAtom, type CardAtomType, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselAtom, type CarouselAtomType, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChannelPlanCard, type ChannelPlanCardMolecule, type ChannelPlanCardProps, type ChannelPlanItem, ChartAtom, type ChartAtomType, type ChartDataPoint, Checkbox, CheckboxAtom, type CheckboxAtomType, ChecklistCard, type ChecklistCardMolecule, type ChecklistCardProps, type ChecklistItem, Collapsible, CollapsibleAtom, type CollapsibleAtomType, CollapsibleContent, CollapsibleTrigger, type CollectedField, type ColumnChartMolecule, Command, CommandAtom, type CommandAtomType, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type ComparativeChartMolecule, type ComparisonAttribute, ComparisonCard, type ComparisonCardProps, type ComparisonOption, ConfirmationCard, type ConfirmationCardMolecule, type ConfirmationCardProps, ContentPreviewGallery, type ContentPreviewGalleryMolecule, ContextMenu, ContextMenuAtom, type ContextMenuAtomType, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, CountrySelectDisplay, CountrySelectEdit, CreatorActionHeader, type CreatorActionHeaderMolecule, CreatorCompactView, type CreatorCompactViewProps, type CreatorDetailData, CreatorExpandedPanel, CreatorGridCard, type CreatorGridCardMolecule, CreatorImageList, type CreatorImageListProps, CreatorProfileSummary, type CreatorProfileSummaryMolecule, CreatorProgressBar, type CreatorProgressBarProps, CreatorSearch, type CreatorSearchProps, type CreatorVersionData, CreatorWidget, type CreatorWidgetAction, type CreatorWidgetMolecule, type CreatorWidgetProps, CreatorWidgetSkeleton, type CreatorWidgetStatus, DataGrid, type DataGridMolecule, DataSourceChecklistCard, type DataSourceChecklistCardMolecule, type DataSourceChecklistCardProps, type DataSourceItem, DataTableCard, type DataTableCardMolecule, type DataTableCardProps, type DataTableColumn, Dialog, DialogAtom, type DialogAtomType, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, type DonutChartMolecule, Drawer, DrawerAtom, type DrawerAtomType, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuAtom, type DropdownMenuAtomType, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, DynamicFormCard, type DynamicFormCardMolecule, type DynamicFormCardProps, EditableField, type EditableFieldProps, EmptyState, type EmptyStateMolecule, FeedbackRatingCard, type FeedbackRatingCardMolecule, type FeedbackRatingCardProps, type FetchCreatorDetailsParams, type FetchStatusParams, type FetchVersionsParams, FileUpload, type FileUploadMolecule, FilterBar, type FilterBarMolecule, Form, FormCard, type FormCardProps, FormControl, FormDescription, FormField, FormInputAtom, type FormInputAtomType, FormItem, FormLabel, FormMessage, FormSelectAtom, type FormSelectAtomType, FormTextareaAtom, type FormTextareaAtomType, type FunnelChartMolecule, type GapSize, GitHubConnectCard, type GitHubConnectCardProps, type GitHubConnectMolecule, GitHubIssueTrackerCard, type GitHubIssueTrackerCardProps, type GitHubIssueTrackerMolecule, GitHubRepoHealthCard, type GitHubRepoHealthCardProps, type GitHubRepoHealthMolecule, GitHubReposListCard, type GitHubReposListCardProps, GoalAlignmentCard, type GoalAlignmentCardMolecule, type GoalAlignmentCardProps, type GoalAlignmentItem, GoogleSheetsCard, type GoogleSheetsCardProps, GoogleSheetsConnectCard, type GoogleSheetsConnectCardProps, GoogleSheetsListCard, type GoogleSheetsListCardProps, GrowthChartCard, type GrowthChartCardMolecule, type HeatmapChartMolecule, HoverCard, HoverCardContent, HoverCardTrigger, IconAtom, type IconAtomType, type IconName, Input, InputAtom, type InputAtomType, type InputElementLike, InputOTP, InputOTPAtom, type InputOTPAtomType, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputType, InputWidget, type InputWidgetField, type InputWidgetFieldKind, type InputWidgetType, InsightDigestCard, type InsightDigestCardMolecule, type InsightDigestCardProps, type InsightDigestItem, type InsightFinding, type InsightItemLike, InsightSummaryCard, type InsightSummaryCardMolecule, type InsightSummaryCardProps, type InsightSummaryItem, type JobProgress$2 as JobProgress, type KPIMetricCardMolecule, type KPIStatItem, KPIStatsCard, type KPIStatsCardMolecule, type KPIStatsCardProps, KbdAtom, type KbdAtomType, KeywordBundlesDisplay, KeywordBundlesEdit, Label, LabelAtom, type LabelAtomType, LayoutAtom, type LayoutAtomType, type LayoutDirection, type LineChartMolecule, LoadingOverlay, type LoadingOverlayMolecule, MCQCard, type MCQCardAtom, type MCQCardProps, type MCQOption, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NextStepCard, type NextStepCardMolecule, type NextStepCardProps, type NextStepItem, NotificationList, type NotificationListMolecule, PXEngineRenderer, Pagination, PaginationAtom, type PaginationAtomType, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PersonaSegment, type PieChartMolecule, PlatformIconGroup, type PlatformIconGroupMolecule, PlatformSelectDisplay, PlatformSelectEdit, PollCard, type PollCardMolecule, type PollCardProps, type PollOption, type PollingConfig, Popover, PopoverAtom, type PopoverAtomType, PopoverContent, PopoverTrigger, type PresentationFormats, PresentationJobCard, type PresentationJobCardProps, type PresentationJobOutput, type PriorityActionItem, PriorityActionsCard, type PriorityActionsCardMolecule, type PriorityActionsCardProps, Progress, ProgressAtom, type ProgressAtomType, type PullRequest, REGISTERED_COMPONENTS, RadioAtom, type RadioAtomType, RadioGroup, RadioGroupAtom, type RadioGroupAtomType, RadioGroupItem, RatingAtom, type RatingAtomType, RecommendationCard, type RecommendationCardMolecule, type RecommendationCardProps, type RepoItem, type ReportTheme, ResearchBriefCard, type ResearchBriefCardMolecule, type ResearchBriefCardProps, type ResearchBriefItem, type JobProgress$1 as ResearchJobProgress, ResearchReportJobCard, type ResearchReportJobCardProps, type ResearchReportJobOutput, ResizableAtom, type ResizableAtomType, ResizablePanel, ResizablePanelGroup, RiskSignalCard, type RiskSignalCardMolecule, type RiskSignalCardProps, type RiskSignalItem, type RunSseConfig, ScoreBreakdownCard, type ScoreBreakdownCardMolecule, type ScoreBreakdownCardProps, type ScoreBreakdownItem, ScrollArea, ScrollAreaAtom, type ScrollAreaAtomType, ScrollBar, SearchSpecCard, type SearchSpecCardAtom, type SearchSpecCardProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeparatorAtom, type SeparatorAtomType, Sheet, SheetAtom, type SheetAtomType, SheetClose, type SheetColumn, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetRow, type SheetTabItem, SheetTitle, SheetTrigger, Skeleton, SkeletonAtom, type SkeletonAtomType, Slider, SliderAtom, type SliderAtomType, type SocialPost, SocialPostCard, type SocialPostCardProps, type SocialPostMolecule, Spinner, SpinnerAtom, type SpinnerAtomType, type SpreadsheetItem, type StackedBarChartMolecule, type StackedColumnChartMolecule, type StaleIssue, StatsGrid, type StatsGridMolecule, type StatusDetails, StepWizard, type StepWizardMolecule, Switch, SwitchAtom, type SwitchAtomType, Table, TableAtom, type TableAtomType, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsAtom, type TabsAtomType, TabsContent, TabsList, TabsTrigger, TagCloud, type TagCloudMolecule, TextAtom, type TextAtomType, type TextVariant, Textarea, TextareaAtom, type TimeSeriesChartMolecule, TimelineAtom, type TimelineAtomType, TimelineCard, type TimelineCardMolecule, type TimelineCardProps, type TimelineStep, type TimelineStepStatus, ToggleAtom, type ToggleAtomType, Tooltip, TooltipAtom, type TooltipAtomType, TooltipContent, TooltipProvider, TooltipTrigger, TopPostsGrid, type TopPostsGridMolecule, type TrendIndicatorMolecule, type UIAtom, type UIComponent, type UIMolecule, type UISchema, VideoAtom, type VideoAtomType, WebSearchJobCard, type WebSearchJobCardProps, type WebSearchJobOutput, type WebSearchResult, type WidgetTheme, WidgetThemeContext, cn, defaultFetchSelections, defaultPersistSelection, elementToQAField, formatQAMessage, generateFieldsFromData, generateFieldsFromPropDefinitions, getPxAuthToken, isInputAtom, setPxAuthTokenProvider, submitWidgetToAgent, th, useCreatorWidgetPolling, useWidgetTheme, withAlpha };
|
package/dist/index.d.ts
CHANGED
|
@@ -1449,7 +1449,7 @@ interface PXEngineRendererProps {
|
|
|
1449
1449
|
*/
|
|
1450
1450
|
onFormSubmit?: (qaText: string, values: Record<string, any>) => void;
|
|
1451
1451
|
}
|
|
1452
|
-
declare const PXEngineRenderer: React__default.
|
|
1452
|
+
declare const PXEngineRenderer: React__default.NamedExoticComponent<PXEngineRendererProps>;
|
|
1453
1453
|
|
|
1454
1454
|
declare const buttonVariants: (props?: ({
|
|
1455
1455
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "purple" | null | undefined;
|
|
@@ -1891,6 +1891,34 @@ declare function generateFieldsFromData(data: Record<string, any>): FieldConfig[
|
|
|
1891
1891
|
*/
|
|
1892
1892
|
declare function generateFieldsFromPropDefinitions(propDefs: EditableOrganismPropDef[], data: Record<string, any>): FieldConfig[];
|
|
1893
1893
|
|
|
1894
|
+
/**
|
|
1895
|
+
* Pluggable auth-token provider for pxengine data-fetching molecules.
|
|
1896
|
+
*
|
|
1897
|
+
* The library's default fetchers (MCQCard, CreatorWidget, …) sometimes call the
|
|
1898
|
+
* backend directly and need a Bearer token. Historically they read the token
|
|
1899
|
+
* from `localStorage["px_auth_token"]`, which the host app mirrored there.
|
|
1900
|
+
*
|
|
1901
|
+
* Persisting a JWT in localStorage makes it trivially exfiltratable by any XSS
|
|
1902
|
+
* (`localStorage.getItem("px_auth_token")`). To avoid that, the host app can
|
|
1903
|
+
* instead INJECT a token provider — a function returning the current in-memory
|
|
1904
|
+
* token — so the library never depends on a script-readable storage key:
|
|
1905
|
+
*
|
|
1906
|
+
* import { setPxAuthTokenProvider } from "pxengine";
|
|
1907
|
+
* setPxAuthTokenProvider(() => getAuthToken()); // in-memory token
|
|
1908
|
+
*
|
|
1909
|
+
* When no provider is registered, the library falls back to any non-httpOnly
|
|
1910
|
+
* auth cookie (other embedding contexts). It deliberately no longer reads
|
|
1911
|
+
* localStorage. In same-origin proxy mode (no direct backend origin) no token is
|
|
1912
|
+
* needed at all — the httpOnly cookie is used server-side by the proxy route.
|
|
1913
|
+
*/
|
|
1914
|
+
type TokenProvider = () => string | null | undefined;
|
|
1915
|
+
/** Register a function that returns the current auth token (or null). Pass null
|
|
1916
|
+
* to clear it (e.g. on logout). */
|
|
1917
|
+
declare function setPxAuthTokenProvider(provider: TokenProvider | null): void;
|
|
1918
|
+
/** Resolve the current auth token: injected provider first, then non-httpOnly
|
|
1919
|
+
* cookies. Never reads localStorage. */
|
|
1920
|
+
declare function getPxAuthToken(): string | null;
|
|
1921
|
+
|
|
1894
1922
|
/**
|
|
1895
1923
|
* Run SSE submission helpers for input widgets.
|
|
1896
1924
|
*
|
|
@@ -3876,6 +3904,10 @@ declare const MCQCard: React__default.NamedExoticComponent<MCQCardProps & {
|
|
|
3876
3904
|
*
|
|
3877
3905
|
* This eliminates the delay where the component remounts after an agent
|
|
3878
3906
|
* response and has to wait for the GET API before showing the selection.
|
|
3907
|
+
*
|
|
3908
|
+
* NOTE: localStorage here caches MCQ *selections* (non-sensitive UI state), not
|
|
3909
|
+
* the auth token. The auth token is resolved via getPxAuthToken() (injected
|
|
3910
|
+
* provider / cookies) — never persisted to localStorage.
|
|
3879
3911
|
*/
|
|
3880
3912
|
declare function defaultFetchSelections(sessionId: string): Promise<Record<string, string>>;
|
|
3881
3913
|
declare function defaultPersistSelection(sessionId: string, questionKey: string, value: string): Promise<void>;
|
|
@@ -4168,4 +4200,4 @@ interface AnalyticsChartProps {
|
|
|
4168
4200
|
}
|
|
4169
4201
|
declare function AnalyticsChart({ config: configProp, chartId, apiBase, authToken, height, className, loading: loadingProp, error: errorProp, }: AnalyticsChartProps): react_jsx_runtime.JSX.Element;
|
|
4170
4202
|
|
|
4171
|
-
export { Accordion, AccordionAtom, type AccordionAtomType, AccordionContent, AccordionItem, AccordionTrigger, ActionButton, type ActionButtonAtom, type ActionButtonProps, type ActionPriority, ActionPriorityCard, type ActionPriorityCardMolecule, type ActionPriorityCardProps, type ActionPriorityItem, Alert, AlertAtom, type AlertAtomType, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogAtom, type AlertDialogAtomType, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnalyticsChart, type AnalyticsChartMolecule, type AnalyticsChartProps, type AnalyticsSummaryCardMolecule, ApprovalCard, type ApprovalCardMolecule, type ApprovalCardProps, type ApprovalDetail, type ApprovalStatus, type AreaChartMolecule, ArrowToggleAtom, type ArrowToggleAtomType, AspectRatio, AspectRatioAtom, type AspectRatioAtomType, AudienceDemographicsCard, type AudienceDemographicsCardMolecule, AudienceMetricCard, type AudienceMetricCardMolecule, AudiencePersonaCard, type AudiencePersonaCardMolecule, type AudiencePersonaCardProps, Avatar, AvatarAtom, type AvatarAtomType, AvatarFallback, AvatarImage, Badge, BadgeAtom, type BadgeAtomType, type BarChartMolecule, type BaseAnalyticsChartMolecule, type BaseAtom, type BaseMolecule, type BranchCI, BrandAffinityGroup, type BrandAffinityGroupMolecule, Breadcrumb, BreadcrumbAtom, type BreadcrumbAtomType, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BudgetAllocCard, type BudgetAllocCardProps, type BudgetAllocItem, Button, type ButtonAction, ButtonAtom, type ButtonAtomType, type ButtonSize$1 as ButtonSize, type ButtonVariant$1 as ButtonVariant, Calendar, CalendarAtom, type CalendarAtomType, type CalendarEventAttendee, CalendarEventCard, type CalendarEventCardProps, type CalendarEventStatus, CampaignBriefCard, type CampaignBriefCardMolecule, type CampaignBriefCardProps, CampaignConceptCard, type CampaignConceptCardProps, CampaignSeedCard, type CampaignSeedCardAtom, type CampaignSeedCardProps, Card, CardAtom, type CardAtomType, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselAtom, type CarouselAtomType, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChannelPlanCard, type ChannelPlanCardMolecule, type ChannelPlanCardProps, type ChannelPlanItem, ChartAtom, type ChartAtomType, type ChartDataPoint, Checkbox, CheckboxAtom, type CheckboxAtomType, ChecklistCard, type ChecklistCardMolecule, type ChecklistCardProps, type ChecklistItem, Collapsible, CollapsibleAtom, type CollapsibleAtomType, CollapsibleContent, CollapsibleTrigger, type CollectedField, type ColumnChartMolecule, Command, CommandAtom, type CommandAtomType, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type ComparativeChartMolecule, type ComparisonAttribute, ComparisonCard, type ComparisonCardProps, type ComparisonOption, ConfirmationCard, type ConfirmationCardMolecule, type ConfirmationCardProps, ContentPreviewGallery, type ContentPreviewGalleryMolecule, ContextMenu, ContextMenuAtom, type ContextMenuAtomType, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, CountrySelectDisplay, CountrySelectEdit, CreatorActionHeader, type CreatorActionHeaderMolecule, CreatorCompactView, type CreatorCompactViewProps, type CreatorDetailData, CreatorExpandedPanel, CreatorGridCard, type CreatorGridCardMolecule, CreatorImageList, type CreatorImageListProps, CreatorProfileSummary, type CreatorProfileSummaryMolecule, CreatorProgressBar, type CreatorProgressBarProps, CreatorSearch, type CreatorSearchProps, type CreatorVersionData, CreatorWidget, type CreatorWidgetAction, type CreatorWidgetMolecule, type CreatorWidgetProps, CreatorWidgetSkeleton, type CreatorWidgetStatus, DataGrid, type DataGridMolecule, DataSourceChecklistCard, type DataSourceChecklistCardMolecule, type DataSourceChecklistCardProps, type DataSourceItem, DataTableCard, type DataTableCardMolecule, type DataTableCardProps, type DataTableColumn, Dialog, DialogAtom, type DialogAtomType, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, type DonutChartMolecule, Drawer, DrawerAtom, type DrawerAtomType, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuAtom, type DropdownMenuAtomType, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, DynamicFormCard, type DynamicFormCardMolecule, type DynamicFormCardProps, EditableField, type EditableFieldProps, EmptyState, type EmptyStateMolecule, FeedbackRatingCard, type FeedbackRatingCardMolecule, type FeedbackRatingCardProps, type FetchCreatorDetailsParams, type FetchStatusParams, type FetchVersionsParams, FileUpload, type FileUploadMolecule, FilterBar, type FilterBarMolecule, Form, FormCard, type FormCardProps, FormControl, FormDescription, FormField, FormInputAtom, type FormInputAtomType, FormItem, FormLabel, FormMessage, FormSelectAtom, type FormSelectAtomType, FormTextareaAtom, type FormTextareaAtomType, type FunnelChartMolecule, type GapSize, GitHubConnectCard, type GitHubConnectCardProps, type GitHubConnectMolecule, GitHubIssueTrackerCard, type GitHubIssueTrackerCardProps, type GitHubIssueTrackerMolecule, GitHubRepoHealthCard, type GitHubRepoHealthCardProps, type GitHubRepoHealthMolecule, GitHubReposListCard, type GitHubReposListCardProps, GoalAlignmentCard, type GoalAlignmentCardMolecule, type GoalAlignmentCardProps, type GoalAlignmentItem, GoogleSheetsCard, type GoogleSheetsCardProps, GoogleSheetsConnectCard, type GoogleSheetsConnectCardProps, GoogleSheetsListCard, type GoogleSheetsListCardProps, GrowthChartCard, type GrowthChartCardMolecule, type HeatmapChartMolecule, HoverCard, HoverCardContent, HoverCardTrigger, IconAtom, type IconAtomType, type IconName, Input, InputAtom, type InputAtomType, type InputElementLike, InputOTP, InputOTPAtom, type InputOTPAtomType, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputType, InputWidget, type InputWidgetField, type InputWidgetFieldKind, type InputWidgetType, InsightDigestCard, type InsightDigestCardMolecule, type InsightDigestCardProps, type InsightDigestItem, type InsightFinding, type InsightItemLike, InsightSummaryCard, type InsightSummaryCardMolecule, type InsightSummaryCardProps, type InsightSummaryItem, type JobProgress$2 as JobProgress, type KPIMetricCardMolecule, type KPIStatItem, KPIStatsCard, type KPIStatsCardMolecule, type KPIStatsCardProps, KbdAtom, type KbdAtomType, KeywordBundlesDisplay, KeywordBundlesEdit, Label, LabelAtom, type LabelAtomType, LayoutAtom, type LayoutAtomType, type LayoutDirection, type LineChartMolecule, LoadingOverlay, type LoadingOverlayMolecule, MCQCard, type MCQCardAtom, type MCQCardProps, type MCQOption, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NextStepCard, type NextStepCardMolecule, type NextStepCardProps, type NextStepItem, NotificationList, type NotificationListMolecule, PXEngineRenderer, Pagination, PaginationAtom, type PaginationAtomType, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PersonaSegment, type PieChartMolecule, PlatformIconGroup, type PlatformIconGroupMolecule, PlatformSelectDisplay, PlatformSelectEdit, PollCard, type PollCardMolecule, type PollCardProps, type PollOption, type PollingConfig, Popover, PopoverAtom, type PopoverAtomType, PopoverContent, PopoverTrigger, type PresentationFormats, PresentationJobCard, type PresentationJobCardProps, type PresentationJobOutput, type PriorityActionItem, PriorityActionsCard, type PriorityActionsCardMolecule, type PriorityActionsCardProps, Progress, ProgressAtom, type ProgressAtomType, type PullRequest, REGISTERED_COMPONENTS, RadioAtom, type RadioAtomType, RadioGroup, RadioGroupAtom, type RadioGroupAtomType, RadioGroupItem, RatingAtom, type RatingAtomType, RecommendationCard, type RecommendationCardMolecule, type RecommendationCardProps, type RepoItem, type ReportTheme, ResearchBriefCard, type ResearchBriefCardMolecule, type ResearchBriefCardProps, type ResearchBriefItem, type JobProgress$1 as ResearchJobProgress, ResearchReportJobCard, type ResearchReportJobCardProps, type ResearchReportJobOutput, ResizableAtom, type ResizableAtomType, ResizablePanel, ResizablePanelGroup, RiskSignalCard, type RiskSignalCardMolecule, type RiskSignalCardProps, type RiskSignalItem, type RunSseConfig, ScoreBreakdownCard, type ScoreBreakdownCardMolecule, type ScoreBreakdownCardProps, type ScoreBreakdownItem, ScrollArea, ScrollAreaAtom, type ScrollAreaAtomType, ScrollBar, SearchSpecCard, type SearchSpecCardAtom, type SearchSpecCardProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeparatorAtom, type SeparatorAtomType, Sheet, SheetAtom, type SheetAtomType, SheetClose, type SheetColumn, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetRow, type SheetTabItem, SheetTitle, SheetTrigger, Skeleton, SkeletonAtom, type SkeletonAtomType, Slider, SliderAtom, type SliderAtomType, type SocialPost, SocialPostCard, type SocialPostCardProps, type SocialPostMolecule, Spinner, SpinnerAtom, type SpinnerAtomType, type SpreadsheetItem, type StackedBarChartMolecule, type StackedColumnChartMolecule, type StaleIssue, StatsGrid, type StatsGridMolecule, type StatusDetails, StepWizard, type StepWizardMolecule, Switch, SwitchAtom, type SwitchAtomType, Table, TableAtom, type TableAtomType, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsAtom, type TabsAtomType, TabsContent, TabsList, TabsTrigger, TagCloud, type TagCloudMolecule, TextAtom, type TextAtomType, type TextVariant, Textarea, TextareaAtom, type TimeSeriesChartMolecule, TimelineAtom, type TimelineAtomType, TimelineCard, type TimelineCardMolecule, type TimelineCardProps, type TimelineStep, type TimelineStepStatus, ToggleAtom, type ToggleAtomType, Tooltip, TooltipAtom, type TooltipAtomType, TooltipContent, TooltipProvider, TooltipTrigger, TopPostsGrid, type TopPostsGridMolecule, type TrendIndicatorMolecule, type UIAtom, type UIComponent, type UIMolecule, type UISchema, VideoAtom, type VideoAtomType, WebSearchJobCard, type WebSearchJobCardProps, type WebSearchJobOutput, type WebSearchResult, type WidgetTheme, WidgetThemeContext, cn, defaultFetchSelections, defaultPersistSelection, elementToQAField, formatQAMessage, generateFieldsFromData, generateFieldsFromPropDefinitions, isInputAtom, submitWidgetToAgent, th, useCreatorWidgetPolling, useWidgetTheme, withAlpha };
|
|
4203
|
+
export { Accordion, AccordionAtom, type AccordionAtomType, AccordionContent, AccordionItem, AccordionTrigger, ActionButton, type ActionButtonAtom, type ActionButtonProps, type ActionPriority, ActionPriorityCard, type ActionPriorityCardMolecule, type ActionPriorityCardProps, type ActionPriorityItem, Alert, AlertAtom, type AlertAtomType, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogAtom, type AlertDialogAtomType, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnalyticsChart, type AnalyticsChartMolecule, type AnalyticsChartProps, type AnalyticsSummaryCardMolecule, ApprovalCard, type ApprovalCardMolecule, type ApprovalCardProps, type ApprovalDetail, type ApprovalStatus, type AreaChartMolecule, ArrowToggleAtom, type ArrowToggleAtomType, AspectRatio, AspectRatioAtom, type AspectRatioAtomType, AudienceDemographicsCard, type AudienceDemographicsCardMolecule, AudienceMetricCard, type AudienceMetricCardMolecule, AudiencePersonaCard, type AudiencePersonaCardMolecule, type AudiencePersonaCardProps, Avatar, AvatarAtom, type AvatarAtomType, AvatarFallback, AvatarImage, Badge, BadgeAtom, type BadgeAtomType, type BarChartMolecule, type BaseAnalyticsChartMolecule, type BaseAtom, type BaseMolecule, type BranchCI, BrandAffinityGroup, type BrandAffinityGroupMolecule, Breadcrumb, BreadcrumbAtom, type BreadcrumbAtomType, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BudgetAllocCard, type BudgetAllocCardProps, type BudgetAllocItem, Button, type ButtonAction, ButtonAtom, type ButtonAtomType, type ButtonSize$1 as ButtonSize, type ButtonVariant$1 as ButtonVariant, Calendar, CalendarAtom, type CalendarAtomType, type CalendarEventAttendee, CalendarEventCard, type CalendarEventCardProps, type CalendarEventStatus, CampaignBriefCard, type CampaignBriefCardMolecule, type CampaignBriefCardProps, CampaignConceptCard, type CampaignConceptCardProps, CampaignSeedCard, type CampaignSeedCardAtom, type CampaignSeedCardProps, Card, CardAtom, type CardAtomType, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselAtom, type CarouselAtomType, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChannelPlanCard, type ChannelPlanCardMolecule, type ChannelPlanCardProps, type ChannelPlanItem, ChartAtom, type ChartAtomType, type ChartDataPoint, Checkbox, CheckboxAtom, type CheckboxAtomType, ChecklistCard, type ChecklistCardMolecule, type ChecklistCardProps, type ChecklistItem, Collapsible, CollapsibleAtom, type CollapsibleAtomType, CollapsibleContent, CollapsibleTrigger, type CollectedField, type ColumnChartMolecule, Command, CommandAtom, type CommandAtomType, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type ComparativeChartMolecule, type ComparisonAttribute, ComparisonCard, type ComparisonCardProps, type ComparisonOption, ConfirmationCard, type ConfirmationCardMolecule, type ConfirmationCardProps, ContentPreviewGallery, type ContentPreviewGalleryMolecule, ContextMenu, ContextMenuAtom, type ContextMenuAtomType, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, CountrySelectDisplay, CountrySelectEdit, CreatorActionHeader, type CreatorActionHeaderMolecule, CreatorCompactView, type CreatorCompactViewProps, type CreatorDetailData, CreatorExpandedPanel, CreatorGridCard, type CreatorGridCardMolecule, CreatorImageList, type CreatorImageListProps, CreatorProfileSummary, type CreatorProfileSummaryMolecule, CreatorProgressBar, type CreatorProgressBarProps, CreatorSearch, type CreatorSearchProps, type CreatorVersionData, CreatorWidget, type CreatorWidgetAction, type CreatorWidgetMolecule, type CreatorWidgetProps, CreatorWidgetSkeleton, type CreatorWidgetStatus, DataGrid, type DataGridMolecule, DataSourceChecklistCard, type DataSourceChecklistCardMolecule, type DataSourceChecklistCardProps, type DataSourceItem, DataTableCard, type DataTableCardMolecule, type DataTableCardProps, type DataTableColumn, Dialog, DialogAtom, type DialogAtomType, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, type DonutChartMolecule, Drawer, DrawerAtom, type DrawerAtomType, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuAtom, type DropdownMenuAtomType, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, DynamicFormCard, type DynamicFormCardMolecule, type DynamicFormCardProps, EditableField, type EditableFieldProps, EmptyState, type EmptyStateMolecule, FeedbackRatingCard, type FeedbackRatingCardMolecule, type FeedbackRatingCardProps, type FetchCreatorDetailsParams, type FetchStatusParams, type FetchVersionsParams, FileUpload, type FileUploadMolecule, FilterBar, type FilterBarMolecule, Form, FormCard, type FormCardProps, FormControl, FormDescription, FormField, FormInputAtom, type FormInputAtomType, FormItem, FormLabel, FormMessage, FormSelectAtom, type FormSelectAtomType, FormTextareaAtom, type FormTextareaAtomType, type FunnelChartMolecule, type GapSize, GitHubConnectCard, type GitHubConnectCardProps, type GitHubConnectMolecule, GitHubIssueTrackerCard, type GitHubIssueTrackerCardProps, type GitHubIssueTrackerMolecule, GitHubRepoHealthCard, type GitHubRepoHealthCardProps, type GitHubRepoHealthMolecule, GitHubReposListCard, type GitHubReposListCardProps, GoalAlignmentCard, type GoalAlignmentCardMolecule, type GoalAlignmentCardProps, type GoalAlignmentItem, GoogleSheetsCard, type GoogleSheetsCardProps, GoogleSheetsConnectCard, type GoogleSheetsConnectCardProps, GoogleSheetsListCard, type GoogleSheetsListCardProps, GrowthChartCard, type GrowthChartCardMolecule, type HeatmapChartMolecule, HoverCard, HoverCardContent, HoverCardTrigger, IconAtom, type IconAtomType, type IconName, Input, InputAtom, type InputAtomType, type InputElementLike, InputOTP, InputOTPAtom, type InputOTPAtomType, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputType, InputWidget, type InputWidgetField, type InputWidgetFieldKind, type InputWidgetType, InsightDigestCard, type InsightDigestCardMolecule, type InsightDigestCardProps, type InsightDigestItem, type InsightFinding, type InsightItemLike, InsightSummaryCard, type InsightSummaryCardMolecule, type InsightSummaryCardProps, type InsightSummaryItem, type JobProgress$2 as JobProgress, type KPIMetricCardMolecule, type KPIStatItem, KPIStatsCard, type KPIStatsCardMolecule, type KPIStatsCardProps, KbdAtom, type KbdAtomType, KeywordBundlesDisplay, KeywordBundlesEdit, Label, LabelAtom, type LabelAtomType, LayoutAtom, type LayoutAtomType, type LayoutDirection, type LineChartMolecule, LoadingOverlay, type LoadingOverlayMolecule, MCQCard, type MCQCardAtom, type MCQCardProps, type MCQOption, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NextStepCard, type NextStepCardMolecule, type NextStepCardProps, type NextStepItem, NotificationList, type NotificationListMolecule, PXEngineRenderer, Pagination, PaginationAtom, type PaginationAtomType, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PersonaSegment, type PieChartMolecule, PlatformIconGroup, type PlatformIconGroupMolecule, PlatformSelectDisplay, PlatformSelectEdit, PollCard, type PollCardMolecule, type PollCardProps, type PollOption, type PollingConfig, Popover, PopoverAtom, type PopoverAtomType, PopoverContent, PopoverTrigger, type PresentationFormats, PresentationJobCard, type PresentationJobCardProps, type PresentationJobOutput, type PriorityActionItem, PriorityActionsCard, type PriorityActionsCardMolecule, type PriorityActionsCardProps, Progress, ProgressAtom, type ProgressAtomType, type PullRequest, REGISTERED_COMPONENTS, RadioAtom, type RadioAtomType, RadioGroup, RadioGroupAtom, type RadioGroupAtomType, RadioGroupItem, RatingAtom, type RatingAtomType, RecommendationCard, type RecommendationCardMolecule, type RecommendationCardProps, type RepoItem, type ReportTheme, ResearchBriefCard, type ResearchBriefCardMolecule, type ResearchBriefCardProps, type ResearchBriefItem, type JobProgress$1 as ResearchJobProgress, ResearchReportJobCard, type ResearchReportJobCardProps, type ResearchReportJobOutput, ResizableAtom, type ResizableAtomType, ResizablePanel, ResizablePanelGroup, RiskSignalCard, type RiskSignalCardMolecule, type RiskSignalCardProps, type RiskSignalItem, type RunSseConfig, ScoreBreakdownCard, type ScoreBreakdownCardMolecule, type ScoreBreakdownCardProps, type ScoreBreakdownItem, ScrollArea, ScrollAreaAtom, type ScrollAreaAtomType, ScrollBar, SearchSpecCard, type SearchSpecCardAtom, type SearchSpecCardProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeparatorAtom, type SeparatorAtomType, Sheet, SheetAtom, type SheetAtomType, SheetClose, type SheetColumn, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetRow, type SheetTabItem, SheetTitle, SheetTrigger, Skeleton, SkeletonAtom, type SkeletonAtomType, Slider, SliderAtom, type SliderAtomType, type SocialPost, SocialPostCard, type SocialPostCardProps, type SocialPostMolecule, Spinner, SpinnerAtom, type SpinnerAtomType, type SpreadsheetItem, type StackedBarChartMolecule, type StackedColumnChartMolecule, type StaleIssue, StatsGrid, type StatsGridMolecule, type StatusDetails, StepWizard, type StepWizardMolecule, Switch, SwitchAtom, type SwitchAtomType, Table, TableAtom, type TableAtomType, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsAtom, type TabsAtomType, TabsContent, TabsList, TabsTrigger, TagCloud, type TagCloudMolecule, TextAtom, type TextAtomType, type TextVariant, Textarea, TextareaAtom, type TimeSeriesChartMolecule, TimelineAtom, type TimelineAtomType, TimelineCard, type TimelineCardMolecule, type TimelineCardProps, type TimelineStep, type TimelineStepStatus, ToggleAtom, type ToggleAtomType, Tooltip, TooltipAtom, type TooltipAtomType, TooltipContent, TooltipProvider, TooltipTrigger, TopPostsGrid, type TopPostsGridMolecule, type TrendIndicatorMolecule, type UIAtom, type UIComponent, type UIMolecule, type UISchema, VideoAtom, type VideoAtomType, WebSearchJobCard, type WebSearchJobCardProps, type WebSearchJobOutput, type WebSearchResult, type WidgetTheme, WidgetThemeContext, cn, defaultFetchSelections, defaultPersistSelection, elementToQAField, formatQAMessage, generateFieldsFromData, generateFieldsFromPropDefinitions, getPxAuthToken, isInputAtom, setPxAuthTokenProvider, submitWidgetToAgent, th, useCreatorWidgetPolling, useWidgetTheme, withAlpha };
|
package/dist/index.mjs
CHANGED
|
@@ -3130,7 +3130,7 @@ __export(lucide_react_exports, {
|
|
|
3130
3130
|
LucideMailX: () => MailX,
|
|
3131
3131
|
LucideMailbox: () => Mailbox,
|
|
3132
3132
|
LucideMails: () => Mails,
|
|
3133
|
-
LucideMap: () =>
|
|
3133
|
+
LucideMap: () => Map2,
|
|
3134
3134
|
LucideMapPin: () => MapPin,
|
|
3135
3135
|
LucideMapPinCheck: () => MapPinCheck,
|
|
3136
3136
|
LucideMapPinCheckInside: () => MapPinCheckInside,
|
|
@@ -3922,8 +3922,8 @@ __export(lucide_react_exports, {
|
|
|
3922
3922
|
MailboxIcon: () => Mailbox,
|
|
3923
3923
|
Mails: () => Mails,
|
|
3924
3924
|
MailsIcon: () => Mails,
|
|
3925
|
-
Map: () =>
|
|
3926
|
-
MapIcon: () =>
|
|
3925
|
+
Map: () => Map2,
|
|
3926
|
+
MapIcon: () => Map2,
|
|
3927
3927
|
MapPin: () => MapPin,
|
|
3928
3928
|
MapPinCheck: () => MapPinCheck,
|
|
3929
3929
|
MapPinCheckIcon: () => MapPinCheck,
|
|
@@ -6334,7 +6334,7 @@ __export(icons_exports, {
|
|
|
6334
6334
|
MailX: () => MailX,
|
|
6335
6335
|
Mailbox: () => Mailbox,
|
|
6336
6336
|
Mails: () => Mails,
|
|
6337
|
-
Map: () =>
|
|
6337
|
+
Map: () => Map2,
|
|
6338
6338
|
MapPin: () => MapPin,
|
|
6339
6339
|
MapPinCheck: () => MapPinCheck,
|
|
6340
6340
|
MapPinCheckInside: () => MapPinCheckInside,
|
|
@@ -17149,7 +17149,7 @@ var __iconNode891 = [
|
|
|
17149
17149
|
["path", { d: "M15 5.764v15", key: "1pn4in" }],
|
|
17150
17150
|
["path", { d: "M9 3.236v15", key: "1uimfh" }]
|
|
17151
17151
|
];
|
|
17152
|
-
var
|
|
17152
|
+
var Map2 = createLucideIcon("Map", __iconNode891);
|
|
17153
17153
|
|
|
17154
17154
|
// node_modules/lucide-react/dist/esm/icons/mars-stroke.js
|
|
17155
17155
|
var __iconNode892 = [
|
|
@@ -33164,7 +33164,7 @@ var ChartTooltipContent = React80.forwardRef(
|
|
|
33164
33164
|
)
|
|
33165
33165
|
] })
|
|
33166
33166
|
},
|
|
33167
|
-
item.dataKey
|
|
33167
|
+
`${item.dataKey ?? index}`
|
|
33168
33168
|
);
|
|
33169
33169
|
}) })
|
|
33170
33170
|
]
|
|
@@ -41393,6 +41393,28 @@ SearchSpecCard.displayName = "SearchSpecCard";
|
|
|
41393
41393
|
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
41394
41394
|
import React112 from "react";
|
|
41395
41395
|
|
|
41396
|
+
// src/lib/auth-provider.ts
|
|
41397
|
+
var _provider = null;
|
|
41398
|
+
function setPxAuthTokenProvider(provider) {
|
|
41399
|
+
_provider = provider;
|
|
41400
|
+
}
|
|
41401
|
+
function getPxAuthToken() {
|
|
41402
|
+
if (_provider) {
|
|
41403
|
+
try {
|
|
41404
|
+
const t = _provider();
|
|
41405
|
+
if (t) return t;
|
|
41406
|
+
} catch {
|
|
41407
|
+
}
|
|
41408
|
+
}
|
|
41409
|
+
if (typeof document !== "undefined") {
|
|
41410
|
+
for (const name of ["adminTokenBuilder", "adminToken", "token"]) {
|
|
41411
|
+
const match2 = document.cookie.match(new RegExp(`(?:^|;\\s*)${name}=([^;]*)`));
|
|
41412
|
+
if (match2?.[1]) return match2[1];
|
|
41413
|
+
}
|
|
41414
|
+
}
|
|
41415
|
+
return null;
|
|
41416
|
+
}
|
|
41417
|
+
|
|
41396
41418
|
// src/molecules/creator-discovery/MCQCard/defaultFetchers.ts
|
|
41397
41419
|
function getBackendOrigin() {
|
|
41398
41420
|
if (typeof window === "undefined") return null;
|
|
@@ -41408,25 +41430,10 @@ function getBaseUrl() {
|
|
|
41408
41430
|
if (backend) return `${backend}/api/custom-agents`;
|
|
41409
41431
|
return "/api/agents-proxy/custom-agents";
|
|
41410
41432
|
}
|
|
41411
|
-
function getAuthToken() {
|
|
41412
|
-
if (typeof window === "undefined") return null;
|
|
41413
|
-
try {
|
|
41414
|
-
const ls = localStorage.getItem("px_auth_token");
|
|
41415
|
-
if (ls) return ls;
|
|
41416
|
-
} catch {
|
|
41417
|
-
}
|
|
41418
|
-
if (typeof document !== "undefined") {
|
|
41419
|
-
for (const name of ["adminTokenBuilder", "adminToken", "token"]) {
|
|
41420
|
-
const match2 = document.cookie.match(new RegExp(`(?:^|;\\s*)${name}=([^;]*)`));
|
|
41421
|
-
if (match2?.[1]) return match2[1];
|
|
41422
|
-
}
|
|
41423
|
-
}
|
|
41424
|
-
return null;
|
|
41425
|
-
}
|
|
41426
41433
|
function buildHeaders() {
|
|
41427
41434
|
const headers = { "Content-Type": "application/json" };
|
|
41428
41435
|
if (getBackendOrigin()) {
|
|
41429
|
-
const token =
|
|
41436
|
+
const token = getPxAuthToken();
|
|
41430
41437
|
if (token) headers["Authorization"] = `Bearer ${token}`;
|
|
41431
41438
|
}
|
|
41432
41439
|
return headers;
|
|
@@ -43005,26 +43012,11 @@ function getBackendOrigin2() {
|
|
|
43005
43012
|
}
|
|
43006
43013
|
return raw;
|
|
43007
43014
|
}
|
|
43008
|
-
function getAuthToken2() {
|
|
43009
|
-
if (typeof window === "undefined") return null;
|
|
43010
|
-
try {
|
|
43011
|
-
const ls = localStorage.getItem("px_auth_token");
|
|
43012
|
-
if (ls) return ls;
|
|
43013
|
-
} catch {
|
|
43014
|
-
}
|
|
43015
|
-
if (typeof document !== "undefined") {
|
|
43016
|
-
for (const name of ["adminTokenBuilder", "adminToken", "token"]) {
|
|
43017
|
-
const match2 = document.cookie.match(new RegExp(`(?:^|;\\s*)${name}=([^;]*)`));
|
|
43018
|
-
if (match2?.[1]) return match2[1];
|
|
43019
|
-
}
|
|
43020
|
-
}
|
|
43021
|
-
return null;
|
|
43022
|
-
}
|
|
43023
43015
|
function buildHeaders2(includeJson = false) {
|
|
43024
43016
|
const headers = {};
|
|
43025
43017
|
if (includeJson) headers["Content-Type"] = "application/json";
|
|
43026
43018
|
if (getBackendOrigin2()) {
|
|
43027
|
-
const token =
|
|
43019
|
+
const token = getPxAuthToken();
|
|
43028
43020
|
if (token) headers["Authorization"] = `Bearer ${token}`;
|
|
43029
43021
|
}
|
|
43030
43022
|
return headers;
|
|
@@ -46884,6 +46876,37 @@ ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
|
46884
46876
|
// src/render/PXEngineRenderer.tsx
|
|
46885
46877
|
import { jsx as jsx188, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
46886
46878
|
var MOLECULE_REFS = new Set(Object.values(molecules_exports));
|
|
46879
|
+
var ATOMS_WITH_RENDER = /* @__PURE__ */ new Set([
|
|
46880
|
+
"LayoutAtom",
|
|
46881
|
+
"CardAtom",
|
|
46882
|
+
"TabsAtom",
|
|
46883
|
+
"AccordionAtom",
|
|
46884
|
+
"ScrollAreaAtom",
|
|
46885
|
+
"CarouselAtom",
|
|
46886
|
+
"AspectRatioAtom",
|
|
46887
|
+
"CollapsibleAtom",
|
|
46888
|
+
"TooltipAtom",
|
|
46889
|
+
"PopoverAtom",
|
|
46890
|
+
"DialogAtom",
|
|
46891
|
+
"SheetAtom",
|
|
46892
|
+
"ResizableAtom"
|
|
46893
|
+
]);
|
|
46894
|
+
var COMPONENT_LOOKUP_CACHE = /* @__PURE__ */ new Map();
|
|
46895
|
+
var resolveComponent = (identifier) => {
|
|
46896
|
+
const cached = COMPONENT_LOOKUP_CACHE.get(identifier);
|
|
46897
|
+
if (cached !== void 0) return cached;
|
|
46898
|
+
const normalized = identifier.split(/[-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
46899
|
+
const atomName = normalized.endsWith("Atom") ? normalized : `${normalized}Atom`;
|
|
46900
|
+
let Comp = atoms_exports[atomName] || atoms_exports[normalized] || atoms_exports[identifier] || null;
|
|
46901
|
+
if (!Comp) {
|
|
46902
|
+
Comp = molecules_exports[normalized] || molecules_exports[identifier] || null;
|
|
46903
|
+
}
|
|
46904
|
+
if (!Comp && !CONTEXT_DEPENDENT_COMPONENTS.has(normalized)) {
|
|
46905
|
+
Comp = ui_exports[normalized] || ui_exports[identifier] || null;
|
|
46906
|
+
}
|
|
46907
|
+
COMPONENT_LOOKUP_CACHE.set(identifier, Comp);
|
|
46908
|
+
return Comp;
|
|
46909
|
+
};
|
|
46887
46910
|
var CONTEXT_DEPENDENT_COMPONENTS = /* @__PURE__ */ new Set([
|
|
46888
46911
|
// Form components - require FormField + FormItem context
|
|
46889
46912
|
"FormLabel",
|
|
@@ -47012,7 +47035,10 @@ var renderContextDependentError = (componentName, normalizedName, key) => {
|
|
|
47012
47035
|
key
|
|
47013
47036
|
);
|
|
47014
47037
|
};
|
|
47038
|
+
var NORMALIZE_PROPS_CACHE = /* @__PURE__ */ new WeakMap();
|
|
47015
47039
|
var normalizeProps = (props) => {
|
|
47040
|
+
const cached = NORMALIZE_PROPS_CACHE.get(props);
|
|
47041
|
+
if (cached) return cached;
|
|
47016
47042
|
const normalized = {};
|
|
47017
47043
|
const dynamicStyle = {};
|
|
47018
47044
|
Object.entries(props).forEach(([key, value]) => {
|
|
@@ -47072,7 +47098,9 @@ var normalizeProps = (props) => {
|
|
|
47072
47098
|
}
|
|
47073
47099
|
normalized[key] = value;
|
|
47074
47100
|
});
|
|
47075
|
-
|
|
47101
|
+
const result = { normalized, dynamicStyle };
|
|
47102
|
+
NORMALIZE_PROPS_CACHE.set(props, result);
|
|
47103
|
+
return result;
|
|
47076
47104
|
};
|
|
47077
47105
|
var FORM_INPUT_ATOM_NAMES = /* @__PURE__ */ new Set([
|
|
47078
47106
|
"InputAtom",
|
|
@@ -47091,13 +47119,13 @@ var FORM_INPUT_ATOM_NAMES = /* @__PURE__ */ new Set([
|
|
|
47091
47119
|
"InputOTPAtom",
|
|
47092
47120
|
"ToggleAtom"
|
|
47093
47121
|
]);
|
|
47094
|
-
var PXEngineRenderer = ({
|
|
47122
|
+
var PXEngineRenderer = React118.memo(function PXEngineRenderer2({
|
|
47095
47123
|
schema,
|
|
47096
47124
|
onAction,
|
|
47097
47125
|
disabled,
|
|
47098
47126
|
theme,
|
|
47099
47127
|
onFormSubmit
|
|
47100
|
-
})
|
|
47128
|
+
}) {
|
|
47101
47129
|
const contextTheme = React118.useContext(WidgetThemeContext);
|
|
47102
47130
|
const effectiveTheme = theme ?? contextTheme;
|
|
47103
47131
|
const formValuesRef = React118.useRef({});
|
|
@@ -47132,28 +47160,34 @@ var PXEngineRenderer = ({
|
|
|
47132
47160
|
} = component;
|
|
47133
47161
|
const componentName = name || type || componentType;
|
|
47134
47162
|
if (!componentName || typeof componentName !== "string") return null;
|
|
47135
|
-
const
|
|
47136
|
-
|
|
47137
|
-
if (
|
|
47138
|
-
|
|
47163
|
+
const hasRemaining = Object.keys(remainingProps).length > 0;
|
|
47164
|
+
let baseProps = hasRemaining ? { ...remainingProps, ...props } : props;
|
|
47165
|
+
if (baseProps && baseProps.key !== void 0) {
|
|
47166
|
+
const { key: _k, ...rest } = baseProps;
|
|
47167
|
+
baseProps = rest;
|
|
47168
|
+
}
|
|
47169
|
+
const { normalized, dynamicStyle } = normalizeProps(baseProps || {});
|
|
47170
|
+
const finalProps = { ...normalized };
|
|
47171
|
+
if (disabled !== void 0 && finalProps.disabled === void 0) {
|
|
47172
|
+
finalProps.disabled = disabled;
|
|
47139
47173
|
}
|
|
47140
47174
|
const normalizedName = componentName.charAt(0).toUpperCase() + componentName.slice(1);
|
|
47141
47175
|
const earlyAtomName = normalizedName.endsWith("Atom") ? normalizedName : `${normalizedName}Atom`;
|
|
47142
47176
|
if (onFormSubmit && FORM_INPUT_ATOM_NAMES.has(earlyAtomName)) {
|
|
47143
|
-
const fieldKey =
|
|
47177
|
+
const fieldKey = finalProps.fieldKey || finalProps.id || id || finalProps.label || componentName;
|
|
47144
47178
|
const storedValue = formValuesRef.current[fieldKey];
|
|
47145
47179
|
if (storedValue !== void 0) {
|
|
47146
|
-
|
|
47180
|
+
finalProps.defaultValue = storedValue;
|
|
47147
47181
|
}
|
|
47148
|
-
|
|
47149
|
-
|
|
47150
|
-
if (id)
|
|
47182
|
+
finalProps.onValueChange = handleInputValueChange;
|
|
47183
|
+
finalProps.fieldKey = fieldKey;
|
|
47184
|
+
if (id) finalProps.id = id;
|
|
47151
47185
|
}
|
|
47152
47186
|
if (onFormSubmit && earlyAtomName === "ButtonAtom") {
|
|
47153
|
-
const action =
|
|
47187
|
+
const action = finalProps.action || finalProps.buttonAction;
|
|
47154
47188
|
if (action === "submit") {
|
|
47155
|
-
const originalOnAction =
|
|
47156
|
-
|
|
47189
|
+
const originalOnAction = finalProps.onAction;
|
|
47190
|
+
finalProps.onAction = (evt) => {
|
|
47157
47191
|
const elements = Object.entries(formValuesRef.current).map(
|
|
47158
47192
|
([key, value]) => ({
|
|
47159
47193
|
id: key,
|
|
@@ -47169,23 +47203,10 @@ var PXEngineRenderer = ({
|
|
|
47169
47203
|
};
|
|
47170
47204
|
}
|
|
47171
47205
|
}
|
|
47172
|
-
const { normalized: finalProps, dynamicStyle } = normalizeProps(rawProps);
|
|
47173
47206
|
if (id && !finalProps.id) {
|
|
47174
47207
|
finalProps.id = id;
|
|
47175
47208
|
}
|
|
47176
47209
|
const uniqueKey = id || (index !== void 0 ? `${componentName}-${index}` : `${componentName}-root`);
|
|
47177
|
-
const resolveComponent = (identifier) => {
|
|
47178
|
-
const normalized = identifier.split(/[-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
47179
|
-
const atomName2 = normalized.endsWith("Atom") ? normalized : `${normalized}Atom`;
|
|
47180
|
-
let Comp = atoms_exports[atomName2] || atoms_exports[normalized] || atoms_exports[identifier];
|
|
47181
|
-
if (!Comp) {
|
|
47182
|
-
Comp = molecules_exports[normalized] || molecules_exports[identifier];
|
|
47183
|
-
}
|
|
47184
|
-
if (!Comp && !CONTEXT_DEPENDENT_COMPONENTS.has(normalized)) {
|
|
47185
|
-
Comp = ui_exports[normalized] || ui_exports[identifier];
|
|
47186
|
-
}
|
|
47187
|
-
return Comp;
|
|
47188
|
-
};
|
|
47189
47210
|
let TargetComponent = resolveComponent(componentName);
|
|
47190
47211
|
let resolvedIdentifier = componentName;
|
|
47191
47212
|
if (!TargetComponent && type && type !== componentName) {
|
|
@@ -47210,21 +47231,6 @@ var PXEngineRenderer = ({
|
|
|
47210
47231
|
}
|
|
47211
47232
|
const resolvedNormalized = resolvedIdentifier.charAt(0).toUpperCase() + resolvedIdentifier.slice(1);
|
|
47212
47233
|
const atomName = resolvedNormalized.endsWith("Atom") ? resolvedNormalized : `${resolvedNormalized}Atom`;
|
|
47213
|
-
const ATOMS_WITH_RENDER = /* @__PURE__ */ new Set([
|
|
47214
|
-
"LayoutAtom",
|
|
47215
|
-
"CardAtom",
|
|
47216
|
-
"TabsAtom",
|
|
47217
|
-
"AccordionAtom",
|
|
47218
|
-
"ScrollAreaAtom",
|
|
47219
|
-
"CarouselAtom",
|
|
47220
|
-
"AspectRatioAtom",
|
|
47221
|
-
"CollapsibleAtom",
|
|
47222
|
-
"TooltipAtom",
|
|
47223
|
-
"PopoverAtom",
|
|
47224
|
-
"DialogAtom",
|
|
47225
|
-
"SheetAtom",
|
|
47226
|
-
"ResizableAtom"
|
|
47227
|
-
]);
|
|
47228
47234
|
const isAtomWithRenderProp = ATOMS_WITH_RENDER.has(atomName);
|
|
47229
47235
|
if (effectiveTheme && finalProps.theme === void 0 && MOLECULE_REFS.has(TargetComponent)) {
|
|
47230
47236
|
finalProps.theme = effectiveTheme;
|
|
@@ -47258,7 +47264,8 @@ var PXEngineRenderer = ({
|
|
|
47258
47264
|
}
|
|
47259
47265
|
};
|
|
47260
47266
|
return /* @__PURE__ */ jsx188(WidgetThemeContext.Provider, { value: effectiveTheme, children: /* @__PURE__ */ jsx188("div", { className: "px-engine-root relative w-full h-full", children: renderRecursive(root) }) });
|
|
47261
|
-
};
|
|
47267
|
+
});
|
|
47268
|
+
PXEngineRenderer.displayName = "PXEngineRenderer";
|
|
47262
47269
|
export {
|
|
47263
47270
|
Accordion,
|
|
47264
47271
|
AccordionAtom,
|
|
@@ -47575,7 +47582,9 @@ export {
|
|
|
47575
47582
|
formatQAMessage,
|
|
47576
47583
|
generateFieldsFromData,
|
|
47577
47584
|
generateFieldsFromPropDefinitions,
|
|
47585
|
+
getPxAuthToken,
|
|
47578
47586
|
isInputAtom,
|
|
47587
|
+
setPxAuthTokenProvider,
|
|
47579
47588
|
submitWidgetToAgent,
|
|
47580
47589
|
th,
|
|
47581
47590
|
useCreatorWidgetPolling,
|