@arbidocs/blocks 0.3.114 → 0.3.116

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
@@ -6,7 +6,7 @@ import { AiRunOptions, useArbi, AiTaskStatus } from '@arbidocs/react';
6
6
  export { AiRunOptions, AiTaskStatus, ArtifactEvent, SearchChunk, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, redlineStats, textToArtifact, toRedlineMarkdown } from '@arbidocs/react';
7
7
  import { ColDef, GridOptions, GridApi, CellValueChangedEvent, GridState } from 'ag-grid-community';
8
8
  import { LucideIcon } from 'lucide-react';
9
- import { Data, Config, CustomField, Field, ComponentConfig } from '@measured/puck';
9
+ import { CustomField, Field, ComponentConfig, Data, Config } from '@measured/puck';
10
10
 
11
11
  /**
12
12
  * The reusable AI-native law-firm prompt library.
@@ -1082,6 +1082,31 @@ interface AppNavSection {
1082
1082
  items: AppNavItem[];
1083
1083
  }
1084
1084
 
1085
+ interface AppShellProps {
1086
+ /** Nav sections to render (already filtered/ordered by the app). */
1087
+ sections: AppNavSection[];
1088
+ /** Footer nav items pinned to the bottom of the sidebar (e.g. Settings). */
1089
+ footerItems?: AppNavItem[];
1090
+ /** Brand mark shown in the sidebar header. */
1091
+ logo?: ReactNode;
1092
+ /** Where the logo links to (omit to render the logo without a link). */
1093
+ logoHref?: string;
1094
+ logoLabel?: string;
1095
+ /** Extra content below the footer nav (e.g. a connection-status pill). */
1096
+ sidebarFooter?: ReactNode;
1097
+ /** Topbar content, rendered to the right of the mobile hamburger. */
1098
+ topbar?: ReactNode;
1099
+ /** Optional docked panel on the far right (e.g. an AI chat rail). */
1100
+ rightRail?: ReactNode;
1101
+ /** Main scroll region content (typically a router `<Outlet/>` wrapper). */
1102
+ children: ReactNode;
1103
+ /** Extra classes for the `<main>` scroll region (e.g. a slim-scrollbar util). */
1104
+ mainClassName?: string;
1105
+ /** Testid namespace for the shell/topbar/sidebar. Default "app". */
1106
+ testIdPrefix?: string;
1107
+ }
1108
+ declare function AppShell({ sections, footerItems, logo, logoHref, logoLabel, sidebarFooter, topbar, rightRail, children, mainClassName, testIdPrefix, }: AppShellProps): react.JSX.Element;
1109
+
1085
1110
  /**
1086
1111
  * Shared studio types — the persistence contract, page metadata and the AI
1087
1112
  * prompt-builder signature the firm supplies. Firm-agnostic: a firm app wires
@@ -1113,6 +1138,12 @@ interface StudioPersistence {
1113
1138
  */
1114
1139
  savePublished: (arbi: Arbi | null, live: boolean, slug: string, data: unknown) => Promise<PersistVia>;
1115
1140
  loadPublished: <T>(arbi: Arbi | null, live: boolean, slug: string) => Promise<LoadResult<T>>;
1141
+ /**
1142
+ * Delete a slug's stored authoring + published pages (backend and localStorage
1143
+ * mirror). Lets a page be reset to empty; also the deterministic-reset hook a
1144
+ * test/demo needs, since backend content otherwise wins over a fresh seed.
1145
+ */
1146
+ deletePage: (arbi: Arbi | null, live: boolean, slug: string) => Promise<void>;
1116
1147
  saveTheme: (arbi: Arbi | null, live: boolean, theme: unknown) => Promise<PersistVia>;
1117
1148
  loadTheme: <T>(arbi: Arbi | null, live: boolean) => Promise<LoadResult<T>>;
1118
1149
  }
@@ -1123,6 +1154,95 @@ type BuildPrompt = (a: {
1123
1154
  current: string;
1124
1155
  }) => string;
1125
1156
 
1157
+ interface AiFieldsConfig {
1158
+ /** The marketing workspace the AI grounds on. */
1159
+ workspaceId: string;
1160
+ /** Turns a field's kind/label/current text into an instruction. */
1161
+ buildPrompt: BuildPrompt;
1162
+ /** Default prompt kind when a field does not specify one. */
1163
+ defaultKind?: string;
1164
+ /** Testid namespace for the field + write button. */
1165
+ testIdPrefix?: string;
1166
+ }
1167
+ interface AiFields {
1168
+ aiText: (label: string, placeholder?: string) => CustomField<string>;
1169
+ aiTextarea: (label: string, placeholder?: string, kind?: string) => CustomField<string>;
1170
+ }
1171
+ declare function createAiFields(cfg: AiFieldsConfig): AiFields;
1172
+
1173
+ /**
1174
+ * Shared field helpers for the block registry. Every block config — the built-ins
1175
+ * in {@link createArbiBlocksConfig} and the website blocks in
1176
+ * {@link file://./websiteBlocks.tsx} — builds its Puck fields from this one kit so
1177
+ * the AI-or-plain copy fallback, the icon `select`, the tone/bool radios and the
1178
+ * stable render-time testid are declared once.
1179
+ */
1180
+
1181
+ declare const iconMap: Record<string, LucideIcon>;
1182
+ /** The bundle of field helpers a block config needs. */
1183
+ interface BlockKit {
1184
+ /** Single-line copy: AI-authorable when a firm supplies aiFields, else plain text. */
1185
+ textField: (label: string, placeholder?: string) => Field;
1186
+ /** Multi-line copy: AI-authorable when a firm supplies aiFields, else plain textarea. */
1187
+ textareaField: (label: string, placeholder?: string, kind?: string) => Field;
1188
+ /** Image source: a workspace-asset picker when a firm supplies imageField, else a URL input. */
1189
+ imageField: (label: string) => Field;
1190
+ /** A Yes/No radio. */
1191
+ boolRadio: (label: string) => Field;
1192
+ /** A `select` over {@link iconMap} names. */
1193
+ iconField: (label?: string) => Field;
1194
+ /** Resolve an icon name to its Lucide component. */
1195
+ resolveIcon: (name?: string) => LucideIcon | undefined;
1196
+ /** Stable, e2e-locatable testid derived from a block's Puck id. */
1197
+ blockTestId: (id: string) => string;
1198
+ /**
1199
+ * Optional firm override for the eyebrow style on heading-bearing blocks
1200
+ * (Hero, Section heading). Lets a consumer render a brand accent (e.g. a brass
1201
+ * eyebrow) without forking the blocks. Undefined → the default token classes.
1202
+ */
1203
+ eyebrowClassName?: string;
1204
+ }
1205
+ /** Build the shared field helpers, closing over the firm's optional AI + image fields. */
1206
+ declare function createBlockKit(ai?: AiFields, image?: (label: string) => Field, eyebrowClassName?: string): BlockKit;
1207
+
1208
+ /**
1209
+ * Live-widget block factory for @arbidocs/blocks.
1210
+ *
1211
+ * Mirrors the other `create*Blocks` factories: it only WIRES pre-built block
1212
+ * components (from {@link ./liveWidgetRuntime}) into Puck `ComponentConfig`s, so
1213
+ * it exports a single function and defines no components of its own — keeping it
1214
+ * fast-refresh clean. The blocks gate on the live-data flag ({@link ./liveData}),
1215
+ * rendering real ARBI data inside an authenticated app tree and a placeholder in
1216
+ * the editor/public. They read the SHARED `@arbidocs/react` hooks, so any client
1217
+ * with an ARBI workspace gets them; a client supplies only *composition* via
1218
+ * `createArbiBlocksConfig({ liveWidgets: true })`.
1219
+ */
1220
+
1221
+ /**
1222
+ * Build the live-widget block set, closing over the shared {@link BlockKit} for
1223
+ * stable testids. Registered under a "Widgets" category when a consumer opts in
1224
+ * with `createArbiBlocksConfig({ liveWidgets: true })`.
1225
+ */
1226
+ declare function createLiveWidgets(kit: BlockKit): Record<string, ComponentConfig>;
1227
+
1228
+ /** Marks the subtree as an authenticated app tree, so live widgets resolve data. */
1229
+ declare function LiveDataProvider({ children }: {
1230
+ children: ReactNode;
1231
+ }): react.JSX.Element;
1232
+ /**
1233
+ * What a live widget shows when it can't (or shouldn't) resolve data: a labelled,
1234
+ * dashed card. Used in the Studio canvas and the public renderer so authoring a
1235
+ * dashboard is WYSIWYG-ish without leaking live back-office data.
1236
+ */
1237
+ declare function WidgetPlaceholder({ label, icon: Icon, testId, }: {
1238
+ label: string;
1239
+ icon?: LucideIcon;
1240
+ testId?: string;
1241
+ }): react.JSX.Element;
1242
+
1243
+ /** Whether live widgets may resolve backend data here (false in editor/public). */
1244
+ declare function useLiveDataActive(): boolean;
1245
+
1126
1246
  /**
1127
1247
  * Publish-time asset materialization.
1128
1248
  *
@@ -1174,6 +1294,13 @@ interface StudioEditorProps {
1174
1294
  live: boolean;
1175
1295
  initialSlug?: string;
1176
1296
  testIdPrefix?: string;
1297
+ /**
1298
+ * Install a DEV-only `window.__studioResetSlug(slug)` hook that clears a slug's
1299
+ * stored page so a fresh seed governs the canvas. For tests/demos only — it can
1300
+ * delete pages, so keep it off in production (pass `import.meta.env.DEV`). The
1301
+ * package stays env-agnostic; the consumer owns the flag.
1302
+ */
1303
+ resetSeam?: boolean;
1177
1304
  /**
1178
1305
  * Optional sink for published image bytes. When omitted, publishing inlines
1179
1306
  * each asset as a `data:` URI (self-contained, no backend). Provide this to
@@ -1181,7 +1308,7 @@ interface StudioEditorProps {
1181
1308
  */
1182
1309
  publishAsset?: MaterializeOptions['publishAsset'];
1183
1310
  }
1184
- declare function StudioEditor({ config, pages, persistence, themeBundle, defaultTheme, brandLabel, backHref, backLabel, live, initialSlug, testIdPrefix, publishAsset, }: StudioEditorProps): react.JSX.Element;
1311
+ declare function StudioEditor({ config, pages, persistence, themeBundle, defaultTheme, brandLabel, backHref, backLabel, live, initialSlug, testIdPrefix, publishAsset, resetSeam, }: StudioEditorProps): react.JSX.Element;
1185
1312
 
1186
1313
  interface PageRendererProps {
1187
1314
  config: Config;
@@ -1194,8 +1321,27 @@ interface PageRendererProps {
1194
1321
  body: string;
1195
1322
  };
1196
1323
  testIdPrefix?: string;
1324
+ /**
1325
+ * Render inside a {@link LiveDataProvider}, so live-widget blocks resolve real
1326
+ * ARBI data. Only pass this when mounting the renderer INSIDE the authenticated
1327
+ * app tree (providers + a selected workspace present); on the public site leave
1328
+ * it off and widgets render placeholders.
1329
+ */
1330
+ liveData?: boolean;
1331
+ /**
1332
+ * Render this page verbatim instead of loading a slug from persistence — for an
1333
+ * in-code page (e.g. a config-authored in-app board) that isn't a published
1334
+ * studio document. The slug is ignored.
1335
+ */
1336
+ initialData?: Data;
1337
+ /**
1338
+ * Apply the persisted studio theme to the document (default true). Turn OFF for
1339
+ * an in-app renderer so it keeps the ambient app theme instead of repainting the
1340
+ * whole document with the marketing palette.
1341
+ */
1342
+ applyTheme?: boolean;
1197
1343
  }
1198
- declare function PageRenderer({ config, persistence, defaultTheme, live, slug: slugProp, emptyState, testIdPrefix, }: PageRendererProps): react.JSX.Element;
1344
+ declare function PageRenderer({ config, persistence, defaultTheme, live, slug: slugProp, emptyState, testIdPrefix, liveData, initialData, applyTheme, }: PageRendererProps): react.JSX.Element;
1199
1345
 
1200
1346
  interface StudioPersistenceConfig {
1201
1347
  /** The public marketing workspace that backs the site builder. */
@@ -1215,22 +1361,6 @@ interface StudioPersistenceConfig {
1215
1361
  }
1216
1362
  declare function createStudioPersistence(cfg: StudioPersistenceConfig): StudioPersistence;
1217
1363
 
1218
- interface AiFieldsConfig {
1219
- /** The marketing workspace the AI grounds on. */
1220
- workspaceId: string;
1221
- /** Turns a field's kind/label/current text into an instruction. */
1222
- buildPrompt: BuildPrompt;
1223
- /** Default prompt kind when a field does not specify one. */
1224
- defaultKind?: string;
1225
- /** Testid namespace for the field + write button. */
1226
- testIdPrefix?: string;
1227
- }
1228
- interface AiFields {
1229
- aiText: (label: string, placeholder?: string) => CustomField<string>;
1230
- aiTextarea: (label: string, placeholder?: string, kind?: string) => CustomField<string>;
1231
- }
1232
- declare function createAiFields(cfg: AiFieldsConfig): AiFields;
1233
-
1234
1364
  interface ImageFieldConfig {
1235
1365
  /** The workspace uploads/generations are saved to, and assets are picked from. */
1236
1366
  workspaceId: string;
@@ -1294,41 +1424,6 @@ interface SectionProps {
1294
1424
  }
1295
1425
  declare function Section({ children, tone, padding, maxWidth, texture, className, }: SectionProps): react.JSX.Element;
1296
1426
 
1297
- /**
1298
- * Shared field helpers for the block registry. Every block config — the built-ins
1299
- * in {@link createArbiBlocksConfig} and the website blocks in
1300
- * {@link file://./websiteBlocks.tsx} — builds its Puck fields from this one kit so
1301
- * the AI-or-plain copy fallback, the icon `select`, the tone/bool radios and the
1302
- * stable render-time testid are declared once.
1303
- */
1304
-
1305
- declare const iconMap: Record<string, LucideIcon>;
1306
- /** The bundle of field helpers a block config needs. */
1307
- interface BlockKit {
1308
- /** Single-line copy: AI-authorable when a firm supplies aiFields, else plain text. */
1309
- textField: (label: string, placeholder?: string) => Field;
1310
- /** Multi-line copy: AI-authorable when a firm supplies aiFields, else plain textarea. */
1311
- textareaField: (label: string, placeholder?: string, kind?: string) => Field;
1312
- /** Image source: a workspace-asset picker when a firm supplies imageField, else a URL input. */
1313
- imageField: (label: string) => Field;
1314
- /** A Yes/No radio. */
1315
- boolRadio: (label: string) => Field;
1316
- /** A `select` over {@link iconMap} names. */
1317
- iconField: (label?: string) => Field;
1318
- /** Resolve an icon name to its Lucide component. */
1319
- resolveIcon: (name?: string) => LucideIcon | undefined;
1320
- /** Stable, e2e-locatable testid derived from a block's Puck id. */
1321
- blockTestId: (id: string) => string;
1322
- /**
1323
- * Optional firm override for the eyebrow style on heading-bearing blocks
1324
- * (Hero, Section heading). Lets a consumer render a brand accent (e.g. a brass
1325
- * eyebrow) without forking the blocks. Undefined → the default token classes.
1326
- */
1327
- eyebrowClassName?: string;
1328
- }
1329
- /** Build the shared field helpers, closing over the firm's optional AI + image fields. */
1330
- declare function createBlockKit(ai?: AiFields, image?: (label: string) => Field, eyebrowClassName?: string): BlockKit;
1331
-
1332
1427
  interface ArbiBlocksConfigOptions {
1333
1428
  /**
1334
1429
  * Firm AI fields from {@link createAiFields}. When present, every string copy
@@ -1357,6 +1452,14 @@ interface ArbiBlocksConfigOptions {
1357
1452
  * heading) — e.g. a brand accent like a brass eyebrow. Undefined → token default.
1358
1453
  */
1359
1454
  eyebrowClassName?: string;
1455
+ /**
1456
+ * Register the live-widget blocks (a "Widgets" category) that read shared ARBI
1457
+ * hooks — Agent activity, Live metric. They render placeholders in the editor
1458
+ * and on the public site, resolving real data only inside an authenticated
1459
+ * in-app renderer (`PageRenderer liveData`). Opt-in so a pure marketing builder
1460
+ * doesn't surface back-office widgets.
1461
+ */
1462
+ liveWidgets?: boolean;
1360
1463
  }
1361
1464
 
1362
1465
  declare function createArbiBlocksConfig(opts?: ArbiBlocksConfigOptions): Config;
@@ -1550,4 +1653,4 @@ interface AgentsPanelProps {
1550
1653
  }
1551
1654
  declare function AgentsPanel({ store, testIdPrefix }: AgentsPanelProps): react.JSX.Element;
1552
1655
 
1553
- export { ASSET_REF_PREFIX, Accordion, type AccordionItem, type AccordionProps, type AgentSelectionStore, AgentsPanel, type AgentsPanelProps, type AiFields, type AiFieldsConfig, type AppNavItem, type AppNavSection, type ApplyThemeOptions, type ArbiBlocksConfigOptions, type ArbiMode, type ArbiUser, type AssetMaterializer, AssetResolverProvider, type AssistantCitation, type AssistantMessage, type AssistantStep, AvatarBlock, type AvatarBlockProps, Banner, type BannerProps, type BannerTone, BlockImage, type BlockImageProps, type BlockKit, type BuildPrompt, type BuilderModule, CTABanner, type CTABannerProps, Callout, type CalloutProps, type CalloutVariant, type ColorToken, type Column, Columns, type ColumnsProps, ConnectionProvider, type ConnectionStatus, type ContactField, ContactForm, type ContactFormProps, Container, type ContainerProps, DataTable, DataTableBlock, type DataTableBlockColumn, type DataTableBlockProps, EmptyState, type ExportedModule, FAQ, type FAQProps, type FaqItem, FeatureGrid, type FeatureGridProps, type FeatureItem, type FirmArbiConfig, Footer, type FooterColumn, type FooterLink, type FooterProps, Gallery, type GalleryImage, type GalleryProps, GridView, type GridViewEmptyState, type GridViewProps, type GridViewSelection, Hero, type HeroCta, type HeroProps, type ImageFieldConfig, type ImageFieldFactory, LegalArbiProvider, ListBlock, type ListBlockProps, type ListItem, type LoadResult, LogoCloud, type LogoCloudProps, type LogoItem, type MaterializeOptions, type MatterContext, MediaText, type MediaTextProps, MetricCard, type MetricCardProps, ModuleManager, type ModuleManagerProps, type ModuleRegistry, type ModuleStoreBundle, type NavLink, Navbar, type NavbarProps, PageHeader, PageRenderer, type PageRendererProps, type PersistVia, type PricingPlan, PricingTable, type PricingTableProps, type PromptConfig, type PromptLibrary, type Prompts, type ResolvedModule, RichTextBlock, type RichTextBlockProps, Section, SectionHeading, type SectionProps, Spacer, type SpacerProps, StatGroup, type StatGroupProps, type StatItem, type StepItem, Steps, type StepsProps, StudioEditor, type StudioEditorProps, type StudioPageMeta, type StudioPersistence, type StudioPersistenceConfig, THEME_STYLE_ID, type TabItem, Tabs, type TabsProps, TeamGrid, type TeamGridProps, type TeamMember, Testimonial, TestimonialGrid, type TestimonialGridProps, type TestimonialItem, type TestimonialProps, type ThemeBundle, ThemeEditor, type ThemeEditorProps, type ThemeEmitMode, type ThemeFonts, type ThemePreset, type ThemeState, type ThemeStoreConfig, type ThemeTokens, Toolbar, type UseImageGen, VerticalBuilder, type VerticalBuilderProps, type VerticalConfig, type VerticalExport, type VerticalExportConfig, type VideoAspect, VideoEmbed, type VideoEmbedProps, applyStoredTheme, applyThemeVars, asAssetRef, assetRefId, clearThemeVars, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createThemeStore, createVerticalExport, createWebsiteBlocks, daysUntil, fmtDate, fmtDateTime, fromNow, gbp, hrs, iconMap, initials, isAssetRef, isAuthenticated, materializePageData, matterToContext, pct, tid, toEmbedUrl, toHslTriplet, useAssetResolverActive, useConnection, useFirmAiTask, useImageGen, useSemanticSearch, useWorkspaceDocs };
1656
+ export { ASSET_REF_PREFIX, Accordion, type AccordionItem, type AccordionProps, type AgentSelectionStore, AgentsPanel, type AgentsPanelProps, type AiFields, type AiFieldsConfig, type AppNavItem, type AppNavSection, AppShell, type AppShellProps, type ApplyThemeOptions, type ArbiBlocksConfigOptions, type ArbiMode, type ArbiUser, type AssetMaterializer, AssetResolverProvider, type AssistantCitation, type AssistantMessage, type AssistantStep, AvatarBlock, type AvatarBlockProps, Banner, type BannerProps, type BannerTone, BlockImage, type BlockImageProps, type BlockKit, type BuildPrompt, type BuilderModule, CTABanner, type CTABannerProps, Callout, type CalloutProps, type CalloutVariant, type ColorToken, type Column, Columns, type ColumnsProps, ConnectionProvider, type ConnectionStatus, type ContactField, ContactForm, type ContactFormProps, Container, type ContainerProps, DataTable, DataTableBlock, type DataTableBlockColumn, type DataTableBlockProps, EmptyState, type ExportedModule, FAQ, type FAQProps, type FaqItem, FeatureGrid, type FeatureGridProps, type FeatureItem, type FirmArbiConfig, Footer, type FooterColumn, type FooterLink, type FooterProps, Gallery, type GalleryImage, type GalleryProps, GridView, type GridViewEmptyState, type GridViewProps, type GridViewSelection, Hero, type HeroCta, type HeroProps, type ImageFieldConfig, type ImageFieldFactory, LegalArbiProvider, ListBlock, type ListBlockProps, type ListItem, LiveDataProvider, type LoadResult, LogoCloud, type LogoCloudProps, type LogoItem, type MaterializeOptions, type MatterContext, MediaText, type MediaTextProps, MetricCard, type MetricCardProps, ModuleManager, type ModuleManagerProps, type ModuleRegistry, type ModuleStoreBundle, type NavLink, Navbar, type NavbarProps, PageHeader, PageRenderer, type PageRendererProps, type PersistVia, type PricingPlan, PricingTable, type PricingTableProps, type PromptConfig, type PromptLibrary, type Prompts, type ResolvedModule, RichTextBlock, type RichTextBlockProps, Section, SectionHeading, type SectionProps, Spacer, type SpacerProps, StatGroup, type StatGroupProps, type StatItem, type StepItem, Steps, type StepsProps, StudioEditor, type StudioEditorProps, type StudioPageMeta, type StudioPersistence, type StudioPersistenceConfig, THEME_STYLE_ID, type TabItem, Tabs, type TabsProps, TeamGrid, type TeamGridProps, type TeamMember, Testimonial, TestimonialGrid, type TestimonialGridProps, type TestimonialItem, type TestimonialProps, type ThemeBundle, ThemeEditor, type ThemeEditorProps, type ThemeEmitMode, type ThemeFonts, type ThemePreset, type ThemeState, type ThemeStoreConfig, type ThemeTokens, Toolbar, type UseImageGen, VerticalBuilder, type VerticalBuilderProps, type VerticalConfig, type VerticalExport, type VerticalExportConfig, type VideoAspect, VideoEmbed, type VideoEmbedProps, WidgetPlaceholder, applyStoredTheme, applyThemeVars, asAssetRef, assetRefId, clearThemeVars, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createLiveWidgets, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createThemeStore, createVerticalExport, createWebsiteBlocks, daysUntil, fmtDate, fmtDateTime, fromNow, gbp, hrs, iconMap, initials, isAssetRef, isAuthenticated, materializePageData, matterToContext, pct, tid, toEmbedUrl, toHslTriplet, useAssetResolverActive, useConnection, useFirmAiTask, useImageGen, useLiveDataActive, useSemanticSearch, useWorkspaceDocs };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import { AiRunOptions, useArbi, AiTaskStatus } from '@arbidocs/react';
6
6
  export { AiRunOptions, AiTaskStatus, ArtifactEvent, SearchChunk, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, redlineStats, textToArtifact, toRedlineMarkdown } from '@arbidocs/react';
7
7
  import { ColDef, GridOptions, GridApi, CellValueChangedEvent, GridState } from 'ag-grid-community';
8
8
  import { LucideIcon } from 'lucide-react';
9
- import { Data, Config, CustomField, Field, ComponentConfig } from '@measured/puck';
9
+ import { CustomField, Field, ComponentConfig, Data, Config } from '@measured/puck';
10
10
 
11
11
  /**
12
12
  * The reusable AI-native law-firm prompt library.
@@ -1082,6 +1082,31 @@ interface AppNavSection {
1082
1082
  items: AppNavItem[];
1083
1083
  }
1084
1084
 
1085
+ interface AppShellProps {
1086
+ /** Nav sections to render (already filtered/ordered by the app). */
1087
+ sections: AppNavSection[];
1088
+ /** Footer nav items pinned to the bottom of the sidebar (e.g. Settings). */
1089
+ footerItems?: AppNavItem[];
1090
+ /** Brand mark shown in the sidebar header. */
1091
+ logo?: ReactNode;
1092
+ /** Where the logo links to (omit to render the logo without a link). */
1093
+ logoHref?: string;
1094
+ logoLabel?: string;
1095
+ /** Extra content below the footer nav (e.g. a connection-status pill). */
1096
+ sidebarFooter?: ReactNode;
1097
+ /** Topbar content, rendered to the right of the mobile hamburger. */
1098
+ topbar?: ReactNode;
1099
+ /** Optional docked panel on the far right (e.g. an AI chat rail). */
1100
+ rightRail?: ReactNode;
1101
+ /** Main scroll region content (typically a router `<Outlet/>` wrapper). */
1102
+ children: ReactNode;
1103
+ /** Extra classes for the `<main>` scroll region (e.g. a slim-scrollbar util). */
1104
+ mainClassName?: string;
1105
+ /** Testid namespace for the shell/topbar/sidebar. Default "app". */
1106
+ testIdPrefix?: string;
1107
+ }
1108
+ declare function AppShell({ sections, footerItems, logo, logoHref, logoLabel, sidebarFooter, topbar, rightRail, children, mainClassName, testIdPrefix, }: AppShellProps): react.JSX.Element;
1109
+
1085
1110
  /**
1086
1111
  * Shared studio types — the persistence contract, page metadata and the AI
1087
1112
  * prompt-builder signature the firm supplies. Firm-agnostic: a firm app wires
@@ -1113,6 +1138,12 @@ interface StudioPersistence {
1113
1138
  */
1114
1139
  savePublished: (arbi: Arbi | null, live: boolean, slug: string, data: unknown) => Promise<PersistVia>;
1115
1140
  loadPublished: <T>(arbi: Arbi | null, live: boolean, slug: string) => Promise<LoadResult<T>>;
1141
+ /**
1142
+ * Delete a slug's stored authoring + published pages (backend and localStorage
1143
+ * mirror). Lets a page be reset to empty; also the deterministic-reset hook a
1144
+ * test/demo needs, since backend content otherwise wins over a fresh seed.
1145
+ */
1146
+ deletePage: (arbi: Arbi | null, live: boolean, slug: string) => Promise<void>;
1116
1147
  saveTheme: (arbi: Arbi | null, live: boolean, theme: unknown) => Promise<PersistVia>;
1117
1148
  loadTheme: <T>(arbi: Arbi | null, live: boolean) => Promise<LoadResult<T>>;
1118
1149
  }
@@ -1123,6 +1154,95 @@ type BuildPrompt = (a: {
1123
1154
  current: string;
1124
1155
  }) => string;
1125
1156
 
1157
+ interface AiFieldsConfig {
1158
+ /** The marketing workspace the AI grounds on. */
1159
+ workspaceId: string;
1160
+ /** Turns a field's kind/label/current text into an instruction. */
1161
+ buildPrompt: BuildPrompt;
1162
+ /** Default prompt kind when a field does not specify one. */
1163
+ defaultKind?: string;
1164
+ /** Testid namespace for the field + write button. */
1165
+ testIdPrefix?: string;
1166
+ }
1167
+ interface AiFields {
1168
+ aiText: (label: string, placeholder?: string) => CustomField<string>;
1169
+ aiTextarea: (label: string, placeholder?: string, kind?: string) => CustomField<string>;
1170
+ }
1171
+ declare function createAiFields(cfg: AiFieldsConfig): AiFields;
1172
+
1173
+ /**
1174
+ * Shared field helpers for the block registry. Every block config — the built-ins
1175
+ * in {@link createArbiBlocksConfig} and the website blocks in
1176
+ * {@link file://./websiteBlocks.tsx} — builds its Puck fields from this one kit so
1177
+ * the AI-or-plain copy fallback, the icon `select`, the tone/bool radios and the
1178
+ * stable render-time testid are declared once.
1179
+ */
1180
+
1181
+ declare const iconMap: Record<string, LucideIcon>;
1182
+ /** The bundle of field helpers a block config needs. */
1183
+ interface BlockKit {
1184
+ /** Single-line copy: AI-authorable when a firm supplies aiFields, else plain text. */
1185
+ textField: (label: string, placeholder?: string) => Field;
1186
+ /** Multi-line copy: AI-authorable when a firm supplies aiFields, else plain textarea. */
1187
+ textareaField: (label: string, placeholder?: string, kind?: string) => Field;
1188
+ /** Image source: a workspace-asset picker when a firm supplies imageField, else a URL input. */
1189
+ imageField: (label: string) => Field;
1190
+ /** A Yes/No radio. */
1191
+ boolRadio: (label: string) => Field;
1192
+ /** A `select` over {@link iconMap} names. */
1193
+ iconField: (label?: string) => Field;
1194
+ /** Resolve an icon name to its Lucide component. */
1195
+ resolveIcon: (name?: string) => LucideIcon | undefined;
1196
+ /** Stable, e2e-locatable testid derived from a block's Puck id. */
1197
+ blockTestId: (id: string) => string;
1198
+ /**
1199
+ * Optional firm override for the eyebrow style on heading-bearing blocks
1200
+ * (Hero, Section heading). Lets a consumer render a brand accent (e.g. a brass
1201
+ * eyebrow) without forking the blocks. Undefined → the default token classes.
1202
+ */
1203
+ eyebrowClassName?: string;
1204
+ }
1205
+ /** Build the shared field helpers, closing over the firm's optional AI + image fields. */
1206
+ declare function createBlockKit(ai?: AiFields, image?: (label: string) => Field, eyebrowClassName?: string): BlockKit;
1207
+
1208
+ /**
1209
+ * Live-widget block factory for @arbidocs/blocks.
1210
+ *
1211
+ * Mirrors the other `create*Blocks` factories: it only WIRES pre-built block
1212
+ * components (from {@link ./liveWidgetRuntime}) into Puck `ComponentConfig`s, so
1213
+ * it exports a single function and defines no components of its own — keeping it
1214
+ * fast-refresh clean. The blocks gate on the live-data flag ({@link ./liveData}),
1215
+ * rendering real ARBI data inside an authenticated app tree and a placeholder in
1216
+ * the editor/public. They read the SHARED `@arbidocs/react` hooks, so any client
1217
+ * with an ARBI workspace gets them; a client supplies only *composition* via
1218
+ * `createArbiBlocksConfig({ liveWidgets: true })`.
1219
+ */
1220
+
1221
+ /**
1222
+ * Build the live-widget block set, closing over the shared {@link BlockKit} for
1223
+ * stable testids. Registered under a "Widgets" category when a consumer opts in
1224
+ * with `createArbiBlocksConfig({ liveWidgets: true })`.
1225
+ */
1226
+ declare function createLiveWidgets(kit: BlockKit): Record<string, ComponentConfig>;
1227
+
1228
+ /** Marks the subtree as an authenticated app tree, so live widgets resolve data. */
1229
+ declare function LiveDataProvider({ children }: {
1230
+ children: ReactNode;
1231
+ }): react.JSX.Element;
1232
+ /**
1233
+ * What a live widget shows when it can't (or shouldn't) resolve data: a labelled,
1234
+ * dashed card. Used in the Studio canvas and the public renderer so authoring a
1235
+ * dashboard is WYSIWYG-ish without leaking live back-office data.
1236
+ */
1237
+ declare function WidgetPlaceholder({ label, icon: Icon, testId, }: {
1238
+ label: string;
1239
+ icon?: LucideIcon;
1240
+ testId?: string;
1241
+ }): react.JSX.Element;
1242
+
1243
+ /** Whether live widgets may resolve backend data here (false in editor/public). */
1244
+ declare function useLiveDataActive(): boolean;
1245
+
1126
1246
  /**
1127
1247
  * Publish-time asset materialization.
1128
1248
  *
@@ -1174,6 +1294,13 @@ interface StudioEditorProps {
1174
1294
  live: boolean;
1175
1295
  initialSlug?: string;
1176
1296
  testIdPrefix?: string;
1297
+ /**
1298
+ * Install a DEV-only `window.__studioResetSlug(slug)` hook that clears a slug's
1299
+ * stored page so a fresh seed governs the canvas. For tests/demos only — it can
1300
+ * delete pages, so keep it off in production (pass `import.meta.env.DEV`). The
1301
+ * package stays env-agnostic; the consumer owns the flag.
1302
+ */
1303
+ resetSeam?: boolean;
1177
1304
  /**
1178
1305
  * Optional sink for published image bytes. When omitted, publishing inlines
1179
1306
  * each asset as a `data:` URI (self-contained, no backend). Provide this to
@@ -1181,7 +1308,7 @@ interface StudioEditorProps {
1181
1308
  */
1182
1309
  publishAsset?: MaterializeOptions['publishAsset'];
1183
1310
  }
1184
- declare function StudioEditor({ config, pages, persistence, themeBundle, defaultTheme, brandLabel, backHref, backLabel, live, initialSlug, testIdPrefix, publishAsset, }: StudioEditorProps): react.JSX.Element;
1311
+ declare function StudioEditor({ config, pages, persistence, themeBundle, defaultTheme, brandLabel, backHref, backLabel, live, initialSlug, testIdPrefix, publishAsset, resetSeam, }: StudioEditorProps): react.JSX.Element;
1185
1312
 
1186
1313
  interface PageRendererProps {
1187
1314
  config: Config;
@@ -1194,8 +1321,27 @@ interface PageRendererProps {
1194
1321
  body: string;
1195
1322
  };
1196
1323
  testIdPrefix?: string;
1324
+ /**
1325
+ * Render inside a {@link LiveDataProvider}, so live-widget blocks resolve real
1326
+ * ARBI data. Only pass this when mounting the renderer INSIDE the authenticated
1327
+ * app tree (providers + a selected workspace present); on the public site leave
1328
+ * it off and widgets render placeholders.
1329
+ */
1330
+ liveData?: boolean;
1331
+ /**
1332
+ * Render this page verbatim instead of loading a slug from persistence — for an
1333
+ * in-code page (e.g. a config-authored in-app board) that isn't a published
1334
+ * studio document. The slug is ignored.
1335
+ */
1336
+ initialData?: Data;
1337
+ /**
1338
+ * Apply the persisted studio theme to the document (default true). Turn OFF for
1339
+ * an in-app renderer so it keeps the ambient app theme instead of repainting the
1340
+ * whole document with the marketing palette.
1341
+ */
1342
+ applyTheme?: boolean;
1197
1343
  }
1198
- declare function PageRenderer({ config, persistence, defaultTheme, live, slug: slugProp, emptyState, testIdPrefix, }: PageRendererProps): react.JSX.Element;
1344
+ declare function PageRenderer({ config, persistence, defaultTheme, live, slug: slugProp, emptyState, testIdPrefix, liveData, initialData, applyTheme, }: PageRendererProps): react.JSX.Element;
1199
1345
 
1200
1346
  interface StudioPersistenceConfig {
1201
1347
  /** The public marketing workspace that backs the site builder. */
@@ -1215,22 +1361,6 @@ interface StudioPersistenceConfig {
1215
1361
  }
1216
1362
  declare function createStudioPersistence(cfg: StudioPersistenceConfig): StudioPersistence;
1217
1363
 
1218
- interface AiFieldsConfig {
1219
- /** The marketing workspace the AI grounds on. */
1220
- workspaceId: string;
1221
- /** Turns a field's kind/label/current text into an instruction. */
1222
- buildPrompt: BuildPrompt;
1223
- /** Default prompt kind when a field does not specify one. */
1224
- defaultKind?: string;
1225
- /** Testid namespace for the field + write button. */
1226
- testIdPrefix?: string;
1227
- }
1228
- interface AiFields {
1229
- aiText: (label: string, placeholder?: string) => CustomField<string>;
1230
- aiTextarea: (label: string, placeholder?: string, kind?: string) => CustomField<string>;
1231
- }
1232
- declare function createAiFields(cfg: AiFieldsConfig): AiFields;
1233
-
1234
1364
  interface ImageFieldConfig {
1235
1365
  /** The workspace uploads/generations are saved to, and assets are picked from. */
1236
1366
  workspaceId: string;
@@ -1294,41 +1424,6 @@ interface SectionProps {
1294
1424
  }
1295
1425
  declare function Section({ children, tone, padding, maxWidth, texture, className, }: SectionProps): react.JSX.Element;
1296
1426
 
1297
- /**
1298
- * Shared field helpers for the block registry. Every block config — the built-ins
1299
- * in {@link createArbiBlocksConfig} and the website blocks in
1300
- * {@link file://./websiteBlocks.tsx} — builds its Puck fields from this one kit so
1301
- * the AI-or-plain copy fallback, the icon `select`, the tone/bool radios and the
1302
- * stable render-time testid are declared once.
1303
- */
1304
-
1305
- declare const iconMap: Record<string, LucideIcon>;
1306
- /** The bundle of field helpers a block config needs. */
1307
- interface BlockKit {
1308
- /** Single-line copy: AI-authorable when a firm supplies aiFields, else plain text. */
1309
- textField: (label: string, placeholder?: string) => Field;
1310
- /** Multi-line copy: AI-authorable when a firm supplies aiFields, else plain textarea. */
1311
- textareaField: (label: string, placeholder?: string, kind?: string) => Field;
1312
- /** Image source: a workspace-asset picker when a firm supplies imageField, else a URL input. */
1313
- imageField: (label: string) => Field;
1314
- /** A Yes/No radio. */
1315
- boolRadio: (label: string) => Field;
1316
- /** A `select` over {@link iconMap} names. */
1317
- iconField: (label?: string) => Field;
1318
- /** Resolve an icon name to its Lucide component. */
1319
- resolveIcon: (name?: string) => LucideIcon | undefined;
1320
- /** Stable, e2e-locatable testid derived from a block's Puck id. */
1321
- blockTestId: (id: string) => string;
1322
- /**
1323
- * Optional firm override for the eyebrow style on heading-bearing blocks
1324
- * (Hero, Section heading). Lets a consumer render a brand accent (e.g. a brass
1325
- * eyebrow) without forking the blocks. Undefined → the default token classes.
1326
- */
1327
- eyebrowClassName?: string;
1328
- }
1329
- /** Build the shared field helpers, closing over the firm's optional AI + image fields. */
1330
- declare function createBlockKit(ai?: AiFields, image?: (label: string) => Field, eyebrowClassName?: string): BlockKit;
1331
-
1332
1427
  interface ArbiBlocksConfigOptions {
1333
1428
  /**
1334
1429
  * Firm AI fields from {@link createAiFields}. When present, every string copy
@@ -1357,6 +1452,14 @@ interface ArbiBlocksConfigOptions {
1357
1452
  * heading) — e.g. a brand accent like a brass eyebrow. Undefined → token default.
1358
1453
  */
1359
1454
  eyebrowClassName?: string;
1455
+ /**
1456
+ * Register the live-widget blocks (a "Widgets" category) that read shared ARBI
1457
+ * hooks — Agent activity, Live metric. They render placeholders in the editor
1458
+ * and on the public site, resolving real data only inside an authenticated
1459
+ * in-app renderer (`PageRenderer liveData`). Opt-in so a pure marketing builder
1460
+ * doesn't surface back-office widgets.
1461
+ */
1462
+ liveWidgets?: boolean;
1360
1463
  }
1361
1464
 
1362
1465
  declare function createArbiBlocksConfig(opts?: ArbiBlocksConfigOptions): Config;
@@ -1550,4 +1653,4 @@ interface AgentsPanelProps {
1550
1653
  }
1551
1654
  declare function AgentsPanel({ store, testIdPrefix }: AgentsPanelProps): react.JSX.Element;
1552
1655
 
1553
- export { ASSET_REF_PREFIX, Accordion, type AccordionItem, type AccordionProps, type AgentSelectionStore, AgentsPanel, type AgentsPanelProps, type AiFields, type AiFieldsConfig, type AppNavItem, type AppNavSection, type ApplyThemeOptions, type ArbiBlocksConfigOptions, type ArbiMode, type ArbiUser, type AssetMaterializer, AssetResolverProvider, type AssistantCitation, type AssistantMessage, type AssistantStep, AvatarBlock, type AvatarBlockProps, Banner, type BannerProps, type BannerTone, BlockImage, type BlockImageProps, type BlockKit, type BuildPrompt, type BuilderModule, CTABanner, type CTABannerProps, Callout, type CalloutProps, type CalloutVariant, type ColorToken, type Column, Columns, type ColumnsProps, ConnectionProvider, type ConnectionStatus, type ContactField, ContactForm, type ContactFormProps, Container, type ContainerProps, DataTable, DataTableBlock, type DataTableBlockColumn, type DataTableBlockProps, EmptyState, type ExportedModule, FAQ, type FAQProps, type FaqItem, FeatureGrid, type FeatureGridProps, type FeatureItem, type FirmArbiConfig, Footer, type FooterColumn, type FooterLink, type FooterProps, Gallery, type GalleryImage, type GalleryProps, GridView, type GridViewEmptyState, type GridViewProps, type GridViewSelection, Hero, type HeroCta, type HeroProps, type ImageFieldConfig, type ImageFieldFactory, LegalArbiProvider, ListBlock, type ListBlockProps, type ListItem, type LoadResult, LogoCloud, type LogoCloudProps, type LogoItem, type MaterializeOptions, type MatterContext, MediaText, type MediaTextProps, MetricCard, type MetricCardProps, ModuleManager, type ModuleManagerProps, type ModuleRegistry, type ModuleStoreBundle, type NavLink, Navbar, type NavbarProps, PageHeader, PageRenderer, type PageRendererProps, type PersistVia, type PricingPlan, PricingTable, type PricingTableProps, type PromptConfig, type PromptLibrary, type Prompts, type ResolvedModule, RichTextBlock, type RichTextBlockProps, Section, SectionHeading, type SectionProps, Spacer, type SpacerProps, StatGroup, type StatGroupProps, type StatItem, type StepItem, Steps, type StepsProps, StudioEditor, type StudioEditorProps, type StudioPageMeta, type StudioPersistence, type StudioPersistenceConfig, THEME_STYLE_ID, type TabItem, Tabs, type TabsProps, TeamGrid, type TeamGridProps, type TeamMember, Testimonial, TestimonialGrid, type TestimonialGridProps, type TestimonialItem, type TestimonialProps, type ThemeBundle, ThemeEditor, type ThemeEditorProps, type ThemeEmitMode, type ThemeFonts, type ThemePreset, type ThemeState, type ThemeStoreConfig, type ThemeTokens, Toolbar, type UseImageGen, VerticalBuilder, type VerticalBuilderProps, type VerticalConfig, type VerticalExport, type VerticalExportConfig, type VideoAspect, VideoEmbed, type VideoEmbedProps, applyStoredTheme, applyThemeVars, asAssetRef, assetRefId, clearThemeVars, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createThemeStore, createVerticalExport, createWebsiteBlocks, daysUntil, fmtDate, fmtDateTime, fromNow, gbp, hrs, iconMap, initials, isAssetRef, isAuthenticated, materializePageData, matterToContext, pct, tid, toEmbedUrl, toHslTriplet, useAssetResolverActive, useConnection, useFirmAiTask, useImageGen, useSemanticSearch, useWorkspaceDocs };
1656
+ export { ASSET_REF_PREFIX, Accordion, type AccordionItem, type AccordionProps, type AgentSelectionStore, AgentsPanel, type AgentsPanelProps, type AiFields, type AiFieldsConfig, type AppNavItem, type AppNavSection, AppShell, type AppShellProps, type ApplyThemeOptions, type ArbiBlocksConfigOptions, type ArbiMode, type ArbiUser, type AssetMaterializer, AssetResolverProvider, type AssistantCitation, type AssistantMessage, type AssistantStep, AvatarBlock, type AvatarBlockProps, Banner, type BannerProps, type BannerTone, BlockImage, type BlockImageProps, type BlockKit, type BuildPrompt, type BuilderModule, CTABanner, type CTABannerProps, Callout, type CalloutProps, type CalloutVariant, type ColorToken, type Column, Columns, type ColumnsProps, ConnectionProvider, type ConnectionStatus, type ContactField, ContactForm, type ContactFormProps, Container, type ContainerProps, DataTable, DataTableBlock, type DataTableBlockColumn, type DataTableBlockProps, EmptyState, type ExportedModule, FAQ, type FAQProps, type FaqItem, FeatureGrid, type FeatureGridProps, type FeatureItem, type FirmArbiConfig, Footer, type FooterColumn, type FooterLink, type FooterProps, Gallery, type GalleryImage, type GalleryProps, GridView, type GridViewEmptyState, type GridViewProps, type GridViewSelection, Hero, type HeroCta, type HeroProps, type ImageFieldConfig, type ImageFieldFactory, LegalArbiProvider, ListBlock, type ListBlockProps, type ListItem, LiveDataProvider, type LoadResult, LogoCloud, type LogoCloudProps, type LogoItem, type MaterializeOptions, type MatterContext, MediaText, type MediaTextProps, MetricCard, type MetricCardProps, ModuleManager, type ModuleManagerProps, type ModuleRegistry, type ModuleStoreBundle, type NavLink, Navbar, type NavbarProps, PageHeader, PageRenderer, type PageRendererProps, type PersistVia, type PricingPlan, PricingTable, type PricingTableProps, type PromptConfig, type PromptLibrary, type Prompts, type ResolvedModule, RichTextBlock, type RichTextBlockProps, Section, SectionHeading, type SectionProps, Spacer, type SpacerProps, StatGroup, type StatGroupProps, type StatItem, type StepItem, Steps, type StepsProps, StudioEditor, type StudioEditorProps, type StudioPageMeta, type StudioPersistence, type StudioPersistenceConfig, THEME_STYLE_ID, type TabItem, Tabs, type TabsProps, TeamGrid, type TeamGridProps, type TeamMember, Testimonial, TestimonialGrid, type TestimonialGridProps, type TestimonialItem, type TestimonialProps, type ThemeBundle, ThemeEditor, type ThemeEditorProps, type ThemeEmitMode, type ThemeFonts, type ThemePreset, type ThemeState, type ThemeStoreConfig, type ThemeTokens, Toolbar, type UseImageGen, VerticalBuilder, type VerticalBuilderProps, type VerticalConfig, type VerticalExport, type VerticalExportConfig, type VideoAspect, VideoEmbed, type VideoEmbedProps, WidgetPlaceholder, applyStoredTheme, applyThemeVars, asAssetRef, assetRefId, clearThemeVars, createAgentSelectionStore, createAiFields, createArbiBlocksConfig, createArbiMaterializer, createBlockKit, createImageField, createLiveWidgets, createModuleRegistry, createModuleStore, createPromptLibrary, createSiteBlocks, createStudioPersistence, createThemeStore, createVerticalExport, createWebsiteBlocks, daysUntil, fmtDate, fmtDateTime, fromNow, gbp, hrs, iconMap, initials, isAssetRef, isAuthenticated, materializePageData, matterToContext, pct, tid, toEmbedUrl, toHslTriplet, useAssetResolverActive, useConnection, useFirmAiTask, useImageGen, useLiveDataActive, useSemanticSearch, useWorkspaceDocs };