@arbidocs/blocks 0.3.138 → 0.3.140

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.d.cts CHANGED
@@ -1,10 +1,11 @@
1
- import { ThemeBundle, ThemeTokens, ThemeState } from './site/index.cjs';
2
- export { Accordion, AccordionItem, AccordionProps, ApplyThemeOptions, AvatarBlock, AvatarBlockProps, Banner, BannerProps, BannerTone, BlockImage, BlockImageProps, BlockLink, BlockLinkComponent, BlockLinkProps, CTABanner, CTABannerProps, Callout, CalloutProps, CalloutVariant, ColorToken, Columns, ColumnsProps, ContactField, ContactForm, ContactFormProps, Container, ContainerProps, FAQ, FAQProps, FONT_PAIRINGS, FaqItem, FeatureGrid, FeatureGridProps, FeatureItem, FontPairing, Footer, FooterColumn, FooterLink, FooterProps, Gallery, GalleryImage, GalleryProps, Hero, HeroCta, HeroProps, ListBlock, ListBlockProps, ListItem, LogoCloud, LogoCloudProps, LogoItem, MediaText, MediaTextProps, NavLink, Navbar, NavbarProps, PricingPlan, PricingTable, PricingTableProps, RichTextBlock, RichTextBlockProps, SectionHeading, Spacer, SpacerProps, StepItem, Steps, StepsProps, THEME_STYLE_ID, TabItem, Tabs, TabsProps, TeamGrid, TeamGridProps, TeamMember, Testimonial, TestimonialGrid, TestimonialGridProps, TestimonialItem, TestimonialProps, ThemeEditor, ThemeEditorProps, ThemeEmitMode, ThemeFonts, ThemePreset, ThemeStoreConfig, VideoAspect, VideoEmbed, VideoEmbedProps, applyFontVars, applyStoredTheme, applyThemeVars, clearFontVars, clearThemeVars, createThemeStore, daysUntil, fmtDate, fmtDateTime, fontPackages, fromNow, gbp, getFontPairing, hrs, initials, matchFontPairing, pct, tid, toEmbedUrl, toHslTriplet } from './site/index.cjs';
1
+ import { ap as ThemeBundle, ax as ThemeTokens, av as ThemeState } from './index-BzrF2JbQ.cjs';
2
+ export { A as Accordion, a as AccordionItem, b as AccordionProps, c as ApplyThemeOptions, d as AvatarBlock, e as AvatarBlockProps, B as Banner, f as BannerProps, g as BannerTone, h as BlockImage, i as BlockImageProps, j as BlockLink, k as BlockLinkComponent, l as BlockLinkProps, C as CTABanner, m as CTABannerProps, n as Callout, o as CalloutProps, p as CalloutVariant, q as ColorToken, r as Columns, s as ColumnsProps, t as ContactField, u as ContactForm, v as ContactFormProps, w as Container, x as ContainerProps, F as FAQ, y as FAQProps, z as FONT_PAIRINGS, D as FaqItem, E as FeatureGrid, G as FeatureGridProps, H as FeatureItem, I as FontPairing, J as Footer, K as FooterColumn, L as FooterLink, M as FooterProps, N as Gallery, O as GalleryImage, P as GalleryProps, Q as Hero, R as HeroCta, S as HeroProps, T as ListBlock, U as ListBlockProps, V as ListItem, W as LogoCloud, X as LogoCloudProps, Y as LogoItem, Z as MediaText, _ as MediaTextProps, $ as NavLink, a0 as Navbar, a1 as NavbarProps, a2 as PricingPlan, a3 as PricingTable, a4 as PricingTableProps, a5 as RichTextBlock, a6 as RichTextBlockProps, a7 as SectionHeading, a8 as Spacer, a9 as SpacerProps, aa as StepItem, ab as Steps, ac as StepsProps, ad as THEME_STYLE_ID, ae as TabItem, af as Tabs, ag as TabsProps, ah as TeamGrid, ai as TeamGridProps, aj as TeamMember, ak as Testimonial, al as TestimonialGrid, am as TestimonialGridProps, an as TestimonialItem, ao as TestimonialProps, aq as ThemeEditor, ar as ThemeEditorProps, as as ThemeEmitMode, at as ThemeFonts, au as ThemePreset, aw as ThemeStoreConfig, ay as VideoAspect, az as VideoEmbed, aA as VideoEmbedProps, aB as applyFontVars, aC as applyStoredTheme, aD as applyThemeVars, aE as clearFontVars, aF as clearThemeVars, aG as createThemeStore, aH as daysUntil, aI as fmtDate, aJ as fmtDateTime, aK as fontPackages, aL as formatPageRefs, aM as fromNow, aN as gbp, aO as getFontPairing, aP as hrs, aQ as initials, aR as matchFontPairing, aS as pct, aT as tid, aU as toEmbedUrl, aV as toHslTriplet } from './index-BzrF2JbQ.cjs';
3
3
  import * as react from 'react';
4
4
  import react__default, { ReactNode, ComponentType } from 'react';
5
5
  import * as _arbidocs_react from '@arbidocs/react';
6
- import { AiRunOptions, UserMenuItem, NotifyVariant, useArbi, AiTaskStatus } from '@arbidocs/react';
6
+ import { DocumentLike, AiRunOptions, UserMenuItem, NotifyVariant, useArbi, AiTaskStatus } from '@arbidocs/react';
7
7
  export { AiRunOptions, AiTaskStatus, ArtifactEvent, DocumentCard, DocumentCardProps, SearchChunk, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, redlineStats, textToArtifact, toRedlineMarkdown } from '@arbidocs/react';
8
+ import { components } from '@arbidocs/client';
8
9
  import { ColDef, GridOptions, GridApi, CellValueChangedEvent, GridState } from 'ag-grid-community';
9
10
  import { LucideIcon } from 'lucide-react';
10
11
  import { CustomField, Field, ComponentConfig, Data, Config } from '@measured/puck';
@@ -128,6 +129,45 @@ declare function createPromptLibrary(config: PromptConfig): {
128
129
  }];
129
130
  };
130
131
 
132
+ type CitationSources = components['schemas']['CitationSources'];
133
+ type Citations = CitationSources | null;
134
+ interface CitationEditorProps {
135
+ value: string;
136
+ citations: Citations | null;
137
+ onChange: (note: string, citations: Citations | null) => void;
138
+ /** Currently active citation key (controlled from parent) */
139
+ activeCitationKey?: string | null;
140
+ /**
141
+ * Open a document in the viewer, armed to collect passages for this field —
142
+ * and tag its first passage, so a chosen document is immediately a usable
143
+ * citation. Passages are picked by reading, so citing means opening.
144
+ *
145
+ * The caller owns this because resolving "first passage" needs the parsed
146
+ * document, and keeping that fetch out here is what lets this component stay
147
+ * store- and API-free (and therefore hoistable to @arbidocs/blocks).
148
+ */
149
+ onCiteDocument?: (docExtId: string) => void;
150
+ /** Cited documents, already resolved by the caller — keyed by external id. */
151
+ citedDocs?: Record<string, DocumentLike>;
152
+ /**
153
+ * The app's document picker, injected as a slot. It is store-coupled, so it
154
+ * is passed in rather than imported, and receives the chosen document id.
155
+ */
156
+ renderDocumentPicker?: (onSelect: (docExtId: string) => void, selectedIds: string[]) => React.ReactNode;
157
+ placeholder?: string;
158
+ readOnly?: boolean;
159
+ className?: string;
160
+ /** Start in edit mode with the caret in the field (composer behaviour). */
161
+ autoFocus?: boolean;
162
+ /** Applied to the text field itself, so callers can target it directly. */
163
+ 'data-testid'?: string;
164
+ /** Persisted textarea height in pixels */
165
+ defaultHeight?: number;
166
+ /** Called after user resizes the textarea */
167
+ onHeightChange?: (height: number) => void;
168
+ }
169
+ declare function CitationEditor({ value, citations, onChange, activeCitationKey, onCiteDocument, citedDocs, renderDocumentPicker, autoFocus, 'data-testid': dataTestId, placeholder, readOnly, className, defaultHeight, onHeightChange, }: CitationEditorProps): react.JSX.Element;
170
+
131
171
  /**
132
172
  * Shared shapes for the ARBI adapter — identical in demo and live mode so UI
133
173
  * never needs to know which backend is serving it — plus the per-firm config a
@@ -286,13 +326,11 @@ declare function useWorkspaceDocs(): {
286
326
  doctags: {
287
327
  note?: string | null | undefined;
288
328
  citations?: {
289
- [x: string]: {
290
- chunk_ids: string[];
291
- scores: number[];
292
- statement: string;
293
- offset_start: number;
294
- offset_end: number;
295
- };
329
+ passages: {
330
+ chunk_id: string;
331
+ doc_ext_id?: string | null | undefined;
332
+ page?: number | null | undefined;
333
+ }[];
296
334
  } | null | undefined;
297
335
  doc_ext_id: string;
298
336
  tag_ext_id: string;
@@ -1259,4 +1297,4 @@ interface AgentsPanelProps {
1259
1297
  }
1260
1298
  declare function AgentsPanel({ store, testIdPrefix }: AgentsPanelProps): react.JSX.Element;
1261
1299
 
1262
- export { ASSET_REF_PREFIX, type AgentSelectionStore, AgentsPanel, type AgentsPanelProps, type AiFields, type AiFieldsConfig, AppHeader, type AppHeaderProps, type AppHeaderUser, type AppNavItem, type AppNavSection, AppShell, type AppShellProps, type ArbiBlocksConfigOptions, type ArbiMode, type ArbiUser, type AssetMaterializer, type AssetRenderProps, type AssetRenderer, AssetResolverProvider, AssetThumb, type AssistantCitation, type AssistantMessage, type AssistantStep, type BlockKit, type BuildPrompt, type BuilderModule, type Column, ConnectionProvider, type ConnectionStatus, DataTable, DataTableBlock, type DataTableBlockColumn, type DataTableBlockProps, EmptyState, type ExportedModule, type FirmArbiConfig, GridView, type GridViewEmptyState, type GridViewProps, type GridViewSelection, type ImageFieldConfig, type ImageFieldFactory, LegalArbiProvider, LiveDataProvider, type LoadResult, type MaterializeOptions, type MatterContext, MetricCard, type MetricCardProps, ModuleManager, type ModuleManagerProps, type ModuleRegistry, type ModuleStoreBundle, PageHeader, PageRenderer, type PageRendererProps, type PersistVia, type PromptConfig, type PromptLibrary, type Prompts, type ResolvedModule, Section, type SectionProps, StatGroup, type StatGroupProps, type StatItem, StudioEditor, type StudioEditorProps, type StudioPageMeta, type StudioPersistence, type StudioPersistenceConfig, ThemeBundle, ThemeState, ThemeTokens, Toolbar, UploadDropzone, type UploadDropzoneProps, type UseImageGen, VerticalBuilder, type VerticalBuilderProps, type VerticalConfig, type VerticalExport, type VerticalExportConfig, WidgetPlaceholder, WorkspaceCard, type WorkspaceCardMember, type WorkspaceCardProps, asAssetRef, assetRefId, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createLiveWidgets, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createVerticalExport, createWebsiteBlocks, iconMap, isAssetRef, isAuthenticated, materializePageData, matterToContext, useAssetImage, useAssetRenderer, useAssetResolverActive, useConnection, useFirmAiTask, useImageGen, useLiveDataActive, useSemanticSearch, useWorkspaceDocs };
1300
+ export { ASSET_REF_PREFIX, type AgentSelectionStore, AgentsPanel, type AgentsPanelProps, type AiFields, type AiFieldsConfig, AppHeader, type AppHeaderProps, type AppHeaderUser, type AppNavItem, type AppNavSection, AppShell, type AppShellProps, type ArbiBlocksConfigOptions, type ArbiMode, type ArbiUser, type AssetMaterializer, type AssetRenderProps, type AssetRenderer, AssetResolverProvider, AssetThumb, type AssistantCitation, type AssistantMessage, type AssistantStep, type BlockKit, type BuildPrompt, type BuilderModule, CitationEditor, type CitationEditorProps, type Column, ConnectionProvider, type ConnectionStatus, DataTable, DataTableBlock, type DataTableBlockColumn, type DataTableBlockProps, EmptyState, type ExportedModule, type FirmArbiConfig, GridView, type GridViewEmptyState, type GridViewProps, type GridViewSelection, type ImageFieldConfig, type ImageFieldFactory, LegalArbiProvider, LiveDataProvider, type LoadResult, type MaterializeOptions, type MatterContext, MetricCard, type MetricCardProps, ModuleManager, type ModuleManagerProps, type ModuleRegistry, type ModuleStoreBundle, PageHeader, PageRenderer, type PageRendererProps, type PersistVia, type PromptConfig, type PromptLibrary, type Prompts, type ResolvedModule, Section, type SectionProps, StatGroup, type StatGroupProps, type StatItem, StudioEditor, type StudioEditorProps, type StudioPageMeta, type StudioPersistence, type StudioPersistenceConfig, ThemeBundle, ThemeState, ThemeTokens, Toolbar, UploadDropzone, type UploadDropzoneProps, type UseImageGen, VerticalBuilder, type VerticalBuilderProps, type VerticalConfig, type VerticalExport, type VerticalExportConfig, WidgetPlaceholder, WorkspaceCard, type WorkspaceCardMember, type WorkspaceCardProps, asAssetRef, assetRefId, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createLiveWidgets, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createVerticalExport, createWebsiteBlocks, iconMap, isAssetRef, isAuthenticated, materializePageData, matterToContext, useAssetImage, useAssetRenderer, useAssetResolverActive, useConnection, useFirmAiTask, useImageGen, useLiveDataActive, useSemanticSearch, useWorkspaceDocs };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { ThemeBundle, ThemeTokens, ThemeState } from './site/index.js';
2
- export { Accordion, AccordionItem, AccordionProps, ApplyThemeOptions, AvatarBlock, AvatarBlockProps, Banner, BannerProps, BannerTone, BlockImage, BlockImageProps, BlockLink, BlockLinkComponent, BlockLinkProps, CTABanner, CTABannerProps, Callout, CalloutProps, CalloutVariant, ColorToken, Columns, ColumnsProps, ContactField, ContactForm, ContactFormProps, Container, ContainerProps, FAQ, FAQProps, FONT_PAIRINGS, FaqItem, FeatureGrid, FeatureGridProps, FeatureItem, FontPairing, Footer, FooterColumn, FooterLink, FooterProps, Gallery, GalleryImage, GalleryProps, Hero, HeroCta, HeroProps, ListBlock, ListBlockProps, ListItem, LogoCloud, LogoCloudProps, LogoItem, MediaText, MediaTextProps, NavLink, Navbar, NavbarProps, PricingPlan, PricingTable, PricingTableProps, RichTextBlock, RichTextBlockProps, SectionHeading, Spacer, SpacerProps, StepItem, Steps, StepsProps, THEME_STYLE_ID, TabItem, Tabs, TabsProps, TeamGrid, TeamGridProps, TeamMember, Testimonial, TestimonialGrid, TestimonialGridProps, TestimonialItem, TestimonialProps, ThemeEditor, ThemeEditorProps, ThemeEmitMode, ThemeFonts, ThemePreset, ThemeStoreConfig, VideoAspect, VideoEmbed, VideoEmbedProps, applyFontVars, applyStoredTheme, applyThemeVars, clearFontVars, clearThemeVars, createThemeStore, daysUntil, fmtDate, fmtDateTime, fontPackages, fromNow, gbp, getFontPairing, hrs, initials, matchFontPairing, pct, tid, toEmbedUrl, toHslTriplet } from './site/index.js';
1
+ import { ap as ThemeBundle, ax as ThemeTokens, av as ThemeState } from './index-BzrF2JbQ.js';
2
+ export { A as Accordion, a as AccordionItem, b as AccordionProps, c as ApplyThemeOptions, d as AvatarBlock, e as AvatarBlockProps, B as Banner, f as BannerProps, g as BannerTone, h as BlockImage, i as BlockImageProps, j as BlockLink, k as BlockLinkComponent, l as BlockLinkProps, C as CTABanner, m as CTABannerProps, n as Callout, o as CalloutProps, p as CalloutVariant, q as ColorToken, r as Columns, s as ColumnsProps, t as ContactField, u as ContactForm, v as ContactFormProps, w as Container, x as ContainerProps, F as FAQ, y as FAQProps, z as FONT_PAIRINGS, D as FaqItem, E as FeatureGrid, G as FeatureGridProps, H as FeatureItem, I as FontPairing, J as Footer, K as FooterColumn, L as FooterLink, M as FooterProps, N as Gallery, O as GalleryImage, P as GalleryProps, Q as Hero, R as HeroCta, S as HeroProps, T as ListBlock, U as ListBlockProps, V as ListItem, W as LogoCloud, X as LogoCloudProps, Y as LogoItem, Z as MediaText, _ as MediaTextProps, $ as NavLink, a0 as Navbar, a1 as NavbarProps, a2 as PricingPlan, a3 as PricingTable, a4 as PricingTableProps, a5 as RichTextBlock, a6 as RichTextBlockProps, a7 as SectionHeading, a8 as Spacer, a9 as SpacerProps, aa as StepItem, ab as Steps, ac as StepsProps, ad as THEME_STYLE_ID, ae as TabItem, af as Tabs, ag as TabsProps, ah as TeamGrid, ai as TeamGridProps, aj as TeamMember, ak as Testimonial, al as TestimonialGrid, am as TestimonialGridProps, an as TestimonialItem, ao as TestimonialProps, aq as ThemeEditor, ar as ThemeEditorProps, as as ThemeEmitMode, at as ThemeFonts, au as ThemePreset, aw as ThemeStoreConfig, ay as VideoAspect, az as VideoEmbed, aA as VideoEmbedProps, aB as applyFontVars, aC as applyStoredTheme, aD as applyThemeVars, aE as clearFontVars, aF as clearThemeVars, aG as createThemeStore, aH as daysUntil, aI as fmtDate, aJ as fmtDateTime, aK as fontPackages, aL as formatPageRefs, aM as fromNow, aN as gbp, aO as getFontPairing, aP as hrs, aQ as initials, aR as matchFontPairing, aS as pct, aT as tid, aU as toEmbedUrl, aV as toHslTriplet } from './index-BzrF2JbQ.js';
3
3
  import * as react from 'react';
4
4
  import react__default, { ReactNode, ComponentType } from 'react';
5
5
  import * as _arbidocs_react from '@arbidocs/react';
6
- import { AiRunOptions, UserMenuItem, NotifyVariant, useArbi, AiTaskStatus } from '@arbidocs/react';
6
+ import { DocumentLike, AiRunOptions, UserMenuItem, NotifyVariant, useArbi, AiTaskStatus } from '@arbidocs/react';
7
7
  export { AiRunOptions, AiTaskStatus, ArtifactEvent, DocumentCard, DocumentCardProps, SearchChunk, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, redlineStats, textToArtifact, toRedlineMarkdown } from '@arbidocs/react';
8
+ import { components } from '@arbidocs/client';
8
9
  import { ColDef, GridOptions, GridApi, CellValueChangedEvent, GridState } from 'ag-grid-community';
9
10
  import { LucideIcon } from 'lucide-react';
10
11
  import { CustomField, Field, ComponentConfig, Data, Config } from '@measured/puck';
@@ -128,6 +129,45 @@ declare function createPromptLibrary(config: PromptConfig): {
128
129
  }];
129
130
  };
130
131
 
132
+ type CitationSources = components['schemas']['CitationSources'];
133
+ type Citations = CitationSources | null;
134
+ interface CitationEditorProps {
135
+ value: string;
136
+ citations: Citations | null;
137
+ onChange: (note: string, citations: Citations | null) => void;
138
+ /** Currently active citation key (controlled from parent) */
139
+ activeCitationKey?: string | null;
140
+ /**
141
+ * Open a document in the viewer, armed to collect passages for this field —
142
+ * and tag its first passage, so a chosen document is immediately a usable
143
+ * citation. Passages are picked by reading, so citing means opening.
144
+ *
145
+ * The caller owns this because resolving "first passage" needs the parsed
146
+ * document, and keeping that fetch out here is what lets this component stay
147
+ * store- and API-free (and therefore hoistable to @arbidocs/blocks).
148
+ */
149
+ onCiteDocument?: (docExtId: string) => void;
150
+ /** Cited documents, already resolved by the caller — keyed by external id. */
151
+ citedDocs?: Record<string, DocumentLike>;
152
+ /**
153
+ * The app's document picker, injected as a slot. It is store-coupled, so it
154
+ * is passed in rather than imported, and receives the chosen document id.
155
+ */
156
+ renderDocumentPicker?: (onSelect: (docExtId: string) => void, selectedIds: string[]) => React.ReactNode;
157
+ placeholder?: string;
158
+ readOnly?: boolean;
159
+ className?: string;
160
+ /** Start in edit mode with the caret in the field (composer behaviour). */
161
+ autoFocus?: boolean;
162
+ /** Applied to the text field itself, so callers can target it directly. */
163
+ 'data-testid'?: string;
164
+ /** Persisted textarea height in pixels */
165
+ defaultHeight?: number;
166
+ /** Called after user resizes the textarea */
167
+ onHeightChange?: (height: number) => void;
168
+ }
169
+ declare function CitationEditor({ value, citations, onChange, activeCitationKey, onCiteDocument, citedDocs, renderDocumentPicker, autoFocus, 'data-testid': dataTestId, placeholder, readOnly, className, defaultHeight, onHeightChange, }: CitationEditorProps): react.JSX.Element;
170
+
131
171
  /**
132
172
  * Shared shapes for the ARBI adapter — identical in demo and live mode so UI
133
173
  * never needs to know which backend is serving it — plus the per-firm config a
@@ -286,13 +326,11 @@ declare function useWorkspaceDocs(): {
286
326
  doctags: {
287
327
  note?: string | null | undefined;
288
328
  citations?: {
289
- [x: string]: {
290
- chunk_ids: string[];
291
- scores: number[];
292
- statement: string;
293
- offset_start: number;
294
- offset_end: number;
295
- };
329
+ passages: {
330
+ chunk_id: string;
331
+ doc_ext_id?: string | null | undefined;
332
+ page?: number | null | undefined;
333
+ }[];
296
334
  } | null | undefined;
297
335
  doc_ext_id: string;
298
336
  tag_ext_id: string;
@@ -1259,4 +1297,4 @@ interface AgentsPanelProps {
1259
1297
  }
1260
1298
  declare function AgentsPanel({ store, testIdPrefix }: AgentsPanelProps): react.JSX.Element;
1261
1299
 
1262
- export { ASSET_REF_PREFIX, type AgentSelectionStore, AgentsPanel, type AgentsPanelProps, type AiFields, type AiFieldsConfig, AppHeader, type AppHeaderProps, type AppHeaderUser, type AppNavItem, type AppNavSection, AppShell, type AppShellProps, type ArbiBlocksConfigOptions, type ArbiMode, type ArbiUser, type AssetMaterializer, type AssetRenderProps, type AssetRenderer, AssetResolverProvider, AssetThumb, type AssistantCitation, type AssistantMessage, type AssistantStep, type BlockKit, type BuildPrompt, type BuilderModule, type Column, ConnectionProvider, type ConnectionStatus, DataTable, DataTableBlock, type DataTableBlockColumn, type DataTableBlockProps, EmptyState, type ExportedModule, type FirmArbiConfig, GridView, type GridViewEmptyState, type GridViewProps, type GridViewSelection, type ImageFieldConfig, type ImageFieldFactory, LegalArbiProvider, LiveDataProvider, type LoadResult, type MaterializeOptions, type MatterContext, MetricCard, type MetricCardProps, ModuleManager, type ModuleManagerProps, type ModuleRegistry, type ModuleStoreBundle, PageHeader, PageRenderer, type PageRendererProps, type PersistVia, type PromptConfig, type PromptLibrary, type Prompts, type ResolvedModule, Section, type SectionProps, StatGroup, type StatGroupProps, type StatItem, StudioEditor, type StudioEditorProps, type StudioPageMeta, type StudioPersistence, type StudioPersistenceConfig, ThemeBundle, ThemeState, ThemeTokens, Toolbar, UploadDropzone, type UploadDropzoneProps, type UseImageGen, VerticalBuilder, type VerticalBuilderProps, type VerticalConfig, type VerticalExport, type VerticalExportConfig, WidgetPlaceholder, WorkspaceCard, type WorkspaceCardMember, type WorkspaceCardProps, asAssetRef, assetRefId, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createLiveWidgets, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createVerticalExport, createWebsiteBlocks, iconMap, isAssetRef, isAuthenticated, materializePageData, matterToContext, useAssetImage, useAssetRenderer, useAssetResolverActive, useConnection, useFirmAiTask, useImageGen, useLiveDataActive, useSemanticSearch, useWorkspaceDocs };
1300
+ export { ASSET_REF_PREFIX, type AgentSelectionStore, AgentsPanel, type AgentsPanelProps, type AiFields, type AiFieldsConfig, AppHeader, type AppHeaderProps, type AppHeaderUser, type AppNavItem, type AppNavSection, AppShell, type AppShellProps, type ArbiBlocksConfigOptions, type ArbiMode, type ArbiUser, type AssetMaterializer, type AssetRenderProps, type AssetRenderer, AssetResolverProvider, AssetThumb, type AssistantCitation, type AssistantMessage, type AssistantStep, type BlockKit, type BuildPrompt, type BuilderModule, CitationEditor, type CitationEditorProps, type Column, ConnectionProvider, type ConnectionStatus, DataTable, DataTableBlock, type DataTableBlockColumn, type DataTableBlockProps, EmptyState, type ExportedModule, type FirmArbiConfig, GridView, type GridViewEmptyState, type GridViewProps, type GridViewSelection, type ImageFieldConfig, type ImageFieldFactory, LegalArbiProvider, LiveDataProvider, type LoadResult, type MaterializeOptions, type MatterContext, MetricCard, type MetricCardProps, ModuleManager, type ModuleManagerProps, type ModuleRegistry, type ModuleStoreBundle, PageHeader, PageRenderer, type PageRendererProps, type PersistVia, type PromptConfig, type PromptLibrary, type Prompts, type ResolvedModule, Section, type SectionProps, StatGroup, type StatGroupProps, type StatItem, StudioEditor, type StudioEditorProps, type StudioPageMeta, type StudioPersistence, type StudioPersistenceConfig, ThemeBundle, ThemeState, ThemeTokens, Toolbar, UploadDropzone, type UploadDropzoneProps, type UseImageGen, VerticalBuilder, type VerticalBuilderProps, type VerticalConfig, type VerticalExport, type VerticalExportConfig, WidgetPlaceholder, WorkspaceCard, type WorkspaceCardMember, type WorkspaceCardProps, asAssetRef, assetRefId, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createLiveWidgets, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createVerticalExport, createWebsiteBlocks, iconMap, isAssetRef, isAuthenticated, materializePageData, matterToContext, useAssetImage, useAssetRenderer, useAssetResolverActive, useConnection, useFirmAiTask, useImageGen, useLiveDataActive, useSemanticSearch, useWorkspaceDocs };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { tid, initials, fromNow, fmtDate, assetRefId, applyStoredTheme, AssetResolverProvider, ThemeEditor, applyThemeVars, SectionHeading, PricingTable, Tabs as Tabs$1, Accordion, Gallery, VideoEmbed, ContactForm, Banner, MediaText, TeamGrid, Steps, TestimonialGrid, Columns, Spacer, Container, Hero, FeatureGrid, Testimonial, CTABanner, LogoCloud, FAQ, RichTextBlock, Callout, BlockImage, AvatarBlock, Navbar, Footer, ListBlock, isAssetRef, asAssetRef } from './chunk-L6GG4KN2.js';
2
- export { ASSET_REF_PREFIX, Accordion, AssetResolverProvider, AvatarBlock, Banner, BlockImage, BlockLink, CTABanner, Callout, Columns, ContactForm, Container, FAQ, FONT_PAIRINGS, FeatureGrid, Footer, Gallery, Hero, ListBlock, LogoCloud, MediaText, Navbar, PricingTable, RichTextBlock, SectionHeading, Spacer, Steps, THEME_STYLE_ID, Tabs, TeamGrid, Testimonial, TestimonialGrid, ThemeEditor, VideoEmbed, applyFontVars, applyStoredTheme, applyThemeVars, asAssetRef, assetRefId, clearFontVars, clearThemeVars, createThemeStore, daysUntil, fmtDate, fmtDateTime, fontPackages, fromNow, gbp, getFontPairing, hrs, initials, isAssetRef, matchFontPairing, pct, tid, toEmbedUrl, toHslTriplet, useAssetRenderer, useAssetResolverActive } from './chunk-L6GG4KN2.js';
3
- import { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect } from 'react';
4
- import { useArbi, ArbiProvider, useAiTask, useWorkspaceDocs as useWorkspaceDocs$1, useSemanticSearch as useSemanticSearch$1, cn, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Input, Card, CardHeader, CardTitle, CardDescription, CardContent, Tooltip, TooltipTrigger, TooltipContent, CardFooter, Avatar, AvatarImage, AvatarFallback, TooltipProvider, Button, NotificationBell, UserMenu, useThumbnails, Badge, Switch, useConfigs, useAgents, Checkbox, Tabs, TabsList, TabsTrigger, TabsContent, Separator, ArbiWebSocketProvider, useDocuments, ImageCropModal, DEFAULT_ASPECT_OPTIONS, useConversations } from '@arbidocs/react';
1
+ import { formatPageRefs, tid, initials, fromNow, fmtDate, assetRefId, applyStoredTheme, AssetResolverProvider, ThemeEditor, applyThemeVars, SectionHeading, PricingTable, Tabs as Tabs$1, Accordion, Gallery, VideoEmbed, ContactForm, Banner, MediaText, TeamGrid, Steps, TestimonialGrid, Columns, Spacer, Container, Hero, FeatureGrid, Testimonial, CTABanner, LogoCloud, FAQ, RichTextBlock, Callout, BlockImage, AvatarBlock, Navbar, Footer, ListBlock, isAssetRef, asAssetRef } from './chunk-ETIYX2MO.js';
2
+ export { ASSET_REF_PREFIX, Accordion, AssetResolverProvider, AvatarBlock, Banner, BlockImage, BlockLink, CTABanner, Callout, Columns, ContactForm, Container, FAQ, FONT_PAIRINGS, FeatureGrid, Footer, Gallery, Hero, ListBlock, LogoCloud, MediaText, Navbar, PricingTable, RichTextBlock, SectionHeading, Spacer, Steps, THEME_STYLE_ID, Tabs, TeamGrid, Testimonial, TestimonialGrid, ThemeEditor, VideoEmbed, applyFontVars, applyStoredTheme, applyThemeVars, asAssetRef, assetRefId, clearFontVars, clearThemeVars, createThemeStore, daysUntil, fmtDate, fmtDateTime, fontPackages, formatPageRefs, fromNow, gbp, getFontPairing, hrs, initials, isAssetRef, matchFontPairing, pct, tid, toEmbedUrl, toHslTriplet, useAssetRenderer, useAssetResolverActive } from './chunk-ETIYX2MO.js';
3
+ import { createContext, useState, useRef, useEffect, useMemo, useCallback, useContext } from 'react';
4
+ import { MessageSquare, Cpu, Code, Cloud, Layers, Target, Award, MapPin, Phone, Mail, Lock, Globe, Heart, Star, Rocket, Shield, Zap, Sparkles, Gavel, Scale, Bell, Activity, BarChart3, DollarSign, TrendingUp, Info, AlertCircle, CheckCircle, Clock, Calendar, Briefcase, Users, Folder, FileText, X, Loader2, UploadCloud, Search, ArrowUpRight, ArrowDownRight, FolderLock, CheckCircle2, ArrowLeftRight, MessagesSquare, Menu, ArrowLeft, Palette, RotateCcw, ChevronUp, ChevronDown, BrainCircuit, Bot, LayoutGrid, FileJson, Download, Crop, ImagePlus, Upload, Link2, Check } from 'lucide-react';
5
+ import { cn, DocumentEntity, useArbi, ArbiProvider, useAiTask, useWorkspaceDocs as useWorkspaceDocs$1, useSemanticSearch as useSemanticSearch$1, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Input, Card, CardHeader, CardTitle, CardDescription, CardContent, Tooltip, TooltipTrigger, TooltipContent, CardFooter, Avatar, AvatarImage, AvatarFallback, TooltipProvider, Button, NotificationBell, UserMenu, useThumbnails, Badge, Switch, useConfigs, useAgents, Checkbox, Tabs, TabsList, TabsTrigger, TabsContent, Separator, ArbiWebSocketProvider, useDocuments, ImageCropModal, DEFAULT_ASPECT_OPTIONS, useConversations } from '@arbidocs/react';
5
6
  export { DocumentCard, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, redlineStats, textToArtifact, toRedlineMarkdown } from '@arbidocs/react';
6
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
8
  import { QueryClient, QueryClientProvider, useQuery, useQueryClient } from '@tanstack/react-query';
8
9
  import { AgGridReact } from 'ag-grid-react';
9
10
  import { themeQuartz, AllCommunityModule } from 'ag-grid-community';
10
- import { MessageSquare, Cpu, Code, Cloud, Layers, Target, Award, MapPin, Phone, Mail, Lock, Globe, Heart, Star, Rocket, Shield, Zap, Sparkles, Gavel, Scale, Bell, Activity, BarChart3, DollarSign, TrendingUp, Info, AlertCircle, CheckCircle, Clock, Calendar, Briefcase, Users, Folder, FileText, Loader2, UploadCloud, Search, ArrowUpRight, ArrowDownRight, FolderLock, CheckCircle2, ArrowLeftRight, MessagesSquare, X, Menu, ArrowLeft, Palette, RotateCcw, ChevronUp, ChevronDown, BrainCircuit, Bot, LayoutGrid, FileJson, Download, Crop, ImagePlus, Upload, Link2, Check } from 'lucide-react';
11
11
  import { useLocation, Link, useParams, NavLink } from 'react-router-dom';
12
12
  import { Puck, Render } from '@measured/puck';
13
13
  import { create } from 'zustand';
@@ -194,6 +194,170 @@ Lead with why the firm is the right choice, reference relevant experience at a t
194
194
  ];
195
195
  return { prompts, WORKFLOW_ACTIONS };
196
196
  }
197
+ function CitationEditor({
198
+ value,
199
+ citations,
200
+ onChange,
201
+ activeCitationKey,
202
+ onCiteDocument,
203
+ citedDocs,
204
+ renderDocumentPicker,
205
+ autoFocus = false,
206
+ "data-testid": dataTestId,
207
+ placeholder = "Add a note...",
208
+ readOnly = false,
209
+ className,
210
+ defaultHeight,
211
+ onHeightChange
212
+ }) {
213
+ const [localValue, setLocalValue] = useState(value);
214
+ const [isEditing, setIsEditing] = useState(autoFocus);
215
+ const textareaRef = useRef(null);
216
+ const debounceRef = useRef(null);
217
+ useEffect(() => {
218
+ if (!isEditing) {
219
+ setLocalValue(value);
220
+ }
221
+ }, [value, isEditing]);
222
+ const passages = useMemo(() => citations?.passages ?? [], [citations]);
223
+ const hasCitations = passages.length > 0;
224
+ const byDoc = useMemo(() => {
225
+ const groups = /* @__PURE__ */ new Map();
226
+ for (const passage of passages) {
227
+ if (!passage.doc_ext_id) continue;
228
+ const group = groups.get(passage.doc_ext_id) ?? { pages: [], count: 0 };
229
+ group.count += 1;
230
+ if (passage.page != null && !group.pages.includes(passage.page))
231
+ group.pages.push(passage.page);
232
+ groups.set(passage.doc_ext_id, group);
233
+ }
234
+ return groups;
235
+ }, [passages]);
236
+ const docIds = Array.from(byDoc.keys());
237
+ const handleRemoveDocument = useCallback(
238
+ (docExtId) => {
239
+ const remaining = passages.filter((p) => p.doc_ext_id !== docExtId);
240
+ onChange(localValue, remaining.length ? { passages: remaining } : null);
241
+ },
242
+ [passages, localValue, onChange]
243
+ );
244
+ const handleToggleDocument = useCallback(
245
+ (docExtId) => {
246
+ if (!docExtId) return;
247
+ if (docIds.includes(docExtId)) {
248
+ handleRemoveDocument(docExtId);
249
+ return;
250
+ }
251
+ onCiteDocument?.(docExtId);
252
+ },
253
+ [docIds, onCiteDocument, handleRemoveDocument]
254
+ );
255
+ const renderedContent = useMemo(
256
+ () => localValue ? /* @__PURE__ */ jsx("span", { children: localValue }) : null,
257
+ [localValue]
258
+ );
259
+ const handleChange = useCallback(
260
+ (newValue) => {
261
+ setLocalValue(newValue);
262
+ if (debounceRef.current) clearTimeout(debounceRef.current);
263
+ debounceRef.current = setTimeout(() => onChange(newValue, citations ?? null), 400);
264
+ },
265
+ [citations, onChange]
266
+ );
267
+ const flushPendingChange = useCallback(() => {
268
+ if (!debounceRef.current) return;
269
+ clearTimeout(debounceRef.current);
270
+ debounceRef.current = null;
271
+ onChange(localValue, citations ?? null);
272
+ }, [localValue, citations, onChange]);
273
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", className), children: [
274
+ /* @__PURE__ */ jsx("div", { className: "relative", children: isEditing ? /* @__PURE__ */ jsx(
275
+ "textarea",
276
+ {
277
+ ref: textareaRef,
278
+ value: localValue,
279
+ onChange: (e) => handleChange(e.target.value),
280
+ onBlur: () => {
281
+ flushPendingChange();
282
+ setIsEditing(false);
283
+ },
284
+ onMouseUp: () => {
285
+ if (textareaRef.current && onHeightChange) {
286
+ onHeightChange(textareaRef.current.offsetHeight);
287
+ }
288
+ },
289
+ placeholder,
290
+ readOnly,
291
+ rows: 2,
292
+ "data-testid": dataTestId,
293
+ autoFocus: true,
294
+ style: defaultHeight ? { height: defaultHeight } : void 0,
295
+ className: "w-full text-sm p-2 pr-14 border border-border rounded-md resize-y bg-background focus:outline-none focus:ring-2 focus:ring-ring"
296
+ }
297
+ ) : /* @__PURE__ */ jsx(
298
+ "div",
299
+ {
300
+ onClick: () => !readOnly && setIsEditing(true),
301
+ style: defaultHeight ? { minHeight: defaultHeight } : void 0,
302
+ "data-testid": dataTestId,
303
+ className: cn(
304
+ "w-full text-sm p-2 pr-14 border border-border rounded-md min-h-[4rem] whitespace-pre-wrap bg-background",
305
+ !readOnly && "cursor-text hover:border-ring",
306
+ !localValue && "text-muted-foreground"
307
+ ),
308
+ children: renderedContent || placeholder
309
+ }
310
+ ) }),
311
+ (hasCitations || !readOnly) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
312
+ docIds.map((docId) => {
313
+ const doc = citedDocs?.[docId];
314
+ const group = byDoc.get(docId);
315
+ const pages = (group?.pages ?? []).slice().sort((a, b) => a - b);
316
+ return /* @__PURE__ */ jsxs(
317
+ "div",
318
+ {
319
+ className: "flex items-center gap-1.5 text-sm",
320
+ "data-testid": `citation-doc-${docId}`,
321
+ children: [
322
+ doc ? /* @__PURE__ */ jsx(
323
+ "button",
324
+ {
325
+ type: "button",
326
+ onClick: () => !readOnly && onCiteDocument?.(docId),
327
+ className: "flex-1 min-w-0 text-left",
328
+ title: "Open to tag more passages",
329
+ children: /* @__PURE__ */ jsx(DocumentEntity, { doc, fullWidth: true, labelMaxWidth: "max-w-full" })
330
+ }
331
+ ) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: docId }),
332
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground shrink-0", children: formatPageRefs(pages) }),
333
+ !readOnly && /* @__PURE__ */ jsx(
334
+ "button",
335
+ {
336
+ type: "button",
337
+ onClick: () => handleRemoveDocument(docId),
338
+ "aria-label": "Remove this document",
339
+ className: "p-0.5 hover:bg-destructive/20 hover:text-destructive rounded shrink-0",
340
+ children: /* @__PURE__ */ jsx(X, { size: 12 })
341
+ }
342
+ )
343
+ ]
344
+ },
345
+ docId
346
+ );
347
+ }),
348
+ passages.some((p) => !p.doc_ext_id) && /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
349
+ passages.filter((p) => !p.doc_ext_id).length,
350
+ " passage(s) without a recorded document"
351
+ ] }),
352
+ !readOnly && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", "data-testid": "citation-document-picker", children: renderDocumentPicker?.(handleToggleDocument, docIds) }) })
353
+ ] }),
354
+ activeCitationKey && /* @__PURE__ */ jsxs("p", { className: "text-sm text-blue-text", children: [
355
+ "Click a passage in the document to add it \u2014 ",
356
+ /* @__PURE__ */ jsx("strong", { children: "shift-click" }),
357
+ " to take a whole range. Add as many as you like, from as many documents as you like."
358
+ ] })
359
+ ] });
360
+ }
197
361
  var ConnectionContext = createContext(null);
198
362
  var WORKSPACE_STORAGE_PREFIX = "arbi:selectedWorkspace";
199
363
  var workspaceStorageKey = (apiUrl) => `${WORKSPACE_STORAGE_PREFIX}:${apiUrl || "demo"}`;
@@ -4636,6 +4800,6 @@ function VerticalBuilder({
4636
4800
  ] });
4637
4801
  }
4638
4802
 
4639
- export { AgentsPanel, AppHeader, AppShell, AssetThumb, ConnectionProvider, DataTable, DataTableBlock, EmptyState, GridView, LegalArbiProvider, LiveDataProvider, MetricCard, ModuleManager, PageHeader, PageRenderer, Section, StatGroup, StudioEditor, Toolbar, UploadDropzone, VerticalBuilder, WidgetPlaceholder, WorkspaceCard, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createLiveWidgets, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createVerticalExport, createWebsiteBlocks, iconMap, isAuthenticated, materializePageData, matterToContext, useAssetImage, useConnection, useFirmAiTask, useImageGen, useLiveDataActive, useSemanticSearch, useWorkspaceDocs };
4803
+ export { AgentsPanel, AppHeader, AppShell, AssetThumb, CitationEditor, ConnectionProvider, DataTable, DataTableBlock, EmptyState, GridView, LegalArbiProvider, LiveDataProvider, MetricCard, ModuleManager, PageHeader, PageRenderer, Section, StatGroup, StudioEditor, Toolbar, UploadDropzone, VerticalBuilder, WidgetPlaceholder, WorkspaceCard, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createLiveWidgets, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createVerticalExport, createWebsiteBlocks, iconMap, isAuthenticated, materializePageData, matterToContext, useAssetImage, useConnection, useFirmAiTask, useImageGen, useLiveDataActive, useSemanticSearch, useWorkspaceDocs };
4640
4804
  //# sourceMappingURL=index.js.map
4641
4805
  //# sourceMappingURL=index.js.map